commit 7e8f72fda15d353c9d88f21de7c2c65c7e6a10de Author: 赵鹏 Date: Mon Apr 28 15:52:49 2025 +0800 init diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e5c60ab --- /dev/null +++ b/.dockerignore @@ -0,0 +1,32 @@ +# Include any files or directories that you don't want to be copied to your +# container here (e.g., local build artifacts, temporary files, etc.). +# +# For more help, visit the .dockerignore file reference guide at +# https://docs.docker.com/go/build-context-dockerignore/ + +**/.DS_Store +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/bin +**/charts +**/docker-compose* +**/compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..3eb20a9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +[*.cs] + +# CS8603: 可能返回 null 引用。 +dotnet_diagnostic.CS8603.severity = none diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..4f2fd10 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.js linguist-language=c# \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..68bb0e2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,212 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +## TODO: Comment the next line if you want to checkin your +## web deploy settings but do note that will include unencrypted +## passwords +#*.pubxml + +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# LightSwitch generated files +GeneratedArtifacts/ +_Pvt_Extensions/ +ModelManifest.xml +Src/Asp.NetCore2/SqlSeverTest/.idea/ +.idea diff --git a/DependencyInjectionTest/Controllers/Class1.cs b/DependencyInjectionTest/Controllers/Class1.cs new file mode 100644 index 0000000..e581d0c --- /dev/null +++ b/DependencyInjectionTest/Controllers/Class1.cs @@ -0,0 +1,17 @@ +using ReZero.DependencyInjection; +using System.Runtime.InteropServices; + +namespace DependencyInjectionTest.Controllers +{ + public class Class1:IClass1, IScopeContract + { + public string? a { get; set; } = "a"; + } + public class Class2 : IScopeContract + { + public string? a2 { get; set; } = "a2"; + } + public interface IClass1 + { + } +} diff --git a/DependencyInjectionTest/Controllers/WeatherForecastController.cs b/DependencyInjectionTest/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..217f673 --- /dev/null +++ b/DependencyInjectionTest/Controllers/WeatherForecastController.cs @@ -0,0 +1,25 @@ +using Microsoft.AspNetCore.Mvc; +using ReZero.DependencyInjection; + +namespace DependencyInjectionTest.Controllers +{ + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + Class2 class2; + public WeatherForecastController(Class2 class2) + { + this.class2 = class2; + } + + + [HttpGet(Name = "GetWeatherForecast")] + public object Get() + { + var class1=DependencyResolver.GetHttpContextService(); + var class2 = DependencyResolver.GetHttpContextService(); + return class1.GetHashCode()+"_"+class2.GetHashCode() ; + } + } +} diff --git a/DependencyInjectionTest/DependencyInjectionTest.csproj b/DependencyInjectionTest/DependencyInjectionTest.csproj new file mode 100644 index 0000000..e5a5f5f --- /dev/null +++ b/DependencyInjectionTest/DependencyInjectionTest.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/DependencyInjectionTest/Program.cs b/DependencyInjectionTest/Program.cs new file mode 100644 index 0000000..fa607f0 --- /dev/null +++ b/DependencyInjectionTest/Program.cs @@ -0,0 +1,36 @@ +using DependencyInjectionTest.Controllers; +using ReZero; +using ReZero.DependencyInjection; +using System.Runtime.CompilerServices; +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); +// builder.Services.AddScoped(typeof(IClass1),typeof(Class1)); +//Register: Register the super API service +builder.Services.AddHttpContextAccessor(); +//ע᣺עᳬAPI +builder.Services.AddReZeroServices(new ReZeroOptions() +{ + DependencyInjectionOptions = new DependencyInjectionOptions(typeof(Program).Assembly) +}); +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/DependencyInjectionTest/Properties/launchSettings.json b/DependencyInjectionTest/Properties/launchSettings.json new file mode 100644 index 0000000..43ad36d --- /dev/null +++ b/DependencyInjectionTest/Properties/launchSettings.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:15186", + "sslPort": 44328 + } + }, + "profiles": { + "DependencyInjectionTest": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7035;http://localhost:5034", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/DependencyInjectionTest/WeatherForecast.cs b/DependencyInjectionTest/WeatherForecast.cs new file mode 100644 index 0000000..a16bb0d --- /dev/null +++ b/DependencyInjectionTest/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace DependencyInjectionTest +{ + public class WeatherForecast + { + public DateTime Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} diff --git a/DependencyInjectionTest/appsettings.Development.json b/DependencyInjectionTest/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/DependencyInjectionTest/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/DependencyInjectionTest/appsettings.json b/DependencyInjectionTest/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/DependencyInjectionTest/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2363cac --- /dev/null +++ b/Dockerfile @@ -0,0 +1,64 @@ +# syntax=docker/dockerfile:1 + +# Comments are provided throughout this file to help you get started. +# If you need more help, visit the Dockerfile reference guide at +# https://docs.docker.com/go/dockerfile-reference/ + +# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk7 + +################################################################################ + +# Learn about building .NET container images: +# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md + +# Create a stage for building the application. +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build + +COPY . /source + +WORKDIR /source/SuperAPI + +# This is the architecture you’re building for, which is passed in by the builder. +# Placing it here allows the previous steps to be cached across architectures. +ARG TARGETARCH + +# Build the application. +# Leverage a cache mount to /root/.nuget/packages so that subsequent builds don't have to re-download packages. +# If TARGETARCH is "amd64", replace it with "x64" - "x64" is .NET's canonical name for this and "amd64" doesn't +# work in .NET 6.0. +RUN --mount=type=cache,id=nuget,target=/root/.nuget/packages \ + dotnet publish -a ${TARGETARCH/amd64/x64} --use-current-runtime --self-contained false -o /app + +# If you need to enable globalization and time zones: +# https://github.com/dotnet/dotnet-docker/blob/main/samples/enable-globalization.md +################################################################################ +# Create a new stage for running the application that contains the minimal +# runtime dependencies for the application. This often uses a different base +# image from the build stage where the necessary files are copied from the build +# stage. +# +# The example below uses an aspnet alpine image as the foundation for running the app. +# It will also use whatever happens to be the most recent version of that tag when you +# build your Dockerfile. If reproducability is important, consider using a more specific +# version (e.g., aspnet:7.0.10-alpine-3.18), +# or SHA (e.g., mcr.microsoft.com/dotnet/aspnet@sha256:f3d99f54d504a21d38e4cc2f13ff47d67235efeeb85c109d3d1ff1808b38d034). +FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine AS final +WORKDIR /app + +# Copy everything needed to run the app from the "build" stage. +COPY --from=build /app . + +# Create a non-privileged user that the app will run under. +# See https://docs.docker.com/go/dockerfile-user-best-practices/ +ARG UID=10001 +RUN adduser \ + --disabled-password \ + --gecos "" \ + --home "/nonexistent" \ + --shell "/sbin/nologin" \ + --no-create-home \ + --uid "${UID}" \ + appuser +USER appuser + +ENTRYPOINT ["dotnet", "SuperAPITest.dll"] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..de98066 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 jacktang + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/NugetTest/.config/dotnet-tools.json b/NugetTest/.config/dotnet-tools.json new file mode 100644 index 0000000..677ed3f --- /dev/null +++ b/NugetTest/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-ef": { + "version": "8.0.4", + "commands": [ + "dotnet-ef" + ] + } + } +} \ No newline at end of file diff --git a/NugetTest/Controllers/WeatherForecastController.cs b/NugetTest/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..bc20a57 --- /dev/null +++ b/NugetTest/Controllers/WeatherForecastController.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Mvc; + +namespace NugetTest.Controllers +{ + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } + } +} diff --git a/NugetTest/NugetTest.csproj b/NugetTest/NugetTest.csproj new file mode 100644 index 0000000..492034d --- /dev/null +++ b/NugetTest/NugetTest.csproj @@ -0,0 +1,283 @@ + + + + net8.0 + enable + enable + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NugetTest/NugetTest.http b/NugetTest/NugetTest.http new file mode 100644 index 0000000..8fa45c8 --- /dev/null +++ b/NugetTest/NugetTest.http @@ -0,0 +1,6 @@ +@NugetTest_HostAddress = http://localhost:5094 + +GET {{NugetTest_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/NugetTest/Program.cs b/NugetTest/Program.cs new file mode 100644 index 0000000..e0ad1b9 --- /dev/null +++ b/NugetTest/Program.cs @@ -0,0 +1,65 @@ +using ReZero; +using ReZero.SuperAPI; +using System.Diagnostics; +using System.Reflection; +using System.Runtime.CompilerServices; + +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + + +//Register: Register the super API service +//ע᣺עᳬAPI +builder.Services.AddReZeroServices(api => +{ + //óAPI + //ؿɻjsonļ + var apiObj = SuperAPIOptions.GetOptions(); + + apiObj!.DependencyInjectionOptions = new DependencyInjectionOptions(Assembly.GetExecutingAssembly()); + //óAPI + api.EnableSuperApi(apiObj); + +}); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +#if !DEBUG +try + { + // Ӧóڱ5000˿ + string url = "http://localhost:5000/rezero/dynamic_interface.html?InterfaceCategoryId=200100"; + Process.Start(new ProcessStartInfo + { + FileName = url, + UseShellExecute = true + }); + } + catch (global::System.Exception) + { + //dockerвܴ + } +#endif +// ĬϵҳָURL + +app.Run(); diff --git a/NugetTest/Properties/PublishProfiles/FolderProfile.pubxml b/NugetTest/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 0000000..39b7a18 --- /dev/null +++ b/NugetTest/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,24 @@ + + + + + true + false + true + Release + Any CPU + FileSystem + bin\Release\net8.0\publish\ + FileSystem + <_TargetId>Folder + + net8.0 + win-x64 + ba1ad8c9-8aec-4e0e-9f68-fc0d1403731c + true + false + false + + \ No newline at end of file diff --git a/NugetTest/Properties/launchSettings.json b/NugetTest/Properties/launchSettings.json new file mode 100644 index 0000000..18c5002 --- /dev/null +++ b/NugetTest/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:30936", + "sslPort": 44372 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "rezero/dynamic_interface.html?InterfaceCategoryId=200100", + "applicationUrl": "http://localhost:5267", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "rezero/dynamic_interface.html?InterfaceCategoryId=200100", + "applicationUrl": "https://localhost:7101;http://localhost:5267", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "rezero", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/NugetTest/WeatherForecast.cs b/NugetTest/WeatherForecast.cs new file mode 100644 index 0000000..eab7310 --- /dev/null +++ b/NugetTest/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace NugetTest +{ + public class WeatherForecast + { + public DateOnly Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} diff --git a/NugetTest/appsettings.Development.json b/NugetTest/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/NugetTest/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/NugetTest/appsettings.json b/NugetTest/appsettings.json new file mode 100644 index 0000000..0c5839e --- /dev/null +++ b/NugetTest/appsettings.json @@ -0,0 +1,47 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + + "AllowedHosts": "*", + + "ReZero": { + "BasicDatabase": { + /* MySql,SqlServer,Sqlite,Oracle,PostgreSQL,Dm (达梦),Kdbndp(人大金仓默认模式) */ + "DbType": "Sqlite", + "ConnectionString": "datasource=rezero.db" + }, + "Ui": { + /*纯ReZero开发可以设为false,true用于兼容Swagger用户*/ + "ShowNativeApiDocument": false + }, + "Jwt": { + "Enable": false, //设置true会启用自带的jwt授权 + "Secret": "C0mPl3xS3cr3tK3yF0rJWT@DEVELOPMENT", + "UserTableName": "UserTable", //用户表的表名 (实体管理可以创建表,操作步骤:1.创建实体 2.同步生成表 ) + "UserNameFieldName": "username", //用户名字段 + "PasswordFieldName": "password", //密码字段 + "Expires": 1000, //分钟 + "Claim": [ // 数据库操作会用到Claim中的值作为条件 + { + "Key": "Id", //Claim Key + "FieldName": "Id", //用户表中的字段 + "Type": "long" //C#类型 + } + ], + //禁用系统接口, 设置为true将禁用所有系统接口(建表、建接口等) + "DisableSystemInterface": false + }, + "Cors": { + "Enable": true, //设置为true启动自带的跨域 + "PolicyName": "cors", + "Headers": [ "*" ], + "Methods": [ "*" ], + //可以跨域的地址 + "Origins": [ "http://localhost:52798", "http://localhost:5000" ] //可以配多个地址 + } + } +} diff --git a/README.Docker.md b/README.Docker.md new file mode 100644 index 0000000..092e4a3 --- /dev/null +++ b/README.Docker.md @@ -0,0 +1,24 @@ +### Building and running your application + +When you're ready, start your application by running: +`docker compose up --build`. + +Your application will be available at http://localhost:8080. + +### Deploying your application to the cloud + +First, build your image, e.g.: `docker build -t myapp .`. +If your cloud uses a different CPU architecture than your development +machine (e.g., you are on a Mac M1 and your cloud provider is amd64), +you'll want to build the image for that platform, e.g.: +`docker build --platform=linux/amd64 -t myapp .`. + +Then, push it to your registry, e.g. `docker push myregistry.com/myapp`. + +Consult Docker's [getting started](https://docs.docker.com/go/get-started-sharing/) +docs for more detail on building and pushing. + +### References +* [Docker's .NET guide](https://docs.docker.com/language/dotnet/) +* The [dotnet-docker](https://github.com/dotnet/dotnet-docker/tree/main/samples) + repository has many relevant samples and docs. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..258f62e --- /dev/null +++ b/README.md @@ -0,0 +1,174 @@ +# Rezero API 功能 +Rezero是一款.NET中间件,无需写代码也能实现CRUD,无破坏性,可以集成到任何.NET API项目,非.NET用户可以用发布好的exe文件 + +1、界面功能:创建接口 、建库、建表 、生成接口、设置授权、接口文档、调试接口等等都不需要写代码
+2、可以创建自已的用户表,而不是固定的表实现授权
+3、支持非.NET用户使用,比如你是前端 GO JAVA PHP也可以使用打包好的EXE +4、.NET6+的API项目都可以一行代码集成到自已项目中,对以前的逻辑没有破坏性
+5、.NET用户也可以用来构建API程序,支持模块化、授权、IOC(支持属性注入)、自动生成接口、ORM、工作单元、多租户等等
+ +## 1.1 官方文档 +https://www.donet5.com/Doc/32/2580 + +## 1.2 加群交流 +qq群号:472534707 + +## 1.3 功能截图 +### 创建接口 + +![输入图片说明](READMEIMG/image1.png) + +### 查看创建后的接口 + +![输入图片说明](READMEIMG/image5.png) + +### 在线调试接口 + +![输入图片说明](READMEIMG/232131.png) + +# 二、数据库支持 +Sqlite 、 MySql 、 SqlServer 、 PgSQL 、Oracle 、人大金仓(默认模式)、 达梦 + + +# 三、非.NET用户教程 +通过下载EXE运行 +https://gitee.com/DotNetNext/ReZero/releases + + +# 四、.NET用户教程 + +## 4.1 Nuget安装 +```cs +Rezero.Api +``` +## 4.2 一行代码配置 +新建一个.NET6+ WEB API +只需要注入一行代码就能使用 Rezero API + +```cs +/***对现有代码没有任何影响***/ + +//注册:注册超级API服务 +builder.Services.AddReZeroServices(api => +{ + //启用超级API + api.EnableSuperApi();//默认载体为sqlite ,有重载可以配置数据库 + +}); +//写在builder.Build前面就行只需要一行 +var app = builder.Build(); + +``` +## 4.3使用ReZero +启动项目直接访问地址就行了 +http://localhost:5267/rezero +![输入图片说明](READMEIMG/image8.png) + +## 4.4 授权 +打开appsettings.json配置jwt参数 +![输入图片说明](READMEIMG/55.png) +界面完成登录 +![输入图片说明](READMEIMG/56.png) + + +## 4.5 集成到自已系统 +只要在url加上model=small 就会隐藏头部菜单和左边的菜单
+如果跨域或者端口需要url加token这样可以让内部接口也支持jwt授权 +![输入图片说明](READMEIMG/image12.png) + +效果图如下 +![输入图片说明](READMEIMG/image9.png) + +## 4.6统一返回结果 +如果不喜欢默认返回格式我们可以自定义返回格式 + +```cs +//注册ReZero.Api +builder.Services.AddReZeroServices(api => +{ + + //有重载可换json文件 (断点看一下apiObj.DatabaseOptions.ConnectionConfig有没有字符串进来) + var apiObj = SuperAPIOptions.GetOptions("rezero.json"); + + .....省略........ + + //只看这一行 (不要new InterfaceOptions会把上面配置清空,尽量用apiObj.InterfaceOptions.xxx) + apiObj.InterfaceOptions.MergeDataToStandardDtoFunc=dto => + { + + if (dto is ErrorResponse error) + { + return new { isSuccess = false, data = error.message }; + } + else if (dto is bool b) + { + return new { isSuccess = b, data = b }; + } + //更多逻辑自已处理这儿只是一个示例 + return new { isSuccess = true, data = dto }; + }; + + + //启用超级API + api.EnableSuperApi(apiObj); + +}); + +``` +## 4.7 AOP实现日志记录 或者 授权(不用自带的JWT) + +```cs +//注册ReZero.Api +builder.Services.AddReZeroServices(api => +{ + //有重载可换json文件 + var apiObj = SuperAPIOptions.GetOptions(); + //IOC业务等所有需要的所有集程集 + apiObj!.DependencyInjectionOptions = new DependencyInjectionOptions(assemblyList); + apiObj.InterfaceOptions.SuperApiAop = new MyAop();//这一行配置AOP + //启用超级API + api.EnableSuperApi(apiObj); + +}); + +//自定义一个AOP类 +public class MyAop : DefaultSuperApiAop +{ + public override Task OnExecutingAsync(InterfaceContext context) + { + //也可以用AOP实现JWT授权,不用使自带的JWT授权,适用于已存在JWT的情况 + //JWT验证 + //context.AttachClaimToHttpContext("Claim", 1); + return base.OnExecutingAsync(context); + } +} +``` + + + +# 五、功能预览 +## 预览1:查询配置显示列 +![输入图片说明](READMEIMG/21.png) +## 预览2:查询配置联表 +![输入图片说明](READMEIMG/22.png) +## 预览3:SQL直接生成接口 +![输入图片说明](READMEIMG/656.png) +## 预览4:配置完显的接口列表 +![输入图片说明](READMEIMG/24.png) +## 预览5: 创建实体 +![输入图片说明](READMEIMG/25.png) +## 预览6: 更新表结构对比 +![输入图片说明](READMEIMG/26.png) + +# 六、打赏作者 + +首先感谢大家 , 项目启动前就有人赞助开发了 + +工作量很大 ,功能复杂 ,对标的是收费软件,相信未来将会成长的很好 + +坚持用开源做出高品质的免费软件 + +![输入图片说明](READMEIMG/image6.png) + +# 七、详细文档 +https://www.donet5.com/Doc/32/2580 diff --git a/READMEIMG/21.png b/READMEIMG/21.png new file mode 100644 index 0000000..bc38fc3 Binary files /dev/null and b/READMEIMG/21.png differ diff --git a/READMEIMG/22.png b/READMEIMG/22.png new file mode 100644 index 0000000..b2ee3db Binary files /dev/null and b/READMEIMG/22.png differ diff --git a/READMEIMG/23.png b/READMEIMG/23.png new file mode 100644 index 0000000..a59998c Binary files /dev/null and b/READMEIMG/23.png differ diff --git a/READMEIMG/232131.png b/READMEIMG/232131.png new file mode 100644 index 0000000..4a26088 Binary files /dev/null and b/READMEIMG/232131.png differ diff --git a/READMEIMG/24.png b/READMEIMG/24.png new file mode 100644 index 0000000..d1dcfa3 Binary files /dev/null and b/READMEIMG/24.png differ diff --git a/READMEIMG/25.png b/READMEIMG/25.png new file mode 100644 index 0000000..c3140a0 Binary files /dev/null and b/READMEIMG/25.png differ diff --git a/READMEIMG/26.png b/READMEIMG/26.png new file mode 100644 index 0000000..e227eb3 Binary files /dev/null and b/READMEIMG/26.png differ diff --git a/READMEIMG/55.png b/READMEIMG/55.png new file mode 100644 index 0000000..cae9a5f Binary files /dev/null and b/READMEIMG/55.png differ diff --git a/READMEIMG/56.png b/READMEIMG/56.png new file mode 100644 index 0000000..362497c Binary files /dev/null and b/READMEIMG/56.png differ diff --git a/READMEIMG/656.png b/READMEIMG/656.png new file mode 100644 index 0000000..bef4805 Binary files /dev/null and b/READMEIMG/656.png differ diff --git a/READMEIMG/88.png b/READMEIMG/88.png new file mode 100644 index 0000000..c9a3a1e Binary files /dev/null and b/READMEIMG/88.png differ diff --git a/READMEIMG/99.png b/READMEIMG/99.png new file mode 100644 index 0000000..0f95237 Binary files /dev/null and b/READMEIMG/99.png differ diff --git a/READMEIMG/image1.png b/READMEIMG/image1.png new file mode 100644 index 0000000..4427a6f Binary files /dev/null and b/READMEIMG/image1.png differ diff --git a/READMEIMG/image10.png b/READMEIMG/image10.png new file mode 100644 index 0000000..512a66c Binary files /dev/null and b/READMEIMG/image10.png differ diff --git a/READMEIMG/image11.png b/READMEIMG/image11.png new file mode 100644 index 0000000..512a66c Binary files /dev/null and b/READMEIMG/image11.png differ diff --git a/READMEIMG/image12.png b/READMEIMG/image12.png new file mode 100644 index 0000000..1ac40c8 Binary files /dev/null and b/READMEIMG/image12.png differ diff --git a/READMEIMG/image14.png b/READMEIMG/image14.png new file mode 100644 index 0000000..ef26b27 Binary files /dev/null and b/READMEIMG/image14.png differ diff --git a/READMEIMG/image15.png b/READMEIMG/image15.png new file mode 100644 index 0000000..ca5e3fa Binary files /dev/null and b/READMEIMG/image15.png differ diff --git a/READMEIMG/image16.png b/READMEIMG/image16.png new file mode 100644 index 0000000..a2abf16 Binary files /dev/null and b/READMEIMG/image16.png differ diff --git a/READMEIMG/image5.png b/READMEIMG/image5.png new file mode 100644 index 0000000..4105dde Binary files /dev/null and b/READMEIMG/image5.png differ diff --git a/READMEIMG/image6.png b/READMEIMG/image6.png new file mode 100644 index 0000000..838eebf Binary files /dev/null and b/READMEIMG/image6.png differ diff --git a/READMEIMG/image8.png b/READMEIMG/image8.png new file mode 100644 index 0000000..10318d6 Binary files /dev/null and b/READMEIMG/image8.png differ diff --git a/READMEIMG/image9.png b/READMEIMG/image9.png new file mode 100644 index 0000000..a35288c Binary files /dev/null and b/READMEIMG/image9.png differ diff --git a/ReZero.sln b/ReZero.sln new file mode 100644 index 0000000..fc9ce5b --- /dev/null +++ b/ReZero.sln @@ -0,0 +1,57 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34031.279 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{03B677B5-D24C-4A9C-B79B-E17F41CA1208}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReZero", "ReZero\ReZero.csproj", "{55D7478B-38DD-47A9-B1AA-4E7EAAF7DDC2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperAPITest", "SuperAPI\SuperAPITest.csproj", "{A04287D1-F1AF-4102-924A-A9EB3B9B7A66}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NugetTest", "NugetTest\NugetTest.csproj", "{BA1AD8C9-8AEC-4E0E-9F68-FC0D1403731C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TextTemplateTest", "TextTemplateTest\TextTemplateTest.csproj", "{EA58EB55-47DD-44FD-A12A-0231F97F06C5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DemoTest", "DemoTest", "{1032E893-22CF-4883-8857-049526541333}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DependencyInjectionTest", "DependencyInjectionTest\DependencyInjectionTest.csproj", "{E7355DEA-E652-4C6A-960C-CECF4B4EB673}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {55D7478B-38DD-47A9-B1AA-4E7EAAF7DDC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {55D7478B-38DD-47A9-B1AA-4E7EAAF7DDC2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {55D7478B-38DD-47A9-B1AA-4E7EAAF7DDC2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {55D7478B-38DD-47A9-B1AA-4E7EAAF7DDC2}.Release|Any CPU.Build.0 = Release|Any CPU + {A04287D1-F1AF-4102-924A-A9EB3B9B7A66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A04287D1-F1AF-4102-924A-A9EB3B9B7A66}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A04287D1-F1AF-4102-924A-A9EB3B9B7A66}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A04287D1-F1AF-4102-924A-A9EB3B9B7A66}.Release|Any CPU.Build.0 = Release|Any CPU + {BA1AD8C9-8AEC-4E0E-9F68-FC0D1403731C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA1AD8C9-8AEC-4E0E-9F68-FC0D1403731C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA1AD8C9-8AEC-4E0E-9F68-FC0D1403731C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA1AD8C9-8AEC-4E0E-9F68-FC0D1403731C}.Release|Any CPU.Build.0 = Release|Any CPU + {EA58EB55-47DD-44FD-A12A-0231F97F06C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EA58EB55-47DD-44FD-A12A-0231F97F06C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EA58EB55-47DD-44FD-A12A-0231F97F06C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EA58EB55-47DD-44FD-A12A-0231F97F06C5}.Release|Any CPU.Build.0 = Release|Any CPU + {E7355DEA-E652-4C6A-960C-CECF4B4EB673}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E7355DEA-E652-4C6A-960C-CECF4B4EB673}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E7355DEA-E652-4C6A-960C-CECF4B4EB673}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E7355DEA-E652-4C6A-960C-CECF4B4EB673}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {EA58EB55-47DD-44FD-A12A-0231F97F06C5} = {1032E893-22CF-4883-8857-049526541333} + {E7355DEA-E652-4C6A-960C-CECF4B4EB673} = {1032E893-22CF-4883-8857-049526541333} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C3ACCBAF-6C08-4037-A398-1D5A9188B7E9} + EndGlobalSection +EndGlobal diff --git a/ReZero/AssemblyModuleSetup/Initialization/ServiceLocator.cs b/ReZero/AssemblyModuleSetup/Initialization/ServiceLocator.cs new file mode 100644 index 0000000..d7ee1ca --- /dev/null +++ b/ReZero/AssemblyModuleSetup/Initialization/ServiceLocator.cs @@ -0,0 +1,12 @@ +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero +{ + internal class ServiceLocator + { + public static IServiceCollection? Services { get; set; } + } +} diff --git a/ReZero/AssemblyModuleSetup/Initialization/ZeroApiServiceCollectionExtensions.cs b/ReZero/AssemblyModuleSetup/Initialization/ZeroApiServiceCollectionExtensions.cs new file mode 100644 index 0000000..e6a1e56 --- /dev/null +++ b/ReZero/AssemblyModuleSetup/Initialization/ZeroApiServiceCollectionExtensions.cs @@ -0,0 +1,80 @@ +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Builder.Extensions; +using Microsoft.AspNetCore.Hosting; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.IdentityModel.Tokens; +using ReZero.DependencyInjection; +using ReZero.SuperAPI; +using System; +using System.Linq; +using System.Text; +namespace ReZero +{ + + public static partial class ReZeroServiceCollectionExtensions + { + + /// + /// Adds ReZero services to the specified . + /// + /// The to add the services to. + /// The to configure the services. + /// The modified . + public static IServiceCollection AddReZeroServices(this IServiceCollection services, ReZeroOptions options) + { + ServiceLocator.Services = services; + services.AddHttpContextAccessor(); + SuperAPIModule.Init(services, options); + AddDependencyInjection(options, options.SuperApiOptions); + DependencyInjectionModule.Init(services, options); + JwtInit(services, options); + return services; + } + + private static void JwtInit(IServiceCollection services, ReZeroOptions options) + { + var key = options.SuperApiOptions.InterfaceOptions?.Jwt?.Secret + ""; + if (string.IsNullOrEmpty(key)|| options.SuperApiOptions.InterfaceOptions?.Jwt?.Enable!=true) + { + return; + } + var keyBytes = Encoding.ASCII.GetBytes(key); + services.AddAuthentication(options => + { + options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; + options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; + }) + .AddJwtBearer(options => + { + options.TokenValidationParameters = new TokenValidationParameters + { + ValidateIssuer = false, + ValidateAudience = false, + ValidateLifetime = true, + ValidateIssuerSigningKey = true, + IssuerSigningKey = new SymmetricSecurityKey(keyBytes) + }; + }); + } + + public static IServiceCollection AddReZeroServices(this IServiceCollection services, Action superAPIOptions) + { + var options = new ReZeroOptions(); + ServiceLocator.Services = services; + superAPIOptions(options.SuperApiOptions); + return services.AddReZeroServices(options); + } + internal static void AddDependencyInjection(ReZeroOptions options, SuperAPIOptions superAPIOptions) + { + if (options.DependencyInjectionOptions?.Assemblies?.Any()!=true) + { + if (options.DependencyInjectionOptions == null) + { + options.DependencyInjectionOptions = new DependencyInjection.DependencyInjectionOptions(); + } + options.DependencyInjectionOptions!.Assemblies = superAPIOptions?.DependencyInjectionOptions?.Assemblies; + } + } + } +} \ No newline at end of file diff --git a/ReZero/AssemblyModuleSetup/Options/ReZeroOption.cs b/ReZero/AssemblyModuleSetup/Options/ReZeroOption.cs new file mode 100644 index 0000000..2eb017e --- /dev/null +++ b/ReZero/AssemblyModuleSetup/Options/ReZeroOption.cs @@ -0,0 +1,25 @@ +using ReZero.DependencyInjection; +using ReZero.SuperAPI; +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; + +namespace ReZero +{ + /// + /// Represents the options for the ReZero class. + /// + public class ReZeroOptions + { + /// + /// Gets or sets the options for the SuperAPI. + /// + public SuperAPIOptions SuperApiOptions { get; set; } = new SuperAPIOptions(); + + /// + /// Gets or sets the options for the DependencyInjection. + /// + public ReZero.DependencyInjection.DependencyInjectionOptions DependencyInjectionOptions { get; set; } = new ReZero.DependencyInjection.DependencyInjectionOptions(); + } +} diff --git a/ReZero/Common/AssemblyLoader.cs b/ReZero/Common/AssemblyLoader.cs new file mode 100644 index 0000000..e767d66 --- /dev/null +++ b/ReZero/Common/AssemblyLoader.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +namespace ReZero +{ + public static class AssemblyExtensions + { + public static Assembly[] GetAllDependentAssemblies(this Assembly rootAssembly, Func whereFunc) + { + var result= AssemblyLoader.GetAllDependentAssemblies(rootAssembly, whereFunc); + return result; + } + } + public class AssemblyLoader + { + public static Assembly[] GetAllDependentAssemblies(Assembly rootAssembly,Func whereFunc) + { + var visited = new HashSet(); + var assemblies = new List(); + CollectDependentAssemblies(rootAssembly, assemblies, visited, whereFunc); + return assemblies.ToArray(); + } + + private static void CollectDependentAssemblies(Assembly assembly, List assemblies, HashSet visited, Func whereFunc) + { + if (visited.Contains(assembly)) return; + + visited.Add(assembly); + assemblies.Add(assembly); + + foreach (var referencedAssemblyName in assembly.GetReferencedAssemblies()) + { + try + { + if (!whereFunc(referencedAssemblyName.FullName)) + { + continue; + } + Assembly referencedAssembly = Assembly.Load(referencedAssemblyName); + CollectDependentAssemblies(referencedAssembly, assemblies, visited,whereFunc); + } + catch (Exception) + { + // Ignore assemblies that cannot be loaded + } + } + } + } +} diff --git a/ReZero/Common/FileSugar.cs b/ReZero/Common/FileSugar.cs new file mode 100644 index 0000000..0177b9d --- /dev/null +++ b/ReZero/Common/FileSugar.cs @@ -0,0 +1,1005 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + +namespace ReZero.Common +{ + /// + /// ** 描述:文件公共类 + /// ** 创始时间:2010-2-28 + /// ** 修改时间:- + /// ** 修改人:sunkaixuan + /// ** 使用说明: + /// + public class FileSugar + { + #region 获取文件路并自动创建目录 + /// + /// 根据文件目录、编号、文件名生成文件路径,并且创建文件存放目录 + /// 格式为:/directory/code/filename + /// + /// + /// + /// + /// + /// + public string GetFiePathAndCreateDirectoryByCode(string directory, T code, string fileName) + { + if (directory == null) + { + throw new ArgumentNullException("FileSugar.GetCreatePath.directory"); + } + directory = directory.TrimEnd('/'); + string path = new StringBuilder("{0}//{1}//{2}").AppendFormat(directory, code, fileName).ToString(); + directory = Path.GetDirectoryName(path); + if (!IsExistDirectory(directory)) + { + CreateDirectory(directory); + } + return path; + } + /// + /// 根据文件目录、日期、文件名生成文件路径,并且创建文件存放目录 + /// 格式为:/directory/2015/01/01/filename + /// + /// + /// + /// + /// + /// + public string GetFiePathAndCreateDirectoryByDate(string directory, string fileName) + { + if (directory == null) + { + throw new ArgumentNullException("FileSugar.GetCreatePath.directory"); + } + directory = directory.TrimEnd('/'); + string path = new StringBuilder("{0}//{1}//{2}//{3}//{4}").AppendFormat(directory, DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, fileName).ToString(); + directory = Path.GetDirectoryName(path); + if (!IsExistDirectory(directory)) + { + CreateDirectory(directory); + } + return path; + } + #endregion + #region 获取缩略图名称 + public static string GetMinPic(string filename, int index) + { + string str = ""; + if (string.IsNullOrEmpty(filename)) + return str; + int nLastDot = filename.LastIndexOf("."); + if (nLastDot == -1) + return str; + str = filename.Substring(0, nLastDot) + "_" + index.ToString() + filename.Substring(nLastDot, filename.Length - nLastDot); + if (index == -1) + { + str = filename.Substring(0, nLastDot) + filename.Substring(nLastDot, filename.Length - nLastDot); + } + return str; + } + /// + /// 获取缩略图片路径 + /// + /// + /// + /// + /// + public static string GetMinPic(string dir, string filename, int index) + { + if (string.IsNullOrEmpty(filename)) + return ""; + if (index < 0) + index = 0; + string minPic = string.Empty; + minPic = string.Format("{0}_{1}{2}", Path.GetFileNameWithoutExtension(filename), index, Path.GetExtension(filename)); + if (!string.IsNullOrEmpty(dir)) + minPic = Path.Combine(dir, minPic); + return minPic; + } + #endregion + #region 字段定义 + /// + /// 同步标识 + /// + private static Object sync = new object(); + #endregion + #region 检测指定目录是否存在 + /// + /// 检测指定目录是否存在 + /// + /// 目录的绝对路径 + public static bool IsExistDirectory(string directoryPath) + { + return Directory.Exists(directoryPath); + } + #endregion + #region 检测指定文件是否存在 + /// + /// 检测指定文件是否存在,如果存在则返回true。 + /// + /// 文件的绝对路径 + public static bool IsExistFile(string filePath) + { + return File.Exists(filePath); + } + #endregion + #region 检测指定目录是否为空 + /// + /// 检测指定目录是否为空 + /// + /// 指定目录的绝对路径 + public static bool IsEmptyDirectory(string directoryPath) + { + try + { + //判断是否存在文件 + string[] fileNames = GetFileNames(directoryPath); + if (fileNames.Length > 0) + { + return false; + } + //判断是否存在文件夹 + string[] directoryNames = GetDirectories(directoryPath); + if (directoryNames.Length > 0) + { + return false; + } + return true; + } + catch (Exception ex) + { + throw ex; + } + } + #endregion + #region 检测指定目录中是否存在指定的文件 + /// + /// 检测指定目录中是否存在指定的文件,若要搜索子目录请使用重载方法. + /// + /// 指定目录的绝对路径 + /// 模式字符串,"*"代表0或N个字符,"?"代表1个字符。 + /// 范例:"Log*.xml"表示搜索所有以Log开头的Xml文件。 + public static bool Contains(string directoryPath, string searchPattern) + { + try + { + //获取指定的文件列表 + string[] fileNames = GetFileNames(directoryPath, searchPattern, false); + //判断指定文件是否存在 + if (fileNames.Length == 0) + { + return false; + } + else + { + return true; + } + } + catch (Exception ex) + { + throw ex; + } + } + /// + /// 检测指定目录中是否存在指定的文件 + /// + /// 指定目录的绝对路径 + /// 模式字符串,"*"代表0或N个字符,"?"代表1个字符。 + /// 范例:"Log*.xml"表示搜索所有以Log开头的Xml文件。 + /// 是否搜索子目录 + public static bool Contains(string directoryPath, string searchPattern, bool isSearchChild) + { + try + { + //获取指定的文件列表 + string[] fileNames = GetFileNames(directoryPath, searchPattern, true); + //判断指定文件是否存在 + if (fileNames.Length == 0) + { + return false; + } + else + { + return true; + } + } + catch (Exception ex) + { + throw ex; + } + } + #endregion + #region 创建一个目录 + /// + /// 创建一个目录 + /// + /// 目录的绝对路径 + public static void CreateDirectory(string directoryPath) + { + //如果目录不存在则创建该目录 + if (!IsExistDirectory(directoryPath)) + { + Directory.CreateDirectory(directoryPath); + } + } + #endregion + #region 创建文 件 + /// + /// 创建一个文件 + /// + /// 文件的绝对路径 + public static void CreateFile(string filePath) + { + try + { + //如果文件不存在则创建该文件 + if (!IsExistFile(filePath)) + { + //获取文件目录路径 + string directoryPath = GetDirectoryFromFilePath(filePath); + //如果文件的目录不存在,则创建目录 + CreateDirectory(directoryPath); + lock (sync) + { + //创建文件 + using (FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate)) + { + } + } + } + } + catch + { + } + } + #endregion + #region 创建一个文件,并将字节流写入文件 + /// + /// 创建一个文件,并将字节流写入文件。 + /// + /// 文件的绝对路径 + /// 二进制流数据 + public static void CreateFile(string filePath, byte[] buffer) + { + try + { + //如果文件不存在则创建该文件 + if (!IsExistFile(filePath)) + { + //获取文件目录路径 + string directoryPath = GetDirectoryFromFilePath(filePath); + //如果文件的目录不存在,则创建目录 + CreateDirectory(directoryPath); + //创建一个FileInfo对象 + System.IO.FileInfo file = new System.IO.FileInfo(filePath); + //创建文件 + using (FileStream fs = file.Create()) + { + //写入二进制流 + fs.Write(buffer, 0, buffer.Length); + } + } + } + catch + { + } + } + #endregion + #region 创建一个文件,并将字符串写入文件 + #region 重载1 + /// + /// 创建一个文件,并将字符串写入文件。 + /// + /// 文件的绝对路径 + /// 字符串数据 + public static void CreateFile(string filePath, string text) + { + CreateFile(filePath, text, Encoding.UTF8); + } + #endregion + #region 重载2 + /// + /// 创建一个文件,并将字符串写入文件。 + /// + /// 文件的绝对路径 + /// 字符串数据 + /// 字符编码 + public static void CreateFile(string filePath, string text, Encoding encoding) + { + try + { + //如果文件不存在则创建该文件 + if (!IsExistFile(filePath)) + { + //获取文件目录路径 + string directoryPath = GetDirectoryFromFilePath(filePath); + //如果文件的目录不存在,则创建目录 + CreateDirectory(directoryPath); + //创建文件 + System.IO.FileInfo file = new System.IO.FileInfo(filePath); + using (FileStream stream = file.Create()) + { + using (StreamWriter writer = new StreamWriter(stream, encoding)) + { + //写入字符串 + writer.Write(text); + //输出 + writer.Flush(); + } + } + } + } + catch + { + } + } + /// + /// 创建一个文件,并将字符串写入文件。 + /// + /// 文件的绝对路径 + /// 字符串数据 + /// 字符编码 + public static void CreateFileReplace(string filePath, string text, Encoding encoding) + { + try + { + //如果文件不存在则创建该文件 + //获取文件目录路径 + string directoryPath = GetDirectoryFromFilePath(filePath); + //如果文件的目录不存在,则创建目录 + CreateDirectory(directoryPath); + //创建文件 + System.IO.FileInfo file = new System.IO.FileInfo(filePath); + using (FileStream stream = file.Create()) + { + using (StreamWriter writer = new StreamWriter(stream, encoding)) + { + //写入字符串 + writer.Write(text); + //输出 + writer.Flush(); + } + } + } + catch + { + } + } + #endregion + #endregion + #region 从文件绝对路径中获取目录路径 + /// + /// 从文件绝对路径中获取目录路径 + /// + /// 文件的绝对路径 + public static string GetDirectoryFromFilePath(string filePath) + { + //实例化文件 + System.IO.FileInfo file = new System.IO.FileInfo(filePath); + //获取目录信息 + DirectoryInfo directory = file.Directory; + //返回目录路径 + return directory.FullName; + } + #endregion + #region 获取文本文件的行数 + /// + /// 获取文本文件的行数 + /// + /// 文件的绝对路径 + public static int GetLineCount(string filePath) + { + //创建流读取器 + using (StreamReader reader = new StreamReader(filePath)) + { + //行数 + int i = 0; + while (true) + { + //如果读取到内容就把行数加1 + if (reader.ReadLine() != null) + { + i++; + } + else + { + break; + } + } + //返回行数 + return i; + } + } + #endregion + #region 获取一个文件的长度 + /// + /// 获取一个文件的长度,单位为Byte + /// + /// 文件的绝对路径 + public static int GetFileSize(string filePath) + { + //创建一个文件对象 + System.IO.FileInfo fi = new System.IO.FileInfo(filePath); + //获取文件的大小 + return (int)fi.Length; + } + /// + /// 获取一个文件的长度,单位为KB + /// + /// 文件的路径 + public static double GetFileSizeByKB(string filePath) + { + //创建一个文件对象 + System.IO.FileInfo fi = new System.IO.FileInfo(filePath); + //获取文件的大小 + return Convert.ToDouble(Convert.ToDouble(fi.Length) / 1024); + } + /// + /// 获取一个文件的长度,单位为MB + /// + /// 文件的路径 + public static double GetFileSizeByMB(string filePath) + { + //创建一个文件对象 + System.IO.FileInfo fi = new System.IO.FileInfo(filePath); + //获取文件的大小 + return Convert.ToDouble(Convert.ToDouble(fi.Length) / 1024 / 1024); + } + #endregion + #region 获取指定目录中的文件列表 + /// + /// 获取指定目录中所有文件列表 + /// + /// 指定目录的绝对路径 + public static string[] GetFileNames(string directoryPath) + { + //如果目录不存在,则抛出异常 + if (!IsExistDirectory(directoryPath)) + { + throw new FileNotFoundException(); + } + //获取文件列表 + return Directory.GetFiles(directoryPath); + } + /// + /// 获取指定目录及子目录中所有文件列表 + /// + /// 指定目录的绝对路径 + /// 模式字符串,"*"代表0或N个字符,"?"代表1个字符。 + /// 范例:"Log*.xml"表示搜索所有以Log开头的Xml文件。 + /// 是否搜索子目录 + public static string[] GetFileNames(string directoryPath, string searchPattern, bool isSearchChild) + { + //如果目录不存在,则抛出异常 + if (!IsExistDirectory(directoryPath)) + { + throw new FileNotFoundException(); + } + try + { + if (isSearchChild) + { + return Directory.GetFiles(directoryPath, searchPattern, SearchOption.AllDirectories); + } + else + { + return Directory.GetFiles(directoryPath, searchPattern, SearchOption.TopDirectoryOnly); + } + } + catch (IOException ex) + { + throw ex; + } + } + #endregion + #region 获取指定目录中的子目录列表 + /// + /// 获取指定目录中所有子目录列表,若要搜索嵌套的子目录列表,请使用重载方法. + /// + /// 指定目录的绝对路径 + public static string[] GetDirectories(string directoryPath) + { + try + { + return Directory.GetDirectories(directoryPath); + } + catch (IOException ex) + { + throw ex; + } + } + /// + /// 获取指定目录及子目录中所有子目录列表 + /// + /// 指定目录的绝对路径 + /// 模式字符串,"*"代表0或N个字符,"?"代表1个字符。 + /// 范例:"Log*.xml"表示搜索所有以Log开头的Xml文件。 + /// 是否搜索子目录 + public static string[] GetDirectories(string directoryPath, string searchPattern, bool isSearchChild) + { + try + { + if (isSearchChild) + { + return Directory.GetDirectories(directoryPath, searchPattern, SearchOption.AllDirectories); + } + else + { + return Directory.GetDirectories(directoryPath, searchPattern, SearchOption.TopDirectoryOnly); + } + } + catch (IOException ex) + { + throw ex; + } + } + #endregion + #region 向文本文件写入内容 + /// + /// 向文本文件中写入内容 + /// + /// 文件的绝对路径 + /// 写入的内容 + public static void WriteText(string filePath, string text) + { + WriteText(filePath, text, Encoding.UTF8); + } + /// + /// 向文本文件中写入内容 + /// + /// 文件的绝对路径 + /// 写入的内容 + /// 编码 + public static void WriteText(string filePath, string text, Encoding encoding) + { + //向文件写入内容 + File.WriteAllText(filePath, text, encoding); + } + #endregion + #region 向文本文件的尾部追加内容 + /// + /// 向文本文件的尾部追加内容 + /// + /// 文件的绝对路径 + /// 写入的内容 + public static void AppendText(string filePath, string text) + { + //======= 追加内容 ======= + try + { + lock (sync) + { + //创建流写入器 + using (StreamWriter writer = new StreamWriter(filePath, true)) + { + writer.WriteLine(text); + } + } + } + catch + { + } + } + #endregion + #region 将现有文件的内容复制到新文件中 + /// + /// 将源文件的内容复制到目标文件中 + /// + /// 源文件的绝对路径 + /// 目标文件的绝对路径 + public static void CopyTo(string sourceFilePath, string destFilePath) + { + //有效性检测 + if (!IsExistFile(sourceFilePath)) + { + return; + } + try + { + //检测目标文件的目录是否存在,不存在则创建 + string destDirectoryPath = GetDirectoryFromFilePath(destFilePath); + CreateDirectory(destDirectoryPath); + //复制文件 + System.IO.FileInfo file = new System.IO.FileInfo(sourceFilePath); + file.CopyTo(destFilePath, true); + } + catch + { + } + } + #endregion + #region 将文件移动到指定目录( 剪切 ) + /// + /// 将文件移动到指定目录( 剪切 ) + /// + /// 需要移动的源文件的绝对路径 + /// 移动到的目录的绝对路径 + public static void MoveToDirectory(string sourceFilePath, string descDirectoryPath) + { + //有效性检测 + if (!IsExistFile(sourceFilePath)) + { + return; + } + try + { + //获取源文件的名称 + string sourceFileName = GetFileName(sourceFilePath); + //如果目标目录不存在则创建 + CreateDirectory(descDirectoryPath); + //如果目标中存在同名文件,则删除 + if (IsExistFile(descDirectoryPath + "\\" + sourceFileName)) + { + DeleteFile(descDirectoryPath + "\\" + sourceFileName); + } + //目标文件路径 + string descFilePath; + if (!descDirectoryPath.EndsWith(@"\")) + { + descFilePath = descDirectoryPath + "\\" + sourceFileName; + } + else + { + descFilePath = descDirectoryPath + sourceFileName; + } + //将文件移动到指定目录 + File.Move(sourceFilePath, descFilePath); + } + catch + { + } + } + #endregion + #region 将文件移动到指定目录,并指定新的文件名( 剪切并改名 ) + /// + /// 将文件移动到指定目录,并指定新的文件名( 剪切并改名 ) + /// + /// 需要移动的源文件的绝对路径 + /// 目标文件的绝对路径 + public static void Move(string sourceFilePath, string descFilePath) + { + //有效性检测 + if (!IsExistFile(sourceFilePath)) + { + return; + } + try + { + //获取目标文件目录 + string descDirectoryPath = GetDirectoryFromFilePath(descFilePath); + //创建目标目录 + CreateDirectory(descDirectoryPath); + //将文件移动到指定目录 + File.Move(sourceFilePath, descFilePath); + } + catch + { + } + } + #endregion + #region 将流读取到缓冲区中 + /// + /// 将流读取到缓冲区中 + /// + /// 原始流 + public static byte[] StreamToBytes(Stream stream) + { + try + { + //创建缓冲区 + byte[] buffer = new byte[stream.Length]; + //读取流 + stream.Read(buffer, 0, Convert.ToInt32(stream.Length)); + //返回流 + return buffer; + } + catch (Exception ex) + { + throw ex; + } + finally + { + //关闭流 + stream.Close(); + } + } + #endregion + #region 将文件读取到缓冲区中 + /// + /// 将文件读取到缓冲区中 + /// + /// 文件的绝对路径 + public static byte[] FileToBytes(string filePath) + { + //获取文件的大小 + int fileSize = GetFileSize(filePath); + //创建一个临时缓冲区 + byte[] buffer = new byte[fileSize]; + //创建一个文件 + System.IO.FileInfo file = new System.IO.FileInfo(filePath); + //创建一个文件流 + using (FileStream fs = file.Open(FileMode.Open)) + { + //将文件流读入缓冲区 + fs.Read(buffer, 0, fileSize); + return buffer; + } + } + #endregion + #region 将文件读取到字符串中 + /// + /// 将文件读取到字符串中 + /// + /// 文件的绝对路径 + public static string FileToString(string filePath) + { + return FileToString(filePath, Encoding.UTF8); + } + /// + /// 将文件读取到字符串中 + /// + /// 文件的绝对路径 + /// 字符编码 + public static string FileToString(string filePath, Encoding encoding) + { + //创建流读取器 + StreamReader reader = new StreamReader(filePath, encoding); + try + { + //读取流 + return reader.ReadToEnd(); + } + catch (Exception ex) + { + throw ex; + } + finally + { + //关闭流读取器 + reader.Close(); + } + } + #endregion + #region 从文件的绝对路径中获取文件名( 包含扩展名 ) + /// + /// 从文件的绝对路径中获取文件名( 包含扩展名 ) + /// + /// 文件的绝对路径 + public static string GetFileName(string filePath) + { + //获取文件的名称 + System.IO.FileInfo fi = new System.IO.FileInfo(filePath); + return fi.Name; + } + #endregion + #region 从文件的绝对路径中获取文件名( 不包含扩展名 ) + /// + /// 从文件的绝对路径中获取文件名( 不包含扩展名 ) + /// + /// 文件的绝对路径 + public static string GetFileNameNoExtension(string filePath) + { + //获取文件的名称 + System.IO.FileInfo fi = new System.IO.FileInfo(filePath); + return fi.Name.Split('.')[0]; + } + #endregion + #region 从文件的绝对路径中获取扩展名 + /// + /// 从文件的绝对路径中获取扩展名 + /// + /// 文件的绝对路径 + public static string GetExtension(string filePath) + { + //获取文件的名称 + System.IO.FileInfo fi = new System.IO.FileInfo(filePath); + return fi.Extension; + } + #endregion + #region 清空指定目录 + /// + /// 清空指定目录下所有文件及子目录,但该目录依然保存. + /// + /// 指定目录的绝对路径 + public static void ClearDirectory(string directoryPath) + { + if (IsExistDirectory(directoryPath)) + { + //删除目录中所有的文件 + string[] fileNames = GetFileNames(directoryPath); + for (int i = 0; i < fileNames.Length; i++) + { + DeleteFile(fileNames[i]); + } + //删除目录中所有的子目录 + string[] directoryNames = GetDirectories(directoryPath); + for (int i = 0; i < directoryNames.Length; i++) + { + DeleteDirectory(directoryNames[i]); + } + } + } + #endregion + #region 清空文件内容 + /// + /// 清空文件内容 + /// + /// 文件的绝对路径 + public static void ClearFile(string filePath) + { + //删除文件 + File.Delete(filePath); + //重新创建该文件 + CreateFile(filePath); + } + #endregion + #region 删除指定文件 + /// + /// 删除指定文件 + /// + /// 文件的绝对路径 + public static void DeleteFile(string filePath) + { + if (IsExistFile(filePath)) + { + File.Delete(filePath); + } + } + #endregion + #region 删除指定目录 + /// + /// 删除指定目录及其所有子目录 + /// + /// 指定目录的绝对路径 + public static void DeleteDirectory(string directoryPath) + { + if (IsExistDirectory(directoryPath)) + { + Directory.Delete(directoryPath, true); + } + } + #endregion + #region 写文件 + /// + /// 写文件 + /// + /// + /// + public static void WriteFile(string strFilePath, string strValue) + { + System.IO.FileInfo oFile = new System.IO.FileInfo(strFilePath); + if (!oFile.Directory.Exists) + oFile.Directory.Create(); + if (!oFile.Exists) + oFile.Create().Close(); + System.IO.StreamWriter oWrite = new StreamWriter(strFilePath, false, System.Text.Encoding.UTF8); + oWrite.Write(strValue); + oWrite.Flush(); + oWrite.Close(); + } + /// + /// 写文件 + /// + /// + /// + /// + public static void WriteFile(string strFilePath, string strValue, string charset) + { + System.IO.FileInfo oFile = new System.IO.FileInfo(strFilePath); + if (!oFile.Directory.Exists) + oFile.Directory.Create(); + if (!oFile.Exists) + oFile.Create().Close(); + System.IO.StreamWriter oWrite = new StreamWriter(strFilePath, false, System.Text.Encoding.GetEncoding(charset)); + oWrite.Write(strValue); + oWrite.Flush(); + oWrite.Close(); + } + #endregion + #region 根据路径得到文件流 + /// + /// 根据路径得到文件流 + /// + /// + /// + public static byte[] GetFileSream(string Path) + { + byte[] buffer = null!; + using (FileStream stream = new System.IO.FileInfo(Path).OpenRead()) + { + buffer = new byte[stream.Length]; + stream.Read(buffer, 0, Convert.ToInt32(stream.Length)); + } + return buffer; + } + #endregion + #region 合并路径 + /// + /// 按数顺序合并URL + /// + /// + /// + public static string MergeUrl(params string[] urls) + { + if (urls == null || urls.Length == 0) + { + return null; + } + else if (urls.Length == 1) + { + urls = urls.Where(it => it != null).ToArray(); + return urls[0]; + } + else + { + urls = urls.Where(it => it != null).ToArray(); + } + StringBuilder reval = new StringBuilder(); + int i = 0; + char slash = '\\'; + if (!urls.Any(it => it.Contains(slash.ToString()))) + { + slash = '/'; + } + foreach (var url in urls) + { + string itUrl = url; + var isFirst = i == 0; + var isLast = i == urls.Length - 1; + if (!isFirst) + { + itUrl = itUrl.TrimStart(slash); + } + if (!isLast) + { + itUrl = url.TrimEnd(slash) + slash; + } + ++i; + reval.Append(itUrl); + itUrl = null!; + } + return GetRuntimeDirectory(reval.ToString()); + } + #endregion + #region 路径处理 + public static string GetRuntimeDirectory(string path) + { + //ForLinux + if (IsLinuxRunTime()) + return GetLinuxDirectory(path); + //ForWindows + if (IsWindowRunTime()) + return GetWindowDirectory(path); + return path; + } + + //OSPlatform.Windows监测运行环境 + public static bool IsWindowRunTime() + { + return System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Windows); + } + + //OSPlatform.Linux运行环境 + public static bool IsLinuxRunTime() + { + return System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Linux); + } + + public static string GetLinuxDirectory(string path) + { + string pathTemp = Path.Combine(path); + return pathTemp.Replace("\\", "/"); + } + public static string GetWindowDirectory(string path) + { + string pathTemp = Path.Combine(path); + return pathTemp.Replace("/", "\\"); + } + #endregion + } +} diff --git a/ReZero/Common/TypeExtensions.cs b/ReZero/Common/TypeExtensions.cs new file mode 100644 index 0000000..9347544 --- /dev/null +++ b/ReZero/Common/TypeExtensions.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero +{ + public static class TypeExtensions + { + public static Type GetNonNullableType(this Type type) + { + if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + return type.GetGenericArguments()[0]; + } + + // 如果类型不是 Nullable<>,则直接返回原类型 + return type; + } + } +} diff --git a/ReZero/Configuration/ApiConfiguration.cs b/ReZero/Configuration/ApiConfiguration.cs new file mode 100644 index 0000000..ac489bd --- /dev/null +++ b/ReZero/Configuration/ApiConfiguration.cs @@ -0,0 +1,87 @@ +using Microsoft.AspNetCore.Builder; +using Newtonsoft.Json.Linq; +using Newtonsoft.Json; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Text; +using System.Diagnostics; +namespace ReZero.Configuration +{ + public class ApiConfiguration + { + /// + /// 获取当前DLL文件的完整路径。 + /// + /// DLL文件的完整路径。 + public static string GetCurrentDllFullPath() + { + var assembly = Assembly.GetExecutingAssembly(); + return assembly.Location; + } + + // 获取当前执行程序(EXE)的完整路径 + public static string GetCurrentExeFullPath() + { + return Process.GetCurrentProcess().MainModule.FileName; + } + + // 获取当前执行程序(EXE)的目录 + public static string GetCurrentExeDirectory() + { + return Path.GetDirectoryName(GetCurrentExeFullPath()); + } + + /// + /// 从JSON文件中读取并反序列化指定键的值到泛型类型T。 + /// + /// 要反序列化的目标类型。 + /// JSON对象中的键。 + /// JSON文件的名称,默认为"appsettings.json"。如果文件位于DLL相同目录,则只需文件名;否则,需要提供完整路径。 + /// 反序列化后的对象。 + public static T GetJsonValue(string key, string fileName = "appsettings.json") + { + + string fullPath = Path.Combine(GetCurrentExeDirectory(), fileName); + if (!File.Exists(fullPath)) + { + // 获取DLL的目录路径 + string dllPath = Path.GetDirectoryName(GetCurrentDllFullPath()); + fullPath =Path.Combine(dllPath, fileName); + } + + // 读取JSON文件内容 + string jsonContent = File.ReadAllText(fullPath, Encoding.UTF8); + + try + { + // 解析JSON内容为JObject + JObject jsonObject = JObject.Parse(jsonContent); + + // 根据提供的键获取对应的JToken + JToken? token = jsonObject.SelectToken(key!); + + if (token != null) + { + // 将JToken反序列化为泛型类型T + return token.ToObject(); + } + else + { + throw new ArgumentException($"GetJsonValue<{typeof(T).Name}>() error。The specified key '{key}' was not found in the JSON file."); + } + } + catch (JsonReaderException ex) + { + throw new InvalidOperationException($"GetJsonValue<{typeof(T).Name}>() error。Error parsing JSON file at path: {fullPath}", ex); + } + catch (FileNotFoundException ex) + { + throw new FileNotFoundException($"GetJsonValue<{typeof(T).Name}>() error。The JSON file was not found at path: {fullPath}", ex); + } + } + } +} \ No newline at end of file diff --git a/ReZero/Configuration/ReZeroCors.cs b/ReZero/Configuration/ReZeroCors.cs new file mode 100644 index 0000000..7e7e427 --- /dev/null +++ b/ReZero/Configuration/ReZeroCors.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.Configuration +{ + + public class ReZeroCors + { + public bool Enable { get; set; } + public string? PolicyName { get; set; } + public string[]? Origins { get; set; } + public string[]? Headers { get; set; } + public string[]? Methods { get; set; } + public bool AllowCredentials { get; set; } + } +} diff --git a/ReZero/Configuration/ReZeroJson.cs b/ReZero/Configuration/ReZeroJson.cs new file mode 100644 index 0000000..bfc4f34 --- /dev/null +++ b/ReZero/Configuration/ReZeroJson.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace ReZero.Configuration +{ + public class ReZeroJson + { + public ReZeroUiBasicdatabase? BasicDatabase { get; set; } + public ReZeroJwt? Jwt { get; set; } + public ReZeroUi? Ui { get; set; } + public ReZeroCors? Cors { get; set; } + } + +} diff --git a/ReZero/Configuration/ReZeroJwt.cs b/ReZero/Configuration/ReZeroJwt.cs new file mode 100644 index 0000000..397ace3 --- /dev/null +++ b/ReZero/Configuration/ReZeroJwt.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.Configuration +{ + public class ReZeroJwt + { + public bool? Enable { get; set; } + public string? Secret { get; set; } + public string? UserTableName { get; set; } + public string? UserNameFieldName { get; set; } + public string? PasswordFieldName { get; set; } + public long? Expires { get; set; } + public List? Claim { get; set; } + public bool? DisableSystemInterface { get; set; } + } + + public class ClaimItem + { + public string? Key { get; set; } + public string? FieldName { get; set; } + public string? Type { get; set; } + } + +} diff --git a/ReZero/Configuration/ReZeroUi.cs b/ReZero/Configuration/ReZeroUi.cs new file mode 100644 index 0000000..758749b --- /dev/null +++ b/ReZero/Configuration/ReZeroUi.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.Configuration +{ + public class ReZeroUi + { + public bool ShowNativeApiDocument { get; set; } + public string? DefaultIndexSource { get; set; } + } +} diff --git a/ReZero/Configuration/ReZeroUiBasicdatabase.cs b/ReZero/Configuration/ReZeroUiBasicdatabase.cs new file mode 100644 index 0000000..fe5037f --- /dev/null +++ b/ReZero/Configuration/ReZeroUiBasicdatabase.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.Configuration +{ + public class ReZeroUiBasicdatabase + { + public SqlSugar.DbType DbType { get; set; } + public string? ConnectionString { get; set; } + } +} diff --git a/ReZero/DependencyInjection/ActivatorHelper.cs b/ReZero/DependencyInjection/ActivatorHelper.cs new file mode 100644 index 0000000..273a517 --- /dev/null +++ b/ReZero/DependencyInjection/ActivatorHelper.cs @@ -0,0 +1,39 @@ +using Newtonsoft.Json.Linq; +using ReZero.SuperAPI; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; + +namespace ReZero.DependencyInjection +{ + public class ActivatorHelper + { + /// + /// Create an instance of the specified class type. + /// + /// The type of the class to create an instance of. + /// Specifies whether to include non-public constructors. + /// The created instance of the class. + internal static object CreateInstance(Type classType, bool nonPublic, Microsoft.Extensions.DependencyInjection.ServiceProvider serviceProvider) + { + if (classType.GetCustomAttribute()!=null) + { + var p = serviceProvider; + var result= p!.GetService(classType); + var diProperties = classType.GetProperties().Where(it => it.GetCustomAttribute() != null); + foreach (var item in diProperties) + { + item.SetValue(result, p!.GetService(item.PropertyType)); + } + return result; + } + else + { + // If the class has no parameters in the constructor, directly instantiate the object + return Activator.CreateInstance(classType, nonPublic); + } + } + } +} diff --git a/ReZero/DependencyInjection/DIAttribute.cs b/ReZero/DependencyInjection/DIAttribute.cs new file mode 100644 index 0000000..3995088 --- /dev/null +++ b/ReZero/DependencyInjection/DIAttribute.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.DependencyInjection +{ + // 自定义的DI属性 + [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] + public class DIAttribute : Attribute + { + } +} diff --git a/ReZero/DependencyInjection/DependencyInjectionModule.cs b/ReZero/DependencyInjection/DependencyInjectionModule.cs new file mode 100644 index 0000000..ce933c1 --- /dev/null +++ b/ReZero/DependencyInjection/DependencyInjectionModule.cs @@ -0,0 +1,78 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; +using ReZero.SuperAPI; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +namespace ReZero.DependencyInjection +{ + public class DependencyInjectionModule + { + public static void Init(IServiceCollection services, ReZeroOptions options) + { + if (options.DependencyInjectionOptions?.Assemblies?.Any()!=true) + { + return; + } + var types = options.DependencyInjectionOptions.Assemblies.SelectMany(it=>it.GetTypes()).Where(type => !type.IsAbstract && !type.IsInterface); + foreach (var type in types) + { + var interfaces = type.GetInterfaces(); + var interfacesNoRezero = type.GetInterfaces().Where(it => !(it.FullName?.StartsWith("ReZero.")==true)); + if (type.GetCustomAttribute() != null) + { + InitApiType(services, type); + } + else + { + InitDefaultType(services, type, interfaces, interfacesNoRezero); + } + } + InitApiType(services, typeof(InternalInitApi)); + } + + private static void InitDefaultType(IServiceCollection services, Type type, Type[] interfaces, IEnumerable interfacesNoRezero) + { + if (type == null) + { + return; + } + if (type?.GetGenericArguments()?.Length > 0) + { + return; + } + foreach (var @interface in interfaces) + { + if (@interface == typeof(ITransientContract)) + { + services.AddTransient(type!, type!); + foreach (var item in interfacesNoRezero) + { + services.AddTransient(item, type!); + } + } + else if (@interface == typeof(IScopeContract)) + { + services.AddScoped(type!, type!); + foreach (var item in interfacesNoRezero) + { + services.AddScoped(item, type!); + } + } + else if (@interface == typeof(ISingletonContract)) + { + services.AddSingleton(type!, type!); + foreach (var item in interfacesNoRezero) + { + services.AddSingleton(item, type!); + } + } + } + } + private static void InitApiType(IServiceCollection services, Type type) + { + services.AddTransient(type, type); + } + } +} \ No newline at end of file diff --git a/ReZero/DependencyInjection/DependencyInjectionOptions.cs b/ReZero/DependencyInjection/DependencyInjectionOptions.cs new file mode 100644 index 0000000..d5c8695 --- /dev/null +++ b/ReZero/DependencyInjection/DependencyInjectionOptions.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; +using System.Linq; +namespace ReZero.DependencyInjection +{ + public class DependencyInjectionOptions + { + public Assembly[]? Assemblies { get; set; } + public bool InitDependencyInjection => Assemblies?.Any() == true; + public DependencyInjectionOptions(params Assembly[] assemblies) + { + if (this.InitDependencyInjection == false) + { + this.Assemblies = assemblies; + } + } + } +} diff --git a/ReZero/DependencyInjection/DependencyResolver.cs b/ReZero/DependencyInjection/DependencyResolver.cs new file mode 100644 index 0000000..f78d6f4 --- /dev/null +++ b/ReZero/DependencyInjection/DependencyResolver.cs @@ -0,0 +1,121 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using ReZero.SuperAPI; +using System; +using System.Collections.Generic; +using System.IdentityModel.Tokens.Jwt; +using System.Linq; +using System.Security.Claims; +using System.Text; + +namespace ReZero.DependencyInjection +{ + public class DependencyResolver + { + public static ServiceProvider Provider { get => ServiceLocator.Services!.BuildServiceProvider(); } + public static IHttpContextAccessor? httpContextAccessor = null; + public static ILogger? logger = null; + public static T GetService() where T : class + { + return Provider!.GetService(); + } + + public static ILogger GetLogger() + { + if (logger == null) + { + logger = ReZero.DependencyInjection.DependencyResolver.GetService>(); + } + return logger; + } + public static ClaimsPrincipal GetClaims() + { + if (httpContextAccessor == null) + { + if (Provider!.GetService()?.HttpContext == null) + { + throw new Exception("Requires builder.Services.AddHttpContextAccessor()"); + } + httpContextAccessor = Provider!.GetService(); + } + HttpContext httpContext = httpContextAccessor!.HttpContext; + var authHeader = httpContext.Request.Headers["Authorization"].FirstOrDefault(); + + if (authHeader != null && authHeader.StartsWith("Bearer ")) + { + var token = authHeader.Substring("Bearer ".Length).Trim(); + var handler = new JwtSecurityTokenHandler(); + + try + { + var jwtToken = handler.ReadJwtToken(token); + var claimsPrincipal = new ClaimsPrincipal(new ClaimsIdentity(jwtToken.Claims)); + return claimsPrincipal; + } + catch (Exception) + { + // Handle token parsing error + return null; + } + } + + return null; + } + public static T GetHttpContextService() where T : class + { + if (httpContextAccessor == null) + { + if (Provider!.GetService()?.HttpContext == null) + { + throw new Exception("Requires builder.Services.AddHttpContextAccessor()"); + } + httpContextAccessor = Provider!.GetService(); + } + return httpContextAccessor!.HttpContext!.RequestServices!.GetService(); + } + public static T GetHttpContextRequiredService() where T : class + { + if (httpContextAccessor == null) + { + if (Provider!.GetService()?.HttpContext == null) + { + throw new Exception("Requires builder.Services.AddHttpContextAccessor()"); + } + httpContextAccessor = Provider!.GetService(); + } + return httpContextAccessor!.HttpContext!.RequestServices!.GetRequiredService(); + } + public static T GetRequiredService() where T : class + { + return Provider?.GetRequiredService(); + } + public static T GetNewService() where T : class + { + using var scope = Provider?.CreateScope(); + return scope?.ServiceProvider?.GetService(); + } + public static T GetNewRequiredService() where T : class + { + using var scope = Provider?.CreateScope(); + return scope?.ServiceProvider?.GetRequiredService(); + } + public static string GetLoggedInUser() + { + var claimsPrincipal = GetClaims(); + if (claimsPrincipal == null) + { + return null; + } + + var usernameClaim = claimsPrincipal.Claims.FirstOrDefault(c => c.Type == "unique_name"); + if (usernameClaim == null) + { + return null; + } + + return usernameClaim.Value; ; + } + } +} diff --git a/ReZero/DependencyInjection/Interface/IDependencyInjection.cs b/ReZero/DependencyInjection/Interface/IDependencyInjection.cs new file mode 100644 index 0000000..f53f463 --- /dev/null +++ b/ReZero/DependencyInjection/Interface/IDependencyInjection.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.DependencyInjection +{ + public interface IDependencyInjection + { + } +} diff --git a/ReZero/DependencyInjection/Interface/IScopeContract.cs b/ReZero/DependencyInjection/Interface/IScopeContract.cs new file mode 100644 index 0000000..68e62cb --- /dev/null +++ b/ReZero/DependencyInjection/Interface/IScopeContract.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.DependencyInjection +{ + public interface IScopeContract: IDependencyInjection + { + } +} diff --git a/ReZero/DependencyInjection/Interface/ISingletonContract.cs b/ReZero/DependencyInjection/Interface/ISingletonContract.cs new file mode 100644 index 0000000..c413444 --- /dev/null +++ b/ReZero/DependencyInjection/Interface/ISingletonContract.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.DependencyInjection +{ + + public interface ISingletonContract: IDependencyInjection + { + } +} diff --git a/ReZero/DependencyInjection/Interface/ITransientContract.cs b/ReZero/DependencyInjection/Interface/ITransientContract.cs new file mode 100644 index 0000000..ce73ac4 --- /dev/null +++ b/ReZero/DependencyInjection/Interface/ITransientContract.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.DependencyInjection +{ + public interface ITransientContract: IDependencyInjection + { + } +} diff --git a/ReZero/DependencyInjection/PropertyInjectionAttribute.cs b/ReZero/DependencyInjection/PropertyInjectionAttribute.cs new file mode 100644 index 0000000..7b7ea8f --- /dev/null +++ b/ReZero/DependencyInjection/PropertyInjectionAttribute.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.DependencyInjection +{ + [AttributeUsage(AttributeTargets.Property)] + public class PropertyInjectionAttribute : Attribute + { + } +} diff --git a/ReZero/Excel/DataTableToExcel.cs b/ReZero/Excel/DataTableToExcel.cs new file mode 100644 index 0000000..aa96f72 --- /dev/null +++ b/ReZero/Excel/DataTableToExcel.cs @@ -0,0 +1,220 @@ +using System.Data; +using System.IO; +using System; +using ClosedXML.Excel; +using System.Linq; +using ReZero.SuperAPI; + +namespace ReZero.Excel +{ + public class DataTableToExcel + { + /// + /// 导出Excel + /// + /// + /// + /// + /// + public static byte[] ExportExcel(ExcelData[] dts, string name, int[]? widths = null,string? navName=null) + { + XLWorkbook wb = new XLWorkbook(); + + // 添加导航工作表 + var navigationSheet = wb.Worksheets.Add(TextHandler.GetCommonText("导航","Navigation")); + navigationSheet.Cell(1, 1).Value = TextHandler.GetCommonText(navName ?? "Sheet名称","Sheet Name"); + navigationSheet.Cell(1, 2).Value = TextHandler.GetCommonText("备注","Description"); // 可以添加其他信息,例如描述 + + int index = 0; + int navRowIndex = 2; // 导航工作表的行索引 + foreach (var data in dts) + { + var dt = data.DataTable!; + index++; + for (int i = 1; i < 15; i++) + { + // 删除Ignore列 + if (dt.Columns.Contains("Column" + i)) + { + dt.Columns.Remove("Column" + i); + } + } + var newdt = new DataTable(); + foreach (DataColumn item in dt.Columns) + { + newdt.Columns.Add(item.ColumnName); + } + foreach (DataRow item in dt.Rows) + { + DataRow dr = newdt.NewRow(); + foreach (DataColumn c in dt.Columns) + { + var value = item[c.ColumnName] + ""; + dr[c.ColumnName] = value; + } + newdt.Rows.Add(dr); + } + string sheetName; + try + { + sheetName = dt.TableName; + wb.Worksheets.Add(newdt, sheetName); + } + catch + { + if (dt.TableName.Length < 28) + { + sheetName = "_" + dt.TableName; + wb.Worksheets.Add(newdt, sheetName); + } + else + { + sheetName = dt.TableName.Substring(0, 25) + DateTime.Now.ToString("...") + index; + wb.Worksheets.Add(newdt, sheetName); + } + } + + var worksheet = wb.Worksheets.Last(); + foreach (var item in worksheet.Tables) + { + item.Theme = XLTableTheme.None; + } + // 处理列 + for (int i = 0; i < dt.Columns.Count; i++) + { + worksheet.Cell(1, i + 1).Value = dt.Columns[i].ColumnName; + } + // 处理列宽 + var colsWidth = dt.Columns.Cast().Select(it => 20).ToArray(); + if (widths != null) + { + colsWidth = widths; + } + for (int j = 1; j <= colsWidth.Length; j++) + { + worksheet.Columns(j, j).Width = colsWidth[j - 1]; + } + + // 在导航工作表中添加链接 + var navCell = navigationSheet.Cell(navRowIndex, 1); + navCell.Value = sheetName; + navCell.SetHyperlink(new XLHyperlink($"'{sheetName}'!A1")); + navCell.Style.Font.FontColor = XLColor.Blue; + navCell.Style.Font.Underline = XLFontUnderlineValues.Single; + navigationSheet.Cell(navRowIndex, 2).Value = data.TableDescrpition; + navRowIndex++; + } + + var minWidth = 50; + if (navigationSheet.Column(1).Width < minWidth) + { + navigationSheet.Column(1).Width = minWidth; + } + if (navigationSheet.Column(2).Width < minWidth) + { + navigationSheet.Column(2).Width = minWidth; + } + + // 缓存到内存流,然后返回 + byte[] bytes = null!; + using (MemoryStream stream = new MemoryStream()) + { + wb.SaveAs(stream); + bytes = stream.ToArray(); + } + return bytes; + } + + + /// + /// 导出Excel + /// + /// + /// + /// + /// + public static byte[] ExportExcel(DataSet dts, string name, int[]? widths = null, string? navName = null) + { + XLWorkbook wb = new XLWorkbook(); + + int index = 0; + foreach (DataTable data in dts.Tables) + { + var dt = data!; + index++; + for (int i = 1; i < 15; i++) + { + // 删除Ignore列 + if (dt.Columns.Contains("Column" + i)) + { + dt.Columns.Remove("Column" + i); + } + } + var newdt = new DataTable(); + foreach (DataColumn item in dt.Columns) + { + newdt.Columns.Add(item.ColumnName); + } + foreach (DataRow item in dt.Rows) + { + DataRow dr = newdt.NewRow(); + foreach (DataColumn c in dt.Columns) + { + var value = item[c.ColumnName] + ""; + dr[c.ColumnName] = value; + } + newdt.Rows.Add(dr); + } + string sheetName; + try + { + sheetName = dt.TableName; + wb.Worksheets.Add(newdt, sheetName); + } + catch + { + if (dt.TableName.Length < 28) + { + sheetName = "_" + dt.TableName; + wb.Worksheets.Add(newdt, sheetName); + } + else + { + sheetName = dt.TableName.Substring(0, 25) + DateTime.Now.ToString("...") + index; + wb.Worksheets.Add(newdt, sheetName); + } + } + + var worksheet = wb.Worksheets.Last(); + foreach (var item in worksheet.Tables) + { + item.Theme = XLTableTheme.None; + } + // 处理列 + for (int i = 0; i < dt.Columns.Count; i++) + { + worksheet.Cell(1, i + 1).Value = dt.Columns[i].ColumnName; + } + // 处理列宽 + var colsWidth = dt.Columns.Cast().Select(it => 20).ToArray(); + if (widths != null) + { + colsWidth = widths; + } + for (int j = 1; j <= colsWidth.Length; j++) + { + worksheet.Columns(j, j).Width = colsWidth[j - 1]; + } + + } + // 缓存到内存流,然后返回 + byte[] bytes = null!; + using (MemoryStream stream = new MemoryStream()) + { + wb.SaveAs(stream); + bytes = stream.ToArray(); + } + return bytes; + } + } +} \ No newline at end of file diff --git a/ReZero/Excel/ExcelData.cs b/ReZero/Excel/ExcelData.cs new file mode 100644 index 0000000..15bdce9 --- /dev/null +++ b/ReZero/Excel/ExcelData.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace ReZero.Excel +{ + + /// + /// Represents the Excel data. + /// + public class ExcelData + { + /// + /// Gets or sets the description of the table. + /// + public string? TableDescrpition { get; set; } + + /// + /// Gets or sets the DataTable. + /// + public DataTable? DataTable { get; set; } + } +} diff --git a/ReZero/ReZero.csproj b/ReZero/ReZero.csproj new file mode 100644 index 0000000..60247fd --- /dev/null +++ b/ReZero/ReZero.csproj @@ -0,0 +1,42 @@ + + + + netstandard2.1 + enable + 1.8.12 + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ReZero/Rezero.nuspec b/ReZero/Rezero.nuspec new file mode 100644 index 0000000..3574224 --- /dev/null +++ b/ReZero/Rezero.nuspec @@ -0,0 +1,25 @@ + + + + Rezero + 1.8.12 + sunkaixuan + 果糖大数据科技 + http://www.apache.org/licenses/LICENSE-2.0.html + https://github.com/sunkaixuan/Rezero + https://secure.gravatar.com/avatar/a82c03402497b2e58fd65038a3699b30 + false + rezero 核心库 (不包含UI) 无需代码只要界面点点就能生成接口、SQL生成接口、代码生成接口、低代码、热插拔、 文档地址: https://www.donet5.com/Doc/32/2580 + Copyright 2016 + 低代码 Zero 超级API API 导出文档 + + + + + + + + + + + \ No newline at end of file diff --git a/ReZero/RezeroApi.nuspec b/ReZero/RezeroApi.nuspec new file mode 100644 index 0000000..29f872e --- /dev/null +++ b/ReZero/RezeroApi.nuspec @@ -0,0 +1,27 @@ + + + + Rezero.Api + 1.8.12 + sunkaixuan + 果糖大数据科技 + http://www.apache.org/licenses/LICENSE-2.0.html + https://github.com/sunkaixuan/Rezero + https://secure.gravatar.com/avatar/a82c03402497b2e58fd65038a3699b30 + false + rezero api (包含UI) 无需代码只要界面点点就能生成接口、SQL生成接口、代码生成接口、低代码、热插拔、 文档地址: https://www.donet5.com/Doc/32/2580 + Copyright 2016 + 低代码 Zero 超级API API 导出文档 + + + + + + + + + + + + + \ No newline at end of file diff --git a/ReZero/SuperAPI/ApiDynamic/DynamicApiManager.cs b/ReZero/SuperAPI/ApiDynamic/DynamicApiManager.cs new file mode 100644 index 0000000..ae227da --- /dev/null +++ b/ReZero/SuperAPI/ApiDynamic/DynamicApiManager.cs @@ -0,0 +1,156 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Policy; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + public class DynamicApiManager : IDynamicApi + { + /// + /// Determines if the given URL is a valid API endpoint. + /// + /// The URL to check. + /// True if the URL is a valid API endpoint, false otherwise. + public bool IsApi(string url) + { + var db = App.Db; + var isAnyUrl = CacheManager.Instance.GetList() + .Any(it => + it!.Url!.ToLower() == url.ToLower()|| + (it.OriginalUrl!=null&&url.ToLower().StartsWith(it.OriginalUrl.ToLower())) + ); + return isAnyUrl; + } + + /// + /// Writes the response for the given HTTP context. + /// + /// The HTTP context. + public async Task WriteAsync(HttpContext context) + { + var helper = new DynamicApiHelper(); + var requestMethodString = context.Request.Method; + HttpRequestMethod requestMethod; + if (helper.IsHttpMethod(requestMethodString, out requestMethod)) + { + await WriteAsyncSuccess(context, helper, requestMethod); + } + else + { + await WriteError(context); + } + } + + /// + /// Writes the response for a successful API request. + /// + /// The HTTP context. + /// The dynamic API helper. + /// The HTTP request method. + private static async Task WriteAsyncSuccess(HttpContext context, DynamicApiHelper helper, HttpRequestMethod requestMethod) + { + var handler = helper.GetHandler(requestMethod, context); + var db = App.Db; + var path = context.Request.Path.ToString()?.ToLower(); + var interInfo = CacheManager + .Instance.GetList() + .Where(it => + it.Url!.ToLower() == path + || + (it.OriginalUrl != null && path!.ToLower().StartsWith(it.OriginalUrl.ToLower())) + )?.First(); + interInfo = db.Utilities.TranslateCopy(interInfo); + var dynamicInterfaceContext = new InterfaceContext() { InterfaceType = InterfaceType.DynamicApi, HttpContext = context, InterfaceInfo = interInfo }; + if (interInfo == null) + { + var message = TextHandler.GetCommonText($"未找到内置接口 {path} ,请在表ZeroInterfaceList中查询", $"No built-in interface {path} is found. Query in the table ZeroInterfaceList"); + context.Response.StatusCode = 500; + await context.Response.WriteAsync(message); + } + else + { + try + { + DataService dataService = new DataService(); + interInfo!.DataModel!.ApiId = interInfo.Id; + interInfo!.DataModel!.ResultType = interInfo.DataModel?.ResultType; + interInfo!.DataModel!.Sql = interInfo.DataModel?.Sql; + interInfo!.DataModel!.DataBaseId = interInfo.DataModel?.DataBaseId ?? 0; + dataService.BindHttpParameters.Bind(interInfo.DataModel, context, path, !string.IsNullOrEmpty(interInfo.OriginalUrl), interInfo); + dynamicInterfaceContext.DataModel = interInfo.DataModel; + var service = DependencyInjection.DependencyResolver.Provider; + dynamicInterfaceContext.ServiceProvider = service; + interInfo.DataModel!.ServiceProvider = service; + await SuperAPIModule._apiOptions!.InterfaceOptions!.SuperApiAop!.OnExecutingAsync(dynamicInterfaceContext); + await InstanceManager.AuthorizationAsync(context, dynamicInterfaceContext); + var data = await dataService.ExecuteAction(interInfo.DataModel!); + data = GetUserInfo(path, interInfo, data); + SetDataToAop(dynamicInterfaceContext, data); + await SuperAPIModule._apiOptions!.InterfaceOptions!.SuperApiAop!.OnExecutedAsync(dynamicInterfaceContext); + var resultModel = interInfo.CustomResultModel ?? new ResultModel(); + resultModel.OutPutData = interInfo.DataModel?.OutPutData; + data = new ResultService().GetResult(data!, resultModel); + if (IsNoSystemPublicApi(interInfo, context)) + data = SuperAPIModule._apiOptions?.InterfaceOptions?.MergeDataToStandardDtoFunc?.Invoke(data) ?? data; + var json = JsonHelper.SerializeObject(data, SuperAPIModule._apiOptions!.InterfaceOptions?.JsonSerializerSettings); + context.Response.ContentType = PubConst.DataSource_ApplicationJson; + await context.Response.WriteAsync(json); + } + catch (Exception ex) + { + ReZero.DependencyInjection.DependencyResolver.GetLogger().LogInformation(ex.Message); + object data = new ErrorResponse { message = ex.Message }; + if (IsNoSystemPublicApi(interInfo, context)) + data = SuperAPIModule._apiOptions?.InterfaceOptions?.MergeDataToStandardDtoFunc?.Invoke(data) ?? data; + context.Response.ContentType = PubConst.DataSource_ApplicationJson; + await context.Response.WriteAsync(JsonHelper.SerializeObject(data, SuperAPIModule._apiOptions!.InterfaceOptions?.JsonSerializerSettings)); + dynamicInterfaceContext.Exception = ex; + await SuperAPIModule._apiOptions!.InterfaceOptions!.SuperApiAop!.OnErrorAsync(dynamicInterfaceContext); + } + } + } + + private static bool IsNoSystemPublicApi(ZeroInterfaceList interInfo, HttpContext context) + { + var query = context.Request.Query; + var supportCustomDto = query.ContainsKey("supportCustomDto") && query["supportCustomDto"].ToString().ToLower() == "true"; + return ((interInfo.Url?.ToLower()?.StartsWith("/public/") != true) && interInfo.Id != InterfaceListInitializerProvider.GetTokenId) || supportCustomDto; + } + + private static void SetDataToAop(InterfaceContext dynamicInterfaceContext, object? data) + { + if (dynamicInterfaceContext.DataModel != null) + dynamicInterfaceContext.DataModel.Data = data; + } + + private static object? GetUserInfo(string? path, ZeroInterfaceList interInfo, object? data) + { + if (path == PubConst.Jwt_GetJwtInfo) + { + data = interInfo?.DataModel?.ClaimList; + if (interInfo?.DataModel?.ClaimList?.Any()!=true) + { + throw new Exception(TextHandler.GetCommonText("你没有启用JWT授权或者没有配置Claim", "You did not enable JWT authorization or did not configure Claim")); + } + } + return data; + } + + + /// + /// Writes the response for an invalid API request. + /// + /// The HTTP context. + private static async Task WriteError(HttpContext context) + { + context.Response.StatusCode = 400; // Bad Request + await context.Response.WriteAsync("Invalid request method"); + } + } +} diff --git a/ReZero/SuperAPI/ApiDynamic/Entities/ErrorResponse.cs b/ReZero/SuperAPI/ApiDynamic/Entities/ErrorResponse.cs new file mode 100644 index 0000000..d5036c2 --- /dev/null +++ b/ReZero/SuperAPI/ApiDynamic/Entities/ErrorResponse.cs @@ -0,0 +1,7 @@ +namespace ReZero.SuperAPI +{ + public class ErrorResponse + { + public string? message { get; set; } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/ApiDynamic/Entities/HandleResult.cs b/ReZero/SuperAPI/ApiDynamic/Entities/HandleResult.cs new file mode 100644 index 0000000..2e06d0f --- /dev/null +++ b/ReZero/SuperAPI/ApiDynamic/Entities/HandleResult.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class HandleResult + { + } +} diff --git a/ReZero/SuperAPI/ApiDynamic/Enum/HttpRequestMethod.cs b/ReZero/SuperAPI/ApiDynamic/Enum/HttpRequestMethod.cs new file mode 100644 index 0000000..01c49b0 --- /dev/null +++ b/ReZero/SuperAPI/ApiDynamic/Enum/HttpRequestMethod.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public enum HttpRequestMethod + { + GET, + POST, + PUT, + DELETE, + PATCH, + All + } +} diff --git a/ReZero/SuperAPI/ApiDynamic/Helper/DynamicApiHelper.cs b/ReZero/SuperAPI/ApiDynamic/Helper/DynamicApiHelper.cs new file mode 100644 index 0000000..07cfbaf --- /dev/null +++ b/ReZero/SuperAPI/ApiDynamic/Helper/DynamicApiHelper.cs @@ -0,0 +1,50 @@ +using Microsoft.AspNetCore.Http; +using System; + +namespace ReZero.SuperAPI +{ + /// + /// Helper class for handling API requests and determining appropriate request method handlers. + /// + internal class DynamicApiHelper + { + /// + /// Determines if the provided string represents a valid HTTP request method. + /// + /// The string representing the HTTP request method. + /// The parsed HttpRequestMethod enum value. + /// True if the string represents a valid HTTP request method; otherwise, false. + public bool IsHttpMethod(string requestMethodString, out HttpRequestMethod requestMethod) + { + // Try to parse the request method string into HttpRequestMethod enum. + return Enum.TryParse(requestMethodString, ignoreCase: true, out requestMethod); + } + + /// + /// Gets the appropriate request method handler based on the provided HTTP request method. + /// + /// The parsed HttpRequestMethod enum representing the HTTP request method. + /// The HttpContext associated with the request. + /// An instance of the appropriate request method handler. + public IRequestMethodHandler GetHandler(HttpRequestMethod method, HttpContext context) + { + // Determine the request method and return the corresponding handler. + switch (method) + { + case HttpRequestMethod.GET: + return new GetRequestHandler(context); + case HttpRequestMethod.POST: + return new PostRequestHandler(context); + case HttpRequestMethod.PUT: + return new PutRequestHandler(context); + case HttpRequestMethod.DELETE: + return new DeleteRequestHandler(context); + case HttpRequestMethod.PATCH: + return new PatchRequestHandler(context); + default: + // Throw an exception if the request method is not supported. + throw new NotSupportedException("Unsupported HTTP request method"); + } + } + } +} diff --git a/ReZero/SuperAPI/ApiDynamic/Interface/IApi.cs b/ReZero/SuperAPI/ApiDynamic/Interface/IApi.cs new file mode 100644 index 0000000..a1872f1 --- /dev/null +++ b/ReZero/SuperAPI/ApiDynamic/Interface/IApi.cs @@ -0,0 +1,9 @@ +using Microsoft.AspNetCore.Http; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + public interface IDynamicApi:ISuperApi + { + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/ApiDynamic/Interface/IRequestMethodHandler.cs b/ReZero/SuperAPI/ApiDynamic/Interface/IRequestMethodHandler.cs new file mode 100644 index 0000000..158933a --- /dev/null +++ b/ReZero/SuperAPI/ApiDynamic/Interface/IRequestMethodHandler.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public interface IRequestMethodHandler + { + HandleResult HandleRequest(); + } +} diff --git a/ReZero/SuperAPI/ApiDynamic/RequestHandler/DeleteRequestHandler.cs b/ReZero/SuperAPI/ApiDynamic/RequestHandler/DeleteRequestHandler.cs new file mode 100644 index 0000000..1b8c1ed --- /dev/null +++ b/ReZero/SuperAPI/ApiDynamic/RequestHandler/DeleteRequestHandler.cs @@ -0,0 +1,22 @@ +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class DeleteRequestHandler : IRequestMethodHandler + { + private HttpContext context; + + public DeleteRequestHandler(HttpContext context) + { + this.context = context; + } + + public HandleResult HandleRequest() + { + throw new NotImplementedException(); + } + } +} diff --git a/ReZero/SuperAPI/ApiDynamic/RequestHandler/GetRequestHandler.cs b/ReZero/SuperAPI/ApiDynamic/RequestHandler/GetRequestHandler.cs new file mode 100644 index 0000000..863c54e --- /dev/null +++ b/ReZero/SuperAPI/ApiDynamic/RequestHandler/GetRequestHandler.cs @@ -0,0 +1,22 @@ +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class GetRequestHandler : IRequestMethodHandler + { + private HttpContext context; + + public GetRequestHandler(HttpContext context) + { + this.context = context; + } + + public HandleResult HandleRequest() + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/ApiDynamic/RequestHandler/PatchRequestHandler .cs b/ReZero/SuperAPI/ApiDynamic/RequestHandler/PatchRequestHandler .cs new file mode 100644 index 0000000..0b521bc --- /dev/null +++ b/ReZero/SuperAPI/ApiDynamic/RequestHandler/PatchRequestHandler .cs @@ -0,0 +1,22 @@ +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class PatchRequestHandler : IRequestMethodHandler + { + private HttpContext context; + + public PatchRequestHandler(HttpContext context) + { + this.context = context; + } + + public HandleResult HandleRequest() + { + throw new NotImplementedException(); + } + } +} diff --git a/ReZero/SuperAPI/ApiDynamic/RequestHandler/PostRequestHandler.cs b/ReZero/SuperAPI/ApiDynamic/RequestHandler/PostRequestHandler.cs new file mode 100644 index 0000000..6d49a0f --- /dev/null +++ b/ReZero/SuperAPI/ApiDynamic/RequestHandler/PostRequestHandler.cs @@ -0,0 +1,24 @@ +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class PostRequestHandler : IRequestMethodHandler + { + private HttpContext context; + + public PostRequestHandler(HttpContext context) + { + this.context = context; + } + + + public HandleResult HandleRequest() + { + throw new NotImplementedException(); + } + } + +} diff --git a/ReZero/SuperAPI/ApiDynamic/RequestHandler/PutRequestHandler.cs b/ReZero/SuperAPI/ApiDynamic/RequestHandler/PutRequestHandler.cs new file mode 100644 index 0000000..46ba9c4 --- /dev/null +++ b/ReZero/SuperAPI/ApiDynamic/RequestHandler/PutRequestHandler.cs @@ -0,0 +1,22 @@ +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class PutRequestHandler : IRequestMethodHandler + { + private HttpContext context; + + public PutRequestHandler(HttpContext context) + { + this.context = context; + } + + public HandleResult HandleRequest() + { + throw new NotImplementedException(); + } + } +} diff --git a/ReZero/SuperAPI/ApiInternal/Interface/InternalApi.cs b/ReZero/SuperAPI/ApiInternal/Interface/InternalApi.cs new file mode 100644 index 0000000..7e8bfc3 --- /dev/null +++ b/ReZero/SuperAPI/ApiInternal/Interface/InternalApi.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + public interface IInternalApi : ISuperApi + { + } +} diff --git a/ReZero/SuperAPI/ApiInternal/InternalApi.cs b/ReZero/SuperAPI/ApiInternal/InternalApi.cs new file mode 100644 index 0000000..93e6e45 --- /dev/null +++ b/ReZero/SuperAPI/ApiInternal/InternalApi.cs @@ -0,0 +1,95 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Logging; +using SqlSugar; +using System; +using System.Linq; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + /// + /// Implementation of the ReZero API interface (IReZeroApi) to handle API-related operations. + /// + public class InternalApi : IInternalApi + { + /// + /// Checks if the provided URL corresponds to a ReZero API endpoint. + /// + /// The URL to be checked. + /// True if the URL is a ReZero API endpoint, otherwise false. + public bool IsApi(string url) + { + return url.ToString().ToLower().TrimStart('/')?.StartsWith(NamingConventionsConst.ApiReZeroRoute.ToLower()) == true; + } + + /// + /// Writes the API response asynchronously to the specified HttpContext. + /// + /// The HttpContext representing the current request and response context. + /// A Task representing the asynchronous operation. + public async Task WriteAsync(HttpContext context) + { + var db = App.Db; + + var path = context.Request.Path.ToString()?.ToLower(); + var interfaceInfos = db.Queryable().ToList(); + var interInfo = interfaceInfos.Where(it => it.Url!.ToLower() == path).FirstOrDefault(); + + if (interInfo == null) + { + var message = TextHandler.GetCommonText($"未找到内置接口 {path} ,请在表ZeroInterfaceList中查询", $"No built-in interface {path} is found. Query in the table ZeroInterfaceList"); + context.Response.StatusCode = 500; + await context.Response.WriteAsync(message); + } + else + { + var systemInterfaceContext = new InterfaceContext() { InterfaceType = InterfaceType.SystemApi, HttpContext = context, InterfaceInfo = interInfo }; + try + { + DataService dataService = new DataService(); + interInfo!.DataModel!.ApiId = interInfo.Id; + dataService.BindHttpParameters.Bind(interInfo.DataModel, context, path, !string.IsNullOrEmpty(interInfo.OriginalUrl), interInfo); + var service = DependencyInjection.DependencyResolver.Provider; + systemInterfaceContext.ServiceProvider = service; + interInfo!.DataModel!.ServiceProvider = service; + await SuperAPIModule._apiOptions!.InterfaceOptions!.SuperApiAop!.OnExecutingAsync(systemInterfaceContext); + await InstanceManager.AuthorizationAsync(context, systemInterfaceContext); + var data = await dataService.ExecuteAction(interInfo.DataModel ?? new DataModel() { }); + SetDataToAop(systemInterfaceContext, data); + await SuperAPIModule._apiOptions!.InterfaceOptions!.SuperApiAop!.OnExecutedAsync(systemInterfaceContext); + var resultModel = interInfo.CustomResultModel ?? new ResultModel(); + resultModel.OutPutData = interInfo.DataModel?.OutPutData; + data = new ResultService().GetResult(data, resultModel); + await Write(context, interInfo, data); + } + catch (Exception ex) + { + ReZero.DependencyInjection.DependencyResolver.GetLogger().LogInformation(ex.Message); + context.Response.ContentType = PubConst.DataSource_ApplicationJson; + await context.Response.WriteAsync(db.Utilities.SerializeObject(new { message = ex.Message })); + systemInterfaceContext.Exception = ex; + await SuperAPIModule._apiOptions!.InterfaceOptions!.SuperApiAop!.OnErrorAsync(systemInterfaceContext); ; + } + } + } + + private static void SetDataToAop(InterfaceContext systemInterfaceContext, object data) + { + if (systemInterfaceContext.DataModel != null) + systemInterfaceContext.DataModel.Data = data; + } + + private static async Task Write(HttpContext context, ZeroInterfaceList interInfo, object data) + { + if (interInfo.CustomResultModel?.ResultType == ResultType.File) + { + await InstanceManager.WriteFileAsync(context, interInfo, data); + } + else + { + context.Response.ContentType = PubConst.DataSource_ApplicationJson; + await context.Response.WriteAsync(JsonHelper.SerializeObject(data)); + } + } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/ApiProvider/Helper/InstanceManager.cs b/ReZero/SuperAPI/ApiProvider/Helper/InstanceManager.cs new file mode 100644 index 0000000..8d06c88 --- /dev/null +++ b/ReZero/SuperAPI/ApiProvider/Helper/InstanceManager.cs @@ -0,0 +1,145 @@ +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Http; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class InstanceManager + { + + public static async Task WriteFileAsync(HttpContext context, ZeroInterfaceList interInfo, object data) + { + var fileBytes = (byte[])data; + context.Response.ContentType = "application/octet-stream"; // Or the appropriate MIME type for your file + context.Response.ContentLength = fileBytes.Length; + var fileName = string.Format(interInfo!.CustomResultModel!.GroupName, DateTime.Now.ToString("yyyyMMddHHmmss")); + var contentDisposition = new ContentDispositionHeaderValue("attachment"); + contentDisposition.FileName = fileName; + context.Response.Headers.Add("Content-Disposition", contentDisposition.ToString()); + // Write the file bytes to the response body + await context.Response.Body.WriteAsync(fileBytes, 0, fileBytes.Length); + } + public static async Task AuthorizationAsync(HttpContext context, InterfaceContext dynamicInterfaceContext) + { + if (SuperAPIModule._apiOptions!.InterfaceOptions!.NoAuthorizationFunc != null) + { + if (SuperAPIModule._apiOptions!.InterfaceOptions!.NoAuthorizationFunc(dynamicInterfaceContext) == true) + { + return true; + } + } + if (SuperAPIModule._apiOptions?.InterfaceOptions?.Jwt?.Enable != true) + { + return true; + } + if (context.Request.Path.ToString()?.ToLower() == PubConst.Jwt_TokenUrl) + { + return true; + } + if (SuperAPIModule._apiOptions?.InterfaceOptions?.Jwt?.DisableSystemInterface == true) + { + if (dynamicInterfaceContext.InterfaceType == InterfaceType.SystemApi) + { + context.Response.StatusCode = 401; + throw new Exception(TextHandler.GetCommonText("系统接口被禁用无法访问,修改JWT参数DisableSystemInterface", "If the system interface is disabled and cannot be accessed, modify the JWT parameter DisableSystemInterface")); + } + } + var url = context.Request.Path.ToString().ToLower(); + if (url.StartsWith("/public/")) + { + return true; + } + var jsonClaims = SuperAPIModule._apiOptions?.InterfaceOptions?.Jwt.Claim ?? new List(); ; + var authHeader = context.Request.Headers["Authorization"].FirstOrDefault(); + if (authHeader != null && authHeader.StartsWith("Bearer ")) + { + var token = authHeader.Split(' ')[1]; + try + { + // 进行JWT令牌验证,例如使用Microsoft.AspNetCore.Authentication.JwtBearer包提供的验证器 + var authResult = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme); + if (authResult.Succeeded) + { + var claims = authResult.Principal.Claims.ToList(); + foreach (var claim in claims) + { + object value = claim.Value; + var type=jsonClaims.FirstOrDefault(it => claim.Type?.ToLower() == it.FieldName?.ToLower())?.Type; + if (!string.IsNullOrEmpty(type)) + { + value = UtilMethods.ConvertDataByTypeName(type,value+""); + } + dynamicInterfaceContext.AttachClaimToHttpContext(claim.Type, value); + } + if (claims.Any()) + { + var userName = claims[0].Value; + var list=CacheManager.Instance.GetList(); + if (list.Any()&& dynamicInterfaceContext?.InterfaceType==InterfaceType.DynamicApi) + { + var mappings=CacheManager.Instance.GetList(); + if (!mappings + .Where(it => it.UserName!.ToLower() == userName?.ToLower()) + .Where(it=> it.InterfaceId== dynamicInterfaceContext?.InterfaceInfo?.Id) + .Any()) + { + throw new Exception(TextHandler.GetCommonText("当前用户在【接口授权】中没有配置可以访问的接口权限 或者 清空所有【接口授权】中的数据", "No interface permission is configured for the current user or the data in all interface permissions is cleared")); + } + } + } + return true; + } + else + { + // 用户未通过身份验证,可能需要进行一些处理,例如返回未经授权的错误 + context.Response.StatusCode = 401; + throw new Exception(TextHandler.GetCommonText("用户未通过身份验证", "The user is not authenticated")); + } + } + catch (Exception) + { + // JWT验证失败 + context.Response.StatusCode = 401; + throw new Exception(TextHandler.GetCommonText("JWT验证失败", "JWT authentication failed")); + } + } + else + { + // Authorization标头缺失或格式不正确 + context.Response.StatusCode = 401; + throw new Exception(TextHandler.GetCommonText("Authorization标头缺失或格式不正确", "The Authorization header is missing or incorrectly formatted")); + } + } + public static string GetActionTypeName(ActionType actionType) + { + return $"ReZero.SuperAPI.{actionType}"; + } + public static string GetActionTypeName(DataModel dataModel) + { + return $"ReZero.SuperAPI.{dataModel.ActionType}"; + } + public static string GetActionTypeElementName(ActionType actionType) + { + return $"ReZero.SuperAPI.Element{actionType}"; + } + + public static string GetSaveInterfaceType(ActionType actionType) + { + return $"ReZero.SuperAPI.SaveInterfaceList{actionType}"; + } + public static void CheckActionType(DataModel dataModel, Type actionType) + { + if (actionType == null) + { + throw new ArgumentException($"Invalid ActionType: {dataModel.ActionType}"); + } + } + } +} diff --git a/ReZero/SuperAPI/ApiProvider/ParameterProvider/BindHttpParameters.cs b/ReZero/SuperAPI/ApiProvider/ParameterProvider/BindHttpParameters.cs new file mode 100644 index 0000000..3bfa547 --- /dev/null +++ b/ReZero/SuperAPI/ApiProvider/ParameterProvider/BindHttpParameters.cs @@ -0,0 +1,240 @@ +using Microsoft.AspNetCore.Http; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class BindHttpParameters + { + internal void Bind(DataModel? dataModel, HttpContext context, string? path, bool isUrlParameters, ZeroInterfaceList interInfo) + { + var formDatas = GetFormDatas(context); + BindPageParameters(dataModel, context, formDatas); + BindDefaultParameters(dataModel, context, formDatas, interInfo); + BindOrderByParameters(dataModel, context, formDatas); + BindGroupByParameters(dataModel, context, formDatas); + BindUrlParameters(isUrlParameters,path, dataModel!, interInfo); + } + + private void BindUrlParameters(bool isUrlParameters, string? path, DataModel dataModel, ZeroInterfaceList interInfo) + { + if (isUrlParameters) + { + var parameterString = path!.Replace(interInfo.OriginalUrl!.ToLower(), string.Empty); + var parameters= parameterString.Split('/').Where(it=>!string.IsNullOrWhiteSpace(it)).ToArray(); + var index = 0; + foreach (var item in dataModel.DefaultParameters??new List()) + { + item.Value= parameters[index]; + index++; + } + } + } + + private void BindGroupByParameters(DataModel? dataModel, HttpContext context, Dictionary formDatas) + { + if (dataModel?.GroupParemters != null) + { + var groupBys = formDatas.FirstOrDefault(it => it.Key.EqualsCase(nameof(DataModel.GroupParemters))); + if (groupBys.Value != null) + { + dataModel!.GroupParemters = Newtonsoft.Json.JsonConvert.DeserializeObject>(groupBys.Value + ""); + } + } + } + + private void BindOrderByParameters(DataModel? dataModel, HttpContext context, Dictionary formDatas) + { + if (dataModel?.OrderDynamicParemters != null) + { + //var data = dataModel?.DefaultParameters?.FirstOrDefault(it => it?.Name?.EqualsCase(nameof(DataModel.OrderByFixedParemters )) == true); + //if (data != null) + //{ + var orderDatas = formDatas.FirstOrDefault(it => it.Key.EqualsCase(nameof(DataModel.OrderDynamicParemters))); + if (orderDatas.Value != null) + { + dataModel!.OrderDynamicParemters = Newtonsoft.Json.JsonConvert.DeserializeObject>(orderDatas.Value + ""); + } + //} + } + } + private void BindPageParameters(DataModel? dataModel, HttpContext context, Dictionary formDatas) + { + if (dataModel?.CommonPage != null) + { + var pageNumberPar = dataModel?.DefaultParameters?.FirstOrDefault(it => it?.Name?.EqualsCase(SuperAPIModule._apiOptions?.InterfaceOptions.PageNumberPropName) == true); + if (pageNumberPar != null) + { + pageNumberPar.Value = GetParameterValueFromRequest(pageNumberPar, context, formDatas); + dataModel!.CommonPage.PageNumber = Convert.ToInt32(pageNumberPar.Value ?? "1"); + } + var pageSizePar = dataModel?.DefaultParameters?.FirstOrDefault(it => it?.Name?.EqualsCase(SuperAPIModule._apiOptions?.InterfaceOptions.PageSizePropName) == true); + if (pageSizePar != null) + { + pageSizePar.Value = GetParameterValueFromRequest(pageSizePar, context, formDatas); + dataModel!.CommonPage.PageSize = Convert.ToInt32(pageSizePar.Value ?? "20"); + } + } + } + + private void BindDefaultParameters(DataModel? dataModel, HttpContext context, Dictionary formDatas, ZeroInterfaceList interInfo) + { + if (IsJObjct(dataModel, formDatas)) + { + var data = dataModel?.DefaultParameters?.FirstOrDefault(); + if (data != null) + { + data.Value = App.Db.Utilities.SerializeObject(formDatas); + } + } + else if (dataModel!.DefaultParameters != null) + { + if (interInfo.IsAttributeMethod==true) + { + // + } + else + { + dataModel!.DefaultParameters = dataModel?.DefaultParameters?.Where(it => NoPageParameters(it)).ToList(); + } + foreach (var item in dataModel?.DefaultParameters ?? new List()) + { + UpdateWhereItemValue(context, formDatas, item); + } + } + } + + private static bool IsJObjct(DataModel? dataModel, Dictionary formDatas) + { + var isJObject = dataModel?.DefaultParameters?.Count == 1 && dataModel!.DefaultParameters!.First().ValueType == nameof(JObject) && dataModel!.DefaultParameters!.First().IsSingleParameter == true; + return isJObject; + } + + private void UpdateWhereItemValue(HttpContext context, Dictionary formDatas, DataModelDefaultParameter item) + { + item.Value = GetParameterValueFromRequest(item, context, formDatas); + if (IsDefaultValue(item)) + { + item.Value = item.DefaultValue; + } + if (IsUserName(item)) + { + var options = SuperAPIModule._apiOptions; + item.Value = options?.DatabaseOptions!.GetCurrentUserCallback().UserName; + } + else if (IsDateTimeNow(item)) + { + var options = SuperAPIModule._apiOptions; + item.Value = DateTime.Now; + } + else if (IsFile(item)) + { + item.Value = PubMethod.ConvertFromBase64(item.Value + ""); + } + //if (!string.IsNullOrEmpty(item?.FieldName)) + //{ + // item.Name = item.FieldName; + //} + } + + + + private static bool NoPageParameters(DataModelDefaultParameter it) + { + return it.Name != SuperAPIModule._apiOptions?.InterfaceOptions.PageNumberPropName && + it.Name != SuperAPIModule._apiOptions?.InterfaceOptions.PageSizePropName; + } + + private static bool IsUserName(DataModelDefaultParameter item) + { + return item?.InsertParameter?.IsUserName == true; + } + private static bool IsDateTimeNow(DataModelDefaultParameter item) + { + return item?.InsertParameter?.IsDateTimeNow == true; + } + private bool IsFile(DataModelDefaultParameter item) + { + return item?.ValueType == "Byte[]"; + } + private static bool IsDefaultValue(DataModelDefaultParameter item) + { + return item.Value == null && item.DefaultValue != null; + } + + private string GetParameterValueFromRequest(DataModelDefaultParameter parameter, HttpContext context, Dictionary formDatas) + { + if (parameter.ValueIsReadOnly) + { + return parameter.Value + ""; + } + string parameterValue = context.Request.Query[parameter.Name]; + var formData = formDatas.FirstOrDefault(it => it.Key.EqualsCase(parameter.Name ?? "")); + if (formData.Key != null) + { + parameterValue = formData.Value + ""; + } + parameter.Value = parameterValue; + return parameterValue; + } + + private static Dictionary GetFormDatas(HttpContext context) + { + + Dictionary formDatas = new Dictionary(); + if (context.Request.Body != null) + { + AddFormData(context, formDatas); + AddRawParameters(context, formDatas); + } + return formDatas ?? new Dictionary(); + } + + private static void AddFormData(HttpContext context, Dictionary formDatas) + { + if (IsFormData(context)) + { + var formParams = context.Request.Form; + + foreach (var key in formParams.Keys) + { + formDatas[key] = formParams[key]; + } + } + } + + private static StreamReader AddRawParameters(HttpContext context, Dictionary formDatas) + { + using StreamReader reader = new System.IO.StreamReader(context.Request.Body); + var body = reader.ReadToEndAsync().Result; + + if (!string.IsNullOrEmpty(body)) + { + + var bodyParams = Newtonsoft.Json.JsonConvert.DeserializeObject>(body) ?? new Dictionary(); + + var items = formDatas.Union(bodyParams).ToDictionary(pair => pair.Key, pair => pair.Value); + foreach (var item in items) + { + formDatas.Add(item.Key,item.Value); + } + } + + return reader; + } + + private static bool IsFormData(HttpContext context) + { + var contentTypes = new List() + { + "multipart/form-data", + "application/x-www-form-urlencoded" + }; + return context.Request.ContentType != null && contentTypes.Any(context.Request.ContentType.Contains); + } + } +} diff --git a/ReZero/SuperAPI/ApiProvider/ParameterProvider/ErrorParameter.cs b/ReZero/SuperAPI/ApiProvider/ParameterProvider/ErrorParameter.cs new file mode 100644 index 0000000..8b0942c --- /dev/null +++ b/ReZero/SuperAPI/ApiProvider/ParameterProvider/ErrorParameter.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ErrorParameter + { + public string? Name { get; set; } + + public string? ErrorType { get; set; } + public string? Message { get; set; } + } +} diff --git a/ReZero/SuperAPI/ApiProvider/ParameterProvider/ErrorParameterHelper.cs b/ReZero/SuperAPI/ApiProvider/ParameterProvider/ErrorParameterHelper.cs new file mode 100644 index 0000000..1366cf8 --- /dev/null +++ b/ReZero/SuperAPI/ApiProvider/ParameterProvider/ErrorParameterHelper.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class ErrorParameterHelper + { + public static bool IsError(object? errorData) + { + return errorData != null; + } + + public static async Task GetErrorParameters(List errorParameters) + { + object? errorData = null; + if (errorParameters.Any()) + { + var data = await Task.FromResult(new + { + ErrorParameters = errorParameters + }); + errorData = data; + } + + return errorData; + } + } +} diff --git a/ReZero/SuperAPI/ApiProvider/ParameterProvider/ValidateParameters.cs b/ReZero/SuperAPI/ApiProvider/ParameterProvider/ValidateParameters.cs new file mode 100644 index 0000000..1fd8aed --- /dev/null +++ b/ReZero/SuperAPI/ApiProvider/ParameterProvider/ValidateParameters.cs @@ -0,0 +1,105 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http.Headers; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class ValidateParameters + { + public static async Task> CheckAsync(DataModel dataModel) + { + List errorLists = new List(); + foreach (var item in dataModel.DefaultParameters ?? new List()) + { + if (IsRequired(item)) + { + AddReuiredError(errorLists, item); + } + if (IsInsertUnique(dataModel, item)) + { + await AddInsertUniqueError(dataModel, errorLists, item); + } + if (item?.ParameterValidate?.IsUnique == true && dataModel.ActionType == ActionType.InsertObject) + { + } + } + return errorLists; + } + + #region Add Error + private static async Task AddInsertUniqueError(DataModel dataModel, List errorLists, DataModelDefaultParameter item) + { + var type = await EntityGeneratorManager.GetTypeAsync(dataModel.TableId); + var db = App.GetDbTableId(dataModel.TableId); + new CommonDataService().InitDb(type, db!); + var entityInfo = db!.EntityMaintenance.GetEntityInfo(type); + var dbColumnInfo = entityInfo.Columns.FirstOrDefault(it => it.PropertyName.EqualsCase(item.Name!)); + var isDeleteIdColumn = entityInfo.Columns.FirstOrDefault(it => it.PropertyName.EqualsCase(nameof(DbBase.IsDeleted))); + bool isAny = await IsAnyValue(item, type, db, dbColumnInfo, isDeleteIdColumn, dataModel); + if (isAny) + { + errorLists.Add(new ErrorParameter() { Name = item.Name, ErrorType = "IsUnique", Message = TextHandler.GetCommonText("唯一", "Unique") }); + } + } + private static void AddReuiredError(List errorLists, DataModelDefaultParameter item) + { + errorLists.Add(new ErrorParameter() { Name = item.Name, ErrorType = "IsRequired", Message = TextHandler.GetCommonText("必填", "Required") }); + } + + #endregion + + #region Validate + private static bool IsInsertUnique(DataModel dataModel, DataModelDefaultParameter item) + { + return item?.ParameterValidate?.IsUnique == true && dataModel.ActionType == ActionType.InsertObject; + } + private static bool IsRequired(DataModelDefaultParameter item) + { + return item?.ParameterValidate?.IsRequired == true && string.IsNullOrEmpty(item.Value + ""); + } + private static async Task IsAnyValue(DataModelDefaultParameter? item, Type type, SqlSugarClient? db, EntityColumnInfo dbColumnInfo, EntityColumnInfo isDeleteIdColumn, DataModel dataModel) + { + var condition = new ConditionalModel() + { + ConditionalType = ConditionalType.Equal, + CSharpTypeName = dbColumnInfo.UnderType.Name, + FieldValue = item!.Value + "", + FieldName = dbColumnInfo.DbColumnName + + }; + var whereColumns = new List() { condition }; + if (isDeleteIdColumn != null) + { + var condition2 = new ConditionalModel() + { + ConditionalType = ConditionalType.Equal, + CSharpTypeName = typeof(bool).Name, + FieldValue = false.ToString().ToLower(), + FieldName = isDeleteIdColumn.DbColumnName + }; + whereColumns.Add(condition2); + } + if (type.Name == nameof(ZeroEntityInfo)) + { + var condition3 = new ConditionalModel() + { + ConditionalType = ConditionalType.Equal, + CSharpTypeName = typeof(long).Name, + FieldValue = dataModel.DefaultParameters.First(it => it.Name!.EqualsCase(nameof(ZeroEntityInfo.DataBaseId))).Value + "", + FieldName = db!.EntityMaintenance.GetEntityInfo(type).Columns.First(it => it.PropertyName == nameof(ZeroEntityInfo.DataBaseId)).DbColumnName + }; + whereColumns.Add(condition3); + } + return await db!.QueryableByObject(type) + .Where(whereColumns) + .AnyAsync(); + } + #endregion + + } +} diff --git a/ReZero/SuperAPI/Application/App.cs b/ReZero/SuperAPI/Application/App.cs new file mode 100644 index 0000000..289be72 --- /dev/null +++ b/ReZero/SuperAPI/Application/App.cs @@ -0,0 +1,112 @@ +using Microsoft.Extensions.Logging; +using SqlSugar; +using System; +using System.Linq; +namespace ReZero.SuperAPI +{ + /// + /// Get rezero db + /// + public class ZeroDb + { + public static ISqlSugarClient Db =>new SqlSugarClient(UtilMethods.CopyConfig( App.PreStartupDb!.CurrentConnectionConfig)); + } + /// + /// Represents the application's main entry point and provides access to essential services and resources. + /// + internal class App + { + /// + /// Gets or sets the application's service provider, allowing access to registered services. + /// + internal static ApplicationServiceProvider? ServiceProvider { get; set; } + /// + /// Represents a database connection object used before service startup. + /// + internal static ISqlSugarClient? PreStartupDb { get; set; } + /// + /// Gets the instance of the SqlSugar client for database operations. + /// + /// + /// This property provides convenient access to the configured SqlSugar client for database operations. + /// + internal static ISqlSugarClient Db { get => ServiceProvider!.GetService().SugarClient; } + + /// + /// Obtain the database operation object based on the database ID + /// + /// + /// + internal static SqlSugarClient? GetDbById(long dbId) + { + var rootDb = App.Db; + var zeroDatabaseInfo = rootDb.Queryable().Where(it => it.Id == dbId).First(); + SqlSugarClient? db = null; + if (zeroDatabaseInfo != null) + db = GetSqlSugarClientByDatabaseInfo(zeroDatabaseInfo); + return db; + } + + /// + /// Obtain the database operation object based on the table ID + /// + /// + /// + internal static SqlSugarClient? GetDbTableId(long tableId) + { + var rootDb = App.Db; + var dbId = CacheManager.Instance.GetList().Where(it => it.Id == tableId).First()?.DataBaseId; + var zeroDatabaseInfo =CacheManager.Instance.GetList().Where(it => it.Id == dbId).First(); + zeroDatabaseInfo = rootDb.Utilities.TranslateCopy(zeroDatabaseInfo); + SqlSugarClient? db = null; + if (zeroDatabaseInfo != null) + db = GetSqlSugarClientByDatabaseInfo(zeroDatabaseInfo); + return db; + } + + /// + /// Obtain the database operation object based on the ZeroDatabaseInfo + /// + /// + /// + private static SqlSugarClient GetSqlSugarClientByDatabaseInfo(ZeroDatabaseInfo zeroDatabaseInfo) + { + return new SqlSugarClient(new ConnectionConfig() + { + ConfigId=int.MaxValue, + ConnectionString = zeroDatabaseInfo.Connection, + DbType = zeroDatabaseInfo.DbType, + IsAutoCloseConnection = true, + InitKeyType = InitKeyType.Attribute, + MoreSettings = new ConnMoreSettings + { + SqlServerCodeFirstNvarchar = true, + SqliteCodeFirstEnableDropColumn = true, + EnableCodeFirstUpdatePrecision = true, + IsAutoToUpper=false, + PgSqlIsAutoToLower=false, + PgSqlIsAutoToLowerCodeFirst=false, + EnableOracleIdentity=true + } + }, + db => + { + db.Aop.OnLogExecuting = (s, p) => + { + ReZero.DependencyInjection.DependencyResolver.GetLogger().LogInformation(UtilMethods.GetNativeSql(s, p)); + }; + }); + } + /// + /// Gets the language used by the SuperAPI module. + /// + /// The language. + internal static Language Language + { + get + { + return SuperAPIModule._apiOptions!.UiOptions!.UiLanguage; + } + } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/Application/ApplicationServiceProvider.cs b/ReZero/SuperAPI/Application/ApplicationServiceProvider.cs new file mode 100644 index 0000000..460b11d --- /dev/null +++ b/ReZero/SuperAPI/Application/ApplicationServiceProvider.cs @@ -0,0 +1,39 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; +using System; + +namespace ReZero.SuperAPI +{ + + /// + /// The main class of the application, used for managing dependency injection and service location. + /// + public class ApplicationServiceProvider + { + private readonly IApplicationBuilder _app; + + /// + /// Constructor that accepts an instance. + /// + /// The dependency injection container. + public ApplicationServiceProvider(IApplicationBuilder serviceProvider) + { + _app = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); + } + + /// + /// Gets an instance of the specified service type. + /// + /// The type of service to retrieve. + /// An instance of the specified service type. + public T GetService() where T : class + { + // Get the IOC container (service provider) + var serviceProvider = _app.ApplicationServices; + + // Perform the operation using the IOC container + var myService = serviceProvider!.GetRequiredService(); + return myService; + } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/Cache/CacheCenter.cs b/ReZero/SuperAPI/Cache/CacheCenter.cs new file mode 100644 index 0000000..bfbb695 --- /dev/null +++ b/ReZero/SuperAPI/Cache/CacheCenter.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class CacheCenter + { + private static readonly object cacheLock = new object(); + public void ClearAllInternalCache() + { + lock (cacheLock) + { + CacheManager.Instance.ClearCache(); + CacheManager.Instance.ClearCache(); + CacheManager.Instance.ClearCache(); + CacheManager.Instance.ClearCache(); + CacheManager.Instance.ClearCache(); + CacheManager.Instance.ClearCache(); + } + } + } +} diff --git a/ReZero/SuperAPI/Cache/CacheManager.cs b/ReZero/SuperAPI/Cache/CacheManager.cs new file mode 100644 index 0000000..ced1571 --- /dev/null +++ b/ReZero/SuperAPI/Cache/CacheManager.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class CacheManager: ICacheManager where T:class,new() + { + private static List cacheObject = null!; + private static readonly object cacheLock = new object(); + + public static CacheManager Instance + { + get + { + return new CacheManager(); + } + } + public List GetList() + { + if (cacheObject != null) + { + return cacheObject; + } + + lock (cacheLock) + { + if (cacheObject == null) + { + var db = App.Db; + cacheObject = db.Queryable().ToList(); + } + } + + return cacheObject; + } + + public void ClearCache() + { + lock (cacheLock) + { + cacheObject = null!; + } + } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/Cache/ICacheManager.cs b/ReZero/SuperAPI/Cache/ICacheManager.cs new file mode 100644 index 0000000..4dc721a --- /dev/null +++ b/ReZero/SuperAPI/Cache/ICacheManager.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; + +namespace ReZero.SuperAPI +{ + public interface ICacheManager + { + void ClearCache(); + List GetList(); + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/DataInitializerService/AttibuteInterfaceInitializerService.cs b/ReZero/SuperAPI/DataInitializerService/AttibuteInterfaceInitializerService.cs new file mode 100644 index 0000000..05a9c33 --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/AttibuteInterfaceInitializerService.cs @@ -0,0 +1,318 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; +using System.Linq; +using SqlSugar; +using System.Reflection.Emit; +namespace ReZero.SuperAPI +{ + public class AttibuteInterfaceInitializerService + { + internal static ZeroInterfaceList GetZeroInterfaceItem(Type type, MethodInfo method) + { + var classAttribute = type.GetCustomAttribute(); + var methodAttribute = method.GetCustomAttribute(); + var urlParametersAttribute = method.GetCustomAttribute(); + var isUrlParameters = urlParametersAttribute != null; + var groupName = methodAttribute.GroupName ?? classAttribute.GroupName ?? type.Name; + string url = GetUrl(type, method, classAttribute, methodAttribute); + var oldUrl = isUrlParameters ? url : null; + var methodDesc = methodAttribute.Description ?? string.Empty; + ZeroInterfaceList it = new ZeroInterfaceList(); + it.HttpMethod = methodAttribute.HttpMethod.ToString(); + it.Id = SnowFlakeSingle.Instance.NextId(); + it.GroupName = groupName; + it.InterfaceCategoryId = classAttribute.InterfaceCategoryId; + it.Name = methodDesc; + it.Url = url; + it.OriginalUrl = oldUrl; + it.IsInitialized = false; + it.IsAttributeMethod = true; + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroInterfaceList, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = method.GetParameters().Count(), + MethodClassFullName = type.FullName, + MethodName = method.Name + } + }; + it.DataModel.DefaultParameters = new List(); + var isAdd = true; + foreach (var item in method.GetParameters()) + { + var nonNullableType = item.ParameterType.GetNonNullableType(); + it.Url = GetUrl(type, isUrlParameters, it.Url, item, nonNullableType); + DataModelDefaultParameter dataModelDefaultParameter = new DataModelDefaultParameter(); + dataModelDefaultParameter.Name = item.Name; + if (IsDefaultType(item.ParameterType)) + { + dataModelDefaultParameter.ValueType = item.ParameterType.GetNonNullableType().Name; + } + else if (item.ParameterType == typeof(byte[])) + { + dataModelDefaultParameter.ValueType = "Byte[]"; + } + else if (IsObject(item.ParameterType)) + { + dataModelDefaultParameter.ValueType = "Json"; + object obj = Activator.CreateInstance(item.ParameterType); + dataModelDefaultParameter.Value = new SerializeService().SerializeObject(obj); + } + else if (method.GetParameters().Count() == 1) + { + isAdd = false; + it.DataModel.MyMethodInfo.ArgsTypes = new Type[] { typeof(SingleModel) }; + var paramters = item.ParameterType.GetProperties(); + AddSingleClassParameters(it, paramters); + } + else + { + dataModelDefaultParameter.ValueType = "Json"; + object obj = Activator.CreateInstance(item.ParameterType); + dataModelDefaultParameter.Value = new SerializeService().SerializeObject(obj); + } + if (isAdd) + it.DataModel.DefaultParameters.Add(dataModelDefaultParameter); + } + return it; + } + + private static string GetUrl(Type type, bool isUrlParameters, string url, ParameterInfo item, Type nonNullableType) + { + if (isUrlParameters && !(nonNullableType.IsValueType || nonNullableType == typeof(string))) + { + throw new Exception(TextHandler.GetCommonText($"{type.FullName}中的{item.Name}方法使用[UrlParameters] 只能是基础类型参数。{nonNullableType.Name}类型不支持", $"The {item.Name} method in {type.FullName} uses [UrlParameters] as a base type parameter only. The {nonNullableType.Name} type is not supported")); + } + else if (isUrlParameters) + { + url += "/{" + item.Name + "}"; + } + return url; + } + + private static string GetUrl(Type type, MethodInfo method, ApiAttribute classAttribute, ApiMethodAttribute methodAttribute) + { + if (string.IsNullOrEmpty(methodAttribute.Url)&& !string.IsNullOrEmpty(classAttribute.Url)) + { + return methodAttribute.Url ?? $"/{classAttribute.Url.TrimStart('/')}/{method.Name?.ToLower()}"; + } + return methodAttribute.Url ?? $"/api/{classAttribute.InterfaceCategoryId}/{type.Name?.ToLower()}/{method.Name?.ToLower()}"; + } + + private static void AddSingleClassParameters(ZeroInterfaceList it, PropertyInfo[] paramters) + { + foreach (var p in paramters) + { + DataModelDefaultParameter addItem = new DataModelDefaultParameter(); + addItem.Name = p.Name; + if (IsDefaultType(p.PropertyType)) + { + addItem.ValueType = p.PropertyType.GetNonNullableType().Name; + } + else if (p.PropertyType == typeof(byte[])) + { + addItem.ValueType = "Byte[]"; + } + else + { + addItem.ValueType = "Json"; + object obj = Activator.CreateInstance(p.PropertyType); + addItem.Value = new SerializeService().SerializeObject(obj); + } + it!.DataModel!.DefaultParameters!.Add(addItem); + } + } + + private static bool IsDefaultType(Type type) + { + return type.GetNonNullableType().IsValueType || type.GetNonNullableType() == typeof(string); + } + + internal static void InitDynamicAttributeApi(List? types) + { + types = AttibuteInterfaceInitializerService.GetTypesWithDynamicApiAttribute(types ?? new List()); + List zeroInterfaceLists = new List(); + foreach (var type in types) + { + var methods = AttibuteInterfaceInitializerService.GetMethodsWithDynamicMethodAttribute(type); + if (methods.Any()) + { + foreach (var method in methods) + { + var addItem = AttibuteInterfaceInitializerService.GetZeroInterfaceItem(type, method); + if (addItem.Url == PubConst.InitApi_SystemSaveConfig) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.SaveConfigId; + } + if (addItem.Url == PubConst.InitApi_SystemGetInitConfig) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.GetInitConfigId; + } + if (addItem.Url == PubConst.InitApi_VerifyCode) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.VerifyCodeId; + } + if (addItem.Url == PubConst.InitApi_SaveUser) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.SaveUserId; + } + if (addItem.Url == PubConst.InitApi_GetUserById) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.GetUserById_Id; + } + if (addItem.Url == PubConst.InitApi_DeleteUserById) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.DeleteUserById_Id; + } + if (addItem.Url == PubConst.InitApi_GetCurrentUser) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.GetCurrentUserId; + } + if (addItem.Url == PubConst.InitApi_GetBizUsers) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.GetBizUsersId; + } + if (addItem.Url == PubConst.InitApi_ViewTemplate) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.ViewTemplateId; + } + if (addItem.Url == PubConst.InitApi_AddTokenManage) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.AddTokenManageId; + } + if (addItem.Url == PubConst.InitApi_UpdateTokenManage) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.UpdateTokenManageId; + } + if (addItem.Url == PubConst.InitApi_DeleteTokenManage) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.DeleteTokenManageId; + } + if (addItem.Url == PubConst.InitApi_GetTokenManageById) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.GetTokenManageById_Id; + } + if (addItem.Url == PubConst.InitApi_GetPermissionList) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.GetPermissionListId; + } + if (addItem.Url == PubConst.InitApi_AddPermission) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.AddPermissionId; + } + if (addItem.Url == PubConst.InitApi_UpdatePermission) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.UpdatePermissionId; + } + if (addItem.Url == PubConst.InitApi_DeletePermission) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.DeletePermissionId; + } + if (addItem.Url == PubConst.InitApi_GetSavePermissionModelById) + { + addItem.IsInitialized = true; + addItem.Id = InterfaceListInitializerProvider.GetSavePermissionModelById_Id; + } + zeroInterfaceLists.Add(addItem); + } + } + } + var db = App.PreStartupDb; + if (db != null) + { + db!.QueryFilter.ClearAndBackup(); + try + { + db!.Ado.BeginTran(); + var list = db.Queryable().Where(it => it.IsAttributeMethod == true).ToList(); + db.Deleteable().Where(it => it.IsAttributeMethod == true).ExecuteCommand(); + foreach (var item in zeroInterfaceLists) + { + if (list.FirstOrDefault(it => it.Url == item.Url) is { } data) + { + item.Id = data.Id; + } + } + db.Insertable(zeroInterfaceLists).ExecuteCommand(); + db!.Ado.CommitTran(); + } + catch (Exception) + { + db!.Ado.RollbackTran(); + throw; + } + db!.QueryFilter.Restore(); + } + } + + /// + /// Get the list of types with the DynamicApiAttribute + /// + /// The list of types + /// The list of types with the DynamicApiAttribute + public static List GetTypesWithDynamicApiAttribute(List types) + { + List typesWithDynamicApiAttribute = new List(); + + foreach (var type in types) + { + // Check if the type has the DynamicApiAttribute + if (type.GetCustomAttributes(typeof(ApiAttribute), true).Length > 0) + { + typesWithDynamicApiAttribute.Add(type); + } + } + + return typesWithDynamicApiAttribute; + } + + + /// + /// Get the list of methods with the DynamicMethodAttribute for a given type + /// + /// The type + /// The list of methods with the DynamicMethodAttribute + public static List GetMethodsWithDynamicMethodAttribute(Type type) + { + List methodsWithDynamicMethodAttribute = new List(); + + MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); + + foreach (var method in methods) + { + if (method.GetCustomAttributes(typeof(ApiMethodAttribute), true).Length > 0) + { + methodsWithDynamicMethodAttribute.Add(method); + } + } + + return methodsWithDynamicMethodAttribute; + } + + private static bool IsObject(Type type) + { + return (type.IsArray || type.FullName.StartsWith("System.Collections.Generic.List")); + } + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/DataBaseInitializerProvider.cs b/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/DataBaseInitializerProvider.cs new file mode 100644 index 0000000..3747adf --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/DataBaseInitializerProvider.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal class DataBaseInitializerProvider + { + public const long Id = 1; + public const string UserName = "Admin"; + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/EntityColumnInitializerProvider.cs b/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/EntityColumnInitializerProvider.cs new file mode 100644 index 0000000..2722830 --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/EntityColumnInitializerProvider.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class EntityColumnInitializerProvider + { + + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/EntityInfoInitializerProvider.cs b/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/EntityInfoInitializerProvider.cs new file mode 100644 index 0000000..c842acb --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/EntityInfoInitializerProvider.cs @@ -0,0 +1,20 @@ +using Npgsql; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class EntityInfoInitializerProvider + { + public const long Id_ZeroInterfaceList = 1; + public const long Id_ZeroInterfaceCategory = 2; + public const long Id_ZeroDatabaseInfo = 3; + public const long Id_ZeroEntityInfo = 4; + public const long Id_ZeroColumnInfo = 5; + public const long Id_ZeroTemplate = 6; + public const long Id_ZeroTemplateType = 7; + public const long Id_ZeroUserInfo = 8; + public const long Id_ZeroJwtTokenManagement = 9; + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/IconInitializerProvider.cs b/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/IconInitializerProvider.cs new file mode 100644 index 0000000..92f7d10 --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/IconInitializerProvider.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class IconInitializerProvider + { + internal const int Id1 = 1; + internal const int Id2 = 2; + internal const int Id3 = 3; + internal const int Id4 = 4; + + private const string IconName1 = "mdi mdi-home"; + private const string IconName2 = "mdi polymer"; + private const string IconName3 = "mdi mdi-book-open"; + private const string IconName4 = "mdi-arrange-send-backward"; + + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/InterfaceCategoryInitializerProvider.cs b/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/InterfaceCategoryInitializerProvider.cs new file mode 100644 index 0000000..0258be6 --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/InterfaceCategoryInitializerProvider.cs @@ -0,0 +1,183 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class InterfaceCategoryInitializerProvider + { + #region Root + /// + /// 根目录 + /// + [ChineseTextAttribute("根目录")] + [EnglishTextAttribute("Root")] + public const long Id = 0; + #endregion + + #region Swagger + /// + /// Swagger + /// + [ChineseTextAttribute("原生接口")] + [EnglishTextAttribute("Swagger")] + public const long Id1 = 1; + #endregion + + + #region Dynamic interface + /// + /// 自定义接口 + /// + [ChineseTextAttribute("动态接口")] + [EnglishTextAttribute("Dynamic interface")] + public const long Id200 = 200; + + /// + /// 测试分类1 + /// + [ChineseTextAttribute("测试分类1")] + [EnglishTextAttribute("Test 01")] + public const long Id200100 = 200100; + + #endregion + + + #region Internal interface + /// + /// 内置接口 + /// + [ChineseTextAttribute("系统接口")] + [EnglishTextAttribute("Internal interface")] + public const long Id100 = 100; + + + /// + /// 页面布局 + /// + [ChineseTextAttribute("页面布局")] + [EnglishTextAttribute("Page layout")] + public const long Id100002 = 100002; + + /// + /// 接口管理 + /// + [ChineseTextAttribute("接口管理")] + [EnglishTextAttribute("Interface list")] + public const long Id100003 = 100003; + + + /// + /// 数据字典 + /// + [ChineseTextAttribute("数据字典")] + [EnglishTextAttribute("Dictionary")] + public const long Id100004 = 100004; + #endregion + + + #region Project management + /// + /// 接口管理 + /// + [ChineseTextAttribute("接口管理")] + [EnglishTextAttribute("Api management")] + public const long Id300 = 300; + + /// + /// 实体表管理 + /// + [ChineseTextAttribute("实体表维护")] + [EnglishTextAttribute("Entity and table management")] + public const long Id300001 = 300001; + + /// + /// 数据库管理 + /// + [ChineseTextAttribute("数据库维护")] + [EnglishTextAttribute("Database management")] + public const long Id300003 = 300002; + + /// + /// 接口分类管理 + /// + [ChineseTextAttribute("分类维护")] + [EnglishTextAttribute("InterfaceCategory")] + public const long Id300002 = 300003; + + /// + /// 接口管理 + /// + [ChineseTextAttribute("接口维护")] + [EnglishTextAttribute("Api management")] + public const long Id300006 = 300006; + + + /// + /// 接口授权 + /// + [ChineseTextAttribute("JWT 认证测试")] + [EnglishTextAttribute("JWT certification test")] + public const long Id300007 = 300007; + + /// + /// 文件模版 + /// + [ChineseTextAttribute("文件模版")] + [EnglishTextAttribute("File template")] + public const long Id300008 = 300008; + + /// + /// 系统缓存 + /// + [ChineseTextAttribute("系统缓存")] + [EnglishTextAttribute("System cache")] + public const long Id300009 = 300009; + + /// + /// 系统配置 + /// + [ChineseTextAttribute("系统配置")] + [EnglishTextAttribute("System config")] + public const long Id300010 = 300010; + + /// + /// 系统用户 + /// + [ChineseTextAttribute("系统用户")] + [EnglishTextAttribute("System user")] + public const long Id300011 = 300011; + + + /// + /// JWT 令牌管理 + /// + [ChineseTextAttribute("JWT 令牌管理")] + [EnglishTextAttribute("JWT token management")] + public const long Id300012 = 300012; + + /// + /// 接口权限管理 + /// + [ChineseTextAttribute("接口权限管理")] + [EnglishTextAttribute("Interface permission management")] + public const long Id300013 = 300013; + #endregion + + #region System setting + [ChineseTextAttribute("系统&配置")] + [EnglishTextAttribute("System setting")] + public const long SystemSettingId = 400; + #endregion + + #region Data document + [ChineseTextAttribute("数据文档")] + [EnglishTextAttribute("Data document")] + public const long DataDocumentRootId = 500; + [ChineseTextAttribute("数据文档")] + [EnglishTextAttribute("Data document")] + public const long DataDocumentManagerId = 500001; + #endregion + + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/InterfaceListInitializerProvider.cs b/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/InterfaceListInitializerProvider.cs new file mode 100644 index 0000000..fb8065d --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/DatabaseSeeder/InterfaceListInitializerProvider.cs @@ -0,0 +1,394 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal partial class InterfaceListInitializerProvider + { + /// + /// 数据库管理 + /// + [ChineseTextAttribute("数据库管理")] + [EnglishTextAttribute("Database management")] + public const long DbManId = 1; + + + /// + /// 获取数据库管理所有 + /// + [ChineseTextAttribute("获取数据库管理所有")] + [EnglishTextAttribute("Database all list")] + public const long GetDbAllId = 23; + + + /// + /// 删除数据库 + /// + [ChineseTextAttribute("删除数据库")] + [EnglishTextAttribute("Daelete Database")] + public const long DelDbManId = 11; + + /// + /// 添加数据库 + /// + [ChineseTextAttribute("添加数据库")] + [EnglishTextAttribute("Add Database")] + public const long AddDbManId = 12; + + /// + /// 修改库管理 + /// + [ChineseTextAttribute("添加数据库")] + [EnglishTextAttribute("Edit Database")] + public const long EditDbManId = 13; + + /// + /// 获取数据库根据ID + /// + [ChineseTextAttribute("获取数据库根据ID")] + [EnglishTextAttribute("Get database by id")] + public const long GetDbManIdById = 14; + + /// + /// 测试数据库 + /// + [ChineseTextAttribute("测试数据库")] + [EnglishTextAttribute("Test database")] + public const long TestDatabaseId=16; + + /// + /// 创建数据库 + /// + [ChineseTextAttribute("创建数据库")] + [EnglishTextAttribute("Create database")] + public const long CreateDatabaseId = 17; + + /// + /// 内部接口 + /// + [ChineseTextAttribute("接口列表")] + [EnglishTextAttribute("Internal interface list")] + public const long IntIntListId = 2; + /// + /// 接口分类 + /// + [ChineseTextAttribute("动态分类列表")] + [EnglishTextAttribute("Dynamic category list")] + public const long IntCatePageListId = 3; + + /// + /// 接口详情 + /// + [ChineseTextAttribute("接口详情")] + [EnglishTextAttribute("Interface Detail")] + public const long IntDetId = 4; + + + + ///// + ///// 动态接口[测试01] + ///// + //[ChineseTextAttribute("测试动态接口01")] + //[EnglishTextAttribute("Test API 01")] + //public const long TestId = 175179646053135000; + + + /// + /// 接口分类树 + /// + [ChineseTextAttribute("接口分类树")] + [EnglishTextAttribute("Interface category tree")] + public const long IntCateTreeId = 6; + + + /// + /// 添加动态接口分类 + /// + [ChineseTextAttribute("添加动态接口分类")] + [EnglishTextAttribute("Add dynamic category")] + public const long AddCateTreeId = 7; + + [ChineseTextAttribute("修改动态接口分类")] + [EnglishTextAttribute("Update dynamic category")] + public const long UpdateCateTreeId = 8; + + [ChineseTextAttribute("删除动态接口分类")] + [EnglishTextAttribute("Delete dynamic category")] + public const long DeleteCateTreeId = 9; + + + [ChineseTextAttribute("根据主键查询接口分类")] + [EnglishTextAttribute("Get category by id")] + public const long GetCateTreeById = 10; + + [ChineseTextAttribute("下拉列表:获取数据库类型")] + [EnglishTextAttribute("Get database type list")] + + public const long GetDbTypeListId = 15; + + [ChineseTextAttribute("下拉列表:获取c#类型")] + [EnglishTextAttribute("Get c# type")] + + public const long GetNativeTypeId = 24; + + + + [ChineseTextAttribute("获取实体列表")] + [EnglishTextAttribute("Get entity list")] + + public const long GetEntityInfoListId = 18; + + + [ChineseTextAttribute("获取实体根据主键")] + [EnglishTextAttribute("Get entity by id")] + + public const long GetEntityInfoById_Id = 19; + + [ChineseTextAttribute("删除实体")] + [EnglishTextAttribute("Delete entity")] + + public const long DeleteEntityInfoById = 20; + + + [ChineseTextAttribute("添加实体")] + [EnglishTextAttribute("Add entity")] + + public const long AddEntityInfoId = 21; + + [ChineseTextAttribute("更新实体")] + [EnglishTextAttribute("Update entity")] + + public const long UpdateEntityInfoId = 22; + + + [ChineseTextAttribute("获取属性根据实体ID")] + [EnglishTextAttribute("Get entity columns")] + public const long GetEntityColumnsByEntityId_Id = 25; + + [ChineseTextAttribute("更新实体属性")] + [EnglishTextAttribute("Update entity columns")] + public const long UpdateEntityColumnInfosId= 26; + + [ChineseTextAttribute("表结构对比")] + [EnglishTextAttribute("Compare database dtructure")] + public const long CompareDatabaseStructureId = 27; + + + [ChineseTextAttribute("创建表")] + [EnglishTextAttribute("Create table")] + public const long CreateTablesId = 28; + + + [ChineseTextAttribute("获取导入的表")] + [EnglishTextAttribute("Get import tables ")] + public const long GetImportTablesId = 29; + + + [ChineseTextAttribute("导入实体")] + [EnglishTextAttribute("Import entities")] + public const long ImportEntitiesId = 30; + + + [ChineseTextAttribute("接口列表分页")] + [EnglishTextAttribute("dynamic interface page list")] + public const long DynamicIntPageListId = 31; + + + [ChineseTextAttribute("删除动态接口")] + [EnglishTextAttribute("Delete dynamic interface")] + public const long DeleteDynamicIntId = 32; + + + [ChineseTextAttribute("下拉列表:动态分类数据源")] + [EnglishTextAttribute("Dynamic category datasource")] + public const long IntCateListId = 33; + + + [ChineseTextAttribute("下拉列表:动态分类中的分组集合")] + [EnglishTextAttribute("Dynamic group name datasource")] + public const long IntCateGroupNameListId = 34; + + + [ChineseTextAttribute("下拉列表:获接口操作方式集合")] + [EnglishTextAttribute("Get interface action list ")] + public const long GetActionTypeId = 35; + + [ChineseTextAttribute("获取所有表")] + [EnglishTextAttribute("Get all tables ")] + public const long GetAllTablesId = 36; + + + [ChineseTextAttribute("保存接口")] + [EnglishTextAttribute("Save interface")] + public const long SaveInterfaceListId = 37; + + + [ChineseTextAttribute("下拉列表:获取条件类型")] + [EnglishTextAttribute("Get where type list ")] + public const long GetWhereTypeListId = 38; + + + [ChineseTextAttribute("同步数据")] + [EnglishTextAttribute("Synchronous Data")] + public const long SynchronousDataId = 39; + [ChineseTextAttribute("获取token")] + [EnglishTextAttribute("Get 获取token")] + public const long GetTokenId = 40; + [ChineseTextAttribute("获取用户信息")] + [EnglishTextAttribute("Get user info")] + public const long GetUserInfoId = 41; + + [ChineseTextAttribute("执行SQL")] + [EnglishTextAttribute("Execuet sql")] + public const long ExecuetSqlId = 42; + + [ChineseTextAttribute("获取配置")] + [EnglishTextAttribute("Get setting")] + public const long GetSettingId = 43; + [ChineseTextAttribute("更新配置")] + [EnglishTextAttribute("Update setting")] + public const long UpdateSettingId = 44; + + [ChineseTextAttribute("导出实体")] + [EnglishTextAttribute("Export entities")] + public const long ExportEntitiesId = 45; + + + [ChineseTextAttribute("文件模版分页")] + [EnglishTextAttribute("File template page")] + public const long GetTemplatePageId = 46; + + [ChineseTextAttribute("文件模版根据id")] + [EnglishTextAttribute("File template by id")] + public const long GetTemplateById_Id = 47; + + [ChineseTextAttribute("添加文件模版")] + [EnglishTextAttribute("Add template")] + public const long GetAddTemplateId = 48; + + [ChineseTextAttribute("修改文件模版")] + [EnglishTextAttribute("Update template")] + public const long GetUpdateTemplateId = 49; + + [ChineseTextAttribute("删除文件模版")] + [EnglishTextAttribute("Delete template")] + public const long DeleteTemplateId = 50; + + [ChineseTextAttribute("获取模版分类")] + [EnglishTextAttribute("Get template type")] + public const long GetTemplateTypeId = 51; + + + [ChineseTextAttribute("获取默认模版")] + [EnglishTextAttribute("Get default template")] + public const long GetDefalutTemplateId = 52; + + [ChineseTextAttribute("执行模版生成")] + [EnglishTextAttribute("Execute template")] + public const long ExecTemplateId = 53; + + [ChineseTextAttribute("获取默认模版json格式")] + [EnglishTextAttribute("Get template tormat json")] + public const long GetTemplateFormatJsonId = 54; + + [ChineseTextAttribute("获取模版根据分类")] + [EnglishTextAttribute("Get template by type")] + public const long GetTemplateByTypeId_Id = 55; + + [ChineseTextAttribute("生成实体")] + [EnglishTextAttribute("Generate entity file")] + public const long ExecTemplateByTableIdsId = 56; + + + [ChineseTextAttribute("清除系统缓存")] + [EnglishTextAttribute("Clear internal cache")] + public const long ClearAllInternalCacheId = 57; + + + [ChineseTextAttribute("根据SQL返回Excel")] + [EnglishTextAttribute("Sql to excel")] + public const long ExecuetSqlReturnExcelId = 58; + + [ChineseTextAttribute("保存接口配置")] + [EnglishTextAttribute("Save config")] + public const long SaveConfigId = 59; + + [ChineseTextAttribute("获取初始化配置")] + [EnglishTextAttribute("Get init config")] + public const long GetInitConfigId= 60; + + [ChineseTextAttribute("获取用户列表")] + [EnglishTextAttribute("Get user list")] + public const long GetUserInfoListId = 61; + + [ChineseTextAttribute("获取验证码")] + [EnglishTextAttribute("Get verify code")] + public const long VerifyCodeId = 62; + + [ChineseTextAttribute("保存用户")] + [EnglishTextAttribute("Save User")] + public const long SaveUserId = 63; + [ChineseTextAttribute("根据主键获取用户")] + [EnglishTextAttribute("Get user by id")] + public const long GetUserById_Id = 64; + [ChineseTextAttribute("删除用户")] + [EnglishTextAttribute("Delete user by id")] + public const long DeleteUserById_Id = 65; + [ChineseTextAttribute("获取当前用户")] + [EnglishTextAttribute("Get current user")] + public const long GetCurrentUserId = 66; + [ChineseTextAttribute("获取业务表用户名集合")] + [EnglishTextAttribute("Gets a collection of business table user names")] + public const long GetBizUsersId = 67; + [ChineseTextAttribute("预览实体")] + [EnglishTextAttribute("Review class")] + public const long ViewTemplateId = 68; + [ChineseTextAttribute("获取JWT令牌管理")] + [EnglishTextAttribute("Get jwt token management")] + public const long GetZeroJwtTokenManagementPageId = 69; + [ChineseTextAttribute("添加Token管理")] + [EnglishTextAttribute("Add token management")] + public const long AddTokenManageId = 70; + [ChineseTextAttribute("更新Token管理")] + [EnglishTextAttribute("Update token management")] + public const long UpdateTokenManageId = 71; + [ChineseTextAttribute("删除Token管理")] + [EnglishTextAttribute("Delete token management")] + public const long DeleteTokenManageId = 72; + [ChineseTextAttribute("获取Token管理")] + [EnglishTextAttribute("Get token management")] + public const long GetTokenManageById_Id = 73; + [ChineseTextAttribute("获取权限列表")] + [EnglishTextAttribute("Get permission list")] + public const long GetPermissionListId = 74; + [ChineseTextAttribute("添加权限")] + [EnglishTextAttribute("Add permission")] + public const long AddPermissionId = 75; + [ChineseTextAttribute("修改权限")] + [EnglishTextAttribute("Update permission")] + public const long UpdatePermissionId = 76; + [ChineseTextAttribute("删除权限")] + [EnglishTextAttribute("Delete permission")] + public const long DeletePermissionId = 77; + [ChineseTextAttribute("获取权限信息根据ID")] + [EnglishTextAttribute("Get save permission by id")] + public const long GetSavePermissionModelById_Id = 78; + + private static ZeroInterfaceList GetNewItem(Action action) + { + var result = new ZeroInterfaceList() + { + IsInitialized = true, + DataModel = new DataModel() + }; + action(result); + return result; + } + + private static string GetUrl(ZeroInterfaceList zeroInterface, string actionName) + { + return $"/{NamingConventionsConst.ApiReZeroRoute}/{zeroInterface.InterfaceCategoryId}/{actionName}"; + } + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/Entities/DynamicApiAttribute.cs b/ReZero/SuperAPI/DataInitializerService/Entities/DynamicApiAttribute.cs new file mode 100644 index 0000000..e66e470 --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/Entities/DynamicApiAttribute.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] + public class ApiAttribute : Attribute + { + internal long InterfaceCategoryId { get; set; } + public string? GroupName { get; set; } + public string? Url { get; set; } + public ApiAttribute(long interfaceCategoryId) + { + InterfaceCategoryId = interfaceCategoryId; + } + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/Entities/DynamicMethodAttribute.cs b/ReZero/SuperAPI/DataInitializerService/Entities/DynamicMethodAttribute.cs new file mode 100644 index 0000000..d20989b --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/Entities/DynamicMethodAttribute.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Text; + +namespace ReZero.SuperAPI +{ + [AttributeUsage(AttributeTargets.Method)] + public class ApiMethodAttribute : Attribute + { + public string? Url { get; set; } + public string? GroupName { get; set; } + public HttpType HttpMethod { get; set; } + internal string? Description { get; set; } + public ApiMethodAttribute(string description) + { + this.Description = description; + } + } + [AttributeUsage(AttributeTargets.Method)] + public class UrlParametersAttribute : Attribute + { + + } + + public enum HttpType + { + Post=0, + Get=1, + Put=2, + Delete=3 + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/Entities/SingleModel.cs b/ReZero/SuperAPI/DataInitializerService/Entities/SingleModel.cs new file mode 100644 index 0000000..9adde17 --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/Entities/SingleModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + /// + /// Service identification + /// + internal class SingleModel + { + + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/InterfaceInitializerService.cs b/ReZero/SuperAPI/DataInitializerService/InterfaceInitializerService.cs new file mode 100644 index 0000000..587ee6c --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/InterfaceInitializerService.cs @@ -0,0 +1,199 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Reflection.Emit; +using System.Text; + +namespace ReZero.SuperAPI +{ + /// + /// Initialize system data + /// + public class DataInitializerService + { + List zeroInterfaceList = new List() { }; + List zeroInterfaceCategory = new List() { }; + public void Initialize(SuperAPIOptions options) + { + var db = App.PreStartupDb; + if (db != null) + { + var version = GetVersion(); + if (IsChangeVersion(db, version)) + { + App.PreStartupDb!.QueryFilter.ClearAndBackup(); + InitUser(options); + InitInterfaceCategory(db); + InitEntityInfo(db); + InitInterfaceList(db); + InitIcon(); + InitDatabase(db); + InitSetting(db); + UpgradeCompatibility(db); + InitTempate(db); + UpdateVersion(db, version); + App.PreStartupDb!.QueryFilter.Restore(); + } + } + } + + private static string GetVersion() + { + return Assembly.GetExecutingAssembly().GetName().Version.ToString(); + } + + private static void UpdateVersion(ISqlSugarClient db, string version) + { + db.Insertable(new ZeroSysSetting() { StringValue = version }).ExecuteReturnSnowflakeId(); + } + + private static bool IsChangeVersion(ISqlSugarClient db, string version) + { + return !db.Queryable().Any(it => it.StringValue == version); + } + + private void InitTempate(ISqlSugarClient? db) + { + var entityTemplate = db!.Queryable().Where(it=>it.IsDeleted==false).First(it => it.TypeId==TemplateType.Entity); + if (entityTemplate == null) + { + db!.Insertable(new ZeroTemplate() + { + Title=TextHandler.GetCommonText("SqlSugar实体类默认模版", "SqlSugar template"), + TemplateContent=new MethodApi().ClassNameDefalutTemplateTemplate(), + TemplateContentStyle="csharp", + Url="c:\\models\\{0}.cs", + Creator = DataBaseInitializerProvider.UserName, + Id =SqlSugar.SnowFlakeSingle.Instance.NextId(), + TypeId=TemplateType.Entity, + IsDeleted=false, + }).ExecuteCommand(); + } + } + + /// + /// Initializes the setting. + /// + /// The database client. + private void InitSetting(ISqlSugarClient? db) + { + var entityType = PubConst.Setting_EntityType; + var importUnunderlineType = PubConst.Setting_ImportUnunderlineType; + var entityExport = db!.Queryable().First(it => it.ChildTypeId == entityType && it.TypeId == importUnunderlineType); + if (entityExport == null) + { + db!.Insertable(new ZeroSysSetting() + { + BoolValue = false, + ChildTypeId = entityType, + EasyDescription = TextHandler.GetCommonText("实体-导入实体是不是去掉下划线", "Entity-Importing entity is not without underline"), + TypeId = importUnunderlineType, + Creator = DataBaseInitializerProvider.UserName, + Id = DataBaseInitializerProvider.Id + }).ExecuteCommand(); + } + } + + /// + /// Upgrades compatibility. + /// + /// The database client. + private static void UpgradeCompatibility(ISqlSugarClient? db) + { + db!.Updateable() + .SetColumns(it => it.IsAttributeMethod == false) + .Where(it => it.IsAttributeMethod == null) + .ExecuteCommand(); + var list = db!.Queryable() + .Where(it => it.IsInitialized == false) + .Where(it => it.DatabaseId == null).ToList(); + foreach (var item in list) + { + if (item?.DataModel?.TableId > 0) + { + var entity = db.Queryable().InSingle(item?.DataModel?.TableId); + item!.DatabaseId = entity.DataBaseId; + db.Updateable(item).ExecuteCommand(); + } + } + } + + /// + /// Initializes the database. + /// + /// The database client. + private void InitDatabase(ISqlSugarClient? db) + { + db!.Storageable(new ZeroDatabaseInfo() + { + Connection = db.CurrentConnectionConfig.ConnectionString, + DbType = db.CurrentConnectionConfig.DbType, + IsInitialized = true, + Name = TextHandler.GetCommonText("Rezero", "Rezero database"), + Creator = DataBaseInitializerProvider.UserName, + Id = DataBaseInitializerProvider.Id + + }).ExecuteCommand(); + } + + /// + /// Initializes the entity information. + /// + /// The database client. + private void InitEntityInfo(ISqlSugarClient? db) + { + var entity = new EntityInfoInitializerProvider(); + var datas = entity.GetDatas(); + db!.UpdateNav(datas, new UpdateNavRootOptions() { IsInsertRoot = true }).Include(x => x.ZeroEntityColumnInfos).ExecuteCommand(); + } + + /// + /// Initializes the icon. + /// + private static void InitIcon() + { + var icon = new IconInitializerProvider(); + } + + /// + /// Initializes the interface list. + /// + /// The database client. + private void InitInterfaceList(ISqlSugarClient? db) + { + db!.Deleteable().Where(it => it.IsInitialized).ExecuteCommand(); + var interfaceListProvider = new InterfaceListInitializerProvider(zeroInterfaceList); + interfaceListProvider.Set(); + db!.Storageable(zeroInterfaceList).ExecuteCommand(); + } + + /// + /// Initializes the interface category. + /// + /// The database client. + private void InitInterfaceCategory(ISqlSugarClient? db) + { + var data = db!.Queryable().InSingle(InterfaceCategoryInitializerProvider.Id200100); + db!.Deleteable().Where(it => it.IsInitialized).ExecuteCommand(); + var categoryProvider = new InterfaceCategoryInitializerProvider(zeroInterfaceCategory); + categoryProvider.Set(); + if (data != null) + { + zeroInterfaceCategory.RemoveAll(it => it.Id == InterfaceCategoryInitializerProvider.Id200100); + zeroInterfaceCategory.Add(data); + } + db!.Storageable(zeroInterfaceCategory).ExecuteCommand(); + } + + /// + /// Initializes the user. + /// + /// The SuperAPI options. + private static void InitUser(SuperAPIOptions options) + { + UserInitializerProvider userInitializerProvider = new UserInitializerProvider(); + userInitializerProvider.Initialize(options); + } + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/Items/DataInitHelper.cs b/ReZero/SuperAPI/DataInitializerService/Items/DataInitHelper.cs new file mode 100644 index 0000000..76303bd --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/Items/DataInitHelper.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal class DataInitHelper + { + + public static DataModelDefaultParameter GetIsInitializedParameter() + { + return new DataModelDefaultParameter() { Name = "IsInitialized", ValueIsReadOnly = true, Value = true, ValueType = typeof(bool).Name, Description = TextHandler.GetCommonText("是否内置数据", "Is initialized") }; + } + public static DataModelDefaultParameter GetIsDynamicParameter() + { + return new DataModelDefaultParameter() { Name = "IsInitialized", ValueIsReadOnly = true, Value = false, ValueType = typeof(bool).Name, Description = TextHandler.GetCommonText("是否内置数据", "Is initialized") }; + } + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/Items/EntityInfoInitializerProvider.cs b/ReZero/SuperAPI/DataInitializerService/Items/EntityInfoInitializerProvider.cs new file mode 100644 index 0000000..3a07b7e --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/Items/EntityInfoInitializerProvider.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class EntityInfoInitializerProvider + { + + internal List GetDatas() + { + List datas = new List(); + AddZeroInterfaceList(datas); + AddZeroInterfaceCategory(datas); + AddZeroDataBaseInfo(datas); + AddZeroEntityInfo(datas); + AddZeroColumn(datas); + AddZeroTemplate(datas); + AddZeroTemplateType(datas); + AddZeroUserInfo(datas); + AddZeroJwtTokenManagement(datas); + return datas; + } + private void AddZeroUserInfo(List datas) + { + var entityMappingService = new EntityMappingService(); + var data = entityMappingService.ConvertDbToEntityInfo(typeof(ZeroUserInfo)); + data.Id = Id_ZeroUserInfo; + data.DataBaseId = DataBaseInitializerProvider.Id; + CommonSetting(data); + datas.Add(data); + } + private void AddZeroColumn(List datas) + { + var entityMappingService = new EntityMappingService(); + var data = entityMappingService.ConvertDbToEntityInfo(typeof(ZeroEntityColumnInfo)); + data.Id = Id_ZeroColumnInfo; + data.DataBaseId = DataBaseInitializerProvider.Id; + CommonSetting(data); + datas.Add(data); + } + + + private void AddZeroEntityInfo(List datas) + { + var entityMappingService = new EntityMappingService(); + var data = entityMappingService.ConvertDbToEntityInfo(typeof(ZeroEntityInfo)); + data.Id = Id_ZeroEntityInfo; + data.DataBaseId = DataBaseInitializerProvider.Id; + CommonSetting(data); + datas.Add(data); + } + + private void AddZeroDataBaseInfo(List datas) + { + var entityMappingService = new EntityMappingService(); + var data = entityMappingService.ConvertDbToEntityInfo(typeof(ZeroDatabaseInfo)); + data.Id = Id_ZeroDatabaseInfo; + data.DataBaseId = DataBaseInitializerProvider.Id; + CommonSetting(data); + datas.Add(data); + } + + private void AddZeroInterfaceList(List datas) + { + var entityMappingService = new EntityMappingService(); + var data = entityMappingService.ConvertDbToEntityInfo(typeof(ZeroInterfaceList)); + data.Id = Id_ZeroInterfaceList; + data.DataBaseId = DataBaseInitializerProvider.Id; + CommonSetting(data); + datas.Add(data); + } + private void AddZeroInterfaceCategory(List datas) + { + var entityMappingService = new EntityMappingService(); + var data = entityMappingService.ConvertDbToEntityInfo(typeof(ZeroInterfaceCategory)); + data.Id = Id_ZeroInterfaceCategory; + data.DataBaseId = DataBaseInitializerProvider.Id; + CommonSetting(data); + datas.Add(data); + } + + private void AddZeroTemplate(List datas) + { + var entityMappingService = new EntityMappingService(); + var data = entityMappingService.ConvertDbToEntityInfo(typeof(ZeroTemplate)); + data.Id = Id_ZeroTemplate; + data.DataBaseId = DataBaseInitializerProvider.Id; + CommonSetting(data); + datas.Add(data); + } + private void AddZeroTemplateType(List datas) + { + var entityMappingService = new EntityMappingService(); + var data = entityMappingService.ConvertDbToEntityInfo(typeof(ZeroTemplateType)); + data.Id = Id_ZeroTemplateType; + data.DataBaseId = DataBaseInitializerProvider.Id; + CommonSetting(data); + datas.Add(data); + } + private void AddZeroJwtTokenManagement(List datas) + { + var entityMappingService = new EntityMappingService(); + var data = entityMappingService.ConvertDbToEntityInfo(typeof(ZeroJwtTokenManagement)); + data.Id = Id_ZeroJwtTokenManagement; + data.DataBaseId = DataBaseInitializerProvider.Id; + CommonSetting(data); + datas.Add(data); + } + private void CommonSetting(ZeroEntityInfo data) + { + data.IsInitialized = true; + data.IsDeleted = false; + } + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/Items/InterfaceCategoryInitializerProvider.cs b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceCategoryInitializerProvider.cs new file mode 100644 index 0000000..c382ac3 --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceCategoryInitializerProvider.cs @@ -0,0 +1,253 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class InterfaceCategoryInitializerProvider + { + List zeroInterfaceCategory = new List() { }; + public InterfaceCategoryInitializerProvider(List zeroInterfaceCategory) + { + this.zeroInterfaceCategory = zeroInterfaceCategory; + } + + internal void Set() + { + SetIndexAndRoot(); + SetInterfaceDocument(); + SetInterfaceManager(); + SetSystemSetting(); + //SetDataDocument(); + } + + private void SetDataDocument() + { + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = DataDocumentRootId; + it.Name = TextHandler.GetInterfaceCategoryText(DataDocumentRootId); + it.ParentId = Id; + it.Icon = "mdi mdi-file-document-box"; + it.SortId = 500; + })); + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = DataDocumentManagerId; + it.Name = TextHandler.GetInterfaceCategoryText(DataDocumentManagerId); + it.ParentId = DataDocumentRootId; + it.Url = "/rezero/data_document.html"; + })); + } + private void SetSystemSetting() + { + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = SystemSettingId; + it.Name = TextHandler.GetInterfaceCategoryText(SystemSettingId); + it.ParentId = Id; + it.Icon = "mdi mdi-settings"; + it.SortId = 499; + })); + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id300007; + it.Name = TextHandler.GetInterfaceCategoryText(Id300007); + it.ParentId = SystemSettingId; + it.Url = "/rezero/authorization.html"; + it.SortId = 100000; + })); + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id300012; + it.Name = TextHandler.GetInterfaceCategoryText(Id300012); + it.ParentId = SystemSettingId; + it.Url = "/rezero/jwt_token_management.html"; + it.SortId = 100000; + })); + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id300013; + it.Name = TextHandler.GetInterfaceCategoryText(Id300013); + it.ParentId = SystemSettingId; + it.Url = "/rezero/interface_permission_management.html"; + it.SortId = 100000; + })); + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id300008; + it.Name = TextHandler.GetInterfaceCategoryText(Id300008); + it.ParentId = SystemSettingId; + it.Url = "/rezero/template.html"; + it.SortId = 5; + })); + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id300009; + it.Name = TextHandler.GetInterfaceCategoryText(300009); + it.ParentId = SystemSettingId; + it.Url = "/rezero/cache.html"; + it.SortId = 6; + })); + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id300010; + it.Name = TextHandler.GetInterfaceCategoryText(Id300010); + it.ParentId = SystemSettingId; + it.Url = "/rezero/sys_config.html"; + it.SortId = 8; + })); + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id300011; + it.Name = TextHandler.GetInterfaceCategoryText(Id300011); + it.ParentId = SystemSettingId; + it.Url = "/rezero/sys_user.html"; + it.SortId = 7; + })); + } + + private void SetIndexAndRoot() + { + if (SuperAPIModule._apiOptions!.UiOptions!.ShowNativeApiDocument == false) + { + return; + } + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id; + it.Name = TextHandler.GetInterfaceCategoryText(Id); + it.ParentId = Id-1; + it.SortId = 0; + })); + + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id1; + it.Name = TextHandler.GetInterfaceCategoryText(Id1); + it.ParentId = Id; + it.Url = "/rezero/index.html"; + it.Icon = "mdi mdi-home"; + })); + } + + private void SetInterfaceManager() + { + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id300; + it.Name = TextHandler.GetInterfaceCategoryText(Id300); + it.ParentId = Id; + it.SortId = 3; + it.Icon = "mdi mdi-database-plus"; + //it.Url= "/rezero/interface_manager.html"; + })); + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id300002; + it.Name = TextHandler.GetInterfaceCategoryText(Id300002); + it.ParentId = Id300; + it.SortId = 0; + it.Url= "/rezero/interface_categroy.html"; + })); + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id300003; + it.Name = TextHandler.GetInterfaceCategoryText(Id300003); + it.ParentId = Id300; + it.SortId = 1; + it.Url= "/rezero/database_manager.html"; + })); + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id300001; + it.Name = TextHandler.GetInterfaceCategoryText(Id300001); + it.ParentId = Id300; + it.Url="/rezero/entity_manager.html"; + it.SortId = 2; + })); + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id300006; + it.Name = TextHandler.GetInterfaceCategoryText(Id300006); + it.ParentId = Id300; + it.Url = "/rezero/interface_manager.html"; + it.SortId = 3; + })); + } + + private void SetInterfaceDocument() + { + //Dyanamic interface + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id200; + it.Name = TextHandler.GetInterfaceCategoryText(Id200); + it.ParentId = Id; + it.Icon = "mdi mdi-palette"; + it.SortId = 1; + + })); + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id200100; + it.Name = TextHandler.GetInterfaceCategoryText(Id200100); + it.ParentId = Id200; + it.Url = "/rezero/dynamic_interface.html?InterfaceCategoryId=" + Id200100; + })); + zeroInterfaceCategory.Last().IsInitialized = false; + + SystemDocment(); + } + + private void SystemDocment() + { + if (SuperAPIModule._apiOptions!.UiOptions!.ShowSystemApiDocument == true) + { + + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id100; + it.Name = TextHandler.GetInterfaceCategoryText(Id100); + it.ParentId = Id; + it.SortId = 999; + it.Icon = "mdi mdi-file-outline"; + })); + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id100002; + it.Name = TextHandler.GetInterfaceCategoryText(Id100002); + it.ParentId = Id100; + it.Url = "/rezero/internal_interface.html?InterfaceCategoryId=" + Id100002; + })); + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id100003; + it.Name = TextHandler.GetInterfaceCategoryText(Id100003); + it.ParentId = Id100; + it.Url = "/rezero/internal_interface.html?InterfaceCategoryId=" + Id100003; + })); + zeroInterfaceCategory.Add(GetNewItem(it => + { + it.Id = Id100004; + it.Name = TextHandler.GetInterfaceCategoryText(Id100004); + it.ParentId = Id100; + it.Url = "/rezero/internal_interface.html?InterfaceCategoryId=" + Id100004; + })); + } + } + + private static ZeroInterfaceCategory GetNewItem(Action action) + { + var result = new ZeroInterfaceCategory() + { + IsInitialized = true, + IsDeleted=false + }; + action(result); + return result; + } + } + +} diff --git a/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/Code.cs b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/Code.cs new file mode 100644 index 0000000..69211b6 --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/Code.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal partial class InterfaceListInitializerProvider + { + private void AddInit_CodeList() + { + GetDbTypeList(); + GetNativeTypeList(); + } + + private void GetDbTypeList() + { + ZeroInterfaceList data = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetDbTypeListId; + it.GroupName = nameof(MethodApi); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100004; + it.Name = TextHandler.GetInterfaceListText(GetDbTypeListId); + it.Url = GetUrl(it, "GetDbTypeList"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodClassFullName = typeof(MethodApi).FullName, + MethodArgsCount = 0, + MethodName = nameof(MethodApi.GetDbTypeSelectDataSource) + } + }; + }); + zeroInterfaceList.Add(data); + } + private void GetNativeTypeList() + { + ZeroInterfaceList data = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetNativeTypeId; + it.GroupName = nameof(MethodApi); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100004; + it.Name = TextHandler.GetInterfaceListText(GetNativeTypeId); + it.Url = GetUrl(it, "GetNativeTypeList"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodClassFullName = typeof(MethodApi).FullName, + MethodArgsCount = 0, + MethodName = nameof(MethodApi.GetNativeTypeSelectDataSource) + } + }; + }); + zeroInterfaceList.Add(data); + } + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/DatabaseInfo.cs b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/DatabaseInfo.cs new file mode 100644 index 0000000..71f3077 --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/DatabaseInfo.cs @@ -0,0 +1,333 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal partial class InterfaceListInitializerProvider + { + + + private void AddInit_DatabaseInfo() + { + GetDatabaseInfoAllList(); + + GetDatabaseInfoList(); + + DeleteDatabaseInfo(); + + AddDatabaseInfo(); + + UpdateDatabaseInfo(); + + GetDatabaseInfoById(); + + TestDatabaseInfo(); + + CreateDatabaseInfo(); + + SynchronousData(); + } + private void SynchronousData() + { + //获取数据库所有 + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = SynchronousDataId; + it.GroupName = nameof(ZeroEntityInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(SynchronousDataId); + it.Url = GetUrl(it, "SynchronousData"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 3, + ArgsTypes = new Type[] { typeof(long), typeof(long),typeof(bool) }, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.SynchronousData) + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name ="originalDb", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("基准数据库", "Original db") }, + new DataModelDefaultParameter() { Name ="targetDb", FieldOperator=FieldOperatorType.Equal, ValueType =typeof(long).Name, Description = TextHandler.GetCommonText("更新数据库", "Target db") }, + new DataModelDefaultParameter() { Name ="isBak", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name, Description = TextHandler.GetCommonText("是否备份", "Is bak") }, + } + }; + }); + zeroInterfaceList.Add(data1); + } + private void CreateDatabaseInfo() + { + //创建数据库 + ZeroInterfaceList data8 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = CreateDatabaseId; + it.GroupName = nameof(ZeroDatabaseInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(CreateDatabaseId); + it.Url = GetUrl(it, "CreateDatabaseInfo"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.DllCreateDb, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = "Connection", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(string).Name,Value=0, Description = TextHandler.GetCommonText("连接字符串", "Connection string") }, + new DataModelDefaultParameter() { Name = "DbType", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(string).Name,Value=0, Description = TextHandler.GetCommonText("库类型", "DbType") } + } + }; + }); + zeroInterfaceList.Add(data8); + } + + private void TestDatabaseInfo() + { + + //测试数据库 + ZeroInterfaceList data7 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = TestDatabaseId; + it.GroupName = nameof(ZeroDatabaseInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(TestDatabaseId); + it.Url = GetUrl(it, "TestDatabaseInfo"); + it.DataModel = new DataModel() + { + MyMethodInfo = new MyMethodInfo() + { + MethodClassFullName = typeof(MethodApi).FullName, + MethodArgsCount = 1, + MethodName = nameof(MethodApi.TestDb) + }, + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroDatabaseInfo.Id), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name,Value=0, Description = TextHandler.GetCommonText("主键", "Id") } + } + }; + }); + zeroInterfaceList.Add(data7); + } + + private void GetDatabaseInfoById() + { + //获取数据库根据主键获取详情 + ZeroInterfaceList data6 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetDbManIdById; + it.GroupName = nameof(ZeroDatabaseInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(GetCateTreeById); + it.Url = GetUrl(it, "GetDatabaseInfoById"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.QueryByPrimaryKey, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroDatabaseInfo.Id), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name,Value=0, Description = TextHandler.GetCommonText("主键", "Id") } + } + }; + }); + zeroInterfaceList.Add(data6); + } + + private void UpdateDatabaseInfo() + { + ZeroInterfaceList data5 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.POST.ToString(); + it.Id = EditDbManId; + it.GroupName = nameof(ZeroDatabaseInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(UpdateCateTreeId); + it.Url = GetUrl(it, "UpdateDatabaseInfo"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.UpdateObject, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name=nameof(ZeroDatabaseInfo.Id),ValueType = typeof(long).Name }, + new DataModelDefaultParameter() { + Name=nameof(ZeroDatabaseInfo.Name) , + ParameterValidate= + new ParameterValidate() + { + IsRequired=true + } , + ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { + Name=nameof(ZeroDatabaseInfo.DbType) ,ParameterValidate= + new ParameterValidate() + { + IsRequired=true + } , + ValueType = typeof(string).Name + }, + new DataModelDefaultParameter() + { + Name=nameof(ZeroDatabaseInfo.Connection), + ParameterValidate= + new ParameterValidate() + { + IsRequired=true + } ,ValueType = typeof(string).Name + } + } + }; + }); + zeroInterfaceList.Add(data5); + } + + private void AddDatabaseInfo() + { + ZeroInterfaceList data4 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.POST.ToString(); + it.Id = AddDbManId; + it.GroupName = nameof(ZeroDatabaseInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(AddCateTreeId); + it.Url = GetUrl(it, "AddDatabaseInfo"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.InsertObject, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name=nameof(ZeroDatabaseInfo.Name) ,ParameterValidate= + new ParameterValidate(){IsRequired=true},ValueType = typeof(string).Name }, new DataModelDefaultParameter() { Name=nameof(ZeroDatabaseInfo.Connection), ValueType = typeof(string).Name,ParameterValidate=new ParameterValidate(){IsRequired=true}}, + + new DataModelDefaultParameter() { Name=nameof(ZeroDatabaseInfo.DbType) ,ValueType = typeof(int).Name,ParameterValidate=new ParameterValidate(){ + IsRequired=true + }}, + + new DataModelDefaultParameter() { Name=nameof(ZeroDatabaseInfo.Creator), + InsertParameter=new InsertParameter(){IsUserName=true},Value="" ,ValueType = typeof(string).Name }, + + } + }; + }); + zeroInterfaceList.Add(data4); + } + + private void DeleteDatabaseInfo() + { + //删除数据库 + ZeroInterfaceList data3 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = DelDbManId; + it.GroupName = nameof(ZeroDatabaseInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(DeleteCateTreeId); + it.Url = GetUrl(it, "DeleteDatabaseInfo"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.BizDeleteObject, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroDatabaseInfo.Id), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name,Value=0, Description = TextHandler.GetCommonText("主键", "Id") }, + new DataModelDefaultParameter() { Name = nameof(ZeroDatabaseInfo.IsDeleted), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="true", Description = TextHandler.GetCommonText("是否删除", "IsDeleted") } + } + }; + }); + zeroInterfaceList.Add(data3); + } + + private void GetDatabaseInfoList() + { + //获取数据库列表 + ZeroInterfaceList data2 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = DbManId; + it.GroupName = nameof(ZeroDatabaseInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(IntCatePageListId); + it.Url = GetUrl(it, "GetDatabaseInfoList"); + it.CustomResultModel = new ResultModel() + { + ResultType = ResultType.Grid, + ResultColumnModels=new List() + { + new ResultColumnModel(){ PropertyName= nameof(ZeroDatabaseInfo.DbType) , ConvertType=typeof(DbType),ConvertType2=typeof(string), ResultColumnType= ResultColumnType.ConvertDefault } + } + }; + it.DataModel = new DataModel() + { + CommonPage = new DataModelPageParameter + { + PageSize = 20, + PageNumber = 1 + }, + Columns = new List() + { + + new DataColumnParameter(){ + PropertyName= nameof(ZeroDatabaseInfo.Id) , + Description=TextHandler.GetCommonText("ID", "Primary key") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroDatabaseInfo.Name) , + Description=TextHandler.GetCommonText("库说明", "Name") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroDatabaseInfo.DbType) , + Description=TextHandler.GetCommonText("类型", "Type") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroDatabaseInfo.Connection) , + Description=TextHandler.GetCommonText("字符串", "Connection") + }, + new DataColumnParameter(){ + PropertyName=nameof(ZeroDatabaseInfo.IsInitialized) , + Description=TextHandler.GetCommonText("系统数据", "System data") + }, + }, + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.QueryCommon, + DefaultParameters = new List() { + + new DataModelDefaultParameter() { Name = nameof(ZeroDatabaseInfo.Name), FieldOperator=FieldOperatorType.Like, ValueType = typeof(string).Name,Value=null , Description = TextHandler.GetCommonText("库说明", "Name") }, + new DataModelDefaultParameter() { Name=SuperAPIModule._apiOptions?.InterfaceOptions.PageNumberPropName ,Value=1,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("第几页", "Page number") }, + new DataModelDefaultParameter() { Name=SuperAPIModule._apiOptions?.InterfaceOptions.PageSizePropName ,Value=20,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("每页几条", "Pageize") }, + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.IsDeleted), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="false",ValueIsReadOnly=true, Description = TextHandler.GetCommonText("IsDeleted", "IsDeleted") }, + } + }; + }); + zeroInterfaceList.Add(data2); + } + + private void GetDatabaseInfoAllList() + { + //获取数据库所有 + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetDbAllId; + it.GroupName = nameof(ZeroDatabaseInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100004; + it.Name = TextHandler.GetInterfaceListText(GetDbAllId); + it.Url = GetUrl(it, "GetDatabaseInfoAllList"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.QueryCommon, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.IsDeleted), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="false",ValueIsReadOnly=true, Description = TextHandler.GetCommonText("IsDeleted", "IsDeleted") }, + } + }; + }); + zeroInterfaceList.Add(data1); + } + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/EntityColumn.cs b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/EntityColumn.cs new file mode 100644 index 0000000..86e4313 --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/EntityColumn.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal partial class InterfaceListInitializerProvider + { + private void AddInit_EntityColumnInfo() + { + GetEntityColuminsByEntityId(); + SaveEntityColumnInfos(); + CompareDatabaseStructure(); + CreateTable(); + } + private void GetEntityColuminsByEntityId() + { + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetEntityColumnsByEntityId_Id; + it.GroupName = nameof(ZeroEntityColumnInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(GetEntityColumnsByEntityId_Id); + it.Url = GetUrl(it, "GetEntityColuminsByEntityId"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroColumnInfo, + ActionType = ActionType.QueryCommon, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroEntityColumnInfo.TableId), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name,Value=0, Description = TextHandler.GetCommonText("实体Id", "Entity id") } + } + }; + }); + zeroInterfaceList.Add(data1); + } + + private void SaveEntityColumnInfos() + { + //修改实体 + ZeroInterfaceList data5 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.POST.ToString(); + it.Id = UpdateEntityColumnInfosId; + it.GroupName = nameof(ZeroEntityColumnInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(UpdateEntityColumnInfosId); + it.Url = GetUrl(it, "SaveEntityColumnInfos"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroColumnInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo=new MyMethodInfo() + { + MethodArgsCount = 1, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.AddOrUpdateEntityColumninfos) + + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name="Columns", Description="List序列化的Json格式",ValueType = typeof(string).Name }, + } + }; + }); + zeroInterfaceList.Add(data5); + } + + private void CompareDatabaseStructure() + { + //修改实体 + ZeroInterfaceList data5 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.POST.ToString(); + it.Id = CompareDatabaseStructureId; + it.GroupName = nameof(ZeroEntityColumnInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(CompareDatabaseStructureId); + it.Url = GetUrl(it, "CompareDatabaseStructure"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroColumnInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 1, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.CompareDatabaseStructure), + ArgsTypes=new Type[] { typeof(List) } + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name="ids", Description="格式:[1,2,3] 表实体Id数组字符串",ValueType = typeof(string).Name }, + } + }; + }); + zeroInterfaceList.Add(data5); + } + + + private void CreateTable() + { + //修改实体 + ZeroInterfaceList data5 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.POST.ToString(); + it.Id = CreateTablesId; + it.GroupName = nameof(ZeroEntityColumnInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(CreateTablesId); + it.Url = GetUrl(it, "CreateTables"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroColumnInfo, + ActionType = ActionType.DllCreateTables, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 1, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.CompareDatabaseStructure), + ArgsTypes = new Type[] { typeof(List) } + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name="ids", Description="格式:[1,2,3] 表实体Id数组字符串",ValueType = typeof(string).Name }, + } + }; + }); + zeroInterfaceList.Add(data5); + } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/EntityInfo.cs b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/EntityInfo.cs new file mode 100644 index 0000000..cc25c02 --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/EntityInfo.cs @@ -0,0 +1,328 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal partial class InterfaceListInitializerProvider + { + private void AddInit_EntityInfo() + { + GetEntityInoList(); + + DeleteEntityInfo(); + + AddEntityInfo(); + + UpdateEntityInfo(); + + GetEntityInfoById(); + + ImportEntities(); + } + + private void GetEntityInfoById() + { + //根据主键获取实体 + ZeroInterfaceList data6 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetEntityInfoById_Id; + it.GroupName = nameof(ZeroInterfaceCategory); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(GetEntityInfoById_Id); + it.Url = GetUrl(it, "GetEntityInfoById"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroEntityInfo, + ActionType = ActionType.QueryByPrimaryKey, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.Id), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name,Value=0, Description = TextHandler.GetCommonText("主键", "Id") } + } + }; + }); + zeroInterfaceList.Add(data6); + } + + private void UpdateEntityInfo() + { + //修改实体 + ZeroInterfaceList data5 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.POST.ToString(); + it.Id = UpdateEntityInfoId; + it.GroupName = nameof(ZeroEntityInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(UpdateEntityInfoId); + it.Url = GetUrl(it, "UpdateEntityInfo"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroEntityInfo, + ActionType = ActionType.UpdateObject, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name=nameof(ZeroEntityInfo.Id),ValueType = typeof(long).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroEntityInfo.ClassName) ,ParameterValidate= + new ParameterValidate() + { + IsRequired=true, + IsUnique=true + } ,ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroEntityInfo.DbTableName) ,ParameterValidate= + new ParameterValidate() + { + IsRequired=true, + IsUnique=true + } ,ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroEntityInfo.DataBaseId), ParameterValidate= new ParameterValidate() + { + IsRequired=true + },ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroEntityInfo.Description),ValueType = typeof(string).Name }, + } + }; + }); + zeroInterfaceList.Add(data5); + } + + private void AddEntityInfo() + { + //添加实体 + ZeroInterfaceList data4 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.POST.ToString(); + it.Id = AddEntityInfoId; + it.GroupName = nameof(ZeroEntityInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(AddEntityInfoId); + it.Url = GetUrl(it, "AddEntityInfo"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroEntityInfo, + ActionType = ActionType.InsertObject, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { + Name=nameof(ZeroEntityInfo.ClassName) , + ParameterValidate=new ParameterValidate(){IsRequired=true,IsUnique=true},ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { + Name=nameof(ZeroEntityInfo.DbTableName) , + ParameterValidate=new ParameterValidate(){IsRequired=true,IsUnique=true},ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { + Name=nameof(ZeroEntityInfo.DataBaseId) , + ParameterValidate= + new ParameterValidate() + { + IsRequired=true + }, + + ValueType = typeof(long).Name }, + new DataModelDefaultParameter() { + Name=nameof(ZeroEntityInfo.Description) , + ValueType = typeof(string).Name }, + DataInitHelper.GetIsDynamicParameter(), + new DataModelDefaultParameter() { + Name=nameof(ZeroEntityInfo.Creator), + InsertParameter=new InsertParameter(){ + IsUserName=true + }, + Value="" , + ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { + Name=nameof(ZeroEntityInfo.CreateTime), + InsertParameter=new InsertParameter(){ + IsDateTimeNow=true + }, + Value="" , + ValueType = typeof(string).Name }, + + } + }; + }); + zeroInterfaceList.Add(data4); + } + + private void DeleteEntityInfo() + { + //实体删除 + ZeroInterfaceList data3 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = DeleteEntityInfoById; + it.GroupName = nameof(ZeroEntityInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(DeleteEntityInfoById); + it.Url = GetUrl(it, "DeleteEntityInfo"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroEntityInfo, + ActionType = ActionType.BizDeleteObject, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroEntityInfo.Id), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name,Value=0, Description = TextHandler.GetCommonText("主键", "Id") }, + new DataModelDefaultParameter() { Name = nameof(ZeroEntityInfo.IsDeleted), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="true", Description = TextHandler.GetCommonText("是否删除", "IsDeleted") } + } + }; + }); + zeroInterfaceList.Add(data3); + } + + private void GetEntityInoList() + { + //获取实体列表 + ZeroInterfaceList data2 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetEntityInfoListId; + it.GroupName = nameof(ZeroEntityInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(GetEntityInfoListId); + it.Url = GetUrl(it, "GetEntityInoList"); + it.CustomResultModel = new ResultModel() + { + ResultType = ResultType.Grid, + ResultColumnModels = new List() + { + //new ResultColumnModel() + //{ + // ResultColumnType=ResultColumnType.SubqueryName, + // PropertyName= nameof(ZeroEntityInfo.DataBaseId), + //}, + new ResultColumnModel() + { + ResultColumnType=ResultColumnType.ConvertDefaultTimeString, + PropertyName= nameof(ZeroEntityInfo.CreateTime), + } + } + }; + it.DataModel = new DataModel() + { + CommonPage = new DataModelPageParameter + { + PageSize = 20, + PageNumber = 1 + }, + SelectParameters=new List() + { + new DataModelSelectParameters() + { + TableIndex=0, + IsTableAll=true + }, + new DataModelSelectParameters() + { + TableIndex=1, + Name=nameof(ZeroDatabaseInfo.Name), + AsName=PubConst.Orm_DataBaseNameDTO, + + } + }, + JoinParameters=new List() + { new DataModelJoinParameters() + { + JoinType=SqlSugar.JoinType.Left, + JoinTableId= EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + OnList=new List() + { + new JoinParameter() + { + LeftPropertyName=nameof(ZeroEntityInfo.DataBaseId), + LeftIndex=0, + FieldOperator=FieldOperatorType.Equal, + RightPropertyName=nameof(ZeroDatabaseInfo.Id), + RightIndex=1 + }, + + } + }, + }, + Columns = new List() + { + + new DataColumnParameter(){ + PropertyName= nameof(ZeroEntityInfo.Id) , + Description=TextHandler.GetCommonText("ID", "Primary key") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroEntityInfo.ClassName) , + Description=TextHandler.GetCommonText("实体名", "Class name") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroEntityInfo.DbTableName) , + Description=TextHandler.GetCommonText("表名", "Table name") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroEntityInfo.Description) , + Description=TextHandler.GetCommonText("备注", "Description") + }, + new DataColumnParameter(){ + PropertyName=PubConst.Orm_DataBaseNameDTO , + Description=TextHandler.GetCommonText("数据库", "DataBase Name") + }, + new DataColumnParameter(){ + PropertyName=nameof(ZeroEntityInfo.IsInitialized) , + Description=TextHandler.GetCommonText("系统数据", "System data") + }, + new DataColumnParameter(){ + PropertyName=nameof(ZeroEntityInfo.CreateTime) , + Description=TextHandler.GetCommonText("创建时间", "Create time") + }, + new DataColumnParameter(){ + PropertyName=nameof(ZeroEntityInfo.ColumnCount) , + Description=TextHandler.GetCommonText("列数", "Column count") + } + }, + TableId = EntityInfoInitializerProvider.Id_ZeroEntityInfo, + ActionType = ActionType.QueryCommon, + OrderDynamicParemters=new List() { + new DataModelDynamicOrderParemter(){ FieldName=nameof(ZeroInterfaceCategory.Id),OrderByType=SqlSugar.OrderByType.Desc } + }, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroEntityInfo.IsDeleted), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="false",ValueIsReadOnly=true, Description = TextHandler.GetCommonText("IsDeleted", "IsDeleted") }, + new DataModelDefaultParameter() { Name = nameof(ZeroEntityInfo.IsInitialized), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="false",ValueIsReadOnly=true, Description = TextHandler.GetCommonText("是否系统数据", "IsInitialized") }, + new DataModelDefaultParameter() { Name = nameof(ZeroEntityInfo.DataBaseId), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name , Description = TextHandler.GetCommonText("数据库ID", "Database id") }, + new DataModelDefaultParameter() { Name = nameof(ZeroEntityInfo.ClassName), FieldOperator=FieldOperatorType.Like, ValueType = typeof(string).Name,Value=null , Description = TextHandler.GetCommonText("名称", "class Name") }, + new DataModelDefaultParameter() { Name = nameof(ZeroEntityInfo.DbTableName),MergeForName=nameof(ZeroEntityInfo.ClassName) }, + new DataModelDefaultParameter() { Name = nameof(ZeroEntityInfo.Description),MergeForName=nameof(ZeroEntityInfo.ClassName) }, + new DataModelDefaultParameter() { Name=SuperAPIModule._apiOptions?.InterfaceOptions.PageNumberPropName ,Value=1,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("第几页", "Page number") }, + new DataModelDefaultParameter() { Name=SuperAPIModule._apiOptions?.InterfaceOptions.PageSizePropName ,Value=20,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("每页几条", "Pageize") }, + new DataModelDefaultParameter() { Name="OrderByType" ,Value=20,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(string).Name, Description = TextHandler.GetCommonText("排序类型", "SortType") }, + new DataModelDefaultParameter() { Name="OrderByName" ,Value=20,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(string).Name, Description = TextHandler.GetCommonText("排序字段", "SortName") } + } + }; + }); + zeroInterfaceList.Add(data2); + } + + private void ImportEntities() + { + //获取数据库所有 + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = ImportEntitiesId; + it.GroupName = nameof(ZeroEntityInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(ImportEntitiesId); + it.Url = GetUrl(it, "ImportEntities"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 2, + ArgsTypes = new Type[] {typeof(long), typeof(List) }, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.ImportEntities) + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name ="databasdeId", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("数据库Id", "Database id") }, + new DataModelDefaultParameter() { Name ="tableNames", FieldOperator=FieldOperatorType.Equal, ValueType = PubConst.Orm_ApiParameterJsonArray, Description = TextHandler.GetCommonText("List 如:[表名1,表名2]", "List [tableName1,tableName2]") }, + } + }; + }); + zeroInterfaceList.Add(data1); + } + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/Interface.cs b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/Interface.cs new file mode 100644 index 0000000..ef21722 --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/Interface.cs @@ -0,0 +1,268 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal partial class InterfaceListInitializerProvider + { + public void AddInit_ZeroInterfaceList() + { + Intenal(); + + Dynamic(); + + GetDynamicGroupNameList(); + + } + + private void GetDynamicGroupNameList() + { + + ZeroInterfaceList data2 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = IntCateGroupNameListId; + it.GroupName = nameof(ZeroInterfaceList); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100004; + it.Name = TextHandler.GetInterfaceListText(IntCateGroupNameListId); + it.Url = GetUrl(it, "GetDynamicGroupNameList"); + it.DataModel = new DataModel() + { + Columns = new List() + { + + new DataColumnParameter(){ + PropertyName= nameof(ZeroInterfaceCategory.Name) , + Description=TextHandler.GetCommonText("名称", "GroupName") + } + }, + SelectParameters = new List() + { + new DataModelSelectParameters() + { + Name=nameof(ZeroInterfaceList.GroupName), + AsName=nameof(ZeroInterfaceList.GroupName) + } + }, + TableId = EntityInfoInitializerProvider.Id_ZeroInterfaceList, + ActionType = ActionType.QueryCommon, + GroupParemters = new List() + { + new DataModelGroupParameter() + { + FieldName="GroupName", + } + }, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.IsDeleted), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="false",ValueIsReadOnly=true, Description = TextHandler.GetCommonText("IsDeleted", "IsDeleted") }, + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.IsInitialized), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="false",ValueIsReadOnly=true, Description = TextHandler.GetCommonText("IsInitialized", "IsInitialized") }, + } + }; + }); + zeroInterfaceList.Add(data2); + } + private void Dynamic() + { + ////动态测试接口 + //ZeroInterfaceList data3 = GetNewItem(it => + //{ + // it.HttpMethod = HttpRequestMethod.GET.ToString(); + // it.Id = TestId; + // it.GroupName = nameof(ZeroInterfaceList); + // it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id200100; + // it.Name = TextHandler.GetInterfaceListText(TestId); + // it.Url = "/MyTest/API"; + // it.DataModel = new DataModel() + // { + // TableId = EntityInfoInitializerProvider.Id_ZeroInterfaceList, + // ActionType = ActionType.QueryByPrimaryKey, + // DefaultParameters = new List() { + // new DataModelDefaultParameter(){ + // Name="Id", + // ParameterValidate=new ParameterValidate{ + // IsRequired=true + // }, + // FieldOperator=FieldOperatorType.Equal, + // ValueType=typeof(long).Name, + // Description=TextHandler.GetCommonText("根据主键获取接口","Get interface detail") }, + // } + // }; + // it.IsInitialized = false; + //}); + //zeroInterfaceList.Add(data3); + + + //获取动态接口加分页 + ZeroInterfaceList data = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = DynamicIntPageListId; + it.CustomResultModel = new ResultModel() { ResultType = ResultType.Grid }; + it.GroupName = nameof(ZeroInterfaceList); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(DynamicIntPageListId); + it.Url = GetUrl(it, "GetDynamicInterfacePageList"); + it.DataModel = new DataModel() + { + JoinParameters = new List() { + new DataModelJoinParameters(){ + JoinTableId=EntityInfoInitializerProvider.Id_ZeroInterfaceCategory, + JoinType=JoinType.Left, + OnList=new List() + { + new JoinParameter(){ + LeftIndex=0, + LeftPropertyName=nameof(ZeroInterfaceList.InterfaceCategoryId), + RightIndex=1, + RightPropertyName=nameof(ZeroInterfaceCategory.Id), + FieldOperator=FieldOperatorType.Equal + } + } + } + }, + CommonPage = new DataModelPageParameter() + { + PageNumber = 1, + PageSize = 20 + }, + OrderByFixedParemters=new List() + { + new DataModelOrderParemter(){ + FieldName="ID", + OrderByType=OrderByType.Desc + } + }, + SelectParameters = new List() + { + new DataModelSelectParameters() + { + TableIndex=0, + IsTableAll=true + }, + new DataModelSelectParameters() + { + TableIndex=1, + Name=nameof(ZeroInterfaceCategory.Name), + AsName=PubConst.Orm_InterfaceCategroyNameDTO, + + } + }, + Columns = new List() + { + + new DataColumnParameter(){ + PropertyName= nameof(ZeroInterfaceList.Id) , + Description=TextHandler.GetCommonText("ID", "Primary key") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroInterfaceList.Name) , + Description=TextHandler.GetCommonText("名称", "Name") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroInterfaceList.GroupName) , + Description=TextHandler.GetCommonText("分组", "Group") + }, + new DataColumnParameter(){ + PropertyName=PubConst.Orm_InterfaceCategroyNameDTO , + Description=TextHandler.GetCommonText("分类", "Interface categroy") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroInterfaceList.Url) , + Description=TextHandler.GetCommonText("接口地址", "Url") + } + }, + TableId = EntityInfoInitializerProvider.Id_ZeroInterfaceList, + ActionType = ActionType.QueryCommon, + DefaultParameters = new List() { + new DataModelDefaultParameter(){ Name="InterfaceCategoryId",FieldOperator=FieldOperatorType.In, ValueType=typeof(long).Name, Description=TextHandler.GetCommonText("接口分类Id","Interface Category Id") }, + new DataModelDefaultParameter(){ Name="Name", FieldOperator=FieldOperatorType.Like, ValueType=typeof(string).Name, Description=TextHandler.GetCommonText("接口名称","Interface Name") }, + new DataModelDefaultParameter(){ Name="GroupName", FieldOperator=FieldOperatorType.Like, ValueType=typeof(string).Name, Description=TextHandler.GetCommonText("接口分组","Group Name") }, + new DataModelDefaultParameter() { Name = "IsInitialized",Value=false,ValueIsReadOnly=true,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name, Description = TextHandler.GetCommonText("是否内置数据", "Is initialized") }, + new DataModelDefaultParameter() { Name = "IsDeleted",Value=false,ValueIsReadOnly=true,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name, Description = TextHandler.GetCommonText("是否删除", "Is deleted") }, + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceList.IsAttributeMethod),Value=false,ValueIsReadOnly=true,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name, Description = TextHandler.GetCommonText("是否是特性方法", "Is attribute method") }, + new DataModelDefaultParameter(){ Name="Url",MergeForName="Name",ValueIsReadOnly=true, FieldOperator=FieldOperatorType.Like, ValueType=typeof(string).Name, Description=TextHandler.GetCommonText("Url","Url") }, + new DataModelDefaultParameter(){ Name="DatabaseId", FieldOperator=FieldOperatorType.Equal, ValueType=typeof(long).Name, Description=TextHandler.GetCommonText("数据库Id","Database id") }, + new DataModelDefaultParameter() { Name=SuperAPIModule._apiOptions?.InterfaceOptions.PageNumberPropName ,Value=1,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("第几页", "Page number") }, + new DataModelDefaultParameter() { Name=SuperAPIModule._apiOptions?.InterfaceOptions.PageSizePropName ,Value=20,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("每页几条", "Pageize") } + } + }; + }); + zeroInterfaceList.Add(data); + + + //动态接口分类删除 + ZeroInterfaceList data2 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = DeleteDynamicIntId; + it.GroupName = nameof(ZeroInterfaceList); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(DeleteDynamicIntId); + it.Url = GetUrl(it, "DeleteDynamicInterface"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroInterfaceList, + ActionType = ActionType.BizDeleteObject, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.Id), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name,Value=0, Description = TextHandler.GetCommonText("主键", "Id") }, + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.IsDeleted), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="true", Description = TextHandler.GetCommonText("是否删除", "IsDeleted") } + } + }; + }); + zeroInterfaceList.Add(data2); + } + + private void Intenal() + { + //内部接口列表 + ZeroInterfaceList data = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = IntIntListId; + it.CustomResultModel = new ResultModel() { ResultType = ResultType.Group, GroupName = nameof(ZeroInterfaceList.GroupName) }; + it.GroupName = nameof(ZeroInterfaceList); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(IntIntListId); + it.Url = GetUrl(it, "GetInternalInterfaceList"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroInterfaceList, + ActionType = ActionType.QueryCommon, + DefaultParameters = new List() { + new DataModelDefaultParameter(){ Name="InterfaceCategoryId",FieldOperator=FieldOperatorType.In, ValueType=typeof(long).Name, Description=TextHandler.GetCommonText("接口分类Id","Interface Category Id") }, + new DataModelDefaultParameter(){ Name="DatabaseId",FieldOperator=FieldOperatorType.Equal, ValueType=typeof(long).Name, Description=TextHandler.GetCommonText("数据库Id","Database id") }, + new DataModelDefaultParameter(){ Name="Name", FieldOperator=FieldOperatorType.Like, ValueType=typeof(string).Name, Description=TextHandler.GetCommonText("接口名称","Interface Name") }, + new DataModelDefaultParameter() { Name = "IsInitialized",FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name, Description = TextHandler.GetCommonText("是否内置数据", "Is initialized") }, + new DataModelDefaultParameter() { Name = "IsDeleted",Value=false,ValueIsReadOnly=true,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name, Description = TextHandler.GetCommonText("是否删除", "Is deleted") }, + new DataModelDefaultParameter(){ Name="Url",MergeForName="Name",ValueIsReadOnly=true, FieldOperator=FieldOperatorType.Like, ValueType=typeof(string).Name, Description=TextHandler.GetCommonText("Url","Url") }, + } + }; + }); + zeroInterfaceList.Add(data); + + //内部接口列表详情 + ZeroInterfaceList data2 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = IntDetId; + it.GroupName = nameof(ZeroInterfaceList); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(IntDetId); + it.Url = GetUrl(it, "GetInternalDetail"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroInterfaceList, + ActionType = ActionType.QueryByPrimaryKey, + DefaultParameters = new List() { + new DataModelDefaultParameter(){ Name="Id", ParameterValidate=new ParameterValidate{ + IsRequired=true + },FieldOperator=FieldOperatorType.Equal, ValueType=typeof(long).Name, Description=TextHandler.GetCommonText("根据主键获取接口","Get interface detail") }, + } + }; + }); + zeroInterfaceList.Add(data2); + } + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/InterfaceCategory.cs b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/InterfaceCategory.cs new file mode 100644 index 0000000..a1fa3a3 --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/InterfaceCategory.cs @@ -0,0 +1,267 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal partial class InterfaceListInitializerProvider + { + + public void AddInit_InterfaceCategory() + { + GetInterfaceCategoryTree(); + + GetDynamicInterfaceCategoryPageList(); + + DeleteDynamicInterfaceCategory(); + + AddDynamicInterfaceCategory(); + + UpdateDynamicInterfaceCategory(); + + GetDynamicInterfaceCategoryById(); + + GetDynamicInterfaceCategoryList(); + } + + private void GetDynamicInterfaceCategoryById() + { + //动态接口分类根据主键获取详情 + ZeroInterfaceList data6 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetCateTreeById; + it.GroupName = nameof(ZeroInterfaceCategory); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(GetCateTreeById); + it.Url = GetUrl(it, "GetDynamicInterfaceCategoryById"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroInterfaceCategory, + ActionType = ActionType.QueryByPrimaryKey, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.Id), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name,Value=0, Description = TextHandler.GetCommonText("主键", "Id") } + } + }; + }); + zeroInterfaceList.Add(data6); + } + + private void UpdateDynamicInterfaceCategory() + { + //修改动态接口分类 + ZeroInterfaceList data5 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.POST.ToString(); + it.Id = UpdateCateTreeId; + it.GroupName = nameof(ZeroInterfaceCategory); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(UpdateCateTreeId); + it.Url = GetUrl(it, "UpdateDynamicInterfaceCategory"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroInterfaceCategory, + ActionType = ActionType.UpdateObject, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name=nameof(ZeroInterfaceCategory.Id),ValueType = typeof(long).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroInterfaceCategory.Name) ,ParameterValidate= + new ParameterValidate() + { + IsRequired=true + } ,ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroInterfaceCategory.Description),ValueType = typeof(string).Name } + } + }; + }); + zeroInterfaceList.Add(data5); + } + + private void AddDynamicInterfaceCategory() + { + //添加动态接口分类 + ZeroInterfaceList data4 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.POST.ToString(); + it.Id = AddCateTreeId; + it.GroupName = nameof(ZeroInterfaceCategory); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(AddCateTreeId); + it.Url = GetUrl(it, "AddDynamicInterfaceCategory"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroInterfaceCategory, + ActionType = ActionType.InsertObject, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name=nameof(ZeroInterfaceCategory.Name) ,ParameterValidate= + new ParameterValidate() + { + IsRequired=true + },ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroInterfaceCategory.ParentId),Value=InterfaceCategoryInitializerProvider.Id200,ValueIsReadOnly=true,ValueType = typeof(long).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroInterfaceCategory.Description) ,ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroInterfaceCategory.Url),ValueIsReadOnly=true,Value= "/rezero/dynamic_interface.html?InterfaceCategoryId="+PubConst.Ui_TreeUrlFormatId,ValueType = typeof(string).Name }, + DataInitHelper.GetIsDynamicParameter(), + new DataModelDefaultParameter() { Name=nameof(ZeroInterfaceCategory.Creator), + InsertParameter=new InsertParameter(){ + IsUserName=true + },Value="" ,ValueType = typeof(string).Name }, + + } + }; + }); + zeroInterfaceList.Add(data4); + } + + private void DeleteDynamicInterfaceCategory() + { + //动态接口分类删除 + ZeroInterfaceList data3 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = DeleteCateTreeId; + it.GroupName = nameof(ZeroInterfaceCategory); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(DeleteCateTreeId); + it.Url = GetUrl(it, "DeleteDynamicInterfaceCategory"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroInterfaceCategory, + ActionType = ActionType.BizDeleteObject, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.Id), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name,Value=0, Description = TextHandler.GetCommonText("主键", "Id") }, + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.IsDeleted), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="true", Description = TextHandler.GetCommonText("是否删除", "IsDeleted") } + } + }; + }); + zeroInterfaceList.Add(data3); + } + + private void GetDynamicInterfaceCategoryPageList() + { + //获取动态接口分类 + ZeroInterfaceList data2 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = IntCatePageListId; + it.GroupName = nameof(ZeroInterfaceCategory); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(IntCatePageListId); + it.Url = GetUrl(it, "GetDynamicInterfaceCategoryPageList"); + it.CustomResultModel = new ResultModel() + { + ResultType = ResultType.Grid + }; + it.DataModel = new DataModel() + { + CommonPage = new DataModelPageParameter + { + PageSize = 20, + PageNumber = 1 + }, + Columns = new List() + { + + new DataColumnParameter(){ + PropertyName= nameof(ZeroInterfaceCategory.Id) , + Description=TextHandler.GetCommonText("ID", "Primary key") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroInterfaceCategory.Name) , + Description=TextHandler.GetCommonText("名称", "Name") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroInterfaceCategory.Description) , + Description=TextHandler.GetCommonText("备注", "Description") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroInterfaceCategory.Url) , + Description=TextHandler.GetCommonText("跳转地址", "Url") + } + }, + TableId = EntityInfoInitializerProvider.Id_ZeroInterfaceCategory, + ActionType = ActionType.QueryCommon, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.ParentId), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name,Value=200,ValueIsReadOnly=true, Description = TextHandler.GetCommonText("上级Id", "ParentId") }, + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.IsDeleted), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="false",ValueIsReadOnly=true, Description = TextHandler.GetCommonText("IsDeleted", "IsDeleted") }, + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.Name), FieldOperator=FieldOperatorType.Like, ValueType = typeof(string).Name,Value=null , Description = TextHandler.GetCommonText("名称", "Name") }, + new DataModelDefaultParameter() { Name=SuperAPIModule._apiOptions?.InterfaceOptions.PageNumberPropName ,Value=1,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("第几页", "Page number") }, + new DataModelDefaultParameter() { Name=SuperAPIModule._apiOptions?.InterfaceOptions.PageSizePropName ,Value=20,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("每页几条", "Pageize") } + } + }; + }); + zeroInterfaceList.Add(data2); + } + + + private void GetDynamicInterfaceCategoryList() + { + //获取动态接口分类 + ZeroInterfaceList data2 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = IntCateListId; + it.GroupName = nameof(ZeroInterfaceCategory); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100004; + it.Name = TextHandler.GetInterfaceListText(IntCateListId); + it.Url = GetUrl(it, "GetDynamicInterfaceCategoryList"); + it.DataModel = new DataModel() + { + Columns = new List() + { + + new DataColumnParameter(){ + PropertyName= nameof(ZeroInterfaceCategory.Id) , + Description=TextHandler.GetCommonText("ID", "Primary key") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroInterfaceCategory.Name) , + Description=TextHandler.GetCommonText("名称", "Name") + } + }, + TableId = EntityInfoInitializerProvider.Id_ZeroInterfaceCategory, + ActionType = ActionType.QueryCommon, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.ParentId), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name,Value=200,ValueIsReadOnly=true, Description = TextHandler.GetCommonText("上级Id", "ParentId") }, + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.IsDeleted), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="false",ValueIsReadOnly=true, Description = TextHandler.GetCommonText("IsDeleted", "IsDeleted") }, + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.Name), FieldOperator=FieldOperatorType.Like, ValueType = typeof(string).Name,Value=null , Description = TextHandler.GetCommonText("名称", "Name") } + } + }; + }); + zeroInterfaceList.Add(data2); + } + + private void GetInterfaceCategoryTree() + { + //接口分类树 + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = IntCateTreeId; + it.GroupName = nameof(ZeroInterfaceCategory); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100002; + it.Name = TextHandler.GetInterfaceListText(IntCateTreeId); + it.Url = GetUrl(it, "GetInterfaceCategoryList"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroInterfaceCategory, + ActionType = ActionType.QueryTree, + TreeParameter = new DataModelTreeParameter() + { + ChildPropertyName = nameof(ZeroInterfaceCategory.SubInterfaceCategories), + RootValue = 0, + CodePropertyName = nameof(ZeroInterfaceCategory.Id), + ParentCodePropertyName = nameof(ZeroInterfaceCategory.ParentId), + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name=nameof(ZeroInterfaceCategory.Id) ,Value=InterfaceCategoryInitializerProvider.Id,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("根目录ID", "Root id") }, + + } + }; + }); + zeroInterfaceList.Add(data1); + } + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/Other.cs b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/Other.cs new file mode 100644 index 0000000..231a73a --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/Other.cs @@ -0,0 +1,714 @@ +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; +using System.Text.Json.Nodes; + +namespace ReZero.SuperAPI +{ + internal partial class InterfaceListInitializerProvider + { + private void AddInit_Other() + { + GetImportTables(); + GetActionType(); + GetAllTables(); + SaveInterfaceList(); + GetWhereTypeList(); + GetToKen(); + GetUserInfo(); + ExecuetSql(); + GetSetting(); + UpdateSetting(); + ExportEntities(); + GetDefalutTemplate(); + GetTemplateFormatJson(); + ExecTemplate(); + ExecTemplateByTableIds(); + ClearAllInternalCache(); + ExecuetSqlReturnExcel(); + GetUserInfoPageList(); + GetZeroJwtTokenManagementPage(); + } + private void GetZeroJwtTokenManagementPage() + { + ZeroInterfaceList data = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetZeroJwtTokenManagementPageId; + it.GroupName = nameof(ZeroJwtTokenManagement); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(GetZeroJwtTokenManagementPageId); + it.Url = GetUrl(it, "GetZeroJwtTokenManagementPage"); + it.CustomResultModel = new ResultModel() + { + ResultType = ResultType.Grid, + ResultColumnModels = new List() + { + new ResultColumnModel() + { + ResultColumnType = ResultColumnType.ConvertDefaultTimeString, + PropertyName = nameof(ZeroJwtTokenManagement.CreateTime), + }, + new ResultColumnModel() + { + ResultColumnType = ResultColumnType.ConvertDefaultTimeString, + PropertyName = nameof(ZeroJwtTokenManagement.Expiration), + } + }, + + }; + + it.DataModel = new DataModel() + { + Columns = new List() + { + new DataColumnParameter(){ + PropertyName= nameof(ZeroJwtTokenManagement.Id) , + Description=TextHandler.GetCommonText("ID", "Primary key") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroJwtTokenManagement.UserName) , + Description=TextHandler.GetCommonText("用户名", "User name") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroJwtTokenManagement.Description) , + Description=TextHandler.GetCommonText("描述", "Description") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroJwtTokenManagement.Expiration) , + Description=TextHandler.GetCommonText("使用期限", "Expiration") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroJwtTokenManagement.Token) , + Description=TextHandler.GetCommonText("JWT Token", "JWT Token") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroJwtTokenManagement.Creator) , + Description=TextHandler.GetCommonText("创建人", "Creator") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroJwtTokenManagement.CreateTime) , + Description=TextHandler.GetCommonText("创建时间", "Create time") + } + }, + TableId = EntityInfoInitializerProvider.Id_ZeroJwtTokenManagement, + ActionType = ActionType.QueryCommon, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroJwtTokenManagement.UserName), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(string).Name, Description = TextHandler.GetCommonText("用户名", "User name") }, + new DataModelDefaultParameter() { Name=SuperAPIModule._apiOptions?.InterfaceOptions.PageNumberPropName ,Value=1,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("第几页", "Page number") }, + new DataModelDefaultParameter() { Name=SuperAPIModule._apiOptions?.InterfaceOptions.PageSizePropName ,Value=20,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("每页几条", "Page size") }, + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.IsDeleted), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="false",ValueIsReadOnly=true, Description = TextHandler.GetCommonText("IsDeleted", "IsDeleted") }, + }, + CommonPage = new DataModelPageParameter() + { + PageNumber = 1, + PageSize = 20 + }, + OrderDynamicParemters = new List() { + new DataModelDynamicOrderParemter(){ FieldName=nameof(ZeroJwtTokenManagement.Id),OrderByType=SqlSugar.OrderByType.Desc } + }, + }; + }); + zeroInterfaceList.Add(data); + } + private void SaveInterfaceList() + { + //获取数据库所有 + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = SaveInterfaceListId; + it.GroupName = nameof(ZeroInterfaceList); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(SaveInterfaceListId); + it.Url = GetUrl(it, "SaveInterfaceList"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroInterfaceList, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 1, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.SaveInterfaceList) + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { IsSingleParameter=true, Name ="model", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(JObject).Name, Description = TextHandler.GetCommonText("动态json", "json parameter") }, + } + }; + }); + zeroInterfaceList.Add(data1); + } + + private void GetImportTables() + { + //获取导入的表 + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetImportTablesId; + it.GroupName = nameof(DbTableInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100004; + it.Name = TextHandler.GetInterfaceListText(GetImportTablesId); + it.Url = GetUrl(it, "GetImportTables"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo=new MyMethodInfo() { + MethodArgsCount=2, + MethodClassFullName=typeof(MethodApi).FullName, + MethodName= nameof(MethodApi.GetImportTables) + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name ="databaseId", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("库ID", "DatabaseId") }, + new DataModelDefaultParameter() { Name ="tableName", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(string).Name, Description = TextHandler.GetCommonText("表名", "Table name") } + } + }; + }); + zeroInterfaceList.Add(data1); + } + private void GetAllTables() + { + //获取数据库所有 + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetAllTablesId; + it.GroupName = nameof(DbTableInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100004; + it.Name = TextHandler.GetInterfaceListText(GetAllTablesId); + it.Url = GetUrl(it, "GetAllTables"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 2, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.GetTables) + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name ="databaseId", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("库ID", "DatabaseId") }, + new DataModelDefaultParameter() { Name ="tableName", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(string).Name, Description = TextHandler.GetCommonText("表名", "Table name") } + } + }; + }); + zeroInterfaceList.Add(data1); + } + private void ExecuetSql() + { + //获取数据库所有 + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = ExecuetSqlId; + it.GroupName = nameof(DbTableInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(ExecuetSqlId); + it.Url = GetUrl(it, "ExecuetSql"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 2, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.ExecuetSql) + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name ="DatabaseId", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("库ID", "DatabaseId") }, + new DataModelDefaultParameter() { Name ="Sql", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(string).Name, Description = TextHandler.GetCommonText("Sql", "Sql") } + } + }; + }); + zeroInterfaceList.Add(data1); + } + private void GetActionType() + { + //获取数据库所有 + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetActionTypeId; + it.GroupName = nameof(MethodApi); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100004; + it.Name = TextHandler.GetInterfaceListText(GetActionTypeId); + it.Url = GetUrl(it, "GetActionType"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 0, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.GetActionType) + }, + DefaultParameters = new List() + { + + } + }; + }); + zeroInterfaceList.Add(data1); + } + private void GetWhereTypeList() + { + //获取数据库所有 + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetWhereTypeListId; + it.GroupName = nameof(MethodApi); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100004; + it.Name = TextHandler.GetInterfaceListText(GetWhereTypeListId); + it.Url = GetUrl(it, "GetWhereTypeList"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 0, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.GetWhereTypeList) + }, + DefaultParameters = new List() + { + + } + }; + }); + zeroInterfaceList.Add(data1); + } + private void GetToKen() + { + //获取数据库所有 + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.All.ToString(); + it.Id = GetTokenId; + it.GroupName = nameof(MethodApi); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id300; + it.Name = TextHandler.GetInterfaceListText(GetTokenId); + it.Url = "/api/rezero/token"; + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 2, + ArgsTypes=new Type[] {typeof(string),typeof(string) }, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.GetToken) + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() + { + Name="UserName",ParameterValidate=new ParameterValidate(){ IsRequired=true }, ValueType=typeof(string).Name, Description=TextHandler.GetCommonText("用户名","User name") + }, + new DataModelDefaultParameter() + { + Name="Password",ParameterValidate=new ParameterValidate(){ IsRequired=true }, ValueType=typeof(string).Name, Description=TextHandler.GetCommonText("密码","Password") + } + } + }; + }); + zeroInterfaceList.Add(data1); + } + private void GetUserInfo() + { + + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.All.ToString(); + it.Id = GetUserInfoId; + it.GroupName = nameof(MethodApi); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id300; + it.Name = TextHandler.GetInterfaceListText(GetUserInfoId); + it.Url = "/api/rezero/getuserinfo"; + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 0, + ArgsTypes = new Type[] { }, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.GetUserInfo) + }, + DefaultParameters = new List() + { + + } + }; + }); + zeroInterfaceList.Add(data1); + } + private void GetSetting() + { + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetSettingId; + it.GroupName = nameof(ZeroSysSetting); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(GetSettingId); + it.Url = GetUrl(it, "GetSetting"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 2, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.GetSetting) + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name ="typeId", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(int).Name, Description = TextHandler.GetCommonText("分类ID", "Type id") }, + new DataModelDefaultParameter() { Name ="childTypeId", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(int).Name, Description = TextHandler.GetCommonText("子分类Id", "Child type id") } + } + }; + }); + zeroInterfaceList.Add(data1); + } + private void UpdateSetting() + { + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = UpdateSettingId; + it.GroupName = nameof(ZeroSysSetting); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(UpdateSettingId); + it.Url = GetUrl(it, "UpdateSetting"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 3, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.UpdateSetting) + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name ="typeId", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(int).Name, Description = TextHandler.GetCommonText("分类ID", "Type id") }, + new DataModelDefaultParameter() { Name ="childTypeId", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(int).Name, Description = TextHandler.GetCommonText("子分类Id", "Child type id") }, + new DataModelDefaultParameter() { Name ="value", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(string).Name, Description = TextHandler.GetCommonText("值", "Value") } + } + }; + }); + zeroInterfaceList.Add(data1); + } + private void ExportEntities() + { + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = ExportEntitiesId; + it.GroupName = nameof(ZeroEntityInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(ExportEntitiesId); + it.Url = GetUrl(it, "ExportEntities"); + it.CustomResultModel = new ResultModel() + { + ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + GroupName=TextHandler.GetCommonText( "数据库文档{0}.xlsx", "Tables{0}.xlsx"), + ResultType=ResultType.File + }; + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 2, + ArgsTypes=new Type[] {typeof(long), typeof(long[]) }, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.ExportEntities) + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name ="databaseId", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("数据库Id", "Database id") }, + new DataModelDefaultParameter() { Name ="tableIds", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(JsonArray).Name, Description = TextHandler.GetCommonText("表Id集合", "Table id array") } + } + }; + }); + zeroInterfaceList.Add(data1); + } + private void GetDefalutTemplate() + { + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetDefalutTemplateId; + it.GroupName = nameof(ZeroEntityInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(GetDefalutTemplateId); + it.Url = GetUrl(it, "GetDefalutTemplate"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroEntityInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 1, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.GetDefalutTemplate) + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name ="type", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(int).Name, Description = TextHandler.GetCommonText("模版分类ID", "template type id") }, + } + }; + }); + zeroInterfaceList.Add(data1); + } + private void GetTemplateFormatJson() + { + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetTemplateFormatJsonId; + it.GroupName = nameof(ZeroEntityInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(GetTemplateFormatJsonId); + it.Url = GetUrl(it, "GetTemplateFormatJson"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroEntityInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 1, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.GetTemplateFormatJson) + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name ="type", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(int).Name, Description = TextHandler.GetCommonText("模版分类ID", "template type id") }, + } + }; + }); + zeroInterfaceList.Add(data1); + } + private void ExecTemplate() + { + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = ExecTemplateId; + it.GroupName = nameof(ZeroEntityInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(ExecTemplateId); + it.Url = GetUrl(it, "ExecTemplate"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroEntityInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 3, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.ExecTemplate) + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name ="type", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(int).Name, Description = TextHandler.GetCommonText("模版分类ID", "template type id") }, + new DataModelDefaultParameter() { Name ="data", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(string).Name, Description = TextHandler.GetCommonText("数据", "data") }, + new DataModelDefaultParameter() { Name ="template", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(string).Name, Description = TextHandler.GetCommonText("模版字符串", "template") } + } + }; + }); + zeroInterfaceList.Add(data1); + } + private void ExecTemplateByTableIds() + { + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = ExecTemplateByTableIdsId; + it.GroupName = nameof(ZeroEntityInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(ExecTemplateByTableIdsId); + it.Url = GetUrl(it, "ExecTemplateByTableIds"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 5, + ArgsTypes = new Type[] { typeof(long), typeof(long[]),typeof(long),typeof(string),typeof(string) }, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.ExecTemplateByTableIds) + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name ="databaseId", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("数据库Id", "Database id") }, + new DataModelDefaultParameter() { Name ="tableIds", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(JsonArray).Name, Description = TextHandler.GetCommonText("表Id集合", "Table id array") }, + new DataModelDefaultParameter() { Name ="templateId", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("模版ID", "template id") }, + new DataModelDefaultParameter() { Name ="url", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(string).Name, Description = TextHandler.GetCommonText("Url", "Url") }, + new DataModelDefaultParameter() { Name ="viewName", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(string).Name, Description = TextHandler.GetCommonText("View", "View") } + } + }; + }); + zeroInterfaceList.Add(data1); + } + private void ClearAllInternalCache() + { + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = ClearAllInternalCacheId; + it.GroupName = nameof(CacheCenter); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(ClearAllInternalCacheId); + it.Url = GetUrl(it, "ClearAllInternalCache"); + it.DataModel = new DataModel() + { + TableId =0, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 0, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.ClearAllInternalCache) + } + }; + }); + zeroInterfaceList.Add(data1); + } + + private void ExecuetSqlReturnExcel() + { + ZeroInterfaceList data1 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = ExecuetSqlReturnExcelId; + it.GroupName = nameof(DbTableInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(ExecuetSqlReturnExcelId); + it.Url = GetUrl(it, "ExecuetSqlReturnExcel"); + it.CustomResultModel = new ResultModel() + { + ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + GroupName = TextHandler.GetCommonText("数据库文档{0}.xlsx", "Tables{0}.xlsx"), + ResultType = ResultType.File + }; + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroDatabaseInfo, + ActionType = ActionType.MethodGeneratorAPI, + MyMethodInfo = new MyMethodInfo() + { + MethodArgsCount = 2, + ArgsTypes = new Type[] { typeof(long), typeof(string) }, + MethodClassFullName = typeof(MethodApi).FullName, + MethodName = nameof(MethodApi.ExecuetSqlReturnExcel) + }, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name ="DatabaseId", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("库ID", "DatabaseId") }, + new DataModelDefaultParameter() { Name ="Sql", FieldOperator=FieldOperatorType.Equal, ValueType = typeof(string).Name, Description = TextHandler.GetCommonText("Sql", "Sql") } + } + }; + }); + zeroInterfaceList.Add(data1); + } + + private void GetUserInfoPageList() + { + ZeroInterfaceList data2 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetUserInfoListId; + it.GroupName = nameof(ZeroUserInfo); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(GetUserInfoListId); + it.Url = GetUrl(it, "GetUserInfoPageList"); + it.CustomResultModel = new ResultModel() + { + ResultType = ResultType.Grid, + ResultColumnModels = new List() + { + new ResultColumnModel() + { + ResultColumnType=ResultColumnType.ConvertDefaultTimeString, + PropertyName= nameof(ZeroEntityInfo.CreateTime), + } + } + }; + it.DataModel = new DataModel() + { + Columns = new List() + { + new DataColumnParameter(){ + PropertyName= nameof(ZeroUserInfo.Id) , + Description=TextHandler.GetCommonText("ID", "Primary key") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroUserInfo.UserName) , + Description=TextHandler.GetCommonText("用户名", "User name") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroUserInfo.Password) , + Description=TextHandler.GetCommonText("密码", "Password") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroUserInfo.BusinessAccount) , + Description=TextHandler.GetCommonText("业务账号", "Business account") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroUserInfo.IsMasterAdmin) , + Description=TextHandler.GetCommonText("管理员", "admin") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroUserInfo.EasyDescription) , + Description=TextHandler.GetCommonText("备注", "Description") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroUserInfo.Creator) , + Description=TextHandler.GetCommonText("创建人", "Creator") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroUserInfo.CreateTime) , + Description=TextHandler.GetCommonText("创建时间", "Create time") + } + }, + TableId = EntityInfoInitializerProvider.Id_ZeroUserInfo, + ActionType = ActionType.QueryCommon, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroUserInfo.UserName), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(string).Name, Description = TextHandler.GetCommonText("用户名", "User name") }, + new DataModelDefaultParameter() { Name = nameof(ZeroUserInfo.IsMasterAdmin), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name, Description = TextHandler.GetCommonText("是否是管理员", "Is master admin") }, + new DataModelDefaultParameter() { Name=SuperAPIModule._apiOptions?.InterfaceOptions.PageNumberPropName ,Value=1,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("第几页", "Page number") }, + new DataModelDefaultParameter() { Name=SuperAPIModule._apiOptions?.InterfaceOptions.PageSizePropName ,Value=20,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("每页几条", "Pageize") }, + new DataModelDefaultParameter() { Name = nameof(ZeroInterfaceCategory.IsDeleted), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="false",ValueIsReadOnly=true, Description = TextHandler.GetCommonText("IsDeleted", "IsDeleted") }, + }, + CommonPage = new DataModelPageParameter() + { + PageNumber = 1, + PageSize = 20 + }, + }; + }); + zeroInterfaceList.Add(data2); + } + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/Template.cs b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/Template.cs new file mode 100644 index 0000000..59273be --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceItems/Template.cs @@ -0,0 +1,320 @@ + using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal partial class InterfaceListInitializerProvider + { + + public void AddInit_Template() + { + + GetTemplatePageList(); + + DeleteTemplate(); + + AddTemplate(); + + UpdateTemplate(); + + GetTemplateById(); + + GetTemplateTypeList(); + + GetTemplateListByTypeId(); + } + + private void GetTemplateById() + { + ZeroInterfaceList data6 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetTemplateById_Id; + it.GroupName = nameof(ZeroTemplate); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(GetTemplateById_Id); + it.Url = GetUrl(it, "GetTemplateById"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroTemplate, + ActionType = ActionType.QueryByPrimaryKey, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroTemplate.Id), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name,Value=0, Description = TextHandler.GetCommonText("主键", "Id") } + } + }; + }); + zeroInterfaceList.Add(data6); + } + + private void UpdateTemplate() + { + ZeroInterfaceList data5 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.POST.ToString(); + it.Id = GetUpdateTemplateId; + it.GroupName = nameof(ZeroTemplate); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(GetUpdateTemplateId); + it.Url = GetUrl(it, "UpdateTemplate"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroTemplate, + ActionType = ActionType.UpdateObject, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name=nameof(ZeroTemplate.Id),ValueType = typeof(long).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroTemplate.Title) ,ParameterValidate= + new ParameterValidate() + { + IsRequired=true + } ,ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroTemplate.TemplateContentStyle) ,ParameterValidate= + new ParameterValidate() + { + IsRequired=true + } ,ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroTemplate.Url) ,ParameterValidate= + new ParameterValidate() + { + IsRequired=true + } ,ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroTemplate.TemplateContent) ,ParameterValidate= + new ParameterValidate() + { + IsRequired=true + } ,ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroTemplate.TypeId) ,ParameterValidate= + new ParameterValidate() + { + IsRequired=true + } ,ValueType = typeof(long).Name }, + } + }; + }); + zeroInterfaceList.Add(data5); + } + + private void AddTemplate() + { + //添加动态接口分类 + ZeroInterfaceList data4 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.POST.ToString(); + it.Id = GetAddTemplateId; + it.GroupName = nameof(ZeroTemplate); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(GetAddTemplateId); + it.Url = GetUrl(it, "AddTemplate"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroTemplate, + ActionType = ActionType.InsertObject, + DefaultParameters = new List() + { + new DataModelDefaultParameter() { Name=nameof(ZeroTemplate.Id) }, + new DataModelDefaultParameter() { Name=nameof(ZeroTemplate.Title) ,ParameterValidate= + new ParameterValidate() + { + IsRequired=true + } ,ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroTemplate.TemplateContent) ,ParameterValidate= + new ParameterValidate() + { + IsRequired=true + } ,ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroTemplate.Url) ,ParameterValidate= + new ParameterValidate() + { + IsRequired=true + } ,ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroTemplate.TypeId) ,ParameterValidate= + new ParameterValidate() + { + IsRequired=true + } ,ValueType = typeof(long).Name }, + new DataModelDefaultParameter() { Name=nameof(ZeroTemplate.TemplateContentStyle) ,ParameterValidate= + new ParameterValidate() + { + IsRequired=true + } ,ValueType = typeof(string).Name }, + DataInitHelper.GetIsDynamicParameter(), + new DataModelDefaultParameter() { + Name=nameof(ZeroEntityInfo.Creator), + InsertParameter=new InsertParameter(){ + IsUserName=true + }, + Value="" , + ValueType = typeof(string).Name }, + new DataModelDefaultParameter() { + Name=nameof(ZeroEntityInfo.CreateTime), + InsertParameter=new InsertParameter(){ + IsDateTimeNow=true + }, + Value="" , + ValueType = typeof(string).Name }, + + } + }; + }); + zeroInterfaceList.Add(data4); + } + + private void DeleteTemplate() + { + //动态接口分类删除 + ZeroInterfaceList data3 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = DeleteTemplateId; + it.GroupName = nameof(ZeroTemplate); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(DeleteTemplateId); + it.Url = GetUrl(it, "DeleteTemplate"); + it.DataModel = new DataModel() + { + TableId = EntityInfoInitializerProvider.Id_ZeroTemplate, + ActionType = ActionType.BizDeleteObject, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroTemplate.Id), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name,Value=0, Description = TextHandler.GetCommonText("主键", "Id") }, + new DataModelDefaultParameter() { Name = nameof(ZeroTemplate.IsDeleted), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="true", Description = TextHandler.GetCommonText("是否删除", "IsDeleted") } + } + }; + }); + zeroInterfaceList.Add(data3); + } + + private void GetTemplatePageList() + { + ZeroInterfaceList data2 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetTemplatePageId; + it.GroupName = nameof(ZeroTemplate); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(GetTemplatePageId); + it.Url = GetUrl(it, "GetTemplatePageList"); + it.CustomResultModel = new ResultModel() + { + ResultType = ResultType.Grid, + ResultColumnModels = new List() + { + new ResultColumnModel(){ PropertyName= nameof(ZeroTemplate.TypeId) , ConvertType=typeof(TemplateType),ConvertType2=typeof(string), ResultColumnType= ResultColumnType.ConvertDefault } + } + }; + it.DataModel = new DataModel() + { + CommonPage = new DataModelPageParameter + { + PageSize = 20, + PageNumber = 1 + }, + Columns = new List() + { + + new DataColumnParameter(){ + PropertyName= nameof(ZeroTemplate.Id) , + Description=TextHandler.GetCommonText("ID", "Primary key") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroTemplate.Title) , + Description=TextHandler.GetCommonText("名称", "Name") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroTemplate.TypeId) , + Description=TextHandler.GetCommonText("类型", "TypeId"), + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroTemplate.TemplateContentStyle) , + Description=TextHandler.GetCommonText("样式", "Style") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroTemplate.Url) , + Description=TextHandler.GetCommonText("生成路径", "Path") + } + }, + TableId = EntityInfoInitializerProvider.Id_ZeroTemplate, + ActionType = ActionType.QueryCommon, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroTemplate.Title), FieldOperator=FieldOperatorType.Like, ValueType = typeof(string).Name ,ValueIsReadOnly=true, Description = TextHandler.GetCommonText("标题", "Title") }, + new DataModelDefaultParameter() { Name = nameof(ZeroTemplate.IsDeleted), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="false",ValueIsReadOnly=true, Description = TextHandler.GetCommonText("IsDeleted", "IsDeleted") }, + new DataModelDefaultParameter() { Name=SuperAPIModule._apiOptions?.InterfaceOptions.PageNumberPropName ,Value=1,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("第几页", "Page number") }, + new DataModelDefaultParameter() { Name=SuperAPIModule._apiOptions?.InterfaceOptions.PageSizePropName ,Value=20,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("每页几条", "Pageize") } + } + }; + }); + zeroInterfaceList.Add(data2); + } + + private void GetTemplateListByTypeId() + { + ZeroInterfaceList data2 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetTemplateByTypeId_Id; + it.GroupName = nameof(ZeroTemplate); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(GetTemplateByTypeId_Id); + it.Url = GetUrl(it, "GetTemplateListByTypeId"); + it.DataModel = new DataModel() + { + Columns = new List() + { + + new DataColumnParameter(){ + PropertyName= nameof(ZeroTemplate.Id) , + Description=TextHandler.GetCommonText("ID", "Primary key") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroTemplate.Title) , + Description=TextHandler.GetCommonText("名称", "Name") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroTemplate.Url) , + Description=TextHandler.GetCommonText("生成路径", "Path") + } + }, + TableId = EntityInfoInitializerProvider.Id_ZeroTemplate, + ActionType = ActionType.QueryCommon, + DefaultParameters = new List() { + new DataModelDefaultParameter() { Name = nameof(ZeroTemplate.TypeId), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(int).Name , Description = TextHandler.GetCommonText("分类Id", "Type id") }, + new DataModelDefaultParameter() { Name = nameof(ZeroTemplate.IsDeleted), FieldOperator=FieldOperatorType.Equal, ValueType = typeof(bool).Name,Value="false",ValueIsReadOnly=true, Description = TextHandler.GetCommonText("IsDeleted", "IsDeleted") }, + } + }; + }); + zeroInterfaceList.Add(data2); + } + + private void GetTemplateTypeList() + { + + ZeroInterfaceList data2 = GetNewItem(it => + { + it.HttpMethod = HttpRequestMethod.GET.ToString(); + it.Id = GetTemplateTypeId; + it.GroupName = nameof(ZeroTemplateType); + it.InterfaceCategoryId = InterfaceCategoryInitializerProvider.Id100003; + it.Name = TextHandler.GetInterfaceListText(GetTemplateTypeId); + it.Url = GetUrl(it, "TemplateTypeList"); + it.DataModel = new DataModel() + { + Columns = new List() + { + + new DataColumnParameter(){ + PropertyName= nameof(ZeroTemplateType.Id) , + Description=TextHandler.GetCommonText("ID", "Primary key") + }, + new DataColumnParameter(){ + PropertyName= nameof(ZeroTemplateType.Name) , + Description=TextHandler.GetCommonText("名称", "Name") + } + }, + TableId = EntityInfoInitializerProvider.Id_ZeroTemplateType, + ActionType = ActionType.QueryCommon + }; + }); + zeroInterfaceList.Add(data2); + } + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/Items/InterfaceListInitializerProvider.cs b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceListInitializerProvider.cs new file mode 100644 index 0000000..2575f1c --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/Items/InterfaceListInitializerProvider.cs @@ -0,0 +1,28 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal partial class InterfaceListInitializerProvider + { + List zeroInterfaceList = new List() { }; + public InterfaceListInitializerProvider(List zeroInterfaceList) + { + this.zeroInterfaceList = zeroInterfaceList; + } + + internal void Set() + { + AddInit_ZeroInterfaceList(); + AddInit_InterfaceCategory(); + AddInit_DatabaseInfo(); + AddInit_CodeList(); + AddInit_EntityInfo(); + AddInit_EntityColumnInfo(); + AddInit_Template(); + AddInit_Other(); + } + } +} diff --git a/ReZero/SuperAPI/DataInitializerService/Items/UserInitializerProvider.cs b/ReZero/SuperAPI/DataInitializerService/Items/UserInitializerProvider.cs new file mode 100644 index 0000000..076dec6 --- /dev/null +++ b/ReZero/SuperAPI/DataInitializerService/Items/UserInitializerProvider.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class UserInitializerProvider + { + private SuperAPIOptions? _options; + public void Initialize(SuperAPIOptions options) + { + _options = options ?? new SuperAPIOptions(); + InitUser(); + } + + private void InitUser() + { + var db = App.PreStartupDb; + var defaltUser=db!.Queryable().ClearFilter().Where(it => !it.IsInitialized) + .Where(it => it.Id == 1).First(); + if (defaltUser != null) + { + db.Deleteable().Where(it => it.Id == 1).ExecuteCommand(); + } + db!.Storageable(new ZeroUserInfo() + { + Id = 1, + IsMasterAdmin = true, + Password = Encryption.Encrypt("123456"), + UserName = "admin", + SortId = -1, + IsInitialized=true, + CreatorId = 1, + Creator = "admin", + EasyDescription = "default password 123456" + }).ToStorage().AsInsertable.ExecuteCommand(); + } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/ActionTypeFormElementSelectDataSourceModel.cs b/ReZero/SuperAPI/DataService/1Entities/ActionTypeFormElementSelectDataSourceModel.cs new file mode 100644 index 0000000..640c3ad --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/ActionTypeFormElementSelectDataSourceModel.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ActionTypeFormElementSelectDataSourceModel + { + public string? Key { get; set; } + public object? Value { get; set; } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/ActionTypeItemModel.cs b/ReZero/SuperAPI/DataService/1Entities/ActionTypeItemModel.cs new file mode 100644 index 0000000..36447e1 --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/ActionTypeItemModel.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal class ActionTypeItemModel + { + /// + /// Gets or sets the Chinese text. + /// + public string? Text { get; set; } + + /// + /// Gets or sets the text group. + /// + public string? TextGroup { get; set; } + /// + /// Gets or sets the form elements. + /// + public object? FormElements { get; set; } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/ActionTypeModel.cs b/ReZero/SuperAPI/DataService/1Entities/ActionTypeModel.cs new file mode 100644 index 0000000..0ef2c59 --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/ActionTypeModel.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; + +namespace ReZero.SuperAPI +{ + internal class ActionTypeModel + { + public string? TextGroup { get; set; } + public List? Items { get; set; } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/DataService/1Entities/CommonDataService.cs b/ReZero/SuperAPI/DataService/1Entities/CommonDataService.cs new file mode 100644 index 0000000..a580796 --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/CommonDataService.cs @@ -0,0 +1,163 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; +using System.Linq; +using System.Reflection; +namespace ReZero.SuperAPI +{ + public class CommonDataService + { + internal void ClearAll(DataModel dataModel) + { + this.ClearZeroInterfaceListCache(dataModel); + this.ClearZeroEntityInfoInfoCache(dataModel); + this.ClearZeroDatabaseInfoCache(dataModel); + } + internal void ClearZeroInterfaceListCache(DataModel dataModel) + { + if (dataModel.TableId == EntityInfoInitializerProvider.Id_ZeroInterfaceList) + { + CacheManager.Instance.ClearCache(); + } + } + internal void ClearZeroDatabaseInfoCache(DataModel dataModel) + { + if (dataModel.TableId == EntityInfoInitializerProvider.Id_ZeroDatabaseInfo) + { + CacheManager.Instance.ClearCache(); + } + } + + internal void ClearZeroEntityInfoInfoCache(DataModel dataModel) + { + if (dataModel.TableId == EntityInfoInitializerProvider.Id_ZeroEntityInfo) + { + CacheManager.Instance.ClearCache(); + } + } + internal void InitData(Type type, ISqlSugarClient db, DataModel dataModel) + { + var datas = dataModel.DefaultParameters.ToDictionary(it => it.Name, it => it.Value)!; + var entityInfo = db.EntityMaintenance.GetEntityInfo(type); + dataModel.Data = CreateObjectByType(type, datas!); + var columnInfos = entityInfo.Columns.Where(it => it.IsPrimarykey).ToList(); + if (IsSinglePrimaryKey(columnInfos)) + { + var columnInfo = columnInfos.First(); + if (IsSnowFlakeSingle(columnInfo)) + { + SetIsSnowFlakeSingle(entityInfo.Columns, type,dataModel, columnInfo); + } + } + } + public object CreateObjectByType(Type type, Dictionary dict) + { + object obj = Activator.CreateInstance(type); + foreach (KeyValuePair pair in dict) + { + PropertyInfo propertyInfo = type.GetProperty(pair.Key); + if (propertyInfo == null) + { + propertyInfo = type.GetProperties().FirstOrDefault((PropertyInfo it) => it.Name.EqualsCase(pair.Key)); + } + + if (propertyInfo != null) + { + if (propertyInfo.PropertyType != typeof(string) && pair.Value?.Equals("") == true) + { + propertyInfo.SetValue(obj, UtilMethods.GetDefaultValue(propertyInfo.PropertyType)); + } + else + { + propertyInfo.SetValue(obj, UtilMethods.ChangeType2(pair.Value, propertyInfo.PropertyType)); + } + } + } + + return obj; + } + internal void InitDb(Type type, SqlSugar.ISqlSugarClient _sqlSugarClient) + { + var tableName = _sqlSugarClient.EntityMaintenance.GetTableName(type); + if (tableName.StartsWith("zero_") && + ( + _sqlSugarClient!.CurrentConnectionConfig.DbType == SqlSugar.DbType.Oracle || + _sqlSugarClient.CurrentConnectionConfig.DbType == SqlSugar.DbType.Dm + )) + { + _sqlSugarClient.CurrentConnectionConfig.MoreSettings.IsAutoToUpper = true; + } + if (tableName.StartsWith("zero_") && + ( + _sqlSugarClient!.CurrentConnectionConfig.DbType == SqlSugar.DbType.PostgreSQL + )) + { + _sqlSugarClient.CurrentConnectionConfig.MoreSettings.PgSqlIsAutoToLower = true; + _sqlSugarClient.CurrentConnectionConfig.MoreSettings.PgSqlIsAutoToLowerCodeFirst = true; + } + } + internal static void CheckSystemData(ISqlSugarClient db,DataModel dataModel, Type type, SqlSugar.EntityInfo entity) + { + var IsInitializedColumn = entity.Columns.FirstOrDefault(it => it.PropertyName.EqualsCase(nameof(DbBase.IsInitialized))); + var pkColumns = entity.Columns.Where(it => it.IsPrimarykey).ToList(); + if (IsInitializedColumn != null && pkColumns.Count==1) + { + var pkValue=pkColumns.First().PropertyInfo.GetValue(dataModel.Data); + if (pkValue != null) + { + var IsInitializedColumnValue = db.QueryableByObject(type) + .Where(new List() { + new ConditionalModel() + { + FieldName=pkColumns.First().DbColumnName, + ConditionalType=ConditionalType.Equal, + FieldValue=pkValue+"", + CSharpTypeName=pkColumns.First().UnderType.Name + } + }).Select(new List() { + new SelectModel(){ FieldName=IsInitializedColumn.DbColumnName, AsName=IsInitializedColumn.DbColumnName } + }).First(); + IsInitializedColumnValue = IsInitializedColumn.PropertyInfo.GetValue(IsInitializedColumnValue); + if (Convert.ToBoolean(IsInitializedColumnValue)) + { + throw new Exception(TextHandler.GetCommonText(type.Name + "系统数据不能修改", type.Name + " system data cannot be updated ")); + } + } + } + } + + internal void RemoveTypeCache(DataModel dataModel) + { + if (dataModel.TableId == EntityInfoInitializerProvider.Id_ZeroEntityInfo) + { + EntityGeneratorManager.RemoveTypeCacheByTypeId(dataModel.TableId); + } + } + protected void SetIsSnowFlakeSingle(List columnInfos, Type type, DataModel dataModel, EntityColumnInfo columnInfo) + { + var value = Convert.ToInt64(columnInfo.PropertyInfo.GetValue(dataModel.Data)); + if (value == 0) + { + value = SnowFlakeSingle.Instance.NextId(); + columnInfo.PropertyInfo.SetValue(dataModel.Data,value); + } + if (type.Name == nameof(ZeroInterfaceCategory)) + { + var urlColumnInfo = columnInfos.First(it => it.PropertyName == nameof(ZeroInterfaceCategory.Url)); + var url = urlColumnInfo.PropertyInfo.GetValue(dataModel.Data)+""; + urlColumnInfo.PropertyInfo.SetValue(dataModel.Data, url.Replace(PubConst.Ui_TreeUrlFormatId, value+"")); + } + } + + protected bool IsSnowFlakeSingle(EntityColumnInfo columnInfo) + { + return columnInfo.IsIdentity == false && columnInfo.UnderType == typeof(long); + } + + private static bool IsSinglePrimaryKey(List data) + { + return data != null && data.Count == 1; + } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/DataColumnParameter.cs b/ReZero/SuperAPI/DataService/1Entities/DataColumnParameter.cs new file mode 100644 index 0000000..691fa06 --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/DataColumnParameter.cs @@ -0,0 +1,16 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class DataColumnParameter + { + public bool IsHidden { get; set; } + public string? PropertyName { get; set; } + public string? Description { get; set; } + public NativeType? PropertyType { get; set; } + public string? AsName { get; set; } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/DataModel.cs b/ReZero/SuperAPI/DataService/1Entities/DataModel.cs new file mode 100644 index 0000000..ed800dd --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/DataModel.cs @@ -0,0 +1,52 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class DataModel + { + #region Core + public ActionType ActionType { get; set; } + public object? Data { get; set; } + public long TableId { get; set; } + public long DataBaseId { get; set; } + public MyMethodInfo? MyMethodInfo { get; set; } + public string? Sql { get; set; } + public SqlResultType? ResultType { get; set; } + public string? TableColumns { get; set; } + #endregion + + #region Paremters + public List? DefaultValueColumns { get; set; } + public List? OrderDynamicParemters { get; set; } + public List? OrderByFixedParemters { get; set; } + public List? MergeOrderByFixedParemters { get; set; } + public List? DefaultParameters { get; set; } + public List? MergeDefaultParameters { get; set; } + public DataModelPageParameter? CommonPage { get; set; } + public DataModelTreeParameter? TreeParameter { get; set; } + public List? JoinParameters { get; set; } + public List? SelectParameters { get; set; } + public List? GroupParemters { get; set; } + #endregion + + #region Other + [Navigate(NavigateType.OneToMany, nameof(TableId))] + public ZeroEntityInfo? MasterEntityInfo { get; set; } + public object? OutPutData { get; set; } + public long ApiId { get; set; } + public List? Columns { get; set; } + public WhereRelation? WhereRelation { get; set; } + public string? WhereRelationTemplate { get; set; } + public string? CurrentDataString { get; set; } + #endregion + + #region Http + + internal object? ServiceProvider { get; set; } + internal Dictionary? ClaimList { get; set; } = new Dictionary(); + #endregion + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/DataModelDefaultParameter.cs b/ReZero/SuperAPI/DataService/1Entities/DataModelDefaultParameter.cs new file mode 100644 index 0000000..c846d68 --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/DataModelDefaultParameter.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; + +namespace ReZero.SuperAPI +{ + public class DataModelDefaultParameter + { + public string? Name { get; set; } + public string? PropertyName { get; set; } + public object? Value { get; set; } + public bool ValueIsReadOnly { get; set; } + public string? MergeForName { get; set; } + public string? Description { get; set; } + public string? ValueType { get; set; } + public bool IsSingleParameter { get; set; } + public FieldOperatorType? FieldOperator { get; set; } + public string? FieldOperatorString { get { return FieldOperator?.ToString(); } } + public UpdateParemeter? UpdateParemeter { get; set; } + public InsertParameter? InsertParameter { get; set; } + public QueryParameter? QueryParameter { get; set; } + public DeleteParameter? DeleteParameter { get; set; } + public ParameterValidate? ParameterValidate { get; set; } + public string? DefaultValue { get; set; } + public int TableIndex { get; set; } + public int? Id { get; set; } + public bool IsMergeWhere { get; set; } + } + public class ParameterValidate + { + public bool IsRequired { get; set; } + public bool IsUnique{ get; set; } + } + public class UpdateParemeter + { + + } + public class InsertParameter + { + public bool IsUserName { get; set; } + public bool IsDateTimeNow { get; set; } + } + public class QueryParameter + { + } + public class DeleteParameter + { + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/DataModelDefaultValueColumnParameter.cs b/ReZero/SuperAPI/DataService/1Entities/DataModelDefaultValueColumnParameter.cs new file mode 100644 index 0000000..aa46b90 --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/DataModelDefaultValueColumnParameter.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class DataModelDefaultValueColumnParameter + { + public string? PropertyName { get; set; } + public string? Value { get; set; } + public DefaultValueType? Type { get; set; } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/DataModelGroupParameter.cs b/ReZero/SuperAPI/DataService/1Entities/DataModelGroupParameter.cs new file mode 100644 index 0000000..d59fc55 --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/DataModelGroupParameter.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class DataModelGroupParameter + { + public string? FieldName { get; set; } + public int TableIndex { get; set; } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/DataModelJoinParameters.cs b/ReZero/SuperAPI/DataService/1Entities/DataModelJoinParameters.cs new file mode 100644 index 0000000..b8c63c9 --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/DataModelJoinParameters.cs @@ -0,0 +1,14 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class DataModelJoinParameters + { + public JoinType JoinType { get; set; } + public long JoinTableId { get; set; } + public List? OnList { get; set; } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/DataModelPageParameter.cs b/ReZero/SuperAPI/DataService/1Entities/DataModelPageParameter.cs new file mode 100644 index 0000000..4c762cd --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/DataModelPageParameter.cs @@ -0,0 +1,30 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + /// + /// Represents a common page with page number, page size, and total count. + /// + public class DataModelPageParameter + { + /// + /// Gets or sets the page number. + /// + public int PageNumber { get; set; } + + /// + /// Gets or sets the page size. + /// + public int PageSize { get; set; } + + /// + /// Gets or sets the total count. + /// + public int Total { get; set; } + public RefAsync? TotalCount { get; set; } + public int TotalPage { get; internal set; } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/DataModelSelectParameters.cs b/ReZero/SuperAPI/DataService/1Entities/DataModelSelectParameters.cs new file mode 100644 index 0000000..b9b649e --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/DataModelSelectParameters.cs @@ -0,0 +1,16 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class DataModelSelectParameters + { + public int TableIndex { get; set; } + public string? Name { get; set; } + public string? AsName { get; set; } + public string? SubquerySQL { get; set; } + public bool IsTableAll { get; set; } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/DataModelTreeParameter.cs b/ReZero/SuperAPI/DataService/1Entities/DataModelTreeParameter.cs new file mode 100644 index 0000000..98db85a --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/DataModelTreeParameter.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + /// + /// Represents the parameters for a tree structure. + /// + public class DataModelTreeParameter + { + /// + /// Gets or sets the name of the property that contains the code. + /// + public string? CodePropertyName { get; set; } + + /// + /// Gets or sets the root value of the tree. + /// + public object? RootValue { get; set; } + + /// + /// Gets or sets the name of the property that contains the parent code. + /// + public string? ParentCodePropertyName { get; set; } + + /// + /// Gets or sets the name of the property that contains the child nodes. + /// + public string? ChildPropertyName { get; set; } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/EnumItemInfo.cs b/ReZero/SuperAPI/DataService/1Entities/EnumItemInfo.cs new file mode 100644 index 0000000..7b13003 --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/EnumItemInfo.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class EnumItemInfo + { + public string? Description { get; set; } + public string? Name { get; set; } + public string? Value { get; set; } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/JoinParameter.cs b/ReZero/SuperAPI/DataService/1Entities/JoinParameter.cs new file mode 100644 index 0000000..6c120a3 --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/JoinParameter.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class JoinParameter + { + public string? LeftPropertyName { get; set; } + public FieldOperatorType FieldOperator { get; set; } + public string? RightPropertyName { get; set; } + public int LeftIndex { get; set; } + public int RightIndex { get; set; } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/MyMethodInfo.cs b/ReZero/SuperAPI/DataService/1Entities/MyMethodInfo.cs new file mode 100644 index 0000000..8cb28e9 --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/MyMethodInfo.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class MyMethodInfo + { + public string? MethodClassFullName { get; set; } + public string? MethodName { get; set; } + public int MethodArgsCount { get; set; } + public Type[]? ArgsTypes { get; set; } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/OrderParemter.cs b/ReZero/SuperAPI/DataService/1Entities/OrderParemter.cs new file mode 100644 index 0000000..c435272 --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/OrderParemter.cs @@ -0,0 +1,20 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class DataModelDynamicOrderParemter + { + public string? FieldName { get; set; } + public OrderByType OrderByType { get; set; } + public int TableIndex { get; set; } + } + public class DataModelOrderParemter + { + public string? FieldName { get; set; } + public OrderByType OrderByType { get; set; } + public int TableIndex { get; set; } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/ResultColumnModel.cs b/ReZero/SuperAPI/DataService/1Entities/ResultColumnModel.cs new file mode 100644 index 0000000..da60b0b --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/ResultColumnModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ResultColumnModel + { + public string? PropertyName { get; set; } + public Type? ConvertType { get; set; } + public Type? ConvertType2 { get; set; } + public ResultColumnType ResultColumnType { get; set; } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/ResultModel.cs b/ReZero/SuperAPI/DataService/1Entities/ResultModel.cs new file mode 100644 index 0000000..e29a0de --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/ResultModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ResultModel + { + public ResultType? ResultType { get; set; } + public string? GroupName { get; set; } + public object? OutPutData { get; set; } + public string? ContentType { get; set; } + public List? ResultColumnModels { get; set; } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/ResultTypeInfo.cs b/ReZero/SuperAPI/DataService/1Entities/ResultTypeInfo.cs new file mode 100644 index 0000000..bcb4989 --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/ResultTypeInfo.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ResultTypeInfo + { + public Type? Type { get; set; } + public string? PropertyName { get; set; } + } +} diff --git a/ReZero/SuperAPI/DataService/1Entities/SaveInterfaceListModel.cs b/ReZero/SuperAPI/DataService/1Entities/SaveInterfaceListModel.cs new file mode 100644 index 0000000..f6f3298 --- /dev/null +++ b/ReZero/SuperAPI/DataService/1Entities/SaveInterfaceListModel.cs @@ -0,0 +1,96 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class SaveInterfaceListModel + { + public long Id { get; set; } + public string? Url { get; set; } + public string? GroupName { get; set; } + public string? TableId { get; set; } + public string? Name { get; set; } + public string? InterfaceCategoryId { get; set; } + public ActionType? ActionType { get; set; } + public CommonConfig? Json { get; set; } + public string? Sql { get; set; } + public string? TreeCode { get; set; } + public string? TreeParentCode { get; set; } + public string? TreeRootParentValue { get; set; } + public string? HttpMethod { get; set; } + public bool PageSize { get; set; } + /// + /// Used for binding interface controls during interface editing. It can be left unassigned if interface editing is not used. + /// + public string? CurrentDataString { get; set; } + + public SqlResultType? ResultType { get; set; } + public string? TableColumns { get; set; } + } + + + public class CommonConfig + { + public List? DefaultValueColumns { get; set; } + public CommonQueryColumn[]? Columns { get; set; } + public CommonQueryComplexitycolumn[]? ComplexityColumns { get; set; } + public CommonQueryWhere[]? Where { get; set; } + public WhereRelation? WhereRelation { get; set; } + public string? WhereRelationTemplate { get; set; } + public CommonQueryOrderby[]? OrderBys { get; set; } + public bool OrderBysEnableSort { get; set; } + public string? CurrentDataString { get; set; } + public long? Id { get; set; } + public long? DataBaseId{get;set;} + } + + public class CommonQueryColumn + { + public string? Id { get; set; } + public string? DbColumnName { get; set; } + public string? PropertyName { get; set; } + public int SortId { get; set; } + } + + public class CommonQueryComplexitycolumn + { + public string? PropertyName { get; set; } + public string? DbColumnName { get; set; } + public int SortId { get; set; } + public CommonQueryComplexitycolumnJson? Json { get; set; } + } + public class CommonQueryComplexitycolumnJson + { + public CommonQueryComplexitycolumnJoinInfo? JoinInfo { get; set; } + } + public class CommonQueryComplexitycolumnJoinInfo + { + public string? MasterField { get; set; } + public string? JoinTable { get; set; } + public ColumnJoinType? JoinType { get; set; } + public string? JoinField { get; set; } + public string? ShowField { get; set; } + public string? Name { get; set; } + public int? SortId { get; set; } + } + + public class CommonQueryWhere + { + public int Id { get; set; } + public string? PropertyName { get; set; } + public string? WhereType { get; set; } + public WhereValueType ValueType { get; set; } + public string? Value { get; set; } + } + + public class CommonQueryOrderby + { + public string? Name { get; set; } + public string? OrderByType { get; set; } + public string? SortId { get; set; } + } + +} diff --git a/ReZero/SuperAPI/DataService/2Enum/ActionType.cs b/ReZero/SuperAPI/DataService/2Enum/ActionType.cs new file mode 100644 index 0000000..7bd6e1f --- /dev/null +++ b/ReZero/SuperAPI/DataService/2Enum/ActionType.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public enum ActionType + { + + #region Query + [ChineseText("根据主键查询")] + [EnglishText("Query by primary key")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_QueryCN, PubConst.DataSource_ActionTypeGroupName_QueryEN)] + QueryByPrimaryKey = 10000, + + [ChineseText("通用查询")] + [EnglishText("Common query")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_QueryCN, PubConst.DataSource_ActionTypeGroupName_QueryEN)] + QueryCommon = 10001, + + [ChineseText("树型查询")] + [EnglishText("Common tree")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_QueryCN, PubConst.DataSource_ActionTypeGroupName_QueryEN)] + QueryTree = 10002, + + [ChineseText("全表查询")] + [EnglishText("Query all")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_QueryCN, PubConst.DataSource_ActionTypeGroupName_QueryEN)] + QueryAll = 10003, + #endregion + + + #region Insert + [ChineseText("插入根据实体")] + [EnglishText("Insert by entity")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_InsertCN, PubConst.DataSource_ActionTypeGroupName_InsertEN)] + InsertObject = 20000, + + [ChineseText("批量插入")] + [EnglishText("Insert range")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_InsertCN, PubConst.DataSource_ActionTypeGroupName_InsertEN)] + InsertRange = 20001, + #endregion + + + #region Delete + [ChineseText("删除")] + [EnglishText("Delete")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_DeleteCN, PubConst.DataSource_ActionTypeGroupName_DeleteEN)] + DeleteObject = 30000, + + [ChineseText("批量删除")] + [EnglishText("Delete range")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_DeleteCN, PubConst.DataSource_ActionTypeGroupName_DeleteEN)] + DeleteRange = 30002, + + [ChineseText("逻辑删除")] + [EnglishText("logic delete")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_DeleteCN, PubConst.DataSource_ActionTypeGroupName_DeleteEN)] + BizDeleteObject = 30001, + + [ChineseText("批量逻辑删除")] + [EnglishText("logic delete range")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_DeleteCN, PubConst.DataSource_ActionTypeGroupName_DeleteEN)] + BizDeleteRange = 30003, + #endregion + + + #region Update + [ChineseText("更新根据实体")] + [EnglishText("Update by entity")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_UpdateCN, PubConst.DataSource_ActionTypeGroupName_UpdateEN)] + UpdateObject = 40000, + + [ChineseText("批量更新")] + [EnglishText("Update Range")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_UpdateCN, PubConst.DataSource_ActionTypeGroupName_UpdateEN)] + UpdateRange = 40001, + #endregion + + + #region DDL + [ChineseText("获取数据库")] + [EnglishText("Get database list")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_DDLCN, PubConst.DataSource_ActionTypeGroupName_DDLEN)] + DllDatabaseList = 50000, + [ChineseText("创建数据库")] + [EnglishText("Create database")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_DDLCN, PubConst.DataSource_ActionTypeGroupName_DDLEN)] + DllCreateDb = 50001, + [ChineseText("创建表")] + [EnglishText("Create tables")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_DDLCN, PubConst.DataSource_ActionTypeGroupName_DDLEN)] + DllCreateTables = 50002, + [ChineseText("获取表")] + [EnglishText("Get tables")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_DDLCN, PubConst.DataSource_ActionTypeGroupName_DDLEN)] + DllGetTables = 50003, + #endregion + + + #region Inset Or Update + [ChineseText("插入或者更新")] + [EnglishText("Insert or update")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_InsertOrUpdateCN, PubConst.DataSource_ActionTypeGroupName_InsertOrUpdateEN)] + InsertOrUpdateObject = 60000, + + [ChineseText("批量插入或者更新")] + [EnglishText("Insert or update range")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_InsertOrUpdateCN, PubConst.DataSource_ActionTypeGroupName_InsertOrUpdateEN)] + InsertOrUpdateRange = 60001, + #endregion + + + #region 自定义方法 + [ChineseText("SQL脚本")] + [EnglishText("SQL Script")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_MyMethodCN, PubConst.DataSource_ActionTypeGroupName_MyMethodEN)] + SqlScript = 90000, + + [ChineseText("C#方法")] + [EnglishText("C# Script")] + [TextGroupAttribute(PubConst.DataSource_ActionTypeGroupName_MyMethodCN, PubConst.DataSource_ActionTypeGroupName_MyMethodEN)] + MethodGeneratorAPI = 99999, + #endregion + } +} diff --git a/ReZero/SuperAPI/DataService/2Enum/DefaultValueType.cs b/ReZero/SuperAPI/DataService/2Enum/DefaultValueType.cs new file mode 100644 index 0000000..66dbe07 --- /dev/null +++ b/ReZero/SuperAPI/DataService/2Enum/DefaultValueType.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public enum DefaultValueType + { + None = 0, // 无 + FixedValue = 1, // 固定值 + DefaultValue = 2, // 默认值(int等于0,空字符串等于空等) + CurrentTime = 3, // 当前时间 + ClaimKey = 4 // ClaimKey + } +} diff --git a/ReZero/SuperAPI/DataService/2Enum/FieldOperator.cs b/ReZero/SuperAPI/DataService/2Enum/FieldOperator.cs new file mode 100644 index 0000000..fbcff55 --- /dev/null +++ b/ReZero/SuperAPI/DataService/2Enum/FieldOperator.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public enum FieldOperatorType + { + Equal, + Like, + GreaterThan, + GreaterThanOrEqual, + LessThan, + LessThanOrEqual, + In, + NotIn, + LikeLeft, + LikeRight, + NoEqual, + NoLike, + InLike + } +} diff --git a/ReZero/SuperAPI/DataService/2Enum/ResultColumnType.cs b/ReZero/SuperAPI/DataService/2Enum/ResultColumnType.cs new file mode 100644 index 0000000..7536cfa --- /dev/null +++ b/ReZero/SuperAPI/DataService/2Enum/ResultColumnType.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public enum ResultColumnType + { + ConvertDefault = 1, + ConvertDefaultTimeString=2, + SubqueryName=2000 + } +} diff --git a/ReZero/SuperAPI/DataService/2Enum/ResultType.cs b/ReZero/SuperAPI/DataService/2Enum/ResultType.cs new file mode 100644 index 0000000..06818c7 --- /dev/null +++ b/ReZero/SuperAPI/DataService/2Enum/ResultType.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public enum ResultType + { + Group=0, + Grid=1000, + File=2000 + } +} diff --git a/ReZero/SuperAPI/DataService/3Interface/IDataService.cs b/ReZero/SuperAPI/DataService/3Interface/IDataService.cs new file mode 100644 index 0000000..acde28a --- /dev/null +++ b/ReZero/SuperAPI/DataService/3Interface/IDataService.cs @@ -0,0 +1,9 @@ +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + public interface IDataService + { + Task ExecuteAction(DataModel dataModel); + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/DataService/3Interface/IResultService.cs b/ReZero/SuperAPI/DataService/3Interface/IResultService.cs new file mode 100644 index 0000000..10d9f13 --- /dev/null +++ b/ReZero/SuperAPI/DataService/3Interface/IResultService.cs @@ -0,0 +1,12 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal interface IResultService + { + object GetResult(object data, ResultModel result); + } +} diff --git a/ReZero/SuperAPI/DataService/Custom/SqlScript.cs b/ReZero/SuperAPI/DataService/Custom/SqlScript.cs new file mode 100644 index 0000000..3ce3ec1 --- /dev/null +++ b/ReZero/SuperAPI/DataService/Custom/SqlScript.cs @@ -0,0 +1,87 @@ +using Newtonsoft.Json; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Data.SqlTypes; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class SqlScript : CommonDataService, IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + var db = App.GetDbById(dataModel.DataBaseId) ?? App.Db; + var sql = dataModel.Sql + string.Empty; + var left = "[["; + var right = "]]"; + var isWhereIf = sql.Contains(left) && sql.Contains(right); + var pars = new List(); + foreach (var item in dataModel.DefaultParameters ?? new List()) + { + var p = new SugarParameter("@" + item.Name, UtilMethods.ConvertDataByTypeName(item.ValueType, item.Value?.ToString())); + if (IsDateOnly(item)) + { + p.DbType = System.Data.DbType.Date; + p.Value = Convert.ToDateTime(p.Value); + } + if (item.ValueIsReadOnly) + { + var claimItem = dataModel.ClaimList.FirstOrDefault(it => it.Key?.ToLower() == item.Name?.ToLower()); + p = new SugarParameter("@" + item.Name, claimItem.Value); + } + if (item.ValueType?.Contains(PubConst.Common_ArrayKey) == true) + { + var type = item.ValueType.Replace(PubConst.Common_ArrayKey, string.Empty); + var arrayType = typeof(List<>).MakeGenericType(EntityGeneratorManager.GetTypeByString(type)); + var value = JsonConvert.DeserializeObject(item.Value?.ToString() ?? PubConst.Common_ArrayKey, arrayType); + p = new SugarParameter("@" + item.Name, value); + } + sql = GetSqlByIsWhereIF(sql, left, right, isWhereIf, p); + pars.Add(p); + } + switch (dataModel.ResultType) + { + case SqlResultType.DataSet: + return await db.Ado.GetDataSetAllAsync(sql, pars); + case SqlResultType.AffectedRows: + return await db.Ado.ExecuteCommandAsync(sql, pars); + case SqlResultType.Query: + default: + return await db.Ado.GetDataTableAsync(sql, pars); + } + } + + private static bool IsDateOnly(DataModelDefaultParameter item) + { + return item?.ValueType?.EqualsCase("DateOnly") == true; + } + + private static string GetSqlByIsWhereIF(string sql, string left, string right, bool isWhereIf, SugarParameter p) + { + if (isWhereIf) + { + var regex = @"\[\[.*?\]\]"; + var matchCollection = Regex.Matches(sql, regex); + foreach (Match math in matchCollection) + { + var value = math.Value; + if (value.Contains(p.ParameterName) && string.IsNullOrEmpty(p.Value?.ToString())) + { + sql = sql.Replace(value, string.Empty); + } + else if (value.Contains(p.ParameterName) && !string.IsNullOrEmpty(p.Value?.ToString())) + { + sql = sql.Replace(value, value.Replace(left, null).Replace(right, null)); + } + } + } + + return sql; + } + + } +} diff --git a/ReZero/SuperAPI/DataService/DDL/DllCreateDb.cs b/ReZero/SuperAPI/DataService/DDL/DllCreateDb.cs new file mode 100644 index 0000000..b976cf9 --- /dev/null +++ b/ReZero/SuperAPI/DataService/DDL/DllCreateDb.cs @@ -0,0 +1,69 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class DllCreateDb : IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + await Task.Delay(0); + var connection = dataModel.DefaultParameters.First().Value; + var DbType = dataModel.DefaultParameters.Last().Value; + try + { + var dbType = (DbType)UtilMethods.ChangeType2(DbType, typeof(DbType)); + if (IsNoSupport(dbType)) + { + return GetNoSupportText(); + } + else + { + CreateDatabase(connection, dbType); + return true; + } + } + catch (Exception ex) + { + return ex.Message; + } + } + + private static void CreateDatabase(object? connection, DbType dbType) + { + SqlSugarClient? db = new SqlSugarClient(new ConnectionConfig() + { + DbType = dbType, + ConnectionString = connection + "", + IsAutoCloseConnection = true, + MoreSettings = new ConnMoreSettings() + { + + } + }); + if (App.Language == Language.CN) + { + db.CurrentConnectionConfig.LanguageType = LanguageType.Chinese; + } + else + { + db.CurrentConnectionConfig.LanguageType = LanguageType.English; + } + db.DbMaintenance.CreateDatabase(); + } + + private static string GetNoSupportText() + { + return TextHandler.GetCommonText($" dm or oracle no support ", "达梦或者Oracle不支持建库"); + } + + private static bool IsNoSupport(DbType dbType) + { + return dbType == SqlSugar.DbType.Dm || dbType == SqlSugar.DbType.Oracle; + } + } +} diff --git a/ReZero/SuperAPI/DataService/DDL/DllCreateTables.cs b/ReZero/SuperAPI/DataService/DDL/DllCreateTables.cs new file mode 100644 index 0000000..b29bec7 --- /dev/null +++ b/ReZero/SuperAPI/DataService/DDL/DllCreateTables.cs @@ -0,0 +1,40 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class DllCreateTables : IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + await Task.Delay(0); + var value = dataModel.DefaultParameters.First().Value; + var dbRoot = App.Db; + var ids = dbRoot.Utilities.DeserializeObject>(value+""); + List tableDifferences = new List(); + var result = string.Empty; + var entities = dbRoot.Queryable().In(ids).ToList(); + foreach (var entity in entities) + { + if (entity.IsInitialized) + { + throw new Exception(TextHandler.GetCommonText("系统表不能修改", "The system table cannot be modified")); + } + var codeFirstDb = App.GetDbTableId(entity.Id)!; + var type = EntityGeneratorManager.GetTypeAsync(entity.Id).GetAwaiter().GetResult(); + var entityInfo = codeFirstDb.EntityMaintenance.GetEntityInfo(type); + if (entityInfo.Columns.Any(it => !string.IsNullOrEmpty(it.DataType)&&it.DataType!=StaticConfig.CodeFirst_BigString&&it.IsJson==false)) + { + codeFirstDb.CurrentConnectionConfig.MoreSettings.SqlServerCodeFirstNvarchar = false; + } + codeFirstDb.CodeFirst.InitTables(type); + codeFirstDb.CurrentConnectionConfig.MoreSettings.SqlServerCodeFirstNvarchar = true; + } + return true; + } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/DataService/DDL/DllDatabaseList.cs b/ReZero/SuperAPI/DataService/DDL/DllDatabaseList.cs new file mode 100644 index 0000000..17755a1 --- /dev/null +++ b/ReZero/SuperAPI/DataService/DDL/DllDatabaseList.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + public class DllDatabaseList : IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + var db = App.GetDbTableId(dataModel.TableId) ?? App.Db; + var dataBaseList=db.DbMaintenance.GetDataBaseList(); + return await Task.FromResult(dataBaseList); + } + } +} diff --git a/ReZero/SuperAPI/DataService/DDL/DllGetTables.cs b/ReZero/SuperAPI/DataService/DDL/DllGetTables.cs new file mode 100644 index 0000000..8d43db1 --- /dev/null +++ b/ReZero/SuperAPI/DataService/DDL/DllGetTables.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + public class DllGetTables : IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + var dbId =Convert.ToInt32(dataModel.DefaultParameters.First().Value); + var db = App.GetDbById(dbId); + var dataBaseList = db!.DbMaintenance.GetTableInfoList(false).Where(it=>!it.Name.ToLower().StartsWith("zero_")); + return await Task.FromResult(dataBaseList); + } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/DataService/DataService.cs b/ReZero/SuperAPI/DataService/DataService.cs new file mode 100644 index 0000000..23727a3 --- /dev/null +++ b/ReZero/SuperAPI/DataService/DataService.cs @@ -0,0 +1,52 @@ +using Microsoft.AspNetCore.Http; +using Newtonsoft.Json.Linq; +using SqlSugar; +using SqlSugar.Extensions; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + public partial class DataService : IDataService + { + public BindHttpParameters BindHttpParameters => new BindHttpParameters(); + public async Task ExecuteAction(DataModel dataModel) + { + try + { + var actionTypeName = InstanceManager.GetActionTypeName(dataModel); + var errorParameters =await ValidateParameters.CheckAsync(dataModel); + object? errorData = await ErrorParameterHelper.GetErrorParameters(errorParameters); + if (ErrorParameterHelper.IsError(errorData)) + { + return errorData; + } + else + { + var actionType = Type.GetType(actionTypeName); + InstanceManager.CheckActionType(dataModel, actionType); + var actionInstance = (IDataService)Activator.CreateInstance(actionType); + var result = await actionInstance.ExecuteAction(dataModel); + return result; + } + } + catch (Exception ex) + { + if (ex.InnerException != null) + { + Console.WriteLine(ex.InnerException.Message); + throw ex.InnerException; + } + else + { + Console.WriteLine(ex.Message); + throw; + } + } + } + + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/DataService/Delete/BizDeleteObject.cs b/ReZero/SuperAPI/DataService/Delete/BizDeleteObject.cs new file mode 100644 index 0000000..ec6902c --- /dev/null +++ b/ReZero/SuperAPI/DataService/Delete/BizDeleteObject.cs @@ -0,0 +1,45 @@ +using Kdbndp.TypeHandlers; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class BizDeleteObject : CommonDataService, IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + var db = App.GetDbTableId(dataModel.TableId) ?? App.Db; + var type = await EntityGeneratorManager.GetTypeAsync(dataModel.TableId); + base.InitDb(type, db); + base.InitData(type, db, dataModel); + var entity = db.EntityMaintenance.GetEntityInfo(type); + if (!entity.Columns.Any(it => it.PropertyName.EqualsCase(nameof(DbBase.IsDeleted)))) + { + throw new Exception(TextHandler.GetCommonText(type.Name + "没有IsDeleted属性不能逻辑删除", type.Name + "Cannot be logically deleted without IsDeleted attribute")); + } + CheckSystemData(db, dataModel, type, entity); + var column = entity.Columns.FirstOrDefault(it => it.PropertyName.EqualsCase(nameof(DbBase.IsDeleted))); + column.PropertyInfo.SetValue(dataModel.Data, true); + var result = db.UpdateableByObject(dataModel.Data) + .UpdateColumns("isdeleted") + .ExecuteCommandAsync(); + base.ClearAll(dataModel); + return GetResult(dataModel, result); + } + + private static object GetResult(DataModel dataModel, Task result) + { + if (dataModel.ResultType == SqlResultType.AffectedRows) + { + return result; + } + else + { + return true; + } + } + } +} diff --git a/ReZero/SuperAPI/DataService/Delete/BizDeleteRange.cs b/ReZero/SuperAPI/DataService/Delete/BizDeleteRange.cs new file mode 100644 index 0000000..878c21e --- /dev/null +++ b/ReZero/SuperAPI/DataService/Delete/BizDeleteRange.cs @@ -0,0 +1,75 @@ +using DocumentFormat.OpenXml.Vml.Office; +using Kdbndp.TypeHandlers; +using Newtonsoft.Json; +using SqlSugar; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class BizDeleteRange : CommonDataService, IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + var db = App.GetDbTableId(dataModel.TableId) ?? App.Db; + var type = await EntityGeneratorManager.GetTypeAsync(dataModel.TableId); + base.InitDb(type, db); + this.InitDatas(type, db, dataModel); + var entity = db.EntityMaintenance.GetEntityInfo(type); + if (!entity.Columns.Any(it => it.PropertyName.EqualsCase(nameof(DbBase.IsDeleted)))) + { + throw new Exception(TextHandler.GetCommonText(type.Name + "没有IsDeleted属性不能逻辑删除", type.Name + "Cannot be logically deleted without IsDeleted attribute")); + } + CheckSystemData(db, dataModel, type, entity); + var column = entity.Columns.FirstOrDefault(it => it.PropertyName.EqualsCase(nameof(DbBase.IsDeleted))); + //column.PropertyInfo.SetValue(dataModel.Data, true); + var result = db.UpdateableByObject(dataModel.Data) + .UpdateColumns("isdeleted") + .ExecuteCommandAsync(); + base.ClearAll(dataModel); + return GetResult(dataModel, result); + } + + internal void InitDatas(Type type, ISqlSugarClient db, DataModel dataModel) + { + List list = new List(); + var entityInfo = db.EntityMaintenance.GetEntityInfo(type); + var pk = entityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey); + var column = entityInfo.Columns.FirstOrDefault(it => it.PropertyName.EqualsCase(nameof(DbBase.IsDeleted))); + var json = dataModel.DefaultParameters.FirstOrDefault()?.Value?.ToString() ?? "[]"; + var listType = typeof(List<>).MakeGenericType(pk.UnderType); + var objs = ((IList)JsonConvert.DeserializeObject(json, listType)!).Cast().ToList(); + foreach (var item in objs) + { + var dataItem = new DataModel() + { + Data = item, + DefaultParameters = new List() + { + new DataModelDefaultParameter(){ Value=item, Name=pk.PropertyName } + } + }; + base.InitData(type, db, dataItem); + column.PropertyInfo.SetValue(dataItem.Data,true); + list.Add(dataItem.Data); + } + dataModel.Data = list; + } + + private static object GetResult(DataModel dataModel, Task result) + { + if (dataModel.ResultType == SqlResultType.AffectedRows) + { + return result; + } + else + { + return true; + } + } + } +} diff --git a/ReZero/SuperAPI/DataService/Delete/DeleteObject.cs b/ReZero/SuperAPI/DataService/Delete/DeleteObject.cs new file mode 100644 index 0000000..90c193d --- /dev/null +++ b/ReZero/SuperAPI/DataService/Delete/DeleteObject.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class DeleteObject : CommonDataService,IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + var db = App.GetDbTableId(dataModel.TableId) ?? App.Db; + var type = await EntityGeneratorManager.GetTypeAsync(dataModel.TableId); + base.InitDb(type, db); + //CheckSystemData(db, dataModel, type, db.EntityMaintenance.GetEntityInfo(type)); + base.InitData(type, db, dataModel); + var result = await db.DeleteableByObject(dataModel.Data).ExecuteCommandAsync(); + base.ClearAll(dataModel); + return GetResult(dataModel, result); + } + + private static object GetResult(DataModel dataModel, int result) + { + if (dataModel.ResultType == SqlResultType.AffectedRows) + { + return result; + } + else + { + return true; + } + } + } +} diff --git a/ReZero/SuperAPI/DataService/Delete/DeleteRange.cs b/ReZero/SuperAPI/DataService/Delete/DeleteRange.cs new file mode 100644 index 0000000..e2f9608 --- /dev/null +++ b/ReZero/SuperAPI/DataService/Delete/DeleteRange.cs @@ -0,0 +1,58 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using System.Linq; +using Newtonsoft.Json; +using System.Collections; +namespace ReZero.SuperAPI +{ + internal class DeleteRange : CommonDataService,IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + var db = App.GetDbTableId(dataModel.TableId) ?? App.Db; + var type = await EntityGeneratorManager.GetTypeAsync(dataModel.TableId); + base.InitDb(type, db); + this.InitDatas(type, db, dataModel); + var result = await db.DeleteableByObject(dataModel.Data).ExecuteCommandAsync(); + base.ClearAll(dataModel); + return GetResult(dataModel, result); + } + internal void InitDatas(Type type, ISqlSugarClient db, DataModel dataModel) + { + List list = new List(); + var entityInfo=db.EntityMaintenance.GetEntityInfo(type); + var pk= entityInfo.Columns.FirstOrDefault(it=>it.IsPrimarykey); + var json = dataModel.DefaultParameters.FirstOrDefault()?.Value?.ToString()??"[]"; + var listType=typeof(List<>).MakeGenericType(pk.UnderType); + var objs = ((IList)JsonConvert.DeserializeObject(json, listType)!).Cast().ToList(); + foreach (var item in objs) + { + var dataItem = new DataModel() + { + Data = item, + DefaultParameters = new List() + { + new DataModelDefaultParameter(){ Value=item, Name=pk.PropertyName } + } + }; + base.InitData(type, db, dataItem); + list.Add(dataItem.Data); + } + dataModel.Data = list; + } + private static object GetResult(DataModel dataModel, int result) + { + if (dataModel.ResultType == SqlResultType.AffectedRows) + { + return result; + } + else + { + return true; + } + } + } +} diff --git a/ReZero/SuperAPI/DataService/Insert/InsertObject.cs b/ReZero/SuperAPI/DataService/Insert/InsertObject.cs new file mode 100644 index 0000000..6b1433d --- /dev/null +++ b/ReZero/SuperAPI/DataService/Insert/InsertObject.cs @@ -0,0 +1,42 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class InsertObject: CommonDataService, IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + var db = App.GetDbTableId(dataModel.TableId) ?? App.Db; + var type = await EntityGeneratorManager.GetTypeAsync(dataModel.TableId); + base.InitDb(type, db); + base.InitData(type, db, dataModel); + this.SetDefaultValue(dataModel, db, type); + if (dataModel.ResultType == SqlResultType.IdNumber) + { + var idNumber = await db.InsertableByObject(dataModel.Data).ExecuteReturnIdentityAsync(); + base.ClearAll(dataModel); + return idNumber; + } + else + { + await db.InsertableByObject(dataModel.Data).ExecuteCommandAsync(); + base.ClearAll(dataModel); + return true; + } + } + + private void SetDefaultValue(DataModel dataModel, ISqlSugarClient db, Type type) + { + if (EntityMappingService.IsAnyDefaultValue(dataModel)) + { + dataModel.Data = EntityMappingService.GetDataByDefaultValueParameters(type, db, dataModel); + } + } + + } +} diff --git a/ReZero/SuperAPI/DataService/Insert/InsertRange.cs b/ReZero/SuperAPI/DataService/Insert/InsertRange.cs new file mode 100644 index 0000000..b25e79e --- /dev/null +++ b/ReZero/SuperAPI/DataService/Insert/InsertRange.cs @@ -0,0 +1,65 @@ +using Newtonsoft.Json; +using SqlSugar; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class InsertRange : CommonDataService, IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + var db = App.GetDbTableId(dataModel.TableId) ?? App.Db; + var type = await EntityGeneratorManager.GetTypeAsync(dataModel.TableId); + base.InitDb(type, db); + this.InitData(type, db, dataModel); + this.SetDefaultValue(dataModel, db, type); + await db.InsertableByObject(dataModel.Data).PageSize(1000).ExecuteCommandAsync(); + base.ClearAll(dataModel); + return true; + } + internal new void InitData(Type type, ISqlSugarClient db, DataModel dataModel) + { + var json = dataModel?.DefaultParameters?.FirstOrDefault().Value + ""; + object obj = JsonConvert.DeserializeObject(json, typeof(List<>).MakeGenericType(type))!; + SetDefaultPkValue(type, db, obj); + dataModel!.Data = obj; + } + + private void SetDefaultPkValue(Type type, ISqlSugarClient db, object obj) + { + var entityInfo = db.EntityMaintenance.GetEntityInfo(type); + var columnInfo = entityInfo.Columns.Where(it => it.IsPrimarykey).FirstOrDefault(); + if (columnInfo != null && IsSnowFlakeSingle(columnInfo)) + { + foreach (var item in (IList)obj) + { + if (Convert.ToInt64(columnInfo.PropertyInfo.GetValue(item)) == 0) + { + columnInfo.PropertyInfo.SetValue(item, SqlSugar.SnowFlakeSingle.Instance.NextId()); + } + } + } + } + + private void SetDefaultValue(DataModel dataModel, ISqlSugarClient db, Type type) + { + if (EntityMappingService.IsAnyDefaultValue(dataModel)) + { + foreach (var item in (IList)dataModel.Data!) + { + var para = new DataModel() + { + Data = item, + DefaultValueColumns=dataModel.DefaultValueColumns + }; + EntityMappingService.GetDataByDefaultValueParameters(type, db, para); + } + } + } + } +} diff --git a/ReZero/SuperAPI/DataService/InsertOrUpdate/InsertOrUpdateObject.cs b/ReZero/SuperAPI/DataService/InsertOrUpdate/InsertOrUpdateObject.cs new file mode 100644 index 0000000..bd43d32 --- /dev/null +++ b/ReZero/SuperAPI/DataService/InsertOrUpdate/InsertOrUpdateObject.cs @@ -0,0 +1,95 @@ +using ClosedXML; +using SqlSugar; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class InsertOrUpdateObject : CommonDataService, IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + var db = App.GetDbTableId(dataModel.TableId) ?? App.Db; + var type = await EntityGeneratorManager.GetTypeAsync(dataModel.TableId); + base.InitDb(type, db); + base.InitData(type, db, dataModel); + CheckSystemData(db, dataModel, type, db.EntityMaintenance.GetEntityInfo(type)); + this.SetDefaultValue(dataModel, db, type); + int result =await InsertOrUpdateAsync(dataModel, db); + base.ClearAll(dataModel); + return GetResult(dataModel, result); + } + + private static async Task InsertOrUpdateAsync(DataModel dataModel, ISqlSugarClient db) + { + int result = 0; + var context = ((SqlSugarClient)db).Context; + var storageableByObject = db.StorageableByObject(dataModel.Data); + var methodino = (MethodInfo)storageableByObject.GetType().GetProperty("MethodInfo", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(storageableByObject); + var value = storageableByObject.GetType().GetProperty("objectValue", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(storageableByObject); + var groupObject = methodino.Invoke(context, new object[] { value }); + var task=(Task)groupObject.GetType().GetMethod("ToStorageAsync").Invoke(groupObject,new object[] { }); + var groupValues= await GetTask(task); + var insertList= GetSelectItemList(groupValues.GetType().GetProperty("InsertList").GetValue(groupValues)); + var updateList = GetSelectItemList(groupValues.GetType().GetProperty("UpdateList").GetValue(groupValues)); + var updatecolumns = GetUpdateableColumns(dataModel); + if(updateList.Any()) + result+=db.UpdateableByObject(updateList).UpdateColumns(updatecolumns).ExecuteCommand(); + if(insertList.Any()) + result += db.InsertableByObject(insertList).ExecuteCommand(); + return result; + } + public static List GetSelectItemList(object objectValue) + { + var list= ((IList)objectValue).Cast().ToList(); + list = list.Select(it => it.GetType().GetProperty("Item").GetValue(it)).ToList(); + return list; + } + + private static async Task GetTask(Task task) + { + await task.ConfigureAwait(false); // 等待任务完成 + var resultProperty = task.GetType().GetProperty("Result"); + var result = resultProperty.GetValue(task); + return result; + } + private static string[] GetUpdateableColumns(DataModel dataModel) + { + string[] result = null!; + if (!string.IsNullOrEmpty(dataModel.TableColumns)) + { + result=dataModel.TableColumns.Split(","); + } + else + { + result=dataModel.DefaultParameters.Select(it => it.Name).ToArray()!; + } + return result; + } + + private static object GetResult(DataModel dataModel, int result) + { + if (dataModel.ResultType == SqlResultType.AffectedRows) + { + return result; + } + else + { + return true; + } + } + + private void SetDefaultValue(DataModel dataModel, ISqlSugarClient db, Type type) + { + if (EntityMappingService.IsAnyDefaultValue(dataModel)) + { + dataModel.Data = EntityMappingService.GetDataByDefaultValueParameters(type, db, dataModel); + } + } + } +} diff --git a/ReZero/SuperAPI/DataService/InsertOrUpdate/InsertOrUpdateRange.cs b/ReZero/SuperAPI/DataService/InsertOrUpdate/InsertOrUpdateRange.cs new file mode 100644 index 0000000..ff760ad --- /dev/null +++ b/ReZero/SuperAPI/DataService/InsertOrUpdate/InsertOrUpdateRange.cs @@ -0,0 +1,144 @@ +using Newtonsoft.Json; +using SqlSugar; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class InsertOrUpdateRange : CommonDataService, IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + var db = App.GetDbTableId(dataModel.TableId) ?? App.Db; + var type = await EntityGeneratorManager.GetTypeAsync(dataModel.TableId); + base.InitDb(type, db); + this.InitData(type, db, dataModel); + CheckSystemData(db, dataModel, type, db.EntityMaintenance.GetEntityInfo(type)); + this.SetDefaultValue(dataModel, db, type); + int result = await ExecuteUpdate(dataModel, db); + base.ClearAll(dataModel); + return GetResult(dataModel, result); + } + + private static async Task ExecuteUpdate(DataModel dataModel, ISqlSugarClient db) + { + var list= ((IList)dataModel.Data!).Cast().ToList(); + var result = 0; + try + { + db.Ado.BeginTran(); + await db.Utilities.PageEachAsync(list,100, async item => + { + result+=await InsertOrUpdateAsync(dataModel, item, db); + }); + db.Ado.CommitTran(); + } + catch (Exception) + { + db.Ado.RollbackTran(); + throw; + } + return result; + } + private static async Task InsertOrUpdateAsync(DataModel dataModel, object data, ISqlSugarClient db) + { + int result = 0; + var context = ((SqlSugarClient)db).Context; + var storageableByObject = db.StorageableByObject(data); + var methodino = (MethodInfo)storageableByObject.GetType().GetProperty("MethodInfo", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(storageableByObject); + var value = storageableByObject.GetType().GetProperty("objectValue", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(storageableByObject); + var groupObject = methodino.Invoke(context, new object[] { value }); + var task = (Task)groupObject.GetType().GetMethod("ToStorageAsync").Invoke(groupObject, new object[] { }); + var groupValues = await GetTask(task); + var insertList = GetSelectItemList(groupValues.GetType().GetProperty("InsertList").GetValue(groupValues)); + var updateList = GetSelectItemList(groupValues.GetType().GetProperty("UpdateList").GetValue(groupValues)); + var updatecolumns = GetUpdateableColumns(dataModel); + if (updateList.Any()) + result += db.UpdateableByObject(updateList).UpdateColumns(updatecolumns).ExecuteCommand(); + if (insertList.Any()) + result += db.InsertableByObject(insertList).ExecuteCommand(); + return result; + } + public static List GetSelectItemList(object objectValue) + { + var list = ((IList)objectValue).Cast().ToList(); + list = list.Select(it => it.GetType().GetProperty("Item").GetValue(it)).ToList(); + return list; + } + + private static async Task GetTask(Task task) + { + await task.ConfigureAwait(false); // 等待任务完成 + var resultProperty = task.GetType().GetProperty("Result"); + var result = resultProperty.GetValue(task); + return result; + } + private static string[] GetUpdateableColumns(DataModel dataModel) + { + string[] result = null!; + if (!string.IsNullOrEmpty(dataModel.TableColumns)) + { + result = dataModel.TableColumns.Split(","); + } + else + { + result = new string[] { }; + } + return result; + } + + internal new void InitData(Type type, ISqlSugarClient db, DataModel dataModel) + { + var json = dataModel?.DefaultParameters?.FirstOrDefault().Value + ""; + object obj = JsonConvert.DeserializeObject(json, typeof(List<>).MakeGenericType(type))!; + dataModel!.Data = obj; + } + private static UpdateCommonMethodInfo GetUpdateable(DataModel dataModel, UpdateMethodInfo updateable) + { + UpdateCommonMethodInfo updateCommonMethodInfo; + if (!string.IsNullOrEmpty(dataModel.TableColumns)) + { + updateCommonMethodInfo = updateable.UpdateColumns(dataModel.TableColumns.Split(",")); + } + else + { + updateCommonMethodInfo = updateable.UpdateColumns(); + } + + return updateCommonMethodInfo; + } + + private static object GetResult(DataModel dataModel, int result) + { + if (dataModel.ResultType == SqlResultType.AffectedRows) + { + return result; + } + else + { + return true; + } + } + + private void SetDefaultValue(DataModel dataModel, ISqlSugarClient db, Type type) + { + if (EntityMappingService.IsAnyDefaultValue(dataModel)) + { + foreach (var item in (IList)dataModel.Data!) + { + var para = new DataModel() + { + Data = item, + DefaultValueColumns = dataModel.DefaultValueColumns + }; + EntityMappingService.GetDataByDefaultValueParameters(type, db, para); + } + } + } + } +} diff --git a/ReZero/SuperAPI/DataService/Query/QueryAll.cs b/ReZero/SuperAPI/DataService/Query/QueryAll.cs new file mode 100644 index 0000000..28aa8d0 --- /dev/null +++ b/ReZero/SuperAPI/DataService/Query/QueryAll.cs @@ -0,0 +1,24 @@ + using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class QueryAll :CommonDataService, IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + var db = App.GetDbTableId(dataModel.TableId) ?? App.Db; + RefAsync count = 0; + var parameter = dataModel.TreeParameter; + var type =await EntityGeneratorManager.GetTypeAsync(dataModel.TableId); + base.InitDb(type, db); + var result = await db.QueryableByObject(type) + .ToListAsync(); + return result; + } + } +} diff --git a/ReZero/SuperAPI/DataService/Query/QueryCommon/DynamicTypeBuilder.cs b/ReZero/SuperAPI/DataService/Query/QueryCommon/DynamicTypeBuilder.cs new file mode 100644 index 0000000..ce2f1ab --- /dev/null +++ b/ReZero/SuperAPI/DataService/Query/QueryCommon/DynamicTypeBuilder.cs @@ -0,0 +1,35 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class DynamicTypeBuilder + { + private readonly ISqlSugarClient db; + private readonly string tableName; + private readonly List propertyInfos; + + public DynamicTypeBuilder(ISqlSugarClient db, string tableName, List propertyInfos) + { + this.db = db; + this.tableName = tableName; + this.propertyInfos = propertyInfos; + } + + public Type BuildDynamicType() + { + var typeBuilder = db.DynamicBuilder().CreateClass(tableName, new SugarTable() { }); + + foreach (var propInfo in propertyInfos) + { + typeBuilder.CreateProperty(propInfo.PropertyName, propInfo.Type, new SugarColumn() { }); + } + + typeBuilder.WithCache(); + + return typeBuilder.BuilderType(); + } + } +} diff --git a/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon.cs b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon.cs new file mode 100644 index 0000000..0458239 --- /dev/null +++ b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon.cs @@ -0,0 +1,42 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Security.AccessControl; +using System.Text; +using System.Threading.Tasks; +using System.Linq; +using System.Data; +using System.Text.RegularExpressions; +namespace ReZero.SuperAPI +{ + public partial class QueryCommon :CommonDataService, IDataService + { + public ISqlSugarClient? _sqlSugarClient; + private ISqlBuilder? _sqlBuilder; + public async Task ExecuteAction(DataModel dataModel) + { + try + { + RefAsync count = 0; + _sqlSugarClient = App.GetDbTableId(dataModel.TableId) ?? App.Db; + _sqlBuilder = _sqlSugarClient.Queryable().SqlBuilder; + var type = await EntityGeneratorManager.GetTypeAsync(dataModel.TableId); + base.InitDb(type,_sqlSugarClient); + var queryObject = _sqlSugarClient.QueryableByObject(type, PubConst.Orm_TableDefaultMasterTableShortName); + queryObject = Join(type, dataModel, queryObject); + queryObject = Where(type, dataModel, queryObject); + queryObject = OrderBySelectBefore(type, dataModel, queryObject); + queryObject = GroupBy(type, dataModel, queryObject); + queryObject = Select(type, dataModel, queryObject); + queryObject = MergeTable(type,dataModel,queryObject); + object? result = await ToList(dataModel, count, type, queryObject); + return result; + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + throw; + } + } + } +} diff --git a/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_GroupBy.cs b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_GroupBy.cs new file mode 100644 index 0000000..ee633e9 --- /dev/null +++ b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_GroupBy.cs @@ -0,0 +1,35 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + /// + /// OrdeBy + /// + public partial class QueryCommon : IDataService + { + private QueryMethodInfo GroupBy(Type type, DataModel dataModel, QueryMethodInfo queryObject) + { + List groupByModels = new List(); + if (dataModel.GroupParemters != null) + { + foreach (var item in dataModel.GroupParemters!) + { + groupByModels.Add(new GroupByModel() + { + FieldName = GetGroupByFieldName(queryObject,item) + }); + } + } + queryObject = queryObject.GroupBy(groupByModels); + return queryObject; + } + private string GetGroupByFieldName(QueryMethodInfo queryObject, DataModelGroupParameter item) + { + var name = _sqlSugarClient!.EntityMaintenance.GetDbColumnName(item.FieldName, queryObject.EntityType); + return PubConst.Orm_TableDefaultPreName + item.TableIndex + "." + name; + } + } +} diff --git a/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_Join.cs b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_Join.cs new file mode 100644 index 0000000..86d2ab1 --- /dev/null +++ b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_Join.cs @@ -0,0 +1,106 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; +using System.Linq; +namespace ReZero.SuperAPI +{ + /// + /// Join + /// + public partial class QueryCommon : IDataService + { + private QueryMethodInfo Join(Type type, DataModel dataModel, QueryMethodInfo queryObject) + { + if (!IsAnyJoin(dataModel)) return queryObject; + int index = 0; + var joinInfoList = dataModel.JoinParameters ?? new List(); + foreach (var item in joinInfoList) + { + index++; + var shortName = GetShortName(index); + var JoinType = EntityGeneratorManager.GetTypeAsync(item.JoinTableId).GetAwaiter().GetResult(); + var onSql = GetJoinOnSql(type, item.OnList, shortName, joinInfoList); + queryObject = queryObject.AddJoinInfo(JoinType, shortName, onSql, item.JoinType); + } + return queryObject; + } + + private string GetJoinOnSql(Type type, List? onList, string shortName, List joinInfoList) + { + string onSql = string.Empty; + List conditionalModels = new List(); + StringBuilder sb = new StringBuilder(); + var index = 0; + foreach (var item in onList ?? new List()) + { + AppendJoinItem(type, joinInfoList, sb, index, item); + index++; + } + return sb.ToString(); + } + + private void AppendJoinItem(Type type, List joinInfoList, StringBuilder sb, int index, JoinParameter item) + { + var leftEntity = _sqlSugarClient!.EntityMaintenance.GetEntityInfo(GetLeftType(type, joinInfoList, item)); + var rightEntity = _sqlSugarClient!.EntityMaintenance.GetEntityInfo(GetRightType(type, joinInfoList, item)); + var leftName = GetLeftName(item,leftEntity); + var rightName = GetRightName(item,rightEntity); + switch (item.FieldOperator) + { + case FieldOperatorType.Equal: + sb.Append($"{(index == 0 ? "" : " AND ")} {leftName}={rightName} "); + break; + case FieldOperatorType.Like: + break; + case FieldOperatorType.GreaterThan: + break; + case FieldOperatorType.GreaterThanOrEqual: + break; + case FieldOperatorType.LessThan: + break; + case FieldOperatorType.LessThanOrEqual: + break; + case FieldOperatorType.In: + break; + case FieldOperatorType.NotIn: + break; + case FieldOperatorType.LikeLeft: + break; + case FieldOperatorType.LikeRight: + break; + case FieldOperatorType.NoEqual: + break; + case FieldOperatorType.NoLike: + break; + case FieldOperatorType.InLike: + break; + } + } + + private static Type GetLeftType(Type type, List joinInfoList, JoinParameter item) + { + return item.LeftIndex == 0 ? type : EntityGeneratorManager.GetTypeAsync((joinInfoList[item.LeftIndex].JoinTableId)).GetAwaiter().GetResult(); + } + private static Type GetRightType(Type type, List joinInfoList, JoinParameter item) + { + return item.RightIndex == 0 ? type : EntityGeneratorManager.GetTypeAsync((joinInfoList[item.RightIndex-1].JoinTableId)).GetAwaiter().GetResult(); + } + private string GetRightName(JoinParameter item, EntityInfo rightEntity) + { + var name=rightEntity.Columns.FirstOrDefault(it => it.PropertyName == item.RightPropertyName).DbColumnName; + return _sqlBuilder!.GetTranslationColumnName(PubConst.Orm_TableDefaultPreName + item.RightIndex) + "." + _sqlBuilder!.GetTranslationColumnName(name); + } + + private string GetLeftName(JoinParameter item, EntityInfo leftEntity) + { + var name = leftEntity.Columns.FirstOrDefault(it => it.PropertyName == item.LeftPropertyName).DbColumnName; + return _sqlBuilder!.GetTranslationColumnName(PubConst.Orm_TableDefaultPreName + item.LeftIndex) + "." + _sqlBuilder!.GetTranslationColumnName(name); + } + private static string GetShortName(int index) + { + return PubConst.Orm_TableDefaultPreName+ index; + } + + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_MergeTable.cs b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_MergeTable.cs new file mode 100644 index 0000000..6189ed8 --- /dev/null +++ b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_MergeTable.cs @@ -0,0 +1,75 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ReZero.SuperAPI +{ + /// + /// MergeTable + /// + public partial class QueryCommon : IDataService + { + private QueryMethodInfo MergeTable(Type type, DataModel dataModel, QueryMethodInfo queryObject) + { + if (!IsMergeTable(dataModel)) + { + return queryObject; + } + queryObject = queryObject.MergeTable(); + queryObject=MergeTableWhere(type,dataModel,queryObject); + queryObject = OrderBySelectAfter(type, dataModel, queryObject); + queryObject =MergeTableOrderBy(type, dataModel, queryObject); + return queryObject; + } + + private QueryMethodInfo MergeTableOrderBy(Type type, DataModel dataModel, QueryMethodInfo queryObject) + { + if (!IsMergeOrderBy(dataModel) || resultType == null) + { + return queryObject; + } + var old = dataModel.OrderByFixedParemters; + var oldType = queryObject.EntityType; + dataModel.OrderByFixedParemters = dataModel.MergeOrderByFixedParemters; + queryObject.EntityType = resultType; + OrderBySelectAfter(resultType, dataModel, queryObject); + dataModel.OrderByFixedParemters = old; + queryObject.EntityType = oldType; + return queryObject; + } + + private QueryMethodInfo MergeTableWhere(Type type, DataModel dataModel, QueryMethodInfo queryObject) + { + if (dataModel?.MergeDefaultParameters?.Any()!=true|| resultType==null) + { + return queryObject; + } + var oldType = queryObject.EntityType; + foreach (var item in dataModel.DefaultParameters!) + { + item.IsMergeWhere = false; + } + queryObject.EntityType = resultType; + Where(this.resultType, dataModel, queryObject); + queryObject.EntityType = oldType; + return queryObject; + } + + private static bool IsMergeTable(DataModel dataModel) + { + return IsMergeOrderBy(dataModel) || IsMergeTableWhere(dataModel); + } + + private static bool IsMergeTableWhere(DataModel dataModel) + { + return dataModel.MergeOrderByFixedParemters?.Any() == true; + } + + private static bool IsMergeOrderBy(DataModel dataModel) + { + return dataModel.MergeDefaultParameters?.Any() == true; + } + } +} diff --git a/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_OrderBy.cs b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_OrderBy.cs new file mode 100644 index 0000000..b297999 --- /dev/null +++ b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_OrderBy.cs @@ -0,0 +1,132 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; +using System.Linq; +namespace ReZero.SuperAPI +{ + /// + /// OrdeBy + /// + public partial class QueryCommon : IDataService + { + private QueryMethodInfo OrderBySelectBefore(Type type, DataModel dataModel, QueryMethodInfo queryObject) + { + if (IsMergeTable(dataModel)) + { + return queryObject; + } + List orderByModels = new List(); + if (dataModel.OrderByFixedParemters != null) + { + foreach (var item in dataModel.OrderByFixedParemters) + { + orderByModels.Add(new OrderByModel() + { + FieldName = GetFieldName(queryObject, new DataModelDynamicOrderParemter() + { + FieldName = item.FieldName, + OrderByType = item.OrderByType, + TableIndex = item.TableIndex + }), + OrderByType = item.OrderByType + }); + } + } + if (dataModel.OrderDynamicParemters != null) + { + var columns = App.Db.EntityMaintenance.GetEntityInfo(queryObject.EntityType).Columns; + foreach (var item in dataModel.OrderDynamicParemters) + { + var isAny = columns.Any(it => it.PropertyName?.ToLower() == item.FieldName?.ToLower() || it.DbColumnName?.ToLower() == item.FieldName?.ToLower()); + if (isAny) + { + orderByModels.Add(new OrderByModel() + { + FieldName = GetFieldName(queryObject, item), + OrderByType = item.OrderByType + }); + } + else if (dataModel?.SelectParameters?.Where(it => it.AsName?.ToLower() == item.FieldName?.ToLower()).Any() == true) + { + if (dataModel.MergeOrderByFixedParemters == null) + { + dataModel.MergeOrderByFixedParemters = new List(); + } + } + else + { + throw new Exception(TextHandler.GetCommonText("排序字段 " + item.FieldName + "不存在实体", "OrderBy " + item.FieldName + " is not exist")); + } + } + } + queryObject = queryObject.OrderBy(orderByModels); + return queryObject; + } + private QueryMethodInfo OrderBySelectAfter(Type type, DataModel dataModel, QueryMethodInfo queryObject) + { + if (!IsMergeTable(dataModel)) + { + return queryObject; + } + List orderByModels = new List(); + if (dataModel.OrderByFixedParemters != null) + { + foreach (var item in dataModel.OrderByFixedParemters) + { + orderByModels.Add(new OrderByModel() + { + FieldName = GetFieldName(queryObject, new DataModelDynamicOrderParemter() + { + FieldName = item.FieldName, + OrderByType = item.OrderByType, + TableIndex = item.TableIndex + }), + OrderByType = item.OrderByType + }); + } + } + if (dataModel.OrderDynamicParemters != null) + { + var columns = App.Db.EntityMaintenance.GetEntityInfo(queryObject.EntityType).Columns; + foreach (var item in dataModel.OrderDynamicParemters) + { + var isAny = columns.Any(it => it.PropertyName?.ToLower() == item.FieldName?.ToLower() || it.DbColumnName?.ToLower() == item.FieldName?.ToLower()); + if (isAny) + { + orderByModels.Add(new OrderByModel() + { + FieldName = GetFieldName(queryObject, item), + OrderByType = item.OrderByType + }); + } + else if (dataModel?.SelectParameters?.Where(it => it.AsName?.ToLower() == item.FieldName?.ToLower()).Any() == true) + { + if (dataModel.MergeOrderByFixedParemters == null) + { + dataModel.MergeOrderByFixedParemters = new List(); + } + } + else + { + throw new Exception(TextHandler.GetCommonText("排序字段 " + item.FieldName + "不存在实体", "OrderBy " + item.FieldName + " is not exist")); + } + } + } + queryObject = queryObject.OrderBy(orderByModels); + return queryObject; + } + private string GetFieldName(QueryMethodInfo queryObject, DataModelDynamicOrderParemter item) + { + var name = _sqlSugarClient!.EntityMaintenance.GetDbColumnName(item.FieldName, queryObject.EntityType); + if (this.resultType != null) + { + return item.FieldName; + } + else + { + return PubConst.Orm_TableDefaultPreName + item.TableIndex + "." + name; + } + } + } +} diff --git a/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_Page.cs b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_Page.cs new file mode 100644 index 0000000..6a0b213 --- /dev/null +++ b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_Page.cs @@ -0,0 +1,47 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; +using System.Linq; +using System.Threading.Tasks; +namespace ReZero.SuperAPI +{ + /// + /// Page + /// + public partial class QueryCommon : IDataService + { + private async Task PageQuery(DataModel dataModel, RefAsync count, Type type, QueryMethodInfo queryObject, object? result) + { + result = await queryObject.ToPageListAsync(dataModel!.CommonPage!.PageNumber, dataModel.CommonPage.PageSize, count); + dataModel.CommonPage.TotalCount = count.Value; + if (dataModel.Columns?.Any() == false) + { + dataModel.Columns = _sqlSugarClient!.EntityMaintenance.GetEntityInfo(type).Columns.Select(it => new DataColumnParameter + { + PropertyName = it.PropertyName, + Description = it.ColumnDescription + }).ToList(); + } + dataModel.OutPutData = new DataModelOutPut + { + Page = new DataModelPageParameter() + { + TotalCount = count.Value, + PageNumber = dataModel.CommonPage.PageNumber, + PageSize = dataModel.CommonPage.PageSize, + TotalPage = (int)Math.Ceiling((double)count.Value / dataModel.CommonPage.PageSize) + }, + Columns = dataModel.Columns + }; + return result; + } + + private static async Task DefaultQuery(QueryMethodInfo queryObject, object? result) + { + result = await queryObject.ToListAsync(); + return result; + } + + } +} diff --git a/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_Select.cs b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_Select.cs new file mode 100644 index 0000000..0300117 --- /dev/null +++ b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_Select.cs @@ -0,0 +1,99 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; +using System.Linq; +using System.Data; +using Microsoft.Extensions.Primitives; +using System.Xml.Linq; +namespace ReZero.SuperAPI +{ + /// + /// Select + /// + public partial class QueryCommon : IDataService + { + public List resultTypeInfos = new List(); + private Type? resultType; + private QueryMethodInfo Select(Type type, DataModel dataModel, QueryMethodInfo queryObject) + { + if (IsAnySelect(dataModel)) + { + queryObject = GetSelectByParameters(type,dataModel, queryObject); + } + else if (IsAnyJoin(dataModel)) + { + queryObject = GetDefaultSelect(type, queryObject); + } + return queryObject; + } + + private QueryMethodInfo GetSelectByParameters(Type type, DataModel dataModel, QueryMethodInfo queryObject) + { + List selectLists = new List(); + foreach (var item in dataModel.SelectParameters ?? new List()) + { + if (IsSelectMasterAll(item)) + { + selectLists.Add(GetMasterSelectAll(type)); + } + else if (IsSelectSubqueryName(item)) + { + selectLists.Add(item.SubquerySQL!); + resultTypeInfos.Add(new ResultTypeInfo() { PropertyName = item.AsName, Type = GetColumnInfo(type, item)?.PropertyInfo?.PropertyType ?? typeof(object) }); + } + else if (IsSelectJoinName(item)) + { + var propertyName = _sqlBuilder!.GetTranslationColumnName(item.AsName); + var tableInfo = dataModel!.JoinParameters![item.TableIndex - 1]; + var name = $"{_sqlBuilder!.GetTranslationColumnName(PubConst.Orm_TableDefaultPreName + item.TableIndex)}.{_sqlBuilder!.GetTranslationColumnName(item.Name)} AS {propertyName} "; + selectLists.Add(name); + resultTypeInfos.Add(new ResultTypeInfo() { PropertyName = item.AsName, Type = typeof(string) }); + } + else if (!string.IsNullOrEmpty(item.Name)) + { + if (string.IsNullOrEmpty(item.AsName)) + item.AsName = item.Name; + var name = $"{_sqlBuilder!.GetTranslationColumnName(GetSelectFieldName(queryObject, item))} AS {_sqlBuilder!.GetTranslationColumnName(item.AsName)} "; + selectLists.Add(name); + resultTypeInfos.Add(new ResultTypeInfo() { PropertyName = item.AsName, Type = GetColumnInfo(type, item)?.PropertyInfo?.PropertyType ?? typeof(object) }); + } + } + var resultType=new DynamicTypeBuilder(_sqlSugarClient!,"ViewModel_"+dataModel.ApiId, resultTypeInfos).BuildDynamicType(); + queryObject = queryObject.Select(string.Join(",", selectLists), resultType); + this.resultType = resultType; + return queryObject; + } + + private string GetSelectFieldName(QueryMethodInfo queryObject, DataModelSelectParameters item) + { + var name = _sqlSugarClient!.EntityMaintenance.GetDbColumnName(item.Name, queryObject.EntityType); + return PubConst.Orm_TableDefaultPreName + item.TableIndex + "." + name; + } + private EntityColumnInfo GetColumnInfo(Type type, DataModelSelectParameters item) + { + var collumnInfo = _sqlSugarClient!.EntityMaintenance.GetEntityInfo(type).Columns.FirstOrDefault(it=>it.PropertyName.EqualsCase(item.AsName!)); + return collumnInfo; + } + private QueryMethodInfo GetDefaultSelect(Type type, QueryMethodInfo queryObject) + { + string selectString = GetMasterSelectAll(type); + queryObject = queryObject.Select(selectString); + return queryObject; + } + + private string GetMasterSelectAll(Type type) + { + var columns = _sqlSugarClient!.EntityMaintenance.GetEntityInfo(type).Columns.Where(it => !it.IsIgnore) + .Select(it => GetEntityColumns(it)).ToList(); + var selectString = String.Join(",", columns); + return selectString; + } + + private object GetEntityColumns(EntityColumnInfo it) + { + resultTypeInfos.Add(new ResultTypeInfo() { PropertyName=it.PropertyName,Type=it.PropertyInfo.PropertyType }); + return _sqlBuilder!.GetTranslationColumnName(PubConst.Orm_TableDefaultMasterTableShortName) +"."+ _sqlBuilder!.GetTranslationColumnName(it.DbColumnName) + " AS " + _sqlBuilder!.GetTranslationColumnName(it.PropertyName); + } + } +} diff --git a/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_ToList.cs b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_ToList.cs new file mode 100644 index 0000000..917f9dc --- /dev/null +++ b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_ToList.cs @@ -0,0 +1,48 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Security.AccessControl; +using System.Text; +using System.Threading.Tasks; +using System.Linq; +using System.Data; +using System.Text.RegularExpressions; +using System.Collections; +using ReZero.DependencyInjection; +namespace ReZero.SuperAPI +{ + /// + /// ToList + /// + public partial class QueryCommon : IDataService + { + private async Task ToList(DataModel dataModel, RefAsync count, Type type, QueryMethodInfo queryObject) + { + object? result = null; + if (IsDefaultToList(dataModel)) + { + result = await DefaultQuery(queryObject, result); + if (dataModel.ApiId == InterfaceListInitializerProvider.IntIntListId) + { + var userName = DependencyResolver.GetLoggedInUser(); + var list = CacheManager.Instance.GetList(); + if (list.Any()) + { + var mappings = CacheManager.Instance.GetList() + .Where(it => it.UserName!.ToLower() == userName?.ToLower()) + .ToList(); + var ids = mappings.Select(it => it.InterfaceId).ToList(); + result = (result as IList).Cast() + .Where(it=> ids.Contains(Convert.ToInt64(it.GetType().GetProperty(nameof(ZeroInterfaceList.Id)).GetValue(it)))).ToList(); + } + } + } + else + { + result = await PageQuery(dataModel, count, type, queryObject, result); + + } + return result; + } + } +} diff --git a/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_Validate.cs b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_Validate.cs new file mode 100644 index 0000000..a3b3ca7 --- /dev/null +++ b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_Validate.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ReZero.SuperAPI +{ + /// + /// Validate + /// + public partial class QueryCommon : IDataService + { + private static bool IsDefaultToList(DataModel dataModel) + { + return dataModel.CommonPage == null; + } + private static bool IsAnyJoin(DataModel dataModel) + { + return dataModel.JoinParameters?.Any() == true; + } + private static bool IsAnySelect(DataModel dataModel) + { + return dataModel.SelectParameters?.Any() == true; + } + private static bool IsSelectMasterAll(DataModelSelectParameters item) + { + return item.IsTableAll && item.TableIndex == 0; + } + private static bool IsSelectJoinName(DataModelSelectParameters item) + { + return item.IsTableAll == false && item.TableIndex > 0; + } + private static bool IsSelectSubqueryName(DataModelSelectParameters item) + { + return item.Name ==PubConst.Orm_SubqueryKey; + } + } +} diff --git a/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_Where.cs b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_Where.cs new file mode 100644 index 0000000..56f2610 --- /dev/null +++ b/ReZero/SuperAPI/DataService/Query/QueryCommon/QueryCommon_Where.cs @@ -0,0 +1,318 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; +using System.Linq; +using System.Runtime.CompilerServices; +namespace ReZero.SuperAPI +{ + /// + /// Where + /// + public partial class QueryCommon : IDataService + { + public QueryMethodInfo Where(Type type, DataModel dataModel, QueryMethodInfo queryObject) + { + List conditionalModels = new List(); + List funcModels = new List(); + if (dataModel.DefaultParameters != null) + { + AddDynamicOrderBy(dataModel); + dataModel.WhereRelation = dataModel.WhereRelation ?? WhereRelation.And; + switch (dataModel.WhereRelation) + { + case WhereRelation.And: + And(dataModel, queryObject, conditionalModels); + break; + case WhereRelation.AndAll: + AndAll(dataModel, queryObject, conditionalModels); + break; + case WhereRelation.Or: + Or(dataModel, queryObject, conditionalModels); + break; + case WhereRelation.OrAll: + OrAll(dataModel, queryObject, conditionalModels); + break; + case WhereRelation.Custom: + Custom(dataModel, queryObject, conditionalModels); + break; + case WhereRelation.CustomAll: + CustomAll(dataModel, queryObject, conditionalModels); + break; + } + } + queryObject = queryObject.Where(conditionalModels,true); + foreach (var item in funcModels) + { + queryObject = queryObject.Where(item); + } + return queryObject; + } + + private static void AddDynamicOrderBy(DataModel dataModel) + { + if (IsOrderByParameters(dataModel)) + { + if (dataModel.OrderDynamicParemters == null) + { + dataModel.OrderDynamicParemters = new List(); + } + var name = dataModel.DefaultParameters.FirstOrDefault(it => it.Name == "OrderByName").Value?.ToString(); + var sortType = Convert.ToInt32(dataModel.DefaultParameters.FirstOrDefault(it => it.Name == "OrderByType").Value); + if (!string.IsNullOrEmpty(name)) + { + dataModel.OrderDynamicParemters = new List(); + dataModel.OrderDynamicParemters.Add(new DataModelDynamicOrderParemter() + { + FieldName = name, + OrderByType = sortType == 0 ? OrderByType.Asc : OrderByType.Desc + }); + } + dataModel.DefaultParameters!.RemoveAll(it => it.Name == "OrderByName" || it.Name == "OrderByType"); + } + } + + private static bool IsOrderByParameters(DataModel dataModel) + { + return dataModel.DefaultParameters.Any(it => it.Name == "OrderByType") && dataModel.DefaultParameters.Any(it => it.Name == "OrderByName"); + } + + private void And(DataModel dataModel, QueryMethodInfo queryObject, List conditionalModels) + { + foreach (var item in dataModel.DefaultParameters.Where(it => it.IsMergeWhere!=true&&string.IsNullOrEmpty(it.MergeForName)).Where(it => it.Value + "" != "")) + { + ConvetConditional(dataModel, queryObject, conditionalModels, item); + } + } + + private void AndAll(DataModel dataModel, QueryMethodInfo queryObject, List conditionalModels) + { + foreach (var item in dataModel.DefaultParameters.Where(it => it.IsMergeWhere != true&& string.IsNullOrEmpty(it.MergeForName))) + { + ConvetConditional(dataModel, queryObject, conditionalModels, item); + } + } + + private void Or(DataModel dataModel, QueryMethodInfo queryObject, List conditionalModels) + { + foreach (var item in dataModel.DefaultParameters.Where(it => it.IsMergeWhere != true&& string.IsNullOrEmpty(it.MergeForName)).Where(it => it.Value + "" != "")) + { + ConvetConditional(dataModel, queryObject, conditionalModels, item); + } + var conditionalList = conditionalModels.Select(it=>new KeyValuePair(WhereType.Or,(ConditionalModel)it)).ToList(); + conditionalModels.Clear(); + conditionalModels.Add(new ConditionalCollections() + { + ConditionalList= conditionalList, + }); + if (conditionalList.Count == 0) + { + conditionalModels.Clear(); + conditionalModels.Add(new ConditionalModel() + { + FieldName = UtilMethods.FieldNameSql(), + ConditionalType = ConditionalType.Equal, + FieldValue = PubConst.Orm_SqlFalseString + }); + } + } + + private void OrAll(DataModel dataModel, QueryMethodInfo queryObject, List conditionalModels) + { + foreach (var item in dataModel.DefaultParameters.Where(it => it.IsMergeWhere != true&& string.IsNullOrEmpty(it.MergeForName))) + { + ConvetConditional(dataModel, queryObject, conditionalModels, item); + } + var conditionalList = conditionalModels.Select(it => new KeyValuePair(WhereType.Or, (ConditionalModel)it)).ToList(); + conditionalModels.Clear(); + conditionalModels.Add(new ConditionalCollections() + { + ConditionalList = conditionalList, + }); + if (conditionalList.Count == 0) + { + conditionalModels.Clear(); + conditionalModels.Add(new ConditionalModel() + { + FieldName = UtilMethods.FieldNameSql(), + ConditionalType = ConditionalType.Equal, + FieldValue = PubConst.Orm_SqlFalseString + }); + } + } + + private void Custom(DataModel dataModel, QueryMethodInfo queryObject, List conditionalModels) + { + var temp = dataModel.WhereRelationTemplate+string.Empty; + List sugarParameters = new List(); + var index = 0; + foreach (var item in dataModel.DefaultParameters!.Where(it => it.IsMergeWhere != true)) + { + index++; + ConvetConditional(dataModel, queryObject, conditionalModels, item); + var conditional=conditionalModels.Last(); + var sql = queryObject.Context.Utilities.ConditionalModelsToSql(new List() { conditional }, index); + if (item.ValueIsReadOnly) + { + temp = temp.Replace($"{{{item.Id}}}", sql.Key); + sugarParameters.AddRange(sql.Value); + } + else if (item.Value?.Equals(string.Empty)==true) + { + temp = temp.Replace($"{{{item.Id}}}",$" 1=1 "); + } + else + { + temp = temp.Replace($"{{{item.Id}}}", sql.Key); + sugarParameters.AddRange(sql.Value); + } + } + queryObject.Where(temp, sugarParameters); + conditionalModels.Clear(); + } + + private void CustomAll(DataModel dataModel, QueryMethodInfo queryObject, List conditionalModels) + { + var temp = dataModel.WhereRelationTemplate + string.Empty; + List sugarParameters = new List(); + var index = 0; + foreach (var item in dataModel.DefaultParameters.Where(it=>it.IsMergeWhere!=true)!) + { + index++; + ConvetConditional(dataModel, queryObject, conditionalModels, item); + var conditional = conditionalModels.Last(); + var sql = queryObject.Context.Utilities.ConditionalModelsToSql(new List() { conditional }, index); + if (item.ValueIsReadOnly) + { + temp = temp.Replace($"{{{item.Id}}}", sql.Key); + sugarParameters.AddRange(sql.Value); + } + else + { + temp = temp.Replace($"{{{item.Id}}}", sql.Key); + sugarParameters.AddRange(sql.Value); + } + } + queryObject.Where(temp, sugarParameters); + conditionalModels.Clear(); + } + + private void ConvetConditional(DataModel dataModel, QueryMethodInfo queryObject, List conditionalModels, DataModelDefaultParameter? item) + { + var preoperyName = item?.Name; + item!.Name =_sqlSugarClient!.EntityMaintenance.GetDbColumnName(item.PropertyName??item.Name, queryObject.EntityType); + if (item.Value != null) + { + if (item.ValueType == typeof(bool).Name) + { + if (item.Value?.ToString().EqualsCase("true") == true || item.Value?.ToString().EqualsCase("false") == true) + { + item.Value = Convert.ToBoolean(item.Value); + } + else + { + item.Value = Convert.ToBoolean(Convert.ToInt32(item.Value)); + } + } + } + if (item.ValueType == PubConst.Orm_WhereValueTypeClaimKey) + { + if (!dataModel.ClaimList.Any(it => it.Key?.ToLower() == item.Value?.ToString()?.ToLower())) + { + throw new SqlSugarException(TextHandler.GetCommonText("授权失败,没有找到Claim Key" + item.Value, "Authorization failure ,ClaimList Not Found Key:" + item.Value)); + } + var value = dataModel.ClaimList.FirstOrDefault(it => it.Key?.ToLower() == item.Value?.ToString()?.ToLower()).Value; + item.Value = value; + item.ValueType = value?.GetType()?.Name; + } + var forNames = dataModel.DefaultParameters.Where(it => it.MergeForName?.ToLower() == (preoperyName)?.ToLower()).ToList(); + if (forNames.Any()) + { + foreach (var forItem in forNames) + { + forItem.Name = _sqlSugarClient!.EntityMaintenance.GetDbColumnName(forItem.Name, queryObject.EntityType); + } + ConvetConditionalModelForNames(conditionalModels, item, forNames); + } + else + { + ConvetConditionalModelDefault(conditionalModels, item); + } + } + + private void ConvetConditionalModelForNames(List conditionalModels, DataModelDefaultParameter item, List forNames) + { + var colItem = new ConditionalModel() { FieldName = GetFieldName(item), ConditionalType = ConditionalType.Like, CSharpTypeName = item.ValueType, FieldValue = item.Value + "" }; + var conditionalCollections = new ConditionalCollections() + { + ConditionalList = new List>() + { + new KeyValuePair(WhereType.And,colItem) + } + }; + foreach (var it in forNames) + { + var colItemNext = new ConditionalModel() { FieldName = GetFieldName(it), ConditionalType = ConditionalType.Like, CSharpTypeName = item.ValueType, FieldValue = item.Value + "" }; + conditionalCollections.ConditionalList.Add(new KeyValuePair(WhereType.Or, colItemNext)); + } + conditionalModels.Add(conditionalCollections); + } + + private void ConvetConditionalModelDefault(List conditionalModels, DataModelDefaultParameter? item) + { + switch (item?.FieldOperator) + { + case FieldOperatorType.Equal: + conditionalModels.Add(new ConditionalModel() { FieldName =GetFieldName(item), ConditionalType = ConditionalType.Equal, CSharpTypeName = item.ValueType, FieldValue = item.Value + "" }); + break; + case FieldOperatorType.NoEqual: + conditionalModels.Add(new ConditionalModel() { FieldName = GetFieldName(item), ConditionalType = ConditionalType.NoEqual, CSharpTypeName = item.ValueType, FieldValue = item.Value + "" }); + break; + case FieldOperatorType.GreaterThan: + conditionalModels.Add(new ConditionalModel() { FieldName = GetFieldName(item), ConditionalType = ConditionalType.GreaterThan, CSharpTypeName = item.ValueType, FieldValue = item.Value + "" }); + break; + case FieldOperatorType.GreaterThanOrEqual: + conditionalModels.Add(new ConditionalModel() { FieldName = GetFieldName(item), ConditionalType = ConditionalType.GreaterThanOrEqual, CSharpTypeName = item.ValueType, FieldValue = item.Value + "" }); + break; + case FieldOperatorType.LessThan: + conditionalModels.Add(new ConditionalModel() { FieldName = GetFieldName(item), ConditionalType = ConditionalType.LessThan, CSharpTypeName = item.ValueType, FieldValue = item.Value + "" }); + break; + case FieldOperatorType.LessThanOrEqual: + conditionalModels.Add(new ConditionalModel() { FieldName = GetFieldName(item), ConditionalType = ConditionalType.LessThanOrEqual, CSharpTypeName = item.ValueType, FieldValue = item.Value + "" }); + break; + case FieldOperatorType.Like: + conditionalModels.Add(new ConditionalModel() { FieldName = GetFieldName(item), ConditionalType = ConditionalType.Like, CSharpTypeName = item.ValueType, FieldValue = item.Value + "" }); + break; + case FieldOperatorType.In: + conditionalModels.Add(new ConditionalModel() { FieldName = GetFieldName(item), ConditionalType = ConditionalType.In, CSharpTypeName = item.ValueType, FieldValue = item.Value + "" }); + break; + case FieldOperatorType.NotIn: + conditionalModels.Add(new ConditionalModel() { FieldName = GetFieldName(item), ConditionalType = ConditionalType.NotIn, CSharpTypeName = item.ValueType, FieldValue = item.Value + "" }); + break; + case FieldOperatorType.LikeLeft: + conditionalModels.Add(new ConditionalModel() { FieldName = GetFieldName(item), ConditionalType = ConditionalType.LikeLeft, CSharpTypeName = item.ValueType, FieldValue = item.Value + "" }); + break; + case FieldOperatorType.LikeRight: + conditionalModels.Add(new ConditionalModel() { FieldName = GetFieldName(item), ConditionalType = ConditionalType.LikeRight, CSharpTypeName = item.ValueType, FieldValue = item.Value + "" }); + break; + case FieldOperatorType.NoLike: + conditionalModels.Add(new ConditionalModel() { FieldName = GetFieldName(item), ConditionalType = ConditionalType.NoLike, CSharpTypeName = item.ValueType, FieldValue = item.Value + "" }); + break; + default: + break; + } + } + + private string GetFieldName(DataModelDefaultParameter item) + { + if (this.resultType != null) + { + return item.Name; + } + else + { + return PubConst.Orm_TableDefaultPreName + item.TableIndex + "." + item.Name; + } + } + } +} diff --git a/ReZero/SuperAPI/DataService/Query/QueryPrimaryKey.cs b/ReZero/SuperAPI/DataService/Query/QueryPrimaryKey.cs new file mode 100644 index 0000000..013af4d --- /dev/null +++ b/ReZero/SuperAPI/DataService/Query/QueryPrimaryKey.cs @@ -0,0 +1,26 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class QueryByPrimaryKey:CommonDataService, IDataService + { + + public async Task ExecuteAction(DataModel dataModel) + { + var db = App.GetDbTableId(dataModel.TableId) ?? App.Db; + var type =await EntityGeneratorManager.GetTypeAsync(dataModel.TableId); + base.InitDb(type, db); + var pkPara = dataModel.DefaultParameters.First(); + var id = pkPara.Value; + id=EntityPropertyMappingService.ConvertValue(id!, pkPara.ValueType!); + var data=await db.QueryableByObject(type).InSingleAsync(id); + return data; + } + + } +} diff --git a/ReZero/SuperAPI/DataService/Query/QueryTree.cs b/ReZero/SuperAPI/DataService/Query/QueryTree.cs new file mode 100644 index 0000000..e28514c --- /dev/null +++ b/ReZero/SuperAPI/DataService/Query/QueryTree.cs @@ -0,0 +1,85 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class QueryTree : CommonDataService, IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + var db = App.GetDbTableId(dataModel.TableId) ?? App.Db; + RefAsync count = 0; + var parameter = dataModel.TreeParameter; + var type = await EntityGeneratorManager.GetTypeAsync(dataModel.TableId); + base.InitDb(type, db); + var entity = db.EntityMaintenance.GetEntityInfo(type); + var pkColumnInfo = entity.Columns.FirstOrDefault(it => it.IsPrimarykey); + CheckEntityInfo(pkColumnInfo); + var pkValue = UtilMethods.ChangeType2(dataModel.DefaultParameters.First().Value, pkColumnInfo.PropertyInfo.PropertyType); + var data = await db.QueryableByObject(type) + .InSingleAsync(pkValue); + var typeBuilder = GetTypeBuilder(db, parameter, type, entity); + var parentCodeName = entity.Columns.FirstOrDefault(it => it.PropertyName.EqualsCase(parameter?.ParentCodePropertyName?.Trim() ?? "")); + var codeName = entity.Columns.FirstOrDefault(it => it.PropertyName.EqualsCase(parameter?.CodePropertyName ?? "")); + CheckPars(parentCodeName, codeName); + object? parentId = new object(); + var treeType = typeBuilder.WithCache().BuilderType(); + if (data != null) + parentId = data.GetType()?.GetProperty(parentCodeName.PropertyName)?.GetValue(data) ?? 1; + + if (dataModel.DefaultParameters.Count() > 1) + { + var queryable = db.QueryableByObject(treeType, PubConst.Orm_TableDefaultMasterTableShortName); + var queryCommon = new QueryCommon(); + queryCommon._sqlSugarClient = db; + dataModel.DefaultParameters=dataModel.DefaultParameters.Skip(1).ToList(); + queryable = queryCommon.Where(treeType, dataModel, queryable); + return await queryable.ToTreeAsync(parameter?.ChildPropertyName, parentCodeName.PropertyName, parentId, codeName.PropertyName); + } + else + { + var result = await db.QueryableByObject(treeType) + .ToTreeAsync(parameter?.ChildPropertyName, parentCodeName.PropertyName, parentId, codeName.PropertyName); + return result; + } + } + + private static void CheckEntityInfo(EntityColumnInfo pkColumnInfo) + { + if (pkColumnInfo == null) + { + throw new Exception(TextHandler.GetCommonText("实体没有配置主键", "The entity is not configured with a primary key")); + } + } + private static DynamicProperyBuilder GetTypeBuilder(ISqlSugarClient db, DataModelTreeParameter? parameter, Type type, EntityInfo entity) + { + var typeBuilder = db.DynamicBuilder().CreateClass("Tree" + type.Name, new SugarTable() { TableName = entity.DbTableName } + ) + .CreateProperty(parameter?.ChildPropertyName, typeof(DynamicOneselfTypeList), new SugarColumn() { IsIgnore = true }); + foreach (var item in entity.Columns) + { + typeBuilder.CreateProperty(item.PropertyName, item.PropertyInfo.PropertyType, new SugarColumn() + { + ColumnName = item.DbColumnName + }); + } + + return typeBuilder; + } + private static void CheckPars(EntityColumnInfo parentCodeName, EntityColumnInfo codeName) + { + if (parentCodeName == null) + { + throw new Exception(TextHandler.GetCommonText("实体没有配置父级编码", "The entity is not configured with a parent code")); + } + if (codeName == null) + { + throw new Exception(TextHandler.GetCommonText("实体没有配置编码", "The entity is not configured with a code")); + } + } + } +} diff --git a/ReZero/SuperAPI/DataService/Update/UpdateObject.cs b/ReZero/SuperAPI/DataService/Update/UpdateObject.cs new file mode 100644 index 0000000..bceeff3 --- /dev/null +++ b/ReZero/SuperAPI/DataService/Update/UpdateObject.cs @@ -0,0 +1,63 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class UpdateObject : CommonDataService, IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + var db = App.GetDbTableId(dataModel.TableId) ?? App.Db; + var type = await EntityGeneratorManager.GetTypeAsync(dataModel.TableId); + base.InitDb(type, db); + base.InitData(type, db, dataModel); + CheckSystemData(db, dataModel, type, db.EntityMaintenance.GetEntityInfo(type)); + this.SetDefaultValue(dataModel, db, type); + var updateable = db.UpdateableByObject(dataModel.Data); + UpdateCommonMethodInfo updateCommonMethodInfo = null!; + updateCommonMethodInfo = GetUpdateable(dataModel, updateable); + var result = await updateCommonMethodInfo.ExecuteCommandAsync(); + base.ClearAll(dataModel); + return GetResult(dataModel, result); + } + + private static UpdateCommonMethodInfo GetUpdateable(DataModel dataModel, UpdateMethodInfo updateable) + { + UpdateCommonMethodInfo updateCommonMethodInfo; + if (!string.IsNullOrEmpty(dataModel.TableColumns)) + { + updateCommonMethodInfo = updateable.UpdateColumns(dataModel.TableColumns.Split(",")); + } + else + { + updateCommonMethodInfo = updateable.UpdateColumns(dataModel.DefaultParameters.Select(it => it.Name).ToArray()); + } + + return updateCommonMethodInfo; + } + + private static object GetResult(DataModel dataModel, int result) + { + if (dataModel.ResultType == SqlResultType.AffectedRows) + { + return result; + } + else + { + return true; + } + } + + private void SetDefaultValue(DataModel dataModel, ISqlSugarClient db, Type type) + { + if (EntityMappingService.IsAnyDefaultValue(dataModel)) + { + dataModel.Data = EntityMappingService.GetDataByDefaultValueParameters(type, db, dataModel); + } + } + } +} diff --git a/ReZero/SuperAPI/DataService/Update/UpdateRange.cs b/ReZero/SuperAPI/DataService/Update/UpdateRange.cs new file mode 100644 index 0000000..534c5cb --- /dev/null +++ b/ReZero/SuperAPI/DataService/Update/UpdateRange.cs @@ -0,0 +1,100 @@ +using Newtonsoft.Json; +using SqlSugar; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class UpdateRange : CommonDataService, IDataService + { + public async Task ExecuteAction(DataModel dataModel) + { + var db = App.GetDbTableId(dataModel.TableId) ?? App.Db; + var type = await EntityGeneratorManager.GetTypeAsync(dataModel.TableId); + base.InitDb(type, db); + this.InitData(type, db, dataModel); + CheckSystemData(db, dataModel, type, db.EntityMaintenance.GetEntityInfo(type)); + this.SetDefaultValue(dataModel, db, type); + int result = await ExecuteUpdate(dataModel, db); + base.ClearAll(dataModel); + return GetResult(dataModel, result); + } + + private static async Task ExecuteUpdate(DataModel dataModel, ISqlSugarClient db) + { + var list= ((IList)dataModel.Data!).Cast().ToList(); + var result = 0; + try + { + db.Ado.BeginTran(); + await db.Utilities.PageEachAsync(list,100, async item => + { + var updateable = db.UpdateableByObject(item); + UpdateCommonMethodInfo updateCommonMethodInfo = null!; + updateCommonMethodInfo = GetUpdateable(dataModel, updateable); + result += await updateCommonMethodInfo.ExecuteCommandAsync(); + }); + db.Ado.CommitTran(); + } + catch (Exception) + { + db.Ado.RollbackTran(); + throw; + } + return result; + } + + internal new void InitData(Type type, ISqlSugarClient db, DataModel dataModel) + { + var json = dataModel?.DefaultParameters?.FirstOrDefault().Value + ""; + object obj = JsonConvert.DeserializeObject(json, typeof(List<>).MakeGenericType(type))!; + dataModel!.Data = obj; + } + private static UpdateCommonMethodInfo GetUpdateable(DataModel dataModel, UpdateMethodInfo updateable) + { + UpdateCommonMethodInfo updateCommonMethodInfo; + if (!string.IsNullOrEmpty(dataModel.TableColumns)) + { + updateCommonMethodInfo = updateable.UpdateColumns(dataModel.TableColumns.Split(",")); + } + else + { + updateCommonMethodInfo = updateable.UpdateColumns(); + } + + return updateCommonMethodInfo; + } + + private static object GetResult(DataModel dataModel, int result) + { + if (dataModel.ResultType == SqlResultType.AffectedRows) + { + return result; + } + else + { + return true; + } + } + + private void SetDefaultValue(DataModel dataModel, ISqlSugarClient db, Type type) + { + if (EntityMappingService.IsAnyDefaultValue(dataModel)) + { + foreach (var item in (IList)dataModel.Data!) + { + var para = new DataModel() + { + Data = item, + DefaultValueColumns = dataModel.DefaultValueColumns + }; + EntityMappingService.GetDataByDefaultValueParameters(type, db, para); + } + } + } + } +} diff --git a/ReZero/SuperAPI/DatabseModels/1Enum/IndexType.cs b/ReZero/SuperAPI/DatabseModels/1Enum/IndexType.cs new file mode 100644 index 0000000..0bae293 --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/1Enum/IndexType.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public enum IndexType + { + Default=0, + Unique=1 + } +} diff --git a/ReZero/SuperAPI/DatabseModels/1Enum/NativeTypes.cs b/ReZero/SuperAPI/DatabseModels/1Enum/NativeTypes.cs new file mode 100644 index 0000000..be4ab2e --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/1Enum/NativeTypes.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public enum NativeType + { + String, + Int, + Short, + Long, + Byte, + SByte, + Float, + Double, + Decimal, + Decimal_18_2, + Decimal_18_4, + Decimal_18_6, + Char, + Bool, + String11, + String20, + String30, + String50, + String100, + String255, + String500, + String1000, + String2000, + String4000, + StringMax, + DateTime, + DateOnly, + TimeSpan, + Guid, + ByteArray, + Json, + UInt, + UShort, + ULong, + IsIgnore + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/DatabseModels/1Enum/PrincipalType.cs b/ReZero/SuperAPI/DatabseModels/1Enum/PrincipalType.cs new file mode 100644 index 0000000..eba74f4 --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/1Enum/PrincipalType.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public enum PrincipalType + { + User, + Role + } +} diff --git a/ReZero/SuperAPI/DatabseModels/2Base/DbBase.cs b/ReZero/SuperAPI/DatabseModels/2Base/DbBase.cs new file mode 100644 index 0000000..f40bf41 --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/2Base/DbBase.cs @@ -0,0 +1,31 @@ +using SqlSugar; +using System; + +namespace ReZero.SuperAPI +{ + public class DbBase:IDeleted + { + [SugarColumn(IsPrimaryKey = true)] + public long Id { get; set; } + public int SortId { get; set; } + [SugarColumn(IsOnlyIgnoreUpdate =true,InsertServerTime =true)] + public DateTime CreateTime { get; set; } + public string? Creator { get; set; } = "-"; + public long CreatorId { get; set; } + [SugarColumn(UpdateServerTime =true,IsNullable =true,IsOnlyIgnoreInsert =true)] + public DateTime UpdateTime { get; set; } + [SugarColumn(IsNullable = true)] + public string? Modifier { get; set; } + [SugarColumn(IsNullable = true)] + public string? ModifierId { get; set; } + [SugarColumn(IsNullable = true)] + public string? LanguageKey { get; set; } + public bool IsDeleted { get; set; } + [SugarColumn(IsNullable =true)] + public string? EasyDescription { get; set; } + public bool IsInitialized { get; set; } + [SugarColumn(IsNullable =true)] + public bool? IsAttributeMethod { get; set; } + } + +} \ No newline at end of file diff --git a/ReZero/SuperAPI/DatabseModels/3Interface/IDeleted.cs b/ReZero/SuperAPI/DatabseModels/3Interface/IDeleted.cs new file mode 100644 index 0000000..246831e --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/3Interface/IDeleted.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + + public interface IDeleted + { + bool IsDeleted { get; set; } + } +} diff --git a/ReZero/SuperAPI/DatabseModels/API/InterfaceCategory.cs b/ReZero/SuperAPI/DatabseModels/API/InterfaceCategory.cs new file mode 100644 index 0000000..b56351c --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/API/InterfaceCategory.cs @@ -0,0 +1,21 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ZeroInterfaceCategory : DbBase + { + public string? Name { get; set; } + [SugarColumn(IsNullable =true)] + public long? ParentId{get;set;} + [SugarColumn(IsNullable =true)] + public string? Description { get; set; } + public string? Url { get; set; } = "#"; + [SugarColumn(IsIgnore = true,ExtendedAttribute =PubConst.Ui_TreeChild)] + public List? SubInterfaceCategories { get; set; } + [SugarColumn(IsNullable =true)] + public string? Icon { get; set; } + } +} diff --git a/ReZero/SuperAPI/DatabseModels/API/InterfaceList.cs b/ReZero/SuperAPI/DatabseModels/API/InterfaceList.cs new file mode 100644 index 0000000..e708a64 --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/API/InterfaceList.cs @@ -0,0 +1,27 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ZeroInterfaceList : DbBase + { + public string? Url { get; set; } + [SugarColumn(IsNullable =true)] + public string? OriginalUrl { get; set; } + public string? Name { get; set; } + public long InterfaceCategoryId { get; set; } + [SugarColumn(IsJson =true,IsNullable =true, ColumnDataType = StaticConfig.CodeFirst_BigString)] + public ResultModel? CustomResultModel{ get; set; } + [SugarColumn(IsNullable = true)] + public string? Description { get; set; } + public string GroupName { get; set; } = "默认分组"; + public string? HttpMethod { get; set; } + [SugarColumn(IsJson = true,ColumnDataType = StaticConfig.CodeFirst_BigString)] + public DataModel? DataModel { get; set; } + [SugarColumn(IsNullable =true)] + public long? DatabaseId { get; set; } + + } +} diff --git a/ReZero/SuperAPI/DatabseModels/API/InterfaceParameter.cs b/ReZero/SuperAPI/DatabseModels/API/InterfaceParameter.cs new file mode 100644 index 0000000..55e6e61 --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/API/InterfaceParameter.cs @@ -0,0 +1,16 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ZeroInterfaceParameter + { + public string? Name { get; set; } + public object? Value { get; set; } + public bool ValueIsReadOnly { get; set; } + public string? Description { get; set; } + public string? ValueType { get; set; } + } +} diff --git a/ReZero/SuperAPI/DatabseModels/Databases/DatabaseInfo.cs b/ReZero/SuperAPI/DatabseModels/Databases/DatabaseInfo.cs new file mode 100644 index 0000000..8cbe259 --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/Databases/DatabaseInfo.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ZeroDatabaseInfo : DbBase + { + public string? Name { get; set; } + public string? Connection { get; set; } + public SqlSugar.DbType DbType { get; set; } + } +} diff --git a/ReZero/SuperAPI/DatabseModels/Databases/UserInfo.cs b/ReZero/SuperAPI/DatabseModels/Databases/UserInfo.cs new file mode 100644 index 0000000..df2154c --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/Databases/UserInfo.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ZeroUserInfo : DbBase + { + public string? UserName { get; set; } + public string? Password { get; set; } + public bool IsMasterAdmin { get; set; } + [SqlSugar.SugarColumn(IsNullable =true)] + public string? Avatar { get; set; } + [SqlSugar.SugarColumn(IsNullable = true)] + public string? BusinessAccount { get; set; } + } +} diff --git a/ReZero/SuperAPI/DatabseModels/Entities/EntityColumnInfo.cs b/ReZero/SuperAPI/DatabseModels/Entities/EntityColumnInfo.cs new file mode 100644 index 0000000..5338ea4 --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/Entities/EntityColumnInfo.cs @@ -0,0 +1,30 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ZeroEntityColumnInfo : DbBase + { + public long TableId { get; set; } + public string? DbColumnName { get; set; } + public string? PropertyName { get; set; } + public int Length { get; set; } + public int DecimalDigits { get; set; } + [SugarColumn(IsNullable = true)] + public string? Description { get; set; } + public bool IsIdentity { get; set; } + public bool IsPrimarykey { get; set; } + public bool IsArray { get; set; } + public bool IsJson { get; set; } + public bool IsNullable { get; set; } + public int Scale { get; set; } + public bool IsUnsigned { get; set; } + public NativeType PropertyType { get; set; } + [SugarColumn(IsNullable=true)] + public string? DataType { get; set; } + [SugarColumn(IsNullable=true,Length =200)] + public string? ExtendedAttribute { get; set; } + } +} diff --git a/ReZero/SuperAPI/DatabseModels/Entities/EntityInfo.cs b/ReZero/SuperAPI/DatabseModels/Entities/EntityInfo.cs new file mode 100644 index 0000000..3ff4aaa --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/Entities/EntityInfo.cs @@ -0,0 +1,20 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ZeroEntityInfo : DbBase + { + public string? ClassName { get; set; } + public string? DbTableName { get; set; } + [SugarColumn(IsNullable = true)] + public int? ColumnCount { get; set; } + public long DataBaseId { get; set; } + [SugarColumn(IsNullable =true)] + public string ? Description { get; set; } + [Navigate(NavigateType.OneToMany,nameof(ZeroEntityColumnInfo.TableId))] + public List? ZeroEntityColumnInfos { get; set; } + } +} diff --git a/ReZero/SuperAPI/DatabseModels/Entities/JwtTokenManagement.cs b/ReZero/SuperAPI/DatabseModels/Entities/JwtTokenManagement.cs new file mode 100644 index 0000000..273037e --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/Entities/JwtTokenManagement.cs @@ -0,0 +1,33 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ZeroJwtTokenManagement : DbBase + { + /// + /// 连接用户名称,标识使用 JWT 的用户 + /// + [SugarColumn(Length = 200)] + public string? UserName { get; set; } + + /// + /// 描述,用于说明该 JWT 授权的用途或其他相关信息 + /// + [SugarColumn(Length =1000)] + public string? Description { get; set; } + + /// + /// 使用期限(授权有效期),定义 JWT 授权的最长可用时间 + /// + public DateTime Expiration { get; set; } + + /// + /// JWT Token,存储已生成的 JWT 令牌 + /// + [SugarColumn(Length = 800)] + public string? Token { get; set; } + } +} diff --git a/ReZero/SuperAPI/DatabseModels/Entities/SysSetting.cs b/ReZero/SuperAPI/DatabseModels/Entities/SysSetting.cs new file mode 100644 index 0000000..958709d --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/Entities/SysSetting.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ZeroSysSetting : DbBase, IDeleted + { + public int TypeId { get; set; } + public int ChildTypeId { get; set; } + + public bool BoolValue { get; set; } + [SqlSugar.SugarColumn(IsNullable =true)] + public string? StringValue { get; set; } + } +} diff --git a/ReZero/SuperAPI/DatabseModels/Entities/Template.cs b/ReZero/SuperAPI/DatabseModels/Entities/Template.cs new file mode 100644 index 0000000..1e06813 --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/Entities/Template.cs @@ -0,0 +1,19 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ZeroTemplate : DbBase + { + public TemplateType TypeId { get; set; } + public string? Title { get; set; } + [SugarColumn(ColumnDataType =StaticConfig.CodeFirst_BigString)] + public string ? TemplateContent { get; set; } + [SugarColumn(IsNullable =true)] + public string? TemplateContentStyle { get; set; } + [SugarColumn(IsNullable = true)] + public string? Url { get; set; } + } +} diff --git a/ReZero/SuperAPI/DatabseModels/Entities/TemplateType.cs b/ReZero/SuperAPI/DatabseModels/Entities/TemplateType.cs new file mode 100644 index 0000000..0999990 --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/Entities/TemplateType.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ZeroTemplateType: DbBase + { + public string? Name { get; set; } + } +} diff --git a/ReZero/SuperAPI/DatabseModels/Entities/ZeroPermissionInfo.cs b/ReZero/SuperAPI/DatabseModels/Entities/ZeroPermissionInfo.cs new file mode 100644 index 0000000..86092c5 --- /dev/null +++ b/ReZero/SuperAPI/DatabseModels/Entities/ZeroPermissionInfo.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ZeroPermissionInfo : DbBase + { + /// + /// 名称 + /// + public string? Name { get; set; } + } + + public class ZeroPermissionMapping : DbBase + { + /// + /// 用户名 + /// + public string? UserName { get; set; } + + /// + /// 接口ID + /// + public long? InterfaceId { get; set; } + + /// + /// 权限信息ID + /// + public long? PermissionInfoId { get; set; } + } +} diff --git a/ReZero/SuperAPI/DbContext/DatabaseContext.cs b/ReZero/SuperAPI/DbContext/DatabaseContext.cs new file mode 100644 index 0000000..189f803 --- /dev/null +++ b/ReZero/SuperAPI/DbContext/DatabaseContext.cs @@ -0,0 +1,78 @@ +using Microsoft.Extensions.Logging; +using SqlSugar; +using System; + +namespace ReZero.SuperAPI +{ + /// + /// Represents a database context for handling database operations using SqlSugar. + /// + public class DatabaseContext + { + /// + /// Gets the SqlSugar client instance for performing database operations. + /// + public ISqlSugarClient SugarClient { get; private set; } + + /// + /// Initializes a new instance of the DatabaseContext class with the provided database connection configuration. + /// + /// Database connection configuration. + public DatabaseContext(SuperAPIConnectionConfig rezeroConnectionConfig) + { + var connectionConfig = new ConnectionConfig() + { + DbType = rezeroConnectionConfig.DbType, + ConnectionString = rezeroConnectionConfig.ConnectionString, + IsAutoCloseConnection = true, + MoreSettings=new ConnMoreSettings() + { + SqlServerCodeFirstNvarchar=true + } + }; + + InitializeExternalServices(connectionConfig); + + ConfigureExternalServices(connectionConfig); + + // Create a new SqlSugar client instance using the provided connection configuration. + SugarClient = new SqlSugarClient(connectionConfig, db => + { + db.QueryFilter.AddTableFilter(it => it.IsDeleted == false); + db.Aop.OnLogExecuting = (s, p) => + ReZero.DependencyInjection.DependencyResolver.GetLogger().LogInformation(UtilMethods.GetNativeSql(s, p)); + }); + + + } + + /// + /// Configures external services for the provided database connection configuration. + /// + /// Database connection configuration. + private static void ConfigureExternalServices(ConnectionConfig connectionConfig) + { + connectionConfig.ConfigureExternalServices.EntityService = (x, p) => + { + // Convert the database column name to snake case. + p.DbColumnName = UtilMethods.ToUnderLine(p.DbColumnName); + }; + connectionConfig.ConfigureExternalServices.EntityNameService = (x, p) => + { + // Convert the database table name to snake case. + p.DbTableName = UtilMethods.ToUnderLine(p.DbTableName); + }; + } + + /// + /// Initializes external services for the provided database connection configuration. + /// + /// Database connection configuration. + private static void InitializeExternalServices(ConnectionConfig connectionConfig) + { + // Adds comments to explain the purpose of the method. + // Sets the ConfigureExternalServices property of the provided connection configuration to a new instance of ConfigureExternalServices if it is null. + connectionConfig.ConfigureExternalServices = connectionConfig.ConfigureExternalServices ?? new ConfigureExternalServices(); + } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/DbContext/ReZeroConnectionConfig.cs b/ReZero/SuperAPI/DbContext/ReZeroConnectionConfig.cs new file mode 100644 index 0000000..bfe6ae2 --- /dev/null +++ b/ReZero/SuperAPI/DbContext/ReZeroConnectionConfig.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace ReZero.SuperAPI +{ + + public class SuperAPIConnectionConfig + { + public SqlSugar.DbType DbType { get; set; } + public string? ConnectionString { get; set; } + } +} diff --git a/ReZero/SuperAPI/Entities/Const/NamingConventionsConst.cs b/ReZero/SuperAPI/Entities/Const/NamingConventionsConst.cs new file mode 100644 index 0000000..6f7ee0c --- /dev/null +++ b/ReZero/SuperAPI/Entities/Const/NamingConventionsConst.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class NamingConventionsConst + { + public const string ApiReZeroRoute = "PrivateReZeroRoute"; + } +} diff --git a/ReZero/SuperAPI/Entities/Options/CallBackUserInfo.cs b/ReZero/SuperAPI/Entities/Options/CallBackUserInfo.cs new file mode 100644 index 0000000..de228bd --- /dev/null +++ b/ReZero/SuperAPI/Entities/Options/CallBackUserInfo.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class CallBackUserInfo + { + public string? UserId { get; set; } + public string? UserName { get; set; } + } +} diff --git a/ReZero/SuperAPI/Entities/Options/ReZeroOptions.cs b/ReZero/SuperAPI/Entities/Options/ReZeroOptions.cs new file mode 100644 index 0000000..4aaf294 --- /dev/null +++ b/ReZero/SuperAPI/Entities/Options/ReZeroOptions.cs @@ -0,0 +1,190 @@ +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Threading.Tasks; +using System.Linq; +using Newtonsoft.Json; +using ReZero.Configuration; +namespace ReZero.SuperAPI +{ + /// + /// Represents configuration options for the ReZero SuperAPI. + /// + public class SuperAPIOptions + { + public static SuperAPIOptions GetOptions( string fileName = "appsettings.json") + { + string key = "ReZero"; + ReZeroJson configuration=ApiConfiguration.GetJsonValue(key,fileName); + SuperAPIOptions superAPIOptions = new SuperAPIOptions(); + superAPIOptions.IsEnableSuperAPI = true; + superAPIOptions.DatabaseOptions = new DatabaseOptions() + { + ConnectionConfig = new SuperAPIConnectionConfig() + { + ConnectionString = configuration.BasicDatabase?.ConnectionString, + DbType = configuration?.BasicDatabase?.DbType ?? SqlSugar.DbType.Sqlite + } + }; + superAPIOptions.UiOptions = new UiOptions() + { + ShowNativeApiDocument = configuration?.Ui?.ShowNativeApiDocument ?? true + }; + superAPIOptions.InterfaceOptions = new InterfaceOptions() + { + Jwt=configuration?.Jwt, + CorsOptions = configuration?.Cors?? new ReZeroCors() + }; + if (!string.IsNullOrEmpty(configuration?.Ui?.DefaultIndexSource)) + { + superAPIOptions.UiOptions.DefaultIndexSource = configuration.Ui.DefaultIndexSource; + } + return superAPIOptions; + } + + public void EnableSuperApi() + { + SuperAPIOptions options = new SuperAPIOptions(); + IsEnableSuperAPI = true; + this.DatabaseOptions = options.DatabaseOptions; + this.InterfaceOptions = options.InterfaceOptions; + this.DependencyInjectionOptions = options.DependencyInjectionOptions; + this.UiOptions = options.UiOptions; + } + public void EnableSuperApi(SuperAPIOptions options) + { + IsEnableSuperAPI = true; + this.DatabaseOptions = options.DatabaseOptions; + this.InterfaceOptions = options.InterfaceOptions; + this.DependencyInjectionOptions = options.DependencyInjectionOptions; + this.UiOptions = options.UiOptions; + } + + /// + /// Enable super api + /// + internal bool IsEnableSuperAPI = false; + + /// + /// Gets or sets the database configuration options. + /// + public DatabaseOptions? DatabaseOptions { get; set; } + + + public InterfaceOptions InterfaceOptions { get; set; } = new InterfaceOptions(); + + /// + /// Gets or sets the options for the DependencyInjection. + /// + public DependencyInjectionOptions DependencyInjectionOptions { get; set; } = new DependencyInjectionOptions(); + + /// + /// Gets or sets the UI configuration options. + /// + public UiOptions UiOptions { get; set; } = new UiOptions(); + + + } + public class DependencyInjectionOptions + { + public Assembly[]? Assemblies { get; set; } + + public bool InitDependencyInjection => Assemblies?.Any() ?? false; + + public DependencyInjectionOptions(params Assembly[] assemblies) + { + if (!InitDependencyInjection) + { + this.Assemblies = assemblies; + } + } + } + public class InterfaceOptions + { + public string? AuthorizationLocalStorageName { get; set; } = "RezeroLocalStorage"; + public string PageNumberPropName { set; get; } = "PageNumber"; + public string PageSizePropName { set; get; } = "PageSize"; + public DefaultSuperApiAop SuperApiAop { get; set; } = new DefaultSuperApiAop(); + public Func? NoAuthorizationFunc { get; set; } + + public Func? MergeDataToStandardDtoFunc { get; set; } + public ReZeroJwt? Jwt { get; set; } + public ReZeroCors CorsOptions { get; set; } = new ReZeroCors(); + + public JsonSerializerSettings? JsonSerializerSettings { get; set; } + } + + /// + /// Represents configuration options for the database settings in ReZero. + /// + public class DatabaseOptions + { + /// + /// Gets or sets whether to initialize configuration tables. Default is true. + /// + public bool InitializeTables { get; set; } = true; + + /// + /// Gets or sets the initialization connection string information. Default is SQLite. + /// + public SuperAPIConnectionConfig ConnectionConfig { get; set; } = new SuperAPIConnectionConfig() + { + DbType = SqlSugar.DbType.Sqlite, + ConnectionString = "datasource=ReZero.db" + }; + + /// + /// Callback function to retrieve the current user information. + /// + internal Func GetCurrentUserCallback { get; set; } = () => new CallBackUserInfo { UserId = "1", UserName = "Admin" }; + } + + /// + /// Represents configuration options for the user interface settings in ReZero. + /// + public class UiOptions + { + /// + /// Gets or sets the language for the UI. + /// + public Language UiLanguage { get; set; } + + /// + /// Gets or sets the folder name for the default UI. Default is "default_ui". + /// + public string? DefaultUiFolderName { get; set; } = "default_ui"; + + /// + /// Gets or sets the source path for the default index. Default is "/swagger". + /// + public string? DefaultIndexSource { get; set; } = "/swagger"; + + /// + /// Gets or sets the path for NuGet packages. Default is the default user NuGet packages path. + /// + public string? NugetPackagesPath { get; set; } = @"C:\Users\Administrator\.nuget\packages"; + /// + /// Show system api document + /// + public bool ShowSystemApiDocument { get; set; } = false; + /// + /// Show native api document + /// + public bool ShowNativeApiDocument { get; set; } = true; + /// + /// Enable Login page Configuration on the UI + /// + internal bool EnableLoginPage { get; set; } + } + + + public class AopOptions + { + public Func? DynamicApiBeforeInvokeAsync { get; set; } + public Func? DynamicApiAfterInvokeAsync { get; set; } + + public Func? SystemApiBeforeInvokeAsync { get; set; } + public Func? SystemApiAfterInvokeAsync { get; set; } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/Entities/Parameters/DefaultSuperApiAop.cs b/ReZero/SuperAPI/Entities/Parameters/DefaultSuperApiAop.cs new file mode 100644 index 0000000..141a6de --- /dev/null +++ b/ReZero/SuperAPI/Entities/Parameters/DefaultSuperApiAop.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + public class DefaultSuperApiAop : ISuperApiAop + { + public virtual Task OnExecutingAsync(InterfaceContext context) + { + return Task.FromResult(0); + } + + public virtual Task OnExecutedAsync(InterfaceContext context) + { + return Task.FromResult(0); + } + + public virtual Task OnErrorAsync(InterfaceContext context) + { + return Task.FromResult(0); + } + } +} diff --git a/ReZero/SuperAPI/Entities/Parameters/DynamicInterfaceContext.cs b/ReZero/SuperAPI/Entities/Parameters/DynamicInterfaceContext.cs new file mode 100644 index 0000000..176a5fd --- /dev/null +++ b/ReZero/SuperAPI/Entities/Parameters/DynamicInterfaceContext.cs @@ -0,0 +1,32 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class InterfaceContext + { + public InterfaceType InterfaceType { get; internal set; } + public HttpContext? HttpContext { get; internal set; } + public DataModel? DataModel { get; internal set; } + public ZeroInterfaceList? InterfaceInfo { get; internal set; } + public Exception? Exception { get; internal set; } + public ServiceProvider? ServiceProvider { get; internal set; } + + public void AttachClaimToHttpContext(string claimKey, object claimValue) + { + if (DataModel != null&& !DataModel.ClaimList!.ContainsKey(claimKey)) + { + DataModel!.ClaimList!.Add(claimKey, claimValue); + } + } + } + public enum InterfaceType + { + DynamicApi, + SystemApi, + } +} diff --git a/ReZero/SuperAPI/EntityManager/Entities/DbColumnInfo.cs b/ReZero/SuperAPI/EntityManager/Entities/DbColumnInfo.cs new file mode 100644 index 0000000..82343d8 --- /dev/null +++ b/ReZero/SuperAPI/EntityManager/Entities/DbColumnInfo.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class DbColumnInfo:SqlSugar.DbColumnInfo + { + + } +} diff --git a/ReZero/SuperAPI/EntityManager/Entities/DbTableInfo.cs b/ReZero/SuperAPI/EntityManager/Entities/DbTableInfo.cs new file mode 100644 index 0000000..9830ecf --- /dev/null +++ b/ReZero/SuperAPI/EntityManager/Entities/DbTableInfo.cs @@ -0,0 +1,14 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class DbTableInfo:SqlSugar.DbTableInfo + { + [SugarColumn(IsPrimaryKey =true)] + public long Id { get; set; } + public List? ColumnInfos { get; set; } + } +} diff --git a/ReZero/SuperAPI/EntityManager/EntityGeneratorManager.cs b/ReZero/SuperAPI/EntityManager/EntityGeneratorManager.cs new file mode 100644 index 0000000..bd7c1b4 --- /dev/null +++ b/ReZero/SuperAPI/EntityManager/EntityGeneratorManager.cs @@ -0,0 +1,353 @@ +using Newtonsoft.Json.Linq; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using System.Linq; +using System.Text.RegularExpressions; +namespace ReZero.SuperAPI +{ + public class EntityGeneratorManager + { + public async static Task GetTypeAsync(long tableId) + { + var cacheManage = SqlSugar.ReflectionInoCore.GetInstance(); + var key = GetTypeCacheKey(tableId); + if (cacheManage.ContainsKey(key)) + { + return cacheManage[key]; + } + else + { + var result = await GetType(tableId); + cacheManage.Add(key, result); + return result; + } + } + + public static void RemoveTypeCacheByTypeId(long tableId) + { + var cacheManage = SqlSugar.ReflectionInoCore.GetInstance(); + var key = GetTypeCacheKey(tableId); + cacheManage.Remove(key); + } + private static string GetTypeCacheKey(long tableId) + { + return string.Format(PubConst.CacheKey_Type, tableId); + } + private static async Task GetType(long tableId) + { + var db = App.Db; + var tableInfo = await db.Queryable().Includes(x => x.ZeroEntityColumnInfos).InSingleAsync(tableId); + CheckTableInfo(tableInfo); + var builder = db.DynamicBuilder().CreateClass(tableInfo.ClassName, new SqlSugar.SugarTable() + { + TableName = tableInfo.DbTableName, + TableDescription=tableInfo.Description + }); + foreach (var item in tableInfo.ZeroEntityColumnInfos ?? new List()) + { + + var typeName = item.PropertyType.ToString(); + if (StringHasLength(typeName)) + { + item.Length = ExtractNumericPart(typeName); + item.PropertyType = NativeType.String; + } + else if (DecimalHasLength(typeName)) + { + var typeInfo = ExtractTypeInformation(typeName); + item.Length = typeInfo.Length; + item.DecimalDigits = typeInfo.DecimalDigits; + item.PropertyType = NativeType.Decimal; + } + else if (typeName == NativeType.StringMax + "") + { + item.PropertyType = NativeType.String; + item.Length = int.MaxValue; + } + var propertyType = GetTypeByNativeTypes(item.PropertyType); + var column = new SugarColumn() + { + ColumnName = item.DbColumnName, + IsJson = item.PropertyType == NativeType.Json, + IsIdentity = item.IsIdentity, + IsPrimaryKey = item.IsPrimarykey, + DecimalDigits = item.DecimalDigits, + Length = item.Length, + ColumnDataType = item.DataType, + ColumnDescription = item.Description, + IsNullable = item.IsNullable + }; + if (item.PropertyType==NativeType.String&&column.Length == 0) + { + column.Length = 255; + } + if (column.Length == int.MaxValue) + { + column.ColumnDataType = StaticConfig.CodeFirst_BigString; + column.Length = 0; + column.DecimalDigits = 0; + } + if (DataTypeHasLength(column)) + { + item.Length = 0; + item.DecimalDigits = 0; + } + if (item.ExtendedAttribute?.ToString() == PubConst.Ui_TreeChild) + { + propertyType = typeof(DynamicOneselfTypeList); + column.IsIgnore = true; + } + if (item.PropertyType == NativeType.IsIgnore) + { + column.IsIgnore = true; + } + builder.CreateProperty(item.PropertyName, propertyType, column); + } + var type = builder.BuilderType(); + return type; + } + + private static void CheckTableInfo(ZeroEntityInfo tableInfo) + { + if (tableInfo == null) + { + throw new Exception(TextHandler.GetCommonText("实体不存在了", "The entity does not exist")); + } + } + + private static bool DecimalHasLength(string typeName) + { + return typeName.StartsWith("Decimal") && ExtractNumericPart(typeName) > 0; + } + + private static bool StringHasLength(string typeName) + { + return typeName.StartsWith("String") && ExtractNumericPart(typeName) > 0; + } + + private static bool DataTypeHasLength(SugarColumn column) + { + return ExtractNumericPart(column.ColumnDataType ?? "") > 0 && (column.ColumnDataType ?? "").Contains("(") && (column.ColumnDataType ?? "").Contains(")"); + } + + public static DbColumnInfo ExtractTypeInformation(string typeName) + { + // 使用正则表达式匹配数字部分 + Match match = Regex.Match(typeName, @"_(\d+)_(\d+)$"); + + if (match.Success && match.Groups.Count == 3) + { + int length = int.Parse(match.Groups[1].Value); + int precision = int.Parse(match.Groups[2].Value); + + return new DbColumnInfo { Length = length, DecimalDigits = precision }; + } + + throw new FormatException($"Invalid type format: {typeName}"); + } + public static int ExtractNumericPart(string input) + { + Match match = Regex.Match(input, @"\d+"); + if (match.Success) + { + return int.Parse(match.Value); + } + return 0; // 默认值,如果未找到数字部分 + } + public static Type GetTypeByNativeTypes(NativeType nativeTypes) + { + switch (nativeTypes) + { + case NativeType.Int: + return typeof(int); + case NativeType.UInt: + return typeof(uint); + case NativeType.Short: + return typeof(short); + case NativeType.UShort: + return typeof(ushort); + case NativeType.Long: + return typeof(long); + case NativeType.ULong: + return typeof(ulong); + case NativeType.Byte: + return typeof(byte); + case NativeType.SByte: + return typeof(sbyte); + case NativeType.Float: + return typeof(float); + case NativeType.Double: + return typeof(double); + case NativeType.Decimal: + return typeof(decimal); + case NativeType.Char: + return typeof(char); + case NativeType.Bool: + return typeof(bool); + case NativeType.String: + return typeof(string); + case NativeType.DateTime: + return typeof(DateTime); + case NativeType.TimeSpan: + return typeof(TimeSpan); + case NativeType.Guid: + return typeof(Guid); + case NativeType.ByteArray: + return typeof(byte[]); + case NativeType.Json: + case NativeType.IsIgnore: + return typeof(object); // Assuming Json is a placeholder for any JSON-related type + default: + if (nativeTypes.ToString().ToLower().StartsWith("string")) + { + return typeof(string); + } + else if (nativeTypes.ToString().ToLower().StartsWith("decimal")) + { + return typeof(decimal); + } + throw new ArgumentException("Unsupported NativeType"); + } + } + public static NativeType GetNativeTypeByType(Type type) + { + if (type == typeof(int)) + return NativeType.Int; + else if (type == typeof(uint)) + return NativeType.UInt; + else if (type == typeof(short)) + return NativeType.Short; + else if (type == typeof(ushort)) + return NativeType.UShort; + else if (type == typeof(long)) + return NativeType.Long; + else if (type == typeof(ulong)) + return NativeType.ULong; + else if (type == typeof(byte)) + return NativeType.Byte; + else if (type == typeof(sbyte)) + return NativeType.SByte; + else if (type == typeof(float)) + return NativeType.Float; + else if (type == typeof(double)) + return NativeType.Double; + else if (type == typeof(decimal)) + return NativeType.Decimal; + else if (type == typeof(char)) + return NativeType.Char; + else if (type == typeof(bool)) + return NativeType.Bool; + else if (type == typeof(string)) + return NativeType.String; + else if (type == typeof(DateTime)) + return NativeType.DateTime; + else if (type == typeof(TimeSpan)) + return NativeType.TimeSpan; + else if (type == typeof(Guid)) + return NativeType.Guid; + else if (type == typeof(byte[])) + return NativeType.ByteArray; + else if (typeof(JToken).IsAssignableFrom(type)) + return NativeType.Json; + else if (type.IsEnum) + return NativeType.Int; + // Check if the type is nullable and get the underlying type + Type underlyingType = Nullable.GetUnderlyingType(type); + if (underlyingType != null) + { + return GetNativeTypeByType(underlyingType); + } + return NativeType.Json; + } + + public static Type GetTypeByString(string typeName) + { + if (typeName == null) + return typeof(object); // Default to object type if no match is found + + typeName = typeName.Trim().ToLower(); + + if (typeName == "int") + return typeof(int); + else if (typeName == "uint") + return typeof(uint); + else if (typeName == "short") + return typeof(short); + else if (typeName == "ushort") + return typeof(ushort); + else if (typeName == "long") + return typeof(long); + else if (typeName == "ulong") + return typeof(ulong); + else if (typeName == "byte") + return typeof(byte); + else if (typeName == "sbyte") + return typeof(sbyte); + else if (typeName == "float") + return typeof(float); + else if (typeName == "double") + return typeof(double); + else if (typeName == "decimal") + return typeof(decimal); + else if (typeName == "char") + return typeof(char); + else if (typeName == "bool") + return typeof(bool); + else if (typeName == "string") + return typeof(string); + else if (typeName == "datetime") + return typeof(DateTime); + else if (typeName == "timespan") + return typeof(TimeSpan); + else if (typeName == "guid") + return typeof(Guid); + else if (typeName == "byte[]") + return typeof(byte[]); + else if (typeName == "jtoken") + return typeof(Newtonsoft.Json.Linq.JToken); // Assuming JToken is from Newtonsoft.Json.Linq + else + return typeof(object); // Default to object type if no match is found + } + + public static string GetNativeTypeName(string name) + { + string result= name??string.Empty; + if (name == "Int32") + { + result = "int"; + } + else if (name == "Int64") + { + result = "long"; + } + else if (name == "Int16") + { + result = "short"; + } + else if (name == "String") + { + result = "string"; + } + else if (name == "Decimal") + { + result = "decimal"; + } + else if (name == "Byte") + { + result = "byte"; + } + else if (name == "Double") + { + result = "double"; + } + else if (name == "Boolean") + { + result = "bool"; + } + return result; + } + } +} diff --git a/ReZero/SuperAPI/EntityManager/EntityMappingService.cs b/ReZero/SuperAPI/EntityManager/EntityMappingService.cs new file mode 100644 index 0000000..ae9f62f --- /dev/null +++ b/ReZero/SuperAPI/EntityManager/EntityMappingService.cs @@ -0,0 +1,208 @@ +using SqlSugar; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class EntityMappingService + { + public Action? TableInfoConvertFunc { get; set; } + + public Action? TableColumnInfoConvertFunc { get; set; } + + internal static bool IsAnyDefaultValue(DataModel dataModel) + { + return dataModel.DefaultValueColumns?.Any() == true; + } + internal static object? GetDataByDefaultValueParameters(Type type,ISqlSugarClient db, DataModel dataModel) + { + if (dataModel.Data == null) + return dataModel.Data; + var entityInfo=db.EntityMaintenance.GetEntityInfo(type); + var now = DateTime.Now; + if (dataModel.DefaultValueColumns.Any(it => it.Type == DefaultValueType.CurrentTime)) + { + now = db.GetDate(); + } + if (dataModel.Data is IList list) + { + foreach (var item in list) + { + SetDatefaultValue(item, entityInfo, db, dataModel, now.AddMilliseconds(1)); + } + } + else + { + SetDatefaultValue(dataModel.Data, entityInfo, db, dataModel, now); + } + return dataModel.Data; + } + + private static void SetDatefaultValue(object item, EntityInfo entityInfo, ISqlSugarClient db, DataModel dataModel, DateTime now) + { + foreach (var DefaultValue in dataModel.DefaultValueColumns??new List()) + { + var columnInfo = entityInfo.Columns.FirstOrDefault(it => it.PropertyName.EqualsCase(DefaultValue.PropertyName!)); + var value = columnInfo.PropertyInfo.GetValue(item); + var defauleValue = UtilMethods.GetDefaultValue(columnInfo.UnderType); + if (columnInfo != null&& (value == null||value.Equals(defauleValue) || (value is string && value?.ToString()==""))) + { + try + { + switch (DefaultValue.Type!) + { + case DefaultValueType.None: + break; + case DefaultValueType.FixedValue: + columnInfo.PropertyInfo.SetValue(item, UtilMethods.ChangeType2(DefaultValue.Value, columnInfo.UnderType)); + break; + case DefaultValueType.DefaultValue: + columnInfo.PropertyInfo.SetValue(item, defauleValue); + break; + case DefaultValueType.CurrentTime: + if (columnInfo.UnderType == typeof(DateTime)) + { + columnInfo.PropertyInfo.SetValue(item, now); + } + else + { + throw new Exception(TextHandler.GetCommonText(PubConst.ErrorCode_001 + columnInfo.PropertyName + "默认值配置错,只能在时间类型配置:当前时间", PubConst.ErrorCode_001 + columnInfo.PropertyName + " The default value is incorrectly configured and can only be configured for the time type: current time")); + } + break; + case DefaultValueType.ClaimKey: + var claim = dataModel.ClaimList.FirstOrDefault(it => it.Key.EqualsCase(DefaultValue.Value!)); + if (claim.Key != null) + { + columnInfo.PropertyInfo.SetValue(item, claim.Value); + } + else + { + throw new Exception(TextHandler.GetCommonText(PubConst.ErrorCode_001+"默认值赋值失败,没有找到 Claim key" + DefaultValue.Value, PubConst.ErrorCode_001+"Default assignment failed, claim key not found " + DefaultValue.Value)); + } + break; + } + } + catch (Exception ex) + { + if (!ex.Message.Contains(PubConst.ErrorCode_001)) + throw new Exception(TextHandler.GetCommonText(columnInfo.PropertyName + "默认值赋值失败 " + ex.Message, columnInfo.PropertyName + "Default assignment failed " + ex.Message)); + else + throw ex; + } + + } + } + } + + public ZeroEntityInfo ConvertDbToEntityInfo(Type type) + { + var db = App.PreStartupDb; + var entityInfo = db!.EntityMaintenance.GetEntityInfo(type); + ZeroEntityInfo result = new ZeroEntityInfo() + { + DbTableName = entityInfo.DbTableName, + ClassName=entityInfo.EntityName, + Description = entityInfo.TableDescription, + }; + var columnInfos = db.DbMaintenance.GetColumnInfosByTableName(entityInfo.DbTableName,false); + result.ZeroEntityColumnInfos = columnInfos.Select(it => { + + var propertyInfo = entityInfo.Columns.Where(it=>it.IsIgnore==false).FirstOrDefault(x => x.DbColumnName?.ToLower()==it.DbColumnName?.ToLower()); + if (propertyInfo == null) + { + return new ZeroEntityColumnInfo() { }; + } + var data = new ZeroEntityColumnInfo() + { + Description = propertyInfo.ColumnDescription??"", + DataType = it.DataType, + DbColumnName = propertyInfo.DbColumnName, + DecimalDigits = propertyInfo.DecimalDigits, + IsIdentity = propertyInfo.IsIdentity, + Length = propertyInfo.Length, + IsPrimarykey = propertyInfo.IsPrimarykey, + IsArray = propertyInfo.IsArray, + IsJson = propertyInfo.IsJson, + IsNullable = propertyInfo.IsNullable, + IsUnsigned = it.IsUnsigned??false, + PropertyName = propertyInfo?.PropertyName, + PropertyType = EntityGeneratorManager.GetNativeTypeByType(propertyInfo!.PropertyInfo.PropertyType), + TableId = it.TableId, + IsInitialized=true + }; + return data; + }).ToList(); + var expColumns=entityInfo.Columns.Where(it =>it.IsIgnore==true&&it.ExtendedAttribute != null).ToList(); + foreach(var item in expColumns) + { + var data = new ZeroEntityColumnInfo() + { + Description = item.ColumnDescription ?? "", + DataType = item.DataType??"", + DbColumnName = item.DbColumnName?? item?.PropertyName, + DecimalDigits = item!.DecimalDigits, + IsIdentity = item.IsIdentity, + Length = item.Length, + IsPrimarykey = item.IsPrimarykey, + IsArray = item.IsArray, + IsJson = item.IsJson, + IsNullable = item.IsNullable, + PropertyName = item?.PropertyName, + ExtendedAttribute = item?.ExtendedAttribute+"", + IsInitialized=true, + IsUnsigned=false + }; + result.ZeroEntityColumnInfos.Add(data); + } + result.ZeroEntityColumnInfos = result.ZeroEntityColumnInfos.Where(it => it.PropertyName != null).ToList(); + // 实现转换逻辑 + return result; + } + + public DbTableInfo ConvertEntityToDbTableInfo(Type type) + { + var db = App.PreStartupDb; + var entityInfo = db!.EntityMaintenance.GetEntityInfo(type); + DbTableInfo result = new DbTableInfo() + { + Name = entityInfo.DbTableName, + Description = entityInfo.TableDescription, + }; + var columnInfos = db.DbMaintenance.GetColumnInfosByTableName(entityInfo.DbTableName); + result.ColumnInfos = columnInfos.Select(it => new DbColumnInfo() + { + ColumnDescription = it.ColumnDescription, + CreateTableFieldSort = it.CreateTableFieldSort, + DataType = it.DataType, + DbColumnName = it.DbColumnName, + DecimalDigits = it.DecimalDigits, + DefaultValue = it.ColumnDescription, + InsertServerTime = it.UpdateServerTime, + UpdateServerTime = it.UpdateServerTime, + InsertSql = it.InsertSql, + TableName = it.TableName, + IsIdentity = it.IsIdentity, + Length = it.Length, + IsPrimarykey = it.IsPrimarykey, + IsArray = it.IsArray, + IsJson = it.IsJson, + IsNullable = it.IsJson, + Scale = it.Scale, + Value = it.Value, + IsUnsigned = it.IsUnsigned, + UpdateSql = it.UpdateSql, + OracleDataType = it.DataType, + PropertyName = it.PropertyName, + PropertyType = it.PropertyType, + SqlParameterDbType = it.SqlParameterDbType, + TableId = it.TableId + }).ToList(); + // 实现转换逻辑 + return result; + } + } +} diff --git a/ReZero/SuperAPI/EntityManager/EntityPropertyMappingService.cs b/ReZero/SuperAPI/EntityManager/EntityPropertyMappingService.cs new file mode 100644 index 0000000..c174926 --- /dev/null +++ b/ReZero/SuperAPI/EntityManager/EntityPropertyMappingService.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal class EntityPropertyMappingService + { + public static object ConvertValue(object value, string valueType) + { + switch (valueType) + { + case "Boolean": + return Convert.ToBoolean(value); + case "Byte": + return Convert.ToByte(value); + case "SByte": + return Convert.ToSByte(value); + case "Char": + return Convert.ToChar(value); + case "Decimal": + return Convert.ToDecimal(value); + case "Double": + return Convert.ToDouble(value); + case "Single": + return Convert.ToSingle(value); + case "Int32": + return Convert.ToInt32(value); + case "UInt32": + return Convert.ToUInt32(value); + case "Int64": + return Convert.ToInt64(value); + case "UInt64": + return Convert.ToUInt64(value); + case "Int16": + return Convert.ToInt16(value); + case "UInt16": + return Convert.ToUInt16(value); + case "String": + return Convert.ToString(value); + case "DateTime": + return Convert.ToDateTime(value); + case "Guid": + return new Guid(Convert.ToString(value)); + case "Byte[]": + // 假设 value 是字节数组的合法表示(例如十六进制字符串),进行转换 + return HexStringToByteArray(Convert.ToString(value)); + default: + return value; + } + } + // 将十六进制字符串转换为字节数组 + private static byte[] HexStringToByteArray(string hex) + { + if (hex.Length % 2 != 0) + { + throw new ArgumentException("Hex string must have an even number of characters."); + } + + byte[] bytes = new byte[hex.Length / 2]; + for (int i = 0; i < hex.Length; i += 2) + { + bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16); + } + + return bytes; + } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/Initialization/SuperAPICorsFilter.cs b/ReZero/SuperAPI/Initialization/SuperAPICorsFilter.cs new file mode 100644 index 0000000..8419f4c --- /dev/null +++ b/ReZero/SuperAPI/Initialization/SuperAPICorsFilter.cs @@ -0,0 +1,30 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.AspNetCore.Cors; +using Microsoft.AspNetCore.Cors.Infrastructure; +using ReZero.Configuration; + +namespace ReZero.SuperAPI +{ + public class SuperAPICorsFilter : IStartupFilter + { + public SuperAPICorsFilter(ReZeroCors options) + { + Options = options; + } + + public ReZeroCors Options { get; } + + public Action Configure(Action next) + { + return builder=> + { + builder.UseCors(Options.PolicyName); + next(builder); + }; + } + } +} diff --git a/ReZero/SuperAPI/Initialization/SuperAPIMiddleware.cs b/ReZero/SuperAPI/Initialization/SuperAPIMiddleware.cs new file mode 100644 index 0000000..2436cc1 --- /dev/null +++ b/ReZero/SuperAPI/Initialization/SuperAPIMiddleware.cs @@ -0,0 +1,177 @@ +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using SqlSugar; +using System; +using System.Linq; +using System.Net; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + /// + /// Middleware class for handling Zero Dynamic API and Internal API requests. + /// + public class SuperAPIMiddleware + { + private readonly IApplicationBuilder _applicationBuilder; + + /// + /// Constructor for ZeroApiMiddleware class. + /// + /// Instance of IApplicationBuilder. + public SuperAPIMiddleware(IApplicationBuilder application) + { + _applicationBuilder = application ?? throw new ArgumentNullException(nameof(application)); + } + + /// + /// Middleware entry point to handle incoming requests. + /// + /// HttpContext for the current request. + /// Delegate representing the next middleware in the pipeline. + public async Task InvokeAsync(HttpContext context, Func next) + { + // Get the requested URL path from the context + var requestedUrl = context.Request.Path; + + // Check if the requested URL corresponds to Internal API + if (IsInternalApi(requestedUrl)) + { + // Handle the request using Internal API logic + await InternalApi(context); + + } + // Check if the requested URL corresponds to Dynamic API + else if(IsDynamicApi(requestedUrl)) + { + // Handle the request using Dynamic API logic + await DynamicApi(context); + + } + // If the requested URL doesn't match any specific API, pass the request to the next middleware + else + { + if (IsShowNativeApiDocument(requestedUrl)) + { + context.Response.Redirect("/rezero/dynamic_interface.html?InterfaceCategoryId=200100"); + } + else + { + await next(); + } + } + } + + //private async Task AuthorizationHtmlAsync(HttpContext context) + //{ + // if (SuperAPIModule._apiOptions?.InterfaceOptions?.Jwt?.Enable != true) + // { + // return true; + // } + // var url = context.Request.Path.ToString().ToLower(); + // if (url.EndsWith(".html") == true && url != PubConst.Jwt_PageUrl) + // { + // var authHeader = context.Request.Headers["Authorization"].FirstOrDefault(); + // if (authHeader != null && authHeader.StartsWith("Bearer ")) + // { + // var token = authHeader.Split(' ')[1]; + // try + // { + // // 进行JWT令牌验证,例如使用Microsoft.AspNetCore.Authentication.JwtBearer包提供的验证器 + // var authResult = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme); + // if (authResult.Succeeded) + // { + // return true; + // } + // else + // { + // // 用户未通过身份验证,可能需要进行一些处理,例如返回未经授权的错误 + // context.Response.StatusCode = 401; + // context.Response.Redirect(PubConst.Jwt_PageUrl); + // return false; + // } + // } + // catch (Exception) + // { + // // JWT验证失败 + // context.Response.StatusCode = 401; + // context.Response.Redirect(PubConst.Jwt_PageUrl); + // return false; + // } + // } + // else + // { + // // Authorization标头缺失或格式不正确 + // context.Response.StatusCode = 401; + // context.Response.Redirect(PubConst.Jwt_PageUrl); + // return false; + // } + // } + // else + // { + // return true; + // } + //} + + private static bool IsShowNativeApiDocument(PathString requestedUrl) + { + return requestedUrl.ToString().TrimStart('/').TrimEnd('/').ToLower() == "rezero" && SuperAPIModule._apiOptions?.UiOptions?.ShowNativeApiDocument != true; + } + + /// + /// Handles requests for Dynamic API. + /// + /// HttpContext for the current request. + private async Task DynamicApi(HttpContext context) + { + // Get the IDynamicApi service instance from the application's service provider + var app = App.ServiceProvider!.GetService(); + + // Invoke the WriteAsync method to process and respond to the request + await app.WriteAsync(context); + } + + /// + /// Checks if the requested URL corresponds to Dynamic API. + /// + /// Requested URL path. + /// True if the URL corresponds to Dynamic API, otherwise false. + private bool IsDynamicApi(PathString requestedUrl) + { + // Get the IDynamicApi service instance from the application's service provider + var app = App.ServiceProvider!.GetService(); + + // Determine if the requested URL matches Dynamic API + return app.IsApi(requestedUrl); + } + + /// + /// Handles requests for Internal API. + /// + /// HttpContext for the current request. + private async Task InternalApi(HttpContext context) + { + // Get the InternalApi service instance from the application's service provider + var app = App.ServiceProvider!.GetService(); + + // Invoke the WriteAsync method to process and respond to the request + await app.WriteAsync(context); + } + + /// + /// Checks if the requested URL corresponds to Internal API. + /// + /// Requested URL path. + /// True if the URL corresponds to Internal API, otherwise false. + private bool IsInternalApi(PathString requestedUrl) + { + // Get the InternalApi service instance from the application's service provider + var app = App.ServiceProvider!.GetService(); + + // Determine if the requested URL matches Internal API + return app.IsApi(requestedUrl); + } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/Initialization/SuperAPIModule.cs b/ReZero/SuperAPI/Initialization/SuperAPIModule.cs new file mode 100644 index 0000000..e26f0b0 --- /dev/null +++ b/ReZero/SuperAPI/Initialization/SuperAPIModule.cs @@ -0,0 +1,157 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.IO; +using System.Net.Http.Headers; +using System.Reflection; +using System.Text; +using System.Linq; +using ReZero.Configuration; +using System.Data; +namespace ReZero.SuperAPI +{ + public static partial class SuperAPIModule + { + + public static SuperAPIOptions? _apiOptions = null; + + + internal static void Init(IServiceCollection services, ReZeroOptions options) + { + if (IsInitSupperApi(options)) + { + var apiOptions = options.SuperApiOptions; + _apiOptions = InitializeOptions(apiOptions); + InitZeroStaticFileMiddleware(); + InitCors(services,_apiOptions); + InitializeDataBase(_apiOptions); + InitializeData(_apiOptions); + AddTransientServices(services, _apiOptions); + InitDynamicAttributeApi(); + } + } + + private static void InitCors(IServiceCollection services, SuperAPIOptions apiOptions) + { + if (apiOptions?.InterfaceOptions.CorsOptions?.Enable == true) + { + var corsOptions = apiOptions.InterfaceOptions.CorsOptions; + services.AddCors(option => + option.AddPolicy(corsOptions.PolicyName, + policy => + { + policy.WithHeaders(corsOptions.Headers).WithMethods(corsOptions.Methods).WithOrigins(corsOptions.Origins); + if (corsOptions.AllowCredentials) + { + policy.AllowCredentials(); + } + }) + ); + services.AddSingleton(provider=>corsOptions); + services.AddTransient(); + } + } + + private static void InitDynamicAttributeApi() + { + if (_apiOptions?.DependencyInjectionOptions?.Assemblies?.Any() != true) + { + return; + } + var types = _apiOptions? + .DependencyInjectionOptions + .Assemblies! + .SelectMany(it => it.GetTypes()).ToList(); + types!.Add(typeof(InternalInitApi)); + AttibuteInterfaceInitializerService.InitDynamicAttributeApi(types); + } + /// + /// Initializes ZeroStaticFileMiddleware. + /// + private static void InitZeroStaticFileMiddleware() + { + _apiOptions!.UiOptions!.DefaultUiFolderName = SuperAPIStaticFileMiddleware.DefaultUiFolderName; + } + + + /// + /// Initializes the database based on ReZero options. + /// + /// ReZero options. + private static void InitializeDataBase(SuperAPIOptions options) + { + if (options.DatabaseOptions == null) + { + options.DatabaseOptions = new DatabaseOptions(); + } + if (options.DatabaseOptions!.InitializeTables == false) + { + return; + } + if (options.DatabaseOptions?.ConnectionConfig?.DbType == SqlSugar.DbType.Sqlite && options.DatabaseOptions?.ConnectionConfig?.ConnectionString == null) + { + options.DatabaseOptions!.ConnectionConfig.ConnectionString = "datasource=rezero.db"; + } + var types = PubMethod.GetTypesDerivedFromDbBase(typeof(DbBase)); + var db = new DatabaseContext(options.DatabaseOptions!.ConnectionConfig).SugarClient; + App.PreStartupDb = db; + if (IsSupportCreateDatabase(db)) + { + db.DbMaintenance.CreateDatabase(); + } + db.CodeFirst.InitTables(types?.ToArray()); + } + + private static bool IsSupportCreateDatabase(SqlSugar.ISqlSugarClient db) + { + return db.CurrentConnectionConfig.DbType != SqlSugar.DbType.Oracle && + db.CurrentConnectionConfig.DbType != SqlSugar.DbType.Dm; + } + + + /// + /// Adds transient services to the IServiceCollection. + /// + /// The IServiceCollection to which services are added. + /// ReZero options. + private static void AddTransientServices(IServiceCollection services, SuperAPIOptions options) + { + // Add transient services to the IServiceCollection. + services.AddTransient(); + services.AddTransient(); + + services.AddTransient(); + + // Create an instance of ORM with the specified connection configuration and add it as a transient service. + services.AddTransient(it => new DatabaseContext(options.DatabaseOptions!.ConnectionConfig)); + } + + /// + /// Initializes ReZero options. If options are not provided, creates a new instance of ReZeroOptions. + /// + /// Optional ReZero options. + /// Initialized ReZero options. + private static SuperAPIOptions InitializeOptions(SuperAPIOptions? options) + { + options = options ?? new SuperAPIOptions(); + return options; + } + + + /// + /// Initializes data based on ReZero options. + /// + /// ReZero options. + private static void InitializeData(SuperAPIOptions options) + { + new DataInitializerService().Initialize(options); + } + + private static bool IsInitSupperApi(ReZeroOptions options) + { + return options.SuperApiOptions.IsEnableSuperAPI; + } + + } +} diff --git a/ReZero/SuperAPI/Initialization/SuperAPIRequestSetOptionsStartupFilter.cs b/ReZero/SuperAPI/Initialization/SuperAPIRequestSetOptionsStartupFilter.cs new file mode 100644 index 0000000..c9a126a --- /dev/null +++ b/ReZero/SuperAPI/Initialization/SuperAPIRequestSetOptionsStartupFilter.cs @@ -0,0 +1,40 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using System; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + /// + /// Custom startup filter to configure application services and middleware. + /// + public class SuperAPIRequestSetOptionsStartupFilter : IStartupFilter + { + /// + /// Configures application services and middleware. + /// + /// The next middleware delegate. + /// An action to configure the application builder. + public Action Configure(Action next) + { + // Return an action to configure the application builder. + return builder => + { + // Initialize the application service provider with the application builder. + App.ServiceProvider = new ApplicationServiceProvider(builder); + + // Create an instance of ZeroApiMiddleware and handle API requests. + Func, Task> func = async (context, next) => await new SuperAPIMiddleware(builder).InvokeAsync(context, next); + + // Use the created middleware in the pipeline. + builder.Use(func); + + builder.UseMiddleware(); + + // Call the next middleware in the pipeline. + next(builder); + }; + } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/Initialization/SuperAPIStaticFileMiddleware.cs b/ReZero/SuperAPI/Initialization/SuperAPIStaticFileMiddleware.cs new file mode 100644 index 0000000..637c784 --- /dev/null +++ b/ReZero/SuperAPI/Initialization/SuperAPIStaticFileMiddleware.cs @@ -0,0 +1,180 @@ +using System; +using System.IO; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; + +namespace ReZero.SuperAPI +{ + public class SuperAPIStaticFileMiddleware + { + private readonly RequestDelegate _next; + + // Constants for ReZero paths and file locations + internal static string ReZeroDirName = "rezero"; + internal static string RezeroPathPrefix = $"/{ReZeroDirName}/"; + internal static string RezeroRootPath = $"/{ReZeroDirName}"; + internal static string DefaultIndexPath = "index.html"; + internal static string WwwRootPath = "wwwroot"; + internal static string DefaultUiFolderName = "default_ui"; + internal static string UiFolderPath { get; set; } = $"{ReZeroDirName}/{DefaultUiFolderName}"; + + public SuperAPIStaticFileMiddleware(RequestDelegate next) + { + _next = next ?? throw new ArgumentNullException(nameof(next)); + } + + /// + /// Invokes the middleware to handle the request. + /// + /// The HttpContext for the request. + public async Task InvokeAsync(HttpContext context) + { + // Get the lowercase path of the request + var path = (context.Request.Path.Value ?? string.Empty).ToLower(); + + // Check if the request is for the root URL of ReZero + if (IsRezeroRootUrl(path)) + { + // Redirect to the default index.html if it is the root URL + context.Response.Redirect($"{RezeroPathPrefix}{DefaultIndexPath}"); + return; + } + // Check if the request is for a ReZero static file + else if (IsRezeroFileUrl(path)) + { + + var filePathByCurrentDirectory = GetFilePathByCurrentDirectory(path); + var filePathByBaseDirectory = GetFilePathByBaseDirectory(path); + + if (FileExistsAndIsNotHtml(filePathByCurrentDirectory)) + { + await CopyToFile(context, filePathByCurrentDirectory); + return; + } + else if (FileExistsHtml(filePathByCurrentDirectory)) + { + await CopyToHtml(context, filePathByCurrentDirectory); + return; + } + else if (FileExistsAndIsNotHtml(filePathByBaseDirectory)) + { + await CopyToFile(context, filePathByBaseDirectory); + return; + } + else if (FileExistsHtml(filePathByBaseDirectory)) + { + await CopyToHtml(context, filePathByBaseDirectory); + return; + } + else + { + // If the file does not exist, return a 404 Not Found status + context.Response.StatusCode = 404; + return; + } + } + + // If the request doesn't match ReZero paths, call the next middleware + await _next(context); + } + + /// + /// Checks if the requested file exists and is not an HTML file. + /// + /// The path of the file to check. + /// True if the file exists and is not an HTML file, false otherwise. + private static bool FileExistsAndIsNotHtml(string filePath) + { + return File.Exists(filePath) && !filePath.Contains(".html"); + } + + /// + /// Checks if the requested file exists and is an HTML file. + /// + /// The path of the file to check. + /// True if the file exists and is an HTML file, false otherwise. + private static bool FileExistsHtml(string filePath) + { + return File.Exists(filePath) && filePath.Contains(".html"); + } + + /// + /// Copies the content of the requested file to the response stream. + /// + /// The HttpContext for the request. + /// The path of the file to copy. + private static async Task CopyToFile(HttpContext context, string filePath) + { + // Read the file content and send it to the client + using (var fileStream = File.OpenRead(filePath)) + { + await fileStream.CopyToAsync(context.Response.Body); + } + } + + /// + /// Copies the content of the requested HTML file to the response stream. + /// + /// The HttpContext for the request. + /// The path of the HTML file to copy. + private static async Task CopyToHtml(HttpContext context, string filePath) + { + // Read the file content + string fileContent; + using (var reader = new StreamReader(filePath)) + { + fileContent = await reader.ReadToEndAsync(); + } + // Check if the file is a master page + IUiManager defaultUiManager = UIFactory.uiManager; + if (defaultUiManager.IsMasterPage(fileContent)) + { + // If the file is a master page, get the HTML and send it to the client + fileContent = await defaultUiManager.GetHtmlAsync(fileContent, filePath, context); + } + else + { + fileContent = await defaultUiManager.GetCustomPageHtmlAsync(fileContent, filePath, context); + } + // Send the file content to the client + await context.Response.WriteAsync(fileContent); + } + + /// + /// Checks if the requested URL is for a ReZero static file. + /// + /// The path of the requested URL. + /// True if the requested URL is for a ReZero static file, false otherwise. + private static bool IsRezeroFileUrl(string path) + { + return path.StartsWith(RezeroPathPrefix) && path.Contains("."); + } + + /// + /// Checks if the requested URL is the root URL of ReZero. + /// + /// The path of the requested URL. + /// True if the requested URL is the root URL of ReZero, false otherwise. + private static bool IsRezeroRootUrl(string path) + { + return path.TrimEnd('/') == RezeroRootPath; + } + + + internal static string GetFilePathByCurrentDirectory(string path) + { + var relativePath = path.Replace(RezeroPathPrefix, string.Empty); + var fullPath = Path.Combine(Directory.GetCurrentDirectory(), WwwRootPath, UiFolderPath, relativePath); + return Path.GetFullPath(fullPath); + } + internal static string GetFilePathByBaseDirectory(string path) + { + var relativePath = path.Replace(RezeroPathPrefix, string.Empty); + var fullPath = Path.Combine(AppContext.BaseDirectory, WwwRootPath, UiFolderPath, relativePath); + return Path.GetFullPath(fullPath); + } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/Interfaces/API/ISuperApi.cs b/ReZero/SuperAPI/Interfaces/API/ISuperApi.cs new file mode 100644 index 0000000..8c802ca --- /dev/null +++ b/ReZero/SuperAPI/Interfaces/API/ISuperApi.cs @@ -0,0 +1,15 @@ +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + public interface ISuperApi + { + + bool IsApi(string url); + Task WriteAsync(HttpContext context); + } +} diff --git a/ReZero/SuperAPI/Interfaces/API/ISuperApiAop.cs b/ReZero/SuperAPI/Interfaces/API/ISuperApiAop.cs new file mode 100644 index 0000000..17e0668 --- /dev/null +++ b/ReZero/SuperAPI/Interfaces/API/ISuperApiAop.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + public interface ISuperApiAop + { + Task OnExecutingAsync(InterfaceContext context); + Task OnExecutedAsync(InterfaceContext context); + Task OnErrorAsync(InterfaceContext context); + } +} diff --git a/ReZero/SuperAPI/Interfaces/Dto/IWhere.cs b/ReZero/SuperAPI/Interfaces/Dto/IWhere.cs new file mode 100644 index 0000000..30c7a8a --- /dev/null +++ b/ReZero/SuperAPI/Interfaces/Dto/IWhere.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal interface IWhere + { + + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Entities/TemplateEntitiesGen.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Entities/TemplateEntitiesGen.cs new file mode 100644 index 0000000..ed41644 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Entities/TemplateEntitiesGen.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using System.Text; + +namespace ReZero.SuperAPI +{ + /// + /// 生成实体结构 + /// + public class TemplateEntitiesGen + { + /// + /// 类名 + /// + public string? ClassName { get; set; } + /// + /// 表名 + /// + public string? TableName { get; set; } + /// + /// 备注 + /// + public string? Description { get; set; } + + /// + /// 列集合 + /// + public List? PropertyGens { get; set; } + + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Entities/TemplateModel.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Entities/TemplateModel.cs new file mode 100644 index 0000000..b416026 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Entities/TemplateModel.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero +{ + public class TemplateModel where T:class + { + public T Model { get; set; } = null!; + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Entities/TemplatePropertyGen.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Entities/TemplatePropertyGen.cs new file mode 100644 index 0000000..b5947a8 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Entities/TemplatePropertyGen.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using System.Text; + +namespace ReZero.SuperAPI +{ + + /// + /// 属性和列 + /// + public class TemplatePropertyGen + { + /// + /// 属性名 + /// + public string? PropertyName { get; set; } + /// + /// 列名 + /// + public string? DbColumnName { get; set; } + + /// + /// 属性类型 + /// + public string? PropertyType { get; set; } + + /// + /// 数据库类型 + /// + public string? DbType { get; set; } + /// + /// 主键 + /// + public bool IsPrimaryKey { get; set; } + /// + /// 自增列 + /// + public bool IsIdentity { get; set; } + /// + /// 备注 + /// + public string? Description { get; set; } + /// + /// 是否是为NULL + /// + public bool IsNullable { get; set; } + /// + /// Mapping精度 + /// + public int? DecimalDigits { get; set; } + /// + /// 是否忽略 + /// + public bool IsIgnore { get; set; } + /// + /// 特殊类型 + /// + public int SpecialType { get; set; } + /// + /// 默认值 + /// + public string? DefaultValue { get; set; } + /// + /// 长度 + /// + public int Length { get; set; } + /// + /// 是否是Json类型 + /// + public bool IsJson { get; set; } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Enum/ColumnJoinType.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Enum/ColumnJoinType.cs new file mode 100644 index 0000000..97c9f6d --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Enum/ColumnJoinType.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public enum ColumnJoinType + { + LeftJoin = 1, + InnerJoin=2, + SubqueryJoin = 3 + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Enum/SqlResultType.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Enum/SqlResultType.cs new file mode 100644 index 0000000..b7077b8 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Enum/SqlResultType.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public enum SqlResultType + { + Query=1, + AffectedRows=2, + DataSet=3, + IdNumber=4 + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Enum/TemplateType.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Enum/TemplateType.cs new file mode 100644 index 0000000..144972c --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Enum/TemplateType.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public enum TemplateType + { + Entity=1, + Api=2 + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Enum/WhereConditionalRelation.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Enum/WhereConditionalRelation.cs new file mode 100644 index 0000000..d541424 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Enum/WhereConditionalRelation.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public enum WhereRelation + { + /// + /// And:并且-带OR参数NULL + /// + And, + + /// + /// And all:并且 + /// + AndAll, + + /// + /// Or:或者-带OR参数NULL + /// + Or, + + /// + /// OrAll:或者 + /// + OrAll, + + /// + /// Custom:自定义-带OR参数NULL + /// + Custom, + + /// + /// CustomAll:自定义 + /// + CustomAll + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Enum/WhereValue.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Enum/WhereValue.cs new file mode 100644 index 0000000..ecbfc82 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Enum/WhereValue.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public enum WhereValueType + { + Value=0, + Parameter=1, + ClaimKey= 2, + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/EnumApi.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/EnumApi.cs new file mode 100644 index 0000000..383162d --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/EnumApi.cs @@ -0,0 +1,37 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class MethodApi + { + public List GetDbTypeSelectDataSource() + { + List enumItemInfos = new List(); + var dts = UtilMethods.EnumToDictionary(); + foreach (var item in dts) + { + enumItemInfos.Add(new EnumItemInfo() { Name = item.Key, Value = Convert.ToInt32(item.Value) + "" }); + } + return enumItemInfos.Take(7).ToList(); + } + public List GetNativeTypeSelectDataSource() + { + List enumItemInfos = new List(); + var dts = UtilMethods.EnumToDictionary(); + foreach (var item in dts) + { + enumItemInfos.Add(new EnumItemInfo() { Name = item.Key, Value = Convert.ToInt32(item.Value) + "" }); + } + return enumItemInfos.ToList(); + } + public static object GetWhereTypeList() + { + return SqlSugar.UtilMethods.EnumToDictionary() + .Select(it => new { Key = it.Value.ToString(), Value = it.Value }).ToList(); + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiAddOrUpdateEntityColumninfos.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiAddOrUpdateEntityColumninfos.cs new file mode 100644 index 0000000..4957bdd --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiAddOrUpdateEntityColumninfos.cs @@ -0,0 +1,120 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class MethodApi + { + + public object AddOrUpdateEntityColumninfos(string columns) + { + try + { + List zeroEntityColumns = App.Db.Utilities.DeserializeObject>(columns); + var tableId = zeroEntityColumns.GroupBy(it => it.TableId).Select(it => it.Key).Single(); + EntityGeneratorManager.RemoveTypeCacheByTypeId(tableId); + var tableInfo = App.Db.Queryable().Where(it => it.Id == tableId).Single(); + this.CheckTableInfo(tableInfo); + App.Db.Deleteable().Where(it => it.TableId == tableId).ExecuteCommand(); + var newColumns = ConvetSaveColumn(zeroEntityColumns).ToArray(); + this.CheckColumns(newColumns); + App.Db.Insertable(newColumns).ExecuteReturnSnowflakeId(); + tableInfo.ColumnCount = newColumns.Length; + App.Db.Updateable(tableInfo).UpdateColumns(it => new { it.ColumnCount }).ExecuteCommand(); + CacheManager.Instance.ClearCache(); + return true; + } + catch (Exception ex) + { + return ex.Message; + } + } + + private void CheckColumns(ZeroEntityColumnInfo[] newColumns) + { + if (IsRepeatColumn(newColumns)) + { + throw new Exception(TextHandler.GetCommonText("列名重复", "Column name repeat")); + } + foreach (var item in newColumns) + { + if (item.IsPrimarykey && item.IsNullable) + { + throw new Exception(TextHandler.GetCommonText("主键不能为null", "Primary key cannot be null")); + } + } + } + + private static bool IsRepeatColumn(ZeroEntityColumnInfo[] newColumns) + { + return newColumns + .Where(it => it.PropertyName != null) + .GroupBy(it => it.PropertyName?.ToLower()).Any(it => it.Count() > 1) || + newColumns + .Where(it => it.DbColumnName != null) + .GroupBy(it => it.DbColumnName?.ToLower()) + .Any(it => it.Count() > 1); + } + + private List ConvetSaveColumn(List zeroEntityColumns) + { + var newColumns = zeroEntityColumns; + foreach (var item in newColumns) + { + CheckTtem(item); + } + if (!newColumns.Any()) + { + throw new Exception(DefaultResult()); + } + if (newColumns.Any(it => it.IsIdentity && it.PropertyType == NativeType.String)) + { + throw new Exception(TextHandler.GetCommonText("字符串类型不能设置自增", "String type cannot be set to auto-increment")); + } + if (newColumns.Any(it => it.IsIdentity)&& newColumns.Count()==1) + { + throw new Exception(TextHandler.GetCommonText("存在自增表里面至少2个字段", "If self-increment columns exist: Requires 2 columns")); + } + return newColumns; + } + + private void CheckTableInfo(ZeroEntityInfo tableInfo) + { + + if (tableInfo == null) + { + throw new Exception(DefaultResult()); + } + else if (!PubMethod.CheckIsPropertyName(tableInfo.ClassName!)) + { + throw new Exception(TextHandler.GetCommonText("【 实体名错误 " + tableInfo.ClassName! + "】开头必须是字母并且不能有特殊字符", "[ Class name" + tableInfo.ClassName! + "] must start with a letter and cannot have special characters")); + } + else if (tableInfo.IsInitialized) + { + throw new Exception((TextHandler.GetCommonText("系统表不能修改", "The system table cannot be modified"))); + } + } + private void CheckTtem(ZeroEntityColumnInfo? item) + { + if (string.IsNullOrEmpty(item!.DbColumnName)) + { + item.DbColumnName = item.PropertyName; + } + if (string.IsNullOrEmpty(item?.PropertyName ?? "")) + { + throw new Exception(TextHandler.GetCommonText("属性不能为空", "PropertyName is required")); + } + if (!PubMethod.CheckIsPropertyName(item?.PropertyName ?? "")) + { + throw new Exception(TextHandler.GetCommonText("【" + item!.PropertyName + "】开头必须是字母并且不能有特殊字符", "[" + item!.PropertyName + "] must start with a letter and cannot have special characters")); + } + } + private string DefaultResult() + { + return TextHandler.GetCommonText("不能保存", "Cannot save"); + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiCompareDatabaseStructure.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiCompareDatabaseStructure.cs new file mode 100644 index 0000000..f4c1e80 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiCompareDatabaseStructure.cs @@ -0,0 +1,59 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class MethodApi + { + public object CompareDatabaseStructure(List ids) + { + try + { + List tableDifferences = new List(); + var result = string.Empty; + var dbRoot = App.Db; + var entities = dbRoot.Queryable().In(ids.Select(it => Convert.ToInt64(it)).ToList()).ToList(); + foreach (var entity in entities) + { + var codeFirstDb = App.GetDbTableId(entity.Id)!; + var type = EntityGeneratorManager.GetTypeAsync(entity.Id).GetAwaiter().GetResult(); + if (codeFirstDb.DbMaintenance.IsAnyTable(codeFirstDb.EntityMaintenance.GetTableName(type), false)) + { + var diff = codeFirstDb.CodeFirst.SetStringDefaultLength(255).GetDifferenceTables(type).ToDiffString(); + if (diff != null && !diff.Contains("No change")) + { + tableDifferences.Add(diff); + } + } + } + if (tableDifferences.Count == 0) + { + result = $"{TextHandler.GetCommonText("此操作没有风险,可以继续!!", "This operation is not risky and can continue!!")}"; + } + else + { + result = string.Join("", tableDifferences).Replace("\n", "
"); + } + result = result.Replace("
----", "

"); + result = result.Replace("----", "

"); + result = result.Replace("Table:", $"{TextHandler.GetCommonText("表名", "Table")}:"); + result = result.Replace("Add column", $"{TextHandler.GetCommonText("添加列", "Add column")}"); + result = result.Replace("Update column", $"{TextHandler.GetCommonText("更新列", "Update column")}"); + result = result.Replace("Delete column", $"{TextHandler.GetCommonText("删除列", "Delete column")}"); + return result; + } + catch + { + return "结构对比出现错误,请谨慎同步"; + } + finally + { + + CacheManager.Instance.ClearCache(); + } + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiExcel.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiExcel.cs new file mode 100644 index 0000000..ba6eee4 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiExcel.cs @@ -0,0 +1,72 @@ + using SqlSugar; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using ReZero.Excel; + +namespace ReZero.SuperAPI +{ + public partial class MethodApi + { + public byte[] ExportEntities(long databaseId,long[] tableIds) + { + List datatables = new List(); + var db = App.Db; + var datas = db.Queryable() + .OrderBy(it=>it.DbTableName) + .Where(it=>it.DataBaseId==databaseId) + .WhereIF(tableIds.Any(), it => tableIds.Contains(it.Id)) + .Includes(it => it.ZeroEntityColumnInfos).ToList(); + foreach (var item in datas) + { + var currentDb = App.GetDbById(databaseId)!; + var columnInfos = currentDb.DbMaintenance.GetColumnInfosByTableName(item.DbTableName, false); + DataTable dt = new DataTable(); + dt.Columns.Add(TextHandler.GetCommonText("列名", "Field name")); + dt.Columns.Add(TextHandler.GetCommonText("列描述", "Column description")); + dt.Columns.Add(TextHandler.GetCommonText("列类型", "Column type")); + dt.Columns.Add(TextHandler.GetCommonText("实体类型", "Entity type")); + dt.Columns.Add(TextHandler.GetCommonText("主键", "Primary key")); + dt.Columns.Add(TextHandler.GetCommonText("自增", "Auto increment")); + dt.Columns.Add(TextHandler.GetCommonText("可空", "Nullable")); + dt.Columns.Add(TextHandler.GetCommonText("长度", "Length")); + dt.Columns.Add(TextHandler.GetCommonText("精度", "Precision")); + dt.Columns.Add(TextHandler.GetCommonText("默认值", "Default value")); + dt.Columns.Add(TextHandler.GetCommonText("表名", "Table name")); + dt.Columns.Add(TextHandler.GetCommonText("表描述", "Table description")); + foreach (var it in columnInfos!) + { + var dr = dt.NewRow(); + dr[TextHandler.GetCommonText("列名", "Field name")] = it.DbColumnName; + dr[TextHandler.GetCommonText("列描述", "Column description")] = it.ColumnDescription?? item.ZeroEntityColumnInfos.FirstOrDefault(x => x.DbColumnName!.EqualsCase(it.DbColumnName!))?.Description; ; + dr[TextHandler.GetCommonText("列类型", "Column type")] = it.DataType; + if (db.CurrentConnectionConfig.DbType == SqlSugar.DbType.Oracle) + { + dr[TextHandler.GetCommonText("列类型", "Column type")] = it.OracleDataType; + } + dr[TextHandler.GetCommonText("实体类型", "Entity type")] = it.PropertyType; + dr[TextHandler.GetCommonText("表名", "Table name")] = item.DbTableName; + dr[TextHandler.GetCommonText("表描述", "Table description")] = item.Description ?? item.Description; + dr[TextHandler.GetCommonText("主键", "Primary key")] = it.IsPrimarykey ? "yes" : ""; + dr[TextHandler.GetCommonText("自增", "Auto increment")] = it.IsIdentity ? "yes" : ""; + dr[TextHandler.GetCommonText("可空", "Nullable")] = it.IsNullable ? "yes" : ""; + dr[TextHandler.GetCommonText("长度", "Length")] = it.Length; + dr[TextHandler.GetCommonText("精度", "Precision")] = it.DecimalDigits; + + dt.Rows.Add(dr); + } + dt.TableName = item.DbTableName; + if (dt.Rows.Count == 0) + { + var dr = dt.NewRow(); + dr[TextHandler.GetCommonText("列名", "Field name")]= TextHandler.GetCommonText("表还没有创建需要到实体管理点同步", "The table has not yet been created and needs to be synchronized to the entity management point"); + dt.Rows.Add(dr); + } + datatables.Add(new ExcelData() { DataTable=dt, TableDescrpition=item.Description??"-" }); + } + return ReZero.Excel.DataTableToExcel.ExportExcel(datatables.ToArray(), $"{DateTime.Now.ToString("实体文档.xlsx")}",navName:TextHandler.GetCommonText("表名","Table name")); + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/BaseElement.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/BaseElement.cs new file mode 100644 index 0000000..6b506d7 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/BaseElement.cs @@ -0,0 +1,94 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class BaseElement + { + protected void AddActionTypeFormElementModels(List result) + { + AddInterfaceName(result); + AddTable(result); + AddInterfaceCategroy(result); + AddInterfacUrl(result); + AddGroup(result); + } + + protected void AddActionTypeElementModel(List result, IEelementActionType obj) + { + + var keyValue = UtilMethods.EnumToDictionary() + .Where(it => obj.GetType().FullName == InstanceManager.GetActionTypeElementName(it.Value)) + .First(); + result.Add(new ActionTypeFormElementModel() + { + ElementType = ElementType.Hidden, + Name =nameof(SaveInterfaceListModel.ActionType) , + Value = ((int)keyValue.Value).ToString() + }); + } + private void AddInterfacUrl(List result) + { + result.Add(new ActionTypeFormElementModel() + { + Name = nameof(ZeroInterfaceList.Url), + Text = TextHandler.GetCommonText("Url", "Url"), + ElementType = ElementType.Text, + Placeholder = TextHandler.GetCommonText("默认自动", "Default is auto") + }); ; + } + + private void AddInterfaceName(List result) + { + result.Add(new ActionTypeFormElementModel() + { + Name = nameof(ZeroInterfaceList.Name), + Text= TextHandler.GetCommonText("接口名称","Interface name"), + ElementType = ElementType.Text, + IsRequired = true + }); + } + + private void AddInterfaceCategroy(List result) + { + result.Add(new ActionTypeFormElementModel() + { + Name = nameof(ZeroInterfaceList.InterfaceCategoryId), + Text = TextHandler.GetCommonText("所属菜单", "Interface categroy"), + ElementType = ElementType.Select, + IsRequired = true, + SelectDataSource=App.Db.Queryable() + .Where(it=>it.ParentId== InterfaceCategoryInitializerProvider.Id200) + .Select(it=>new ActionTypeFormElementSelectDataSourceModel { + Key=Convert.ToString(it.Id), + Value=it.Name + }).ToList() + }); + } + + private void AddTable(List result) + { + result.Add(new ActionTypeFormElementModel() + { + Name = nameof(DataModel.TableId), + Text = TextHandler.GetCommonText("实体/表", "Entity/Table name"), + ElementType = ElementType.Table, + IsRequired = true + }); + } + + private void AddGroup(List result) + { + result.Add(new ActionTypeFormElementModel() + { + Name = nameof(ZeroInterfaceList.GroupName), + Text = TextHandler.GetCommonText("分组名", "Group name"), + ElementType = ElementType.Text , + Placeholder= TextHandler.GetCommonText("默认为实体名","Default is entity name") + }); + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/DynamicElement/ActionTypeFormElementModel.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/DynamicElement/ActionTypeFormElementModel.cs new file mode 100644 index 0000000..13a486c --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/DynamicElement/ActionTypeFormElementModel.cs @@ -0,0 +1,20 @@ +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ActionTypeFormElementModel + { + public string? Name { get; set; } + public string? Text { get; set; } + public ElementType? ElementType { get; set; } + public string? Value { get; set; } + public bool IsRequired { get; set; } + public List? Items { get; set; } + public string? Placeholder { get; set; } + public List? SelectDataSource { get; set; } + + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/DynamicElement/ElementType.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/DynamicElement/ElementType.cs new file mode 100644 index 0000000..ed3c17b --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/DynamicElement/ElementType.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public enum ElementType + { + Text=0, + Table=1, + Columns=3, + Select = 4, + Hidden = 5, + Page=6, + SqlText=7, + DefaultValueColumn=8, + UpdateColumns = 9, + UpdateResultType=10, + Where = 11, + InsertResultType = 12, + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementBizDeleteObject.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementBizDeleteObject.cs new file mode 100644 index 0000000..dd36b03 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementBizDeleteObject.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; +using ReZero.SuperAPI; + +namespace ReZero.SuperAPI +{ + public class ElementBizDeleteObject : BaseElement,IEelementActionType + { + public List GetModels() + { + var result = new List(); + base.AddActionTypeFormElementModels(result); + base.AddActionTypeElementModel(result,this); + result.Insert(4, new ActionTypeFormElementModel() + { + ElementType = ElementType.UpdateResultType, + Name = "ResultType", + Text = TextHandler.GetCommonText("返回类型", "return type") + }); + return result; + } + + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementBizDeleteRange.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementBizDeleteRange.cs new file mode 100644 index 0000000..88893f5 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementBizDeleteRange.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; +using ReZero.SuperAPI; + +namespace ReZero.SuperAPI +{ + public class ElementBizDeleteRange : BaseElement,IEelementActionType + { + public List GetModels() + { + var result = new List(); + base.AddActionTypeFormElementModels(result); + base.AddActionTypeElementModel(result,this); + result.Insert(4, new ActionTypeFormElementModel() + { + ElementType = ElementType.UpdateResultType, + Name = "ResultType", + Text = TextHandler.GetCommonText("返回类型", "return type") + }); + return result; + } + + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementDeleteObject.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementDeleteObject.cs new file mode 100644 index 0000000..3cb7400 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementDeleteObject.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; +using ReZero.SuperAPI; + +namespace ReZero.SuperAPI +{ + public class ElementDeleteObject : BaseElement,IEelementActionType + { + public List GetModels() + { + var result = new List(); + base.AddActionTypeFormElementModels(result); + base.AddActionTypeElementModel(result, this); + result.Insert(4, new ActionTypeFormElementModel() + { + ElementType = ElementType.UpdateResultType, + Name = "ResultType", + Text = TextHandler.GetCommonText("返回类型", "return type") + }); + return result; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementDeleteRange.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementDeleteRange.cs new file mode 100644 index 0000000..0c0f839 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementDeleteRange.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; +using ReZero.SuperAPI; + +namespace ReZero.SuperAPI +{ + public class ElementDeleteRange : BaseElement,IEelementActionType + { + public List GetModels() + { + var result = new List(); + base.AddActionTypeFormElementModels(result); + base.AddActionTypeElementModel(result, this); + result.Insert(4, new ActionTypeFormElementModel() + { + ElementType = ElementType.UpdateResultType, + Name = "ResultType", + Text = TextHandler.GetCommonText("返回类型", "return type") + }); + return result; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementInsertObject.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementInsertObject.cs new file mode 100644 index 0000000..57eb125 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementInsertObject.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; +using ReZero.SuperAPI; + +namespace ReZero.SuperAPI +{ + public class ElementInsertObject : BaseElement,IEelementActionType + { + public List GetModels() + { + var result = new List(); + base.AddActionTypeFormElementModels(result); + base.AddActionTypeElementModel(result, this); + result.Insert(3, new ActionTypeFormElementModel() + { + ElementType=ElementType.DefaultValueColumn, + Name= "DefaultValueColumns", + Text=TextHandler.GetCommonText("默认值","Dafault value") + }); + result.Insert(4, new ActionTypeFormElementModel() + { + ElementType = ElementType.InsertResultType, + Name = "ResultType", + Text = TextHandler.GetCommonText("返回类型", "return type") + }); + return result; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementInsertOrUpdateObject.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementInsertOrUpdateObject.cs new file mode 100644 index 0000000..882b5e6 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementInsertOrUpdateObject.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; +using ReZero.SuperAPI; + +namespace ReZero.SuperAPI +{ + public class ElementInsertOrUpdateObject : BaseElement,IEelementActionType + { + public List GetModels() + { + var result = new List(); + base.AddActionTypeFormElementModels(result); + base.AddActionTypeElementModel(result, this); + result.Insert(3, new ActionTypeFormElementModel() + { + ElementType = ElementType.DefaultValueColumn, + Name = "DefaultValueColumns", + Text = TextHandler.GetCommonText("默认值", "Dafault value") + }); + result.Insert(6, new ActionTypeFormElementModel() + { + ElementType = ElementType.UpdateColumns, + Name = "TableColumns", + Value = "", + Text = TextHandler.GetCommonText("更新的列 ( 默认所有 )", "Updated columns") + }); + result.Insert(7, new ActionTypeFormElementModel() + { + ElementType = ElementType.UpdateResultType, + Name = "ResultType", + Text = TextHandler.GetCommonText("返回类型", "return type") + }); + return result; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementInsertOrUpdateRange.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementInsertOrUpdateRange.cs new file mode 100644 index 0000000..c02fbc5 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementInsertOrUpdateRange.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; +using ReZero.SuperAPI; + +namespace ReZero.SuperAPI +{ + public class ElementInsertOrUpdateRange : BaseElement,IEelementActionType + { + public List GetModels() + { + var result = new List(); + base.AddActionTypeFormElementModels(result); + base.AddActionTypeElementModel(result, this); + result.Insert(3, new ActionTypeFormElementModel() + { + ElementType = ElementType.DefaultValueColumn, + Name = "DefaultValueColumns", + Text = TextHandler.GetCommonText("默认值", "Dafault value") + }); + result.Insert(6, new ActionTypeFormElementModel() + { + ElementType = ElementType.UpdateColumns, + Name = "TableColumns", + Value = "", + Text = TextHandler.GetCommonText("更新的列 ( 默认所有 )", "Updated columns") + }); + result.Insert(7, new ActionTypeFormElementModel() + { + ElementType = ElementType.UpdateResultType, + Name = "ResultType", + Text = TextHandler.GetCommonText("返回类型", "return type") + }); + return result; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementInsertRange.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementInsertRange.cs new file mode 100644 index 0000000..90eb9e1 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementInsertRange.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal class ElementInsertRange : BaseElement, IEelementActionType + { + public List GetModels() + { + var result = new List(); + base.AddActionTypeFormElementModels(result); + base.AddActionTypeElementModel(result, this); + result.Insert(3, new ActionTypeFormElementModel() + { + ElementType = ElementType.DefaultValueColumn, + Name = "DefaultValueColumns", + Text = TextHandler.GetCommonText("默认值", "Dafault value") + }); + return result; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementQueryAll.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementQueryAll.cs new file mode 100644 index 0000000..f6c26d9 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementQueryAll.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; +using ReZero.SuperAPI; + +namespace ReZero.SuperAPI +{ + public class ElementQueryAll : BaseElement,IEelementActionType + { + public List GetModels() + { + var result = new List(); + base.AddActionTypeFormElementModels(result); + base.AddActionTypeElementModel(result, this); + return result; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementQueryCommon.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementQueryCommon.cs new file mode 100644 index 0000000..7a28be5 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementQueryCommon.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Newtonsoft.Json; +using ReZero.SuperAPI; + +namespace ReZero.SuperAPI +{ + public class ElementQueryCommon : BaseElement,IEelementActionType + { + public List GetModels() + { + var result = new List(); + base.AddActionTypeFormElementModels(result); + base.AddActionTypeElementModel(result, this); + this.AddElements(result); + result = result.OrderBy(it => GetSprt(it)).ToList(); + return result; + } + + private static int GetSprt(ActionTypeFormElementModel it) + { + if (it.ElementType == ElementType.Columns) + { + return 0; + } + else if (it.ElementType == ElementType.Page) + { + return 0; + } + else if (it.ElementType == ElementType.Table) + { + return 0; + } + else if (it.Name == nameof(ZeroInterfaceList.Name)) + { + return -100; + } + else if (it.Name == nameof(ZeroInterfaceList.InterfaceCategoryId)) + { + return -99; + } + else + { + return 1; + } + } + + private void AddElements(List result) + { + + result.Add(new ActionTypeFormElementModel() + { + ElementType = ElementType.Columns, + Name = "Columns", + Text=TextHandler.GetCommonText("显示列", "Show columns"), + Value = null + }); + + result.Add(new ActionTypeFormElementModel() + { + ElementType = ElementType.Page, + Name = nameof(DataModel.CommonPage.PageSize), + Text = TextHandler.GetCommonText("分页","Page"), + Value =null + }); + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementQueryPrimaryKey.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementQueryPrimaryKey.cs new file mode 100644 index 0000000..628470c --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementQueryPrimaryKey.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; +using ReZero.SuperAPI; + +namespace ReZero.SuperAPI +{ + public class ElementQueryByPrimaryKey : BaseElement,IEelementActionType + { + public List GetModels() + { + var result = new List(); + base.AddActionTypeFormElementModels(result); + base.AddActionTypeElementModel(result, this); + return result; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementQueryTree.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementQueryTree.cs new file mode 100644 index 0000000..c6f6b59 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementQueryTree.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; +using ReZero.SuperAPI; + +namespace ReZero.SuperAPI +{ + public class ElementQueryTree : BaseElement,IEelementActionType + { + public List GetModels() + { + var result = new List(); + base.AddActionTypeFormElementModels(result); + base.AddActionTypeElementModel(result, this); + result.Insert(3, new ActionTypeFormElementModel() + { + ElementType= ElementType.Text, + Name= "TreeCode", + Text=TextHandler.GetCommonText("编号字段名", "Number field name"), + IsRequired=true, + }); + result.Insert(4, new ActionTypeFormElementModel() + { + ElementType = ElementType.Text, + Name = "TreeParentCode", + Text = TextHandler.GetCommonText("父级编号字段名", "Parent number Field name"), + IsRequired = true, + }); + result.Insert(5, new ActionTypeFormElementModel() + { + ElementType = ElementType.Where, + Name = "Where", + Text = TextHandler.GetCommonText("可选条件", "Where"), + Placeholder="注意:不能添加影响树型构造的条件,也就是加了条件这个结果还能构造树", + IsRequired = false, + }); + return result; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementSqlScript.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementSqlScript.cs new file mode 100644 index 0000000..c66cb9b --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementSqlScript.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ElementSqlScript : BaseElement, IEelementActionType + { + public List GetModels() + { + var result = new List(); + base.AddActionTypeFormElementModels(result); + base.AddActionTypeElementModel(result, this); + RemoveCommonItem(result); + result.Insert(2, new ActionTypeFormElementModel() + { + Text = TextHandler.GetCommonText("返回类型", "Result type"), + ElementType = ElementType.Select, + Name = nameof(SaveInterfaceListModel.ResultType), + Value = ((int)SqlResultType.Query).ToString(), + IsRequired = true, + SelectDataSource = new List() { + new ActionTypeFormElementSelectDataSourceModel(){ + Key=((int)SqlResultType.Query).ToString(), + Value=TextHandler.GetCommonText("查询", "Query"), + }, + new ActionTypeFormElementSelectDataSourceModel(){ + Key=((int)SqlResultType.AffectedRows).ToString(), + Value=TextHandler.GetCommonText("受影响行数", "Affected rows"), + }, + new ActionTypeFormElementSelectDataSourceModel(){ + Key=((int)SqlResultType.DataSet).ToString(), + Value=TextHandler.GetCommonText("DataSet", "DataSet"), + } + }, + }); + result.Insert(3, new ActionTypeFormElementModel() + { + Text = TextHandler.GetCommonText("Sql脚本", "Sql script"), + ElementType = ElementType.SqlText, + Name = nameof(SaveInterfaceListModel.Sql), + Value = "\r\nselect * from tableName where id={int:id} and name={string:name} " + }); + return result; + } + + private static void RemoveCommonItem(List result) + { + result.RemoveAll(it => it.Name == "TableId"); + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementUpdateObject.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementUpdateObject.cs new file mode 100644 index 0000000..448dff6 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementUpdateObject.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; +using ReZero.SuperAPI; + +namespace ReZero.SuperAPI +{ + public class ElementUpdateObject : BaseElement,IEelementActionType + { + public List GetModels() + { + var result = new List(); + base.AddActionTypeFormElementModels(result); + base.AddActionTypeElementModel(result, this); + result.Insert(3, new ActionTypeFormElementModel() + { + ElementType = ElementType.DefaultValueColumn, + Name = "DefaultValueColumns", + Text = TextHandler.GetCommonText("默认值", "Dafault value") + }); + result.Insert(6, new ActionTypeFormElementModel() + { + ElementType = ElementType.UpdateColumns, + Name = "TableColumns", + Value = "", + Text = TextHandler.GetCommonText("更新的列 ( 默认所有 )", "Updated columns") + }); + result.Insert(7, new ActionTypeFormElementModel() + { + ElementType = ElementType.UpdateResultType, + Name = "ResultType", + Text = TextHandler.GetCommonText("返回类型", "return type") + }); + return result; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementUpdateRange.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementUpdateRange.cs new file mode 100644 index 0000000..6a17e02 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/ElementUpdateRange.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; +using ReZero.SuperAPI; + +namespace ReZero.SuperAPI +{ + public class ElementUpdateRange : BaseElement,IEelementActionType + { + public List GetModels() + { + var result = new List(); + base.AddActionTypeFormElementModels(result); + base.AddActionTypeElementModel(result, this); + result.Insert(3, new ActionTypeFormElementModel() + { + ElementType = ElementType.DefaultValueColumn, + Name = "DefaultValueColumns", + Text = TextHandler.GetCommonText("默认值", "Dafault value") + }); + result.Insert(6, new ActionTypeFormElementModel() + { + ElementType = ElementType.UpdateColumns, + Name = "TableColumns", + Value = "", + Text = TextHandler.GetCommonText("更新的列 ( 默认所有 )", "Updated columns") + }); + result.Insert(7, new ActionTypeFormElementModel() + { + ElementType = ElementType.UpdateResultType, + Name = "ResultType", + Text = TextHandler.GetCommonText("返回类型", "return type") + }); + return result; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/IEelementActionType.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/IEelementActionType.cs new file mode 100644 index 0000000..ef1845f --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/FormElements/IEelementActionType.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; +using ReZero.SuperAPI; + +namespace ReZero.SuperAPI +{ + public interface IEelementActionType + { + List GetModels(); + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/GetActionType.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/GetActionType.cs new file mode 100644 index 0000000..343655d --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiGetActionType/GetActionType.cs @@ -0,0 +1,97 @@ + using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class MethodApi + { + public object GetActionType() + { + var items = EnumAttributeExtractor.GetEnumAttributeValues(); + var result = items! + .GroupBy(it => it.TextGroup)! + .Select(it => GetActionTypeSelectItem(it)) + .ToList(); + return result; + } + + private static ActionTypeModel GetActionTypeSelectItem(IGrouping it) + { + return new ActionTypeModel + { + TextGroup = it.Key, + Items = GetItemResult(it) + }; + } + + private static List GetItemResult(IGrouping it) + { + var items = new List(); + foreach (var item in it.ToList()) + { + var eles = GetFormElements(item); + if (eles.Any()) + { + eles.Add(new ActionTypeFormElementModel() + { + + ElementType = ElementType.Select, + Name = nameof(HttpMethod), + Text = nameof(HttpMethod), + SelectDataSource = new List() + { + new ActionTypeFormElementSelectDataSourceModel() + { + Key=HttpRequestMethod.All.ToString().FirstCharToUpper(), + Value=HttpRequestMethod.All.ToString().FirstCharToUpper(), + }, + new ActionTypeFormElementSelectDataSourceModel() + { + Key=HttpRequestMethod.GET.ToString().FirstCharToUpper(), + Value=HttpRequestMethod.GET.ToString().FirstCharToUpper(), + }, + new ActionTypeFormElementSelectDataSourceModel() + { + Key=HttpRequestMethod.POST.ToString().FirstCharToUpper(), + Value=HttpRequestMethod.POST.ToString().FirstCharToUpper(), + }, + new ActionTypeFormElementSelectDataSourceModel() + { + Key=HttpRequestMethod.PUT.ToString().FirstCharToUpper(), + Value=HttpRequestMethod.PUT.ToString().FirstCharToUpper(), + }, + new ActionTypeFormElementSelectDataSourceModel() + { + Key=HttpRequestMethod.DELETE.ToString().FirstCharToUpper(), + Value=HttpRequestMethod.DELETE.ToString().FirstCharToUpper(), + }, + } + + }); + } + items.Add(new ActionTypeItemModel() + { + Text=item.Text, + TextGroup=item.TextGroup, + FormElements= eles, + }); + } + return items; + } + + private static List GetFormElements(EnumAttributeExtractor.EnumAttributeValues item) + { + var actionType = (ActionType)item.Value; + var fullName = InstanceManager.GetActionTypeElementName(actionType); + var type = Type.GetType(fullName); + if (type == null) return new List(); + var actionInstance = (IEelementActionType)Activator.CreateInstance(type); + var result=actionInstance.GetModels(); + return result; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiImportEntities.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiImportEntities.cs new file mode 100644 index 0000000..ab93c0e --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiImportEntities.cs @@ -0,0 +1,160 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class MethodApi + { + public object ImportEntities(long databasdeId, List tableNames) + { + var db = App.GetDbById(databasdeId)!; + List entityInfos = new List(); + var tableInfos = db.DbMaintenance.GetTableInfoList(false); + foreach (var tableName in tableNames) + { + ZeroEntityInfo entityInfo = CreateEntityInfo(db, tableName,tableInfos); + entityInfo.DataBaseId = databasdeId; + entityInfo.ColumnCount = entityInfo.ZeroEntityColumnInfos?.Count??0; + entityInfos.Add(entityInfo); + } + var dbTableNames = entityInfos.Select(it => it.DbTableName).ToList(); + var deleteTables=App.Db.Queryable() + .ClearFilter() + .Where(it => it.DataBaseId == databasdeId) + .Where(it=>it.IsDeleted==true) + .Where(it => dbTableNames.Contains(it.DbTableName)) + .ToList(); + var deleteTableNames = deleteTables.Select(it => it.DbTableName).ToList(); + var inserObj = entityInfos.Where(it => !deleteTableNames.Contains(it.DbTableName)).ToList(); + var updateObj = entityInfos.Where(it => deleteTableNames.Contains(it.DbTableName)).ToList(); + App.Db.InsertNav(inserObj).Include(it => it.ZeroEntityColumnInfos).ExecuteCommand(); + foreach (var item in updateObj) + { + item.Id = deleteTables.OrderByDescending(it => it.Id).FirstOrDefault(it => it.DbTableName == item.DbTableName)?.Id??0; + } + App.Db.UpdateNav(updateObj).Include(it => it.ZeroEntityColumnInfos).ExecuteCommand(); + CacheManager.Instance.ClearCache(); + return true; + } + + private ZeroEntityInfo CreateEntityInfo(SqlSugarClient db, string tableName, List tableInfos) + { + ZeroEntityInfo entityInfo = new ZeroEntityInfo(); + var setting = App.Db.Queryable().First(it => it.TypeId == PubConst.Setting_EntityType && it.ChildTypeId == PubConst.Setting_ImportUnunderlineType); + entityInfo.ClassName = CapitalizeFirstLetter(tableName,setting.BoolValue); + entityInfo.DbTableName = tableName; + entityInfo.Description = tableInfos.FirstOrDefault(it => it.Name == tableName)?.Description; + entityInfo.CreateTime = DateTime.Now; + var columns = db.DbMaintenance.GetColumnInfosByTableName(tableName, false); + var dataTable = db.Queryable().AS(tableName).Where(GetWhereFalse()).ToDataTable(); + var dtColumns = dataTable.Columns.Cast().ToList(); + var joinedColumns = columns. + Join(dtColumns, c => + c.DbColumnName.ToLower(), + dtc => (dtc.ColumnName?.ToLower()), (c, dtc) => + new ZeroEntityColumnInfo + { + DbColumnName = c.DbColumnName, + DataType = GetDataType(db.CurrentConnectionConfig.DbType,c), + PropertyName = CapitalizeFirstLetter(c.DbColumnName, setting.BoolValue), + PropertyType = EntityGeneratorManager.GetNativeTypeByType(GetType(c, dtc)), + IsNullable = c.IsNullable, + IsPrimarykey = c.IsPrimarykey, + IsIdentity = c.IsIdentity, + Description = c.ColumnDescription, + Length=c.Length, + Scale=c.Scale, + DecimalDigits=c.DecimalDigits, + CreateTime = DateTime.Now + }).ToList(); + entityInfo.ZeroEntityColumnInfos = joinedColumns; + return entityInfo; + } + + private string GetDataType(SqlSugar.DbType dbType, SqlSugar.DbColumnInfo c) + { + if (dbType==SqlSugar.DbType.Oracle&&!string.IsNullOrEmpty(c.OracleDataType)) + { + return c.OracleDataType; + } + else if (dbType == SqlSugar.DbType.Dm && !string.IsNullOrEmpty(c.OracleDataType)) + { + return c.OracleDataType; + } + return c.DataType; + } + + private static Type GetType(SqlSugar.DbColumnInfo c, DataColumn dtc) + { + if (dtc.DataType == typeof(string)) + { + return dtc.DataType; + } + if (dtc.DataType == typeof(byte[])) + { + return dtc.DataType; + } + return c.IsNullable ? typeof(Nullable<>).MakeGenericType(dtc.DataType) : dtc.DataType; + } + #region Helper + private static string GetWhereFalse() + { + return "0=" + PubConst.Common_Random.Next(1, 9999999); + } + public string CapitalizeFirstLetter(string input, bool boolValue) + { + if (string.IsNullOrEmpty(input)) + { + return input; + } + if (boolValue) + { + return GetCsharpName(input); + } + else + { + return char.ToUpper(input[0]) + input.Substring(1); + } + } + public static string GetCsharpName(string dbColumnName) + { + if (dbColumnName.Contains("_")) + { + dbColumnName = dbColumnName.TrimEnd('_'); + dbColumnName = dbColumnName.TrimStart('_'); + var array = dbColumnName.Split('_').Select(it => GetFirstUpper(it, true)).ToArray(); + return string.Join("", array); + } + else + { + return GetFirstUpper(dbColumnName); + } + } + private static string GetFirstUpper(string dbColumnName, bool islower = false) + { + if (dbColumnName == null) + return null; + if (islower) + { + return dbColumnName.Substring(0, 1).ToUpper() + dbColumnName.Substring(1).ToLower(); + } + else + { + if (dbColumnName.ToUpper() == dbColumnName) + { + return dbColumnName.Substring(0, 1).ToUpper() + dbColumnName.Substring(1).ToLower(); + } + else + { + return dbColumnName.Substring(0, 1).ToUpper() + dbColumnName.Substring(1); + } + } + } + #endregion + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiJwt.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiJwt.cs new file mode 100644 index 0000000..647ba7d --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiJwt.cs @@ -0,0 +1,158 @@ +using Kdbndp.TypeHandlers; +using Microsoft.IdentityModel.Tokens; +using ReZero.Configuration; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Data; +using System.IdentityModel.Tokens.Jwt; +using System.Linq; +using System.Security.Claims; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class MethodApi + { + public DateTime? TokenExpiration { get; set; } + + /// + /// 获取JWT Token + /// + /// 用户名 + /// 密码 + /// JWT Token字符串 + public string GetToken(string userName, string password) + { + var db = App.Db; + var options = SuperAPIModule._apiOptions; + var jwt = options?.InterfaceOptions?.Jwt ?? new Configuration.ReZeroJwt(); + ZeroUserInfo data = GetAdminUserInfo(userName, password, db); + if (data != null && string.IsNullOrEmpty(data.BusinessAccount)) + { + return GenerateJwtToken(data, jwt); + } + else if (data != null&& !string.IsNullOrEmpty(data.BusinessAccount)) + { + var dt = db.Queryable() + .AS(jwt.UserTableName) + .Where(jwt.UserNameFieldName, "=", data.BusinessAccount) + .ToDataTable(); + if (dt.Rows.Count == 0) + { + throw new Exception(TextHandler.GetCommonText("授权失败", "Authorization failure")); + } + return GenerateJwtToken(dt.Rows[0], jwt); + } + else //业务表登录 + { + CheckJwt(jwt); + DataTable dt = new DataTable(); + try + { + dt = db.Queryable() + .AS(jwt.UserTableName) + .Where(jwt.PasswordFieldName, "=", password) + .Where(jwt.UserNameFieldName, "=", userName) + .ToDataTable(); + + } + catch (Exception) + { + throw new Exception(TextHandler.GetCommonText("授权失败", "Authorization failure")); + } + if (dt.Rows.Count == 0) + { + throw new Exception(TextHandler.GetCommonText("授权失败", "Authorization failure")); + } + return GenerateJwtToken(dt.Rows[0], jwt); + } + } + + /// + /// 获取管理员用户信息 + /// + /// 用户名 + /// 密码 + /// 数据库连接 + /// 管理员用户信息 + private static ZeroUserInfo GetAdminUserInfo(string userName, string password, ISqlSugarClient db) + { + // 先验证是不是系统管理员账号 + return db.Queryable() + .Where(it => it.UserName == userName) + .Where(it => it.Password == password).First(); + } + + /// + /// 检查JWT配置 + /// + /// JWT配置 + private static void CheckJwt(ReZeroJwt jwt) + { + if (string.IsNullOrEmpty(jwt.Secret) || string.IsNullOrEmpty(jwt.UserTableName) || string.IsNullOrEmpty(jwt.UserTableName) || string.IsNullOrEmpty(jwt.UserTableName)) + { + throw new Exception(TextHandler.GetCommonText("请到json文件配置jwt信息", "Go to the json file to configure the jwt information")); + } + } + + /// + /// 生成JWT Token + /// + /// 用户信息 + /// JWT配置 + /// JWT Token字符串 + private string GenerateJwtToken(ZeroUserInfo user, ReZeroJwt jwt) + { + var options = SuperAPIModule._apiOptions; + var tokenHandler = new JwtSecurityTokenHandler(); + var key = Encoding.ASCII.GetBytes(jwt.Secret); + var claims = new List(); + claims.Add(new Claim(ClaimTypes.Name, user.UserName)); + foreach (var claim in jwt.Claim ?? new List()) + { + claims.Add(new Claim(claim.Key, user.GetType().GetProperty(claim.FieldName)?.GetValue(user, null)?.ToString() ?? "")); + } + var tokenExpiration = this.TokenExpiration; + if (tokenExpiration == null) + { + tokenExpiration = DateTime.UtcNow.AddMinutes(jwt?.Expires ?? 1000); + } + var tokenDescriptor = new SecurityTokenDescriptor + { + Subject = new ClaimsIdentity(claims.ToArray()), + Expires = tokenExpiration, + SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature) + }; + var token = tokenHandler.CreateToken(tokenDescriptor); + return tokenHandler.WriteToken(token); + } + + /// + /// 生成JWT Token + /// + /// 用户信息 + /// JWT配置 + /// JWT Token字符串 + private string GenerateJwtToken(DataRow user, ReZeroJwt jwt) + { + var options = SuperAPIModule._apiOptions; + var tokenHandler = new JwtSecurityTokenHandler(); + var key = Encoding.ASCII.GetBytes(jwt.Secret); + var claims = new List(); + claims.Add(new Claim(ClaimTypes.Name, user[jwt.UserNameFieldName] + "")); + foreach (var claim in jwt.Claim ?? new List()) + { + claims.Add(new Claim(claim.Key, user[claim.FieldName] + "")); + } + var tokenDescriptor = new SecurityTokenDescriptor + { + Subject = new ClaimsIdentity(claims.ToArray()), + Expires = DateTime.UtcNow.AddMinutes(jwt?.Expires ?? 1000), + SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature) + }; + var token = tokenHandler.CreateToken(tokenDescriptor); + return tokenHandler.WriteToken(token); + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiOther.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiOther.cs new file mode 100644 index 0000000..0a54946 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiOther.cs @@ -0,0 +1,167 @@ +using ReZero.Excel; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Data; +using System.DirectoryServices.Protocols; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + public partial class MethodApi + { + public bool TestDb(long Id) + { + SqlSugarClient? db = App.GetDbById(Id); + if (db == null) + { + return false; + } + else + { + return db.Ado.IsValidConnection(); + } + } + + public object CreateDb(long dbId) + { + try + { + SqlSugarClient? db = App.GetDbById(dbId); + db!.DbMaintenance.CreateDatabase(); + return true; + } + catch (Exception ex) + { + return ex.Message; + } + } + public object GetImportTables(long databaseId, string tableName) + { + var db = App.GetDbById(databaseId); + var entitys = App.Db.Queryable() + .Where(it => it.IsDeleted == false) + .Where(it => it.DataBaseId == databaseId).ToList(); + var tables = db!.DbMaintenance.GetTableInfoList(false).Where(it => !it.Name.ToLower().StartsWith("zero_")).ToList(); + var result = tables + .OrderBy(it => it.Name) + .Where(it => !entitys.Any(s => s.DbTableName!.EqualsCase(it.Name))).ToList(); + if (!string.IsNullOrEmpty(tableName)) + { + result = result.Where(it => it.Name.ToLower().Contains(tableName.ToLower())).ToList(); + } + return result; + } + public object GetUserInfo() + { + return null; + } + public object GetTables(long databaseId, string tableName) + { + var db = App.GetDbById(databaseId); + var entitys = App.Db.Queryable() + .Where(it => it.IsDeleted == false) + .WhereIF(!string.IsNullOrEmpty(tableName), it => it.DbTableName!.ToLower().Contains(tableName.ToLower())) + .Where(it => it.DataBaseId == databaseId).ToList() + .Where(it => !it.DbTableName!.ToLower().StartsWith("zero_")); + var result = entitys.Select(it => new DbTableInfo() + { + Id = it.Id, + Name = it.ClassName, + Description = it.Description + }) + .OrderBy(it=>it.Name).ToList(); + return result; + } + + public object ExecuetSql(long databaseId, string sql) + { + var db = App.GetDbById(databaseId); + sql = sql + string.Empty; + if (db!.CurrentConnectionConfig.DbType == SqlSugar.DbType.Oracle && sql.Contains(";") && !sql.ToLower().Contains("begin")) + { + var sqls = sql.Split(';'); + List result = new List(); + foreach (var item in sqls) + { + if (!string.IsNullOrEmpty(item.Trim().Replace("\r", "").Replace("\n", ""))) + { + result.Add(GetObject(item, db)); + } + } + if (result.Count == 1) + { + return result.FirstOrDefault(); + } + else + { + return result; + } + } + else + { + var result = GetObject(sql, db); + return result; + } + } + + public byte[] ExecuetSqlReturnExcel(long databaseId, string sql) + { + var db = App.GetDbById(databaseId); + sql = sql + string.Empty; + DataSet result = new DataSet(); + if (db!.CurrentConnectionConfig.DbType == SqlSugar.DbType.Oracle && sql.Contains(";") && !sql.ToLower().Contains("begin")) + { + var sqls = sql.Split(';'); + foreach (var item in sqls) + { + if (!string.IsNullOrEmpty(item.Trim().Replace("\r", "").Replace("\n", ""))) + { + result.Tables.Add(db.Ado.GetDataTable(sql)); + } + } + } + else + { + result = db!.Ado.GetDataSetAll(sql); + } + var bytes= DataTableToExcel.ExportExcel(result, nameof(ExecuetSqlReturnExcel)); + return bytes; + } + + private static object GetObject(string sql, SqlSugarClient? db) + { + if (sql.ToLower().Contains("select")) + { + var ds = db!.Ado.GetDataSetAll(sql); + if (ds.Tables.Count == 1) + { + return ds.Tables[0]; + } + else + { + return ds; + } + } + else if (db!.CurrentConnectionConfig.DbType == SqlSugar.DbType.SqlServer && sql.ToLower().Contains("go")) + { + return db!.Ado.ExecuteCommandWithGo(sql); + } + else + { + return db!.Ado.ExecuteCommand(sql) + " affected rows"; + } + } + + + public static bool ClearAllInternalCache() + { + var cc = new CacheCenter(); + cc.ClearAllInternalCache(); + return true; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/BaseSaveInterfaceList.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/BaseSaveInterfaceList.cs new file mode 100644 index 0000000..a5b4081 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/BaseSaveInterfaceList.cs @@ -0,0 +1,158 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Policy; +using System.Text; +using System.Text.RegularExpressions; + +namespace ReZero.SuperAPI +{ + public class BaseSaveInterfaceList + { + + protected void ApplyDefaultAndClearIfNotEmpty(ZeroInterfaceList zeroInterfaceList) + { + foreach (var item in zeroInterfaceList.DataModel?.DefaultValueColumns ?? new List()) + { + var paramter = zeroInterfaceList.DataModel?.DefaultParameters?.FirstOrDefault(it => it.Name == item.PropertyName); + if (paramter != null) + { + if (paramter?.ParameterValidate?.IsRequired == true && item?.Type != DefaultValueType.None) + { + paramter.ParameterValidate = null; + } + } + } + } + protected void Check(EntityColumnInfo pk) + { + if (pk == null) + { + throw new Exception(TextHandler.GetCommonText("创建失败实体没有主键", "The failed entity does not have a primary key")); + + } + } + protected virtual void SetCommonProperties(ZeroInterfaceList zeroInterfaceList, SaveInterfaceListModel saveInterfaceListModel) + { + // Set default values for ZeroInterfaceList + zeroInterfaceList.IsInitialized = false; + zeroInterfaceList.IsDeleted = false; + zeroInterfaceList.IsAttributeMethod = false; + zeroInterfaceList.Name = saveInterfaceListModel.Name; + zeroInterfaceList.Url = GetUrl(saveInterfaceListModel); + zeroInterfaceList.DatabaseId = saveInterfaceListModel?.Json?.DataBaseId; + zeroInterfaceList.GroupName = !string.IsNullOrEmpty(saveInterfaceListModel?.GroupName)? saveInterfaceListModel?.GroupName!:saveInterfaceListModel?.TableId!; + zeroInterfaceList.InterfaceCategoryId = Convert.ToInt64(saveInterfaceListModel?.InterfaceCategoryId); + + // Set creator information + var options = SuperAPIModule._apiOptions; + var userInfo = options?.DatabaseOptions!.GetCurrentUserCallback(); + zeroInterfaceList.Creator = userInfo?.UserName; + zeroInterfaceList.CreateTime = DateTime.Now; + + // Set default HttpMethod if not specified + if (string.IsNullOrEmpty(zeroInterfaceList.HttpMethod)) + { + zeroInterfaceList.HttpMethod = HttpRequestMethod.All.ToString(); + } + if (!string.IsNullOrEmpty(saveInterfaceListModel?.HttpMethod)) + { + zeroInterfaceList.HttpMethod = saveInterfaceListModel.HttpMethod; + } + + // Set DataModel for ZeroInterfaceList + zeroInterfaceList.DataModel = new DataModel() + { + ActionType = saveInterfaceListModel!.ActionType!.Value, + TableId = GetTableId(saveInterfaceListModel.TableId) + }; + + //primary key + zeroInterfaceList.Id= saveInterfaceListModel.Json?.Id??0; + + //update info + SetCurrentData(zeroInterfaceList.DataModel,saveInterfaceListModel); + + } + + protected void SetCurrentData(DataModel dataModel, SaveInterfaceListModel saveInterfaceListModel) + { + dataModel.CurrentDataString = saveInterfaceListModel?.Json?.CurrentDataString; + } + protected EntityInfo GetEntityInfo(long tableId) + { + var type = EntityGeneratorManager.GetTypeAsync(tableId).GetAwaiter().GetResult(); + var entityInfo = App.Db.EntityMaintenance.GetEntityInfo(type); + return entityInfo; + } + + protected object SaveData(ZeroInterfaceList zeroInterfaceList) + { + if (zeroInterfaceList.Id == 0) + { + zeroInterfaceList.Id = SnowFlakeSingle.Instance.NextId(); + } + zeroInterfaceList.IsDeleted = false; + var url = zeroInterfaceList.Url?.ToLower(); + var urlCount = App.Db.Queryable() + .Where(it => it.Id != zeroInterfaceList!.Id) + .Where(it => it.Url!.ToLower() == url) + .Count(); + if (urlCount > 0) throw new Exception(TextHandler.GetCommonText("接口地址已存在", "The interface address already exists.")); + var x= App.Db.Storageable(zeroInterfaceList).ToStorage(); + x.AsInsertable.ExecuteCommand(); + if(x.UpdateList.Any()) + App.Db.Updateable(x.UpdateList.Select(it=>it.Item).First()).ExecuteCommand(); + return true; + } + public long GetTableId(string? tableId) + { + var db = App.Db; + var entityInfo= db.Queryable() + .Includes(x=>x.ZeroEntityColumnInfos) + .Where(it => it.ClassName == tableId).ToList(); + if (entityInfo.Count > 1) + { + throw new Exception("表名重复"); + } + else if (entityInfo.Count == 0) + { + throw new Exception("表名不存在"); + } + else if (!entityInfo.First().ZeroEntityColumnInfos.Any()) + { + throw new Exception("实体没有配置列"); + } + else + { + return entityInfo.First().Id; + } + } + + public string GetUrl(SaveInterfaceListModel? saveInterfaceListModel) + { + if (string.IsNullOrEmpty(saveInterfaceListModel?.Url)) + { + var data = App.Db.Queryable().InSingle(saveInterfaceListModel?.Json?.Id ?? 0); + if (data != null) + { + saveInterfaceListModel!.Url = data.Url; + } + else if (Regex.IsMatch(saveInterfaceListModel?.TableId?.ToLower()+"", @"[\u4e00-\u9fa5]")) + { + saveInterfaceListModel!.Url = $"/{saveInterfaceListModel.InterfaceCategoryId}/{saveInterfaceListModel.ActionType.ToString().ToLower()}/{SqlSugar.SnowFlakeSingle.Instance.NextId()}"; + } + else + { + saveInterfaceListModel!.Url = $"/{saveInterfaceListModel.InterfaceCategoryId}/{saveInterfaceListModel.ActionType.ToString().ToLower()}/{saveInterfaceListModel.TableId?.ToLower()}/{SqlSugar.SnowFlakeSingle.Instance.NextId()}"; + } + } + if (saveInterfaceListModel?.Url?.StartsWith(@"/") != true) + { + saveInterfaceListModel!.Url = $@"/{saveInterfaceListModel?.Url}"; + } + return saveInterfaceListModel?.Url!; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/IEelementActionType.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/IEelementActionType.cs new file mode 100644 index 0000000..489018e --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/IEelementActionType.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; +using ReZero.SuperAPI; + +namespace ReZero.SuperAPI +{ + public interface ISaveInterfaceList + { + object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel); + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListBizDeleteObject.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListBizDeleteObject.cs new file mode 100644 index 0000000..46067f3 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListBizDeleteObject.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Newtonsoft.Json; +using SqlSugar; + +namespace ReZero.SuperAPI +{ + public class SaveInterfaceListBizDeleteObject : BaseSaveInterfaceList, ISaveInterfaceList + { + public object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + ZeroInterfaceList zeroInterfaceList = new ZeroInterfaceList(); + base.SetCommonProperties(zeroInterfaceList, saveInterfaceListModel); + this.SetProperties(zeroInterfaceList, saveInterfaceListModel); + return base.SaveData(zeroInterfaceList); + } + private void SetProperties(ZeroInterfaceList zeroInterfaceList, SaveInterfaceListModel saveInterfaceListModel) + { + var entityInfo = base.GetEntityInfo(zeroInterfaceList!.DataModel!.TableId!); + var pk = entityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey); + base.Check(pk); + zeroInterfaceList.DataModel.DefaultParameters = new List() + { + new DataModelDefaultParameter(){ + FieldOperator=FieldOperatorType.Equal, + Name=pk.PropertyName, + ParameterValidate=new ParameterValidate(){ IsRequired=true }, + Description=pk.ColumnDescription, + ValueType=pk.UnderType.Name + } + }; + zeroInterfaceList.DataModel.ResultType = saveInterfaceListModel?.ResultType; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListBizDeleteRange.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListBizDeleteRange.cs new file mode 100644 index 0000000..f8609ae --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListBizDeleteRange.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using SqlSugar; + +namespace ReZero.SuperAPI +{ + public class SaveInterfaceListBizDeleteRange : BaseSaveInterfaceList, ISaveInterfaceList + { + public object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + ZeroInterfaceList zeroInterfaceList = new ZeroInterfaceList(); + base.SetCommonProperties(zeroInterfaceList, saveInterfaceListModel); + this.SetProperties(zeroInterfaceList, saveInterfaceListModel); + return base.SaveData(zeroInterfaceList); + } + private void SetProperties(ZeroInterfaceList zeroInterfaceList, SaveInterfaceListModel saveInterfaceListModel) + { + var entityInfo = base.GetEntityInfo(zeroInterfaceList!.DataModel!.TableId!); + var pk = entityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey); + base.Check(pk); + zeroInterfaceList.DataModel.DefaultParameters = new List() + { + new DataModelDefaultParameter(){ + FieldOperator=FieldOperatorType.Equal, + Name=pk.PropertyName+"Array", + ParameterValidate=new ParameterValidate(){ IsRequired=true }, + Description=pk.ColumnDescription, + ValueType=typeof(JArray).Name, + Value="[]" + } + }; + zeroInterfaceList.DataModel.ResultType = saveInterfaceListModel?.ResultType; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListDeleteObject.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListDeleteObject.cs new file mode 100644 index 0000000..b8aec9a --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListDeleteObject.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Newtonsoft.Json; +using SqlSugar; + +namespace ReZero.SuperAPI +{ + public class SaveInterfaceListDeleteObject : BaseSaveInterfaceList, ISaveInterfaceList + { + public object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + ZeroInterfaceList zeroInterfaceList = new ZeroInterfaceList(); + base.SetCommonProperties(zeroInterfaceList, saveInterfaceListModel); + this.SetProperties(zeroInterfaceList, saveInterfaceListModel); + return base.SaveData(zeroInterfaceList); + } + private void SetProperties(ZeroInterfaceList zeroInterfaceList, SaveInterfaceListModel saveInterfaceListModel) + { + var entityInfo = base.GetEntityInfo(zeroInterfaceList!.DataModel!.TableId!); + var pk = entityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey); + base.Check(pk); + zeroInterfaceList.DataModel.DefaultParameters = new List() + { + new DataModelDefaultParameter(){ + FieldOperator=FieldOperatorType.Equal, + Name=pk.PropertyName, + ParameterValidate=new ParameterValidate(){ IsRequired=true }, + Description=pk.ColumnDescription, + ValueType=pk.UnderType.Name + } + }; + zeroInterfaceList.DataModel.ResultType = saveInterfaceListModel?.ResultType; + } + + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListDeleteRange.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListDeleteRange.cs new file mode 100644 index 0000000..3621f4d --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListDeleteRange.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using SqlSugar; + +namespace ReZero.SuperAPI +{ + public class SaveInterfaceListDeleteRange : BaseSaveInterfaceList, ISaveInterfaceList + { + public object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + ZeroInterfaceList zeroInterfaceList = new ZeroInterfaceList(); + base.SetCommonProperties(zeroInterfaceList, saveInterfaceListModel); + this.SetProperties(zeroInterfaceList, saveInterfaceListModel); + return base.SaveData(zeroInterfaceList); + } + private void SetProperties(ZeroInterfaceList zeroInterfaceList, SaveInterfaceListModel saveInterfaceListModel) + { + var entityInfo = base.GetEntityInfo(zeroInterfaceList!.DataModel!.TableId!); + var pk = entityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey); + base.Check(pk); + zeroInterfaceList.DataModel.DefaultParameters = new List() + { + new DataModelDefaultParameter(){ + FieldOperator=FieldOperatorType.Equal, + Name=pk.PropertyName+"Array", + ParameterValidate=new ParameterValidate(){ IsRequired=true }, + Description=pk.ColumnDescription, + ValueType=typeof(JArray).Name, + Value="[]" + } + }; + zeroInterfaceList.DataModel.ResultType = saveInterfaceListModel?.ResultType; + } + + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListInsertObject.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListInsertObject.cs new file mode 100644 index 0000000..d1678b3 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListInsertObject.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Newtonsoft.Json; + +namespace ReZero.SuperAPI +{ + public class SaveInterfaceListInsertObject : BaseSaveInterfaceList, ISaveInterfaceList + { + public object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + ZeroInterfaceList zeroInterfaceList = new ZeroInterfaceList(); + base.SetCommonProperties(zeroInterfaceList, saveInterfaceListModel); + this.SetProperties(zeroInterfaceList, saveInterfaceListModel); + base.ApplyDefaultAndClearIfNotEmpty(zeroInterfaceList); + return base.SaveData(zeroInterfaceList); + } + + + + private void SetProperties(ZeroInterfaceList zeroInterfaceList, SaveInterfaceListModel saveInterfaceListModel) + { + var entityInfo = base.GetEntityInfo(zeroInterfaceList!.DataModel!.TableId!); + zeroInterfaceList.DataModel.DefaultParameters = new List(); + foreach (var item in entityInfo.Columns.Where(it=>it.IsIdentity==false&&it.IsOnlyIgnoreInsert==false && it.IsIgnore == false)) + { + zeroInterfaceList.DataModel.DefaultParameters.Add(new DataModelDefaultParameter() + { + FieldOperator = FieldOperatorType.Equal, + Name = item.PropertyName, + ParameterValidate =item.IsNullable?null:new ParameterValidate() { IsRequired = true }, + Description = item.ColumnDescription, + ValueType = item.UnderType.Name + }); + } + zeroInterfaceList.DataModel.ResultType = saveInterfaceListModel.ResultType; + zeroInterfaceList.DataModel.DefaultValueColumns = saveInterfaceListModel.Json?.DefaultValueColumns; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListInsertOrUpdateObject.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListInsertOrUpdateObject.cs new file mode 100644 index 0000000..52f0b3a --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListInsertOrUpdateObject.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Newtonsoft.Json; + +namespace ReZero.SuperAPI +{ + public class SaveInterfaceListInsertOrUpdateObject : BaseSaveInterfaceList, ISaveInterfaceList + { + public object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + ZeroInterfaceList zeroInterfaceList = new ZeroInterfaceList(); + base.SetCommonProperties(zeroInterfaceList, saveInterfaceListModel); + this.SetProperties(zeroInterfaceList, saveInterfaceListModel); + base.ApplyDefaultAndClearIfNotEmpty(zeroInterfaceList); + return base.SaveData(zeroInterfaceList); + } + private void SetProperties(ZeroInterfaceList zeroInterfaceList, SaveInterfaceListModel saveInterfaceListModel) + { + var entityInfo = base.GetEntityInfo(zeroInterfaceList!.DataModel!.TableId!); + zeroInterfaceList.DataModel.DefaultParameters = new List(); + foreach (var item in entityInfo.Columns.Where(it =>it.IsOnlyIgnoreUpdate == false&&it.IsIgnore==false)) + { + zeroInterfaceList.DataModel.DefaultParameters.Add(new DataModelDefaultParameter() + { + FieldOperator = FieldOperatorType.Equal, + Name = item.PropertyName, + ParameterValidate = item.IsNullable ? null : new ParameterValidate() { IsRequired = true }, + Description = item.ColumnDescription, + ValueType = item.UnderType.Name + }); + } + zeroInterfaceList.DataModel.DefaultValueColumns = saveInterfaceListModel.Json?.DefaultValueColumns; + zeroInterfaceList.DataModel.ResultType = saveInterfaceListModel?.ResultType; + zeroInterfaceList.DataModel.TableColumns = saveInterfaceListModel?.TableColumns; + if (!string.IsNullOrEmpty(zeroInterfaceList?.DataModel?.TableColumns??null)) + { + var cols = entityInfo.Columns.Where(it => it.IsPrimarykey || it.IsIdentity).Select(it=>it.PropertyName).ToList(); + cols.AddRange(zeroInterfaceList?.DataModel?.TableColumns?.Split(',')); + zeroInterfaceList!.DataModel.DefaultParameters = + zeroInterfaceList.DataModel.DefaultParameters.Where(it => cols.Contains(it.Name!)|| cols.Contains(it.PropertyName!)).ToList(); + } + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListInsertOrUpdateRange.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListInsertOrUpdateRange.cs new file mode 100644 index 0000000..24cc9d9 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListInsertOrUpdateRange.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using SqlSugar; + +namespace ReZero.SuperAPI +{ + public class SaveInterfaceListInsertOrUpdateRange : BaseSaveInterfaceList, ISaveInterfaceList + { + public object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + ZeroInterfaceList zeroInterfaceList = new ZeroInterfaceList(); + base.SetCommonProperties(zeroInterfaceList, saveInterfaceListModel); + this.SetProperties(zeroInterfaceList, saveInterfaceListModel); + base.ApplyDefaultAndClearIfNotEmpty(zeroInterfaceList); + return base.SaveData(zeroInterfaceList); + } + private void SetProperties(ZeroInterfaceList zeroInterfaceList, SaveInterfaceListModel saveInterfaceListModel) + { + var entityInfo = base.GetEntityInfo(zeroInterfaceList!.DataModel!.TableId!); + var listType = typeof(List<>).MakeGenericType(entityInfo.Type); + var listInstance = (IList)Activator.CreateInstance(listType); + listInstance.Add(Activator.CreateInstance(entityInfo.Type)); + var json = new SerializeService().SerializeObject(listInstance); + zeroInterfaceList.DataModel.DefaultParameters = + new List() { + new DataModelDefaultParameter() + { + Value=json, + Name="Data", + ValueType=typeof(JArray).Name, + Description="" + } + }; + zeroInterfaceList.DataModel.DefaultValueColumns = saveInterfaceListModel.Json?.DefaultValueColumns; + zeroInterfaceList.DataModel.ResultType = saveInterfaceListModel?.ResultType; + zeroInterfaceList.DataModel.TableColumns = saveInterfaceListModel?.TableColumns; + if (!string.IsNullOrEmpty(zeroInterfaceList?.DataModel?.TableColumns??null)) + { + var cols = entityInfo.Columns.Where(it => it.IsPrimarykey || it.IsIdentity).Select(it=>it.PropertyName).ToList(); + cols.AddRange(zeroInterfaceList?.DataModel?.TableColumns?.Split(',')); + zeroInterfaceList!.DataModel.DefaultParameters = + zeroInterfaceList.DataModel.DefaultParameters.Where(it => cols.Contains(it.Name!)|| cols.Contains(it.PropertyName!)).ToList(); + } + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListInsertRange.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListInsertRange.cs new file mode 100644 index 0000000..c8f8b55 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListInsertRange.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Linq; +using Newtonsoft.Json.Linq; +using System.Collections; +using SqlSugar; +namespace ReZero.SuperAPI +{ + public class SaveInterfaceListInsertRange : BaseSaveInterfaceList, ISaveInterfaceList + { + public object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + ZeroInterfaceList zeroInterfaceList = new ZeroInterfaceList(); + base.SetCommonProperties(zeroInterfaceList, saveInterfaceListModel); + this.SetProperties(zeroInterfaceList, saveInterfaceListModel); + base.ApplyDefaultAndClearIfNotEmpty(zeroInterfaceList); + return base.SaveData(zeroInterfaceList); + } + private void SetProperties(ZeroInterfaceList zeroInterfaceList, SaveInterfaceListModel saveInterfaceListModel) + { + var entityInfo = base.GetEntityInfo(zeroInterfaceList!.DataModel!.TableId!); + var listType= typeof(List<>).MakeGenericType(entityInfo.Type); + var listInstance = (IList)Activator.CreateInstance(listType) ; + listInstance.Add(Activator.CreateInstance(entityInfo.Type)); + var json = new SerializeService().SerializeObject(listInstance); + zeroInterfaceList.DataModel.DefaultParameters = + new List() { + new DataModelDefaultParameter() + { + Value=json, + Name="Data", + ValueType=typeof(JArray).Name, + Description="" + } + }; + zeroInterfaceList.DataModel.DefaultValueColumns = saveInterfaceListModel.Json?.DefaultValueColumns; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryAll.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryAll.cs new file mode 100644 index 0000000..67c0f20 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryAll.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; + +namespace ReZero.SuperAPI +{ + public class SaveInterfaceListQueryAll : BaseSaveInterfaceList, ISaveInterfaceList + { + public object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + ZeroInterfaceList zeroInterfaceList = new ZeroInterfaceList(); + base.SetCommonProperties(zeroInterfaceList, saveInterfaceListModel); + return base.SaveData(zeroInterfaceList); + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryByPrimaryKey.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryByPrimaryKey.cs new file mode 100644 index 0000000..96f4e8b --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryByPrimaryKey.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Newtonsoft.Json; +using SqlSugar; + +namespace ReZero.SuperAPI +{ + public class SaveInterfaceListQueryByPrimaryKey : BaseSaveInterfaceList, ISaveInterfaceList + { + public object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + ZeroInterfaceList zeroInterfaceList = new ZeroInterfaceList(); + base.SetCommonProperties(zeroInterfaceList, saveInterfaceListModel); + this.SetProperties(zeroInterfaceList,saveInterfaceListModel); + return base.SaveData(zeroInterfaceList); + } + + private void SetProperties(ZeroInterfaceList zeroInterfaceList, SaveInterfaceListModel saveInterfaceListModel) + { + var entityInfo = base.GetEntityInfo(zeroInterfaceList!.DataModel!.TableId!); + var pk = entityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey); + base.Check(pk); + zeroInterfaceList.DataModel.DefaultParameters = new List() + { + new DataModelDefaultParameter(){ + FieldOperator=FieldOperatorType.Equal, + Name=pk.PropertyName, + ParameterValidate=new ParameterValidate(){ IsRequired=true }, + Description=pk.ColumnDescription, + ValueType=pk.UnderType.Name + } + }; + } + + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryCommon/Items/Columns.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryCommon/Items/Columns.cs new file mode 100644 index 0000000..22f96da --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryCommon/Items/Columns.cs @@ -0,0 +1,232 @@ +using SqlSugar; +using SqlSugar.Extensions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class SaveInterfaceListQueryCommon : BaseSaveInterfaceList, ISaveInterfaceList + { + #region Core + private void SetColumns(SaveInterfaceListModel saveInterfaceListModel, ZeroInterfaceList zeroInterfaceList) + { + var anyColumns = saveInterfaceListModel!.Json!.Columns.Any(); + var anyJoin = saveInterfaceListModel!.Json!.ComplexityColumns.Any(); + var tableId = GetTableId(saveInterfaceListModel); + var columns = GetTableColums(tableId); + if (IsDefaultColums(anyColumns, anyJoin)) + { + AddDefaultColumns(zeroInterfaceList, columns); + } + else + { + AddMasterColumns(saveInterfaceListModel, zeroInterfaceList, anyColumns, columns); + AddJoinColumns(saveInterfaceListModel, zeroInterfaceList, anyJoin); + } + } + private static void AddJoinColumns(SaveInterfaceListModel saveInterfaceListModel, ZeroInterfaceList zeroInterfaceList, bool anyJoin) + { + if (anyJoin) + { + var joinColumns = saveInterfaceListModel!.Json!.ComplexityColumns; + var tableNames = joinColumns.Select(it => it.Json!.JoinInfo!.JoinTable!.ToLower()).ToList(); + var entityInfos = GetJoinEntityInfos(joinColumns, tableNames); + var index = 0; + foreach (var item in GetJoinComplexityColumns(joinColumns!)) + { + index++; + var tableInfo = GetJoinEntity(entityInfos, item); + AddJoins(zeroInterfaceList, index, item, tableInfo); + AddJoinSelectColumns(zeroInterfaceList, index, item, tableInfo); + } + var subIndex = 0; + foreach (var item in GetSubqueryComplexityColumns(joinColumns!)) + { + var tableInfo = GetJoinEntity(entityInfos, item); + subIndex++; + AddSubquerySelectColums(zeroInterfaceList, subIndex, item, tableInfo); + } + } + } + + private static void AddJoins(ZeroInterfaceList zeroInterfaceList, int index, CommonQueryComplexitycolumn item, ZeroEntityInfo tableInfo) + { + if (zeroInterfaceList.DataModel!.JoinParameters == null) + zeroInterfaceList.DataModel!.JoinParameters = new List(); + zeroInterfaceList!.DataModel!.JoinParameters.Add(new DataModelJoinParameters() + { + JoinTableId = tableInfo!.Id, + JoinType= (item.Json?.JoinInfo?.JoinType== ColumnJoinType.LeftJoin)?JoinType.Left:JoinType.Inner, + OnList = new List() + { + new JoinParameter() + { + FieldOperator=FieldOperatorType.Equal, + LeftIndex=0, + LeftPropertyName=item.Json!.JoinInfo!.MasterField, + RightPropertyName=item.Json!.JoinInfo!.JoinField, + RightIndex=index + } + } + }); + } + private void AddMasterColumns(SaveInterfaceListModel saveInterfaceListModel, ZeroInterfaceList zeroInterfaceList, bool anyColumns, List columns) + { + if (anyColumns) + { + zeroInterfaceList.DataModel!.Columns = columns + .Where(it => saveInterfaceListModel!.Json!.Columns.Any(z => z.PropertyName == it.PropertyName)).Select(it => new DataColumnParameter() + { + Description = saveInterfaceListModel!.Json!.Columns.FirstOrDefault(z => z.PropertyName == it.PropertyName).DbColumnName, + PropertyName = it.PropertyName + }).ToList(); + var isPage = saveInterfaceListModel.PageSize; + if (isPage) + { + foreach (var item in zeroInterfaceList.DataModel!.Columns) + { + if (item.PropertyName == item.Description || string.IsNullOrEmpty(item.Description)) + { + item.Description = columns.FirstOrDefault(it => it.PropertyName == item.PropertyName).Description; + } + } + } + zeroInterfaceList.DataModel!.SelectParameters = saveInterfaceListModel!.Json!.Columns + .Select(it => new DataModelSelectParameters() + { + AsName = isPage ? it.PropertyName : it.DbColumnName, + TableIndex = 0, + Name = it.PropertyName, + }).ToList(); + } + } + private void AddDefaultColumns(ZeroInterfaceList zeroInterfaceList, List columns) + { + if (this.isPage) + { + zeroInterfaceList.DataModel!.Columns = columns.Select(it => new DataColumnParameter() + { + Description = it.PropertyName, + PropertyName = it.PropertyName, + AsName = it.PropertyName + + }).ToList(); + + foreach (var item in zeroInterfaceList.DataModel!.Columns) + { + if (item.PropertyName == item.Description || string.IsNullOrEmpty(item.Description)) + { + item.Description = columns.FirstOrDefault(it => it.PropertyName == item.PropertyName).Description; + } + } + } + else + { + zeroInterfaceList.DataModel!.Columns = columns.Select(it => new DataColumnParameter() + { + Description = it.DbColumnName, + PropertyName = it.PropertyName, + AsName = it.DbColumnName + + }).ToList(); + } + } + private static void AddSubquerySelectColums(ZeroInterfaceList zeroInterfaceList, int subIndex, CommonQueryComplexitycolumn item, ZeroEntityInfo tableInfo) + { + var columnsInfo = tableInfo!.ZeroEntityColumnInfos! + .Where(it => it.PropertyName == item.Json!.JoinInfo!.ShowField).First(); + var joinField = item.Json!.JoinInfo!.JoinField; + var materField = item.Json!.JoinInfo!.MasterField; + var asName = item.Json!.JoinInfo!.Name; + var showField = item.Json!.JoinInfo!.ShowField; + var subQueryable = App.Db.Queryable(); + var builder = subQueryable.QueryBuilder.Builder; + var subquerySql = subQueryable + .Take(1) + .AS(tableInfo.DbTableName) + .Where($"{builder.GetTranslationColumnName(joinField)}={builder.GetTranslationColumnName(PubConst.Orm_TableDefaultPreName + 0)}.{builder.GetTranslationColumnName(materField)}") + .Select(SelectModel.Create(new SelectModel() + { + AsName = asName, + FieldName = showField + })).ToSql().Key; + DataModelSelectParameters addColumnItem = new DataModelSelectParameters() + { + Name = PubConst.Orm_SubqueryKey, + SubquerySQL = $"({subquerySql}) AS {builder.GetTranslationColumnName(asName)} ", + AsName = asName, + }; + zeroInterfaceList.DataModel!.SelectParameters!.Add(addColumnItem); + zeroInterfaceList.DataModel!.Columns!.Add(new DataColumnParameter() + { + Description = addColumnItem.AsName, + PropertyName = addColumnItem.AsName + }); + } + private static void AddJoinSelectColumns(ZeroInterfaceList zeroInterfaceList, int index, CommonQueryComplexitycolumn item, ZeroEntityInfo tableInfo) + { + var columnsInfo = tableInfo!.ZeroEntityColumnInfos! + .Where(it => it.PropertyName == item.Json!.JoinInfo!.ShowField).First(); + DataModelSelectParameters addColumnItem = new DataModelSelectParameters() + { + Name = columnsInfo.PropertyName, + TableIndex = index, + AsName = string.IsNullOrEmpty(item.Json!.JoinInfo!.Name) ? columnsInfo.PropertyName : item.Json!.JoinInfo!.Name + }; + zeroInterfaceList.DataModel!.SelectParameters!.Add(addColumnItem); + zeroInterfaceList.DataModel!.Columns!.Add(new DataColumnParameter() + { + Description = addColumnItem.AsName, + PropertyName = addColumnItem.AsName + }); + } + + #endregion + + #region Helper + private static ZeroEntityInfo GetJoinEntity(List entityInfos, CommonQueryComplexitycolumn item) + { + return entityInfos.FirstOrDefault(it => it.DbTableName!.ToLower() == item!.Json!.JoinInfo!.JoinTable!.ToLower() || + it.ClassName!.ToLower() == item!.Json!.JoinInfo!.JoinTable!.ToLower()); + } + private static IEnumerable GetJoinComplexityColumns(CommonQueryComplexitycolumn[] joinColumns) + { + return joinColumns!.Where(it => it.Json!.JoinInfo!.JoinType != ColumnJoinType.SubqueryJoin); + } + private static IEnumerable GetSubqueryComplexityColumns(CommonQueryComplexitycolumn[] joinColumns) + { + return joinColumns!.Where(it => it.Json!.JoinInfo!.JoinType == ColumnJoinType.SubqueryJoin); + } + + private static List GetJoinEntityInfos(CommonQueryComplexitycolumn[]? joinColumns, List tableNames) + { + return App.Db.Queryable() + .Includes(s => s.ZeroEntityColumnInfos) + .Where(s => + joinColumns.Any(it => tableNames.Contains(s.DbTableName!.ToLower())) || + joinColumns.Any(it => tableNames.Contains(s.ClassName!.ToLower())) + ) + .ToList(); + } + private static bool IsDefaultColums(bool anyColumns, bool anyJoin) + { + return !anyJoin && !anyColumns; + } + + private static List GetTableColums(long tableId) + { + return App.Db.Queryable().Where(it => it.TableId == tableId).ToList(); + } + + private static long GetTableId(SaveInterfaceListModel saveInterfaceListModel) + { + return App.Db.Queryable().Where(it => it.ClassName == saveInterfaceListModel.TableId).First().Id; + } + #endregion + + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryCommon/Items/OrderBy.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryCommon/Items/OrderBy.cs new file mode 100644 index 0000000..79fccf4 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryCommon/Items/OrderBy.cs @@ -0,0 +1,71 @@ +using SqlSugar; +using SqlSugar.Extensions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class SaveInterfaceListQueryCommon : BaseSaveInterfaceList, ISaveInterfaceList + { + private void SetOrderBy(SaveInterfaceListModel saveInterfaceListModel, ZeroInterfaceList zeroInterfaceList) + { + if (saveInterfaceListModel.Json!.OrderBysEnableSort) + { + zeroInterfaceList.DataModel!.OrderDynamicParemters = new List(); + } + if (saveInterfaceListModel.Json!.OrderBys.Any()) + { + AddDefaultOrderBy(saveInterfaceListModel, zeroInterfaceList); + AddMergeOrderBy(saveInterfaceListModel, zeroInterfaceList); + } + } + private void AddMergeOrderBy(SaveInterfaceListModel saveInterfaceListModel, ZeroInterfaceList zeroInterfaceList) + { + + zeroInterfaceList.DataModel!.MergeOrderByFixedParemters = + saveInterfaceListModel.Json!.OrderBys + .OrderBy(it => it.SortId.ObjToInt()) + .Where(it => IsMergeOrder(it)) + .Where(it => !string.IsNullOrEmpty(it.OrderByType)) + .Select(it => { + var left = it.Name!.Split(" AS ")[0]; + var joinClassName = left.Split(".").First().Trim(); + var joinPropertyName = left.Split(".").Last().Trim(); + var asName = it.Name!.Split(" AS ")[1]; + var joinEntity = App.Db.Queryable().Includes(it => it.ZeroEntityColumnInfos).Where(it => it.ClassName == joinClassName).First(); + var entityColumns = joinEntity.ZeroEntityColumnInfos; + var columnInfo = entityColumns.FirstOrDefault(x => x.PropertyName == joinPropertyName); + var type = columnInfo.PropertyType; + var result = new DataModelOrderParemter() + { + FieldName = asName, + OrderByType = it.OrderByType!.EqualsCase("asc") ? OrderByType.Asc : OrderByType.Desc, + TableIndex = 0 + }; + return result; + }).ToList(); + } + private void AddDefaultOrderBy(SaveInterfaceListModel saveInterfaceListModel, ZeroInterfaceList zeroInterfaceList) + { + zeroInterfaceList.DataModel!.OrderByFixedParemters = + saveInterfaceListModel.Json!.OrderBys + .OrderBy(it => it.SortId.ObjToInt()) + .Where(it => !IsMergeOrder(it)) + .Where(it => !string.IsNullOrEmpty(it.OrderByType)) + .Select(it => new DataModelOrderParemter() + { + FieldName = it.Name, + OrderByType = it.OrderByType!.EqualsCase("asc") ? OrderByType.Asc : OrderByType.Desc, + TableIndex = 0 + }).ToList(); + } + + private bool IsMergeOrder(CommonQueryOrderby it) + { + return it.Name!.Contains(" AS ") && it.Name.Contains("."); + } + + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryCommon/Items/Page.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryCommon/Items/Page.cs new file mode 100644 index 0000000..ee53cd6 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryCommon/Items/Page.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class SaveInterfaceListQueryCommon : BaseSaveInterfaceList, ISaveInterfaceList + { + + private static void SetPage(SaveInterfaceListModel saveInterfaceListModel, ZeroInterfaceList zeroInterfaceList) + { + if (saveInterfaceListModel.PageSize) + { + zeroInterfaceList!.DataModel!.CommonPage = new DataModelPageParameter + { + PageSize = 20, + PageNumber = 1 + }; + zeroInterfaceList.DataModel.DefaultParameters!.AddRange( + new List() { + new DataModelDefaultParameter() { Name=SuperAPIModule._apiOptions?.InterfaceOptions.PageNumberPropName ,Value=1,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("第几页", "Page number") }, + new DataModelDefaultParameter() { Name=SuperAPIModule._apiOptions?.InterfaceOptions.PageSizePropName ,Value=20,FieldOperator=FieldOperatorType.Equal, ValueType = typeof(long).Name, Description = TextHandler.GetCommonText("每页几条", "Pageize") } + } + ); + zeroInterfaceList.CustomResultModel = new ResultModel() + { + ResultType = ResultType.Grid + }; + } + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryCommon/Items/Where.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryCommon/Items/Where.cs new file mode 100644 index 0000000..06eb0c6 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryCommon/Items/Where.cs @@ -0,0 +1,116 @@ +using SqlSugar; +using SqlSugar.Extensions; +using System; +using System.Collections.Generic; +using System.DirectoryServices.Protocols; +using System.Linq; +using System.Text; +using System.Transactions; + +namespace ReZero.SuperAPI +{ + public partial class SaveInterfaceListQueryCommon : BaseSaveInterfaceList, ISaveInterfaceList + { + public void SetWhere(SaveInterfaceListModel saveInterfaceListModel, ZeroInterfaceList zeroInterfaceList) + { + var json = saveInterfaceListModel.Json!; + if (IsWhere(json)) + { + zeroInterfaceList.DataModel!.WhereRelation=json.WhereRelation; + zeroInterfaceList.DataModel.WhereRelationTemplate = json.WhereRelationTemplate; + foreach (var it in json.Where??new CommonQueryWhere[] { }) + { + if (it.PropertyName == null) + { + throw new Exception(TextHandler.GetCommonText("条件没有配置列名", "Condition No column name is configured")); + } + if (IsMergeWhere(it)) + { + AddMergeWhereItem(zeroInterfaceList, it, json); + } + else + { + AddDefaultWhere(zeroInterfaceList, json, it); + } + } + } + } + + private void AddDefaultWhere(ZeroInterfaceList zeroInterfaceList, CommonConfig json, CommonQueryWhere it) + { + var type = this.zeroEntityInfo! + .ZeroEntityColumnInfos.FirstOrDefault(x => x.PropertyName == it.PropertyName).PropertyType; + zeroInterfaceList.DataModel!.DefaultParameters!.Add(new DataModelDefaultParameter() + { + Id = it.Id, + Name = it.Value, + PropertyName=it.PropertyName, + ValueType = EntityGeneratorManager.GetTypeByNativeTypes(type).Name, + Value = it.ValueType == WhereValueType.Value ? it.Value : null, + FieldOperator = Enum.Parse(it.WhereType), + DefaultValue = it.ValueType == WhereValueType.Value ? it.Value : null, + Description = json.Columns.FirstOrDefault(s => s.PropertyName == it.PropertyName)?.DbColumnName, + ValueIsReadOnly = it.ValueType == WhereValueType.Value ? true : false + }); + var currentParameter = zeroInterfaceList.DataModel!.DefaultParameters.Last(); + if (it.ValueType == WhereValueType.ClaimKey) + { + currentParameter.Value = it.Value; + currentParameter.ValueType = PubConst.Orm_WhereValueTypeClaimKey; + currentParameter.ValueIsReadOnly = true; + } + } + + private void AddMergeWhereItem(ZeroInterfaceList zeroInterfaceList, CommonQueryWhere it, CommonConfig json) + { + InitItem(zeroInterfaceList); + + var left= it.PropertyName!.Split(" AS ")[0]; + var joinClassName = left.Split(".").First().Trim(); + var joinPropertyName = left.Split(".").Last().Trim(); + var asName = it.PropertyName!.Split(" AS ")[1]; + var joinEntity = App.Db.Queryable().Includes(it=>it.ZeroEntityColumnInfos).Where(it => it.ClassName == joinClassName).First(); + var entityColumns= joinEntity.ZeroEntityColumnInfos; + var type = entityColumns.FirstOrDefault(x => x.PropertyName == joinPropertyName).PropertyType; + var item = new DataModelDefaultParameter() + { + Id = it.Id, + Name = asName, + ValueType = EntityGeneratorManager.GetTypeByNativeTypes(type).Name, + Value = it.ValueType == WhereValueType.Value ? it.Value : null, + FieldOperator = Enum.Parse(it.WhereType), + DefaultValue = it.ValueType == WhereValueType.Value ? it.Value : null, + Description = asName, + ValueIsReadOnly = it.ValueType == WhereValueType.Value ? true : false, + IsMergeWhere=true + }; + zeroInterfaceList!.DataModel!.MergeDefaultParameters!.Add(item); + + var currentParameter = zeroInterfaceList.DataModel!.MergeDefaultParameters.Last(); + if (it.ValueType == WhereValueType.ClaimKey) + { + currentParameter.Value = it.Value; + currentParameter.ValueType = PubConst.Orm_WhereValueTypeClaimKey; + currentParameter.ValueIsReadOnly = true; + } + zeroInterfaceList!.DataModel!.DefaultParameters!.Add(item); + } + + private void InitItem(ZeroInterfaceList zeroInterfaceList) + { + if (zeroInterfaceList.DataModel!.MergeDefaultParameters == null) + { + zeroInterfaceList.DataModel!.MergeDefaultParameters = new List(); + } + } + private bool IsMergeWhere(CommonQueryWhere it) + { + return it.PropertyName!.Contains(" AS ") && it.PropertyName.Contains("."); + } + + private static bool IsWhere(CommonConfig json) + { + return json.Where?.Any() == true; + } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryCommon/SaveInterfaceListQueryCommon.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryCommon/SaveInterfaceListQueryCommon.cs new file mode 100644 index 0000000..aed786d --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryCommon/SaveInterfaceListQueryCommon.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.AccessControl; +using System.Text; +using Newtonsoft.Json; +using SqlSugar; +using SqlSugar.Extensions; +namespace ReZero.SuperAPI +{ + public partial class SaveInterfaceListQueryCommon : BaseSaveInterfaceList, ISaveInterfaceList + { + public ZeroEntityInfo? zeroEntityInfo { get; set; } + public bool isPage { get; set; } + public object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + ZeroInterfaceList zeroInterfaceList = new ZeroInterfaceList(); + SetCommonProperties(zeroInterfaceList, saveInterfaceListModel); + SetCurrentClassField(zeroInterfaceList, saveInterfaceListModel); + SetChildObject(zeroInterfaceList); + SetPage(saveInterfaceListModel, zeroInterfaceList); + SetColumns(saveInterfaceListModel, zeroInterfaceList); + SetOrderBy(saveInterfaceListModel, zeroInterfaceList); + SetWhere(saveInterfaceListModel, zeroInterfaceList); + return SaveData(zeroInterfaceList); + } + + + private void SetCurrentClassField(ZeroInterfaceList zeroInterfaceList, SaveInterfaceListModel saveInterfaceListModel) + { + var tableId=Convert.ToInt64( zeroInterfaceList.DataModel!.TableId); + var db = App.Db; + this.zeroEntityInfo = db.Queryable() + .Includes(it => it.ZeroEntityColumnInfos).Where(it=>it.Id==tableId).First(); + this.isPage = saveInterfaceListModel?.PageSize == true; + } + + private static void SetChildObject(ZeroInterfaceList zeroInterfaceList) + { + zeroInterfaceList.DataModel!.DefaultParameters = zeroInterfaceList.DataModel.DefaultParameters ?? new List(); + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryTree.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryTree.cs new file mode 100644 index 0000000..5e1455b --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListQueryTree.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Newtonsoft.Json; + +namespace ReZero.SuperAPI +{ + public class SaveInterfaceListQueryTree : BaseSaveInterfaceList, ISaveInterfaceList + { + public object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + ZeroInterfaceList zeroInterfaceList = new ZeroInterfaceList(); + base.SetCommonProperties(zeroInterfaceList, saveInterfaceListModel); + this.SetProperties(zeroInterfaceList, saveInterfaceListModel); + var commonQuery = new SaveInterfaceListQueryCommon(); + commonQuery.zeroEntityInfo =App.Db.Queryable().Includes(it=>it.ZeroEntityColumnInfos).InSingle(zeroInterfaceList.DataModel!.TableId) ; + commonQuery.SetWhere(saveInterfaceListModel, zeroInterfaceList); + return base.SaveData(zeroInterfaceList); + } + private void SetProperties(ZeroInterfaceList zeroInterfaceList, SaveInterfaceListModel saveInterfaceListModel) + { + zeroInterfaceList.DataModel!.TreeParameter=new DataModelTreeParameter() + { + ChildPropertyName="Children", + CodePropertyName = saveInterfaceListModel.TreeCode, + ParentCodePropertyName=saveInterfaceListModel.TreeParentCode, + RootValue =saveInterfaceListModel.TreeRootParentValue + }; + zeroInterfaceList.DataModel!.DefaultParameters = new List() + { + new DataModelDefaultParameter(){ + FieldOperator=FieldOperatorType.Equal, + Name="RootPk", + ValueType=typeof(string).Name, + Description=TextHandler.GetCommonText("根目录主键", "Root primary key") + } + }; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListSqlScript.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListSqlScript.cs new file mode 100644 index 0000000..0f426b5 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListSqlScript.cs @@ -0,0 +1,129 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using SqlSugar; + +namespace ReZero.SuperAPI +{ + public class SaveInterfaceListSqlScript : BaseSaveInterfaceList, ISaveInterfaceList + { + public object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + ZeroInterfaceList zeroInterfaceList = new ZeroInterfaceList(); + this.SetCommonProperties(zeroInterfaceList, saveInterfaceListModel); + this.SetGroupName(zeroInterfaceList); + this.SetDataModel(saveInterfaceListModel, zeroInterfaceList); + this.SetParameters(zeroInterfaceList); + return base.SaveData(zeroInterfaceList); + } + + private void SetParameters(ZeroInterfaceList zeroInterfaceList) + { + zeroInterfaceList!.DataModel!.DefaultParameters = new List(); + // 定义正则表达式 + Regex regex = new Regex(@"{(?\w+):(?\w+)}"); + var replaceKey =PubConst.Common_RegexWKey; + var keyword = PubConst.Common_ArrayKey; + var sqlQuery = zeroInterfaceList!.DataModel.Sql!.Replace(keyword, replaceKey) +string.Empty; + // 匹配所有的 {type:name} 格式 + MatchCollection matches = regex.Matches(sqlQuery); + + // 循环替换匹配的内容 + foreach (Match match in matches.GroupBy(it => it.Groups["name"]+"").Select(it=>it.First()).ToList()) + { + string type = match.Groups["type"].Value; + string name = match.Groups["name"].Value; + string replacement = "@" + name; + if (type?.Contains(replaceKey) == true) + { + type = type?.Replace(replaceKey, string.Empty) + keyword; + } + sqlQuery = sqlQuery.Replace(match.Value, replacement); + zeroInterfaceList!.DataModel!.DefaultParameters.Add(new DataModelDefaultParameter() { + ValueIsReadOnly=false, + Name=name, + ValueType=type + }); + if (type?.ToLower() == PubConst.Orm_ClaimkeyName) + { + var currentParameter=zeroInterfaceList!.DataModel!.DefaultParameters.Last(); + currentParameter.Value =null; + currentParameter.ValueType = PubConst.Orm_WhereValueTypeClaimKey; + currentParameter.ValueIsReadOnly = true; + } + } + zeroInterfaceList!.DataModel.Sql = sqlQuery.Replace(replaceKey, keyword); + } + + private void SetDataModel(SaveInterfaceListModel saveInterfaceListModel, ZeroInterfaceList zeroInterfaceList) + { + zeroInterfaceList.DataModel!.DataBaseId = saveInterfaceListModel!.Json!.DataBaseId ?? 0; + zeroInterfaceList.DataModel.ActionType = ActionType.SqlScript; + zeroInterfaceList.DataModel.Sql = saveInterfaceListModel.Sql; + zeroInterfaceList.DataModel.ResultType = saveInterfaceListModel?.ResultType; + } + + private void SetGroupName(ZeroInterfaceList zeroInterfaceList) + { + if (string.IsNullOrEmpty(zeroInterfaceList.GroupName)) + { + zeroInterfaceList.GroupName = "Sql"; + } + } + + protected override void SetCommonProperties(ZeroInterfaceList zeroInterfaceList, SaveInterfaceListModel saveInterfaceListModel) + { + // Set default values for ZeroInterfaceList + zeroInterfaceList.IsInitialized = false; + zeroInterfaceList.IsDeleted = false; + zeroInterfaceList.Name = saveInterfaceListModel.Name; + zeroInterfaceList.Url = base.GetUrl(saveInterfaceListModel).Replace("//","/"); + zeroInterfaceList.DatabaseId = saveInterfaceListModel?.Json?.DataBaseId; + zeroInterfaceList.IsAttributeMethod = false; + zeroInterfaceList.GroupName = !string.IsNullOrEmpty(saveInterfaceListModel?.GroupName) ? saveInterfaceListModel?.GroupName! : saveInterfaceListModel?.TableId!; + zeroInterfaceList.InterfaceCategoryId = Convert.ToInt64(saveInterfaceListModel?.InterfaceCategoryId); + + // Set creator information + var options = SuperAPIModule._apiOptions; + var userInfo = options?.DatabaseOptions!.GetCurrentUserCallback(); + zeroInterfaceList.Creator = userInfo?.UserName; + zeroInterfaceList.CreateTime = DateTime.Now; + + // Set default HttpMethod if not specified + if (zeroInterfaceList.HttpMethod == null) + { + zeroInterfaceList.HttpMethod = HttpRequestMethod.All.ToString(); + } + + //primary key + zeroInterfaceList.Id = saveInterfaceListModel!.Json?.Id ?? 0; + + if (zeroInterfaceList.DataModel == null) + { + zeroInterfaceList.DataModel = new DataModel(); + } + //update info + SetCurrentData(zeroInterfaceList.DataModel!, saveInterfaceListModel); + + } + private void SetProperties(ZeroInterfaceList zeroInterfaceList, SaveInterfaceListModel saveInterfaceListModel) + { + var entityInfo = base.GetEntityInfo(zeroInterfaceList!.DataModel!.TableId!); + var pk = entityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey); + base.Check(pk); + zeroInterfaceList.DataModel.DefaultParameters = new List() + { + new DataModelDefaultParameter(){ + FieldOperator=FieldOperatorType.Equal, + Name=pk.PropertyName, + ParameterValidate=new ParameterValidate(){ IsRequired=true }, + Description=pk.ColumnDescription, + ValueType=pk.UnderType.Name + } + }; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListUpdateObject.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListUpdateObject.cs new file mode 100644 index 0000000..49868cf --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListUpdateObject.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Newtonsoft.Json; + +namespace ReZero.SuperAPI +{ + public class SaveInterfaceListUpdateObject : BaseSaveInterfaceList, ISaveInterfaceList + { + public object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + ZeroInterfaceList zeroInterfaceList = new ZeroInterfaceList(); + base.SetCommonProperties(zeroInterfaceList, saveInterfaceListModel); + this.SetProperties(zeroInterfaceList, saveInterfaceListModel); + base.ApplyDefaultAndClearIfNotEmpty(zeroInterfaceList); + return base.SaveData(zeroInterfaceList); + } + private void SetProperties(ZeroInterfaceList zeroInterfaceList, SaveInterfaceListModel saveInterfaceListModel) + { + var entityInfo = base.GetEntityInfo(zeroInterfaceList!.DataModel!.TableId!); + zeroInterfaceList.DataModel.DefaultParameters = new List(); + foreach (var item in entityInfo.Columns.Where(it =>it.IsOnlyIgnoreUpdate == false&&it.IsIgnore==false)) + { + zeroInterfaceList.DataModel.DefaultParameters.Add(new DataModelDefaultParameter() + { + FieldOperator = FieldOperatorType.Equal, + Name = item.PropertyName, + ParameterValidate = item.IsNullable ? null : new ParameterValidate() { IsRequired = true }, + Description = item.ColumnDescription, + ValueType = item.UnderType.Name + }); + } + zeroInterfaceList.DataModel.DefaultValueColumns = saveInterfaceListModel.Json?.DefaultValueColumns; + zeroInterfaceList.DataModel.ResultType = saveInterfaceListModel?.ResultType; + zeroInterfaceList.DataModel.TableColumns = saveInterfaceListModel?.TableColumns; + if (!string.IsNullOrEmpty(zeroInterfaceList?.DataModel?.TableColumns??null)) + { + var cols = entityInfo.Columns.Where(it => it.IsPrimarykey || it.IsIdentity).Select(it=>it.PropertyName).ToList(); + cols.AddRange(zeroInterfaceList?.DataModel?.TableColumns?.Split(',')); + zeroInterfaceList!.DataModel.DefaultParameters = + zeroInterfaceList.DataModel.DefaultParameters.Where(it => cols.Contains(it.Name!)|| cols.Contains(it.PropertyName!)).ToList(); + } + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListUpdateRange.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListUpdateRange.cs new file mode 100644 index 0000000..a922ed5 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/Items/SaveInterfaceListUpdateRange.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using SqlSugar; + +namespace ReZero.SuperAPI +{ + public class SaveInterfaceListUpdateRange : BaseSaveInterfaceList, ISaveInterfaceList + { + public object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + ZeroInterfaceList zeroInterfaceList = new ZeroInterfaceList(); + base.SetCommonProperties(zeroInterfaceList, saveInterfaceListModel); + this.SetProperties(zeroInterfaceList, saveInterfaceListModel); + base.ApplyDefaultAndClearIfNotEmpty(zeroInterfaceList); + return base.SaveData(zeroInterfaceList); + } + private void SetProperties(ZeroInterfaceList zeroInterfaceList, SaveInterfaceListModel saveInterfaceListModel) + { + var entityInfo = base.GetEntityInfo(zeroInterfaceList!.DataModel!.TableId!); + var listType = typeof(List<>).MakeGenericType(entityInfo.Type); + var listInstance = (IList)Activator.CreateInstance(listType); + listInstance.Add(Activator.CreateInstance(entityInfo.Type)); + var json = new SerializeService().SerializeObject(listInstance); + zeroInterfaceList.DataModel.DefaultParameters = + new List() { + new DataModelDefaultParameter() + { + Value=json, + Name="Data", + ValueType=typeof(JArray).Name, + Description="" + } + }; + zeroInterfaceList.DataModel.DefaultValueColumns = saveInterfaceListModel.Json?.DefaultValueColumns; + zeroInterfaceList.DataModel.ResultType = saveInterfaceListModel?.ResultType; + zeroInterfaceList.DataModel.TableColumns = saveInterfaceListModel?.TableColumns; + //if (!string.IsNullOrEmpty(zeroInterfaceList?.DataModel?.TableColumns??null)) + //{ + // var cols = entityInfo.Columns.Where(it => it.IsPrimarykey || it.IsIdentity).Select(it=>it.PropertyName).ToList(); + // cols.AddRange(zeroInterfaceList?.DataModel?.TableColumns?.Split(',')); + // zeroInterfaceList!.DataModel.DefaultParameters = + // zeroInterfaceList.DataModel.DefaultParameters.Where(it => cols.Contains(it.Name!)|| cols.Contains(it.PropertyName!)).ToList(); + //} + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/MethodApi_SaveInterfaceList.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/MethodApi_SaveInterfaceList.cs new file mode 100644 index 0000000..3fd7332 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSaveInterfaceList/MethodApi_SaveInterfaceList.cs @@ -0,0 +1,29 @@ +using Newtonsoft.Json.Linq; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class MethodApi + { + public object SaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + var db = App.Db; + ISaveInterfaceList saveInterfaceList = GetSaveInterfaceList(saveInterfaceListModel); + var result= saveInterfaceList.SaveInterfaceList(saveInterfaceListModel); + CacheManager.Instance.ClearCache(); + return result; + } + + private static ISaveInterfaceList GetSaveInterfaceList(SaveInterfaceListModel saveInterfaceListModel) + { + var fullName= InstanceManager.GetSaveInterfaceType(saveInterfaceListModel.ActionType!.Value); + var type=Type.GetType(fullName); + return (ISaveInterfaceList)Activator.CreateInstance(type); + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSynchronousData.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSynchronousData.cs new file mode 100644 index 0000000..20c3e72 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodApiSynchronousData.cs @@ -0,0 +1,74 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class MethodApi + { + private long _targetDb; + public bool SynchronousData(long originalDb, long targetDb, bool? isBak) + { + _targetDb = targetDb; + var odb = App.Db; + var tdb = App.GetDbById(targetDb); + if (!tdb!.Ado.IsValidConnection()) + { + new Exception(TextHandler.GetCommonText("目标数据库连接失败", "The target database connection failed")); + } + tdb!.CurrentConnectionConfig.MoreSettings=odb.CurrentConnectionConfig.MoreSettings; + tdb!.CurrentConnectionConfig.ConfigureExternalServices = odb.CurrentConnectionConfig.ConfigureExternalServices; + try + { + tdb!.CodeFirst.InitTables(typeof(ZeroEntityInfo), + typeof(ZeroEntityColumnInfo), + typeof(ZeroInterfaceCategory), + typeof(ZeroInterfaceList), + typeof(ZeroDatabaseInfo), + typeof(ZeroUserInfo)); + tdb!.BeginTran(); + var randomNum =Convert.ToInt32( DateTime.Now.ToString("HHmmss")); + SynchronousTable(odb, tdb, isBak, randomNum); + SynchronousTable(odb, tdb, isBak, randomNum); + SynchronousTable(odb, tdb, isBak, randomNum); + SynchronousTable(odb, tdb, isBak, randomNum); + SynchronousTable(odb, tdb, isBak, randomNum); + SynchronousTable(odb, tdb, isBak, randomNum); + var tIno = odb.Queryable().First(it => it.Id == targetDb); + tdb.Updateable() + .SetColumns(it => new ZeroDatabaseInfo + { + DbType = tIno.DbType, + Connection = tIno.Connection, + EasyDescription = tIno.EasyDescription, + }) + .Where(it => it.Id == 1).ExecuteCommand(); + tdb.Deleteable().Where(it => it.Id == targetDb).ExecuteCommand(); + tdb.CommitTran(); + } + catch (Exception) + { + tdb!.CommitTran(); + throw; + } + return true; + } + + private void SynchronousTable(ISqlSugarClient? odb, SqlSugar.SqlSugarClient? tdb, bool? isBak, int randomNum) where T : class, new() + { + + var tTableName = tdb!.EntityMaintenance.GetTableName(); + var newtTableName = tTableName.ToLower().Replace("zero_","_bak_") + randomNum; + var oldList = odb!.Queryable().ToList(); + if (isBak == true) + { + tdb!.CodeFirst.As(newtTableName).InitTables(); + tdb.DbMaintenance.TruncateTable(newtTableName); + tdb.Insertable(oldList).AS(newtTableName).ExecuteCommand(); + } + tdb.DbMaintenance.TruncateTable(); + tdb.Insertable(oldList).ExecuteCommand(); + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodSetting.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodSetting.cs new file mode 100644 index 0000000..6fbf986 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/MethodSetting.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class MethodApi + { + public bool UpdateSetting(int typeId,int childTypeId,string value) + { + var db = App.Db; + if (typeId == PubConst.Setting_EntityType && childTypeId == PubConst.Setting_ImportUnunderlineType) + { + var newValue = Convert.ToBoolean(value?.ToLower()); + db.Updateable() + .SetColumns(it => it.BoolValue == newValue) + .Where(it => it.TypeId == PubConst.Setting_EntityType) + .Where(it => it.ChildTypeId == PubConst.Setting_ImportUnunderlineType) + .ExecuteCommand(); + } + return true; + } + public object GetSetting(int typeId, int childTypeId) + { + var db = App.Db; + var result = db.Queryable() + .Where(it => it.TypeId == typeId) + .Where(it => it.ChildTypeId == childTypeId).First(); + return result; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/Template/DirectoryHelper.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/Template/DirectoryHelper.cs new file mode 100644 index 0000000..6c4f4d8 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/Template/DirectoryHelper.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; + +namespace ReZero.SuperAPI +{ + public class DirectoryHelper + { + public static string FindParentDirectoryWithSlnFile(string startDirectory) + { + if (string.IsNullOrWhiteSpace(startDirectory) || !Directory.Exists(startDirectory)) + { + throw new ArgumentException("Invalid start directory.", nameof(startDirectory)); + } + + return FindParentDirectoryWithSlnFileRecursive(startDirectory); + } + + private static string FindParentDirectoryWithSlnFileRecursive(string currentDirectory) + { + // 检查当前目录中的文件 + var files = Directory.GetFiles(currentDirectory, "*.sln"); + if (files.Length > 0) + { + // 找到.sln文件,返回当前目录 + return currentDirectory; + } + + // 如果没有找到,则检查上一级目录 + var parentDirectory = Directory.GetParent(currentDirectory)?.FullName; + if (parentDirectory == null) + { + // 如果没有上一级目录(即已经是根目录),则返回null + return null; + } + + // 递归调用自身,检查上一级目录 + return FindParentDirectoryWithSlnFileRecursive(parentDirectory); + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/Template/ExecTemplate.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/Template/ExecTemplate.cs new file mode 100644 index 0000000..3a55a66 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/Template/ExecTemplate.cs @@ -0,0 +1,294 @@ +using DocumentFormat.OpenXml.Spreadsheet; +using ReZero.Common; +using ReZero.Excel; +using ReZero.TextTemplate; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlTypes; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; + +namespace ReZero.SuperAPI +{ + public partial class MethodApi + { + #region ExecTemplateByTableIds + /// + /// Execute template generation for multiple tables. + /// + /// The ID of the database. + /// The IDs of the tables. + /// The ID of the template. + /// The URL of the output file. + /// The directory path of the generated files. + public string ExecTemplateByTableIds(long databaseId, long[] tableIds, long templateId, string url,string viewName) + { + if (IsView(viewName)) + { + return ExecTemplateByView(databaseId, viewName, templateId, url); + } + List datatables = new List(); + var db = App.Db; + List datas = GetZeroEntities(databaseId, tableIds, db); + var template = App.Db.Queryable().First(it => it.Id == templateId); + var outUrl = string.Empty; + foreach (var item in datas) + { + outUrl = CreateFile(databaseId, template, item, url); + } + var result = Directory.GetParent(outUrl).FullName; + return result; + } + + private string ExecTemplateByView(long databaseId, string viewName, long templateId, string url) + { + var db = App.Db; + var template = App.Db.Queryable().First(it => it.Id == templateId); + var item = new ZeroEntityInfo(); + var viewDb = App.GetDbById(databaseId); + var dt=viewDb!.Queryable().AS(viewName).Take(1).Select("*").ToDataTable(); + item.ClassName = viewName; + item.DbTableName = viewName; + item.Description = string.Empty; + item.ZeroEntityColumnInfos = new List(); + foreach (DataColumn dataColumn in dt.Columns) + { + item.ZeroEntityColumnInfos.Add(new ZeroEntityColumnInfo() + { + PropertyName=dataColumn.ColumnName, + DbColumnName=dataColumn.ColumnName, + DataType=dataColumn.DataType.Name, + PropertyType=EntityGeneratorManager.GetNativeTypeByType(dataColumn.DataType) + }); + } + var outUrl = CreateFile(databaseId, template, item, url); + var result = Directory.GetParent(outUrl).FullName; + return result; + } + + private static bool IsView(string viewName) + { + return !string.IsNullOrEmpty(viewName); + } + + /// + /// Create a file based on the template and entity information. + /// + /// The ID of the database. + /// The template to use. + /// The entity information. + /// The URL of the output file. + /// The URL of the created file. + private string CreateFile(long databaseId, ZeroTemplate template, ZeroEntityInfo item, string url) + { + var classString = GetClassString(databaseId, template, item, out TemplateEntitiesGen templateEntitiesGen); + url = GetUrl(url, templateEntitiesGen); + if (url.Contains(PubConst.Common_Project)) + { + var baseDir = AppContext.BaseDirectory; + var findDir = DirectoryHelper.FindParentDirectoryWithSlnFile(baseDir); + if (!string.IsNullOrEmpty(findDir)) + { + url = Regex.Replace(url, PubConst.Common_ProjectRegex, string.Empty, RegexOptions.IgnoreCase).TrimStart('/').TrimStart('\\'); + url = Path.Combine(findDir, url); + } + else + { + throw new Exception(TextHandler.GetCommonText("没有找到 项目sln文件,可以使完整物理路径", "No project sln file found that can make the full physical path")); + } + } + FileSugar.CreateFileReplace(url, classString, Encoding.UTF8); + return url; + } + + /// + /// Get the class string based on the template and entity information. + /// + /// The ID of the database. + /// The template to use. + /// The entity information. + /// The generated template entities. + /// The class string. + private string GetClassString(long databaseId, ZeroTemplate template, ZeroEntityInfo item, out TemplateEntitiesGen templateEntitiesGen) + { + var propertyGens = new List(); + templateEntitiesGen = new TemplateEntitiesGen() + { + ClassName = item.ClassName, + Description = item.Description, + TableName = item.DbTableName, + PropertyGens = propertyGens + }; + var columnInfos = App.GetDbById(databaseId)!.DbMaintenance.GetColumnInfosByTableName(item.DbTableName, false); + foreach (var zeroEntityColumn in item.ZeroEntityColumnInfos!) + { + AddProperty(propertyGens, columnInfos, zeroEntityColumn); + } + var classString = ExecTemplate(TemplateType.Entity, new SerializeService().SerializeObject(templateEntitiesGen), template.TemplateContent!); + return classString; + } + + /// + /// Add a property to the property list based on the entity column information. + /// + /// The list of property generators. + /// The list of column information. + /// The entity column information. + private static void AddProperty(List propertyGens, List columnInfos, ZeroEntityColumnInfo zeroEntityColumn) + { + var dbColumn = columnInfos.FirstOrDefault(it => it.DbColumnName!.EqualsCase(zeroEntityColumn.DbColumnName!)); + TemplatePropertyGen templatePropertyGen = new TemplatePropertyGen() + { + DbColumnName = zeroEntityColumn.DbColumnName, + DbType = zeroEntityColumn.DataType, + DecimalDigits = zeroEntityColumn.DecimalDigits, + DefaultValue = string.Empty, + Description = zeroEntityColumn.Description?.Replace(Environment.NewLine,PubConst.Common_BlankSpace)?.Replace(PubConst.Common_N, PubConst.Common_BlankSpace)?.Replace(PubConst.Common_R, PubConst.Common_BlankSpace), + IsIdentity = zeroEntityColumn.IsIdentity, + IsNullable = zeroEntityColumn.IsNullable, + IsPrimaryKey = zeroEntityColumn.IsPrimarykey, + PropertyName = zeroEntityColumn.PropertyName, + PropertyType = EntityGeneratorManager.GetTypeByNativeTypes(zeroEntityColumn.PropertyType).Name, + IsJson = zeroEntityColumn.IsJson, + IsIgnore = zeroEntityColumn.PropertyType == NativeType.IsIgnore + }; + ProcessingPropertyDefault(zeroEntityColumn, templatePropertyGen); + ProcessingPropertyByDbColumn(dbColumn, templatePropertyGen); + propertyGens.Add(templatePropertyGen); + } + + /// + /// Process the property based on the database column information. + /// + /// The database column information. + /// The template property generator. + private static void ProcessingPropertyByDbColumn(SqlSugar.DbColumnInfo dbColumn, TemplatePropertyGen templatePropertyGen) + { + if (dbColumn != null) + { + templatePropertyGen.DbType = string.IsNullOrEmpty(dbColumn.OracleDataType) ? dbColumn.DataType : dbColumn.OracleDataType; + templatePropertyGen.DecimalDigits = dbColumn.DecimalDigits; + templatePropertyGen.Length = dbColumn.Length; + templatePropertyGen.IsNullable = dbColumn.IsNullable; + } + } + + /// + /// Process the default value of the property. + /// + /// The entity column information. + /// The template property generator. + private static void ProcessingPropertyDefault(ZeroEntityColumnInfo zeroEntityColumn, TemplatePropertyGen templatePropertyGen) + { + templatePropertyGen.PropertyType = EntityGeneratorManager.GetNativeTypeName(templatePropertyGen.PropertyType!); + templatePropertyGen.PropertyType = templatePropertyGen.PropertyType + (zeroEntityColumn.IsNullable ? PubConst.Common_Q : string.Empty); + } + + /// + /// Get the URL based on the template entities information. + /// + /// The URL template. + /// The generated template entities. + /// The URL with replaced placeholders. + private static string GetUrl(string url, TemplateEntitiesGen templateEntitiesGen) + { + url = url.Replace(PubConst.Common_Format0, templateEntitiesGen.ClassName).Replace(PubConst.Common_Format1, templateEntitiesGen.TableName); + return url; + } + + /// + /// Get the entity information for the specified database and table IDs. + /// + /// The ID of the database. + /// The IDs of the tables. + /// The SQL Sugar client. + /// The list of entity information. + private static List GetZeroEntities(long databaseId, long[] tableIds, ISqlSugarClient db) + { + return db.Queryable() + .OrderBy(it => it.DbTableName) + .Where(it => it.DataBaseId == databaseId) + .WhereIF(tableIds.Any(), it => tableIds.Contains(it.Id)) + .Includes(it => it.ZeroEntityColumnInfos).ToList(); + } + #endregion + + #region ExecTemplate + /// + /// Execute template generation based on the specified type, data, and template. + /// + /// The type of the template. + /// The data to use for template generation. + /// The template to use. + /// The generated template result. + public string ExecTemplate(TemplateType type, string data, string template) + { + string result = string.Empty; + switch (type) + { + case TemplateType.Entity: + result = ExecTemplateByEntity(data, template); + break; + default: + throw new ArgumentException("Invalid template type."); + } + + return result; + } + + /// + /// Execute template generation based on the entity type. + /// + /// The data to use for template generation. + /// The template to use. + /// The generated template result. + private string ExecTemplateByEntity(string data, string template) + { + var model = new SerializeService().DeserializeObject(data); + var templateModel = new TemplateModel { Model = model }; + var temp = new TextTemplateManager().RenderTemplate(template, templateModel); + return temp.ToString(); + } + #endregion + + #region Helper + + internal string ExecTemplateByViewWithoutCreatingFiles(long databaseId, string viewName,bool isView, long templateId) + { + var db = App.Db; + var template = App.Db.Queryable().First(it => it.Id == templateId); + var item = new ZeroEntityInfo(); + var viewDb = App.GetDbById(databaseId); + string className = string.Empty; + if (isView == false) + { + var data = db.Queryable()!.InSingle(viewName); + viewName = data!.DbTableName!; + className = data!.ClassName!; + } + var dt = viewDb!.Queryable().AS(viewName).Take(1).Select("*").ToDataTable(); + item.ClassName = className==string.Empty? viewName: className; + item.DbTableName = viewName; + item.Description = string.Empty; + item.ZeroEntityColumnInfos = new List(); + foreach (DataColumn dataColumn in dt.Columns) + { + item.ZeroEntityColumnInfos.Add(new ZeroEntityColumnInfo() + { + PropertyName = dataColumn.ColumnName, + DbColumnName = dataColumn.ColumnName, + DataType = dataColumn.DataType.Name, + PropertyType = EntityGeneratorManager.GetNativeTypeByType(dataColumn.DataType) + }); + } + var classString = GetClassString(databaseId, template, item, out _); + return classString; + } + + #endregion + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/Template/GetDefalutTemplate.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/Template/GetDefalutTemplate.cs new file mode 100644 index 0000000..fca0af5 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/Template/GetDefalutTemplate.cs @@ -0,0 +1,30 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class MethodApi + { + public string GetDefalutTemplate(TemplateType type) + { + string result = string.Empty; + switch (type) + { + case TemplateType.Entity: + result =ClassNameDefalutTemplateTemplate(); + break; + default: + throw new ArgumentException("Invalid template type."); + } + + return result; + } + + public string ClassNameDefalutTemplateTemplate() + { + return "using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing SqlSugar;\r\nnamespace Models\r\n{\r\n /// \r\n /// {{(Model.Description+\"\").Replace(\"\\r\",\"\").Replace(\"\\n\",\"\")}}\r\n ///\r\n [SugarTable(\"{{Model.TableName}}\")]\r\n public class {{Model.ClassName}}\r\n {\r\n \r\n <% foreach (var item in Model.PropertyGens) { \r\n \r\n var isPrimaryKey = item.IsPrimaryKey ? \",IsPrimaryKey = true\" : \"\";\r\n var isIdentity = item.IsIdentity ? \",IsIdentity = true\" : \"\"; \r\n var isIgnore=(item.IsIgnore?\",IsIgnore = true\":\"\");\r\n var isJson=item.IsJson?\",IsJson= true\":\"\" ; \r\n var stringValue=item.PropertyType==\"string\"?\"= null!;\":\"\";//C#低版本改模版\r\n %> \r\n /// \r\n /// 备 注:{{item.Description}}\r\n /// 默认值:{{item.DefaultValue}}\r\n ///\r\n [SugarColumn(ColumnName=\"{{item.DbColumnName}}\" {{isPrimaryKey+isIdentity+isIgnore+isJson}}) ]\r\n public {{item.PropertyType}} {{item.PropertyName}} { get; set; } {{stringValue}}\r\n <%} %>\r\n\r\n }\r\n \r\n}"; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/Items/Template/GetTemplateFormatJson.cs b/ReZero/SuperAPI/MethodGeneratorAPI/Items/Template/GetTemplateFormatJson.cs new file mode 100644 index 0000000..e7ea790 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/Items/Template/GetTemplateFormatJson.cs @@ -0,0 +1,66 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public partial class MethodApi + { + public object GetTemplateFormatJson(TemplateType type) + { + object result = new object(); + switch (type) + { + case TemplateType.Entity: + result = GenerateClassNameTemplate(); + break; + default: + throw new ArgumentException("Invalid template type."); + } + + return result; + } + + private object GenerateClassNameTemplate() + { + TemplateEntitiesGen templateEntitiesGen = new TemplateEntitiesGen() + { + ClassName = "ClassName01", + TableName = "TableName01", + Description =TextHandler.GetCommonText( "表备注", "Table description"), + PropertyGens = new List() + { + new TemplatePropertyGen() + { + DbColumnName="Id", + PropertyName="PId", + PropertyType="int", + IsIdentity=true, + IsPrimaryKey=true, + IsNullable=false, + Description=TextHandler.GetCommonText("序号","No") + }, + new TemplatePropertyGen() + { + DbColumnName="Name", + PropertyName="PName", + PropertyType="string", + IsNullable=false, + Description=TextHandler.GetCommonText( "名称","Name") + }, + new TemplatePropertyGen() + { + DbColumnName="Price", + PropertyName="PPrice", + PropertyType="decimal?", + IsNullable=true, + Description=TextHandler.GetCommonText( "价格","Price") + } + } + }; + + return templateEntitiesGen; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/MethodGeneratorAPI.cs b/ReZero/SuperAPI/MethodGeneratorAPI/MethodGeneratorAPI.cs new file mode 100644 index 0000000..1c66c24 --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/MethodGeneratorAPI.cs @@ -0,0 +1,215 @@ +using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + internal class MethodGeneratorAPI : IDataService + { + private ISqlSugarClient db; + public MethodGeneratorAPI() + { + db = App.Db; + } + public async Task ExecuteAction(DataModel dataModel) + { + if (dataModel.MyMethodInfo == null) return null; + + var classType = Type.GetType(dataModel.MyMethodInfo?.MethodClassFullName); + classType = GetTypeByAttribute(dataModel, classType); + var methodInfo = classType.GetMyMethod(dataModel?.MyMethodInfo?.MethodName, dataModel!.MyMethodInfo!.MethodArgsCount); + var classObj = ReZero.DependencyInjection.ActivatorHelper.CreateInstance(classType!, nonPublic: true, (ServiceProvider)dataModel.ServiceProvider!); + object[] parameters = new object[methodInfo.GetParameters().Length]; + var argsTypes = dataModel.MyMethodInfo.ArgsTypes; + parameters = GetParameters(dataModel, methodInfo, parameters, argsTypes); + var unitType = methodInfo.GetCustomAttributes().FirstOrDefault(it => it.GetType().GetInterfaces().Any(s => s == typeof(IUnitOfWork))); + if (unitType != null) + { + var unitObj =(IUnitOfWork)ReZero.DependencyInjection.ActivatorHelper.CreateInstance(unitType!.GetType(), nonPublic: true, (ServiceProvider)dataModel.ServiceProvider!); + unitObj.db = ((ServiceProvider)dataModel.ServiceProvider!).GetRequiredService(); + try + { + unitObj.BeginTran(); + object result = new object(); + result = await ExecuteMethodAsync(methodInfo, classObj, parameters); + unitObj.CommitTran(); + return result; + } + catch (Exception) + { + unitObj.RollbackTran(); + throw; + } + } + else + { + object result = await ExecuteMethodAsync(methodInfo, classObj, parameters); + return result; + } + } + + private object[] GetParameters(DataModel dataModel, MethodInfo methodInfo, object[] parameters, Type[]? argsTypes) + { + if (IsJObject(dataModel, parameters)) + { + FillJObjectParameters(dataModel, methodInfo, parameters, argsTypes); + } + else if (IsSingleModel(dataModel)) + { + parameters = FillSingleModelParameters(dataModel, methodInfo); + } + else + { + FillDefaultParameters(dataModel, methodInfo, parameters, argsTypes); + } + + return parameters; + } + + private static async Task ExecuteMethodAsync(MethodInfo methodInfo, object classObj, object[] parameters) + { + var result = methodInfo.Invoke(classObj, parameters); + if (result is Task) + { + result = await GetTask((Task)result); + } + else + { + result = await Task.FromResult(result); + } + + return result; + } + + private static object[] FillSingleModelParameters(DataModel dataModel, MethodInfo methodInfo) + { + object[] parameters; + var type = methodInfo.GetParameters().First().ParameterType; + var parameterOjb = Activator.CreateInstance(type, nonPublic: true); + foreach (var item in type!.GetProperties()) + { + var p = dataModel.DefaultParameters.First(it => it.Name == item.Name); + p.Value = ConvetEmptyValue(item.PropertyType, p.Value); + if (IsJson(item, p)) + { + item.SetValue(parameterOjb,JsonConvert.DeserializeObject(p.Value + "",item.PropertyType)); + } + else + { + item.SetValue(parameterOjb, UtilMethods.ChangeType2(p.Value, item.PropertyType)); + } + } + parameters = new object[] { parameterOjb }; + return parameters; + } + + private static bool IsJson(PropertyInfo item, DataModelDefaultParameter p) + { + if (item.PropertyType?.FullName?.StartsWith("System.Collections.Generic.List")==true) + { + var value2 = p.Value?.ToString()?.Trim(); + return value2?.StartsWith("[") == true && value2?.EndsWith("]") == true; + } + if (item.PropertyType?.FullName?.StartsWith("System.")==true) + { + return false; + } + var value = p.Value?.ToString()?.Trim(); + return value?.StartsWith("{") == true && value?.EndsWith("}") == true; + } + + private static bool IsSingleModel(DataModel dataModel) + { + return dataModel.MyMethodInfo?.ArgsTypes?.Any(it => typeof(SingleModel) == it) == true; + } + + private static Type? GetTypeByAttribute(DataModel dataModel, Type? classType) + { + if (classType == null) + { + var ass = SuperAPIModule._apiOptions?.DependencyInjectionOptions?.Assemblies; + if (ass?.Any() == true) + { + classType = ass.Select(it => it.GetType(dataModel.MyMethodInfo?.MethodClassFullName)).Where(it => it != null).FirstOrDefault(); + } + } + return classType; + } + + private void FillJObjectParameters(DataModel dataModel, MethodInfo methodInfo, object[] parameters, Type[]? argsTypes) + { + var value = dataModel?.DefaultParameters?.FirstOrDefault()?.Value! + ""; + var type = methodInfo.GetParameters().First().ParameterType; + if (!string.IsNullOrEmpty(value)) + { + parameters[0] = JsonConvert.DeserializeObject(value, type)!; + if (parameters[0] is SaveInterfaceListModel saveInterfaceListModel) + { + saveInterfaceListModel.InterfaceCategoryId =Convert.ToInt64( Convert.ToDouble(saveInterfaceListModel.InterfaceCategoryId)) + ""; + } + } + } + + private static bool IsJObject(DataModel dataModel, object[] parameters) + { + return parameters.Count() == 1 && dataModel.DefaultParameters.First().ValueType == nameof(JObject)&& dataModel.DefaultParameters.First().IsSingleParameter==true; + } + + private static int FillDefaultParameters(DataModel dataModel, MethodInfo methodInfo, object[] parameters, Type[]? argsTypes) + { + var index = 0; + methodInfo.GetParameters().ToList().ForEach((p) => + { + object? value = dataModel?.DefaultParameters?.FirstOrDefault(it => it.Name!.EqualsCase(p.Name)).Value; + if (argsTypes?.Length - 1 >= index) + { + var type = argsTypes![index]; + if (IsObject(value, type)) + { + value = JsonConvert.DeserializeObject(value + "", type); + } + } + try + { + value = ConvetEmptyValue(p.ParameterType, value); + value = UtilMethods.ChangeType2(value, p.ParameterType); + } + catch (Exception) + { + throw new Exception(TextHandler.GetCommonText(p.Name+"参数类型不匹配 "+value, p.Name + " Parameter type does not match " + value)); + } + parameters[p.Position] = value!; + index++; + }); + return index; + } + + private static object? ConvetEmptyValue(Type type, object? value) + { + if (value?.Equals("") == true && type != typeof(string)) + { + value = null; + } + + return value; + } + private static async Task GetTask(Task task) + { + await task.ConfigureAwait(false); // 等待任务完成 + var resultProperty = task.GetType().GetProperty("Result"); + var result = resultProperty.GetValue(task); + return result; + } + private static bool IsObject(object? value, Type type) + { + return (type.IsArray || type.FullName.StartsWith("System.Collections.Generic.List")) && value != null; + } + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/internalapi/InternalApi.cs b/ReZero/SuperAPI/MethodGeneratorAPI/internalapi/InternalApi.cs new file mode 100644 index 0000000..4133dea --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/internalapi/InternalApi.cs @@ -0,0 +1,480 @@ +using DocumentFormat.OpenXml.Spreadsheet; +using DocumentFormat.OpenXml.Vml.Spreadsheet; +using DocumentFormat.OpenXml.Wordprocessing; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Options; +using ReZero.DependencyInjection; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Data; +using System.IO; +using System.Linq; +using System.Net.Sockets; +using System.Security.Cryptography.Xml; +using System.Security.Policy; +using System.Text; +using static Microsoft.CodeAnalysis.CSharp.SyntaxTokenParser; + +namespace ReZero.SuperAPI +{ + [Api(InterfaceCategoryInitializerProvider.Id100003)] + internal class InternalInitApi + { + [DI] + public IHttpContextAccessor? contextAccessor { get; set; } + + #region Setting + [ApiMethod(nameof(InternalInitApi.SaveLoginConfig), GroupName = PubConst.InitApi_SystemCommon, Url = PubConst.InitApi_SystemSaveConfig)] + public bool SaveLoginConfig(bool enable) + { + var db = App.Db; + var sysSetting = db.Queryable().Where(it => it.TypeId == PubConst.Setting_EnableLoginType).First(); + if (sysSetting == null) + sysSetting = new ZeroSysSetting() { Id = SqlSugar.SnowFlakeSingle.Instance.NextId(), TypeId = PubConst.Setting_EnableLoginType }; + sysSetting.BoolValue = enable; + db.Storageable(sysSetting).ExecuteCommand(); + return true; + } + + [ApiMethod(nameof(InternalInitApi.GetLoginConfig), GroupName = PubConst.InitApi_SystemCommon, Url = PubConst.InitApi_SystemGetInitConfig)] + public object GetLoginConfig() + { + var db = App.Db; + var sysSetting = db.Queryable().Where(it => it.TypeId == PubConst.Setting_EnableLoginType).First(); + if (sysSetting == null) return false; + return sysSetting.BoolValue; + } + [ApiMethod(nameof(InternalInitApi.VerifyCode), GroupName = PubConst.InitApi_SystemCommon, Url = PubConst.InitApi_VerifyCode)] + + #endregion + + #region User + public object VerifyCode() + { + var bytes = VerifyCodeSugar.Create(); + var base64String = Convert.ToBase64String(bytes.Item2); + return new { Code = Encryption.Encrypt(bytes.Item1?.ToLower() ?? string.Empty), Src = $"data:image/png;base64,{base64String}" }; + } + [ApiMethod(nameof(InternalInitApi.SaveUser), GroupName = nameof(ZeroUserInfo), Url = PubConst.InitApi_SaveUser)] + public bool SaveUser(ZeroUserInfo zeroUserInfo) + { + var db = App.Db; + if (zeroUserInfo?.Avatar?.StartsWith("data:image/") == true) + { + var avatarBytes = PubMethod.ConvertBase64ToBytes(zeroUserInfo.Avatar); + var imgId = SqlSugar.SnowFlakeSingle.Instance.NextId(); + var avatarDirectory = Path.Combine(AppContext.BaseDirectory, SuperAPIStaticFileMiddleware.GetFilePathByCurrentDirectory(Path.Combine("images", "users"))); + if (!Directory.Exists(avatarDirectory)) + { + Directory.CreateDirectory(avatarDirectory); + } + var avatarPath = Path.Combine(avatarDirectory, $"{imgId}.jpg"); + File.WriteAllBytes(avatarPath, avatarBytes); + zeroUserInfo.Avatar = $"images/users/{imgId}.jpg"; + } + if (zeroUserInfo?.Id == 0) + { + if (string.IsNullOrEmpty(zeroUserInfo.UserName)) + { + throw new Exception(TextHandler.GetCommonText("用户名不能为空", "Username cannot be empty")); + } + if (string.IsNullOrEmpty(zeroUserInfo.Password)) + { + throw new Exception(TextHandler.GetCommonText("密码不能为空", "Password cannot be empty")); + } + if (db.Queryable().Any(it => it.UserName == zeroUserInfo.UserName)) + { + throw new Exception(TextHandler.GetCommonText("用户名已存在", "The user name already exists")); + } + zeroUserInfo.CreateTime = DateTime.Now; + zeroUserInfo.Creator = DataBaseInitializerProvider.UserName; + zeroUserInfo.CreatorId = 1; + zeroUserInfo.Password = Encryption.Encrypt(zeroUserInfo.Password); + zeroUserInfo.Id = SqlSugar.SnowFlakeSingle.Instance.NextId(); + db.Insertable(zeroUserInfo).ExecuteCommand(); + } + else + { + zeroUserInfo!.Password = Encryption.Encrypt(zeroUserInfo.Password!); + zeroUserInfo.Modifier = DataBaseInitializerProvider.UserName; + db.Updateable(zeroUserInfo).IgnoreColumns(true).ExecuteCommand(); + } + return true; + } + [ApiMethod(nameof(InternalInitApi.GetUserById), GroupName = nameof(ZeroUserInfo), Url = PubConst.InitApi_GetUserById)] + public ZeroUserInfo GetUserById(long id) + { + var db = App.Db; + if (id == -1) + { + var userName = DependencyResolver.GetLoggedInUser(); + var userInfo = App.Db.Queryable().Where(it => it.UserName == userName || it.BusinessAccount == userName) + .First(); + return userInfo; + } + return db.Queryable().InSingle(id); + } + [ApiMethod(nameof(InternalInitApi.DeleteUserInfo), GroupName = nameof(ZeroUserInfo), Url = PubConst.InitApi_DeleteUserById)] + public bool DeleteUserInfo(long id) + { + var db = App.Db; + var zeroUser = db.Queryable().InSingle(id); + if (zeroUser == null) return true; + if (zeroUser.IsInitialized || zeroUser.Id == 1) + { + throw new Exception("初始化数据无法删除"); + } + db.Deleteable().In(zeroUser.Id).ExecuteCommand(); + return true; + } + [ApiMethod(nameof(InternalInitApi.GetUserInfo), GroupName = nameof(ZeroUserInfo), Url = PubConst.InitApi_GetCurrentUser)] + public object GetUserInfo() + { + var userName = DependencyResolver.GetLoggedInUser(); + var defaultSrc = "images/users/avatar.jpg"; + var defaultUserName = userName??"ReZero"; + var userInfo = App.Db.Queryable().Where(it => it.UserName == userName || it.BusinessAccount == userName) + .First(); + if (userInfo?.Avatar==string.Empty) + { + userInfo.Avatar = defaultSrc; + } + if (userInfo == null) + { + userInfo = new ZeroUserInfo() + { + Avatar= defaultSrc + }; + } + return new { IsAdmin= userInfo.IsMasterAdmin, UserName = userInfo?.UserName?? defaultUserName, Avatar = userInfo?.Avatar }; + } + [ApiMethod(nameof(InternalInitApi.GetBizUsers), GroupName = nameof(ZeroUserInfo), Url = PubConst.InitApi_GetBizUsers)] + public object GetBizUsers() + { + var db = App.Db; + var options = SuperAPIModule._apiOptions; + var jwt = options?.InterfaceOptions?.Jwt ?? new Configuration.ReZeroJwt(); + var isEnable=options?.InterfaceOptions?.Jwt?.Enable==true; + if (string.IsNullOrEmpty(jwt?.UserTableName)|| string.IsNullOrEmpty(jwt?.PasswordFieldName)|| string.IsNullOrEmpty(jwt?.UserNameFieldName)) + { + throw new Exception(TextHandler.GetCommonText("JWT用户表或者字段未设置", "The JWT user table or field is not set")); + } + try + { + var result = db.Queryable().AS(jwt.UserTableName) + .Select(SelectModel.Create( + new SelectModel() { FieldName = jwt.UserNameFieldName, AsName = "username" } + )).ToList(); + return result; + } + catch (Exception ex) + { + throw new Exception(TextHandler.GetCommonText(ex.Message, ex.Message)); + } + } + #endregion + + #region Entity + [ApiMethod(nameof(InternalInitApi.ExecTemplateByViewWithoutCreatingFiles), GroupName = nameof(ZeroEntityInfo), Url = PubConst.InitApi_ViewTemplate)] + public string ExecTemplateByViewWithoutCreatingFiles(long databaseId,bool isView, string viewName, long templateId) + { + return new MethodApi().ExecTemplateByViewWithoutCreatingFiles(databaseId, viewName, isView, templateId); + } + #endregion + + #region Token + [ApiMethod(nameof(InternalInitApi.AddTokenManage), GroupName = nameof(ZeroJwtTokenManagement), Url = PubConst.InitApi_AddTokenManage)] + public bool AddTokenManage(ZeroJwtTokenManagement zeroJwtTokenManagement) + { + CacheManager.Instance.ClearCache(); + var db = App.Db; + var options = SuperAPIModule._apiOptions; + var jwt = options?.InterfaceOptions?.Jwt ?? new Configuration.ReZeroJwt(); + if (string.IsNullOrEmpty(jwt.UserTableName) || string.IsNullOrEmpty(jwt.PasswordFieldName) || string.IsNullOrEmpty(jwt.UserNameFieldName)) + { + throw new Exception(TextHandler.GetCommonText($"JWT信息没有配置完整表名字段名存在空", $"The JWT information is not fully configured. Table name The field name is empty")); + } + if (string.IsNullOrEmpty(zeroJwtTokenManagement.UserName)) + { + throw new Exception(TextHandler.GetCommonText($"用户名必填", $"User name is required")); + } + if (zeroJwtTokenManagement.Expiration == DateTime.MinValue) + { + throw new Exception(TextHandler.GetCommonText($"使用期限必填", $"The usage period is required")); + } + DataTable dt = new DataTable(); + try + { + dt = db.Queryable() + .AS(jwt.UserTableName) + .Where(jwt.UserNameFieldName, "=", zeroJwtTokenManagement.UserName) + .ToDataTable(); + } + catch (Exception ex) + { + throw ex; + } + if (dt.Rows.Count == 0) + { + throw new Exception(TextHandler.GetCommonText($"JWT用户表没有找到{zeroJwtTokenManagement.UserName}", $" JWT user table not found {zeroJwtTokenManagement.UserName}")); + } + var password = dt.Rows[0][jwt.PasswordFieldName] + ""; + var token = new MethodApi() { TokenExpiration=zeroJwtTokenManagement.Expiration }.GetToken(zeroJwtTokenManagement.UserName!,password); + zeroJwtTokenManagement.CreateTime = DateTime.Now; + zeroJwtTokenManagement.Creator = DataBaseInitializerProvider.UserName; + zeroJwtTokenManagement.Id = SqlSugar.SnowFlakeSingle.Instance.NextId(); + zeroJwtTokenManagement.Token = token; + db.Insertable(zeroJwtTokenManagement).ExecuteCommand(); + return true; + } + [ApiMethod(nameof(InternalInitApi.UpdateTokenManage), GroupName = nameof(ZeroJwtTokenManagement), Url = PubConst.InitApi_UpdateTokenManage)] + public bool UpdateTokenManage(ZeroJwtTokenManagement zeroJwtTokenManagement) + { + CacheManager.Instance.ClearCache(); + var db = App.Db; + zeroJwtTokenManagement.UpdateTime = DateTime.Now; + db.Updateable(zeroJwtTokenManagement) + .UpdateColumns(it => new { it.Description,it.EasyDescription ,it.UpdateTime}).ExecuteCommand(); + return true; + } + [ApiMethod(nameof(InternalInitApi.DeleteTokenManage), GroupName = nameof(ZeroJwtTokenManagement), Url = PubConst.InitApi_DeleteTokenManage)] + public bool DeleteTokenManage(long Id) + { + CacheManager.Instance.ClearCache(); + var db = App.Db; + db.Updateable() + .SetColumns(it => it.IsDeleted == true) + .Where(it => it.Id == Id).ExecuteCommand(); + return true; + } + [ApiMethod(nameof(InternalInitApi.GetZeroJwtTokenManagementById), GroupName = nameof(ZeroJwtTokenManagement), Url = PubConst.InitApi_GetTokenManageById)] + public ZeroJwtTokenManagement GetZeroJwtTokenManagementById(long id) + { + var data = App.Db.Queryable().InSingle(id); + return data; + } + #endregion + + #region Permission + + [ApiMethod(nameof(InternalInitApi.GetPermissionList), GroupName = nameof(ZeroPermissionInfo), Url = PubConst.InitApi_GetPermissionList)] + public object GetPermissionList(int pageNumber,int pageSize,string permissionName,string userName) + { + var db = App.Db; + int count = SetDefaultPageParameters(ref pageNumber, ref pageSize); + var permissions = db.Queryable() + .WhereIF(!string.IsNullOrEmpty(userName), it => SqlFunc.Subqueryable().Where(s => s.PermissionInfoId == it.Id && s.UserName == userName).Any()) + .WhereIF(!string.IsNullOrEmpty(permissionName), it => it.Name!.Contains(permissionName)).ToPageList(pageNumber, pageSize, ref count); + var columns = new List + { + new ResultGridColumn { PropertyName = "Id", ColumnDescription = "权限ID" }, + new ResultGridColumn { PropertyName = "Name", ColumnDescription = "权限名称" }, + new ResultGridColumn { PropertyName = "CreateTime", ColumnDescription = "创建时间"}, + new ResultGridColumn { PropertyName = "Creator", ColumnDescription = "创建者"} + }; + return GetGridDataList(pageNumber, pageSize, count, permissions, columns); + } + private static object GetGridDataList(int pageNumber, int pageSize, int count, List permissions, List columns) + { + return new ResultPageGrid + { + Data = permissions, + Columns = columns, + Page = new ResultPage() + { + TotalCount = count, + PageNumber = pageNumber, + PageSize = pageSize, + TotalPage = (int)Math.Ceiling((double)count / pageSize) + } + }; + } + private static int SetDefaultPageParameters(ref int pageNumber, ref int pageSize) + { + var count = 0; + if (pageNumber == 0) + pageNumber = 1; + if (pageSize == 0) + pageSize = 10; + return count; + } + + [ApiMethod(nameof(InternalInitApi.AddPermission), GroupName = nameof(ZeroPermissionInfo), Url = PubConst.InitApi_AddPermission)] + public bool AddPermission(SavePermissionInfoDetailModel permission) + { + var db = App.Db; + CacheManager.Instance.ClearCache(); + CacheManager.Instance.ClearCache(); + CheckPermissionModel(permission); + // 设置权限基本信息 + permission.Id = SqlSugar.SnowFlakeSingle.Instance.NextId(); + permission.CreateTime = DateTime.Now; + permission.Creator = DataBaseInitializerProvider.UserName; + + // 插入权限信息 + db.Insertable((ZeroPermissionInfo)permission).ExecuteCommand(); + + // 插入权限与接口的映射关系 + if (permission.Items != null && permission.Items.Any()) + { + var mappings = permission.Items + .Where(item => item.Checked && item.ZeroInterfaceList != null) + .SelectMany(item => permission.Users!.Select(user => new ZeroPermissionMapping + { + Id = SqlSugar.SnowFlakeSingle.Instance.NextId(), + PermissionInfoId = permission.Id, + InterfaceId = item.ZeroInterfaceList!.Id, + UserName = user, + CreateTime = DateTime.Now, + Creator = DataBaseInitializerProvider.UserName, + IsInitialized = false + })) + .ToList(); + + if (mappings.Any()) + { + db.Insertable(mappings).ExecuteCommand(); + } + } + + return true; + } + + [ApiMethod(nameof(InternalInitApi.UpdatePermission), GroupName = nameof(ZeroPermissionInfo), Url = PubConst.InitApi_UpdatePermission)] + public bool UpdatePermission(SavePermissionInfoDetailModel permission) + { + CheckPermissionModel(permission); + var db = App.Db; + CacheManager.Instance.ClearCache(); + CacheManager.Instance.ClearCache(); + // 更新权限基本信息 + permission.UpdateTime = DateTime.Now; + db.Updateable((ZeroPermissionInfo)permission) + .IgnoreColumns(it => new { it.CreateTime, it.Creator }) + .ExecuteCommand(); + + // 删除旧的权限映射关系 + db.Deleteable() + .Where(it => it.PermissionInfoId == permission.Id) + .ExecuteCommand(); + + // 插入新的权限映射关系 + if (permission.Items != null && permission.Items.Any()) + { + var mappings = permission.Items + .Where(item => item.Checked && item.ZeroInterfaceList != null) + .SelectMany(item => permission.Users!.Select(user => new ZeroPermissionMapping + { + Id = SqlSugar.SnowFlakeSingle.Instance.NextId(), + PermissionInfoId = permission.Id, + InterfaceId = item.ZeroInterfaceList!.Id, + UserName = user, + CreateTime = DateTime.Now, + Creator = DataBaseInitializerProvider.UserName, + IsInitialized=false + })) + .ToList(); + + if (mappings.Any()) + { + db.Insertable(mappings).ExecuteCommand(); + } + } + + return true; + } + + + private static void CheckPermissionModel(SavePermissionInfoDetailModel permission) + { + if (string.IsNullOrEmpty(permission.Name)) + { + throw new Exception("权限名称不能为空"); + } + if (permission.Users?.Any() != true) + { + throw new Exception("用户不能为空"); + } + } + [ApiMethod(nameof(InternalInitApi.DeletePermission), GroupName = nameof(ZeroPermissionInfo), Url = PubConst.InitApi_DeletePermission)] + public bool DeletePermission(long id) + { + var db = App.Db; + CacheManager.Instance.ClearCache(); + CacheManager.Instance.ClearCache(); + try + { + db.Ado.BeginTran(); + db.Updateable().In(new object[] { id }).SetColumns(it => it.IsDeleted == true).ExecuteCommand(); + var list = db.Queryable().In(id).ToList(); + foreach (var item in list) + { + item.IsDeleted = true; + } + db.Updateable(list).ExecuteCommand(); + db.Ado.CommitTran(); + } + catch (Exception) + { + db.Ado.RollbackTran(); + throw; + } + return true; + } + [ApiMethod(nameof(InternalInitApi.GetSavePermissionModelById), GroupName = nameof(ZeroPermissionInfo), Url = PubConst.InitApi_GetSavePermissionModelById)] + public SavePermissionInfoDetailModel GetSavePermissionModelById(long id) + { + + var db = App.Db; + var result = new SavePermissionInfoDetailModel() { Users = new List() { } }; + if (id > 0) + { + result=db.Queryable().In(id).Select().First(); + } + // 一次性加载分类表到内存 + var categoryMap = db.Queryable() + .ToList() + .ToDictionary(it => it.Id, it => it.Name ?? "未知分类"); + + // 获取所有接口列表 + var interfaces = db.Queryable() + .OrderBy(it => it.SortId) + .OrderBy(it => it.GroupName) + .Where(it => it.IsInitialized == false) + .ToList() + .Select(it => new PermissionInfoInterfaceItem() + { + ZeroInterfaceList = it, + Checked = false, // 默认未选中 + TypeName = categoryMap.ContainsKey(it.InterfaceCategoryId) ? categoryMap[it.InterfaceCategoryId] : "未知分类" // 根据分类 ID 设置 TypeName + }) + .ToList(); + + result.Items = interfaces; + + // 如果 id > 0,设置 Checked 为 true + if (id > 0) + { + // 获取与当前权限关联的接口 ID 列表 + var mappings = db.Queryable() + .Where(it => it.PermissionInfoId == id).ToList(); + var associatedInterfaceIds = mappings + .Select(it => it.InterfaceId) + .ToList(); + + // 设置关联的接口项的 Checked 为 true + foreach (var item in result.Items) + { + if (item.ZeroInterfaceList != null && associatedInterfaceIds.Contains(item.ZeroInterfaceList.Id)) + { + item.Checked = true; + } + } + result.Users = mappings.Select(it => it.UserName).Distinct()!.ToList()!; + } + return result; + } + #endregion + } +} diff --git a/ReZero/SuperAPI/MethodGeneratorAPI/internalapi/PermissionHelper/SavePermissionInfoDetailModel.cs b/ReZero/SuperAPI/MethodGeneratorAPI/internalapi/PermissionHelper/SavePermissionInfoDetailModel.cs new file mode 100644 index 0000000..0a888fd --- /dev/null +++ b/ReZero/SuperAPI/MethodGeneratorAPI/internalapi/PermissionHelper/SavePermissionInfoDetailModel.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class SavePermissionInfoDetailModel: ZeroPermissionInfo + { + public List? Users { get; set; } + + public List? Items { get; set; } + } + public class PermissionInfoInterfaceItem + { + public ZeroInterfaceList? ZeroInterfaceList { get; set; } + public bool Checked { get; set; } + public string? TypeName { get; set; } + } +} diff --git a/ReZero/SuperAPI/ResultService/Entities/DataModelOutPut.cs b/ReZero/SuperAPI/ResultService/Entities/DataModelOutPut.cs new file mode 100644 index 0000000..6e06fbd --- /dev/null +++ b/ReZero/SuperAPI/ResultService/Entities/DataModelOutPut.cs @@ -0,0 +1,14 @@ +using Microsoft.Data.SqlClient.DataClassification; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class DataModelOutPut + { + public DataModelPageParameter? Page { get; set; } + public List? Columns { get; internal set; } + } +} diff --git a/ReZero/SuperAPI/ResultService/Entities/ResultGridColumn.cs b/ReZero/SuperAPI/ResultService/Entities/ResultGridColumn.cs new file mode 100644 index 0000000..b590880 --- /dev/null +++ b/ReZero/SuperAPI/ResultService/Entities/ResultGridColumn.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ResultGridColumn + { + public string? ColumnDescription { get; set; } + public string? PropertyName { get; set; } + } +} diff --git a/ReZero/SuperAPI/ResultService/Entities/ResultPage.cs b/ReZero/SuperAPI/ResultService/Entities/ResultPage.cs new file mode 100644 index 0000000..d13a611 --- /dev/null +++ b/ReZero/SuperAPI/ResultService/Entities/ResultPage.cs @@ -0,0 +1,15 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ResultPage + { + public int PageNumber { get; set; } + public int PageSize { get; set; } + public int TotalCount { get; set; } + public int TotalPage { get; set; } + } +} diff --git a/ReZero/SuperAPI/ResultService/Entities/ResultPageGrid.cs b/ReZero/SuperAPI/ResultService/Entities/ResultPageGrid.cs new file mode 100644 index 0000000..c5870d0 --- /dev/null +++ b/ReZero/SuperAPI/ResultService/Entities/ResultPageGrid.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + + public class ResultPageGrid + { + public object? Data { get; set; } + public IEnumerable? Columns { get; set; } + public ResultPage? Page { get; set; } + } +} diff --git a/ReZero/SuperAPI/ResultService/Items/Grid.cs b/ReZero/SuperAPI/ResultService/Items/Grid.cs new file mode 100644 index 0000000..1098a0a --- /dev/null +++ b/ReZero/SuperAPI/ResultService/Items/Grid.cs @@ -0,0 +1,85 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; +using System.Linq; +using System.Reflection; +namespace ReZero.SuperAPI.Items +{ + public class Grid : IResultService + { + ResultModel? _result; + public object GetResult(object data, ResultModel result) + { + _result = result; + var dataModelOutPut = ((DataModelOutPut?)result.OutPutData); + IEnumerable columns = GetGridColumn(dataModelOutPut); + ResultPage page = GetPage(dataModelOutPut); + if (data is IEnumerable dataList) + { + data = TransformData(dataList, columns); + } + return new ResultPageGrid + { + Data = data, + Columns = columns, + Page = page + }; + } + + private static ResultPage GetPage(DataModelOutPut? dataModelOutPut) + { + return new ResultPage + { + PageNumber = dataModelOutPut!.Page!.PageNumber, + PageSize = dataModelOutPut.Page.PageSize, + TotalCount = dataModelOutPut.Page.TotalCount!.Value, + TotalPage = dataModelOutPut.Page.TotalPage + }; + } + + private static IEnumerable GetGridColumn(DataModelOutPut? dataModelOutPut) + { + return dataModelOutPut!.Columns!.Select(it => new ResultGridColumn + { + PropertyName = it.PropertyName, + ColumnDescription = it.Description + }); + } + private IEnumerable TransformData(IEnumerable dataList, IEnumerable columns) + { + var newData = new List(); + ResultColumnService resultColumnService = new ResultColumnService(); + foreach (var item in dataList) + { + var newItem = new System.Dynamic.ExpandoObject() as IDictionary; + + foreach (var column in columns) + { + var propertyValue = GetPropertyValue(item, column.PropertyName!); + if (IsConvertColumn(column)) + { + var resultColumnModel = _result?.ResultColumnModels?.First(it => it.PropertyName == column.PropertyName); + propertyValue = resultColumnService.GetValue(propertyValue, resultColumnModel); ; + } + newItem[column.PropertyName!] = propertyValue; + } + + newData.Add(newItem); + } + + return newData; + } + + private bool IsConvertColumn(ResultGridColumn column) + { + return _result?.ResultColumnModels?.Any(it => it.PropertyName == column.PropertyName) == true; + } + + private static object GetPropertyValue(object obj, string propertyName) + { + PropertyInfo propertyInfo = obj.GetType().GetProperty(propertyName); + return propertyInfo?.GetValue(obj); + } + } +} diff --git a/ReZero/SuperAPI/ResultService/Items/Group.cs b/ReZero/SuperAPI/ResultService/Items/Group.cs new file mode 100644 index 0000000..c1fc814 --- /dev/null +++ b/ReZero/SuperAPI/ResultService/Items/Group.cs @@ -0,0 +1,40 @@ +using SqlSugar; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Security.Policy; +using System.Text; + +namespace ReZero.SuperAPI.Items +{ + internal class Group: IResultService + { + public object GetResult(object data, ResultModel model) + { + // 检查data是否是可枚举的集合 + if (data is IEnumerable enumerableData) + { + // 使用LINQ的GroupBy方法根据groupName进行分组 + var groupedData = GroupDataByGroupName(enumerableData,model?.GroupName!); + return groupedData; + } + else + { + + // 如果data不是可枚举的集合,可以根据实际情况处理,比如抛出异常或返回原始data + return data; + } + } + + private object GroupDataByGroupName(IEnumerable data, string groupName) + { + // 这里假设data中的元素有一个名为GroupName的属性,你可能需要根据实际情况调整 + var groupedData = data.Cast() + .GroupBy(item => item.GetType().GetProperty(groupName)?.GetValue(item)?.ToString()) + .Select(it=>new {it.Key,Value=it.ToList() }).ToList(); ; + + return groupedData!; + } + } +} diff --git a/ReZero/SuperAPI/ResultService/ResultColumns/ResultColumnService.cs b/ReZero/SuperAPI/ResultService/ResultColumns/ResultColumnService.cs new file mode 100644 index 0000000..7a1643a --- /dev/null +++ b/ReZero/SuperAPI/ResultService/ResultColumns/ResultColumnService.cs @@ -0,0 +1,31 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + internal class ResultColumnService + { + internal object GetValue(object propertyValue, ResultColumnModel? resultColumnModel) + { + switch (resultColumnModel!.ResultColumnType) + { + case ResultColumnType.ConvertDefault: + propertyValue= UtilMethods.ChangeType2(propertyValue, resultColumnModel.ConvertType); + break; + case ResultColumnType.ConvertDefaultTimeString: + if (propertyValue is DateTime) + { + propertyValue = Convert.ToDateTime(propertyValue).ToString("yyyy-MM-dd HH:mm:ss"); + } + break; + } + if (resultColumnModel.ConvertType2 != null) + { + propertyValue=UtilMethods.ChangeType2(propertyValue, resultColumnModel.ConvertType2); + } + return propertyValue; + } + } +} diff --git a/ReZero/SuperAPI/ResultService/ResultService.cs b/ReZero/SuperAPI/ResultService/ResultService.cs new file mode 100644 index 0000000..9e49c4c --- /dev/null +++ b/ReZero/SuperAPI/ResultService/ResultService.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq.Expressions; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class ResultService: IResultService + { + public object GetResult(object data, ResultModel result) + { + if (IsNoConvert(result)) + { + return data; + } + else if (result?.ResultType == ResultType.File) + { + return data; + } + else + { + return GetResultProvider(data, result!); + } + } + + private static object GetResultProvider(object data, ResultModel model) + { + IResultService actionInstance = GetActionInstance(model); + var result = actionInstance.GetResult(data, model!); + return result; + } + + + private static IResultService GetActionInstance(ResultModel model) + { + var actionType = Type.GetType(PubConst.Namespace_ResultService + model?.ResultType); + var actionInstance = (IResultService)Activator.CreateInstance(actionType); + return actionInstance; + } + + private static bool IsNoConvert(ResultModel result) + { + return result == null || result?.ResultType == null; + } + + } +} diff --git a/ReZero/SuperAPI/TextHandler/Attribute/TextAttributes.cs b/ReZero/SuperAPI/TextHandler/Attribute/TextAttributes.cs new file mode 100644 index 0000000..a5b3554 --- /dev/null +++ b/ReZero/SuperAPI/TextHandler/Attribute/TextAttributes.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + /// + /// Represents an attribute for Chinese text. + /// + [AttributeUsage(AttributeTargets.All)] + public class ChineseTextAttribute : Attribute + { + /// + /// Initializes a new instance of the class with the specified text. + /// + /// The Chinese text. + public ChineseTextAttribute(string text) + { + this.Text = text; + } + + /// + /// Gets or sets the Chinese text. + /// + public string? Text { get; set; } + } + + /// + /// Represents an attribute for English text. + /// + [AttributeUsage(AttributeTargets.All)] + public class EnglishTextAttribute : Attribute + { + /// + /// Initializes a new instance of the class with the specified text. + /// + /// The English text. + public EnglishTextAttribute(string text) + { + this.Text = text; + } + + /// + /// Gets or sets the English text. + /// + public string? Text { get; set; } + } + + + + [AttributeUsage(AttributeTargets.All)] + public class TextGroupAttribute : Attribute + { + public string? cnText { get; set; } + public string? enText { get; set; } + + public TextGroupAttribute(string cnText,string enText) + { + this.cnText = cnText; + this.enText = cnText; + } + } +} diff --git a/ReZero/SuperAPI/TextHandler/Enum/Language.cs b/ReZero/SuperAPI/TextHandler/Enum/Language.cs new file mode 100644 index 0000000..9046f7b --- /dev/null +++ b/ReZero/SuperAPI/TextHandler/Enum/Language.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + /// + /// Represents the language options. + /// + public enum Language + { + /// + /// Chinese language. + /// + CN, + + /// + /// English language. + /// + EN + } +} diff --git a/ReZero/SuperAPI/TextHandler/TextHandler.cs b/ReZero/SuperAPI/TextHandler/TextHandler.cs new file mode 100644 index 0000000..5f7a16a --- /dev/null +++ b/ReZero/SuperAPI/TextHandler/TextHandler.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Xml.Serialization; + +namespace ReZero.SuperAPI +{ + internal class TextHandler + { + /// + /// Get the common text based on the language. + /// + /// The Chinese text. + /// The English text. + /// The common text. + public static string GetCommonText(string cn, string en) + { + var language = App.Language; + switch (language) + { + case Language.CN: + return cn; + default: + return en; + } + } + + /// + /// Get the interface category text based on the value. + /// + /// The value. + /// The interface category text. + public static string? GetInterfaceCategoryText(object value) + { + return GetText(typeof(InterfaceCategoryInitializerProvider), value); + } + + /// + /// Get the interface list text based on the value. + /// + /// The value. + /// The interface list text. + public static string? GetInterfaceListText(object value) + { + return GetText(typeof(InterfaceListInitializerProvider), value); + } + + /// + /// Get the text based on the type and value. + /// + /// The type. + /// The value. + /// The text. + public static string? GetText(Type type, object value) + { + var language = App.Language; + var fieldInfo = type.GetFields() + .Where(it => it.GetCustomAttribute() != null) + .Where(it => it.GetValue(null)?.ToString() == value?.ToString()) + .FirstOrDefault(); + switch (language) + { + case Language.CN: + return fieldInfo?.GetCustomAttribute()?.Text; + default: + return fieldInfo?.GetCustomAttribute()?.Text; + } + } + } +} diff --git a/ReZero/SuperAPI/Ui/DefaultUi/DefaultUiManager.cs b/ReZero/SuperAPI/Ui/DefaultUi/DefaultUiManager.cs new file mode 100644 index 0000000..0b2b50f --- /dev/null +++ b/ReZero/SuperAPI/Ui/DefaultUi/DefaultUiManager.cs @@ -0,0 +1,201 @@ +using Microsoft.AspNetCore.Http; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.IO; +using System.Net.Http; +using System.Reflection; +using System.Security.Policy; +using System.Text; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + /// + /// 默认UI使用,如果是Vue前后分离不会使用该类 + /// + public class DefaultUiManager : IUiManager + { + private readonly string masterPagePlaceholder = "@@master_page.html"; + private readonly string index_url = "@@index_url"; + private readonly string masterPageFolder = "template"; + private readonly string masterPageFileName = "master_page.html"; + private readonly string layoutContentPlaceholder = "@@lyear-layout-content"; + private readonly string masterMenuPlaceholder = "@@left-menu"; + private readonly string mastreNavNamePlaceholder = "@@nav-title"; + private readonly string pageControlPlaceholder = "@@page_control.html"; + private readonly string pageControlName = "page_control.html"; + private readonly string authorizationLocalStorageName = "@@authorizationLocalStorageName"; + private readonly string version = "@@version"; + private readonly string pageNumber = "__pageNumber"; + private readonly string pageSize = "__pageSize"; + public DefaultUiManager() + { + } + + /// + /// Replaces the master page placeholder with the actual master page HTML content and replaces the layout content placeholder with the modified file content. + /// + /// The content of the file to modify. + /// The path of the file to modify. + /// The modified file content. + public async Task GetHtmlAsync(string fileContent, string filePath, Microsoft.AspNetCore.Http.HttpContext content) + { + + var url = (content.Request.Path + "" + content.Request.QueryString).ToLower(); + var modifiedContent = fileContent.Replace(masterPagePlaceholder, ""); + var masterPagePath = Path.Combine(Path.GetDirectoryName(filePath), masterPageFolder, masterPageFileName); + var masterPageHtml = await File.ReadAllTextAsync(masterPagePath); + + //menu html + var menuList = await App.Db.Queryable().ToTreeAsync(it => it.SubInterfaceCategories, it => it.ParentId, 0, it => it.Id); + var currentMenu = await App.Db.Queryable().Where(it => it.Url!.ToLower() == url).FirstAsync(); + if (currentMenu == null) + { + if (url.Contains("utorials.html")) + { + currentMenu = await App.Db.Queryable().FirstAsync(it=>it.Id== InterfaceCategoryInitializerProvider.Id300008); + } + else + { + currentMenu = await App.Db.Queryable().FirstAsync(); + } + } + var parentMenu = await App.Db.Queryable().Where(it => it.Id == currentMenu.ParentId).FirstAsync(); + var menuHtml = await GetMenuHtml(menuList, filePath, currentMenu); + + //authorization + masterPageHtml = GetAuthorizationHtml(content,masterPageHtml); + + //Samll page + masterPageHtml = GetSmallPageHtml(content, masterPageHtml); + + //Nav title + masterPageHtml = ReplaceNavTitle(masterPageHtml, currentMenu, parentMenu); + + //Page html + modifiedContent = await ReplacePageContext(filePath, modifiedContent); + + modifiedContent = ReplceIndexSrc(modifiedContent, currentMenu); + + //Body context + masterPageHtml = ReplaceBodyContext(modifiedContent, masterPageHtml, menuHtml); + + //token + masterPageHtml = masterPageHtml.Replace(authorizationLocalStorageName, SuperAPIModule._apiOptions?.InterfaceOptions?.AuthorizationLocalStorageName); + + masterPageHtml = masterPageHtml.Replace(pageNumber, SuperAPIModule._apiOptions?.InterfaceOptions?.PageNumberPropName); + + masterPageHtml = masterPageHtml.Replace(pageSize, SuperAPIModule._apiOptions?.InterfaceOptions?.PageSizePropName); + + //version + masterPageHtml = masterPageHtml.Replace(version, $"{Assembly.GetExecutingAssembly().GetName().Version}"); + return masterPageHtml; + } + + private string GetAuthorizationHtml(HttpContext content, string masterPageHtml) + { + if (!string.IsNullOrEmpty((content.Request.Query["token"] + "").ToString())&& content.Request.Query["token"].ToString()!="null") + { + masterPageHtml = masterPageHtml + .Replace("localStorage.getItem('@@authorizationLocalStorageName')",$"'{content.Request.Query["token"]}'"); + + } + masterPageHtml = masterPageHtml.Replace(authorizationLocalStorageName, SuperAPIModule._apiOptions?.InterfaceOptions?.AuthorizationLocalStorageName); + //var db = App.Db; + //var loginSetting=db.Queryable().First(it => it.TypeId == PubConst.Setting_EnableLoginType); + //if (loginSetting?.BoolValue == true) + //{ + masterPageHtml=masterPageHtml.Replace("tools.checkAuthorization();", "var isloginPage=true;\r\n tools.checkAuthorization();"); + //} + return masterPageHtml; + } + + + public Task GetCustomPageHtmlAsync(string fileContent, string filePath, Microsoft.AspNetCore.Http.HttpContext content) + { + fileContent = fileContent.Replace(authorizationLocalStorageName, SuperAPIModule._apiOptions?.InterfaceOptions?.AuthorizationLocalStorageName); + return Task.FromResult(fileContent); + } + + private static string GetSmallPageHtml(HttpContext content, string masterPageHtml) + { + if ((content.Request.Query["model"] + "").ToString().ToLower() == "small") + { + masterPageHtml = masterPageHtml + .Replace("", "") + .Replace("dropdown dropdown-profile", "dropdown dropdown-profile hide") + .Replace("lyear-aside-toggler", "lyear-aside-toggler hide") + .Replace("@@nav-title", " Rezero云API"); + + } + + return masterPageHtml; + } + + private string ReplceIndexSrc(string modifiedContent, ZeroInterfaceCategory? currentMenu) + { + + if ( + SuperAPIModule._apiOptions!.UiOptions!.DefaultIndexSource!=null&& + !SuperAPIModule._apiOptions!.UiOptions!.DefaultIndexSource!.StartsWith("/")&& + !SuperAPIModule._apiOptions!.UiOptions!.DefaultIndexSource.Contains(":")) + { + SuperAPIModule._apiOptions!.UiOptions!.DefaultIndexSource = "/" + SuperAPIModule._apiOptions!.UiOptions!.DefaultIndexSource; + } + + modifiedContent = modifiedContent.Replace(index_url, SuperAPIModule._apiOptions!.UiOptions!.DefaultIndexSource); + return modifiedContent; + } + + private async Task ReplacePageContext(string filePath,string html) + { + if (html?.Contains(pageControlPlaceholder)==true) + { + var path = Path.Combine(Path.GetDirectoryName(filePath), masterPageFolder, pageControlName); + var pageHtml = await File.ReadAllTextAsync(path); + html= html.Replace(pageControlPlaceholder, pageHtml); + } + return html; + } + + private string ReplaceBodyContext(string modifiedContent, string masterPageHtml, string menuHtml) + { + masterPageHtml = masterPageHtml.Replace(masterMenuPlaceholder, menuHtml); + masterPageHtml = masterPageHtml.Replace(layoutContentPlaceholder, modifiedContent); + return masterPageHtml; + } + + private string ReplaceNavTitle(string masterPageHtml, ZeroInterfaceCategory currentMenu, ZeroInterfaceCategory parentMenu) + { + var navTitle = parentMenu?.Name + "->" + currentMenu.Name; + if (parentMenu == null) + { + navTitle=TextHandler.GetCommonText("详情页","Detail"); + } + masterPageHtml = masterPageHtml.Replace(mastreNavNamePlaceholder, navTitle); + return masterPageHtml; + } + + /// + /// Generates the HTML code for the menu based on the given list of interface categories. + /// + /// The list of interface categories. + /// The HTML code for the menu. + public async Task GetMenuHtml(List categories,string filePath, ZeroInterfaceCategory current) + { + var result= await Task.FromResult(MenuBuilder.GenerateMenu(categories, current)); + return result; + } + + /// + /// Determines whether the given file content contains the master page placeholder. + /// + /// The content of the file to check. + /// True if the file content contains the master page placeholder, otherwise false. + public bool IsMasterPage(string fileContent) + { + return fileContent.Contains(masterPagePlaceholder); + } + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/Ui/DefaultUi/MenuBuilder.cs b/ReZero/SuperAPI/Ui/DefaultUi/MenuBuilder.cs new file mode 100644 index 0000000..f507d5e --- /dev/null +++ b/ReZero/SuperAPI/Ui/DefaultUi/MenuBuilder.cs @@ -0,0 +1,87 @@ +using KdbndpTypes; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class MenuBuilder + { + /// + /// Generate the menu based on the provided tree list and current category. + /// + /// The list of interface categories. + /// The current interface category. + /// The generated menu HTML. + public static string GenerateMenu(List treeList, ZeroInterfaceCategory current) + { + StringBuilder htmlBuilder = new StringBuilder(); + int i = 0; + foreach (var tree in treeList.OrderBy(it=>it.SortId)) + { + var isOpen = IsOpen(current, tree); + var active = isOpen ? " active " : null; + var isHidden = SuperAPIModule._apiOptions?.InterfaceOptions?.Jwt?.Enable==true&&tree.Id>200; + if (tree.SubInterfaceCategories != null && tree.SubInterfaceCategories.Count > 0) + { + if (active != null) + active = $" {active} open "; + if (isHidden) + active = $"hide manager {active}"; + htmlBuilder.AppendLine("
  • "); + htmlBuilder.AppendLine($" {tree.Name}"); + htmlBuilder.AppendLine("
      "); + GenerateSubMenu(tree.SubInterfaceCategories, htmlBuilder, current); + htmlBuilder.AppendLine("
    "); + htmlBuilder.AppendLine("
  • "); + } + else + { + if (isHidden) + active = $"hide manager {active}"; + htmlBuilder.AppendLine("
  • "); + htmlBuilder.AppendLine($" {tree.Name}"); + htmlBuilder.AppendLine("
  • "); + } + ++i; + } + + return htmlBuilder.ToString(); + } + + private static void GenerateSubMenu(List subTreeList, StringBuilder htmlBuilder, ZeroInterfaceCategory current) + { + + foreach (var subTree in subTreeList.OrderBy(it=>it.SortId)) + { + var isOpen = IsOpen(current, subTree); + var active = isOpen ? " active " : ""; + + if (subTree.SubInterfaceCategories != null && subTree.SubInterfaceCategories.Count > 0) + { + htmlBuilder.AppendLine("
  • "); + htmlBuilder.AppendLine($" {subTree.Name}"); + htmlBuilder.AppendLine("
      "); + GenerateSubMenu(subTree.SubInterfaceCategories, htmlBuilder, current); + htmlBuilder.AppendLine("
    "); + htmlBuilder.AppendLine("
  • "); + } + else + { + isOpen = current.Id.ToString().Equals(subTree.Id.ToString()); + active = isOpen ? " active " : ""; + htmlBuilder.AppendLine("
  • "); + htmlBuilder.AppendLine($" {subTree.Name}"); + htmlBuilder.AppendLine("
  • "); + } + } + } + + private static bool IsOpen(ZeroInterfaceCategory current, ZeroInterfaceCategory subTree) + { + return current.ParentId.ToString().Equals(subTree.Id.ToString()) || current.Id == subTree.Id; + } + } +} diff --git a/ReZero/SuperAPI/Ui/IUiManager.cs b/ReZero/SuperAPI/Ui/IUiManager.cs new file mode 100644 index 0000000..9b83b63 --- /dev/null +++ b/ReZero/SuperAPI/Ui/IUiManager.cs @@ -0,0 +1,30 @@ +using System.Net.Http; +using System.Threading.Tasks; + +namespace ReZero.SuperAPI +{ + /// + /// Default UI usage, not applicable for Vue front-end and back-end separation + /// + public interface IUiManager + { + /// + /// Retrieves the HTML content asynchronously. + /// + /// The content of the file. + /// The path of the file. + /// The HTTP context. + /// The HTML content as a string. + Task GetHtmlAsync(string fileContent, string filePath, Microsoft.AspNetCore.Http.HttpContext content); + + Task GetCustomPageHtmlAsync(string fileContent, string filePath, Microsoft.AspNetCore.Http.HttpContext content); + + + /// + /// Checks if the file content represents a master page. + /// + /// The content of the file. + /// True if the file content represents a master page, otherwise false. + bool IsMasterPage(string fileContent); + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/Ui/UIFactory.cs b/ReZero/SuperAPI/Ui/UIFactory.cs new file mode 100644 index 0000000..a7d649d --- /dev/null +++ b/ReZero/SuperAPI/Ui/UIFactory.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + /// + /// Default UI usage, not used for Vue front-end and back-end separation + /// + public class UIFactory + { + // Although this method is not used for VUE, it is retained for compatibility with other users and secondary development + public static IUiManager uiManager = new DefaultUiManager(); + } +} diff --git a/ReZero/SuperAPI/UnitOfWork/IUnitOfWork.cs b/ReZero/SuperAPI/UnitOfWork/IUnitOfWork.cs new file mode 100644 index 0000000..3bd4519 --- /dev/null +++ b/ReZero/SuperAPI/UnitOfWork/IUnitOfWork.cs @@ -0,0 +1,13 @@ +using SqlSugar; + +namespace ReZero.SuperAPI +{ + public interface IUnitOfWork + { + ISqlSugarClient? db { get; set; } + + void BeginTran(); + void CommitTran(); + void RollbackTran(); + } +} \ No newline at end of file diff --git a/ReZero/SuperAPI/UnitOfWork/UnitOfWork.cs b/ReZero/SuperAPI/UnitOfWork/UnitOfWork.cs new file mode 100644 index 0000000..6dee231 --- /dev/null +++ b/ReZero/SuperAPI/UnitOfWork/UnitOfWork.cs @@ -0,0 +1,25 @@ +using ReZero.DependencyInjection; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +namespace ReZero.SuperAPI +{ + public class UnitOfWork : Attribute, IUnitOfWork + { + public ISqlSugarClient? db { get; set; } + public virtual void BeginTran() + { + db!.AsTenant().BeginTran(); + } + public virtual void CommitTran() + { + db!.AsTenant().CommitTran(); ; + } + public virtual void RollbackTran() + { + db!.AsTenant().RollbackTran(); ; + } + } +} diff --git a/ReZero/SuperAPI/Utils/Encryption.cs b/ReZero/SuperAPI/Utils/Encryption.cs new file mode 100644 index 0000000..c5643d5 --- /dev/null +++ b/ReZero/SuperAPI/Utils/Encryption.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Security.Cryptography; +using System.Text; +namespace ReZero.SuperAPI +{ + public class Encryption + { + /// + /// Encrypt the input string using MD5 hashing algorithm. + /// + /// The string to encrypt + /// The encrypted string in hexadecimal format + public static string Encrypt(string input) + { + using (MD5 md5 = MD5.Create()) + { + byte[] inputBytes = Encoding.UTF8.GetBytes(input); + byte[] hashBytes = md5.ComputeHash(inputBytes); + + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < hashBytes.Length; i++) + { + sb.Append(hashBytes[i].ToString("X2")); + } + return sb.ToString().ToLower(); + } + } + } +} + \ No newline at end of file diff --git a/ReZero/SuperAPI/Utils/EnumAttributeExtractor.cs b/ReZero/SuperAPI/Utils/EnumAttributeExtractor.cs new file mode 100644 index 0000000..b684920 --- /dev/null +++ b/ReZero/SuperAPI/Utils/EnumAttributeExtractor.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; + +namespace ReZero.SuperAPI +{ + public static class EnumAttributeExtractor + { + /// + /// Gets the attribute values of the specified enum type. + /// + /// The enum type. + /// A list of EnumAttributeValues. + public static List GetEnumAttributeValues() where T : Enum + { + var values = Enum.GetValues(typeof(T)).Cast().ToList(); + + List attributeValuesList = new List(); + + foreach (var value in values) + { + var enumType = typeof(T); + var fieldInfo = enumType.GetField(value.ToString()); + + var chineseTextAttribute = GetCustomAttribute(fieldInfo); + var englishTextAttribute = GetCustomAttribute(fieldInfo); + var textGroupAttribute = GetCustomAttribute(fieldInfo); + + var attributeValues = new EnumAttributeValues + { + Value=Convert.ToInt64(value), + Text = App.Language == Language.CN ? chineseTextAttribute?.Text:englishTextAttribute?.Text, + TextGroup = App.Language == Language.CN ? textGroupAttribute?.cnText : textGroupAttribute?.enText + }; + + attributeValuesList.Add(attributeValues); + } + + return attributeValuesList; + } + + private static T GetCustomAttribute(FieldInfo fieldInfo) where T : Attribute + { + return (T)Attribute.GetCustomAttribute(fieldInfo, typeof(T)); + } + + /// + /// Represents the values of an enum attribute. + /// + public class EnumAttributeValues + { + /// + /// Gets or sets the Chinese text. + /// + public string? Text { get; set; } + + /// + /// Gets or sets the text group. + /// + public string? TextGroup { get; set; } + /// + /// Enum value + /// + + public long Value { get; set; } + } + } +} diff --git a/ReZero/SuperAPI/Utils/Extensions.cs b/ReZero/SuperAPI/Utils/Extensions.cs new file mode 100644 index 0000000..30aece6 --- /dev/null +++ b/ReZero/SuperAPI/Utils/Extensions.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero +{ + public static class Extensions + { + /// + /// Determines whether two strings are equal, ignoring case. + /// + /// The first string to compare. + /// The second string to compare. + /// True if the strings are equal, ignoring case; otherwise, false. + public static bool EqualsCase(this string a, string b) + { + return a?.ToLower() == b?.ToLower(); + } + + /// + /// Converts the first character of a string to uppercase and the rest to lowercase. + /// + /// The string to convert. + /// The converted string. + public static string FirstCharToUpper(this string input) + { + if (string.IsNullOrEmpty(input)) + return input; + + return char.ToUpper(input[0]) + input.Substring(1).ToLower(); + } + } +} diff --git a/ReZero/SuperAPI/Utils/JsonHelper.cs b/ReZero/SuperAPI/Utils/JsonHelper.cs new file mode 100644 index 0000000..604e58e --- /dev/null +++ b/ReZero/SuperAPI/Utils/JsonHelper.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + + +namespace ReZero.SuperAPI +{ + /// + /// Provides helper methods for JSON serialization and deserialization. + /// + public static class JsonHelper + { + public static readonly JsonSerializerSettings DefaultJsonSerializerSettings = new JsonSerializerSettings + { + Converters = new List { new StringLongConverter() }, + // Other settings... + }; + + /// + /// Serializes an object to a JSON string. + /// + /// The object to serialize. + /// + /// The JSON string representation of the object. + public static string SerializeObject(object obj, JsonSerializerSettings? settings = null) + { + return JsonConvert.SerializeObject(obj, settings ?? DefaultJsonSerializerSettings); + } + } + + /// + /// Converts a string or integer to a long value during JSON serialization and deserialization. + /// + public class StringLongConverter : JsonConverter + { + /// + /// Determines whether this converter can convert the specified object type. + /// + /// The type of the object to convert. + /// true if the converter can convert the specified type; otherwise, false. + public override bool CanConvert(Type objectType) + { + return objectType == typeof(long); + } + + /// + /// Writes the JSON representation of the object. + /// + /// The JSON writer. + /// The value to write. + /// The JSON serializer. + public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer) + { + writer.WriteValue(value?.ToString()); + } + + /// + /// Reads the JSON representation of the object. + /// + /// The JSON reader. + /// The type of the object to convert. + /// The existing value of the object being read. + /// The JSON serializer. + /// The deserialized object. + public override object ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.String) + { + // Parse the value as a long if it is a string in the JSON + if (long.TryParse(reader.Value?.ToString(), out long result)) + { + return result; + } + else + { + throw new JsonSerializationException($"Unable to parse '{reader.Value}' as long."); + } + } + else if (reader.TokenType == JsonToken.Integer) + { + // Convert the value directly to long if it is an integer in the JSON + return Convert.ToInt64(reader.Value); + } + else + { + throw new JsonSerializationException($"Unexpected token type: {reader.TokenType}"); + } + } + } +} diff --git a/ReZero/SuperAPI/Utils/PubConst.cs b/ReZero/SuperAPI/Utils/PubConst.cs new file mode 100644 index 0000000..c363a1b --- /dev/null +++ b/ReZero/SuperAPI/Utils/PubConst.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.SuperAPI +{ + public class PubConst + { + public const string Ui_TreeChild = "TreeChild"; + public const string Ui_TreeUrlFormatId = "{Id}"; + + public const string Orm_SqlFalseString = " 1=2 "; + public const string Orm_TableDefaultPreName = "t"; + public const string Orm_DataBaseNameDTO = "DataBaseName"; + public const string Orm_InterfaceCategroyNameDTO = "InterfaceCategroyName"; + public readonly static string Orm_TableDefaultMasterTableShortName = Orm_TableDefaultPreName + 0; + public const string Orm_ApiParameterJsonArray = "json array"; + public const string Orm_SubqueryKey = "`SqlFunc`.`Key`.['010203']"; + public const string Orm_WhereValueTypeClaimKey = "Orm_WhereValueTypeClaimKey['16125']"; + public const string Orm_ClaimkeyName = "claimkey"; + + public const string Namespace_ResultService = "ReZero.SuperAPI.Items."; + + public readonly static Random Common_Random = new Random(); + public readonly static string Common_BlankSpace = " "; + public readonly static string Common_R = "\r"; + public readonly static string Common_N = "\n"; + public readonly static string Common_Project = "{project}"; + public readonly static string Common_ProjectRegex= @"\{project\}"; + public readonly static string Common_Format0 = "{0}"; + public readonly static string Common_Format1 = "{1}"; + public readonly static string Common_Q = "?"; + public readonly static string Common_ArrayKey = "[]"; + public readonly static string Common_RegexWKey = "_____asfalflsgayfaggugglgfgyydfyiypqombbgjoosbds____"; + + public const string CacheKey_Type = "ReZero_Type_{0}"; + + public const string DataSource_ActionTypeGroupName_QueryCN = "查询"; + public const string DataSource_ActionTypeGroupName_QueryEN = "Query"; + public const string DataSource_ActionTypeGroupName_InsertCN = "插入"; + public const string DataSource_ActionTypeGroupName_InsertEN = "Insert"; + public const string DataSource_ActionTypeGroupName_UpdateCN = "更新"; + public const string DataSource_ActionTypeGroupName_UpdateEN = "Update"; + public const string DataSource_ActionTypeGroupName_DeleteCN = "删除"; + public const string DataSource_ActionTypeGroupName_DeleteEN = "Delete"; + public const string DataSource_ActionTypeGroupName_DDLCN = "库表维护"; + public const string DataSource_ActionTypeGroupName_DDLEN = "DLL"; + public const string DataSource_ActionTypeGroupName_MyMethodCN = "自定义方法"; + public const string DataSource_ActionTypeGroupName_MyMethodEN = "My method"; + public const string DataSource_ApplicationJson = "application/json; charset=utf-8"; + public const string DataSource_ActionTypeGroupName_InsertOrUpdateCN = "插入或更新"; + public const string DataSource_ActionTypeGroupName_InsertOrUpdateEN = "Insert or update"; + + public const string Jwt_TokenUrl = "/api/rezero/token"; + public const string Jwt_GetJwtInfo = "/api/rezero/getuserinfo"; + public const string Jwt_PageUrl = "/rezero/authorization.html"; + + public const string ErrorCode_001 = "[001]"; + + public const int Setting_EntityType = 1; + public const int Setting_ImportUnunderlineType = 1; + public const int Setting_EnableLoginType = 2; + + + public const string InitApi_SystemCommon = "SystemCommon"; + public const string InitApi_RootUrl = "/PrivateReZeroRoute/100003/"; + public const string InitApi_SystemSaveConfig = "/PrivateReZeroRoute/100003/SaveLoginConfig"; + public const string InitApi_SystemGetInitConfig = "/PrivateReZeroRoute/100003/GetLoginConfig"; + public const string InitApi_VerifyCode = "/Public/InitApi_VerifyCode"; + public const string InitApi_SaveUser = "/PrivateReZeroRoute/100003/SaveUser"; + public const string InitApi_GetUserById = "/PrivateReZeroRoute/100003/GetUserById"; + public const string InitApi_DeleteUserById = "/PrivateReZeroRoute/100003/DeleteUserById"; + public const string InitApi_GetCurrentUser = "/Public/User"; + public const string InitApi_GetBizUsers = "/PrivateReZeroRoute/100003/GetBizUsers"; + public const string InitApi_ViewTemplate = "/PrivateReZeroRoute/100003/ViewTemplate"; + public const string InitApi_AddTokenManage = "/PrivateReZeroRoute/100003/AddTokenManage"; + public const string InitApi_UpdateTokenManage = "/PrivateReZeroRoute/100003/UpdateTokenManage"; + public const string InitApi_DeleteTokenManage = "/PrivateReZeroRoute/100003/DeleteTokenManage"; + public const string InitApi_GetTokenManageById = "/PrivateReZeroRoute/100003/GetTokenManageById"; + public const string InitApi_GetPermissionList = "/PrivateReZeroRoute/100003/GetPermissionList"; + public const string InitApi_AddPermission = "/PrivateReZeroRoute/100003/AddPermission"; + public const string InitApi_UpdatePermission = "/PrivateReZeroRoute/100003/UpdatePermission"; + public const string InitApi_DeletePermission = "/PrivateReZeroRoute/100003/DeletePermission"; + public const string InitApi_GetSavePermissionModelById = "/PrivateReZeroRoute/100003/GetSavePermissionModelById"; + } +} diff --git a/ReZero/SuperAPI/Utils/PubMethod.cs b/ReZero/SuperAPI/Utils/PubMethod.cs new file mode 100644 index 0000000..d1416ba --- /dev/null +++ b/ReZero/SuperAPI/Utils/PubMethod.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using System.Text; +using System.Text.RegularExpressions; +namespace ReZero.SuperAPI +{ + /// + /// Provides utility methods for common operations. + /// + internal class PubMethod + { + public static byte[] ConvertBase64ToBytes(string dataUri) + { + if (string.IsNullOrWhiteSpace(dataUri)) + throw new ArgumentException("Data URI cannot be null or empty.", nameof(dataUri)); + + var match = Regex.Match(dataUri, @"^data:(image/\w+);base64,(.+)$", RegexOptions.IgnoreCase); + if (!match.Success) + throw new FormatException("Invalid data URI format."); + + return Convert.FromBase64String(match.Groups[2].Value); + } + /// + /// Checks if the given URL has a valid format. + /// + /// The URL to check + /// True if the URL has a valid format, otherwise false + public static bool IsValidUrlFormat(string url) + { + string pattern = @"^\/[a-zA-Z0-9_-]+\/[a-zA-Z0-9_-]+$"; + if (url.Contains(".")) + url = System.IO.Path.GetFileNameWithoutExtension(url); + Regex regex = new Regex(pattern); + + return regex.IsMatch(url); + } + + /// + /// Get the types derived from the specified base type. + /// + /// The base type + /// A list of types derived from the base type + public static List GetTypesDerivedFromDbBase(Type baseType) + { + Assembly assembly = baseType.Assembly; + List derivedTypes = new List(); + Type[] types = assembly.GetTypes(); + foreach (Type type in types) + { + if (type.IsSubclassOf(baseType)) + { + derivedTypes.Add(type); + } + } + return derivedTypes; + } + + /// + /// Checks if the given string is a valid property name. + /// + /// The string to check + /// True if the string is a valid property name, otherwise false + public static bool CheckIsPropertyName(string str) + { + return Regex.IsMatch(str, @"^[\u4e00-\u9fa5a-zA-Z_]\w*$"); + } + + public static byte[] ConvertFromBase64(string base64String) + { + int startIndex = base64String.IndexOf(',') + 1; + string base64Data = base64String.Substring(startIndex); + + return Convert.FromBase64String(base64Data); + } + + public static void CopyDirectory(string sourceDir, string destDir) + { + if (!Directory.Exists(destDir)) + { + Directory.CreateDirectory(destDir); + } + + string[] files = Directory.GetFiles(sourceDir); + + foreach (string file in files) + { + string destFile = Path.Combine(destDir, Path.GetFileName(file)); + File.Copy(file, destFile, true); // 设置为 true 表示覆盖已存在的文件 + } + + string[] dirs = Directory.GetDirectories(sourceDir); + + foreach (string dir in dirs) + { + string destSubDir = Path.Combine(destDir, Path.GetFileName(dir)); + CopyDirectory(dir, destSubDir); + } + } + } +} diff --git a/ReZero/SuperAPI/Utils/VerifyCodeSugar.cs b/ReZero/SuperAPI/Utils/VerifyCodeSugar.cs new file mode 100644 index 0000000..732f63c --- /dev/null +++ b/ReZero/SuperAPI/Utils/VerifyCodeSugar.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; +using System.Linq; +using Microsoft.AspNetCore.Http; +using System.IO; +using System.Collections.Concurrent; + +namespace ReZero.SuperAPI +{ + + /// + /// ** 描述:验证码类 + /// ** 创始时间:2015-6-30 + /// ** 修改时间:- + /// ** 修改人:sunkaixuan + /// + public class VerifyCodeSugar + { + private static readonly char[] chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".ToCharArray(); + private static readonly Random random = new Random(); + internal static (string,byte[]) Create() + { + string code = GenerateCode(4); + byte[] imageBytes = GenerateImage(code); + return (code,imageBytes); + } + + private static string GenerateCode(int length) + { + StringBuilder sb = new StringBuilder(length); + for (int i = 0; i < length; i++) + { + sb.Append(chars[random.Next(chars.Length)]); + } + return sb.ToString(); + } + + private static byte[] GenerateImage(string code) + { + return new byte[] { }; + } + } +} diff --git a/ReZero/TextTemplate/Directives/DefaultDirective.cs b/ReZero/TextTemplate/Directives/DefaultDirective.cs new file mode 100644 index 0000000..d897af0 --- /dev/null +++ b/ReZero/TextTemplate/Directives/DefaultDirective.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; + +namespace ReZero.TextTemplate +{ + public class DefaultDirective : IDirective + { + public string Execute(string input, object data, ITemplateEngine templateEngine) + { + string pattern = @"<%([\s\S]*?)%>"; + MatchCollection matches = Regex.Matches(input, pattern); + foreach (Match match in matches) + { + string expression = match.Groups[1].Value; + string value = Evaluate(expression).ToString(); + input = input.Replace(match.Value, value); + } + return input; + } + + private string Evaluate(string expression) + { + expression = $"\";\r\n{expression}\r\nresult+=@\""; + return expression; + } + } +} diff --git a/ReZero/TextTemplate/Directives/MemberDirective.cs b/ReZero/TextTemplate/Directives/MemberDirective.cs new file mode 100644 index 0000000..a90a5f0 --- /dev/null +++ b/ReZero/TextTemplate/Directives/MemberDirective.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; + +namespace ReZero.TextTemplate +{ + public class MemberDirective : IDirective + { + public string Execute(string input, object data, ITemplateEngine templateEngine) + { + string pattern = @"\{\{([\s\S]*?)\}\}"; + MatchCollection matches = Regex.Matches(input, pattern); + foreach (Match match in matches) + { + string expression = match.Groups[1].Value; + string value = Evaluate(expression).ToString(); + input = input.Replace(match.Value, value); + } + return input; + } + + private string Evaluate(string expression) + { + expression = $"\"+{expression}+@\""; + return expression; + } + } +} diff --git a/ReZero/TextTemplate/Directives/RootDirective.cs b/ReZero/TextTemplate/Directives/RootDirective.cs new file mode 100644 index 0000000..2024cb7 --- /dev/null +++ b/ReZero/TextTemplate/Directives/RootDirective.cs @@ -0,0 +1,28 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; + +namespace ReZero.TextTemplate +{ + public class RootDirective : IDirective + { + public string Execute(string input, object data, ITemplateEngine templateEngine) + { + input = Regex.Replace(input, @"\{\ {1,5}\{", "{{"); + input = Regex.Replace(input, @"\} {1,5}\}", "}}"); + input = Regex.Replace(input, @"\<\ {1,5}\%", "<%"); + input = Regex.Replace(input, @"\% {1,5}\>", "%>"); + input = Regex.Replace(input, "\"{{", "\"\"{{"); + input = Regex.Replace(input, "}}\"", "}}\"\""); + input = Regex.Replace(input, "}}{{", "}} {{"); + StringBuilder sb = new StringBuilder(); + sb.Append("string result = "); + sb.Append("@\""); + sb.Append(input); + sb.Append("\";"); + return sb.ToString(); + } + } +} diff --git a/ReZero/TextTemplate/ExpressionEvaluator.cs b/ReZero/TextTemplate/ExpressionEvaluator.cs new file mode 100644 index 0000000..363b0c6 --- /dev/null +++ b/ReZero/TextTemplate/ExpressionEvaluator.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq.Dynamic.Core; +using System.Text; + +namespace ReZero.TextTemplate +{ + public class ExpressionEvaluator + { + public object Evaluate(string expression) + { + return DynamicExpressionParser.ParseLambda(new ParsingConfig() { }, typeof(object), expression, new object[] { }).Compile().DynamicInvoke(); + } + } +} diff --git a/ReZero/TextTemplate/IDirective.cs b/ReZero/TextTemplate/IDirective.cs new file mode 100644 index 0000000..95d993a --- /dev/null +++ b/ReZero/TextTemplate/IDirective.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.TextTemplate +{ + public interface IDirective + { + string Execute(string input, object data, ITemplateEngine templateEngine); + } + +} diff --git a/ReZero/TextTemplate/ITemplateEngine.cs b/ReZero/TextTemplate/ITemplateEngine.cs new file mode 100644 index 0000000..1874278 --- /dev/null +++ b/ReZero/TextTemplate/ITemplateEngine.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.TextTemplate +{ + + public interface ITemplateEngine: IRender + { + void AddDirective(string name, IDirective directive); + } + public interface IRender + { + void Render(string template, object data, StringBuilder output); + } +} diff --git a/ReZero/TextTemplate/Model.cs b/ReZero/TextTemplate/Model.cs new file mode 100644 index 0000000..9bde940 --- /dev/null +++ b/ReZero/TextTemplate/Model.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.TextTemplate +{ + public class TextTemplateModel where T:class + { + public T Model { get; set; } = null!; + } +} diff --git a/ReZero/TextTemplate/TemplateEngine.cs b/ReZero/TextTemplate/TemplateEngine.cs new file mode 100644 index 0000000..0beaf5f --- /dev/null +++ b/ReZero/TextTemplate/TemplateEngine.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReZero.TextTemplate +{ + public class TemplateEngine : ITemplateEngine + { + private readonly Dictionary directives = new Dictionary(); + + public void AddDirective(string name, IDirective directive) + { + directives[name] = directive; + } + + public void Render(string template, object data, StringBuilder output) + { + foreach (var directive in directives) + { + template = directive.Value.Execute(template, data, this); + } + output.Append(template); + } + } +} diff --git a/ReZero/TextTemplate/TemplateManger.cs b/ReZero/TextTemplate/TemplateManger.cs new file mode 100644 index 0000000..a1797b5 --- /dev/null +++ b/ReZero/TextTemplate/TemplateManger.cs @@ -0,0 +1,106 @@ +using DocumentFormat.OpenXml.Office2016.Drawing.Command; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp.Scripting; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Scripting; +using ReZero.Common; +using ReZero.TextTemplate; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Text.RegularExpressions; +namespace ReZero.TextTemplate +{ + public class TextTemplateManager + { + IRender? customRenderer = null; + public TextTemplateManager(IRender? customRenderer=null) + { + this.customRenderer = customRenderer; + } + public string RenderTemplate(string template, object data) + { + if (this.customRenderer != null) + { + return CustomRender(template, data, this.customRenderer); + } + else + { + return DefaultRender(template, data); + } + } + + private string CustomRender(string template, object data, IRender renderer) + { + var result = new StringBuilder(); + renderer.Render(template, data, result); + return result.ToString(); + } + + private string DefaultRender(string template, object data) + { + var engine = new TemplateEngine(); + engine.AddDirective("root", new RootDirective()); + engine.AddDirective("default", new DefaultDirective()); + engine.AddDirective("member", new MemberDirective()); + var output = new StringBuilder(); + engine.Render(template, data, output); + var options = GetOptions(); + try + { + output.AppendLine("result"); + var result = CSharpScript.EvaluateAsync(output.ToString(), options, data).GetAwaiter().GetResult(); + output.Clear(); + output.Append(result); + } + catch (CompilationErrorException e) + { + throw new Exception(string.Join(Environment.NewLine, e.Diagnostics)); + } + return output.ToString(); + } + private static ScriptOptions? scriptOptions; + private static object objLock = new object(); + private static ScriptOptions GetOptions() + { + if (scriptOptions != null) + return scriptOptions; + lock (objLock) + { + var namespaces = new[] + { + // System命名空间 + "System", + "System.Collections", + "System.Collections.Generic", + "System.IO", + "System.Linq", + "System.Text", + "System.Text.RegularExpressions" + }; + + // 获取当前域内的程序集,并排除不含位置的程序集 + var ass = AppDomain.CurrentDomain.GetAssemblies() + .Where(it => + it.FullName.StartsWith("System.Linq")|| + it.FullName.StartsWith("System.text")|| + it.FullName.StartsWith("System.Collections")|| + it.FullName.StartsWith("System.IO")).ToList(); + + var isSingleFile =!FileSugar.IsExistFile("".GetType().Assembly.Location); + if (isSingleFile) + { + throw new Exception("该功能暂时还不支持单文件发布,发布时不能勾选文件合并,合并方案还在研究中"); + } + + var result = ScriptOptions.Default.AddReferences(ass) + .WithImports(namespaces); + scriptOptions = result; + + return result; + } + } + } +} \ No newline at end of file diff --git a/ReZero/nuget.bat b/ReZero/nuget.bat new file mode 100644 index 0000000..a3c29d0 --- /dev/null +++ b/ReZero/nuget.bat @@ -0,0 +1 @@ +%~dp0nuget.exe pack %~dp0Rezero.nuspec -OutputDirectory %~dp0 \ No newline at end of file diff --git a/ReZero/nugetAPI.bat b/ReZero/nugetAPI.bat new file mode 100644 index 0000000..c6de89e --- /dev/null +++ b/ReZero/nugetAPI.bat @@ -0,0 +1 @@ +%~dp0nuget.exe pack %~dp0RezeroAPI.nuspec -OutputDirectory %~dp0 \ No newline at end of file diff --git a/SuperAPI/Controllers/MyApiController.cs b/SuperAPI/Controllers/MyApiController.cs new file mode 100644 index 0000000..c54c3a4 --- /dev/null +++ b/SuperAPI/Controllers/MyApiController.cs @@ -0,0 +1,43 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; +using ReZero.SuperAPI; +using System.Security.Policy; +namespace SuperAPITest.Controllers +{ + /// + /// 动态接口 + /// + [Api(200100, GroupName = "分组1",Url= "/api/MyApiController")] + public class MyApiController + { + [ApiMethod("我是A方法")] + public int A(int num,int num2) + { + return num+num2; + } + + [ApiMethod("我是B方法")] + public string B(byte[] file) + { + return "文件长度"+ file.Length; + } + + [ApiMethod("我是C方法", HttpMethod = HttpType.Get)] + public Object C(SqlSugar.PageModel classA) + { + return classA; + } + + [ApiMethod("我是D方法")] + [UrlParameters] + public int D(int num, int num2) + { + return num + num2; + } + } + + public class ClassA + { + public int Id { get; set; } + public string? Name { get; set; } + } +} diff --git a/SuperAPI/Controllers/MyApiWithIocController.cs b/SuperAPI/Controllers/MyApiWithIocController.cs new file mode 100644 index 0000000..9f4df68 --- /dev/null +++ b/SuperAPI/Controllers/MyApiWithIocController.cs @@ -0,0 +1,29 @@ +using ReZero.DependencyInjection; +using ReZero.SuperAPI; +namespace SuperAPITest.Controllers +{ + /// + /// 动态接口+IOC + /// + [Api(200100,GroupName = "分组2")] + public class MyApiWithIocController + { + //属性注入 + [DI] + public MyService? MyService { get; set; } + + [ApiMethod("我是A方法")] + public int A(int num, int num2) + { + return this.MyService!.CalculateSum(num, num2); + } + } + //继承IScopeContract 、ISingletonContract或者ITransientContract就可以自动注入 + public class MyService : IScopeContract + { + public int CalculateSum(int num, int num2) + { + return num2 + num; + } + } +} diff --git a/SuperAPI/Controllers/MyApiWithUnitOfWorkController.cs b/SuperAPI/Controllers/MyApiWithUnitOfWorkController.cs new file mode 100644 index 0000000..7f13554 --- /dev/null +++ b/SuperAPI/Controllers/MyApiWithUnitOfWorkController.cs @@ -0,0 +1,26 @@ +using ReZero.DependencyInjection; +using ReZero.SuperAPI; +using SqlSugar; + +namespace SuperAPITest.Controllers +{ + /// + /// 动态接口+工作单元 + /// + [Api(200100, GroupName = "分组3")] + public class MyApiWithUnitOfWorkController + { + //属性注入 + [DI] + public ISqlSugarClient? db { get; set; } + + //工作单元,可以用自带的也可以重新写 + [UnitOfWork] + [ApiMethod("我是QueryTest方法")] + public bool QueryTest() + { + db!.Ado.ExecuteCommand("select 1 as id"); + return true; + } + } +} diff --git a/SuperAPI/Controllers/WeatherForecastController.cs b/SuperAPI/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..0851a7c --- /dev/null +++ b/SuperAPI/Controllers/WeatherForecastController.cs @@ -0,0 +1,18 @@ +using Microsoft.AspNetCore.Mvc; + +namespace ReZeroWeb.Controllers +{ + /// + /// ԭӿ + /// + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + [HttpGet(Name = "GetWeatherForecast")] + public string Get() + { + return "Hello word" ; + } + } +} \ No newline at end of file diff --git a/SuperAPI/Program.cs b/SuperAPI/Program.cs new file mode 100644 index 0000000..0a158b0 --- /dev/null +++ b/SuperAPI/Program.cs @@ -0,0 +1,66 @@ +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Components.Forms; +using Microsoft.IdentityModel.Tokens; +using ReZero; +using ReZero.Configuration; +using ReZero.SuperAPI; +using SqlSugar; +using SuperAPITest; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Text; +using Microsoft.AspNetCore.Cors; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddControllers(); +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + + +//עdb: дԲע +builder.Services.AddScoped(it => +{ + var config = ApiConfiguration.GetJsonValue("ReZero"); + return new SqlSugarClient(new ConnectionConfig() + { + DbType = config!.BasicDatabase!.DbType, + ConnectionString = config!.BasicDatabase!.ConnectionString, + IsAutoCloseConnection = true + }); +}); +//builder.Services.AddCors(); + + +//עReZero.Api +builder.Services.AddReZeroServices(api => +{ + + //ؿɻjsonļ + var apiObj = SuperAPIOptions.GetOptions(); + + //IOCҵҪм̼ + var assemblyList = Assembly.GetExecutingAssembly() + .GetAllDependentAssemblies(it => it.Contains("SuperAPITest")) + .ToArray(); + + apiObj!.DependencyInjectionOptions = new DependencyInjectionOptions(assemblyList); + + //óAPI + api.EnableSuperApi(apiObj); + +}); + + +var app = builder.Build(); +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} +app.UseHttpsRedirection(); +app.UseAuthorization(); +app.MapControllers(); +app.Run(); diff --git a/SuperAPI/Properties/launchSettings.json b/SuperAPI/Properties/launchSettings.json new file mode 100644 index 0000000..776dbc8 --- /dev/null +++ b/SuperAPI/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:30936", + "sslPort": 44372 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "rezero", + "applicationUrl": "http://localhost:5267", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "rezero", + "applicationUrl": "https://localhost:7101;http://localhost:5267", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "rezero", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/SuperAPI/SuperAPITest.csproj b/SuperAPI/SuperAPITest.csproj new file mode 100644 index 0000000..5a5f4b6 --- /dev/null +++ b/SuperAPI/SuperAPITest.csproj @@ -0,0 +1,24 @@ + + + + net8.0 + enable + enable + 1.0.4.1 + 1.0.4.1 + + + + <_ContentIncludedByDefault Remove="wwwroot\rezero\default_ui\Cache.html" /> + + + + + + + + + + + + diff --git a/SuperAPI/appsettings.Development.json b/SuperAPI/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/SuperAPI/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/SuperAPI/appsettings.json b/SuperAPI/appsettings.json new file mode 100644 index 0000000..afcdfa7 --- /dev/null +++ b/SuperAPI/appsettings.json @@ -0,0 +1,59 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "ReZero": { + "BasicDatabase": { + /* MySql,SqlServer,Sqlite,Oracle,PostgreSQL,Dm (达梦),Kdbndp(人大金仓默认模式) */ + // "DbType": "SqlServer", + // "ConnectionString": "server=.;uid=sa;pwd=sasa;database=SuperAPI" + // "DbType": "Sqlite", + // "ConnectionString": "Data Source=SuperAPI.db", + "DbType": "SqlServer", + "ConnectionString": "server=192.168.2.5;uid=hdhis;pwd=haoding@123;database=SuperAPI" + }, + "Ui": { + /*纯ReZero开发可以设为false,true用于兼容Swagger用户*/ + "ShowNativeApiDocument": true, + /*纯ReZero开发可以忽略,Swagger的URL */ + "DefaultIndexSource": "/swagger" + }, + "Jwt": { + //设置true会启用自带的jwt授权 + "Enable": true, + //jwt密钥 + "Secret": "C0mPl3xS3cr3tK3yF0rJWT@DEVELOPMENT", + //用户表的表名 (实体管理可以创建表,操作步骤:1.创建实体 2.同步生成表 ) + "UserTableName": "user", + //用户名字段名称 (是名称不是值) + "UserNameFieldName": "username", + //密码字段名称 (是名称不是值) + "PasswordFieldName": "password", + //分钟 + "Expires": 1000, + // 数据库操作会用到Claim中的值作为条件 + "Claim": [ + { + //Claim Key + "Key": "Id", + //用户表中的字段 + "FieldName": "Id", + //C#类型 + "Type": "long" + } + ], + //禁用系统接口, 设置为true将禁用所有系统接口(建表、建接口等) + "DisableSystemInterface": false + }, + "Cors": { + "Enable": false, //设置为true启动自带的跨域 + "PolicyName": "cors", + "Headers": [ "*" ], + "Methods": [ "*" ], + "Origins": [ "http://localhost:52798", "http://localhost:1803" ] + } + } +} diff --git a/SuperAPI/wwwroot/rezero/default_ui/authorization.html b/SuperAPI/wwwroot/rezero/default_ui/authorization.html new file mode 100644 index 0000000..e99f831 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/authorization.html @@ -0,0 +1,146 @@ +@@master_page.html +
    +
    +

    授权说明

    +
    +
    +
    一、用户表不存需要创建表
    +

    1、Json文件禁用授权

    +

    2、实体管理创建【用户实体】,然后点同步生成【用户表】

    +

    3、创建【用户插入接口】

    +

    4、插入用户名密码(密码前端加密好)

    +
    二、用户表存在只需四步
    +

    1、完成json配置启用授权

    +

    2、输入用户名密码获取Token (密码前端加密好)

    +

    3、保存Token

    +

    4、其他页面能正常访问说明授权成功,未成功接口都是返回401

    +
    +
    +
    +
    +

    保存登录

    【支持所有JWT】
    +
    +
    + + +
    + +
    + +
    +
    +
    +
    +

    获取Token

    【仅支持自带JWT】
    +
    + +
    + + +
    +
    + + + +
    +
    + + +
    +
    + +
    +
    +
    +
    +

    测试授权 【仅支持自带JWT】

    +
    +
    +
    获取JWT信息
    +
    Url: /api/rezero/getuserinfo
    + +
    +
    + + + 注意:如果成功,内置接口访问不了可能是 DisableSystemInterface 禁用了 +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/cache.html b/SuperAPI/wwwroot/rezero/default_ui/cache.html new file mode 100644 index 0000000..ccec421 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/cache.html @@ -0,0 +1,41 @@ +@@master_page.html +
    +
    +

    内部缓存

    +
    +
    + 外部修改数据库需要清空 ,缓存内容主要包含:数据库信息、实体信息和接口信息。 +
    +
    + +
    +
    +
    +
    + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/css/animate.css b/SuperAPI/wwwroot/rezero/default_ui/css/animate.css new file mode 100644 index 0000000..7148b57 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/css/animate.css @@ -0,0 +1,3340 @@ +@charset "UTF-8"; + +/*! + * animate.css -http://daneden.me/animate + * Version - 3.5.1 + * Licensed under the MIT license - http://opensource.org/licenses/MIT + * + * Copyright (c) 2016 Daniel Eden + */ + +.animated { + -webkit-animation-duration: 1s; + animation-duration: 1s; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} + +.animated.infinite { + -webkit-animation-iteration-count: infinite; + animation-iteration-count: infinite; +} + +.animated.hinge { + -webkit-animation-duration: 2s; + animation-duration: 2s; +} + +.animated.flipOutX, +.animated.flipOutY, +.animated.bounceIn, +.animated.bounceOut { + -webkit-animation-duration: .75s; + animation-duration: .75s; +} + +@-webkit-keyframes bounce { + from, 20%, 53%, 80%, to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + -webkit-transform: translate3d(0,0,0); + transform: translate3d(0,0,0); + } + + 40%, 43% { + -webkit-animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060); + animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060); + -webkit-transform: translate3d(0, -30px, 0); + transform: translate3d(0, -30px, 0); + } + + 70% { + -webkit-animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060); + animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060); + -webkit-transform: translate3d(0, -15px, 0); + transform: translate3d(0, -15px, 0); + } + + 90% { + -webkit-transform: translate3d(0,-4px,0); + transform: translate3d(0,-4px,0); + } +} + +@keyframes bounce { + from, 20%, 53%, 80%, to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + -webkit-transform: translate3d(0,0,0); + transform: translate3d(0,0,0); + } + + 40%, 43% { + -webkit-animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060); + animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060); + -webkit-transform: translate3d(0, -30px, 0); + transform: translate3d(0, -30px, 0); + } + + 70% { + -webkit-animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060); + animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060); + -webkit-transform: translate3d(0, -15px, 0); + transform: translate3d(0, -15px, 0); + } + + 90% { + -webkit-transform: translate3d(0,-4px,0); + transform: translate3d(0,-4px,0); + } +} + +.bounce { + -webkit-animation-name: bounce; + animation-name: bounce; + -webkit-transform-origin: center bottom; + transform-origin: center bottom; +} + +@-webkit-keyframes flash { + from, 50%, to { + opacity: 1; + } + + 25%, 75% { + opacity: 0; + } +} + +@keyframes flash { + from, 50%, to { + opacity: 1; + } + + 25%, 75% { + opacity: 0; + } +} + +.flash { + -webkit-animation-name: flash; + animation-name: flash; +} + +/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */ + +@-webkit-keyframes pulse { + from { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } + + 50% { + -webkit-transform: scale3d(1.05, 1.05, 1.05); + transform: scale3d(1.05, 1.05, 1.05); + } + + to { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } +} + +@keyframes pulse { + from { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } + + 50% { + -webkit-transform: scale3d(1.05, 1.05, 1.05); + transform: scale3d(1.05, 1.05, 1.05); + } + + to { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } +} + +.pulse { + -webkit-animation-name: pulse; + animation-name: pulse; +} + +@-webkit-keyframes rubberBand { + from { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } + + 30% { + -webkit-transform: scale3d(1.25, 0.75, 1); + transform: scale3d(1.25, 0.75, 1); + } + + 40% { + -webkit-transform: scale3d(0.75, 1.25, 1); + transform: scale3d(0.75, 1.25, 1); + } + + 50% { + -webkit-transform: scale3d(1.15, 0.85, 1); + transform: scale3d(1.15, 0.85, 1); + } + + 65% { + -webkit-transform: scale3d(.95, 1.05, 1); + transform: scale3d(.95, 1.05, 1); + } + + 75% { + -webkit-transform: scale3d(1.05, .95, 1); + transform: scale3d(1.05, .95, 1); + } + + to { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } +} + +@keyframes rubberBand { + from { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } + + 30% { + -webkit-transform: scale3d(1.25, 0.75, 1); + transform: scale3d(1.25, 0.75, 1); + } + + 40% { + -webkit-transform: scale3d(0.75, 1.25, 1); + transform: scale3d(0.75, 1.25, 1); + } + + 50% { + -webkit-transform: scale3d(1.15, 0.85, 1); + transform: scale3d(1.15, 0.85, 1); + } + + 65% { + -webkit-transform: scale3d(.95, 1.05, 1); + transform: scale3d(.95, 1.05, 1); + } + + 75% { + -webkit-transform: scale3d(1.05, .95, 1); + transform: scale3d(1.05, .95, 1); + } + + to { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } +} + +.rubberBand { + -webkit-animation-name: rubberBand; + animation-name: rubberBand; +} + +@-webkit-keyframes shake { + from, to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + 10%, 30%, 50%, 70%, 90% { + -webkit-transform: translate3d(-10px, 0, 0); + transform: translate3d(-10px, 0, 0); + } + + 20%, 40%, 60%, 80% { + -webkit-transform: translate3d(10px, 0, 0); + transform: translate3d(10px, 0, 0); + } +} + +@keyframes shake { + from, to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + 10%, 30%, 50%, 70%, 90% { + -webkit-transform: translate3d(-10px, 0, 0); + transform: translate3d(-10px, 0, 0); + } + + 20%, 40%, 60%, 80% { + -webkit-transform: translate3d(10px, 0, 0); + transform: translate3d(10px, 0, 0); + } +} + +.shake { + -webkit-animation-name: shake; + animation-name: shake; +} + +@-webkit-keyframes headShake { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + } + + 6.5% { + -webkit-transform: translateX(-6px) rotateY(-9deg); + transform: translateX(-6px) rotateY(-9deg); + } + + 18.5% { + -webkit-transform: translateX(5px) rotateY(7deg); + transform: translateX(5px) rotateY(7deg); + } + + 31.5% { + -webkit-transform: translateX(-3px) rotateY(-5deg); + transform: translateX(-3px) rotateY(-5deg); + } + + 43.5% { + -webkit-transform: translateX(2px) rotateY(3deg); + transform: translateX(2px) rotateY(3deg); + } + + 50% { + -webkit-transform: translateX(0); + transform: translateX(0); + } +} + +@keyframes headShake { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + } + + 6.5% { + -webkit-transform: translateX(-6px) rotateY(-9deg); + transform: translateX(-6px) rotateY(-9deg); + } + + 18.5% { + -webkit-transform: translateX(5px) rotateY(7deg); + transform: translateX(5px) rotateY(7deg); + } + + 31.5% { + -webkit-transform: translateX(-3px) rotateY(-5deg); + transform: translateX(-3px) rotateY(-5deg); + } + + 43.5% { + -webkit-transform: translateX(2px) rotateY(3deg); + transform: translateX(2px) rotateY(3deg); + } + + 50% { + -webkit-transform: translateX(0); + transform: translateX(0); + } +} + +.headShake { + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + -webkit-animation-name: headShake; + animation-name: headShake; +} + +@-webkit-keyframes swing { + 20% { + -webkit-transform: rotate3d(0, 0, 1, 15deg); + transform: rotate3d(0, 0, 1, 15deg); + } + + 40% { + -webkit-transform: rotate3d(0, 0, 1, -10deg); + transform: rotate3d(0, 0, 1, -10deg); + } + + 60% { + -webkit-transform: rotate3d(0, 0, 1, 5deg); + transform: rotate3d(0, 0, 1, 5deg); + } + + 80% { + -webkit-transform: rotate3d(0, 0, 1, -5deg); + transform: rotate3d(0, 0, 1, -5deg); + } + + to { + -webkit-transform: rotate3d(0, 0, 1, 0deg); + transform: rotate3d(0, 0, 1, 0deg); + } +} + +@keyframes swing { + 20% { + -webkit-transform: rotate3d(0, 0, 1, 15deg); + transform: rotate3d(0, 0, 1, 15deg); + } + + 40% { + -webkit-transform: rotate3d(0, 0, 1, -10deg); + transform: rotate3d(0, 0, 1, -10deg); + } + + 60% { + -webkit-transform: rotate3d(0, 0, 1, 5deg); + transform: rotate3d(0, 0, 1, 5deg); + } + + 80% { + -webkit-transform: rotate3d(0, 0, 1, -5deg); + transform: rotate3d(0, 0, 1, -5deg); + } + + to { + -webkit-transform: rotate3d(0, 0, 1, 0deg); + transform: rotate3d(0, 0, 1, 0deg); + } +} + +.swing { + -webkit-transform-origin: top center; + transform-origin: top center; + -webkit-animation-name: swing; + animation-name: swing; +} + +@-webkit-keyframes tada { + from { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } + + 10%, 20% { + -webkit-transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg); + transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg); + } + + 30%, 50%, 70%, 90% { + -webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg); + transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg); + } + + 40%, 60%, 80% { + -webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg); + transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg); + } + + to { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } +} + +@keyframes tada { + from { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } + + 10%, 20% { + -webkit-transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg); + transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg); + } + + 30%, 50%, 70%, 90% { + -webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg); + transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg); + } + + 40%, 60%, 80% { + -webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg); + transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg); + } + + to { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } +} + +.tada { + -webkit-animation-name: tada; + animation-name: tada; +} + +/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */ + +@-webkit-keyframes wobble { + from { + -webkit-transform: none; + transform: none; + } + + 15% { + -webkit-transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg); + transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg); + } + + 30% { + -webkit-transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg); + transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg); + } + + 45% { + -webkit-transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg); + transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg); + } + + 60% { + -webkit-transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg); + transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg); + } + + 75% { + -webkit-transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg); + transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg); + } + + to { + -webkit-transform: none; + transform: none; + } +} + +@keyframes wobble { + from { + -webkit-transform: none; + transform: none; + } + + 15% { + -webkit-transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg); + transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg); + } + + 30% { + -webkit-transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg); + transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg); + } + + 45% { + -webkit-transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg); + transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg); + } + + 60% { + -webkit-transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg); + transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg); + } + + 75% { + -webkit-transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg); + transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg); + } + + to { + -webkit-transform: none; + transform: none; + } +} + +.wobble { + -webkit-animation-name: wobble; + animation-name: wobble; +} + +@-webkit-keyframes jello { + from, 11.1%, to { + -webkit-transform: none; + transform: none; + } + + 22.2% { + -webkit-transform: skewX(-12.5deg) skewY(-12.5deg); + transform: skewX(-12.5deg) skewY(-12.5deg); + } + + 33.3% { + -webkit-transform: skewX(6.25deg) skewY(6.25deg); + transform: skewX(6.25deg) skewY(6.25deg); + } + + 44.4% { + -webkit-transform: skewX(-3.125deg) skewY(-3.125deg); + transform: skewX(-3.125deg) skewY(-3.125deg); + } + + 55.5% { + -webkit-transform: skewX(1.5625deg) skewY(1.5625deg); + transform: skewX(1.5625deg) skewY(1.5625deg); + } + + 66.6% { + -webkit-transform: skewX(-0.78125deg) skewY(-0.78125deg); + transform: skewX(-0.78125deg) skewY(-0.78125deg); + } + + 77.7% { + -webkit-transform: skewX(0.390625deg) skewY(0.390625deg); + transform: skewX(0.390625deg) skewY(0.390625deg); + } + + 88.8% { + -webkit-transform: skewX(-0.1953125deg) skewY(-0.1953125deg); + transform: skewX(-0.1953125deg) skewY(-0.1953125deg); + } +} + +@keyframes jello { + from, 11.1%, to { + -webkit-transform: none; + transform: none; + } + + 22.2% { + -webkit-transform: skewX(-12.5deg) skewY(-12.5deg); + transform: skewX(-12.5deg) skewY(-12.5deg); + } + + 33.3% { + -webkit-transform: skewX(6.25deg) skewY(6.25deg); + transform: skewX(6.25deg) skewY(6.25deg); + } + + 44.4% { + -webkit-transform: skewX(-3.125deg) skewY(-3.125deg); + transform: skewX(-3.125deg) skewY(-3.125deg); + } + + 55.5% { + -webkit-transform: skewX(1.5625deg) skewY(1.5625deg); + transform: skewX(1.5625deg) skewY(1.5625deg); + } + + 66.6% { + -webkit-transform: skewX(-0.78125deg) skewY(-0.78125deg); + transform: skewX(-0.78125deg) skewY(-0.78125deg); + } + + 77.7% { + -webkit-transform: skewX(0.390625deg) skewY(0.390625deg); + transform: skewX(0.390625deg) skewY(0.390625deg); + } + + 88.8% { + -webkit-transform: skewX(-0.1953125deg) skewY(-0.1953125deg); + transform: skewX(-0.1953125deg) skewY(-0.1953125deg); + } +} + +.jello { + -webkit-animation-name: jello; + animation-name: jello; + -webkit-transform-origin: center; + transform-origin: center; +} + +@-webkit-keyframes bounceIn { + from, 20%, 40%, 60%, 80%, to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + } + + 0% { + opacity: 0; + -webkit-transform: scale3d(.3, .3, .3); + transform: scale3d(.3, .3, .3); + } + + 20% { + -webkit-transform: scale3d(1.1, 1.1, 1.1); + transform: scale3d(1.1, 1.1, 1.1); + } + + 40% { + -webkit-transform: scale3d(.9, .9, .9); + transform: scale3d(.9, .9, .9); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(1.03, 1.03, 1.03); + transform: scale3d(1.03, 1.03, 1.03); + } + + 80% { + -webkit-transform: scale3d(.97, .97, .97); + transform: scale3d(.97, .97, .97); + } + + to { + opacity: 1; + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } +} + +@keyframes bounceIn { + from, 20%, 40%, 60%, 80%, to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + } + + 0% { + opacity: 0; + -webkit-transform: scale3d(.3, .3, .3); + transform: scale3d(.3, .3, .3); + } + + 20% { + -webkit-transform: scale3d(1.1, 1.1, 1.1); + transform: scale3d(1.1, 1.1, 1.1); + } + + 40% { + -webkit-transform: scale3d(.9, .9, .9); + transform: scale3d(.9, .9, .9); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(1.03, 1.03, 1.03); + transform: scale3d(1.03, 1.03, 1.03); + } + + 80% { + -webkit-transform: scale3d(.97, .97, .97); + transform: scale3d(.97, .97, .97); + } + + to { + opacity: 1; + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } +} + +.bounceIn { + -webkit-animation-name: bounceIn; + animation-name: bounceIn; +} + +@-webkit-keyframes bounceInDown { + from, 60%, 75%, 90%, to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + } + + 0% { + opacity: 0; + -webkit-transform: translate3d(0, -3000px, 0); + transform: translate3d(0, -3000px, 0); + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(0, 25px, 0); + transform: translate3d(0, 25px, 0); + } + + 75% { + -webkit-transform: translate3d(0, -10px, 0); + transform: translate3d(0, -10px, 0); + } + + 90% { + -webkit-transform: translate3d(0, 5px, 0); + transform: translate3d(0, 5px, 0); + } + + to { + -webkit-transform: none; + transform: none; + } +} + +@keyframes bounceInDown { + from, 60%, 75%, 90%, to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + } + + 0% { + opacity: 0; + -webkit-transform: translate3d(0, -3000px, 0); + transform: translate3d(0, -3000px, 0); + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(0, 25px, 0); + transform: translate3d(0, 25px, 0); + } + + 75% { + -webkit-transform: translate3d(0, -10px, 0); + transform: translate3d(0, -10px, 0); + } + + 90% { + -webkit-transform: translate3d(0, 5px, 0); + transform: translate3d(0, 5px, 0); + } + + to { + -webkit-transform: none; + transform: none; + } +} + +.bounceInDown { + -webkit-animation-name: bounceInDown; + animation-name: bounceInDown; +} + +@-webkit-keyframes bounceInLeft { + from, 60%, 75%, 90%, to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + } + + 0% { + opacity: 0; + -webkit-transform: translate3d(-3000px, 0, 0); + transform: translate3d(-3000px, 0, 0); + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(25px, 0, 0); + transform: translate3d(25px, 0, 0); + } + + 75% { + -webkit-transform: translate3d(-10px, 0, 0); + transform: translate3d(-10px, 0, 0); + } + + 90% { + -webkit-transform: translate3d(5px, 0, 0); + transform: translate3d(5px, 0, 0); + } + + to { + -webkit-transform: none; + transform: none; + } +} + +@keyframes bounceInLeft { + from, 60%, 75%, 90%, to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + } + + 0% { + opacity: 0; + -webkit-transform: translate3d(-3000px, 0, 0); + transform: translate3d(-3000px, 0, 0); + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(25px, 0, 0); + transform: translate3d(25px, 0, 0); + } + + 75% { + -webkit-transform: translate3d(-10px, 0, 0); + transform: translate3d(-10px, 0, 0); + } + + 90% { + -webkit-transform: translate3d(5px, 0, 0); + transform: translate3d(5px, 0, 0); + } + + to { + -webkit-transform: none; + transform: none; + } +} + +.bounceInLeft { + -webkit-animation-name: bounceInLeft; + animation-name: bounceInLeft; +} + +@-webkit-keyframes bounceInRight { + from, 60%, 75%, 90%, to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + } + + from { + opacity: 0; + -webkit-transform: translate3d(3000px, 0, 0); + transform: translate3d(3000px, 0, 0); + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(-25px, 0, 0); + transform: translate3d(-25px, 0, 0); + } + + 75% { + -webkit-transform: translate3d(10px, 0, 0); + transform: translate3d(10px, 0, 0); + } + + 90% { + -webkit-transform: translate3d(-5px, 0, 0); + transform: translate3d(-5px, 0, 0); + } + + to { + -webkit-transform: none; + transform: none; + } +} + +@keyframes bounceInRight { + from, 60%, 75%, 90%, to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + } + + from { + opacity: 0; + -webkit-transform: translate3d(3000px, 0, 0); + transform: translate3d(3000px, 0, 0); + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(-25px, 0, 0); + transform: translate3d(-25px, 0, 0); + } + + 75% { + -webkit-transform: translate3d(10px, 0, 0); + transform: translate3d(10px, 0, 0); + } + + 90% { + -webkit-transform: translate3d(-5px, 0, 0); + transform: translate3d(-5px, 0, 0); + } + + to { + -webkit-transform: none; + transform: none; + } +} + +.bounceInRight { + -webkit-animation-name: bounceInRight; + animation-name: bounceInRight; +} + +@-webkit-keyframes bounceInUp { + from, 60%, 75%, 90%, to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + } + + from { + opacity: 0; + -webkit-transform: translate3d(0, 3000px, 0); + transform: translate3d(0, 3000px, 0); + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(0, -20px, 0); + transform: translate3d(0, -20px, 0); + } + + 75% { + -webkit-transform: translate3d(0, 10px, 0); + transform: translate3d(0, 10px, 0); + } + + 90% { + -webkit-transform: translate3d(0, -5px, 0); + transform: translate3d(0, -5px, 0); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +@keyframes bounceInUp { + from, 60%, 75%, 90%, to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + } + + from { + opacity: 0; + -webkit-transform: translate3d(0, 3000px, 0); + transform: translate3d(0, 3000px, 0); + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(0, -20px, 0); + transform: translate3d(0, -20px, 0); + } + + 75% { + -webkit-transform: translate3d(0, 10px, 0); + transform: translate3d(0, 10px, 0); + } + + 90% { + -webkit-transform: translate3d(0, -5px, 0); + transform: translate3d(0, -5px, 0); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +.bounceInUp { + -webkit-animation-name: bounceInUp; + animation-name: bounceInUp; +} + +@-webkit-keyframes bounceOut { + 20% { + -webkit-transform: scale3d(.9, .9, .9); + transform: scale3d(.9, .9, .9); + } + + 50%, 55% { + opacity: 1; + -webkit-transform: scale3d(1.1, 1.1, 1.1); + transform: scale3d(1.1, 1.1, 1.1); + } + + to { + opacity: 0; + -webkit-transform: scale3d(.3, .3, .3); + transform: scale3d(.3, .3, .3); + } +} + +@keyframes bounceOut { + 20% { + -webkit-transform: scale3d(.9, .9, .9); + transform: scale3d(.9, .9, .9); + } + + 50%, 55% { + opacity: 1; + -webkit-transform: scale3d(1.1, 1.1, 1.1); + transform: scale3d(1.1, 1.1, 1.1); + } + + to { + opacity: 0; + -webkit-transform: scale3d(.3, .3, .3); + transform: scale3d(.3, .3, .3); + } +} + +.bounceOut { + -webkit-animation-name: bounceOut; + animation-name: bounceOut; +} + +@-webkit-keyframes bounceOutDown { + 20% { + -webkit-transform: translate3d(0, 10px, 0); + transform: translate3d(0, 10px, 0); + } + + 40%, 45% { + opacity: 1; + -webkit-transform: translate3d(0, -20px, 0); + transform: translate3d(0, -20px, 0); + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, 2000px, 0); + transform: translate3d(0, 2000px, 0); + } +} + +@keyframes bounceOutDown { + 20% { + -webkit-transform: translate3d(0, 10px, 0); + transform: translate3d(0, 10px, 0); + } + + 40%, 45% { + opacity: 1; + -webkit-transform: translate3d(0, -20px, 0); + transform: translate3d(0, -20px, 0); + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, 2000px, 0); + transform: translate3d(0, 2000px, 0); + } +} + +.bounceOutDown { + -webkit-animation-name: bounceOutDown; + animation-name: bounceOutDown; +} + +@-webkit-keyframes bounceOutLeft { + 20% { + opacity: 1; + -webkit-transform: translate3d(20px, 0, 0); + transform: translate3d(20px, 0, 0); + } + + to { + opacity: 0; + -webkit-transform: translate3d(-2000px, 0, 0); + transform: translate3d(-2000px, 0, 0); + } +} + +@keyframes bounceOutLeft { + 20% { + opacity: 1; + -webkit-transform: translate3d(20px, 0, 0); + transform: translate3d(20px, 0, 0); + } + + to { + opacity: 0; + -webkit-transform: translate3d(-2000px, 0, 0); + transform: translate3d(-2000px, 0, 0); + } +} + +.bounceOutLeft { + -webkit-animation-name: bounceOutLeft; + animation-name: bounceOutLeft; +} + +@-webkit-keyframes bounceOutRight { + 20% { + opacity: 1; + -webkit-transform: translate3d(-20px, 0, 0); + transform: translate3d(-20px, 0, 0); + } + + to { + opacity: 0; + -webkit-transform: translate3d(2000px, 0, 0); + transform: translate3d(2000px, 0, 0); + } +} + +@keyframes bounceOutRight { + 20% { + opacity: 1; + -webkit-transform: translate3d(-20px, 0, 0); + transform: translate3d(-20px, 0, 0); + } + + to { + opacity: 0; + -webkit-transform: translate3d(2000px, 0, 0); + transform: translate3d(2000px, 0, 0); + } +} + +.bounceOutRight { + -webkit-animation-name: bounceOutRight; + animation-name: bounceOutRight; +} + +@-webkit-keyframes bounceOutUp { + 20% { + -webkit-transform: translate3d(0, -10px, 0); + transform: translate3d(0, -10px, 0); + } + + 40%, 45% { + opacity: 1; + -webkit-transform: translate3d(0, 20px, 0); + transform: translate3d(0, 20px, 0); + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, -2000px, 0); + transform: translate3d(0, -2000px, 0); + } +} + +@keyframes bounceOutUp { + 20% { + -webkit-transform: translate3d(0, -10px, 0); + transform: translate3d(0, -10px, 0); + } + + 40%, 45% { + opacity: 1; + -webkit-transform: translate3d(0, 20px, 0); + transform: translate3d(0, 20px, 0); + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, -2000px, 0); + transform: translate3d(0, -2000px, 0); + } +} + +.bounceOutUp { + -webkit-animation-name: bounceOutUp; + animation-name: bounceOutUp; +} + +@-webkit-keyframes fadeIn { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} + +@keyframes fadeIn { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} + +.fadeIn { + -webkit-animation-name: fadeIn; + animation-name: fadeIn; +} + +@-webkit-keyframes fadeInDown { + from { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes fadeInDown { + from { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +.fadeInDown { + -webkit-animation-name: fadeInDown; + animation-name: fadeInDown; +} + +@-webkit-keyframes fadeInDownBig { + from { + opacity: 0; + -webkit-transform: translate3d(0, -2000px, 0); + transform: translate3d(0, -2000px, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes fadeInDownBig { + from { + opacity: 0; + -webkit-transform: translate3d(0, -2000px, 0); + transform: translate3d(0, -2000px, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +.fadeInDownBig { + -webkit-animation-name: fadeInDownBig; + animation-name: fadeInDownBig; +} + +@-webkit-keyframes fadeInLeft { + from { + opacity: 0; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes fadeInLeft { + from { + opacity: 0; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +.fadeInLeft { + -webkit-animation-name: fadeInLeft; + animation-name: fadeInLeft; +} + +@-webkit-keyframes fadeInLeftBig { + from { + opacity: 0; + -webkit-transform: translate3d(-2000px, 0, 0); + transform: translate3d(-2000px, 0, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes fadeInLeftBig { + from { + opacity: 0; + -webkit-transform: translate3d(-2000px, 0, 0); + transform: translate3d(-2000px, 0, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +.fadeInLeftBig { + -webkit-animation-name: fadeInLeftBig; + animation-name: fadeInLeftBig; +} + +@-webkit-keyframes fadeInRight { + from { + opacity: 0; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes fadeInRight { + from { + opacity: 0; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +.fadeInRight { + -webkit-animation-name: fadeInRight; + animation-name: fadeInRight; +} + +@-webkit-keyframes fadeInRightBig { + from { + opacity: 0; + -webkit-transform: translate3d(2000px, 0, 0); + transform: translate3d(2000px, 0, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes fadeInRightBig { + from { + opacity: 0; + -webkit-transform: translate3d(2000px, 0, 0); + transform: translate3d(2000px, 0, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +.fadeInRightBig { + -webkit-animation-name: fadeInRightBig; + animation-name: fadeInRightBig; +} + +@-webkit-keyframes fadeInUp { + from { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes fadeInUp { + from { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +.fadeInUp { + -webkit-animation-name: fadeInUp; + animation-name: fadeInUp; +} + +@-webkit-keyframes fadeInUpBig { + from { + opacity: 0; + -webkit-transform: translate3d(0, 2000px, 0); + transform: translate3d(0, 2000px, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes fadeInUpBig { + from { + opacity: 0; + -webkit-transform: translate3d(0, 2000px, 0); + transform: translate3d(0, 2000px, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +.fadeInUpBig { + -webkit-animation-name: fadeInUpBig; + animation-name: fadeInUpBig; +} + +@-webkit-keyframes fadeOut { + from { + opacity: 1; + } + + to { + opacity: 0; + } +} + +@keyframes fadeOut { + from { + opacity: 1; + } + + to { + opacity: 0; + } +} + +.fadeOut { + -webkit-animation-name: fadeOut; + animation-name: fadeOut; +} + +@-webkit-keyframes fadeOutDown { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } +} + +@keyframes fadeOutDown { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } +} + +.fadeOutDown { + -webkit-animation-name: fadeOutDown; + animation-name: fadeOutDown; +} + +@-webkit-keyframes fadeOutDownBig { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, 2000px, 0); + transform: translate3d(0, 2000px, 0); + } +} + +@keyframes fadeOutDownBig { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, 2000px, 0); + transform: translate3d(0, 2000px, 0); + } +} + +.fadeOutDownBig { + -webkit-animation-name: fadeOutDownBig; + animation-name: fadeOutDownBig; +} + +@-webkit-keyframes fadeOutLeft { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } +} + +@keyframes fadeOutLeft { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } +} + +.fadeOutLeft { + -webkit-animation-name: fadeOutLeft; + animation-name: fadeOutLeft; +} + +@-webkit-keyframes fadeOutLeftBig { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(-2000px, 0, 0); + transform: translate3d(-2000px, 0, 0); + } +} + +@keyframes fadeOutLeftBig { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(-2000px, 0, 0); + transform: translate3d(-2000px, 0, 0); + } +} + +.fadeOutLeftBig { + -webkit-animation-name: fadeOutLeftBig; + animation-name: fadeOutLeftBig; +} + +@-webkit-keyframes fadeOutRight { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } +} + +@keyframes fadeOutRight { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } +} + +.fadeOutRight { + -webkit-animation-name: fadeOutRight; + animation-name: fadeOutRight; +} + +@-webkit-keyframes fadeOutRightBig { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(2000px, 0, 0); + transform: translate3d(2000px, 0, 0); + } +} + +@keyframes fadeOutRightBig { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(2000px, 0, 0); + transform: translate3d(2000px, 0, 0); + } +} + +.fadeOutRightBig { + -webkit-animation-name: fadeOutRightBig; + animation-name: fadeOutRightBig; +} + +@-webkit-keyframes fadeOutUp { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } +} + +@keyframes fadeOutUp { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } +} + +.fadeOutUp { + -webkit-animation-name: fadeOutUp; + animation-name: fadeOutUp; +} + +@-webkit-keyframes fadeOutUpBig { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, -2000px, 0); + transform: translate3d(0, -2000px, 0); + } +} + +@keyframes fadeOutUpBig { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, -2000px, 0); + transform: translate3d(0, -2000px, 0); + } +} + +.fadeOutUpBig { + -webkit-animation-name: fadeOutUpBig; + animation-name: fadeOutUpBig; +} + +@-webkit-keyframes flip { + from { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -360deg); + transform: perspective(400px) rotate3d(0, 1, 0, -360deg); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + + 40% { + -webkit-transform: perspective(400px) translate3d(0, 0, 150px) rotate3d(0, 1, 0, -190deg); + transform: perspective(400px) translate3d(0, 0, 150px) rotate3d(0, 1, 0, -190deg); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + + 50% { + -webkit-transform: perspective(400px) translate3d(0, 0, 150px) rotate3d(0, 1, 0, -170deg); + transform: perspective(400px) translate3d(0, 0, 150px) rotate3d(0, 1, 0, -170deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + + 80% { + -webkit-transform: perspective(400px) scale3d(.95, .95, .95); + transform: perspective(400px) scale3d(.95, .95, .95); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + + to { + -webkit-transform: perspective(400px); + transform: perspective(400px); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } +} + +@keyframes flip { + from { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -360deg); + transform: perspective(400px) rotate3d(0, 1, 0, -360deg); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + + 40% { + -webkit-transform: perspective(400px) translate3d(0, 0, 150px) rotate3d(0, 1, 0, -190deg); + transform: perspective(400px) translate3d(0, 0, 150px) rotate3d(0, 1, 0, -190deg); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + + 50% { + -webkit-transform: perspective(400px) translate3d(0, 0, 150px) rotate3d(0, 1, 0, -170deg); + transform: perspective(400px) translate3d(0, 0, 150px) rotate3d(0, 1, 0, -170deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + + 80% { + -webkit-transform: perspective(400px) scale3d(.95, .95, .95); + transform: perspective(400px) scale3d(.95, .95, .95); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + + to { + -webkit-transform: perspective(400px); + transform: perspective(400px); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } +} + +.animated.flip { + -webkit-backface-visibility: visible; + backface-visibility: visible; + -webkit-animation-name: flip; + animation-name: flip; +} + +@-webkit-keyframes flipInX { + from { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + opacity: 0; + } + + 40% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + + 60% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + opacity: 1; + } + + 80% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + } + + to { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } +} + +@keyframes flipInX { + from { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + opacity: 0; + } + + 40% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + + 60% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + opacity: 1; + } + + 80% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + } + + to { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } +} + +.flipInX { + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; + -webkit-animation-name: flipInX; + animation-name: flipInX; +} + +@-webkit-keyframes flipInY { + from { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + opacity: 0; + } + + 40% { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -20deg); + transform: perspective(400px) rotate3d(0, 1, 0, -20deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + + 60% { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 10deg); + transform: perspective(400px) rotate3d(0, 1, 0, 10deg); + opacity: 1; + } + + 80% { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -5deg); + transform: perspective(400px) rotate3d(0, 1, 0, -5deg); + } + + to { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } +} + +@keyframes flipInY { + from { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + opacity: 0; + } + + 40% { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -20deg); + transform: perspective(400px) rotate3d(0, 1, 0, -20deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + + 60% { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 10deg); + transform: perspective(400px) rotate3d(0, 1, 0, 10deg); + opacity: 1; + } + + 80% { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -5deg); + transform: perspective(400px) rotate3d(0, 1, 0, -5deg); + } + + to { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } +} + +.flipInY { + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; + -webkit-animation-name: flipInY; + animation-name: flipInY; +} + +@-webkit-keyframes flipOutX { + from { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } + + 30% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + opacity: 1; + } + + to { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + opacity: 0; + } +} + +@keyframes flipOutX { + from { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } + + 30% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + opacity: 1; + } + + to { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + opacity: 0; + } +} + +.flipOutX { + -webkit-animation-name: flipOutX; + animation-name: flipOutX; + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} + +@-webkit-keyframes flipOutY { + from { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } + + 30% { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -15deg); + transform: perspective(400px) rotate3d(0, 1, 0, -15deg); + opacity: 1; + } + + to { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + opacity: 0; + } +} + +@keyframes flipOutY { + from { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } + + 30% { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -15deg); + transform: perspective(400px) rotate3d(0, 1, 0, -15deg); + opacity: 1; + } + + to { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + opacity: 0; + } +} + +.flipOutY { + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; + -webkit-animation-name: flipOutY; + animation-name: flipOutY; +} + +@-webkit-keyframes lightSpeedIn { + from { + -webkit-transform: translate3d(100%, 0, 0) skewX(-30deg); + transform: translate3d(100%, 0, 0) skewX(-30deg); + opacity: 0; + } + + 60% { + -webkit-transform: skewX(20deg); + transform: skewX(20deg); + opacity: 1; + } + + 80% { + -webkit-transform: skewX(-5deg); + transform: skewX(-5deg); + opacity: 1; + } + + to { + -webkit-transform: none; + transform: none; + opacity: 1; + } +} + +@keyframes lightSpeedIn { + from { + -webkit-transform: translate3d(100%, 0, 0) skewX(-30deg); + transform: translate3d(100%, 0, 0) skewX(-30deg); + opacity: 0; + } + + 60% { + -webkit-transform: skewX(20deg); + transform: skewX(20deg); + opacity: 1; + } + + 80% { + -webkit-transform: skewX(-5deg); + transform: skewX(-5deg); + opacity: 1; + } + + to { + -webkit-transform: none; + transform: none; + opacity: 1; + } +} + +.lightSpeedIn { + -webkit-animation-name: lightSpeedIn; + animation-name: lightSpeedIn; + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; +} + +@-webkit-keyframes lightSpeedOut { + from { + opacity: 1; + } + + to { + -webkit-transform: translate3d(100%, 0, 0) skewX(30deg); + transform: translate3d(100%, 0, 0) skewX(30deg); + opacity: 0; + } +} + +@keyframes lightSpeedOut { + from { + opacity: 1; + } + + to { + -webkit-transform: translate3d(100%, 0, 0) skewX(30deg); + transform: translate3d(100%, 0, 0) skewX(30deg); + opacity: 0; + } +} + +.lightSpeedOut { + -webkit-animation-name: lightSpeedOut; + animation-name: lightSpeedOut; + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; +} + +@-webkit-keyframes rotateIn { + from { + -webkit-transform-origin: center; + transform-origin: center; + -webkit-transform: rotate3d(0, 0, 1, -200deg); + transform: rotate3d(0, 0, 1, -200deg); + opacity: 0; + } + + to { + -webkit-transform-origin: center; + transform-origin: center; + -webkit-transform: none; + transform: none; + opacity: 1; + } +} + +@keyframes rotateIn { + from { + -webkit-transform-origin: center; + transform-origin: center; + -webkit-transform: rotate3d(0, 0, 1, -200deg); + transform: rotate3d(0, 0, 1, -200deg); + opacity: 0; + } + + to { + -webkit-transform-origin: center; + transform-origin: center; + -webkit-transform: none; + transform: none; + opacity: 1; + } +} + +.rotateIn { + -webkit-animation-name: rotateIn; + animation-name: rotateIn; +} + +@-webkit-keyframes rotateInDownLeft { + from { + -webkit-transform-origin: left bottom; + transform-origin: left bottom; + -webkit-transform: rotate3d(0, 0, 1, -45deg); + transform: rotate3d(0, 0, 1, -45deg); + opacity: 0; + } + + to { + -webkit-transform-origin: left bottom; + transform-origin: left bottom; + -webkit-transform: none; + transform: none; + opacity: 1; + } +} + +@keyframes rotateInDownLeft { + from { + -webkit-transform-origin: left bottom; + transform-origin: left bottom; + -webkit-transform: rotate3d(0, 0, 1, -45deg); + transform: rotate3d(0, 0, 1, -45deg); + opacity: 0; + } + + to { + -webkit-transform-origin: left bottom; + transform-origin: left bottom; + -webkit-transform: none; + transform: none; + opacity: 1; + } +} + +.rotateInDownLeft { + -webkit-animation-name: rotateInDownLeft; + animation-name: rotateInDownLeft; +} + +@-webkit-keyframes rotateInDownRight { + from { + -webkit-transform-origin: right bottom; + transform-origin: right bottom; + -webkit-transform: rotate3d(0, 0, 1, 45deg); + transform: rotate3d(0, 0, 1, 45deg); + opacity: 0; + } + + to { + -webkit-transform-origin: right bottom; + transform-origin: right bottom; + -webkit-transform: none; + transform: none; + opacity: 1; + } +} + +@keyframes rotateInDownRight { + from { + -webkit-transform-origin: right bottom; + transform-origin: right bottom; + -webkit-transform: rotate3d(0, 0, 1, 45deg); + transform: rotate3d(0, 0, 1, 45deg); + opacity: 0; + } + + to { + -webkit-transform-origin: right bottom; + transform-origin: right bottom; + -webkit-transform: none; + transform: none; + opacity: 1; + } +} + +.rotateInDownRight { + -webkit-animation-name: rotateInDownRight; + animation-name: rotateInDownRight; +} + +@-webkit-keyframes rotateInUpLeft { + from { + -webkit-transform-origin: left bottom; + transform-origin: left bottom; + -webkit-transform: rotate3d(0, 0, 1, 45deg); + transform: rotate3d(0, 0, 1, 45deg); + opacity: 0; + } + + to { + -webkit-transform-origin: left bottom; + transform-origin: left bottom; + -webkit-transform: none; + transform: none; + opacity: 1; + } +} + +@keyframes rotateInUpLeft { + from { + -webkit-transform-origin: left bottom; + transform-origin: left bottom; + -webkit-transform: rotate3d(0, 0, 1, 45deg); + transform: rotate3d(0, 0, 1, 45deg); + opacity: 0; + } + + to { + -webkit-transform-origin: left bottom; + transform-origin: left bottom; + -webkit-transform: none; + transform: none; + opacity: 1; + } +} + +.rotateInUpLeft { + -webkit-animation-name: rotateInUpLeft; + animation-name: rotateInUpLeft; +} + +@-webkit-keyframes rotateInUpRight { + from { + -webkit-transform-origin: right bottom; + transform-origin: right bottom; + -webkit-transform: rotate3d(0, 0, 1, -90deg); + transform: rotate3d(0, 0, 1, -90deg); + opacity: 0; + } + + to { + -webkit-transform-origin: right bottom; + transform-origin: right bottom; + -webkit-transform: none; + transform: none; + opacity: 1; + } +} + +@keyframes rotateInUpRight { + from { + -webkit-transform-origin: right bottom; + transform-origin: right bottom; + -webkit-transform: rotate3d(0, 0, 1, -90deg); + transform: rotate3d(0, 0, 1, -90deg); + opacity: 0; + } + + to { + -webkit-transform-origin: right bottom; + transform-origin: right bottom; + -webkit-transform: none; + transform: none; + opacity: 1; + } +} + +.rotateInUpRight { + -webkit-animation-name: rotateInUpRight; + animation-name: rotateInUpRight; +} + +@-webkit-keyframes rotateOut { + from { + -webkit-transform-origin: center; + transform-origin: center; + opacity: 1; + } + + to { + -webkit-transform-origin: center; + transform-origin: center; + -webkit-transform: rotate3d(0, 0, 1, 200deg); + transform: rotate3d(0, 0, 1, 200deg); + opacity: 0; + } +} + +@keyframes rotateOut { + from { + -webkit-transform-origin: center; + transform-origin: center; + opacity: 1; + } + + to { + -webkit-transform-origin: center; + transform-origin: center; + -webkit-transform: rotate3d(0, 0, 1, 200deg); + transform: rotate3d(0, 0, 1, 200deg); + opacity: 0; + } +} + +.rotateOut { + -webkit-animation-name: rotateOut; + animation-name: rotateOut; +} + +@-webkit-keyframes rotateOutDownLeft { + from { + -webkit-transform-origin: left bottom; + transform-origin: left bottom; + opacity: 1; + } + + to { + -webkit-transform-origin: left bottom; + transform-origin: left bottom; + -webkit-transform: rotate3d(0, 0, 1, 45deg); + transform: rotate3d(0, 0, 1, 45deg); + opacity: 0; + } +} + +@keyframes rotateOutDownLeft { + from { + -webkit-transform-origin: left bottom; + transform-origin: left bottom; + opacity: 1; + } + + to { + -webkit-transform-origin: left bottom; + transform-origin: left bottom; + -webkit-transform: rotate3d(0, 0, 1, 45deg); + transform: rotate3d(0, 0, 1, 45deg); + opacity: 0; + } +} + +.rotateOutDownLeft { + -webkit-animation-name: rotateOutDownLeft; + animation-name: rotateOutDownLeft; +} + +@-webkit-keyframes rotateOutDownRight { + from { + -webkit-transform-origin: right bottom; + transform-origin: right bottom; + opacity: 1; + } + + to { + -webkit-transform-origin: right bottom; + transform-origin: right bottom; + -webkit-transform: rotate3d(0, 0, 1, -45deg); + transform: rotate3d(0, 0, 1, -45deg); + opacity: 0; + } +} + +@keyframes rotateOutDownRight { + from { + -webkit-transform-origin: right bottom; + transform-origin: right bottom; + opacity: 1; + } + + to { + -webkit-transform-origin: right bottom; + transform-origin: right bottom; + -webkit-transform: rotate3d(0, 0, 1, -45deg); + transform: rotate3d(0, 0, 1, -45deg); + opacity: 0; + } +} + +.rotateOutDownRight { + -webkit-animation-name: rotateOutDownRight; + animation-name: rotateOutDownRight; +} + +@-webkit-keyframes rotateOutUpLeft { + from { + -webkit-transform-origin: left bottom; + transform-origin: left bottom; + opacity: 1; + } + + to { + -webkit-transform-origin: left bottom; + transform-origin: left bottom; + -webkit-transform: rotate3d(0, 0, 1, -45deg); + transform: rotate3d(0, 0, 1, -45deg); + opacity: 0; + } +} + +@keyframes rotateOutUpLeft { + from { + -webkit-transform-origin: left bottom; + transform-origin: left bottom; + opacity: 1; + } + + to { + -webkit-transform-origin: left bottom; + transform-origin: left bottom; + -webkit-transform: rotate3d(0, 0, 1, -45deg); + transform: rotate3d(0, 0, 1, -45deg); + opacity: 0; + } +} + +.rotateOutUpLeft { + -webkit-animation-name: rotateOutUpLeft; + animation-name: rotateOutUpLeft; +} + +@-webkit-keyframes rotateOutUpRight { + from { + -webkit-transform-origin: right bottom; + transform-origin: right bottom; + opacity: 1; + } + + to { + -webkit-transform-origin: right bottom; + transform-origin: right bottom; + -webkit-transform: rotate3d(0, 0, 1, 90deg); + transform: rotate3d(0, 0, 1, 90deg); + opacity: 0; + } +} + +@keyframes rotateOutUpRight { + from { + -webkit-transform-origin: right bottom; + transform-origin: right bottom; + opacity: 1; + } + + to { + -webkit-transform-origin: right bottom; + transform-origin: right bottom; + -webkit-transform: rotate3d(0, 0, 1, 90deg); + transform: rotate3d(0, 0, 1, 90deg); + opacity: 0; + } +} + +.rotateOutUpRight { + -webkit-animation-name: rotateOutUpRight; + animation-name: rotateOutUpRight; +} + +@-webkit-keyframes hinge { + 0% { + -webkit-transform-origin: top left; + transform-origin: top left; + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + } + + 20%, 60% { + -webkit-transform: rotate3d(0, 0, 1, 80deg); + transform: rotate3d(0, 0, 1, 80deg); + -webkit-transform-origin: top left; + transform-origin: top left; + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + } + + 40%, 80% { + -webkit-transform: rotate3d(0, 0, 1, 60deg); + transform: rotate3d(0, 0, 1, 60deg); + -webkit-transform-origin: top left; + transform-origin: top left; + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + opacity: 1; + } + + to { + -webkit-transform: translate3d(0, 700px, 0); + transform: translate3d(0, 700px, 0); + opacity: 0; + } +} + +@keyframes hinge { + 0% { + -webkit-transform-origin: top left; + transform-origin: top left; + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + } + + 20%, 60% { + -webkit-transform: rotate3d(0, 0, 1, 80deg); + transform: rotate3d(0, 0, 1, 80deg); + -webkit-transform-origin: top left; + transform-origin: top left; + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + } + + 40%, 80% { + -webkit-transform: rotate3d(0, 0, 1, 60deg); + transform: rotate3d(0, 0, 1, 60deg); + -webkit-transform-origin: top left; + transform-origin: top left; + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + opacity: 1; + } + + to { + -webkit-transform: translate3d(0, 700px, 0); + transform: translate3d(0, 700px, 0); + opacity: 0; + } +} + +.hinge { + -webkit-animation-name: hinge; + animation-name: hinge; +} + +/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */ + +@-webkit-keyframes rollIn { + from { + opacity: 0; + -webkit-transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg); + transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes rollIn { + from { + opacity: 0; + -webkit-transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg); + transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +.rollIn { + -webkit-animation-name: rollIn; + animation-name: rollIn; +} + +/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */ + +@-webkit-keyframes rollOut { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg); + transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg); + } +} + +@keyframes rollOut { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg); + transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg); + } +} + +.rollOut { + -webkit-animation-name: rollOut; + animation-name: rollOut; +} + +@-webkit-keyframes zoomIn { + from { + opacity: 0; + -webkit-transform: scale3d(.3, .3, .3); + transform: scale3d(.3, .3, .3); + } + + 50% { + opacity: 1; + } +} + +@keyframes zoomIn { + from { + opacity: 0; + -webkit-transform: scale3d(.3, .3, .3); + transform: scale3d(.3, .3, .3); + } + + 50% { + opacity: 1; + } +} + +.zoomIn { + -webkit-animation-name: zoomIn; + animation-name: zoomIn; +} + +@-webkit-keyframes zoomInDown { + from { + opacity: 0; + -webkit-transform: scale3d(.1, .1, .1) translate3d(0, -1000px, 0); + transform: scale3d(.1, .1, .1) translate3d(0, -1000px, 0); + -webkit-animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(.475, .475, .475) translate3d(0, 60px, 0); + transform: scale3d(.475, .475, .475) translate3d(0, 60px, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +@keyframes zoomInDown { + from { + opacity: 0; + -webkit-transform: scale3d(.1, .1, .1) translate3d(0, -1000px, 0); + transform: scale3d(.1, .1, .1) translate3d(0, -1000px, 0); + -webkit-animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(.475, .475, .475) translate3d(0, 60px, 0); + transform: scale3d(.475, .475, .475) translate3d(0, 60px, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +.zoomInDown { + -webkit-animation-name: zoomInDown; + animation-name: zoomInDown; +} + +@-webkit-keyframes zoomInLeft { + from { + opacity: 0; + -webkit-transform: scale3d(.1, .1, .1) translate3d(-1000px, 0, 0); + transform: scale3d(.1, .1, .1) translate3d(-1000px, 0, 0); + -webkit-animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(.475, .475, .475) translate3d(10px, 0, 0); + transform: scale3d(.475, .475, .475) translate3d(10px, 0, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +@keyframes zoomInLeft { + from { + opacity: 0; + -webkit-transform: scale3d(.1, .1, .1) translate3d(-1000px, 0, 0); + transform: scale3d(.1, .1, .1) translate3d(-1000px, 0, 0); + -webkit-animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(.475, .475, .475) translate3d(10px, 0, 0); + transform: scale3d(.475, .475, .475) translate3d(10px, 0, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +.zoomInLeft { + -webkit-animation-name: zoomInLeft; + animation-name: zoomInLeft; +} + +@-webkit-keyframes zoomInRight { + from { + opacity: 0; + -webkit-transform: scale3d(.1, .1, .1) translate3d(1000px, 0, 0); + transform: scale3d(.1, .1, .1) translate3d(1000px, 0, 0); + -webkit-animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(.475, .475, .475) translate3d(-10px, 0, 0); + transform: scale3d(.475, .475, .475) translate3d(-10px, 0, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +@keyframes zoomInRight { + from { + opacity: 0; + -webkit-transform: scale3d(.1, .1, .1) translate3d(1000px, 0, 0); + transform: scale3d(.1, .1, .1) translate3d(1000px, 0, 0); + -webkit-animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(.475, .475, .475) translate3d(-10px, 0, 0); + transform: scale3d(.475, .475, .475) translate3d(-10px, 0, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +.zoomInRight { + -webkit-animation-name: zoomInRight; + animation-name: zoomInRight; +} + +@-webkit-keyframes zoomInUp { + from { + opacity: 0; + -webkit-transform: scale3d(.1, .1, .1) translate3d(0, 1000px, 0); + transform: scale3d(.1, .1, .1) translate3d(0, 1000px, 0); + -webkit-animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0); + transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +@keyframes zoomInUp { + from { + opacity: 0; + -webkit-transform: scale3d(.1, .1, .1) translate3d(0, 1000px, 0); + transform: scale3d(.1, .1, .1) translate3d(0, 1000px, 0); + -webkit-animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0); + transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +.zoomInUp { + -webkit-animation-name: zoomInUp; + animation-name: zoomInUp; +} + +@-webkit-keyframes zoomOut { + from { + opacity: 1; + } + + 50% { + opacity: 0; + -webkit-transform: scale3d(.3, .3, .3); + transform: scale3d(.3, .3, .3); + } + + to { + opacity: 0; + } +} + +@keyframes zoomOut { + from { + opacity: 1; + } + + 50% { + opacity: 0; + -webkit-transform: scale3d(.3, .3, .3); + transform: scale3d(.3, .3, .3); + } + + to { + opacity: 0; + } +} + +.zoomOut { + -webkit-animation-name: zoomOut; + animation-name: zoomOut; +} + +@-webkit-keyframes zoomOutDown { + 40% { + opacity: 1; + -webkit-transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0); + transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0); + -webkit-animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + to { + opacity: 0; + -webkit-transform: scale3d(.1, .1, .1) translate3d(0, 2000px, 0); + transform: scale3d(.1, .1, .1) translate3d(0, 2000px, 0); + -webkit-transform-origin: center bottom; + transform-origin: center bottom; + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +@keyframes zoomOutDown { + 40% { + opacity: 1; + -webkit-transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0); + transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0); + -webkit-animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + to { + opacity: 0; + -webkit-transform: scale3d(.1, .1, .1) translate3d(0, 2000px, 0); + transform: scale3d(.1, .1, .1) translate3d(0, 2000px, 0); + -webkit-transform-origin: center bottom; + transform-origin: center bottom; + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +.zoomOutDown { + -webkit-animation-name: zoomOutDown; + animation-name: zoomOutDown; +} + +@-webkit-keyframes zoomOutLeft { + 40% { + opacity: 1; + -webkit-transform: scale3d(.475, .475, .475) translate3d(42px, 0, 0); + transform: scale3d(.475, .475, .475) translate3d(42px, 0, 0); + } + + to { + opacity: 0; + -webkit-transform: scale(.1) translate3d(-2000px, 0, 0); + transform: scale(.1) translate3d(-2000px, 0, 0); + -webkit-transform-origin: left center; + transform-origin: left center; + } +} + +@keyframes zoomOutLeft { + 40% { + opacity: 1; + -webkit-transform: scale3d(.475, .475, .475) translate3d(42px, 0, 0); + transform: scale3d(.475, .475, .475) translate3d(42px, 0, 0); + } + + to { + opacity: 0; + -webkit-transform: scale(.1) translate3d(-2000px, 0, 0); + transform: scale(.1) translate3d(-2000px, 0, 0); + -webkit-transform-origin: left center; + transform-origin: left center; + } +} + +.zoomOutLeft { + -webkit-animation-name: zoomOutLeft; + animation-name: zoomOutLeft; +} + +@-webkit-keyframes zoomOutRight { + 40% { + opacity: 1; + -webkit-transform: scale3d(.475, .475, .475) translate3d(-42px, 0, 0); + transform: scale3d(.475, .475, .475) translate3d(-42px, 0, 0); + } + + to { + opacity: 0; + -webkit-transform: scale(.1) translate3d(2000px, 0, 0); + transform: scale(.1) translate3d(2000px, 0, 0); + -webkit-transform-origin: right center; + transform-origin: right center; + } +} + +@keyframes zoomOutRight { + 40% { + opacity: 1; + -webkit-transform: scale3d(.475, .475, .475) translate3d(-42px, 0, 0); + transform: scale3d(.475, .475, .475) translate3d(-42px, 0, 0); + } + + to { + opacity: 0; + -webkit-transform: scale(.1) translate3d(2000px, 0, 0); + transform: scale(.1) translate3d(2000px, 0, 0); + -webkit-transform-origin: right center; + transform-origin: right center; + } +} + +.zoomOutRight { + -webkit-animation-name: zoomOutRight; + animation-name: zoomOutRight; +} + +@-webkit-keyframes zoomOutUp { + 40% { + opacity: 1; + -webkit-transform: scale3d(.475, .475, .475) translate3d(0, 60px, 0); + transform: scale3d(.475, .475, .475) translate3d(0, 60px, 0); + -webkit-animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + to { + opacity: 0; + -webkit-transform: scale3d(.1, .1, .1) translate3d(0, -2000px, 0); + transform: scale3d(.1, .1, .1) translate3d(0, -2000px, 0); + -webkit-transform-origin: center bottom; + transform-origin: center bottom; + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +@keyframes zoomOutUp { + 40% { + opacity: 1; + -webkit-transform: scale3d(.475, .475, .475) translate3d(0, 60px, 0); + transform: scale3d(.475, .475, .475) translate3d(0, 60px, 0); + -webkit-animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + to { + opacity: 0; + -webkit-transform: scale3d(.1, .1, .1) translate3d(0, -2000px, 0); + transform: scale3d(.1, .1, .1) translate3d(0, -2000px, 0); + -webkit-transform-origin: center bottom; + transform-origin: center bottom; + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +.zoomOutUp { + -webkit-animation-name: zoomOutUp; + animation-name: zoomOutUp; +} + +@-webkit-keyframes slideInDown { + from { + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + visibility: visible; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +@keyframes slideInDown { + from { + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + visibility: visible; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +.slideInDown { + -webkit-animation-name: slideInDown; + animation-name: slideInDown; +} + +@-webkit-keyframes slideInLeft { + from { + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + visibility: visible; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +@keyframes slideInLeft { + from { + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + visibility: visible; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +.slideInLeft { + -webkit-animation-name: slideInLeft; + animation-name: slideInLeft; +} + +@-webkit-keyframes slideInRight { + from { + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + visibility: visible; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +@keyframes slideInRight { + from { + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + visibility: visible; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +.slideInRight { + -webkit-animation-name: slideInRight; + animation-name: slideInRight; +} + +@-webkit-keyframes slideInUp { + from { + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + visibility: visible; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +@keyframes slideInUp { + from { + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + visibility: visible; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +.slideInUp { + -webkit-animation-name: slideInUp; + animation-name: slideInUp; +} + +@-webkit-keyframes slideOutDown { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } +} + +@keyframes slideOutDown { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } +} + +.slideOutDown { + -webkit-animation-name: slideOutDown; + animation-name: slideOutDown; +} + +@-webkit-keyframes slideOutLeft { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } +} + +@keyframes slideOutLeft { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } +} + +.slideOutLeft { + -webkit-animation-name: slideOutLeft; + animation-name: slideOutLeft; +} + +@-webkit-keyframes slideOutRight { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } +} + +@keyframes slideOutRight { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } +} + +.slideOutRight { + -webkit-animation-name: slideOutRight; + animation-name: slideOutRight; +} + +@-webkit-keyframes slideOutUp { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } +} + +@keyframes slideOutUp { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } +} + +.slideOutUp { + -webkit-animation-name: slideOutUp; + animation-name: slideOutUp; +} diff --git a/SuperAPI/wwwroot/rezero/default_ui/css/bootstrap.min.css b/SuperAPI/wwwroot/rezero/default_ui/css/bootstrap.min.css new file mode 100644 index 0000000..a0c0e02 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/css/bootstrap.min.css @@ -0,0 +1,5 @@ +/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/css/master-dark.css b/SuperAPI/wwwroot/rezero/default_ui/css/master-dark.css new file mode 100644 index 0000000..a5ac06b --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/css/master-dark.css @@ -0,0 +1,72 @@ +[data-theme="dark"] .mdi-palette { + color:#fff +} +[data-theme='dark'] .endpointPost .method { + background: #1a5336; /* 较暗的绿色背景 */ + color: #e0f2e9; /* 较亮的文字颜色,确保可读性 */ +} +[data-theme='dark'] .alert-success { + background-color: #0a3d2a; /* 较暗的绿色背景 */ + border-color: #0a3d2a; /* 较暗的绿色边框 */ + color: #e0f2e9; /* 较亮的文字颜色,确保可读性 */ +} +[data-theme="dark"] #apibox, [data-theme="dark"] #apibox .cad { + background: #1c1e2f !important +} +[data-theme='dark'] .sidebar-header, [data-theme='dark'] .lyear-layout-sidebar-scroll, [data-theme='dark'] .lyear-layout-header, [data-theme='dark'] .card, [data-theme='dark'] .jconfirm .jconfirm-box { + background: #1c1e2f !important +} +[data-theme="dark"] #app { + background: #1c1e2f !important; + padding: 35px; +} +[data-theme="dark"] .btn { + color: #d1d8e1; /* 暗色模式下的浅灰色文本 */ + padding: 8px 12px; + letter-spacing: 1px; + border-radius: 2px; + background-color: #353537; /* 深色背景 */ + outline: none !important; + -webkit-transition: 0.15s linear; + transition: 0.15s linear; + border-color: #353537 !important; +} + + + [data-theme="dark"] .btn:hover, + [data-theme="dark"] .btn:focus, + [data-theme="dark"] .btn:active { + color: #ffffff !important; /* 文本保持为白色 */ + } + + [data-theme="dark"] .btn:hover { + background-color: #4a4d50 !important; /* 稍微浅一点的深色背景 */ + border-color: #4a4d50 !important; /* 稍微浅一点的边框颜色 */ + } + + [data-theme="dark"] .btn:active { + background-color: #2e2f30 !important; /* 点击时的深色背景 */ + border-color: #2e2f30 !important; /* 点击时的边框颜色 */ + } + + [data-theme="dark"] .btn:focus { + background-color: #4a4d50 !important; /* 获取焦点时的背景色 */ + border-color: #4a4d50 !important; /* 获取焦点时的边框颜色 */ + box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); /* 聚焦时的蓝色阴影 */ + } +[data-theme='dark'] .alert-warning { + background-color: #ff7043; /* 暗色主题下使用的亮橙色背景 */ + border-color: #ff7043; /* 同样的边框颜色 */ + color: #ffffff; /* 白色文字 */ +} +[data-theme="dark"] .table-bordered th { + color: #fff; /* 白色文字 */ + background-color: #27223b; /* 深色背景 */ +} +[data-theme="dark"] .parameter-title { + background: #000 !important; + border-top: #000 !important; +} +[data-theme="dark"] .table thead th { + background-color: #1c1e2f !important; +} \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/css/master.css b/SuperAPI/wwwroot/rezero/default_ui/css/master.css new file mode 100644 index 0000000..fce5bf4 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/css/master.css @@ -0,0 +1,185 @@ + .border3CCC { + border: 3px solid #ccc !important; +} +.pointer { + cursor: pointer +} + +.red { + color: red; + margin-left: 2px; +} +.width1200 { + width: 1200px !important +} +.width1000 { + width: 1000px !important +} +.width950 { + width: 950px !important +} +.width800 { + width: 800px !important +} +.width500 { + width: 500px !important +} +.width200 { + width: 200px !important +} + +.width250 { + width: 250px !important +} +.width350 { + width: 350px !important +} +.width100 { + width: 100px !important +} + +.width50 { + width: 50px !important +} + +.width30 { + width: 30px !important +} +.width_r_80 { + width:80% !important; +} +.t_a_r { + text-align: right !important +} +.t_a_l { + text-align: left !important +} +.mi-w-100 { + min-width:100px !important; +} +.mi-w-150 { + min-width:150px !important; +} +.mi-w-200 { + min-width: 200px !important; +} +.text-align-left { + text-align:left !important +} +#loadingOverlay { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.1); + z-index: 9999; + align-items: center; + justify-content: center; +} + +#loadingMessage { + font-size: 24px; + color: white; + text-align: center; +} + +.dot { + height: 10px; + width: 10px; + background-color: white; + border-radius: 50%; + display: inline-block; + animation: dot 1.4s infinite; +} + + .dot:nth-child(1) { + animation-delay: 0s; + } + + .dot:nth-child(2) { + animation-delay: 0.5s; + } + + .dot:nth-child(3) { + animation-delay: 1s; + } + +@keyframes dot { + 0% { + transform: scale(0.7); + opacity: 0.7; + } + + 50% { + transform: scale(0.8); + opacity: 1; + } + + 100% { + transform: scale(0.7); + opacity: 0.7; + } +} +.caret-wrapper { + display: inline-block; + position: relative; +} + +.sort-desc .descending { + color: #666 +} +.sort-asc .ascending { + color: #666 +} +.sort-caret{ + position: absolute; + left: 50%; + transform: translateX(-50%); + margin-left: 10px; + color: #ccc +} + + .sort-caret.ascending { + bottom: 0; /* 调整位置 */ + cursor:pointer + } + + .sort-caret.descending { + top: -10px; /* 调整位置 */ + cursor:pointer + } + + .sort-caret i { + font-size: 1rem; /* 可以根据需要调整图标大小 */ + color: #333; /* 调整图标颜色 */ + } + + +.word-all { + word-wrap: break-word; + word-break: break-all; +} + +.master-table-container { + height: calc(100vh - 380px); + max-height: 70vh; /* 设置表格容器的最大高度,防止内容过多时出现滚动条 */ + overflow-y: auto; /* 启用垂直滚动条 */ +} + + .master-table-container thead th { + position: -webkit-sticky; /* 兼容性写法 */ + position: sticky; + top: 0; + background-color: #fff; /* 可以根据需要设置表头的背景色 */ + z-index: 2; /* 确保表头在上方 */ + } +.mypage .pagination { + position:relative; + top:10px; + margin:0 !important; +} +.topbar .close:focus, .topbar .close:hover { + opacity: 1 !important; +} \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/css/materialdesignicons.min.css b/SuperAPI/wwwroot/rezero/default_ui/css/materialdesignicons.min.css new file mode 100644 index 0000000..69c5775 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/css/materialdesignicons.min.css @@ -0,0 +1 @@ +/* MaterialDesignIcons.com */@font-face{font-family:"Material Design Icons";src:url("../fonts/materialdesignicons.eot?v=2.0.46");src:url("../fonts/materialdesignicons.eot?#iefix&v=2.0.46") format("embedded-opentype"),url("../fonts/materialdesignicons.woff2?v=2.0.46") format("woff2"),url("../fonts/materialdesignicons.woff?v=2.0.46") format("woff"),url("../fonts/materialdesignicons.ttf?v=2.0.46") format("truetype"),url("../fonts/materialdesignicons.svg?v=2.0.46#materialdesigniconsregular") format("svg");font-weight:normal;font-style:normal}.mdi:before,.mdi-set{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.mdi-access-point:before{content:"\F002"}.mdi-access-point-network:before{content:"\F003"}.mdi-account:before{content:"\F004"}.mdi-account-alert:before{content:"\F005"}.mdi-account-box:before{content:"\F006"}.mdi-account-box-outline:before{content:"\F007"}.mdi-account-card-details:before{content:"\F5D2"}.mdi-account-check:before{content:"\F008"}.mdi-account-circle:before{content:"\F009"}.mdi-account-convert:before{content:"\F00A"}.mdi-account-edit:before{content:"\F6BB"}.mdi-account-key:before{content:"\F00B"}.mdi-account-location:before{content:"\F00C"}.mdi-account-minus:before{content:"\F00D"}.mdi-account-multiple:before{content:"\F00E"}.mdi-account-multiple-minus:before{content:"\F5D3"}.mdi-account-multiple-outline:before{content:"\F00F"}.mdi-account-multiple-plus:before{content:"\F010"}.mdi-account-network:before{content:"\F011"}.mdi-account-off:before{content:"\F012"}.mdi-account-outline:before{content:"\F013"}.mdi-account-plus:before{content:"\F014"}.mdi-account-remove:before{content:"\F015"}.mdi-account-search:before{content:"\F016"}.mdi-account-settings:before{content:"\F630"}.mdi-account-settings-variant:before{content:"\F631"}.mdi-account-star:before{content:"\F017"}.mdi-account-switch:before{content:"\F019"}.mdi-adjust:before{content:"\F01A"}.mdi-air-conditioner:before{content:"\F01B"}.mdi-airballoon:before{content:"\F01C"}.mdi-airplane:before{content:"\F01D"}.mdi-airplane-landing:before{content:"\F5D4"}.mdi-airplane-off:before{content:"\F01E"}.mdi-airplane-takeoff:before{content:"\F5D5"}.mdi-airplay:before{content:"\F01F"}.mdi-alarm:before{content:"\F020"}.mdi-alarm-bell:before{content:"\F78D"}.mdi-alarm-check:before{content:"\F021"}.mdi-alarm-light:before{content:"\F78E"}.mdi-alarm-multiple:before{content:"\F022"}.mdi-alarm-off:before{content:"\F023"}.mdi-alarm-plus:before{content:"\F024"}.mdi-alarm-snooze:before{content:"\F68D"}.mdi-album:before{content:"\F025"}.mdi-alert:before{content:"\F026"}.mdi-alert-box:before{content:"\F027"}.mdi-alert-circle:before{content:"\F028"}.mdi-alert-circle-outline:before{content:"\F5D6"}.mdi-alert-decagram:before{content:"\F6BC"}.mdi-alert-octagon:before{content:"\F029"}.mdi-alert-octagram:before{content:"\F766"}.mdi-alert-outline:before{content:"\F02A"}.mdi-all-inclusive:before{content:"\F6BD"}.mdi-alpha:before{content:"\F02B"}.mdi-alphabetical:before{content:"\F02C"}.mdi-altimeter:before{content:"\F5D7"}.mdi-amazon:before{content:"\F02D"}.mdi-amazon-clouddrive:before{content:"\F02E"}.mdi-ambulance:before{content:"\F02F"}.mdi-amplifier:before{content:"\F030"}.mdi-anchor:before{content:"\F031"}.mdi-android:before{content:"\F032"}.mdi-android-debug-bridge:before{content:"\F033"}.mdi-android-head:before{content:"\F78F"}.mdi-android-studio:before{content:"\F034"}.mdi-angular:before{content:"\F6B1"}.mdi-angularjs:before{content:"\F6BE"}.mdi-animation:before{content:"\F5D8"}.mdi-apple:before{content:"\F035"}.mdi-apple-finder:before{content:"\F036"}.mdi-apple-ios:before{content:"\F037"}.mdi-apple-keyboard-caps:before{content:"\F632"}.mdi-apple-keyboard-command:before{content:"\F633"}.mdi-apple-keyboard-control:before{content:"\F634"}.mdi-apple-keyboard-option:before{content:"\F635"}.mdi-apple-keyboard-shift:before{content:"\F636"}.mdi-apple-mobileme:before{content:"\F038"}.mdi-apple-safari:before{content:"\F039"}.mdi-application:before{content:"\F614"}.mdi-approval:before{content:"\F790"}.mdi-apps:before{content:"\F03B"}.mdi-archive:before{content:"\F03C"}.mdi-arrange-bring-forward:before{content:"\F03D"}.mdi-arrange-bring-to-front:before{content:"\F03E"}.mdi-arrange-send-backward:before{content:"\F03F"}.mdi-arrange-send-to-back:before{content:"\F040"}.mdi-arrow-all:before{content:"\F041"}.mdi-arrow-bottom-left:before{content:"\F042"}.mdi-arrow-bottom-right:before{content:"\F043"}.mdi-arrow-collapse:before{content:"\F615"}.mdi-arrow-collapse-all:before{content:"\F044"}.mdi-arrow-collapse-down:before{content:"\F791"}.mdi-arrow-collapse-left:before{content:"\F792"}.mdi-arrow-collapse-right:before{content:"\F793"}.mdi-arrow-collapse-up:before{content:"\F794"}.mdi-arrow-down:before{content:"\F045"}.mdi-arrow-down-bold:before{content:"\F72D"}.mdi-arrow-down-bold-box:before{content:"\F72E"}.mdi-arrow-down-bold-box-outline:before{content:"\F72F"}.mdi-arrow-down-bold-circle:before{content:"\F047"}.mdi-arrow-down-bold-circle-outline:before{content:"\F048"}.mdi-arrow-down-bold-hexagon-outline:before{content:"\F049"}.mdi-arrow-down-box:before{content:"\F6BF"}.mdi-arrow-down-drop-circle:before{content:"\F04A"}.mdi-arrow-down-drop-circle-outline:before{content:"\F04B"}.mdi-arrow-down-thick:before{content:"\F046"}.mdi-arrow-expand:before{content:"\F616"}.mdi-arrow-expand-all:before{content:"\F04C"}.mdi-arrow-expand-down:before{content:"\F795"}.mdi-arrow-expand-left:before{content:"\F796"}.mdi-arrow-expand-right:before{content:"\F797"}.mdi-arrow-expand-up:before{content:"\F798"}.mdi-arrow-left:before{content:"\F04D"}.mdi-arrow-left-bold:before{content:"\F730"}.mdi-arrow-left-bold-box:before{content:"\F731"}.mdi-arrow-left-bold-box-outline:before{content:"\F732"}.mdi-arrow-left-bold-circle:before{content:"\F04F"}.mdi-arrow-left-bold-circle-outline:before{content:"\F050"}.mdi-arrow-left-bold-hexagon-outline:before{content:"\F051"}.mdi-arrow-left-box:before{content:"\F6C0"}.mdi-arrow-left-drop-circle:before{content:"\F052"}.mdi-arrow-left-drop-circle-outline:before{content:"\F053"}.mdi-arrow-left-thick:before{content:"\F04E"}.mdi-arrow-right:before{content:"\F054"}.mdi-arrow-right-bold:before{content:"\F733"}.mdi-arrow-right-bold-box:before{content:"\F734"}.mdi-arrow-right-bold-box-outline:before{content:"\F735"}.mdi-arrow-right-bold-circle:before{content:"\F056"}.mdi-arrow-right-bold-circle-outline:before{content:"\F057"}.mdi-arrow-right-bold-hexagon-outline:before{content:"\F058"}.mdi-arrow-right-box:before{content:"\F6C1"}.mdi-arrow-right-drop-circle:before{content:"\F059"}.mdi-arrow-right-drop-circle-outline:before{content:"\F05A"}.mdi-arrow-right-thick:before{content:"\F055"}.mdi-arrow-top-left:before{content:"\F05B"}.mdi-arrow-top-right:before{content:"\F05C"}.mdi-arrow-up:before{content:"\F05D"}.mdi-arrow-up-bold:before{content:"\F736"}.mdi-arrow-up-bold-box:before{content:"\F737"}.mdi-arrow-up-bold-box-outline:before{content:"\F738"}.mdi-arrow-up-bold-circle:before{content:"\F05F"}.mdi-arrow-up-bold-circle-outline:before{content:"\F060"}.mdi-arrow-up-bold-hexagon-outline:before{content:"\F061"}.mdi-arrow-up-box:before{content:"\F6C2"}.mdi-arrow-up-drop-circle:before{content:"\F062"}.mdi-arrow-up-drop-circle-outline:before{content:"\F063"}.mdi-arrow-up-thick:before{content:"\F05E"}.mdi-assistant:before{content:"\F064"}.mdi-asterisk:before{content:"\F6C3"}.mdi-at:before{content:"\F065"}.mdi-atom:before{content:"\F767"}.mdi-attachment:before{content:"\F066"}.mdi-audiobook:before{content:"\F067"}.mdi-auto-fix:before{content:"\F068"}.mdi-auto-upload:before{content:"\F069"}.mdi-autorenew:before{content:"\F06A"}.mdi-av-timer:before{content:"\F06B"}.mdi-baby:before{content:"\F06C"}.mdi-baby-buggy:before{content:"\F68E"}.mdi-backburger:before{content:"\F06D"}.mdi-backspace:before{content:"\F06E"}.mdi-backup-restore:before{content:"\F06F"}.mdi-bandcamp:before{content:"\F674"}.mdi-bank:before{content:"\F070"}.mdi-barcode:before{content:"\F071"}.mdi-barcode-scan:before{content:"\F072"}.mdi-barley:before{content:"\F073"}.mdi-barrel:before{content:"\F074"}.mdi-basecamp:before{content:"\F075"}.mdi-basket:before{content:"\F076"}.mdi-basket-fill:before{content:"\F077"}.mdi-basket-unfill:before{content:"\F078"}.mdi-battery:before{content:"\F079"}.mdi-battery-10:before{content:"\F07A"}.mdi-battery-20:before{content:"\F07B"}.mdi-battery-30:before{content:"\F07C"}.mdi-battery-40:before{content:"\F07D"}.mdi-battery-50:before{content:"\F07E"}.mdi-battery-60:before{content:"\F07F"}.mdi-battery-70:before{content:"\F080"}.mdi-battery-80:before{content:"\F081"}.mdi-battery-90:before{content:"\F082"}.mdi-battery-alert:before{content:"\F083"}.mdi-battery-charging:before{content:"\F084"}.mdi-battery-charging-100:before{content:"\F085"}.mdi-battery-charging-20:before{content:"\F086"}.mdi-battery-charging-30:before{content:"\F087"}.mdi-battery-charging-40:before{content:"\F088"}.mdi-battery-charging-60:before{content:"\F089"}.mdi-battery-charging-80:before{content:"\F08A"}.mdi-battery-charging-90:before{content:"\F08B"}.mdi-battery-minus:before{content:"\F08C"}.mdi-battery-negative:before{content:"\F08D"}.mdi-battery-outline:before{content:"\F08E"}.mdi-battery-plus:before{content:"\F08F"}.mdi-battery-positive:before{content:"\F090"}.mdi-battery-unknown:before{content:"\F091"}.mdi-beach:before{content:"\F092"}.mdi-beaker:before{content:"\F68F"}.mdi-beats:before{content:"\F097"}.mdi-beer:before{content:"\F098"}.mdi-behance:before{content:"\F099"}.mdi-bell:before{content:"\F09A"}.mdi-bell-off:before{content:"\F09B"}.mdi-bell-outline:before{content:"\F09C"}.mdi-bell-plus:before{content:"\F09D"}.mdi-bell-ring:before{content:"\F09E"}.mdi-bell-ring-outline:before{content:"\F09F"}.mdi-bell-sleep:before{content:"\F0A0"}.mdi-beta:before{content:"\F0A1"}.mdi-bible:before{content:"\F0A2"}.mdi-bike:before{content:"\F0A3"}.mdi-bing:before{content:"\F0A4"}.mdi-binoculars:before{content:"\F0A5"}.mdi-bio:before{content:"\F0A6"}.mdi-biohazard:before{content:"\F0A7"}.mdi-bitbucket:before{content:"\F0A8"}.mdi-black-mesa:before{content:"\F0A9"}.mdi-blackberry:before{content:"\F0AA"}.mdi-blender:before{content:"\F0AB"}.mdi-blinds:before{content:"\F0AC"}.mdi-block-helper:before{content:"\F0AD"}.mdi-blogger:before{content:"\F0AE"}.mdi-bluetooth:before{content:"\F0AF"}.mdi-bluetooth-audio:before{content:"\F0B0"}.mdi-bluetooth-connect:before{content:"\F0B1"}.mdi-bluetooth-off:before{content:"\F0B2"}.mdi-bluetooth-settings:before{content:"\F0B3"}.mdi-bluetooth-transfer:before{content:"\F0B4"}.mdi-blur:before{content:"\F0B5"}.mdi-blur-linear:before{content:"\F0B6"}.mdi-blur-off:before{content:"\F0B7"}.mdi-blur-radial:before{content:"\F0B8"}.mdi-bomb:before{content:"\F690"}.mdi-bomb-off:before{content:"\F6C4"}.mdi-bone:before{content:"\F0B9"}.mdi-book:before{content:"\F0BA"}.mdi-book-minus:before{content:"\F5D9"}.mdi-book-multiple:before{content:"\F0BB"}.mdi-book-multiple-variant:before{content:"\F0BC"}.mdi-book-open:before{content:"\F0BD"}.mdi-book-open-page-variant:before{content:"\F5DA"}.mdi-book-open-variant:before{content:"\F0BE"}.mdi-book-plus:before{content:"\F5DB"}.mdi-book-secure:before{content:"\F799"}.mdi-book-unsecure:before{content:"\F79A"}.mdi-book-variant:before{content:"\F0BF"}.mdi-bookmark:before{content:"\F0C0"}.mdi-bookmark-check:before{content:"\F0C1"}.mdi-bookmark-music:before{content:"\F0C2"}.mdi-bookmark-outline:before{content:"\F0C3"}.mdi-bookmark-plus:before{content:"\F0C5"}.mdi-bookmark-plus-outline:before{content:"\F0C4"}.mdi-bookmark-remove:before{content:"\F0C6"}.mdi-boombox:before{content:"\F5DC"}.mdi-bootstrap:before{content:"\F6C5"}.mdi-border-all:before{content:"\F0C7"}.mdi-border-bottom:before{content:"\F0C8"}.mdi-border-color:before{content:"\F0C9"}.mdi-border-horizontal:before{content:"\F0CA"}.mdi-border-inside:before{content:"\F0CB"}.mdi-border-left:before{content:"\F0CC"}.mdi-border-none:before{content:"\F0CD"}.mdi-border-outside:before{content:"\F0CE"}.mdi-border-right:before{content:"\F0CF"}.mdi-border-style:before{content:"\F0D0"}.mdi-border-top:before{content:"\F0D1"}.mdi-border-vertical:before{content:"\F0D2"}.mdi-bow-tie:before{content:"\F677"}.mdi-bowl:before{content:"\F617"}.mdi-bowling:before{content:"\F0D3"}.mdi-box:before{content:"\F0D4"}.mdi-box-cutter:before{content:"\F0D5"}.mdi-box-shadow:before{content:"\F637"}.mdi-bridge:before{content:"\F618"}.mdi-briefcase:before{content:"\F0D6"}.mdi-briefcase-check:before{content:"\F0D7"}.mdi-briefcase-download:before{content:"\F0D8"}.mdi-briefcase-upload:before{content:"\F0D9"}.mdi-brightness-1:before{content:"\F0DA"}.mdi-brightness-2:before{content:"\F0DB"}.mdi-brightness-3:before{content:"\F0DC"}.mdi-brightness-4:before{content:"\F0DD"}.mdi-brightness-5:before{content:"\F0DE"}.mdi-brightness-6:before{content:"\F0DF"}.mdi-brightness-7:before{content:"\F0E0"}.mdi-brightness-auto:before{content:"\F0E1"}.mdi-broom:before{content:"\F0E2"}.mdi-brush:before{content:"\F0E3"}.mdi-buffer:before{content:"\F619"}.mdi-bug:before{content:"\F0E4"}.mdi-bulletin-board:before{content:"\F0E5"}.mdi-bullhorn:before{content:"\F0E6"}.mdi-bullseye:before{content:"\F5DD"}.mdi-burst-mode:before{content:"\F5DE"}.mdi-bus:before{content:"\F0E7"}.mdi-bus-articulated-end:before{content:"\F79B"}.mdi-bus-articulated-front:before{content:"\F79C"}.mdi-bus-double-decker:before{content:"\F79D"}.mdi-bus-school:before{content:"\F79E"}.mdi-bus-side:before{content:"\F79F"}.mdi-cached:before{content:"\F0E8"}.mdi-cake:before{content:"\F0E9"}.mdi-cake-layered:before{content:"\F0EA"}.mdi-cake-variant:before{content:"\F0EB"}.mdi-calculator:before{content:"\F0EC"}.mdi-calendar:before{content:"\F0ED"}.mdi-calendar-blank:before{content:"\F0EE"}.mdi-calendar-check:before{content:"\F0EF"}.mdi-calendar-clock:before{content:"\F0F0"}.mdi-calendar-multiple:before{content:"\F0F1"}.mdi-calendar-multiple-check:before{content:"\F0F2"}.mdi-calendar-plus:before{content:"\F0F3"}.mdi-calendar-question:before{content:"\F691"}.mdi-calendar-range:before{content:"\F678"}.mdi-calendar-remove:before{content:"\F0F4"}.mdi-calendar-text:before{content:"\F0F5"}.mdi-calendar-today:before{content:"\F0F6"}.mdi-call-made:before{content:"\F0F7"}.mdi-call-merge:before{content:"\F0F8"}.mdi-call-missed:before{content:"\F0F9"}.mdi-call-received:before{content:"\F0FA"}.mdi-call-split:before{content:"\F0FB"}.mdi-camcorder:before{content:"\F0FC"}.mdi-camcorder-box:before{content:"\F0FD"}.mdi-camcorder-box-off:before{content:"\F0FE"}.mdi-camcorder-off:before{content:"\F0FF"}.mdi-camera:before{content:"\F100"}.mdi-camera-burst:before{content:"\F692"}.mdi-camera-enhance:before{content:"\F101"}.mdi-camera-front:before{content:"\F102"}.mdi-camera-front-variant:before{content:"\F103"}.mdi-camera-gopro:before{content:"\F7A0"}.mdi-camera-iris:before{content:"\F104"}.mdi-camera-metering-center:before{content:"\F7A1"}.mdi-camera-metering-matrix:before{content:"\F7A2"}.mdi-camera-metering-partial:before{content:"\F7A3"}.mdi-camera-metering-spot:before{content:"\F7A4"}.mdi-camera-off:before{content:"\F5DF"}.mdi-camera-party-mode:before{content:"\F105"}.mdi-camera-rear:before{content:"\F106"}.mdi-camera-rear-variant:before{content:"\F107"}.mdi-camera-switch:before{content:"\F108"}.mdi-camera-timer:before{content:"\F109"}.mdi-cancel:before{content:"\F739"}.mdi-candle:before{content:"\F5E2"}.mdi-candycane:before{content:"\F10A"}.mdi-cannabis:before{content:"\F7A5"}.mdi-car:before{content:"\F10B"}.mdi-car-battery:before{content:"\F10C"}.mdi-car-connected:before{content:"\F10D"}.mdi-car-convertable:before{content:"\F7A6"}.mdi-car-estate:before{content:"\F7A7"}.mdi-car-hatchback:before{content:"\F7A8"}.mdi-car-pickup:before{content:"\F7A9"}.mdi-car-side:before{content:"\F7AA"}.mdi-car-sports:before{content:"\F7AB"}.mdi-car-wash:before{content:"\F10E"}.mdi-caravan:before{content:"\F7AC"}.mdi-cards:before{content:"\F638"}.mdi-cards-outline:before{content:"\F639"}.mdi-cards-playing-outline:before{content:"\F63A"}.mdi-cards-variant:before{content:"\F6C6"}.mdi-carrot:before{content:"\F10F"}.mdi-cart:before{content:"\F110"}.mdi-cart-off:before{content:"\F66B"}.mdi-cart-outline:before{content:"\F111"}.mdi-cart-plus:before{content:"\F112"}.mdi-case-sensitive-alt:before{content:"\F113"}.mdi-cash:before{content:"\F114"}.mdi-cash-100:before{content:"\F115"}.mdi-cash-multiple:before{content:"\F116"}.mdi-cash-usd:before{content:"\F117"}.mdi-cast:before{content:"\F118"}.mdi-cast-connected:before{content:"\F119"}.mdi-cast-off:before{content:"\F789"}.mdi-castle:before{content:"\F11A"}.mdi-cat:before{content:"\F11B"}.mdi-cctv:before{content:"\F7AD"}.mdi-ceiling-light:before{content:"\F768"}.mdi-cellphone:before{content:"\F11C"}.mdi-cellphone-android:before{content:"\F11D"}.mdi-cellphone-basic:before{content:"\F11E"}.mdi-cellphone-dock:before{content:"\F11F"}.mdi-cellphone-iphone:before{content:"\F120"}.mdi-cellphone-link:before{content:"\F121"}.mdi-cellphone-link-off:before{content:"\F122"}.mdi-cellphone-settings:before{content:"\F123"}.mdi-certificate:before{content:"\F124"}.mdi-chair-school:before{content:"\F125"}.mdi-chart-arc:before{content:"\F126"}.mdi-chart-areaspline:before{content:"\F127"}.mdi-chart-bar:before{content:"\F128"}.mdi-chart-bar-stacked:before{content:"\F769"}.mdi-chart-bubble:before{content:"\F5E3"}.mdi-chart-donut:before{content:"\F7AE"}.mdi-chart-donut-variant:before{content:"\F7AF"}.mdi-chart-gantt:before{content:"\F66C"}.mdi-chart-histogram:before{content:"\F129"}.mdi-chart-line:before{content:"\F12A"}.mdi-chart-line-stacked:before{content:"\F76A"}.mdi-chart-line-variant:before{content:"\F7B0"}.mdi-chart-pie:before{content:"\F12B"}.mdi-chart-scatterplot-hexbin:before{content:"\F66D"}.mdi-chart-timeline:before{content:"\F66E"}.mdi-check:before{content:"\F12C"}.mdi-check-all:before{content:"\F12D"}.mdi-check-circle:before{content:"\F5E0"}.mdi-check-circle-outline:before{content:"\F5E1"}.mdi-checkbox-blank:before{content:"\F12E"}.mdi-checkbox-blank-circle:before{content:"\F12F"}.mdi-checkbox-blank-circle-outline:before{content:"\F130"}.mdi-checkbox-blank-outline:before{content:"\F131"}.mdi-checkbox-marked:before{content:"\F132"}.mdi-checkbox-marked-circle:before{content:"\F133"}.mdi-checkbox-marked-circle-outline:before{content:"\F134"}.mdi-checkbox-marked-outline:before{content:"\F135"}.mdi-checkbox-multiple-blank:before{content:"\F136"}.mdi-checkbox-multiple-blank-circle:before{content:"\F63B"}.mdi-checkbox-multiple-blank-circle-outline:before{content:"\F63C"}.mdi-checkbox-multiple-blank-outline:before{content:"\F137"}.mdi-checkbox-multiple-marked:before{content:"\F138"}.mdi-checkbox-multiple-marked-circle:before{content:"\F63D"}.mdi-checkbox-multiple-marked-circle-outline:before{content:"\F63E"}.mdi-checkbox-multiple-marked-outline:before{content:"\F139"}.mdi-checkerboard:before{content:"\F13A"}.mdi-chemical-weapon:before{content:"\F13B"}.mdi-chevron-double-down:before{content:"\F13C"}.mdi-chevron-double-left:before{content:"\F13D"}.mdi-chevron-double-right:before{content:"\F13E"}.mdi-chevron-double-up:before{content:"\F13F"}.mdi-chevron-down:before{content:"\F140"}.mdi-chevron-left:before{content:"\F141"}.mdi-chevron-right:before{content:"\F142"}.mdi-chevron-up:before{content:"\F143"}.mdi-chili-hot:before{content:"\F7B1"}.mdi-chili-medium:before{content:"\F7B2"}.mdi-chili-mild:before{content:"\F7B3"}.mdi-chip:before{content:"\F61A"}.mdi-church:before{content:"\F144"}.mdi-circle:before{content:"\F764"}.mdi-circle-outline:before{content:"\F765"}.mdi-cisco-webex:before{content:"\F145"}.mdi-city:before{content:"\F146"}.mdi-clipboard:before{content:"\F147"}.mdi-clipboard-account:before{content:"\F148"}.mdi-clipboard-alert:before{content:"\F149"}.mdi-clipboard-arrow-down:before{content:"\F14A"}.mdi-clipboard-arrow-left:before{content:"\F14B"}.mdi-clipboard-check:before{content:"\F14C"}.mdi-clipboard-flow:before{content:"\F6C7"}.mdi-clipboard-outline:before{content:"\F14D"}.mdi-clipboard-plus:before{content:"\F750"}.mdi-clipboard-text:before{content:"\F14E"}.mdi-clippy:before{content:"\F14F"}.mdi-clock:before{content:"\F150"}.mdi-clock-alert:before{content:"\F5CE"}.mdi-clock-end:before{content:"\F151"}.mdi-clock-fast:before{content:"\F152"}.mdi-clock-in:before{content:"\F153"}.mdi-clock-out:before{content:"\F154"}.mdi-clock-start:before{content:"\F155"}.mdi-close:before{content:"\F156"}.mdi-close-box:before{content:"\F157"}.mdi-close-box-outline:before{content:"\F158"}.mdi-close-circle:before{content:"\F159"}.mdi-close-circle-outline:before{content:"\F15A"}.mdi-close-network:before{content:"\F15B"}.mdi-close-octagon:before{content:"\F15C"}.mdi-close-octagon-outline:before{content:"\F15D"}.mdi-close-outline:before{content:"\F6C8"}.mdi-closed-caption:before{content:"\F15E"}.mdi-cloud:before{content:"\F15F"}.mdi-cloud-braces:before{content:"\F7B4"}.mdi-cloud-check:before{content:"\F160"}.mdi-cloud-circle:before{content:"\F161"}.mdi-cloud-download:before{content:"\F162"}.mdi-cloud-off-outline:before{content:"\F164"}.mdi-cloud-outline:before{content:"\F163"}.mdi-cloud-print:before{content:"\F165"}.mdi-cloud-print-outline:before{content:"\F166"}.mdi-cloud-sync:before{content:"\F63F"}.mdi-cloud-tags:before{content:"\F7B5"}.mdi-cloud-upload:before{content:"\F167"}.mdi-code-array:before{content:"\F168"}.mdi-code-braces:before{content:"\F169"}.mdi-code-brackets:before{content:"\F16A"}.mdi-code-equal:before{content:"\F16B"}.mdi-code-greater-than:before{content:"\F16C"}.mdi-code-greater-than-or-equal:before{content:"\F16D"}.mdi-code-less-than:before{content:"\F16E"}.mdi-code-less-than-or-equal:before{content:"\F16F"}.mdi-code-not-equal:before{content:"\F170"}.mdi-code-not-equal-variant:before{content:"\F171"}.mdi-code-parentheses:before{content:"\F172"}.mdi-code-string:before{content:"\F173"}.mdi-code-tags:before{content:"\F174"}.mdi-code-tags-check:before{content:"\F693"}.mdi-codepen:before{content:"\F175"}.mdi-coffee:before{content:"\F176"}.mdi-coffee-outline:before{content:"\F6C9"}.mdi-coffee-to-go:before{content:"\F177"}.mdi-coin:before{content:"\F178"}.mdi-coins:before{content:"\F694"}.mdi-collage:before{content:"\F640"}.mdi-color-helper:before{content:"\F179"}.mdi-comment:before{content:"\F17A"}.mdi-comment-account:before{content:"\F17B"}.mdi-comment-account-outline:before{content:"\F17C"}.mdi-comment-alert:before{content:"\F17D"}.mdi-comment-alert-outline:before{content:"\F17E"}.mdi-comment-check:before{content:"\F17F"}.mdi-comment-check-outline:before{content:"\F180"}.mdi-comment-multiple-outline:before{content:"\F181"}.mdi-comment-outline:before{content:"\F182"}.mdi-comment-plus-outline:before{content:"\F183"}.mdi-comment-processing:before{content:"\F184"}.mdi-comment-processing-outline:before{content:"\F185"}.mdi-comment-question-outline:before{content:"\F186"}.mdi-comment-remove-outline:before{content:"\F187"}.mdi-comment-text:before{content:"\F188"}.mdi-comment-text-outline:before{content:"\F189"}.mdi-compare:before{content:"\F18A"}.mdi-compass:before{content:"\F18B"}.mdi-compass-outline:before{content:"\F18C"}.mdi-console:before{content:"\F18D"}.mdi-console-line:before{content:"\F7B6"}.mdi-contact-mail:before{content:"\F18E"}.mdi-contacts:before{content:"\F6CA"}.mdi-content-copy:before{content:"\F18F"}.mdi-content-cut:before{content:"\F190"}.mdi-content-duplicate:before{content:"\F191"}.mdi-content-paste:before{content:"\F192"}.mdi-content-save:before{content:"\F193"}.mdi-content-save-all:before{content:"\F194"}.mdi-content-save-settings:before{content:"\F61B"}.mdi-contrast:before{content:"\F195"}.mdi-contrast-box:before{content:"\F196"}.mdi-contrast-circle:before{content:"\F197"}.mdi-cookie:before{content:"\F198"}.mdi-copyright:before{content:"\F5E6"}.mdi-corn:before{content:"\F7B7"}.mdi-counter:before{content:"\F199"}.mdi-cow:before{content:"\F19A"}.mdi-creation:before{content:"\F1C9"}.mdi-credit-card:before{content:"\F19B"}.mdi-credit-card-multiple:before{content:"\F19C"}.mdi-credit-card-off:before{content:"\F5E4"}.mdi-credit-card-plus:before{content:"\F675"}.mdi-credit-card-scan:before{content:"\F19D"}.mdi-crop:before{content:"\F19E"}.mdi-crop-free:before{content:"\F19F"}.mdi-crop-landscape:before{content:"\F1A0"}.mdi-crop-portrait:before{content:"\F1A1"}.mdi-crop-rotate:before{content:"\F695"}.mdi-crop-square:before{content:"\F1A2"}.mdi-crosshairs:before{content:"\F1A3"}.mdi-crosshairs-gps:before{content:"\F1A4"}.mdi-crown:before{content:"\F1A5"}.mdi-cube:before{content:"\F1A6"}.mdi-cube-outline:before{content:"\F1A7"}.mdi-cube-send:before{content:"\F1A8"}.mdi-cube-unfolded:before{content:"\F1A9"}.mdi-cup:before{content:"\F1AA"}.mdi-cup-off:before{content:"\F5E5"}.mdi-cup-water:before{content:"\F1AB"}.mdi-currency-btc:before{content:"\F1AC"}.mdi-currency-chf:before{content:"\F7B8"}.mdi-currency-cny:before{content:"\F7B9"}.mdi-currency-eth:before{content:"\F7BA"}.mdi-currency-eur:before{content:"\F1AD"}.mdi-currency-gbp:before{content:"\F1AE"}.mdi-currency-inr:before{content:"\F1AF"}.mdi-currency-jpy:before{content:"\F7BB"}.mdi-currency-krw:before{content:"\F7BC"}.mdi-currency-ngn:before{content:"\F1B0"}.mdi-currency-rub:before{content:"\F1B1"}.mdi-currency-sign:before{content:"\F7BD"}.mdi-currency-try:before{content:"\F1B2"}.mdi-currency-twd:before{content:"\F7BE"}.mdi-currency-usd:before{content:"\F1B3"}.mdi-currency-usd-off:before{content:"\F679"}.mdi-cursor-default:before{content:"\F1B4"}.mdi-cursor-default-outline:before{content:"\F1B5"}.mdi-cursor-move:before{content:"\F1B6"}.mdi-cursor-pointer:before{content:"\F1B7"}.mdi-cursor-text:before{content:"\F5E7"}.mdi-database:before{content:"\F1B8"}.mdi-database-minus:before{content:"\F1B9"}.mdi-database-plus:before{content:"\F1BA"}.mdi-debug-step-into:before{content:"\F1BB"}.mdi-debug-step-out:before{content:"\F1BC"}.mdi-debug-step-over:before{content:"\F1BD"}.mdi-decagram:before{content:"\F76B"}.mdi-decagram-outline:before{content:"\F76C"}.mdi-decimal-decrease:before{content:"\F1BE"}.mdi-decimal-increase:before{content:"\F1BF"}.mdi-delete:before{content:"\F1C0"}.mdi-delete-circle:before{content:"\F682"}.mdi-delete-empty:before{content:"\F6CB"}.mdi-delete-forever:before{content:"\F5E8"}.mdi-delete-sweep:before{content:"\F5E9"}.mdi-delete-variant:before{content:"\F1C1"}.mdi-delta:before{content:"\F1C2"}.mdi-deskphone:before{content:"\F1C3"}.mdi-desktop-classic:before{content:"\F7BF"}.mdi-desktop-mac:before{content:"\F1C4"}.mdi-desktop-tower:before{content:"\F1C5"}.mdi-details:before{content:"\F1C6"}.mdi-developer-board:before{content:"\F696"}.mdi-deviantart:before{content:"\F1C7"}.mdi-dialpad:before{content:"\F61C"}.mdi-diamond:before{content:"\F1C8"}.mdi-dice-1:before{content:"\F1CA"}.mdi-dice-2:before{content:"\F1CB"}.mdi-dice-3:before{content:"\F1CC"}.mdi-dice-4:before{content:"\F1CD"}.mdi-dice-5:before{content:"\F1CE"}.mdi-dice-6:before{content:"\F1CF"}.mdi-dice-d10:before{content:"\F76E"}.mdi-dice-d20:before{content:"\F5EA"}.mdi-dice-d4:before{content:"\F5EB"}.mdi-dice-d6:before{content:"\F5EC"}.mdi-dice-d8:before{content:"\F5ED"}.mdi-dice-multiple:before{content:"\F76D"}.mdi-dictionary:before{content:"\F61D"}.mdi-dip-switch:before{content:"\F7C0"}.mdi-directions:before{content:"\F1D0"}.mdi-directions-fork:before{content:"\F641"}.mdi-discord:before{content:"\F66F"}.mdi-disk:before{content:"\F5EE"}.mdi-disk-alert:before{content:"\F1D1"}.mdi-disqus:before{content:"\F1D2"}.mdi-disqus-outline:before{content:"\F1D3"}.mdi-division:before{content:"\F1D4"}.mdi-division-box:before{content:"\F1D5"}.mdi-dna:before{content:"\F683"}.mdi-dns:before{content:"\F1D6"}.mdi-do-not-disturb:before{content:"\F697"}.mdi-do-not-disturb-off:before{content:"\F698"}.mdi-dolby:before{content:"\F6B2"}.mdi-domain:before{content:"\F1D7"}.mdi-donkey:before{content:"\F7C1"}.mdi-dots-horizontal:before{content:"\F1D8"}.mdi-dots-horizontal-circle:before{content:"\F7C2"}.mdi-dots-vertical:before{content:"\F1D9"}.mdi-dots-vertical-circle:before{content:"\F7C3"}.mdi-douban:before{content:"\F699"}.mdi-download:before{content:"\F1DA"}.mdi-download-network:before{content:"\F6F3"}.mdi-drag:before{content:"\F1DB"}.mdi-drag-horizontal:before{content:"\F1DC"}.mdi-drag-vertical:before{content:"\F1DD"}.mdi-drawing:before{content:"\F1DE"}.mdi-drawing-box:before{content:"\F1DF"}.mdi-dribbble:before{content:"\F1E0"}.mdi-dribbble-box:before{content:"\F1E1"}.mdi-drone:before{content:"\F1E2"}.mdi-dropbox:before{content:"\F1E3"}.mdi-drupal:before{content:"\F1E4"}.mdi-duck:before{content:"\F1E5"}.mdi-dumbbell:before{content:"\F1E6"}.mdi-ear-hearing:before{content:"\F7C4"}.mdi-earth:before{content:"\F1E7"}.mdi-earth-box:before{content:"\F6CC"}.mdi-earth-box-off:before{content:"\F6CD"}.mdi-earth-off:before{content:"\F1E8"}.mdi-edge:before{content:"\F1E9"}.mdi-eject:before{content:"\F1EA"}.mdi-elephant:before{content:"\F7C5"}.mdi-elevation-decline:before{content:"\F1EB"}.mdi-elevation-rise:before{content:"\F1EC"}.mdi-elevator:before{content:"\F1ED"}.mdi-email:before{content:"\F1EE"}.mdi-email-alert:before{content:"\F6CE"}.mdi-email-open:before{content:"\F1EF"}.mdi-email-open-outline:before{content:"\F5EF"}.mdi-email-outline:before{content:"\F1F0"}.mdi-email-secure:before{content:"\F1F1"}.mdi-email-variant:before{content:"\F5F0"}.mdi-emby:before{content:"\F6B3"}.mdi-emoticon:before{content:"\F1F2"}.mdi-emoticon-cool:before{content:"\F1F3"}.mdi-emoticon-dead:before{content:"\F69A"}.mdi-emoticon-devil:before{content:"\F1F4"}.mdi-emoticon-excited:before{content:"\F69B"}.mdi-emoticon-happy:before{content:"\F1F5"}.mdi-emoticon-neutral:before{content:"\F1F6"}.mdi-emoticon-poop:before{content:"\F1F7"}.mdi-emoticon-sad:before{content:"\F1F8"}.mdi-emoticon-tongue:before{content:"\F1F9"}.mdi-engine:before{content:"\F1FA"}.mdi-engine-outline:before{content:"\F1FB"}.mdi-equal:before{content:"\F1FC"}.mdi-equal-box:before{content:"\F1FD"}.mdi-eraser:before{content:"\F1FE"}.mdi-eraser-variant:before{content:"\F642"}.mdi-escalator:before{content:"\F1FF"}.mdi-ethernet:before{content:"\F200"}.mdi-ethernet-cable:before{content:"\F201"}.mdi-ethernet-cable-off:before{content:"\F202"}.mdi-etsy:before{content:"\F203"}.mdi-ev-station:before{content:"\F5F1"}.mdi-eventbrite:before{content:"\F7C6"}.mdi-evernote:before{content:"\F204"}.mdi-exclamation:before{content:"\F205"}.mdi-exit-to-app:before{content:"\F206"}.mdi-export:before{content:"\F207"}.mdi-eye:before{content:"\F208"}.mdi-eye-off:before{content:"\F209"}.mdi-eye-off-outline:before{content:"\F6D0"}.mdi-eye-outline:before{content:"\F6CF"}.mdi-eyedropper:before{content:"\F20A"}.mdi-eyedropper-variant:before{content:"\F20B"}.mdi-face:before{content:"\F643"}.mdi-face-profile:before{content:"\F644"}.mdi-facebook:before{content:"\F20C"}.mdi-facebook-box:before{content:"\F20D"}.mdi-facebook-messenger:before{content:"\F20E"}.mdi-factory:before{content:"\F20F"}.mdi-fan:before{content:"\F210"}.mdi-fast-forward:before{content:"\F211"}.mdi-fast-forward-outline:before{content:"\F6D1"}.mdi-fax:before{content:"\F212"}.mdi-feather:before{content:"\F6D2"}.mdi-ferry:before{content:"\F213"}.mdi-file:before{content:"\F214"}.mdi-file-account:before{content:"\F73A"}.mdi-file-chart:before{content:"\F215"}.mdi-file-check:before{content:"\F216"}.mdi-file-cloud:before{content:"\F217"}.mdi-file-delimited:before{content:"\F218"}.mdi-file-document:before{content:"\F219"}.mdi-file-document-box:before{content:"\F21A"}.mdi-file-excel:before{content:"\F21B"}.mdi-file-excel-box:before{content:"\F21C"}.mdi-file-export:before{content:"\F21D"}.mdi-file-find:before{content:"\F21E"}.mdi-file-hidden:before{content:"\F613"}.mdi-file-image:before{content:"\F21F"}.mdi-file-import:before{content:"\F220"}.mdi-file-lock:before{content:"\F221"}.mdi-file-multiple:before{content:"\F222"}.mdi-file-music:before{content:"\F223"}.mdi-file-outline:before{content:"\F224"}.mdi-file-pdf:before{content:"\F225"}.mdi-file-pdf-box:before{content:"\F226"}.mdi-file-plus:before{content:"\F751"}.mdi-file-powerpoint:before{content:"\F227"}.mdi-file-powerpoint-box:before{content:"\F228"}.mdi-file-presentation-box:before{content:"\F229"}.mdi-file-restore:before{content:"\F670"}.mdi-file-send:before{content:"\F22A"}.mdi-file-tree:before{content:"\F645"}.mdi-file-video:before{content:"\F22B"}.mdi-file-word:before{content:"\F22C"}.mdi-file-word-box:before{content:"\F22D"}.mdi-file-xml:before{content:"\F22E"}.mdi-film:before{content:"\F22F"}.mdi-filmstrip:before{content:"\F230"}.mdi-filmstrip-off:before{content:"\F231"}.mdi-filter:before{content:"\F232"}.mdi-filter-outline:before{content:"\F233"}.mdi-filter-remove:before{content:"\F234"}.mdi-filter-remove-outline:before{content:"\F235"}.mdi-filter-variant:before{content:"\F236"}.mdi-find-replace:before{content:"\F6D3"}.mdi-fingerprint:before{content:"\F237"}.mdi-fire:before{content:"\F238"}.mdi-firefox:before{content:"\F239"}.mdi-fish:before{content:"\F23A"}.mdi-flag:before{content:"\F23B"}.mdi-flag-checkered:before{content:"\F23C"}.mdi-flag-outline:before{content:"\F23D"}.mdi-flag-outline-variant:before{content:"\F23E"}.mdi-flag-triangle:before{content:"\F23F"}.mdi-flag-variant:before{content:"\F240"}.mdi-flash:before{content:"\F241"}.mdi-flash-auto:before{content:"\F242"}.mdi-flash-off:before{content:"\F243"}.mdi-flash-outline:before{content:"\F6D4"}.mdi-flash-red-eye:before{content:"\F67A"}.mdi-flashlight:before{content:"\F244"}.mdi-flashlight-off:before{content:"\F245"}.mdi-flask:before{content:"\F093"}.mdi-flask-empty:before{content:"\F094"}.mdi-flask-empty-outline:before{content:"\F095"}.mdi-flask-outline:before{content:"\F096"}.mdi-flattr:before{content:"\F246"}.mdi-flip-to-back:before{content:"\F247"}.mdi-flip-to-front:before{content:"\F248"}.mdi-floppy:before{content:"\F249"}.mdi-flower:before{content:"\F24A"}.mdi-folder:before{content:"\F24B"}.mdi-folder-account:before{content:"\F24C"}.mdi-folder-download:before{content:"\F24D"}.mdi-folder-google-drive:before{content:"\F24E"}.mdi-folder-image:before{content:"\F24F"}.mdi-folder-lock:before{content:"\F250"}.mdi-folder-lock-open:before{content:"\F251"}.mdi-folder-move:before{content:"\F252"}.mdi-folder-multiple:before{content:"\F253"}.mdi-folder-multiple-image:before{content:"\F254"}.mdi-folder-multiple-outline:before{content:"\F255"}.mdi-folder-open:before{content:"\F76F"}.mdi-folder-outline:before{content:"\F256"}.mdi-folder-plus:before{content:"\F257"}.mdi-folder-remove:before{content:"\F258"}.mdi-folder-star:before{content:"\F69C"}.mdi-folder-upload:before{content:"\F259"}.mdi-font-awesome:before{content:"\F03A"}.mdi-food:before{content:"\F25A"}.mdi-food-apple:before{content:"\F25B"}.mdi-food-croissant:before{content:"\F7C7"}.mdi-food-fork-drink:before{content:"\F5F2"}.mdi-food-off:before{content:"\F5F3"}.mdi-food-variant:before{content:"\F25C"}.mdi-football:before{content:"\F25D"}.mdi-football-australian:before{content:"\F25E"}.mdi-football-helmet:before{content:"\F25F"}.mdi-forklift:before{content:"\F7C8"}.mdi-format-align-bottom:before{content:"\F752"}.mdi-format-align-center:before{content:"\F260"}.mdi-format-align-justify:before{content:"\F261"}.mdi-format-align-left:before{content:"\F262"}.mdi-format-align-middle:before{content:"\F753"}.mdi-format-align-right:before{content:"\F263"}.mdi-format-align-top:before{content:"\F754"}.mdi-format-annotation-plus:before{content:"\F646"}.mdi-format-bold:before{content:"\F264"}.mdi-format-clear:before{content:"\F265"}.mdi-format-color-fill:before{content:"\F266"}.mdi-format-color-text:before{content:"\F69D"}.mdi-format-float-center:before{content:"\F267"}.mdi-format-float-left:before{content:"\F268"}.mdi-format-float-none:before{content:"\F269"}.mdi-format-float-right:before{content:"\F26A"}.mdi-format-font:before{content:"\F6D5"}.mdi-format-header-1:before{content:"\F26B"}.mdi-format-header-2:before{content:"\F26C"}.mdi-format-header-3:before{content:"\F26D"}.mdi-format-header-4:before{content:"\F26E"}.mdi-format-header-5:before{content:"\F26F"}.mdi-format-header-6:before{content:"\F270"}.mdi-format-header-decrease:before{content:"\F271"}.mdi-format-header-equal:before{content:"\F272"}.mdi-format-header-increase:before{content:"\F273"}.mdi-format-header-pound:before{content:"\F274"}.mdi-format-horizontal-align-center:before{content:"\F61E"}.mdi-format-horizontal-align-left:before{content:"\F61F"}.mdi-format-horizontal-align-right:before{content:"\F620"}.mdi-format-indent-decrease:before{content:"\F275"}.mdi-format-indent-increase:before{content:"\F276"}.mdi-format-italic:before{content:"\F277"}.mdi-format-line-spacing:before{content:"\F278"}.mdi-format-line-style:before{content:"\F5C8"}.mdi-format-line-weight:before{content:"\F5C9"}.mdi-format-list-bulleted:before{content:"\F279"}.mdi-format-list-bulleted-type:before{content:"\F27A"}.mdi-format-list-checks:before{content:"\F755"}.mdi-format-list-numbers:before{content:"\F27B"}.mdi-format-page-break:before{content:"\F6D6"}.mdi-format-paint:before{content:"\F27C"}.mdi-format-paragraph:before{content:"\F27D"}.mdi-format-pilcrow:before{content:"\F6D7"}.mdi-format-quote-close:before{content:"\F27E"}.mdi-format-quote-open:before{content:"\F756"}.mdi-format-rotate-90:before{content:"\F6A9"}.mdi-format-section:before{content:"\F69E"}.mdi-format-size:before{content:"\F27F"}.mdi-format-strikethrough:before{content:"\F280"}.mdi-format-strikethrough-variant:before{content:"\F281"}.mdi-format-subscript:before{content:"\F282"}.mdi-format-superscript:before{content:"\F283"}.mdi-format-text:before{content:"\F284"}.mdi-format-textdirection-l-to-r:before{content:"\F285"}.mdi-format-textdirection-r-to-l:before{content:"\F286"}.mdi-format-title:before{content:"\F5F4"}.mdi-format-underline:before{content:"\F287"}.mdi-format-vertical-align-bottom:before{content:"\F621"}.mdi-format-vertical-align-center:before{content:"\F622"}.mdi-format-vertical-align-top:before{content:"\F623"}.mdi-format-wrap-inline:before{content:"\F288"}.mdi-format-wrap-square:before{content:"\F289"}.mdi-format-wrap-tight:before{content:"\F28A"}.mdi-format-wrap-top-bottom:before{content:"\F28B"}.mdi-forum:before{content:"\F28C"}.mdi-forward:before{content:"\F28D"}.mdi-foursquare:before{content:"\F28E"}.mdi-fridge:before{content:"\F28F"}.mdi-fridge-filled:before{content:"\F290"}.mdi-fridge-filled-bottom:before{content:"\F291"}.mdi-fridge-filled-top:before{content:"\F292"}.mdi-fuel:before{content:"\F7C9"}.mdi-fullscreen:before{content:"\F293"}.mdi-fullscreen-exit:before{content:"\F294"}.mdi-function:before{content:"\F295"}.mdi-gamepad:before{content:"\F296"}.mdi-gamepad-variant:before{content:"\F297"}.mdi-garage:before{content:"\F6D8"}.mdi-garage-open:before{content:"\F6D9"}.mdi-gas-cylinder:before{content:"\F647"}.mdi-gas-station:before{content:"\F298"}.mdi-gate:before{content:"\F299"}.mdi-gauge:before{content:"\F29A"}.mdi-gavel:before{content:"\F29B"}.mdi-gender-female:before{content:"\F29C"}.mdi-gender-male:before{content:"\F29D"}.mdi-gender-male-female:before{content:"\F29E"}.mdi-gender-transgender:before{content:"\F29F"}.mdi-gesture:before{content:"\F7CA"}.mdi-gesture-double-tap:before{content:"\F73B"}.mdi-gesture-swipe-down:before{content:"\F73C"}.mdi-gesture-swipe-left:before{content:"\F73D"}.mdi-gesture-swipe-right:before{content:"\F73E"}.mdi-gesture-swipe-up:before{content:"\F73F"}.mdi-gesture-tap:before{content:"\F740"}.mdi-gesture-two-double-tap:before{content:"\F741"}.mdi-gesture-two-tap:before{content:"\F742"}.mdi-ghost:before{content:"\F2A0"}.mdi-gift:before{content:"\F2A1"}.mdi-git:before{content:"\F2A2"}.mdi-github-box:before{content:"\F2A3"}.mdi-github-circle:before{content:"\F2A4"}.mdi-github-face:before{content:"\F6DA"}.mdi-glass-flute:before{content:"\F2A5"}.mdi-glass-mug:before{content:"\F2A6"}.mdi-glass-stange:before{content:"\F2A7"}.mdi-glass-tulip:before{content:"\F2A8"}.mdi-glassdoor:before{content:"\F2A9"}.mdi-glasses:before{content:"\F2AA"}.mdi-gmail:before{content:"\F2AB"}.mdi-gnome:before{content:"\F2AC"}.mdi-gondola:before{content:"\F685"}.mdi-google:before{content:"\F2AD"}.mdi-google-analytics:before{content:"\F7CB"}.mdi-google-assistant:before{content:"\F7CC"}.mdi-google-cardboard:before{content:"\F2AE"}.mdi-google-chrome:before{content:"\F2AF"}.mdi-google-circles:before{content:"\F2B0"}.mdi-google-circles-communities:before{content:"\F2B1"}.mdi-google-circles-extended:before{content:"\F2B2"}.mdi-google-circles-group:before{content:"\F2B3"}.mdi-google-controller:before{content:"\F2B4"}.mdi-google-controller-off:before{content:"\F2B5"}.mdi-google-drive:before{content:"\F2B6"}.mdi-google-earth:before{content:"\F2B7"}.mdi-google-glass:before{content:"\F2B8"}.mdi-google-keep:before{content:"\F6DB"}.mdi-google-maps:before{content:"\F5F5"}.mdi-google-nearby:before{content:"\F2B9"}.mdi-google-pages:before{content:"\F2BA"}.mdi-google-photos:before{content:"\F6DC"}.mdi-google-physical-web:before{content:"\F2BB"}.mdi-google-play:before{content:"\F2BC"}.mdi-google-plus:before{content:"\F2BD"}.mdi-google-plus-box:before{content:"\F2BE"}.mdi-google-translate:before{content:"\F2BF"}.mdi-google-wallet:before{content:"\F2C0"}.mdi-gradient:before{content:"\F69F"}.mdi-grease-pencil:before{content:"\F648"}.mdi-grid:before{content:"\F2C1"}.mdi-grid-large:before{content:"\F757"}.mdi-grid-off:before{content:"\F2C2"}.mdi-group:before{content:"\F2C3"}.mdi-guitar-acoustic:before{content:"\F770"}.mdi-guitar-electric:before{content:"\F2C4"}.mdi-guitar-pick:before{content:"\F2C5"}.mdi-guitar-pick-outline:before{content:"\F2C6"}.mdi-hackernews:before{content:"\F624"}.mdi-hamburger:before{content:"\F684"}.mdi-hand-pointing-right:before{content:"\F2C7"}.mdi-hanger:before{content:"\F2C8"}.mdi-hangouts:before{content:"\F2C9"}.mdi-harddisk:before{content:"\F2CA"}.mdi-headphones:before{content:"\F2CB"}.mdi-headphones-box:before{content:"\F2CC"}.mdi-headphones-off:before{content:"\F7CD"}.mdi-headphones-settings:before{content:"\F2CD"}.mdi-headset:before{content:"\F2CE"}.mdi-headset-dock:before{content:"\F2CF"}.mdi-headset-off:before{content:"\F2D0"}.mdi-heart:before{content:"\F2D1"}.mdi-heart-box:before{content:"\F2D2"}.mdi-heart-box-outline:before{content:"\F2D3"}.mdi-heart-broken:before{content:"\F2D4"}.mdi-heart-half:before{content:"\F6DE"}.mdi-heart-half-full:before{content:"\F6DD"}.mdi-heart-half-outline:before{content:"\F6DF"}.mdi-heart-off:before{content:"\F758"}.mdi-heart-outline:before{content:"\F2D5"}.mdi-heart-pulse:before{content:"\F5F6"}.mdi-help:before{content:"\F2D6"}.mdi-help-box:before{content:"\F78A"}.mdi-help-circle:before{content:"\F2D7"}.mdi-help-circle-outline:before{content:"\F625"}.mdi-help-network:before{content:"\F6F4"}.mdi-hexagon:before{content:"\F2D8"}.mdi-hexagon-multiple:before{content:"\F6E0"}.mdi-hexagon-outline:before{content:"\F2D9"}.mdi-high-definition:before{content:"\F7CE"}.mdi-highway:before{content:"\F5F7"}.mdi-history:before{content:"\F2DA"}.mdi-hololens:before{content:"\F2DB"}.mdi-home:before{content:"\F2DC"}.mdi-home-assistant:before{content:"\F7CF"}.mdi-home-automation:before{content:"\F7D0"}.mdi-home-circle:before{content:"\F7D1"}.mdi-home-map-marker:before{content:"\F5F8"}.mdi-home-modern:before{content:"\F2DD"}.mdi-home-outline:before{content:"\F6A0"}.mdi-home-variant:before{content:"\F2DE"}.mdi-hook:before{content:"\F6E1"}.mdi-hook-off:before{content:"\F6E2"}.mdi-hops:before{content:"\F2DF"}.mdi-hospital:before{content:"\F2E0"}.mdi-hospital-building:before{content:"\F2E1"}.mdi-hospital-marker:before{content:"\F2E2"}.mdi-hotel:before{content:"\F2E3"}.mdi-houzz:before{content:"\F2E4"}.mdi-houzz-box:before{content:"\F2E5"}.mdi-human:before{content:"\F2E6"}.mdi-human-child:before{content:"\F2E7"}.mdi-human-female:before{content:"\F649"}.mdi-human-greeting:before{content:"\F64A"}.mdi-human-handsdown:before{content:"\F64B"}.mdi-human-handsup:before{content:"\F64C"}.mdi-human-male:before{content:"\F64D"}.mdi-human-male-female:before{content:"\F2E8"}.mdi-human-pregnant:before{content:"\F5CF"}.mdi-humble-bundle:before{content:"\F743"}.mdi-image:before{content:"\F2E9"}.mdi-image-album:before{content:"\F2EA"}.mdi-image-area:before{content:"\F2EB"}.mdi-image-area-close:before{content:"\F2EC"}.mdi-image-broken:before{content:"\F2ED"}.mdi-image-broken-variant:before{content:"\F2EE"}.mdi-image-filter:before{content:"\F2EF"}.mdi-image-filter-black-white:before{content:"\F2F0"}.mdi-image-filter-center-focus:before{content:"\F2F1"}.mdi-image-filter-center-focus-weak:before{content:"\F2F2"}.mdi-image-filter-drama:before{content:"\F2F3"}.mdi-image-filter-frames:before{content:"\F2F4"}.mdi-image-filter-hdr:before{content:"\F2F5"}.mdi-image-filter-none:before{content:"\F2F6"}.mdi-image-filter-tilt-shift:before{content:"\F2F7"}.mdi-image-filter-vintage:before{content:"\F2F8"}.mdi-image-multiple:before{content:"\F2F9"}.mdi-import:before{content:"\F2FA"}.mdi-inbox:before{content:"\F686"}.mdi-inbox-arrow-down:before{content:"\F2FB"}.mdi-inbox-arrow-up:before{content:"\F3D1"}.mdi-incognito:before{content:"\F5F9"}.mdi-infinity:before{content:"\F6E3"}.mdi-information:before{content:"\F2FC"}.mdi-information-outline:before{content:"\F2FD"}.mdi-information-variant:before{content:"\F64E"}.mdi-instagram:before{content:"\F2FE"}.mdi-instapaper:before{content:"\F2FF"}.mdi-internet-explorer:before{content:"\F300"}.mdi-invert-colors:before{content:"\F301"}.mdi-itunes:before{content:"\F676"}.mdi-jeepney:before{content:"\F302"}.mdi-jira:before{content:"\F303"}.mdi-jsfiddle:before{content:"\F304"}.mdi-json:before{content:"\F626"}.mdi-keg:before{content:"\F305"}.mdi-kettle:before{content:"\F5FA"}.mdi-key:before{content:"\F306"}.mdi-key-change:before{content:"\F307"}.mdi-key-minus:before{content:"\F308"}.mdi-key-plus:before{content:"\F309"}.mdi-key-remove:before{content:"\F30A"}.mdi-key-variant:before{content:"\F30B"}.mdi-keyboard:before{content:"\F30C"}.mdi-keyboard-backspace:before{content:"\F30D"}.mdi-keyboard-caps:before{content:"\F30E"}.mdi-keyboard-close:before{content:"\F30F"}.mdi-keyboard-off:before{content:"\F310"}.mdi-keyboard-return:before{content:"\F311"}.mdi-keyboard-tab:before{content:"\F312"}.mdi-keyboard-variant:before{content:"\F313"}.mdi-kickstarter:before{content:"\F744"}.mdi-kodi:before{content:"\F314"}.mdi-label:before{content:"\F315"}.mdi-label-outline:before{content:"\F316"}.mdi-lambda:before{content:"\F627"}.mdi-lamp:before{content:"\F6B4"}.mdi-lan:before{content:"\F317"}.mdi-lan-connect:before{content:"\F318"}.mdi-lan-disconnect:before{content:"\F319"}.mdi-lan-pending:before{content:"\F31A"}.mdi-language-c:before{content:"\F671"}.mdi-language-cpp:before{content:"\F672"}.mdi-language-csharp:before{content:"\F31B"}.mdi-language-css3:before{content:"\F31C"}.mdi-language-go:before{content:"\F7D2"}.mdi-language-html5:before{content:"\F31D"}.mdi-language-javascript:before{content:"\F31E"}.mdi-language-php:before{content:"\F31F"}.mdi-language-python:before{content:"\F320"}.mdi-language-python-text:before{content:"\F321"}.mdi-language-r:before{content:"\F7D3"}.mdi-language-swift:before{content:"\F6E4"}.mdi-language-typescript:before{content:"\F6E5"}.mdi-laptop:before{content:"\F322"}.mdi-laptop-chromebook:before{content:"\F323"}.mdi-laptop-mac:before{content:"\F324"}.mdi-laptop-off:before{content:"\F6E6"}.mdi-laptop-windows:before{content:"\F325"}.mdi-lastfm:before{content:"\F326"}.mdi-launch:before{content:"\F327"}.mdi-lava-lamp:before{content:"\F7D4"}.mdi-layers:before{content:"\F328"}.mdi-layers-off:before{content:"\F329"}.mdi-lead-pencil:before{content:"\F64F"}.mdi-leaf:before{content:"\F32A"}.mdi-led-off:before{content:"\F32B"}.mdi-led-on:before{content:"\F32C"}.mdi-led-outline:before{content:"\F32D"}.mdi-led-strip:before{content:"\F7D5"}.mdi-led-variant-off:before{content:"\F32E"}.mdi-led-variant-on:before{content:"\F32F"}.mdi-led-variant-outline:before{content:"\F330"}.mdi-library:before{content:"\F331"}.mdi-library-books:before{content:"\F332"}.mdi-library-music:before{content:"\F333"}.mdi-library-plus:before{content:"\F334"}.mdi-lightbulb:before{content:"\F335"}.mdi-lightbulb-on:before{content:"\F6E7"}.mdi-lightbulb-on-outline:before{content:"\F6E8"}.mdi-lightbulb-outline:before{content:"\F336"}.mdi-link:before{content:"\F337"}.mdi-link-off:before{content:"\F338"}.mdi-link-variant:before{content:"\F339"}.mdi-link-variant-off:before{content:"\F33A"}.mdi-linkedin:before{content:"\F33B"}.mdi-linkedin-box:before{content:"\F33C"}.mdi-linux:before{content:"\F33D"}.mdi-loading:before{content:"\F771"}.mdi-lock:before{content:"\F33E"}.mdi-lock-open:before{content:"\F33F"}.mdi-lock-open-outline:before{content:"\F340"}.mdi-lock-outline:before{content:"\F341"}.mdi-lock-pattern:before{content:"\F6E9"}.mdi-lock-plus:before{content:"\F5FB"}.mdi-lock-reset:before{content:"\F772"}.mdi-locker:before{content:"\F7D6"}.mdi-locker-multiple:before{content:"\F7D7"}.mdi-login:before{content:"\F342"}.mdi-login-variant:before{content:"\F5FC"}.mdi-logout:before{content:"\F343"}.mdi-logout-variant:before{content:"\F5FD"}.mdi-looks:before{content:"\F344"}.mdi-loop:before{content:"\F6EA"}.mdi-loupe:before{content:"\F345"}.mdi-lumx:before{content:"\F346"}.mdi-magnet:before{content:"\F347"}.mdi-magnet-on:before{content:"\F348"}.mdi-magnify:before{content:"\F349"}.mdi-magnify-minus:before{content:"\F34A"}.mdi-magnify-minus-outline:before{content:"\F6EB"}.mdi-magnify-plus:before{content:"\F34B"}.mdi-magnify-plus-outline:before{content:"\F6EC"}.mdi-mail-ru:before{content:"\F34C"}.mdi-mailbox:before{content:"\F6ED"}.mdi-map:before{content:"\F34D"}.mdi-map-marker:before{content:"\F34E"}.mdi-map-marker-circle:before{content:"\F34F"}.mdi-map-marker-minus:before{content:"\F650"}.mdi-map-marker-multiple:before{content:"\F350"}.mdi-map-marker-off:before{content:"\F351"}.mdi-map-marker-outline:before{content:"\F7D8"}.mdi-map-marker-plus:before{content:"\F651"}.mdi-map-marker-radius:before{content:"\F352"}.mdi-margin:before{content:"\F353"}.mdi-markdown:before{content:"\F354"}.mdi-marker:before{content:"\F652"}.mdi-marker-check:before{content:"\F355"}.mdi-martini:before{content:"\F356"}.mdi-material-ui:before{content:"\F357"}.mdi-math-compass:before{content:"\F358"}.mdi-matrix:before{content:"\F628"}.mdi-maxcdn:before{content:"\F359"}.mdi-medical-bag:before{content:"\F6EE"}.mdi-medium:before{content:"\F35A"}.mdi-memory:before{content:"\F35B"}.mdi-menu:before{content:"\F35C"}.mdi-menu-down:before{content:"\F35D"}.mdi-menu-down-outline:before{content:"\F6B5"}.mdi-menu-left:before{content:"\F35E"}.mdi-menu-right:before{content:"\F35F"}.mdi-menu-up:before{content:"\F360"}.mdi-menu-up-outline:before{content:"\F6B6"}.mdi-message:before{content:"\F361"}.mdi-message-alert:before{content:"\F362"}.mdi-message-bulleted:before{content:"\F6A1"}.mdi-message-bulleted-off:before{content:"\F6A2"}.mdi-message-draw:before{content:"\F363"}.mdi-message-image:before{content:"\F364"}.mdi-message-outline:before{content:"\F365"}.mdi-message-plus:before{content:"\F653"}.mdi-message-processing:before{content:"\F366"}.mdi-message-reply:before{content:"\F367"}.mdi-message-reply-text:before{content:"\F368"}.mdi-message-settings:before{content:"\F6EF"}.mdi-message-settings-variant:before{content:"\F6F0"}.mdi-message-text:before{content:"\F369"}.mdi-message-text-outline:before{content:"\F36A"}.mdi-message-video:before{content:"\F36B"}.mdi-meteor:before{content:"\F629"}.mdi-metronome:before{content:"\F7D9"}.mdi-metronome-tick:before{content:"\F7DA"}.mdi-micro-sd:before{content:"\F7DB"}.mdi-microphone:before{content:"\F36C"}.mdi-microphone-off:before{content:"\F36D"}.mdi-microphone-outline:before{content:"\F36E"}.mdi-microphone-settings:before{content:"\F36F"}.mdi-microphone-variant:before{content:"\F370"}.mdi-microphone-variant-off:before{content:"\F371"}.mdi-microscope:before{content:"\F654"}.mdi-microsoft:before{content:"\F372"}.mdi-minecraft:before{content:"\F373"}.mdi-minus:before{content:"\F374"}.mdi-minus-box:before{content:"\F375"}.mdi-minus-box-outline:before{content:"\F6F1"}.mdi-minus-circle:before{content:"\F376"}.mdi-minus-circle-outline:before{content:"\F377"}.mdi-minus-network:before{content:"\F378"}.mdi-mixcloud:before{content:"\F62A"}.mdi-mixer:before{content:"\F7DC"}.mdi-monitor:before{content:"\F379"}.mdi-monitor-multiple:before{content:"\F37A"}.mdi-more:before{content:"\F37B"}.mdi-motorbike:before{content:"\F37C"}.mdi-mouse:before{content:"\F37D"}.mdi-mouse-off:before{content:"\F37E"}.mdi-mouse-variant:before{content:"\F37F"}.mdi-mouse-variant-off:before{content:"\F380"}.mdi-move-resize:before{content:"\F655"}.mdi-move-resize-variant:before{content:"\F656"}.mdi-movie:before{content:"\F381"}.mdi-movie-roll:before{content:"\F7DD"}.mdi-multiplication:before{content:"\F382"}.mdi-multiplication-box:before{content:"\F383"}.mdi-mushroom:before{content:"\F7DE"}.mdi-mushroom-outline:before{content:"\F7DF"}.mdi-music:before{content:"\F759"}.mdi-music-box:before{content:"\F384"}.mdi-music-box-outline:before{content:"\F385"}.mdi-music-circle:before{content:"\F386"}.mdi-music-note:before{content:"\F387"}.mdi-music-note-bluetooth:before{content:"\F5FE"}.mdi-music-note-bluetooth-off:before{content:"\F5FF"}.mdi-music-note-eighth:before{content:"\F388"}.mdi-music-note-half:before{content:"\F389"}.mdi-music-note-off:before{content:"\F38A"}.mdi-music-note-quarter:before{content:"\F38B"}.mdi-music-note-sixteenth:before{content:"\F38C"}.mdi-music-note-whole:before{content:"\F38D"}.mdi-music-off:before{content:"\F75A"}.mdi-nature:before{content:"\F38E"}.mdi-nature-people:before{content:"\F38F"}.mdi-navigation:before{content:"\F390"}.mdi-near-me:before{content:"\F5CD"}.mdi-needle:before{content:"\F391"}.mdi-nest-protect:before{content:"\F392"}.mdi-nest-thermostat:before{content:"\F393"}.mdi-netflix:before{content:"\F745"}.mdi-network:before{content:"\F6F2"}.mdi-new-box:before{content:"\F394"}.mdi-newspaper:before{content:"\F395"}.mdi-nfc:before{content:"\F396"}.mdi-nfc-tap:before{content:"\F397"}.mdi-nfc-variant:before{content:"\F398"}.mdi-ninja:before{content:"\F773"}.mdi-nintendo-switch:before{content:"\F7E0"}.mdi-nodejs:before{content:"\F399"}.mdi-note:before{content:"\F39A"}.mdi-note-multiple:before{content:"\F6B7"}.mdi-note-multiple-outline:before{content:"\F6B8"}.mdi-note-outline:before{content:"\F39B"}.mdi-note-plus:before{content:"\F39C"}.mdi-note-plus-outline:before{content:"\F39D"}.mdi-note-text:before{content:"\F39E"}.mdi-notification-clear-all:before{content:"\F39F"}.mdi-npm:before{content:"\F6F6"}.mdi-nuke:before{content:"\F6A3"}.mdi-null:before{content:"\F7E1"}.mdi-numeric:before{content:"\F3A0"}.mdi-numeric-0-box:before{content:"\F3A1"}.mdi-numeric-0-box-multiple-outline:before{content:"\F3A2"}.mdi-numeric-0-box-outline:before{content:"\F3A3"}.mdi-numeric-1-box:before{content:"\F3A4"}.mdi-numeric-1-box-multiple-outline:before{content:"\F3A5"}.mdi-numeric-1-box-outline:before{content:"\F3A6"}.mdi-numeric-2-box:before{content:"\F3A7"}.mdi-numeric-2-box-multiple-outline:before{content:"\F3A8"}.mdi-numeric-2-box-outline:before{content:"\F3A9"}.mdi-numeric-3-box:before{content:"\F3AA"}.mdi-numeric-3-box-multiple-outline:before{content:"\F3AB"}.mdi-numeric-3-box-outline:before{content:"\F3AC"}.mdi-numeric-4-box:before{content:"\F3AD"}.mdi-numeric-4-box-multiple-outline:before{content:"\F3AE"}.mdi-numeric-4-box-outline:before{content:"\F3AF"}.mdi-numeric-5-box:before{content:"\F3B0"}.mdi-numeric-5-box-multiple-outline:before{content:"\F3B1"}.mdi-numeric-5-box-outline:before{content:"\F3B2"}.mdi-numeric-6-box:before{content:"\F3B3"}.mdi-numeric-6-box-multiple-outline:before{content:"\F3B4"}.mdi-numeric-6-box-outline:before{content:"\F3B5"}.mdi-numeric-7-box:before{content:"\F3B6"}.mdi-numeric-7-box-multiple-outline:before{content:"\F3B7"}.mdi-numeric-7-box-outline:before{content:"\F3B8"}.mdi-numeric-8-box:before{content:"\F3B9"}.mdi-numeric-8-box-multiple-outline:before{content:"\F3BA"}.mdi-numeric-8-box-outline:before{content:"\F3BB"}.mdi-numeric-9-box:before{content:"\F3BC"}.mdi-numeric-9-box-multiple-outline:before{content:"\F3BD"}.mdi-numeric-9-box-outline:before{content:"\F3BE"}.mdi-numeric-9-plus-box:before{content:"\F3BF"}.mdi-numeric-9-plus-box-multiple-outline:before{content:"\F3C0"}.mdi-numeric-9-plus-box-outline:before{content:"\F3C1"}.mdi-nut:before{content:"\F6F7"}.mdi-nutrition:before{content:"\F3C2"}.mdi-oar:before{content:"\F67B"}.mdi-octagon:before{content:"\F3C3"}.mdi-octagon-outline:before{content:"\F3C4"}.mdi-octagram:before{content:"\F6F8"}.mdi-octagram-outline:before{content:"\F774"}.mdi-odnoklassniki:before{content:"\F3C5"}.mdi-office:before{content:"\F3C6"}.mdi-oil:before{content:"\F3C7"}.mdi-oil-temperature:before{content:"\F3C8"}.mdi-omega:before{content:"\F3C9"}.mdi-onedrive:before{content:"\F3CA"}.mdi-onenote:before{content:"\F746"}.mdi-opacity:before{content:"\F5CC"}.mdi-open-in-app:before{content:"\F3CB"}.mdi-open-in-new:before{content:"\F3CC"}.mdi-openid:before{content:"\F3CD"}.mdi-opera:before{content:"\F3CE"}.mdi-orbit:before{content:"\F018"}.mdi-ornament:before{content:"\F3CF"}.mdi-ornament-variant:before{content:"\F3D0"}.mdi-owl:before{content:"\F3D2"}.mdi-package:before{content:"\F3D3"}.mdi-package-down:before{content:"\F3D4"}.mdi-package-up:before{content:"\F3D5"}.mdi-package-variant:before{content:"\F3D6"}.mdi-package-variant-closed:before{content:"\F3D7"}.mdi-page-first:before{content:"\F600"}.mdi-page-last:before{content:"\F601"}.mdi-page-layout-body:before{content:"\F6F9"}.mdi-page-layout-footer:before{content:"\F6FA"}.mdi-page-layout-header:before{content:"\F6FB"}.mdi-page-layout-sidebar-left:before{content:"\F6FC"}.mdi-page-layout-sidebar-right:before{content:"\F6FD"}.mdi-palette:before{content:"\F3D8"}.mdi-palette-advanced:before{content:"\F3D9"}.mdi-panda:before{content:"\F3DA"}.mdi-pandora:before{content:"\F3DB"}.mdi-panorama:before{content:"\F3DC"}.mdi-panorama-fisheye:before{content:"\F3DD"}.mdi-panorama-horizontal:before{content:"\F3DE"}.mdi-panorama-vertical:before{content:"\F3DF"}.mdi-panorama-wide-angle:before{content:"\F3E0"}.mdi-paper-cut-vertical:before{content:"\F3E1"}.mdi-paperclip:before{content:"\F3E2"}.mdi-parking:before{content:"\F3E3"}.mdi-passport:before{content:"\F7E2"}.mdi-pause:before{content:"\F3E4"}.mdi-pause-circle:before{content:"\F3E5"}.mdi-pause-circle-outline:before{content:"\F3E6"}.mdi-pause-octagon:before{content:"\F3E7"}.mdi-pause-octagon-outline:before{content:"\F3E8"}.mdi-paw:before{content:"\F3E9"}.mdi-paw-off:before{content:"\F657"}.mdi-pen:before{content:"\F3EA"}.mdi-pencil:before{content:"\F3EB"}.mdi-pencil-box:before{content:"\F3EC"}.mdi-pencil-box-outline:before{content:"\F3ED"}.mdi-pencil-circle:before{content:"\F6FE"}.mdi-pencil-circle-outline:before{content:"\F775"}.mdi-pencil-lock:before{content:"\F3EE"}.mdi-pencil-off:before{content:"\F3EF"}.mdi-pentagon:before{content:"\F6FF"}.mdi-pentagon-outline:before{content:"\F700"}.mdi-percent:before{content:"\F3F0"}.mdi-periodic-table-co2:before{content:"\F7E3"}.mdi-periscope:before{content:"\F747"}.mdi-pharmacy:before{content:"\F3F1"}.mdi-phone:before{content:"\F3F2"}.mdi-phone-bluetooth:before{content:"\F3F3"}.mdi-phone-classic:before{content:"\F602"}.mdi-phone-forward:before{content:"\F3F4"}.mdi-phone-hangup:before{content:"\F3F5"}.mdi-phone-in-talk:before{content:"\F3F6"}.mdi-phone-incoming:before{content:"\F3F7"}.mdi-phone-locked:before{content:"\F3F8"}.mdi-phone-log:before{content:"\F3F9"}.mdi-phone-minus:before{content:"\F658"}.mdi-phone-missed:before{content:"\F3FA"}.mdi-phone-outgoing:before{content:"\F3FB"}.mdi-phone-paused:before{content:"\F3FC"}.mdi-phone-plus:before{content:"\F659"}.mdi-phone-settings:before{content:"\F3FD"}.mdi-phone-voip:before{content:"\F3FE"}.mdi-pi:before{content:"\F3FF"}.mdi-pi-box:before{content:"\F400"}.mdi-piano:before{content:"\F67C"}.mdi-pig:before{content:"\F401"}.mdi-pill:before{content:"\F402"}.mdi-pillar:before{content:"\F701"}.mdi-pin:before{content:"\F403"}.mdi-pin-off:before{content:"\F404"}.mdi-pine-tree:before{content:"\F405"}.mdi-pine-tree-box:before{content:"\F406"}.mdi-pinterest:before{content:"\F407"}.mdi-pinterest-box:before{content:"\F408"}.mdi-pipe:before{content:"\F7E4"}.mdi-pipe-disconnected:before{content:"\F7E5"}.mdi-pistol:before{content:"\F702"}.mdi-pizza:before{content:"\F409"}.mdi-plane-shield:before{content:"\F6BA"}.mdi-play:before{content:"\F40A"}.mdi-play-box-outline:before{content:"\F40B"}.mdi-play-circle:before{content:"\F40C"}.mdi-play-circle-outline:before{content:"\F40D"}.mdi-play-pause:before{content:"\F40E"}.mdi-play-protected-content:before{content:"\F40F"}.mdi-playlist-check:before{content:"\F5C7"}.mdi-playlist-minus:before{content:"\F410"}.mdi-playlist-play:before{content:"\F411"}.mdi-playlist-plus:before{content:"\F412"}.mdi-playlist-remove:before{content:"\F413"}.mdi-playstation:before{content:"\F414"}.mdi-plex:before{content:"\F6B9"}.mdi-plus:before{content:"\F415"}.mdi-plus-box:before{content:"\F416"}.mdi-plus-box-outline:before{content:"\F703"}.mdi-plus-circle:before{content:"\F417"}.mdi-plus-circle-multiple-outline:before{content:"\F418"}.mdi-plus-circle-outline:before{content:"\F419"}.mdi-plus-network:before{content:"\F41A"}.mdi-plus-one:before{content:"\F41B"}.mdi-plus-outline:before{content:"\F704"}.mdi-pocket:before{content:"\F41C"}.mdi-pokeball:before{content:"\F41D"}.mdi-polaroid:before{content:"\F41E"}.mdi-poll:before{content:"\F41F"}.mdi-poll-box:before{content:"\F420"}.mdi-polymer:before{content:"\F421"}.mdi-pool:before{content:"\F606"}.mdi-popcorn:before{content:"\F422"}.mdi-pot:before{content:"\F65A"}.mdi-pot-mix:before{content:"\F65B"}.mdi-pound:before{content:"\F423"}.mdi-pound-box:before{content:"\F424"}.mdi-power:before{content:"\F425"}.mdi-power-plug:before{content:"\F6A4"}.mdi-power-plug-off:before{content:"\F6A5"}.mdi-power-settings:before{content:"\F426"}.mdi-power-socket:before{content:"\F427"}.mdi-power-socket-eu:before{content:"\F7E6"}.mdi-power-socket-uk:before{content:"\F7E7"}.mdi-power-socket-us:before{content:"\F7E8"}.mdi-prescription:before{content:"\F705"}.mdi-presentation:before{content:"\F428"}.mdi-presentation-play:before{content:"\F429"}.mdi-printer:before{content:"\F42A"}.mdi-printer-3d:before{content:"\F42B"}.mdi-printer-alert:before{content:"\F42C"}.mdi-printer-settings:before{content:"\F706"}.mdi-priority-high:before{content:"\F603"}.mdi-priority-low:before{content:"\F604"}.mdi-professional-hexagon:before{content:"\F42D"}.mdi-projector:before{content:"\F42E"}.mdi-projector-screen:before{content:"\F42F"}.mdi-publish:before{content:"\F6A6"}.mdi-pulse:before{content:"\F430"}.mdi-puzzle:before{content:"\F431"}.mdi-qqchat:before{content:"\F605"}.mdi-qrcode:before{content:"\F432"}.mdi-qrcode-scan:before{content:"\F433"}.mdi-quadcopter:before{content:"\F434"}.mdi-quality-high:before{content:"\F435"}.mdi-quicktime:before{content:"\F436"}.mdi-radar:before{content:"\F437"}.mdi-radiator:before{content:"\F438"}.mdi-radio:before{content:"\F439"}.mdi-radio-handheld:before{content:"\F43A"}.mdi-radio-tower:before{content:"\F43B"}.mdi-radioactive:before{content:"\F43C"}.mdi-radiobox-blank:before{content:"\F43D"}.mdi-radiobox-marked:before{content:"\F43E"}.mdi-raspberrypi:before{content:"\F43F"}.mdi-ray-end:before{content:"\F440"}.mdi-ray-end-arrow:before{content:"\F441"}.mdi-ray-start:before{content:"\F442"}.mdi-ray-start-arrow:before{content:"\F443"}.mdi-ray-start-end:before{content:"\F444"}.mdi-ray-vertex:before{content:"\F445"}.mdi-rdio:before{content:"\F446"}.mdi-react:before{content:"\F707"}.mdi-read:before{content:"\F447"}.mdi-readability:before{content:"\F448"}.mdi-receipt:before{content:"\F449"}.mdi-record:before{content:"\F44A"}.mdi-record-rec:before{content:"\F44B"}.mdi-recycle:before{content:"\F44C"}.mdi-reddit:before{content:"\F44D"}.mdi-redo:before{content:"\F44E"}.mdi-redo-variant:before{content:"\F44F"}.mdi-refresh:before{content:"\F450"}.mdi-regex:before{content:"\F451"}.mdi-relative-scale:before{content:"\F452"}.mdi-reload:before{content:"\F453"}.mdi-remote:before{content:"\F454"}.mdi-rename-box:before{content:"\F455"}.mdi-reorder-horizontal:before{content:"\F687"}.mdi-reorder-vertical:before{content:"\F688"}.mdi-repeat:before{content:"\F456"}.mdi-repeat-off:before{content:"\F457"}.mdi-repeat-once:before{content:"\F458"}.mdi-replay:before{content:"\F459"}.mdi-reply:before{content:"\F45A"}.mdi-reply-all:before{content:"\F45B"}.mdi-reproduction:before{content:"\F45C"}.mdi-resize-bottom-right:before{content:"\F45D"}.mdi-responsive:before{content:"\F45E"}.mdi-restart:before{content:"\F708"}.mdi-restore:before{content:"\F6A7"}.mdi-rewind:before{content:"\F45F"}.mdi-rewind-outline:before{content:"\F709"}.mdi-rhombus:before{content:"\F70A"}.mdi-rhombus-outline:before{content:"\F70B"}.mdi-ribbon:before{content:"\F460"}.mdi-rice:before{content:"\F7E9"}.mdi-ring:before{content:"\F7EA"}.mdi-road:before{content:"\F461"}.mdi-road-variant:before{content:"\F462"}.mdi-robot:before{content:"\F6A8"}.mdi-rocket:before{content:"\F463"}.mdi-roomba:before{content:"\F70C"}.mdi-rotate-3d:before{content:"\F464"}.mdi-rotate-left:before{content:"\F465"}.mdi-rotate-left-variant:before{content:"\F466"}.mdi-rotate-right:before{content:"\F467"}.mdi-rotate-right-variant:before{content:"\F468"}.mdi-rounded-corner:before{content:"\F607"}.mdi-router-wireless:before{content:"\F469"}.mdi-routes:before{content:"\F46A"}.mdi-rowing:before{content:"\F608"}.mdi-rss:before{content:"\F46B"}.mdi-rss-box:before{content:"\F46C"}.mdi-ruler:before{content:"\F46D"}.mdi-run:before{content:"\F70D"}.mdi-run-fast:before{content:"\F46E"}.mdi-sale:before{content:"\F46F"}.mdi-sass:before{content:"\F7EB"}.mdi-satellite:before{content:"\F470"}.mdi-satellite-variant:before{content:"\F471"}.mdi-saxophone:before{content:"\F609"}.mdi-scale:before{content:"\F472"}.mdi-scale-balance:before{content:"\F5D1"}.mdi-scale-bathroom:before{content:"\F473"}.mdi-scanner:before{content:"\F6AA"}.mdi-school:before{content:"\F474"}.mdi-screen-rotation:before{content:"\F475"}.mdi-screen-rotation-lock:before{content:"\F476"}.mdi-screwdriver:before{content:"\F477"}.mdi-script:before{content:"\F478"}.mdi-sd:before{content:"\F479"}.mdi-seal:before{content:"\F47A"}.mdi-search-web:before{content:"\F70E"}.mdi-seat-flat:before{content:"\F47B"}.mdi-seat-flat-angled:before{content:"\F47C"}.mdi-seat-individual-suite:before{content:"\F47D"}.mdi-seat-legroom-extra:before{content:"\F47E"}.mdi-seat-legroom-normal:before{content:"\F47F"}.mdi-seat-legroom-reduced:before{content:"\F480"}.mdi-seat-recline-extra:before{content:"\F481"}.mdi-seat-recline-normal:before{content:"\F482"}.mdi-security:before{content:"\F483"}.mdi-security-home:before{content:"\F689"}.mdi-security-network:before{content:"\F484"}.mdi-select:before{content:"\F485"}.mdi-select-all:before{content:"\F486"}.mdi-select-inverse:before{content:"\F487"}.mdi-select-off:before{content:"\F488"}.mdi-selection:before{content:"\F489"}.mdi-selection-off:before{content:"\F776"}.mdi-send:before{content:"\F48A"}.mdi-send-secure:before{content:"\F7EC"}.mdi-serial-port:before{content:"\F65C"}.mdi-server:before{content:"\F48B"}.mdi-server-minus:before{content:"\F48C"}.mdi-server-network:before{content:"\F48D"}.mdi-server-network-off:before{content:"\F48E"}.mdi-server-off:before{content:"\F48F"}.mdi-server-plus:before{content:"\F490"}.mdi-server-remove:before{content:"\F491"}.mdi-server-security:before{content:"\F492"}.mdi-set-all:before{content:"\F777"}.mdi-set-center:before{content:"\F778"}.mdi-set-center-right:before{content:"\F779"}.mdi-set-left:before{content:"\F77A"}.mdi-set-left-center:before{content:"\F77B"}.mdi-set-left-right:before{content:"\F77C"}.mdi-set-none:before{content:"\F77D"}.mdi-set-right:before{content:"\F77E"}.mdi-settings:before{content:"\F493"}.mdi-settings-box:before{content:"\F494"}.mdi-shape-circle-plus:before{content:"\F65D"}.mdi-shape-plus:before{content:"\F495"}.mdi-shape-polygon-plus:before{content:"\F65E"}.mdi-shape-rectangle-plus:before{content:"\F65F"}.mdi-shape-square-plus:before{content:"\F660"}.mdi-share:before{content:"\F496"}.mdi-share-variant:before{content:"\F497"}.mdi-shield:before{content:"\F498"}.mdi-shield-half-full:before{content:"\F77F"}.mdi-shield-outline:before{content:"\F499"}.mdi-shopping:before{content:"\F49A"}.mdi-shopping-music:before{content:"\F49B"}.mdi-shovel:before{content:"\F70F"}.mdi-shovel-off:before{content:"\F710"}.mdi-shredder:before{content:"\F49C"}.mdi-shuffle:before{content:"\F49D"}.mdi-shuffle-disabled:before{content:"\F49E"}.mdi-shuffle-variant:before{content:"\F49F"}.mdi-sigma:before{content:"\F4A0"}.mdi-sigma-lower:before{content:"\F62B"}.mdi-sign-caution:before{content:"\F4A1"}.mdi-sign-direction:before{content:"\F780"}.mdi-sign-text:before{content:"\F781"}.mdi-signal:before{content:"\F4A2"}.mdi-signal-2g:before{content:"\F711"}.mdi-signal-3g:before{content:"\F712"}.mdi-signal-4g:before{content:"\F713"}.mdi-signal-hspa:before{content:"\F714"}.mdi-signal-hspa-plus:before{content:"\F715"}.mdi-signal-off:before{content:"\F782"}.mdi-signal-variant:before{content:"\F60A"}.mdi-silverware:before{content:"\F4A3"}.mdi-silverware-fork:before{content:"\F4A4"}.mdi-silverware-spoon:before{content:"\F4A5"}.mdi-silverware-variant:before{content:"\F4A6"}.mdi-sim:before{content:"\F4A7"}.mdi-sim-alert:before{content:"\F4A8"}.mdi-sim-off:before{content:"\F4A9"}.mdi-sitemap:before{content:"\F4AA"}.mdi-skip-backward:before{content:"\F4AB"}.mdi-skip-forward:before{content:"\F4AC"}.mdi-skip-next:before{content:"\F4AD"}.mdi-skip-next-circle:before{content:"\F661"}.mdi-skip-next-circle-outline:before{content:"\F662"}.mdi-skip-previous:before{content:"\F4AE"}.mdi-skip-previous-circle:before{content:"\F663"}.mdi-skip-previous-circle-outline:before{content:"\F664"}.mdi-skull:before{content:"\F68B"}.mdi-skype:before{content:"\F4AF"}.mdi-skype-business:before{content:"\F4B0"}.mdi-slack:before{content:"\F4B1"}.mdi-sleep:before{content:"\F4B2"}.mdi-sleep-off:before{content:"\F4B3"}.mdi-smoking:before{content:"\F4B4"}.mdi-smoking-off:before{content:"\F4B5"}.mdi-snapchat:before{content:"\F4B6"}.mdi-snowflake:before{content:"\F716"}.mdi-snowman:before{content:"\F4B7"}.mdi-soccer:before{content:"\F4B8"}.mdi-sofa:before{content:"\F4B9"}.mdi-solid:before{content:"\F68C"}.mdi-sort:before{content:"\F4BA"}.mdi-sort-alphabetical:before{content:"\F4BB"}.mdi-sort-ascending:before{content:"\F4BC"}.mdi-sort-descending:before{content:"\F4BD"}.mdi-sort-numeric:before{content:"\F4BE"}.mdi-sort-variant:before{content:"\F4BF"}.mdi-soundcloud:before{content:"\F4C0"}.mdi-source-branch:before{content:"\F62C"}.mdi-source-commit:before{content:"\F717"}.mdi-source-commit-end:before{content:"\F718"}.mdi-source-commit-end-local:before{content:"\F719"}.mdi-source-commit-local:before{content:"\F71A"}.mdi-source-commit-next-local:before{content:"\F71B"}.mdi-source-commit-start:before{content:"\F71C"}.mdi-source-commit-start-next-local:before{content:"\F71D"}.mdi-source-fork:before{content:"\F4C1"}.mdi-source-merge:before{content:"\F62D"}.mdi-source-pull:before{content:"\F4C2"}.mdi-soy-sauce:before{content:"\F7ED"}.mdi-speaker:before{content:"\F4C3"}.mdi-speaker-off:before{content:"\F4C4"}.mdi-speaker-wireless:before{content:"\F71E"}.mdi-speedometer:before{content:"\F4C5"}.mdi-spellcheck:before{content:"\F4C6"}.mdi-spotify:before{content:"\F4C7"}.mdi-spotlight:before{content:"\F4C8"}.mdi-spotlight-beam:before{content:"\F4C9"}.mdi-spray:before{content:"\F665"}.mdi-square:before{content:"\F763"}.mdi-square-inc:before{content:"\F4CA"}.mdi-square-inc-cash:before{content:"\F4CB"}.mdi-square-outline:before{content:"\F762"}.mdi-square-root:before{content:"\F783"}.mdi-stackexchange:before{content:"\F60B"}.mdi-stackoverflow:before{content:"\F4CC"}.mdi-stadium:before{content:"\F71F"}.mdi-stairs:before{content:"\F4CD"}.mdi-standard-definition:before{content:"\F7EE"}.mdi-star:before{content:"\F4CE"}.mdi-star-circle:before{content:"\F4CF"}.mdi-star-half:before{content:"\F4D0"}.mdi-star-off:before{content:"\F4D1"}.mdi-star-outline:before{content:"\F4D2"}.mdi-steam:before{content:"\F4D3"}.mdi-steering:before{content:"\F4D4"}.mdi-step-backward:before{content:"\F4D5"}.mdi-step-backward-2:before{content:"\F4D6"}.mdi-step-forward:before{content:"\F4D7"}.mdi-step-forward-2:before{content:"\F4D8"}.mdi-stethoscope:before{content:"\F4D9"}.mdi-sticker:before{content:"\F5D0"}.mdi-sticker-emoji:before{content:"\F784"}.mdi-stocking:before{content:"\F4DA"}.mdi-stop:before{content:"\F4DB"}.mdi-stop-circle:before{content:"\F666"}.mdi-stop-circle-outline:before{content:"\F667"}.mdi-store:before{content:"\F4DC"}.mdi-store-24-hour:before{content:"\F4DD"}.mdi-stove:before{content:"\F4DE"}.mdi-subdirectory-arrow-left:before{content:"\F60C"}.mdi-subdirectory-arrow-right:before{content:"\F60D"}.mdi-subway:before{content:"\F6AB"}.mdi-subway-variant:before{content:"\F4DF"}.mdi-summit:before{content:"\F785"}.mdi-sunglasses:before{content:"\F4E0"}.mdi-surround-sound:before{content:"\F5C5"}.mdi-surround-sound-2-0:before{content:"\F7EF"}.mdi-surround-sound-3-1:before{content:"\F7F0"}.mdi-surround-sound-5-1:before{content:"\F7F1"}.mdi-surround-sound-7-1:before{content:"\F7F2"}.mdi-svg:before{content:"\F720"}.mdi-swap-horizontal:before{content:"\F4E1"}.mdi-swap-vertical:before{content:"\F4E2"}.mdi-swim:before{content:"\F4E3"}.mdi-switch:before{content:"\F4E4"}.mdi-sword:before{content:"\F4E5"}.mdi-sword-cross:before{content:"\F786"}.mdi-sync:before{content:"\F4E6"}.mdi-sync-alert:before{content:"\F4E7"}.mdi-sync-off:before{content:"\F4E8"}.mdi-tab:before{content:"\F4E9"}.mdi-tab-plus:before{content:"\F75B"}.mdi-tab-unselected:before{content:"\F4EA"}.mdi-table:before{content:"\F4EB"}.mdi-table-column-plus-after:before{content:"\F4EC"}.mdi-table-column-plus-before:before{content:"\F4ED"}.mdi-table-column-remove:before{content:"\F4EE"}.mdi-table-column-width:before{content:"\F4EF"}.mdi-table-edit:before{content:"\F4F0"}.mdi-table-large:before{content:"\F4F1"}.mdi-table-row-height:before{content:"\F4F2"}.mdi-table-row-plus-after:before{content:"\F4F3"}.mdi-table-row-plus-before:before{content:"\F4F4"}.mdi-table-row-remove:before{content:"\F4F5"}.mdi-tablet:before{content:"\F4F6"}.mdi-tablet-android:before{content:"\F4F7"}.mdi-tablet-ipad:before{content:"\F4F8"}.mdi-taco:before{content:"\F761"}.mdi-tag:before{content:"\F4F9"}.mdi-tag-faces:before{content:"\F4FA"}.mdi-tag-heart:before{content:"\F68A"}.mdi-tag-multiple:before{content:"\F4FB"}.mdi-tag-outline:before{content:"\F4FC"}.mdi-tag-plus:before{content:"\F721"}.mdi-tag-remove:before{content:"\F722"}.mdi-tag-text-outline:before{content:"\F4FD"}.mdi-target:before{content:"\F4FE"}.mdi-taxi:before{content:"\F4FF"}.mdi-teamviewer:before{content:"\F500"}.mdi-telegram:before{content:"\F501"}.mdi-television:before{content:"\F502"}.mdi-television-classic:before{content:"\F7F3"}.mdi-television-guide:before{content:"\F503"}.mdi-temperature-celsius:before{content:"\F504"}.mdi-temperature-fahrenheit:before{content:"\F505"}.mdi-temperature-kelvin:before{content:"\F506"}.mdi-tennis:before{content:"\F507"}.mdi-tent:before{content:"\F508"}.mdi-terrain:before{content:"\F509"}.mdi-test-tube:before{content:"\F668"}.mdi-text-shadow:before{content:"\F669"}.mdi-text-to-speech:before{content:"\F50A"}.mdi-text-to-speech-off:before{content:"\F50B"}.mdi-textbox:before{content:"\F60E"}.mdi-textbox-password:before{content:"\F7F4"}.mdi-texture:before{content:"\F50C"}.mdi-theater:before{content:"\F50D"}.mdi-theme-light-dark:before{content:"\F50E"}.mdi-thermometer:before{content:"\F50F"}.mdi-thermometer-lines:before{content:"\F510"}.mdi-thought-bubble:before{content:"\F7F5"}.mdi-thought-bubble-outline:before{content:"\F7F6"}.mdi-thumb-down:before{content:"\F511"}.mdi-thumb-down-outline:before{content:"\F512"}.mdi-thumb-up:before{content:"\F513"}.mdi-thumb-up-outline:before{content:"\F514"}.mdi-thumbs-up-down:before{content:"\F515"}.mdi-ticket:before{content:"\F516"}.mdi-ticket-account:before{content:"\F517"}.mdi-ticket-confirmation:before{content:"\F518"}.mdi-ticket-percent:before{content:"\F723"}.mdi-tie:before{content:"\F519"}.mdi-tilde:before{content:"\F724"}.mdi-timelapse:before{content:"\F51A"}.mdi-timer:before{content:"\F51B"}.mdi-timer-10:before{content:"\F51C"}.mdi-timer-3:before{content:"\F51D"}.mdi-timer-off:before{content:"\F51E"}.mdi-timer-sand:before{content:"\F51F"}.mdi-timer-sand-empty:before{content:"\F6AC"}.mdi-timer-sand-full:before{content:"\F78B"}.mdi-timetable:before{content:"\F520"}.mdi-toggle-switch:before{content:"\F521"}.mdi-toggle-switch-off:before{content:"\F522"}.mdi-tooltip:before{content:"\F523"}.mdi-tooltip-edit:before{content:"\F524"}.mdi-tooltip-image:before{content:"\F525"}.mdi-tooltip-outline:before{content:"\F526"}.mdi-tooltip-outline-plus:before{content:"\F527"}.mdi-tooltip-text:before{content:"\F528"}.mdi-tooth:before{content:"\F529"}.mdi-tor:before{content:"\F52A"}.mdi-tower-beach:before{content:"\F680"}.mdi-tower-fire:before{content:"\F681"}.mdi-trackpad:before{content:"\F7F7"}.mdi-traffic-light:before{content:"\F52B"}.mdi-train:before{content:"\F52C"}.mdi-tram:before{content:"\F52D"}.mdi-transcribe:before{content:"\F52E"}.mdi-transcribe-close:before{content:"\F52F"}.mdi-transfer:before{content:"\F530"}.mdi-transit-transfer:before{content:"\F6AD"}.mdi-translate:before{content:"\F5CA"}.mdi-treasure-chest:before{content:"\F725"}.mdi-tree:before{content:"\F531"}.mdi-trello:before{content:"\F532"}.mdi-trending-down:before{content:"\F533"}.mdi-trending-neutral:before{content:"\F534"}.mdi-trending-up:before{content:"\F535"}.mdi-triangle:before{content:"\F536"}.mdi-triangle-outline:before{content:"\F537"}.mdi-trophy:before{content:"\F538"}.mdi-trophy-award:before{content:"\F539"}.mdi-trophy-outline:before{content:"\F53A"}.mdi-trophy-variant:before{content:"\F53B"}.mdi-trophy-variant-outline:before{content:"\F53C"}.mdi-truck:before{content:"\F53D"}.mdi-truck-delivery:before{content:"\F53E"}.mdi-truck-fast:before{content:"\F787"}.mdi-truck-trailer:before{content:"\F726"}.mdi-tshirt-crew:before{content:"\F53F"}.mdi-tshirt-v:before{content:"\F540"}.mdi-tumblr:before{content:"\F541"}.mdi-tumblr-reblog:before{content:"\F542"}.mdi-tune:before{content:"\F62E"}.mdi-tune-vertical:before{content:"\F66A"}.mdi-twitch:before{content:"\F543"}.mdi-twitter:before{content:"\F544"}.mdi-twitter-box:before{content:"\F545"}.mdi-twitter-circle:before{content:"\F546"}.mdi-twitter-retweet:before{content:"\F547"}.mdi-uber:before{content:"\F748"}.mdi-ubuntu:before{content:"\F548"}.mdi-ultra-high-definition:before{content:"\F7F8"}.mdi-umbraco:before{content:"\F549"}.mdi-umbrella:before{content:"\F54A"}.mdi-umbrella-outline:before{content:"\F54B"}.mdi-undo:before{content:"\F54C"}.mdi-undo-variant:before{content:"\F54D"}.mdi-unfold-less-horizontal:before{content:"\F54E"}.mdi-unfold-less-vertical:before{content:"\F75F"}.mdi-unfold-more-horizontal:before{content:"\F54F"}.mdi-unfold-more-vertical:before{content:"\F760"}.mdi-ungroup:before{content:"\F550"}.mdi-unity:before{content:"\F6AE"}.mdi-untappd:before{content:"\F551"}.mdi-update:before{content:"\F6AF"}.mdi-upload:before{content:"\F552"}.mdi-upload-network:before{content:"\F6F5"}.mdi-usb:before{content:"\F553"}.mdi-van-passenger:before{content:"\F7F9"}.mdi-van-utility:before{content:"\F7FA"}.mdi-vanish:before{content:"\F7FB"}.mdi-vector-arrange-above:before{content:"\F554"}.mdi-vector-arrange-below:before{content:"\F555"}.mdi-vector-circle:before{content:"\F556"}.mdi-vector-circle-variant:before{content:"\F557"}.mdi-vector-combine:before{content:"\F558"}.mdi-vector-curve:before{content:"\F559"}.mdi-vector-difference:before{content:"\F55A"}.mdi-vector-difference-ab:before{content:"\F55B"}.mdi-vector-difference-ba:before{content:"\F55C"}.mdi-vector-intersection:before{content:"\F55D"}.mdi-vector-line:before{content:"\F55E"}.mdi-vector-point:before{content:"\F55F"}.mdi-vector-polygon:before{content:"\F560"}.mdi-vector-polyline:before{content:"\F561"}.mdi-vector-radius:before{content:"\F749"}.mdi-vector-rectangle:before{content:"\F5C6"}.mdi-vector-selection:before{content:"\F562"}.mdi-vector-square:before{content:"\F001"}.mdi-vector-triangle:before{content:"\F563"}.mdi-vector-union:before{content:"\F564"}.mdi-verified:before{content:"\F565"}.mdi-vibrate:before{content:"\F566"}.mdi-video:before{content:"\F567"}.mdi-video-3d:before{content:"\F7FC"}.mdi-video-off:before{content:"\F568"}.mdi-video-switch:before{content:"\F569"}.mdi-view-agenda:before{content:"\F56A"}.mdi-view-array:before{content:"\F56B"}.mdi-view-carousel:before{content:"\F56C"}.mdi-view-column:before{content:"\F56D"}.mdi-view-dashboard:before{content:"\F56E"}.mdi-view-day:before{content:"\F56F"}.mdi-view-grid:before{content:"\F570"}.mdi-view-headline:before{content:"\F571"}.mdi-view-list:before{content:"\F572"}.mdi-view-module:before{content:"\F573"}.mdi-view-parallel:before{content:"\F727"}.mdi-view-quilt:before{content:"\F574"}.mdi-view-sequential:before{content:"\F728"}.mdi-view-stream:before{content:"\F575"}.mdi-view-week:before{content:"\F576"}.mdi-vimeo:before{content:"\F577"}.mdi-vine:before{content:"\F578"}.mdi-violin:before{content:"\F60F"}.mdi-visualstudio:before{content:"\F610"}.mdi-vk:before{content:"\F579"}.mdi-vk-box:before{content:"\F57A"}.mdi-vk-circle:before{content:"\F57B"}.mdi-vlc:before{content:"\F57C"}.mdi-voice:before{content:"\F5CB"}.mdi-voicemail:before{content:"\F57D"}.mdi-volume-high:before{content:"\F57E"}.mdi-volume-low:before{content:"\F57F"}.mdi-volume-medium:before{content:"\F580"}.mdi-volume-minus:before{content:"\F75D"}.mdi-volume-mute:before{content:"\F75E"}.mdi-volume-off:before{content:"\F581"}.mdi-volume-plus:before{content:"\F75C"}.mdi-vpn:before{content:"\F582"}.mdi-walk:before{content:"\F583"}.mdi-wall:before{content:"\F7FD"}.mdi-wallet:before{content:"\F584"}.mdi-wallet-giftcard:before{content:"\F585"}.mdi-wallet-membership:before{content:"\F586"}.mdi-wallet-travel:before{content:"\F587"}.mdi-wan:before{content:"\F588"}.mdi-washing-machine:before{content:"\F729"}.mdi-watch:before{content:"\F589"}.mdi-watch-export:before{content:"\F58A"}.mdi-watch-import:before{content:"\F58B"}.mdi-watch-vibrate:before{content:"\F6B0"}.mdi-water:before{content:"\F58C"}.mdi-water-off:before{content:"\F58D"}.mdi-water-percent:before{content:"\F58E"}.mdi-water-pump:before{content:"\F58F"}.mdi-watermark:before{content:"\F612"}.mdi-waves:before{content:"\F78C"}.mdi-weather-cloudy:before{content:"\F590"}.mdi-weather-fog:before{content:"\F591"}.mdi-weather-hail:before{content:"\F592"}.mdi-weather-lightning:before{content:"\F593"}.mdi-weather-lightning-rainy:before{content:"\F67D"}.mdi-weather-night:before{content:"\F594"}.mdi-weather-partlycloudy:before{content:"\F595"}.mdi-weather-pouring:before{content:"\F596"}.mdi-weather-rainy:before{content:"\F597"}.mdi-weather-snowy:before{content:"\F598"}.mdi-weather-snowy-rainy:before{content:"\F67E"}.mdi-weather-sunny:before{content:"\F599"}.mdi-weather-sunset:before{content:"\F59A"}.mdi-weather-sunset-down:before{content:"\F59B"}.mdi-weather-sunset-up:before{content:"\F59C"}.mdi-weather-windy:before{content:"\F59D"}.mdi-weather-windy-variant:before{content:"\F59E"}.mdi-web:before{content:"\F59F"}.mdi-webcam:before{content:"\F5A0"}.mdi-webhook:before{content:"\F62F"}.mdi-webpack:before{content:"\F72A"}.mdi-wechat:before{content:"\F611"}.mdi-weight:before{content:"\F5A1"}.mdi-weight-kilogram:before{content:"\F5A2"}.mdi-whatsapp:before{content:"\F5A3"}.mdi-wheelchair-accessibility:before{content:"\F5A4"}.mdi-white-balance-auto:before{content:"\F5A5"}.mdi-white-balance-incandescent:before{content:"\F5A6"}.mdi-white-balance-iridescent:before{content:"\F5A7"}.mdi-white-balance-sunny:before{content:"\F5A8"}.mdi-widgets:before{content:"\F72B"}.mdi-wifi:before{content:"\F5A9"}.mdi-wifi-off:before{content:"\F5AA"}.mdi-wii:before{content:"\F5AB"}.mdi-wiiu:before{content:"\F72C"}.mdi-wikipedia:before{content:"\F5AC"}.mdi-window-close:before{content:"\F5AD"}.mdi-window-closed:before{content:"\F5AE"}.mdi-window-maximize:before{content:"\F5AF"}.mdi-window-minimize:before{content:"\F5B0"}.mdi-window-open:before{content:"\F5B1"}.mdi-window-restore:before{content:"\F5B2"}.mdi-windows:before{content:"\F5B3"}.mdi-wordpress:before{content:"\F5B4"}.mdi-worker:before{content:"\F5B5"}.mdi-wrap:before{content:"\F5B6"}.mdi-wrench:before{content:"\F5B7"}.mdi-wunderlist:before{content:"\F5B8"}.mdi-xaml:before{content:"\F673"}.mdi-xbox:before{content:"\F5B9"}.mdi-xbox-controller:before{content:"\F5BA"}.mdi-xbox-controller-battery-alert:before{content:"\F74A"}.mdi-xbox-controller-battery-empty:before{content:"\F74B"}.mdi-xbox-controller-battery-full:before{content:"\F74C"}.mdi-xbox-controller-battery-low:before{content:"\F74D"}.mdi-xbox-controller-battery-medium:before{content:"\F74E"}.mdi-xbox-controller-battery-unknown:before{content:"\F74F"}.mdi-xbox-controller-off:before{content:"\F5BB"}.mdi-xda:before{content:"\F5BC"}.mdi-xing:before{content:"\F5BD"}.mdi-xing-box:before{content:"\F5BE"}.mdi-xing-circle:before{content:"\F5BF"}.mdi-xml:before{content:"\F5C0"}.mdi-xmpp:before{content:"\F7FE"}.mdi-yammer:before{content:"\F788"}.mdi-yeast:before{content:"\F5C1"}.mdi-yelp:before{content:"\F5C2"}.mdi-yin-yang:before{content:"\F67F"}.mdi-youtube-play:before{content:"\F5C3"}.mdi-zip-box:before{content:"\F5C4"}.mdi-blank:before{content:"\F68C";visibility:hidden}.mdi-18px.mdi-set,.mdi-18px.mdi:before{font-size:18px}.mdi-24px.mdi-set,.mdi-24px.mdi:before{font-size:24px}.mdi-36px.mdi-set,.mdi-36px.mdi:before{font-size:36px}.mdi-48px.mdi-set,.mdi-48px.mdi:before{font-size:48px}.mdi-dark:before{color:rgba(0,0,0,0.54)}.mdi-dark.mdi-inactive:before{color:rgba(0,0,0,0.26)}.mdi-light:before{color:#fff}.mdi-light.mdi-inactive:before{color:rgba(255,255,255,0.3)}.mdi-rotate-45:before{-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.mdi-rotate-90:before{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.mdi-rotate-135:before{-webkit-transform:rotate(135deg);-ms-transform:rotate(135deg);transform:rotate(135deg)}.mdi-rotate-180:before{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.mdi-rotate-225:before{-webkit-transform:rotate(225deg);-ms-transform:rotate(225deg);transform:rotate(225deg)}.mdi-rotate-270:before{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.mdi-rotate-315:before{-webkit-transform:rotate(315deg);-ms-transform:rotate(315deg);transform:rotate(315deg)}.mdi-flip-h:before{-webkit-transform:scaleX(-1);transform:scaleX(-1);filter:FlipH;-ms-filter:"FlipH"}.mdi-flip-v:before{-webkit-transform:scaleY(-1);transform:scaleY(-1);filter:FlipV;-ms-filter:"FlipV"}.mdi-spin:before{-webkit-animation:mdi-spin 2s infinite linear;animation:mdi-spin 2s infinite linear}@-webkit-keyframes mdi-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes mdi-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}} diff --git a/SuperAPI/wwwroot/rezero/default_ui/css/page_entity_manager.css b/SuperAPI/wwwroot/rezero/default_ui/css/page_entity_manager.css new file mode 100644 index 0000000..b486559 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/css/page_entity_manager.css @@ -0,0 +1,84 @@ +#divDiff { + padding-top: 5px !important; + padding-left: 5px !important; + height: 400px; + overflow-y: scroll +} + +.diff_h3 { + margin: 0; + padding: 0; + font-size: 15px; + display: block; + background: #15c377; + color: white; + padding: 5px; + margin-left: -3px; +} + +.diff_bule { + color: #009688; + font-size: 14px; + padding-bottom: 3px; +} + +.diff_yellow { + color: red; + font-size: 14px; + padding-bottom: 3px; +} + +.diff_red { + color: red; + font-size: 14px; + padding-bottom:3px; +} + +.diff_success { + display: block; + text-align: center; + font-size: 16px; +} +.table-container { + height: 70vh; /* 将表格容器的高度设置为当前窗口高度的80% */ + max-height: 70vh; /* 设置表格容器的最大高度,防止内容过多时出现滚动条 */ + overflow-y: auto; /* 启用垂直滚动条 */ +} + +.table thead th { + position: -webkit-sticky; /* 兼容性写法 */ + position: sticky; + top: 0; + background-color: #fff; /* 可以根据需要设置表头的背景色 */ + z-index: 2; /* 确保表头在上方 */ +} +.table-container2 { + height: 65vh; /* 将表格容器的高度设置为当前窗口高度的80% */ + max-height: 65vh; /* 设置表格容器的最大高度,防止内容过多时出现滚动条 */ + overflow-y: auto; /* 启用垂直滚动条 */ +} + +.tablebox +{ + padding:10px 0; +} +.tablebox label { + font-weight:100; + margin-top:-2px; +} +.tablebox .btn { + margin-top: -7px; + cursor: pointer !important +} +.tablebox input { + width: 100px; + display: inline; + height: 25px; + margin-left: 10px; +} + +.removedatalist { + position: relative !important; + top: -30px; + left: 370px; +} diff --git a/SuperAPI/wwwroot/rezero/default_ui/css/page_index.css b/SuperAPI/wwwroot/rezero/default_ui/css/page_index.css new file mode 100644 index 0000000..efb46a9 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/css/page_index.css @@ -0,0 +1,4 @@ +iframe { + width: 100%; + border: none; /* 去除 iframe 边框 */ +} diff --git a/SuperAPI/wwwroot/rezero/default_ui/css/page_interface.css b/SuperAPI/wwwroot/rezero/default_ui/css/page_interface.css new file mode 100644 index 0000000..098503c --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/css/page_interface.css @@ -0,0 +1,136 @@ +#apibox { + padding: 10px; + background:#fff +} + +section { + margin-top: 20px; + margin-bottom: 20px; +} +.data > h2 { + font-family: sans-serif; + font-size: 24px; + padding-left: 10px; + padding-bottom: 10px; + border-bottom: 1px solid rgba(59,65,81,.3); + padding-right: 10px; + font-weight: bold +} + +.endpoint { + margin-bottom: 10px; + padding: 10px 0; + border-radius: 5px; + background-color: rgba(97,175,254,.1); + border-radius: 3px; + border: 1px solid #61affe; + border-radius: 4px; + box-shadow: 0 0 3px rgba(0,0,0,.19); +} + .endpoint .p { + cursor:pointer + } + + .endpoint h2 { + margin-bottom: 5px; + } + + .endpoint p { + margin-top: 5px; + font-weight: bold; + } + .endpoint p .url { + font-size: 16px; + font-family: monospace; + } +.endpointGet +{ +} +.endpointPost { + background-color: rgba(73, 204, 144, .1); + border: 1px solid #49cc90; +} + .endpointPost .method { + background:#49cc90 + } +.endpointPut { + background-color: rgba(252,161,48,.1); + border: 1px solid #fca130; +} + + .endpointPut .method { + background: #fca130 + } +.endpointDelete { + background-color: rgba(249,62,62,.1); + border: 1px solid #f93e3e; +} + + .endpointDelete .method { + background: #f93e3e + } +.endpointSql { + background-color: #ddd6eb; + border: 1px solid #9c27b0; +} + + .endpointSql .method { + background: #9c27b0 + } +.method { + padding: 5px 10px; + background-color: #61affe; + color: white; + border-radius: 3px; + margin-left: 10px; +} + +.parameter { + margin-top: 10px; + padding: 5px; +} +.parameter-title { + background: #fff; + padding: 10px; + font-weight: bold !important; + border-top: 1px solid #61affe; + box-shadow: 0 1px 2px rgba(0,0,0,.1); +} + .parameter-title .try-out { + text-align: right; + display: inline-block; + float: right; + margin-top: -6px; + } + .parameter-title button:hover { + cursor: pointer; + border-color:brown + } + .parameter-title button { + background: transparent; + border: 2px solid gray; + border-radius: 4px; + box-shadow: 0 1px 2px rgba(0,0,0,.1); + color: #3b4151; + font-family: sans-serif; + font-size: 14px; + font-weight: 700; + padding: 5px 23px; + transition: all .3s; + } +.show-grid { + padding-left: 20px; + padding-top: 35px; +} +.openapi { + right: 30px; + position: absolute; + font-size: 30px; + margin-top: -12px; + cursor: pointer; + padding: 0 20px; +} +.reduction { + margin-top: -15px; + padding:0 20px; +} \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/css/page_interface_detail.css b/SuperAPI/wwwroot/rezero/default_ui/css/page_interface_detail.css new file mode 100644 index 0000000..16b722f --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/css/page_interface_detail.css @@ -0,0 +1,18 @@ +#app { + background:#fff; + padding:35px; +} +.url +{ + font-size:20px; + padding:30px; + padding-left:0; +} +.readonly +{ + background:#ccc +} +.ace_editor { + z-index:99999999 +} + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/css/page_interface_manager.css b/SuperAPI/wwwroot/rezero/default_ui/css/page_interface_manager.css new file mode 100644 index 0000000..13b8f77 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/css/page_interface_manager.css @@ -0,0 +1,31 @@ +.tabbox { + height: 60vh; /* 将表格容器的高度设置为当前窗口高度的80% */ + max-height: 60vh; /* 设置表格容器的最大高度,防止内容过多时出现滚动条 */ + overflow-y: auto; /* 启用垂直滚动条 */ +} + +.tablebox { + padding: 10px 0; +} + + .tablebox label { + font-weight: 100; + margin-top: -2px; + } + + .tablebox .btn { + margin-top: -7px; + cursor: pointer !important + } + + .tablebox input { + width: 100px; + display: inline; + height: 25px; + margin-left: 10px; + } +.removedatalist { + position: relative !important; + top: -30px; + left: 600px; +} diff --git a/SuperAPI/wwwroot/rezero/default_ui/css/page_table_list.css b/SuperAPI/wwwroot/rezero/default_ui/css/page_table_list.css new file mode 100644 index 0000000..febeab3 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/css/page_table_list.css @@ -0,0 +1,58 @@ +.table-responsive th { + text-align: center; +} + +.table_opt { + text-align: center; + width: 250px; +} + + .table_opt button { + max-width: 80px; + margin: 0 10px; + } + +.table_opt2 { + text-align: center; + width: 330px; +} + + .table_opt2 button { + max-width: 90px; + margin: 0 5px; + } + +.table_opt3 { + text-align: center; + width: 450px; +} + + .table_opt3 button { + max-width: 75px; + margin: 0 5px; + } + +.form-group label { + border: 0 !important; + text-align: right +} + +.search-bar { + padding: 0 15px; + padding-top: 35px; +} +.pagination { + margin-left:20px; + margin-top:-20px; +} + .pagination select { + border:1px solid #ccc; + width:40px; + text-align:center; + position:relative; + top:4px + } + +.lyear-checkbox { + padding-left: 10px; +} diff --git a/SuperAPI/wwwroot/rezero/default_ui/css/style.min.css b/SuperAPI/wwwroot/rezero/default_ui/css/style.min.css new file mode 100644 index 0000000..55a3bbf --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/css/style.min.css @@ -0,0 +1,4541 @@ +/** ---------------------------------- + * 光年(Light Year Admin)后台管理系统模板 + * 基于Bootstrap v3.3.7 + * http://www.itshubao.com + * yinqi<3331653644@qq.com> + -------------------------------------- */ +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; + color: #4d5259; + line-height: 1.5; + font-size: 14px; + overflow-x: hidden; + background-color: #f5f6fa; +} +html, +body { + height: 100%; +} +a { + color: #33cabb; + -webkit-transition: .2s linear; + transition: .2s linear +} +a:hover, +a:focus { + color: #4d5259; + text-decoration: none; + outline: none +} +a:hover, +a:focus, +a:active { + text-decoration: none; +} +a, +button, +a:focus, +a:active, +button:focus, +button:active { + outline: none !important; +} +blockquote { + font-size: 16px; +} +img { + max-width: 100%; +} +pre { + background-color: #f9fafb; + border: none; + border-left: 5px solid #ebebeb; + padding: 12px; + border-radius: 3px; + color: #616a78; +} + +/** ---------------------------------- + * 示例中用到的样式,可删除 + -------------------------------------- */ +.example-box .btn { + margin-bottom: 10px; + margin-right: 6px; +} + +/** ---------------------------------- + * 重设样式 + -------------------------------------- */ + +/* 标题 */ +h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { + font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', 'Source Han Sans SC', 'Noto Sans CJK SC', 'WenQuanYi Micro Hei', sans-serif; + color: #313944; + line-height: 1.5; + letter-spacing: .5px; +} +.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 { + margin-top: 0; + margin-bottom: .5rem; +} + +/* 导航相关 */ +.navbar-toggle { + background-color: transparent; + border-color: transparent!important; +} +.navbar-default .navbar-toggle:hover, +.navbar-default .navbar-toggle:focus { + background-color: transparent; +} +.navbar-default .navbar-toggle .icon-bar { + background-color: #4d5259; +} +.nav > li > a:focus { + background-color: transparent; +} +.nav > li > a:hover { + background-color: rgba(0,0,0,.0085); +} +.nav .open > a, +.nav .open > a:focus, +.nav .open > a:hover { + background-color: transparent; + border-color: transparent; +} + +/* 下拉 */ +.dropdown-menu { + border-radius: 0; + border: none; + /*border: 1px solid rgba(235, 235, 235, 0.4);*/ + -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.075); + box-shadow: 0 0 4px rgba(0, 0, 0, 0.075); +} +.dropdown-menu > li > a:focus, .dropdown-menu > li > a:hover { + background-color: #f9fafb; +} +.dropdown-menu .divider { + background-color: #f1f2f3; +} +.dropdown-menu > li > a { + padding-top: 8px; + padding-bottom: 8px; +} +.dropdown-menu > li > a > i { + margin-right: 10px; +} +.dropdown-menu>.active>a, +.dropdown-menu>.active>a:focus, +.dropdown-menu>.active>a:hover { + background-color: #33cabb; +} + +/* 表格 */ +.table-bordered { + border-color: #eceeef; +} +.table>tbody>tr>td, +.table>tbody>tr>th, +.table>tfoot>tr>td, +.table>tfoot>tr>th, +.table>thead>tr>td, +.table>thead>tr>th { + /*padding: .75em;*/ + vertical-align: middle; + padding: 10px; + line-height: 1.5; + border-color: #eceeef; +} +.table-striped tbody tr:nth-of-type(odd) { + background-color: #fafafa; +} +.table-hover > tbody > tr:hover { + background-color: #F1FBFB; +} +.table-vcenter > thead > tr > th, +.table-vcenter > thead > tr > td, +.table-vcenter > tbody > tr > th, +.table-vcenter > tbody > tr > td, +.table-vcenter > tfoot > tr > th, +.table-vcenter > tfoot > tr > td { + vertical-align: middle; +} +.table-hover tbody tr { + -webkit-transition: background-color 0.2s linear; + transition: background-color 0.2s linear; +} +.table-condensed > tbody > tr > td, +.table-condensed > tbody > tr > th, +.table-condensed > tfoot > tr > td, +.table-condensed > tfoot > tr > th, +.table-condensed > thead > tr > td, +.table-condensed > thead > tr > th { + padding: .5em; +} + +/* 标签 */ +.label { + padding-top: .3em; + border-radius: 2px; + font-weight: 300; +} +.label-default { + background-color: #f5f6f7; + color: #8b95a5; +} +.label-primary { + background-color: #33cabb; +} +.label-success { + background-color: #15c377; +} +.label-info { + background-color: #48b0f7; +} +.label-warning { + background-color: #faa64b; +} +.label-danger { + background-color: #f96868; +} +.label-dark { + background-color: #222437; +} +.label-secondary { + background-color: #e4e7ea; + color: #4d5259; +} +.label-purple { + background-color: #926dde; +} +.label-pink { + background-color: #f96197; +} +.label-cyan { + background-color: #57c7d4; +} +.label-yellow { + background-color: #fcc525; +} +.label-brown { + background-color: #8d6658; +} +[class*='label-outline-'] { + position: relative; + border: 1px solid #ebebeb; + color: #4d5259; + font-size: 12px; +} +[class*='label-outline-']:before { + content: ""; + margin-right: 5px; + width: 8px; + height: 8px; + display: inline-block; + -wekit-border-radius: 50%; + border-radius: 50%; +} +.label-outline-default::before { + background-color: #f5f6f7; +} +.label-outline-primary::before { + background-color: #33cabb; +} +.label-outline-success::before { + background-color: #15c377; +} +.label-outline-info::before { + background-color: #48b0f7; +} +.label-outline-warning::before { + background-color: #faa64b; +} +.label-outline-danger::before { + background-color: #f96868; +} +.label-outline-dark::before { + background-color: #222437; +} +.label-outline-secondary::before { + background-color: #e4e7ea; +} +.label-outline-purple::before { + background-color: #926dde; +} +.label-outline-pink::before { + background-color: #f96197; +} +.label-outline-cyan::before { + background-color: #57c7d4; +} +.label-outline-yellow::before { + background-color: #fcc525; +} +.label-outline-brown::before { + background-color: #8d6658; +} +/* 淡一些的颜色 */ +.label-primary-light { + background-color: rgba(51, 202, 187, .15); + color: #33cabb; +} +.label-success-light { + background-color: rgba(21, 195, 119, .15); + color: #15c377; +} +.label-info-light { + background-color: rgba(72,176,247, .15); + color: #48b0f7; +} +.label-warning-light { + background-color: rgba(250,166,75, .15); + color: #faa64b; +} +.label-danger-light { + background-color: rgba(249,104,104, .15); + color: #f96868; +} +.label-purple-light { + background-color: rgba(146,109,222, .15); + color: #926dde; +} +.label-pink-light { + background-color: rgba(249,97,151, .15); + color: #f96197; +} +.label-cyan-light { + background-color: rgba(87,199,212, .15); + color: #57c7d4; +} +.label-yellow-light { + background-color: rgba(252,197,37, .15); + color: #fcc525; +} +.label-brown-light { + background-color: rgba(141,102,88, .15); + color: #8d6658; +} + +/* well */ +.well { + border-radius: 2px; + background-color: #f7f7f7; + border-color: #f0f0f0; + -webkit-box-shadow: none; + box-shadow: none; +} + +/* 面板 */ +.panel { + border-color: #f0f0f0; + -webkit-box-shadow: none; + box-shadow: none; + margin-bottom: 30px; +} +.panel a:hover, +.panel a:focus, +.panel a:active { + color: inherit; +} +.panel-heading { + -webkit-border-radius: 0px; + border-radius: 0px; +} +.panel-default>.panel-heading, +.panel-default>.panel-heading+.panel-collapse>.panel-body { + border-color: #f0f0f0; +} +.panel-primary>.panel-heading { + background-color: #33cabb; + border-color: #33cabb; +} +.panel-primary { + border-color: #33cabb; +} +.panel-primary>.panel-heading+.panel-collapse>.panel-body { + border-top-color: #33cabb; +} +.panel-primary > .panel-heading .badge { + color: #33cabb; +} +.panel-success>.panel-heading { + color: #fff; + background-color: #15c377; + border-color: #15c377; +} +.panel-success { + border-color: #15c377; +} +.panel-success>.panel-heading+.panel-collapse>.panel-body { + border-top-color: #15c377; +} +.panel-success > .panel-heading .badge { + background-color: #fff; + color: #15c377; +} +.panel-info>.panel-heading { + color: #fff; + background-color: #48b0f7; + border-color: #48b0f7; +} +.panel-info { + border-color: #48b0f7; +} +.panel-info>.panel-heading+.panel-collapse>.panel-body { + border-top-color: #48b0f7; +} +.panel-info > .panel-heading .badge { + background-color: #fff; + color: #48b0f7; +} +.panel-warning>.panel-heading { + color: #fff; + background-color: #faa64b; + border-color: #faa64b; +} +.panel-warning { + border-color: #faa64b; +} +.panel-warning>.panel-heading+.panel-collapse>.panel-body { + border-top-color: #faa64b; +} +.panel-warning > .panel-heading .badge { + background-color: #fff; + color: #faa64b; +} +.panel-danger>.panel-heading { + color: #fff; + background-color: #f96868; + border-color: #f96868; +} +.panel-danger { + border-color: #f96868; +} +.panel-danger>.panel-heading+.panel-collapse>.panel-body { + border-top-color: #f96868; +} +.panel-danger > .panel-heading .badge { + background-color: #fff; + color: #f96868; +} +.panel-dark>.panel-heading { + color: #fff; + background-color: #222437; + border-color: #222437; +} +.panel-dark { + border-color: #222437; +} +.panel-dark>.panel-heading+.panel-collapse>.panel-body { + border-top-color: #222437; +} +.panel-secondary>.panel-heading { + background-color: #e4e7ea; + border-color: #e4e7ea; +} +.panel-secondary { + border-color: #e4e7ea; +} +.panel-secondary>.panel-heading+.panel-collapse>.panel-body { + border-top-color: #e4e7ea; +} +.panel-purple>.panel-heading { + color: #fff; + background-color: #926dde; + border-color: #926dde; +} +.panel-purple { + border-color: #926dde; +} +.panel-purple>.panel-heading+.panel-collapse>.panel-body { + border-top-color: #926dde; +} +.panel-pink>.panel-heading { + color: #fff; + background-color: #f96197; + border-color: #f96197; +} +.panel-pink { + border-color: #f96197; +} +.panel-pink>.panel-heading+.panel-collapse>.panel-body { + border-top-color: #f96197; +} +.panel-cyan>.panel-heading { + color: #fff; + background-color: #57c7d4; + border-color: #57c7d4; +} +.panel-cyan { + border-color: #57c7d4; +} +.panel-cyan>.panel-heading+.panel-collapse>.panel-body { + border-top-color: #57c7d4; +} + +/* 列表组 */ +.list-group-item { + border-color: #f0f0f0; +} +a.list-group-item:focus, +a.list-group-item:hover, +button.list-group-item:focus, +button.list-group-item:hover { + background-color: #f9fafb; +} +.list-group-item.active, .list-group-item.active:focus, .list-group-item.active:hover { + background-color: #33cabb; + border-color: #33cabb; +} +.list-group-item:first-child { + border-top-left-radius: 2px; + border-top-right-radius: 2px; +} +.list-group-item:last-child { + border-bottom-right-radius: 2px; + border-bottom-left-radius: 2px; +} + +/* 表单 */ +.form-control { + height: 38px; + border-color: #ebebeb; + -webkit-border-radius: 2px; + border-radius: 2px; + padding: 5px 12px; + line-height: inherit; + -webkit-transition: 0.2s linear; + transition: 0.2s linear; + -webkit-box-shadow: none; + box-shadow: none; +} +.form-control:focus { + border-color: #33cabb; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(51, 202, 187, .6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(51, 202, 187, .6); +} +.input-group-addon { + border-color: #ebebeb; + background-color: #f9fafb; + -webkit-border-radius: 2px; + border-radius: 2px; +} +.input-group-lg>.form-control, .input-group-lg>.input-group-addon, .input-group-lg>.input-group-btn>.btn { + -webkit-border-radius: 2px; + border-radius: 2px; +} +.input-sm { + height: 30px; +} +.input-lg { + height: 46px; +} +.has-success .help-block, +.has-success .control-label, +.has-success .radio, +.has-success .checkbox, +.has-success .radio-inline, +.has-success .checkbox-inline, +.has-success.radio label, +.has-success.checkbox label, +.has-success.radio-inline label, +.has-success.checkbox-inline label { + color: #15c377; +} +.has-success .form-control { + border-color: #15c377!important; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075)!important; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075)!important; +} +.has-success .form-control:focus { + border-color: #15c377!important; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(21, 195, 119, .6)!important; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(21, 195, 119, .6)!important; +} +.has-success .input-group-addon { + color: #15c377; + background-color: #dff0d8; + border-color: #15c377; +} +.has-success .form-control-feedback { + color: #15c377; +} +.has-info .help-block, +.has-info .control-label, +.has-info .radio, +.has-info .checkbox, +.has-info .radio-inline, +.has-info .checkbox-inline, +.has-info.radio label, +.has-info.checkbox label, +.has-info.radio-inline label, +.has-info.checkbox-inline label { + color: #48b0f7; +} +.has-info .form-control { + border-color: #48b0f7!important; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075)!important; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075)!important; +} +.has-info .form-control:focus { + border-color: #48b0f7!important; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(72, 176, 247, .6)!important; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(72, 176, 247, .6)!important; +} +.has-info .input-group-addon { + color: #48b0f7; + background-color: #dff0d8; + border-color: #48b0f7; +} +.has-info .form-control-feedback { + color: #48b0f7; +} +.has-warning .help-block, +.has-warning .control-label, +.has-warning .radio, +.has-warning .checkbox, +.has-warning .radio-inline, +.has-warning .checkbox-inline, +.has-warning.radio label, +.has-warning.checkbox label, +.has-warning.radio-inline label, +.has-warning.checkbox-inline label { + color: #faa64b; +} +.has-warning .form-control { + border-color: #faa64b!important; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075)!important; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075)!important; +} +.has-warning .form-control:focus { + border-color: #faa64b!important; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px rgba(250, 166, 75, .6)!important; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px rgba(250, 166, 75, .6)!important; +} +.has-warning .input-group-addon { + color: #faa64b; + background-color: #fcf8e3; + border-color: #faa64b; +} +.has-warning .form-control-feedback { + color: #faa64b; +} +.has-error .help-block, +.has-error .control-label, +.has-error .radio, +.has-error .checkbox, +.has-error .radio-inline, +.has-error .checkbox-inline, +.has-error.radio label, +.has-error.checkbox label, +.has-error.radio-inline label, +.has-error.checkbox-inline label { + color: #f96868; +} +.has-error .form-control { + border-color: #f96868!important; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075)!important; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075)!important; +} +.has-error .form-control:focus { + border-color: #f96868!important; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px rgba(249, 104, 104, .6)!important; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px rgba(249, 104, 104, .6)!important; +} +.has-error .input-group-addon { + color: #f96868; + background-color: #f2dede; + border-color: #f96868; +} +.has-error .form-control-feedback { + color: #f96868; +} + +/* 复选框 & 单选框 */ +.lyear-checkbox, +.lyear-radio { + display: block; + position: relative; + margin-top: 0px; + margin-bottom: 0px; + cursor: pointer; + padding-left: 30px; + padding-right: 10px; + font-weight: 400; + min-height: 18px; + height: auto!important; + line-height: 18px!important; +} +input[type=checkbox], +input[type=radio] { + -webkit-box-sizing: border-box; + box-sizing: border-box; + padding: 0; +} +.lyear-checkbox input, +.lyear-radio input { + position: absolute;; + /*opacity: 0;*/ + display: none; +} +.lyear-checkbox span::before, +.lyear-radio span::before { + content: ''; + position: absolute; + display: inline-block; + height: 18px; + width: 18px; + left: 0; + top: 0px; + border: 2px solid #ebebeb;; + -webkit-transition: all .1s; + -o-transition: all .1s; + transition: all .1s; +} +.lyear-checkbox span::after, +.lyear-radio span::after { + content: ''; + position: absolute; + display: none; + width: 5px; + height: 10px; + left: 7px; + top: 3px; + border: solid #4d5259; + border-width: 0 2px 2px 0; + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); +} +.lyear-checkbox span, +.lyear-radio span { + display: inline-block; +} +.lyear-checkbox input:checked~span:after, +.lyear-radio input:checked~span:after { + display: inline-block; +} +.lyear-checkbox:hover span::before, +.lyear-radio:hover span::before { + border-color: #ebebeb; +} +.lyear-checkbox.checkbox-grey span::before, +.lyear-checkbox.radio-grey span::before, +.lyear-radio.checkbox-grey span::before, +.lyear-radio.radio-grey span::before { + background-color: #ebebeb; + border-color: #ebebeb; +} +.lyear-checkbox input:disabled + span, +.lyear-radio input:disabled + span { + cursor: not-allowed; +} +.lyear-checkbox input:disabled + span::before, +.lyear-checkbox input:disabled + span::after, +.lyear-radio input:disabled + span::before, +.lyear-radio input:disabled + span::after { + opacity: .4; +} +/* checkbox */ +.checkbox-primary input:checked~span::before { + background-color: #33cabb; + border-color: #33cabb; +} +.checkbox-primary input:checked~span::after { + border-color: #fff; +} +.checkbox-success input:checked~span::before { + background-color: #15c377; + border-color: #15c377; +} +.checkbox-success input:checked~span::after { + border-color: #fff; +} +.checkbox-info input:checked~span::before { + background-color: #48b0f7; + border-color: #48b0f7; +} +.checkbox-info input:checked~span::after { + border-color: #fff; +} +.checkbox-warning input:checked~span::before { + background-color: #faa64b; + border-color: #faa64b; +} +.checkbox-warning input:checked~span::after { + border-color: #fff; +} +.checkbox-danger input:checked~span::before { + background-color: #f96868; + border-color: #f96868; +} +.checkbox-danger input:checked~span::after { + border-color: #fff; +} +.checkbox-dark input:checked~span::before { + background-color: #222437; + border-color: #222437; +} +.checkbox-dark input:checked~span::after { + border-color: #fff; +} +.checkbox-secondary input:checked~span::before { + background-color: #e4e7ea; + border-color: #e4e7ea; +} +.checkbox-secondary input:checked~span::after { + border-color: #fff; +} +.checkbox-purple input:checked~span::before { + background-color: #926dde; + border-color: #926dde; +} +.checkbox-purple input:checked~span::after { + border-color: #fff; +} +.checkbox-pink input:checked~span::before { + background-color: #f96197; + border-color: #f96197; +} +.checkbox-pink input:checked~span::after { + border-color: #fff; +} +.checkbox-cyan input:checked~span::before { + background-color: #57c7d4; + border-color: #57c7d4; +} +.checkbox-cyan input:checked~span::after { + border-color: #fff; +} +.checkbox-yellow input:checked~span::before { + background-color: #fcc525; + border-color: #fcc525; +} +.checkbox-yellow input:checked~span::after { + border-color: #fff; +} +.checkbox-brown input:checked~span::before { + background-color: #8d6658; + border-color: #8d6658; +} +.checkbox-brown input:checked~span::after { + border-color: #fff; +} +/* radio */ +.lyear-radio span::before { + -webkit-border-radius: 50%; + border-radius: 50%; +} +.lyear-radio span::after { + border: 0; + height: 6px; + left: 6px; + top: 6px; + width: 6px; + background: #4d5259; + -webkit-border-radius: 100%; + border-radius: 100%; +} +.radio-primary input:checked~span::before { + background-color: #33cabb; + border-color: #33cabb; +} +.radio-primary input:checked~span::after { + background-color: #fff; +} +.radio-success input:checked~span::before { + background-color: #15c377; + border-color: #15c377; +} +.radio-success input:checked~span::after { + background-color: #fff; +} +.radio-info input:checked~span::before { + background-color: #48b0f7; + border-color: #48b0f7; +} +.radio-info input:checked~span::after { + background-color: #fff; +} +.radio-warning input:checked~span::before { + background-color: #faa64b; + border-color: #faa64b; +} +.radio-warning input:checked~span::after { + background-color: #fff; +} +.radio-danger input:checked~span::before { + background-color: #f96868; + border-color: #f96868; +} +.radio-danger input:checked~span::after { + background-color: #fff; +} +.radio-dark input:checked~span::before { + background-color: #222437; + border-color: #222437; +} +.radio-dark input:checked~span::after { + background-color: #fff; +} +.radio-secondary input:checked~span::before { + background-color: #e4e7ea; + border-color: #e4e7ea; +} +.radio-secondary input:checked~span::after { + background-color: #fff; +} +.radio-purple input:checked~span::before { + background-color: #926dde; + border-color: #926dde; +} +.radio-purple input:checked~span::after { + background-color: #fff; +} +.radio-pink input:checked~span::before { + background-color: #f96197; + border-color: #f96197; +} +.radio-pink input:checked~span::after { + background-color: #fff; +} +.radio-cyan input:checked~span::before { + background-color: #57c7d4; + border-color: #57c7d4; +} +.radio-cyan input:checked~span::after { + background-color: #fff; +} +.radio-yellow input:checked~span::before { + background-color: #fcc525; + border-color: #fcc525; +} +.radio-yellow input:checked~span::after { + background-color: #fff; +} +.radio-brown input:checked~span::before { + background-color: #8d6658; + border-color: #8d6658; +} +.radio-brown input:checked~span::after { + background-color: #fff; +} + +.checkbox-inline, .radio-inline { + display: inline-block; +} +.form-horizontal .lyear-radio.radio-inline, +.form-horizontal .lyear-checkbox.checkbox-inline { + padding-top: 0px; + margin-top: 8px; +} +.checkbox-inline+.checkbox-inline, +.radio-inline+.radio-inline { + margin-left: 0px; +} + +/* 开关 */ +.lyear-switch { + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + margin-bottom: 0; +} +.lyear-switch input { + height: 0; + width: 0; + position: absolute; + opacity: 0; +} +.lyear-switch span { + display: inline-block; + position: relative; + width: 40px; + height: 10px; + -webkit-border-radius: 10px; + border-radius: 10px; + background-color: #ebebeb; + border: 2px solid #ebebeb; + cursor: pointer; + -webkit-transition: all .1s ease; + -o-transition: all .1s ease; + transition: all .1s ease +} +.lyear-switch span:after { + content: ''; + height: 20px; + width: 20px; + -webkit-border-radius: 50%; + border-radius: 50%; + position: absolute; + left: 1px; + top: -7px; + color: #aaa; + -webkit-transition: all .1s ease; + -o-transition: all .1s ease; + transition: all .1s ease; + text-align: center; + font-size: 13px; + background-color: #fff; + -webkit-box-shadow: rgba(0,0,0,.12) 0 1px 6px,rgba(0,0,0,.12) 0 1px 4px; + box-shadow: rgba(0,0,0,.12) 0 1px 6px,rgba(0,0,0,.12) 0 1px 4px +} +.lyear-switch input:checked~span:after { + left: -webkit-calc(100% - 20px); + left: calc(100% - 20px); +} +.switch-primary input:checked~span:after { + background-color: #33cabb +} +.switch-success input:checked~span:after { + background-color: #15c377 +} +.switch-info input:checked~span:after { + background-color: #48b0f7 +} +.switch-warning input:checked~span:after { + background-color: #faa64b +} +.switch-danger input:checked~span:after { + background-color: #f96868 +} +.switch-secondary input:checked~span:after { + background-color: #868e96 +} +.switch-dark input:checked~span:after { + background-color: #222437 +} +.switch-purple input:checked~span:after { + background-color: #926dde +} +.switch-pink input:checked~span:after { + background-color: #f96197 +} +.switch-cyan input:checked~span:after { + background-color: #57c7d4 +} +.switch-yellow input:checked~span:after { + background-color: #fcc525 +} +.switch-brown input:checked~span:after { + background-color: #8d6658 +} + +.lyear-switch.switch-solid span, +.lyear-switch.switch-light span, +.lyear-switch.switch-outline span { + height: 20px; +} +.lyear-switch.switch-solid span:after, +.lyear-switch.switch-light span:after, +.lyear-switch.switch-outline span:after { + top: -2px; +} +.lyear-switch.switch-outline span { + background-color: #fff +} +.switch-solid.switch-primary input:checked~span { + background-color: #33cabb; + border-color: #33cabb +} +.switch-solid.switch-primary input:checked~span:after { + background-color: #fff; + color: #33cabb +} +.switch-solid.switch-success input:checked~span { + background-color: #15c377; + border-color: #15c377 +} +.switch-solid.switch-success input:checked~span:after { + background-color: #fff; + color: #15c377 +} +.switch-solid.switch-info input:checked~span { + background-color: #48b0f7; + border-color: #48b0f7 +} +.switch-solid.switch-info input:checked~span:after { + background-color: #fff; + color: #48b0f7 +} +.switch-solid.switch-warning input:checked~span { + background-color: #faa64b; + border-color: #faa64b +} +.switch-solid.switch-warning input:checked~span:after { + background-color: #fff; + color: #faa64b +} +.switch-solid.switch-danger input:checked~span { + background-color: #f96868; + border-color: #f96868 +} +.switch-solid.switch-danger input:checked~span:after { + background-color: #fff; + color: #f96868 +} +.switch-solid.switch-secondary input:checked~span { + background-color: #868e96; + border-color: #868e96 +} +.switch-solid.switch-secondary input:checked~span:after { + background-color: #fff; + color: #868e96 +} +.switch-solid.switch-dark input:checked~span { + background-color: #222437; + border-color: #222437 +} +.switch-solid.switch-dark input:checked~span:after { + background-color: #fff; + color: #222437 +} +.switch-solid.switch-purple input:checked~span { + background-color: #926dde; + border-color: #926dde +} +.switch-solid.switch-purple input:checked~span:after { + background-color: #fff; + color: #926dde +} +.switch-solid.switch-pink input:checked~span { + background-color: #f96197; + border-color: #f96197 +} +.switch-solid.switch-pink input:checked~span:after { + background-color: #fff; + color: #f96197 +} +.switch-solid.switch-cyan input:checked~span { + background-color: #57c7d4; + border-color: #57c7d4 +} +.switch-solid.switch-cyan input:checked~span:after { + background-color: #fff; + color: #57c7d4 +} +.switch-solid.switch-yellow input:checked~span { + background-color: #fcc525; + border-color: #fcc525 +} +.switch-solid.switch-yellow input:checked~span:after { + background-color: #fff; + color: #fcc525 +} +.switch-solid.switch-brown input:checked~span { + background-color: #8d6658; + border-color: #8d6658 +} +.switch-solid.switch-brown input:checked~span:after { + background-color: #fff; + color: #8d6658 +} + +/* 模态框 */ +.modal-header { + border-bottom-color: #f1f2f3; +} +.modal-footer { + border-top-color: #f1f2f3; +} +.modal-content { + -webkit-border-radius: 3px; + border-radius: 3px; + border: none; + -webkit-box-shadow: none; + box-shadow: none; +} + +/* 标签页 */ +.nav-tabs { + border-bottom-color: #ebebeb; + margin-bottom: 1rem; +} +.nav-tabs > li > a { + margin-right: 0px; + border: none; + border-bottom: 1px solid transparent; + border-radius: 0; + color: #8b95a5; + -webkit-transition: 0.5s; + transition: 0.5s; +} +.nav-tabs > li.active > a, +.nav-tabs > li.active > a:focus, +.nav-tabs > li.active > a:hover { + color: #4d5259; + border: none; + background-color: transparent; + border-bottom: 1px solid #33cabb; +} +.nav-tabs.nav > li > a:hover, +.nav-tabs.nav > li > a:focus { + text-decoration: none; + background-color: transparent; + border-bottom-color: #33cabb; +} +.nav-tabs.nav-justified>.active>a, +.nav-tabs.nav-justified>.active>a:focus, +.nav-tabs.nav-justified>.active>a:hover { + color: #4d5259; + border: none; + border-bottom: 1px solid #33cabb; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified>li>a { + border-bottom-color: #ebebeb; + -webkit-border-radius: 0px; + border-radius: 0px; + } +} + +/* 进度条 */ +.progress { + height: 12px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + margin-bottom: 8px; + background-color: #f5f6f7; + -webkit-box-shadow: none; + box-shadow: none; +} +.progress-bar { + font-size: 10px; + line-height: 12px; + background-color: #33cabb; + -webkit-box-shadow: none; + box-shadow: none; +} +.progress-bar-success { + background-color: #15c377; +} +.progress-bar-info { + background-color: #48b0f7; +} +.progress-bar-warning { + background-color: #faa64b; +} +.progress-bar-danger { + background-color: #f96868; +} +.progress-bar-secondary { + background-color: #e4e7ea; +} +.progress-bar-pink { + background-color: #f96197; +} +.progress-bar-purple { + background-color: #926dde; +} +.progress-bar-brown { + background-color: #8d6658; +} +.progress-bar-cyan { + background-color: #57c7d4; +} +.progress-bar-yellow { + background-color: #fcc525; +} +.progress-bar-gray { + background-color: #868e96; +} +.progress-bar-dark { + background-color: #222437; +} +.progress-sm { + height: 8px; +} +.progress-lg { + height: 16px; +} + +/* 弹出框 */ +.popover { + border-color: #ebebeb; + -webkit-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: none; + box-shadow: none; + padding: 0px; +} +.popover-title { + background-color: #fcfdfe; + padding-top: 10px; + padding-bottom: 10px; + color: #616a78; + border-bottom-color: #f1f2f3; +} +.popover.top>.arrow { + border-top-color: #ebebeb; +} +.popover.right>.arrow { + border-right-color: #ebebeb; +} +.popover.bottom>.arrow { + border-bottom-color: #ebebeb; +} +.popover.left>.arrow { + border-left-color: #ebebeb; +} + +/* 警告框 */ +.alert { + -webkit-border-radius: 2px; + border-radius: 2px; +} +.alert .alert-link:hover { + text-decoration: underline; +} + +/* 分页 */ +.pagination > li > a, +.pagination > li > span { + padding: 0px 8px; + margin: 0 3px; + color: #6c757d; + border-color: #dee2e6; + line-height: 29px; + min-width: 31px; + text-align: center; + -webkit-border-radius: 2px; + border-radius: 2px; +} +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 0; + min-width: 26px; + line-height: 24px; +} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding: 0; + min-width: 37px; + line-height: 35px; +} +.pagination > li > a:hover, +.pagination > li > a:focus +.pagination > li > span:hover, +.pagination > li > span:focus { + background-color: #f9fafb; + color: #4d5259; +} +.pagination > li:first-child a, +.pagination > li:first-child span { + -webkit-border-radius: 2px; + border-radius: 2px; +} +.pagination > li:last-child a, +.pagination > li:last-child span { + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; +} +.pagination > .active > a, +.pagination > .active > a:focus, +.pagination > .active > a:hover, +.pagination > .active > span, +.pagination > .active > span:focus, +.pagination > .active > span:hover { + background-color: #33cabb; + border-color: #33cabb; +} +.pagination > .disabled > a, +.pagination > .disabled > a:focus, +.pagination > .disabled > a:hover, +.pagination > .disabled > span, +.pagination > .disabled > span:focus, +.pagination > .disabled > span:hover { + color: #6c757d; + opacity: 0.6; +} +.pagination.no-border > li a, +.pagination.no-border > li span { + border: none; +} +.pagination-circle > li a, +.pagination-circle > li span { + -webkit-border-radius: 50% !important; + border-radius: 50% !important; +} +.pagination.no-gutters > li a, +.pagination.no-gutters > li span { + margin: 0; + margin-left: -1px; + -webkit-border-radius: 0 !important; + border-radius: 0 !important; +} + +.pager li > a, +.pager li > span { + -webkit-border-radius: 2px; + border-radius: 2px; + background-color: #fcfdfe; + border-color: #ebebeb; + color: #8b95a5; +} +.pager li > a:hover, +.pager li > a:focus{ + background-color: #f9fafb; + color: #4d5259 +} +.pager li > a:active, +.pager li > a.active { + background-color: #f9fafb; + color: #4d5259 +} +.pager .disabled > a, +.pager .disabled > a:focus, +.pager .disabled > a:hover, +.pager .disabled > span { + opacity: .6; + background-color: #fcfdfe; +} + +/* 按钮 */ +.btn-w-xs { + width: 80px +} +.btn-w-sm { + width: 100px +} +.btn-w-md { + width: 120px +} +.btn-w-lg { + width: 145px +} +.btn-w-xl { + width: 180px +} +.btn { + color: #8b95a5; + padding: 8px 12px; + letter-spacing: 1px; + border-radius: 2px; + background-color: #fff; + outline: none !important; + -webkit-transition: 0.15s linear; + transition: 0.15s linear +} +.btn:focus, +.btn.focus, +.btn:active, +.btn.active { + -webkit-box-shadow: none !important; + box-shadow: none !important +} +.btn-default { + background-color: #fcfdfe; + border-color: #ebebeb; + color: #8b95a5 +} +.btn-default:hover { + background-color: #f9fafb; + border-color: #ebebeb; + color: #4d5259 +} +.btn-default:focus, +.btn-default.focus, +.btn-default:active, +.btn-default.active, +.show>.btn-default.dropdown-toggle, +.open>.btn-default.dropdown-toggle { + background-color: #f9fafb!important; + border-color: #ebebeb!important; + color: #4d5259 +} +.btn-default:not([disabled]):not(.disabled).active, +.btn-default:not([disabled]):not(.disabled):active, +.show>.btn-default.dropdown-toggle { + background-color: #f9fafb!important; + border-color: #ebebeb!important; + color: #4d5259; + -webkit-box-shadow: none; + box-shadow: none +} +.btn-default.disabled, +.btn-default:disabled { + background-color: #fcfdfe; + border-color: #ebebeb; + opacity: 0.5 +} +.btn-primary { + background-color: #33cabb; + border-color: #33cabb; + color: #fff!important; +} +.btn-primary:hover { + background-color: #52d3c7; + border-color: #52d3c7; +} +.btn-primary:focus, +.btn-primary.focus, +.btn-primary.active, +.btn-primary:active, +.open>.dropdown-toggle.btn-primary { + background-color: #52d3c7!important; + border-color: #52d3c7!important; +} +.btn-primary.disabled, +.btn-primary:disabled { + background-color: #33cabb; + border-color: #33cabb; + opacity: 0.5 +} +.btn-primary:not([disabled]):not(.disabled).active, +.btn-primary:not([disabled]):not(.disabled):active, +.show>.btn-primary.dropdown-toggle { + background-color: #2ba99d!important; + border-color: #2ba99d!important; + -webkit-box-shadow: none; + box-shadow: none +} +.btn-primary.disabled.focus, +.btn-primary.disabled:focus, +.btn-primary.disabled:hover, +.btn-primary[disabled].focus, +.btn-primary[disabled]:focus, +.btn-primary[disabled]:hover, +fieldset[disabled] .btn-primary.focus, +fieldset[disabled] .btn-primary:focus, +fieldset[disabled] .btn-primary:hover { + background-color: #26BBA8; + border-color: #26BBA8; +} +.btn-success { + background-color: #15c377; + border-color: #15c377; + color: #fff!important; +} +.btn-success:hover { + background-color: #16d17f; + border-color: #16d17f; +} +.btn-success:focus, +.btn-success.focus, +.btn-success.active, +.btn-success:active, +.open>.dropdown-toggle.btn-success { + background-color: #16d17f!important; + border-color: #16d17f!important; +} +.btn-success.disabled,.btn-success:disabled { + background-color: #15c377; + border-color: #15c377; + opacity: 0.5 +} +.btn-success:not([disabled]):not(.disabled).active, +.btn-success:not([disabled]):not(.disabled):active, +.show>.btn-success.dropdown-toggle { + background-color: #14b56f!important; + border-color: #14b56f!important; + -webkit-box-shadow: none; + box-shadow: none +} +.btn-success.disabled.focus, +.btn-success.disabled:focus, +.btn-success.disabled:hover, +.btn-success[disabled].focus, +.btn-success[disabled]:focus, +.btn-success[disabled]:hover, +fieldset[disabled] .btn-success.focus, +fieldset[disabled] .btn-success:focus, +fieldset[disabled] .btn-success:hover { + background-color: #0FB25F; + border-color: #0FB25F; +} +.btn-info { + background-color: #48b0f7; + border-color: #48b0f7; + color: #fff!important; +} +.btn-info:hover { + background-color: #65bdf8; + border-color: #65bdf8; +} +.btn-info:focus, +.btn-info.focus, +.btn-info.active, +.btn-info:active, +.open>.dropdown-toggle.btn-info { + background-color: #65bdf8!important; + border-color: #65bdf8!important; +} +.btn-info.disabled, +.btn-info:disabled { + background-color: #48b0f7; + border-color: #48b0f7; + opacity: 0.5 +} +.btn-info:not([disabled]):not(.disabled).active, +.btn-info:not([disabled]):not(.disabled):active, +.show>.btn-info.dropdown-toggle { + background-color: #2ba3f6!important; + border-color: #2ba3f6!important; + -webkit-box-shadow: none; + box-shadow: none +} +.btn-info.disabled.focus, +.btn-info.disabled:focus, +.btn-info.disabled:hover, +.btn-info[disabled].focus, +.btn-info[disabled]:focus, +.btn-info[disabled]:hover, +fieldset[disabled] .btn-info.focus, +fieldset[disabled] .btn-info:focus, +fieldset[disabled] .btn-info:hover { + background-color: #379BF5; + border-color: #379BF5; +} +.btn-warning { + background-color: #faa64b; + border-color: #faa64b; + color: #fff!important; +} +.btn-warning:hover { + background-color: #fbb264; + border-color: #fbb264; +} +.btn-warning:focus, +.btn-warning.focus, +.btn-warning.active, +.btn-warning:active, +.open>.dropdown-toggle.btn-warning { + background-color: #fbb264!important; + border-color: #fbb264!important; +} +.btn-warning.disabled,.btn-warning:disabled { + background-color: #faa64b; + border-color: #faa64b; + opacity: 0.5 +} +.btn-warning:not([disabled]):not(.disabled).active, +.btn-warning:not([disabled]):not(.disabled):active, +.show>.btn-warning.dropdown-toggle { + background-color: #f99a32!important; + border-color: #f99a32!important; + -webkit-box-shadow: none; + box-shadow: none +} +.btn-warning.disabled.focus, +.btn-warning.disabled:focus, +.btn-warning.disabled:hover, +.btn-warning[disabled].focus, +.btn-warning[disabled]:focus, +.btn-warning[disabled]:hover, +fieldset[disabled] .btn-warning.focus, +fieldset[disabled] .btn-warning:focus, +fieldset[disabled] .btn-warning:hover { + background-color: #F89038; + border-color: #F89038; +} +.btn-danger { + background-color: #f96868; + border-color: #f96868; + color: #fff!important; +} +.btn-danger:hover { + background-color: #fa8181; + border-color: #fa8181; +} +.btn-danger:focus, +.btn-danger.focus, +.btn-danger.active, +.btn-danger:active, +.open>.dropdown-toggle.btn-danger { + background-color: #fa8181!important; + border-color: #fa8181!important; +} +.btn-danger.disabled, +.btn-danger:disabled { + background-color: #f96868; + border-color: #f96868; + opacity: 0.5 +} +.btn-danger:not([disabled]):not(.disabled).active, +.btn-danger:not([disabled]):not(.disabled):active, +.show>.btn-danger.dropdown-toggle { + background-color: #f84f4f!important; + border-color: #f84f4f!important; + -webkit-box-shadow: none; + box-shadow: none +} +.btn-danger.disabled.focus, +.btn-danger.disabled:focus, +.btn-danger.disabled:hover, +.btn-danger[disabled].focus, +.btn-danger[disabled]:focus, +.btn-danger[disabled]:hover, +fieldset[disabled] .btn-danger.focus, +fieldset[disabled] .btn-danger:focus, +fieldset[disabled] .btn-danger:hover { + background-color: #F75252; + border-color: #F75252; +} +.btn-secondary { + color: #4d5259 !important; + background-color: #e4e7ea; + border-color: #e4e7ea; +} +.btn-secondary:hover { + background-color: #edeff1; + border-color: #edeff1; +} +.btn-secondary:focus, +.btn-secondary.focus, +.btn-secondary.active, +.btn-secondary:active, +.open>.dropdown-toggle.btn-secondary { + background-color: #edeff1!important; + border-color: #edeff1!important; +} +.btn-secondary.disabled, +.btn-secondary:disabled { + background-color: #e4e7ea; + border-color: #e4e7ea; + opacity: 0.5 +} +.btn-secondary:not([disabled]):not(.disabled).active, +.btn-secondary:not([disabled]):not(.disabled):active, +.show>.btn-secondary.dropdown-toggle { + background-color: #dbdfe3!important; + border-color: #dbdfe3!important; + -webkit-box-shadow: none; + box-shadow: none +} +.btn-secondary.disabled.focus, +.btn-secondary.disabled:focus, +.btn-secondary.disabled:hover, +.btn-secondary[disabled].focus, +.btn-secondary[disabled]:focus, +.btn-secondary[disabled]:hover, +fieldset[disabled] .btn-secondary.focus, +fieldset[disabled] .btn-secondary:focus, +fieldset[disabled] .btn-secondary:hover { + background-color: #DBDFE3; + border-color: #DBDFE3; +} +.btn-link { + color: #48b0f7; + background-color: transparent; + border-color: transparent; +} +.btn-link:hover, +.btn-link:focus { + text-decoration: none; + color: #e4e7ea +} +.btn-purple { + background-color: #926dde; + border-color: #926dde; + color: #fff!important; +} +.btn-purple:hover { + background-color: #a282e3; + border-color: #a282e3; +} +.btn-purple:focus, +.btn-purple.focus, +.btn-purple.active, +.btn-purple:active, +.open>.dropdown-toggle.btn-purple { + background-color: #a282e3!important; + border-color: #a282e3!important; +} +.btn-purple.disabled, +.btn-purple:disabled { + background-color: #926dde; + border-color: #926dde; + opacity: 0.5 +} +.btn-purple:not([disabled]):not(.disabled).active, +.btn-purple:not([disabled]):not(.disabled):active, +.show>.btn-purple.dropdown-toggle { + background-color: #8258d9!important; + border-color: #8258d9!important; + -webkit-box-shadow: none; + box-shadow: none +} +.btn-purple.disabled.focus, +.btn-purple.disabled:focus, +.btn-purple.disabled:hover, +.btn-purple[disabled].focus, +.btn-purple[disabled]:focus, +.btn-purple[disabled]:hover, +fieldset[disabled] .btn-purple.focus, +fieldset[disabled] .btn-purple:focus, +fieldset[disabled] .btn-purple:hover { + background-color: #7A56D4; + border-color: #7A56D4; +} +.btn-pink { + background-color: #f96197; + border-color: #f96197; + color: #fff!important; +} +.btn-pink:hover { + background-color: #fa75a4; + border-color: #fa75a4; +} +.btn-pink:focus, +.btn-pink.focus, +.btn-pink.active, +.btn-pink:active, +.open>.dropdown-toggle.btn-pink { + background-color: #fa75a4!important; + border-color: #fa75a4!important; +} +.btn-pink.disabled, +.btn-pink:disabled { + background-color: #f96197; + border-color: #f96197; + opacity: 0.5 +} +.btn-pink:not([disabled]):not(.disabled).active, +.btn-pink:not([disabled]):not(.disabled):active, +.show>.btn-pink.dropdown-toggle { + background-color: #f84d8a!important; + border-color: #f84d8a!important; + -webkit-box-shadow: none; + box-shadow: none +} +.btn-pink.disabled.focus, +.btn-pink.disabled:focus, +.btn-pink.disabled:hover, +.btn-pink[disabled].focus, +.btn-pink[disabled]:focus, +.btn-pink[disabled]:hover, +fieldset[disabled] .btn-pink.focus, +fieldset[disabled] .btn-pink:focus, +fieldset[disabled] .btn-pink:hover { + background-color: #F74B80; + border-color: #F74B80; +} +.btn-cyan { + background-color: #57c7d4; + border-color: #57c7d4; + color: #fff!important; +} +.btn-cyan:hover { + background-color: #77d2dc; + border-color: #77d2dc; +} +.btn-cyan:focus, +.btn-cyan.focus, +.btn-cyan.active, +.btn-cyan:active, +.open>.dropdown-toggle.btn-cyan { + background-color: #77d2dc!important; + border-color: #77d2dc!important; +} +.btn-cyan.disabled, +.btn-cyan:disabled { + background-color: #57c7d4; + border-color: #57c7d4; + opacity: 0.5 +} +.btn-cyan:not([disabled]):not(.disabled).active, +.btn-cyan:not([disabled]):not(.disabled):active, +.show>.btn-cyan.dropdown-toggle { + background-color: #37bccc!important; + border-color: #37bccc!important; + -webkit-box-shadow: none; + box-shadow: none +} +.btn-cyan.disabled.focus, +.btn-cyan.disabled:focus, +.btn-cyan.disabled:hover, +.btn-cyan[disabled].focus, +.btn-cyan[disabled]:focus, +.btn-cyan[disabled]:hover, +fieldset[disabled] .btn-cyan.focus, +fieldset[disabled] .btn-cyan:focus, +fieldset[disabled] .btn-cyan:hover { + background-color: #42B7C7; + border-color: #42B7C7; +} +.btn-yellow { + background-color: #fcc525; + border-color: #fcc525; + color: #fff!important; +} +.btn-yellow:hover { + background-color: #fdd04d; + border-color: #fdd04d; +} +.btn-yellow:focus, +.btn-yellow.focus, +.btn-yellow.active, +.btn-yellow:active, +.open>.dropdown-toggle.btn-yellow { + background-color: #fdd04d!important; + border-color: #fdd04d!important; +} +.btn-yellow.disabled, +.btn-yellow:disabled { + background-color: #fcc525; + border-color: #fcc525; + opacity: 0.5 +} +.btn-yellow:not([disabled]):not(.disabled).active, +.btn-yellow:not([disabled]):not(.disabled):active, +.show>.btn-yellow.dropdown-toggle { + background-color: #f5b703!important; + border-color: #f5b703!important; + -webkit-box-shadow: none; + box-shadow: none +} +.btn-yellow.disabled.focus, +.btn-yellow.disabled:focus, +.btn-yellow.disabled:hover, +.btn-yellow[disabled].focus, +.btn-yellow[disabled]:focus, +.btn-yellow[disabled]:hover, +fieldset[disabled] .btn-yellow.focus, +fieldset[disabled] .btn-yellow:focus, +fieldset[disabled] .btn-yellow:hover { + background-color: #FCB41B; + border-color: #FCB41B; +} +.btn-brown { + background-color: #8d6658; + border-color: #8d6658; + color: #fff!important; +} +.btn-brown:hover { + background-color: #9d7162; + border-color: #9d7162; +} +.btn-brown:focus, +.btn-brown.focus, +.btn-brown.active, +.btn-brown:active, +.open>.dropdown-toggle.btn-brown { + background-color: #8d6658!important; + border-color: #8d6658!important; +} +.btn-brown.disabled, +.btn-brown:disabled { + background-color: #8d6658; + border-color: #8d6658; + opacity: 0.5 +} +.btn-brown:not([disabled]):not(.disabled).active, +.btn-brown:not([disabled]):not(.disabled):active, +.show>.btn-brown.dropdown-toggle { + background-color: #7d5b4e!important; + border-color: #7d5b4e!important; + -webkit-box-shadow: none; + box-shadow: none +} +.btn-brown.disabled.focus, +.btn-brown.disabled:focus, +.btn-brown.disabled:hover, +.btn-brown[disabled].focus, +.btn-brown[disabled]:focus, +.btn-brown[disabled]:hover, +fieldset[disabled] .btn-brown.focus, +fieldset[disabled] .btn-brown:focus, +fieldset[disabled] .btn-brown:hover { + background-color: #755043; + border-color: #755043; +} +.btn-dark { + background-color: #222437; + border-color: #222437; + color: #fff!important; +} +.btn-dark:hover { + background-color: #515d70; + border-color: #515d70; +} +.btn-dark:focus, +.btn-dark.focus, +.btn-dark.active, +.btn-dark:active, +.open>.dropdown-toggle.btn-dark { + background-color: #515d70!important; + border-color: #515d70!important; +} +.btn-dark.disabled, +.btn-dark:disabled { + background-color: #222437; + border-color: #222437; + opacity: 0.5 +} +.btn-dark:not([disabled]):not(.disabled).active, +.btn-dark:not([disabled]):not(.disabled):active, +.show>.btn-dark.dropdown-toggle { + background-color: #3b4552!important; + border-color: #3b4552!important; + -webkit-box-shadow: none; + box-shadow: none +} +.btn-dark.disabled.focus, +.btn-dark.disabled:focus, +.btn-dark.disabled:hover, +.btn-dark[disabled].focus, +.btn-dark[disabled]:focus, +.btn-dark[disabled]:hover, +fieldset[disabled] .btn-dark.focus, +fieldset[disabled] .btn-dark:focus, +fieldset[disabled] .btn-dark:hover { + background-color: #353E4B; + border-color: #353E4B; +} +.btn-round { + -webkit-border-radius: 10rem; +} +.btn-label { + position: relative; + padding-left: 52px; + overflow: hidden; +} +.btn-label label { + position: absolute; + left: 0; + top: 0; + bottom: 0; + width: 36px; + line-height: 1.5; + padding-top: 5px; + padding-bottom: 5px; + background-color: rgba(0,0,0,0.1); + cursor: pointer; + margin-bottom: 0; +} +.btn-label label i { + font-size: 16px; +} +.btn-group-xs>.btn, +.btn-xs { + font-size: 12px; + padding: 2px 6px; + line-height: 18px +} +.btn-group-sm>.btn, +.btn-sm { + font-size: 12px; + padding: 4px 8px; + line-height: 20px +} +.btn-group-lg>.btn, +.btn-lg { + font-size: 16px; + padding: 7px 20px; + line-height: 32px +} +.btn-sm.btn-label { + padding-left: 42px; +} +.btn-sm.btn-label label { + line-height: 20px; + width: 30px; +} +.btn-lg.btn-label { + padding-left: 58px; +} +.btn-lg.btn-label label { + line-height: 36px; + width: 36px; +} +.btn-xs.btn-label { + padding-left: 36px; +} +.btn-xs.btn-label label { + line-height: 14px; + width: 28px; +} +.btn-group-justified { + display: -webkit-box; + display: flex; + -webkit-box-pack: justify; + justify-content: space-between; +} +.btn-group-justified .btn, +.btn-group-justified .btn-group { + width: 100%; +} +.btn-group-round .btn:first-child { + border-top-left-radius: 10rem; + border-bottom-left-radius: 10rem; +} +.btn-group-round .btn:last-child { + border-top-right-radius: 10rem; + border-bottom-right-radius: 10rem; +} + +/* 背景色 */ +.bg-primary { + background-color: #33cabb !important; + color: #fff!important; +} +.bg-secondary { + background-color: #e4e7ea !important; + color: #fff!important; +} +.bg-success { + background-color: #15c377 !important; + color: #fff!important; +} +.bg-info { + background-color: #48b0f7 !important; + color: #fff!important; +} +.bg-warning { + background-color: #faa64b !important; + color: #fff!important; +} +.bg-danger { + background-color: #f96868 !important; + color: #fff!important; +} +.bg-pink { + background-color: #f96197 !important; + color: #fff!important; +} +.bg-purple { + background-color: #926dde !important; + color: #fff!important; +} +.bg-brown { + background-color: #8d6658 !important; + color: #fff!important; +} +.bg-cyan { + background-color: #57c7d4 !important; + color: #fff!important; +} +.bg-yellow { + background-color: #fcc525 !important; + color: #fff!important; +} +.bg-gray { + background-color: #868e96 !important; + color: #fff!important; +} +.bg-dark { + background-color: #222437 !important; + color: #fff!important; +} +.bg-white { + background-color: #fff !important +} +.bg-lightest { + background-color: #fcfdfe !important +} +.bg-lighter { + background-color: #f9fafb !important +} +.bg-light { + background-color: #f5f6f7 !important +} +.bg-translucent { + background-color: rgba(255, 255, 255, 0.175) +} +.bg-transparent { + background-color: transparent !important +} + +/* 字体颜色 */ +.text-primary { + color: #33cabb !important +} +.text-secondary { + color: #e4e7ea !important +} +.text-success { + color: #15c377 !important +} +.text-info { + color: #48b0f7 !important +} +.text-warning { + color: #faa64b !important +} +.text-danger { + color: #f96868 !important +} +.text-pink { + color: #f96197 !important +} +.text-purple { + color: #926dde !important +} +.text-brown { + color: #8d6658 !important +} +.text-cyan { + color: #57c7d4 !important +} +.text-yellow { + color: #fcc525 !important +} +.text-gray { + color: #868e96 !important +} +.text-dark { + color: #222437 !important +} +.text-default { + color: #4d5259 !important +} +.text-muted { + color: #868e96 !important +} +.text-light { + color: #616a78 !important +} +.text-lighter { + color: #a5b3c7 !important +} +.text-fade { + color: rgba(77,82,89,0.7) !important +} +.text-fader { + color: rgba(77,82,89,0.5) !important +} +.text-fadest { + color: rgba(77,82,89,0.4) !important +} +.text-white-50 { + color: rgba(255, 255, 255, 0.5) !important +} +.text-white { + color: #ffffff!important +} +.text-transparent { + color: transparent !important +} +a.text-primary:hover,a.text-primary:focus { + color: #33cabb !important +} +a.text-secondary:hover,a.text-secondary:focus { + color: #e4e7ea !important +} +a.text-info:hover,a.text-info:focus { + color: #48b0f7 !important +} +a.text-success:hover,a.text-success:focus { + color: #15c377 !important +} +a.text-warning:hover,a.text-warning:focus { + color: #faa64b !important +} +a.text-danger:hover,a.text-danger:focus { + color: #f96868 !important +} + +/* 分割线 */ +.divider { + display: -webkit-box; + display: flex; + -webkit-box-align: center; + align-items: center; + -webkit-box-flex: 0; + flex: 0 1; + color: #8b95a5; + font-size: 11px; + letter-spacing: .5px; + margin: 2rem auto; + width: 100%; +} +.divider::before, +.divider::after { + content: ''; + -webkit-box-flex: 1; + flex-grow: 1; + border-top: 1px solid #ebebeb; +} +.divider::before { + margin-right: 16px; +} +.divider::after { + margin-left: 16px; +} + +/* 其他 */ +.media img { + max-width: inherit; +} +hr { + border-top-color: rgba(77,82,89,0.05); + margin: 2rem auto; +} +dd, dt { + line-height: 1.75; +} +.lead { + font-size: 16px; + line-height: 1.75; +} +.irs { + font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; +} + +/** ---------------------------------- + * 辅助类 + -------------------------------------- */ +/* margin */ +.m-0 { + margin: 0px!important; +} +.m-t-0 { + margin-top: 0px!important; +} +.m-b-0 { + margin-bottom: 0px!important; +} +.m-5 { + margin: 5px!important; +} +.m-t-5 { + margin-top: 5px!important; +} +.m-r-5 { + margin-right: 5px!important; +} +.m-b-5 { + margin-bottom: 5px!important; +} +.m-l-5 { + margin-left: 5px!important; +} +.m-10 { + margin: 10px!important; +} +.m-tb-10 { + margin: 10px 0px!important; +} +.m-lr-10 { + margin: 0px 10px!important; +} +.m-t-10 { + margin-top: 10px!important; +} +.m-r-10 { + margin-right: 10px!important; +} +.m-b-10 { + margin-bottom: 10px!important; +} +.m-l-10 { + margin-left: 10px!important; +} +.m-15 { + margin: 15px!important; +} +.m-tb-15 { + margin: 15px 0px!important; +} +.m-lr-15 { + margin: 0px 15px!important; +} +.m-t-15 { + margin-top: 15px!important; +} +.m-r-15 { + margin-right: 15px!important; +} +.m-b-15 { + margin-bottom: 15px!important; +} +.m-l-15 { + margin-left: 15px!important; +} + +/* padding */ +.p-0 { + padding: 0px!important; +} +.p-t-0 { + padding-top: 0px!important; +} +.p-b-0 { + padding-bottom: 0px!important; +} +.p-10 { + padding: 10px!important; +} +.p-tb-10 { + padding: 10px 0px!important; +} +.p-lr-10 { + padding: 0px 10px!important; +} +.p-t-10 { + padding-top: 10px!important; +} +.p-r-10 { + padding-right: 10px!important; +} +.p-b-10 { + padding-bottom: 10px!important; +} +.p-l-10 { + padding-left: 10px!important; +} +.p-15 { + padding: 15px!important; +} +.p-tb-15 { + padding: 15px 0px!important; +} +.p-lr-15 { + padding: 0px 15px!important; +} +.p-t-15 { + padding-top: 15px!important; +} +.p-r-15 { + padding-right: 15px!important; +} +.p-b-15 { + padding-bottom: 15px!important; +} +.p-l-15 { + padding-left: 15px!important; +} +.p-l-20 { + padding-left: 20px!important; +} +.p-l-40 { + padding-left: 40px!important; +} + +/* 字体大小 */ +.fa-1-5x { + font-size: 1.5em; +} +.fa-2x { + font-size: 2em; +} +.fa-3x { + font-size: 3em; +} +.fa-4x { + font-size: 4em; +} +.fa-5x { + font-size: 5em; +} +.fa-6x { + font-size: 6em; +} +.fa-7x { + font-size: 7em; +} +.fa-8x { + font-size: 8em; +} +.fa-9x { + font-size: 9em; +} +.fa-10x { + font-size: 10em; +} + +/* 宽度 */ +.w-5 { + width: 5%; +} +.w-10 { + width: 10%; +} +.w-15 { + width: 15%; +} +.w-20 { + width: 20%; +} +.w-25 { + width: 25%; +} +.w-30 { + width: 30%; +} +.w-35 { + width: 35%; +} +.w-40 { + width: 40%; +} +.w-45 { + width: 45%; +} +.w-50 { + width: 50%; +} +.w-55 { + width: 55%; +} +.w-60 { + width: 60%; +} +.w-65 { + width: 65%; +} +.w-70 { + width: 70%; +} +.w-75 { + width: 75%; +} +.w-80 { + width: 80%; +} +.w-85 { + width: 85%; +} +.w-90 { + width: 90%; +} +.w-95 { + width: 95%; +} +.w-100 { + width: 100%; +} + +/* 边框 */ +.no-border-tb { + border-top: 0px; + border-bottom: 0px +} +.no-border-lr { + border-left: 0px; + border-right: 0px; +} + +/* 圆点 */ +.badge-dot { + min-width: inherit; + padding: 0px; + width: 8px; + height: 8px; + -webkit-border-radius: 100%; + border-radius: 100%; +} +.badge-dot:empty { + display: inline-block; +} +.badge-dot-sm { + width: 6px; + height: 6px; +} +.badge-dot-lg { + width: 10px; + height: 10px; +} +.badge-dot-xl { + width: 12px; + height: 12px; +} + +/* 其他辅助类 */ +.d-none { + display: none !important; +} +.d-inline { + display: inline !important; +} +.d-inline-block { + display: inline-block !important; +} +.d-block { + display: block !important; +} +.d-table { + display: table !important; +} +.d-table-row { + display: table-row !important; +} +.d-table-cell { + display: table-cell !important; +} +.position-static { + position: static !important; +} +.position-relative { + position: relative !important; +} +.position-absolute { + position: absolute !important; +} +.position-fixed { + position: fixed !important; +} + +/* 图库 */ +.masonry-grid { + -webkit-column-count: 3; + -moz-column-count: 3; + column-count: 3; + -webkit-column-gap: 30px; + -moz-column-gap: 30px; + column-gap: 30px; +} +.masonry-item { + display: block; + -webkit-column-break-inside: avoid; + break-inside: avoid; + padding-bottom: 30px; +} +.masonry-grid { + -webkit-column-gap: 16px; + -moz-column-gap: 16px; + column-gap: 16px; +} +.masonry-grid .masonry-item { + padding-bottom: 16px; +} + +/** ---------------------------------- + * 滚动条样式 + -------------------------------------- */ +.ps { + overflow: hidden !important; + overflow-anchor: none; + -ms-overflow-style: none; + touch-action: auto; + -ms-touch-action: auto; +} +.ps__rail-x { + display: none; + opacity: 0; + transition: background-color .2s linear, opacity .2s linear; + -webkit-transition: background-color .2s linear, opacity .2s linear; + height: 6px; + bottom: 2px; + position: absolute; +} + +.ps__rail-y { + display: none; + opacity: 0; + transition: background-color .2s linear, opacity .2s linear; + -webkit-transition: background-color .2s linear, opacity .2s linear; + width: 6px; + right: 2px; + position: absolute; +} +.ps--active-x > .ps__rail-x, +.ps--active-y > .ps__rail-y { + display: block; + background-color: transparent; +} +.ps:hover > .ps__rail-x, +.ps:hover > .ps__rail-y, +.ps--focus > .ps__rail-x, +.ps--focus > .ps__rail-y, +.ps--scrolling-x > .ps__rail-x, +.ps--scrolling-y > .ps__rail-y { + opacity: 0.6; +} +.ps .ps__rail-x:hover, +.ps .ps__rail-y:hover, +.ps .ps__rail-x:focus, +.ps .ps__rail-y:focus, +.ps .ps__rail-x.ps--clicking, +.ps .ps__rail-y.ps--clicking { + background-color: #eee; + opacity: 0.9; +} +.ps__thumb-x { + background-color: #aaa; + border-radius: 6px; + transition: background-color .2s linear, height .2s ease-in-out; + -webkit-transition: background-color .2s linear, height .2s ease-in-out; + height: 3px; + bottom: 0px; + position: absolute; +} +.ps__thumb-y { + background-color: #aaa; + border-radius: 6px; + transition: background-color .2s linear, width .2s ease-in-out; + -webkit-transition: background-color .2s linear, width .2s ease-in-out; + width: 3px; + right: 0px; + position: absolute; +} +.ps__rail-x:hover > .ps__thumb-x, +.ps__rail-x:focus > .ps__thumb-x, +.ps__rail-x.ps--clicking .ps__thumb-x { + background-color: #999; + height: 6px; +} +.ps__rail-y:hover > .ps__thumb-y, +.ps__rail-y:focus > .ps__thumb-y, +.ps__rail-y.ps--clicking .ps__thumb-y { + background-color: #999; + width: 6px; +} +@supports (-ms-overflow-style: none) { + .ps { + overflow: auto !important; + } +} +@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { + .ps { + overflow: auto !important; + } +} + +/** ---------------------------------- + * 左侧导航 + -------------------------------------- */ +.lyear-layout-sidebar { + position: fixed; + top: 0; + bottom: 0; + z-index: 5; + display: block; + width: 240px; + font-weight: 500; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-transition: 0.3s transform; + transition: 0.3s transform; + transform: translateX(0); + -webkit-box-shadow: 0px 0px 5px rgba(0,0,0,0.08); + -moz-box-shadow: 0px 0px 5px rgba(0,0,0,0.08); + box-shadow: 0px 0px 5px rgba(0,0,0,0.08); +} +.lyear-layout-sidebar-close .lyear-layout-sidebar { + transform: translateX(-100%); + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.lyear-layout-sidebar-close .lyear-layout-header, +.lyear-layout-sidebar-close .lyear-layout-content { + padding-left: 0px; +} +.lyear-layout-sidebar-scroll { + height: -moz-calc(100% - 68px); + height: -webkit-calc(100% - 68px); + height: calc(100% - 68px); + position: relative; + background-color: #fff; +} + +/* 侧边栏开关 */ +.lyear-aside-toggler { + margin-right: .25rem; + padding: .25rem .95rem .25rem .25rem; + line-height: 1.5; + cursor: pointer; +} +.lyear-aside-toggler .lyear-toggler-bar { + display: block; + height: 2px; + width: 20px; + background-color: #4d5259; + margin: 4px 0px; + -webkit-transition: 0.3s; + transition: 0.3s; +} +.lyear-aside-toggler .lyear-toggler-bar:nth-child(2) { + width: 15px; +} +.lyear-aside-toggler:hover .lyear-toggler-bar:nth-child(2) { + width: 20px; +} +.lyear-layout-sidebar-close .lyear-aside-toggler .lyear-toggler-bar { + width: 20px; +} + +/* logo */ +.sidebar-header { + position: relative; + overflow: hidden; + z-index: 999; + background-color: #fff; + width: 100%; + -webkit-box-shadow: 0 1px 1px -1px rgba(77,82,89,0.15); + box-shadow: 0 1px 1px -1px rgba(77,82,89,0.15); +} +.sidebar-header:before, .sidebar-header:after { + content: " "; + display: table; +} +.sidebar-header a { + display: block; + height: auto; + width: 100%; + text-align: center; +} +.sidebar-header a img { + max-width: 240px; + margin: 16px 0px; +} +.sidebar-main { + -webkit-transform: translateZ(0); + transform: translateZ(0); +} +.nav-drawer li a { + padding-right: 24px; + padding-left: 52.99999px; + color: inherit; + font-weight: 500; +} +.nav-drawer > li > a { + border-right: 3px solid transparent; + padding-top: 14px; + padding-bottom: 13px; +} +.nav-drawer > .active > a { + background-color: rgba(0,0,0,.0125); + border-color: #33cabb; +} +.nav-drawer > li.active > a { + background-color: rgba(0,0,0,.0125)!important; +} +.nav-drawer > .active > a:hover, +.nav-drawer > .active > a:focus, +.nav-drawer > .active > a:active { + background-color: rgba(0,0,0,.0125); + border-color: #33cabb; +} +.nav-drawer .nav-subnav > li.active > a, +.nav-drawer .nav-subnav > li > a:hover { + color: #33cabb !important; + background-color: transparent; +} +.nav-drawer > li > a > i { + position: absolute; + left: 21px; + top: 11px; + font-size: 1.25em; +} +.nav-drawer ul li ul { + padding-left: 15px; +} +.nav-item-has-subnav > a:after { + position: absolute; + right: 24px; + font-family: 'Material Design Icons'; + font-size: 10px; + line-height: 1.75; + content: '\f142'; + -webkit-transition: -webkit-transform 0.3s linear; + transition: -webkit-transform 0.3s linear; + transition: transform 0.3s linear; + transition: transform 0.3s linear, -webkit-transform 0.3s linear; +} +.nav-item-has-subnav.open > a:after { + -webkit-transform: rotate(90deg); + transform: rotate(90deg); +} +.nav-item-has-subnav.open > .nav-subnav { + display: block; +} +.nav-subnav { + display: none; + margin-top: 8px; + margin-bottom: 8px; +} + +/* 左侧版权信息 */ +.sidebar-footer { + bottom: 0; + width: 100%; + height: 96px; + border-top: 1px solid rgba(77,82,89,0.05); + margin-top: 24px; + padding-top: 24px; + padding-right: 24px; + padding-bottom: 24px; + padding-left: 24px; + font-size: 13px; + line-height: 24px; +} + +/** ---------------------------------- + * 头部信息 + -------------------------------------- */ +.lyear-layout-header { + position: fixed; + top: 0; + right: 0; + left: 0; + z-index: 4; + padding-left: 240px; + background-color: #fff; + -webkit-transition: padding 0.3s; + transition: padding 0.3s; + -webkit-box-shadow: 4px 0 5px rgba(0, 0, 0, 0.035); + -moz-box-shadow: 4px 0 5px rgba(0, 0, 0, 0.035); + box-shadow: 4px 0 5px rgba(0, 0, 0, 0.035); +} +.lyear-layout-header .navbar { + position: relative; + min-height: 64px; + margin-bottom: 0; + border: 0px; + -webkit-border-radius: 0px; + -moz-border-radius: 0px; + border-radius: 0px; +} +.lyear-layout-header .navbar-default { + background-color: transparent; +} +.topbar { + display: -webkit-box; + display: flex; + -webkit-box-pack: justify; + justify-content: space-between; + -webkit-box-align: center; + align-items: center; + min-height: 64px; + padding: 0 15px; +} +.topbar .topbar-left { + display: -webkit-box; + display: flex; + -webkit-box-align: center; + align-items: center; +} +.topbar .topbar-right { + display: -webkit-box; + display: flex; + -webkit-box-align: center; + align-items: center; + -webkit-box-orient: horizontal; + -webkit-box-direction: reverse; + flex-direction: row-reverse; + list-style: none; + margin: 0px; + padding: 0px; +} +.topbar-right > li > a { + position: relative; + display: block; + padding: 10px 0px 10px 15px; +} +.navbar-page-title { + display: inline-block; + margin-right: 20px; + padding-top: 20px; + padding-bottom: 20px; + font-size: 16px; +} + +/* 头像相关 */ +.img-avatar { + display: inline-block !important; + width: 64px; + height: 64px; + line-height: 64px; + text-align: center; + vertical-align: middle; + -webkit-border-radius: 50%; + border-radius: 50%; +} +.img-avatar-48 { + width: 48px; + height: 48px; + line-height: 48px; +} +.edit-avatar { + display: -ms-flexbox; + display: flex; + -ms-flex-align: start; + align-items: flex-start; +} +.avatar-divider { + display: inline-block; + border-left: 1px solid rgba(77,82,89,0.07); + height: 50px; + align-self: center; + margin: 0px 20px; +} +.edit-avatar-content { + display: inline-block; +} + + +/** ---------------------------------- + * 主要内容 + -------------------------------------- */ +.lyear-layout-content { + height: 100%; + width: 100%; + padding-top: 68px; + padding-left: 240px; + -webkit-transition: padding 0.3s; + transition: padding 0.3s; +} +.lyear-layout-content .container-fluid { + padding-top: 15px; + padding-bottom: 15px; +} + +/* card */ +.card { + margin-bottom: 24px; + background-color: #fff; + -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.035); + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.035); +} +.card-header { + width: 100%; + margin: 0; + padding: 15px 24px; + border-bottom: 1px solid rgba(77,82,89,0.05); +} +.card-header > * { + margin: 0; + display: table-cell; + vertical-align: middle; +} +.card-header:after, +.card-footer:after { + display: table; + content: " "; + clear: both; +} +.card-body { + padding: 24px 24px; +} +.card-header .h4, +.card-header h4 { + font-size: 16px; + float: left; +} +.card-header + .card-body { + padding-top: 15px; +} +.card-header[class*='bg'] .card-actions > li > a:not(.label), +.card-header[class*='bg'] .card-actions > li > button, +.card-header[class*='bg'] h1, +.card-header[class*='bg'] h2, +.card-header[class*='bg'] h3, +.card-header[class*='bg'] h4, +.card-header[class*='bg'] h5, +.card-header[class*='bg'] h6, +.card-header[class*='bg'] .h1, +.card-header[class*='bg'] .h2, +.card-header[class*='bg'] .h3, +.card-header[class*='bg'] .h4, +.card-header[class*='bg'] .h5, +.card-header[class*='bg'] .h6 { + color: #ffffff; +} +.card-toolbar { + padding: 24px 24px 0px 24px; + position: relative; +} +.card-toolbar .search-bar { + max-width: 280px; +} +.card-toolbar .dropdown-menu { + min-width: 100%; +} +/* card-actions */ +.card-actions { + float: right; + margin-bottom: 0; + margin-left: auto; + padding: 0; +} +.card-actions > li { + display: inline-block; + padding: 0; +} +.card-actions > li > a:not(.label), +.card-actions > li > button { + color: #86939e; + display: inline-block; + padding: 0; + line-height: 1; + opacity: .7; + vertical-align: middle; + -webkit-transition: opacity 0.15s ease-out; + transition: opacity 0.15s ease-out; +} +.card-actions > li > a:not(.label):hover, +.card-actions > li > button:hover { + text-decoration: none; + opacity: 1; +} +.card-actions > li > a:not(.label):active, +.card-actions > li > button:active { + opacity: .6; +} +.card-actions > li > span { + display: block; +} +.card-actions > li > .label { + line-height: 1.25; +} +.card-actions > li > a:focus { + text-decoration: none; + opacity: 1; +} +.card-actions > li > button { + background: none; + border: none; +} +.card-actions > li.active > a, +.card-actions > li.open > button { + text-decoration: none; + opacity: 1; +} +.card-actions > li + li { + margin-left: 10px; +} +.card .tab-content { + padding: 10px 24px; +} +.card-footer { + background-color: #fcfdfe; + border-top: 1px solid rgba(77,82,89,0.05); + padding: 15px 24px; +} +/* page-tabs */ +.page-tabs.nav-tabs { + padding: 0px 10px; +} +.page-tabs.nav-tabs > li > a { + padding: 15px; +} + +/* 加载动画 */ +#lyear-loading { + position: fixed; + width: 100%; + height: 100%; + z-index: 9990; + background: rgba(0, 0, 0, 0.0325) +} +#lyear-loading .spinner-border { + z-index: 999999; + position: fixed; + left: 50%; + top: 50% +} +@-webkit-keyframes spinner-border { + to { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes spinner-border { + to { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} +.spinner-border { + display: inline-block; + width: 3rem; + height: 3rem; + vertical-align: text-bottom; + border: 0.125em solid currentColor; + border-right-color: transparent; + border-radius: 50%; + -webkit-animation: spinner-border .75s linear infinite; + animation: spinner-border .75s linear infinite; +} + +/* 步骤条 */ +.nav-step { + display: -webkit-box; + display: flex; + -webkit-box-pack: justify; + justify-content: space-between; + -webkit-box-align: baseline; + align-items: baseline; + padding: 0px; + margin-bottom: 1rem; +} +.step-dots .nav-step-item { + position: relative; + display: -webkit-box; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + flex-direction: column; + -webkit-box-flex: 1; + -webkit-box-align: center; + align-items: center; + flex: 1 1; + padding: 0 12px +} +.step-dots .nav-step-item:first-child a::before { + display: none +} +.step-dots .nav-step-item.complete a, +.step-dots .nav-step-item.complete a::before, +.step-dots .nav-step-item.active a, +.step-dots .nav-step-item.active a::before { + background-color: #dcfcfa +} +.step-dots .nav-step-item.complete a::after, +.step-dots .nav-step-item.active a::after { + background-color: #33cabb; + width: 29px; + height: 29px; + -webkit-transform: translateX(0); + transform: translateX(0); + color: #fff +} +.step-dots .nav-step-item.complete a::after { + width: 29px; + height: 29px; + -webkit-transform: translateX(0); + transform: translateX(0); + color: #fff +} +.step-dots .nav-step-item.active a::after { + width: 13px; + height: 13px; + margin-top: 8px; + -webkit-transform: translateX(8px); + transform: translateX(8px); + color: transparent +} +.step-dots a { + display: -webkit-inline-box; + display: inline-flex; + padding: 0; + margin: 10px 0; + width: 29px; + height: 29px; + max-height: 29px; + border-radius: 50%; + background-color: #f7fafc; + -webkit-transition: .5s; + transition: .5s; + z-index: 1 +} +.step-dots a::before { + content: ''; + position: absolute; + left: calc(-50% + 14.5px); + right: calc(50% + 14.5px); + height: 10px; + margin-top: 9.5px; + background-color: #f7fafc; + cursor: default; + -webkit-transition: .5s; + transition: .5s; +} +.step-dots a::after { + content: "\f12c"; + font-family: "Material Design Icons"; + width: 0; + height: 0; + text-align: center; + font-size: 15px; + position: absolute; + border-radius: 50%; + background-color: transparent; + color: transparent; + -webkit-transform: translate(14.5px, 14.5px); + transform: translate(14.5px, 14.5px); + -webkit-transition: .5s; + transition: .5s; + z-index: 1; + display: -webkit-inline-box; + display: inline-flex; + -webkit-box-align: center; + align-items: center; + -webkit-box-pack: center; + justify-content: center +} +.nav-step-pane.active { + display: block!important; +} +.nav-step-button { + display: -webkit-box; + display: flex; + -webkit-box-pack: justify; + justify-content: space-between; +} +.nav-step-button button.disabled { + opacity: 0; +} + +.nav-step.step-anchor { + justify-content: flex-start; + border: 0; + background: #fcfdfe; + border-radius: 0; + list-style: none; + overflow: hidden; +} +.step-anchor > li > a, +.step-anchor > li > a:hover { + color: #bbb; + text-decoration: none; + padding: 10px 0 10px 45px; + position: relative; + display: block; + border: 0!important; + border-radius: 0; + outline-style: none; + background: #f7fafc; +} +.step-anchor > li > a:before, +.step-anchor > li > a:after { + -webkit-transition: .2s linear; + transition: .2s linear; +} +.step-anchor > li > a:after { + content: " "; + display: block; + width: 0; + height: 0; + border-top: 50px solid transparent; + border-bottom: 50px solid transparent; + border-left: 30px solid #f7fafc; + position: absolute; + top: 50%; + margin-top: -50px; + left: 100%; + z-index: 2 +} +.step-anchor > li > a:before { + content: " "; + display: block; + width: 0; + height: 0; + border-top: 50px solid transparent; + border-bottom: 50px solid transparent; + border-left: 30px solid rgba(77,82,89,0.075); + position: absolute; + top: 50%; + margin-top: -50px; + margin-left: 1px; + left: 100%; + z-index: 1 +} +.step-anchor > li:first-child > a { + padding-left: 15px; +} +.step-anchor > li.active h6, +.step-anchor > li.complete h6 { + color: #fff!important; +} +.step-anchor > li.active > a, +.step-anchor > li.complete > a { + border-color: #33cabb!important; + color: rgba(255, 255, 255, .8)!important; + background: #33cabb!important; +} +.step-anchor > li.active > a:after, +.step-anchor > li.complete > a:after { + border-left: 30px solid #33cabb!important; +} + +/* 多图上传 */ +.lyear-uploads-pic { + display: -webkit-flex; + display: flex; + -webkit-align-items: stretch; + align-items: stretch; + flex-direction: row; + flex-wrap: wrap; + margin-bottom: -10px; +} +.lyear-uploads-pic li { + margin-bottom: 10px; +} +.lyear-uploads-pic figure { + position: relative; + background: #4d5259; + overflow: hidden; + text-align: center; + cursor: pointer; +} +.lyear-uploads-pic figure img { + position: relative; + display: block; + min-height: 100%; + max-width: 100%; + width: 100%; + opacity: 1; + backface-visibility: hidden; + -webkit-backface-visibility: hidden; + -webkit-transition: opacity 0.5s; + transition: opacity 0.5s; +} +.lyear-uploads-pic figure:hover img { + opacity: 0.5; +} +.lyear-uploads-pic figure figcaption, +.lyear-uploads-pic figure figcaption > a:not(.btn) { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.lyear-uploads-pic figure figcaption { + display: -webkit-box; + display: flex; + -webkit-box-align: center; + align-items: center; + -webkit-box-pack: center; + justify-content: center; + text-transform: none; + padding: 2em; + color: #fff; + -webkit-transform: scale(0); + transform: scale(0); + -webkit-transition: .35s; + transition: .35s; +} +.lyear-uploads-pic figure figcaption > a { + position: static; + z-index: auto; + text-indent: 0; + white-space: nowrap; + opacity: 1; + margin-left: 2px; + margin-right: 2px +} +.lyear-uploads-pic figure figcaption > *:first-child { + margin-left: 0; +} +.lyear-uploads-pic figure:hover figcaption { + -webkit-transform: scale(1); + transform: scale(1) +} +.lyear-uploads-pic .pic-add { + display: -webkit-flex; + justify-content: center; + align-items: center; + height: 100%; + border: 1px dashed #ebebeb; + font-family: "Material Design Icons"; + font-size: 2.875rem; + color: #8b95a5; + -webkit-transition: .35s; + transition: .35s; +} +.lyear-uploads-pic .pic-add:before { + content: "\f415"; +} +.lyear-uploads-pic .pic-add:hover { + border-color: #33cabb; + color: #33cabb; +} + +/** ---------------------------------- + * 响应式处理 + -------------------------------------- */ +@media (max-width: 1024px) { + .lyear-layout-sidebar { + transform: translateX(-100%); + } + .lyear-layout-header, + .lyear-layout-content { + padding-left: 0; + } + .lyear-layout-sidebar { + -webkit-box-shadow: none; + -moz-webkit-box-shadow: none; + box-shadow: none; + } + .lyear-layout-sidebar.lyear-aside-open { + transform: translateX(0); + } + /* 遮罩层 */ + .lyear-mask-modal { + background-color: rgba(0, 0, 0, 0.5); + height: 100%; + left: 0; + opacity: 1; + top: 0; + visibility: visible; + width: 100%; + z-index: 5; + position: fixed; + -webkit-transition: visibility 0 linear 0.4s, opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1); + transition: visibility 0 linear 0.4s, opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1); + -webkit-transform: translateZ(0); + transform: translateZ(0); + } +} +@media screen and (max-width: 767px) { + .table-responsive { + border-color: #eceeef; + } +} +@media screen and (max-width: 700px) { + .card-toolbar .search-bar { + max-width: 100%; + margin-bottom: 10px; + float: none!important; + } + .masonry-grid { + -webkit-column-count: 2; + -moz-column-count: 2; + column-count: 2; + } +} +@media screen and (max-width: 430px) { + .navbar-page-title { + display: none; + } + .dropdown-skin .dropdown-menu { + left: -80px!important; + } + .nav-step .nav-step-item p { + display: none; + } +} + +@media (min-width: 1024px) { + .masonry-grid { + -webkit-column-count: 4; + -moz-column-count: 4; + column-count: 4; + } +} + +/** ---------------------------------- + * 主题设置 + -------------------------------------- */ +.icon-palette { + display: block; + height: 68px; + line-height: 68px; + font-size: 1.5em; + cursor: pointer; + padding: 0 12px; + text-align: center; +} +.drop-title { + color: #4d5259; +} +.drop-title p { + padding: 5px 15px 0px 15px; +} +.drop-skin-li { + padding: 0px 12px; +} +.drop-skin-li input[type=radio] { + display: none; +} +.drop-skin-li input[type=radio]+label { + display: inline-block; + width: 20px; + height: 20px; + cursor: pointer; + margin: 3px; + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + border-radius: 50%; + -webkit-transition: all .1s ease; + transition: all .1s ease; +} +.drop-skin-li input[type=radio]:checked+label { + position: relative; +} +.drop-skin-li input[type=radio]:checked+label::after { + content: "\f12c"; + font-family: "Material Design Icons"; + font-size: 1rem; + display: block; + color: #fff; + width: 100%; + text-align: center; + line-height: 20px; + position: absolute; + top: 0px; + -webkit-transition: .2s; + transition: .2s; +} +.drop-skin-li .inverse input[type=radio]:checked+label::after { + color: #4d5259; +} +.dropdown-skin .dropdown-menu { + border: none; + width: 262px; +} + +#header_bg_1+label, #logo_bg_1+label, #sidebar_bg_1+label, #site_theme_1+label { + background-color: #fff; + border: 1px solid #f0f0f0; +} +#header_bg_2+label, #logo_bg_2+label, #sidebar_bg_2+label { + background-color: #15c377; + border: 1px solid #15c377; +} +#header_bg_3+label, #logo_bg_3+label, #sidebar_bg_3+label { + background-color: #48b0f7; + border: 1px solid #48b0f7; +} +#header_bg_4+label, #logo_bg_4+label, #sidebar_bg_4+label { + background-color: #faa64b; + border: 1px solid #faa64b; +} +#header_bg_5+label, #logo_bg_5+label, #sidebar_bg_5+label { + background-color: #f96868; + border: 1px solid #f96868; +} +#header_bg_6+label, #logo_bg_6+label, #sidebar_bg_6+label { + background-color: #926dde; + border: 1px solid #926dde; +} +#header_bg_7+label, #logo_bg_7+label, #sidebar_bg_7+label { + background-color: #33cabb; + border: 1px solid #33cabb; +} +#header_bg_8+label, #logo_bg_8+label, #sidebar_bg_8+label, #site_theme_2+label { + background-color: #222437; + border: 1px solid #222437; +} +#site_theme_3+label { + background: -webkit-linear-gradient(135deg, #65FDF0 10%, #1D6FA3 100%); + background: -o-linear-gradient(135deg, #65FDF0 10%, #1D6FA3 100%); + background: -moz-linear-gradient(135deg, #65FDF0 10%, #1D6FA3 100%); + background: linear-gradient(135deg, #65FDF0 10%, #1D6FA3 100%); +} + +/* 暗黑 */ +body[data-theme='dark'] { + background-color: #1c1e2f; + color: #8c909a; +} +body[data-theme='dark'] .jconfirm.jconfirm-white .jconfirm-bg, +body[data-theme='dark'] .jconfirm.jconfirm-light .jconfirm-bg { + background-color: #fff; +} +body[data-theme='dark'] a, +[data-theme='dark'] .input-group-addon, +[data-theme='dark'] a.list-group-item, +[data-theme='dark'] button.list-group-item, +[data-theme='dark'] h1, +[data-theme='dark'] h2, +[data-theme='dark'] h3, +[data-theme='dark'] h4, +[data-theme='dark'] h5, +[data-theme='dark'] h6, +[data-theme='dark'] .h1, +[data-theme='dark'] .h2, +[data-theme='dark'] .h3, +[data-theme='dark'] .h4, +[data-theme='dark'] .h5, +[data-theme='dark'] .h6 { + color: #8c909a; +} +[data-theme='dark'] code, +[data-theme='dark'] .panel { + background-color: #292B3D; +} +[data-theme='dark'] .lyear-aside-toggler .lyear-toggler-bar { + background-color: #8c909a; +} +[data-theme='dark'] .lyear-layout-header { + -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.35); + -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.35); + box-shadow: 0 0 5px rgba(0, 0, 0, 0.35); +} +[data-theme='dark'] .sidebar-header { + -webkit-box-shadow: 0 1px 1px -1px rgba(0, 0, 0, 0.35); + -moz-box-shadow: 0 1px 1px -1px rgba(0, 0, 0, 0.35); + box-shadow: 0 1px 1px -1px rgba(0, 0, 0, 0.35); +} +[data-theme='dark'] .lyear-layout-sidebar-scroll { + -webkit-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.35); + -moz-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.35); + box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.35) +} +[data-theme='dark'] .sidebar-header, +[data-theme='dark'] .lyear-layout-sidebar-scroll, +[data-theme='dark'] .lyear-layout-header, +[data-theme='dark'] .card, +[data-theme='dark'] .jconfirm .jconfirm-box { + background-color: #222437; +} +[data-theme='dark'] .nav-drawer > .active > a { + background-color: #202234!important; +} +[data-theme='dark'] .nav-drawer .nav-subnav > li.active > a, +[data-theme='dark'] .nav-drawer .nav-subnav > li > a:hover { + color: #bebdc2; +} +[data-theme='dark'] hr, +[data-theme='dark'] .card-header, +[data-theme='dark'] .sidebar-footer, +[data-theme='dark'] .modal-header, +[data-theme='dark'] .modal-footer, +[data-theme='dark'] .card-footer, +[data-theme='dark'] .table>tbody>tr>td, +[data-theme='dark'] .table>tbody>tr>th, +[data-theme='dark'] .table>tfoot>tr>td, +[data-theme='dark'] .table>tfoot>tr>th, +[data-theme='dark'] .table>thead>tr>td, +[data-theme='dark'] .table>thead>tr>th, +[data-theme='dark'] .table-bordered { + border-color: #303243; +} +[data-theme='dark'] .table-hover > tbody > tr:hover, +[data-theme='dark'] .table-striped tbody tr:nth-of-type(odd) { + background-color: #292B3D; +} +[data-theme='dark'] .dropdown-menu, +[data-theme='dark'] .modal-content { + background-color: #222437; + border: none; + -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.35); + -moz-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.35); + box-shadow: 0 0 5px rgba(0, 0, 0, 0.35); +} +[data-theme='dark'] .dropdown-menu > li > a:focus, +[data-theme='dark'] .dropdown-menu > li > a:hover, +[data-theme='dark'] .dropdown-menu>.active>a, +[data-theme='dark'] .dropdown-menu>.active>a:focus, +[data-theme='dark'] .dropdown-menu>.active>a:hover { + background-color: #292B3D; + color: #bebdc2; +} +[data-theme='dark'] .dropdown-menu .divider { + background-color: #303243; +} +[data-theme='dark'] .divider::before, +[data-theme='dark'] .divider::after { + border-color: #303243; +} + +[data-theme='dark'] .popover { + background-color: #222437; + border: none; + -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.35); + box-shadow: 0 0 4px rgba(0, 0, 0, 0.35); +} +[data-theme='dark'] .popover.top>.arrow:after { + border-top-color: #222437; +} +[data-theme='dark'] .popover.right>.arrow:after { + border-right-color: #222437; +} +[data-theme='dark'] .popover.bottom>.arrow:after { + border-bottom-color: #222437; +} +[data-theme='dark'] .popover.left>.arrow:after { + border-left-color: #222437; +} +[data-theme='dark'] .popover.top>.arrow { + border-top-color: #1D1F2F; +} +[data-theme='dark'] .popover.right>.arrow { + border-right-color: #1D1F2F; +} +[data-theme='dark'] .popover.bottom>.arrow { + border-bottom-color: #1D1F2F; +} +[data-theme='dark'] .popover.left>.arrow { + border-left-color: #1D1F2F; +} +[data-theme='dark'] .popover-title { + background-color: #222437; + border-color: #303243; +} + +[data-theme='dark'] .progress, +[data-theme='dark'] .irs--flat .irs-min, +[data-theme='dark'] .irs--flat .irs-max, +[data-theme='dark'] .irs--flat .irs-line { + background-color: #303243; +} + +[data-theme='dark'] .nav-tabs, +[data-theme='dark'] blockquote { + border-color: #303243; +} +[data-theme='dark'] .nav-tabs > li.active > a, +[data-theme='dark'] .nav-tabs > li.active > a:focus, +[data-theme='dark'] .nav-tabs > li.active > a:hover { + color: #bebdc2; +} + +@media (min-width: 768px) { + [data-theme='dark'] .nav-tabs.nav-justified>li>a { + border-bottom-color: #303243; + } +} +[data-theme='dark'] .nav-tabs.nav-justified>.active>a, +[data-theme='dark'] .nav-tabs.nav-justified>.active>a:focus, +[data-theme='dark'] .nav-tabs.nav-justified>.active>a:hover { + border-bottom-color: #33cabb; +} + +[data-theme='dark'] :not(panel-default) .panel-title a { + color: #fff; +} +[data-theme='dark'] .form-control { + border-color: #303243; + background-color: #1D1F2F; +} +[data-theme='dark'] .form-control:focus { + border-color: #33cabb; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(51, 202, 187, .6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(51, 202, 187, .6); +} +[data-theme='dark'] div.tagsinput, +[data-theme='dark'] .input-group-addon, +[data-theme='dark'] .input-group-btn .btn-default, +[data-theme='dark'] .btn-group .btn-default, +[data-theme='dark'] .btn-group-vertical .btn-default, +[data-theme='dark'] .pagination > li > a, +[data-theme='dark'] .pagination > li > span { + border-color: #303243!important; + background-color: #1D1F2F!important; +} +[data-theme='dark'] .pagination > li > a:hover, +[data-theme='dark'] .pagination > li > a:focus +[data-theme='dark'] .pagination > li > span:hover, +[data-theme='dark'] .pagination > li > span:focus { + background-color: #191A28; + color: #8c909a; +} +[data-theme='dark'] .pagination > .active > a, +[data-theme='dark'] .pagination > .active > a:focus, +[data-theme='dark'] .pagination > .active > a:hover, +[data-theme='dark'] .pagination > .active > span, +[data-theme='dark'] .pagination > .active > span:focus, +[data-theme='dark'] .pagination > .active > span:hover { + border-color: #303243; + background-color: #191A28; + color: #fff; +} +[data-theme='dark'] .pager li > a, +[data-theme='dark'] .pager li > span { + background-color: #1D1F2F; + border-color: #303243; +} +[data-theme='dark'] .pager li > a:hover, +[data-theme='dark'] .pager li > a:focus{ + background-color: #191A28; + color: #8c909a +} +[data-theme='dark'] .pager li > a:active, +[data-theme='dark'] .pager li > a.active { + background-color: #191A28; + color: #fff +} +[data-theme='dark'] .pager .disabled > a, +[data-theme='dark'] .pager .disabled > a:focus, +[data-theme='dark'] .pager .disabled > a:hover, +[data-theme='dark'] .pager .disabled > span { + opacity: .6; + background-color: #1D1F2F; +} + +[data-theme='dark'] .well { + background-color: #292B3D; + border-color: #303243; +} + +[data-theme='dark'] .list-group-item { + background-color: transparent; + border-color: #303243; +} +[data-theme='dark'] .list-group-item.active, +[data-theme='dark'] .list-group-item.active:focus, +[data-theme='dark'] .list-group-item.active:hover { + background-color: #33cabb; + border-color: #33cabb; + color: #fff; +} +[data-theme='dark'] a.list-group-item:hover, +[data-theme='dark'] button.list-group-item:hover, +[data-theme='dark'] a.list-group-item:focus, +[data-theme='dark'] button.list-group-item:focus { + background-color: #292B3D; + color: #bebdc2; +} +[data-theme='dark'] button.list-group-item { + -webkit-transition: .2s linear; + transition: .2s linear +} +[data-theme='dark'] .list-group-item.disabled, +[data-theme='dark'] .list-group-item.disabled:focus, +[data-theme='dark'] .list-group-item.disabled:hover { + background-color: #292B3D; + color: #bebdc2; +} +[data-theme='dark'] .list-group-item-success, +[data-theme='translucent'] .list-group-item-success { + color: #155724!important; +} +[data-theme='dark'] .list-group-item-info, +[data-theme='translucent'] .list-group-item-info { + color: #0c5460!important; +} +[data-theme='dark'] .list-group-item-warning, +[data-theme='translucent'] .list-group-item-warning { + color: #856404!important; +} +[data-theme='dark'] .list-group-item-danger, +[data-theme='translucent'] .list-group-item-danger { + color: #721c24!important; +} +[data-theme='dark'] a.list-group-item .list-group-item-heading, +[data-theme='dark'] button.list-group-item .list-group-item-heading { + color: #bebdc2; +} +[data-theme='dark'] .list-group-item.active .list-group-item-heading, +[data-theme='dark'] .list-group-item.active .list-group-item-heading>.small, +[data-theme='dark'] .list-group-item.active .list-group-item-heading>small, +[data-theme='dark'] .list-group-item.active:focus .list-group-item-heading, +[data-theme='dark'] .list-group-item.active:focus .list-group-item-heading>.small, +[data-theme='dark'] .list-group-item.active:focus .list-group-item-heading>small, +[data-theme='dark'] .list-group-item.active:hover .list-group-item-heading, +[data-theme='dark'] .list-group-item.active:hover .list-group-item-heading>.small, +[data-theme='dark'] .list-group-item.active:hover .list-group-item-heading>small { + color: #fff; +} +[data-theme='dark'] .lyear-checkbox span::before, +[data-theme='dark'] .lyear-radio span::before { + border-color: #656B77; +} +[data-theme='dark'] .lyear-checkbox.checkbox-grey span::before, +[data-theme='dark'] .lyear-checkbox.radio-grey span::before, +[data-theme='dark'] .lyear-radio.checkbox-grey span::before, +[data-theme='dark'] .lyear-radio.radio-grey span::before { + background-color: #656B77; +} +[data-theme='dark'] .lyear-switch span { + background-color: #1D1F2F; + border-color: #303243; +} +[data-theme='dark'] .lyear-switch.switch-outline span { + background-color: transparent; +} +[data-theme='dark'] .input-group-btn .btn-default:focus, +[data-theme='dark'] .input-group-btn .btn-default.focus, +[data-theme='dark'] .input-group-btn .btn-default:active, +[data-theme='dark'] .input-group-btn .btn-default.active, +[data-theme='dark'] .input-group-btn .show>.btn-default.dropdown-toggle, +[data-theme='dark'] .input-group-btn .open>.btn-default.dropdown-toggle { + border-color: #303243!important; + background-color: #292B3D!important; + color: #BEBDC2; +} +[data-theme='dark'] .input-group-btn .btn-default:hover { + color: #BEBDC2; +} +[data-theme='dark'] .has-success .input-group-addon { + color: #15c377!important; + border-color: #15c377!important; +} +[data-theme='dark'] .has-info .input-group-addon { + color: #48b0f7!important; + border-color: #48b0f7!important; +} +[data-theme='dark'] .has-warning .input-group-addon { + color: #faa64b!important; + border-color: #faa64b!important; +} +[data-theme='dark'] .has-error .input-group-addon { + color: #f96868!important; + border-color: #f96868!important; +} +[data-theme='dark'] .login-center { + background-color: #222437; + -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.35); + -moz-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.35); + box-shadow: 0 0 5px rgba(0, 0, 0, 0.35); +} +[data-theme='dark'] .datepicker-dropdown.datepicker-orient-top:after { + border-top-color: #222437; +} +[data-theme='dark'] .datepicker-dropdown:after { + border-bottom-color: #222437; +} +[data-theme='dark'] .bootstrap-datetimepicker-widget.dropdown-menu.bottom:before { + border-bottom-color: #1D1E2F; +} +[data-theme='dark'] .bootstrap-datetimepicker-widget.dropdown-menu.bottom:after { + border-bottom-color: #222437; +} +[data-theme='dark'] .bootstrap-datetimepicker-widget.dropdown-menu.top:before { + border-top-color: #1D1E2F; +} +[data-theme='dark'] .bootstrap-datetimepicker-widget.dropdown-menu.top:after { + border-top-color: #222437; +} +[data-theme='dark'] .bootstrap-datetimepicker-widget .btn { + background-color: transparent; +} +[data-theme='dark'] .close { + text-shadow: none; + -webkit-transition: .2s linear; + transition: .2s linear +} +[data-theme='dark'] .alert-success { + background-color: #16d17f; + border-color: #16d17f; + color: #fff; +} +[data-theme='dark'] .alert-info { + background-color: #48b0f7; + border-color: #48b0f7; + color: #fff; +} +[data-theme='dark'] .alert-warning { + background-color: #faa64b; + border-color: #faa64b; + color: #fff; +} +[data-theme='dark'] .alert-danger { + background-color: #f96868; + border-color: #f96868; + color: #fff; +} +[data-theme='dark'] .alert-link { + color: #fff; +} +[data-theme='dark'] .alert h1, +[data-theme='dark'] .alert h2, +[data-theme='dark'] .alert h3, +[data-theme='dark'] .alert h4, +[data-theme='dark'] .alert h5, +[data-theme='dark'] .alert h6, +[data-theme='dark'] .alert .h1, +[data-theme='dark'] .alert .h2, +[data-theme='dark'] .alert .h3, +[data-theme='dark'] .alert .h4, +[data-theme='dark'] .alert .h5, +[data-theme='dark'] .alert .h6 { + color: #fff; +} + +/* 半透明 */ +body[data-theme='translucent'] { + color: rgba(255, 255, 255, .85); + background: -webkit-linear-gradient(135deg, #65FDF0 10%, #1D6FA3 100%); + background: -o-linear-gradient(135deg, #65FDF0 10%, #1D6FA3 100%); + background: -moz-linear-gradient(135deg, #65FDF0 10%, #1D6FA3 100%); + background: linear-gradient(135deg, #65FDF0 10%, #1D6FA3 100%); + background-repeat: no-repeat; + background-size: cover; + background-attachment: fixed; +} +body[data-theme='translucent'] .jconfirm { + color: #4d5259; +} +[data-theme='translucent'] ::-webkit-input-placeholder { + color: rgba(255, 255, 255, .85); +} +[data-theme='translucent'] :-moz-placeholder { + color: rgba(255, 255, 255, .85); +} +[data-theme='translucent'] ::-moz-placeholder { + color: rgba(255, 255, 255, .85); +} +[data-theme='translucent'] :-ms-input-placeholder { + color: rgba(255, 255, 255, .85); +} +[data-theme='translucent'] .sidebar-footer { + border-color: rgba(255, 255, 255, .075); +} +[data-theme='translucent'] a, +[data-theme='translucent'] h1, +[data-theme='translucent'] h2, +[data-theme='translucent'] h3, +[data-theme='translucent'] h4, +[data-theme='translucent'] h5, +[data-theme='translucent'] h6, +[data-theme='translucent'] .h1, +[data-theme='translucent'] .h2, +[data-theme='translucent'] .h3, +[data-theme='translucent'] .h4, +[data-theme='translucent'] .h5, +[data-theme='translucent'] .h6, +[data-theme='translucent'] .divider { + color: rgba(255, 255, 255, .85); +} +[data-theme='translucent'] .h1 .small, +[data-theme='translucent'] .h1 small, +[data-theme='translucent'] .h2 .small, +[data-theme='translucent'] .h2 small, +[data-theme='translucent'] .h3 .small, +[data-theme='translucent'] .h3 small, +[data-theme='translucent'] .h4 .small, +[data-theme='translucent'] .h4 small, +[data-theme='translucent'] .h5 .small, +[data-theme='translucent'] .h5 small, +[data-theme='translucent'] .h6 .small, +[data-theme='translucent'] .h6 small, +[data-theme='translucent'] h1 .small, +[data-theme='translucent'] h1 small, +[data-theme='translucent'] h2 .small, +[data-theme='translucent'] h2 small, +[data-theme='translucent'] h3 .small, +[data-theme='translucent'] h3 small, +[data-theme='translucent'] h4 .small, +[data-theme='translucent'] h4 small, +[data-theme='translucent'] h5 .small, +[data-theme='translucent'] h5 small, +[data-theme='translucent'] h6 .small, +[data-theme='translucent'] h6 small { + color: rgba(255, 255, 255, .65); +} +[data-theme='translucent'] a:hover, +[data-theme='translucent'] .nav-drawer .nav-subnav > li.active > a, +[data-theme='translucent'] .nav-drawer .nav-subnav > li > a:hover, +[data-theme='translucent'] .card-header h1, +[data-theme='translucent'] .card-header h2, +[data-theme='translucent'] .card-header h3, +[data-theme='translucent'] .card-header h4, +[data-theme='translucent'] .card-header h5, +[data-theme='translucent'] .card-header h6, +[data-theme='translucent'] .card-header .h1, +[data-theme='translucent'] .card-header .h2, +[data-theme='translucent'] .card-header .h3, +[data-theme='translucent'] .card-header .h4, +[data-theme='translucent'] .card-header .h5, +[data-theme='translucent'] .card-header .h6 { + color: #fff; +} +[data-theme='translucent'] .card, +[data-theme='translucent'] .sidebar-header, +[data-theme='translucent'] .lyear-layout-sidebar-scroll, +[data-theme='translucent'] .lyear-layout-header { + background-color: rgba(0, 0, 0, .075); +} +[data-theme='translucent'] .card-header, +[data-theme='translucent'] .modal-header, +[data-theme='translucent'] .modal-footer, +[data-theme='translucent'] .divider::before, +[data-theme='translucent'] .divider::after, +[data-theme='translucent'] .card-footer { + border-color: rgba(255, 255, 255, .075); +} +[data-theme='translucent'] .lyear-aside-toggler .lyear-toggler-bar { + background-color: rgba(255, 255, 255, .85); +} +[data-theme='translucent'] .table-bordered, +[data-theme='translucent'] .table>tbody>tr>td, +[data-theme='translucent'] .table>tbody>tr>th, +[data-theme='translucent'] .table>tfoot>tr>td, +[data-theme='translucent'] .table>tfoot>tr>th, +[data-theme='translucent'] .table>thead>tr>td, +[data-theme='translucent'] .table>thead>tr>th { + border-color: rgba(255, 255, 255, .075); +} +[data-theme='translucent'] .table-striped tbody tr:nth-of-type(odd) { + background-color: rgba(255, 255, 255, .1); +} +[data-theme='translucent'] .table-hover > tbody > tr:hover, +[data-theme='translucent'] a.list-group-item:focus, +[data-theme='translucent'] a.list-group-item:hover, +[data-theme='translucent'] button.list-group-item:focus, +[data-theme='translucent'] button.list-group-item:hover { + background-color: rgba(255, 255, 255, .075); +} +[data-theme='translucent'] .table>tbody>tr.active>td, +[data-theme='translucent'] .table>tbody>tr.active>th, +[data-theme='translucent'] .table>tbody>tr>td.active, +[data-theme='translucent'] .table>tbody>tr>th.active, +[data-theme='translucent'] .table>tfoot>tr.active>td, +[data-theme='translucent'] .table>tfoot>tr.active>th, +[data-theme='translucent'] .table>tfoot>tr>td.active, +[data-theme='translucent'] .table>tfoot>tr>th.active, +[data-theme='translucent'] .table>thead>tr.active>td, +[data-theme='translucent'] .table>thead>tr.active>th, +[data-theme='translucent'] .table>thead>tr>td.active, +[data-theme='translucent'] .table>thead>tr>th.active { + background-color: rgba(245, 245, 245, .35); +} +[data-theme='translucent'] .table>tbody>tr.success>td, +[data-theme='translucent'] .table>tbody>tr.success>th, +[data-theme='translucent'] .table>tbody>tr>td.success, +[data-theme='translucent'] .table>tbody>tr>th.success, +[data-theme='translucent'] .table>tfoot>tr.success>td, +[data-theme='translucent'] .table>tfoot>tr.success>th, +[data-theme='translucent'] .table>tfoot>tr>td.success, +[data-theme='translucent'] .table>tfoot>tr>th.success, +[data-theme='translucent'] .table>thead>tr.success>td, +[data-theme='translucent'] .table>thead>tr.success>th, +[data-theme='translucent'] .table>thead>tr>td.success, +[data-theme='translucent'] .table>thead>tr>th.success { + background-color: rgba(21, 195, 119, .35); +} +[data-theme='translucent'] .table>tbody>tr.info>td, +[data-theme='translucent'] .table>tbody>tr.info>th, +[data-theme='translucent'] .table>tbody>tr>td.info, +[data-theme='translucent'] .table>tbody>tr>th.info, +[data-theme='translucent'] .table>tfoot>tr.info>td, +[data-theme='translucent'] .table>tfoot>tr.info>th, +[data-theme='translucent'] .table>tfoot>tr>td.info, +[data-theme='translucent'] .table>tfoot>tr>th.info, +[data-theme='translucent'] .table>thead>tr.info>td, +[data-theme='translucent'] .table>thead>tr.info>th, +[data-theme='translucent'] .table>thead>tr>td.info, +[data-theme='translucent'] .table>thead>tr>th.info { + background-color: rgba(72, 176, 247, .35); +} +[data-theme='translucent'] .table>tbody>tr.warning>td, +[data-theme='translucent'] .table>tbody>tr.warning>th, +[data-theme='translucent'] .table>tbody>tr>td.warning, +[data-theme='translucent'] .table>tbody>tr>th.warning, +[data-theme='translucent'] .table>tfoot>tr.warning>td, +[data-theme='translucent'] .table>tfoot>tr.warning>th, +[data-theme='translucent'] .table>tfoot>tr>td.warning, +[data-theme='translucent'] .table>tfoot>tr>th.warning, +[data-theme='translucent'] .table>thead>tr.warning>td, +[data-theme='translucent'] .table>thead>tr.warning>th, +[data-theme='translucent'] .table>thead>tr>td.warning, +[data-theme='translucent'] .table>thead>tr>th.warning { + background-color: rgba(250, 166, 75, .35); +} +[data-theme='translucent'] .table>tbody>tr.danger>td, +[data-theme='translucent'] .table>tbody>tr.danger>th, +[data-theme='translucent'] .table>tbody>tr>td.danger, +[data-theme='translucent'] .table>tbody>tr>th.danger, +[data-theme='translucent'] .table>tfoot>tr.danger>td, +[data-theme='translucent'] .table>tfoot>tr.danger>th, +[data-theme='translucent'] .table>tfoot>tr>td.danger, +[data-theme='translucent'] .table>tfoot>tr>th.danger, +[data-theme='translucent'] .table>thead>tr.danger>td, +[data-theme='translucent'] .table>thead>tr.danger>th, +[data-theme='translucent'] .table>thead>tr>td.danger, +[data-theme='translucent'] .table>thead>tr>th.danger { + background-color: rgba(249, 104, 104, .35); +} +[data-theme='translucent'] .btn-default { + border-color: rgba(255, 255, 255, .075); + background-color: rgba(255, 255, 255, .075); + color: rgba(255, 255, 255, .85); +} +[data-theme='translucent'] .btn-default:hover { + background-color: rgba(255, 255, 255, .125); + border-color: rgba(255, 255, 255, .125); + color: #fff +} +[data-theme='translucent'] .btn-default:focus, +[data-theme='translucent'] .btn-default.focus, +[data-theme='translucent'] .btn-default:active, +[data-theme='translucent'] .btn-default.active, +[data-theme='translucent'] .show>.btn-default.dropdown-toggle, +[data-theme='translucent'] .open>.btn-default.dropdown-toggle, +[data-theme='translucent'] .btn-default:not([disabled]):not(.disabled).active, +[data-theme='translucent'] .btn-default:not([disabled]):not(.disabled):active, +[data-theme='translucent'] .show>.btn-default.dropdown-toggle, +[data-theme='translucent'] .btn-default.disabled, +[data-theme='translucent'] .btn-default:disabled { + background-color: rgba(255, 255, 255, .125)!important; + border-color: rgba(255, 255, 255, .125)!important; + color: #fff +} +[data-theme='translucent'] .dropdown-menu { + border: none; +} +[data-theme='translucent'] blockquote { + border-color: rgba(255, 255, 255, .1); +} +[data-theme='translucent'] blockquote .small, +[data-theme='translucent'] blockquote footer, +[data-theme='translucent'] blockquote small { + color: rgba(255, 255, 255, .85); +} +[data-theme='translucent'] .bg-white { + background-color: rgba(255, 255, 255, .35) !important +} +[data-theme='translucent'] .bg-lightest { + background-color: rgba(253, 252, 254, .35)!important; +} +[data-theme='translucent'] .bg-lighter { + background-color: rgba(249, 250, 251, .35) !important; +} +[data-theme='translucent'] .bg-light { + background-color: rgba(245, 246, 247, .35) !important; +} +[data-theme='translucent'] .progress { + background-color: rgba(245, 246, 247, .075); +} + +[data-theme='translucent'] .nav-tabs { + border-bottom-color: rgba(255, 255, 255, .075); +} +[data-theme='translucent'] .nav-tabs > li > a { + color: rgba(255, 255, 255, .85); +} +[data-theme='translucent'] .nav-tabs > li.active > a, +[data-theme='translucent'] .nav-tabs > li.active > a:focus, +[data-theme='translucent'] .nav-tabs > li.active > a:hover, +[data-theme='translucent'] .nav-tabs.nav-justified > .active > a, +[data-theme='translucent'] .nav-tabs.nav-justified > .active > a:focus, +[data-theme='translucent'] .nav-tabs.nav-justified > .active > a:hover { + color: #fff; + border-bottom-color: rgba(255, 255, 255, .35); +} +[data-theme='translucent'] .nav-tabs.nav > li > a:hover, +[data-theme='translucent'] .nav-tabs.nav > li > a:focus { + border-bottom-color: rgba(255, 255, 255, .35); +} +@media (min-width: 768px) { + [data-theme='translucent'] .nav-tabs.nav-justified>li>a { + border-bottom-color: rgba(255, 255, 255, .075); + } +} +[data-theme='translucent'] .modal-content, +[data-theme='translucent'] .popover { + background-color: #474747; + border: none; + -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, .35); + -moz-box-shadow: 0 0 4px rgba(0, 0, 0, .35); + box-shadow: 0 0 4px rgba(0, 0, 0, .35); +} +[data-theme='translucent'] .popover-title { + background-color: #474747; + border-color: rgba(255, 255, 255, .075); +} +[data-theme='translucent'] .popover.top>.arrow { + border-top-color: #474747; +} +[data-theme='translucent'] .popover.right>.arrow { + border-right-color: #474747; +} +[data-theme='translucent'] .popover.bottom>.arrow { + border-bottom-color: #474747; +} +[data-theme='translucent'] .popover.left>.arrow { + border-left-color: #474747; +} +[data-theme='translucent'] .popover.top>.arrow:after, +[data-theme='translucent'] .popover.right>.arrow:after, +[data-theme='translucent'] .popover.bottom>.arrow:after, +[data-theme='translucent'] .popover.left>.arrow:after { + border-color: transparent; +} + +[data-theme='translucent'] .alert-success, +[data-theme='translucent'] .alert-info, +[data-theme='translucent'] .alert-warning, +[data-theme='translucent'] .alert-danger { + border: none; + color: rgba(255, 255, 255, .85); +} +[data-theme='translucent'] .alert-success a, +[data-theme='translucent'] .alert-info a, +[data-theme='translucent'] .alert-warning a, +[data-theme='translucent'] .alert-danger a { + color: rgba(255, 255, 255, .85); +} +[data-theme='translucent'] .alert-success { + background-color: #15c377; +} +[data-theme='translucent'] .alert-info { + background-color: #48b0f7; +} +[data-theme='translucent'] .alert-warning { + background-color: #faa64b; +} +[data-theme='translucent'] .alert-danger { + background-color: #f96868; +} +[data-theme='translucent'] .pagination > li > a, +[data-theme='translucent'] .pagination > li > span, +[data-theme='translucent'] .pager li > a, +[data-theme='translucent'] .pager li > span { + color: rgba(255, 255, 255, .85); + border-color: rgba(255, 255, 255, .125); + background-color: rgba(255, 255, 255, .075); +} +[data-theme='translucent'] .pagination > li > a:hover, +[data-theme='translucent'] .pagination > li > a:focus +[data-theme='translucent'] .pagination > li > span:hover, +[data-theme='translucent'] .pagination > li > span:focus, +[data-theme='translucent'] .pager li > a:hover, +[data-theme='translucent'] .pager li > a:focus { + color: #fff; + background-color: rgba(255, 255, 255, .125); +} +[data-theme='translucent'] .pagination > .active > a, +[data-theme='translucent'] .pagination > .active > a:focus, +[data-theme='translucent'] .pagination > .active > a:hover, +[data-theme='translucent'] .pagination > .active > span, +[data-theme='translucent'] .pagination > .active > span:focus, +[data-theme='translucent'] .pagination > .active > span:hover, +[data-theme='translucent'] .pager li > a:active, +[data-theme='translucent'] .pager li > a.active { + background-color: rgba(255, 255, 255, .125); +} +[data-theme='translucent'] .well, +[data-theme='translucent'] .panel, +[data-theme='translucent'] code, +[data-theme='translucent'] .list-group-item { + background-color: rgba(0, 0, 0, .035); +} +[data-theme='translucent'] .well, +[data-theme='translucent'] .list-group-item { + border-color: rgba(0, 0, 0, .035); +} +[data-theme='translucent'] .list-group-item.active, +[data-theme='translucent'] .list-group-item.active:focus, +[data-theme='translucent'] .list-group-item.active:hover { + background-color: #33cabb; + border-color: #33cabb; +} +[data-theme='translucent'] .form-control, +[data-theme='translucent'] div.tagsinput { + border-color: rgba(255, 255, 255, .075); + background-color: rgba(0, 0, 0, .035); + color: rgba(255, 255, 255, .85); +} +[data-theme='translucent'] .form-control:focus { + border-color: rgba(255, 255, 255, .35); +} +[data-theme='translucent'] .form-control:not([multiple]) option { + background: #1D6FA3; +} +[data-theme='translucent'] .input-group-btn:first-child>.btn, +[data-theme='translucent'] .input-group-btn:first-child>.btn-group { + margin-right: 0px; +} +[data-theme='translucent'] .input-group-addon { + background-color: rgba(255, 255, 255, .075); + border-color: rgba(255, 255, 255, .075); + color: rgba(255, 255, 255, .85); +} +[data-theme='translucent'] .help-block { + color: rgba(255, 255, 255, .5); +} +[data-theme='translucent'] .lyear-checkbox span::before, +[data-theme='translucent'] .lyear-radio span::before, +[data-theme='translucent'] .lyear-checkbox.checkbox-grey span::before, +[data-theme='translucent'] .lyear-checkbox.radio-grey span::before, +[data-theme='translucent'] .lyear-radio.checkbox-grey span::before, +[data-theme='translucent'] .lyear-radio.radio-grey span::before { + border-color: rgba(0, 0, 0, .125); +} +[data-theme='translucent'] .lyear-checkbox.checkbox-grey span::before, +[data-theme='translucent'] .lyear-checkbox.radio-grey span::before, +[data-theme='translucent'] .lyear-radio.checkbox-grey span::before, +[data-theme='translucent'] .lyear-radio.radio-grey span::before { + background-color: rgba(235, 235, 235, .35) +} +[data-theme='translucent'] .lyear-switch.switch-outline span { + background-color: transparent; + border-color: rgba(0, 0, 0, .35); +} +[data-theme='translucent'] .lyear-switch span { + border-color: rgba(0, 0, 0, .035); + background-color: rgba(0, 0, 0, .35); +} +[data-theme='translucent'] .login-center { + background-color: rgba(0, 0, 0, .125); +} +[data-theme='translucent'] .datepicker.dropdown-menu { + color: #333; +} +[data-theme='translucent'] .irs--flat .irs-min, +[data-theme='translucent'] .irs--flat .irs-max { + background-color: rgba(0, 0, 0, .035); + color: rgba(255, 255, 255, .85); +} +[data-theme='translucent'] .irs--flat .irs-line { + background-color: rgba(0, 0, 0, .075); +} +[data-theme='translucent'] .irs--flat .irs-grid-text { + color: rgba(255, 255, 255, .85); +} +[data-theme='translucent'] .text-muted { + color: rgba(255, 255, 255, .5)!important; +} +[data-theme='dark'] .card-footer, +[data-theme='translucent'] .card-footer { + background-color: transparent; +} + +@media (max-width: 1024px) { + [data-theme='translucent'].lyear-layout-sidebar-close .lyear-layout-sidebar-scroll, + [data-theme='translucent'].lyear-layout-sidebar-close .sidebar-header { + background-color: rgba(0, 0, 0, .75); + } +} + +/* 颜色搭配 */ +[data-headerbg='color_2'] .lyear-layout-header, +[data-logobg='color_2'] .sidebar-header, +[data-sidebarbg='color_2'] .lyear-layout-sidebar-scroll { + background-color: #15c377; +} +[data-headerbg='color_3'] .lyear-layout-header, +[data-logobg='color_3'] .sidebar-header, +[data-sidebarbg='color_3'] .lyear-layout-sidebar-scroll { + background-color: #48b0f7; +} +[data-headerbg='color_4'] .lyear-layout-header, +[data-logobg='color_4'] .sidebar-header, +[data-sidebarbg='color_4'] .lyear-layout-sidebar-scroll { + background-color: #faa64b; +} +[data-headerbg='color_5'] .lyear-layout-header, +[data-logobg='color_5'] .sidebar-header, +[data-sidebarbg='color_5'] .lyear-layout-sidebar-scroll { + background-color: #f96868; +} +[data-headerbg='color_6'] .lyear-layout-header, +[data-logobg='color_6'] .sidebar-header, +[data-sidebarbg='color_6'] .lyear-layout-sidebar-scroll { + background-color: #926dde; +} +[data-headerbg='color_7'] .lyear-layout-header, +[data-logobg='color_7'] .sidebar-header, +[data-sidebarbg='color_7'] .lyear-layout-sidebar-scroll { + background-color: #33cabb; +} +[data-headerbg='color_8'] .lyear-layout-header, +[data-logobg='color_8'] .sidebar-header, +[data-sidebarbg='color_8'] .lyear-layout-sidebar-scroll { + background-color: #222437; +} + +[data-logobg*='color_'] .sidebar-header img, +[data-theme='dark'] .sidebar-header img, +[data-theme='translucent'] .sidebar-header img { + position: relative; + -webkit-filter: brightness(275%); + -moz-filter: brightness(275%); + -ms-filter: brightness(275%); + -o-filter: brightness(275%); + filter: brightness(275%); +} +[data-headerbg*='color_'] .lyear-layout-header, +[data-headerbg*='color_'] .lyear-layout-header .topbar-right > li > a, +[data-sidebarbg*='color_'] .lyear-layout-sidebar-scroll a, +[data-sidebarbg*='color_'] .sidebar-footer { + color: rgba(255, 255, 255, .85); +} +[data-sidebarbg*='color_'] .nav-drawer .nav-subnav > li.active > a, +[data-sidebarbg*='color_'] .nav-drawer .nav-subnav > li > a:hover { + color: #fff; +} +[data-headerbg*='color_'] .lyear-aside-toggler .lyear-toggler-bar { + background-color: #fff; +} +[data-sidebarbg*='color_'] .nav-drawer > .active > a { + border-color: rgba(255, 255, 255, .35); + background-color: rgba(255, 255, 255, .075)!important; +} +[data-sidebarbg*='color_'] .nav > li > a:hover { + background-color: rgba(255, 255, 255, .035); +} +[data-sidebarbg*='color_'] .nav-drawer > .active > a:hover, +[data-sidebarbg*='color_'] .nav-drawer > .active > a:focus, +[data-sidebarbg*='color_'] .nav-drawer > .active > a:active { + border-color: rgba(255, 255, 255, .35); +} \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/database_manager.html b/SuperAPI/wwwroot/rezero/default_ui/database_manager.html new file mode 100644 index 0000000..bbe08c5 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/database_manager.html @@ -0,0 +1,393 @@ +@@master_page.html + +
    + +
    + +
    +
    + + + + + + + + + + + + + + + + +
    {{column.ColumnDescription}}操作
    +
    + {{ item[column.PropertyName] }} +
    +
    + {{ item[column.PropertyName] }} +
    +
    + + + + +
    +
    + +
    + @@page_control.html + + +
    + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/dynamic_interface.html b/SuperAPI/wwwroot/rezero/default_ui/dynamic_interface.html new file mode 100644 index 0000000..09b0823 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/dynamic_interface.html @@ -0,0 +1,191 @@ +@@master_page.html + +
    +
    +
    +
    +
    +
    + +
    +
    + + +
    + + +
    +
    + + +
    +
    +
    +
    +
    +
    +

    {{ masterItem.Key }}

    +
    +
    +

    + {{ item.HttpMethod }} + {{item.Url}} {{item.Name}} + + +

    +

    {{ item.Description }}

    + + +
    +
    +
    + +
    + +
    +
    + diff --git a/SuperAPI/wwwroot/rezero/default_ui/entity_manager.html b/SuperAPI/wwwroot/rezero/default_ui/entity_manager.html new file mode 100644 index 0000000..a7f1eff --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/entity_manager.html @@ -0,0 +1,1075 @@ +@@master_page.html + + + + +
    + +
    + +
    +
    +
    +
    +
    +
    +
    + + + 搜索 + +
    +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + +
    + + 操作
    + + + + + +
    +
    +
    + @@page_control.html +
    +
    +
    + + + + + + + + + + + + + + + + + + + + +
    + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/favicon.ico b/SuperAPI/wwwroot/rezero/default_ui/favicon.ico new file mode 100644 index 0000000..158a70a Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/favicon.ico differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/fonts/materialdesignicons.eot b/SuperAPI/wwwroot/rezero/default_ui/fonts/materialdesignicons.eot new file mode 100644 index 0000000..df4d452 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/fonts/materialdesignicons.eot differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/fonts/materialdesignicons.svg b/SuperAPI/wwwroot/rezero/default_ui/fonts/materialdesignicons.svg new file mode 100644 index 0000000..41d0359 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/fonts/materialdesignicons.svg @@ -0,0 +1,6150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SuperAPI/wwwroot/rezero/default_ui/fonts/materialdesignicons.ttf b/SuperAPI/wwwroot/rezero/default_ui/fonts/materialdesignicons.ttf new file mode 100644 index 0000000..69404e3 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/fonts/materialdesignicons.ttf differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/fonts/materialdesignicons.woff b/SuperAPI/wwwroot/rezero/default_ui/fonts/materialdesignicons.woff new file mode 100644 index 0000000..56b9a35 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/fonts/materialdesignicons.woff differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/fonts/materialdesignicons.woff2 b/SuperAPI/wwwroot/rezero/default_ui/fonts/materialdesignicons.woff2 new file mode 100644 index 0000000..9f0cc36 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/fonts/materialdesignicons.woff2 differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/captcha.png b/SuperAPI/wwwroot/rezero/default_ui/images/captcha.png new file mode 100644 index 0000000..a363c47 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/captcha.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/gallery/1.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/1.jpg new file mode 100644 index 0000000..17e157b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/1.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/gallery/10.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/10.jpg new file mode 100644 index 0000000..fc4942d Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/10.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/gallery/11.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/11.jpg new file mode 100644 index 0000000..7b8ca10 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/11.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/gallery/13.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/13.jpg new file mode 100644 index 0000000..3408610 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/13.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/gallery/14.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/14.jpg new file mode 100644 index 0000000..d802afe Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/14.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/gallery/15.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/15.jpg new file mode 100644 index 0000000..ee9a967 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/15.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/gallery/16.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/16.jpg new file mode 100644 index 0000000..82aa5aa Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/16.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/gallery/17.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/17.jpg new file mode 100644 index 0000000..0698124 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/17.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/gallery/2.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/2.jpg new file mode 100644 index 0000000..7d671be Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/2.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/gallery/3.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/3.jpg new file mode 100644 index 0000000..64eb884 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/3.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/gallery/4.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/4.jpg new file mode 100644 index 0000000..2ea1695 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/4.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/gallery/5.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/5.jpg new file mode 100644 index 0000000..24d4204 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/5.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/gallery/6.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/6.jpg new file mode 100644 index 0000000..3cc035c Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/6.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/gallery/7.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/7.jpg new file mode 100644 index 0000000..ce4f50d Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/7.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/gallery/8.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/8.jpg new file mode 100644 index 0000000..3cbbbc7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/8.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/gallery/9.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/9.jpg new file mode 100644 index 0000000..2134383 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/gallery/9.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/img-slide-1.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/img-slide-1.jpg new file mode 100644 index 0000000..1d44225 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/img-slide-1.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/img-slide-2.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/img-slide-2.jpg new file mode 100644 index 0000000..ee784e9 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/img-slide-2.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/img-slide-3.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/img-slide-3.jpg new file mode 100644 index 0000000..ff843b9 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/img-slide-3.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/img-slide-4.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/img-slide-4.jpg new file mode 100644 index 0000000..eab3018 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/img-slide-4.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/img-slide-5.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/img-slide-5.jpg new file mode 100644 index 0000000..4508a07 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/img-slide-5.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/login-bg-2.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/login-bg-2.jpg new file mode 100644 index 0000000..36ac54a Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/login-bg-2.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/login-bg-3.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/login-bg-3.jpg new file mode 100644 index 0000000..90e9c76 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/login-bg-3.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/login-bg-4.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/login-bg-4.jpg new file mode 100644 index 0000000..ebc7317 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/login-bg-4.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/login-bg.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/login-bg.jpg new file mode 100644 index 0000000..6bc0468 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/login-bg.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/logo-ico.png b/SuperAPI/wwwroot/rezero/default_ui/images/logo-ico.png new file mode 100644 index 0000000..eb1c65a Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/logo-ico.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/logo-sidebar.png b/SuperAPI/wwwroot/rezero/default_ui/images/logo-sidebar.png new file mode 100644 index 0000000..7922653 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/logo-sidebar.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/logo.png b/SuperAPI/wwwroot/rezero/default_ui/images/logo.png new file mode 100644 index 0000000..9ea0bde Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/logo.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/images/users/avatar.jpg b/SuperAPI/wwwroot/rezero/default_ui/images/users/avatar.jpg new file mode 100644 index 0000000..500dd96 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/images/users/avatar.jpg differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/index.html b/SuperAPI/wwwroot/rezero/default_ui/index.html new file mode 100644 index 0000000..64fb9d1 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/index.html @@ -0,0 +1,6 @@ +@@master_page.html + + + + + diff --git a/SuperAPI/wwwroot/rezero/default_ui/interface_categroy.html b/SuperAPI/wwwroot/rezero/default_ui/interface_categroy.html new file mode 100644 index 0000000..12a6951 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/interface_categroy.html @@ -0,0 +1,197 @@ +@@master_page.html + +
    + +
    + +
    +
    + + + + + + + + + + + + + + + + +
    {{column.ColumnDescription}}操作
    + {{ item[column.PropertyName] }} + + + +
    +
    + +
    + @@page_control.html + +
    + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/interface_manager.html b/SuperAPI/wwwroot/rezero/default_ui/interface_manager.html new file mode 100644 index 0000000..d4c3f5a --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/interface_manager.html @@ -0,0 +1,1537 @@ +@@master_page.html + + + + +
    + + + + + +
    +
    +
    + + + + + + + + + + + + + + + + + +
    + + {{column.ColumnDescription}}操作
    + + + {{ item[column.PropertyName] }} + + + +
    +
    +
    + +
    + + @@page_control.html + + + + + + + + + + + + + + + + +
    + diff --git a/SuperAPI/wwwroot/rezero/default_ui/interface_permission_management.html b/SuperAPI/wwwroot/rezero/default_ui/interface_permission_management.html new file mode 100644 index 0000000..e488c5d --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/interface_permission_management.html @@ -0,0 +1,488 @@ +@@master_page.html + + + + +
    + + + + +
    + +
    + + +
    +
    +
    + + + + + + + + + + + + + + + +
    + + {{ column.ColumnDescription }}操作
    + + + {{ item[column.PropertyName] }} + + + +
    +
    +
    +
    + + + @@page_control.html + + + + + + +
    + diff --git a/SuperAPI/wwwroot/rezero/default_ui/internal_interface.html b/SuperAPI/wwwroot/rezero/default_ui/internal_interface.html new file mode 100644 index 0000000..0e79d76 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/internal_interface.html @@ -0,0 +1,96 @@ +@@master_page.html + +
    +
    +
    +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    +
    +

    {{ masterItem.Key }}

    +
    +
    +

    + {{ item.HttpMethod }} + {{item.Url}} {{item.Name}} + + +

    +

    {{ item.Description }}

    + + +
    +
    +
    +
    + diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/ace.css b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/ace.css new file mode 100644 index 0000000..f48d3c2 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/ace.css @@ -0,0 +1,1303 @@ +/*ace_scrollbar.css*/ +.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{ +position: absolute; +background: rgba(128, 128, 128, 0.6); +-moz-box-sizing: border-box; +box-sizing: border-box; +border: 1px solid #bbb; +border-radius: 2px; +z-index: 8; +} +.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h { +position: absolute; +z-index: 6; +background: none; +overflow: hidden!important; +} +.ace_editor>.ace_sb-v { +z-index: 6; +right: 0; +top: 0; +width: 12px; +} +.ace_editor>.ace_sb-v div { +z-index: 8; +right: 0; +width: 100%; +} +.ace_editor>.ace_sb-h { +bottom: 0; +left: 0; +height: 12px; +} +.ace_editor>.ace_sb-h div { +bottom: 0; +height: 100%; +} +.ace_editor>.ace_sb_grabbed { +z-index: 8; +background: #000; +} +/*ace_editor.css*/ +.ace_br1 {border-top-left-radius : 3px;} +.ace_br2 {border-top-right-radius : 3px;} +.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;} +.ace_br4 {border-bottom-right-radius: 3px;} +.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;} +.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;} +.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;} +.ace_br8 {border-bottom-left-radius : 3px;} +.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;} +.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;} +.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;} +.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} +.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} +.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} +.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} +.ace_editor { +position: relative; +overflow: hidden; +padding: 0; +font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace; +direction: ltr; +text-align: left; +-webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +.ace_scroller { +position: absolute; +overflow: hidden; +top: 0; +bottom: 0; +background-color: inherit; +-ms-user-select: none; +-moz-user-select: none; +-webkit-user-select: none; +user-select: none; +cursor: text; +} +.ace_content { +position: absolute; +box-sizing: border-box; +min-width: 100%; +contain: style size layout; +font-variant-ligatures: no-common-ligatures; +} +.ace_keyboard-focus:focus { +box-shadow: inset 0 0 0 2px #5E9ED6; +outline: none; +} +.ace_dragging .ace_scroller:before{ +position: absolute; +top: 0; +left: 0; +right: 0; +bottom: 0; +content: ''; +background: rgba(250, 250, 250, 0.01); +z-index: 1000; +} +.ace_dragging.ace_dark .ace_scroller:before{ +background: rgba(0, 0, 0, 0.01); +} +.ace_gutter { +position: absolute; +overflow : hidden; +width: auto; +top: 0; +bottom: 0; +left: 0; +cursor: default; +z-index: 4; +-ms-user-select: none; +-moz-user-select: none; +-webkit-user-select: none; +user-select: none; +contain: style size layout; +} +.ace_gutter-active-line { +position: absolute; +left: 0; +right: 0; +} +.ace_scroller.ace_scroll-left:after { +content: ""; +position: absolute; +top: 0; +right: 0; +bottom: 0; +left: 0; +box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset; +pointer-events: none; +} +.ace_gutter-cell, .ace_gutter-cell_svg-icons { +position: absolute; +top: 0; +left: 0; +right: 0; +padding-left: 19px; +padding-right: 6px; +background-repeat: no-repeat; +} +.ace_gutter-cell_svg-icons .ace_gutter_annotation { +margin-left: -14px; +float: left; +} +.ace_gutter-cell .ace_gutter_annotation { +margin-left: -19px; +float: left; +} +.ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold { +background-image: url("./main-1.png"); +background-repeat: no-repeat; +background-position: 2px center; +} +.ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold { +background-image: url("./main-2.png"); +background-repeat: no-repeat; +background-position: 2px center; +} +.ace_gutter-cell.ace_info, .ace_icon.ace_info { +background-image: url("./main-3.png"); +background-repeat: no-repeat; +background-position: 2px center; +} +.ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info { +background-image: url("./main-4.png"); +} +.ace_icon_svg.ace_error { +-webkit-mask-image: url("./main-5.svg"); +background-color: crimson; +} +.ace_icon_svg.ace_warning { +-webkit-mask-image: url("./main-6.svg"); +background-color: darkorange; +} +.ace_icon_svg.ace_info { +-webkit-mask-image: url("./main-7.svg"); +background-color: royalblue; +} +.ace_icon_svg.ace_error_fold { +-webkit-mask-image: url("./main-8.svg"); +background-color: crimson; +} +.ace_icon_svg.ace_warning_fold { +-webkit-mask-image: url("./main-9.svg"); +background-color: darkorange; +} +.ace_scrollbar { +contain: strict; +position: absolute; +right: 0; +bottom: 0; +z-index: 6; +} +.ace_scrollbar-inner { +position: absolute; +cursor: text; +left: 0; +top: 0; +} +.ace_scrollbar-v{ +overflow-x: hidden; +overflow-y: scroll; +top: 0; +} +.ace_scrollbar-h { +overflow-x: scroll; +overflow-y: hidden; +left: 0; +} +.ace_print-margin { +position: absolute; +height: 100%; +} +.ace_text-input { +position: absolute; +z-index: 0; +width: 0.5em; +height: 1em; +opacity: 0; +background: transparent; +-moz-appearance: none; +appearance: none; +border: none; +resize: none; +outline: none; +overflow: hidden; +font: inherit; +padding: 0 1px; +margin: 0 -1px; +contain: strict; +-ms-user-select: text; +-moz-user-select: text; +-webkit-user-select: text; +user-select: text; +/*with `pre-line` chrome inserts   instead of space*/ +white-space: pre!important; +} +.ace_text-input.ace_composition { +background: transparent; +color: inherit; +z-index: 1000; +opacity: 1; +} +.ace_composition_placeholder { color: transparent } +.ace_composition_marker { +border-bottom: 1px solid; +position: absolute; +border-radius: 0; +margin-top: 1px; +} +[ace_nocontext=true] { +transform: none!important; +filter: none!important; +clip-path: none!important; +mask : none!important; +contain: none!important; +perspective: none!important; +mix-blend-mode: initial!important; +z-index: auto; +} +.ace_layer { +z-index: 1; +position: absolute; +overflow: hidden; +/* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/ +word-wrap: normal; +white-space: pre; +height: 100%; +width: 100%; +box-sizing: border-box; +/* setting pointer-events: auto; on node under the mouse, which changes +during scroll, will break mouse wheel scrolling in Safari */ +pointer-events: none; +} +.ace_gutter-layer { +position: relative; +width: auto; +text-align: right; +pointer-events: auto; +height: 1000000px; +contain: style size layout; +} +.ace_text-layer { +font: inherit !important; +position: absolute; +height: 1000000px; +width: 1000000px; +contain: style size layout; +} +.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group { +contain: style size layout; +position: absolute; +top: 0; +left: 0; +right: 0; +} +.ace_hidpi .ace_text-layer, +.ace_hidpi .ace_gutter-layer, +.ace_hidpi .ace_content, +.ace_hidpi .ace_gutter { +contain: strict; +} +.ace_hidpi .ace_text-layer > .ace_line, +.ace_hidpi .ace_text-layer > .ace_line_group { +contain: strict; +} +.ace_cjk { +display: inline-block; +text-align: center; +} +.ace_cursor-layer { +z-index: 4; +} +.ace_cursor { +z-index: 4; +position: absolute; +box-sizing: border-box; +border-left: 2px solid; +/* workaround for smooth cursor repaintng whole screen in chrome */ +transform: translatez(0); +} +.ace_multiselect .ace_cursor { +border-left-width: 1px; +} +.ace_slim-cursors .ace_cursor { +border-left-width: 1px; +} +.ace_overwrite-cursors .ace_cursor { +border-left-width: 0; +border-bottom: 1px solid; +} +.ace_hidden-cursors .ace_cursor { +opacity: 0.2; +} +.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor { +opacity: 0; +} +.ace_smooth-blinking .ace_cursor { +transition: opacity 0.18s; +} +.ace_animate-blinking .ace_cursor { +animation-duration: 1000ms; +animation-timing-function: step-end; +animation-name: blink-ace-animate; +animation-iteration-count: infinite; +} +.ace_animate-blinking.ace_smooth-blinking .ace_cursor { +animation-duration: 1000ms; +animation-timing-function: ease-in-out; +animation-name: blink-ace-animate-smooth; +} +@keyframes blink-ace-animate { +from, to { opacity: 1; } +60% { opacity: 0; } +} +@keyframes blink-ace-animate-smooth { +from, to { opacity: 1; } +45% { opacity: 1; } +60% { opacity: 0; } +85% { opacity: 0; } +} +.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack { +position: absolute; +z-index: 3; +} +.ace_marker-layer .ace_selection { +position: absolute; +z-index: 5; +} +.ace_marker-layer .ace_bracket { +position: absolute; +z-index: 6; +} +.ace_marker-layer .ace_error_bracket { +position: absolute; +border-bottom: 1px solid #DE5555; +border-radius: 0; +} +.ace_marker-layer .ace_active-line { +position: absolute; +z-index: 2; +} +.ace_marker-layer .ace_selected-word { +position: absolute; +z-index: 4; +box-sizing: border-box; +} +.ace_line .ace_fold { +box-sizing: border-box; +display: inline-block; +height: 11px; +margin-top: -2px; +vertical-align: middle; +background-image: +url("./main-10.png"), +url("./main-11.png"); +background-repeat: no-repeat, repeat-x; +background-position: center center, top left; +color: transparent; +border: 1px solid black; +border-radius: 2px; +cursor: pointer; +pointer-events: auto; +} +.ace_dark .ace_fold { +} +.ace_fold:hover{ +background-image: +url("./main-12.png"), +url("./main-13.png"); +} +.ace_tooltip { +background-color: #f5f5f5; +border: 1px solid gray; +border-radius: 1px; +box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); +color: black; +max-width: 100%; +padding: 3px 4px; +position: fixed; +z-index: 999999; +box-sizing: border-box; +cursor: default; +white-space: pre-wrap; +word-wrap: break-word; +line-height: normal; +font-style: normal; +font-weight: normal; +letter-spacing: normal; +pointer-events: none; +overflow: auto; +max-width: min(60em, 66vw); +overscroll-behavior: contain; +} +.ace_tooltip pre { +white-space: pre-wrap; +} +.ace_tooltip.ace_dark { +background-color: #636363; +color: #fff; +} +.ace_tooltip:focus { +outline: 1px solid #5E9ED6; +} +.ace_icon { +display: inline-block; +width: 18px; +vertical-align: top; +} +.ace_icon_svg { +display: inline-block; +width: 12px; +vertical-align: top; +-webkit-mask-repeat: no-repeat; +-webkit-mask-size: 12px; +-webkit-mask-position: center; +} +.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons { +padding-right: 13px; +} +.ace_fold-widget { +box-sizing: border-box; +margin: 0 -12px 0 1px; +display: none; +width: 11px; +vertical-align: top; +background-image: url("./main-14.png"); +background-repeat: no-repeat; +background-position: center; +border-radius: 3px; +border: 1px solid transparent; +cursor: pointer; +} +.ace_folding-enabled .ace_fold-widget { +display: inline-block; +} +.ace_fold-widget.ace_end { +background-image: url("./main-15.png"); +} +.ace_fold-widget.ace_closed { +background-image: url("./main-16.png"); +} +.ace_fold-widget:hover { +border: 1px solid rgba(0, 0, 0, 0.3); +background-color: rgba(255, 255, 255, 0.2); +box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7); +} +.ace_fold-widget:active { +border: 1px solid rgba(0, 0, 0, 0.4); +background-color: rgba(0, 0, 0, 0.05); +box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); +} +/** +* Dark version for fold widgets +*/ +.ace_dark .ace_fold-widget { +background-image: url("./main-17.png"); +} +.ace_dark .ace_fold-widget.ace_end { +background-image: url("./main-18.png"); +} +.ace_dark .ace_fold-widget.ace_closed { +background-image: url("./main-19.png"); +} +.ace_dark .ace_fold-widget:hover { +box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); +background-color: rgba(255, 255, 255, 0.1); +} +.ace_dark .ace_fold-widget:active { +box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); +} +.ace_inline_button { +border: 1px solid lightgray; +display: inline-block; +margin: -1px 8px; +padding: 0 5px; +pointer-events: auto; +cursor: pointer; +} +.ace_inline_button:hover { +border-color: gray; +background: rgba(200,200,200,0.2); +display: inline-block; +pointer-events: auto; +} +.ace_fold-widget.ace_invalid { +background-color: #FFB4B4; +border-color: #DE5555; +} +.ace_fade-fold-widgets .ace_fold-widget { +transition: opacity 0.4s ease 0.05s; +opacity: 0; +} +.ace_fade-fold-widgets:hover .ace_fold-widget { +transition: opacity 0.05s ease 0.05s; +opacity:1; +} +.ace_underline { +text-decoration: underline; +} +.ace_bold { +font-weight: bold; +} +.ace_nobold .ace_bold { +font-weight: normal; +} +.ace_italic { +font-style: italic; +} +.ace_error-marker { +background-color: rgba(255, 0, 0,0.2); +position: absolute; +z-index: 9; +} +.ace_highlight-marker { +background-color: rgba(255, 255, 0,0.2); +position: absolute; +z-index: 8; +} +.ace_mobile-menu { +position: absolute; +line-height: 1.5; +border-radius: 4px; +-ms-user-select: none; +-moz-user-select: none; +-webkit-user-select: none; +user-select: none; +background: white; +box-shadow: 1px 3px 2px grey; +border: 1px solid #dcdcdc; +color: black; +} +.ace_dark > .ace_mobile-menu { +background: #333; +color: #ccc; +box-shadow: 1px 3px 2px grey; +border: 1px solid #444; +} +.ace_mobile-button { +padding: 2px; +cursor: pointer; +overflow: hidden; +} +.ace_mobile-button:hover { +background-color: #eee; +opacity:1; +} +.ace_mobile-button:active { +background-color: #ddd; +} +.ace_placeholder { +font-family: arial; +transform: scale(0.9); +transform-origin: left; +white-space: pre; +opacity: 0.7; +margin: 0 10px; +} +.ace_ghost_text { +opacity: 0.5; +font-style: italic; +white-space: pre; +} +.ace_screenreader-only { +position:absolute; +left:-10000px; +top:auto; +width:1px; +height:1px; +overflow:hidden; +} +/*ace-tm*/ +.ace-tm .ace_gutter { +background: #f0f0f0; +color: #333; +} +.ace-tm .ace_print-margin { +width: 1px; +background: #e8e8e8; +} +.ace-tm .ace_fold { +background-color: #6B72E6; +} +.ace-tm { +background-color: #FFFFFF; +color: black; +} +.ace-tm .ace_cursor { +color: black; +} +.ace-tm .ace_invisible { +color: rgb(191, 191, 191); +} +.ace-tm .ace_storage, +.ace-tm .ace_keyword { +color: blue; +} +.ace-tm .ace_constant { +color: rgb(197, 6, 11); +} +.ace-tm .ace_constant.ace_buildin { +color: rgb(88, 72, 246); +} +.ace-tm .ace_constant.ace_language { +color: rgb(88, 92, 246); +} +.ace-tm .ace_constant.ace_library { +color: rgb(6, 150, 14); +} +.ace-tm .ace_invalid { +background-color: rgba(255, 0, 0, 0.1); +color: red; +} +.ace-tm .ace_support.ace_function { +color: rgb(60, 76, 114); +} +.ace-tm .ace_support.ace_constant { +color: rgb(6, 150, 14); +} +.ace-tm .ace_support.ace_type, +.ace-tm .ace_support.ace_class { +color: rgb(109, 121, 222); +} +.ace-tm .ace_keyword.ace_operator { +color: rgb(104, 118, 135); +} +.ace-tm .ace_string { +color: rgb(3, 106, 7); +} +.ace-tm .ace_comment { +color: rgb(76, 136, 107); +} +.ace-tm .ace_comment.ace_doc { +color: rgb(0, 102, 255); +} +.ace-tm .ace_comment.ace_doc.ace_tag { +color: rgb(128, 159, 191); +} +.ace-tm .ace_constant.ace_numeric { +color: rgb(0, 0, 205); +} +.ace-tm .ace_variable { +color: rgb(49, 132, 149); +} +.ace-tm .ace_xml-pe { +color: rgb(104, 104, 91); +} +.ace-tm .ace_entity.ace_name.ace_function { +color: #0000A2; +} +.ace-tm .ace_heading { +color: rgb(12, 7, 255); +} +.ace-tm .ace_list { +color:rgb(185, 6, 144); +} +.ace-tm .ace_meta.ace_tag { +color:rgb(0, 22, 142); +} +.ace-tm .ace_string.ace_regex { +color: rgb(255, 0, 0) +} +.ace-tm .ace_marker-layer .ace_selection { +background: rgb(181, 213, 255); +} +.ace-tm.ace_multiselect .ace_selection.ace_start { +box-shadow: 0 0 3px 0px white; +} +.ace-tm .ace_marker-layer .ace_step { +background: rgb(252, 255, 0); +} +.ace-tm .ace_marker-layer .ace_stack { +background: rgb(164, 229, 101); +} +.ace-tm .ace_marker-layer .ace_bracket { +margin: -1px 0 0 -1px; +border: 1px solid rgb(192, 192, 192); +} +.ace-tm .ace_marker-layer .ace_active-line { +background: rgba(0, 0, 0, 0.07); +} +.ace-tm .ace_gutter-active-line { +background-color : #dcdcdc; +} +.ace-tm .ace_marker-layer .ace_selected-word { +background: rgb(250, 250, 255); +border: 1px solid rgb(200, 200, 250); +} +.ace-tm .ace_indent-guide { +background: url("./main-20.png") right repeat-y; +} +.ace-tm .ace_indent-guide-active { +background: url("./main-21.png") right repeat-y; +} +/*error_marker.css*/ +.error_widget_wrapper { +background: inherit; +color: inherit; +border:none +} +.error_widget { +border-top: solid 2px; +border-bottom: solid 2px; +margin: 5px 0; +padding: 10px 40px; +white-space: pre-wrap; +} +.error_widget.ace_error, .error_widget_arrow.ace_error{ +border-color: #ff5a5a +} +.error_widget.ace_warning, .error_widget_arrow.ace_warning{ +border-color: #F1D817 +} +.error_widget.ace_info, .error_widget_arrow.ace_info{ +border-color: #5a5a5a +} +.error_widget.ace_ok, .error_widget_arrow.ace_ok{ +border-color: #5aaa5a +} +.error_widget_arrow { +position: absolute; +border: solid 5px; +border-top-color: transparent!important; +border-right-color: transparent!important; +border-left-color: transparent!important; +top: -5px; +} +/*codelense.css*/ +.ace_codeLens { +position: absolute; +color: #aaa; +font-size: 88%; +background: inherit; +width: 100%; +display: flex; +align-items: flex-end; +pointer-events: none; +} +.ace_codeLens > a { +cursor: pointer; +pointer-events: auto; +} +.ace_codeLens > a:hover { +color: #0000ff; +text-decoration: underline; +} +.ace_dark > .ace_codeLens > a:hover { +color: #4e94ce; +} +/*commandbar.css*/ +.ace_tooltip.command_bar_tooltip_wrapper { +padding: 0; +} +.ace_tooltip .command_bar_tooltip { +padding: 1px 5px; +display: flex; +pointer-events: auto; +} +.ace_tooltip .command_bar_tooltip.tooltip_more_options { +padding: 1px; +flex-direction: column; +} +div.command_bar_tooltip_button { +display: inline-flex; +cursor: pointer; +margin: 1px; +border-radius: 2px; +padding: 2px 5px; +align-items: center; +} +div.command_bar_tooltip_button.ace_selected, +div.command_bar_tooltip_button:hover:not(.ace_disabled) { +background-color: rgba(0, 0, 0, 0.1); +} +div.command_bar_tooltip_button.ace_disabled { +color: #777; +pointer-events: none; +} +div.command_bar_tooltip_button .ace_icon_svg { +height: 12px; +background-color: #000; +} +div.command_bar_tooltip_button.ace_disabled .ace_icon_svg { +background-color: #777; +} +.command_bar_tooltip.tooltip_more_options .command_bar_tooltip_button { +display: flex; +} +.command_bar_tooltip.command_bar_button_value { +display: none; +} +.command_bar_tooltip.tooltip_more_options .command_bar_button_value { +display: inline-block; +width: 12px; +} +.command_bar_button_caption { +display: inline-block; +} +.command_bar_keybinding { +margin: 0 2px; +display: inline-block; +font-size: 8px; +} +.command_bar_tooltip.tooltip_more_options .command_bar_keybinding { +margin-left: auto; +} +.command_bar_keybinding div { +display: inline-block; +min-width: 8px; +padding: 2px; +margin: 0 1px; +border-radius: 2px; +background-color: #ccc; +text-align: center; +} +.ace_dark.ace_tooltip .command_bar_tooltip { +background-color: #373737; +color: #eee; +} +.ace_dark div.command_bar_tooltip_button.ace_disabled { +color: #979797; +} +.ace_dark div.command_bar_tooltip_button.ace_selected, +.ace_dark div.command_bar_tooltip_button:hover:not(.ace_disabled) { +background-color: rgba(255, 255, 255, 0.1); +} +.ace_dark div.command_bar_tooltip_button .ace_icon_svg { +background-color: #eee; +} +.ace_dark div.command_bar_tooltip_button.ace_disabled .ace_icon_svg { +background-color: #979797; +} +.ace_dark .command_bar_tooltip_button.ace_disabled { +color: #979797; +} +.ace_dark .command_bar_keybinding div { +background-color: #575757; +} +.ace_checkmark::before { +content: '✓'; +} +/*snippets.css*/ +.ace_snippet-marker { +-moz-box-sizing: border-box; +box-sizing: border-box; +background: rgba(194, 193, 208, 0.09); +border: 1px dotted rgba(211, 208, 235, 0.62); +position: absolute; +} +/*autocompletion.css*/ +.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line { +background-color: #CAD6FA; +z-index: 1; +} +.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line { +background-color: #3a674e; +} +.ace_editor.ace_autocomplete .ace_line-hover { +border: 1px solid #abbffe; +margin-top: -1px; +background: rgba(233,233,253,0.4); +position: absolute; +z-index: 2; +} +.ace_dark.ace_editor.ace_autocomplete .ace_line-hover { +border: 1px solid rgba(109, 150, 13, 0.8); +background: rgba(58, 103, 78, 0.62); +} +.ace_completion-meta { +opacity: 0.5; +margin-left: 0.9em; +} +.ace_completion-message { +margin-left: 0.9em; +color: blue; +} +.ace_editor.ace_autocomplete .ace_completion-highlight{ +color: #2d69c7; +} +.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{ +color: #93ca12; +} +.ace_editor.ace_autocomplete { +width: 300px; +z-index: 200000; +border: 1px lightgray solid; +position: fixed; +box-shadow: 2px 3px 5px rgba(0,0,0,.2); +line-height: 1.4; +background: #fefefe; +color: #111; +} +.ace_dark.ace_editor.ace_autocomplete { +border: 1px #484747 solid; +box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51); +line-height: 1.4; +background: #25282c; +color: #c1c1c1; +} +.ace_autocomplete .ace_text-layer { +width: calc(100% - 8px); +} +.ace_autocomplete .ace_line { +display: flex; +align-items: center; +} +.ace_autocomplete .ace_line > * { +min-width: 0; +flex: 0 0 auto; +} +.ace_autocomplete .ace_line .ace_ { +flex: 0 1 auto; +overflow: hidden; +white-space: nowrap; +text-overflow: ellipsis; +} +.ace_autocomplete .ace_completion-spacer { +flex: 1; +} +.ace_autocomplete.ace_loading:after { +content: ""; +position: absolute; +top: 0px; +height: 2px; +width: 8%; +background: blue; +z-index: 100; +animation: ace_progress 3s infinite linear; +animation-delay: 300ms; +transform: translateX(-100%) scaleX(1); +} +@keyframes ace_progress { +0% { transform: translateX(-100%) scaleX(1) } +50% { transform: translateX(625%) scaleX(2) } +100% { transform: translateX(1500%) scaleX(3) } +} +@media (prefers-reduced-motion) { +.ace_autocomplete.ace_loading:after { +transform: translateX(625%) scaleX(2); +animation: none; +} +} +/*inlineautocomplete.css*/ +.ace_icon_svg.ace_arrow, +.ace_icon_svg.ace_arrow_rotated { +-webkit-mask-image: url("./main-22.svg"); +} +.ace_icon_svg.ace_arrow_rotated { +transform: rotate(180deg); +} +div.command_bar_tooltip_button.completion_position { +padding: 0; +} +/*settings_menu.css*/ +#ace_settingsmenu, #kbshortcutmenu { +background-color: #F7F7F7; +color: black; +box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55); +padding: 1em 0.5em 2em 1em; +overflow: auto; +position: absolute; +margin: 0; +bottom: 0; +right: 0; +top: 0; +z-index: 9991; +cursor: default; +} +.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu { +box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25); +background-color: rgba(255, 255, 255, 0.6); +color: black; +} +.ace_optionsMenuEntry:hover { +background-color: rgba(100, 100, 100, 0.1); +transition: all 0.3s +} +.ace_closeButton { +background: rgba(245, 146, 146, 0.5); +border: 1px solid #F48A8A; +border-radius: 50%; +padding: 7px; +position: absolute; +right: -8px; +top: -8px; +z-index: 100000; +} +.ace_closeButton{ +background: rgba(245, 146, 146, 0.9); +} +.ace_optionsMenuKey { +color: darkslateblue; +font-weight: bold; +} +.ace_optionsMenuCommand { +color: darkcyan; +font-weight: normal; +} +.ace_optionsMenuEntry input, .ace_optionsMenuEntry button { +vertical-align: middle; +} +.ace_optionsMenuEntry button[ace_selected_button=true] { +background: #e7e7e7; +box-shadow: 1px 0px 2px 0px #adadad inset; +border-color: #adadad; +} +.ace_optionsMenuEntry button { +background: white; +border: 1px solid lightgray; +margin: 0px; +} +.ace_optionsMenuEntry button:hover{ +background: #f0f0f0; +} +/*promtp.css*/ +.ace_prompt_container { +max-width: 603px; +width: 100%; +margin: 20px auto; +padding: 3px; +background: white; +border-radius: 2px; +box-shadow: 0px 2px 3px 0px #555; +} +/*ace_searchbox*/ +/* ------------------------------------------------------------------------------------------ +* Editor Search Form +* --------------------------------------------------------------------------------------- */ +.ace_search { +background-color: #ddd; +color: #666; +border: 1px solid #cbcbcb; +border-top: 0 none; +overflow: hidden; +margin: 0; +padding: 4px 6px 0 4px; +position: absolute; +top: 0; +z-index: 99; +white-space: normal; +} +.ace_search.left { +border-left: 0 none; +border-radius: 0px 0px 5px 0px; +left: 0; +} +.ace_search.right { +border-radius: 0px 0px 0px 5px; +border-right: 0 none; +right: 0; +} +.ace_search_form, .ace_replace_form { +margin: 0 20px 4px 0; +overflow: hidden; +line-height: 1.9; +} +.ace_replace_form { +margin-right: 0; +} +.ace_search_form.ace_nomatch { +outline: 1px solid red; +} +.ace_search_field { +border-radius: 3px 0 0 3px; +background-color: white; +color: black; +border: 1px solid #cbcbcb; +border-right: 0 none; +outline: 0; +padding: 0; +font-size: inherit; +margin: 0; +line-height: inherit; +padding: 0 6px; +min-width: 17em; +vertical-align: top; +min-height: 1.8em; +box-sizing: content-box; +} +.ace_searchbtn { +border: 1px solid #cbcbcb; +line-height: inherit; +display: inline-block; +padding: 0 6px; +background: #fff; +border-right: 0 none; +border-left: 1px solid #dcdcdc; +cursor: pointer; +margin: 0; +position: relative; +color: #666; +} +.ace_searchbtn:last-child { +border-radius: 0 3px 3px 0; +border-right: 1px solid #cbcbcb; +} +.ace_searchbtn:disabled { +background: none; +cursor: default; +} +.ace_searchbtn:hover { +background-color: #eef1f6; +} +.ace_searchbtn.prev, .ace_searchbtn.next { +padding: 0px 0.7em +} +.ace_searchbtn.prev:after, .ace_searchbtn.next:after { +content: ""; +border: solid 2px #888; +width: 0.5em; +height: 0.5em; +border-width: 2px 0 0 2px; +display:inline-block; +transform: rotate(-45deg); +} +.ace_searchbtn.next:after { +border-width: 0 2px 2px 0 ; +} +.ace_searchbtn_close { +background: url("./main-23.png") no-repeat 50% 0; +border-radius: 50%; +border: 0 none; +color: #656565; +cursor: pointer; +font: 16px/16px Arial; +padding: 0; +height: 14px; +width: 14px; +top: 9px; +right: 7px; +position: absolute; +} +.ace_searchbtn_close:hover { +background-color: #656565; +background-position: 50% 100%; +color: white; +} +.ace_button { +margin-left: 2px; +cursor: pointer; +-webkit-user-select: none; +-moz-user-select: none; +-o-user-select: none; +-ms-user-select: none; +user-select: none; +overflow: hidden; +opacity: 0.7; +border: 1px solid rgba(100,100,100,0.23); +padding: 1px; +box-sizing: border-box!important; +color: black; +} +.ace_button:hover { +background-color: #eee; +opacity:1; +} +.ace_button:active { +background-color: #ddd; +} +.ace_button.checked { +border-color: #3399ff; +opacity:1; +} +.ace_search_options{ +margin-bottom: 3px; +text-align: right; +-webkit-user-select: none; +-moz-user-select: none; +-o-user-select: none; +-ms-user-select: none; +user-select: none; +clear: both; +} +.ace_search_counter { +float: left; +font-family: arial; +padding: 0 8px; +} +/*incremental-occur-highlighting*/ +.ace_occur-highlight { +border-radius: 4px; +background-color: rgba(87, 255, 8, 0.25); +position: absolute; +z-index: 4; +box-sizing: border-box; +box-shadow: 0 0 4px rgb(91, 255, 50); +} +.ace_dark .ace_occur-highlight { +background-color: rgb(80, 140, 85); +box-shadow: 0 0 4px rgb(60, 120, 70); +} +/*incremental-search-highlighting*/ +.ace_marker-layer .ace_isearch-result { +position: absolute; +z-index: 6; +box-sizing: border-box; +} +div.ace_isearch-result { +border-radius: 4px; +background-color: rgba(255, 200, 0, 0.5); +box-shadow: 0 0 4px rgb(255, 200, 0); +} +.ace_dark div.ace_isearch-result { +background-color: rgb(100, 110, 160); +box-shadow: 0 0 4px rgb(80, 90, 140); +} +/*emacsMode*/ +.emacs-mode .ace_cursor{ +border: 1px rgba(50,250,50,0.8) solid!important; +box-sizing: border-box!important; +background-color: rgba(0,250,0,0.9); +opacity: 0.5; +} +.emacs-mode .ace_hidden-cursors .ace_cursor{ +opacity: 1; +background-color: transparent; +} +.emacs-mode .ace_overwrite-cursors .ace_cursor { +opacity: 1; +background-color: transparent; +border-width: 0 0 2px 2px !important; +} +.emacs-mode .ace_text-layer { +z-index: 4 +} +.emacs-mode .ace_cursor-layer { +z-index: 2 +} +/*vimMode*/ +.normal-mode .ace_cursor{ +border: none; +background-color: rgba(255,0,0,0.5); +} +.normal-mode .ace_hidden-cursors .ace_cursor{ +background-color: transparent; +border: 1px solid red; +opacity: 0.7 +} +.ace_dialog { +position: absolute; +left: 0; right: 0; +background: inherit; +z-index: 15; +padding: .1em .8em; +overflow: hidden; +color: inherit; +} +.ace_dialog-top { +border-bottom: 1px solid #444; +top: 0; +} +.ace_dialog-bottom { +border-top: 1px solid #444; +bottom: 0; +} +.ace_dialog input { +border: none; +outline: none; +background: transparent; +width: 20em; +color: inherit; +font-family: monospace; +} \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/ambiance-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/ambiance-1.png new file mode 100644 index 0000000..432e05b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/ambiance-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/ambiance-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/ambiance-2.png new file mode 100644 index 0000000..0e55503 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/ambiance-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/ambiance-3.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/ambiance-3.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/ambiance-3.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/chrome-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/chrome-1.png new file mode 100644 index 0000000..b13132b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/chrome-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/chrome-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/chrome-2.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/chrome-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_day-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_day-1.png new file mode 100644 index 0000000..b13132b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_day-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_day-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_day-2.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_day-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_night-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_night-1.png new file mode 100644 index 0000000..644dfaf Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_night-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_night-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_night-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_night-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_night_low_color-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_night_low_color-1.png new file mode 100644 index 0000000..644dfaf Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_night_low_color-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_night_low_color-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_night_low_color-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cloud9_night_low_color-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/clouds-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/clouds-1.png new file mode 100644 index 0000000..b13132b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/clouds-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/clouds-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/clouds-2.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/clouds-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/clouds_midnight-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/clouds_midnight-1.png new file mode 100644 index 0000000..3e9f16c Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/clouds_midnight-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/clouds_midnight-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/clouds_midnight-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/clouds_midnight-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cobalt-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cobalt-1.png new file mode 100644 index 0000000..8c44e94 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cobalt-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cobalt-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cobalt-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/cobalt-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/crimson_editor-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/crimson_editor-1.png new file mode 100644 index 0000000..b13132b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/crimson_editor-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/crimson_editor-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/crimson_editor-2.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/crimson_editor-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dawn-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dawn-1.png new file mode 100644 index 0000000..0191105 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dawn-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dawn-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dawn-2.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dawn-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dracula-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dracula-1.png new file mode 100644 index 0000000..3e9f16c Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dracula-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dracula-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dracula-2.png new file mode 100644 index 0000000..79ad820 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dracula-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dreamweaver-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dreamweaver-1.png new file mode 100644 index 0000000..b13132b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dreamweaver-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dreamweaver-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dreamweaver-2.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/dreamweaver-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/eclipse-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/eclipse-1.png new file mode 100644 index 0000000..b13132b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/eclipse-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/eclipse-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/eclipse-2.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/eclipse-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/github-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/github-1.png new file mode 100644 index 0000000..b13132b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/github-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/github-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/github-2.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/github-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/github_dark-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/github_dark-1.png new file mode 100644 index 0000000..5788811 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/github_dark-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/github_dark-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/github_dark-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/github_dark-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gob-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gob-1.png new file mode 100644 index 0000000..641f162 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gob-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gob-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gob-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gob-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gruvbox-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gruvbox-1.png new file mode 100644 index 0000000..0e55503 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gruvbox-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gruvbox-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gruvbox-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gruvbox-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gruvbox_dark_hard-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gruvbox_dark_hard-1.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gruvbox_dark_hard-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gruvbox_light_hard-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gruvbox_light_hard-1.png new file mode 100644 index 0000000..b13132b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gruvbox_light_hard-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gruvbox_light_hard-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gruvbox_light_hard-2.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/gruvbox_light_hard-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/idle_fingers-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/idle_fingers-1.png new file mode 100644 index 0000000..b3318d6 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/idle_fingers-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/idle_fingers-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/idle_fingers-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/idle_fingers-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/iplastic-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/iplastic-1.png new file mode 100644 index 0000000..dfd76e1 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/iplastic-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/iplastic-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/iplastic-2.png new file mode 100644 index 0000000..b54b800 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/iplastic-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/iplastic-3.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/iplastic-3.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/iplastic-3.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/katzenmilch-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/katzenmilch-1.png new file mode 100644 index 0000000..b13132b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/katzenmilch-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/katzenmilch-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/katzenmilch-2.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/katzenmilch-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/kr_theme-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/kr_theme-1.png new file mode 100644 index 0000000..644dfaf Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/kr_theme-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/kr_theme-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/kr_theme-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/kr_theme-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/kuroir-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/kuroir-1.png new file mode 100644 index 0000000..b13132b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/kuroir-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/kuroir-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/kuroir-2.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/kuroir-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-1.png new file mode 100644 index 0000000..1ab8062 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-10.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-10.png new file mode 100644 index 0000000..7013006 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-10.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-11.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-11.png new file mode 100644 index 0000000..4411156 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-11.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-12.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-12.png new file mode 100644 index 0000000..7013006 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-12.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-13.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-13.png new file mode 100644 index 0000000..615640f Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-13.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-14.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-14.png new file mode 100644 index 0000000..dfd76e1 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-14.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-15.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-15.png new file mode 100644 index 0000000..ec0385c Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-15.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-16.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-16.png new file mode 100644 index 0000000..519bd36 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-16.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-17.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-17.png new file mode 100644 index 0000000..539961c Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-17.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-18.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-18.png new file mode 100644 index 0000000..c73f2e0 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-18.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-19.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-19.png new file mode 100644 index 0000000..f609a86 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-19.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-2.png new file mode 100644 index 0000000..5cf6249 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-20.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-20.png new file mode 100644 index 0000000..b13132b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-20.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-21.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-21.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-21.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-22.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-22.png new file mode 100644 index 0000000..bd04aa7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-22.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-22.svg b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-22.svg new file mode 100644 index 0000000..496894b --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-22.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-23.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-23.png new file mode 100644 index 0000000..bd04aa7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-23.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-3.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-3.png new file mode 100644 index 0000000..b03a0c0 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-3.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-4.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-4.png new file mode 100644 index 0000000..6425a55 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-4.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-5.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-5.png new file mode 100644 index 0000000..7013006 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-5.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-5.svg b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-5.svg new file mode 100644 index 0000000..bea585b --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-5.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-6.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-6.png new file mode 100644 index 0000000..4411156 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-6.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-6.svg b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-6.svg new file mode 100644 index 0000000..6f13b94 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-6.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-7.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-7.png new file mode 100644 index 0000000..7013006 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-7.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-7.svg b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-7.svg new file mode 100644 index 0000000..12d100b --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-7.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-8.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-8.png new file mode 100644 index 0000000..7013006 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-8.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-8.svg b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-8.svg new file mode 100644 index 0000000..29a6f4a --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-8.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-9.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-9.png new file mode 100644 index 0000000..4411156 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-9.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-9.svg b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-9.svg new file mode 100644 index 0000000..4274471 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/main-9.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/merbivore-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/merbivore-1.png new file mode 100644 index 0000000..ccef122 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/merbivore-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/merbivore-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/merbivore-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/merbivore-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/merbivore_soft-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/merbivore_soft-1.png new file mode 100644 index 0000000..c821095 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/merbivore_soft-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/merbivore_soft-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/merbivore_soft-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/merbivore_soft-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/mono_industrial-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/mono_industrial-1.png new file mode 100644 index 0000000..1b91018 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/mono_industrial-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/mono_industrial-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/mono_industrial-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/mono_industrial-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/monokai-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/monokai-1.png new file mode 100644 index 0000000..81d56d6 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/monokai-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/monokai-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/monokai-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/monokai-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/one_dark-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/one_dark-1.png new file mode 100644 index 0000000..9a9435b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/one_dark-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/one_dark-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/one_dark-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/one_dark-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/pastel_on_dark-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/pastel_on_dark-1.png new file mode 100644 index 0000000..e5c0ca8 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/pastel_on_dark-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/pastel_on_dark-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/pastel_on_dark-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/pastel_on_dark-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/solarized_dark-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/solarized_dark-1.png new file mode 100644 index 0000000..8f8e034 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/solarized_dark-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/solarized_dark-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/solarized_dark-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/solarized_dark-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/solarized_light-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/solarized_light-1.png new file mode 100644 index 0000000..7a1a455 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/solarized_light-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/solarized_light-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/solarized_light-2.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/solarized_light-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/sqlserver-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/sqlserver-1.png new file mode 100644 index 0000000..b13132b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/sqlserver-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/sqlserver-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/sqlserver-2.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/sqlserver-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/terminal-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/terminal-1.png new file mode 100644 index 0000000..60c6f58 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/terminal-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/terminal-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/terminal-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/terminal-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/textmate-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/textmate-1.png new file mode 100644 index 0000000..b13132b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/textmate-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/textmate-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/textmate-2.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/textmate-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/theme/monokai.css b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/theme/monokai.css new file mode 100644 index 0000000..17d7435 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/theme/monokai.css @@ -0,0 +1,125 @@ +.ace-monokai .ace_gutter { + background: #2F3129; + color: #8F908A +} + +.ace-monokai .ace_print-margin { + width: 1px; + background: #555651 +} + +.ace-monokai { + background-color: #272822; + color: #F8F8F2 +} + +.ace-monokai .ace_cursor { + color: #F8F8F0 +} + +.ace-monokai .ace_marker-layer .ace_selection { + background: #49483E +} + +.ace-monokai.ace_multiselect .ace_selection.ace_start { + box-shadow: 0 0 3px 0px #272822; +} + +.ace-monokai .ace_marker-layer .ace_step { + background: rgb(102, 82, 0) +} + +.ace-monokai .ace_marker-layer .ace_bracket { + margin: -1px 0 0 -1px; + border: 1px solid #49483E +} + +.ace-monokai .ace_marker-layer .ace_active-line { + background: #202020 +} + +.ace-monokai .ace_gutter-active-line { + background-color: #272727 +} + +.ace-monokai .ace_marker-layer .ace_selected-word { + border: 1px solid #49483E +} + +.ace-monokai .ace_invisible { + color: #52524d +} + +.ace-monokai .ace_entity.ace_name.ace_tag, +.ace-monokai .ace_keyword, +.ace-monokai .ace_meta.ace_tag, +.ace-monokai .ace_storage { + color: #F92672 +} + +.ace-monokai .ace_punctuation, +.ace-monokai .ace_punctuation.ace_tag { + color: #fff +} + +.ace-monokai .ace_constant.ace_character, +.ace-monokai .ace_constant.ace_language, +.ace-monokai .ace_constant.ace_numeric, +.ace-monokai .ace_constant.ace_other { + color: #AE81FF +} + +.ace-monokai .ace_invalid { + color: #F8F8F0; + background-color: #F92672 +} + +.ace-monokai .ace_invalid.ace_deprecated { + color: #F8F8F0; + background-color: #AE81FF +} + +.ace-monokai .ace_support.ace_constant, +.ace-monokai .ace_support.ace_function { + color: #66D9EF +} + +.ace-monokai .ace_fold { + background-color: #A6E22E; + border-color: #F8F8F2 +} + +.ace-monokai .ace_storage.ace_type, +.ace-monokai .ace_support.ace_class, +.ace-monokai .ace_support.ace_type { + font-style: italic; + color: #66D9EF +} + +.ace-monokai .ace_entity.ace_name.ace_function, +.ace-monokai .ace_entity.ace_other, +.ace-monokai .ace_entity.ace_other.ace_attribute-name, +.ace-monokai .ace_variable { + color: #A6E22E +} + +.ace-monokai .ace_variable.ace_parameter { + font-style: italic; + color: #FD971F +} + +.ace-monokai .ace_string { + color: #E6DB74 +} + +.ace-monokai .ace_comment { + color: #75715E +} + +.ace-monokai .ace_indent-guide { + background: url("../monokai-1.png") right repeat-y +} + +.ace-monokai .ace_indent-guide-active { + background: url("../monokai-2.png") right repeat-y; +} diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/theme/twilight.css b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/theme/twilight.css new file mode 100644 index 0000000..a78993f --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/theme/twilight.css @@ -0,0 +1,130 @@ +.ace-twilight .ace_gutter { + background: #232323; + color: #E2E2E2 +} + +.ace-twilight .ace_print-margin { + width: 1px; + background: #232323 +} + +.ace-twilight { + background-color: #141414; + color: #F8F8F8 +} + +.ace-twilight .ace_cursor { + color: #A7A7A7 +} + +.ace-twilight .ace_marker-layer .ace_selection { + background: rgba(221, 240, 255, 0.20) +} + +.ace-twilight.ace_multiselect .ace_selection.ace_start { + box-shadow: 0 0 3px 0px #141414; +} + +.ace-twilight .ace_marker-layer .ace_step { + background: rgb(102, 82, 0) +} + +.ace-twilight .ace_marker-layer .ace_bracket { + margin: -1px 0 0 -1px; + border: 1px solid rgba(255, 255, 255, 0.25) +} + +.ace-twilight .ace_marker-layer .ace_active-line { + background: rgba(255, 255, 255, 0.031) +} + +.ace-twilight .ace_gutter-active-line { + background-color: rgba(255, 255, 255, 0.031) +} + +.ace-twilight .ace_marker-layer .ace_selected-word { + border: 1px solid rgba(221, 240, 255, 0.20) +} + +.ace-twilight .ace_invisible { + color: rgba(255, 255, 255, 0.25) +} + +.ace-twilight .ace_keyword, +.ace-twilight .ace_meta { + color: #CDA869 +} + +.ace-twilight .ace_constant, +.ace-twilight .ace_constant.ace_character, +.ace-twilight .ace_constant.ace_character.ace_escape, +.ace-twilight .ace_constant.ace_other, +.ace-twilight .ace_heading, +.ace-twilight .ace_markup.ace_heading, +.ace-twilight .ace_support.ace_constant { + color: #CF6A4C +} + +.ace-twilight .ace_invalid.ace_illegal { + color: #F8F8F8; + background-color: rgba(86, 45, 86, 0.75) +} + +.ace-twilight .ace_invalid.ace_deprecated { + text-decoration: underline; + font-style: italic; + color: #D2A8A1 +} + +.ace-twilight .ace_support { + color: #9B859D +} + +.ace-twilight .ace_fold { + background-color: #AC885B; + border-color: #F8F8F8 +} + +.ace-twilight .ace_support.ace_function { + color: #DAD085 +} + +.ace-twilight .ace_list, +.ace-twilight .ace_markup.ace_list, +.ace-twilight .ace_storage { + color: #F9EE98 +} + +.ace-twilight .ace_entity.ace_name.ace_function, +.ace-twilight .ace_meta.ace_tag { + color: #AC885B +} + +.ace-twilight .ace_string { + color: #8F9D6A +} + +.ace-twilight .ace_string.ace_regexp { + color: #E9C062 +} + +.ace-twilight .ace_comment { + font-style: italic; + color: #5F5A60 +} + +.ace-twilight .ace_variable { + color: #7587A6 +} + +.ace-twilight .ace_xml-pe { + color: #494949 +} + +.ace-twilight .ace_indent-guide { + background: url("../twilight-1.png") right repeat-y +} + +.ace-twilight .ace_indent-guide-active { + background: url("../twilight-2.png") right repeat-y; +} diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow-1.png new file mode 100644 index 0000000..b2ac8cb Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow-2.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night-1.png new file mode 100644 index 0000000..3e9f16c Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_blue-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_blue-1.png new file mode 100644 index 0000000..5788811 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_blue-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_blue-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_blue-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_blue-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_bright-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_bright-1.png new file mode 100644 index 0000000..644dfaf Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_bright-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_bright-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_bright-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_bright-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_eighties-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_eighties-1.png new file mode 100644 index 0000000..9a9435b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_eighties-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_eighties-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_eighties-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/tomorrow_night_eighties-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/twilight-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/twilight-1.png new file mode 100644 index 0000000..641f162 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/twilight-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/twilight-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/twilight-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/twilight-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/vibrant_ink-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/vibrant_ink-1.png new file mode 100644 index 0000000..805cfb8 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/vibrant_ink-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/vibrant_ink-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/vibrant_ink-2.png new file mode 100644 index 0000000..4ec9664 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/vibrant_ink-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/xcode-1.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/xcode-1.png new file mode 100644 index 0000000..b13132b Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/xcode-1.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/xcode-2.png b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/xcode-2.png new file mode 100644 index 0000000..2902ec7 Binary files /dev/null and b/SuperAPI/wwwroot/rezero/default_ui/js/ace/css/xcode-2.png differ diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/ace.js b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/ace.js new file mode 100644 index 0000000..a86244a --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/ace.js @@ -0,0 +1,23 @@ +(function(){function o(n){var i=e;n&&(e[n]||(e[n]={}),i=e[n]);if(!i.define||!i.define.packaged)t.original=i.define,i.define=t,i.define.packaged=!0;if(!i.require||!i.require.packaged)r.original=i.require,i.require=r,i.require.packaged=!0}var ACE_NAMESPACE="",e=function(){return this}();!e&&typeof window!="undefined"&&(e=window);if(!ACE_NAMESPACE&&typeof requirejs!="undefined")return;var t=function(e,n,r){if(typeof e!="string"){t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(r=n),t.modules[e]||(t.payloads[e]=r,t.modules[e]=null)};t.modules={},t.payloads={};var n=function(e,t,n){if(typeof t=="string"){var i=s(e,t);if(i!=undefined)return n&&n(),i}else if(Object.prototype.toString.call(t)==="[object Array]"){var o=[];for(var u=0,a=t.length;un.length)t=n.length;t-=e.length;var r=n.indexOf(e,t);return r!==-1&&r===t}),String.prototype.repeat||r(String.prototype,"repeat",function(e){var t="",n=this;while(e>0){e&1&&(t+=n);if(e>>=1)n+=n}return t}),String.prototype.includes||r(String.prototype,"includes",function(e,t){return this.indexOf(e,t)!=-1}),Object.assign||(Object.assign=function(e){if(e===undefined||e===null)throw new TypeError("Cannot convert undefined or null to object");var t=Object(e);for(var n=1;n>>0,r=arguments[1],i=r>>0,s=i<0?Math.max(n+i,0):Math.min(i,n),o=arguments[2],u=o===undefined?n:o>>0,a=u<0?Math.max(n+u,0):Math.min(u,n);while(s0){t&1&&(n+=e);if(t>>=1)e+=e}return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){var t=[];for(var n=0,r=e.length;n65535?2:1}}),define("ace/lib/useragent",["require","exports","module"],function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r=typeof navigator=="object"?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||["other"])[0].toLowerCase(),s=r.userAgent||"",o=r.appName||"";t.isWin=i=="win",t.isMac=i=="mac",t.isLinux=i=="linux",t.isIE=o=="Microsoft Internet Explorer"||o.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window["opera"])=="[object Opera]",t.isWebKit=parseFloat(s.split("WebKit/")[1])||undefined,t.isChrome=parseFloat(s.split(" Chrome/")[1])||undefined,t.isSafari=parseFloat(s.split(" Safari/")[1])&&!t.isChrome||undefined,t.isEdge=parseFloat(s.split(" Edge/")[1])||undefined,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isAndroid=s.indexOf("Android")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";function u(){var e=o;o=null,e&&e.forEach(function(e){a(e[0],e[1])})}function a(e,n,r){if(typeof document=="undefined")return;if(o)if(r)u();else if(r===!1)return o.push([e,n]);if(s)return;var i=r;if(!r||!r.getRootNode)i=document;else{i=r.getRootNode();if(!i||i==r)i=document}var a=i.ownerDocument||i;if(n&&t.hasCssString(n,i))return null;n&&(e+="\n/*# sourceURL=ace/css/"+n+" */");var f=t.createElement("style");f.appendChild(a.createTextNode(e)),n&&(f.id=n),i==a&&(i=t.getDocumentHead(a)),i.insertBefore(f,i.firstChild)}var r=e("./useragent"),i="http://www.w3.org/1999/xhtml";t.buildDom=function l(e,t,n){if(typeof e=="string"&&e){var r=document.createTextNode(e);return t&&t.appendChild(r),r}if(!Array.isArray(e))return e&&e.appendChild&&t&&t.appendChild(e),e;if(typeof e[0]!="string"||!e[0]){var i=[];for(var s=0;s=1.5:!0,r.isChromeOS&&(t.HI_DPI=!1);if(typeof document!="undefined"){var f=document.createElement("div");t.HI_DPI&&f.style.transform!==undefined&&(t.HAS_CSS_TRANSFORMS=!0),!r.isEdge&&typeof f.style.animationName!="undefined"&&(t.HAS_CSS_ANIMATION=!0),f=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./dom");t.get=function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onreadystatechange=function(){n.readyState===4&&t(n.responseText)},n.send(null)},t.loadScript=function(e,t){var n=r.getDocumentHead(),i=document.createElement("script");i.src=e,n.appendChild(i),i.onload=i.onreadystatechange=function(e,n){if(n||!i.readyState||i.readyState=="loaded"||i.readyState=="complete")i=i.onload=i.onreadystatechange=null,n||t()}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}}),define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),define("ace/lib/event_emitter",["require","exports","module"],function(e,t,n){"use strict";var r={},i=function(){this.propagationStopped=!0},s=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!n.length&&!r)return;if(typeof t!="object"||!t)t={};t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=i),t.preventDefault||(t.preventDefault=s),n=n.slice();for(var o=0;o1&&(i=n[n.length-2]);var o=u[t+"Path"];return o==null?o=u.basePath:r=="/"&&(t=r=""),o&&o.slice(-1)!="/"&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return u.$moduleUrls[e]=t};var a=function(t,n){if(t==="ace/theme/textmate"||t==="./theme/textmate")return n(null,e("./theme/textmate"));if(f)return f(t,n);console.error("loader is not configured")},f;t.setLoader=function(e){f=e},t.dynamicModules=Object.create(null),t.$loading={},t.$loaded={},t.loadModule=function(e,n){var r;if(Array.isArray(e))var s=e[0],o=e[1];else if(typeof e=="string")var o=e;var u=function(e){if(e&&!t.$loading[o])return n&&n(e);t.$loading[o]||(t.$loading[o]=[]),t.$loading[o].push(n);if(t.$loading[o].length>1)return;var r=function(){a(o,function(e,n){n&&(t.$loaded[o]=n),t._emit("load.module",{name:o,module:n});var r=t.$loading[o];t.$loading[o]=null,r.forEach(function(e){e&&e(n)})})};if(!t.get("packaged"))return r();i.loadScript(t.moduleUrl(o,s),r),l()};if(t.dynamicModules[o])t.dynamicModules[o]().then(function(e){e.default?u(e.default):u(e)});else{try{r=this.$require(o)}catch(f){}u(r||t.$loaded[o])}},t.$require=function(e){if(typeof n["require"]=="function"){var t="require";return n[t](e)}},t.setModuleLoader=function(e,n){t.dynamicModules[e]=n};var l=function(){!u.basePath&&!u.workerPath&&!u.modePath&&!u.themePath&&!Object.keys(u.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),l=function(){})};t.version="1.33.1"}),define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(e,t,n){"use strict";function s(t){if(!i||!i.document)return;r.set("packaged",t||e.packaged||n.packaged||i.define&&define.packaged);var s={},u="",a=document.currentScript||document._currentScript,f=a&&a.ownerDocument||document;a&&a.src&&(u=a.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");var l=f.getElementsByTagName("script");for(var c=0;c ["+this.end.row+"/"+this.end.column+"]"},e.prototype.contains=function(e,t){return this.compare(e,t)==0},e.prototype.compareRange=function(e){var t,n=e.end,r=e.start;return t=this.compare(n.row,n.column),t==1?(t=this.compare(r.row,r.column),t==1?2:t==0?1:0):t==-1?-2:(t=this.compare(r.row,r.column),t==-1?-1:t==1?42:0)},e.prototype.comparePoint=function(e){return this.compare(e.row,e.column)},e.prototype.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},e.prototype.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},e.prototype.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},e.prototype.isStart=function(e,t){return this.start.row==e&&this.start.column==t},e.prototype.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},e.prototype.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},e.prototype.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},e.prototype.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},e.prototype.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},e.prototype.compare=function(e,t){return!this.isMultiLine()&&e===this.start.row?tthis.end.column?1:0:ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0},e.prototype.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},e.prototype.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},e.prototype.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},e.prototype.clipRows=function(t,n){if(this.end.row>n)var r={row:n+1,column:0};else if(this.end.rown)var i={row:n+1,column:0};else if(this.start.row1?(u++,u>4&&(u=1)):u=1;if(i.isIE){var o=Math.abs(e.clientX-a)>5||Math.abs(e.clientY-f)>5;if(!l||o)u=1;l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),u==1&&(a=e.clientX,f=e.clientY)}e._clicks=u,r[s]("mousedown",e);if(u>4)u=0;else if(u>1)return r[s](h[u],e)}var u=0,a,f,l,h={2:"dblclick",3:"tripleclick",4:"quadclick"};Array.isArray(e)||(e=[e]),e.forEach(function(e){c(e,"mousedown",p,o)})},t.getModifierString=function(e){return r.KEY_MODS[p(e)]},t.addCommandKeyListener=function(e,n,r){var i=null;c(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=d(n,e,e.keyCode);return i=e.defaultPrevented,t},r),c(e,"keypress",function(e){i&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),i=null)},r),c(e,"keyup",function(e){s[e.keyCode]=null},r),s||(v(),c(window,"focus",v))};if(typeof window=="object"&&window.postMessage&&!i.isOldIE){var m=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+m++,i=function(s){s.data==r&&(t.stopPropagation(s),h(n,"message",i),e())};c(n,"message",i),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function r(){t.$idleBlocked?setTimeout(r,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),define("ace/clipboard",["require","exports","module"],function(e,t,n){"use strict";var r;n.exports={lineMode:!1,pasteCancelled:function(){return r&&r>Date.now()-50?!0:r=!1},cancel:function(){r=Date.now()}}}),define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../config").nls,s=e("../lib/useragent"),o=e("../lib/dom"),u=e("../lib/lang"),a=e("../clipboard"),f=s.isChrome<18,l=s.isIE,c=s.isChrome>63,h=400,p=e("../lib/keys"),d=p.KEY_MODS,v=s.isIOS,m=v?/\s/:/\n/,g=s.isMobile,y;y=function(e,t){function Q(){T=!0,n.blur(),n.focus(),T=!1}function Y(e){e.keyCode==27&&n.value.lengthk&&N[s]=="\n")o=p.end;else if(rk&&N.slice(0,s).split("\n").length>2)o=p.down;else if(s>k&&N[s-1]==" ")o=p.right,u=d.option;else if(s>k||s==k&&k!=C&&r==s)o=p.right;r!==s&&(u|=d.shift);if(o){var a=t.onCommandKey({},u,o);if(!a&&t.commands){o=p.keyCodeToString(o);var f=t.commands.findKeyCommand(u,o);f&&t.execCommand(f)}C=r,k=s,H("")}};document.addEventListener("selectionchange",s),t.on("destroy",function(){document.removeEventListener("selectionchange",s)})}var n=o.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck","false"),n.style.opacity="0",e.insertBefore(n,e.firstChild);var y=!1,b=!1,w=!1,E=!1,S="";g||(n.style.fontSize="1px");var x=!1,T=!1,N="",C=0,k=0,L=0,A=Number.MAX_SAFE_INTEGER,O=Number.MIN_SAFE_INTEGER,M=0;try{var _=document.activeElement===n}catch(D){}this.setNumberOfExtraLines=function(e){A=Number.MAX_SAFE_INTEGER,O=Number.MIN_SAFE_INTEGER;if(e<0){M=0;return}M=e},this.setAriaOptions=function(e){e.activeDescendant?(n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-autocomplete",e.inline?"both":"list"),n.setAttribute("aria-activedescendant",e.activeDescendant)):(n.setAttribute("aria-haspopup","false"),n.setAttribute("aria-autocomplete","both"),n.removeAttribute("aria-activedescendant")),e.role&&n.setAttribute("role",e.role);if(e.setLabel){n.setAttribute("aria-roledescription",i("text-input.aria-roledescription","editor"));if(t.session){var r=t.session.selection.cursor.row;n.setAttribute("aria-label",i("text-input.aria-label","Cursor at row $0",[r+1]))}}},this.setAriaOptions({role:"textbox"}),r.addListener(n,"blur",function(e){if(T)return;t.onBlur(e),_=!1},t),r.addListener(n,"focus",function(e){if(T)return;_=!0;if(s.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),s.isEdge?setTimeout(H):H()},t),this.$focusScroll=!1,this.focus=function(){this.setAriaOptions({setLabel:t.renderer.enableKeyboardAccessibility});if(S||c||this.$focusScroll=="browser")return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var r=n.getBoundingClientRect().top!=0}catch(i){return}var s=[];if(r){var o=n.parentElement;while(o&&o.nodeType==1)s.push(o),o.setAttribute("ace_nocontext","true"),!o.parentElement&&o.getRootNode?o=o.getRootNode().host:o=o.parentElement}n.focus({preventScroll:!0}),r&&s.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="",n.style.top=="0px"&&(n.style.top=e)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return _},t.on("beforeEndOperation",function(){var e=t.curOp,r=e&&e.command&&e.command.name;if(r=="insertstring")return;var i=r&&(e.docChanged||e.selectionChanged);w&&i&&(N=n.value="",K()),H()});var P=function(e,n){var r=n;for(var i=1;i<=e-A&&i<2*M+1;i++)r+=t.session.getLine(e-i).length+1;return r},H=v?function(e){if(!_||y&&!e||E)return;e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=N=r);var i=4,s=4+(e.length||(t.selection.isEmpty()?0:1));(C!=i||k!=s)&&n.setSelectionRange(i,s),C=i,k=s}:function(){if(w||E)return;if(!_&&!I)return;w=!0;var e=0,r=0,i="";if(t.session){var s=t.selection,o=s.getRange(),u=s.cursor.row;if(u===O+1)A=O+1,O=A+2*M;else if(u===A-1)O=A-1,A=O-2*M;else if(uO+1)A=u>M?u-M:0,O=u>M?u+M:2*M;var a=[];for(var f=A;f<=O;f++)a.push(t.session.getLine(f));i=a.join("\n"),e=P(o.start.row,o.start.column),r=P(o.end.row,o.end.column);if(o.start.rowO){var c=t.session.getLine(O+1);r=o.end.row>O+1?c.length:o.end.column,r+=i.length+1,i=i+"\n"+c}else g&&u>0&&(i="\n"+i,r+=1,e+=1);i.length>h&&(e=N.length&&e.value===N&&N&&e.selectionEnd!==k},j=function(e){if(w)return;y?y=!1:B(n)?(t.selectAll(),H()):g&&n.selectionStart!=C&&H()},F=null;this.setInputHandler=function(e){F=e},this.getInputHandler=function(){return F};var I=!1,q=function(e,r){I&&(I=!1);if(b)return H(),e&&t.onPaste(e),b=!1,"";var i=n.selectionStart,o=n.selectionEnd,u=C,a=N.length-k,f=e,l=e.length-i,c=e.length-o,h=0;while(u>0&&N[h]==e[h])h++,u--;f=f.slice(h),h=1;while(a>0&&N.length-h>C-1&&N[N.length-h]==e[e.length-h])h++,a--;l-=h-1,c-=h-1;var p=f.length-h+1;p<0&&(u=-p,p=0),f=f.slice(0,p);if(!r&&!f&&!l&&!u&&!a&&!c)return"";E=!0;var d=!1;return s.isAndroid&&f==". "&&(f=" ",d=!0),f&&!u&&!a&&!l&&!c||x?t.onTextInput(f):t.onTextInput(f,{extendLeft:u,extendRight:a,restoreStart:l,restoreEnd:c}),E=!1,N=e,C=i,k=o,L=c,d?"\n":f},R=function(e){if(w)return J();if(e&&e.inputType){if(e.inputType=="historyUndo")return t.execCommand("undo");if(e.inputType=="historyRedo")return t.execCommand("redo")}var r=n.value,i=q(r,!0);(r.length>h+100||m.test(i)||g&&C<1&&C==k)&&H()},U=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(!r||f)return;var i=l||n?"Text":"text/plain";try{return t?r.setData(i,t)!==!1:r.getData(i)}catch(e){if(!n)return U(e,t,!0)}},z=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);U(e,s)?(v&&(H(s),y=s,setTimeout(function(){y=!1},10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(y=!0,n.value=s,n.select(),setTimeout(function(){y=!1,H(),i?t.onCut():t.onCopy()}))},W=function(e){z(e,!0)},X=function(e){z(e,!1)},V=function(e){var i=U(e);if(a.pasteCancelled())return;typeof i=="string"?(i&&t.onPaste(i,e),s.isIE&&setTimeout(H),r.preventDefault(e)):(n.value="",b=!0)};r.addCommandKeyListener(n,function(e,n,r){if(w)return;return t.onCommandKey(e,n,r)},t),r.addListener(n,"select",j,t),r.addListener(n,"input",R,t),r.addListener(n,"cut",W,t),r.addListener(n,"copy",X,t),r.addListener(n,"paste",V,t),(!("oncut"in n)||!("oncopy"in n)||!("onpaste"in n))&&r.addListener(e,"keydown",function(e){if(s.isMac&&!e.metaKey||!e.ctrlKey)return;switch(e.keyCode){case 67:X(e);break;case 86:V(e);break;case 88:W(e)}},t);var $=function(e){if(w||!t.onCompositionStart||t.$readOnly)return;w={};if(x)return;e.data&&(w.useTextareaForIME=!1),setTimeout(J,0),t._signal("compositionStart"),t.on("mousedown",Q);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,w.markerRange=r,w.selectionStart=C,t.onCompositionStart(w),w.useTextareaForIME?(N=n.value="",C=0,k=0):(n.msGetInputContext&&(w.context=n.msGetInputContext()),n.getInputContext&&(w.context=n.getInputContext()))},J=function(){if(!w||!t.onCompositionUpdate||t.$readOnly)return;if(x)return Q();if(w.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;q(e),w.markerRange&&(w.context&&(w.markerRange.start.column=w.selectionStart=w.context.compositionStartOffset),w.markerRange.end.column=w.markerRange.start.column+k-w.selectionStart+L)}},K=function(e){if(!t.onCompositionEnd||t.$readOnly)return;w=!1,t.onCompositionEnd(),t.off("mousedown",Q),e&&R()},G=u.delayedCall(J,50).schedule.bind(null,null);r.addListener(n,"compositionstart",$,t),r.addListener(n,"compositionupdate",J,t),r.addListener(n,"keyup",Y,t),r.addListener(n,"keydown",G,t),r.addListener(n,"compositionend",K,t),this.getElement=function(){return n},this.setCommandMode=function(e){x=e,n.readOnly=!1},this.setReadOnly=function(e){x||(n.readOnly=e)},this.setCopyWithEmptySelection=function(e){},this.onContextMenu=function(e){I=!0,H(),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,i){S||(S=n.style.cssText),n.style.cssText=(i?"z-index:100000;":"")+(s.isIE?"opacity:0.1;":"")+"text-indent: -"+(C+k)*t.renderer.characterWidth*.5+"px;";var u=t.container.getBoundingClientRect(),a=o.computedStyle(t.container),f=u.top+(parseInt(a.borderTopWidth)||0),l=u.left+(parseInt(u.borderLeftWidth)||0),c=u.bottom-f-n.clientHeight-2,h=function(e){o.translate(n,e.clientX-l-2,Math.min(e.clientY-f-2,c))};h(e);if(e.type!="mousedown")return;t.renderer.$isMousePressed=!0,clearTimeout(Z),s.isWin&&r.capture(t.container,h,et)},this.onContextMenuClose=et;var Z,tt=function(e){t.textInput.onContextMenu(e),et()};r.addListener(n,"mouseup",tt,t),r.addListener(n,"mousedown",function(e){e.preventDefault(),et()},t),r.addListener(t.renderer.scroller,"contextmenu",tt,t),r.addListener(n,"contextmenu",tt,t),v&&nt(e,t,n),this.destroy=function(){n.parentElement&&n.parentElement.removeChild(n)}},t.TextInput=y,t.$setUserAgentForTests=function(e,t){g=e,v=t}}),define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";function u(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}function a(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row==e.end.row-1&&!e.start.column&&!e.end.column)var n=t.column-4;else var n=2*t.row-e.start.row-e.end.row;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var r=e("../lib/useragent"),i=0,s=550,o=function(){function e(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e));var n=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];n.forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}return e.prototype.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();if(s!==0){var o=i.getSelectionRange(),u=o.isEmpty();(u||s==1)&&i.selection.moveToPosition(n),s==2&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault());return}this.mousedownEvent.time=Date.now();if(t&&!i.isFocused()){i.focus();if(this.$focusTimeout&&!this.$clickSelection&&!i.inMultiSelectMode){this.setState("focusWait"),this.captureMouse(e);return}}return this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()},e.prototype.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;if(!this.mousedownEvent)return;this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.setStyle("ace_selecting"),this.setState("select")},e.prototype.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(r==-1)e=this.$clickSelection.end;else if(r==1)e=this.$clickSelection.start;else{var i=a(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},e.prototype.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var s=this.$clickSelection.comparePoint(i.start),o=this.$clickSelection.comparePoint(i.end);if(s==-1&&o<=0){t=this.$clickSelection.end;if(i.end.row!=r.row||i.end.column!=r.column)r=i.start}else if(o==1&&s>=0){t=this.$clickSelection.start;if(i.start.row!=r.row||i.start.column!=r.column)r=i.end}else if(s==-1&&o==1)r=i.end,t=i.start;else{var u=a(this.$clickSelection,r);r=u.cursor,t=u.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},e.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},e.prototype.focusWait=function(){var e=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(e>i||t-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},e.prototype.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session,i=r.getBracketRange(t);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},e.prototype.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},e.prototype.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},e.prototype.onMouseWheel=function(e){if(e.getAccelKey())return;e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,o=i?e.wheelX/i:n.vx,u=i?e.wheelY/i:n.vy;i=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(f=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(f=!0);if(f)n.allowed=r;else if(r-n.allowedn.clientHeight;r||t.preventDefault()}}),define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=e("./lib/dom"),o=e("./lib/event"),u=e("./range").Range,a=e("./lib/scroll").preventParentScroll,f="ace_tooltip",l=function(){function e(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}return e.prototype.$init=function(){return this.$element=s.createElement("div"),this.$element.className=f,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},e.prototype.getElement=function(){return this.$element||this.$init()},e.prototype.setText=function(e){this.getElement().textContent=e},e.prototype.setHtml=function(e){this.getElement().innerHTML=e},e.prototype.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},e.prototype.setClassName=function(e){s.addCssClass(this.getElement(),e)},e.prototype.setTheme=function(e){this.$element.className=f+" "+(e.isDark?"ace_dark ":"")+(e.cssClass||"")},e.prototype.show=function(e,t,n){e!=null&&this.setText(e),t!=null&&n!=null&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},e.prototype.hide=function(e){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=f,this.isOpen=!1)},e.prototype.getHeight=function(){return this.getElement().offsetHeight},e.prototype.getWidth=function(){return this.getElement().offsetWidth},e.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},e}(),c=function(){function e(){this.popups=[]}return e.prototype.addPopup=function(e){this.popups.push(e),this.updatePopups()},e.prototype.removePopup=function(e){var t=this.popups.indexOf(e);t!==-1&&(this.popups.splice(t,1),this.updatePopups())},e.prototype.updatePopups=function(){var e,t,n,r;this.popups.sort(function(e,t){return t.priority-e.priority});var s=[];try{for(var o=i(this.popups),u=o.next();!u.done;u=o.next()){var a=u.value,f=!0;try{for(var l=(n=void 0,i(s)),c=l.next();!c.done;c=l.next()){var h=c.value;if(this.doPopupsOverlap(h,a)){f=!1;break}}}catch(p){n={error:p}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}f?s.push(a):a.hide()}}catch(d){e={error:d}}finally{try{u&&!u.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}},e.prototype.doPopupsOverlap=function(e,t){var n=e.getElement().getBoundingClientRect(),r=t.getElement().getBoundingClientRect();return n.leftr.left&&n.topr.top},e}(),h=new c;t.popupManager=h,t.Tooltip=l;var p=function(e){function t(t){t===void 0&&(t=document.body);var n=e.call(this,t)||this;n.timeout=undefined,n.lastT=0,n.idleTime=350,n.lastEvent=undefined,n.onMouseOut=n.onMouseOut.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.waitForHover=n.waitForHover.bind(n),n.hide=n.hide.bind(n);var r=n.getElement();return r.style.whiteSpace="pre-wrap",r.style.pointerEvents="auto",r.addEventListener("mouseout",n.onMouseOut),r.tabIndex=-1,r.addEventListener("blur",function(){r.contains(document.activeElement)||this.hide()}.bind(n)),r.addEventListener("wheel",a),n}return r(t,e),t.prototype.addToEditor=function(e){e.on("mousemove",this.onMouseMove),e.on("mousedown",this.hide),e.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},t.prototype.removeFromEditor=function(e){e.off("mousemove",this.onMouseMove),e.off("mousedown",this.hide),e.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},t.prototype.onMouseMove=function(e,t){this.lastEvent=e,this.lastT=Date.now();var n=t.$mouseHandler.isMousePressed;if(this.isOpen){var r=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(r.row,r.column)||n||this.isOutsideOfText(this.lastEvent))&&this.hide()}if(this.timeout||n)return;this.lastEvent=e,this.timeout=setTimeout(this.waitForHover,this.idleTime)},t.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var e=Date.now()-this.lastT;if(this.idleTime-e>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-e);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},t.prototype.isOutsideOfText=function(e){var t=e.editor,n=e.getDocumentPosition(),r=t.session.getLine(n.row);if(n.column==r.length){var i=t.renderer.pixelToScreenCoordinates(e.clientX,e.clientY),s=t.session.documentToScreenPosition(n.row,n.column);if(s.column!=i.column||s.row!=i.row)return!0}return!1},t.prototype.setDataProvider=function(e){this.$gatherData=e},t.prototype.showForRange=function(e,t,n,r){var i=10;if(r&&r!=this.lastEvent)return;if(this.isOpen&&document.activeElement==this.getElement())return;var s=e.renderer;this.isOpen||(h.addPopup(this),this.$registerCloseEvents(),this.setTheme(s.theme)),this.isOpen=!0,this.addMarker(t,e.session),this.range=u.fromPoints(t.start,t.end);var o=s.textToScreenCoordinates(t.start.row,t.start.column),a=s.scroller.getBoundingClientRect();o.pageXt.session.documentToScreenRow(a.row,a.column))return f()}r.showTooltip(i);if(!r.isOpen)return;t.on("mousewheel",f);if(e.$tooltipFollowsMouse)c(u);else{var l=u.getGutterRow(),h=n.$lines.get(l);if(h){var p=h.element.querySelector(".ace_gutter_annotation"),d=p.getBoundingClientRect(),v=r.getElement().style;v.left=d.right+"px",v.top=d.bottom+"px"}else c(u)}}function f(){i&&(i=clearTimeout(i)),r.isOpen&&(r.hideTooltip(),t.off("mousewheel",f))}function c(e){r.setPosition(e.x,e.y)}var t=e.editor,n=t.renderer.$gutterLayer,r=new l(t);e.editor.setDefaultHandler("guttermousedown",function(r){if(!t.isFocused()||r.getButton()!=0)return;var i=n.getRegion(r);if(i=="foldWidgets")return;var s=r.getDocumentPosition().row,o=t.session.selection;if(r.getShiftKey())o.selectTo(s,0);else{if(r.domEvent.detail==2)return t.selectAll(),r.preventDefault();e.$clickSelection=t.selection.getLineRange(s)}return e.setState("selectByLines"),e.captureMouse(r),r.preventDefault()});var i,u;e.editor.setDefaultHandler("guttermousemove",function(t){var n=t.domEvent.target||t.domEvent.srcElement;if(s.hasCssClass(n,"ace_fold-widget"))return f();r.isOpen&&e.$tooltipFollowsMouse&&c(t),u=t;if(i)return;i=setTimeout(function(){i=null,u&&!e.isMousePressed?a():f()},50)}),o.addListener(t.renderer.$gutter,"mouseout",function(e){u=null;if(!r.isOpen||i)return;i=setTimeout(function(){i=null,f()},50)},t),t.on("changeSession",f),t.on("input",f)}var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=e("../lib/dom"),o=e("../lib/event"),u=e("../tooltip").Tooltip,a=e("../config").nls;t.GutterHandler=f;var l=function(e){function t(t){var n=e.call(this,t.container)||this;return n.editor=t,n}return r(t,e),t.prototype.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();e+=15,t+=15,e+i>n&&(e-=e+i-n),t+s>r&&(t-=20+s),u.prototype.setPosition.call(this,e,t)},Object.defineProperty(t,"annotationLabels",{get:function(){return{error:{singular:a("gutter-tooltip.aria-label.error.singular","error"),plural:a("gutter-tooltip.aria-label.error.plural","errors")},warning:{singular:a("gutter-tooltip.aria-label.warning.singular","warning"),plural:a("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:a("gutter-tooltip.aria-label.info.singular","information message"),plural:a("gutter-tooltip.aria-label.info.plural","information messages")}}},enumerable:!1,configurable:!0}),t.prototype.showTooltip=function(e){var n=this.editor.renderer.$gutterLayer,r=n.$annotations[e],i;r?i={text:Array.from(r.text),type:Array.from(r.type)}:i={text:[],type:[]};var s=n.session.getFoldLine(e);if(s&&n.$showFoldedAnnotations){var o={error:[],warning:[],info:[]},u;for(var a=e+1;a<=s.end.row;a++){if(!n.$annotations[a])continue;for(var f=0;f ").concat(i.text[a]);h[i.type[a].replace("_fold","")].push(d)}var v=[].concat(h.error,h.warning,h.info).join("
    ");this.setHtml(v),this.$element.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.editor._signal("showGutterTooltip",this)},t.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live"),this.hide(),this.editor._signal("hideGutterTooltip",this)},t.annotationsToSummaryString=function(e){var n,r,s=[],o=["error","warning","info"];try{for(var u=i(o),a=u.next();!a.done;a=u.next()){var f=a.value;if(!e[f].length)continue;var l=e[f].length===1?t.annotationLabels[f].singular:t.annotationLabels[f].plural;s.push("".concat(e[f].length," ").concat(l))}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return s.join(", ")},t}(u);t.GutterTooltip=l}),define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=function(){function e(e,t){this.speed,this.wheelX,this.wheelY,this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return e.prototype.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},e.prototype.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},e.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},e.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},e.prototype.getGutterRow=function(){var e=this.getDocumentPosition().row,t=this.editor.session.documentToScreenRow(e,0),n=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return t-n},e.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var e=this.editor,t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var n=this.getDocumentPosition();this.$inSelection=t.contains(n.row,n.column)}return this.$inSelection},e.prototype.getButton=function(){return r.getButton(this.domEvent)},e.prototype.getShiftKey=function(){return this.domEvent.shiftKey},e.prototype.getAccelKey=function(){return i.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},e}();t.MouseEvent=s}),define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";function f(e){function T(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;if(!S||i||s)t.moveCursorToPosition(e),S=r,x={x:p,y:d};else{var o=l(x.x,x.y,p,d);o>a?S=null:r-S>=u&&(t.renderer.scrollCursorIntoView(),S=null)}}function N(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,u=t.renderer.scroller.getBoundingClientRect(),a={x:{left:p-u.left,right:u.right-p},y:{top:d-u.top,bottom:u.bottom-d}},f=Math.min(a.x.left,a.x.right),l=Math.min(a.y.top,a.y.bottom),c={row:e.row,column:e.column};f/s<=2&&(c.column+=a.x.left=o&&t.renderer.scrollCursorIntoView(c):E=r:E=null}function C(){var e=g;g=t.renderer.screenToTextCoordinates(p,d),T(g,e),N(g,e)}function k(){m=t.selection.toOrientedRange(),h=t.session.addMarker(m,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(v),C(),v=setInterval(C,20),y=0,i.addListener(document,"mousemove",O)}function L(){clearInterval(v),t.session.removeMarker(h),h=null,t.selection.fromOrientedRange(m),t.isFocused()&&!w&&t.$resetCursorStyle(),m=null,g=null,y=0,E=null,S=null,i.removeListener(document,"mousemove",O)}function O(){A==null&&(A=setTimeout(function(){A!=null&&h&&L()},20))}function M(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return e=="text/plain"||e=="Text"})}function _(e){var t=["copy","copymove","all","uninitialized"],n=["move","copymove","linkmove","all","uninitialized"],r=s.isMac?e.altKey:e.ctrlKey,i="uninitialized";try{i=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var o="none";return r&&t.indexOf(i)>=0?o="copy":n.indexOf(i)>=0?o="move":t.indexOf(i)>=0&&(o="copy"),o}var t=e.editor,n=r.createElement("div");n.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",n.textContent="\u00a0";var f=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];f.forEach(function(t){e[t]=this[t]},this),t.on("mousedown",this.onMouseDown.bind(e));var c=t.container,h,p,d,v,m,g,y=0,b,w,E,S,x;this.onDragStart=function(e){if(this.cancelDrag||!c.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}m=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",t.container.appendChild(n),i.setDragImage&&i.setDragImage(n,0,0),setTimeout(function(){t.container.removeChild(n)}),i.clearData(),i.setData("Text",t.session.getTextRange()),w=!0,this.setState("drag")},this.onDragEnd=function(e){c.draggable=!1,w=!1,this.setState(null);if(!t.getReadOnly()){var n=e.dataTransfer.dropEffect;!b&&n=="move"&&t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(t.getReadOnly()||!M(e.dataTransfer))return;return p=e.clientX,d=e.clientY,h||k(),y++,e.dataTransfer.dropEffect=b=_(e),i.preventDefault(e)},this.onDragOver=function(e){if(t.getReadOnly()||!M(e.dataTransfer))return;return p=e.clientX,d=e.clientY,h||(k(),y++),A!==null&&(A=null),e.dataTransfer.dropEffect=b=_(e),i.preventDefault(e)},this.onDragLeave=function(e){y--;if(y<=0&&h)return L(),b=null,i.preventDefault(e)},this.onDrop=function(e){if(!g)return;var n=e.dataTransfer;if(w)switch(b){case"move":m.contains(g.row,g.column)?m={start:g,end:g}:m=t.moveText(m,g);break;case"copy":m=t.moveText(m,g,!0)}else{var r=n.getData("Text");m={start:g,end:t.session.insert(g,r)},t.focus(),b=null}return L(),i.preventDefault(e)},i.addListener(c,"dragstart",this.onDragStart.bind(e),t),i.addListener(c,"dragend",this.onDragEnd.bind(e),t),i.addListener(c,"dragenter",this.onDragEnter.bind(e),t),i.addListener(c,"dragover",this.onDragOver.bind(e),t),i.addListener(c,"dragleave",this.onDragLeave.bind(e),t),i.addListener(c,"drop",this.onDrop.bind(e),t);var A=null}function l(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent"),o=200,u=200,a=5;(function(){this.dragWait=function(){var e=Date.now()-this.mousedownEvent.time;e>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var e=this.editor.container;e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor,t=e.container;t.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var n=s.isWin?"default":"move";e.renderer.setCursorStyle(n),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;if(s.isIE&&this.state=="dragReady"){var n=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>3&&t.dragDrop()}if(this.state==="dragWait"){var n=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(!this.$dragEnabled)return;this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton(),i=e.domEvent.detail||1;if(i===1&&r===0&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var o=e.domEvent.target||e.domEvent.srcElement;"unselectable"in o&&(o.unselectable="on");if(t.getDragDelay()){if(s.isWebKit){this.cancelDrag=!0;var u=t.container;u.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}).call(f.prototype),t.DragdropHandler=f}),define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./mouse_event").MouseEvent,i=e("../lib/event"),s=e("../lib/dom");t.addTouchListeners=function(e,t){function b(){var e=window.navigator&&window.navigator.clipboard,r=!1,i=function(){var n=t.getCopyText(),i=t.session.getUndoManager().hasUndo();y.replaceChild(s.buildDom(r?["span",!n&&["span",{"class":"ace_mobile-button",action:"selectall"},"Select All"],n&&["span",{"class":"ace_mobile-button",action:"copy"},"Copy"],n&&["span",{"class":"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{"class":"ace_mobile-button",action:"paste"},"Paste"],i&&["span",{"class":"ace_mobile-button",action:"undo"},"Undo"],["span",{"class":"ace_mobile-button",action:"find"},"Find"],["span",{"class":"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),y.firstChild)},o=function(n){var s=n.target.getAttribute("action");if(s=="more"||!r)return r=!r,i();if(s=="paste")e.readText().then(function(e){t.execCommand(s,e)});else if(s){if(s=="cut"||s=="copy")e?e.writeText(t.getCopyText()):document.execCommand("copy");t.execCommand(s)}y.firstChild.style.display="none",r=!1,s!="openCommandPalette"&&t.focus()};y=s.buildDom(["div",{"class":"ace_mobile-menu",ontouchstart:function(e){n="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),o(e)},onclick:o},["span"],["span",{"class":"ace_mobile-button",action:"more"},"..."]],t.container)}function w(){y||b();var e=t.selection.cursor,n=t.renderer.textToScreenCoordinates(e.row,e.column),r=t.renderer.textToScreenCoordinates(0,0).pageX,i=t.renderer.scrollLeft,s=t.container.getBoundingClientRect();y.style.top=n.pageY-s.top-3+"px",n.pageX-s.left=2?t.selection.getLineRange(p.row):t.session.getBracketRange(p);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),n="wait"}function T(){h+=60,c=setInterval(function(){h--<=0&&(clearInterval(c),c=null),Math.abs(v)<.01&&(v=0),Math.abs(m)<.01&&(m=0),h<20&&(v=.9*v),h<20&&(m=.9*m);var e=t.session.getScrollTop();t.renderer.scrollBy(10*v,10*m),e==t.session.getScrollTop()&&(h=0)},10)}var n="scroll",o,u,a,f,l,c,h=0,p,d=0,v=0,m=0,g,y;i.addListener(e,"contextmenu",function(e){if(!g)return;var n=t.textInput.getElement();n.focus()},t),i.addListener(e,"touchstart",function(e){var i=e.touches;if(l||i.length>1){clearTimeout(l),l=null,a=-1,n="zoom";return}g=t.$mouseHandler.isMousePressed=!0;var s=t.renderer.layerConfig.lineHeight,c=t.renderer.layerConfig.lineHeight,y=e.timeStamp;f=y;var b=i[0],w=b.clientX,E=b.clientY;Math.abs(o-w)+Math.abs(u-E)>s&&(a=-1),o=e.clientX=w,u=e.clientY=E,v=m=0;var T=new r(e,t);p=T.getDocumentPosition();if(y-a<500&&i.length==1&&!h)d++,e.preventDefault(),e.button=0,x();else{d=0;var N=t.selection.cursor,C=t.selection.isEmpty()?N:t.selection.anchor,k=t.renderer.$cursorLayer.getPixelPosition(N,!0),L=t.renderer.$cursorLayer.getPixelPosition(C,!0),A=t.renderer.scroller.getBoundingClientRect(),O=t.renderer.layerConfig.offset,M=t.renderer.scrollLeft,_=function(e,t){return e/=c,t=t/s-.75,e*e+t*t};if(e.clientXP?"cursor":"anchor"),P<3.5?n="anchor":D<3.5?n="cursor":n="scroll",l=setTimeout(S,450)}a=y},t),i.addListener(e,"touchend",function(e){g=t.$mouseHandler.isMousePressed=!1,c&&clearInterval(c),n=="zoom"?(n="",h=0):l?(t.selection.moveToPosition(p),h=0,w()):n=="scroll"?(T(),E()):w(),clearTimeout(l),l=null},t),i.addListener(e,"touchmove",function(e){l&&(clearTimeout(l),l=null);var i=e.touches;if(i.length>1||n=="zoom")return;var s=i[0],a=o-s.clientX,c=u-s.clientY;if(n=="wait"){if(!(a*a+c*c>4))return e.preventDefault();n="cursor"}o=s.clientX,u=s.clientY,e.clientX=s.clientX,e.clientY=s.clientY;var h=e.timeStamp,p=h-f;f=h;if(n=="scroll"){var d=new r(e,t);d.speed=1,d.wheelX=a,d.wheelY=c,10*Math.abs(a)0)if(g==16){for(w=b;w-1){for(w=b;w=0;C--){if(r[C]!=N)break;t[C]=s}}}function I(e,t,n){if(o=e){u=i+1;while(u=e)u++;for(a=i,l=u-1;a=t.length||(o=n[r-1])!=b&&o!=w||(c=t[r+1])!=b&&c!=w)return E;return u&&(c=w),c==o?c:E;case k:o=r>0?n[r-1]:S;if(o==b&&r+10&&n[r-1]==b)return b;if(u)return E;p=r+1,h=t.length;while(p=1425&&d<=2303||d==64286;o=t[p];if(v&&(o==y||o==T))return y}if(r<1||(o=t[r-1])==S)return E;return n[r-1];case S:return u=!1,f=!0,s;case x:return l=!0,E;case O:case M:case D:case P:case _:u=!1;case H:return E}}function R(e){var t=e.charCodeAt(0),n=t>>8;return n==0?t>191?g:B[t]:n==5?/[\u0591-\u05f4]/.test(e)?y:g:n==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?A:/[\u0660-\u0669\u066b-\u066c]/.test(e)?w:t==1642?L:/[\u06f0-\u06f9]/.test(e)?b:T:n==32&&t<=8287?j[t&255]:n==254?t>=65136?T:E:E}function U(e){return e>="\u064b"&&e<="\u0655"}var r=["\u0621","\u0641"],i=["\u063a","\u064a"],s=0,o=0,u=!1,a=!1,f=!1,l=!1,c=!1,h=!1,p=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],d=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],v=0,m=1,g=0,y=1,b=2,w=3,E=4,S=5,x=6,T=7,N=8,C=9,k=10,L=11,A=12,O=13,M=14,_=15,D=16,P=17,H=18,B=[H,H,H,H,H,H,H,H,H,x,S,x,N,S,H,H,H,H,H,H,H,H,H,H,H,H,H,H,S,S,S,x,N,E,E,L,L,L,E,E,E,E,E,k,C,k,C,C,b,b,b,b,b,b,b,b,b,b,C,E,E,E,E,E,E,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,E,E,E,E,E,E,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,E,E,E,E,H,H,H,H,H,H,S,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,C,E,L,L,L,L,E,E,E,E,g,E,E,H,E,E,L,L,b,b,E,g,E,E,E,b,g,E,E,E,E,E],j=[N,N,N,N,N,N,N,N,N,N,N,H,H,H,g,y,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,N,S,O,M,_,D,P,C,L,L,L,L,L,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,C,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,N];t.L=g,t.R=y,t.EN=b,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="\u00b7",t.doBidiReorder=function(e,n,r){if(e.length<2)return{};var i=e.split(""),o=new Array(i.length),u=new Array(i.length),a=[];s=r?m:v,F(i,a,i.length,n);for(var f=0;fT&&n[f]0&&i[f-1]==="\u0644"&&/\u0622|\u0623|\u0625|\u0627/.test(i[f])&&(a[f-1]=a[f]=t.R_H,f++);i[i.length-1]===t.DOT&&(a[i.length-1]=t.B),i[0]==="\u202b"&&(a[0]=t.RLE);for(var f=0;f=0&&(e=this.session.$docRowCache[n])}return e},e.prototype.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length){var n,r=this.session.$getRowCacheIndex(t,this.currentRow);while(this.currentRow-e>0){n=this.session.$getRowCacheIndex(t,this.currentRow-e-1);if(n!==r)break;r=n,e++}}else e=this.currentRow;return e},e.prototype.updateRowLine=function(e,t){e===undefined&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1,s=n?this.EOF:this.EOL;this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE;if(this.session.$useWrapMode){var o=this.session.$wrapData[e];o&&(t===undefined&&(t=this.getSplitIndex()),t>0&&o.length?(this.wrapIndent=o.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&s[i]%2!==0&&i++;for(var u=0;ut&&s[i]%2===0&&(o+=this.charWidths[s[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},e.prototype.getSelections=function(e,t){var n=this.bidiMap,r=n.bidiLevels,i,s=[],o=0,u=Math.min(e,t)-this.wrapIndent,a=Math.max(e,t)-this.wrapIndent,f=!1,l=!1,c=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var h,p=0;p=u&&hn+s/2){n+=s;if(r===i.length-1){s=0;break}s=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!==0&&i[r]%2===0?(e0&&i[r-1]%2===0&&i[r]%2!==0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&s===0&&i[r-1]%2===0||!this.isRtlDir&&r===0&&i[r]%2!==0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!==0&&s!==0&&r--,t=this.bidiMap.logicalFromVisual[r]),t===0&&this.isRtlDir&&t++,t+this.wrapIndent},e}();t.BidiHandler=o}),define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,u=function(){function e(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),!t.$isEmpty&&!t.$silent&&t._emit("changeSelection"),!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column&&(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,!t.$isEmpty&&!t.$silent&&t._emit("changeSelection")})}return e.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},e.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},e.prototype.getCursor=function(){return this.lead.getPosition()},e.prototype.setAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},e.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},e.prototype.getSelectionLead=function(){return this.lead.getPosition()},e.prototype.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},e.prototype.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},e.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},e.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},e.prototype.setRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},e.prototype.$setSelection=function(e,t,n,r){if(this.$silent)return;var i=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||s)&&this._emit("changeSelection")},e.prototype.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},e.prototype.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},e.prototype.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},e.prototype.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},e.prototype.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},e.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},e.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},e.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},e.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},e.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},e.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},e.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},e.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},e.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},e.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},e.prototype.getWordRange=function(e,t){if(typeof t=="undefined"){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},e.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},e.prototype.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},e.prototype.getLineRange=function(e,t){var n=typeof e=="number"?e:this.lead.row,r,i=this.session.getFoldLine(n);return i?(n=i.start.row,r=i.end.row):r=n,t===!0?new o(n,0,r,this.session.getLine(r).length):new o(n,0,r+1,0)},e.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},e.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},e.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},e.prototype.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(" ").length-1==t},e.prototype.moveCursorLeft=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,-1))this.moveCursorTo(t.start.row,t.start.column);else if(e.column===0)e.row>0&&this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(e,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},e.prototype.moveCursorRight=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,1))this.moveCursorTo(t.end.row,t.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},e.prototype.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},e.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},e.prototype.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i){this.moveCursorTo(i.end.row,i.end.column);return}this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t));if(t>=n.length){this.moveCursorTo(e,n.length),this.moveCursorRight(),e0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(s)&&(t-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)},e.prototype.$shortWordEndIndex=function(e){var t=0,n,r=/\s/,i=this.session.tokenRe;i.lastIndex=0;if(this.session.tokenRe.exec(e))t=this.session.tokenRe.lastIndex;else{while((n=e[t])&&r.test(n))t++;if(t<1){i.lastIndex=0;while((n=e[t])&&!i.test(n)){i.lastIndex=0,t++;if(r.test(n)){if(t>2){t--;break}while((n=e[t])&&r.test(n))t++;if(t>2)break}}}}return i.lastIndex=0,t},e.prototype.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do e++,r=this.doc.getLine(e);while(e0&&/^\s*$/.test(r));t=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(e,t-o)},e.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},e.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},e.prototype.moveCursorBy=function(e,t){var n=this.session.documentToScreenPosition(this.lead.row,this.lead.column),r;t===0&&(e!==0&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(r=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(r/this.session.$bidiHandler.charWidths[0])):r=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column);if(e!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var i=this.session.lineWidgets[this.lead.row];e<0?e-=i.rowsAbove||0:e>0&&(e+=i.rowCount-(i.rowsAbove||0))}var s=this.session.screenToDocumentPosition(n.row+e,n.column,r);e!==0&&t===0&&s.row===this.lead.row&&s.column===this.lead.column,this.moveCursorTo(s.row,s.column+t,t===0)},e.prototype.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},e.prototype.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},e.prototype.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},e.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},e.prototype.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},e.prototype.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},e.prototype.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch(r){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},e.prototype.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e},e.prototype.fromJSON=function(e){if(e.start==undefined){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},e.prototype.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0},e}();u.prototype.setSelectionAnchor=u.prototype.setAnchor,u.prototype.getSelectionAnchor=u.prototype.getAnchor,u.prototype.setSelectionRange=u.prototype.setRange,r.implement(u.prototype,s),t.Selection=u}),define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(e,t,n){"use strict";var r=e("./lib/report_error").reportError,i=2e3,s=function(){function e(e){this.splitRegex,this.states=e,this.regExps={},this.matchMappings={};for(var t in this.states){var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",u=[];for(var a=0;a1?f.onMatch=this.$applyToken:f.onMatch=f.token),c>1&&(/\\\d/.test(f.regex)?l=f.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(c=1,l=this.removeCapturingGroups(f.regex)),!f.splitRegex&&typeof f.token!="string"&&u.push(f)),s[i]=a,i+=c,r.push(l),f.onMatch||(f.onMatch=null)}r.length||(s[0]=0,r.push("$")),u.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}}return e.prototype.$setMaxTokenCount=function(e){i=e|0},e.prototype.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if(typeof n=="string")return[{type:n,value:e}];var r=[];for(var i=0,s=n.length;il){var g=e.substring(l,m-v.length);h.type==p?h.value+=g:(h.type&&f.push(h),h={type:p,value:g})}for(var y=0;yi){c>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});while(l1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:f,state:n.length?n:r}},e}();s.prototype.reportError=r,t.Tokenizer=s}),define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(e,t,n){"use strict";var r=e("../lib/deep_copy").deepCopy,i;i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},function(){this.addRules=function(e,t){if(!t){for(var n in e)this.$rules[n]=e[n];return}for(var n in e){var r=e[n];for(var i=0;i=this.$rowTokens.length){this.$row+=1,e||(e=this.$session.getLength());if(this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},e.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},e.prototype.getCurrentTokenRow=function(){return this.$row},e.prototype.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(n!==undefined)return n;n=0;while(t>0)t-=1,n+=e[t].value.length;return n},e.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},e.prototype.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)},e}();t.TokenIterator=i}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","rparen","paren","punctuation.operator"],a=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],f,l={},c={'"':'"',"'":"'"},h=function(e){var t=-1;e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},p=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},d;d=function(e){e=e||{},this.add("braces","insertion",function(t,n,r,i,s){var u=r.getCursorPosition(),a=i.doc.getLine(u.row);if(s=="{"){h(r);var l=r.getSelectionRange(),c=i.doc.getTextRange(l),v=i.getTokenAt(u.row,u.column);if(c!==""&&c!=="{"&&r.getWrapBehavioursEnabled())return p(l,c,"{","}");if(v&&/(?:string)\.quasi|\.xml/.test(v.type)){var m=[/tag\-(?:open|name)/,/attribute\-name/];if(m.some(function(e){return e.test(v.type)})||/(string)\.quasi/.test(v.type)&&v.value[u.column-v.start-1]!=="$")return;return d.recordAutoInsert(r,i,"}"),{text:"{}",selection:[1,1]}}if(d.isSaneInsertion(r,i))return/[\]\}\)]/.test(a[u.column])||r.inMultiSelectMode||e.braces?(d.recordAutoInsert(r,i,"}"),{text:"{}",selection:[1,1]}):(d.recordMaybeInsert(r,i,"{"),{text:"{",selection:[1,1]})}else if(s=="}"){h(r);var g=a.substring(u.column,u.column+1);if(g=="}"){var y=i.$findOpeningBracket("}",{column:u.column+1,row:u.row});if(y!==null&&d.isAutoInsertedClosing(u,a,s))return d.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(s=="\n"||s=="\r\n"){h(r);var b="";d.isMaybeInsertedClosing(u,a)&&(b=o.stringRepeat("}",f.maybeInsertedBrackets),d.clearMaybeInsertedClosing());var g=a.substring(u.column,u.column+1);if(g==="}"){var w=i.findMatchingBracket({row:u.row,column:u.column+1},"}");if(!w)return null;var E=this.$getIndent(i.getLine(w.row))}else{if(!b){d.clearMaybeInsertedClosing();return}var E=this.$getIndent(a)}var S=E+i.getTabString();return{text:"\n"+S+"\n"+E+b,selection:[1,S.length,1,S.length]}}d.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){h(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){h(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return p(s,o,"(",")");if(d.isSaneInsertion(n,r))return d.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){h(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&d.isAutoInsertedClosing(u,a,i))return d.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){h(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){h(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return p(s,o,"[","]");if(d.isSaneInsertion(n,r))return d.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){h(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&d.isAutoInsertedClosing(u,a,i))return d.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){h(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){var s=r.$mode.$quotes||c;if(i.length==1&&s[i]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(i)!=-1)return;h(n);var o=i,u=n.getSelectionRange(),a=r.doc.getTextRange(u);if(a!==""&&(a.length!=1||!s[a])&&n.getWrapBehavioursEnabled())return p(u,a,o,o);if(!a){var f=n.getCursorPosition(),l=r.doc.getLine(f.row),d=l.substring(f.column-1,f.column),v=l.substring(f.column,f.column+1),m=r.getTokenAt(f.row,f.column),g=r.getTokenAt(f.row,f.column+1);if(d=="\\"&&m&&/escape/.test(m.type))return null;var y=m&&/string|escape/.test(m.type),b=!g||/string|escape/.test(g.type),w;if(v==o)w=y!==b,w&&/string\.end/.test(g.type)&&(w=!1);else{if(y&&!b)return null;if(y&&b)return null;var E=r.$mode.tokenRe;E.lastIndex=0;var S=E.test(d);E.lastIndex=0;var x=E.test(v),T=r.$mode.$pairQuotesAfter,N=T&&T[o]&&T[o].test(d);if(!N&&S||x)return null;if(v&&!/[\s;,.})\]\\]/.test(v))return null;var C=l[f.column-2];if(!(d!=o||C!=o&&!E.test(C)))return null;w=!0}return{text:w?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.$mode.$quotes||c,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&s.hasOwnProperty(o)){h(n);var u=r.doc.getLine(i.start.row),a=u.substring(i.start.column+1,i.start.column+2);if(a==o)return i.end.column++,i}}),e.closeDocComment!==!1&&this.add("doc comment end","insertion",function(e,t,n,r,i){if(e==="doc-start"&&(i==="\n"||i==="\r\n")&&n.selection.isEmpty()){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=r.doc.getLine(s.row+1),a=this.$getIndent(o);if(/\s*\*/.test(u))return/^\s*\*/.test(o)?{text:i+a+"* ",selection:[1,3+a.length,1,3+a.length]}:{text:i+a+" * ",selection:[1,3+a.length,1,3+a.length]};if(/\/\*\*/.test(o.substring(0,s.column)))return{text:i+a+" * "+i+" "+a+"*/",selection:[1,4+a.length,1,4+a.length]}}})},d.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},d.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},d.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},d.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},d.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},d.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},d.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},d.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(d,i),t.CstyleBehaviour=d}),define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,s=[];for(var o=0;o2?r%f!=f-1:r%f==0}}var E=Infinity;w(function(e,t){var n=e.search(/\S/);n!==-1?(ne.length&&(E=e.length)}),u==Infinity&&(u=E,s=!1,o=!1),l&&u%f!=0&&(u=Math.floor(u/f)*f),w(o?m:v)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(!i)return;!i.start&&i[0]&&(i=i[0]);var s=new f(t,r.row,r.column),o=s.getCurrentToken(),u=t.selection,a=t.selection.toOrientedRange(),c,h;if(o&&/comment/.test(o.type)){var p,d;while(o&&/comment/.test(o.type)){var v=o.value.indexOf(i.start);if(v!=-1){var m=s.getCurrentTokenRow(),g=s.getCurrentTokenColumn()+v;p=new l(m,g,m,g+i.start.length);break}o=s.stepBackward()}var s=new f(t,r.row,r.column),o=s.getCurrentToken();while(o&&/comment/.test(o.type)){var v=o.value.indexOf(i.end);if(v!=-1){var m=s.getCurrentTokenRow(),g=s.getCurrentTokenColumn()+v;d=new l(m,g,m,g+i.end.length);break}o=s.stepForward()}d&&t.remove(d),p&&(t.remove(p),c=p.start.row,h=-i.start.length)}else h=i.start.length,c=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);a.start.row==c&&(a.start.column+=h),a.end.row==c&&(a.end.column+=h),t.selection.fromOrientedRange(a)},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){this.$embeds=[],this.$modes={};for(var t in e)if(e[t]){var n=e[t],i=n.prototype.$id,s=r.$modes[i];s||(r.$modes[i]=s=new n),r.$modes[t]||(r.$modes[t]=s),this.$embeds.push(t),this.$modes[t]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],u=function(e){(function(t){var n=o[e],r=t[n];t[o[e]]=function(){return this.$delegator(n,arguments,r)}})(a)},a=this;for(var t=0;t=0&&t.row=0&&t.column<=e[t.row].length}function s(e,t){t.action!="insert"&&t.action!="remove"&&r(t,"delta.action must be 'insert' or 'remove'"),t.lines instanceof Array||r(t,"delta.lines must be an Array"),(!t.start||!t.end)&&r(t,"delta.start/end must be an present");var n=t.start;i(e,t.start)||r(t,"delta.start must be contained in document");var s=t.end;t.action=="remove"&&!i(e,s)&&r(t,"delta.end must contained in document for 'remove' actions");var o=s.row-n.row,u=s.column-(o==0?n.column:0);(o!=t.lines.length-1||t.lines[o].length!=u)&&r(t,"delta.range must match delta lines")}t.applyDelta=function(e,t,n){var r=t.start.row,i=t.start.column,s=e[r]||"";switch(t.action){case"insert":var o=t.lines;if(o.length===1)e[r]=s.substring(0,i)+t.lines[0]+s.substring(i);else{var u=[r,1].concat(t.lines);e.splice.apply(e,u),e[r]=s.substring(0,i)+e[r],e[r+t.lines.length-1]+=s.substring(i)}break;case"remove":var a=t.end.column,f=t.end.row;r===f?e[r]=s.substring(0,i)+s.substring(a):e.splice(r,f-r+1,s.substring(0,i)+e[f].substring(a))}}}),define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,n){"use strict";function o(e,t,n){var r=n?e.column<=t.column:e.columnthis.row)return;var t=u(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(t.row,t.column,!0)},e.prototype.setPosition=function(e,t,n){var r;n?r={row:e,column:t}:r=this.$clipPositionToDocument(e,t);if(this.row==r.row&&this.column==r.column)return;var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})},e.prototype.detach=function(){this.document.off("change",this.$onChange)},e.prototype.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},e.prototype.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n},e}();s.prototype.$insertRight=!1,r.implement(s.prototype,i),t.Anchor=s}),define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,u=e("./anchor").Anchor,a=function(){function e(e){this.$lines=[""],e.length===0?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)}return e.prototype.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e||"")},e.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},e.prototype.createAnchor=function(e,t){return new u(this,e,t)},e.prototype.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},e.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},e.prototype.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e,this._signal("changeNewLineMode")},e.prototype.getNewLineMode=function(){return this.$newLineMode},e.prototype.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},e.prototype.getLine=function(e){return this.$lines[e]||""},e.prototype.getLines=function(e,t){return this.$lines.slice(e,t+1)},e.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},e.prototype.getLength=function(){return this.$lines.length},e.prototype.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},e.prototype.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{t=this.getLines(e.start.row,e.end.row),t[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},e.prototype.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},e.prototype.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},e.prototype.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},e.prototype.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},e.prototype.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},e.prototype.clippedPos=function(e,t){var n=this.getLength();e===undefined?e=n:e<0?e=0:e>=n&&(e=n-1,t=undefined);var r=this.getLine(e);return t==undefined&&(t=r.length),t=Math.min(Math.max(t,0),r.length),{row:e,column:t}},e.prototype.clonePos=function(e){return{row:e.row,column:e.column}},e.prototype.pos=function(e,t){return{row:e,column:t}},e.prototype.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},e.prototype.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var n=0;e0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},e.prototype.replace=function(e,t){e instanceof o||(e=o.fromPoints(e.start,e.end));if(t.length===0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);var n;return t?n=this.insert(e.start,t):n=e.start,n},e.prototype.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},e.prototype.applyDelta=function(e,t){var n=e.action=="insert";if(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))return;n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e))},e.prototype.$safeApplyDelta=function(e){var t=this.$lines.length;(e.action=="remove"&&e.start.row20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,r==-1&&(r=t),s<=r&&n.fireUpdateEvent(s,r)}}return e.prototype.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},e.prototype.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},e.prototype.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},e.prototype.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},e.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},e.prototype.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(n===0)this.lines[t]=null;else if(e.action=="remove")this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},e.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},e.prototype.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},e.prototype.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},e.prototype.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens},e.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},e}();r.implement(s.prototype,i),t.BackgroundTokenizer=s}),define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./range").Range,s=function(){function e(e,t,n){n===void 0&&(n="text"),this.setRegexp(e),this.clazz=t,this.type=n}return e.prototype.setRegexp=function(e){if(this.regExp+""==e+"")return;this.regExp=e,this.cache=[]},e.prototype.update=function(e,t,n,s){if(!this.regExp)return;var o=s.firstRow,u=s.lastRow,a={};for(var f=o;f<=u;f++){var l=this.cache[f];l==null&&(l=r.getMatchOffsets(n.getLine(f),this.regExp),l.length>this.MAX_RANGES&&(l=l.slice(0,this.MAX_RANGES)),l=l.map(function(e){return new i(f,e.offset,f,e.offset+e.length)}),this.cache[f]=l.length?l:"");for(var c=l.length;c--;){var h=l[c].toScreenRange(n),p=h.toString();if(a[p])continue;a[p]=!0,t.drawSingleLineMarker(e,h,this.clazz,s)}}},e}();s.prototype.MAX_RANGES=500,t.SearchHighlight=s}),define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";function i(e,t){for(var n=t;n--;){var r=e[n];if(r&&!r[0].ignore){while(n0){a.row+=i,a.column+=a.row==r.row?s:0;continue}!t&&l<=0&&(a.row=n.row,a.column=n.column,l===0&&(a.bias=1))}}function f(e){return{row:e.row,column:e.column}}function l(e){return{start:f(e.start),end:f(e.end),action:e.action,lines:e.lines.slice()}}function c(e){e=e||this;if(Array.isArray(e))return e.map(c).join("\n");var t="";e.action?(t=e.action=="insert"?"+":"-",t+="["+e.lines+"]"):e.value&&(Array.isArray(e.value)?t=e.value.map(h).join("\n"):t=h(e.value)),e.start&&(t+=h(e));if(e.id||e.rev)t+=" ("+(e.id||e.rev)+")";return t}function h(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function p(e,t){var n=e.action=="insert",r=t.action=="insert";if(n&&r)if(o(t.start,e.end)>=0)m(t,e,-1);else{if(!(o(t.start,e.start)<=0))return null;m(e,t,1)}else if(n&&!r)if(o(t.start,e.end)>=0)m(t,e,-1);else{if(!(o(t.end,e.start)<=0))return null;m(e,t,-1)}else if(!n&&r)if(o(t.start,e.start)>=0)m(t,e,1);else{if(!(o(t.start,e.start)<=0))return null;m(e,t,1)}else if(!n&&!r)if(o(t.start,e.start)>=0)m(t,e,1);else{if(!(o(t.end,e.start)<=0))return null;m(e,t,-1)}return[t,e]}function d(e,t){for(var n=e.length;n--;)for(var r=0;r=0?m(e,t,-1):o(e.start,t.start)<=0?m(t,e,1):(m(e,s.fromPoints(t.start,e.start),-1),m(t,e,1));else if(!n&&r)o(t.start,e.end)>=0?m(t,e,-1):o(t.start,e.start)<=0?m(e,t,1):(m(t,s.fromPoints(e.start,t.start),-1),m(e,t,1));else if(!n&&!r)if(o(t.start,e.end)>=0)m(t,e,-1);else{if(!(o(t.end,e.start)<=0)){var i,u;return o(e.start,t.start)<0&&(i=e,e=y(e,t.start)),o(e.end,t.end)>0&&(u=y(e,t.end)),g(t.end,e.start,e.end,-1),u&&!i&&(e.lines=u.lines,e.start=u.start,e.end=u.end,u=e),[t,i,u].filter(Boolean)}m(e,t,-1)}return[t,e]}function m(e,t,n){g(e.start,t.start,t.end,n),g(e.end,t.start,t.end,n)}function g(e,t,n,r){e.row==(r==1?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function y(e,t){var n=e.lines,r=e.end;e.end=f(t);var i=e.end.row-e.start.row,s=n.splice(i,n.length),o=i?t.column:t.column-e.start.column;n.push(s[0].substring(0,o)),s[0]=s[0].substr(o);var u={start:f(t),end:r,lines:s,action:e.action};return u}function b(e,t){t=l(t);for(var n=e.length;n--;){var r=e[n];for(var i=0;ithis.$undoDepth-1&&this.$undoStack.splice(0,r-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev}if(e.action=="remove"||e.action=="insert")this.$lastDelta=e;this.lastDeltas.push(e)},e.prototype.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},e.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},e.prototype.markIgnored=function(e,t){t==null&&(t=this.$rev+1);var n=this.$undoStack;for(var r=n.length;r--;){var i=n[r][0];if(i.id<=e)break;i.id0},e.prototype.canRedo=function(){return this.$redoStack.length>0},e.prototype.bookmark=function(e){e==undefined&&(e=this.$rev),this.mark=e},e.prototype.isAtBookmark=function(){return this.$rev===this.mark},e.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},e.prototype.fromJSON=function(e){this.reset(),this.$undoStack=e.$undoStack,this.$redoStack=e.$redoStack},e.prototype.$prettyPrint=function(e){return e?c(e):c(this.$undoStack)+"\n---\n"+c(this.$redoStack)},e}();r.prototype.hasUndo=r.prototype.canUndo,r.prototype.hasRedo=r.prototype.canRedo,r.prototype.isClean=r.prototype.isAtBookmark,r.prototype.markClean=r.prototype.bookmark;var s=e("./range").Range,o=s.comparePoints,u=s.comparePoints;t.UndoManager=r}),define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){function e(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}return e.prototype.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},e.prototype.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},e.prototype.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},e.prototype.walk=function(e,t,n){var r=0,i=this.folds,s,o,u,a=!0;t==null&&(t=this.end.row,n=this.end.column);for(var f=0;f0)continue;var a=i(e,o.start);return u===0?t&&a!==0?-s-2:s:a>0||a===0&&!t?s:-s-1}return-s-1},e.prototype.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},e.prototype.addList=function(e){var t=[];for(var n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},e.prototype.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},e.prototype.merge=function(){var e=[],t=this.ranges;t=t.sort(function(e,t){return i(e.start,t.start)});var n=t[0],r;for(var s=1;s=0},e.prototype.containsPoint=function(e){return this.pointIndex(e)>=0},e.prototype.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},e.prototype.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r)break}if(e.action=="insert"){var f=i-r,l=-t.column+n.column;for(;or)break;a.start.row==r&&a.start.column>=t.column&&(a.start.column==t.column&&this.$bias<=0||(a.start.column+=l,a.start.row+=f));if(a.end.row==r&&a.end.column>=t.column){if(a.end.column==t.column&&this.$bias<0)continue;a.end.column==t.column&&l>0&&oa.start.column&&a.end.column==s[o+1].start.column&&(a.end.column-=l),a.end.column+=l,a.end.row+=f}}}else{var f=r-i,l=t.column-n.column;for(;oi)break;if(a.end.rowt.column)a.end.column=t.column,a.end.row=t.row}else a.end.column+=l,a.end.row+=f;else a.end.row>i&&(a.end.row+=f);if(a.start.rowt.column)a.start.column=t.column,a.start.row=t.row}else a.start.column+=l,a.start.row+=f;else a.start.row>i&&(a.start.row+=f)}}if(f!=0&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;t&&(r=n.indexOf(t)),r==-1&&(r=0);for(r;r=e)return i}return null},this.getFoldedRowCount=function(e,t){var n=this.$foldData,r=t-e+1;for(var i=0;i=t){u=e?r-=t-u:r=0);break}o>=e&&(u>=e?r-=o-u:r-=o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n=this.$foldData,r=!1,o;e instanceof s?o=e:(o=new s(t,e),o.collapseChildren=t.collapseChildren),this.$clipRangeToDocument(o.range);var u=o.start.row,a=o.start.column,f=o.end.row,l=o.end.column,c=this.getFoldAt(u,a,1),h=this.getFoldAt(f,l,-1);if(c&&h==c)return c.addSubFold(o);c&&!c.range.isStart(u,a)&&this.removeFold(c),h&&!h.range.isEnd(f,l)&&this.removeFold(h);var p=this.getFoldsInRange(o.range);p.length>0&&(this.removeFolds(p),o.collapseChildren||p.forEach(function(e){o.addSubFold(e)}));for(var d=0;d0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;if(e==null)n=new r(0,0,this.getLength(),0),t==null&&(t=!0);else if(typeof e=="number")n=new r(e,0,e,this.getLine(e).length);else if("row"in e)n=r.fromPoints(e,e);else{if(Array.isArray(e))return i=[],e.forEach(function(e){i=i.concat(this.unfold(e))},this),i;n=e}i=this.getFoldsInRangeList(n);var s=i;while(i.length==1&&r.comparePoints(i[0].start,n.start)<0&&r.comparePoints(i[0].end,n.end)>0)this.expandFolds(i),i=this.getFoldsInRangeList(n);t!=0?this.removeFolds(i):this.expandFolds(i);if(s.length)return s},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){r==null&&(r=e.start.row),i==null&&(i=0),t==null&&(t=e.end.row),n==null&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,u){if(tl)break}while(s&&a.test(s.type)&&!/^comment.start/.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return f.end.row=i.getCurrentTokenRow(),f.end.column=i.getCurrentTokenColumn(),/^comment.end/.test(s.type)||(f.end.column+=s.value.length-2),f}},this.foldAll=function(e,t,n,r){n==undefined&&(n=1e5);var i=this.foldWidgets;if(!i)return;t=t||this.getLength(),e=e||0;for(var s=e;s=e&&(s=o.end.row,o.collapseChildren=n,this.addFold("...",o))}},this.foldToLevel=function(e){this.foldAll();while(e-->0)this.unfold(null,!1)},this.foldAllComments=function(){var e=this;this.foldAll(null,null,null,function(t){var n=e.getTokens(t);for(var r=0;r=0){var s=n[r];s==null&&(s=n[r]=this.getFoldWidget(r));if(s=="start"){var o=this.getFoldWidgetRange(r);i||(i=o);if(o&&o.end.row>=e)break}r--}return{range:r!==-1&&o,firstRange:i}},this.onFoldWidgetClick=function(e,t){t instanceof u&&(t=t.domEvent);var n={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey},r=this.$toggleFoldWidget(e,n);if(!r){var i=t.target||t.srcElement;i&&/ace_fold-widget/.test(i.className)&&(i.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(!this.getFoldWidget)return;var n=this.getFoldWidget(e),r=this.getLine(e),i=n==="end"?-1:1,s=this.getFoldAt(e,i===-1?0:r.length,i);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()){s=this.getFoldAt(o.start.row,o.start.column,1);if(s&&o.isEqual(s.range))return this.removeFold(s),s}if(t.siblings){var u=this.getParentFoldRangeData(e);if(u.range)var a=u.range.start.row+1,f=u.range.end.row;this.foldAll(a,f,t.all?1e4:0)}else t.children?(f=o?o.end.row:this.getLength(),this.foldAll(e+1,f,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(n)return;var r=this.getParentFoldRangeData(t,!0);n=r.range||r.firstRange;if(n){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(n===0)this.foldWidgets[t]=null;else if(e.action=="remove")this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}var r=e("../range").Range,i=e("./fold_line").FoldLine,s=e("./fold").Fold,o=e("../token_iterator").TokenIterator,u=e("../mouse/mouse_event").MouseEvent;t.Folding=a}),define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";function s(){this.findMatchingBracket=function(e,t){if(e.column==0)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(n=="")return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t=this.getLine(e.row),n=!0,r,s=t.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);o||(s=t.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),n=!1);if(!o)return null;if(o[1]){var u=this.$findClosingBracket(o[1],e);if(!u)return null;r=i.fromPoints(e,u),n||(r.end.column++,r.start.column--),r.cursor=r.end}else{var u=this.$findOpeningBracket(o[2],e);if(!u)return null;r=i.fromPoints(u,e),n||(r.start.column++,r.end.column--),r.cursor=r.start}return r},this.getMatchingBracketRanges=function(e,t){var n=this.getLine(e.row),r=/([\(\[\{])|([\)\]\}])/,s=!t&&n.charAt(e.column-1),o=s&&s.match(r);o||(s=(t===undefined||t)&&n.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(r));if(!o)return null;var u=new i(e.row,e.column-1,e.row,e.column),a=o[1]?this.$findClosingBracket(o[1],e):this.$findOpeningBracket(o[2],e);if(!a)return[u];var f=new i(a.row,a.column,a.row,a.column+1);return[u,f]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),u=o.getCurrentToken();u||(u=o.stepForward());if(!u)return;n||(n=new RegExp("(\\.?"+u.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));var a=t.column-o.getCurrentTokenColumn()-2,f=u.value;for(;;){while(a>=0){var l=f.charAt(a);if(l==i){s-=1;if(s==0)return{row:o.getCurrentTokenRow(),column:a+o.getCurrentTokenColumn()}}else l==e&&(s+=1);a-=1}do u=o.stepBackward();while(u&&!n.test(u.type));if(u==null)break;f=u.value,a=f.length-1}return null},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),u=o.getCurrentToken();u||(u=o.stepForward());if(!u)return;n||(n=new RegExp("(\\.?"+u.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));var a=t.column-o.getCurrentTokenColumn();for(;;){var f=u.value,l=f.length;while(a"?r=!0:t.type.indexOf("tag-name")!==-1&&(n=!0));while(t&&!n);return t},this.$findClosingTag=function(e,t){var n,r=t.value,s=t.value,o=0,u=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);t=e.stepForward();var a=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length),f=!1;do{n=t;if(n.type.indexOf("tag-close")!==-1&&!f){var l=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);f=!0}t=e.stepForward();if(t){if(t.value===">"&&!f){var l=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);f=!0}if(t.type.indexOf("tag-name")!==-1){r=t.value;if(s===r)if(n.value==="<")o++;else if(n.value==="")return;var p=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}}else if(s===r&&t.value==="/>"){o--;if(o<0)var c=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2),h=c,p=h,l=new i(a.end.row,a.end.column,a.end.row,a.end.column+1)}}}while(t&&o>=0);if(u&&l&&c&&p&&a&&h)return{openTag:new i(u.start.row,u.start.column,l.end.row,l.end.column),closeTag:new i(c.start.row,c.start.column,p.end.row,p.end.column),openTagName:a,closeTagName:h}},this.$findOpeningTag=function(e,t){var n=e.getCurrentToken(),r=t.value,s=0,o=e.getCurrentTokenRow(),u=e.getCurrentTokenColumn(),a=u+2,f=new i(o,u,o,a);e.stepForward();var l=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length);t.type.indexOf("tag-close")===-1&&(t=e.stepForward());if(!t||t.value!==">")return;var c=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);e.stepBackward(),e.stepBackward();do{t=n,o=e.getCurrentTokenRow(),u=e.getCurrentTokenColumn(),a=u+t.value.length,n=e.stepBackward();if(t)if(t.type.indexOf("tag-name")!==-1){if(r===t.value)if(n.value==="<"){s++;if(s>0){var h=new i(o,u,o,a),p=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);do t=e.stepForward();while(t&&t.value!==">");var d=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else n.value===""){var v=0,m=n;while(m){if(m.type.indexOf("tag-name")!==-1&&m.value===r){s--;break}if(m.value==="<")break;m=e.stepBackward(),v++}for(var g=0;g=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510}var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./bidihandler").BidiHandler,o=e("./config"),u=e("./lib/event_emitter").EventEmitter,a=e("./selection").Selection,f=e("./mode/text").Mode,l=e("./range").Range,c=e("./document").Document,h=e("./background_tokenizer").BackgroundTokenizer,p=e("./search_highlight").SearchHighlight,d=e("./undomanager").UndoManager,v=function(){function e(t,n){this.doc,this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++e.$uid,this.$foldData.toString=function(){return this.join("\n")},this.bgTokenizer=new h((new f).getTokenizer(),this);var r=this;this.bgTokenizer.on("update",function(e){r._signal("tokenizerUpdate",e)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this);if(typeof t!="object"||!t.getLine)t=new c(t);this.setDocument(t),this.selection=new a(this),this.$bidiHandler=new s(this),o.resetOptions(this),this.setMode(n),o._signal("session",this),this.destroyed=!1}return e.prototype.setDocument=function(e){this.doc&&this.doc.off("change",this.$onChange),this.doc=e,e.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},e.prototype.getDocument=function(){return this.doc},e.prototype.$resetRowCache=function(e){if(!e){this.$docRowCache=[],this.$screenRowCache=[];return}var t=this.$docRowCache.length,n=this.$getRowCacheIndex(this.$docRowCache,e)+1;t>n&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},e.prototype.$getRowCacheIndex=function(e,t){var n=0,r=e.length-1;while(n<=r){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t)break}return r=n[s],r?(r.index=s,r.start=i-r.value.length,r):null},e.prototype.setUndoManager=function(e){this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel();if(e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},e.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},e.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},e.prototype.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):" "},e.prototype.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},e.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},e.prototype.setTabSize=function(e){this.setOption("tabSize",e)},e.prototype.getTabSize=function(){return this.$tabSize},e.prototype.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},e.prototype.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},e.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},e.prototype.setOverwrite=function(e){this.setOption("overwrite",e)},e.prototype.getOverwrite=function(){return this.$overwrite},e.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},e.prototype.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},e.prototype.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},e.prototype.getBreakpoints=function(){return this.$breakpoints},e.prototype.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe));if(r)var i=this.tokenRe;else if(/^\s+$/.test(n.slice(t-1,t+1)))var i=/\s/;else var i=this.nonTokenRe;var s=t;if(s>0){do s--;while(s>=0&&n.charAt(s).match(i));s++}var o=t;while(oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},e.prototype.$computeWidth=function(e){if(this.$modified||e){this.$modified=!1;if(this.$useWrapMode)return this.screenWidth=this.$wrapLimit;var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:Infinity,u=t.length;for(var a=0;ao){a=s.end.row+1;if(a>=u)break;s=this.$foldData[i++],o=s?s.start.row:Infinity}n[a]==null&&(n[a]=this.$getStringScreenWidth(t[a])[0]),n[a]>r&&(r=n[a])}this.screenWidth=r}},e.prototype.getLine=function(e){return this.doc.getLine(e)},e.prototype.getLines=function(e,t){return this.doc.getLines(e,t)},e.prototype.getLength=function(){return this.doc.getLength()},e.prototype.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},e.prototype.insert=function(e,t){return this.doc.insert(e,t)},e.prototype.remove=function(e){return this.doc.remove(e)},e.prototype.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},e.prototype.undoChanges=function(e,t){if(!e.length)return;this.$fromUndo=!0;for(var n=e.length-1;n!=-1;n--){var r=e[n];r.action=="insert"||r.action=="remove"?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1},e.prototype.redoChanges=function(e,t){if(!e.length)return;this.$fromUndo=!0;for(var n=0;ne.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}s.end=this.insert(s.start,r);if(i.length){var a=e.start,f=s.start,o=f.row-a.row,u=f.column-a.column;this.addFolds(i.map(function(e){return e=e.clone(),e.start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},e.prototype.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},e.prototype.outdentRows=function(e){var t=e.collapseRows(),n=new l(0,0,0,0),r=this.getTabSize();for(var i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var r=this.getRowFoldEnd(t+n);if(r>this.doc.getLength()-1)return 0;var i=r-t}else{e=this.$clipRowToDocument(e),t=this.$clipRowToDocument(t);var i=t-e+1}var s=new l(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return e=e.clone(),e.start.row+=i,e.end.row+=i,e}),u=n==0?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+i,u),o.length&&this.addFolds(o),i},e.prototype.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},e.prototype.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},e.prototype.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},e.prototype.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},e.prototype.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},e.prototype.$clipPositionToDocument=function(e,t){t=Math.max(0,t);if(e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},e.prototype.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},e.prototype.setUseWrapMode=function(e){if(e!=this.$useWrapMode){this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0);if(e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},e.prototype.getUseWrapMode=function(){return this.$useWrapMode},e.prototype.setWrapLimitRange=function(e,t){if(this.$wrapLimitRange.min!==e||this.$wrapLimitRange.max!==t)this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode")},e.prototype.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1?(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},e.prototype.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},e.prototype.getWrapLimit=function(){return this.$wrapLimit},e.prototype.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},e.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},e.prototype.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,s=r.row,o=i.row,u=o-s,a=null;this.$updating=!0;if(u!=0)if(n==="remove"){this[t?"$wrapData":"$rowLengthCache"].splice(s,u);var f=this.$foldData;a=this.getFoldsInRange(e),this.removeFolds(a);var l=this.getFoldLine(i.row),c=0;if(l){l.addRemoveChars(i.row,i.column,r.column-i.column),l.shiftRow(-u);var h=this.getFoldLine(s);h&&h!==l&&(h.merge(l),l=h),c=f.indexOf(l)+1}for(c;c=i.row&&l.shiftRow(-u)}o=s}else{var p=Array(u);p.unshift(s,0);var d=t?this.$wrapData:this.$rowLengthCache;d.splice.apply(d,p);var f=this.$foldData,l=this.getFoldLine(s),c=0;if(l){var v=l.range.compareInside(r.row,r.column);v==0?(l=l.split(r.row,r.column),l&&(l.shiftRow(u),l.addRemoveChars(o,0,i.column-r.column))):v==-1&&(l.addRemoveChars(s,0,i.column-r.column),l.shiftRow(u)),c=f.indexOf(l)+1}for(c;c=s&&l.shiftRow(u)}}else{u=Math.abs(e.start.column-e.end.column),n==="remove"&&(a=this.getFoldsInRange(e),this.removeFolds(a),u=-u);var l=this.getFoldLine(s);l&&l.addRemoveChars(s,r.column,u)}return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),a},e.prototype.$updateRowLengthCache=function(e,t){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},e.prototype.$updateWrapData=function(e,t){var n=this.doc.getAllLines(),r=this.getTabSize(),i=this.$wrapData,s=this.$wrapLimit,o,u,a=e;t=Math.min(t,n.length-1);while(a<=t)u=this.getFoldLine(a,u),u?(o=[],u.walk(function(e,t,r,i){var s;if(e!=null){s=this.$getDisplayTokens(e,o.length),s[0]=y;for(var u=1;ut-h){var p=s+t-h;if(e[p-1]>=E&&e[p]>=E){c(p);continue}if(e[p]==y||e[p]==b){for(p;p!=s-1;p--)if(e[p]==y)break;if(p>s){c(p);continue}p=s+t;for(p;p>2)),s-1);while(p>d&&e[p]d&&e[p]d&&e[p]==w)p--}else while(p>d&&e[p]d){c(++p);continue}p=s+t,e[p]==g&&p--,c(p-h)}return r},e.prototype.$getDisplayTokens=function(e,t){var n=[],r;t=t||0;for(var i=0;i39&&s<48||s>57&&s<64?n.push(w):s>=4352&&T(s)?n.push(m,g):n.push(m)}return n},e.prototype.$getStringScreenWidth=function(e,t,n){if(t==0)return[0,0];t==null&&(t=Infinity),n=n||0;var r,i;for(i=0;i=4352&&T(r)?n+=2:n+=1;if(n>t)break}return[n,i]},e.prototype.getRowLength=function(e){var t=1;return this.lineWidgets&&(t+=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0),!this.$useWrapMode||!this.$wrapData[e]?t:this.$wrapData[e].length+t},e.prototype.getRowLineCount=function(e){return!this.$useWrapMode||!this.$wrapData[e]?1:this.$wrapData[e].length+1},e.prototype.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0)var u=f[l],i=this.$docRowCache[l],h=e>f[c-1];else var h=!c;var p=this.getLength()-1,d=this.getNextFoldLine(i),v=d?d.start.row:Infinity;while(u<=e){a=this.getRowLength(i);if(u+a>e||i>=p)break;u+=a,i++,i>v&&(i=d.end.row+1,d=this.getNextFoldLine(i,d),v=d?d.start.row:Infinity),h&&(this.$docRowCache.push(i),this.$screenRowCache.push(u))}if(d&&d.start.row<=i)r=this.getFoldDisplayLine(d),i=d.start.row;else{if(u+a<=e||i>p)return{row:p,column:this.getLine(p).length};r=this.getLine(i),d=null}var m=0,g=Math.floor(e-u);if(this.$useWrapMode){var y=this.$wrapData[i];y&&(o=y[g],g>0&&y.length&&(m=y.indent,s=y[g-1]||y[y.length-1],r=r.substring(s)))}return n!==undefined&&this.$bidiHandler.isBidiRow(u+g,i,g)&&(t=this.$bidiHandler.offsetToCol(n)),s+=this.$getStringScreenWidth(r,t-m)[1],this.$useWrapMode&&s>=o&&(s=o-1),d?d.idxToPosition(s):{row:i,column:s}},e.prototype.documentToScreenPosition=function(e,t){if(typeof t=="undefined")var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r=0,i=null,s=null;s=this.getFoldAt(e,t,1),s&&(e=s.start.row,t=s.start.column);var o,u=0,a=this.$docRowCache,f=this.$getRowCacheIndex(a,e),l=a.length;if(l&&f>=0)var u=a[f],r=this.$screenRowCache[f],c=e>a[l-1];else var c=!l;var h=this.getNextFoldLine(u),p=h?h.start.row:Infinity;while(u=p){o=h.end.row+1;if(o>e)break;h=this.getNextFoldLine(o,h),p=h?h.start.row:Infinity}else o=u+1;r+=this.getRowLength(u),u=o,c&&(this.$docRowCache.push(u),this.$screenRowCache.push(r))}var d="";h&&u>=p?(d=this.getFoldDisplayLine(h,e,t),i=h.start.row):(d=this.getLine(e).substring(0,t),i=e);var v=0;if(this.$useWrapMode){var m=this.$wrapData[i];if(m){var g=0;while(d.length>=m[g])r++,g++;d=d.substring(m[g-1]||0,d.length),v=g>0?m.indent:0}}return this.lineWidgets&&this.lineWidgets[u]&&this.lineWidgets[u].rowsAbove&&(r+=this.lineWidgets[u].rowsAbove),{row:r,column:v+this.$getStringScreenWidth(d)[0]}},e.prototype.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},e.prototype.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},e.prototype.getScreenLength=function(){var e=0,t=null;if(!this.$useWrapMode){e=this.getLength();var n=this.$foldData;for(var r=0;ro&&(s=t.end.row+1,t=this.$foldData[r++],o=t?t.start.row:Infinity)}}return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},e.prototype.$setFontMetrics=function(e){if(!this.$enableVarChar)return;this.$getStringScreenWidth=function(t,n,r){if(n===0)return[0,0];n||(n=Infinity),r=r||0;var i,s;for(s=0;sn)break}return[r,s]}},e.prototype.getPrecedingCharacter=function(){var e=this.selection.getCursor();if(e.column===0)return e.row===0?"":this.doc.getNewLineCharacter();var t=this.getLine(e.row);return t[e.column-1]},e.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection.detach()},e}();v.$uid=0,v.prototype.$modes=o.$modes,v.prototype.getValue=v.prototype.toString,v.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},v.prototype.$overwrite=!1,v.prototype.$mode=null,v.prototype.$modeId=null,v.prototype.$scrollTop=0,v.prototype.$scrollLeft=0,v.prototype.$wrapLimit=80,v.prototype.$useWrapMode=!1,v.prototype.$wrapLimitRange={min:null,max:null},v.prototype.lineWidgets=null,v.prototype.isFullWidth=T,r.implement(v.prototype,u);var m=1,g=2,y=3,b=4,w=9,E=10,S=11,x=12;e("./edit_session/folding").Folding.call(v.prototype),e("./edit_session/bracket_match").BracketMatch.call(v.prototype),o.defineOptions(v.prototype,"session",{wrap:{set:function(e){!e||e=="off"?e=!1:e=="free"?e=!0:e=="printMargin"?e=-1:typeof e=="string"&&(e=parseInt(e,10)||!1);if(this.$wrap==e)return;this.$wrap=e;if(!e)this.setUseWrapMode(!1);else{var t=typeof e=="number"?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){e=e=="auto"?this.$mode.type!="text":e!="text",e!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){e=parseInt(e),e>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=v}),define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";function u(e,t){function i(e,r){r===void 0&&(r=!0);var i=n&&t.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");if(i.test(e)||t.regExp)return n&&t.$supportsUnicodeFlag?r?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b";return""}var n=r.supportsLookbehind(),s=Array.from(e),o=s[0],u=s[s.length-1];return i(o)+e+i(u,!1)}var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){function e(){this.$options={}}return e.prototype.set=function(e){return i.mixin(this.$options,e),this},e.prototype.getOptions=function(){return r.copyObject(this.$options)},e.prototype.setOptions=function(e){this.$options=e},e.prototype.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new s(e,n,i,o),n==o&&t.start&&t.start.start&&t.skipCurrent!=0&&r.isEqual(t.start)?(r=null,!1):!0}),r},e.prototype.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],u=t.re;if(t.$isMultiLine){var a=u.length,f=i.length-a,l;e:for(var c=u.offset||0;c<=f;c++){for(var h=0;hv)continue;o.push(l=new s(c,v,c+a-1,m)),a>2&&(c=c+a-2)}}else for(var g=0;gE&&o[h].end.row==S)h--;o=o.slice(g,h+1);for(g=0,h=o.length;g=f;n--)if(p(n,Number.MAX_VALUE,e))return;if(t.wrap==0)return;for(n=l,f=a.row;n>=f;n--)if(p(n,Number.MAX_VALUE,e))return};else var c=function(e){var n=a.row;if(p(n,a.column,e))return;for(n+=1;n<=l;n++)if(p(n,0,e))return;if(t.wrap==0)return;for(n=f,l=a.row;n<=l;n++)if(p(n,0,e))return};if(t.$isMultiLine)var h=n.length,p=function(t,r,s){var o=i?t-h+1:t;if(o<0||o+h>e.getLength())return;var u=e.getLine(o),a=u.search(n[0]);if(!i&&ar)return;if(s(o,a,o+h-1,l))return!0};else if(i)var p=function(t,i,s){var u=e.getLine(t),a=[],f,l=0;n.lastIndex=0;while(f=n.exec(u)){var c=f[0].length;l=f.index;if(!c){if(l>=u.length)break;n.lastIndex=l+=r.skipEmptyMatch(u,l,o)}if(f.index+c>i)break;a.push(f.index,c)}for(var h=a.length-1;h>=0;h-=2){var p=a[h-1],c=a[h];if(s(t,p,t,p+c))return!0}};else var p=function(t,i,s){var u=e.getLine(t),a,f;n.lastIndex=i;while(f=n.exec(u)){var l=f[0].length;a=f.index;if(s(t,a,t,a+l))return!0;if(!l){n.lastIndex=a+=r.skipEmptyMatch(u,a,o);if(a>=u.length)return!1}}};return{forEach:c}},e}();t.Search=o}),define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";function a(e){return typeof e=="object"&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=e("../lib/keys"),s=e("../lib/useragent"),o=i.KEY_MODS,u=function(){function e(e,t){this.$init(e,t,!1)}return e.prototype.$init=function(e,t,n){this.platform=t||(s.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=n},e.prototype.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},e.prototype.removeCommand=function(e,t){var n=e&&(typeof e=="string"?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);o!=-1&&(s.splice(o,1),s.length==1&&(r[i]=s[0]))}}},e.prototype.bindKey=function(e,t,n){typeof e=="object"&&e&&(n==undefined&&(n=e.position),e=e[this.platform]);if(!e)return;if(typeof t=="function")return this.addCommand({exec:t,bindKey:e,name:t.name||e});e.split("|").forEach(function(e){var r="";if(e.indexOf(" ")!=-1){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=o[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var s=this.parseKeys(e),u=o[s.hashId]+s.key;this._addCommandToBinding(r+u,t,n)},this)},e.prototype._addCommandToBinding=function(e,t,n){var r=this.commandKeyBinding,i;if(!t)delete r[e];else if(!r[e]||this.$singleCommand)r[e]=t;else{Array.isArray(r[e])?(i=r[e].indexOf(t))!=-1&&r[e].splice(i,1):r[e]=[r[e]],typeof n!="number"&&(n=a(t));var s=r[e];for(i=0;in)break}s.splice(i,0,t)}},e.prototype.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(!n)return;if(typeof n=="string")return this.bindKey(n,t);typeof n=="function"&&(n={exec:n});if(typeof n!="object")return;n.name||(n.name=t),this.addCommand(n)},this)},e.prototype.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},e.prototype.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},e.prototype._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},e.prototype.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),r=i[n];if(i.FUNCTION_KEYS[r])n=i.FUNCTION_KEYS[r].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(t.length==1&&t[0]=="shift")return{key:n.toUpperCase(),hashId:-1}}var s=0;for(var o=t.length;o--;){var u=i.KEY_MODS[t[o]];if(u==null)return typeof console!="undefined"&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=u}return{key:n,hashId:s}},e.prototype.findKeyCommand=function(e,t){var n=o[e]+t;return this.commandKeyBinding[n]},e.prototype.handleKeyboard=function(e,t,n,r){if(r<0)return;var i=o[t]+n,s=this.commandKeyBinding[i];e.$keyChain&&(e.$keyChain+=" "+i,s=this.commandKeyBinding[e.$keyChain]||s);if(s)if(s=="chainKeys"||s[s.length-1]=="chainKeys")return e.$keyChain=e.$keyChain||i,{command:"null"};if(e.$keyChain)if(!!t&&t!=4||n.length!=1){if(t==-1||r>0)e.$keyChain=""}else e.$keyChain=e.$keyChain.slice(0,-i.length-1);return{command:s}},e.prototype.getStatusText=function(e,t){return t.$keyChain||""},e}(),f=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.$singleCommand=!0,r}return r(t,e),t}(u);f.call=function(e,t,n){u.prototype.$init.call(e,t,n,!0)},u.call=function(e,t,n){u.prototype.$init.call(e,t,n,!1)},t.HashHandler=f,t.MultiHashHandler=u}),define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=e("../lib/oop"),s=e("../keyboard/hash_handler").MultiHashHandler,o=e("../lib/event_emitter").EventEmitter,u=function(e){function t(t,n){var r=e.call(this,n,t)||this;return r.byName=r.commands,r.setDefaultHandler("exec",function(e){return e.args?e.command.exec(e.editor,e.args,e.event,!1):e.command.exec(e.editor,{},e.event,!0)}),r}return r(t,e),t.prototype.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}typeof e=="string"&&(e=this.commands[e]);if(!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(this.$checkCommandState!=0&&e.isAvailable&&!e.isAvailable(t))return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),i.returnValue===!1?!1:!0},t.prototype.toggleRecording=function(e){if(this.$inReplay)return;return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},t.prototype.replay=function(e){if(this.$inReplay||!this.macro)return;if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t=="string"?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}},t.prototype.trimMacro=function(e){return e.map(function(e){return typeof e[0]!="string"&&(e[0]=e[0].name),e[1]||(e=e[0]),e})},t}(s);i.implement(u.prototype,o),t.CommandManager=u}),define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";function o(e,t){return{win:e,mac:t}}var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;t.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:o("Alt-E","F4"),exec:function(e){i.loadModule("ace/ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){i.loadModule("ace/ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){typeof t=="number"&&!isNaN(t)&&e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty(),n=t?e.selection.getLineRange():e.selection.getRange();e._emit("cut",n),n.isEmpty()||e.session.remove(n),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:o(null,null),exec:function(e){e.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:o("Ctrl+F3","F3"),exec:function(e){e.openLink()}},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(e){var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,u=e.session.doc.getTextRange(e.selection.getRange()),a=u.replace(/\n\s*/," ").length,f=e.session.doc.getLine(n.row);for(var l=n.row+1;l<=i.row+1;l++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(l)));c.length!==0&&(c=" "+c),f+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;ot[n].column&&n++,s.unshift(n,0),t.splice.apply(t,s),this.$updateRows()}},e.prototype.$updateRows=function(){var e=this.session.lineWidgets;if(!e)return;var t=!0;e.forEach(function(e,n){if(e){t=!1,e.row=n;while(e.$oldWidget)e.$oldWidget.row=n,e=e.$oldWidget}}),t&&(this.session.lineWidgets=null)},e.prototype.$registerLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];return t&&(e.$oldWidget=t,t.el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1)),this.session.lineWidgets[e.row]=e,e},e.prototype.addLineWidget=function(e){this.$registerLineWidget(e),e.session=this.session;if(!this.editor)return e;var t=this.editor.renderer;e.html&&!e.el&&(e.el=r.createElement("div"),e.el.innerHTML=e.html),e.text&&!e.el&&(e.el=r.createElement("div"),e.el.textContent=e.text),e.el&&(r.addCssClass(e.el,"ace_lineWidgetContainer"),e.className&&r.addCssClass(e.el,e.className),e.el.style.position="absolute",e.el.style.zIndex="5",t.container.appendChild(e.el),e._inDocument=!0,e.coverGutter||(e.el.style.zIndex="3"),e.pixelHeight==null&&(e.pixelHeight=e.el.offsetHeight)),e.rowCount==null&&(e.rowCount=e.pixelHeight/t.layerConfig.lineHeight);var n=this.session.getFoldAt(e.row,0);e.$fold=n;if(n){var i=this.session.lineWidgets;e.row==n.end.row&&!i[n.start.row]?i[n.start.row]=e:e.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),this.onWidgetChanged(e),e},e.prototype.removeLineWidget=function(e){e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el);if(e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(t){}if(this.session.lineWidgets){var n=this.session.lineWidgets[e.row];if(n==e)this.session.lineWidgets[e.row]=e.$oldWidget,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else while(n){if(n.$oldWidget==e){n.$oldWidget=e.$oldWidget;break}n=n.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},e.prototype.getWidgetsAtRow=function(e){var t=this.session.lineWidgets,n=t&&t[e],r=[];while(n)r.push(n),n=n.$oldWidget;return r},e.prototype.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},e.prototype.measureWidgets=function(e,t){var n=this.session._changedWidgets,r=t.layerConfig;if(!n||!n.length)return;var i=Infinity;for(var s=0;s0&&!r[i])i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var u=r[o];if(!u||!u.el)continue;if(u.hidden){u.el.style.top=-100-(u.pixelHeight||0)+"px";continue}u._inDocument||(u._inDocument=!0,t.container.appendChild(u.el));var a=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;u.coverLine||(a+=n.lineHeight*this.session.getRowLineCount(u.row)),u.el.style.top=a-n.offset+"px";var f=u.coverGutter?0:t.gutterWidth;u.fixedWidth||(f-=t.scrollLeft),u.el.style.left=f+"px",u.fullWidth&&u.screenWidth&&(u.el.style.minWidth=n.width+2*n.padding+"px"),u.fixedWidth?u.el.style.right=t.scrollBar.getWidth()+"px":u.el.style.right=""}},e}();t.LineWidgets=i}),define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../mouse/default_gutter_handler").GutterTooltip,s=function(){function e(e){this.editor=e,this.gutterLayer=e.renderer.$gutterLayer,this.element=e.renderer.$gutter,this.lines=e.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new i(this.editor)}return e.prototype.addListener=function(){this.element.addEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.addEventListener("focusout",this.$blurGutter.bind(this)),this.editor.on("mousewheel",this.$blurGutter.bind(this))},e.prototype.removeListener=function(){this.element.removeEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.removeEventListener("focusout",this.$blurGutter.bind(this)),this.editor.off("mousewheel",this.$blurGutter.bind(this))},e.prototype.$onGutterKeyDown=function(e){if(this.annotationTooltip.isOpen){e.preventDefault(),e.keyCode===r.escape&&this.annotationTooltip.hideTooltip();return}if(e.target===this.element){if(e.keyCode!=r["enter"])return;e.preventDefault();var t=this.editor.getCursorPosition().row;this.editor.isRowVisible(t)||this.editor.scrollToLine(t,!0,!0),setTimeout(function(){var e=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),t=this.$findNearestFoldWidget(e),n=this.$findNearestAnnotation(e);if(t===null&&n===null)return;if(t===null&&n!==null){this.activeRowIndex=n,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}if(t!==null&&n===null){this.activeRowIndex=t,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}if(Math.abs(n-e)0||e+t=0&&this.$isFoldWidgetVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(e+t))return e+t}return null},e.prototype.$findNearestAnnotation=function(e){if(this.$isAnnotationVisible(e))return e;var t=0;while(e-t>0||e+t=0&&this.$isAnnotationVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isAnnotationVisible(e+t))return e+t}return null},e.prototype.$focusFoldWidget=function(e){if(e==null)return;var t=this.$getFoldWidget(e);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus()},e.prototype.$focusAnnotation=function(e){if(e==null)return;var t=this.$getAnnotation(e);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus()},e.prototype.$blurFoldWidget=function(e){var t=this.$getFoldWidget(e);t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur()},e.prototype.$blurAnnotation=function(e){var t=this.$getAnnotation(e);t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur()},e.prototype.$moveFoldWidgetUp=function(){var e=this.activeRowIndex;while(e>0){e--;if(this.$isFoldWidgetVisible(e)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=e,this.$focusFoldWidget(this.activeRowIndex);return}}return},e.prototype.$moveFoldWidgetDown=function(){var e=this.activeRowIndex;while(e0){e--;if(this.$isAnnotationVisible(e)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,this.$focusAnnotation(this.activeRowIndex);return}}return},e.prototype.$moveAnnotationDown=function(){var e=this.activeRowIndex;while(e=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=e("./lib/oop"),s=e("./lib/dom"),o=e("./lib/lang"),u=e("./lib/useragent"),a=e("./keyboard/textinput").TextInput,f=e("./mouse/mouse_handler").MouseHandler,l=e("./mouse/fold_handler").FoldHandler,c=e("./keyboard/keybinding").KeyBinding,h=e("./edit_session").EditSession,p=e("./search").Search,d=e("./range").Range,v=e("./lib/event_emitter").EventEmitter,m=e("./commands/command_manager").CommandManager,g=e("./commands/default_commands").commands,y=e("./config"),b=e("./token_iterator").TokenIterator,w=e("./line_widgets").LineWidgets,E=e("./keyboard/gutter_handler").GutterKeyboardHandler,S=e("./config").nls,x=e("./clipboard"),T=e("./lib/keys"),N=function(){function e(t,n,r){this.session,this.$toDestroy=[];var i=t.getContainerElement();this.container=i,this.renderer=t,this.id="editor"+ ++e.$uid,this.commands=new m(u.isMac?"mac":"win",g),typeof document=="object"&&(this.textInput=new a(t.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new f(this),new l(this)),this.keyBinding=new c(this),this.$search=(new p).set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=o.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",function(e,t){t._$emitInputEvent.schedule(31)}),this.setSession(n||r&&r.session||new h("")),y.resetOptions(this),r&&this.setOptions(r),y._signal("editor",this)}return e.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=o.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0}.bind(this),!0)},e.prototype.startOperation=function(e){if(this.curOp){if(!e||this.curOp.command)return;this.prevOp=this.curOp}e||(this.previousCommand=null,e={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:e.command||{},args:e.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},e.prototype.endOperation=function(e){if(this.curOp&&this.session){if(e&&e.returnValue===!1||!this.session)return this.curOp=null;if(e==1&&this.curOp.command&&this.curOp.command.name=="mouse")return;this._signal("beforeEndOperation");if(!this.curOp)return;var t=this.curOp.command,n=t&&t.scrollIntoView;if(n){switch(n){case"center-animate":n="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var r=this.selection.getRange(),i=this.renderer.layerConfig;(r.start.row>=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break;default:}n=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},e.prototype.$historyTracker=function(e){if(!this.$mergeUndoDeltas)return;var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if(e.command.name=="insertstring"){var i=e.args;this.mergeNextCommand===undefined&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&n.indexOf(e.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:n.indexOf(e.command.name)!==-1&&(this.sequenceStartTime=Date.now())},e.prototype.setKeyboardHandler=function(e,t){if(e&&typeof e=="string"&&e!="ace"){this.$keybindingId=e;var n=this;y.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},e.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},e.prototype.setSession=function(e){if(this.session==e)return;this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&!e.destroyed&&e.bgTokenizer.scheduleStart()},e.prototype.getSession=function(){return this.session},e.prototype.setValue=function(e,t){return this.session.doc.setValue(e),t?t==1?this.navigateFileEnd():t==-1&&this.navigateFileStart():this.selectAll(),e},e.prototype.getValue=function(){return this.session.getValue()},e.prototype.getSelection=function(){return this.selection},e.prototype.resize=function(e){this.renderer.onResize(e)},e.prototype.setTheme=function(e,t){this.renderer.setTheme(e,t)},e.prototype.getTheme=function(){return this.renderer.getTheme()},e.prototype.setStyle=function(e){this.renderer.setStyle(e)},e.prototype.unsetStyle=function(e){this.renderer.unsetStyle(e)},e.prototype.getFontSize=function(){return this.getOption("fontSize")||s.computedStyle(this.container).fontSize},e.prototype.setFontSize=function(e){this.setOption("fontSize",e)},e.prototype.$highlightBrackets=function(){if(this.$highlightPending)return;var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(!t||t.destroyed)return;t.$bracketHighlight&&(t.$bracketHighlight.markerIds.forEach(function(e){t.removeMarker(e)}),t.$bracketHighlight=null);var n=e.getCursorPosition(),r=e.getKeyboardHandler(),i=r&&r.$getDirectionForHighlight&&r.$getDirectionForHighlight(e),s=t.getMatchingBracketRanges(n,i);if(!s){var o=new b(t,n.row,n.column),u=o.getCurrentToken();if(u&&/\b(?:tag-open|tag-name)/.test(u.type)){var a=t.getMatchingTags(n);a&&(s=[a.openTagName.isEmpty()?a.openTag:a.openTagName,a.closeTagName.isEmpty()?a.closeTag:a.closeTagName])}}!s&&t.$mode.getMatching&&(s=t.$mode.getMatching(e.session));if(!s){e.getHighlightIndentGuides()&&e.renderer.$textLayer.$highlightIndentGuide();return}var f="ace_bracket";Array.isArray(s)?s.length==1&&(f="ace_error_bracket"):s=[s],s.length==2&&(d.comparePoints(s[0].end,s[1].start)==0?s=[d.fromPoints(s[0].start,s[1].end)]:d.comparePoints(s[0].start,s[1].end)==0&&(s=[d.fromPoints(s[1].start,s[0].end)])),t.$bracketHighlight={ranges:s,markerIds:s.map(function(e){return t.addMarker(e,f,"text")})},e.getHighlightIndentGuides()&&e.renderer.$textLayer.$highlightIndentGuide()},50)},e.prototype.focus=function(){this.textInput.focus()},e.prototype.isFocused=function(){return this.textInput.isFocused()},e.prototype.blur=function(){this.textInput.blur()},e.prototype.onFocus=function(e){if(this.$isFocused)return;this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",e)},e.prototype.onBlur=function(e){if(!this.$isFocused)return;this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",e)},e.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},e.prototype.onDocumentChange=function(e){var t=this.session.$useWrapMode,n=e.start.row==e.end.row?e.end.row:Infinity;this.renderer.updateLines(e.start.row,n,t),this._signal("change",e),this.$cursorChange()},e.prototype.onTokenizerUpdate=function(e){var t=e.data;this.renderer.updateLines(t.first,t.last)},e.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},e.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},e.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},e.prototype.$updateHighlightActiveLine=function(){var e=this.getSession(),t;if(this.$highlightActiveLine){if(this.$selectionStyle!="line"||!this.selection.isMultiLine())t=this.getCursorPosition();this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(t=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(t=!1)}if(e.$highlightLineMarker&&!t)e.removeMarker(e.$highlightLineMarker.id),e.$highlightLineMarker=null;else if(!e.$highlightLineMarker&&t){var n=new d(t.row,t.column,t.row,Infinity);n.id=e.addMarker(n,"ace_active-line","screenLine"),e.$highlightLineMarker=n}else t&&(e.$highlightLineMarker.start.row=t.row,e.$highlightLineMarker.end.row=t.row,e.$highlightLineMarker.start.column=t.column,e._signal("changeBackMarker"))},e.prototype.onSelectionChange=function(e){var t=this.session;t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null;if(!this.selection.isEmpty()){var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}else this.$updateHighlightActiveLine();var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},e.prototype.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(t.isEmpty()||t.isMultiLine())return;var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),s=i.substring(n,r);if(s.length>5e3||!/[\w\d]/.test(s))return;var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),u=i.substring(n-1,r+1);if(!o.test(u))return;return o},e.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},e.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},e.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},e.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},e.prototype.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},e.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},e.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},e.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},e.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},e.prototype.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;var r=this.selection.getAllRanges();for(var i=0;iu.search(/\S|$/)){var a=u.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+a)}}this.clearSelection();var f=i.column,l=n.getState(i.row),u=n.getLine(i.row),c=r.checkOutdent(l,u,e);n.insert(i,e),s&&s.selection&&(s.selection.length==2?this.selection.setSelectionRange(new d(i.row,f+s.selection[0],i.row,f+s.selection[1])):this.selection.setSelectionRange(new d(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3])));if(this.$enableAutoIndent){if(n.getDocument().isNewLine(e)){var h=r.getNextLineIndent(l,u.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},h)}c&&r.autoOutdent(l,n,i.row)}},e.prototype.autoIndent=function(){var e=this.session,t=e.getMode(),n=this.selection.isEmpty()?[new d(0,0,e.doc.getLength()-1,0)]:this.selection.getAllRanges(),r="",i="",s="",o=e.getTabString();for(var u=0;u0&&(r=e.getState(l-1),i=e.getLine(l-1),s=t.getNextLineIndent(r,i,o));var c=e.getLine(l),h=t.$getIndent(c);if(s!==h){if(h.length>0){var p=new d(l,0,l,h.length);e.remove(p)}s.length>0&&e.insert({row:l,column:0},s)}t.autoOutdent(r,e,l)}}},e.prototype.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},e.prototype.applyComposition=function(e,t){if(t.extendLeft||t.extendRight){var n=this.selection.getRange();n.start.column-=t.extendLeft,n.end.column+=t.extendRight,n.start.column<0&&(n.start.row--,n.start.column+=this.session.getLine(n.start.row).length+1),this.selection.setRange(n),!e&&!n.isEmpty()&&this.remove()}(e||!this.selection.isEmpty())&&this.insert(e,!0);if(t.restoreStart||t.restoreEnd){var n=this.selection.getRange();n.start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n)}},e.prototype.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},e.prototype.setOverwrite=function(e){this.session.setOverwrite(e)},e.prototype.getOverwrite=function(){return this.session.getOverwrite()},e.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},e.prototype.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},e.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},e.prototype.setDragDelay=function(e){this.setOption("dragDelay",e)},e.prototype.getDragDelay=function(){return this.getOption("dragDelay")},e.prototype.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},e.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},e.prototype.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},e.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},e.prototype.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},e.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},e.prototype.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},e.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},e.prototype.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},e.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},e.prototype.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},e.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},e.prototype.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},e.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},e.prototype.setHighlightIndentGuides=function(e){this.renderer.setHighlightIndentGuides(e)},e.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},e.prototype.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},e.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},e.prototype.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},e.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},e.prototype.setReadOnly=function(e){this.setOption("readOnly",e)},e.prototype.getReadOnly=function(){return this.getOption("readOnly")},e.prototype.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},e.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},e.prototype.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},e.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},e.prototype.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},e.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},e.prototype.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},e.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},e.prototype.remove=function(e){this.selection.isEmpty()&&(e=="left"?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(t.end.column===0){var s=n.getTextRange(t);if(s[s.length-1]=="\n"){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},e.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},e.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},e.prototype.setGhostText=function(e,t){this.session.widgetManager||(this.session.widgetManager=new w(this.session),this.session.widgetManager.attach(this)),this.renderer.setGhostText(e,t)},e.prototype.removeGhostText=function(){if(!this.session.widgetManager)return;this.renderer.removeGhostText()},e.prototype.transposeLetters=function(){if(!this.selection.isEmpty())return;var e=this.getCursorPosition(),t=e.column;if(t===0)return;var n=this.session.getLine(e.row),r,i;tt.toLowerCase()?1:0});var i=new d(0,0,0,0);for(var r=e.first;r<=e.last;r++){var s=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=s.length,t.replace(i,n[r-e.first])}},e.prototype.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},e.prototype.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},e.prototype.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;var r=this.session.getLine(e);while(n.lastIndex=t){var s={value:i[0],start:i.index,end:i.index+i[0].length};return s}}return null},e.prototype.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new d(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,u=s.start+s.value.length-o,a=parseFloat(s.value);a*=Math.pow(10,u),o!==s.end&&n=u&&s<=a&&(n=t,f.selection.clearSelection(),f.moveCursorTo(e,u+r),f.selection.selectTo(e,a+r)),u=a});var l=this.$toggleWordPairs,c;for(var h=0;h=a&&u<=f&&p.match(/((?:https?|ftp):\/\/[\S]+)/)){l=p.replace(/[\s:.,'";}\]]+$/,"");break}a=f}}catch(d){n={error:d}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}return l},e.prototype.openLink=function(){var e=this.selection.getCursor(),t=this.findLinkAt(e.row,e.column);return t&&window.open(t,"_blank"),t!=null},e.prototype.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last),this.clearSelection()},e.prototype.duplicateSelection=function(){var e=this.selection,t=this.session,n=e.getRange(),r=e.isBackwards();if(n.isEmpty()){var i=n.start.row;t.duplicateLines(i,i)}else{var s=r?n.start:n.end,o=t.insert(s,t.getTextRange(n));n.start=s,n.end=o,e.setSelectionRange(n,r)}},e.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},e.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},e.prototype.moveText=function(e,t,n){return this.session.moveText(e,t,n)},e.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},e.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},e.prototype.$moveLines=function(e,t){var n,r,i=this.selection;if(!i.inMultiSelectMode||this.inVirtualSelectionMode){var s=i.toOrientedRange();n=this.$getSelectedRows(s),r=this.session.$moveLines(n.first,n.last,t?0:e),t&&e==-1&&(r=0),s.moveBy(r,0),i.fromOrientedRange(s)}else{var o=i.rangeList.ranges;i.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;var u=0,a=0,f=o.length;for(var l=0;lp+1)break;p=d.last}l--,u=this.session.$moveLines(h,p,t?0:e),t&&e==-1&&(c=l+1);while(c<=l)o[c].moveBy(u,0),c++;t||(u=0),a+=u}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},e.prototype.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},e.prototype.onCompositionStart=function(e){this.renderer.showComposition(e)},e.prototype.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},e.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},e.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},e.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},e.prototype.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},e.prototype.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},e.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},e.prototype.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);t===!0?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):t===!1&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),t!=null&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},e.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},e.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},e.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},e.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},e.prototype.scrollPageDown=function(){this.$moveByPage(1)},e.prototype.scrollPageUp=function(){this.$moveByPage(-1)},e.prototype.scrollToRow=function(e){this.renderer.scrollToRow(e)},e.prototype.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},e.prototype.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},e.prototype.getCursorPosition=function(){return this.selection.getCursor()},e.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},e.prototype.getSelectionRange=function(){return this.selection.getRange()},e.prototype.selectAll=function(){this.selection.selectAll()},e.prototype.clearSelection=function(){this.selection.clearSelection()},e.prototype.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},e.prototype.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},e.prototype.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new b(this.session,n.row,n.column),i=r.getCurrentToken(),s=0;i&&i.type.indexOf("tag-name")!==-1&&(i=r.stepBackward());var o=i||r.stepForward();if(!o)return;var u,a=!1,f={},l=n.column-o.start,c,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(o.value.match(/[{}()\[\]]/g))for(;l1?f[o.value]++:i.value==="=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),r},e.prototype.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return t=this.$search.replace(n,t),t!==null?(e.end=this.session.replace(e,t),e):null},e.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},e.prototype.find=function(e,t,n){t||(t={}),typeof e=="string"||e instanceof RegExp?t.needle=e:typeof e=="object"&&i.mixin(t,e);var r=this.selection.getRange();t.needle==null&&(e=this.session.getTextRange(r)||this.$search.$options.needle,e||(r=this.session.getWordRange(r.start.row,r.start.column),e=this.session.getTextRange(r)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:r});var s=this.$search.find(this.session);if(t.preventScroll)return s;if(s)return this.revealRange(s,n),s;t.backwards?r.start=r.end:r.end=r.start,this.selection.setRange(r)},e.prototype.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},e.prototype.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},e.prototype.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),t!==!1&&this.renderer.animateScrolling(n)},e.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},e.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},e.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(e){e.destroy()}),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},e.prototype.setAutoScrollEditorIntoView=function(e){if(!e)return;var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),u=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,u=s.top-o.offset;s.top>=0&&u+t.top<0?r=!0:s.topwindow.innerHeight?r=!1:r=null,r!=null&&(i.style.top=u+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){if(e)return;delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",u),this.renderer.off("beforeRender",o)}},e.prototype.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;if(!t)return;t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&e!="wide",s.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e))},e.prototype.prompt=function(e,t,n){var r=this;y.loadModule("ace/ext/prompt",function(i){i.prompt(r,e,t,n)})},e}();N.$uid=0,N.prototype.curOp=null,N.prototype.prevOp={},N.prototype.$mergeableCommands=["backspace","del","insertstring"],N.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],i.implement(N.prototype,v),y.defineOptions(N.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?C.attach(this):C.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?C.attach(this):C.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),s.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!e&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),s.addCssClass(this.container,"ace_hasPlaceholder");var t=s.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!e&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(e){var t={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(e){e.blur(),e.renderer.scroller.focus()},readOnly:!0},n=function(e){if(e.target==this.renderer.scroller&&e.keyCode===T.enter){e.preventDefault();var t=this.getCursorPosition().row;this.isRowVisible(t)||this.scrollToLine(t,!0,!0),this.focus()}},r;e?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(u.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",S("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",S("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",n.bind(this)),this.commands.addCommand(t),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",S("editor.gutter.aria-roledescription","editor")),this.renderer.$gutter.setAttribute("aria-label",S("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),r||(r=new E(this)),r.addListener()):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",n.bind(this)),this.commands.removeCommand(t),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),r&&r.removeListener())},initialValue:!1},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var C={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"\u00b7":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=N}),define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(){function e(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return e.prototype.moveContainer=function(e){r.translate(this.element,0,-(e.firstRowScreen*e.lineHeight%this.canvasHeight)-e.offset*this.$offsetCoefficient)},e.prototype.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},e.prototype.computeLineTop=function(e,t,n){var r=t.firstRowScreen*t.lineHeight,i=Math.floor(r/this.canvasHeight),s=n.documentToScreenRow(e,0)*t.lineHeight;return s-i*this.canvasHeight},e.prototype.computeLineHeight=function(e,t,n){return t.lineHeight*n.getRowLineCount(e)},e.prototype.getLength=function(){return this.cells.length},e.prototype.get=function(e){return this.cells[e]},e.prototype.shift=function(){this.$cacheCell(this.cells.shift())},e.prototype.pop=function(){this.$cacheCell(this.cells.pop())},e.prototype.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);var t=r.createFragment(this.element);for(var n=0;ns&&(a=i.end.row+1,i=t.getNextFoldLine(a,i),s=i?i.start.row:Infinity);if(a>r){while(this.$lines.getLength()>u+1)this.$lines.pop();break}o=this.$lines.get(++u),o?o.row=a:(o=this.$lines.createCell(a,e,this.session,l),this.$lines.push(o)),this.$renderCell(o,e,i,a),a++}this._signal("afterRender"),this.$updateGutterWidth(e)},e.prototype.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:"";if(this.$fixedWidth||t.$useWrapMode)i=t.getLength()+r-1;var s=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();s+=o.left+o.right,s!==this.gutterWidth&&!isNaN(s)&&(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},e.prototype.$updateCursorRow=function(){if(!this.$highlightGutterLine)return;var e=this.session.selection.getCursor();if(this.$cursorRow===e.row)return;this.$cursorRow=e.row},e.prototype.updateLineHighlight=function(){if(!this.$highlightGutterLine)return;var e=this.session.selection.cursor.row;this.$cursorRow=e;if(this.$cursorCell&&this.$cursorCell.row==e)return;this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&i&&i.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}},e.prototype.scrollLines=function(e){var t=this.config;this.config=e,this.$updateCursorRow();if(this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;this.oldLastRow=n;if(!t||r0;i--)this.$lines.shift();if(r>n)for(var i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},e.prototype.$renderLines=function(e,t,n){var r=[],i=t,s=this.session.getNextFoldLine(i),o=s?s.start.row:Infinity;for(;;){i>o&&(i=s.end.row+1,s=this.session.getNextFoldLine(i,s),o=s?s.start.row:Infinity);if(i>n)break;var u=this.$lines.createCell(i,e,this.session,l);this.$renderCell(u,e,s,i),r.push(u),i++}return r},e.prototype.$renderCell=function(e,t,n,i){var s=e.element,o=this.session,u=s.childNodes[0],f=s.childNodes[1],l=s.childNodes[2],c=l.firstChild,h=o.$firstLineNumber,p=o.$breakpoints,d=o.$decorations,v=o.gutterRenderer||this.$renderer,m=this.$showFoldWidgets&&o.foldWidgets,g=n?n.start.row:Number.MAX_VALUE,y=t.lineHeight+"px",b=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",w=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",E=(v?v.getText(o,i):i+h).toString();this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=g&&this.$cursorRow<=n.end.row)&&(b+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),p[i]&&(b+=p[i]),d[i]&&(b+=d[i]),this.$annotations[i]&&i!==g&&(b+=this.$annotations[i].className);if(m){var S=m[i];S==null&&(S=m[i]=o.getFoldWidget(i))}if(S){var x="ace_fold-widget ace_"+S,T=S=="start"&&i==g&&in.right-t.right)return"foldWidgets"},e}();f.prototype.$fixedWidth=!1,f.prototype.$highlightGutterLine=!0,f.prototype.$renderer="",f.prototype.$showLineNumbers=!0,f.prototype.$showFoldWidgets=!0,i.implement(f.prototype,o),t.Gutter=f}),define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";function o(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}var r=e("../range").Range,i=e("../lib/dom"),s=function(){function e(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)}return e.prototype.setPadding=function(e){this.$padding=e},e.prototype.setSession=function(e){this.session=e},e.prototype.setMarkers=function(e){this.markers=e},e.prototype.elt=function(e,t){var n=this.i!=-1&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},e.prototype.update=function(e){if(!e)return;this.config=e,this.i=0;var t;for(var n in this.markers){var r=this.markers[n];if(!r.range){r.update(t,this,this.session,e);continue}var i=r.range.clipRows(e.firstRow,e.lastRow);if(i.isEmpty())continue;i=i.toScreenRange(this.session);if(r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else r.type=="fullLine"?this.drawFullLineMarker(t,i,r.clazz,e):r.type=="screenLine"?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?r.type=="text"?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start"+" ace_br15",e)}if(this.i!=-1)while(this.ip,l==f),i,l==f?0:1,s)},e.prototype.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,u=this.$getTop(t.start.row,r),a=s+t.start.column*r.characterWidth;i=i||"";if(this.session.$bidiHandler.isBidiRow(t.start.row)){var f=t.clone();f.end.row=f.start.row,f.end.column=this.session.getLine(f.start.row).length,this.drawBidiSingleLineMarker(e,f,n+" ace_br1 ace_start",r,null,i)}else this.elt(n+" ace_br1 ace_start","height:"+o+"px;"+"right:0;"+"top:"+u+"px;left:"+a+"px;"+(i||""));if(this.session.$bidiHandler.isBidiRow(t.end.row)){var f=t.clone();f.start.row=f.end.row,f.start.column=0,this.drawBidiSingleLineMarker(e,f,n+" ace_br12",r,null,i)}else{u=this.$getTop(t.end.row,r);var l=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;"+"width:"+l+"px;"+"top:"+u+"px;"+"left:"+s+"px;"+(i||""))}o=(t.end.row-t.start.row-1)*r.lineHeight;if(o<=0)return;u=this.$getTop(t.start.row+1,r);var c=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(c?" ace_br"+c:""),"height:"+o+"px;"+"right:0;"+"top:"+u+"px;"+"left:"+s+"px;"+(i||""))},e.prototype.drawSingleLineMarker=function(e,t,n,r,i,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,s);var o=r.lineHeight,u=(t.end.column+(i||0)-t.start.column)*r.characterWidth,a=this.$getTop(t.start.row,r),f=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+o+"px;"+"width:"+u+"px;"+"top:"+a+"px;"+"left:"+f+"px;"+(s||""))},e.prototype.drawBidiSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,u=this.$getTop(t.start.row,r),a=this.$padding,f=this.session.$bidiHandler.getSelections(t.start.column,t.end.column);f.forEach(function(e){this.elt(n,"height:"+o+"px;"+"width:"+(e.width+(i||0))+"px;"+"top:"+u+"px;"+"left:"+(a+e.left)+"px;"+(s||""))},this)},e.prototype.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),this.elt(n,"height:"+o+"px;"+"top:"+s+"px;"+"left:0;right:0;"+(i||""))},e.prototype.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,"height:"+o+"px;"+"top:"+s+"px;"+"left:0;right:0;"+(i||""))},e}();s.prototype.$padding=0,t.Marker=s}),define("ace/layer/text_util",["require","exports","module"],function(e,t,n){var r=new Set(["text","rparen","lparen"]);t.isTextToken=function(e){return r.has(e)}}),define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("./lines").Lines,u=e("../lib/event_emitter").EventEmitter,a=e("../config").nls,f=e("./text_util").isTextToken,l=function(){function e(e){this.dom=i,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)}return e.prototype.$updateEolChar=function(){var e=this.session.doc,t=e.getNewLineCharacter()=="\n"&&e.getNewLineMode()!="windows",n=t?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=n)return this.EOL_CHAR=n,!0},e.prototype.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},e.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},e.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},e.prototype.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},e.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},e.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},e.prototype.setSession=function(e){this.session=e,e&&this.$computeTabString()},e.prototype.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,typeof e=="string"?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},e.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},e.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides===e?!1:(this.$highlightIndentGuides=e,e)},e.prototype.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;var t=this.$tabStrings=[0];for(var n=1;nl&&(u=a.end.row+1,a=this.session.getNextFoldLine(u,a),l=a?a.start.row:Infinity);if(u>i)break;var c=s[o++];if(c){this.dom.removeChildren(c),this.$renderLine(c,u,u==l?a:!1),f&&(c.style.top=this.$lines.computeLineTop(u,e,this.session)+"px");var h=e.lineHeight*this.session.getRowLength(u)+"px";c.style.height!=h&&(f=!0,c.style.height=h)}u++}if(f)while(o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(var i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},e.prototype.$renderLinesFragment=function(e,t,n){var r=[],s=t,o=this.session.getNextFoldLine(s),u=o?o.start.row:Infinity;for(;;){s>u&&(s=o.end.row+1,o=this.session.getNextFoldLine(s,o),u=o?o.start.row:Infinity);if(s>n)break;var a=this.$lines.createCell(s,e,this.session),f=a.element;this.dom.removeChildren(f),i.setStyle(f.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),i.setStyle(f.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(f,s,s==u?o:!1),this.$useLineGroups()?f.className="ace_line_group":f.className="ace_line",r.push(a),s++}return r},e.prototype.update=function(e){this.$lines.moveContainer(e),this.config=e;var t=e.firstRow,n=e.lastRow,r=this.$lines;while(r.getLength())r.pop();r.push(this.$renderLinesFragment(e,t,n))},e.prototype.$renderToken=function(e,t,n,r){var i=this,o=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,u=this.dom.createFragment(this.element),l,c=0;while(l=o.exec(r)){var h=l[1],p=l[2],d=l[3],v=l[4],m=l[5];if(!i.showSpaces&&p)continue;var g=c!=l.index?r.slice(c,l.index):"";c=l.index+l[0].length,g&&u.appendChild(this.dom.createTextNode(g,this.element));if(h){var y=i.session.getScreenTabSize(t+l.index);u.appendChild(i.$tabStrings[y].cloneNode(!0)),t+=y-1}else if(p)if(i.showSpaces){var b=this.dom.createElement("span");b.className="ace_invisible ace_invisible_space",b.textContent=s.stringRepeat(i.SPACE_CHAR,p.length),u.appendChild(b)}else u.appendChild(this.dom.createTextNode(p,this.element));else if(d){var b=this.dom.createElement("span");b.className="ace_invisible ace_invisible_space ace_invalid",b.textContent=s.stringRepeat(i.SPACE_CHAR,d.length),u.appendChild(b)}else if(v){t+=1;var b=this.dom.createElement("span");b.style.width=i.config.characterWidth*2+"px",b.className=i.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",b.textContent=i.showSpaces?i.SPACE_CHAR:v,u.appendChild(b)}else if(m){t+=1;var b=this.dom.createElement("span");b.style.width=i.config.characterWidth*2+"px",b.className="ace_cjk",b.textContent=m,u.appendChild(b)}}u.appendChild(this.dom.createTextNode(c?r.slice(c):r,this.element));if(!f(n.type)){var w="ace_"+n.type.replace(/\./g," ace_"),b=this.dom.createElement("span");n.type=="fold"&&(b.style.width=n.value.length*this.config.characterWidth+"px",b.setAttribute("title",a("inline-fold.closed.title","Unfold code"))),b.className=w,b.appendChild(u),e.appendChild(b)}else e.appendChild(u);return t+r.length},e.prototype.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(t[0]==" "){r-=r%this.tabSize;var i=r/this.tabSize;for(var s=0;ss[o].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&e[t.row]!==""&&t.column===e[t.row].length){this.$highlightIndentGuideMarker.dir=1;for(var o=t.row+1;o0)for(var i=0;i=this.$highlightIndentGuideMarker.start+1){if(r.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(r,t)}}else for(var n=e.length-1;n>=0;n--){var r=e[n];if(this.$highlightIndentGuideMarker.end&&r.row=o)u=this.$renderToken(a,u,l,c.substring(0,o-r)),c=c.substring(o-r),r=o,a=this.$createLineElement(),e.appendChild(a),a.appendChild(this.dom.createTextNode(s.stringRepeat("\u00a0",n.indent),this.element)),i++,u=0,o=n[i]||Number.MAX_VALUE;c.length!=0&&(r+=c.length,u=this.$renderToken(a,u,l,c))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(a,u,null,"",!0)},e.prototype.$renderSimpleLine=function(e,t){var n=0;for(var r=0;rthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,i,s);n=this.$renderToken(e,n,i,s)}},e.prototype.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=i?"":"",e.appendChild(s)},e.prototype.$renderLine=function(e,t,n){!n&&n!=0&&(n=this.session.getFoldLine(t));if(n)var r=this.$getFoldLineTokens(t,n);else var r=this.session.getTokens(t);var i=e;if(r.length){var s=this.session.getRowSplitData(t);if(s&&s.length){this.$renderWrappedLine(e,r,s);var i=e.lastChild}else{var i=e;this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r)}}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showEOL&&i){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},e.prototype.$getFoldLineTokens=function(e,t){function i(e,t,n){var i=0,s=0;while(s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1}while(sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}var n=this.session,r=[],s=n.getTokens(e);return t.walk(function(e,t,o,u,a){e!=null?r.push({type:"fold",value:e}):(a&&(s=n.getTokens(t)),s.length&&i(s,u,o))},t.end.row,this.session.getLine(t.end.row).length),r},e.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},e}();l.prototype.EOF_CHAR="\u00b6",l.prototype.EOL_CHAR_LF="\u00ac",l.prototype.EOL_CHAR_CRLF="\u00a4",l.prototype.EOL_CHAR=l.prototype.EOL_CHAR_LF,l.prototype.TAB_CHAR="\u2014",l.prototype.SPACE_CHAR="\u00b7",l.prototype.$padding=0,l.prototype.MAX_LINE_LENGTH=1e4,l.prototype.showInvisibles=!1,l.prototype.showSpaces=!1,l.prototype.showTabs=!1,l.prototype.showEOL=!1,l.prototype.displayIndentGuides=!0,l.prototype.$highlightIndentGuides=!0,l.prototype.$tabStrings=[],l.prototype.destroy={},l.prototype.onChangeTabSize=l.prototype.$computeTabString,r.implement(l.prototype,u),t.Text=l}),define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(){function e(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return e.prototype.$updateOpacity=function(e){var t=this.cursors;for(var n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},e.prototype.$startCssAnimation=function(){var e=this.cursors;for(var t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},e.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,r.removeCssClass(this.element,"ace_animate-blinking")},e.prototype.setPadding=function(e){this.$padding=e},e.prototype.setSession=function(e){this.session=e},e.prototype.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},e.prototype.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},e.prototype.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},e.prototype.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},e.prototype.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},e.prototype.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},e.prototype.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},e.prototype.restartTimer=function(){var e=this.$updateCursors;clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,r.removeCssClass(this.element,"ace_smooth-blinking")),e(!0);if(!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)));if(r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}},e.prototype.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e),r=this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),i=(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:r,top:i}},e.prototype.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)continue;var u=this.cursors[i++]||this.addCursor(),a=u.style;this.drawCursor?this.drawCursor(u,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(a,"display","block"),r.translate(u,o.left,o.top),r.setStyle(a,"width",Math.round(e.characterWidth)+"px"),r.setStyle(a,"height",e.lineHeight+"px")):r.setStyle(a,"display","none")}while(this.cursors.length>i)this.removeCursor();var f=this.session.getOverwrite();this.$setOverwrite(f),this.$pixelPos=o,this.restartTimer()},e.prototype.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},e.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},e}();i.prototype.$padding=0,i.prototype.drawCursor=null,t.Cursor=i}),define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=e("./lib/oop"),s=e("./lib/dom"),o=e("./lib/event"),u=e("./lib/event_emitter").EventEmitter,a=32768,f=function(){function e(e,t){this.element=s.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+t,this.inner=s.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent="\u00a0",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,o.addListener(this.element,"scroll",this.onScroll.bind(this)),o.addListener(this.element,"mousedown",o.preventDefault)}return e.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},e}();i.implement(f.prototype,u);var l=function(e){function t(t,n){var r=e.call(this,t,"-v")||this;return r.scrollTop=0,r.scrollHeight=0,n.$scrollbarWidth=r.width=s.scrollbarWidth(t.ownerDocument),r.inner.style.width=r.element.style.width=(r.width||15)+5+"px",r.$minWidth=0,r}return r(t,e),t.prototype.onScroll=function(){if(!this.skipEvent){this.scrollTop=this.element.scrollTop;if(this.coeff!=1){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},t.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},t.prototype.setHeight=function(e){this.element.style.height=e+"px"},t.prototype.setScrollHeight=function(e){this.scrollHeight=e,e>a?(this.coeff=a/e,e=a):this.coeff!=1&&(this.coeff=1),this.inner.style.height=e+"px"},t.prototype.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)},t}(f);l.prototype.setInnerHeight=l.prototype.setScrollHeight;var c=function(e){function t(t,n){var r=e.call(this,t,"-h")||this;return r.scrollLeft=0,r.height=n.$scrollbarWidth,r.inner.style.height=r.element.style.height=(r.height||15)+5+"px",r}return r(t,e),t.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},t.prototype.getHeight=function(){return this.isVisible?this.height:0},t.prototype.setWidth=function(e){this.element.style.width=e+"px"},t.prototype.setInnerWidth=function(e){this.inner.style.width=e+"px"},t.prototype.setScrollWidth=function(e){this.inner.style.width=e+"px"},t.prototype.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)},t}(f);t.ScrollBar=l,t.ScrollBarV=l,t.ScrollBarH=c,t.VScrollBar=l,t.HScrollBar=c}),define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=e("./lib/oop"),s=e("./lib/dom"),o=e("./lib/event"),u=e("./lib/event_emitter").EventEmitter;s.importCssString(".ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{\n position: absolute;\n background: rgba(128, 128, 128, 0.6);\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n border: 1px solid #bbb;\n border-radius: 2px;\n z-index: 8;\n}\n.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {\n position: absolute;\n z-index: 6;\n background: none;\n overflow: hidden!important;\n}\n.ace_editor>.ace_sb-v {\n z-index: 6;\n right: 0;\n top: 0;\n width: 12px;\n}\n.ace_editor>.ace_sb-v div {\n z-index: 8;\n right: 0;\n width: 100%;\n}\n.ace_editor>.ace_sb-h {\n bottom: 0;\n left: 0;\n height: 12px;\n}\n.ace_editor>.ace_sb-h div {\n bottom: 0;\n height: 100%;\n}\n.ace_editor>.ace_sb_grabbed {\n z-index: 8;\n background: #000;\n}","ace_scrollbar.css",!1);var a=function(){function e(e,t){this.element=s.createElement("div"),this.element.className="ace_sb"+t,this.inner=s.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,o.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return e.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},e}();i.implement(a.prototype,u);var f=function(e){function t(t,n){var r=e.call(this,t,"-v")||this;return r.scrollTop=0,r.scrollHeight=0,r.parent=t,r.width=r.VScrollWidth,r.renderer=n,r.inner.style.width=r.element.style.width=(r.width||15)+"px",r.$minWidth=0,r}return r(t,e),t.prototype.onMouseDown=function(e,t){if(e!=="mousedown")return;if(o.getButton(t)!==0||t.detail===2)return;if(t.target===this.inner){var n=this,r=t.clientY,i=function(e){r=e.clientY},s=function(){clearInterval(l)},u=t.clientY,a=this.thumbTop,f=function(){if(r===undefined)return;var e=n.scrollTopFromThumbTop(a+r-u);if(e===n.scrollTop)return;n._emit("scroll",{data:e})};o.capture(this.inner,i,s);var l=setInterval(f,20);return o.preventDefault(t)}var c=t.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(c)}),o.preventDefault(t)},t.prototype.getHeight=function(){return this.height},t.prototype.scrollTopFromThumbTop=function(e){var t=e*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return t>>=0,t<0?t=0:t>this.pageHeight-this.viewHeight&&(t=this.pageHeight-this.viewHeight),t},t.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},t.prototype.setHeight=function(e){this.height=Math.max(0,e),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},t.prototype.setScrollHeight=function(e,t){if(this.pageHeight===e&&!t)return;this.pageHeight=e,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop}))},t.prototype.setScrollTop=function(e){this.scrollTop=e,e<0&&(e=0),this.thumbTop=e*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},t}(a);f.prototype.setInnerHeight=f.prototype.setScrollHeight;var l=function(e){function t(t,n){var r=e.call(this,t,"-h")||this;return r.scrollLeft=0,r.scrollWidth=0,r.height=r.HScrollHeight,r.inner.style.height=r.element.style.height=(r.height||12)+"px",r.renderer=n,r}return r(t,e),t.prototype.onMouseDown=function(e,t){if(e!=="mousedown")return;if(o.getButton(t)!==0||t.detail===2)return;if(t.target===this.inner){var n=this,r=t.clientX,i=function(e){r=e.clientX},s=function(){clearInterval(l)},u=t.clientX,a=this.thumbLeft,f=function(){if(r===undefined)return;var e=n.scrollLeftFromThumbLeft(a+r-u);if(e===n.scrollLeft)return;n._emit("scroll",{data:e})};o.capture(this.inner,i,s);var l=setInterval(f,20);return o.preventDefault(t)}var c=t.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(c)}),o.preventDefault(t)},t.prototype.getHeight=function(){return this.isVisible?this.height:0},t.prototype.scrollLeftFromThumbLeft=function(e){var t=e*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return t>>=0,t<0?t=0:t>this.pageWidth-this.viewWidth&&(t=this.pageWidth-this.viewWidth),t},t.prototype.setWidth=function(e){this.width=Math.max(0,e),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},t.prototype.setScrollWidth=function(e,t){if(this.pageWidth===e&&!t)return;this.pageWidth=e,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft}))},t.prototype.setScrollLeft=function(e){this.scrollLeft=e,e<0&&(e=0),this.thumbLeft=e*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},t}(a);l.prototype.setInnerWidth=l.prototype.setScrollWidth,t.ScrollBar=f,t.ScrollBarV=f,t.ScrollBarH=l,t.VScrollBar=f,t.HScrollBar=l}),define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(){function e(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;t&&(r.blockIdle(100),n.changes=0,n.onRender(t));if(n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}}return e.prototype.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},e.prototype.clear=function(e){var t=this.changes;return this.changes=0,t},e}();t.RenderLoop=i}),define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),u=e("../lib/useragent"),a=e("../lib/event_emitter").EventEmitter,f=512,l=typeof ResizeObserver=="function",c=200,h=function(){function e(e){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.textContent=s.stringRepeat("X",f),this.$characterSize={width:0,height:0},l?this.$addObserver():this.checkForSizeChanges()}return e.prototype.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",u.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},e.prototype.checkForSizeChanges=function(e){e===undefined&&(e=this.$measureSizes());if(e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},e.prototype.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){e.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},e.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},e.prototype.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},e.prototype.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/f};return t.width===0||t.height===0?null:t},e.prototype.$measureCharWidth=function(e){this.$main.textContent=s.stringRepeat(e,f);var t=this.$main.getBoundingClientRect();return t.width/f},e.prototype.getCharacterWidth=function(e){var t=this.charSizes[e];return t===undefined&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},e.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.$getZoom=function(e){return!e||!e.parentElement?1:(window.getComputedStyle(e).zoom||1)*this.$getZoom(e.parentElement)},e.prototype.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=i.buildDom([e(0,0),e(c,0),e(0,c),e(c,c)],this.el)},e.prototype.transformCoordinates=function(e,t){function r(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function i(e,t){return[e[0]-t[0],e[1]-t[1]]}function s(e,t){return[e[0]+t[0],e[1]+t[1]]}function o(e,t){return[e*t[0],e*t[1]]}function u(e){var t=e.getBoundingClientRect();return[t.left,t.top]}if(e){var n=this.$getZoom(this.el);e=o(1/n,e)}this.els||this.$initTransformMeasureNodes();var a=u(this.els[0]),f=u(this.els[1]),l=u(this.els[2]),h=u(this.els[3]),p=r(i(h,f),i(h,l),i(s(f,l),s(h,a))),d=o(1+p[0],i(f,a)),v=o(1+p[1],i(l,a));if(t){var m=t,g=p[0]*m[0]/c+p[1]*m[1]/c+1,y=s(o(m[0],d),o(m[1],v));return s(o(1/g/c,y),a)}var b=i(e,a),w=r(i(d,o(p[0],b)),i(v,o(p[1],b)),b);return o(c,w)},e}();h.prototype.$characterSize={width:0,height:0},r.implement(h.prototype,a),t.FontMetrics=h}),define("ace/css/editor-css",["require","exports","module"],function(e,t,n){n.exports='\n.ace_br1 {border-top-left-radius : 3px;}\n.ace_br2 {border-top-right-radius : 3px;}\n.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}\n.ace_br4 {border-bottom-right-radius: 3px;}\n.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}\n.ace_br8 {border-bottom-left-radius : 3px;}\n.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n\n\n.ace_editor {\n position: relative;\n overflow: hidden;\n padding: 0;\n font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'Source Code Pro\', \'source-code-pro\', monospace;\n direction: ltr;\n text-align: left;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n.ace_scroller {\n position: absolute;\n overflow: hidden;\n top: 0;\n bottom: 0;\n background-color: inherit;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n cursor: text;\n}\n\n.ace_content {\n position: absolute;\n box-sizing: border-box;\n min-width: 100%;\n contain: style size layout;\n font-variant-ligatures: no-common-ligatures;\n}\n\n.ace_keyboard-focus:focus {\n box-shadow: inset 0 0 0 2px #5E9ED6;\n outline: none;\n}\n\n.ace_dragging .ace_scroller:before{\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n content: \'\';\n background: rgba(250, 250, 250, 0.01);\n z-index: 1000;\n}\n.ace_dragging.ace_dark .ace_scroller:before{\n background: rgba(0, 0, 0, 0.01);\n}\n\n.ace_gutter {\n position: absolute;\n overflow : hidden;\n width: auto;\n top: 0;\n bottom: 0;\n left: 0;\n cursor: default;\n z-index: 4;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n contain: style size layout;\n}\n\n.ace_gutter-active-line {\n position: absolute;\n left: 0;\n right: 0;\n}\n\n.ace_scroller.ace_scroll-left:after {\n content: "";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\n pointer-events: none;\n}\n\n.ace_gutter-cell, .ace_gutter-cell_svg-icons {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-left: 19px;\n padding-right: 6px;\n background-repeat: no-repeat;\n}\n\n.ace_gutter-cell_svg-icons .ace_gutter_annotation {\n margin-left: -14px;\n float: left;\n}\n\n.ace_gutter-cell .ace_gutter_annotation {\n margin-left: -19px;\n float: left;\n}\n\n.ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_info, .ace_icon.ace_info {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n.ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");\n}\n\n.ace_icon_svg.ace_error {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==");\n background-color: darkorange;\n}\n.ace_icon_svg.ace_info {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==");\n background-color: royalblue;\n}\n\n.ace_icon_svg.ace_error_fold {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning_fold {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=");\n background-color: darkorange;\n}\n\n.ace_scrollbar {\n contain: strict;\n position: absolute;\n right: 0;\n bottom: 0;\n z-index: 6;\n}\n\n.ace_scrollbar-inner {\n position: absolute;\n cursor: text;\n left: 0;\n top: 0;\n}\n\n.ace_scrollbar-v{\n overflow-x: hidden;\n overflow-y: scroll;\n top: 0;\n}\n\n.ace_scrollbar-h {\n overflow-x: scroll;\n overflow-y: hidden;\n left: 0;\n}\n\n.ace_print-margin {\n position: absolute;\n height: 100%;\n}\n\n.ace_text-input {\n position: absolute;\n z-index: 0;\n width: 0.5em;\n height: 1em;\n opacity: 0;\n background: transparent;\n -moz-appearance: none;\n appearance: none;\n border: none;\n resize: none;\n outline: none;\n overflow: hidden;\n font: inherit;\n padding: 0 1px;\n margin: 0 -1px;\n contain: strict;\n -ms-user-select: text;\n -moz-user-select: text;\n -webkit-user-select: text;\n user-select: text;\n /*with `pre-line` chrome inserts   instead of space*/\n white-space: pre!important;\n}\n.ace_text-input.ace_composition {\n background: transparent;\n color: inherit;\n z-index: 1000;\n opacity: 1;\n}\n.ace_composition_placeholder { color: transparent }\n.ace_composition_marker { \n border-bottom: 1px solid;\n position: absolute;\n border-radius: 0;\n margin-top: 1px;\n}\n\n[ace_nocontext=true] {\n transform: none!important;\n filter: none!important;\n clip-path: none!important;\n mask : none!important;\n contain: none!important;\n perspective: none!important;\n mix-blend-mode: initial!important;\n z-index: auto;\n}\n\n.ace_layer {\n z-index: 1;\n position: absolute;\n overflow: hidden;\n /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/\n word-wrap: normal;\n white-space: pre;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n /* setting pointer-events: auto; on node under the mouse, which changes\n during scroll, will break mouse wheel scrolling in Safari */\n pointer-events: none;\n}\n\n.ace_gutter-layer {\n position: relative;\n width: auto;\n text-align: right;\n pointer-events: auto;\n height: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer {\n font: inherit !important;\n position: absolute;\n height: 1000000px;\n width: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {\n contain: style size layout;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n}\n\n.ace_hidpi .ace_text-layer,\n.ace_hidpi .ace_gutter-layer,\n.ace_hidpi .ace_content,\n.ace_hidpi .ace_gutter {\n contain: strict;\n}\n.ace_hidpi .ace_text-layer > .ace_line, \n.ace_hidpi .ace_text-layer > .ace_line_group {\n contain: strict;\n}\n\n.ace_cjk {\n display: inline-block;\n text-align: center;\n}\n\n.ace_cursor-layer {\n z-index: 4;\n}\n\n.ace_cursor {\n z-index: 4;\n position: absolute;\n box-sizing: border-box;\n border-left: 2px solid;\n /* workaround for smooth cursor repaintng whole screen in chrome */\n transform: translatez(0);\n}\n\n.ace_multiselect .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_slim-cursors .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_overwrite-cursors .ace_cursor {\n border-left-width: 0;\n border-bottom: 1px solid;\n}\n\n.ace_hidden-cursors .ace_cursor {\n opacity: 0.2;\n}\n\n.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\n opacity: 0;\n}\n\n.ace_smooth-blinking .ace_cursor {\n transition: opacity 0.18s;\n}\n\n.ace_animate-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: step-end;\n animation-name: blink-ace-animate;\n animation-iteration-count: infinite;\n}\n\n.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: ease-in-out;\n animation-name: blink-ace-animate-smooth;\n}\n \n@keyframes blink-ace-animate {\n from, to { opacity: 1; }\n 60% { opacity: 0; }\n}\n\n@keyframes blink-ace-animate-smooth {\n from, to { opacity: 1; }\n 45% { opacity: 1; }\n 60% { opacity: 0; }\n 85% { opacity: 0; }\n}\n\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 6;\n}\n\n.ace_marker-layer .ace_error_bracket {\n position: absolute;\n border-bottom: 1px solid #DE5555;\n border-radius: 0;\n}\n\n.ace_marker-layer .ace_active-line {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selected-word {\n position: absolute;\n z-index: 4;\n box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n box-sizing: border-box;\n\n display: inline-block;\n height: 11px;\n margin-top: -2px;\n vertical-align: middle;\n\n background-image:\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n color: transparent;\n\n border: 1px solid black;\n border-radius: 2px;\n\n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n background-image:\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");\n}\n\n.ace_tooltip {\n background-color: #f5f5f5;\n border: 1px solid gray;\n border-radius: 1px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n color: black;\n max-width: 100%;\n padding: 3px 4px;\n position: fixed;\n z-index: 999999;\n box-sizing: border-box;\n cursor: default;\n white-space: pre-wrap;\n word-wrap: break-word;\n line-height: normal;\n font-style: normal;\n font-weight: normal;\n letter-spacing: normal;\n pointer-events: none;\n overflow: auto;\n max-width: min(60em, 66vw);\n overscroll-behavior: contain;\n}\n.ace_tooltip pre {\n white-space: pre-wrap;\n}\n\n.ace_tooltip.ace_dark {\n background-color: #636363;\n color: #fff;\n}\n\n.ace_tooltip:focus {\n outline: 1px solid #5E9ED6;\n}\n\n.ace_icon {\n display: inline-block;\n width: 18px;\n vertical-align: top;\n}\n\n.ace_icon_svg {\n display: inline-block;\n width: 12px;\n vertical-align: top;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: 12px;\n -webkit-mask-position: center;\n}\n\n.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {\n padding-right: 13px;\n}\n\n.ace_fold-widget {\n box-sizing: border-box;\n\n margin: 0 -12px 0 1px;\n display: none;\n width: 11px;\n vertical-align: top;\n\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");\n background-repeat: no-repeat;\n background-position: center;\n\n border-radius: 3px;\n \n border: 1px solid transparent;\n cursor: pointer;\n}\n\n.ace_folding-enabled .ace_fold-widget {\n display: inline-block; \n}\n\n.ace_fold-widget.ace_end {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");\n}\n\n.ace_fold-widget.ace_closed {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");\n}\n\n.ace_fold-widget:hover {\n border: 1px solid rgba(0, 0, 0, 0.3);\n background-color: rgba(255, 255, 255, 0.2);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n}\n\n.ace_fold-widget:active {\n border: 1px solid rgba(0, 0, 0, 0.4);\n background-color: rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n}\n/**\n * Dark version for fold widgets\n */\n.ace_dark .ace_fold-widget {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");\n}\n.ace_dark .ace_fold-widget.ace_end {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");\n}\n.ace_dark .ace_fold-widget.ace_closed {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");\n}\n.ace_dark .ace_fold-widget:hover {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n background-color: rgba(255, 255, 255, 0.1);\n}\n.ace_dark .ace_fold-widget:active {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n}\n\n.ace_inline_button {\n border: 1px solid lightgray;\n display: inline-block;\n margin: -1px 8px;\n padding: 0 5px;\n pointer-events: auto;\n cursor: pointer;\n}\n.ace_inline_button:hover {\n border-color: gray;\n background: rgba(200,200,200,0.2);\n display: inline-block;\n pointer-events: auto;\n}\n\n.ace_fold-widget.ace_invalid {\n background-color: #FFB4B4;\n border-color: #DE5555;\n}\n\n.ace_fade-fold-widgets .ace_fold-widget {\n transition: opacity 0.4s ease 0.05s;\n opacity: 0;\n}\n\n.ace_fade-fold-widgets:hover .ace_fold-widget {\n transition: opacity 0.05s ease 0.05s;\n opacity:1;\n}\n\n.ace_underline {\n text-decoration: underline;\n}\n\n.ace_bold {\n font-weight: bold;\n}\n\n.ace_nobold .ace_bold {\n font-weight: normal;\n}\n\n.ace_italic {\n font-style: italic;\n}\n\n\n.ace_error-marker {\n background-color: rgba(255, 0, 0,0.2);\n position: absolute;\n z-index: 9;\n}\n\n.ace_highlight-marker {\n background-color: rgba(255, 255, 0,0.2);\n position: absolute;\n z-index: 8;\n}\n\n.ace_mobile-menu {\n position: absolute;\n line-height: 1.5;\n border-radius: 4px;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n background: white;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #dcdcdc;\n color: black;\n}\n.ace_dark > .ace_mobile-menu {\n background: #333;\n color: #ccc;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #444;\n\n}\n.ace_mobile-button {\n padding: 2px;\n cursor: pointer;\n overflow: hidden;\n}\n.ace_mobile-button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_mobile-button:active {\n background-color: #ddd;\n}\n\n.ace_placeholder {\n font-family: arial;\n transform: scale(0.9);\n transform-origin: left;\n white-space: pre;\n opacity: 0.7;\n margin: 0 10px;\n}\n\n.ace_ghost_text {\n opacity: 0.5;\n font-style: italic;\n white-space: pre;\n}\n\n.ace_screenreader-only {\n position:absolute;\n left:-10000px;\n top:auto;\n width:1px;\n height:1px;\n overflow:hidden;\n}'}),define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event_emitter").EventEmitter,o=function(){function e(e,t){this.canvas=r.createElement("canvas"),this.renderer=t,this.pixelRatio=1,this.maxHeight=t.layerConfig.maxHeight,this.lineHeight=t.layerConfig.lineHeight,this.canvasHeight=e.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=e.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},e.element.appendChild(this.canvas)}return e.prototype.$updateDecorators=function(e){function i(e,t){return e.priorityt.priority?1:0}var t=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(e){this.maxHeight=e.maxHeight,this.lineHeight=e.lineHeight,this.canvasHeight=e.height;var n=(e.lastRow+1)*this.lineHeight;nthis.canvasHeight&&(v=this.canvasHeight-this.halfMinDecorationHeight),h=Math.round(v-this.halfMinDecorationHeight),p=Math.round(v+this.halfMinDecorationHeight)}r.fillStyle=t[s[a].type]||null,r.fillRect(0,c,this.canvasWidth,p-h)}}var m=this.renderer.session.selection.getCursor();if(m){var l=this.compensateFoldRows(m.row,u),c=Math.round((m.row-l)*this.lineHeight*this.heightRatio);r.fillStyle="rgba(0, 0, 0, 0.5)",r.fillRect(0,c,this.canvasWidth,2)}},e.prototype.compensateFoldRows=function(e,t){var n=0;if(t&&t.length>0)for(var r=0;rt[r].start.row&&e=t[r].end.row&&(n+=t[r].end.row-t[r].start.row);return n},e}();i.implement(o.prototype,s),t.Decorator=o}),define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/lang"),o=e("./config"),u=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,f=e("./layer/text").Text,l=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,p=e("./scrollbar_custom").HScrollBar,d=e("./scrollbar_custom").VScrollBar,v=e("./renderloop").RenderLoop,m=e("./layer/font_metrics").FontMetrics,g=e("./lib/event_emitter").EventEmitter,y=e("./css/editor-css"),b=e("./layer/decorators").Decorator,w=e("./lib/useragent");i.importCssString(y,"ace_editor.css",!1);var E=function(){function e(e,t){var n=this;this.container=e||i.createElement("div"),i.addCssClass(this.container,"ace_editor"),i.HI_DPI&&i.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),o.get("useStrictCSP")==null&&o.set("useStrictCSP",!1),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new u(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var r=this.$textLayer=new f(this.content);this.canvas=r.element,this.$markerFront=new a(this.content),this.$cursorLayer=new l(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.on("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.on("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new m(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!w.isIOS,this.$loop=new v(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),o.resetOptions(this),o._signal("renderer",this)}return e.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),i.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},e.prototype.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e);if(!e)return;this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode)},e.prototype.updateLines=function(e,t,n){t===undefined&&(t=Infinity),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow)return;this.$loop.schedule(this.CHANGE_LINES)},e.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},e.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},e.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},e.prototype.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},e.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},e.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},e.prototype.onResize=function(e,t,n,r){if(this.resizing>2)return;this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);this.$resizeTimer&&this.$resizeTimer.cancel();if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)},e.prototype.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var s=0,o=this.$size,u={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};r&&(e||o.height!=r)&&(o.height=r,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(o.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL);if(n&&(e||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,t==null&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,"left",t+"px"),i.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,"left",this.margin.left+"px");var a=this.scrollBarV.getWidth()+"px";i.setStyle(this.scrollBarH.element.style,"right",a),i.setStyle(this.scroller.style,"right",a),i.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(o.scrollerWidth);if(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)s|=this.CHANGE_FULL}return o.$dirty=!n||!r,s&&this._signal("resize",u),s},e.prototype.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},e.prototype.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-this.$padding*2,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},e.prototype.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},e.prototype.getAnimatedScroll=function(){return this.$animatedScroll},e.prototype.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},e.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},e.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},e.prototype.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},e.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},e.prototype.setHighlightIndentGuides=function(e){this.setOption("highlightIndentGuides",e)},e.prototype.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},e.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},e.prototype.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},e.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},e.prototype.getShowGutter=function(){return this.getOption("showGutter")},e.prototype.setShowGutter=function(e){return this.setOption("showGutter",e)},e.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},e.prototype.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},e.prototype.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},e.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},e.prototype.$updatePrintMargin=function(){if(!this.$showPrintMargin&&!this.$printMarginEl)return;if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()},e.prototype.getContainerElement=function(){return this.container},e.prototype.getMouseEventTarget=function(){return this.scroller},e.prototype.getTextAreaContainer=function(){return this.container},e.prototype.$moveTextAreaToCursor=function(){if(this.$isMousePressed)return;var e=this.textarea.style,t=this.$composition;if(!this.$keepTextAreaAtCursor&&!t){i.translate(this.textarea,-100,0);return}var n=this.$cursorLayer.$pixelPos;if(!n)return;t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,s=n.top,o=n.left;s-=r.offset;var u=t&&t.useTextareaForIME||w.isMobile?this.lineHeight:1;if(s<0||s>r.height-u){i.translate(this.textarea,0,0);return}var a=1,f=this.$size.height-u;if(!t)s+=this.lineHeight;else if(t.useTextareaForIME){var l=this.textarea.value;a=this.characterWidth*this.session.$getStringScreenWidth(l)[0]}else s+=this.lineHeight+2;o-=this.scrollLeft,o>this.$size.scrollerWidth-a&&(o=this.$size.scrollerWidth-a),o+=this.gutterWidth+this.margin.left,i.setStyle(e,"height",u+"px"),i.setStyle(e,"width",a+"px"),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-a),Math.min(s,f))},e.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},e.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},e.prototype.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow,n=this.session.documentToScreenRow(t,0)*e.lineHeight;return n-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},e.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},e.prototype.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},e.prototype.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=e|0,i.bottom=t|0,i.right=r|0,i.left=n|0,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},e.prototype.setMargin=function(e,t,n,r){var i=this.margin;i.top=e|0,i.bottom=t|0,i.right=r|0,i.left=n|0,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},e.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},e.prototype.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},e.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},e.prototype.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},e.prototype.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},e.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},e.prototype.freeze=function(){this.$frozen=!0},e.prototype.unfreeze=function(){this.$frozen=!1},e.prototype.$renderChanges=function(e,t){this.$changes&&(e|=this.$changes,this.$changes=0);if(!this.session||!this.container.offsetWidth||this.$frozen||!e&&!t){this.$changes|=e;return}if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",e),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){e|=this.$computeLayerConfig()|this.$loop.clear();if(n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var s=n.width+2*this.$padding+"px",o=n.minHeight+"px";i.setStyle(this.content.style,"width",s),i.setStyle(this.content.style,"height",o)}e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName));if(e&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),this._signal("afterRender",e);return}if(e&this.CHANGE_SCROLL){this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),this._signal("afterRender",e);return}e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)):e&this.CHANGE_LINES?((this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)):e&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender",e)},e.prototype.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=n<=2*this.lineHeight,i=!r&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||i!=this.$vScroll){i!=this.$vScroll&&(this.$vScroll=i,this.scrollBarV.setVisible(i));var s=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,s,n),this.desiredHeight=n,this._signal("autosize")}},e.prototype.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength(),i=r*this.lineHeight,s=this.$getLongestLine(),o=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-s-2*this.$padding<0),u=this.$horizScroll!==o;u&&(this.$horizScroll=o,this.scrollBarH.setVisible(o));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var f=t.scrollerHeight+this.lineHeight,l=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;i+=l;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,i-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,s+2*this.$padding-t.scrollerWidth+c.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-i+l<0||this.scrollTop>c.top),p=a!==h;p&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var d=this.scrollTop%this.lineHeight,v=Math.ceil(f/this.lineHeight)-1,m=Math.max(0,Math.round((this.scrollTop-d)/this.lineHeight)),g=m+v,y,b,w=this.lineHeight;m=e.screenToDocumentRow(m,0);var E=e.getFoldLine(m);E&&(m=E.start.row),y=e.documentToScreenRow(m,0),b=e.getRowLength(m)*w,g=Math.min(e.screenToDocumentRow(g,0),e.getLength()-1),f=t.scrollerHeight+e.getRowLength(g)*w+b,d=this.scrollTop-y*w;var S=0;if(this.layerConfig.width!=s||u)S=this.CHANGE_H_SCROLL;if(u||p)S|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),p&&(s=this.$getLongestLine());return this.layerConfig={width:s,padding:this.$padding,firstRow:m,firstRowScreen:y,lastRow:g,lineHeight:w,characterWidth:this.characterWidth,minHeight:f,maxHeight:i,offset:d,gutterOffset:w?Math.max(0,Math.ceil((d+t.height-t.scrollerHeight)/w)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(s-this.$padding),S},e.prototype.$updateLines=function(){if(!this.$changedLines)return;var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(e>n.lastRow+1)return;if(tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},e.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},e.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},e.prototype.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},e.prototype.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},e.prototype.updateBreakpoints=function(e){this._rows=e,this.$loop.schedule(this.CHANGE_GUTTER)},e.prototype.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},e.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},e.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},e.prototype.showCursor=function(){this.$cursorLayer.showCursor()},e.prototype.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},e.prototype.scrollCursorIntoView=function(e,t,n){if(this.$size.scrollerHeight===0)return;var r=this.$cursorLayer.getPixelPosition(e),i=r.left,s=r.top,o=n&&n.top||0,u=n&&n.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var a=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;a+o>s?(t&&a+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),s===0&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):a+this.$size.scrollerHeight-u=1-this.scrollMargin.top)return!0;if(t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom)return!0;if(e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left)return!0;if(e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},e.prototype.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),u=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:u,side:s-u>0?1:-1,offsetX:i}},e.prototype.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),u=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(u,Math.max(o,0),i)},e.prototype.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},e.prototype.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},e.prototype.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},e.prototype.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),e.useTextareaForIME==undefined&&(e.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},e.prototype.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},e.prototype.hideComposition=function(){if(!this.$composition)return;this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var e=this.session.selection.cursor;this.removeExtraToken(e.row,e.column),this.$composition=null,this.$cursorLayer.element.style.display=""},e.prototype.setGhostText=function(e,t){var n=this.session.selection.cursor,r=t||{row:n.row,column:n.column};this.removeGhostText();var i=e.split("\n");this.addToken(i[0],"ghost_text",r.row,r.column),this.$ghostText={text:e,position:{row:r.row,column:r.column}};if(i.length>1){this.$ghostTextWidget={text:i.slice(1).join("\n"),row:r.row,column:r.column,className:"ace_ghost_text"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var s=this.$cursorLayer.getPixelPosition(r,!0),o=this.container,u=o.getBoundingClientRect().height,a=i.length*this.lineHeight,f=a1||Math.abs(e.$size.height-r)>1?e.$resizeTimer.delay():e.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)},e}();E.prototype.CHANGE_CURSOR=1,E.prototype.CHANGE_MARKER=2,E.prototype.CHANGE_GUTTER=4,E.prototype.CHANGE_SCROLL=8,E.prototype.CHANGE_LINES=16,E.prototype.CHANGE_TEXT=32,E.prototype.CHANGE_SIZE=64,E.prototype.CHANGE_MARKER_BACK=128,E.prototype.CHANGE_MARKER_FRONT=256,E.prototype.CHANGE_FULL=512,E.prototype.CHANGE_H_SCROLL=1024,E.prototype.$changes=0,E.prototype.$padding=null,E.prototype.$frozen=!1,E.prototype.STEPS=8,r.implement(E.prototype,g),o.defineOptions(E.prototype,"renderer",{useResizeObserver:{set:function(e){!e&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):e&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){typeof e=="number"&&(this.$printMarginColumn=e),this.$showPrintMargin=!!e,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(e){this.$gutterLayer.$useSvgGutterIcons=e},initialValue:!1},showFoldedAnnotations:{set:function(e){this.$gutterLayer.$showFoldedAnnotations=e},initialValue:!1},fadeFoldWidgets:{set:function(e){i.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(e){this.$textLayer.setHighlightIndentGuides(e)==1?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(e){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){typeof e=="number"&&(e+="px"),this.container.style.fontSize=e,this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e,this.updateFontSize()}},maxLines:{set:function(e){this.updateFull()}},minLines:{set:function(e){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){e=+e||0;if(this.$scrollPastEnd==e)return;this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(e){this.$updateCustomScrollbar(e)},initialValue:!1},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!w.isMobile&&!w.isIE}}),t.VirtualRenderer=E}),define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(e,t,n){"use strict";function u(e){var t="importScripts('"+i.qualifyURL(e)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(n){var r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,s=new r;return s.append(t),s.getBlob("application/javascript")}}function a(e){if(typeof Worker=="undefined")return{postMessage:function(){},terminate:function(){}};if(o.get("loadWorkerFromBlob")){var t=u(e),n=window.URL||window.webkitURL,r=n.createObjectURL(t);return new Worker(r)}return new Worker(e)}var r=e("../lib/oop"),i=e("../lib/net"),s=e("../lib/event_emitter").EventEmitter,o=e("../config"),f=function(e){e.postMessage||(e=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=e,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){r.implement(this,s),this.$createWorkerFromOldConfig=function(t,n,r,i,s){e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl);if(o.get("packaged")||!e.toUrl)i=i||o.moduleUrl(n,"worker");else{var u=this.$normalizePath;i=i||u(e.toUrl("ace/worker/worker.js",null,"_"));var f={};t.forEach(function(t){f[t]=u(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=a(i),s&&this.send("importScripts",s),this.$worker.postMessage({init:!0,tlns:f,module:n,classname:r}),this.$worker},this.onMessage=function(e){var t=e.data;switch(t.type){case"event":this._signal(t.name,{data:t.data});break;case"call":var n=this.callbacks[t.id];n&&(n(t.data),delete this.callbacks[t.id]);break;case"error":this.reportError(t.data);break;case"log":window.console&&console.log&&console.log.apply(console,t.data)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return i.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(e){e.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(e,t){this.$worker.postMessage({command:e,args:t})},this.call=function(e,t,n){if(n){var r=this.callbackId++;this.callbacks[r]=n,t.push(r)}this.send(e,t)},this.emit=function(e,t){try{t.data&&t.data.err&&(t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code}),this.$worker&&this.$worker.postMessage({event:e,data:{data:t.data}})}catch(n){console.error(n.stack)}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call("setValue",[e.getValue()]),e.on("change",this.changeListener,!0)},this.changeListener=function(e){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),e.action=="insert"?this.deltaQueue.push(e.start,e.lines):this.deltaQueue.push(e.start,e.end)},this.$sendDeltaQueue=function(){var e=this.deltaQueue;if(!e)return;this.deltaQueue=null,e.length>50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e})}}).call(f.prototype);var l=function(e,t,n){var r=null,i=!1,u=Object.create(s),a=[],l=new f({messageBuffer:a,terminate:function(){},postMessage:function(e){a.push(e);if(!r)return;i?setTimeout(c):c()}});l.setEmitSync=function(e){i=e};var c=function(){var e=a.shift();e.command?r[e.command].apply(r,e.args):e.event&&u._signal(e.event,e.data)};return u.postMessage=function(e){l.onMessage({data:e})},u.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},u.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){r=new e[n](u);while(a.length)c()}),l};t.UIWorkerClient=l,t.WorkerClient=f,t.createWorker=a}),define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(){function e(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var u=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=u.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)}return e.prototype.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},e.prototype.showOtherMarkers=function(){if(this.othersActive)return;var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})},e.prototype.hideOtherMarkers=function(){if(!this.othersActive)return;this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;this.updateAnchors(e),i&&(this.length+=n);if(i&&!this.session.$fromUndo)if(e.action==="insert")for(var o=this.others.length-1;o>=0;o--){var u=this.others[o],a={row:u.row,column:u.column+s};this.doc.insertMergedLines(a,e.lines)}else if(e.action==="remove")for(var o=this.others.length-1;o>=0;o--){var u=this.others[o],a={row:u.row,column:u.column+s};this.doc.remove(new r(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()},e.prototype.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},e.prototype.updateMarkers=function(){if(this.$updating)return;var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)},e.prototype.onCursorChange=function(e){if(this.$updating||!this.session)return;var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))},e.prototype.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},e.prototype.cancel=function(){if(this.$undoStackDepth===-1)return;var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth;for(var n=0;n1?e.multiSelect.joinSelections():e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(e){e.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(e){e.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],t.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var r=e("../keyboard/hash_handler").HashHandler;t.keyboardHandler=new r(t.multiSelectCommands)}),define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(e,t,n){function h(e,t,n){return c.$options.wrap=!0,c.$options.needle=t,c.$options.backwards=n==-1,c.find(e)}function v(e,t){return e.row==t.row&&e.column==t.column}function m(e){if(e.$multiselectOnSessionChange)return;e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",o),e.commands.addCommands(f.defaultCommands),g(e)}function g(e){function r(t){n&&(e.renderer.setMouseCursor(""),n=!1)}if(!e.textInput)return;var t=e.textInput.getElement(),n=!1;u.addListener(t,"keydown",function(t){var i=t.keyCode==18&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&i?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&r()},e),u.addListener(t,"keyup",r,e),u.addListener(t,"blur",r,e)}var r=e("./range_list").RangeList,i=e("./range").Range,s=e("./selection").Selection,o=e("./mouse/multi_select_handler").onMouseDown,u=e("./lib/event"),a=e("./lib/lang"),f=e("./commands/multi_select_commands");t.commands=f.defaultCommands.concat(f.multiSelectCommands);var l=e("./search").Search,c=new l,p=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(p.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(!e)return;if(!this.inMultiSelectMode&&this.rangeCount===0){var n=this.toOrientedRange();this.rangeList.add(n),this.rangeList.add(e);if(this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(n),this.$onAddRange(n)}e.cursor||(e.cursor=e.end);var r=this.rangeList.add(e);return this.$onAddRange(e),r.length&&this.$onRemoveRange(r),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){this.rangeCount=this.rangeList.ranges.length;if(this.rangeCount==1&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),t=t||this.ranges[0],t&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){if(this.rangeList)return;this.rangeList=new r,this.ranges=[],this.rangeCount=0},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){var e=this.ranges.length?this.ranges:[this.getRange()],t=[];for(var n=0;n1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor),o=this.rectangularRangeBlock(r,s);o.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0)g--;if(g>0){var y=0;while(r[y].isEmpty())y++}for(var b=g;b>=y;b--)r[b].isEmpty()&&r.splice(b,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(!e.marker)return;this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);t!=-1&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length},this.removeSelectionMarkers=function(e){var t=this.session.$selectionMarkers;for(var n=e.length;n--;){var r=e[n];if(!r.marker)continue;this.session.removeMarker(r.marker);var i=t.indexOf(r);i!=-1&&t.splice(i,1)}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){if(this.inMultiSelectMode)return;this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(f.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onSingleSelect=function(e){if(this.session.multiSelect.inVirtualMode)return;this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(f.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection")},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(!n.multiSelect)return;if(!t.multiSelectAction){var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}else t.multiSelectAction=="forEach"?r=n.forEachSelection(t,e.args):t.multiSelectAction=="forEachLine"?r=n.forEachSelection(t,e.args,!0):t.multiSelectAction=="single"?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});return r},this.forEachSelection=function(e,t,n){if(this.inVirtualSelectionMode)return;var r=n&&n.keepOrder,i=n==1||n&&n.$byLines,o=this.session,u=this.selection,a=u.rangeList,f=(r?u:a).ranges,l;if(!f.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var c=u._eventRegistry;u._eventRegistry={};var h=new s(o);this.inVirtualSelectionMode=!0;for(var p=f.length;p--;){if(i)while(p>0&&f[p].start.row==f[p-1].end.row)p--;h.fromOrientedRange(f[p]),h.index=p,this.selection=o.selection=h;var d=e.exec?e.exec(this,t||{}):e(this,t||{});!l&&d!==undefined&&(l=d),h.toOrientedRange(f[p])}h.detach(),this.selection=o.selection=u,this.inVirtualSelectionMode=!1,u._eventRegistry=c,u.mergeOverlappingRanges(),u.ranges[0]&&u.fromOrientedRange(u.ranges[0]);var v=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),v&&v.from==v.to&&this.renderer.animateScrolling(v.from),l},this.exitMultiSelectMode=function(){if(!this.inMultiSelectMode||this.inVirtualSelectionMode)return;this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var t=this.multiSelect.rangeList.ranges,n=[];for(var r=0;r0);u<0&&(u=0),f>=c&&(f=c-1)}var p=this.session.removeFullLines(u,f);p=this.$reAlignText(p,l),this.session.insert({row:u,column:0},p.join("\n")+"\n"),l||(o.start.column=0,o.end.column=p[p.length-1].length),this.selection.setRange(o)}else{s.forEach(function(e){t.substractPoint(e.cursor)});var d=0,v=Infinity,m=n.map(function(t){var n=t.cursor,r=e.getLine(n.row),i=r.substr(n.column).search(/\S/g);return i==-1&&(i=0),n.column>d&&(d=n.column),io?e.insert(r,a.stringRepeat(" ",s-o)):e.remove(new i(r.row,r.column,r.row,r.column-s+o)),t.start.column=t.end.column=d,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(e,t){function u(e){return a.stringRepeat(" ",e)}function f(e){return e[2]?u(i)+e[2]+u(s-e[2].length+o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function l(e){return e[2]?u(i+s-e[2].length)+e[2]+u(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function c(e){return e[2]?u(i)+e[2]+u(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}var n=!0,r=!0,i,s,o;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?i==null?(i=t[1].length,s=t[2].length,o=t[3].length,t):(i+s+o!=t[1].length+t[2].length+t[3].length&&(r=!1),i!=t[1].length&&(n=!1),i>t[1].length&&(i=t[1].length),st[3].length&&(o=t[3].length),t):[e]}).map(t?f:n?r?l:f:c)}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=m,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){m(this),e?this.on("mousedown",o):this.off("mousedown",o)},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":t=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(o==-1)return;var u=n||s.length,a=e.getLength(),f=t,l=t;while(++tf){var p=e.getLine(l).length;return new r(f,u,l,p)}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},u=e.$findClosingBracket(t,o,s);if(!u)return;var a=e.foldWidgets[u.row];return a==null&&(a=e.getFoldWidget(u.row)),a=="start"&&u.row>o.row&&(u.row--,u.column=e.getLine(u.row).length),r.fromPoints(o,u)},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},u=e.$findOpeningBracket(t,o);if(!u)return;return u.column++,o.column--,r.fromPoints(u,o)}}).call(i.prototype)}),define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range","ace/config"],function(e,t,n){"use strict";function u(e,t,n){var r=0,i=e.length-1;while(r<=i){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}function a(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(!r.length)return;var i=u(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length?i=n>0?0:r.length-1:i===0&&n<0&&(i=r.length-1);var o=r[i];if(!o||!n)return;if(o.row===t){do o=r[i+=n];while(o&&o.row===t);if(!o)return r.slice()}var a=[];t=o.row;do a[n<0?"unshift":"push"](o),o=r[i+=n];while(o&&o.row==t);return a.length&&a}var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range,o=e("../config").nls;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var s=e.getCursorPosition(),u=s.row,f=n.widgetManager.getWidgetsAtRow(u).filter(function(e){return e.type=="errorMarker"})[0];f?f.destroy():u-=t;var l=a(n,u,t),c;if(l){var h=l[0];s.column=(h.pos&&typeof h.column!="number"?h.pos.sc:h.column)||0,s.row=h.row,c=e.renderer.$gutterLayer.$annotations[s.row]}else{if(f)return;c={text:[o("error-marker.good-state","Looks good!")],className:"ace_ok"}}e.session.unfold(s.row),e.selection.moveToPosition(s);var p={row:s.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},d=p.el.appendChild(i.createElement("div")),v=p.el.appendChild(i.createElement("div"));v.className="error_widget_arrow "+c.className;var m=e.renderer.$cursorLayer.getPixelPosition(s).left;v.style.left=m+e.renderer.gutterWidth-5+"px",p.el.className="error_widget_wrapper",d.className="error_widget "+c.className,d.innerHTML=c.text.join("
    "),d.appendChild(i.createElement("div"));var g=function(e,t,n){if(t===0&&(n==="esc"||n==="return"))return p.destroy(),{command:"null"}};p.destroy=function(){if(e.$mouseHandler.isMousePressed)return;e.keyBinding.removeKeyboardHandler(g),n.widgetManager.removeLineWidget(p),e.off("changeSelection",p.destroy),e.off("changeSession",p.destroy),e.off("mouseup",p.destroy),e.off("change",p.destroy)},e.keyBinding.addKeyboardHandler(g),e.on("changeSelection",p.destroy),e.on("changeSession",p.destroy),e.on("mouseup",p.destroy),e.on("change",p.destroy),e.session.widgetManager.addLineWidget(p),p.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:p.el.offsetHeight})},i.importCssString("\n .error_widget_wrapper {\n background: inherit;\n color: inherit;\n border:none\n }\n .error_widget {\n border-top: solid 2px;\n border-bottom: solid 2px;\n margin: 5px 0;\n padding: 10px 40px;\n white-space: pre-wrap;\n }\n .error_widget.ace_error, .error_widget_arrow.ace_error{\n border-color: #ff5a5a\n }\n .error_widget.ace_warning, .error_widget_arrow.ace_warning{\n border-color: #F1D817\n }\n .error_widget.ace_info, .error_widget_arrow.ace_info{\n border-color: #5a5a5a\n }\n .error_widget.ace_ok, .error_widget_arrow.ace_ok{\n border-color: #5aaa5a\n }\n .error_widget_arrow {\n position: absolute;\n border: solid 5px;\n border-top-color: transparent!important;\n border-right-color: transparent!important;\n border-left-color: transparent!important;\n top: -5px;\n }\n","error_marker.css",!1)}),define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],function(e,t,n){"use strict";e("./loader_build")(t);var r=e("./lib/dom"),i=e("./range").Range,s=e("./editor").Editor,o=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,a=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.edit=function(e,n){if(typeof e=="string"){var i=e;e=document.getElementById(i);if(!e)throw new Error("ace.edit can't find div #"+i)}if(e&&e.env&&e.env.editor instanceof s)return e.env.editor;var o="";if(e&&/input|textarea/i.test(e.tagName)){var u=e;o=u.value,e=r.createElement("pre"),u.parentNode.replaceChild(e,u)}else e&&(o=e.textContent,e.innerHTML="");var f=t.createEditSession(o),l=new s(new a(e),f,n),c={document:f,editor:l,onResize:l.resize.bind(l,null)};return u&&(c.textarea=u),l.on("destroy",function(){c.editor.container.env=null}),l.container.env=l.env=c,l},t.createEditSession=function(e,t){var n=new o(e,t);return n.setUndoManager(new u),n},t.Range=i,t.Editor=s,t.EditSession=o,t.UndoManager=u,t.VirtualRenderer=a,t.version=t.config.version}); (function() { + window.require(["ace/ace"], function(a) { + if (a) { + a.config.init(true); + a.define = window.define; + } + var global = (function () { + return this; + })(); + if (!global && typeof window != "undefined") global = window; // can happen in strict mode + if (!global && typeof self != "undefined") global = self; // can happen in webworker + + if (!global.ace) + global.ace = a; + for (var key in a) if (a.hasOwnProperty(key)) + global.ace[key] = a[key]; + global.ace["default"] = global.ace; + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = global.ace; + } + }); + })(); + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/ext-language_tools.js b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/ext-language_tools.js new file mode 100644 index 0000000..634e7d3 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/ext-language_tools.js @@ -0,0 +1,8 @@ +define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],function(e,t,n){"use strict";function p(e){var t=(new Date).toLocaleString("en-us",e);return t.length==1?"0"+t:t}var r=e("./lib/dom"),i=e("./lib/oop"),s=e("./lib/event_emitter").EventEmitter,o=e("./lib/lang"),u=e("./range").Range,a=e("./range_list").RangeList,f=e("./keyboard/hash_handler").HashHandler,l=e("./tokenizer").Tokenizer,c=e("./clipboard"),h={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,t,n){var r=e.session.getTextRange();return n?r.replace(/\n\r?([ \t]*\S)/g,"\n"+n+"$1"):r},CURRENT_LINE:function(e){return e.session.getLine(e.getCursorPosition().row)},PREV_LINE:function(e){return e.session.getLine(e.getCursorPosition().row-1)},LINE_INDEX:function(e){return e.getCursorPosition().row},LINE_NUMBER:function(e){return e.getCursorPosition().row+1},SOFT_TABS:function(e){return e.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(e){return e.session.getTabSize()},CLIPBOARD:function(e){return c.getText&&c.getText()},FILENAME:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0]},FILENAME_BASE:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(e){return this.FILEPATH(e).replace(/[^/\\]*$/,"")},FILEPATH:function(e){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.start||""},BLOCK_COMMENT_END:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.end||""},LINE_COMMENT:function(e){var t=e.session.$mode||{};return t.lineCommentStart||""},CURRENT_YEAR:p.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:p.bind(null,{year:"2-digit"}),CURRENT_MONTH:p.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:p.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:p.bind(null,{month:"short"}),CURRENT_DATE:p.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:p.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:p.bind(null,{weekday:"short"}),CURRENT_HOUR:p.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:p.bind(null,{minute:"2-digit"}),CURRENT_SECOND:p.bind(null,{second:"2-digit"})};h.SELECTED_TEXT=h.SELECTION;var d=function(){function e(){this.snippetMap={},this.snippetNameMap={},this.variables=h}return e.prototype.getTokenizer=function(){return e.$tokenizer||this.createTokenizer()},e.prototype.createTokenizer=function(){function t(e){return e=e.substr(1),/^\d+$/.test(e)?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function n(e){return"(?:[^\\\\"+e+"]|\\\\.)"}var r={regex:"/("+n("/")+"+)/",onMatch:function(e,t,n){var r=n[0];return r.fmtString=!0,r.guard=e.slice(1,-1),r.flag="",""},next:"formatString"};return e.$tokenizer=new l({start:[{regex:/\\./,onMatch:function(e,t,n){var r=e[1];return r=="}"&&n.length?e=r:"`$\\".indexOf(r)!=-1&&(e=r),[e]}},{regex:/}/,onMatch:function(e,t,n){return[n.length?n.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:t},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(e,n,r){var i=t(e.substr(1));return r.unshift(i[0]),i},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+n("\\|")+"*\\|",onMatch:function(e,t,n){var r=e.slice(1,-1).replace(/\\[,|\\]|,/g,function(e){return e.length==2?e[1]:"\0"}).split("\0").map(function(e){return{value:e}});return n[0].choices=r,[r[0]]},next:"start"},r,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(e,t,n){return n.length&&n[0].expectElse?(n[0].expectElse=!1,n[0].ifEnd={elseEnd:n[0]},[n[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(e,t,n){var r=e[1];return r=="}"&&n.length?e=r:"`$\\".indexOf(r)!=-1?e=r:r=="n"?e="\n":r=="t"?e=" ":"ulULE".indexOf(r)!=-1&&(e={changeCase:r,local:r>"a"}),[e]}},{regex:"/\\w*}",onMatch:function(e,t,n){var r=n.shift();return r&&(r.flag=e.slice(1,-1)),this.next=r&&r.tabstopId?"start":"",[r||e]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(e,t,n){return[{text:e.slice(1)}]}},{regex:/\${\w+/,onMatch:function(e,t,n){var r={text:e.slice(2)};return n.unshift(r),[r]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(e,t,n){var r=n.shift();return this.next=r&&r.tabstopId?"start":"",[r||e]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(e,t,n){var r=n[0];return r.formatFunction=e.slice(2,-1),[n.shift()]},next:"formatString"},r,{regex:/:[\?\-+]?/,onMatch:function(e,t,n){e[1]=="+"&&(n[0].ifEnd=n[0]),e[1]=="?"&&(n[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),e.$tokenizer},e.prototype.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map(function(e){return e.value||e})},e.prototype.getVariableValue=function(e,t,n){if(/^\d+$/.test(t))return(this.variables.__||{})[t]||"";if(/^[A-Z]\d+$/.test(t))return(this.variables[t[0]+"__"]||{})[t.substr(1)]||"";t=t.replace(/^TM_/,"");if(!this.variables.hasOwnProperty(t))return"";var r=this.variables[t];return typeof r=="function"&&(r=this.variables[t](e,t,n)),r==null?"":r},e.prototype.tmStrFormat=function(e,t,n){if(!t.fmt)return e;var r=t.flag||"",i=t.guard;i=new RegExp(i,r.replace(/[^gim]/g,""));var s=typeof t.fmt=="string"?this.tokenizeTmSnippet(t.fmt,"formatString"):t.fmt,o=this,u=e.replace(i,function(){var e=o.variables.__;o.variables.__=[].slice.call(arguments);var t=o.resolveVariables(s,n),r="E";for(var i=0;i=0&&s.splice(o,1)}}var n=this.snippetMap,r=this.snippetNameMap;e.content?i(e):Array.isArray(e)&&e.forEach(i)},e.prototype.parseSnippetFile=function(e){e=e.replace(/\r/g,"");var t=[],n={},r=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,i;while(i=r.exec(e)){if(i[1])try{n=JSON.parse(i[1]),t.push(n)}catch(s){}if(i[4])n.content=i[4].replace(/^\t/gm,""),t.push(n),n={};else{var o=i[2],u=i[3];if(o=="regex"){var a=/\/((?:[^\/\\]|\\.)*)|$/g;n.guard=a.exec(u)[1],n.trigger=a.exec(u)[1],n.endTrigger=a.exec(u)[1],n.endGuard=a.exec(u)[1]}else o=="snippet"?(n.tabTrigger=u.match(/^\S*/)[0],n.name||(n.name=u)):o&&(n[o]=u)}}return t},e.prototype.getSnippetByName=function(e,t){var n=this.snippetNameMap,r;return this.getActiveScopes(t).some(function(t){var i=n[t];return i&&(r=i[e]),!!r},this),r},e}();i.implement(d.prototype,s);var v=function(e,t,n){function l(e){var t=[];for(var n=0;n1?(y=t[t.length-1].length,g+=t.length-1):y+=e.length,b+=e}else e&&(e.start?e.end={row:g,column:y}:e.start={row:g,column:y})}),{text:b,tabstops:a,tokens:u}},m=function(){function e(e){this.index=0,this.ranges=[],this.tabstops=[];if(e.tabstopManager)return e.tabstopManager;e.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=o.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)}return e.prototype.attach=function(e){this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.session=e.session,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},e.prototype.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges.length=0,this.tabstops.length=0,this.selectedTabstop=null,this.editor.off("change",this.$onChange),this.editor.off("changeSelection",this.$onChangeSelection),this.editor.off("changeSession",this.$onChangeSession),this.editor.commands.off("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.session=null,this.editor=null},e.prototype.onChange=function(e){var t=e.action[0]=="r",n=this.selectedTabstop||{},r=n.parents||{},i=this.tabstops.slice();for(var s=0;s2&&(this.tabstops.length&&o.push(o.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,o))},e.prototype.addTabstopMarkers=function(e){var t=this.session;e.forEach(function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))})},e.prototype.removeTabstopMarkers=function(e){var t=this.session;e.forEach(function(e){t.removeMarker(e.markerId),e.markerId=null})},e.prototype.updateTabstopMarkers=function(){if(!this.selectedTabstop)return;var e=this.selectedTabstop.snippetId;this.selectedTabstop.index===0&&e--,this.tabstops.forEach(function(t){t.snippetId===e?this.addTabstopMarkers(t):this.removeTabstopMarkers(t)},this)},e.prototype.removeRange=function(e){var t=e.tabstop.indexOf(e);t!=-1&&e.tabstop.splice(t,1),t=this.ranges.indexOf(e),t!=-1&&this.ranges.splice(t,1),t=e.tabstop.rangeList.ranges.indexOf(e),t!=-1&&e.tabstop.splice(t,1),this.session.removeMarker(e.markerId),e.tabstop.length||(t=this.tabstops.indexOf(e.tabstop),t!=-1&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},e}();m.prototype.keyboardHandler=new f,m.prototype.keyboardHandler.bindKeys({Tab:function(e){if(t.snippetManager&&t.snippetManager.expandWithTab(e))return;e.tabstopManager.tabNext(1),e.renderer.scrollCursorIntoView()},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1),e.renderer.scrollCursorIntoView()},Esc:function(e){e.tabstopManager.detach()}});var g=function(e,t){e.row==0&&(e.column+=t.column),e.row+=t.row},y=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};r.importCssString("\n.ace_snippet-marker {\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n background: rgba(194, 193, 208, 0.09);\n border: 1px dotted rgba(211, 208, 235, 0.62);\n position: absolute;\n}","snippets.css",!1),t.snippetManager=new d;var b=e("./editor").Editor;(function(){this.insertSnippet=function(e,n){return t.snippetManager.insertSnippet(this,e,n)},this.expandSnippet=function(e){return t.snippetManager.expandWithTab(this,e)}}).call(b.prototype)}),define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/config","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../virtual_renderer").VirtualRenderer,i=e("../editor").Editor,s=e("../range").Range,o=e("../lib/event"),u=e("../lib/lang"),a=e("../lib/dom"),f=e("../config").nls,l=e("./../lib/useragent"),c=function(e){return"suggest-aria-id:".concat(e)},h=l.isSafari?"menu":"listbox",p=l.isSafari?"menuitem":"option",d=l.isSafari?"aria-current":"aria-selected",v=function(e){var t=new r(e);t.$maxLines=4;var n=new i(t);return n.setHighlightActiveLine(!1),n.setShowPrintMargin(!1),n.renderer.setShowGutter(!1),n.renderer.setHighlightGutterLine(!1),n.$mouseHandler.$focusTimeout=0,n.$highlightTagPending=!0,n},m=function(){function e(e){var t=a.createElement("div"),n=v(t);e&&e.appendChild(t),t.style.display="none",n.renderer.content.style.cursor="default",n.renderer.setStyle("ace_autocomplete"),n.renderer.$textLayer.element.setAttribute("role",h),n.renderer.$textLayer.element.setAttribute("aria-roledescription",f("autocomplete.popup.aria-roledescription","Autocomplete suggestions")),n.renderer.$textLayer.element.setAttribute("aria-label",f("autocomplete.popup.aria-label","Autocomplete suggestions")),n.renderer.textarea.setAttribute("aria-hidden","true"),n.setOption("displayIndentGuides",!1),n.setOption("dragDelay",150);var r=function(){};n.focus=r,n.$isFocused=!0,n.renderer.$cursorLayer.restartTimer=r,n.renderer.$cursorLayer.element.style.opacity="0",n.renderer.$maxLines=8,n.renderer.$keepTextAreaAtCursor=!1,n.setHighlightActiveLine(!1),n.session.highlight(""),n.session.$searchHighlight.clazz="ace_highlight-marker",n.on("mousedown",function(e){var t=e.getDocumentPosition();n.selection.moveToPosition(t),m.start.row=m.end.row=t.row,e.stop()});var i,l=new s(-1,0,-1,Infinity),m=new s(-1,0,-1,Infinity);m.id=n.session.addMarker(m,"ace_active-line","fullLine"),n.setSelectOnHover=function(e){e?l.id&&(n.session.removeMarker(l.id),l.id=null):l.id=n.session.addMarker(l,"ace_line-hover","fullLine")},n.setSelectOnHover(!1),n.on("mousemove",function(e){if(!i){i=e;return}if(i.x==e.x&&i.y==e.y)return;i=e,i.scrollTop=n.renderer.scrollTop,n.isMouseOver=!0;var t=i.getDocumentPosition().row;l.start.row!=t&&(l.id||n.setRow(t),y(t))}),n.renderer.on("beforeRender",function(){if(i&&l.start.row!=-1){i.$pos=null;var e=i.getDocumentPosition().row;l.id||n.setRow(e),y(e,!0)}}),n.renderer.on("afterRender",function(){var e=n.getRow(),t=n.renderer.$textLayer,r=t.element.childNodes[e-t.config.firstRow],i=document.activeElement;r!==n.selectedNode&&n.selectedNode&&(a.removeCssClass(n.selectedNode,"ace_selected"),i.removeAttribute("aria-activedescendant"),n.selectedNode.removeAttribute(d),n.selectedNode.removeAttribute("id")),n.selectedNode=r;if(r){a.addCssClass(r,"ace_selected");var s=c(e);r.id=s,t.element.setAttribute("aria-activedescendant",s),i.setAttribute("aria-activedescendant",s),r.setAttribute("role",p),r.setAttribute("aria-roledescription",f("autocomplete.popup.item.aria-roledescription","item")),r.setAttribute("aria-label",n.getData(e).caption||n.getData(e).value),r.setAttribute("aria-setsize",n.data.length),r.setAttribute("aria-posinset",e+1),r.setAttribute("aria-describedby","doc-tooltip"),r.setAttribute(d,"true")}});var g=function(){y(-1)},y=function(e,t){e!==l.start.row&&(l.start.row=l.end.row=e,t||n.session._emit("changeBackMarker"),n._emit("changeHoverMarker"))};n.getHoveredRow=function(){return l.start.row},o.addListener(n.container,"mouseout",function(){n.isMouseOver=!1,g()}),n.on("hide",g),n.on("changeSelection",g),n.session.doc.getLength=function(){return n.data.length},n.session.doc.getLine=function(e){var t=n.data[e];return typeof t=="string"?t:t&&t.value||""};var b=n.session.bgTokenizer;return b.$tokenizeRow=function(e){function s(e,n){e&&r.push({type:(t.className||"")+(n||""),value:e})}var t=n.data[e],r=[];if(!t)return r;typeof t=="string"&&(t={value:t});var i=t.caption||t.value||t.name,o=i.toLowerCase(),u=(n.filterText||"").toLowerCase(),a=0,f=0;for(var l=0;l<=u.length;l++)if(l!=f&&(t.matchMask&1<=l?r="bottom":r="top"),r==="top"?(c.bottom=e.top-this.$borderSize,c.top=c.bottom-l):r==="bottom"&&(c.top=e.top+t+this.$borderSize,c.bottom=c.top+l);var d=c.top>=0&&c.bottom<=u;if(!s&&!d)return!1;d?f.$maxPixelHeight=null:r==="top"?f.$maxPixelHeight=p:f.$maxPixelHeight=h,r==="top"?(o.style.top="",o.style.bottom=u-c.bottom+"px",n.isTopdown=!1):(o.style.top=c.top+"px",o.style.bottom="",n.isTopdown=!0),o.style.display="";var v=e.left;return v+o.offsetWidth>a&&(v=a-o.offsetWidth),o.style.left=v+"px",o.style.right="",n.isOpen||(n.isOpen=!0,this._signal("show"),i=null),n.anchorPos=e,n.anchor=r,!0},n.show=function(e,t,n){this.tryShow(e,t,n?"bottom":undefined,!0)},n.goTo=function(e){var t=this.getRow(),n=this.session.getLength()-1;switch(e){case"up":t=t<=0?n:t-1;break;case"down":t=t>=n?-1:t+1;break;case"start":t=0;break;case"end":t=n}this.setRow(t)},n.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},n.$imageSize=0,n.$borderSize=1,n}return e}();a.importCssString('\n.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #CAD6FA;\n z-index: 1;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #3a674e;\n}\n.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid #abbffe;\n margin-top: -1px;\n background: rgba(233,233,253,0.4);\n position: absolute;\n z-index: 2;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid rgba(109, 150, 13, 0.8);\n background: rgba(58, 103, 78, 0.62);\n}\n.ace_completion-meta {\n opacity: 0.5;\n margin-left: 0.9em;\n}\n.ace_completion-message {\n margin-left: 0.9em;\n color: blue;\n}\n.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #2d69c7;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #93ca12;\n}\n.ace_editor.ace_autocomplete {\n width: 300px;\n z-index: 200000;\n border: 1px lightgray solid;\n position: fixed;\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n line-height: 1.4;\n background: #fefefe;\n color: #111;\n}\n.ace_dark.ace_editor.ace_autocomplete {\n border: 1px #484747 solid;\n box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);\n line-height: 1.4;\n background: #25282c;\n color: #c1c1c1;\n}\n.ace_autocomplete .ace_text-layer {\n width: calc(100% - 8px);\n}\n.ace_autocomplete .ace_line {\n display: flex;\n align-items: center;\n}\n.ace_autocomplete .ace_line > * {\n min-width: 0;\n flex: 0 0 auto;\n}\n.ace_autocomplete .ace_line .ace_ {\n flex: 0 1 auto;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.ace_autocomplete .ace_completion-spacer {\n flex: 1;\n}\n.ace_autocomplete.ace_loading:after {\n content: "";\n position: absolute;\n top: 0px;\n height: 2px;\n width: 8%;\n background: blue;\n z-index: 100;\n animation: ace_progress 3s infinite linear;\n animation-delay: 300ms;\n transform: translateX(-100%) scaleX(1);\n}\n@keyframes ace_progress {\n 0% { transform: translateX(-100%) scaleX(1) }\n 50% { transform: translateX(625%) scaleX(2) } \n 100% { transform: translateX(1500%) scaleX(3) } \n}\n@media (prefers-reduced-motion) {\n .ace_autocomplete.ace_loading:after {\n transform: translateX(625%) scaleX(2);\n animation: none;\n }\n}\n',"autocompletion.css",!1),t.AcePopup=m,t.$singleLineEditor=v,t.getAriaId=c}),define("ace/autocomplete/inline_screenreader",["require","exports","module"],function(e,t,n){"use strict";var r=function(){function e(e){this.editor=e,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv)}return e.prototype.setScreenReaderContent=function(e){!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on("afterRender",function(){var e=this.popup.getRow(),t=this.popup.renderer.$textLayer,n=t.element.childNodes[e-t.config.firstRow];if(n){var r="doc-tooltip ";for(var i=0;i=0;s--){if(!n.test(e[s]))break;i.push(e[s])}return i.reverse().join("")},t.retrieveFollowingIdentifier=function(e,t,n){n=n||r;var i=[];for(var s=t;s0)for(var t=this.popup.getFirstVisibleRow();t<=this.popup.getLastVisibleRow();t++){var n=this.popup.getData(t);n&&(!e||n.hideInlinePreview)&&this.$seen(n)}},e.prototype.$onPopupShow=function(e){this.$onPopupChange(e),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},e.prototype.observeLayoutChanges=function(){if(this.$elements||!this.editor)return;window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);var e=this.editor.container.parentNode,t=[];while(e)t.push(e),e.addEventListener("scroll",this.onLayoutChange,{passive:!0}),e=e.parentNode;this.$elements=t},e.prototype.unObserveLayoutChanges=function(){var e=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach(function(t){t.removeEventListener("scroll",e.onLayoutChange,{passive:!0})}),this.$elements=null},e.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},e.prototype.$updatePopupPosition=function(){var e=this.editor,t=e.renderer,n=t.layerConfig.lineHeight,r=t.$cursorLayer.getPixelPosition(this.base,!0);r.left-=this.popup.getTextLeftOffset();var i=e.container.getBoundingClientRect();r.top+=i.top-t.layerConfig.offset,r.left+=i.left-e.renderer.scrollLeft,r.left+=t.gutterWidth;var s={top:r.top,left:r.left};t.$ghostText&&t.$ghostTextWidget&&this.base.row===t.$ghostText.position.row&&(s.top+=t.$ghostTextWidget.el.offsetHeight);var o=e.container.getBoundingClientRect().bottom-n,u=othis.filterText&&e.lastIndexOf(this.filterText,0)===0)var t=this.filtered;else var t=this.all;this.filterText=e,t=this.filterCompletions(t,this.filterText),t=t.sort(function(e,t){return t.exactMatch-e.exactMatch||t.$score-e.$score||(e.caption||e.value).localeCompare(t.caption||t.value)});var n=null;t=t.filter(function(e){var t=e.snippet||e.caption||e.value;return t===n?!1:(n=t,!0)}),this.filtered=t},e.prototype.filterCompletions=function(e,t){var n=[],r=t.toUpperCase(),i=t.toLowerCase();e:for(var s=0,o;o=e[s];s++){var u=!this.ignoreCaption&&o.caption||o.value||o.snippet;if(!u)continue;var a=-1,f=0,l=0,c,h;if(this.exactMatch){if(t!==u.substr(0,t.length))continue e}else{var p=u.toLowerCase().indexOf(i);if(p>-1)l=p;else for(var d=0;d=0?m<0||v0&&(a===-1&&(l+=10),l+=h,f|=1<",o.escapeHTML(e.caption),"","
    ",o.escapeHTML(l(e.snippet))].join(""))},id:"snippetCompleter"},h=[c,a,f];t.setCompleters=function(e){h.length=0,e&&h.push.apply(h,e)},t.addCompleter=function(e){h.push(e)},t.textCompleter=a,t.keyWordCompleter=f,t.snippetCompleter=c;var p={name:"expandSnippet",exec:function(e){return r.expandWithTab(e)},bindKey:"Tab"},d=function(e,t){v(t.session.$mode)},v=function(e){typeof e=="string"&&(e=s.$modes[e]);if(!e)return;r.files||(r.files={}),m(e.$id,e.snippetFileId),e.modes&&e.modes.forEach(v)},m=function(e,t){if(!t||!e||r.files[e])return;r.files[e]={},s.loadModule(t,function(t){if(!t)return;r.files[e]=t,!t.snippets&&t.snippetText&&(t.snippets=r.parseSnippetFile(t.snippetText)),r.register(t.snippets||[],t.scope),t.includeScopes&&(r.snippetMap[t.scope].includeScopes=t.includeScopes,t.includeScopes.forEach(function(e){v("ace/mode/"+e)}))})},g=function(e){var t=e.editor,n=t.completer&&t.completer.activated;if(e.command.name==="backspace")n&&!u.getCompletionPrefix(t)&&t.completer.detach();else if(e.command.name==="insertstring"&&!n){y=e;var r=e.editor.$liveAutocompletionDelay;r?b.delay(r):w(e)}},y,b=o.delayedCall(function(){w(y)},0),w=function(e){var t=e.editor,n=u.getCompletionPrefix(t),r=e.args,s=u.triggerAutocomplete(t,r);if(n&&n.length>=t.$liveAutocompletionThreshold||s){var o=i.for(t);o.autoShown=!0,o.showPopup(t)}},E=e("../editor").Editor;e("../config").defineOptions(E.prototype,"editor",{enableBasicAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:h),this.commands.addCommand(i.startCommand)):this.commands.removeCommand(i.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:h),this.commands.on("afterExec",g)):this.commands.off("afterExec",g)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(e){e?(this.commands.addCommand(p),this.on("changeMode",d),d(null,this)):(this.commands.removeCommand(p),this.off("changeMode",d))},value:!1}})}); (function() { + window.require(["ace/ext/language_tools"], function(m) { + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = m; + } + }); + })(); + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/mode-csharp.js b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/mode-csharp.js new file mode 100644 index 0000000..a641dbc --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/mode-csharp.js @@ -0,0 +1,8 @@ +define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@\\w+(?=\\s|$)"},s.getTagRule(),{defaultToken:"comment.doc.body",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:/\/\*\*(?!\/)/,next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),define("ace/mode/csharp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=function(){var e=this.createKeywordMapper({"variable.language":"this",keyword:"abstract|async|await|event|new|struct|as|explicit|null|switch|base|extern|object|this|bool|false|operator|throw|break|finally|out|true|byte|fixed|override|try|case|float|params|typeof|catch|for|private|uint|char|foreach|protected|ulong|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|ushort|continue|in|return|using|decimal|int|sbyte|virtual|default|interface|sealed|volatile|delegate|internal|partial|short|void|do|is|sizeof|while|double|lock|stackalloc|else|long|static|enum|namespace|string|var|dynamic","constant.language":"null|true|false"},"identifier");this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:/'(?:.|\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n]))?'/},{token:"string",start:'"',end:'"|$',next:[{token:"constant.language.escape",regex:/\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/},{token:"invalid",regex:/\\./}]},{token:"string",start:'@"',end:'"',next:[{token:"constant.language.escape",regex:'""'}]},{token:"string",start:/\$"/,end:'"|$',next:[{token:"constant.language.escape",regex:/\\(:?$)|{{/},{token:"constant.language.escape",regex:/\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/},{token:"invalid",regex:/\\./}]},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"keyword",regex:"^\\s*#(if|else|elif|endif|define|undef|warning|error|line|region|endregion|pragma)"},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]},this.embedRules(i,"doc-",[i.getEndRule("start")]),this.normalizeRules()};r.inherits(o,s),t.CSharpHighlightRules=o}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),define("ace/mode/folding/csharp",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./cstyle").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.usingRe=/^\s*using \S/,this.getFoldWidgetRangeBase=this.getFoldWidgetRange,this.getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=this.getFoldWidgetBase(e,t,n);if(!r){var i=e.getLine(n);if(/^\s*#region\b/.test(i))return"start";var s=this.usingRe;if(s.test(i)){var o=e.getLine(n-1),u=e.getLine(n+1);if(!s.test(o)&&s.test(u))return"start"}}return r},this.getFoldWidgetRange=function(e,t,n){var r=this.getFoldWidgetRangeBase(e,t,n);if(r)return r;var i=e.getLine(n);if(this.usingRe.test(i))return this.getUsingStatementBlock(e,i,n);if(/^\s*#region\b/.test(i))return this.getRegionBlock(e,i,n)},this.getUsingStatementBlock=function(e,t,n){var r=t.match(this.usingRe)[0].length-1,s=e.getLength(),o=n,u=n;while(++no){var a=e.getLine(u).length;return new i(o,r,u,a)}},this.getRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*#(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),define("ace/mode/csharp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/csharp_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/csharp"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./csharp_highlight_rules").CSharpHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("./folding/csharp").FoldMode,a=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new u};r.inherits(a,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"){var o=t.match(/^.*[\{\(\[]\s*$/);o&&(r+=n)}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){return null},this.$id="ace/mode/csharp"}.call(a.prototype),t.Mode=a}); (function() { + window.require(["ace/mode/csharp"], function(m) { + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = m; + } + }); + })(); + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/mode-javascript.js b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/mode-javascript.js new file mode 100644 index 0000000..5ec5896 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/mode-javascript.js @@ -0,0 +1,8 @@ +define("ace/mode/jsdoc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:["comment.doc.tag","comment.doc.text","lparen.doc"],regex:"(@(?:param|member|typedef|property|namespace|var|const|callback))(\\s*)({)",push:[{token:"lparen.doc",regex:"{",push:[{include:"doc-syntax"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"}]},{token:["rparen.doc","text.doc","variable.parameter.doc","lparen.doc","variable.parameter.doc","rparen.doc"],regex:/(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,next:"pop"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"},{include:"doc-syntax"},{defaultToken:"text.doc"}]},{token:["comment.doc.tag","text.doc","lparen.doc"],regex:"(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|implements|external|exception|throws|enum|define|extends))(\\s*)({)",push:[{token:"lparen.doc",regex:"{",push:[{include:"doc-syntax"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"}]},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"},{include:"doc-syntax"},{defaultToken:"text.doc"}]},{token:["comment.doc.tag","text.doc","variable.parameter.doc"],regex:'(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|requires|param|implements|function|extends|typedef|mixes|constructor|var|memberof\\!|event|listens|exports|class|constructs|interface|emits|fires|throws|const|callback|borrows|augments))(\\s+)(\\w[\\w#.:/~"\\-]*)?'},{token:["comment.doc.tag","text.doc","variable.parameter.doc"],regex:"(@method)(\\s+)(\\w[\\w.\\(\\)]*)"},{token:"comment.doc.tag",regex:"@access\\s+(?:private|public|protected)"},{token:"comment.doc.tag",regex:"@kind\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)"},{token:"comment.doc.tag",regex:"@\\w+(?=\\s|$)"},s.getTagRule(),{defaultToken:"comment.doc.body",caseInsensitive:!0}],"doc-syntax":[{token:"operator.doc",regex:/[|:]/},{token:"paren.doc",regex:/[\[\]]/}]},this.normalizeRules()};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:/\/\*\*(?!\/)/,next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.JsDocCommentHighlightRules=s}),define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/jsdoc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";function a(){var e=o.replace("\\d","\\d\\-"),t={onMatch:function(e,t,n){var r=e.charAt(1)=="/"?2:1;if(r==1)t!=this.nextState?n.unshift(this.next,this.nextState,0):n.unshift(this.next),n[2]++;else if(r==2&&t==this.nextState){n[1]--;if(!n[1]||n[1]<0)n.shift(),n.shift()}return[{type:"meta.tag.punctuation."+(r==1?"":"end-")+"tag-open.xml",value:e.slice(0,r)},{type:"meta.tag.tag-name.xml",value:e.substr(r)}]},regex:"))",next:"jsxAttributes",nextState:"jsx"};this.$rules.start.unshift(t);var n={regex:"{",token:"paren.quasi.start",push:"start"};this.$rules.jsx=[n,t,{include:"reference"},{defaultToken:"string.xml"}],this.$rules.jsxAttributes=[{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",onMatch:function(e,t,n){return t==n[0]&&n.shift(),e.length==2&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||"start",[{type:this.token,value:e}]},nextState:"jsx"},n,f("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:e},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},t],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}function f(e){return[{token:"comment",regex:/\/\*/,next:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[i.getTagRule(),{token:"comment",regex:"$|^",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}var r=e("../lib/oop"),i=e("./jsdoc_comment_highlight_rules").JsDocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*",u=function(e){var t={"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},n=this.createKeywordMapper(t,"identifier"),r="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",s="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)",u="(function)(\\s*)(\\*?)",l={token:["identifier","text","paren.lparen"],regex:"(\\b(?!"+Object.values(t).join("|")+"\\b)"+o+")(\\s*)(\\()"};this.$rules={no_regex:[i.getStartRule("doc-start"),f("no_regex"),l,{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(=)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","storage.type","text","text","entity.name.function","text","paren.lparen"],regex:"(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))("+o+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(:)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"from(?=\\s*('|\"))"},{token:"keyword",regex:"(?:"+r+")\\b",next:"start"},{token:"support.constant",regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\b/},{token:n,regex:o},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"storage.type",regex:/=>/,next:"start"},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:"keyword.operator",regex:/=/},{token:["storage.type","text","storage.type","text","paren.lparen"],regex:u+"(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","storage.type","text","text","entity.name.function","text","paren.lparen"],regex:"(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:"prototype"},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:o},{regex:"",token:"empty",next:"no_regex"}],start:[i.getStartRule("doc-start"),f("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],default_parameter:[{token:"string",regex:"'(?=.)",push:[{token:"string",regex:"'|$",next:"pop"},{include:"qstring"}]},{token:"string",regex:'"(?=.)',push:[{token:"string",regex:'"|$',next:"pop"},{include:"qqstring"}]},{token:"constant.language",regex:"null|Infinity|NaN|undefined"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:"punctuation.operator",regex:",",next:"function_arguments"},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],function_arguments:[f("function_arguments"),{token:"variable.parameter",regex:o},{token:"punctuation.operator",regex:","},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!e||!e.noES6)this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)n.unshift("start",t);else if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:s},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]},{token:["variable.parameter","text"],regex:"("+o+")(\\s*)(?=\\=>)"},{token:"paren.lparen",regex:"(\\()(?=[^\\(]+\\s*=>)",next:"function_arguments"},{token:"variable.language",regex:"(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\b"}),this.$rules.function_arguments.unshift({token:"keyword.operator",regex:"=",next:"default_parameter"},{token:"keyword.operator",regex:"\\.{3}"}),this.$rules.property.unshift({token:"support.function",regex:"(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\b(?=\\()"},{token:"constant.language",regex:"(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\b"}),(!e||e.jsx!=0)&&a.call(this);this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(u,s),t.JavaScriptHighlightRules=u}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"],function(e,t,n){"use strict";function o(e,t){return e&&e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,u=function(){this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var u=i,a=r.doc.getTextRange(n.getSelectionRange());if(a!==""&&a!=="'"&&a!='"'&&n.getWrapBehavioursEnabled())return{text:u+a+u,selection:!1};var f=n.getCursorPosition(),l=r.doc.getLine(f.row),c=l.substring(f.column,f.column+1),h=new s(r,f.row,f.column),p=h.getCurrentToken();if(c==u&&(o(p,"attribute-value")||o(p,"string")))return{text:"",selection:[1,1]};p||(p=h.stepBackward());if(!p)return;while(o(p,"tag-whitespace")||o(p,"whitespace"))p=h.stepBackward();var d=!c||c.match(/\s/);if(o(p,"attribute-equals")&&(d||c==">")||o(p,"decl-attribute-equals")&&(d||c=="?"))return{text:u+u,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}}),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var u=n.getSelectionRange().start,a=new s(r,u.row,u.column),f=a.getCurrentToken()||a.stepBackward();if(!f||!(o(f,"tag-name")||o(f,"tag-whitespace")||o(f,"attribute-name")||o(f,"attribute-equals")||o(f,"attribute-value")))return;if(o(f,"reference.attribute-value"))return;if(o(f,"attribute-value")){var l=a.getCurrentTokenColumn()+f.value.length;if(u.column/.test(r.getLine(u.row).slice(u.column)))return;while(!o(f,"tag-name")){f=a.stepBackward();if(f.value=="<"){f=a.stepForward();break}}var h=a.getCurrentTokenRow(),p=a.getCurrentTokenColumn();if(o(a.stepBackward(),"end-tag-open"))return;var d=f.value;h==u.row&&(d=d.substring(0,u.column-p));if(this.voidElements&&this.voidElements.hasOwnProperty(d.toLowerCase()))return;return{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,i){if(i=="\n"){var u=n.getCursorPosition(),a=r.getLine(u.row),f=new s(r,u.row,u.column),l=f.getCurrentToken();if(o(l,"")&&l.type.indexOf("tag-close")!==-1){if(l.value=="/>")return;while(l&&l.type.indexOf("tag-name")===-1)l=f.stepBackward();if(!l)return;var c=l.value,h=f.getCurrentTokenRow();l=f.stepBackward();if(!l||l.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[c]||!this.voidElements){var p=r.getTokenAt(u.row,u.column+1),a=r.getLine(h),d=this.$getIndent(a),v=d+r.getTabString();return p&&p.value===""){var o=n.getSelectionRange().start,u=new i(r,o.row,o.column),a=u.getCurrentToken()||u.stepBackward();if(!a)return;if(a.value=="<")return{text:">",selection:[1,1]}}})};r.inherits(u,s),t.JavaScriptBehaviour=u}),define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";function a(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e,t){s.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(o,s);var u=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t==="markbeginend"?"end":"":!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())?"":this._findEndTagInLine(e,n,r.tagName,r.end.column)?"":"start":this.getCommentFoldWidget(e,n)},this.getCommentFoldWidget=function(e,t){return/comment/.test(e.getState(t))&&/";break}}return r}if(a(s,"tag-close"))return r.selfClosing=s.value=="/>",r;r.start.column+=s.value.length}return null},this._findEndTagInLine=function(e,t,n,r){var i=e.getTokens(t),s=0;for(var o=0;of)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./xml").FoldMode,s=e("./cstyle").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end))),this.xmlFoldMode=new i};r.inherits(o,s),function(){this.getFoldWidgetRangeBase=this.getFoldWidgetRange,this.getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=this.getFoldWidgetBase(e,t,n);return r?r:this.xmlFoldMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n,r){var i=this.getFoldWidgetRangeBase(e,t,n,r);return i?i:this.xmlFoldMode.getFoldWidgetRange(e,t,n)}}.call(o.prototype)}),define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./behaviour/javascript").JavaScriptBehaviour,f=e("./folding/javascript").FoldMode,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new f};r.inherits(l,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.$pairQuotesAfter={"`":/\w/},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start"||o=="no_regex")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript",this.snippetFileId="ace/snippets/javascript"}.call(l.prototype),t.Mode=l}); (function() { + window.require(["ace/mode/javascript"], function(m) { + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = m; + } + }); + })(); + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/mode-json5.js b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/mode-json5.js new file mode 100644 index 0000000..7c72e8b --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/mode-json5.js @@ -0,0 +1,8 @@ +define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};r.inherits(s,i),t.JsonHighlightRules=s}),define("ace/mode/json5_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/json_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./json_highlight_rules").JsonHighlightRules,s=function(){i.call(this);var e=[{token:"variable",regex:/[a-zA-Z$_\u00a1-\uffff][\w$\u00a1-\uffff]*\s*(?=:)/},{token:"variable",regex:/['](?:(?:\\.)|(?:[^'\\]))*?[']\s*(?=:)/},{token:"constant.language.boolean",regex:/(?:null)\b/},{token:"string",regex:/'/,next:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,consumeLineEnd:!0},{token:"string",regex:/'|$/,next:"start"},{defaultToken:"string"}]},{token:"string",regex:/"(?![^"]*":)/,next:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,consumeLineEnd:!0},{token:"string",regex:/"|$/,next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:/[+-]?(?:Infinity|NaN)\b/}];for(var t in this.$rules)this.$rules[t].unshift.apply(this.$rules[t],e);this.normalizeRules()};r.inherits(s,i),t.Json5HighlightRules=s}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),define("ace/mode/json5",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json5_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./json5_highlight_rules").Json5HighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("./folding/cstyle").FoldMode,a=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new u};r.inherits(a,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/json5"}.call(a.prototype),t.Mode=a}); (function() { + window.require(["ace/mode/json5"], function(m) { + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = m; + } + }); + })(); + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/mode-sql.js b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/mode-sql.js new file mode 100644 index 0000000..83943db --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/mode-sql.js @@ -0,0 +1,8 @@ +define("ace/mode/sql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|when|then|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|foreign|not|references|default|null|inner|cross|natural|database|drop|grant|distinct|is|in|all|alter|any|array|at|authorization|between|both|cast|check|collate|column|commit|constraint|cube|current|current_date|current_time|current_timestamp|current_user|describe|escape|except|exists|external|extract|fetch|filter|for|full|function|global|grouping|intersect|interval|into|leading|like|local|no|of|only|out|overlaps|partition|position|range|revoke|rollback|rollup|row|rows|session_user|set|some|start|tablesample|time|to|trailing|truncate|unique|unknown|user|using|values|window|with",t="true|false",n="avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|coalesce|ifnull|isnull|nvl",r="int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|money|real|number|integer|string",i=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t,"storage.type":r},"identifier",!0);this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"comment",start:"/\\*",end:"\\*/"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"string",regex:"`.*?`"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:i,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]},this.normalizeRules()};r.inherits(s,i),t.SqlHighlightRules=s}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),define("ace/mode/folding/sql",["require","exports","module","ace/lib/oop","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./cstyle").FoldMode,s=t.FoldMode=function(){};r.inherits(s,i),function(){}.call(s.prototype)}),define("ace/mode/sql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sql_highlight_rules","ace/mode/folding/sql"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./sql_highlight_rules").SqlHighlightRules,o=e("./folding/sql").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart="--",this.blockComment={start:"/*",end:"*/"},this.$id="ace/mode/sql",this.snippetFileId="ace/snippets/sql"}.call(u.prototype),t.Mode=u}); (function() { + window.require(["ace/mode/sql"], function(m) { + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = m; + } + }); + })(); + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/mode-typescript.js b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/mode-typescript.js new file mode 100644 index 0000000..beebf91 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/mode-typescript.js @@ -0,0 +1,8 @@ +define("ace/mode/jsdoc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:["comment.doc.tag","comment.doc.text","lparen.doc"],regex:"(@(?:param|member|typedef|property|namespace|var|const|callback))(\\s*)({)",push:[{token:"lparen.doc",regex:"{",push:[{include:"doc-syntax"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"}]},{token:["rparen.doc","text.doc","variable.parameter.doc","lparen.doc","variable.parameter.doc","rparen.doc"],regex:/(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,next:"pop"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"},{include:"doc-syntax"},{defaultToken:"text.doc"}]},{token:["comment.doc.tag","text.doc","lparen.doc"],regex:"(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|implements|external|exception|throws|enum|define|extends))(\\s*)({)",push:[{token:"lparen.doc",regex:"{",push:[{include:"doc-syntax"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"}]},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"},{include:"doc-syntax"},{defaultToken:"text.doc"}]},{token:["comment.doc.tag","text.doc","variable.parameter.doc"],regex:'(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|requires|param|implements|function|extends|typedef|mixes|constructor|var|memberof\\!|event|listens|exports|class|constructs|interface|emits|fires|throws|const|callback|borrows|augments))(\\s+)(\\w[\\w#.:/~"\\-]*)?'},{token:["comment.doc.tag","text.doc","variable.parameter.doc"],regex:"(@method)(\\s+)(\\w[\\w.\\(\\)]*)"},{token:"comment.doc.tag",regex:"@access\\s+(?:private|public|protected)"},{token:"comment.doc.tag",regex:"@kind\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)"},{token:"comment.doc.tag",regex:"@\\w+(?=\\s|$)"},s.getTagRule(),{defaultToken:"comment.doc.body",caseInsensitive:!0}],"doc-syntax":[{token:"operator.doc",regex:/[|:]/},{token:"paren.doc",regex:/[\[\]]/}]},this.normalizeRules()};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:/\/\*\*(?!\/)/,next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.JsDocCommentHighlightRules=s}),define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/jsdoc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";function a(){var e=o.replace("\\d","\\d\\-"),t={onMatch:function(e,t,n){var r=e.charAt(1)=="/"?2:1;if(r==1)t!=this.nextState?n.unshift(this.next,this.nextState,0):n.unshift(this.next),n[2]++;else if(r==2&&t==this.nextState){n[1]--;if(!n[1]||n[1]<0)n.shift(),n.shift()}return[{type:"meta.tag.punctuation."+(r==1?"":"end-")+"tag-open.xml",value:e.slice(0,r)},{type:"meta.tag.tag-name.xml",value:e.substr(r)}]},regex:"))",next:"jsxAttributes",nextState:"jsx"};this.$rules.start.unshift(t);var n={regex:"{",token:"paren.quasi.start",push:"start"};this.$rules.jsx=[n,t,{include:"reference"},{defaultToken:"string.xml"}],this.$rules.jsxAttributes=[{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",onMatch:function(e,t,n){return t==n[0]&&n.shift(),e.length==2&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||"start",[{type:this.token,value:e}]},nextState:"jsx"},n,f("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:e},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},t],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}function f(e){return[{token:"comment",regex:/\/\*/,next:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[i.getTagRule(),{token:"comment",regex:"$|^",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}var r=e("../lib/oop"),i=e("./jsdoc_comment_highlight_rules").JsDocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*",u=function(e){var t={"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},n=this.createKeywordMapper(t,"identifier"),r="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",s="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)",u="(function)(\\s*)(\\*?)",l={token:["identifier","text","paren.lparen"],regex:"(\\b(?!"+Object.values(t).join("|")+"\\b)"+o+")(\\s*)(\\()"};this.$rules={no_regex:[i.getStartRule("doc-start"),f("no_regex"),l,{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(=)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","storage.type","text","text","entity.name.function","text","paren.lparen"],regex:"(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))("+o+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","storage.type","text","paren.lparen"],regex:"("+o+")(\\s*)(:)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)"+u+"(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"from(?=\\s*('|\"))"},{token:"keyword",regex:"(?:"+r+")\\b",next:"start"},{token:"support.constant",regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\b/},{token:n,regex:o},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"storage.type",regex:/=>/,next:"start"},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:"keyword.operator",regex:/=/},{token:["storage.type","text","storage.type","text","paren.lparen"],regex:u+"(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","storage.type","text","text","entity.name.function","text","paren.lparen"],regex:"(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:"prototype"},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:o},{regex:"",token:"empty",next:"no_regex"}],start:[i.getStartRule("doc-start"),f("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],default_parameter:[{token:"string",regex:"'(?=.)",push:[{token:"string",regex:"'|$",next:"pop"},{include:"qstring"}]},{token:"string",regex:'"(?=.)',push:[{token:"string",regex:'"|$',next:"pop"},{include:"qqstring"}]},{token:"constant.language",regex:"null|Infinity|NaN|undefined"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:"punctuation.operator",regex:",",next:"function_arguments"},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],function_arguments:[f("function_arguments"),{token:"variable.parameter",regex:o},{token:"punctuation.operator",regex:","},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!e||!e.noES6)this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)n.unshift("start",t);else if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:s},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]},{token:["variable.parameter","text"],regex:"("+o+")(\\s*)(?=\\=>)"},{token:"paren.lparen",regex:"(\\()(?=[^\\(]+\\s*=>)",next:"function_arguments"},{token:"variable.language",regex:"(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\b"}),this.$rules.function_arguments.unshift({token:"keyword.operator",regex:"=",next:"default_parameter"},{token:"keyword.operator",regex:"\\.{3}"}),this.$rules.property.unshift({token:"support.function",regex:"(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\b(?=\\()"},{token:"constant.language",regex:"(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\b"}),(!e||e.jsx!=0)&&a.call(this);this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(u,s),t.JavaScriptHighlightRules=u}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"],function(e,t,n){"use strict";function o(e,t){return e&&e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,u=function(){this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var u=i,a=r.doc.getTextRange(n.getSelectionRange());if(a!==""&&a!=="'"&&a!='"'&&n.getWrapBehavioursEnabled())return{text:u+a+u,selection:!1};var f=n.getCursorPosition(),l=r.doc.getLine(f.row),c=l.substring(f.column,f.column+1),h=new s(r,f.row,f.column),p=h.getCurrentToken();if(c==u&&(o(p,"attribute-value")||o(p,"string")))return{text:"",selection:[1,1]};p||(p=h.stepBackward());if(!p)return;while(o(p,"tag-whitespace")||o(p,"whitespace"))p=h.stepBackward();var d=!c||c.match(/\s/);if(o(p,"attribute-equals")&&(d||c==">")||o(p,"decl-attribute-equals")&&(d||c=="?"))return{text:u+u,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}}),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var u=n.getSelectionRange().start,a=new s(r,u.row,u.column),f=a.getCurrentToken()||a.stepBackward();if(!f||!(o(f,"tag-name")||o(f,"tag-whitespace")||o(f,"attribute-name")||o(f,"attribute-equals")||o(f,"attribute-value")))return;if(o(f,"reference.attribute-value"))return;if(o(f,"attribute-value")){var l=a.getCurrentTokenColumn()+f.value.length;if(u.column/.test(r.getLine(u.row).slice(u.column)))return;while(!o(f,"tag-name")){f=a.stepBackward();if(f.value=="<"){f=a.stepForward();break}}var h=a.getCurrentTokenRow(),p=a.getCurrentTokenColumn();if(o(a.stepBackward(),"end-tag-open"))return;var d=f.value;h==u.row&&(d=d.substring(0,u.column-p));if(this.voidElements&&this.voidElements.hasOwnProperty(d.toLowerCase()))return;return{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,i){if(i=="\n"){var u=n.getCursorPosition(),a=r.getLine(u.row),f=new s(r,u.row,u.column),l=f.getCurrentToken();if(o(l,"")&&l.type.indexOf("tag-close")!==-1){if(l.value=="/>")return;while(l&&l.type.indexOf("tag-name")===-1)l=f.stepBackward();if(!l)return;var c=l.value,h=f.getCurrentTokenRow();l=f.stepBackward();if(!l||l.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[c]||!this.voidElements){var p=r.getTokenAt(u.row,u.column+1),a=r.getLine(h),d=this.$getIndent(a),v=d+r.getTabString();return p&&p.value===""){var o=n.getSelectionRange().start,u=new i(r,o.row,o.column),a=u.getCurrentToken()||u.stepBackward();if(!a)return;if(a.value=="<")return{text:">",selection:[1,1]}}})};r.inherits(u,s),t.JavaScriptBehaviour=u}),define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";function a(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e,t){s.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(o,s);var u=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t==="markbeginend"?"end":"":!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())?"":this._findEndTagInLine(e,n,r.tagName,r.end.column)?"":"start":this.getCommentFoldWidget(e,n)},this.getCommentFoldWidget=function(e,t){return/comment/.test(e.getState(t))&&/";break}}return r}if(a(s,"tag-close"))return r.selfClosing=s.value=="/>",r;r.start.column+=s.value.length}return null},this._findEndTagInLine=function(e,t,n,r){var i=e.getTokens(t),s=0;for(var o=0;of)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./xml").FoldMode,s=e("./cstyle").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end))),this.xmlFoldMode=new i};r.inherits(o,s),function(){this.getFoldWidgetRangeBase=this.getFoldWidgetRange,this.getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=this.getFoldWidgetBase(e,t,n);return r?r:this.xmlFoldMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n,r){var i=this.getFoldWidgetRangeBase(e,t,n,r);return i?i:this.xmlFoldMode.getFoldWidgetRange(e,t,n)}}.call(o.prototype)}),define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./behaviour/javascript").JavaScriptBehaviour,f=e("./folding/javascript").FoldMode,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new f};r.inherits(l,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.$pairQuotesAfter={"`":/\w/},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start"||o=="no_regex")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript",this.snippetFileId="ace/snippets/javascript"}.call(l.prototype),t.Mode=l}),define("ace/mode/typescript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/javascript_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./javascript_highlight_rules").JavaScriptHighlightRules,s=function(e){var t=[{token:["storage.type","text","entity.name.function.ts"],regex:"(function)(\\s+)([a-zA-Z0-9$_\u00a1-\uffff][a-zA-Z0-9d$_\u00a1-\uffff]*)"},{token:"keyword",regex:"(?:\\b(constructor|declare|interface|as|AS|public|private|extends|export|super|readonly|module|namespace|abstract|implements)\\b)"},{token:["keyword","storage.type.variable.ts"],regex:"(class|type)(\\s+[a-zA-Z0-9_?.$][\\w?.$]*)"},{token:"keyword",regex:"\\b(?:super|export|import|keyof|infer)\\b"},{token:["storage.type.variable.ts"],regex:"(?:\\b(this\\.|string\\b|bool\\b|boolean\\b|number\\b|true\\b|false\\b|undefined\\b|any\\b|null\\b|(?:unique )?symbol\\b|object\\b|never\\b|enum\\b))"}],n=(new i({jsx:(e&&e.jsx)==1})).getRules();n.no_regex=t.concat(n.no_regex),this.$rules=n};r.inherits(s,i),t.TypeScriptHighlightRules=s}),define("ace/mode/typescript",["require","exports","module","ace/lib/oop","ace/mode/javascript","ace/mode/typescript_highlight_rules","ace/mode/folding/cstyle","ace/mode/matching_brace_outdent"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./javascript").Mode,s=e("./typescript_highlight_rules").TypeScriptHighlightRules,o=e("./folding/cstyle").FoldMode,u=e("./matching_brace_outdent").MatchingBraceOutdent,a=function(){this.HighlightRules=s,this.$outdent=new u,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new o};r.inherits(a,i),function(){this.createWorker=function(e){return null},this.$id="ace/mode/typescript"}.call(a.prototype),t.Mode=a}); (function() { + window.require(["ace/mode/typescript"], function(m) { + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = m; + } + }); + })(); + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/snippets/csharp.js b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/snippets/csharp.js new file mode 100644 index 0000000..058fe1a --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/snippets/csharp.js @@ -0,0 +1,8 @@ +; (function() { + window.require(["ace/snippets/csharp"], function(m) { + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = m; + } + }); + })(); + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/snippets/javascript.js b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/snippets/javascript.js new file mode 100644 index 0000000..357c9a0 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/snippets/javascript.js @@ -0,0 +1,8 @@ +define("ace/snippets/javascript.snippets",["require","exports","module"],function(e,t,n){n.exports='# Prototype\nsnippet proto\n ${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {\n ${4:// body...}\n };\n# Function\nsnippet fun\n function ${1?:function_name}(${2:argument}) {\n ${3:// body...}\n }\n# Anonymous Function\nregex /((=)\\s*|(:)\\s*|(\\()|\\b)/f/(\\))?/\nsnippet f\n function${M1?: ${1:functionName}}($2) {\n ${0:$TM_SELECTED_TEXT}\n }${M2?;}${M3?,}${M4?)}\n# Immediate function\ntrigger \\(?f\\(\nendTrigger \\)?\nsnippet f(\n (function(${1}) {\n ${0:${TM_SELECTED_TEXT:/* code */}}\n }(${1}));\n# if\nsnippet if\n if (${1:true}) {\n ${0}\n }\n# if ... else\nsnippet ife\n if (${1:true}) {\n ${2}\n } else {\n ${0}\n }\n# tertiary conditional\nsnippet ter\n ${1:/* condition */} ? ${2:a} : ${3:b}\n# switch\nsnippet switch\n switch (${1:expression}) {\n case \'${3:case}\':\n ${4:// code}\n break;\n ${5}\n default:\n ${2:// code}\n }\n# case\nsnippet case\n case \'${1:case}\':\n ${2:// code}\n break;\n ${3}\n\n# while (...) {...}\nsnippet wh\n while (${1:/* condition */}) {\n ${0:/* code */}\n }\n# try\nsnippet try\n try {\n ${0:/* code */}\n } catch (e) {}\n# do...while\nsnippet do\n do {\n ${2:/* code */}\n } while (${1:/* condition */});\n# Object Method\nsnippet :f\nregex /([,{[])|^\\s*/:f/\n ${1:method_name}: function(${2:attribute}) {\n ${0}\n }${3:,}\n# setTimeout function\nsnippet setTimeout\nregex /\\b/st|timeout|setTimeo?u?t?/\n setTimeout(function() {${3:$TM_SELECTED_TEXT}}, ${1:10});\n# Get Elements\nsnippet gett\n getElementsBy${1:TagName}(\'${2}\')${3}\n# Get Element\nsnippet get\n getElementBy${1:Id}(\'${2}\')${3}\n# console.log (Firebug)\nsnippet cl\n console.log(${1});\n# return\nsnippet ret\n return ${1:result}\n# for (property in object ) { ... }\nsnippet fori\n for (var ${1:prop} in ${2:Things}) {\n ${0:$2[$1]}\n }\n# hasOwnProperty\nsnippet has\n hasOwnProperty(${1})\n# docstring\nsnippet /**\n /**\n * ${1:description}\n *\n */\nsnippet @par\nregex /^\\s*\\*\\s*/@(para?m?)?/\n @param {${1:type}} ${2:name} ${3:description}\nsnippet @ret\n @return {${1:type}} ${2:description}\n# JSON.parse\nsnippet jsonp\n JSON.parse(${1:jstr});\n# JSON.stringify\nsnippet jsons\n JSON.stringify(${1:object});\n# self-defining function\nsnippet sdf\n var ${1:function_name} = function(${2:argument}) {\n ${3:// initial code ...}\n\n $1 = function($2) {\n ${4:// main code}\n };\n }\n# singleton\nsnippet sing\n function ${1:Singleton} (${2:argument}) {\n // the cached instance\n var instance;\n\n // rewrite the constructor\n $1 = function $1($2) {\n return instance;\n };\n \n // carry over the prototype properties\n $1.prototype = this;\n\n // the instance\n instance = new $1();\n\n // reset the constructor pointer\n instance.constructor = $1;\n\n ${3:// code ...}\n\n return instance;\n }\n# class\nsnippet class\nregex /^\\s*/clas{0,2}/\n var ${1:class} = function(${20}) {\n $40$0\n };\n \n (function() {\n ${60:this.prop = ""}\n }).call(${1:class}.prototype);\n \n exports.${1:class} = ${1:class};\n# \nsnippet for-\n for (var ${1:i} = ${2:Things}.length; ${1:i}--; ) {\n ${0:${2:Things}[${1:i}];}\n }\n# for (...) {...}\nsnippet for\n for (var ${1:i} = 0; $1 < ${2:Things}.length; $1++) {\n ${3:$2[$1]}$0\n }\n# for (...) {...} (Improved Native For-Loop)\nsnippet forr\n for (var ${1:i} = ${2:Things}.length - 1; $1 >= 0; $1--) {\n ${3:$2[$1]}$0\n }\n\n\n#modules\nsnippet def\n define(function(require, exports, module) {\n "use strict";\n var ${1/.*\\///} = require("${1}");\n \n $TM_SELECTED_TEXT\n });\nsnippet req\nguard ^\\s*\n var ${1/.*\\///} = require("${1}");\n $0\nsnippet requ\nguard ^\\s*\n var ${1/.*\\/(.)/\\u$1/} = require("${1}").${1/.*\\/(.)/\\u$1/};\n $0\n'}),define("ace/snippets/javascript",["require","exports","module","ace/snippets/javascript.snippets"],function(e,t,n){"use strict";t.snippetText=e("./javascript.snippets"),t.scope="javascript"}); (function() { + window.require(["ace/snippets/javascript"], function(m) { + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = m; + } + }); + })(); + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/snippets/json5.js b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/snippets/json5.js new file mode 100644 index 0000000..175f737 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/snippets/json5.js @@ -0,0 +1,8 @@ +; (function() { + window.require(["ace/snippets/json5"], function(m) { + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = m; + } + }); + })(); + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/snippets/sql.js b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/snippets/sql.js new file mode 100644 index 0000000..ae65e5d --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/snippets/sql.js @@ -0,0 +1,8 @@ +define("ace/snippets/sql.snippets",["require","exports","module"],function(e,t,n){n.exports="snippet tbl\n create table ${1:table} (\n ${2:columns}\n );\nsnippet col\n ${1:name} ${2:type} ${3:default ''} ${4:not null}\nsnippet ccol\n ${1:name} varchar2(${2:size}) ${3:default ''} ${4:not null}\nsnippet ncol\n ${1:name} number ${3:default 0} ${4:not null}\nsnippet dcol\n ${1:name} date ${3:default sysdate} ${4:not null}\nsnippet ind\n create index ${3:$1_$2} on ${1:table}(${2:column});\nsnippet uind\n create unique index ${1:name} on ${2:table}(${3:column});\nsnippet tblcom\n comment on table ${1:table} is '${2:comment}';\nsnippet colcom\n comment on column ${1:table}.${2:column} is '${3:comment}';\nsnippet addcol\n alter table ${1:table} add (${2:column} ${3:type});\nsnippet seq\n create sequence ${1:name} start with ${2:1} increment by ${3:1} minvalue ${4:1};\nsnippet s*\n select * from ${1:table}\n"}),define("ace/snippets/sql",["require","exports","module","ace/snippets/sql.snippets"],function(e,t,n){"use strict";t.snippetText=e("./sql.snippets"),t.scope="sql"}); (function() { + window.require(["ace/snippets/sql"], function(m) { + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = m; + } + }); + })(); + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/snippets/typescript.js b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/snippets/typescript.js new file mode 100644 index 0000000..f0b763d --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/snippets/typescript.js @@ -0,0 +1,8 @@ +; (function() { + window.require(["ace/snippets/typescript"], function(m) { + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = m; + } + }); + })(); + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/theme-monokai.js b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/theme-monokai.js new file mode 100644 index 0000000..a5f5040 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/theme-monokai.js @@ -0,0 +1,8 @@ +define("ace/theme/monokai-css",["require","exports","module"],function(e,t,n){n.exports=".ace-monokai .ace_gutter {\n background: #2F3129;\n color: #8F908A\n}\n\n.ace-monokai .ace_print-margin {\n width: 1px;\n background: #555651\n}\n\n.ace-monokai {\n background-color: #272822;\n color: #F8F8F2\n}\n\n.ace-monokai .ace_cursor {\n color: #F8F8F0\n}\n\n.ace-monokai .ace_marker-layer .ace_selection {\n background: #49483E\n}\n\n.ace-monokai.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px #272822;\n}\n\n.ace-monokai .ace_marker-layer .ace_step {\n background: rgb(102, 82, 0)\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #49483E\n}\n\n.ace-monokai .ace_marker-layer .ace_active-line {\n background: #202020\n}\n\n.ace-monokai .ace_gutter-active-line {\n background-color: #272727\n}\n\n.ace-monokai .ace_marker-layer .ace_selected-word {\n border: 1px solid #49483E\n}\n\n.ace-monokai .ace_invisible {\n color: #52524d\n}\n\n.ace-monokai .ace_entity.ace_name.ace_tag,\n.ace-monokai .ace_keyword,\n.ace-monokai .ace_meta.ace_tag,\n.ace-monokai .ace_storage {\n color: #F92672\n}\n\n.ace-monokai .ace_punctuation,\n.ace-monokai .ace_punctuation.ace_tag {\n color: #fff\n}\n\n.ace-monokai .ace_constant.ace_character,\n.ace-monokai .ace_constant.ace_language,\n.ace-monokai .ace_constant.ace_numeric,\n.ace-monokai .ace_constant.ace_other {\n color: #AE81FF\n}\n\n.ace-monokai .ace_invalid {\n color: #F8F8F0;\n background-color: #F92672\n}\n\n.ace-monokai .ace_invalid.ace_deprecated {\n color: #F8F8F0;\n background-color: #AE81FF\n}\n\n.ace-monokai .ace_support.ace_constant,\n.ace-monokai .ace_support.ace_function {\n color: #66D9EF\n}\n\n.ace-monokai .ace_fold {\n background-color: #A6E22E;\n border-color: #F8F8F2\n}\n\n.ace-monokai .ace_storage.ace_type,\n.ace-monokai .ace_support.ace_class,\n.ace-monokai .ace_support.ace_type {\n font-style: italic;\n color: #66D9EF\n}\n\n.ace-monokai .ace_entity.ace_name.ace_function,\n.ace-monokai .ace_entity.ace_other,\n.ace-monokai .ace_entity.ace_other.ace_attribute-name,\n.ace-monokai .ace_variable {\n color: #A6E22E\n}\n\n.ace-monokai .ace_variable.ace_parameter {\n font-style: italic;\n color: #FD971F\n}\n\n.ace-monokai .ace_string {\n color: #E6DB74\n}\n\n.ace-monokai .ace_comment {\n color: #75715E\n}\n\n.ace-monokai .ace_indent-guide {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y\n}\n\n.ace-monokai .ace_indent-guide-active {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y;\n}\n"}),define("ace/theme/monokai",["require","exports","module","ace/theme/monokai-css","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=e("./monokai-css");var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass,!1)}); (function() { + window.require(["ace/theme/monokai"], function(m) { + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = m; + } + }); + })(); + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/theme-twilight.js b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/theme-twilight.js new file mode 100644 index 0000000..c4803c7 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/ace/src-min/theme-twilight.js @@ -0,0 +1,8 @@ +define("ace/theme/twilight-css",["require","exports","module"],function(e,t,n){n.exports=".ace-twilight .ace_gutter {\n background: #232323;\n color: #E2E2E2\n}\n\n.ace-twilight .ace_print-margin {\n width: 1px;\n background: #232323\n}\n\n.ace-twilight {\n background-color: #141414;\n color: #F8F8F8\n}\n\n.ace-twilight .ace_cursor {\n color: #A7A7A7\n}\n\n.ace-twilight .ace_marker-layer .ace_selection {\n background: rgba(221, 240, 255, 0.20)\n}\n\n.ace-twilight.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px #141414;\n}\n\n.ace-twilight .ace_marker-layer .ace_step {\n background: rgb(102, 82, 0)\n}\n\n.ace-twilight .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(255, 255, 255, 0.25)\n}\n\n.ace-twilight .ace_marker-layer .ace_active-line {\n background: rgba(255, 255, 255, 0.031)\n}\n\n.ace-twilight .ace_gutter-active-line {\n background-color: rgba(255, 255, 255, 0.031)\n}\n\n.ace-twilight .ace_marker-layer .ace_selected-word {\n border: 1px solid rgba(221, 240, 255, 0.20)\n}\n\n.ace-twilight .ace_invisible {\n color: rgba(255, 255, 255, 0.25)\n}\n\n.ace-twilight .ace_keyword,\n.ace-twilight .ace_meta {\n color: #CDA869\n}\n\n.ace-twilight .ace_constant,\n.ace-twilight .ace_constant.ace_character,\n.ace-twilight .ace_constant.ace_character.ace_escape,\n.ace-twilight .ace_constant.ace_other,\n.ace-twilight .ace_heading,\n.ace-twilight .ace_markup.ace_heading,\n.ace-twilight .ace_support.ace_constant {\n color: #CF6A4C\n}\n\n.ace-twilight .ace_invalid.ace_illegal {\n color: #F8F8F8;\n background-color: rgba(86, 45, 86, 0.75)\n}\n\n.ace-twilight .ace_invalid.ace_deprecated {\n text-decoration: underline;\n font-style: italic;\n color: #D2A8A1\n}\n\n.ace-twilight .ace_support {\n color: #9B859D\n}\n\n.ace-twilight .ace_fold {\n background-color: #AC885B;\n border-color: #F8F8F8\n}\n\n.ace-twilight .ace_support.ace_function {\n color: #DAD085\n}\n\n.ace-twilight .ace_list,\n.ace-twilight .ace_markup.ace_list,\n.ace-twilight .ace_storage {\n color: #F9EE98\n}\n\n.ace-twilight .ace_entity.ace_name.ace_function,\n.ace-twilight .ace_meta.ace_tag {\n color: #AC885B\n}\n\n.ace-twilight .ace_string {\n color: #8F9D6A\n}\n\n.ace-twilight .ace_string.ace_regexp {\n color: #E9C062\n}\n\n.ace-twilight .ace_comment {\n font-style: italic;\n color: #5F5A60\n}\n\n.ace-twilight .ace_variable {\n color: #7587A6\n}\n\n.ace-twilight .ace_xml-pe {\n color: #494949\n}\n\n.ace-twilight .ace_indent-guide {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y\n}\n\n.ace-twilight .ace_indent-guide-active {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y;\n}\n"}),define("ace/theme/twilight",["require","exports","module","ace/theme/twilight-css","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-twilight",t.cssText=e("./twilight-css");var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass,!1)}); (function() { + window.require(["ace/theme/twilight"], function(m) { + if (typeof module == "object" && typeof exports == "object" && module) { + module.exports = m; + } + }); + })(); + \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/axios.min.js b/SuperAPI/wwwroot/rezero/default_ui/js/axios.min.js new file mode 100644 index 0000000..b3107c7 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/axios.min.js @@ -0,0 +1,2 @@ +!function (e, t) { "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).axios = t() }(this, (function () { "use strict"; function e(e, t) { var n = Object.keys(e); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(e); t && (r = r.filter((function (t) { return Object.getOwnPropertyDescriptor(e, t).enumerable }))), n.push.apply(n, r) } return n } function t(t) { for (var n = 1; n < arguments.length; n++) { var r = null != arguments[n] ? arguments[n] : {}; n % 2 ? e(Object(r), !0).forEach((function (e) { a(t, e, r[e]) })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : e(Object(r)).forEach((function (e) { Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e)) })) } return t } function n(e) { return n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }, n(e) } function r(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") } function o(e, t) { for (var n = 0; n < t.length; n++) { var r = t[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r) } } function i(e, t, n) { return t && o(e.prototype, t), n && o(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e } function a(e, t, n) { return t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e } function s(e, t) { return c(e) || function (e, t) { var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"]; if (null == n) return; var r, o, i = [], a = !0, s = !1; try { for (n = n.call(e); !(a = (r = n.next()).done) && (i.push(r.value), !t || i.length !== t); a = !0); } catch (e) { s = !0, o = e } finally { try { a || null == n.return || n.return() } finally { if (s) throw o } } return i }(e, t) || l(e, t) || p() } function u(e) { return function (e) { if (Array.isArray(e)) return d(e) }(e) || f(e) || l(e) || function () { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") }() } function c(e) { if (Array.isArray(e)) return e } function f(e) { if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e) } function l(e, t) { if (e) { if ("string" == typeof e) return d(e, t); var n = Object.prototype.toString.call(e).slice(8, -1); return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? d(e, t) : void 0 } } function d(e, t) { (null == t || t > e.length) && (t = e.length); for (var n = 0, r = new Array(t); n < t; n++)r[n] = e[n]; return r } function p() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } function h(e, t) { return function () { return e.apply(t, arguments) } } var m, y = Object.prototype.toString, v = Object.getPrototypeOf, b = (m = Object.create(null), function (e) { var t = y.call(e); return m[t] || (m[t] = t.slice(8, -1).toLowerCase()) }), g = function (e) { return e = e.toLowerCase(), function (t) { return b(t) === e } }, w = function (e) { return function (t) { return n(t) === e } }, O = Array.isArray, E = w("undefined"); var S = g("ArrayBuffer"); var R = w("string"), A = w("function"), j = w("number"), T = function (e) { return null !== e && "object" === n(e) }, P = function (e) { if ("object" !== b(e)) return !1; var t = v(e); return !(null !== t && t !== Object.prototype && null !== Object.getPrototypeOf(t) || Symbol.toStringTag in e || Symbol.iterator in e) }, N = g("Date"), x = g("File"), C = g("Blob"), k = g("FileList"), _ = g("URLSearchParams"); function F(e, t) { var r, o, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, a = i.allOwnKeys, s = void 0 !== a && a; if (null != e) if ("object" !== n(e) && (e = [e]), O(e)) for (r = 0, o = e.length; r < o; r++)t.call(null, e[r], r, e); else { var u, c = s ? Object.getOwnPropertyNames(e) : Object.keys(e), f = c.length; for (r = 0; r < f; r++)u = c[r], t.call(null, e[u], u, e) } } function U(e, t) { t = t.toLowerCase(); for (var n, r = Object.keys(e), o = r.length; o-- > 0;)if (t === (n = r[o]).toLowerCase()) return n; return null } var D = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : "undefined" != typeof window ? window : global, B = function (e) { return !E(e) && e !== D }; var L, I = (L = "undefined" != typeof Uint8Array && v(Uint8Array), function (e) { return L && e instanceof L }), q = g("HTMLFormElement"), z = function (e) { var t = Object.prototype.hasOwnProperty; return function (e, n) { return t.call(e, n) } }(), M = g("RegExp"), H = function (e, t) { var n = Object.getOwnPropertyDescriptors(e), r = {}; F(n, (function (n, o) { var i; !1 !== (i = t(n, o, e)) && (r[o] = i || n) })), Object.defineProperties(e, r) }, J = "abcdefghijklmnopqrstuvwxyz", W = "0123456789", K = { DIGIT: W, ALPHA: J, ALPHA_DIGIT: J + J.toUpperCase() + W }; var V = g("AsyncFunction"), G = { isArray: O, isArrayBuffer: S, isBuffer: function (e) { return null !== e && !E(e) && null !== e.constructor && !E(e.constructor) && A(e.constructor.isBuffer) && e.constructor.isBuffer(e) }, isFormData: function (e) { var t; return e && ("function" == typeof FormData && e instanceof FormData || A(e.append) && ("formdata" === (t = b(e)) || "object" === t && A(e.toString) && "[object FormData]" === e.toString())) }, isArrayBufferView: function (e) { return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer && S(e.buffer) }, isString: R, isNumber: j, isBoolean: function (e) { return !0 === e || !1 === e }, isObject: T, isPlainObject: P, isUndefined: E, isDate: N, isFile: x, isBlob: C, isRegExp: M, isFunction: A, isStream: function (e) { return T(e) && A(e.pipe) }, isURLSearchParams: _, isTypedArray: I, isFileList: k, forEach: F, merge: function e() { for (var t = B(this) && this || {}, n = t.caseless, r = {}, o = function (t, o) { var i = n && U(r, o) || o; P(r[i]) && P(t) ? r[i] = e(r[i], t) : P(t) ? r[i] = e({}, t) : O(t) ? r[i] = t.slice() : r[i] = t }, i = 0, a = arguments.length; i < a; i++)arguments[i] && F(arguments[i], o); return r }, extend: function (e, t, n) { var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, o = r.allOwnKeys; return F(t, (function (t, r) { n && A(t) ? e[r] = h(t, n) : e[r] = t }), { allOwnKeys: o }), e }, trim: function (e) { return e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "") }, stripBOM: function (e) { return 65279 === e.charCodeAt(0) && (e = e.slice(1)), e }, inherits: function (e, t, n, r) { e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", { value: t.prototype }), n && Object.assign(e.prototype, n) }, toFlatObject: function (e, t, n, r) { var o, i, a, s = {}; if (t = t || {}, null == e) return t; do { for (i = (o = Object.getOwnPropertyNames(e)).length; i-- > 0;)a = o[i], r && !r(a, e, t) || s[a] || (t[a] = e[a], s[a] = !0); e = !1 !== n && v(e) } while (e && (!n || n(e, t)) && e !== Object.prototype); return t }, kindOf: b, kindOfTest: g, endsWith: function (e, t, n) { e = String(e), (void 0 === n || n > e.length) && (n = e.length), n -= t.length; var r = e.indexOf(t, n); return -1 !== r && r === n }, toArray: function (e) { if (!e) return null; if (O(e)) return e; var t = e.length; if (!j(t)) return null; for (var n = new Array(t); t-- > 0;)n[t] = e[t]; return n }, forEachEntry: function (e, t) { for (var n, r = (e && e[Symbol.iterator]).call(e); (n = r.next()) && !n.done;) { var o = n.value; t.call(e, o[0], o[1]) } }, matchAll: function (e, t) { for (var n, r = []; null !== (n = e.exec(t));)r.push(n); return r }, isHTMLForm: q, hasOwnProperty: z, hasOwnProp: z, reduceDescriptors: H, freezeMethods: function (e) { H(e, (function (t, n) { if (A(e) && -1 !== ["arguments", "caller", "callee"].indexOf(n)) return !1; var r = e[n]; A(r) && (t.enumerable = !1, "writable" in t ? t.writable = !1 : t.set || (t.set = function () { throw Error("Can not rewrite read-only method '" + n + "'") })) })) }, toObjectSet: function (e, t) { var n = {}, r = function (e) { e.forEach((function (e) { n[e] = !0 })) }; return O(e) ? r(e) : r(String(e).split(t)), n }, toCamelCase: function (e) { return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, (function (e, t, n) { return t.toUpperCase() + n })) }, noop: function () { }, toFiniteNumber: function (e, t) { return e = +e, Number.isFinite(e) ? e : t }, findKey: U, global: D, isContextDefined: B, ALPHABET: K, generateString: function () { for (var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 16, t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : K.ALPHA_DIGIT, n = "", r = t.length; e--;)n += t[Math.random() * r | 0]; return n }, isSpecCompliantForm: function (e) { return !!(e && A(e.append) && "FormData" === e[Symbol.toStringTag] && e[Symbol.iterator]) }, toJSONObject: function (e) { var t = new Array(10); return function e(n, r) { if (T(n)) { if (t.indexOf(n) >= 0) return; if (!("toJSON" in n)) { t[r] = n; var o = O(n) ? [] : {}; return F(n, (function (t, n) { var i = e(t, r + 1); !E(i) && (o[n] = i) })), t[r] = void 0, o } } return n }(e, 0) }, isAsyncFn: V, isThenable: function (e) { return e && (T(e) || A(e)) && A(e.then) && A(e.catch) } }; function X(e, t, n, r, o) { Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = (new Error).stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), o && (this.response = o) } G.inherits(X, Error, { toJSON: function () { return { message: this.message, name: this.name, description: this.description, number: this.number, fileName: this.fileName, lineNumber: this.lineNumber, columnNumber: this.columnNumber, stack: this.stack, config: G.toJSONObject(this.config), code: this.code, status: this.response && this.response.status ? this.response.status : null } } }); var $ = X.prototype, Q = {};["ERR_BAD_OPTION_VALUE", "ERR_BAD_OPTION", "ECONNABORTED", "ETIMEDOUT", "ERR_NETWORK", "ERR_FR_TOO_MANY_REDIRECTS", "ERR_DEPRECATED", "ERR_BAD_RESPONSE", "ERR_BAD_REQUEST", "ERR_CANCELED", "ERR_NOT_SUPPORT", "ERR_INVALID_URL"].forEach((function (e) { Q[e] = { value: e } })), Object.defineProperties(X, Q), Object.defineProperty($, "isAxiosError", { value: !0 }), X.from = function (e, t, n, r, o, i) { var a = Object.create($); return G.toFlatObject(e, a, (function (e) { return e !== Error.prototype }), (function (e) { return "isAxiosError" !== e })), X.call(a, e.message, t, n, r, o), a.cause = e, a.name = e.name, i && Object.assign(a, i), a }; function Z(e) { return G.isPlainObject(e) || G.isArray(e) } function Y(e) { return G.endsWith(e, "[]") ? e.slice(0, -2) : e } function ee(e, t, n) { return e ? e.concat(t).map((function (e, t) { return e = Y(e), !n && t ? "[" + e + "]" : e })).join(n ? "." : "") : t } var te = G.toFlatObject(G, {}, null, (function (e) { return /^is[A-Z]/.test(e) })); function ne(e, t, r) { if (!G.isObject(e)) throw new TypeError("target must be an object"); t = t || new FormData; var o = (r = G.toFlatObject(r, { metaTokens: !0, dots: !1, indexes: !1 }, !1, (function (e, t) { return !G.isUndefined(t[e]) }))).metaTokens, i = r.visitor || f, a = r.dots, s = r.indexes, u = (r.Blob || "undefined" != typeof Blob && Blob) && G.isSpecCompliantForm(t); if (!G.isFunction(i)) throw new TypeError("visitor must be a function"); function c(e) { if (null === e) return ""; if (G.isDate(e)) return e.toISOString(); if (!u && G.isBlob(e)) throw new X("Blob is not supported. Use a Buffer instead."); return G.isArrayBuffer(e) || G.isTypedArray(e) ? u && "function" == typeof Blob ? new Blob([e]) : Buffer.from(e) : e } function f(e, r, i) { var u = e; if (e && !i && "object" === n(e)) if (G.endsWith(r, "{}")) r = o ? r : r.slice(0, -2), e = JSON.stringify(e); else if (G.isArray(e) && function (e) { return G.isArray(e) && !e.some(Z) }(e) || (G.isFileList(e) || G.endsWith(r, "[]")) && (u = G.toArray(e))) return r = Y(r), u.forEach((function (e, n) { !G.isUndefined(e) && null !== e && t.append(!0 === s ? ee([r], n, a) : null === s ? r : r + "[]", c(e)) })), !1; return !!Z(e) || (t.append(ee(i, r, a), c(e)), !1) } var l = [], d = Object.assign(te, { defaultVisitor: f, convertValue: c, isVisitable: Z }); if (!G.isObject(e)) throw new TypeError("data must be an object"); return function e(n, r) { if (!G.isUndefined(n)) { if (-1 !== l.indexOf(n)) throw Error("Circular reference detected in " + r.join(".")); l.push(n), G.forEach(n, (function (n, o) { !0 === (!(G.isUndefined(n) || null === n) && i.call(t, n, G.isString(o) ? o.trim() : o, r, d)) && e(n, r ? r.concat(o) : [o]) })), l.pop() } }(e), t } function re(e) { var t = { "!": "%21", "'": "%27", "(": "%28", ")": "%29", "~": "%7E", "%20": "+", "%00": "\0" }; return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, (function (e) { return t[e] })) } function oe(e, t) { this._pairs = [], e && ne(e, this, t) } var ie = oe.prototype; function ae(e) { return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]") } function se(e, t, n) { if (!t) return e; var r, o = n && n.encode || ae, i = n && n.serialize; if (r = i ? i(t, n) : G.isURLSearchParams(t) ? t.toString() : new oe(t, n).toString(o)) { var a = e.indexOf("#"); -1 !== a && (e = e.slice(0, a)), e += (-1 === e.indexOf("?") ? "?" : "&") + r } return e } ie.append = function (e, t) { this._pairs.push([e, t]) }, ie.toString = function (e) { var t = e ? function (t) { return e.call(this, t, re) } : re; return this._pairs.map((function (e) { return t(e[0]) + "=" + t(e[1]) }), "").join("&") }; var ue, ce = function () { function e() { r(this, e), this.handlers = [] } return i(e, [{ key: "use", value: function (e, t, n) { return this.handlers.push({ fulfilled: e, rejected: t, synchronous: !!n && n.synchronous, runWhen: n ? n.runWhen : null }), this.handlers.length - 1 } }, { key: "eject", value: function (e) { this.handlers[e] && (this.handlers[e] = null) } }, { key: "clear", value: function () { this.handlers && (this.handlers = []) } }, { key: "forEach", value: function (e) { G.forEach(this.handlers, (function (t) { null !== t && e(t) })) } }]), e }(), fe = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 }, le = { isBrowser: !0, classes: { URLSearchParams: "undefined" != typeof URLSearchParams ? URLSearchParams : oe, FormData: "undefined" != typeof FormData ? FormData : null, Blob: "undefined" != typeof Blob ? Blob : null }, protocols: ["http", "https", "file", "blob", "url", "data"] }, de = "undefined" != typeof window && "undefined" != typeof document, pe = (ue = "undefined" != typeof navigator && navigator.product, de && ["ReactNative", "NativeScript", "NS"].indexOf(ue) < 0), he = "undefined" != typeof WorkerGlobalScope && self instanceof WorkerGlobalScope && "function" == typeof self.importScripts, me = t(t({}, Object.freeze({ __proto__: null, hasBrowserEnv: de, hasStandardBrowserWebWorkerEnv: he, hasStandardBrowserEnv: pe })), le); function ye(e) { function t(e, n, r, o) { var i = e[o++], a = Number.isFinite(+i), s = o >= e.length; return i = !i && G.isArray(r) ? r.length : i, s ? (G.hasOwnProp(r, i) ? r[i] = [r[i], n] : r[i] = n, !a) : (r[i] && G.isObject(r[i]) || (r[i] = []), t(e, n, r[i], o) && G.isArray(r[i]) && (r[i] = function (e) { var t, n, r = {}, o = Object.keys(e), i = o.length; for (t = 0; t < i; t++)r[n = o[t]] = e[n]; return r }(r[i])), !a) } if (G.isFormData(e) && G.isFunction(e.entries)) { var n = {}; return G.forEachEntry(e, (function (e, r) { t(function (e) { return G.matchAll(/\w+|\[(\w*)]/g, e).map((function (e) { return "[]" === e[0] ? "" : e[1] || e[0] })) }(e), r, n, 0) })), n } return null } var ve = { transitional: fe, adapter: ["xhr", "http"], transformRequest: [function (e, t) { var n, r = t.getContentType() || "", o = r.indexOf("application/json") > -1, i = G.isObject(e); if (i && G.isHTMLForm(e) && (e = new FormData(e)), G.isFormData(e)) return o && o ? JSON.stringify(ye(e)) : e; if (G.isArrayBuffer(e) || G.isBuffer(e) || G.isStream(e) || G.isFile(e) || G.isBlob(e)) return e; if (G.isArrayBufferView(e)) return e.buffer; if (G.isURLSearchParams(e)) return t.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString(); if (i) { if (r.indexOf("application/x-www-form-urlencoded") > -1) return function (e, t) { return ne(e, new me.classes.URLSearchParams, Object.assign({ visitor: function (e, t, n, r) { return me.isNode && G.isBuffer(e) ? (this.append(t, e.toString("base64")), !1) : r.defaultVisitor.apply(this, arguments) } }, t)) }(e, this.formSerializer).toString(); if ((n = G.isFileList(e)) || r.indexOf("multipart/form-data") > -1) { var a = this.env && this.env.FormData; return ne(n ? { "files[]": e } : e, a && new a, this.formSerializer) } } return i || o ? (t.setContentType("application/json", !1), function (e, t, n) { if (G.isString(e)) try { return (t || JSON.parse)(e), G.trim(e) } catch (e) { if ("SyntaxError" !== e.name) throw e } return (n || JSON.stringify)(e) }(e)) : e }], transformResponse: [function (e) { var t = this.transitional || ve.transitional, n = t && t.forcedJSONParsing, r = "json" === this.responseType; if (e && G.isString(e) && (n && !this.responseType || r)) { var o = !(t && t.silentJSONParsing) && r; try { return JSON.parse(e) } catch (e) { if (o) { if ("SyntaxError" === e.name) throw X.from(e, X.ERR_BAD_RESPONSE, this, null, this.response); throw e } } } return e }], timeout: 0, xsrfCookieName: "XSRF-TOKEN", xsrfHeaderName: "X-XSRF-TOKEN", maxContentLength: -1, maxBodyLength: -1, env: { FormData: me.classes.FormData, Blob: me.classes.Blob }, validateStatus: function (e) { return e >= 200 && e < 300 }, headers: { common: { Accept: "application/json, text/plain, */*", "Content-Type": void 0 } } }; G.forEach(["delete", "get", "head", "post", "put", "patch"], (function (e) { ve.headers[e] = {} })); var be = ve, ge = G.toObjectSet(["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"]), we = Symbol("internals"); function Oe(e) { return e && String(e).trim().toLowerCase() } function Ee(e) { return !1 === e || null == e ? e : G.isArray(e) ? e.map(Ee) : String(e) } function Se(e, t, n, r, o) { return G.isFunction(r) ? r.call(this, t, n) : (o && (t = n), G.isString(t) ? G.isString(r) ? -1 !== t.indexOf(r) : G.isRegExp(r) ? r.test(t) : void 0 : void 0) } var Re = function (e, t) { function n(e) { r(this, n), e && this.set(e) } return i(n, [{ key: "set", value: function (e, t, n) { var r = this; function o(e, t, n) { var o = Oe(t); if (!o) throw new Error("header name must be a non-empty string"); var i = G.findKey(r, o); (!i || void 0 === r[i] || !0 === n || void 0 === n && !1 !== r[i]) && (r[i || t] = Ee(e)) } var i, a, s, u, c, f = function (e, t) { return G.forEach(e, (function (e, n) { return o(e, n, t) })) }; return G.isPlainObject(e) || e instanceof this.constructor ? f(e, t) : G.isString(e) && (e = e.trim()) && !/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()) ? f((c = {}, (i = e) && i.split("\n").forEach((function (e) { u = e.indexOf(":"), a = e.substring(0, u).trim().toLowerCase(), s = e.substring(u + 1).trim(), !a || c[a] && ge[a] || ("set-cookie" === a ? c[a] ? c[a].push(s) : c[a] = [s] : c[a] = c[a] ? c[a] + ", " + s : s) })), c), t) : null != e && o(t, e, n), this } }, { key: "get", value: function (e, t) { if (e = Oe(e)) { var n = G.findKey(this, e); if (n) { var r = this[n]; if (!t) return r; if (!0 === t) return function (e) { for (var t, n = Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; t = r.exec(e);)n[t[1]] = t[2]; return n }(r); if (G.isFunction(t)) return t.call(this, r, n); if (G.isRegExp(t)) return t.exec(r); throw new TypeError("parser must be boolean|regexp|function") } } } }, { key: "has", value: function (e, t) { if (e = Oe(e)) { var n = G.findKey(this, e); return !(!n || void 0 === this[n] || t && !Se(0, this[n], n, t)) } return !1 } }, { key: "delete", value: function (e, t) { var n = this, r = !1; function o(e) { if (e = Oe(e)) { var o = G.findKey(n, e); !o || t && !Se(0, n[o], o, t) || (delete n[o], r = !0) } } return G.isArray(e) ? e.forEach(o) : o(e), r } }, { key: "clear", value: function (e) { for (var t = Object.keys(this), n = t.length, r = !1; n--;) { var o = t[n]; e && !Se(0, this[o], o, e, !0) || (delete this[o], r = !0) } return r } }, { key: "normalize", value: function (e) { var t = this, n = {}; return G.forEach(this, (function (r, o) { var i = G.findKey(n, o); if (i) return t[i] = Ee(r), void delete t[o]; var a = e ? function (e) { return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (function (e, t, n) { return t.toUpperCase() + n })) }(o) : String(o).trim(); a !== o && delete t[o], t[a] = Ee(r), n[a] = !0 })), this } }, { key: "concat", value: function () { for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)n[r] = arguments[r]; return (e = this.constructor).concat.apply(e, [this].concat(n)) } }, { key: "toJSON", value: function (e) { var t = Object.create(null); return G.forEach(this, (function (n, r) { null != n && !1 !== n && (t[r] = e && G.isArray(n) ? n.join(", ") : n) })), t } }, { key: Symbol.iterator, value: function () { return Object.entries(this.toJSON())[Symbol.iterator]() } }, { key: "toString", value: function () { return Object.entries(this.toJSON()).map((function (e) { var t = s(e, 2); return t[0] + ": " + t[1] })).join("\n") } }, { key: Symbol.toStringTag, get: function () { return "AxiosHeaders" } }], [{ key: "from", value: function (e) { return e instanceof this ? e : new this(e) } }, { key: "concat", value: function (e) { for (var t = new this(e), n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++)r[o - 1] = arguments[o]; return r.forEach((function (e) { return t.set(e) })), t } }, { key: "accessor", value: function (e) { var t = (this[we] = this[we] = { accessors: {} }).accessors, n = this.prototype; function r(e) { var r = Oe(e); t[r] || (!function (e, t) { var n = G.toCamelCase(" " + t);["get", "set", "has"].forEach((function (r) { Object.defineProperty(e, r + n, { value: function (e, n, o) { return this[r].call(this, t, e, n, o) }, configurable: !0 }) })) }(n, e), t[r] = !0) } return G.isArray(e) ? e.forEach(r) : r(e), this } }]), n }(); Re.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]), G.reduceDescriptors(Re.prototype, (function (e, t) { var n = e.value, r = t[0].toUpperCase() + t.slice(1); return { get: function () { return n }, set: function (e) { this[r] = e } } })), G.freezeMethods(Re); var Ae = Re; function je(e, t) { var n = this || be, r = t || n, o = Ae.from(r.headers), i = r.data; return G.forEach(e, (function (e) { i = e.call(n, i, o.normalize(), t ? t.status : void 0) })), o.normalize(), i } function Te(e) { return !(!e || !e.__CANCEL__) } function Pe(e, t, n) { X.call(this, null == e ? "canceled" : e, X.ERR_CANCELED, t, n), this.name = "CanceledError" } G.inherits(Pe, X, { __CANCEL__: !0 }); var Ne = me.hasStandardBrowserEnv ? { write: function (e, t, n, r, o, i) { var a = [e + "=" + encodeURIComponent(t)]; G.isNumber(n) && a.push("expires=" + new Date(n).toGMTString()), G.isString(r) && a.push("path=" + r), G.isString(o) && a.push("domain=" + o), !0 === i && a.push("secure"), document.cookie = a.join("; ") }, read: function (e) { var t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)")); return t ? decodeURIComponent(t[3]) : null }, remove: function (e) { this.write(e, "", Date.now() - 864e5) } } : { write: function () { }, read: function () { return null }, remove: function () { } }; function xe(e, t) { return e && !/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t) ? function (e, t) { return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e }(e, t) : t } var Ce = me.hasStandardBrowserEnv ? function () { var e, t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a"); function r(e) { var r = e; return t && (n.setAttribute("href", r), r = n.href), n.setAttribute("href", r), { href: n.href, protocol: n.protocol ? n.protocol.replace(/:$/, "") : "", host: n.host, search: n.search ? n.search.replace(/^\?/, "") : "", hash: n.hash ? n.hash.replace(/^#/, "") : "", hostname: n.hostname, port: n.port, pathname: "/" === n.pathname.charAt(0) ? n.pathname : "/" + n.pathname } } return e = r(window.location.href), function (t) { var n = G.isString(t) ? r(t) : t; return n.protocol === e.protocol && n.host === e.host } }() : function () { return !0 }; function ke(e, t) { var n = 0, r = function (e, t) { e = e || 10; var n, r = new Array(e), o = new Array(e), i = 0, a = 0; return t = void 0 !== t ? t : 1e3, function (s) { var u = Date.now(), c = o[a]; n || (n = u), r[i] = s, o[i] = u; for (var f = a, l = 0; f !== i;)l += r[f++], f %= e; if ((i = (i + 1) % e) === a && (a = (a + 1) % e), !(u - n < t)) { var d = c && u - c; return d ? Math.round(1e3 * l / d) : void 0 } } }(50, 250); return function (o) { var i = o.loaded, a = o.lengthComputable ? o.total : void 0, s = i - n, u = r(s); n = i; var c = { loaded: i, total: a, progress: a ? i / a : void 0, bytes: s, rate: u || void 0, estimated: u && a && i <= a ? (a - i) / u : void 0, event: o }; c[t ? "download" : "upload"] = !0, e(c) } } var _e = { http: null, xhr: "undefined" != typeof XMLHttpRequest && function (e) { return new Promise((function (t, n) { var r, o, i, a = e.data, s = Ae.from(e.headers).normalize(), d = e.responseType, h = e.withXSRFToken; function m() { e.cancelToken && e.cancelToken.unsubscribe(r), e.signal && e.signal.removeEventListener("abort", r) } if (G.isFormData(a)) if (me.hasStandardBrowserEnv || me.hasStandardBrowserWebWorkerEnv) s.setContentType(!1); else if (!1 !== (o = s.getContentType())) { var y = o ? o.split(";").map((function (e) { return e.trim() })).filter(Boolean) : [], v = c(i = y) || f(i) || l(i) || p(), b = v[0], g = v.slice(1); s.setContentType([b || "multipart/form-data"].concat(u(g)).join("; ")) } var w = new XMLHttpRequest; if (e.auth) { var O = e.auth.username || "", E = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : ""; s.set("Authorization", "Basic " + btoa(O + ":" + E)) } var S = xe(e.baseURL, e.url); function R() { if (w) { var r = Ae.from("getAllResponseHeaders" in w && w.getAllResponseHeaders()); !function (e, t, n) { var r = n.config.validateStatus; n.status && r && !r(n.status) ? t(new X("Request failed with status code " + n.status, [X.ERR_BAD_REQUEST, X.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4], n.config, n.request, n)) : e(n) }((function (e) { t(e), m() }), (function (e) { n(e), m() }), { data: d && "text" !== d && "json" !== d ? w.response : w.responseText, status: w.status, statusText: w.statusText, headers: r, config: e, request: w }), w = null } } if (w.open(e.method.toUpperCase(), se(S, e.params, e.paramsSerializer), !0), w.timeout = e.timeout, "onloadend" in w ? w.onloadend = R : w.onreadystatechange = function () { w && 4 === w.readyState && (0 !== w.status || w.responseURL && 0 === w.responseURL.indexOf("file:")) && setTimeout(R) }, w.onabort = function () { w && (n(new X("Request aborted", X.ECONNABORTED, e, w)), w = null) }, w.onerror = function () { n(new X("Network Error", X.ERR_NETWORK, e, w)), w = null }, w.ontimeout = function () { var t = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded", r = e.transitional || fe; e.timeoutErrorMessage && (t = e.timeoutErrorMessage), n(new X(t, r.clarifyTimeoutError ? X.ETIMEDOUT : X.ECONNABORTED, e, w)), w = null }, me.hasStandardBrowserEnv && (h && G.isFunction(h) && (h = h(e)), h || !1 !== h && Ce(S))) { var A = e.xsrfHeaderName && e.xsrfCookieName && Ne.read(e.xsrfCookieName); A && s.set(e.xsrfHeaderName, A) } void 0 === a && s.setContentType(null), "setRequestHeader" in w && G.forEach(s.toJSON(), (function (e, t) { w.setRequestHeader(t, e) })), G.isUndefined(e.withCredentials) || (w.withCredentials = !!e.withCredentials), d && "json" !== d && (w.responseType = e.responseType), "function" == typeof e.onDownloadProgress && w.addEventListener("progress", ke(e.onDownloadProgress, !0)), "function" == typeof e.onUploadProgress && w.upload && w.upload.addEventListener("progress", ke(e.onUploadProgress)), (e.cancelToken || e.signal) && (r = function (t) { w && (n(!t || t.type ? new Pe(null, e, w) : t), w.abort(), w = null) }, e.cancelToken && e.cancelToken.subscribe(r), e.signal && (e.signal.aborted ? r() : e.signal.addEventListener("abort", r))); var j, T = (j = /^([-+\w]{1,25})(:?\/\/|:)/.exec(S)) && j[1] || ""; T && -1 === me.protocols.indexOf(T) ? n(new X("Unsupported protocol " + T + ":", X.ERR_BAD_REQUEST, e)) : w.send(a || null) })) } }; G.forEach(_e, (function (e, t) { if (e) { try { Object.defineProperty(e, "name", { value: t }) } catch (e) { } Object.defineProperty(e, "adapterName", { value: t }) } })); var Fe = function (e) { return "- ".concat(e) }, Ue = function (e) { return G.isFunction(e) || null === e || !1 === e }, De = function (e) { for (var t, n, r = (e = G.isArray(e) ? e : [e]).length, o = {}, i = 0; i < r; i++) { var a = void 0; if (n = t = e[i], !Ue(t) && void 0 === (n = _e[(a = String(t)).toLowerCase()])) throw new X("Unknown adapter '".concat(a, "'")); if (n) break; o[a || "#" + i] = n } if (!n) { var u = Object.entries(o).map((function (e) { var t = s(e, 2), n = t[0], r = t[1]; return "adapter ".concat(n, " ") + (!1 === r ? "is not supported by the environment" : "is not available in the build") })); throw new X("There is no suitable adapter to dispatch the request " + (r ? u.length > 1 ? "since :\n" + u.map(Fe).join("\n") : " " + Fe(u[0]) : "as no adapter specified"), "ERR_NOT_SUPPORT") } return n }; function Be(e) { if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted) throw new Pe(null, e) } function Le(e) { return Be(e), e.headers = Ae.from(e.headers), e.data = je.call(e, e.transformRequest), -1 !== ["post", "put", "patch"].indexOf(e.method) && e.headers.setContentType("application/x-www-form-urlencoded", !1), De(e.adapter || be.adapter)(e).then((function (t) { return Be(e), t.data = je.call(e, e.transformResponse, t), t.headers = Ae.from(t.headers), t }), (function (t) { return Te(t) || (Be(e), t && t.response && (t.response.data = je.call(e, e.transformResponse, t.response), t.response.headers = Ae.from(t.response.headers))), Promise.reject(t) })) } var Ie = function (e) { return e instanceof Ae ? e.toJSON() : e }; function qe(e, t) { t = t || {}; var n = {}; function r(e, t, n) { return G.isPlainObject(e) && G.isPlainObject(t) ? G.merge.call({ caseless: n }, e, t) : G.isPlainObject(t) ? G.merge({}, t) : G.isArray(t) ? t.slice() : t } function o(e, t, n) { return G.isUndefined(t) ? G.isUndefined(e) ? void 0 : r(void 0, e, n) : r(e, t, n) } function i(e, t) { if (!G.isUndefined(t)) return r(void 0, t) } function a(e, t) { return G.isUndefined(t) ? G.isUndefined(e) ? void 0 : r(void 0, e) : r(void 0, t) } function s(n, o, i) { return i in t ? r(n, o) : i in e ? r(void 0, n) : void 0 } var u = { url: i, method: i, data: i, baseURL: a, transformRequest: a, transformResponse: a, paramsSerializer: a, timeout: a, timeoutMessage: a, withCredentials: a, withXSRFToken: a, adapter: a, responseType: a, xsrfCookieName: a, xsrfHeaderName: a, onUploadProgress: a, onDownloadProgress: a, decompress: a, maxContentLength: a, maxBodyLength: a, beforeRedirect: a, transport: a, httpAgent: a, httpsAgent: a, cancelToken: a, socketPath: a, responseEncoding: a, validateStatus: s, headers: function (e, t) { return o(Ie(e), Ie(t), !0) } }; return G.forEach(Object.keys(Object.assign({}, e, t)), (function (r) { var i = u[r] || o, a = i(e[r], t[r], r); G.isUndefined(a) && i !== s || (n[r] = a) })), n } var ze = "1.6.2", Me = {};["object", "boolean", "number", "function", "string", "symbol"].forEach((function (e, t) { Me[e] = function (r) { return n(r) === e || "a" + (t < 1 ? "n " : " ") + e } })); var He = {}; Me.transitional = function (e, t, n) { function r(e, t) { return "[Axios v1.6.2] Transitional option '" + e + "'" + t + (n ? ". " + n : "") } return function (n, o, i) { if (!1 === e) throw new X(r(o, " has been removed" + (t ? " in " + t : "")), X.ERR_DEPRECATED); return t && !He[o] && (He[o] = !0, console.warn(r(o, " has been deprecated since v" + t + " and will be removed in the near future"))), !e || e(n, o, i) } }; var Je = { assertOptions: function (e, t, r) { if ("object" !== n(e)) throw new X("options must be an object", X.ERR_BAD_OPTION_VALUE); for (var o = Object.keys(e), i = o.length; i-- > 0;) { var a = o[i], s = t[a]; if (s) { var u = e[a], c = void 0 === u || s(u, a, e); if (!0 !== c) throw new X("option " + a + " must be " + c, X.ERR_BAD_OPTION_VALUE) } else if (!0 !== r) throw new X("Unknown option " + a, X.ERR_BAD_OPTION) } }, validators: Me }, We = Je.validators, Ke = function () { function e(t) { r(this, e), this.defaults = t, this.interceptors = { request: new ce, response: new ce } } return i(e, [{ key: "request", value: function (e, t) { "string" == typeof e ? (t = t || {}).url = e : t = e || {}; var n = t = qe(this.defaults, t), r = n.transitional, o = n.paramsSerializer, i = n.headers; void 0 !== r && Je.assertOptions(r, { silentJSONParsing: We.transitional(We.boolean), forcedJSONParsing: We.transitional(We.boolean), clarifyTimeoutError: We.transitional(We.boolean) }, !1), null != o && (G.isFunction(o) ? t.paramsSerializer = { serialize: o } : Je.assertOptions(o, { encode: We.function, serialize: We.function }, !0)), t.method = (t.method || this.defaults.method || "get").toLowerCase(); var a = i && G.merge(i.common, i[t.method]); i && G.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (function (e) { delete i[e] })), t.headers = Ae.concat(a, i); var s = [], u = !0; this.interceptors.request.forEach((function (e) { "function" == typeof e.runWhen && !1 === e.runWhen(t) || (u = u && e.synchronous, s.unshift(e.fulfilled, e.rejected)) })); var c, f = []; this.interceptors.response.forEach((function (e) { f.push(e.fulfilled, e.rejected) })); var l, d = 0; if (!u) { var p = [Le.bind(this), void 0]; for (p.unshift.apply(p, s), p.push.apply(p, f), l = p.length, c = Promise.resolve(t); d < l;)c = c.then(p[d++], p[d++]); return c } l = s.length; var h = t; for (d = 0; d < l;) { var m = s[d++], y = s[d++]; try { h = m(h) } catch (e) { y.call(this, e); break } } try { c = Le.call(this, h) } catch (e) { return Promise.reject(e) } for (d = 0, l = f.length; d < l;)c = c.then(f[d++], f[d++]); return c } }, { key: "getUri", value: function (e) { return se(xe((e = qe(this.defaults, e)).baseURL, e.url), e.params, e.paramsSerializer) } }]), e }(); G.forEach(["delete", "get", "head", "options"], (function (e) { Ke.prototype[e] = function (t, n) { return this.request(qe(n || {}, { method: e, url: t, data: (n || {}).data })) } })), G.forEach(["post", "put", "patch"], (function (e) { function t(t) { return function (n, r, o) { return this.request(qe(o || {}, { method: e, headers: t ? { "Content-Type": "multipart/form-data" } : {}, url: n, data: r })) } } Ke.prototype[e] = t(), Ke.prototype[e + "Form"] = t(!0) })); var Ve = Ke, Ge = function () { function e(t) { if (r(this, e), "function" != typeof t) throw new TypeError("executor must be a function."); var n; this.promise = new Promise((function (e) { n = e })); var o = this; this.promise.then((function (e) { if (o._listeners) { for (var t = o._listeners.length; t-- > 0;)o._listeners[t](e); o._listeners = null } })), this.promise.then = function (e) { var t, n = new Promise((function (e) { o.subscribe(e), t = e })).then(e); return n.cancel = function () { o.unsubscribe(t) }, n }, t((function (e, t, r) { o.reason || (o.reason = new Pe(e, t, r), n(o.reason)) })) } return i(e, [{ key: "throwIfRequested", value: function () { if (this.reason) throw this.reason } }, { key: "subscribe", value: function (e) { this.reason ? e(this.reason) : this._listeners ? this._listeners.push(e) : this._listeners = [e] } }, { key: "unsubscribe", value: function (e) { if (this._listeners) { var t = this._listeners.indexOf(e); -1 !== t && this._listeners.splice(t, 1) } } }], [{ key: "source", value: function () { var t; return { token: new e((function (e) { t = e })), cancel: t } } }]), e }(); var Xe = { Continue: 100, SwitchingProtocols: 101, Processing: 102, EarlyHints: 103, Ok: 200, Created: 201, Accepted: 202, NonAuthoritativeInformation: 203, NoContent: 204, ResetContent: 205, PartialContent: 206, MultiStatus: 207, AlreadyReported: 208, ImUsed: 226, MultipleChoices: 300, MovedPermanently: 301, Found: 302, SeeOther: 303, NotModified: 304, UseProxy: 305, Unused: 306, TemporaryRedirect: 307, PermanentRedirect: 308, BadRequest: 400, Unauthorized: 401, PaymentRequired: 402, Forbidden: 403, NotFound: 404, MethodNotAllowed: 405, NotAcceptable: 406, ProxyAuthenticationRequired: 407, RequestTimeout: 408, Conflict: 409, Gone: 410, LengthRequired: 411, PreconditionFailed: 412, PayloadTooLarge: 413, UriTooLong: 414, UnsupportedMediaType: 415, RangeNotSatisfiable: 416, ExpectationFailed: 417, ImATeapot: 418, MisdirectedRequest: 421, UnprocessableEntity: 422, Locked: 423, FailedDependency: 424, TooEarly: 425, UpgradeRequired: 426, PreconditionRequired: 428, TooManyRequests: 429, RequestHeaderFieldsTooLarge: 431, UnavailableForLegalReasons: 451, InternalServerError: 500, NotImplemented: 501, BadGateway: 502, ServiceUnavailable: 503, GatewayTimeout: 504, HttpVersionNotSupported: 505, VariantAlsoNegotiates: 506, InsufficientStorage: 507, LoopDetected: 508, NotExtended: 510, NetworkAuthenticationRequired: 511 }; Object.entries(Xe).forEach((function (e) { var t = s(e, 2), n = t[0], r = t[1]; Xe[r] = n })); var $e = Xe; var Qe = function e(t) { var n = new Ve(t), r = h(Ve.prototype.request, n); return G.extend(r, Ve.prototype, n, { allOwnKeys: !0 }), G.extend(r, n, null, { allOwnKeys: !0 }), r.create = function (n) { return e(qe(t, n)) }, r }(be); return Qe.Axios = Ve, Qe.CanceledError = Pe, Qe.CancelToken = Ge, Qe.isCancel = Te, Qe.VERSION = ze, Qe.toFormData = ne, Qe.AxiosError = X, Qe.Cancel = Qe.CanceledError, Qe.all = function (e) { return Promise.all(e) }, Qe.spread = function (e) { return function (t) { return e.apply(null, t) } }, Qe.isAxiosError = function (e) { return G.isObject(e) && !0 === e.isAxiosError }, Qe.mergeConfig = qe, Qe.AxiosHeaders = Ae, Qe.formToJSON = function (e) { return ye(G.isHTMLForm(e) ? new FormData(e) : e) }, Qe.getAdapter = De, Qe.HttpStatusCode = $e, Qe.default = Qe, Qe })); +//# sourceMappingURL=axios.min.js.map \ No newline at end of file diff --git a/SuperAPI/wwwroot/rezero/default_ui/js/bootstrap-colorpicker/bootstrap-colorpicker.js b/SuperAPI/wwwroot/rezero/default_ui/js/bootstrap-colorpicker/bootstrap-colorpicker.js new file mode 100644 index 0000000..758ebc3 --- /dev/null +++ b/SuperAPI/wwwroot/rezero/default_ui/js/bootstrap-colorpicker/bootstrap-colorpicker.js @@ -0,0 +1,1106 @@ +/*! + * Bootstrap Colorpicker v2.3.3 + * http://mjolnic.github.io/bootstrap-colorpicker/ + * + * Originally written by (c) 2012 Stefan Petre + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0.txt + * + */ + +(function(factory) { + "use strict"; + if (typeof exports === 'object') { + module.exports = factory(window.jQuery); + } else if (typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else if (window.jQuery && !window.jQuery.fn.colorpicker) { + factory(window.jQuery); + } +}(function($) { + 'use strict'; + + /** + * Color manipulation helper class + * + * @param {Object|String} val + * @param {Object} predefinedColors + * @constructor + */ + var Color = function(val, predefinedColors) { + this.value = { + h: 0, + s: 0, + b: 0, + a: 1 + }; + this.origFormat = null; // original string format + if (predefinedColors) { + $.extend(this.colors, predefinedColors); + } + if (val) { + if (val.toLowerCase !== undefined) { + // cast to string + val = val + ''; + this.setColor(val); + } else if (val.h !== undefined) { + this.value = val; + } + } + }; + + Color.prototype = { + constructor: Color, + // 140 predefined colors from the HTML Colors spec + colors: { + "aliceblue": "#f0f8ff", + "antiquewhite": "#faebd7", + "aqua": "#00ffff", + "aquamarine": "#7fffd4", + "azure": "#f0ffff", + "beige": "#f5f5dc", + "bisque": "#ffe4c4", + "black": "#000000", + "blanchedalmond": "#ffebcd", + "blue": "#0000ff", + "blueviolet": "#8a2be2", + "brown": "#a52a2a", + "burlywood": "#deb887", + "cadetblue": "#5f9ea0", + "chartreuse": "#7fff00", + "chocolate": "#d2691e", + "coral": "#ff7f50", + "cornflowerblue": "#6495ed", + "cornsilk": "#fff8dc", + "crimson": "#dc143c", + "cyan": "#00ffff", + "darkblue": "#00008b", + "darkcyan": "#008b8b", + "darkgoldenrod": "#b8860b", + "darkgray": "#a9a9a9", + "darkgreen": "#006400", + "darkkhaki": "#bdb76b", + "darkmagenta": "#8b008b", + "darkolivegreen": "#556b2f", + "darkorange": "#ff8c00", + "darkorchid": "#9932cc", + "darkred": "#8b0000", + "darksalmon": "#e9967a", + "darkseagreen": "#8fbc8f", + "darkslateblue": "#483d8b", + "darkslategray": "#2f4f4f", + "darkturquoise": "#00ced1", + "darkviolet": "#9400d3", + "deeppink": "#ff1493", + "deepskyblue": "#00bfff", + "dimgray": "#696969", + "dodgerblue": "#1e90ff", + "firebrick": "#b22222", + "floralwhite": "#fffaf0", + "forestgreen": "#228b22", + "fuchsia": "#ff00ff", + "gainsboro": "#dcdcdc", + "ghostwhite": "#f8f8ff", + "gold": "#ffd700", + "goldenrod": "#daa520", + "gray": "#808080", + "green": "#008000", + "greenyellow": "#adff2f", + "honeydew": "#f0fff0", + "hotpink": "#ff69b4", + "indianred": "#cd5c5c", + "indigo": "#4b0082", + "ivory": "#fffff0", + "khaki": "#f0e68c", + "lavender": "#e6e6fa", + "lavenderblush": "#fff0f5", + "lawngreen": "#7cfc00", + "lemonchiffon": "#fffacd", + "lightblue": "#add8e6", + "lightcoral": "#f08080", + "lightcyan": "#e0ffff", + "lightgoldenrodyellow": "#fafad2", + "lightgrey": "#d3d3d3", + "lightgreen": "#90ee90", + "lightpink": "#ffb6c1", + "lightsalmon": "#ffa07a", + "lightseagreen": "#20b2aa", + "lightskyblue": "#87cefa", + "lightslategray": "#778899", + "lightsteelblue": "#b0c4de", + "lightyellow": "#ffffe0", + "lime": "#00ff00", + "limegreen": "#32cd32", + "linen": "#faf0e6", + "magenta": "#ff00ff", + "maroon": "#800000", + "mediumaquamarine": "#66cdaa", + "mediumblue": "#0000cd", + "mediumorchid": "#ba55d3", + "mediumpurple": "#9370d8", + "mediumseagreen": "#3cb371", + "mediumslateblue": "#7b68ee", + "mediumspringgreen": "#00fa9a", + "mediumturquoise": "#48d1cc", + "mediumvioletred": "#c71585", + "midnightblue": "#191970", + "mintcream": "#f5fffa", + "mistyrose": "#ffe4e1", + "moccasin": "#ffe4b5", + "navajowhite": "#ffdead", + "navy": "#000080", + "oldlace": "#fdf5e6", + "olive": "#808000", + "olivedrab": "#6b8e23", + "orange": "#ffa500", + "orangered": "#ff4500", + "orchid": "#da70d6", + "palegoldenrod": "#eee8aa", + "palegreen": "#98fb98", + "paleturquoise": "#afeeee", + "palevioletred": "#d87093", + "papayawhip": "#ffefd5", + "peachpuff": "#ffdab9", + "peru": "#cd853f", + "pink": "#ffc0cb", + "plum": "#dda0dd", + "powderblue": "#b0e0e6", + "purple": "#800080", + "red": "#ff0000", + "rosybrown": "#bc8f8f", + "royalblue": "#4169e1", + "saddlebrown": "#8b4513", + "salmon": "#fa8072", + "sandybrown": "#f4a460", + "seagreen": "#2e8b57", + "seashell": "#fff5ee", + "sienna": "#a0522d", + "silver": "#c0c0c0", + "skyblue": "#87ceeb", + "slateblue": "#6a5acd", + "slategray": "#708090", + "snow": "#fffafa", + "springgreen": "#00ff7f", + "steelblue": "#4682b4", + "tan": "#d2b48c", + "teal": "#008080", + "thistle": "#d8bfd8", + "tomato": "#ff6347", + "turquoise": "#40e0d0", + "violet": "#ee82ee", + "wheat": "#f5deb3", + "white": "#ffffff", + "whitesmoke": "#f5f5f5", + "yellow": "#ffff00", + "yellowgreen": "#9acd32", + "transparent": "transparent" + }, + _sanitizeNumber: function(val) { + if (typeof val === 'number') { + return val; + } + if (isNaN(val) || (val === null) || (val === '') || (val === undefined)) { + return 1; + } + if (val === '') { + return 0; + } + if (val.toLowerCase !== undefined) { + if (val.match(/^\./)) { + val = "0" + val; + } + return Math.ceil(parseFloat(val) * 100) / 100; + } + return 1; + }, + isTransparent: function(strVal) { + if (!strVal) { + return false; + } + strVal = strVal.toLowerCase().trim(); + return (strVal === 'transparent') || (strVal.match(/#?00000000/)) || (strVal.match(/(rgba|hsla)\(0,0,0,0?\.?0\)/)); + }, + rgbaIsTransparent: function(rgba) { + return ((rgba.r === 0) && (rgba.g === 0) && (rgba.b === 0) && (rgba.a === 0)); + }, + //parse a string to HSB + setColor: function(strVal) { + strVal = strVal.toLowerCase().trim(); + if (strVal) { + if (this.isTransparent(strVal)) { + this.value = { + h: 0, + s: 0, + b: 0, + a: 0 + }; + } else { + this.value = this.stringToHSB(strVal) || { + h: 0, + s: 0, + b: 0, + a: 1 + }; // if parser fails, defaults to black + } + } + }, + stringToHSB: function(strVal) { + strVal = strVal.toLowerCase(); + var alias; + if (typeof this.colors[strVal] !== 'undefined') { + strVal = this.colors[strVal]; + alias = 'alias'; + } + var that = this, + result = false; + $.each(this.stringParsers, function(i, parser) { + var match = parser.re.exec(strVal), + values = match && parser.parse.apply(that, [match]), + format = alias || parser.format || 'rgba'; + if (values) { + if (format.match(/hsla?/)) { + result = that.RGBtoHSB.apply(that, that.HSLtoRGB.apply(that, values)); + } else { + result = that.RGBtoHSB.apply(that, values); + } + that.origFormat = format; + return false; + } + return true; + }); + return result; + }, + setHue: function(h) { + this.value.h = 1 - h; + }, + setSaturation: function(s) { + this.value.s = s; + }, + setBrightness: function(b) { + this.value.b = 1 - b; + }, + setAlpha: function(a) { + this.value.a = Math.round((parseInt((1 - a) * 100, 10) / 100) * 100) / 100; + }, + toRGB: function(h, s, b, a) { + if (!h) { + h = this.value.h; + s = this.value.s; + b = this.value.b; + } + h *= 360; + var R, G, B, X, C; + h = (h % 360) / 60; + C = b * s; + X = C * (1 - Math.abs(h % 2 - 1)); + R = G = B = b - C; + + h = ~~h; + R += [C, X, 0, 0, X, C][h]; + G += [X, C, C, X, 0, 0][h]; + B += [0, 0, X, C, C, X][h]; + return { + r: Math.round(R * 255), + g: Math.round(G * 255), + b: Math.round(B * 255), + a: a || this.value.a + }; + }, + toHex: function(h, s, b, a) { + var rgb = this.toRGB(h, s, b, a); + if (this.rgbaIsTransparent(rgb)) { + return 'transparent'; + } + return '#' + ((1 << 24) | (parseInt(rgb.r) << 16) | (parseInt(rgb.g) << 8) | parseInt(rgb.b)).toString(16).substr(1); + }, + toHSL: function(h, s, b, a) { + h = h || this.value.h; + s = s || this.value.s; + b = b || this.value.b; + a = a || this.value.a; + + var H = h, + L = (2 - s) * b, + S = s * b; + if (L > 0 && L <= 1) { + S /= L; + } else { + S /= 2 - L; + } + L /= 2; + if (S > 1) { + S = 1; + } + return { + h: isNaN(H) ? 0 : H, + s: isNaN(S) ? 0 : S, + l: isNaN(L) ? 0 : L, + a: isNaN(a) ? 0 : a + }; + }, + toAlias: function(r, g, b, a) { + var rgb = this.toHex(r, g, b, a); + for (var alias in this.colors) { + if (this.colors[alias] === rgb) { + return alias; + } + } + return false; + }, + RGBtoHSB: function(r, g, b, a) { + r /= 255; + g /= 255; + b /= 255; + + var H, S, V, C; + V = Math.max(r, g, b); + C = V - Math.min(r, g, b); + H = (C === 0 ? null : + V === r ? (g - b) / C : + V === g ? (b - r) / C + 2 : + (r - g) / C + 4 + ); + H = ((H + 360) % 6) * 60 / 360; + S = C === 0 ? 0 : C / V; + return { + h: this._sanitizeNumber(H), + s: S, + b: V, + a: this._sanitizeNumber(a) + }; + }, + HueToRGB: function(p, q, h) { + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + if ((h * 6) < 1) { + return p + (q - p) * h * 6; + } else if ((h * 2) < 1) { + return q; + } else if ((h * 3) < 2) { + return p + (q - p) * ((2 / 3) - h) * 6; + } else { + return p; + } + }, + HSLtoRGB: function(h, s, l, a) { + if (s < 0) { + s = 0; + } + var q; + if (l <= 0.5) { + q = l * (1 + s); + } else { + q = l + s - (l * s); + } + + var p = 2 * l - q; + + var tr = h + (1 / 3); + var tg = h; + var tb = h - (1 / 3); + + var r = Math.round(this.HueToRGB(p, q, tr) * 255); + var g = Math.round(this.HueToRGB(p, q, tg) * 255); + var b = Math.round(this.HueToRGB(p, q, tb) * 255); + return [r, g, b, this._sanitizeNumber(a)]; + }, + toString: function(format) { + format = format || 'rgba'; + var c = false; + switch (format) { + case 'rgb': + { + c = this.toRGB(); + if (this.rgbaIsTransparent(c)) { + return 'transparent'; + } + return 'rgb(' + c.r + ',' + c.g + ',' + c.b + ')'; + } + break; + case 'rgba': + { + c = this.toRGB(); + return 'rgba(' + c.r + ',' + c.g + ',' + c.b + ',' + c.a + ')'; + } + break; + case 'hsl': + { + c = this.toHSL(); + return 'hsl(' + Math.round(c.h * 360) + ',' + Math.round(c.s * 100) + '%,' + Math.round(c.l * 100) + '%)'; + } + break; + case 'hsla': + { + c = this.toHSL(); + return 'hsla(' + Math.round(c.h * 360) + ',' + Math.round(c.s * 100) + '%,' + Math.round(c.l * 100) + '%,' + c.a + ')'; + } + break; + case 'hex': + { + return this.toHex(); + } + break; + case 'alias': + return this.toAlias() || this.toHex(); + default: + { + return c; + } + break; + } + }, + // a set of RE's that can match strings and generate color tuples. + // from John Resig color plugin + // https://github.com/jquery/jquery-color/ + stringParsers: [{ + re: /rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*?\)/, + format: 'rgb', + parse: function(execResult) { + return [ + execResult[1], + execResult[2], + execResult[3], + 1 + ]; + } + }, { + re: /rgb\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/, + format: 'rgb', + parse: function(execResult) { + return [ + 2.55 * execResult[1], + 2.55 * execResult[2], + 2.55 * execResult[3], + 1 + ]; + } + }, { + re: /rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/, + format: 'rgba', + parse: function(execResult) { + return [ + execResult[1], + execResult[2], + execResult[3], + execResult[4] + ]; + } + }, { + re: /rgba\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/, + format: 'rgba', + parse: function(execResult) { + return [ + 2.55 * execResult[1], + 2.55 * execResult[2], + 2.55 * execResult[3], + execResult[4] + ]; + } + }, { + re: /hsl\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/, + format: 'hsl', + parse: function(execResult) { + return [ + execResult[1] / 360, + execResult[2] / 100, + execResult[3] / 100, + execResult[4] + ]; + } + }, { + re: /hsla\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/, + format: 'hsla', + parse: function(execResult) { + return [ + execResult[1] / 360, + execResult[2] / 100, + execResult[3] / 100, + execResult[4] + ]; + } + }, { + re: /#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/, + format: 'hex', + parse: function(execResult) { + return [ + parseInt(execResult[1], 16), + parseInt(execResult[2], 16), + parseInt(execResult[3], 16), + 1 + ]; + } + }, { + re: /#?([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/, + format: 'hex', + parse: function(execResult) { + return [ + parseInt(execResult[1] + execResult[1], 16), + parseInt(execResult[2] + execResult[2], 16), + parseInt(execResult[3] + execResult[3], 16), + 1 + ]; + } + }], + colorNameToHex: function(name) { + if (typeof this.colors[name.toLowerCase()] !== 'undefined') { + return this.colors[name.toLowerCase()]; + } + return false; + } + }; + + /* + * Default plugin options + */ + var defaults = { + horizontal: false, // horizontal mode layout ? + inline: false, //forces to show the colorpicker as an inline element + color: false, //forces a color + format: false, //forces a format + input: 'input', // children input selector + container: false, // container selector + component: '.add-on, .input-group-addon', // children component selector + sliders: { + saturation: { + maxLeft: 100, + maxTop: 100, + callLeft: 'setSaturation', + callTop: 'setBrightness' + }, + hue: { + maxLeft: 0, + maxTop: 100, + callLeft: false, + callTop: 'setHue' + }, + alpha: { + maxLeft: 0, + maxTop: 100, + callLeft: false, + callTop: 'setAlpha' + } + }, + slidersHorz: { + saturation: { + maxLeft: 100, + maxTop: 100, + callLeft: 'setSaturation', + callTop: 'setBrightness' + }, + hue: { + maxLeft: 100, + maxTop: 0, + callLeft: 'setHue', + callTop: false + }, + alpha: { + maxLeft: 100, + maxTop: 0, + callLeft: 'setAlpha', + callTop: false + } + }, + template: '