@kajitiluna/erd-cli 0.261003.194400 → 0.261011.3830

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/erd-cli.cjs +33 -33
  2. package/package.json +1 -1
package/erd-cli.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- var iu=Object.create;var Ur=Object.defineProperty;var au=Object.getOwnPropertyDescriptor;var su=Object.getOwnPropertyNames;var lu=Object.getPrototypeOf,cu=Object.prototype.hasOwnProperty;var Lr=(t,e)=>{for(var n in e)Ur(t,n,{get:e[n],enumerable:!0})},uu=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of su(e))!cu.call(t,o)&&o!==n&&Ur(t,o,{get:()=>e[o],enumerable:!(r=au(e,o))||r.enumerable});return t};var tt=(t,e,n)=>(n=t!=null?iu(lu(t)):{},uu(e||!t||!t.__esModule?Ur(n,"default",{value:t,enumerable:!0}):n,t));var $r=tt(require("node:process"),1);var ui=(t,e)=>{let n=new Map(e.map(i=>[i.name,i])),r=du(t,n);return r.resultType==="invalid"?{resultType:"invalid",message:r.message}:{resultType:"parsed",options:pu(r.values,r.flags,r.operands)}},du=(t,e)=>{let n=new Map,r=new Set,o=[],i=0,a=!1;for(;i<t.length;){let s=t[i];if(a||s==="--"){a=!0,s!=="--"&&o.push(s),i+=1;continue}if(s.startsWith("--")===!1){o.push(s),i+=1;continue}let l=mu(t,i,e);if(l.resultType==="invalid")return l;if(l.resultType==="flag"){r.add(l.optionName),i+=1;continue}let c=n.get(l.optionName)??[];c.push(l.value),n.set(l.optionName,c),i+=l.tokenCount}return{resultType:"collected",values:n,flags:r,operands:o}},mu=(t,e,n)=>{let r=t[e],o=r.indexOf("="),i=o>=0?r.slice(0,o):r,a=n.get(i);if(a==null)return{resultType:"invalid",message:`Unknown option: ${i}.`};if(a.arity==="flag")return o>=0?{resultType:"invalid",message:`Option ${i} does not take a value.`}:{resultType:"flag",optionName:i};let s=o>=0?r.slice(o+1):null;if(s!=null)return{resultType:"value",tokenCount:1,optionName:i,value:s};let l=t[e+1];return l==null||l.startsWith("--")?{resultType:"invalid",message:`Option ${i} requires a value.`}:{resultType:"value",tokenCount:2,optionName:i,value:l}},pu=(t,e,n)=>({findValue:r=>hu(t,r),listValues:r=>t.get(r)??[],hasFlag:r=>e.has(r),operands:n}),hu=(t,e)=>{let n=t.get(e);return n==null||n.length===0?null:n[n.length-1]};var nt=class t{constructor(e){this.regexes=e}static create(e){try{let n=e.map(r=>new RegExp(r));return{resultType:"parsed",filter:new t(n)}}catch(n){return{resultType:"invalid",message:`Invalid --ignore-table pattern: ${n instanceof Error?n.message:String(n)}`}}}filterTables(e){let n=e.tables.filter(r=>this.keep(r));return{...e,tables:n}}ignoredTableNames(e){return e.tables.filter(n=>this.keep(n)===!1).map(n=>di(n))}keep(e){let n=di(e);return this.regexes.every(r=>r.test(e.tableName)===!1&&r.test(n)===!1)}},di=t=>t.schemaName!==""?`${t.schemaName}.${t.tableName}`:t.tableName;var pi=tt(require("node:process"),1);var Ae=class{constructor({indexOptions:e,indexTypes:n,supportsClustered:r=!1,nullsOrder:o=!1,supportsIndex:i=!0}){this.indexOptions=e,this.indexTypes=n,this.supportsClustered=r,this.nullsOrder=o,this.supportsIndex=i}};var Re=class{constructor({orderable:e,supportsUniqueKey:n=!0}){this.orderable=e,this.supportsUniqueKey=n}};var ee=class{constructor(e,n,r,o,i,a){this.databaseType=e;this.name=n;this.uniqueKeySupport=r;this.tableIndexSupport=o;this.tableOption=i;this.columnOption=a}static get(e){return mi[e]}static allDatabaseTypes(){return Object.keys(mi)}get supportsSchema(){return this.tableOption.supportsSchema}get defaultSchemaName(){return this.tableOption.defaultSchemaName}get supportsTableCollate(){return this.tableOption.supportsTableCollate}get supportsArrayType(){return this.columnOption.supportArray}get supportsStructType(){return this.columnOption.supportStruct}get editableCharacterSet(){return this.columnOption.editableCharacterSet}get caseSensitiveColumnName(){return this.columnOption.caseSensitiveColumnName}get collatePattern(){return this.tableOption.collatePattern}autoIncrementLabel(){return this.columnOption.autoIncrementLabel}},mi={postgres:new ee("postgres","PostgreSQL",new Re({orderable:!1}),new Ae({indexOptions:["UNIQUE"],indexTypes:["BTREE","HASH","GIST","SPGIST","GIN","BRIN"],nullsOrder:!0}),{supportsSchema:!0,defaultSchemaName:"public",supportsTableCollate:!1,collatePattern:/^[a-zA-Z][a-zA-Z0-9_.-]*$/},{autoIncrementLabel:"Generated Always As Identity",editableCharacterSet:!1,supportArray:!0,supportStruct:!1,caseSensitiveColumnName:!0}),mysql:new ee("mysql","MySQL",new Re({orderable:!0}),new Ae({indexOptions:["UNIQUE","FULLTEXT","SPATIAL"],indexTypes:["BTREE","HASH"]}),{supportsSchema:!1,defaultSchemaName:"",supportsTableCollate:!0,collatePattern:/^[a-zA-Z][a-zA-Z0-9_]*$/},{autoIncrementLabel:"Auto Increment",editableCharacterSet:!0,supportArray:!1,supportStruct:!1,caseSensitiveColumnName:!1}),mariadb:new ee("mariadb","MariaDB",new Re({orderable:!0}),new Ae({indexOptions:["UNIQUE","FULLTEXT","SPATIAL"],indexTypes:["BTREE","HASH"]}),{supportsSchema:!1,defaultSchemaName:"",supportsTableCollate:!0,collatePattern:/^[a-zA-Z][a-zA-Z0-9_]*$/},{autoIncrementLabel:"Auto Increment",editableCharacterSet:!0,supportArray:!1,supportStruct:!1,caseSensitiveColumnName:!1}),ms_sqlserver:new ee("ms_sqlserver","MS SQL Server",new Re({orderable:!0}),new Ae({indexOptions:["UNIQUE"],indexTypes:[],supportsClustered:!0}),{supportsSchema:!0,defaultSchemaName:"dbo",supportsTableCollate:!1,collatePattern:/^[a-zA-Z][a-zA-Z0-9_]*$/},{autoIncrementLabel:"Identity",editableCharacterSet:!1,supportArray:!1,supportStruct:!1,caseSensitiveColumnName:!1}),sqlite:new ee("sqlite","SQLite",new Re({orderable:!0}),new Ae({indexOptions:["UNIQUE"],indexTypes:[]}),{supportsSchema:!1,defaultSchemaName:"",supportsTableCollate:!1,collatePattern:/^[a-zA-Z][a-zA-Z0-9_]*$/},{autoIncrementLabel:"",editableCharacterSet:!1,supportArray:!1,supportStruct:!1,caseSensitiveColumnName:!1}),bigquery:new ee("bigquery","BigQuery",new Re({orderable:!1,supportsUniqueKey:!1}),new Ae({indexOptions:[],indexTypes:[],supportsIndex:!1}),{supportsSchema:!0,defaultSchemaName:"",supportsTableCollate:!1,collatePattern:/^[a-zA-Z][a-zA-Z0-9_.:-]*$/},{autoIncrementLabel:"",editableCharacterSet:!1,supportArray:!0,supportStruct:!0,caseSensitiveColumnName:!1}),snowflake:new ee("snowflake","Snowflake",new Re({orderable:!1}),new Ae({indexOptions:[],indexTypes:[],supportsIndex:!1}),{supportsSchema:!0,defaultSchemaName:"PUBLIC",supportsTableCollate:!1,collatePattern:/^[a-zA-Z][a-zA-Z0-9_.:-]*$/},{autoIncrementLabel:"Autoincrement",editableCharacterSet:!1,supportArray:!1,supportStruct:!1,caseSensitiveColumnName:!0})};var oe=class{static{this.OPTION_SPECS=[{name:"--ignore-table",arity:"repeatable"},{name:"--no-index",arity:"flag"},{name:"--no-foreign-key",arity:"flag"},{name:"--no-comment",arity:"flag"},{name:"--no-schema",arity:"flag"},{name:"--format",arity:"single"}]}constructor(){}static findConnectionUrl(e){let n=pi.default.env.ERD_DB_URL;return n!=null&&n!==""?n:e.findValue("--dsn")}static toCompareScope(e,n,r){return{withIndex:e.hasFlag("--no-index")===!1,withForeignKey:e.hasFlag("--no-foreign-key")===!1,withComment:e.hasFlag("--no-comment")===!1,withSchema:e.hasFlag("--no-schema")===!1,withLogicalName:n==="designToRevision",commentStyle:r}}static toSnapshotTarget(e,n,r){let o=e.findValue("--schema")??"",a=ee.get(n).supportsSchema;return a===!1&&o!==""&&console.warn(`warn: --schema is ignored for ${n}. The target database is the one selected by the connection URL.`),{schemaOption:a?o:"",designSchemaNames:r}}static toDiffFormat(e){let n=e.findValue("--format")??"text";return n!=="text"&&n!=="json"&&n!=="markdown"?{resultType:"invalid",message:`Invalid --format value: ${n}. Expected one of: text, json, markdown.`}:{resultType:"parsed",format:n}}};var Fe=tt(require("fs"),1),Zt=tt(require("path"),1),xc=require("url");var hi={documents:"erd-designer://documents",documentDetail:"erd-designer://documents/{documentId}",documentFor:t=>`erd-designer://documents/${t}`,database:"erd-designer://documents/{documentId}/database",tables:"erd-designer://documents/{documentId}/tables",tableDetail:"erd-designer://documents/{documentId}/tables/{tableId}",tableFor:(t,e)=>`erd-designer://documents/${t}/tables/${e}`,columnDetail:"erd-designer://documents/{documentId}/columns/{columnId}",columnShares:"erd-designer://documents/{documentId}/column_shares",columnShareDetail:"erd-designer://documents/{documentId}/column_shares/{columnShareId}",columnTypes:"erd-designer://documents/{documentId}/column_types",columnTypeDetail:"erd-designer://documents/{documentId}/column_types/{columnTypeId}",relations:"erd-designer://documents/{documentId}/relations",relationDetail:"erd-designer://documents/{documentId}/relations/{relationId}",schemas:"erd-designer://documents/{documentId}/schemas",schemaDetail:"erd-designer://documents/{documentId}/schemas/{schemaId}",columnGroups:"erd-designer://documents/{documentId}/column_groups",columnGroupDetail:"erd-designer://documents/{documentId}/column_groups/{columnGroupId}",structColumnShares:"erd-designer://documents/{documentId}/struct_column_shares",structColumnShareDetail:"erd-designer://documents/{documentId}/struct_column_shares/{structColumnShareModelId}",memos:"erd-designer://documents/{documentId}/memos",memoDetail:"erd-designer://documents/{documentId}/memos/{memoId}",perspectives:"erd-designer://documents/{documentId}/perspectives",perspectiveDetail:"erd-designer://documents/{documentId}/perspectives/{perspectiveId}"},fn=class{constructor(e){this.documentId=e.documentId,this.fileUri=e.uri,this.erdDocument=e.erdDocument,this.rectangles=new Map(e.rectangles)}documentUri(){return hi.documentFor(this.documentId)}databaseUri(){return`${this.documentUri()}/database`}schemaListUri(){return`${this.documentUri()}/schemas`}schemaUri(e){return`${this.documentUri()}/schemas/${e}`}tableUri(e){return`${this.documentUri()}/tables/${e}`}columnGroupListUri(){return`${this.documentUri()}/column_groups`}columnGroupUri(e){return`${this.documentUri()}/column_groups/${e}`}structColumnShareListUri(){return`${this.documentUri()}/struct_column_shares`}structColumnShareUri(e){return`${this.documentUri()}/struct_column_shares/${e}`}columnUri(e){return`${this.documentUri()}/columns/${e}`}columnShareUri(e){return`${this.documentUri()}/column_shares/${e}`}columnTypeUri(e){return`${this.documentUri()}/column_types/${e}`}relationUri(e){return`${this.documentUri()}/relations/${e}`}perspectiveListUri(){return`${this.documentUri()}/perspectives`}perspectiveUri(e){return`${this.documentUri()}/perspectives/${e}`}memoUri(e){return`${this.documentUri()}/memos/${e}`}findRectangle(e){return this.rectangles.get(e)||null}getRectangles(){return new Map(this.rectangles)}};var fi=tt(require("crypto"),1),gi=t=>fi.createHash("sha256").update(t).digest("hex").substring(0,16);var Ky=Object.freeze({status:"aborted"});function f(t,e,n){function r(s,l){var c;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(c=s._zod).traits??(c.traits=new Set),s._zod.traits.add(t),e(s,l);for(let m in a.prototype)m in s||Object.defineProperty(s,m,{value:a.prototype[m].bind(s)});s._zod.constr=a,s._zod.def=l}let o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:t});function a(s){var l;let c=n?.Parent?new i:this;r(c,s),(l=c._zod).deferred??(l.deferred=[]);for(let m of c._zod.deferred)m();return c}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(t)}),Object.defineProperty(a,"name",{value:t}),a}var Ye=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Hn={};function Me(t){return t&&Object.assign(Hn,t),Hn}var U={};Lr(U,{BIGINT_FORMAT_RANGES:()=>bi,Class:()=>qr,NUMBER_FORMAT_RANGES:()=>jr,aborted:()=>Mt,allowsEval:()=>Kr,assert:()=>Su,assertEqual:()=>fu,assertIs:()=>yu,assertNever:()=>bu,assertNotEqual:()=>gu,assignProp:()=>Br,cached:()=>yn,captureStackTrace:()=>er,cleanEnum:()=>Pu,cleanRegex:()=>Sn,clone:()=>ke,createTransparentProxy:()=>Cu,defineLazy:()=>q,esc:()=>wt,escapeRegex:()=>rt,extend:()=>vu,finalizeIssue:()=>Pe,floatSafeRemainder:()=>Qr,getElementAtPath:()=>wu,getEnumValues:()=>Zr,getLengthableOrigin:()=>wn,getParsedType:()=>Iu,getSizableOrigin:()=>Si,isObject:()=>Kt,isPlainObject:()=>Gt,issue:()=>Wr,joinValues:()=>Xn,jsonStringifyReplacer:()=>Fr,merge:()=>Eu,normalizeParams:()=>E,nullish:()=>bn,numKeys:()=>Tu,omit:()=>Nu,optionalKeys:()=>Yr,partial:()=>Au,pick:()=>_u,prefixIssues:()=>De,primitiveTypes:()=>yi,promiseAllObject:()=>Mu,propertyKeyTypes:()=>Gr,randomString:()=>xu,required:()=>Ru,stringifyPrimitive:()=>tr,unwrapMessage:()=>gn});function fu(t){return t}function gu(t){return t}function yu(t){}function bu(t){throw new Error}function Su(t){}function Zr(t){let e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,o])=>e.indexOf(+r)===-1).map(([r,o])=>o)}function Xn(t,e="|"){return t.map(n=>tr(n)).join(e)}function Fr(t,e){return typeof e=="bigint"?e.toString():e}function yn(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function bn(t){return t==null}function Sn(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function Qr(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,i=Number.parseInt(t.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return i%a/10**o}function q(t,e,n){Object.defineProperty(t,e,{get(){{let o=n();return t[e]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}function Br(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function wu(t,e){return e?e.reduce((n,r)=>n?.[r],t):t}function Mu(t){let e=Object.keys(t),n=e.map(r=>t[r]);return Promise.all(n).then(r=>{let o={};for(let i=0;i<e.length;i++)o[e[i]]=r[i];return o})}function xu(t=10){let e="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<t;r++)n+=e[Math.floor(Math.random()*e.length)];return n}function wt(t){return JSON.stringify(t)}var er=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};function Kt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var Kr=yn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Gt(t){if(Kt(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let n=e.prototype;return!(Kt(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Tu(t){let e=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}var Iu=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},Gr=new Set(["string","number","symbol"]),yi=new Set(["string","number","bigint","boolean","symbol","undefined"]);function rt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ke(t,e,n){let r=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(r._zod.parent=t),r}function E(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function Cu(t){let e;return new Proxy({},{get(n,r,o){return e??(e=t()),Reflect.get(e,r,o)},set(n,r,o,i){return e??(e=t()),Reflect.set(e,r,o,i)},has(n,r){return e??(e=t()),Reflect.has(e,r)},deleteProperty(n,r){return e??(e=t()),Reflect.deleteProperty(e,r)},ownKeys(n){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(n,r){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,r)},defineProperty(n,r,o){return e??(e=t()),Reflect.defineProperty(e,r,o)}})}function tr(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Yr(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var jr={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},bi={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function _u(t,e){let n={},r=t._zod.def;for(let o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(n[o]=r.shape[o])}return ke(t,{...t._zod.def,shape:n,checks:[]})}function Nu(t,e){let n={...t._zod.def.shape},r=t._zod.def;for(let o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete n[o]}return ke(t,{...t._zod.def,shape:n,checks:[]})}function vu(t,e){if(!Gt(e))throw new Error("Invalid input to extend: expected a plain object");let n={...t._zod.def,get shape(){let r={...t._zod.def.shape,...e};return Br(this,"shape",r),r},checks:[]};return ke(t,n)}function Eu(t,e){return ke(t,{...t._zod.def,get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return Br(this,"shape",n),n},catchall:e._zod.def.catchall,checks:[]})}function Au(t,e,n){let r=e._zod.def.shape,o={...r};if(n)for(let i in n){if(!(i in r))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=t?new t({type:"optional",innerType:r[i]}):r[i])}else for(let i in r)o[i]=t?new t({type:"optional",innerType:r[i]}):r[i];return ke(e,{...e._zod.def,shape:o,checks:[]})}function Ru(t,e,n){let r=e._zod.def.shape,o={...r};if(n)for(let i in n){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=new t({type:"nonoptional",innerType:r[i]}))}else for(let i in r)o[i]=new t({type:"nonoptional",innerType:r[i]});return ke(e,{...e._zod.def,shape:o,checks:[]})}function Mt(t,e=0){for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function De(t,e){return e.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(t),n})}function gn(t){return typeof t=="string"?t:t?.message}function Pe(t,e,n){let r={...t,path:t.path??[]};if(!t.message){let o=gn(t.inst?._zod.def?.error?.(t))??gn(e?.error?.(t))??gn(n.customError?.(t))??gn(n.localeError?.(t))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,e?.reportInput||delete r.input,r}function Si(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function wn(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Wr(...t){let[e,n,r]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:r}:{...e}}function Pu(t){return Object.entries(t).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var qr=class{constructor(...e){}};var wi=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,Fr,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},nr=f("$ZodError",wi),Jr=f("$ZodError",wi,{Parent:Error});function Mi(t,e=n=>n.message){let n={},r=[];for(let o of t.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(e(o))):r.push(e(o));return{formErrors:r,fieldErrors:n}}function xi(t,e){let n=e||function(i){return i.message},r={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s}));else if(a.code==="invalid_key")o({issues:a.issues});else if(a.code==="invalid_element")o({issues:a.issues});else if(a.path.length===0)r._errors.push(n(a));else{let s=r,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return o(t),r}var Ti=t=>(e,n,r,o)=>{let i=r?Object.assign(r,{async:!1}):{async:!1},a=e._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Ye;if(a.issues.length){let s=new(o?.Err??t)(a.issues.map(l=>Pe(l,i,Me())));throw er(s,o?.callee),s}return a.value};var Ii=t=>async(e,n,r,o)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=e._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(o?.Err??t)(a.issues.map(l=>Pe(l,i,Me())));throw er(s,o?.callee),s}return a.value};var Hr=t=>(e,n,r)=>{let o=r?{...r,async:!1}:{async:!1},i=e._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Ye;return i.issues.length?{success:!1,error:new(t??nr)(i.issues.map(a=>Pe(a,o,Me())))}:{success:!0,data:i.value}},Ci=Hr(Jr),Xr=t=>async(e,n,r)=>{let o=r?Object.assign(r,{async:!0}):{async:!0},i=e._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new t(i.issues.map(a=>Pe(a,o,Me())))}:{success:!0,data:i.value}},_i=Xr(Jr);var Ni=/^[cC][^\s-]{8,}$/,vi=/^[0-9a-z]+$/,Ei=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ai=/^[0-9a-vA-V]{20}$/,Ri=/^[A-Za-z0-9]{27}$/,Pi=/^[a-zA-Z0-9_-]{21}$/,zi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Oi=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,eo=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;var ki=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Ou="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Di(){return new RegExp(Ou,"u")}var $i=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ui=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Li=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Vi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,to=/^[A-Za-z0-9_-]*$/,Zi=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var Fi=/^\+(?:[0-9]){6,14}[0-9]$/,Qi="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Bi=new RegExp(`^${Qi}$`);function Ki(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Gi(t){return new RegExp(`^${Ki(t)}$`)}function Yi(t){let e=Ki({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-]\\d{2}:\\d{2})");let r=`${e}(?:${n.join("|")})`;return new RegExp(`^${Qi}T(?:${r})$`)}var ji=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)};var Wi=/^\d+$/,Ji=/^-?\d+(?:\.\d+)?/i,Hi=/true|false/i,Xi=/null/i;var ea=/^[^A-Z]*$/,ta=/^[^a-z]*$/;var ue=f("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),na={number:"number",bigint:"bigint",object:"date"},ro=f("$ZodCheckLessThan",(t,e)=>{ue.init(t,e);let n=na[typeof e.value];t._zod.onattach.push(r=>{let o=r._zod.bag,i=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<i&&(e.inclusive?o.maximum=e.value:o.exclusiveMaximum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:n,code:"too_big",maximum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),oo=f("$ZodCheckGreaterThan",(t,e)=>{ue.init(t,e);let n=na[typeof e.value];t._zod.onattach.push(r=>{let o=r._zod.bag,i=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>i&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:n,code:"too_small",minimum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),ra=f("$ZodCheckMultipleOf",(t,e)=>{ue.init(t,e),t._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):Qr(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),oa=f("$ZodCheckNumberFormat",(t,e)=>{ue.init(t,e),e.format=e.format||"float64";let n=e.format?.includes("int"),r=n?"int":"number",[o,i]=jr[e.format];t._zod.onattach.push(a=>{let s=a._zod.bag;s.format=e.format,s.minimum=o,s.maximum=i,n&&(s.pattern=Wi)}),t._zod.check=a=>{let s=a.value;if(n){if(!Number.isInteger(s)){a.issues.push({expected:r,format:e.format,code:"invalid_type",input:s,inst:t});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort});return}}s<o&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:t,continue:!e.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inst:t})}});var ia=f("$ZodCheckMaxLength",(t,e)=>{var n;ue.init(t,e),(n=t._zod.def).when??(n.when=r=>{let o=r.value;return!bn(o)&&o.length!==void 0}),t._zod.onattach.push(r=>{let o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<o&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{let o=r.value;if(o.length<=e.maximum)return;let a=wn(o);r.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),aa=f("$ZodCheckMinLength",(t,e)=>{var n;ue.init(t,e),(n=t._zod.def).when??(n.when=r=>{let o=r.value;return!bn(o)&&o.length!==void 0}),t._zod.onattach.push(r=>{let o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let o=r.value;if(o.length>=e.minimum)return;let a=wn(o);r.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),sa=f("$ZodCheckLengthEquals",(t,e)=>{var n;ue.init(t,e),(n=t._zod.def).when??(n.when=r=>{let o=r.value;return!bn(o)&&o.length!==void 0}),t._zod.onattach.push(r=>{let o=r._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=r=>{let o=r.value,i=o.length;if(i===e.length)return;let a=wn(o),s=i>e.length;r.issues.push({origin:a,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),Mn=f("$ZodCheckStringFormat",(t,e)=>{var n,r;ue.init(t,e),t._zod.onattach.push(o=>{let i=o._zod.bag;i.format=e.format,e.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),la=f("$ZodCheckRegex",(t,e)=>{Mn.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),ca=f("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=ea),Mn.init(t,e)}),ua=f("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=ta),Mn.init(t,e)}),da=f("$ZodCheckIncludes",(t,e)=>{ue.init(t,e);let n=rt(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=r,t._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),ma=f("$ZodCheckStartsWith",(t,e)=>{ue.init(t,e);let n=new RegExp(`^${rt(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),pa=f("$ZodCheckEndsWith",(t,e)=>{ue.init(t,e);let n=new RegExp(`.*${rt(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}});var ha=f("$ZodCheckOverwrite",(t,e)=>{ue.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});var rr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
2
+ var iu=Object.create;var Ur=Object.defineProperty;var au=Object.getOwnPropertyDescriptor;var su=Object.getOwnPropertyNames;var lu=Object.getPrototypeOf,cu=Object.prototype.hasOwnProperty;var Lr=(t,e)=>{for(var n in e)Ur(t,n,{get:e[n],enumerable:!0})},uu=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of su(e))!cu.call(t,o)&&o!==n&&Ur(t,o,{get:()=>e[o],enumerable:!(r=au(e,o))||r.enumerable});return t};var tt=(t,e,n)=>(n=t!=null?iu(lu(t)):{},uu(e||!t||!t.__esModule?Ur(n,"default",{value:t,enumerable:!0}):n,t));var $r=tt(require("node:process"),1);var ui=(t,e)=>{let n=new Map(e.map(i=>[i.name,i])),r=du(t,n);return r.resultType==="invalid"?{resultType:"invalid",message:r.message}:{resultType:"parsed",options:pu(r.values,r.flags,r.operands)}},du=(t,e)=>{let n=new Map,r=new Set,o=[],i=0,a=!1;for(;i<t.length;){let s=t[i];if(a||s==="--"){a=!0,s!=="--"&&o.push(s),i+=1;continue}if(s.startsWith("--")===!1){o.push(s),i+=1;continue}let l=mu(t,i,e);if(l.resultType==="invalid")return l;if(l.resultType==="flag"){r.add(l.optionName),i+=1;continue}let c=n.get(l.optionName)??[];c.push(l.value),n.set(l.optionName,c),i+=l.tokenCount}return{resultType:"collected",values:n,flags:r,operands:o}},mu=(t,e,n)=>{let r=t[e],o=r.indexOf("="),i=o>=0?r.slice(0,o):r,a=n.get(i);if(a==null)return{resultType:"invalid",message:`Unknown option: ${i}.`};if(a.arity==="flag")return o>=0?{resultType:"invalid",message:`Option ${i} does not take a value.`}:{resultType:"flag",optionName:i};let s=o>=0?r.slice(o+1):null;if(s!=null)return{resultType:"value",tokenCount:1,optionName:i,value:s};let l=t[e+1];return l==null||l.startsWith("--")?{resultType:"invalid",message:`Option ${i} requires a value.`}:{resultType:"value",tokenCount:2,optionName:i,value:l}},pu=(t,e,n)=>({findValue:r=>hu(t,r),listValues:r=>t.get(r)??[],hasFlag:r=>e.has(r),operands:n}),hu=(t,e)=>{let n=t.get(e);return n==null||n.length===0?null:n[n.length-1]};var nt=class t{constructor(e){this.regexes=e}static create(e){try{let n=e.map(r=>new RegExp(r));return{resultType:"parsed",filter:new t(n)}}catch(n){return{resultType:"invalid",message:`Invalid --ignore-table pattern: ${n instanceof Error?n.message:String(n)}`}}}filterTables(e){let n=e.tables.filter(r=>this.keep(r));return{...e,tables:n}}ignoredTableNames(e){return e.tables.filter(n=>this.keep(n)===!1).map(n=>di(n))}keep(e){let n=di(e);return this.regexes.every(r=>r.test(e.tableName)===!1&&r.test(n)===!1)}},di=t=>t.schemaName!==""?`${t.schemaName}.${t.tableName}`:t.tableName;var pi=tt(require("node:process"),1);var Ae=class{constructor({indexOptions:e,indexTypes:n,supportsClustered:r=!1,nullsOrder:o=!1,supportsIndex:i=!0}){this.indexOptions=e,this.indexTypes=n,this.supportsClustered=r,this.nullsOrder=o,this.supportsIndex=i}};var Re=class{constructor({orderable:e,supportsUniqueKey:n=!0}){this.orderable=e,this.supportsUniqueKey=n}};var ee=class{constructor(e,n,r,o,i,a){this.databaseType=e;this.name=n;this.uniqueKeySupport=r;this.tableIndexSupport=o;this.tableOption=i;this.columnOption=a}static get(e){return mi[e]}static allDatabaseTypes(){return Object.keys(mi)}get supportsSchema(){return this.tableOption.supportsSchema}get defaultSchemaName(){return this.tableOption.defaultSchemaName}get supportsTableCollate(){return this.tableOption.supportsTableCollate}get supportsArrayType(){return this.columnOption.supportArray}get supportsStructType(){return this.columnOption.supportStruct}get editableCharacterSet(){return this.columnOption.editableCharacterSet}get caseSensitiveColumnName(){return this.columnOption.caseSensitiveColumnName}get collatePattern(){return this.tableOption.collatePattern}autoIncrementLabel(){return this.columnOption.autoIncrementLabel}},mi={postgres:new ee("postgres","PostgreSQL",new Re({orderable:!1}),new Ae({indexOptions:["UNIQUE"],indexTypes:["BTREE","HASH","GIST","SPGIST","GIN","BRIN"],nullsOrder:!0}),{supportsSchema:!0,defaultSchemaName:"public",supportsTableCollate:!1,collatePattern:/^[a-zA-Z][a-zA-Z0-9_.-]*$/},{autoIncrementLabel:"Generated Always As Identity",editableCharacterSet:!1,supportArray:!0,supportStruct:!1,caseSensitiveColumnName:!0}),mysql:new ee("mysql","MySQL",new Re({orderable:!0}),new Ae({indexOptions:["UNIQUE","FULLTEXT","SPATIAL"],indexTypes:["BTREE","HASH"]}),{supportsSchema:!1,defaultSchemaName:"",supportsTableCollate:!0,collatePattern:/^[a-zA-Z][a-zA-Z0-9_]*$/},{autoIncrementLabel:"Auto Increment",editableCharacterSet:!0,supportArray:!1,supportStruct:!1,caseSensitiveColumnName:!1}),mariadb:new ee("mariadb","MariaDB",new Re({orderable:!0}),new Ae({indexOptions:["UNIQUE","FULLTEXT","SPATIAL"],indexTypes:["BTREE","HASH"]}),{supportsSchema:!1,defaultSchemaName:"",supportsTableCollate:!0,collatePattern:/^[a-zA-Z][a-zA-Z0-9_]*$/},{autoIncrementLabel:"Auto Increment",editableCharacterSet:!0,supportArray:!1,supportStruct:!1,caseSensitiveColumnName:!1}),ms_sqlserver:new ee("ms_sqlserver","MS SQL Server",new Re({orderable:!0}),new Ae({indexOptions:["UNIQUE"],indexTypes:[],supportsClustered:!0}),{supportsSchema:!0,defaultSchemaName:"dbo",supportsTableCollate:!1,collatePattern:/^[a-zA-Z][a-zA-Z0-9_]*$/},{autoIncrementLabel:"Identity",editableCharacterSet:!1,supportArray:!1,supportStruct:!1,caseSensitiveColumnName:!1}),sqlite:new ee("sqlite","SQLite",new Re({orderable:!0}),new Ae({indexOptions:["UNIQUE"],indexTypes:[]}),{supportsSchema:!1,defaultSchemaName:"",supportsTableCollate:!1,collatePattern:/^[a-zA-Z][a-zA-Z0-9_]*$/},{autoIncrementLabel:"",editableCharacterSet:!1,supportArray:!1,supportStruct:!1,caseSensitiveColumnName:!1}),bigquery:new ee("bigquery","BigQuery",new Re({orderable:!1,supportsUniqueKey:!1}),new Ae({indexOptions:[],indexTypes:[],supportsIndex:!1}),{supportsSchema:!0,defaultSchemaName:"",supportsTableCollate:!1,collatePattern:/^[a-zA-Z][a-zA-Z0-9_.:-]*$/},{autoIncrementLabel:"",editableCharacterSet:!1,supportArray:!0,supportStruct:!0,caseSensitiveColumnName:!1}),snowflake:new ee("snowflake","Snowflake",new Re({orderable:!1}),new Ae({indexOptions:[],indexTypes:[],supportsIndex:!1}),{supportsSchema:!0,defaultSchemaName:"PUBLIC",supportsTableCollate:!1,collatePattern:/^[a-zA-Z][a-zA-Z0-9_.:-]*$/},{autoIncrementLabel:"Autoincrement",editableCharacterSet:!1,supportArray:!1,supportStruct:!1,caseSensitiveColumnName:!0})};var oe=class{static{this.OPTION_SPECS=[{name:"--ignore-table",arity:"repeatable"},{name:"--no-index",arity:"flag"},{name:"--no-foreign-key",arity:"flag"},{name:"--no-comment",arity:"flag"},{name:"--no-schema",arity:"flag"},{name:"--format",arity:"single"}]}constructor(){}static findConnectionUrl(e){let n=pi.default.env.ERD_DB_URL;return n!=null&&n!==""?n:e.findValue("--dsn")}static toCompareScope(e,n,r){return{withIndex:e.hasFlag("--no-index")===!1,withForeignKey:e.hasFlag("--no-foreign-key")===!1,withComment:e.hasFlag("--no-comment")===!1,withSchema:e.hasFlag("--no-schema")===!1,withLogicalName:n==="designToRevision",commentStyle:r}}static toSnapshotTarget(e,n,r){let o=e.findValue("--schema")??"",a=ee.get(n).supportsSchema;return a===!1&&o!==""&&console.warn(`warn: --schema is ignored for ${n}. The target database is the one selected by the connection URL.`),{schemaOption:a?o:"",designSchemaNames:r}}static toDiffFormat(e){let n=e.findValue("--format")??"text";return n!=="text"&&n!=="json"&&n!=="markdown"?{resultType:"invalid",message:`Invalid --format value: ${n}. Expected one of: text, json, markdown.`}:{resultType:"parsed",format:n}}};var Fe=tt(require("fs"),1),Zt=tt(require("path"),1),xc=require("url");var hi={documents:"erd-designer://documents",documentDetail:"erd-designer://documents/{documentId}",documentFor:t=>`erd-designer://documents/${t}`,database:"erd-designer://documents/{documentId}/database",tables:"erd-designer://documents/{documentId}/tables",tableDetail:"erd-designer://documents/{documentId}/tables/{tableId}",tableFor:(t,e)=>`erd-designer://documents/${t}/tables/${e}`,columnDetail:"erd-designer://documents/{documentId}/columns/{columnId}",columnShares:"erd-designer://documents/{documentId}/column_shares",columnShareDetail:"erd-designer://documents/{documentId}/column_shares/{columnShareId}",columnTypes:"erd-designer://documents/{documentId}/column_types",columnTypeDetail:"erd-designer://documents/{documentId}/column_types/{columnTypeId}",relations:"erd-designer://documents/{documentId}/relations",relationDetail:"erd-designer://documents/{documentId}/relations/{relationId}",schemas:"erd-designer://documents/{documentId}/schemas",schemaDetail:"erd-designer://documents/{documentId}/schemas/{schemaId}",columnGroups:"erd-designer://documents/{documentId}/column_groups",columnGroupDetail:"erd-designer://documents/{documentId}/column_groups/{columnGroupId}",structColumnShares:"erd-designer://documents/{documentId}/struct_column_shares",structColumnShareDetail:"erd-designer://documents/{documentId}/struct_column_shares/{structColumnShareModelId}",memos:"erd-designer://documents/{documentId}/memos",memoDetail:"erd-designer://documents/{documentId}/memos/{memoId}",perspectives:"erd-designer://documents/{documentId}/perspectives",perspectiveDetail:"erd-designer://documents/{documentId}/perspectives/{perspectiveId}"},fn=class{constructor(e){this.documentId=e.documentId,this.fileUri=e.uri,this.erdDocument=e.erdDocument,this.rectangles=new Map(e.rectangles)}documentUri(){return hi.documentFor(this.documentId)}databaseUri(){return`${this.documentUri()}/database`}schemaListUri(){return`${this.documentUri()}/schemas`}schemaUri(e){return`${this.documentUri()}/schemas/${e}`}tableUri(e){return`${this.documentUri()}/tables/${e}`}columnGroupListUri(){return`${this.documentUri()}/column_groups`}columnGroupUri(e){return`${this.documentUri()}/column_groups/${e}`}structColumnShareListUri(){return`${this.documentUri()}/struct_column_shares`}structColumnShareUri(e){return`${this.documentUri()}/struct_column_shares/${e}`}columnUri(e){return`${this.documentUri()}/columns/${e}`}columnShareUri(e){return`${this.documentUri()}/column_shares/${e}`}columnTypeUri(e){return`${this.documentUri()}/column_types/${e}`}relationUri(e){return`${this.documentUri()}/relations/${e}`}perspectiveListUri(){return`${this.documentUri()}/perspectives`}perspectiveUri(e){return`${this.documentUri()}/perspectives/${e}`}memoUri(e){return`${this.documentUri()}/memos/${e}`}findRectangle(e){return this.rectangles.get(e)||null}getRectangles(){return new Map(this.rectangles)}};var fi=tt(require("crypto"),1),gi=t=>fi.createHash("sha256").update(t).digest("hex").substring(0,16);var Jy=Object.freeze({status:"aborted"});function f(t,e,n){function r(s,l){var c;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(c=s._zod).traits??(c.traits=new Set),s._zod.traits.add(t),e(s,l);for(let m in a.prototype)m in s||Object.defineProperty(s,m,{value:a.prototype[m].bind(s)});s._zod.constr=a,s._zod.def=l}let o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:t});function a(s){var l;let c=n?.Parent?new i:this;r(c,s),(l=c._zod).deferred??(l.deferred=[]);for(let m of c._zod.deferred)m();return c}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(t)}),Object.defineProperty(a,"name",{value:t}),a}var Ye=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Hn={};function Me(t){return t&&Object.assign(Hn,t),Hn}var U={};Lr(U,{BIGINT_FORMAT_RANGES:()=>bi,Class:()=>qr,NUMBER_FORMAT_RANGES:()=>jr,aborted:()=>Mt,allowsEval:()=>Kr,assert:()=>Su,assertEqual:()=>fu,assertIs:()=>yu,assertNever:()=>bu,assertNotEqual:()=>gu,assignProp:()=>Br,cached:()=>yn,captureStackTrace:()=>er,cleanEnum:()=>Pu,cleanRegex:()=>Sn,clone:()=>ke,createTransparentProxy:()=>Cu,defineLazy:()=>q,esc:()=>wt,escapeRegex:()=>rt,extend:()=>vu,finalizeIssue:()=>Pe,floatSafeRemainder:()=>Qr,getElementAtPath:()=>wu,getEnumValues:()=>Zr,getLengthableOrigin:()=>wn,getParsedType:()=>Iu,getSizableOrigin:()=>Si,isObject:()=>Kt,isPlainObject:()=>Gt,issue:()=>Wr,joinValues:()=>Xn,jsonStringifyReplacer:()=>Fr,merge:()=>Eu,normalizeParams:()=>E,nullish:()=>bn,numKeys:()=>Tu,omit:()=>Nu,optionalKeys:()=>Yr,partial:()=>Au,pick:()=>_u,prefixIssues:()=>De,primitiveTypes:()=>yi,promiseAllObject:()=>Mu,propertyKeyTypes:()=>Gr,randomString:()=>xu,required:()=>Ru,stringifyPrimitive:()=>tr,unwrapMessage:()=>gn});function fu(t){return t}function gu(t){return t}function yu(t){}function bu(t){throw new Error}function Su(t){}function Zr(t){let e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,o])=>e.indexOf(+r)===-1).map(([r,o])=>o)}function Xn(t,e="|"){return t.map(n=>tr(n)).join(e)}function Fr(t,e){return typeof e=="bigint"?e.toString():e}function yn(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function bn(t){return t==null}function Sn(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function Qr(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,i=Number.parseInt(t.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return i%a/10**o}function q(t,e,n){Object.defineProperty(t,e,{get(){{let o=n();return t[e]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}function Br(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function wu(t,e){return e?e.reduce((n,r)=>n?.[r],t):t}function Mu(t){let e=Object.keys(t),n=e.map(r=>t[r]);return Promise.all(n).then(r=>{let o={};for(let i=0;i<e.length;i++)o[e[i]]=r[i];return o})}function xu(t=10){let e="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<t;r++)n+=e[Math.floor(Math.random()*e.length)];return n}function wt(t){return JSON.stringify(t)}var er=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};function Kt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var Kr=yn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Gt(t){if(Kt(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let n=e.prototype;return!(Kt(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Tu(t){let e=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}var Iu=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},Gr=new Set(["string","number","symbol"]),yi=new Set(["string","number","bigint","boolean","symbol","undefined"]);function rt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ke(t,e,n){let r=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(r._zod.parent=t),r}function E(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function Cu(t){let e;return new Proxy({},{get(n,r,o){return e??(e=t()),Reflect.get(e,r,o)},set(n,r,o,i){return e??(e=t()),Reflect.set(e,r,o,i)},has(n,r){return e??(e=t()),Reflect.has(e,r)},deleteProperty(n,r){return e??(e=t()),Reflect.deleteProperty(e,r)},ownKeys(n){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(n,r){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,r)},defineProperty(n,r,o){return e??(e=t()),Reflect.defineProperty(e,r,o)}})}function tr(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Yr(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var jr={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},bi={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function _u(t,e){let n={},r=t._zod.def;for(let o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(n[o]=r.shape[o])}return ke(t,{...t._zod.def,shape:n,checks:[]})}function Nu(t,e){let n={...t._zod.def.shape},r=t._zod.def;for(let o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete n[o]}return ke(t,{...t._zod.def,shape:n,checks:[]})}function vu(t,e){if(!Gt(e))throw new Error("Invalid input to extend: expected a plain object");let n={...t._zod.def,get shape(){let r={...t._zod.def.shape,...e};return Br(this,"shape",r),r},checks:[]};return ke(t,n)}function Eu(t,e){return ke(t,{...t._zod.def,get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return Br(this,"shape",n),n},catchall:e._zod.def.catchall,checks:[]})}function Au(t,e,n){let r=e._zod.def.shape,o={...r};if(n)for(let i in n){if(!(i in r))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=t?new t({type:"optional",innerType:r[i]}):r[i])}else for(let i in r)o[i]=t?new t({type:"optional",innerType:r[i]}):r[i];return ke(e,{...e._zod.def,shape:o,checks:[]})}function Ru(t,e,n){let r=e._zod.def.shape,o={...r};if(n)for(let i in n){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=new t({type:"nonoptional",innerType:r[i]}))}else for(let i in r)o[i]=new t({type:"nonoptional",innerType:r[i]});return ke(e,{...e._zod.def,shape:o,checks:[]})}function Mt(t,e=0){for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function De(t,e){return e.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(t),n})}function gn(t){return typeof t=="string"?t:t?.message}function Pe(t,e,n){let r={...t,path:t.path??[]};if(!t.message){let o=gn(t.inst?._zod.def?.error?.(t))??gn(e?.error?.(t))??gn(n.customError?.(t))??gn(n.localeError?.(t))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,e?.reportInput||delete r.input,r}function Si(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function wn(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Wr(...t){let[e,n,r]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:r}:{...e}}function Pu(t){return Object.entries(t).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var qr=class{constructor(...e){}};var wi=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,Fr,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},nr=f("$ZodError",wi),Jr=f("$ZodError",wi,{Parent:Error});function Mi(t,e=n=>n.message){let n={},r=[];for(let o of t.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(e(o))):r.push(e(o));return{formErrors:r,fieldErrors:n}}function xi(t,e){let n=e||function(i){return i.message},r={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s}));else if(a.code==="invalid_key")o({issues:a.issues});else if(a.code==="invalid_element")o({issues:a.issues});else if(a.path.length===0)r._errors.push(n(a));else{let s=r,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return o(t),r}var Ti=t=>(e,n,r,o)=>{let i=r?Object.assign(r,{async:!1}):{async:!1},a=e._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Ye;if(a.issues.length){let s=new(o?.Err??t)(a.issues.map(l=>Pe(l,i,Me())));throw er(s,o?.callee),s}return a.value};var Ii=t=>async(e,n,r,o)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=e._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(o?.Err??t)(a.issues.map(l=>Pe(l,i,Me())));throw er(s,o?.callee),s}return a.value};var Hr=t=>(e,n,r)=>{let o=r?{...r,async:!1}:{async:!1},i=e._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Ye;return i.issues.length?{success:!1,error:new(t??nr)(i.issues.map(a=>Pe(a,o,Me())))}:{success:!0,data:i.value}},Ci=Hr(Jr),Xr=t=>async(e,n,r)=>{let o=r?Object.assign(r,{async:!0}):{async:!0},i=e._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new t(i.issues.map(a=>Pe(a,o,Me())))}:{success:!0,data:i.value}},_i=Xr(Jr);var Ni=/^[cC][^\s-]{8,}$/,vi=/^[0-9a-z]+$/,Ei=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ai=/^[0-9a-vA-V]{20}$/,Ri=/^[A-Za-z0-9]{27}$/,Pi=/^[a-zA-Z0-9_-]{21}$/,zi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Oi=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,eo=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;var ki=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Ou="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Di(){return new RegExp(Ou,"u")}var $i=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ui=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Li=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Vi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,to=/^[A-Za-z0-9_-]*$/,Zi=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var Fi=/^\+(?:[0-9]){6,14}[0-9]$/,Qi="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Bi=new RegExp(`^${Qi}$`);function Ki(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Gi(t){return new RegExp(`^${Ki(t)}$`)}function Yi(t){let e=Ki({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-]\\d{2}:\\d{2})");let r=`${e}(?:${n.join("|")})`;return new RegExp(`^${Qi}T(?:${r})$`)}var ji=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)};var Wi=/^\d+$/,Ji=/^-?\d+(?:\.\d+)?/i,Hi=/true|false/i,Xi=/null/i;var ea=/^[^A-Z]*$/,ta=/^[^a-z]*$/;var ue=f("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),na={number:"number",bigint:"bigint",object:"date"},ro=f("$ZodCheckLessThan",(t,e)=>{ue.init(t,e);let n=na[typeof e.value];t._zod.onattach.push(r=>{let o=r._zod.bag,i=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<i&&(e.inclusive?o.maximum=e.value:o.exclusiveMaximum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:n,code:"too_big",maximum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),oo=f("$ZodCheckGreaterThan",(t,e)=>{ue.init(t,e);let n=na[typeof e.value];t._zod.onattach.push(r=>{let o=r._zod.bag,i=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>i&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:n,code:"too_small",minimum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),ra=f("$ZodCheckMultipleOf",(t,e)=>{ue.init(t,e),t._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):Qr(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),oa=f("$ZodCheckNumberFormat",(t,e)=>{ue.init(t,e),e.format=e.format||"float64";let n=e.format?.includes("int"),r=n?"int":"number",[o,i]=jr[e.format];t._zod.onattach.push(a=>{let s=a._zod.bag;s.format=e.format,s.minimum=o,s.maximum=i,n&&(s.pattern=Wi)}),t._zod.check=a=>{let s=a.value;if(n){if(!Number.isInteger(s)){a.issues.push({expected:r,format:e.format,code:"invalid_type",input:s,inst:t});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort});return}}s<o&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:t,continue:!e.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inst:t})}});var ia=f("$ZodCheckMaxLength",(t,e)=>{var n;ue.init(t,e),(n=t._zod.def).when??(n.when=r=>{let o=r.value;return!bn(o)&&o.length!==void 0}),t._zod.onattach.push(r=>{let o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<o&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{let o=r.value;if(o.length<=e.maximum)return;let a=wn(o);r.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),aa=f("$ZodCheckMinLength",(t,e)=>{var n;ue.init(t,e),(n=t._zod.def).when??(n.when=r=>{let o=r.value;return!bn(o)&&o.length!==void 0}),t._zod.onattach.push(r=>{let o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let o=r.value;if(o.length>=e.minimum)return;let a=wn(o);r.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),sa=f("$ZodCheckLengthEquals",(t,e)=>{var n;ue.init(t,e),(n=t._zod.def).when??(n.when=r=>{let o=r.value;return!bn(o)&&o.length!==void 0}),t._zod.onattach.push(r=>{let o=r._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=r=>{let o=r.value,i=o.length;if(i===e.length)return;let a=wn(o),s=i>e.length;r.issues.push({origin:a,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),Mn=f("$ZodCheckStringFormat",(t,e)=>{var n,r;ue.init(t,e),t._zod.onattach.push(o=>{let i=o._zod.bag;i.format=e.format,e.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),la=f("$ZodCheckRegex",(t,e)=>{Mn.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),ca=f("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=ea),Mn.init(t,e)}),ua=f("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=ta),Mn.init(t,e)}),da=f("$ZodCheckIncludes",(t,e)=>{ue.init(t,e);let n=rt(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=r,t._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),ma=f("$ZodCheckStartsWith",(t,e)=>{ue.init(t,e);let n=new RegExp(`^${rt(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),pa=f("$ZodCheckEndsWith",(t,e)=>{ue.init(t,e);let n=new RegExp(`.*${rt(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}});var ha=f("$ZodCheckOverwrite",(t,e)=>{ue.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});var rr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
3
3
  `).filter(a=>a),o=Math.min(...r.map(a=>a.length-a.trimStart().length)),i=r.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let e=Function,n=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new e(...n,o.join(`
4
4
  `))}};var ga={major:4,minor:0,patch:0};var Z=f("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=ga;let r=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&r.unshift(t);for(let o of r)for(let i of o._zod.onattach)i(t);if(r.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=(i,a,s)=>{let l=Mt(i),c;for(let m of a){if(m._zod.def.when){if(!m._zod.def.when(i))continue}else if(l)continue;let d=i.issues.length,h=m._zod.check(i);if(h instanceof Promise&&s?.async===!1)throw new Ye;if(c||h instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await h,i.issues.length!==d&&(l||(l=Mt(i,d)))});else{if(i.issues.length===d)continue;l||(l=Mt(i,d))}}return c?c.then(()=>i):i};t._zod.run=(i,a)=>{let s=t._zod.parse(i,a);if(s instanceof Promise){if(a.async===!1)throw new Ye;return s.then(l=>o(l,r,a))}return o(s,r,a)}}t["~standard"]={validate:o=>{try{let i=Ci(t,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return _i(t,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),ir=f("$ZodString",(t,e)=>{Z.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??ji(t._zod.bag),t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),Q=f("$ZodStringFormat",(t,e)=>{Mn.init(t,e),ir.init(t,e)}),_a=f("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Oi),Q.init(t,e)}),Na=f("$ZodUUID",(t,e)=>{if(e.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=eo(r))}else e.pattern??(e.pattern=eo());Q.init(t,e)}),va=f("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=ki),Q.init(t,e)}),Ea=f("$ZodURL",(t,e)=>{Q.init(t,e),t._zod.check=n=>{try{let r=n.value,o=new URL(r),i=o.href;e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Zi.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),!r.endsWith("/")&&i.endsWith("/")?n.value=i.slice(0,-1):n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),Aa=f("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Di()),Q.init(t,e)}),Ra=f("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Pi),Q.init(t,e)}),Pa=f("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Ni),Q.init(t,e)}),za=f("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=vi),Q.init(t,e)}),Oa=f("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Ei),Q.init(t,e)}),ka=f("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Ai),Q.init(t,e)}),Da=f("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Ri),Q.init(t,e)}),$a=f("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Yi(e)),Q.init(t,e)}),Ua=f("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Bi),Q.init(t,e)}),La=f("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Gi(e)),Q.init(t,e)}),Va=f("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=zi),Q.init(t,e)}),qa=f("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=$i),Q.init(t,e),t._zod.onattach.push(n=>{let r=n._zod.bag;r.format="ipv4"})}),Za=f("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Ui),Q.init(t,e),t._zod.onattach.push(n=>{let r=n._zod.bag;r.format="ipv6"}),t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}}),Fa=f("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Li),Q.init(t,e)}),Qa=f("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Vi),Q.init(t,e),t._zod.check=n=>{let[r,o]=n.value.split("/");try{if(!o)throw new Error;let i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}}});function Ba(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var Ka=f("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=qi),Q.init(t,e),t._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),t._zod.check=n=>{Ba(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});function ku(t){if(!to.test(t))return!1;let e=t.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return Ba(n)}var Ga=f("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=to),Q.init(t,e),t._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),t._zod.check=n=>{ku(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),Ya=f("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Fi),Q.init(t,e)});function Du(t,e=null){try{let n=t.split(".");if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}var ja=f("$ZodJWT",(t,e)=>{Q.init(t,e),t._zod.check=n=>{Du(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}});var ao=f("$ZodNumber",(t,e)=>{Z.init(t,e),t._zod.pattern=t._zod.bag.pattern??Ji,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}let o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...i?{received:i}:{}}),n}}),Wa=f("$ZodNumber",(t,e)=>{oa.init(t,e),ao.init(t,e)}),Ja=f("$ZodBoolean",(t,e)=>{Z.init(t,e),t._zod.pattern=Hi,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=!!n.value}catch{}let o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),n}});var Ha=f("$ZodNull",(t,e)=>{Z.init(t,e),t._zod.pattern=Xi,t._zod.values=new Set([null]),t._zod.parse=(n,r)=>{let o=n.value;return o===null||n.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),n}});var Xa=f("$ZodUnknown",(t,e)=>{Z.init(t,e),t._zod.parse=n=>n}),es=f("$ZodNever",(t,e)=>{Z.init(t,e),t._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)});function ya(t,e,n){t.issues.length&&e.issues.push(...De(n,t.issues)),e.value[n]=t.value}var ts=f("$ZodArray",(t,e)=>{Z.init(t,e),t._zod.parse=(n,r)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),n;n.value=Array(o.length);let i=[];for(let a=0;a<o.length;a++){let s=o[a],l=e.element._zod.run({value:s,issues:[]},r);l instanceof Promise?i.push(l.then(c=>ya(c,n,a))):ya(l,n,a)}return i.length?Promise.all(i).then(()=>n):n}});function or(t,e,n){t.issues.length&&e.issues.push(...De(n,t.issues)),e.value[n]=t.value}function ba(t,e,n,r){t.issues.length?r[n]===void 0?n in r?e.value[n]=void 0:e.value[n]=t.value:e.issues.push(...De(n,t.issues)):t.value===void 0?n in r&&(e.value[n]=void 0):e.value[n]=t.value}var ns=f("$ZodObject",(t,e)=>{Z.init(t,e);let n=yn(()=>{let d=Object.keys(e.shape);for(let g of d)if(!(e.shape[g]instanceof Z))throw new Error(`Invalid element at key "${g}": expected a Zod schema`);let h=Yr(e.shape);return{shape:e.shape,keys:d,keySet:new Set(d),numKeys:d.length,optionalKeys:new Set(h)}});q(t._zod,"propValues",()=>{let d=e.shape,h={};for(let g in d){let b=d[g]._zod;if(b.values){h[g]??(h[g]=new Set);for(let y of b.values)h[g].add(y)}}return h});let r=d=>{let h=new rr(["shape","payload","ctx"]),g=n.value,b=R=>{let v=wt(R);return`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`};h.write("const input = payload.value;");let y=Object.create(null),N=0;for(let R of g.keys)y[R]=`key_${N++}`;h.write("const newResult = {}");for(let R of g.keys)if(g.optionalKeys.has(R)){let v=y[R];h.write(`const ${v} = ${b(R)};`);let z=wt(R);h.write(`
5
5
  if (${v}.issues.length) {
@@ -24,30 +24,30 @@ var iu=Object.create;var Ur=Object.defineProperty;var au=Object.getOwnPropertyDe
24
24
  if (${v}.issues.length) payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
25
25
  ...iss,
26
26
  path: iss.path ? [${wt(R)}, ...iss.path] : [${wt(R)}]
27
- })));`),h.write(`newResult[${wt(R)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let M=h.compile();return(R,v)=>M(d,R,v)},o,i=Kt,a=!Hn.jitless,l=a&&Kr.value,c=e.catchall,m;t._zod.parse=(d,h)=>{m??(m=n.value);let g=d.value;if(!i(g))return d.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),d;let b=[];if(a&&l&&h?.async===!1&&h.jitless!==!0)o||(o=r(e.shape)),d=o(d,h);else{d.value={};let v=m.shape;for(let z of m.keys){let me=v[z],pe=me._zod.run({value:g[z],issues:[]},h),H=me._zod.optin==="optional"&&me._zod.optout==="optional";pe instanceof Promise?b.push(pe.then(Ge=>H?ba(Ge,d,z,g):or(Ge,d,z))):H?ba(pe,d,z,g):or(pe,d,z)}}if(!c)return b.length?Promise.all(b).then(()=>d):d;let y=[],N=m.keySet,M=c._zod,R=M.def.type;for(let v of Object.keys(g)){if(N.has(v))continue;if(R==="never"){y.push(v);continue}let z=M.run({value:g[v],issues:[]},h);z instanceof Promise?b.push(z.then(me=>or(me,d,v))):or(z,d,v)}return y.length&&d.issues.push({code:"unrecognized_keys",keys:y,input:g,inst:t}),b.length?Promise.all(b).then(()=>d):d}});function Sa(t,e,n,r){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(i=>Pe(i,r,Me())))}),e}var so=f("$ZodUnion",(t,e)=>{Z.init(t,e),q(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),q(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),q(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),q(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>Sn(r.source)).join("|")})$`)}}),t._zod.parse=(n,r)=>{let o=!1,i=[];for(let a of e.options){let s=a._zod.run({value:n.value,issues:[]},r);if(s instanceof Promise)i.push(s),o=!0;else{if(s.issues.length===0)return s;i.push(s)}}return o?Promise.all(i).then(a=>Sa(a,n,t,r)):Sa(i,n,t,r)}}),rs=f("$ZodDiscriminatedUnion",(t,e)=>{so.init(t,e);let n=t._zod.parse;q(t._zod,"propValues",()=>{let o={};for(let i of e.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let[s,l]of Object.entries(a)){o[s]||(o[s]=new Set);for(let c of l)o[s].add(c)}}return o});let r=yn(()=>{let o=e.options,i=new Map;for(let a of o){let s=a._zod.propValues[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let l of s){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,a)}}return i});t._zod.parse=(o,i)=>{let a=o.value;if(!Kt(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),o;let s=r.value.get(a?.[e.discriminator]);return s?s._zod.run(o,i):e.unionFallback?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[e.discriminator],inst:t}),o)}}),os=f("$ZodIntersection",(t,e)=>{Z.init(t,e),t._zod.parse=(n,r)=>{let o=n.value,i=e.left._zod.run({value:o,issues:[]},r),a=e.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,c])=>wa(n,l,c)):wa(n,i,a)}});function io(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Gt(t)&&Gt(e)){let n=Object.keys(e),r=Object.keys(t).filter(i=>n.indexOf(i)!==-1),o={...t,...e};for(let i of r){let a=io(t[i],e[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};o[i]=a.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e[r],a=io(o,i);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wa(t,e,n){if(e.issues.length&&t.issues.push(...e.issues),n.issues.length&&t.issues.push(...n.issues),Mt(t))return t;let r=io(e.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return t.value=r.data,t}var is=f("$ZodRecord",(t,e)=>{Z.init(t,e),t._zod.parse=(n,r)=>{let o=n.value;if(!Gt(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),n;let i=[];if(e.keyType._zod.values){let a=e.keyType._zod.values;n.value={};for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){let c=e.valueType._zod.run({value:o[l],issues:[]},r);c instanceof Promise?i.push(c.then(m=>{m.issues.length&&n.issues.push(...De(l,m.issues)),n.value[l]=m.value})):(c.issues.length&&n.issues.push(...De(l,c.issues)),n.value[l]=c.value)}let s;for(let l in o)a.has(l)||(s=s??[],s.push(l));s&&s.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:s})}else{n.value={};for(let a of Reflect.ownKeys(o)){if(a==="__proto__")continue;let s=e.keyType._zod.run({value:a,issues:[]},r);if(s instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(s.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:s.issues.map(c=>Pe(c,r,Me())),input:a,path:[a],inst:t}),n.value[s.value]=s.value;continue}let l=e.valueType._zod.run({value:o[a],issues:[]},r);l instanceof Promise?i.push(l.then(c=>{c.issues.length&&n.issues.push(...De(a,c.issues)),n.value[s.value]=c.value})):(l.issues.length&&n.issues.push(...De(a,l.issues)),n.value[s.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}});var as=f("$ZodEnum",(t,e)=>{Z.init(t,e);let n=Zr(e.entries);t._zod.values=new Set(n),t._zod.pattern=new RegExp(`^(${n.filter(r=>Gr.has(typeof r)).map(r=>typeof r=="string"?rt(r):r.toString()).join("|")})$`),t._zod.parse=(r,o)=>{let i=r.value;return t._zod.values.has(i)||r.issues.push({code:"invalid_value",values:n,input:i,inst:t}),r}}),ss=f("$ZodLiteral",(t,e)=>{Z.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?rt(n):n?n.toString():String(n)).join("|")})$`),t._zod.parse=(n,r)=>{let o=n.value;return t._zod.values.has(o)||n.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),n}});var ls=f("$ZodTransform",(t,e)=>{Z.init(t,e),t._zod.parse=(n,r)=>{let o=e.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(n.value=a,n));if(o instanceof Promise)throw new Ye;return n.value=o,n}}),cs=f("$ZodOptional",(t,e)=>{Z.init(t,e),t._zod.optin="optional",t._zod.optout="optional",q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),q(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Sn(n.source)})?$`):void 0}),t._zod.parse=(n,r)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(n,r):n.value===void 0?n:e.innerType._zod.run(n,r)}),us=f("$ZodNullable",(t,e)=>{Z.init(t,e),q(t._zod,"optin",()=>e.innerType._zod.optin),q(t._zod,"optout",()=>e.innerType._zod.optout),q(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Sn(n.source)}|null)$`):void 0}),q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,r)=>n.value===null?n:e.innerType._zod.run(n,r)}),ds=f("$ZodDefault",(t,e)=>{Z.init(t,e),t._zod.optin="optional",q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=e.defaultValue,n;let o=e.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Ma(i,e)):Ma(o,e)}});function Ma(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var ms=f("$ZodPrefault",(t,e)=>{Z.init(t,e),t._zod.optin="optional",q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>(n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,r))}),ps=f("$ZodNonOptional",(t,e)=>{Z.init(t,e),q(t._zod,"values",()=>{let n=e.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),t._zod.parse=(n,r)=>{let o=e.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>xa(i,t)):xa(o,t)}});function xa(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var hs=f("$ZodCatch",(t,e)=>{Z.init(t,e),t._zod.optin="optional",q(t._zod,"optout",()=>e.innerType._zod.optout),q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{let o=e.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=e.catchValue({...n,error:{issues:i.issues.map(a=>Pe(a,r,Me()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=e.catchValue({...n,error:{issues:o.issues.map(i=>Pe(i,r,Me()))},input:n.value}),n.issues=[]),n)}});var fs=f("$ZodPipe",(t,e)=>{Z.init(t,e),q(t._zod,"values",()=>e.in._zod.values),q(t._zod,"optin",()=>e.in._zod.optin),q(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(n,r)=>{let o=e.in._zod.run(n,r);return o instanceof Promise?o.then(i=>Ta(i,e,r)):Ta(o,e,r)}});function Ta(t,e,n){return Mt(t)?t:e.out._zod.run({value:t.value,issues:t.issues},n)}var gs=f("$ZodReadonly",(t,e)=>{Z.init(t,e),q(t._zod,"propValues",()=>e.innerType._zod.propValues),q(t._zod,"values",()=>e.innerType._zod.values),q(t._zod,"optin",()=>e.innerType._zod.optin),q(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(n,r)=>{let o=e.innerType._zod.run(n,r);return o instanceof Promise?o.then(Ia):Ia(o)}});function Ia(t){return t.value=Object.freeze(t.value),t}var ys=f("$ZodCustom",(t,e)=>{ue.init(t,e),Z.init(t,e),t._zod.parse=(n,r)=>n,t._zod.check=n=>{let r=n.value,o=e.fn(r);if(o instanceof Promise)return o.then(i=>Ca(i,n,r,t));Ca(o,n,r,t)}});function Ca(t,e,n,r){if(!t){let o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),e.issues.push(Wr(o))}}var $u=t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},Uu=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(r){return t[r]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Invalid input: expected ${r.expected}, received ${$u(r.input)}`;case"invalid_value":return r.values.length===1?`Invalid input: expected ${tr(r.values[0])}`:`Invalid option: expected one of ${Xn(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",i=e(r.origin);return i?`Too big: expected ${r.origin??"value"} to have ${o}${r.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",i=e(r.origin);return i?`Too small: expected ${r.origin} to have ${o}${r.minimum.toString()} ${i.unit}`:`Too small: expected ${r.origin} to be ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${Xn(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function bs(){return{localeError:Uu()}}var lo=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...n){let r=n[0];if(this._map.set(e,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){let n=e._zod.parent;if(n){let r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function Lu(){return new lo}var xn=Lu();function Ss(t,e){return new t({type:"string",...E(e)})}function ws(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...E(e)})}function co(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...E(e)})}function Ms(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...E(e)})}function xs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(e)})}function Ts(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(e)})}function Is(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(e)})}function Cs(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...E(e)})}function _s(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...E(e)})}function Ns(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(e)})}function vs(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...E(e)})}function Es(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(e)})}function As(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...E(e)})}function Rs(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...E(e)})}function Ps(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(e)})}function zs(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(e)})}function Os(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(e)})}function ks(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(e)})}function Ds(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(e)})}function $s(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...E(e)})}function Us(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...E(e)})}function Ls(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...E(e)})}function Vs(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...E(e)})}function qs(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(e)})}function Zs(t,e){return new t({type:"string",format:"date",check:"string_format",...E(e)})}function Fs(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...E(e)})}function Qs(t,e){return new t({type:"string",format:"duration",check:"string_format",...E(e)})}function Bs(t,e){return new t({type:"number",checks:[],...E(e)})}function Ks(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...E(e)})}function Gs(t,e){return new t({type:"boolean",...E(e)})}function Ys(t,e){return new t({type:"null",...E(e)})}function js(t){return new t({type:"unknown"})}function Ws(t,e){return new t({type:"never",...E(e)})}function ar(t,e){return new ro({check:"less_than",...E(e),value:t,inclusive:!1})}function Tn(t,e){return new ro({check:"less_than",...E(e),value:t,inclusive:!0})}function sr(t,e){return new oo({check:"greater_than",...E(e),value:t,inclusive:!1})}function In(t,e){return new oo({check:"greater_than",...E(e),value:t,inclusive:!0})}function lr(t,e){return new ra({check:"multiple_of",...E(e),value:t})}function cr(t,e){return new ia({check:"max_length",...E(e),maximum:t})}function Yt(t,e){return new aa({check:"min_length",...E(e),minimum:t})}function ur(t,e){return new sa({check:"length_equals",...E(e),length:t})}function uo(t,e){return new la({check:"string_format",format:"regex",...E(e),pattern:t})}function mo(t){return new ca({check:"string_format",format:"lowercase",...E(t)})}function po(t){return new ua({check:"string_format",format:"uppercase",...E(t)})}function ho(t,e){return new da({check:"string_format",format:"includes",...E(e),includes:t})}function fo(t,e){return new ma({check:"string_format",format:"starts_with",...E(e),prefix:t})}function go(t,e){return new pa({check:"string_format",format:"ends_with",...E(e),suffix:t})}function xt(t){return new ha({check:"overwrite",tx:t})}function yo(t){return xt(e=>e.normalize(t))}function bo(){return xt(t=>t.trim())}function So(){return xt(t=>t.toLowerCase())}function wo(){return xt(t=>t.toUpperCase())}function Js(t,e,n){return new t({type:"array",element:e,...E(n)})}function Hs(t,e,n){let r=E(n);return r.abort??(r.abort=!0),new t({type:"custom",check:"custom",fn:e,...r})}function Xs(t,e,n){return new t({type:"custom",check:"custom",fn:e,...E(n)})}var _n={};Lr(_n,{ZodISODate:()=>tl,ZodISODateTime:()=>el,ZodISODuration:()=>rl,ZodISOTime:()=>nl,date:()=>xo,datetime:()=>Mo,duration:()=>Io,time:()=>To});var el=f("ZodISODateTime",(t,e)=>{$a.init(t,e),K.init(t,e)});function Mo(t){return qs(el,t)}var tl=f("ZodISODate",(t,e)=>{Ua.init(t,e),K.init(t,e)});function xo(t){return Zs(tl,t)}var nl=f("ZodISOTime",(t,e)=>{La.init(t,e),K.init(t,e)});function To(t){return Fs(nl,t)}var rl=f("ZodISODuration",(t,e)=>{Va.init(t,e),K.init(t,e)});function Io(t){return Qs(rl,t)}var ol=(t,e)=>{nr.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>xi(t,n)},flatten:{value:n=>Mi(t,n)},addIssue:{value:n=>t.issues.push(n)},addIssues:{value:n=>t.issues.push(...n)},isEmpty:{get(){return t.issues.length===0}}})},Pb=f("ZodError",ol),Nn=f("ZodError",ol,{Parent:Error});var il=Ti(Nn),al=Ii(Nn),sl=Hr(Nn),ll=Xr(Nn);var J=f("ZodType",(t,e)=>(Z.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...n)=>t.clone({...e,checks:[...e.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),t.clone=(n,r)=>ke(t,n,r),t.brand=()=>t,t.register=((n,r)=>(n.add(t,r),t)),t.parse=(n,r)=>il(t,n,r,{callee:t.parse}),t.safeParse=(n,r)=>sl(t,n,r),t.parseAsync=async(n,r)=>al(t,n,r,{callee:t.parseAsync}),t.safeParseAsync=async(n,r)=>ll(t,n,r),t.spa=t.safeParseAsync,t.refine=(n,r)=>t.check(Dd(n,r)),t.superRefine=n=>t.check($d(n)),t.overwrite=n=>t.check(xt(n)),t.optional=()=>Y(t),t.nullable=()=>dl(t),t.nullish=()=>Y(dl(t)),t.nonoptional=n=>Ed(t,n),t.array=()=>$(t),t.or=n=>B([t,n]),t.and=n=>mr(t,n),t.transform=n=>_o(t,yl(n)),t.default=n=>_d(t,n),t.prefault=n=>vd(t,n),t.catch=n=>Rd(t,n),t.pipe=n=>_o(t,n),t.readonly=()=>Od(t),t.describe=n=>{let r=t.clone();return xn.add(r,{description:n}),r},Object.defineProperty(t,"description",{get(){return xn.get(t)?.description},configurable:!0}),t.meta=(...n)=>{if(n.length===0)return xn.get(t);let r=t.clone();return xn.add(r,n[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),ml=f("_ZodString",(t,e)=>{ir.init(t,e),J.init(t,e);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,t.regex=(...r)=>t.check(uo(...r)),t.includes=(...r)=>t.check(ho(...r)),t.startsWith=(...r)=>t.check(fo(...r)),t.endsWith=(...r)=>t.check(go(...r)),t.min=(...r)=>t.check(Yt(...r)),t.max=(...r)=>t.check(cr(...r)),t.length=(...r)=>t.check(ur(...r)),t.nonempty=(...r)=>t.check(Yt(1,...r)),t.lowercase=r=>t.check(mo(r)),t.uppercase=r=>t.check(po(r)),t.trim=()=>t.check(bo()),t.normalize=(...r)=>t.check(yo(...r)),t.toLowerCase=()=>t.check(So()),t.toUpperCase=()=>t.check(wo())}),Yu=f("ZodString",(t,e)=>{ir.init(t,e),ml.init(t,e),t.email=n=>t.check(ws(ju,n)),t.url=n=>t.check(Cs(Wu,n)),t.jwt=n=>t.check(Vs(dd,n)),t.emoji=n=>t.check(_s(Ju,n)),t.guid=n=>t.check(co(cl,n)),t.uuid=n=>t.check(Ms(dr,n)),t.uuidv4=n=>t.check(xs(dr,n)),t.uuidv6=n=>t.check(Ts(dr,n)),t.uuidv7=n=>t.check(Is(dr,n)),t.nanoid=n=>t.check(Ns(Hu,n)),t.guid=n=>t.check(co(cl,n)),t.cuid=n=>t.check(vs(Xu,n)),t.cuid2=n=>t.check(Es(ed,n)),t.ulid=n=>t.check(As(td,n)),t.base64=n=>t.check($s(ld,n)),t.base64url=n=>t.check(Us(cd,n)),t.xid=n=>t.check(Rs(nd,n)),t.ksuid=n=>t.check(Ps(rd,n)),t.ipv4=n=>t.check(zs(od,n)),t.ipv6=n=>t.check(Os(id,n)),t.cidrv4=n=>t.check(ks(ad,n)),t.cidrv6=n=>t.check(Ds(sd,n)),t.e164=n=>t.check(Ls(ud,n)),t.datetime=n=>t.check(Mo(n)),t.date=n=>t.check(xo(n)),t.time=n=>t.check(To(n)),t.duration=n=>t.check(Io(n))});function p(t){return Ss(Yu,t)}var K=f("ZodStringFormat",(t,e)=>{Q.init(t,e),ml.init(t,e)}),ju=f("ZodEmail",(t,e)=>{va.init(t,e),K.init(t,e)});var cl=f("ZodGUID",(t,e)=>{_a.init(t,e),K.init(t,e)});var dr=f("ZodUUID",(t,e)=>{Na.init(t,e),K.init(t,e)});var Wu=f("ZodURL",(t,e)=>{Ea.init(t,e),K.init(t,e)});var Ju=f("ZodEmoji",(t,e)=>{Aa.init(t,e),K.init(t,e)});var Hu=f("ZodNanoID",(t,e)=>{Ra.init(t,e),K.init(t,e)});var Xu=f("ZodCUID",(t,e)=>{Pa.init(t,e),K.init(t,e)});var ed=f("ZodCUID2",(t,e)=>{za.init(t,e),K.init(t,e)});var td=f("ZodULID",(t,e)=>{Oa.init(t,e),K.init(t,e)});var nd=f("ZodXID",(t,e)=>{ka.init(t,e),K.init(t,e)});var rd=f("ZodKSUID",(t,e)=>{Da.init(t,e),K.init(t,e)});var od=f("ZodIPv4",(t,e)=>{qa.init(t,e),K.init(t,e)});var id=f("ZodIPv6",(t,e)=>{Za.init(t,e),K.init(t,e)});var ad=f("ZodCIDRv4",(t,e)=>{Fa.init(t,e),K.init(t,e)});var sd=f("ZodCIDRv6",(t,e)=>{Qa.init(t,e),K.init(t,e)});var ld=f("ZodBase64",(t,e)=>{Ka.init(t,e),K.init(t,e)});var cd=f("ZodBase64URL",(t,e)=>{Ga.init(t,e),K.init(t,e)});var ud=f("ZodE164",(t,e)=>{Ya.init(t,e),K.init(t,e)});var dd=f("ZodJWT",(t,e)=>{ja.init(t,e),K.init(t,e)});var pl=f("ZodNumber",(t,e)=>{ao.init(t,e),J.init(t,e),t.gt=(r,o)=>t.check(sr(r,o)),t.gte=(r,o)=>t.check(In(r,o)),t.min=(r,o)=>t.check(In(r,o)),t.lt=(r,o)=>t.check(ar(r,o)),t.lte=(r,o)=>t.check(Tn(r,o)),t.max=(r,o)=>t.check(Tn(r,o)),t.int=r=>t.check(ul(r)),t.safe=r=>t.check(ul(r)),t.positive=r=>t.check(sr(0,r)),t.nonnegative=r=>t.check(In(0,r)),t.negative=r=>t.check(ar(0,r)),t.nonpositive=r=>t.check(Tn(0,r)),t.multipleOf=(r,o)=>t.check(lr(r,o)),t.step=(r,o)=>t.check(lr(r,o)),t.finite=()=>t;let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function L(t){return Bs(pl,t)}var md=f("ZodNumberFormat",(t,e)=>{Wa.init(t,e),pl.init(t,e)});function ul(t){return Ks(md,t)}var pd=f("ZodBoolean",(t,e)=>{Ja.init(t,e),J.init(t,e)});function ne(t){return Gs(pd,t)}var hd=f("ZodNull",(t,e)=>{Ha.init(t,e),J.init(t,e)});function hl(t){return Ys(hd,t)}var fd=f("ZodUnknown",(t,e)=>{Xa.init(t,e),J.init(t,e)});function G(){return js(fd)}var gd=f("ZodNever",(t,e)=>{es.init(t,e),J.init(t,e)});function yd(t){return Ws(gd,t)}var bd=f("ZodArray",(t,e)=>{ts.init(t,e),J.init(t,e),t.element=e.element,t.min=(n,r)=>t.check(Yt(n,r)),t.nonempty=n=>t.check(Yt(1,n)),t.max=(n,r)=>t.check(cr(n,r)),t.length=(n,r)=>t.check(ur(n,r)),t.unwrap=()=>t.element});function $(t,e){return Js(bd,t,e)}var fl=f("ZodObject",(t,e)=>{ns.init(t,e),J.init(t,e),U.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>fe(Object.keys(t._zod.def.shape)),t.catchall=n=>t.clone({...t._zod.def,catchall:n}),t.passthrough=()=>t.clone({...t._zod.def,catchall:G()}),t.loose=()=>t.clone({...t._zod.def,catchall:G()}),t.strict=()=>t.clone({...t._zod.def,catchall:yd()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=n=>U.extend(t,n),t.merge=n=>U.merge(t,n),t.pick=n=>U.pick(t,n),t.omit=n=>U.omit(t,n),t.partial=(...n)=>U.partial(bl,t,n[0]),t.required=(...n)=>U.required(Sl,t,n[0])});function I(t,e){let n={type:"object",get shape(){return U.assignProp(this,"shape",{...t}),this.shape},...U.normalizeParams(e)};return new fl(n)}function he(t,e){return new fl({type:"object",get shape(){return U.assignProp(this,"shape",{...t}),this.shape},catchall:G(),...U.normalizeParams(e)})}var gl=f("ZodUnion",(t,e)=>{so.init(t,e),J.init(t,e),t.options=e.options});function B(t,e){return new gl({type:"union",options:t,...U.normalizeParams(e)})}var Sd=f("ZodDiscriminatedUnion",(t,e)=>{gl.init(t,e),rs.init(t,e)});function No(t,e,n){return new Sd({type:"union",options:e,discriminator:t,...U.normalizeParams(n)})}var wd=f("ZodIntersection",(t,e)=>{os.init(t,e),J.init(t,e)});function mr(t,e){return new wd({type:"intersection",left:t,right:e})}var Md=f("ZodRecord",(t,e)=>{is.init(t,e),J.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function F(t,e,n){return new Md({type:"record",keyType:t,valueType:e,...U.normalizeParams(n)})}var Co=f("ZodEnum",(t,e)=>{as.init(t,e),J.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let n=new Set(Object.keys(e.entries));t.extract=(r,o)=>{let i={};for(let a of r)if(n.has(a))i[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Co({...e,checks:[],...U.normalizeParams(o),entries:i})},t.exclude=(r,o)=>{let i={...e.entries};for(let a of r)if(n.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new Co({...e,checks:[],...U.normalizeParams(o),entries:i})}});function fe(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new Co({type:"enum",entries:n,...U.normalizeParams(e)})}var xd=f("ZodLiteral",(t,e)=>{ss.init(t,e),J.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function _(t,e){return new xd({type:"literal",values:Array.isArray(t)?t:[t],...U.normalizeParams(e)})}var Td=f("ZodTransform",(t,e)=>{ls.init(t,e),J.init(t,e),t._zod.parse=(n,r)=>{n.addIssue=i=>{if(typeof i=="string")n.issues.push(U.issue(i,n.value,e));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=t),a.continue??(a.continue=!0),n.issues.push(U.issue(a))}};let o=e.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function yl(t){return new Td({type:"transform",transform:t})}var bl=f("ZodOptional",(t,e)=>{cs.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Y(t){return new bl({type:"optional",innerType:t})}var Id=f("ZodNullable",(t,e)=>{us.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType});function dl(t){return new Id({type:"nullable",innerType:t})}var Cd=f("ZodDefault",(t,e)=>{ds.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function _d(t,e){return new Cd({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}var Nd=f("ZodPrefault",(t,e)=>{ms.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType});function vd(t,e){return new Nd({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}var Sl=f("ZodNonOptional",(t,e)=>{ps.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Ed(t,e){return new Sl({type:"nonoptional",innerType:t,...U.normalizeParams(e)})}var Ad=f("ZodCatch",(t,e)=>{hs.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Rd(t,e){return new Ad({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var Pd=f("ZodPipe",(t,e)=>{fs.init(t,e),J.init(t,e),t.in=e.in,t.out=e.out});function _o(t,e){return new Pd({type:"pipe",in:t,out:e})}var zd=f("ZodReadonly",(t,e)=>{gs.init(t,e),J.init(t,e)});function Od(t){return new zd({type:"readonly",innerType:t})}var wl=f("ZodCustom",(t,e)=>{ys.init(t,e),J.init(t,e)});function kd(t){let e=new ue({check:"custom"});return e._zod.check=t,e}function Ml(t,e){return Hs(wl,t??(()=>!0),e)}function Dd(t,e={}){return Xs(wl,t,e)}function $d(t){let e=kd(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(U.issue(r,n.value,e._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),o.continue??(o.continue=!e._zod.def.abort),n.issues.push(U.issue(o))}},t(n.value,n)));return e}function vo(t,e){return _o(yl(t),e)}Me(bs());var Ud="io.modelcontextprotocol/related-task",hr="2.0",te=Ml(t=>t!==null&&(typeof t=="object"||typeof t=="function")),xl=B([p(),L().int()]),Tl=p(),CS=he({ttl:L().optional(),pollInterval:L().optional()}),Ld=I({ttl:L().optional()}),Vd=I({taskId:p()}),Ao=he({progressToken:xl.optional(),[Ud]:Vd.optional()}),Se=I({_meta:Ao.optional()}),fr=Se.extend({task:Ld.optional()});var ie=I({method:p(),params:Se.loose().optional()}),xe=I({_meta:Ao.optional()}),Te=I({method:p(),params:xe.loose().optional()}),ae=he({_meta:Ao.optional()}),gr=B([p(),L().int()]),qd=I({jsonrpc:_(hr),id:gr,...ie.shape}).strict();var Zd=I({jsonrpc:_(hr),...Te.shape}).strict();var Il=I({jsonrpc:_(hr),id:gr,result:ae}).strict();var Tt;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Tt||(Tt={}));var Cl=I({jsonrpc:_(hr),id:gr.optional(),error:I({code:L().int(),message:p(),data:G().optional()})}).strict();var _S=B([qd,Zd,Il,Cl]),NS=B([Il,Cl]),_l=ae.strict(),Fd=xe.extend({requestId:gr.optional(),reason:p().optional()}),Nl=Te.extend({method:_("notifications/cancelled"),params:Fd}),Qd=I({src:p(),mimeType:p().optional(),sizes:$(p()).optional(),theme:fe(["light","dark"]).optional()}),En=I({icons:$(Qd).optional()}),jt=I({name:p(),title:p().optional()}),vl=jt.extend({...jt.shape,...En.shape,version:p(),websiteUrl:p().optional(),description:p().optional()}),Bd=mr(I({applyDefaults:ne().optional()}),F(p(),G())),Kd=vo(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,mr(I({form:Bd.optional(),url:te.optional()}),F(p(),G()).optional())),Gd=he({list:te.optional(),cancel:te.optional(),requests:he({sampling:he({createMessage:te.optional()}).optional(),elicitation:he({create:te.optional()}).optional()}).optional()}),Yd=he({list:te.optional(),cancel:te.optional(),requests:he({tools:he({call:te.optional()}).optional()}).optional()}),jd=I({experimental:F(p(),te).optional(),sampling:I({context:te.optional(),tools:te.optional()}).optional(),elicitation:Kd.optional(),roots:I({listChanged:ne().optional()}).optional(),tasks:Gd.optional(),extensions:F(p(),te).optional()}),Wd=Se.extend({protocolVersion:p(),capabilities:jd,clientInfo:vl}),Jd=ie.extend({method:_("initialize"),params:Wd});var Hd=I({experimental:F(p(),te).optional(),logging:te.optional(),completions:te.optional(),prompts:I({listChanged:ne().optional()}).optional(),resources:I({subscribe:ne().optional(),listChanged:ne().optional()}).optional(),tools:I({listChanged:ne().optional()}).optional(),tasks:Yd.optional(),extensions:F(p(),te).optional()}),Xd=ae.extend({protocolVersion:p(),capabilities:Hd,serverInfo:vl,instructions:p().optional()}),em=Te.extend({method:_("notifications/initialized"),params:xe.optional()});var El=ie.extend({method:_("ping"),params:Se.optional()}),tm=I({progress:L(),total:Y(L()),message:Y(p())}),nm=I({...xe.shape,...tm.shape,progressToken:xl}),Al=Te.extend({method:_("notifications/progress"),params:nm}),rm=Se.extend({cursor:Tl.optional()}),An=ie.extend({params:rm.optional()}),Rn=ae.extend({nextCursor:Tl.optional()}),om=fe(["working","input_required","completed","failed","cancelled"]),Pn=I({taskId:p(),status:om,ttl:B([L(),hl()]),createdAt:p(),lastUpdatedAt:p(),pollInterval:Y(L()),statusMessage:Y(p())}),Rl=ae.extend({task:Pn}),im=xe.merge(Pn),Pl=Te.extend({method:_("notifications/tasks/status"),params:im}),zl=ie.extend({method:_("tasks/get"),params:Se.extend({taskId:p()})}),Ol=ae.merge(Pn),kl=ie.extend({method:_("tasks/result"),params:Se.extend({taskId:p()})}),vS=ae.loose(),Dl=An.extend({method:_("tasks/list")}),$l=Rn.extend({tasks:$(Pn)}),Ul=ie.extend({method:_("tasks/cancel"),params:Se.extend({taskId:p()})}),ES=ae.merge(Pn),Ll=I({uri:p(),mimeType:Y(p()),_meta:F(p(),G()).optional()}),Vl=Ll.extend({text:p()}),Ro=p().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),ql=Ll.extend({blob:Ro}),zn=fe(["user","assistant"]),Wt=I({audience:$(zn).optional(),priority:L().min(0).max(1).optional(),lastModified:_n.datetime({offset:!0}).optional()}),Zl=I({...jt.shape,...En.shape,uri:p(),description:Y(p()),mimeType:Y(p()),size:Y(L()),annotations:Wt.optional(),_meta:Y(he({}))}),am=I({...jt.shape,...En.shape,uriTemplate:p(),description:Y(p()),mimeType:Y(p()),annotations:Wt.optional(),_meta:Y(he({}))}),sm=An.extend({method:_("resources/list")}),lm=Rn.extend({resources:$(Zl)}),cm=An.extend({method:_("resources/templates/list")}),um=Rn.extend({resourceTemplates:$(am)}),Po=Se.extend({uri:p()}),dm=Po,mm=ie.extend({method:_("resources/read"),params:dm}),pm=ae.extend({contents:$(B([Vl,ql]))}),hm=Te.extend({method:_("notifications/resources/list_changed"),params:xe.optional()}),fm=Po,gm=ie.extend({method:_("resources/subscribe"),params:fm}),ym=Po,bm=ie.extend({method:_("resources/unsubscribe"),params:ym}),Sm=xe.extend({uri:p()}),wm=Te.extend({method:_("notifications/resources/updated"),params:Sm}),Mm=I({name:p(),description:Y(p()),required:Y(ne())}),xm=I({...jt.shape,...En.shape,description:Y(p()),arguments:Y($(Mm)),_meta:Y(he({}))}),Tm=An.extend({method:_("prompts/list")}),Im=Rn.extend({prompts:$(xm)}),Cm=Se.extend({name:p(),arguments:F(p(),p()).optional()}),_m=ie.extend({method:_("prompts/get"),params:Cm}),zo=I({type:_("text"),text:p(),annotations:Wt.optional(),_meta:F(p(),G()).optional()}),Oo=I({type:_("image"),data:Ro,mimeType:p(),annotations:Wt.optional(),_meta:F(p(),G()).optional()}),ko=I({type:_("audio"),data:Ro,mimeType:p(),annotations:Wt.optional(),_meta:F(p(),G()).optional()}),Nm=I({type:_("tool_use"),name:p(),id:p(),input:F(p(),G()),_meta:F(p(),G()).optional()}),vm=I({type:_("resource"),resource:B([Vl,ql]),annotations:Wt.optional(),_meta:F(p(),G()).optional()}),Em=Zl.extend({type:_("resource_link")}),Do=B([zo,Oo,ko,Em,vm]),Am=I({role:zn,content:Do}),Rm=ae.extend({description:p().optional(),messages:$(Am)}),Pm=Te.extend({method:_("notifications/prompts/list_changed"),params:xe.optional()}),zm=I({title:p().optional(),readOnlyHint:ne().optional(),destructiveHint:ne().optional(),idempotentHint:ne().optional(),openWorldHint:ne().optional()}),Om=I({taskSupport:fe(["required","optional","forbidden"]).optional()}),Fl=I({...jt.shape,...En.shape,description:p().optional(),inputSchema:I({type:_("object"),properties:F(p(),te).optional(),required:$(p()).optional()}).catchall(G()),outputSchema:I({type:_("object"),properties:F(p(),te).optional(),required:$(p()).optional()}).catchall(G()).optional(),annotations:zm.optional(),execution:Om.optional(),_meta:F(p(),G()).optional()}),km=An.extend({method:_("tools/list")}),Dm=Rn.extend({tools:$(Fl)}),Ql=ae.extend({content:$(Do).default([]),structuredContent:F(p(),G()).optional(),isError:ne().optional()}),AS=Ql.or(ae.extend({toolResult:G()})),$m=fr.extend({name:p(),arguments:F(p(),G()).optional()}),Um=ie.extend({method:_("tools/call"),params:$m}),Lm=Te.extend({method:_("notifications/tools/list_changed"),params:xe.optional()}),RS=I({autoRefresh:ne().default(!0),debounceMs:L().int().nonnegative().default(300)}),Bl=fe(["debug","info","notice","warning","error","critical","alert","emergency"]),Vm=Se.extend({level:Bl}),qm=ie.extend({method:_("logging/setLevel"),params:Vm}),Zm=xe.extend({level:Bl,logger:p().optional(),data:G()}),Fm=Te.extend({method:_("notifications/message"),params:Zm}),Qm=I({name:p().optional()}),Bm=I({hints:$(Qm).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),Km=I({mode:fe(["auto","required","none"]).optional()}),Gm=I({type:_("tool_result"),toolUseId:p().describe("The unique identifier for the corresponding tool call."),content:$(Do).default([]),structuredContent:I({}).loose().optional(),isError:ne().optional(),_meta:F(p(),G()).optional()}),Ym=No("type",[zo,Oo,ko]),pr=No("type",[zo,Oo,ko,Nm,Gm]),jm=I({role:zn,content:B([pr,$(pr)]),_meta:F(p(),G()).optional()}),Wm=fr.extend({messages:$(jm),modelPreferences:Bm.optional(),systemPrompt:p().optional(),includeContext:fe(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:$(p()).optional(),metadata:te.optional(),tools:$(Fl).optional(),toolChoice:Km.optional()}),Jm=ie.extend({method:_("sampling/createMessage"),params:Wm}),Hm=ae.extend({model:p(),stopReason:Y(fe(["endTurn","stopSequence","maxTokens"]).or(p())),role:zn,content:Ym}),Xm=ae.extend({model:p(),stopReason:Y(fe(["endTurn","stopSequence","maxTokens","toolUse"]).or(p())),role:zn,content:B([pr,$(pr)])}),ep=I({type:_("boolean"),title:p().optional(),description:p().optional(),default:ne().optional()}),tp=I({type:_("string"),title:p().optional(),description:p().optional(),minLength:L().optional(),maxLength:L().optional(),format:fe(["email","uri","date","date-time"]).optional(),default:p().optional()}),np=I({type:fe(["number","integer"]),title:p().optional(),description:p().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),rp=I({type:_("string"),title:p().optional(),description:p().optional(),enum:$(p()),default:p().optional()}),op=I({type:_("string"),title:p().optional(),description:p().optional(),oneOf:$(I({const:p(),title:p()})),default:p().optional()}),ip=I({type:_("string"),title:p().optional(),description:p().optional(),enum:$(p()),enumNames:$(p()).optional(),default:p().optional()}),ap=B([rp,op]),sp=I({type:_("array"),title:p().optional(),description:p().optional(),minItems:L().optional(),maxItems:L().optional(),items:I({type:_("string"),enum:$(p())}),default:$(p()).optional()}),lp=I({type:_("array"),title:p().optional(),description:p().optional(),minItems:L().optional(),maxItems:L().optional(),items:I({anyOf:$(I({const:p(),title:p()}))}),default:$(p()).optional()}),cp=B([sp,lp]),up=B([ip,ap,cp]),dp=B([up,ep,tp,np]),mp=fr.extend({mode:_("form").optional(),message:p(),requestedSchema:I({type:_("object"),properties:F(p(),dp),required:$(p()).optional()})}),pp=fr.extend({mode:_("url"),message:p(),elicitationId:p(),url:p().url()}),hp=B([mp,pp]),fp=ie.extend({method:_("elicitation/create"),params:hp}),gp=xe.extend({elicitationId:p()}),yp=Te.extend({method:_("notifications/elicitation/complete"),params:gp}),bp=ae.extend({action:fe(["accept","decline","cancel"]),content:vo(t=>t===null?void 0:t,F(p(),B([p(),L(),ne(),$(p())])).optional())}),Sp=I({type:_("ref/resource"),uri:p()});var wp=I({type:_("ref/prompt"),name:p()}),Mp=Se.extend({ref:B([wp,Sp]),argument:I({name:p(),value:p()}),context:I({arguments:F(p(),p()).optional()}).optional()}),xp=ie.extend({method:_("completion/complete"),params:Mp});var Tp=ae.extend({completion:he({values:$(p()).max(100),total:Y(L().int()),hasMore:Y(ne())})}),Ip=I({uri:p().startsWith("file://"),name:p().optional(),_meta:F(p(),G()).optional()}),Cp=ie.extend({method:_("roots/list"),params:Se.optional()}),_p=ae.extend({roots:$(Ip)}),Np=Te.extend({method:_("notifications/roots/list_changed"),params:xe.optional()}),PS=B([El,Jd,xp,qm,_m,Tm,sm,cm,mm,gm,bm,Um,km,zl,kl,Dl,Ul]),zS=B([Nl,Al,em,Np,Pl]),OS=B([_l,Hm,Xm,bp,_p,Ol,$l,Rl]),kS=B([El,Jm,fp,Cp,zl,kl,Dl,Ul]),DS=B([Nl,Al,Fm,wm,hm,Lm,Pm,Pl,yp]),$S=B([_l,Xd,Tp,Rm,Im,lm,um,pm,Ql,Dm,Ol,$l,Rl]),vn=class t extends Error{constructor(e,n,r){super(`MCP error ${e}: ${n}`),this.code=e,this.data=r,this.name="McpError"}static fromError(e,n,r){if(e===Tt.UrlElicitationRequired&&r){let o=r;if(o.elicitations)return new Eo(o.elicitations,n)}return new t(e,n,r)}},Eo=class extends vn{constructor(e,n=`URL elicitation${e.length>1?"s":""} required`){super(Tt.UrlElicitationRequired,n,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};var oc=require("url");var Vo={};Lr(Vo,{BRAND:()=>Xp,DIRTY:()=>It,EMPTY_PATH:()=>Rp,INVALID:()=>A,NEVER:()=>$h,OK:()=>de,ParseStatus:()=>se,Schema:()=>k,ZodAny:()=>at,ZodArray:()=>He,ZodBigInt:()=>_t,ZodBoolean:()=>Nt,ZodBranded:()=>kn,ZodCatch:()=>Ut,ZodDate:()=>vt,ZodDefault:()=>$t,ZodDiscriminatedUnion:()=>Sr,ZodEffects:()=>_e,ZodEnum:()=>kt,ZodError:()=>ge,ZodFirstPartyTypeKind:()=>P,ZodFunction:()=>Mr,ZodIntersection:()=>Pt,ZodIssueCode:()=>w,ZodLazy:()=>zt,ZodLiteral:()=>Ot,ZodMap:()=>nn,ZodNaN:()=>on,ZodNativeEnum:()=>Dt,ZodNever:()=>ze,ZodNull:()=>At,ZodNullable:()=>Le,ZodNumber:()=>Ct,ZodObject:()=>ye,ZodOptional:()=>Ie,ZodParsedType:()=>T,ZodPipeline:()=>Dn,ZodPromise:()=>st,ZodReadonly:()=>Lt,ZodRecord:()=>wr,ZodSchema:()=>k,ZodSet:()=>rn,ZodString:()=>it,ZodSymbol:()=>en,ZodTransformer:()=>_e,ZodTuple:()=>Ue,ZodType:()=>k,ZodUndefined:()=>Et,ZodUnion:()=>Rt,ZodUnknown:()=>Je,ZodVoid:()=>tn,addIssueToContext:()=>x,any:()=>lh,array:()=>mh,bigint:()=>rh,boolean:()=>nc,coerce:()=>Dh,custom:()=>Xl,date:()=>oh,datetimeRegex:()=>Jl,defaultErrorMap:()=>je,discriminatedUnion:()=>gh,effect:()=>vh,enum:()=>Ch,function:()=>xh,getErrorMap:()=>Jt,getParsedType:()=>$e,instanceof:()=>th,intersection:()=>yh,isAborted:()=>yr,isAsync:()=>Ht,isDirty:()=>br,isValid:()=>ot,late:()=>eh,lazy:()=>Th,literal:()=>Ih,makeIssue:()=>On,map:()=>wh,nan:()=>nh,nativeEnum:()=>_h,never:()=>uh,null:()=>sh,nullable:()=>Ah,number:()=>tc,object:()=>ph,objectUtil:()=>$o,oboolean:()=>kh,onumber:()=>Oh,optional:()=>Eh,ostring:()=>zh,pipeline:()=>Ph,preprocess:()=>Rh,promise:()=>Nh,quotelessJson:()=>vp,record:()=>Sh,set:()=>Mh,setErrorMap:()=>Ap,strictObject:()=>hh,string:()=>ec,symbol:()=>ih,transformer:()=>vh,tuple:()=>bh,undefined:()=>ah,union:()=>fh,unknown:()=>ch,util:()=>D,void:()=>dh});var D;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},t.getValidEnumValues=o=>{let i=t.objectKeys(o).filter(s=>typeof o[o[s]]!="number"),a={};for(let s of i)a[s]=o[s];return t.objectValues(a)},t.objectValues=o=>t.objectKeys(o).map(function(i){return o[i]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},t.find=(o,i)=>{for(let a of o)if(i(a))return a},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(D||(D={}));var $o;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})($o||($o={}));var T=D.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$e=t=>{switch(typeof t){case"undefined":return T.undefined;case"string":return T.string;case"number":return Number.isNaN(t)?T.nan:T.number;case"boolean":return T.boolean;case"function":return T.function;case"bigint":return T.bigint;case"symbol":return T.symbol;case"object":return Array.isArray(t)?T.array:t===null?T.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?T.promise:typeof Map<"u"&&t instanceof Map?T.map:typeof Set<"u"&&t instanceof Set?T.set:typeof Date<"u"&&t instanceof Date?T.date:T.object;default:return T.unknown}};var w=D.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),vp=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ge=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(i){return i.message},r={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return o(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,D.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];n[i]=n[i]||[],n[i].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};ge.create=t=>new ge(t);var Ep=(t,e)=>{let n;switch(t.code){case w.invalid_type:t.received===T.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case w.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,D.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:n=`Unrecognized key(s) in object: ${D.joinValues(t.keys,", ")}`;break;case w.invalid_union:n="Invalid input";break;case w.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${D.joinValues(t.options)}`;break;case w.invalid_enum_value:n=`Invalid enum value. Expected ${D.joinValues(t.options)}, received '${t.received}'`;break;case w.invalid_arguments:n="Invalid function arguments";break;case w.invalid_return_type:n="Invalid function return type";break;case w.invalid_date:n="Invalid date";break;case w.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:D.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case w.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case w.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case w.custom:n="Invalid input";break;case w.invalid_intersection_types:n="Intersection results could not be merged";break;case w.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case w.not_finite:n="Number must be finite";break;default:n=e.defaultError,D.assertNever(t)}return{message:n}},je=Ep;var Kl=je;function Ap(t){Kl=t}function Jt(){return Kl}var On=t=>{let{data:e,path:n,errorMaps:r,issueData:o}=t,i=[...n,...o.path||[]],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let s="",l=r.filter(c=>!!c).slice().reverse();for(let c of l)s=c(a,{data:e,defaultError:s}).message;return{...o,path:i,message:s}},Rp=[];function x(t,e){let n=Jt(),r=On({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===je?void 0:je].filter(o=>!!o)});t.common.issues.push(r)}var se=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return A;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n){let i=await o.key,a=await o.value;r.push({key:i,value:a})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return A;i.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(r[i.value]=a.value)}return{status:e.value,value:r}}},A=Object.freeze({status:"aborted"}),It=t=>({status:"dirty",value:t}),de=t=>({status:"valid",value:t}),yr=t=>t.status==="aborted",br=t=>t.status==="dirty",ot=t=>t.status==="valid",Ht=t=>typeof Promise<"u"&&t instanceof Promise;var C;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(C||(C={}));var Ce=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Gl=(t,e)=>{if(ot(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new ge(t.common.issues);return this._error=n,this._error}}};function O(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(a,s)=>{let{message:l}=t;return a.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??r??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:l??n??s.defaultError}},description:o}}var k=class{get description(){return this._def.description}_getType(e){return $e(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:$e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new se,ctx:{common:e.parent.common,data:e.data,parsedType:$e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Ht(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$e(e)},o=this._parseSync({data:e,path:r.path,parent:r});return Gl(r,o)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$e(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return ot(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>ot(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$e(e)},o=this._parse({data:e,path:r.path,parent:r}),i=await(Ht(o)?o:Promise.resolve(o));return Gl(r,i)}refine(e,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{let a=e(o),s=()=>i.addIssue({code:w.custom,...r(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new _e({schema:this,typeName:P.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ie.create(this,this._def)}nullable(){return Le.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return He.create(this)}promise(){return st.create(this,this._def)}or(e){return Rt.create([this,e],this._def)}and(e){return Pt.create(this,e,this._def)}transform(e){return new _e({...O(this._def),schema:this,typeName:P.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new $t({...O(this._def),innerType:this,defaultValue:n,typeName:P.ZodDefault})}brand(){return new kn({typeName:P.ZodBranded,type:this,...O(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Ut({...O(this._def),innerType:this,catchValue:n,typeName:P.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Dn.create(this,e)}readonly(){return Lt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Pp=/^c[^\s-]{8,}$/i,zp=/^[0-9a-z]+$/,Op=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kp=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Dp=/^[a-z0-9_-]{21}$/i,$p=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Up=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Lp=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Vp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Uo,qp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Zp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Fp=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Qp=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Bp=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Kp=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,jl="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Gp=new RegExp(`^${jl}$`);function Wl(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Yp(t){return new RegExp(`^${Wl(t)}$`)}function Jl(t){let e=`${jl}T${Wl(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function jp(t,e){return!!((e==="v4"||!e)&&qp.test(t)||(e==="v6"||!e)&&Fp.test(t))}function Wp(t,e){if(!$p.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function Jp(t,e){return!!((e==="v4"||!e)&&Zp.test(t)||(e==="v6"||!e)&&Qp.test(t))}var it=class t extends k{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==T.string){let i=this._getOrReturnCtx(e);return x(i,{code:w.invalid_type,expected:T.string,received:i.parsedType}),A}let r=new se,o;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:w.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:w.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let a=e.data.length>i.value,s=e.data.length<i.value;(a||s)&&(o=this._getOrReturnCtx(e,o),a?x(o,{code:w.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&x(o,{code:w.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Lp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"email",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Uo||(Uo=new RegExp(Vp,"u")),Uo.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"emoji",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")kp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"uuid",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Dp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"nanoid",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")Pp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cuid",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")zp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cuid2",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Op.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"ulid",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),x(o,{validation:"url",code:w.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"regex",code:w.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?Jl(i).test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Gp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Yp(i).test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Up.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"duration",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?jp(e.data,i.version)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"ip",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?Wp(e.data,i.alg)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"jwt",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?Jp(e.data,i.version)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cidr",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Bp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"base64",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?Kp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"base64url",code:w.invalid_string,message:i.message}),r.dirty()):D.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:w.invalid_string,...C.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...C.errToObj(e)})}url(e){return this._addCheck({kind:"url",...C.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...C.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...C.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...C.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...C.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...C.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...C.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...C.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...C.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...C.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...C.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...C.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...C.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...C.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...C.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...C.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...C.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...C.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...C.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...C.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...C.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...C.errToObj(n)})}nonempty(e){return this.min(1,C.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};it.create=t=>new it({checks:[],typeName:P.ZodString,coerce:t?.coerce??!1,...O(t)});function Hp(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,i=Number.parseInt(t.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return i%a/10**o}var Ct=class t extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==T.number){let i=this._getOrReturnCtx(e);return x(i,{code:w.invalid_type,expected:T.number,received:i.parsedType}),A}let r,o=new se;for(let i of this._def.checks)i.kind==="int"?D.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),x(r,{code:w.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?Hp(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),x(r,{code:w.not_finite,message:i.message}),o.dirty()):D.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,C.toString(n))}gt(e,n){return this.setLimit("min",e,!1,C.toString(n))}lte(e,n){return this.setLimit("max",e,!0,C.toString(n))}lt(e,n){return this.setLimit("max",e,!1,C.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:C.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:C.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:C.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&D.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};Ct.create=t=>new Ct({checks:[],typeName:P.ZodNumber,coerce:t?.coerce||!1,...O(t)});var _t=class t extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==T.bigint)return this._getInvalidInput(e);let r,o=new se;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):D.assertNever(i);return{status:o.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return x(n,{code:w.invalid_type,expected:T.bigint,received:n.parsedType}),A}gte(e,n){return this.setLimit("min",e,!0,C.toString(n))}gt(e,n){return this.setLimit("min",e,!1,C.toString(n))}lte(e,n){return this.setLimit("max",e,!0,C.toString(n))}lt(e,n){return this.setLimit("max",e,!1,C.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:C.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};_t.create=t=>new _t({checks:[],typeName:P.ZodBigInt,coerce:t?.coerce??!1,...O(t)});var Nt=class extends k{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==T.boolean){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.boolean,received:r.parsedType}),A}return de(e.data)}};Nt.create=t=>new Nt({typeName:P.ZodBoolean,coerce:t?.coerce||!1,...O(t)});var vt=class t extends k{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==T.date){let i=this._getOrReturnCtx(e);return x(i,{code:w.invalid_type,expected:T.date,received:i.parsedType}),A}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return x(i,{code:w.invalid_date}),A}let r=new se,o;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:w.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:w.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):D.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:C.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:C.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};vt.create=t=>new vt({checks:[],coerce:t?.coerce||!1,typeName:P.ZodDate,...O(t)});var en=class extends k{_parse(e){if(this._getType(e)!==T.symbol){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.symbol,received:r.parsedType}),A}return de(e.data)}};en.create=t=>new en({typeName:P.ZodSymbol,...O(t)});var Et=class extends k{_parse(e){if(this._getType(e)!==T.undefined){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.undefined,received:r.parsedType}),A}return de(e.data)}};Et.create=t=>new Et({typeName:P.ZodUndefined,...O(t)});var At=class extends k{_parse(e){if(this._getType(e)!==T.null){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.null,received:r.parsedType}),A}return de(e.data)}};At.create=t=>new At({typeName:P.ZodNull,...O(t)});var at=class extends k{constructor(){super(...arguments),this._any=!0}_parse(e){return de(e.data)}};at.create=t=>new at({typeName:P.ZodAny,...O(t)});var Je=class extends k{constructor(){super(...arguments),this._unknown=!0}_parse(e){return de(e.data)}};Je.create=t=>new Je({typeName:P.ZodUnknown,...O(t)});var ze=class extends k{_parse(e){let n=this._getOrReturnCtx(e);return x(n,{code:w.invalid_type,expected:T.never,received:n.parsedType}),A}};ze.create=t=>new ze({typeName:P.ZodNever,...O(t)});var tn=class extends k{_parse(e){if(this._getType(e)!==T.undefined){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.void,received:r.parsedType}),A}return de(e.data)}};tn.create=t=>new tn({typeName:P.ZodVoid,...O(t)});var He=class t extends k{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==T.array)return x(n,{code:w.invalid_type,expected:T.array,received:n.parsedType}),A;if(o.exactLength!==null){let a=n.data.length>o.exactLength.value,s=n.data.length<o.exactLength.value;(a||s)&&(x(n,{code:a?w.too_big:w.too_small,minimum:s?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(x(n,{code:w.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(x(n,{code:w.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>o.type._parseAsync(new Ce(n,a,n.path,s)))).then(a=>se.mergeArray(r,a));let i=[...n.data].map((a,s)=>o.type._parseSync(new Ce(n,a,n.path,s)));return se.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:C.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:C.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:C.toString(n)}})}nonempty(e){return this.min(1,e)}};He.create=(t,e)=>new He({type:t,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...O(e)});function Xt(t){if(t instanceof ye){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Ie.create(Xt(r))}return new ye({...t._def,shape:()=>e})}else return t instanceof He?new He({...t._def,type:Xt(t.element)}):t instanceof Ie?Ie.create(Xt(t.unwrap())):t instanceof Le?Le.create(Xt(t.unwrap())):t instanceof Ue?Ue.create(t.items.map(e=>Xt(e))):t}var ye=class t extends k{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=D.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==T.object){let c=this._getOrReturnCtx(e);return x(c,{code:w.invalid_type,expected:T.object,received:c.parsedType}),A}let{status:r,ctx:o}=this._processInputParams(e),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof ze&&this._def.unknownKeys==="strip"))for(let c in o.data)a.includes(c)||s.push(c);let l=[];for(let c of a){let m=i[c],d=o.data[c];l.push({key:{status:"valid",value:c},value:m._parse(new Ce(o,d,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof ze){let c=this._def.unknownKeys;if(c==="passthrough")for(let m of s)l.push({key:{status:"valid",value:m},value:{status:"valid",value:o.data[m]}});else if(c==="strict")s.length>0&&(x(o,{code:w.unrecognized_keys,keys:s}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let m of s){let d=o.data[m];l.push({key:{status:"valid",value:m},value:c._parse(new Ce(o,d,o.path,m)),alwaysSet:m in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let c=[];for(let m of l){let d=await m.key,h=await m.value;c.push({key:d,value:h,alwaysSet:m.alwaysSet})}return c}).then(c=>se.mergeObjectSync(r,c)):se.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return C.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:C.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:P.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of D.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of D.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return Xt(this)}partial(e){let n={};for(let r of D.objectKeys(this.shape)){let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of D.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Ie;)i=i._def.innerType;n[r]=i}return new t({...this._def,shape:()=>n})}keyof(){return Hl(D.objectKeys(this.shape))}};ye.create=(t,e)=>new ye({shape:()=>t,unknownKeys:"strip",catchall:ze.create(),typeName:P.ZodObject,...O(e)});ye.strictCreate=(t,e)=>new ye({shape:()=>t,unknownKeys:"strict",catchall:ze.create(),typeName:P.ZodObject,...O(e)});ye.lazycreate=(t,e)=>new ye({shape:t,unknownKeys:"strip",catchall:ze.create(),typeName:P.ZodObject,...O(e)});var Rt=class extends k{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(s=>new ge(s.ctx.common.issues));return x(n,{code:w.invalid_union,unionErrors:a}),A}if(n.common.async)return Promise.all(r.map(async i=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(o);{let i,a=[];for(let l of r){let c={...n,common:{...n.common,issues:[]},parent:null},m=l._parseSync({data:n.data,path:n.path,parent:c});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let s=a.map(l=>new ge(l));return x(n,{code:w.invalid_union,unionErrors:s}),A}}get options(){return this._def.options}};Rt.create=(t,e)=>new Rt({options:t,typeName:P.ZodUnion,...O(e)});var We=t=>t instanceof zt?We(t.schema):t instanceof _e?We(t.innerType()):t instanceof Ot?[t.value]:t instanceof kt?t.options:t instanceof Dt?D.objectValues(t.enum):t instanceof $t?We(t._def.innerType):t instanceof Et?[void 0]:t instanceof At?[null]:t instanceof Ie?[void 0,...We(t.unwrap())]:t instanceof Le?[null,...We(t.unwrap())]:t instanceof kn||t instanceof Lt?We(t.unwrap()):t instanceof Ut?We(t._def.innerType):[],Sr=class t extends k{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==T.object)return x(n,{code:w.invalid_type,expected:T.object,received:n.parsedType}),A;let r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(x(n,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),A)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=new Map;for(let i of n){let a=We(i.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of a){if(o.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);o.set(s,i)}}return new t({typeName:P.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...O(r)})}};function Lo(t,e){let n=$e(t),r=$e(e);if(t===e)return{valid:!0,data:t};if(n===T.object&&r===T.object){let o=D.objectKeys(e),i=D.objectKeys(t).filter(s=>o.indexOf(s)!==-1),a={...t,...e};for(let s of i){let l=Lo(t[s],e[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===T.array&&r===T.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let i=0;i<t.length;i++){let a=t[i],s=e[i],l=Lo(a,s);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===T.date&&r===T.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Pt=class extends k{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=(i,a)=>{if(yr(i)||yr(a))return A;let s=Lo(i.value,a.value);return s.valid?((br(i)||br(a))&&n.dirty(),{status:n.value,value:s.data}):(x(r,{code:w.invalid_intersection_types}),A)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,a])=>o(i,a)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Pt.create=(t,e,n)=>new Pt({left:t,right:e,typeName:P.ZodIntersection,...O(n)});var Ue=class t extends k{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==T.array)return x(r,{code:w.invalid_type,expected:T.array,received:r.parsedType}),A;if(r.data.length<this._def.items.length)return x(r,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&r.data.length>this._def.items.length&&(x(r,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((a,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Ce(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(i).then(a=>se.mergeArray(n,a)):se.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Ue.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ue({items:t,typeName:P.ZodTuple,rest:null,...O(e)})};var wr=class t extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==T.object)return x(r,{code:w.invalid_type,expected:T.object,received:r.parsedType}),A;let o=[],i=this._def.keyType,a=this._def.valueType;for(let s in r.data)o.push({key:i._parse(new Ce(r,s,r.path,s)),value:a._parse(new Ce(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?se.mergeObjectAsync(n,o):se.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof k?new t({keyType:e,valueType:n,typeName:P.ZodRecord,...O(r)}):new t({keyType:it.create(),valueType:e,typeName:P.ZodRecord,...O(n)})}},nn=class extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==T.map)return x(r,{code:w.invalid_type,expected:T.map,received:r.parsedType}),A;let o=this._def.keyType,i=this._def.valueType,a=[...r.data.entries()].map(([s,l],c)=>({key:o._parse(new Ce(r,s,r.path,[c,"key"])),value:i._parse(new Ce(r,l,r.path,[c,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of a){let c=await l.key,m=await l.value;if(c.status==="aborted"||m.status==="aborted")return A;(c.status==="dirty"||m.status==="dirty")&&n.dirty(),s.set(c.value,m.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let l of a){let c=l.key,m=l.value;if(c.status==="aborted"||m.status==="aborted")return A;(c.status==="dirty"||m.status==="dirty")&&n.dirty(),s.set(c.value,m.value)}return{status:n.value,value:s}}}};nn.create=(t,e,n)=>new nn({valueType:e,keyType:t,typeName:P.ZodMap,...O(n)});var rn=class t extends k{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==T.set)return x(r,{code:w.invalid_type,expected:T.set,received:r.parsedType}),A;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(x(r,{code:w.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(x(r,{code:w.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let i=this._def.valueType;function a(l){let c=new Set;for(let m of l){if(m.status==="aborted")return A;m.status==="dirty"&&n.dirty(),c.add(m.value)}return{status:n.value,value:c}}let s=[...r.data.values()].map((l,c)=>i._parse(new Ce(r,l,r.path,c)));return r.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(e,n){return new t({...this._def,minSize:{value:e,message:C.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:C.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};rn.create=(t,e)=>new rn({valueType:t,minSize:null,maxSize:null,typeName:P.ZodSet,...O(e)});var Mr=class t extends k{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==T.function)return x(n,{code:w.invalid_type,expected:T.function,received:n.parsedType}),A;function r(s,l){return On({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Jt(),je].filter(c=>!!c),issueData:{code:w.invalid_arguments,argumentsError:l}})}function o(s,l){return On({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Jt(),je].filter(c=>!!c),issueData:{code:w.invalid_return_type,returnTypeError:l}})}let i={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof st){let s=this;return de(async function(...l){let c=new ge([]),m=await s._def.args.parseAsync(l,i).catch(g=>{throw c.addIssue(r(l,g)),c}),d=await Reflect.apply(a,this,m);return await s._def.returns._def.type.parseAsync(d,i).catch(g=>{throw c.addIssue(o(d,g)),c})})}else{let s=this;return de(function(...l){let c=s._def.args.safeParse(l,i);if(!c.success)throw new ge([r(l,c.error)]);let m=Reflect.apply(a,this,c.data),d=s._def.returns.safeParse(m,i);if(!d.success)throw new ge([o(m,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Ue.create(e).rest(Je.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||Ue.create([]).rest(Je.create()),returns:n||Je.create(),typeName:P.ZodFunction,...O(r)})}},zt=class extends k{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};zt.create=(t,e)=>new zt({getter:t,typeName:P.ZodLazy,...O(e)});var Ot=class extends k{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return x(n,{received:n.data,code:w.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ot.create=(t,e)=>new Ot({value:t,typeName:P.ZodLiteral,...O(e)});function Hl(t,e){return new kt({values:t,typeName:P.ZodEnum,...O(e)})}var kt=class t extends k{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return x(n,{expected:D.joinValues(r),received:n.parsedType,code:w.invalid_type}),A}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return x(n,{received:n.data,code:w.invalid_enum_value,options:r}),A}return de(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};kt.create=Hl;var Dt=class extends k{_parse(e){let n=D.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==T.string&&r.parsedType!==T.number){let o=D.objectValues(n);return x(r,{expected:D.joinValues(o),received:r.parsedType,code:w.invalid_type}),A}if(this._cache||(this._cache=new Set(D.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=D.objectValues(n);return x(r,{received:r.data,code:w.invalid_enum_value,options:o}),A}return de(e.data)}get enum(){return this._def.values}};Dt.create=(t,e)=>new Dt({values:t,typeName:P.ZodNativeEnum,...O(e)});var st=class extends k{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==T.promise&&n.common.async===!1)return x(n,{code:w.invalid_type,expected:T.promise,received:n.parsedType}),A;let r=n.parsedType===T.promise?n.data:Promise.resolve(n.data);return de(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};st.create=(t,e)=>new st({type:t,typeName:P.ZodPromise,...O(e)});var _e=class extends k{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,i={addIssue:a=>{x(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(r.data,i);if(r.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return A;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?A:l.status==="dirty"?It(l.value):n.value==="dirty"?It(l.value):l});{if(n.value==="aborted")return A;let s=this._def.schema._parseSync({data:a,path:r.path,parent:r});return s.status==="aborted"?A:s.status==="dirty"?It(s.value):n.value==="dirty"?It(s.value):s}}if(o.type==="refinement"){let a=s=>{let l=o.refinement(s,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?A:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?A:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(o.type==="transform")if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ot(a))return A;let s=o.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>ot(a)?Promise.resolve(o.transform(a.value,i)).then(s=>({status:n.value,value:s})):A);D.assertNever(o)}};_e.create=(t,e,n)=>new _e({schema:t,typeName:P.ZodEffects,effect:e,...O(n)});_e.createWithPreprocess=(t,e,n)=>new _e({schema:e,effect:{type:"preprocess",transform:t},typeName:P.ZodEffects,...O(n)});var Ie=class extends k{_parse(e){return this._getType(e)===T.undefined?de(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ie.create=(t,e)=>new Ie({innerType:t,typeName:P.ZodOptional,...O(e)});var Le=class extends k{_parse(e){return this._getType(e)===T.null?de(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Le.create=(t,e)=>new Le({innerType:t,typeName:P.ZodNullable,...O(e)});var $t=class extends k{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===T.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};$t.create=(t,e)=>new $t({innerType:t,typeName:P.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...O(e)});var Ut=class extends k{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ht(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ge(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ge(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Ut.create=(t,e)=>new Ut({innerType:t,typeName:P.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...O(e)});var on=class extends k{_parse(e){if(this._getType(e)!==T.nan){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.nan,received:r.parsedType}),A}return{status:"valid",value:e.data}}};on.create=t=>new on({typeName:P.ZodNaN,...O(t)});var Xp=Symbol("zod_brand"),kn=class extends k{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Dn=class t extends k{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?A:i.status==="dirty"?(n.dirty(),It(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?A:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:P.ZodPipeline})}},Lt=class extends k{_parse(e){let n=this._def.innerType._parse(e),r=o=>(ot(o)&&(o.value=Object.freeze(o.value)),o);return Ht(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}};Lt.create=(t,e)=>new Lt({innerType:t,typeName:P.ZodReadonly,...O(e)});function Yl(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function Xl(t,e={},n){return t?at.create().superRefine((r,o)=>{let i=t(r);if(i instanceof Promise)return i.then(a=>{if(!a){let s=Yl(e,r),l=s.fatal??n??!0;o.addIssue({code:"custom",...s,fatal:l})}});if(!i){let a=Yl(e,r),s=a.fatal??n??!0;o.addIssue({code:"custom",...a,fatal:s})}}):at.create()}var eh={object:ye.lazycreate},P;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(P||(P={}));var th=(t,e={message:`Input not instance of ${t.name}`})=>Xl(n=>n instanceof t,e),ec=it.create,tc=Ct.create,nh=on.create,rh=_t.create,nc=Nt.create,oh=vt.create,ih=en.create,ah=Et.create,sh=At.create,lh=at.create,ch=Je.create,uh=ze.create,dh=tn.create,mh=He.create,ph=ye.create,hh=ye.strictCreate,fh=Rt.create,gh=Sr.create,yh=Pt.create,bh=Ue.create,Sh=wr.create,wh=nn.create,Mh=rn.create,xh=Mr.create,Th=zt.create,Ih=Ot.create,Ch=kt.create,_h=Dt.create,Nh=st.create,vh=_e.create,Eh=Ie.create,Ah=Le.create,Rh=_e.createWithPreprocess,Ph=Dn.create,zh=()=>ec().optional(),Oh=()=>tc().optional(),kh=()=>nc().optional(),Dh={string:(t=>it.create({...t,coerce:!0})),number:(t=>Ct.create({...t,coerce:!0})),boolean:(t=>Nt.create({...t,coerce:!0})),bigint:(t=>_t.create({...t,coerce:!0})),date:(t=>vt.create({...t,coerce:!0}))};var $h=A;var rc=Vo;var Uh={ResourceNotFound:-32002,InvalidParams:Tt.InvalidParams,InternalError:Tt.InternalError};var gw=rc.string().regex(/^#[0-9A-Fa-f]{6}$/,"Color must be in hex format (e.g., #FFFFFF).");var ic=t=>t.startsWith("file://")?(0,oc.fileURLToPath)(t):t;var qo=t=>new vn(Uh.InvalidParams,t);var le=[];for(let t=0;t<256;++t)le.push((t+256).toString(16).slice(1));function ac(t,e=0){return(le[t[e+0]]+le[t[e+1]]+le[t[e+2]]+le[t[e+3]]+"-"+le[t[e+4]]+le[t[e+5]]+"-"+le[t[e+6]]+le[t[e+7]]+"-"+le[t[e+8]]+le[t[e+9]]+"-"+le[t[e+10]]+le[t[e+11]]+le[t[e+12]]+le[t[e+13]]+le[t[e+14]]+le[t[e+15]]).toLowerCase()}var Lh=new Uint8Array(16);function Zo(){return crypto.getRandomValues(Lh)}function Vh(t,e,n){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():qh(t,e,n)}function qh(t,e,n){t=t||{};let r=t.random??t.rng?.()??Zo();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){if(n=n||0,n<0||n+16>e.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let o=0;o<16;++o)e[n+o]=r[o];return e}return ac(r)}var X=Vh;var Zh={equalsEntries(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],o=e[n];if(r.modelType!==o.modelType||r.modelType==="single"&&o.modelType==="single"&&r.columnModelId!==o.columnModelId||r.modelType==="group"&&o.modelType==="group"&&r.columnGroupId!==o.columnGroupId)return!1}return!0},serializeEntries(t){return t.map(e=>e.modelType==="group"?`group:${e.columnGroupId}`:e.columnModelId)},deserializeEntries(t){return t.map(e=>e.startsWith("group:")?{modelType:"group",columnGroupId:e.substring(6)}:{modelType:"single",columnModelId:e})}},lt=Zh;var $n=class extends Error{constructor(e){super(e)}},xr=class extends $n{constructor(e,n){super(`Not exists property '${e}' in object : ${n}`),this.propertyName=e}},Tr=class extends $n{constructor(e,n){super(`The property '${e}' is not array : ${n}`),this.propertyName=e}},Ir=class extends $n{constructor(e,n){super(`The property '${e}' is not Object : ${n}`),this.propertyName=e}};function S(t,e){if(!(e in t))throw new xr(e,t)}function j(t,e,n){if(Fh(t)===!1)throw new Tr(e,t);if(t.length===0)return[];if(Qh(t)===!1)throw new Ir(e,t);return t.map(r=>n(r))}function Fh(t){return Array.isArray(t)}function Qh(t){return t.every(e=>typeof e=="object"&&e!==null)}function Ve(t,e=null){return t==null?e??new Date:t instanceof Date?t:typeof t=="string"?new Date(t):new Date}var ct=class t{constructor({structShareModelId:e="",physicalName:n="",logicalName:r="",columnEntries:o=[],isArray:i=!1,description:a=""}){this.structShareModelId=e||X(),this.physicalName=n.trim(),this.logicalName=r.trim(),this.columnEntries=o,this.isArray=i,this.description=a.trim()}simpleColumnType(){return this.isArray===!0?"ARRAY<STRUCT>":"STRUCT"}toJSON(){let e=lt.serializeEntries(this.columnEntries);return{structShareModelId:this.structShareModelId,physicalName:this.physicalName,...this.logicalName!==""&&{logicalName:this.logicalName},columnModelIds:e,...this.isArray===!0&&{isArray:this.isArray},...this.description!==""&&{description:this.description}}}static toObject(e){S(e,"structShareModelId"),S(e,"physicalName"),S(e,"columnModelIds");let n="logicalName"in e?e.logicalName:"",r=lt.deserializeEntries(e.columnModelIds),o="isArray"in e?e.isArray:!1,i="description"in e?e.description:"";return new t({structShareModelId:e.structShareModelId,physicalName:e.physicalName,logicalName:n,columnEntries:r,isArray:o,description:i})}equals(e){return this.structShareModelId!==e.structShareModelId||this.physicalName!==e.physicalName||this.logicalName!==e.logicalName||this.description!==e.description||this.isArray!==e.isArray?!1:lt.equalsEntries(this.columnEntries,e.columnEntries)}};function Xe(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([n,r])=>{let o=e.get(n);return o!=null&&r.equals(o)})}function Vt(t,e){let n=t.size===e.size,r=Array.from(e.entries()).map(([o,i])=>{let a=t.get(o);return a!=null&&a.equals(i)?[o,a]:(n=!1,[o,i])});return n?t:new Map(r)}function Fo(t,e){return an(t,e)?t:e}function an(t,e){return t.length!==e.length?!1:t.every((n,r)=>n===e[r])}var Un=class t{constructor(e,n){this.columnShareModelMap=e,this.structShareModelMap=n}static create(e=null,n=null){let r=new Map(e==null?[]:e.map(i=>[i.columnShareModelId,i])),o=new Map(n==null?[]:n.map(i=>[i.structShareModelId,i]));return new t(r,o)}getColumnShareModels(){return Array.from(this.columnShareModelMap.values()).sort((e,n)=>{let r=e.physicalName.localeCompare(n.physicalName,"en");if(r!==0)return r;let o=e.logicalName.localeCompare(n.logicalName,"en");if(o!==0)return o;let i=e.columnType.name.localeCompare(n.columnType.name,"en");return i!==0?i:e.columnShareModelId.localeCompare(n.columnShareModelId,"en")})}findColumnShare(e){if(e==="")return null;let n=this.columnShareModelMap.get(e);return n??null}addColumnShare(...e){if(e.length===0)return this;let n=new Map(this.columnShareModelMap);return e.forEach(r=>n.set(r.columnShareModelId,r)),new t(n,this.structShareModelMap)}getStructShareModels(){return this.structShareModelMap.size===0?[]:Array.from(this.structShareModelMap.values()).sort((e,n)=>{let r=e.physicalName.localeCompare(n.physicalName,"en");return r!==0?r:e.structShareModelId.localeCompare(n.structShareModelId,"en")})}findStructShare(e){if(e==="")return null;let n=this.structShareModelMap.get(e);return n??null}addStructShare(...e){if(e.length===0)return this;let n=new Map(this.structShareModelMap);return e.forEach(r=>n.set(r.structShareModelId,r)),new t(this.columnShareModelMap,n)}deleteStructShare(e){if(e.length===0)return this;let n=new Map(this.structShareModelMap);return e.forEach(r=>n.delete(r)),new t(this.columnShareModelMap,n)}retain(e,n,r,o){let i=Array.from(this.columnShareModelMap.keys()).filter(s=>e.has(s)===!1),a=Array.from(this.structShareModelMap.keys()).filter(s=>n.has(s)===!1);return this.deleteColumnShare(i).deleteStructShare(a).deleteDanglingColumnEntries(r,o)}deleteColumnShare(e){if(e.length===0)return this;let n=new Map(this.columnShareModelMap);return e.forEach(r=>n.delete(r)),new t(n,this.structShareModelMap)}deleteDanglingColumnEntries(e,n){let r=!1,o=new Map(this.structShareModelMap);for(let[i,a]of this.structShareModelMap.entries()){let s=a.columnEntries.filter(c=>c.modelType==="single"?e.has(c.columnModelId):n.has(c.columnGroupId));if(s.length===a.columnEntries.length)continue;r=!0;let l=new ct({...a,columnEntries:s});o.set(i,l)}return r?new t(this.columnShareModelMap,o):this}copy(){return new t(new Map(this.columnShareModelMap),new Map(this.structShareModelMap))}equals(e){return Xe(this.columnShareModelMap,e.columnShareModelMap)&&Xe(this.structShareModelMap,e.structShareModelMap)}reuseInstancesFrom(e){let n=Vt(e.columnShareModelMap,this.columnShareModelMap),r=Vt(e.structShareModelMap,this.structShareModelMap);return(n===e.columnShareModelMap&&r===e.structShareModelMap)===!0?e:new t(new Map(n),new Map(r))}};var sn=class t{constructor({columnGroupId:e="",groupName:n="",columnModelIds:r=[],description:o=""}){this.columnGroupId=e||X(),this.groupName=n.trim(),this.columnModelIds=[...r],this.description=o}toJSON(){return{columnGroupId:this.columnGroupId,groupName:this.groupName,columnModelIds:this.columnModelIds,...this.description!==""&&{description:this.description}}}static toObject(e){return S(e,"columnGroupId"),S(e,"groupName"),S(e,"columnModelIds"),new t({columnGroupId:e.columnGroupId,groupName:e.groupName,columnModelIds:e.columnModelIds,description:"description"in e?e.description:""})}equals(e){return this.columnGroupId===e.columnGroupId&&this.groupName===e.groupName&&this.description===e.description&&this.columnModelIds.length===e.columnModelIds.length&&this.columnModelIds.every((n,r)=>n===e.columnModelIds[r])}};var ut=class t{constructor(e){this.entityType="simple";this.columnModelId=e.columnModelId?e.columnModelId:X(),this.physicalName=(e.physicalName??"").trim(),this.logicalName=(e.logicalName??"").trim(),this.notNull=e.notNull??!1,this.columnShareModelId=e.columnShareModelId,this.primaryKey=e.primaryKey??!1,this.unique=e.unique??!1,this.autoIncrement=e.autoIncrement??!1,this.defaultValue=(e.defaultValue??"").trim()}toJSON(){return{columnModelId:this.columnModelId,columnShareModelId:this.columnShareModelId,...this.physicalName!==""&&{physicalName:this.physicalName},...this.logicalName!==""&&{logicalName:this.logicalName},...this.primaryKey&&{primaryKey:this.primaryKey},...this.notNull&&{notNull:this.notNull},...this.unique&&{unique:this.unique},...this.autoIncrement&&{autoIncrement:this.autoIncrement},...this.defaultValue!==""&&{defaultValue:this.defaultValue}}}static toObject(e){S(e,"columnModelId"),S(e,"columnShareModelId");let n="physicalName"in e?e.physicalName:"",r="logicalName"in e?e.logicalName:"",o="notNull"in e?e.notNull:!1,i="primaryKey"in e?e.primaryKey:!1,a="unique"in e?e.unique:!1,s="autoIncrement"in e?e.autoIncrement:!1,l="defaultValue"in e?e.defaultValue:"";return new t({columnModelId:e.columnModelId,columnShareModelId:e.columnShareModelId,physicalName:n,logicalName:r,primaryKey:i,notNull:o,unique:a,autoIncrement:s,defaultValue:l})}equals(e){return this.columnModelId===e.columnModelId&&this.physicalName===e.physicalName&&this.logicalName===e.logicalName&&this.notNull===e.notNull&&this.columnShareModelId===e.columnShareModelId&&this.primaryKey===e.primaryKey&&this.unique===e.unique&&this.autoIncrement===e.autoIncrement&&this.defaultValue===e.defaultValue}};var Ln=class t{constructor(e){this.entityType="struct";this.columnModelId=e.columnModelId?e.columnModelId:X(),this.physicalName=(e.physicalName??"").trim(),this.logicalName=(e.logicalName??"").trim(),this.notNull=e.notNull??!1,this.structShareModelId=e.structShareModelId}toJSON(){return{columnModelId:this.columnModelId,entityType:"struct",structShareModelId:this.structShareModelId,...this.physicalName!==""&&{physicalName:this.physicalName},...this.logicalName!==""&&{logicalName:this.logicalName},...this.notNull&&{notNull:this.notNull}}}static toObject(e){S(e,"columnModelId"),S(e,"structShareModelId");let n="physicalName"in e?e.physicalName:"",r="logicalName"in e?e.logicalName:"",o="notNull"in e?e.notNull:!1;return new t({columnModelId:e.columnModelId,physicalName:n,logicalName:r,notNull:o,structShareModelId:e.structShareModelId})}equals(e){return this.columnModelId===e.columnModelId&&this.physicalName===e.physicalName&&this.logicalName===e.logicalName&&this.notNull===e.notNull&&this.structShareModelId===e.structShareModelId}};var Vn={isSimpleColumn(t){return t.entityType==="simple"},isStructColumn(t){return t.entityType==="struct"},equals(t,e){return Vn.isSimpleColumn(t)&&Vn.isSimpleColumn(e)||Vn.isStructColumn(t)&&Vn.isStructColumn(e)?t.equals(e):!1},toObject(t){return("entityType"in t?t.entityType:"simple")==="struct"?Ln.toObject(t):ut.toObject(t)}},ce=Vn;var qn=class t{constructor({columnShareModelId:e,physicalName:n,logicalName:r,columnType:o,precision:i="",scale:a="",unsigned:s=!1,isArray:l=!1,description:c="",checkExpression:m="",characterSet:d="",collate:h="",optionExpression:g="",createdAt:b=null}){this.columnShareModelId=e,this.physicalName=n,this.logicalName=r,this.columnType=o,this.precision=o.withPrecision?i:"",this.scale=o.withScale?a:"",this.unsigned=o.withUnsigned?s:!1,this.isArray=l,this.description=c.trim(),this.checkExpression=m.trim(),this.characterSetValue=d.trim(),this.collateValue=h.trim(),this.optionExpression=g.trim(),this.createdAt=b||new Date}get collate(){return this.columnType.category==="text"?this.collateValue:""}characterSet(e){return this.columnType.category==="text"&&e.editableCharacterSet?this.characterSetValue:""}specifiedColumnType(e=!1){return this.columnType.specifiedType({precision:this.precision,scale:this.scale,isArray:this.isArray,inChildRelation:e})}matchForReferenceType(e){let n=this.specifiedColumnType(!0),r=e.specifiedColumnType(!0);return!(n!==r||this.columnType.withUnsigned&&this.unsigned!==e.unsigned)}toJSON(){return{columnShareModelId:this.columnShareModelId,physicalName:this.physicalName,logicalName:this.logicalName,columnTypeId:this.columnType.id,...this.precision!==""&&{precision:this.precision},...this.scale!==""&&{scale:this.scale},...this.unsigned&&{unsigned:this.unsigned},...this.isArray&&{isArray:this.isArray},...this.description!==""&&{description:this.description},...this.checkExpression!==""&&{checkExpression:this.checkExpression},...this.characterSetValue!==""&&this.columnType.category==="text"&&{characterSet:this.characterSetValue},...this.collateValue!==""&&this.columnType.category==="text"&&{collate:this.collateValue},...this.optionExpression!==""&&{optionExpression:this.optionExpression},createdAt:this.createdAt}}static toObject(e,n){return S(e,"columnShareModelId"),S(e,"physicalName"),S(e,"logicalName"),S(e,"columnTypeId"),new t({columnShareModelId:e.columnShareModelId,physicalName:e.physicalName,logicalName:e.logicalName,columnType:n(e.columnTypeId),precision:"precision"in e?e.precision:"",scale:"scale"in e?e.scale:"",unsigned:"unsigned"in e?e.unsigned:!1,isArray:"isArray"in e?e.isArray:!1,description:"description"in e?e.description:"",checkExpression:"checkExpression"in e?e.checkExpression:"",characterSet:"characterSet"in e?e.characterSet:"",collate:"collate"in e?e.collate:"",optionExpression:"optionExpression"in e?e.optionExpression:"",createdAt:"createdAt"in e?Ve(e.createdAt):new Date})}equals(e){return this.columnShareModelId===e.columnShareModelId&&this.physicalName===e.physicalName&&this.logicalName===e.logicalName&&this.columnType.id===e.columnType.id&&this.precision===e.precision&&this.scale===e.scale&&this.unsigned===e.unsigned&&this.isArray===e.isArray&&this.description===e.description&&this.checkExpression===e.checkExpression&&this.characterSetValue===e.characterSetValue&&this.collateValue===e.collateValue&&this.optionExpression===e.optionExpression}};var dt=class t{constructor({parentColumnModelId:e,childColumnModelId:n}){this.parentColumnModelId=e,this.childColumnModelId=n}toJSON(){return{parentColumnModelId:this.parentColumnModelId,childColumnModelId:this.childColumnModelId}}static toObject(e){return S(e,"parentColumnModelId"),S(e,"childColumnModelId"),new t({parentColumnModelId:e.parentColumnModelId,childColumnModelId:e.childColumnModelId})}equals(e){return this.parentColumnModelId===e.parentColumnModelId&&this.childColumnModelId===e.childColumnModelId}};var qe=class t{constructor({relationModelId:e="",relationName:n="",parentTableModelId:r,parentCardinality:o="1",childTableModelId:i,childCardinality:a="1",relationPairs:s=[],onUpdateAction:l="RESTRICT",onDeleteAction:c="RESTRICT"}){this.relationModelId=e||X(),this.relationName=n,this.parentTableModelId=r,this.parentCardinality=o,this.childTableModelId=i,this.childCardinality=a,this.relationPairs=[...s],this.onUpdateAction=l,this.onDeleteAction=c}toJSON(){return{relationModelId:this.relationModelId,...this.relationName!==""&&{relationName:this.relationName},parentTableModelId:this.parentTableModelId,parentCardinality:this.parentCardinality,childTableModelId:this.childTableModelId,childCardinality:this.childCardinality,relationPairs:this.relationPairs.map(e=>e.toJSON()),onUpdateAction:this.onUpdateAction,onDeleteAction:this.onDeleteAction}}static toObject(e){return S(e,"relationModelId"),S(e,"parentTableModelId"),S(e,"childTableModelId"),S(e,"relationPairs"),new t({relationModelId:e.relationModelId,relationName:"relationName"in e?e.relationName:"",parentTableModelId:e.parentTableModelId,parentCardinality:"parentCardinality"in e?e.parentCardinality:"1",childTableModelId:e.childTableModelId,childCardinality:"childCardinality"in e?e.childCardinality:"1",relationPairs:j(e.relationPairs,"relationPairs",n=>dt.toObject(n)),onUpdateAction:"onUpdateAction"in e?e.onUpdateAction:"RESTRICT",onDeleteAction:"onDeleteAction"in e?e.onDeleteAction:"RESTRICT"})}equals(e){if(this.relationModelId!==e.relationModelId||this.relationName!==e.relationName||this.parentTableModelId!==e.parentTableModelId||this.parentCardinality!==e.parentCardinality||this.childTableModelId!==e.childTableModelId||this.childCardinality!==e.childCardinality||this.relationPairs.length!==e.relationPairs.length)return!1;for(let n=0;n<this.relationPairs.length;n++)if(this.relationPairs[n].equals(e.relationPairs[n])===!1)return!1;return!(this.onUpdateAction!==e.onUpdateAction||this.onDeleteAction!==e.onDeleteAction)}};var mt=(t,e)=>{let n=t.physicalName!=""?t.physicalName:e.physicalName,r=t.logicalName!=""?t.logicalName:e.logicalName;return{physicalName:n,logicalName:r}};var pt=class t{constructor({tableIndexModelId:e,physicalName:n,indexColumnModels:r,indexOption:o="",indexType:i="",clustered:a=!1,description:s=""}){this.tableIndexModelId=e,this.physicalName=n.trim(),this.indexColumnModels=[...r],this.indexOption=o,this.indexType=i,this.clustered=a,this.description=s}static filterColumns(e,n){let r=!1;return{tableIndexModels:e.flatMap(i=>{let a=i.indexColumnModels.filter(n);return a.length===i.indexColumnModels.length?[i]:(r=!0,a.length===0?[]:[new t({...i,indexColumnModels:a})])}),hasChanged:r}}toJSON(){return{tableIndexModelId:this.tableIndexModelId,physicalName:this.physicalName,indexColumnModels:this.indexColumnModels.map(e=>e.toJSON()),...this.indexOption!==""&&{indexOption:this.indexOption},...this.indexType!==""&&{indexType:this.indexType},...this.clustered&&{clustered:this.clustered},...this.description!==""&&{description:this.description}}}static toObject(e){S(e,"tableIndexModelId"),S(e,"physicalName"),S(e,"indexColumnModels");let n=j(e.indexColumnModels,"indexColumnModels",r=>Qo.toObject(r));return new t({tableIndexModelId:e.tableIndexModelId,physicalName:e.physicalName,indexColumnModels:n,indexOption:Bh(e),indexType:"indexType"in e?e.indexType:"",clustered:"clustered"in e?e.clustered:!1,description:"description"in e?e.description:""})}equals(e){if(this.tableIndexModelId!==e.tableIndexModelId||this.physicalName!==e.physicalName||this.indexColumnModels.length!==e.indexColumnModels.length)return!1;for(let n=0;n<this.indexColumnModels.length;n++){let r=this.indexColumnModels[n],o=e.indexColumnModels[n];if(r.equals(o)===!1)return!1}return!(this.indexOption!==e.indexOption||this.indexType!==e.indexType||this.clustered!==e.clustered||this.description!==e.description)}},Bh=t=>"indexOption"in t?t.indexOption:"indexOptioin"in t?t.indexOptioin:"",Qo=class t{constructor({columnModelId:e,sortOrderType:n="",nullsOrderType:r=""}){this.columnModelId=e,this.sortOrderType=n,this.nullsOrderType=r}querySort(){return this.sortOrderType===""?"":this.nullsOrderType===""?this.sortOrderType:`${this.sortOrderType} NULLS ${this.nullsOrderType}`}toJSON(){return{columnModelId:this.columnModelId,...this.sortOrderType!==""&&{sortOrderType:this.sortOrderType},...this.nullsOrderType!==""&&{nullsOrderType:this.nullsOrderType}}}static toObject(e){return S(e,"columnModelId"),new t({columnModelId:e.columnModelId,sortOrderType:"sortOrderType"in e?e.sortOrderType:"",nullsOrderType:"nullsOrderType"in e?e.nullsOrderType:""})}equals(e){return!(this.columnModelId!==e.columnModelId||this.sortOrderType!==e.sortOrderType||this.nullsOrderType!==e.nullsOrderType)}};var ht=class t{constructor({tableUniqueKeysModelId:e,physicalName:n="",uniqueKeysColumnModels:r,description:o=""}){this.tableUniqueKeysModelId=e,this.physicalName=n.trim(),this.uniqueKeysColumnModels=[...r],this.description=o}static filterColumns(e,n){let r=!1;return{tableUniqueKeysModels:e.flatMap(i=>{let a=i.uniqueKeysColumnModels.filter(n);return a.length===i.uniqueKeysColumnModels.length?[i]:(r=!0,a.length===0?[]:[new t({...i,uniqueKeysColumnModels:a})])}),hasChanged:r}}toJSON(){return{tableUniqueKeysModelId:this.tableUniqueKeysModelId,...this.physicalName!==""&&{physicalName:this.physicalName},uniqueKeysColumnModels:this.uniqueKeysColumnModels.map(e=>e.toJSON()),...this.description!==""&&{description:this.description}}}static toObject(e){S(e,"tableUniqueKeysModelId"),S(e,"uniqueKeysColumnModels");let n="physicalName"in e?e.physicalName:"",r=j(e.uniqueKeysColumnModels,"uniqueKeysColumnModels",o=>Bo.toObject(o));return new t({tableUniqueKeysModelId:e.tableUniqueKeysModelId,physicalName:n,uniqueKeysColumnModels:r,description:"description"in e?e.description:""})}equals(e){if(this.tableUniqueKeysModelId!==e.tableUniqueKeysModelId||this.physicalName!==e.physicalName||this.uniqueKeysColumnModels.length!==e.uniqueKeysColumnModels.length)return!1;for(let n=0;n<this.uniqueKeysColumnModels.length;n++){let r=this.uniqueKeysColumnModels[n],o=e.uniqueKeysColumnModels[n];if(r.equals(o)===!1)return!1}return this.description===e.description}},Bo=class t{constructor({columnModelId:e,sortOrderType:n}){this.columnModelId=e,this.sortOrderType=n}toJSON(){return{columnModelId:this.columnModelId,...this.sortOrderType!==""&&{sortOrderType:this.sortOrderType}}}static toObject(e){return S(e,"columnModelId"),new t({columnModelId:e.columnModelId,sortOrderType:"sortOrderType"in e?e.sortOrderType:""})}equals(e){return!(this.columnModelId!==e.columnModelId||this.sortOrderType!==e.sortOrderType)}};var Ze=class t{constructor({tableModelId:e="",physicalName:n="",logicalName:r="",schemaId:o="",columnEntries:i=[],uniqueKeysModels:a=[],tableIndexModels:s=[],description:l="",checkExpression:c="",characterSet:m="",collate:d="",definitionExpression:h="",optionExpression:g=""}){this.tableModelId=e||X(),this.physicalName=n.trim(),this.logicalName=r.trim(),this.schemaId=o,this.columnEntries=i,this.uniqueKeysModels=a,this.tableIndexModels=s,this.description=l.trim(),this.checkExpression=c.trim(),this.characterSet=m.trim(),this.collate=d.trim(),this.definitionExpression=h.trim(),this.optionExpression=g.trim()}addColumnModelIds(e){let n=new Set(this.columnEntries.filter(o=>o.modelType==="single").map(o=>o.columnModelId)),r=e.filter(o=>n.has(o)===!1).map(o=>({modelType:"single",columnModelId:o}));return r.length===0?this:new t({...this,columnEntries:this.columnEntries.concat(r)})}updateCheckExpression(e){if(this.checkExpression===""||e.length===0)return this;let n=this.checkExpression;for(let r of e){let o=`\${${r.previousName.physicalName}}`,i=`\${${r.nextName.physicalName}}`;n=n.replaceAll(o,i)}return n===this.checkExpression?this:new t({...this,checkExpression:n})}equals(e){if(this.tableModelId!==e.tableModelId||this.physicalName!==e.physicalName||this.logicalName!==e.logicalName||this.schemaId!==e.schemaId||lt.equalsEntries(this.columnEntries,e.columnEntries)===!1||this.uniqueKeysModels.length!==e.uniqueKeysModels.length)return!1;for(let n=0;n<this.uniqueKeysModels.length;n++){let r=this.uniqueKeysModels[n],o=e.uniqueKeysModels[n];if(r.equals(o)===!1)return!1}if(this.tableIndexModels.length!==e.tableIndexModels.length)return!1;for(let n=0;n<this.tableIndexModels.length;n++){let r=this.tableIndexModels[n],o=e.tableIndexModels[n];if(r.equals(o)===!1)return!1}return!(this.description!==e.description||this.checkExpression!==e.checkExpression||this.characterSet!==e.characterSet||this.collate!==e.collate||this.definitionExpression!==e.definitionExpression||this.optionExpression!==e.optionExpression)}toJSON(){let e=lt.serializeEntries(this.columnEntries);return{tableModelId:this.tableModelId,physicalName:this.physicalName,logicalName:this.logicalName,...this.schemaId!=""&&{schemaId:this.schemaId},columnModelIds:e,...this.uniqueKeysModels.length>0&&{uniqueKeysModels:this.uniqueKeysModels.map(n=>n.toJSON())},...this.tableIndexModels.length>0&&{tableIndexModels:this.tableIndexModels.map(n=>n.toJSON())},...this.description!==""&&{description:this.description},...this.checkExpression!==""&&{checkExpression:this.checkExpression},...this.characterSet!==""&&{characterSet:this.characterSet},...this.collate!==""&&{collate:this.collate},...this.definitionExpression!==""&&{definitionExpression:this.definitionExpression},...this.optionExpression!==""&&{optionExpression:this.optionExpression}}}static toObject(e){S(e,"tableModelId"),S(e,"physicalName"),S(e,"logicalName"),S(e,"columnModelIds");let n="schemaId"in e?e.schemaId:"",r=lt.deserializeEntries(e.columnModelIds),o="uniqueKeysModels"in e?j(e.uniqueKeysModels,"uniqueKeysModels",h=>ht.toObject(h)):[],i="tableIndexModels"in e?j(e.tableIndexModels,"tableIndexModels",h=>pt.toObject(h)):[],a="description"in e?e.description:"",s="checkExpression"in e?e.checkExpression:"",l="characterSet"in e?e.characterSet:"",c="collate"in e?e.collate:"",m="definitionExpression"in e?e.definitionExpression:"",d="optionExpression"in e?e.optionExpression:"";return new t({tableModelId:e.tableModelId,physicalName:e.physicalName,logicalName:e.logicalName,schemaId:n,columnEntries:r,uniqueKeysModels:o,tableIndexModels:i,description:a,checkExpression:s,characterSet:l,collate:c,definitionExpression:m,optionExpression:d})}};var Ko="[[TYPE]][]",u=class t{static{this.EMPTY=new t({id:0,name:"",description:"",baseQuery:""})}constructor({id:e,name:n,description:r,baseQuery:o,category:i="other",withPrecision:a=!1,withScale:s=!1,withUnsigned:l=!1,withAutoIncrement:c=!1,foreignColumn:m=null,defaultValueCandidates:d=[],arrayQueryTemplate:h=Ko}){this.id=e,this.name=n,this.description=r,this.baseQuery=o,this.category=i,this.withPrecision=a,this.withScale=s,this.withUnsigned=l,this.withAutoIncrement=c,this.foreignColumn=m??null,this.defaultValueCandidates=d,this.arrayQueryTemplate=h}specifiedType({precision:e="",scale:n="",isArray:r=!1,inChildRelation:o=!1}){if(this.foreignColumn&&o)return this.foreignColumn.specifiedType({precision:e,scale:n,isArray:r});if(this.baseQuery.indexOf("[[PARAM]]")<0)return this.applyArrayTemplate(this.baseQuery,r);let i=this.initTypeParam(e,n),a=this.baseQuery.replace("[[PARAM]]",i);return this.applyArrayTemplate(a,r)}applyArrayTemplate(e,n){return n===!1?e:this.arrayQueryTemplate.replace("[[TYPE]]",e)}candidateDefaultValues(e,n){return this.defaultValueCandidates.map(r=>{if(r.indexOf("[[PARAM]]")<0)return r;let o=this.initTypeParam(e,n);return r.replaceAll("[[PARAM]]",o)})}initTypeParam(e,n){return n&&this.withScale?`(${e}, ${n})`:e&&this.withPrecision?`(${e})`:""}toJSON(){return{id:this.id,name:this.name,description:this.description,baseQuery:this.baseQuery,category:this.category,...this.withPrecision&&{withPrecision:this.withPrecision},...this.withScale&&{withScale:this.withScale},...this.withUnsigned&&{withUnsigned:this.withUnsigned},...this.withAutoIncrement&&{withAutoIncrement:this.withAutoIncrement},...this.foreignColumn!=null&&{foreignColumn:this.foreignColumn.toJSON()},...this.defaultValueCandidates.length>0&&{defaultValueCandidates:this.defaultValueCandidates},...this.arrayQueryTemplate!==Ko&&{arrayQueryTemplate:this.arrayQueryTemplate}}}static toObject(e){S(e,"id"),S(e,"name"),S(e,"description"),S(e,"baseQuery");let n="category"in e?e.category:"other",r="withPrecision"in e?e.withPrecision:!1,o="withScale"in e?e.withScale:!1,i="withUnsigned"in e?e.withUnsigned:!1,a="withAutoIncrement"in e?e.withAutoIncrement:"withAuthIncrement"in e?e.withAuthIncrement:!1,s="foreignColumn"in e&&e.foreignColumn!=null?t.toObject(e.foreignColumn):null,l="defaultValueCandidates"in e?e.defaultValueCandidates:[],c="arrayQueryTemplate"in e?e.arrayQueryTemplate:Ko;return new t({id:e.id,name:e.name,description:e.description,baseQuery:e.baseQuery,category:n,withPrecision:r,withScale:o,withUnsigned:i,withAutoIncrement:a,foreignColumn:s,defaultValueCandidates:l,arrayQueryTemplate:c})}equals(e){return this.id===e.id&&this.name===e.name&&this.description===e.description&&this.baseQuery===e.baseQuery&&this.withPrecision===e.withPrecision&&this.withScale===e.withScale&&this.withUnsigned===e.withUnsigned&&this.withAutoIncrement===e.withAutoIncrement&&(this.foreignColumn===null&&e.foreignColumn===null||this.foreignColumn!==null&&e.foreignColumn!==null&&this.foreignColumn.equals(e.foreignColumn))&&this.defaultValueCandidates.length===e.defaultValueCandidates.length&&this.defaultValueCandidates.every((n,r)=>n===e.defaultValueCandidates[r])&&this.arrayQueryTemplate===e.arrayQueryTemplate}static migrateDefaultValueCandidates(e,n,r){if(e.name!==n.name||n.defaultValueCandidates.length===0)return e;if(r<20250612)return new t({...e,defaultValueCandidates:[...n.defaultValueCandidates]});if(r<20260321){let o=new Set(e.defaultValueCandidates);if(n.defaultValueCandidates.some(i=>o.has(i)===!1))return new t({...e,defaultValueCandidates:[...n.defaultValueCandidates]})}return e}};var sc=new u({id:11,name:"smallint",description:"2\u30D0\u30A4\u30C8\u7B26\u53F7\u4ED8\u304D\u6574\u6570",baseQuery:"SMALLINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),lc=new u({id:15,name:"integer",description:"4\u30D0\u30A4\u30C8\u7B26\u53F7\u4ED8\u304D\u6574\u6570",baseQuery:"INTEGER",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),cc=new u({id:17,name:"bigint",description:"8\u30D0\u30A4\u30C8\u7B26\u53F7\u4ED8\u304D\u6574\u6570",baseQuery:"BIGINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),Kh={postgres:[new u({id:1,name:"bit",description:"\u56FA\u5B9A\u9577\u30D3\u30C3\u30C8\u5217",baseQuery:"BIT",category:"bit",withPrecision:!1,withScale:!1}),new u({id:2,name:"bit (n)",description:"\u56FA\u5B9A\u9577\u30D3\u30C3\u30C8\u5217",baseQuery:"BIT[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1}),new u({id:4,name:"bit varying",description:"\u53EF\u5909\u9577\u30D3\u30C3\u30C8\u5217",baseQuery:"BIT VARYING",category:"bit",withPrecision:!1,withScale:!1}),new u({id:5,name:"bit varying (n)",description:"\u53EF\u5909\u9577\u30D3\u30C3\u30C8\u5217",baseQuery:"BIT VARYING[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1}),new u({id:6,name:"boolean",description:"\u8AD6\u7406\u5024 (\u771F/\u507D)",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1}),new u({id:367,name:"bytea",description:"\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF (\u300C\u30D0\u30A4\u30C8\u306E\u914D\u5217 (byte array)\u300D)",baseQuery:"BYTEA",category:"bit",withPrecision:!1,withScale:!1}),sc,new u({id:51,name:"smallserial",description:"\u81EA\u52D5\u5897\u52062\u30D0\u30A4\u30C8\u6574\u6570",baseQuery:"SMALLSERIAL",category:"integer",withPrecision:!1,withScale:!1,foreignColumn:sc}),lc,new u({id:55,name:"serial",description:"\u81EA\u52D5\u5897\u52064\u30D0\u30A4\u30C8\u6574\u6570",baseQuery:"SERIAL",category:"integer",withPrecision:!1,withScale:!1,foreignColumn:lc}),cc,new u({id:57,name:"bigserial",description:"\u81EA\u52D5\u5897\u52068\u30D0\u30A4\u30C8\u6574\u6570",baseQuery:"BIGSERIAL",category:"integer",withPrecision:!1,withScale:!1,foreignColumn:cc}),new u({id:31,name:"real",description:"\u5358\u7CBE\u5EA6\u6D6E\u52D5\u5C0F\u6570\u70B9 (4\u30D0\u30A4\u30C8)",baseQuery:"REAL",category:"decimal",withPrecision:!1,withScale:!1}),new u({id:33,name:"double precision",description:"\u500D\u7CBE\u5EA6\u6D6E\u52D5\u5C0F\u6570\u70B9 (8\u30D0\u30A4\u30C8)",baseQuery:"DOUBLE PRECISION",category:"decimal",withPrecision:!1,withScale:!1}),new u({id:35,name:"decimal",description:"\u7CBE\u5EA6\u306E\u9078\u629E\u53EF\u80FD\u306A\u9AD8\u7CBE\u5EA6\u6570\u5024",baseQuery:"DECIMAL",category:"decimal",withPrecision:!1,withScale:!1}),new u({id:36,name:"numeric",description:"\u7CBE\u5EA6\u306E\u9078\u629E\u53EF\u80FD\u306A\u9AD8\u7CBE\u5EA6\u6570\u5024",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1}),new u({id:45,name:"decimal (p, s)",description:"\u7CBE\u5EA6\u306E\u9078\u629E\u53EF\u80FD\u306A\u9AD8\u7CBE\u5EA6\u6570\u5024",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0}),new u({id:46,name:"numeric (p, s)",description:"\u7CBE\u5EA6\u306E\u9078\u629E\u53EF\u80FD\u306A\u9AD8\u7CBE\u5EA6\u6570\u5024",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0}),new u({id:101,name:"date",description:"\u66A6\u306E\u65E5\u4ED8 (\u5E74\u6708\u65E5)",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:131,name:"time without time zone",description:"\u6642\u523B (\u6642\u9593\u5E2F\u306A\u3057)",baseQuery:"TIME WITHOUT TIME ZONE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:132,name:"time with time zone",description:"\u6642\u9593\u5E2F\u4ED8\u304D\u6642\u523B",baseQuery:"TIME WITH TIME ZONE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:141,name:"time (p) without time zone",description:"\u6642\u523B (\u6642\u9593\u5E2F\u306A\u3057)",baseQuery:"TIME[[PARAM]] WITHOUT TIME ZONE",category:"timestamp",withPrecision:!0,withScale:!1}),new u({id:142,name:"time (p) with time zone",description:"\u6642\u9593\u5E2F\u4ED8\u304D\u6642\u523B",baseQuery:"TIME[[PARAM]] WITH TIME ZONE",category:"timestamp",withPrecision:!0,withScale:!1}),new u({id:111,name:"timestamp without time zone",description:"\u65E5\u4ED8\u3068\u6642\u523B (\u6642\u9593\u5E2F\u306A\u3057)",baseQuery:"TIMESTAMP WITHOUT TIME ZONE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:112,name:"timestamp with time zone",description:"\u6642\u9593\u5E2F\u4ED8\u304D\u65E5\u4ED8\u3068\u6642\u523B",baseQuery:"TIMESTAMP WITH TIME ZONE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:121,name:"timestamp (p) without time zone",description:"\u65E5\u4ED8\u3068\u6642\u523B (\u6642\u9593\u5E2F\u306A\u3057)",baseQuery:"TIMESTAMP[[PARAM]] WITHOUT TIME ZONE",category:"timestamp",withPrecision:!0,withScale:!1}),new u({id:122,name:"timestamp (p) with time zone",description:"\u6642\u9593\u5E2F\u4ED8\u304D\u65E5\u4ED8\u3068\u6642\u523B",baseQuery:"TIMESTAMP[[PARAM]] WITH TIME ZONE",category:"timestamp",withPrecision:!0,withScale:!1}),new u({id:301,name:"char",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1}),new u({id:302,name:"varchar",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217",baseQuery:"VARCHAR",category:"text",withPrecision:!1,withScale:!1}),new u({id:311,name:"char (n)",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1}),new u({id:312,name:"varchar (n)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1}),new u({id:325,name:"text",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1}),new u({id:411,name:"uuid",description:"\u6C4E\u7528\u4E00\u610F\u8B58\u5225\u5B50",baseQuery:"UUID",category:"other",withPrecision:!1,withScale:!1}),new u({id:421,name:"json",description:"\u30C6\u30AD\u30B9\u30C8\u306EJSON\u30C7\u30FC\u30BF",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1}),new u({id:422,name:"jsonb",description:"\u30D0\u30A4\u30CA\u30EA JSON \u30C7\u30FC\u30BF, \u5C55\u958B\u578B",baseQuery:"JSONB",category:"other",withPrecision:!1,withScale:!1}),new u({id:431,name:"xml",description:"XML\u30C7\u30FC\u30BF",baseQuery:"XML",category:"other",withPrecision:!1,withScale:!1}),new u({id:441,name:"money",description:"\u8CA8\u5E63\u91D1\u984D",baseQuery:"MONEY",category:"other",withPrecision:!1,withScale:!1}),new u({id:451,name:"tsquery",description:"\u30C6\u30AD\u30B9\u30C8\u691C\u7D22\u554F\u3044\u5408\u308F\u305B",baseQuery:"TSQUERY",category:"other",withPrecision:!1,withScale:!1}),new u({id:453,name:"tsvector",description:"\u30C6\u30AD\u30B9\u30C8\u691C\u7D22\u6587\u66F8",baseQuery:"TSVECTOR",category:"other",withPrecision:!1,withScale:!1}),new u({id:1011,name:"point",description:"\u5E73\u9762\u4E0A\u306E\u5E7E\u4F55\u5B66\u7684\u70B9",baseQuery:"POINT",category:"other",withPrecision:!1,withScale:!1}),new u({id:1021,name:"line",description:"\u5E73\u9762\u4E0A\u306E\u7121\u9650\u76F4\u7DDA",baseQuery:"LINE",category:"other",withPrecision:!1,withScale:!1}),new u({id:1022,name:"lseg",description:"\u5E73\u9762\u4E0A\u306E\u7DDA\u5206",baseQuery:"LSEG",category:"other",withPrecision:!1,withScale:!1}),new u({id:1031,name:"box",description:"\u5E73\u9762\u4E0A\u306E\u77E9\u5F62",baseQuery:"BOX",category:"other",withPrecision:!1,withScale:!1}),new u({id:1032,name:"circle",description:"\u5E73\u9762\u4E0A\u306E\u5186",baseQuery:"CIRCLE",category:"other",withPrecision:!1,withScale:!1}),new u({id:1041,name:"path",description:"\u5E73\u9762\u4E0A\u306E\u5E7E\u4F55\u5B66\u7684\u7D4C\u8DEF",baseQuery:"PATH",category:"other",withPrecision:!1,withScale:!1}),new u({id:1042,name:"polygon",description:"\u5E73\u9762\u4E0A\u306E\u9589\u3058\u305F\u5E7E\u4F55\u5B66\u7684\u7D4C\u8DEF",baseQuery:"POLYGON",category:"other",withPrecision:!1,withScale:!1}),new u({id:1111,name:"cidr",description:"IPv4\u3082\u3057\u304F\u306FIPv6\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30A2\u30C9\u30EC\u30B9",baseQuery:"CIDR",category:"other",withPrecision:!1,withScale:!1}),new u({id:1112,name:"inet",description:"IPv4\u3082\u3057\u304F\u306FIPv6\u30DB\u30B9\u30C8\u30A2\u30C9\u30EC\u30B9",baseQuery:"INET",category:"other",withPrecision:!1,withScale:!1}),new u({id:1121,name:"macaddr",description:"MAC (Media Access Control)\u30A2\u30C9\u30EC\u30B9",baseQuery:"MACADDR",category:"other",withPrecision:!1,withScale:!1}),new u({id:1122,name:"macaddr8",description:"MAC (Media Access Control) \u30A2\u30C9\u30EC\u30B9 (EUI-64 \u5F62\u5F0F)",baseQuery:"MACADDR8",category:"other",withPrecision:!1,withScale:!1}),new u({id:9101,name:"pg_lsn",description:"PostgreSQL\u30ED\u30B0\u30B7\u30FC\u30B1\u30F3\u30B9\u756A\u53F7",baseQuery:"PG_LSN",category:"other",withPrecision:!1,withScale:!1}),new u({id:9102,name:"pg_snapshot",description:"\u30E6\u30FC\u30B6\u30EC\u30D9\u30EB\u306E\u30C8\u30E9\u30F3\u30B6\u30AF\u30B7\u30E7\u30F3ID\u30B9\u30CA\u30C3\u30D7\u30B7\u30E7\u30C3\u30C8",baseQuery:"PG_SNAPSHOT",category:"other",withPrecision:!1,withScale:!1}),new u({id:9103,name:"oid",description:"\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u8B58\u5225\u5B50\u30C7\u30FC\u30BF",baseQuery:"OID",category:"other",withPrecision:!1,withScale:!1}),u.EMPTY],mysql:[new u({id:1,name:"bit",description:"\u30D3\u30C3\u30C8\u5024\u578B",baseQuery:"BIT",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2,name:"bit (m)",description:"\u30D3\u30C3\u30C8\u5024\u578B",baseQuery:"BIT[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:6,name:"boolean",description:"TINYINT(1) \u306E\u30B7\u30CE\u30CB\u30E0",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:10,name:"tinyint",description:"\u975E\u5E38\u306B\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -128 \u304B\u3089 127 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 255 \u3067\u3059\u3002",baseQuery:"TINYINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:11,name:"smallint",description:"\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -32768 \u304B\u3089 32767 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 65535 \u3067\u3059\u3002",baseQuery:"SMALLINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:13,name:"mediumint",description:"\u4E2D\u9593\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -8388608 \u304B\u3089 8388607 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 16777215 \u3067\u3059\u3002",baseQuery:"MEDIUMINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:15,name:"int",description:"\u666E\u901A\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -2147483648 \u304B\u3089 2147483647 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 4294967295 \u3067\u3059\u3002",baseQuery:"INT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:17,name:"bigint",description:"\u5927\u304D\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -9223372036854775808 \u304B\u3089 9223372036854775807 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 18446744073709551615 \u3067\u3059\u3002",baseQuery:"BIGINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:20,name:"tinyint (m)",description:"\u975E\u5E38\u306B\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -128 \u304B\u3089 127 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 255 \u3067\u3059\u3002",baseQuery:"TINYINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!1}),new u({id:21,name:"smallint (m)",description:"\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -32768 \u304B\u3089 32767 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 65535 \u3067\u3059\u3002",baseQuery:"SMALLINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:23,name:"mediumint (m)",description:"\u4E2D\u9593\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -8388608 \u304B\u3089 8388607 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 16777215 \u3067\u3059\u3002",baseQuery:"MEDIUMINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:25,name:"int (m)",description:"\u666E\u901A\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -2147483648 \u304B\u3089 2147483647 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 4294967295 \u3067\u3059\u3002",baseQuery:"INT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:27,name:"bigint (m)",description:"\u5927\u304D\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -9223372036854775808 \u304B\u3089 9223372036854775807 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 18446744073709551615 \u3067\u3059\u3002",baseQuery:"BIGINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:31,name:"float",description:"\u5C0F\u3055\u3044 (\u5358\u7CBE\u5EA6) \u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u308B\u5024\u306F\u3001-3.402823466E+38 \u304B\u3089 -1.175494351E-38\u30010\u3001\u304A\u3088\u3073 1.175494351E-38 \u304B\u3089 3.402823466E+38 \u3067\u3059\u3002",baseQuery:"FLOAT",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:33,name:"double",description:"\u666E\u901A\u30B5\u30A4\u30BA (\u500D\u7CBE\u5EA6) \u306E\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u5024\u306F\u3001-1.7976931348623157E+308 \u304B\u3089 -2.2250738585072014E-308\u30010\u3001\u304A\u3088\u3073 2.2250738585072014E-308 \u304B\u3089 1.7976931348623157E+308 \u3067\u3059\u3002",baseQuery:"DOUBLE",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:35,name:"decimal",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 \u6841\u657010 (\u7CBE\u5EA6) \u3067\u3001\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u65700\u3067\u3059\u3002",baseQuery:"DECIMAL",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:36,name:"numeric",description:"DECIMAL \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059\u3002\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 \u6841\u657010 (\u7CBE\u5EA6) \u3067\u3001\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u65700\u3067\u3059\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:41,name:"float (m, d)",description:"\u5C0F\u3055\u3044 (\u5358\u7CBE\u5EA6) \u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u308B\u5024\u306F\u3001-3.402823466E+38 \u304B\u3089 -1.175494351E-38\u30010\u3001\u304A\u3088\u3073 1.175494351E-38 \u304B\u3089 3.402823466E+38 \u3067\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:42,name:"float (p)",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3067\u3059\u3002p \u306F\u7CBE\u5EA6\u3092\u30D3\u30C3\u30C8\u3067\u8868\u73FE\u3057\u307E\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:43,name:"double (m, d)",description:"\u666E\u901A\u30B5\u30A4\u30BA (\u500D\u7CBE\u5EA6) \u306E\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u5024\u306F\u3001-1.7976931348623157E+308 \u304B\u3089 -2.2250738585072014E-308\u30010\u3001\u304A\u3088\u3073 2.2250738585072014E-308 \u304B\u3089 1.7976931348623157E+308 \u3067\u3059\u3002",baseQuery:"DOUBLE[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:45,name:"decimal (m, d)",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 M \u306F\u6841\u6570\u306E\u5408\u8A08 (\u7CBE\u5EA6) \u3067\u3001D \u306F\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570 (\u30B9\u30B1\u30FC\u30EB) \u3067\u3059\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:46,name:"numeric (m, d)",description:"DECIMAL \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059\u3002\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 M \u306F\u6841\u6570\u306E\u5408\u8A08 (\u7CBE\u5EA6) \u3067\u3001D \u306F\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570 (\u30B9\u30B1\u30FC\u30EB) \u3067\u3059\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:'\u65E5\u4ED8\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01" \u304B\u3089 "9999-12-31" \u3067\u3059\u3002',baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_DATE)"]}),new u({id:131,name:"time",description:'\u6642\u9593\u3067\u3059\u3002 \u7BC4\u56F2\u306F\u3001"-838:59:59.000000" \u304B\u3089 "838:59:59.000000" \u3067\u3059\u3002',baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_TIME)"]}),new u({id:141,name:"time (p)",description:'\u6642\u9593\u3067\u3059\u3002 \u7BC4\u56F2\u306F\u3001"-838:59:59.000000" \u304B\u3089 "838:59:59.000000" \u3067\u3059\u3002',baseQuery:"TIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_TIME)"]}),new u({id:112,name:"datetime",description:'\u65E5\u4ED8\u3068\u6642\u9593\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01 00:00:00.000000" \u304B\u3089 "9999-12-31 23:59:59.999999" \u3067\u3059\u3002',baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP","CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"]}),new u({id:115,name:"timestamp",description:'\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3067\u3059\u3002 \u7BC4\u56F2\u306F "1970-01-01 00:00:01.000000" UTC \u304B\u3089 "2038-01-19 03:14:07.999999" UTC \u3067\u3059\u3002',baseQuery:"TIMESTAMP",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP","CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"]}),new u({id:122,name:"datetime (p)",description:'\u65E5\u4ED8\u3068\u6642\u9593\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01 00:00:00.000000" \u304B\u3089 "9999-12-31 23:59:59.999999" \u3067\u3059\u3002',baseQuery:"DATETIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP[[PARAM]]","CURRENT_TIMESTAMP[[PARAM]] ON UPDATE CURRENT_TIMESTAMP[[PARAM]]"]}),new u({id:125,name:"timestamp (p)",description:'\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3067\u3059\u3002 \u7BC4\u56F2\u306F "1970-01-01 00:00:01.000000" UTC \u304B\u3089 "2038-01-19 03:14:07.999999" UTC \u3067\u3059\u3002',baseQuery:"TIMESTAMP[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP[[PARAM]]","CURRENT_TIMESTAMP[[PARAM]] ON UPDATE CURRENT_TIMESTAMP[[PARAM]]"]}),new u({id:151,name:"year",description:"4 \u6841\u5F62\u5F0F\u306E\u5E74\u3002",baseQuery:"YEAR",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:301,name:"char",description:"\u683C\u7D0D\u6642\u306B\u5FC5\u305A\u3001\u6307\u5B9A\u3055\u308C\u305F\u9577\u3055\u306B\u306A\u308B\u3088\u3046\u306B\u53F3\u5074\u304C\u30B9\u30DA\u30FC\u30B9\u3067\u57CB\u3081\u3089\u308C\u308B\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:311,name:"char (m)",description:"\u683C\u7D0D\u6642\u306B\u5FC5\u305A\u3001\u6307\u5B9A\u3055\u308C\u305F\u9577\u3055\u306B\u306A\u308B\u3088\u3046\u306B\u53F3\u5074\u304C\u30B9\u30DA\u30FC\u30B9\u3067\u57CB\u3081\u3089\u308C\u308B\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (m)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:321,name:"tinytext",description:"\u6700\u5927\u9577\u304C 255 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TINYTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:322,name:"text",description:"\u6700\u5927\u9577\u304C 65,535 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:323,name:"text (m)",description:"\u6700\u5927\u9577\u304C 65,535 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TEXT[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:324,name:"mediumtext",description:"\u6700\u5927\u9577\u304C 16,777,215 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"MEDIUMTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:325,name:"longtext",description:"\u6700\u5927\u9577\u304C 4G \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"LONGTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:3,name:"binary (m)",description:"\u30D0\u30A4\u30CA\u30EA\u30D0\u30A4\u30C8\u6587\u5B57\u5217\u3092\u683C\u7D0D\u3057\u307E\u3059\u3002",baseQuery:"BINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:5,name:"varbinary (m)",description:"\u30D0\u30A4\u30CA\u30EA\u30D0\u30A4\u30C8\u6587\u5B57\u5217\u3092\u683C\u7D0D\u3057\u307E\u3059\u3002",baseQuery:"VARBINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:361,name:"tinyblob",description:"\u6700\u5927\u9577\u304C 255 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"TINYBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:363,name:"blob",description:"\u6700\u5927\u9577\u304C 65,535 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"BLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:364,name:"blob (m)",description:"\u6700\u5927\u9577\u304C 65,535 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"BLOB[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:365,name:"mediumblob",description:"\u6700\u5927\u9577\u304C 16,777,215 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"MEDIUMBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:367,name:"longblob",description:"\u6700\u5927\u9577\u304C 4G \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"LONGBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:422,name:"json",description:"\u6587\u66F8\u306E\u578B\u5F0F\u3067\u3042\u308BJSON\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2001,name:"geometry",description:"\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002\u70B9\u3001\u7DDA\u3001\u591A\u89D2\u5F62\u3001\u304A\u3088\u3073\u305D\u306E\u4ED6\u306E\u5F62\u72B6\u3092\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002",baseQuery:"GEOMETRY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2011,name:"point",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u7A7A\u9593\u4E0A\u306E\u5358\u4E00\u306E\u70B9\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"POINT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2012,name:"linestring",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u7A7A\u9593\u4E0A\u306E\u8907\u6570\u306E\u70B9\u3092\u7D50\u3076\u76F4\u7DDA\u30BB\u30B0\u30E1\u30F3\u30C8\u306E\u9023\u7D9A\u3057\u305F\u30BB\u30C3\u30C8\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"LINESTRING",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2013,name:"polygon",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u5E73\u9762\u4E0A\u306E\u5358\u4E00\u306E\u9818\u57DF\u3092\u8868\u3059\u9589\u3058\u305F\u30EB\u30FC\u30D7\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"POLYGON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2021,name:"multipoint",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u70B9\u3092\u8868\u3059\u8907\u6570\u306EPOINT\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTIPOINT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2022,name:"multilinestring",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u7DDA\u5206\u3092\u8868\u3059\u8907\u6570\u306ELINESTRING\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTILINESTRING",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2023,name:"multipolygon",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u30DD\u30EA\u30B4\u30F3\u3092\u8868\u3059\u8907\u6570\u306EPOLYGON\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTIPOLYGON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2031,name:"geometrycollection",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306EGEOMETRY\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"GEOMETRYCOLLECTION",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2101,name:"enum",description:"\u6587\u5B57\u5217\u306E\u30EA\u30B9\u30C8\u306E\u4E2D\u304B\u30891\u3064\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"ENUM",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2102,name:"set",description:"ENUM\u306E\u62E1\u5F35\u7248\u3067\u3042\u308A\u3001\u6587\u5B57\u5217\u306E\u30EA\u30B9\u30C8\u304B\u3089\u8907\u6570\u306E\u9078\u629E\u80A2\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"SET",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),u.EMPTY],ms_sqlserver:[new u({id:1,name:"bit",description:"1\u30010\u3001\u307E\u305F\u306FNULL\u306E\u5024\u3092\u53D7\u3051\u53D6\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u6574\u6570\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"BIT",category:"bit",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:3,name:"binary (n)",description:"n \u30D0\u30A4\u30C8\u306E\u56FA\u5B9A\u9577\u306E binary \u30C7\u30FC\u30BF\u3067\u3059\u3002\u3053\u3053\u3067\u3001n \u306F 1 \u304B\u3089 8,000 \u306E\u5024\u306B\u306A\u308A\u307E\u3059\u3002",baseQuery:"BINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:4,name:"binary",description:"\u56FA\u5B9A\u9577\u306E binary \u30C7\u30FC\u30BF\u3067\u3059\u3002",baseQuery:"BINARY",category:"bit",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:5,name:"varbinary (n)",description:"\u53EF\u5909\u9577 binary \u30C7\u30FC\u30BF\u3002 n \u306B\u306F 1 \uFF5E 8,000 \u306E\u5024\u3092\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002",baseQuery:"VARBINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:9,name:"varbinary (max)",description:"\u53EF\u5909\u9577 binary \u30C7\u30FC\u30BF\u3002",baseQuery:"VARBINARY(MAX)",category:"bit",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:10,name:"tinyint",description:"\u6574\u6570\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5B9F\u6570\u30C7\u30FC\u30BF\u578B\u3067\u3059\u30020 to 255 (2^0-1 to 2^8-1)",baseQuery:"TINYINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:11,name:"smallint",description:"\u6574\u6570\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5B9F\u6570\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002-32,768 to 32,767 (-2^15 to 2^15-1)",baseQuery:"SMALLINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:15,name:"int",description:"\u6574\u6570\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5B9F\u6570\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002-2,147,483,648 to 2,147,483,647 (-2^31 to 2^31-1)",baseQuery:"INT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:17,name:"bigint",description:"\u6574\u6570\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5B9F\u6570\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (-2^63 to 2^63-1)",baseQuery:"BIGINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:31,name:"real",description:"real \u306E ISO \u30B7\u30CE\u30CB\u30E0\u306F\u3001 float (24) \u3067\u3059\u3002",baseQuery:"REAL",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:33,name:"float",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u30C7\u30FC\u30BF\u3067\u4F7F\u7528\u3059\u308B\u6982\u6570\u578B\u3067\u3059\u3002",baseQuery:"FLOAT",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:35,name:"decimal",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"DECIMAL",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:36,name:"numeric",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002decimal \u3068 numeric \u306F\u30B7\u30CE\u30CB\u30E0\u3067\u3042\u308A\u3001\u540C\u3058\u610F\u5473\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:42,name:"float (n)",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u30C7\u30FC\u30BF\u3067\u4F7F\u7528\u3059\u308B\u6982\u6570\u578B\u3067\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:45,name:"decimal (m, s)",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withAutoIncrement:!1}),new u({id:46,name:"numeric (m, s)",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002decimal \u3068 numeric \u306F\u30B7\u30CE\u30CB\u30E0\u3067\u3042\u308A\u3001\u540C\u3058\u610F\u5473\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withAutoIncrement:!1}),new u({id:47,name:"decimal (m)",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withAutoIncrement:!0}),new u({id:48,name:"numeric (m)",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002decimal \u3068 numeric \u306F\u30B7\u30CE\u30CB\u30E0\u3067\u3042\u308A\u3001\u540C\u3058\u610F\u5473\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withAutoIncrement:!0}),new u({id:65,name:"smallmoney",description:"\u91D1\u984D\u5024\u307E\u305F\u306F\u901A\u8CA8\u5024\u3092\u8868\u3059\u30C7\u30FC\u30BF\u578B\u3002-214,748.3648 to 214,748.3647",baseQuery:"SMALLMONEY",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:67,name:"money",description:"\u91D1\u984D\u5024\u307E\u305F\u306F\u901A\u8CA8\u5024\u3092\u8868\u3059\u30C7\u30FC\u30BF\u578B\u3002-922,337,203,685,477.5808 to 922,337,203,685,477.5807",baseQuery:"MONEY",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:"\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:111,name:"datetime2",description:"24 \u6642\u9593\u5F62\u5F0F\u306E\u6642\u523B\u3068\u7D44\u307F\u5408\u308F\u305B\u305F\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002",baseQuery:"DATETIME2",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["SYSDATETIME()","SYSUTCDATETIME()"]}),new u({id:112,name:"datetimeoffset",description:"datetime2 \u306A\u3069\u306E 24 \u6642\u9593\u5236\u306B\u57FA\u3065\u3044\u3066 1 \u65E5\u306E\u6642\u523B\u3068\u7D44\u307F\u5408\u308F\u3055\u308C\u308B\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u3001\u5354\u5B9A\u4E16\u754C\u6642 (UTC) \u306B\u57FA\u3065\u3044\u3066\u30BF\u30A4\u30E0 \u30BE\u30FC\u30F3\u8A8D\u8B58\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002",baseQuery:"DATETIMEOFFSET",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["SYSDATETIMEOFFSET()"]}),new u({id:121,name:"datetime2 (p)",description:"24 \u6642\u9593\u5F62\u5F0F\u306E\u6642\u523B\u3068\u7D44\u307F\u5408\u308F\u305B\u305F\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002",baseQuery:"DATETIME2[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["SYSDATETIME()","SYSUTCDATETIME()"]}),new u({id:122,name:"datetimeoffset (p)",description:"datetime2 \u306A\u3069\u306E 24 \u6642\u9593\u5236\u306B\u57FA\u3065\u3044\u3066 1 \u65E5\u306E\u6642\u523B\u3068\u7D44\u307F\u5408\u308F\u3055\u308C\u308B\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u3001\u5354\u5B9A\u4E16\u754C\u6642 (UTC) \u306B\u57FA\u3065\u3044\u3066\u30BF\u30A4\u30E0 \u30BE\u30FC\u30F3\u8A8D\u8B58\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002",baseQuery:"DATETIMEOFFSET[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["SYSDATETIMEOFFSET()"]}),new u({id:131,name:"time",description:"1 \u65E5\u306E\u6642\u523B\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002 \u6642\u523B\u306F 24 \u6642\u9593\u5F62\u5F0F\u3067\u3001\u30BF\u30A4\u30E0 \u30BE\u30FC\u30F3\u306F\u8A8D\u8B58\u3055\u308C\u307E\u305B\u3093\u3002",baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:141,name:"time (s)",description:"",baseQuery:"TIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:191,name:"smalldatetime (deprecated)",description:"(deprecated)",baseQuery:"SMALLDATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["GETDATE()","GETUTCDATE()"]}),new u({id:192,name:"datetime (deprecated)",description:"(deprecated)",baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["GETDATE()","GETUTCDATE()"]}),new u({id:301,name:"char",description:"\u56FA\u5B9A\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:302,name:"varchar",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"VARCHAR",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:306,name:"nchar",description:"\u56FA\u5B9A\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002",baseQuery:"NCHAR",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:307,name:"nvarchar",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002 ",baseQuery:"NVARCHAR",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:311,name:"char (n)",description:"\u56FA\u5B9A\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (n)",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:316,name:"nchar (n)",description:"\u56FA\u5B9A\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002",baseQuery:"NCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:317,name:"nvarchar (n)",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002 ",baseQuery:"NVARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:325,name:"varchar (max)",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"VARCHAR(MAX)",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:326,name:"nvarchar (max)",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002 ",baseQuery:"NVARCHAR(MAX)",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:395,name:"text (deprecated)",description:"(deprecated)",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:396,name:"ntext (deprecated)",description:"(deprecated)",baseQuery:"NTEXT",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:397,name:"image (deprecated)",description:"(deprecated)",baseQuery:"IMAGE",category:"bit",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:422,name:"json",description:"The native json data type that stores JSON documents in a native binary format.",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:431,name:"xml",description:"XML \u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"XML",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:453,name:"vector",description:"vector \u30C7\u30FC\u30BF\u578B\u306F\u3001\u985E\u4F3C\u6027\u691C\u7D22\u3084\u6A5F\u68B0\u5B66\u7FD2\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306A\u3069\u306E\u64CD\u4F5C\u7528\u306B\u6700\u9069\u5316\u3055\u308C\u305F\u30D9\u30AF\u30C8\u30EB \u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u3088\u3046\u306B\u8A2D\u8A08\u3055\u308C\u3066\u3044\u307E\u3059\u3002",baseQuery:"VECTOR",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:2001,name:"geometry",description:"\u5E73\u9762\u7A7A\u9593\u30C7\u30FC\u30BF\u578B\u306E geometry \u306F\u3001SQL Server \u3067\u306F\u5171\u901A\u8A00\u8A9E\u30E9\u30F3\u30BF\u30A4\u30E0 (CLR) \u306E\u30C7\u30FC\u30BF\u578B\u3068\u3057\u3066\u5B9F\u88C5\u3055\u308C\u3066\u3044\u307E\u3059\u3002 \u3053\u306E\u578B\u306F\u3001\u30E6\u30FC\u30AF\u30EA\u30C3\u30C9 (\u5E73\u9762) \u5EA7\u6A19\u7CFB\u306E\u30C7\u30FC\u30BF\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"GEOMETRY",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:2002,name:"geography",description:"\u5730\u7406\u7A7A\u9593\u30C7\u30FC\u30BF\u578B\u306E geography \u306F\u3001SQL Server \u3067\u306F .NET \u5171\u901A\u8A00\u8A9E\u30E9\u30F3\u30BF\u30A4\u30E0 (CLR) \u306E\u30C7\u30FC\u30BF\u578B\u3068\u3057\u3066\u5B9F\u88C5\u3055\u308C\u3066\u3044\u307E\u3059\u3002 \u3053\u306E\u578B\u306F\u3001\u7403\u4F53\u5730\u7403\u5EA7\u6A19\u7CFB\u306E\u30C7\u30FC\u30BF\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"GEOGRAPHY",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:2061,name:"hierarchyid",description:"hierarchyid \u30C7\u30FC\u30BF\u578B\u306F\u53EF\u5909\u9577\u306E\u30B7\u30B9\u30C6\u30E0 \u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002 hierarchyid \u306F\u3001\u968E\u5C64\u5185\u306E\u4F4D\u7F6E\u3092\u8868\u3059\u305F\u3081\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002",baseQuery:"HIERARCHYID",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:9301,name:"uniqueidentifier",description:"16 \u30D0\u30A4\u30C8\u306E GUID \u3067\u3059\u3002",baseQuery:"UNIQUEIDENTIFIER",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:9302,name:"sql_variant",description:"SQL Server \u3067\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u5404\u7A2E\u30C7\u30FC\u30BF\u578B\u306E\u5024\u304C\u683C\u7D0D\u3055\u308C\u307E\u3059\u3002",baseQuery:"SQL_VARIANT",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),u.EMPTY],mariadb:[new u({id:1,name:"bit",description:"\u30D3\u30C3\u30C8\u5024\u578B",baseQuery:"BIT",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2,name:"bit (m)",description:"\u30D3\u30C3\u30C8\u5024\u578B",baseQuery:"BIT[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:6,name:"boolean",description:"TINYINT(1) \u306E\u30B7\u30CE\u30CB\u30E0",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:10,name:"tinyint",description:"\u975E\u5E38\u306B\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -128 \u304B\u3089 127 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 255 \u3067\u3059\u3002",baseQuery:"TINYINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:11,name:"smallint",description:"\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -32768 \u304B\u3089 32767 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 65535 \u3067\u3059\u3002",baseQuery:"SMALLINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:13,name:"mediumint",description:"\u4E2D\u9593\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -8388608 \u304B\u3089 8388607 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 16777215 \u3067\u3059\u3002",baseQuery:"MEDIUMINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:15,name:"int",description:"\u666E\u901A\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -2147483648 \u304B\u3089 2147483647 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 4294967295 \u3067\u3059\u3002",baseQuery:"INT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:17,name:"bigint",description:"\u5927\u304D\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -9223372036854775808 \u304B\u3089 9223372036854775807 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 18446744073709551615 \u3067\u3059\u3002",baseQuery:"BIGINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:20,name:"tinyint (m)",description:"\u975E\u5E38\u306B\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -128 \u304B\u3089 127 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 255 \u3067\u3059\u3002",baseQuery:"TINYINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!1}),new u({id:21,name:"smallint (m)",description:"\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -32768 \u304B\u3089 32767 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 65535 \u3067\u3059\u3002",baseQuery:"SMALLINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:23,name:"mediumint (m)",description:"\u4E2D\u9593\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -8388608 \u304B\u3089 8388607 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 16777215 \u3067\u3059\u3002",baseQuery:"MEDIUMINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:25,name:"int (m)",description:"\u666E\u901A\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -2147483648 \u304B\u3089 2147483647 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 4294967295 \u3067\u3059\u3002",baseQuery:"INT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:27,name:"bigint (m)",description:"\u5927\u304D\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -9223372036854775808 \u304B\u3089 9223372036854775807 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 18446744073709551615 \u3067\u3059\u3002",baseQuery:"BIGINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:31,name:"float",description:"\u5C0F\u3055\u3044 (\u5358\u7CBE\u5EA6) \u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u308B\u5024\u306F\u3001-3.402823466E+38 \u304B\u3089 -1.175494351E-38\u30010\u3001\u304A\u3088\u3073 1.175494351E-38 \u304B\u3089 3.402823466E+38 \u3067\u3059\u3002",baseQuery:"FLOAT",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:33,name:"double",description:"\u666E\u901A\u30B5\u30A4\u30BA (\u500D\u7CBE\u5EA6) \u306E\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u5024\u306F\u3001-1.7976931348623157E+308 \u304B\u3089 -2.2250738585072014E-308\u30010\u3001\u304A\u3088\u3073 2.2250738585072014E-308 \u304B\u3089 1.7976931348623157E+308 \u3067\u3059\u3002",baseQuery:"DOUBLE",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:35,name:"decimal",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 \u6841\u657010 (\u7CBE\u5EA6) \u3067\u3001\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u65700\u3067\u3059\u3002",baseQuery:"DECIMAL",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:36,name:"numeric",description:"DECIMAL \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059\u3002\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 \u6841\u657010 (\u7CBE\u5EA6) \u3067\u3001\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u65700\u3067\u3059\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:41,name:"float (m, d)",description:"\u5C0F\u3055\u3044 (\u5358\u7CBE\u5EA6) \u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u308B\u5024\u306F\u3001-3.402823466E+38 \u304B\u3089 -1.175494351E-38\u30010\u3001\u304A\u3088\u3073 1.175494351E-38 \u304B\u3089 3.402823466E+38 \u3067\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:42,name:"float (p)",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3067\u3059\u3002p \u306F\u7CBE\u5EA6\u3092\u30D3\u30C3\u30C8\u3067\u8868\u73FE\u3057\u307E\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:43,name:"double (m, d)",description:"\u666E\u901A\u30B5\u30A4\u30BA (\u500D\u7CBE\u5EA6) \u306E\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u5024\u306F\u3001-1.7976931348623157E+308 \u304B\u3089 -2.2250738585072014E-308\u30010\u3001\u304A\u3088\u3073 2.2250738585072014E-308 \u304B\u3089 1.7976931348623157E+308 \u3067\u3059\u3002",baseQuery:"DOUBLE[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:45,name:"decimal (m, d)",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 M \u306F\u6841\u6570\u306E\u5408\u8A08 (\u7CBE\u5EA6) \u3067\u3001D \u306F\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570 (\u30B9\u30B1\u30FC\u30EB) \u3067\u3059\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:46,name:"numeric (m, d)",description:"DECIMAL \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059\u3002\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 M \u306F\u6841\u6570\u306E\u5408\u8A08 (\u7CBE\u5EA6) \u3067\u3001D \u306F\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570 (\u30B9\u30B1\u30FC\u30EB) \u3067\u3059\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:'\u65E5\u4ED8\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01" \u304B\u3089 "9999-12-31" \u3067\u3059\u3002',baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_DATE)"]}),new u({id:131,name:"time",description:'\u6642\u9593\u3067\u3059\u3002 \u7BC4\u56F2\u306F\u3001"-838:59:59.000000" \u304B\u3089 "838:59:59.000000" \u3067\u3059\u3002',baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_TIME)"]}),new u({id:141,name:"time (p)",description:'\u6642\u9593\u3067\u3059\u3002 \u7BC4\u56F2\u306F\u3001"-838:59:59.000000" \u304B\u3089 "838:59:59.000000" \u3067\u3059\u3002',baseQuery:"TIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_TIME)"]}),new u({id:112,name:"datetime",description:'\u65E5\u4ED8\u3068\u6642\u9593\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01 00:00:00.000000" \u304B\u3089 "9999-12-31 23:59:59.999999" \u3067\u3059\u3002',baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP","CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"]}),new u({id:115,name:"timestamp",description:'\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3067\u3059\u3002 \u7BC4\u56F2\u306F "1970-01-01 00:00:01.000000" UTC \u304B\u3089 "2038-01-19 03:14:07.999999" UTC \u3067\u3059\u3002',baseQuery:"TIMESTAMP",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP","CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"]}),new u({id:122,name:"datetime (p)",description:'\u65E5\u4ED8\u3068\u6642\u9593\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01 00:00:00.000000" \u304B\u3089 "9999-12-31 23:59:59.999999" \u3067\u3059\u3002',baseQuery:"DATETIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP[[PARAM]]","CURRENT_TIMESTAMP[[PARAM]] ON UPDATE CURRENT_TIMESTAMP[[PARAM]]"]}),new u({id:125,name:"timestamp (p)",description:'\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3067\u3059\u3002 \u7BC4\u56F2\u306F "1970-01-01 00:00:01.000000" UTC \u304B\u3089 "2038-01-19 03:14:07.999999" UTC \u3067\u3059\u3002',baseQuery:"TIMESTAMP[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP[[PARAM]]","CURRENT_TIMESTAMP[[PARAM]] ON UPDATE CURRENT_TIMESTAMP[[PARAM]]"]}),new u({id:151,name:"year",description:"4 \u6841\u5F62\u5F0F\u306E\u5E74\u3002",baseQuery:"YEAR",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:301,name:"char",description:"\u683C\u7D0D\u6642\u306B\u5FC5\u305A\u3001\u6307\u5B9A\u3055\u308C\u305F\u9577\u3055\u306B\u306A\u308B\u3088\u3046\u306B\u53F3\u5074\u304C\u30B9\u30DA\u30FC\u30B9\u3067\u57CB\u3081\u3089\u308C\u308B\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:311,name:"char (m)",description:"\u683C\u7D0D\u6642\u306B\u5FC5\u305A\u3001\u6307\u5B9A\u3055\u308C\u305F\u9577\u3055\u306B\u306A\u308B\u3088\u3046\u306B\u53F3\u5074\u304C\u30B9\u30DA\u30FC\u30B9\u3067\u57CB\u3081\u3089\u308C\u308B\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (m)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:321,name:"tinytext",description:"\u6700\u5927\u9577\u304C 255 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TINYTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:322,name:"text",description:"\u6700\u5927\u9577\u304C 65,535 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:323,name:"text (m)",description:"\u6700\u5927\u9577\u304C 65,535 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TEXT[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:324,name:"mediumtext",description:"\u6700\u5927\u9577\u304C 16,777,215 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"MEDIUMTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:325,name:"longtext",description:"\u6700\u5927\u9577\u304C 4G \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"LONGTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:3,name:"binary (m)",description:"\u30D0\u30A4\u30CA\u30EA\u30D0\u30A4\u30C8\u6587\u5B57\u5217\u3092\u683C\u7D0D\u3057\u307E\u3059\u3002",baseQuery:"BINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:5,name:"varbinary (m)",description:"\u30D0\u30A4\u30CA\u30EA\u30D0\u30A4\u30C8\u6587\u5B57\u5217\u3092\u683C\u7D0D\u3057\u307E\u3059\u3002",baseQuery:"VARBINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:361,name:"tinyblob",description:"\u6700\u5927\u9577\u304C 255 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"TINYBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:363,name:"blob",description:"\u6700\u5927\u9577\u304C 65,535 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"BLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:364,name:"blob (m)",description:"\u6700\u5927\u9577\u304C 65,535 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"BLOB[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:365,name:"mediumblob",description:"\u6700\u5927\u9577\u304C 16,777,215 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"MEDIUMBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:367,name:"longblob",description:"\u6700\u5927\u9577\u304C 4G \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"LONGBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:422,name:"json",description:"\u6587\u66F8\u306E\u578B\u5F0F\u3067\u3042\u308BJSON\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2001,name:"geometry",description:"\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002\u70B9\u3001\u7DDA\u3001\u591A\u89D2\u5F62\u3001\u304A\u3088\u3073\u305D\u306E\u4ED6\u306E\u5F62\u72B6\u3092\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002",baseQuery:"GEOMETRY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2011,name:"point",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u7A7A\u9593\u4E0A\u306E\u5358\u4E00\u306E\u70B9\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"POINT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2012,name:"linestring",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u7A7A\u9593\u4E0A\u306E\u8907\u6570\u306E\u70B9\u3092\u7D50\u3076\u76F4\u7DDA\u30BB\u30B0\u30E1\u30F3\u30C8\u306E\u9023\u7D9A\u3057\u305F\u30BB\u30C3\u30C8\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"LINESTRING",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2013,name:"polygon",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u5E73\u9762\u4E0A\u306E\u5358\u4E00\u306E\u9818\u57DF\u3092\u8868\u3059\u9589\u3058\u305F\u30EB\u30FC\u30D7\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"POLYGON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2021,name:"multipoint",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u70B9\u3092\u8868\u3059\u8907\u6570\u306EPOINT\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTIPOINT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2022,name:"multilinestring",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u7DDA\u5206\u3092\u8868\u3059\u8907\u6570\u306ELINESTRING\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTILINESTRING",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2023,name:"multipolygon",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u30DD\u30EA\u30B4\u30F3\u3092\u8868\u3059\u8907\u6570\u306EPOLYGON\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTIPOLYGON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2031,name:"geometrycollection",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306EGEOMETRY\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"GEOMETRYCOLLECTION",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2101,name:"enum",description:"\u6587\u5B57\u5217\u306E\u30EA\u30B9\u30C8\u306E\u4E2D\u304B\u30891\u3064\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"ENUM",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2102,name:"set",description:"ENUM\u306E\u62E1\u5F35\u7248\u3067\u3042\u308A\u3001\u6587\u5B57\u5217\u306E\u30EA\u30B9\u30C8\u304B\u3089\u8907\u6570\u306E\u9078\u629E\u80A2\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"SET",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:411,name:"uuid",description:"128\u30D3\u30C3\u30C8\u306EUUID\u5024\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B (MariaDB 10.7+)\u3002",baseQuery:"UUID",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:1113,name:"inet4",description:"IPv4\u30A2\u30C9\u30EC\u30B9\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B (MariaDB 10.10+)\u3002",baseQuery:"INET4",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:1114,name:"inet6",description:"IPv6\u30A2\u30C9\u30EC\u30B9\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B (MariaDB 10.5+)\u3002",baseQuery:"INET6",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),u.EMPTY],sqlite:[new u({id:15,name:"integer",description:"\u6574\u6570\u5024\u3002INTEGER\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u3002\u5358\u4E00\u5217\u306EPRIMARY KEY\u306B\u8A2D\u5B9A\u3059\u308B\u3068rowid\u30A8\u30A4\u30EA\u30A2\u30B9\u3068\u306A\u308A\u81EA\u52D5\u63A1\u756A\u76F8\u5F53\u306B\u306A\u308B\u3002",baseQuery:"INTEGER",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:33,name:"real",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u3002REAL\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u3002",baseQuery:"REAL",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:325,name:"text",description:"\u6587\u5B57\u5217\u3002TEXT\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u3002",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:363,name:"blob",description:"\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002BLOB\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3(\u578B\u6307\u5B9A\u306A\u3057\u3068\u540C\u7FA9)\u3002",baseQuery:"BLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:36,name:"numeric",description:"\u6570\u5024\u3002NUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:6,name:"boolean",description:"\u8AD6\u7406\u5024\u3002NUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:311,name:"char (n)",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002n\u306F\u69CB\u6587\u4E0A\u66F8\u3051\u308B\u304C\u7121\u8996\u3055\u308CTEXT\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (n)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002n\u306F\u69CB\u6587\u4E0A\u66F8\u3051\u308B\u304C\u7121\u8996\u3055\u308CTEXT\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:"\u65E5\u4ED8\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002NUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u6163\u7528\u578B\u3002",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:112,name:"datetime",description:"\u65E5\u6642\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002NUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u6163\u7528\u578B\u3002",baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:45,name:"decimal (p, s)",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002p,s\u306F\u69CB\u6587\u4E0A\u66F8\u3051\u308B\u304C\u7121\u8996\u3055\u308CNUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),u.EMPTY],bigquery:[new u({id:17,name:"int64",description:"8\u30D0\u30A4\u30C8\u7B26\u53F7\u4ED8\u304D\u6574\u6570\u3002INT/SMALLINT/INTEGER/BIGINT/TINYINT/BYTEINT \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"INT64",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:33,name:"float64",description:"\u500D\u7CBE\u5EA6\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u3002FLOAT \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"FLOAT64",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:36,name:"numeric",description:"\u7CBE\u5EA638\u6841\u30FB\u30B9\u30B1\u30FC\u30EB9\u6841\u306E\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u5024\u3002DECIMAL \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:46,name:"numeric (p, s)",description:"\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u3092\u6307\u5B9A\u3059\u308B\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u5024\u3002DECIMAL \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002\u7CBE\u5EA6\u6307\u5B9A\u4ED8\u304D DDL \u306E\u8AAD\u8FBC\u306F node-sql-parser \u975E\u5BFE\u5FDC\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:37,name:"bignumeric",description:"\u7CBE\u5EA676.76\u6841\u30FB\u30B9\u30B1\u30FC\u30EB38\u6841\u306E\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u5024\u3002BIGDECIMAL \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"BIGNUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:49,name:"bignumeric (p, s)",description:"\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u3092\u6307\u5B9A\u3059\u308B\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u5024\u3002BIGDECIMAL \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002\u7CBE\u5EA6\u6307\u5B9A\u4ED8\u304D DDL \u306E\u8AAD\u8FBC\u306F node-sql-parser \u975E\u5BFE\u5FDC\u3002",baseQuery:"BIGNUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:6,name:"bool",description:"\u8AD6\u7406\u5024 (\u771F/\u507D)\u3002BOOLEAN \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"BOOL",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:325,name:"string",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217 (Unicode)\u3002",baseQuery:"STRING",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:312,name:"string (n)",description:"\u6700\u5927\u9577\u3092\u6307\u5B9A\u3059\u308B\u53EF\u5909\u9577\u6587\u5B57\u5217 (Unicode)\u3002\u7CBE\u5EA6\u6307\u5B9A\u4ED8\u304D DDL \u306E\u8AAD\u8FBC\u306F node-sql-parser \u975E\u5BFE\u5FDC\u3002",baseQuery:"STRING[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:367,name:"bytes",description:"\u53EF\u5909\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002",baseQuery:"BYTES",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:5,name:"bytes (n)",description:"\u6700\u5927\u9577\u3092\u6307\u5B9A\u3059\u308B\u53EF\u5909\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002",baseQuery:"BYTES[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:101,name:"date",description:"\u66A6\u306E\u65E5\u4ED8 (\u5E74\u6708\u65E5)\u3002",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:111,name:"datetime",description:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u306A\u3057\u306E\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:131,name:"time",description:"\u6642\u523B\u3002",baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:112,name:"timestamp",description:"UTC \u57FA\u6E96\u306E\u7D76\u5BFE\u6642\u70B9\u3092\u8868\u3059\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"TIMESTAMP",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:422,name:"json",description:"JSON \u5F62\u5F0F\u306E\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:2002,name:"geography",description:"\u7403\u4F53\u5730\u7403\u5EA7\u6A19\u7CFB\u306E\u5730\u7406\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"GEOGRAPHY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),u.EMPTY],snowflake:[new u({id:36,name:"number",description:"\u6570\u5024\u578B\u3002\u65E2\u5B9A\u306E\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u306F (38, 0)\u3002INT/INTEGER/BIGINT \u7B49\u306E\u6574\u6570\u578B\u306F\u3059\u3079\u3066 NUMBER(38,0) \u306E\u30B7\u30CE\u30CB\u30E0\u3068\u3057\u3066\u6271\u308F\u308C\u308B\u3002",baseQuery:"NUMBER",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:46,name:"number (p, s)",description:"\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u3092\u6307\u5B9A\u3059\u308B\u6570\u5024\u578B\u3002INT/INTEGER/BIGINT \u7B49\u306F NUMBER(38,0) \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3042\u308A\u3001\u3053\u306E\u578B\u3067\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u3092\u660E\u793A\u7684\u306B\u6307\u5B9A\u3057\u305F\u3082\u306E\u306B\u76F8\u5F53\u3059\u308B\u3002",baseQuery:"NUMBER[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!0}),new u({id:33,name:"float",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u3002\u500D\u7CBE\u5EA6\u6D6E\u52D5\u5C0F\u6570\u70B9\u3068\u3057\u3066\u683C\u7D0D\u3055\u308C\u308B\u3002",baseQuery:"FLOAT",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:301,name:"char",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217 (\u5B9F\u969B\u306B\u306F\u53EF\u5909\u9577\u3068\u3057\u3066\u683C\u7D0D\u3055\u308C\u308B)\u3002",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:311,name:"char (n)",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217 (\u5B9F\u969B\u306B\u306F\u53EF\u5909\u9577\u3068\u3057\u3066\u683C\u7D0D\u3055\u308C\u308B)\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:302,name:"varchar",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u3002STRING/TEXT \u306F\u30B7\u30CE\u30CB\u30E0\u3002",baseQuery:"VARCHAR",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (n)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u3002STRING/TEXT \u306F\u30B7\u30CE\u30CB\u30E0\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:4,name:"binary",description:"\u56FA\u5B9A\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002",baseQuery:"BINARY",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:3,name:"binary (n)",description:"\u56FA\u5B9A\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002",baseQuery:"BINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:5,name:"varbinary (n)",description:"\u53EF\u5909\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002BINARY \u306E\u30B7\u30CE\u30CB\u30E0\u3002",baseQuery:"VARBINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:6,name:"boolean",description:"\u8AD6\u7406\u5024 (\u771F/\u507D)\u3002",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:"\u66A6\u306E\u65E5\u4ED8 (\u5E74\u6708\u65E5)\u3002",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:131,name:"time",description:"\u6642\u523B\u3002\u65E2\u5B9A\u306E\u7CBE\u5EA6\u306F\u79D2\u306E\u5C0F\u6570\u70B9\u4EE5\u4E0B9\u6841\u3002",baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:141,name:"time (p)",description:"\u7CBE\u5EA6 (\u79D2\u306E\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570) \u3092\u6307\u5B9A\u3059\u308B\u6642\u523B\u578B\u3002",baseQuery:"TIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:111,name:"timestamp_ntz",description:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u306A\u3057\u306E\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"TIMESTAMP_NTZ",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:112,name:"timestamp_tz",description:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u4ED8\u304D\u306E\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"TIMESTAMP_TZ",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:113,name:"timestamp_ltz",description:"\u30BB\u30C3\u30B7\u30E7\u30F3\u306E\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u3067\u89E3\u91C8\u3055\u308C\u308B\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"TIMESTAMP_LTZ",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:9601,name:"variant",description:"\u4EFB\u610F\u306E\u4ED6\u306E\u30C7\u30FC\u30BF\u578B\u306E\u5024\u3092\u683C\u7D0D\u3067\u304D\u308B\u534A\u69CB\u9020\u5316\u30C7\u30FC\u30BF\u578B\u3002DDL \u8AAD\u8FBC (\u30A4\u30F3\u30DD\u30FC\u30C8) \u306F node-sql-parser \u306E snowflake \u30C0\u30A4\u30A2\u30EC\u30AF\u30C8\u306E\u5236\u7D04\u306B\u3088\u308A\u975E\u5BFE\u5FDC\u3002",baseQuery:"VARIANT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:9602,name:"object",description:"\u30AD\u30FC\u3068\u5024\u306E\u30DA\u30A2\u306E\u96C6\u5408\u3092\u683C\u7D0D\u3059\u308B\u534A\u69CB\u9020\u5316\u30C7\u30FC\u30BF\u578B\u3002DDL \u8AAD\u8FBC (\u30A4\u30F3\u30DD\u30FC\u30C8) \u306F node-sql-parser \u306E snowflake \u30C0\u30A4\u30A2\u30EC\u30AF\u30C8\u306E\u5236\u7D04\u306B\u3088\u308A\u975E\u5BFE\u5FDC\u3002",baseQuery:"OBJECT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:9603,name:"array",description:"\u5024\u306E\u914D\u5217\u3092\u683C\u7D0D\u3059\u308B\u534A\u69CB\u9020\u5316\u30C7\u30FC\u30BF\u578B\u3002DDL \u8AAD\u8FBC (\u30A4\u30F3\u30DD\u30FC\u30C8) \u306F node-sql-parser \u306E snowflake \u30C0\u30A4\u30A2\u30EC\u30AF\u30C8\u306E\u5236\u7D04\u306B\u3088\u308A\u975E\u5BFE\u5FDC\u3002",baseQuery:"ARRAY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2001,name:"geometry",description:"\u5E73\u9762 (\u30E6\u30FC\u30AF\u30EA\u30C3\u30C9) \u5EA7\u6A19\u7CFB\u306E\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"GEOMETRY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2002,name:"geography",description:"\u7403\u4F53\u5730\u7403\u5EA7\u6A19\u7CFB\u306E\u5730\u7406\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"GEOGRAPHY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),u.EMPTY]},Zn=t=>Kh[t],uc=(t,e,n)=>{let r=new Map(Zn(t).map(i=>[i.id,i])),o=e;if(n<20260321&&(o=o.map(i=>{let a=r.get(i.id);return a==null?i:u.migrateDefaultValueCandidates(i,a,n)})),n<20250718&&t==="postgres"){let i=r.get(9103);i!=null&&o.every(a=>a.id!==9103)&&o.push(i)}return n<20251130&&t==="postgres"&&(o=o.map(i=>{let a=r.get(i.id);return a==null||a.withAutoIncrement===!1?i:new u({...i,withAutoIncrement:!0})})),n<20260504&&(o=o.map(i=>{let a=r.get(i.id);return a==null?i:new u({...i,category:a.category})})),o};var dc=20260504,Fn=class t{constructor({databaseType:e,columnTypes:n,version:r}){this.databaseType=e,this.columnTypes=n,this.version=r}static create(e){let n=Zn(e);return new t({databaseType:e,columnTypes:n,version:dc})}getDatabase(){return ee.get(this.databaseType)}initToColumnTypeMapping(){let e=new Map(this.columnTypes.map(n=>[n.id,n]));return n=>e.get(n)??u.EMPTY}findColumnType(e){return this.columnTypes.find(n=>n.id===e)??null}toJSON(){return{databaseType:this.databaseType,columnTypes:this.columnTypes.map(e=>e.toJSON()),version:this.version}}static toObject(e){S(e,"databaseType"),S(e,"columnTypes");let n=e.databaseType,r=j(e.columnTypes,"columnTypes",a=>u.toObject(a)),o="version"in e?e.version:0,i=uc(n,r,o);return new t({databaseType:n,columnTypes:i,version:dc})}equals(e){if(this.databaseType!==e.databaseType||this.columnTypes.length!==e.columnTypes.length)return!1;for(let n=0;n<this.columnTypes.length;n++)if(this.columnTypes[n].equals(e.columnTypes[n])===!1)return!1;return!0}};var Go=class t{constructor({schemaId:e,schemaName:n,description:r}){this.schemaId=e,this.schemaName=n,this.description=r}static create(e,n){return new t({schemaId:X(),schemaName:e,description:n})}update(e){return new t({schemaId:this.schemaId,schemaName:e.schemaName??this.schemaName,description:e.description??this.description})}toJSON(){return{schemaId:this.schemaId,schemaName:this.schemaName,description:this.description}}static toObject(e){return S(e,"schemaId"),S(e,"schemaName"),new t({schemaId:e.schemaId,schemaName:e.schemaName,description:"description"in e?e.description:""})}equals(e){return this.schemaId===e.schemaId&&this.schemaName===e.schemaName&&this.description===e.description}},mc=Go;var Yo=class t{constructor(e,n,r){this.defaultSchemaId=r.has(e)?e:"",this.schemaIds=n,this.schemaMap=r}static create(e={}){let n=e.defaultSchemaId||"",r=e.schemas||[],o=r.map(a=>a.schemaId),i=new Map(r.map(a=>[a.schemaId,a]));return new t(n,o,i)}findSchema(e){if(e==="")return this.findDefaultSchema();let n=this.schemaMap.get(e);return n??this.findDefaultSchema()}findDefaultSchema(){return this.defaultSchemaId===""?null:this.schemaMap.get(this.defaultSchemaId)||null}hasSchemas(){return this.schemaIds.length>0}getSchemas(){return this.schemaIds.map(e=>this.schemaMap.get(e))}equals(e){if(this===e)return!0;if(this.defaultSchemaId!==e.defaultSchemaId||this.schemaIds.length!==e.schemaIds.length)return!1;for(let[n,r]of this.schemaIds.entries()){let o=e.schemaIds[n];if(r!==o)return!1;let i=this.schemaMap.get(r),a=e.schemaMap.get(r);if(i==null||a==null||i.equals(a)===!1)return!1}return!0}toJSON(){return{defaultSchemaId:this.defaultSchemaId,schemas:this.getSchemas().map(e=>e.toJSON())}}static toObject(e){S(e,"defaultSchemaId"),S(e,"schemas");let n=e.defaultSchemaId,r=j(e.schemas,"schemas",a=>mc.toObject(a)),o=r.map(a=>a.schemaId),i=new Map(r.map(a=>[a.schemaId,a]));return new t(n,o,i)}},Cr=Yo;var qt=class t{constructor(e,n,r){this.name=e;this.displayFunction=n;this.logicalNameIncluded=r}static{this.PHYSICAL=new t("Physical",(e,n)=>e,!1)}static{this.LOGICAL=new t("Logical",(e,n)=>n,!0)}static{this.BOTH=new t("Both",(e,n)=>`${n} / ${e}`,!0)}static values(){return[t.PHYSICAL,t.LOGICAL,t.BOTH]}displayName(e,n){return this.displayFunction(e,n)}withLogicalName(){return this.logicalNameIncluded}toJSON(){return{styleName:this.name}}static toObject(e){if(!("styleName"in e))return t.BOTH;let n=e.styleName;for(let r of t.values())if(r.name===n)return r;return t.BOTH}equals(e){return this.name===e.name}};var ft=class t{static{this.ALL=new t("all","All Columns",()=>!0)}static{this.ONLY_PK=new t("pk","Only PK Columns",e=>e.primaryKey)}static{this.PK_OR_FK=new t("pk_fk","PK or FK Columns",(e,n)=>e.primaryKey||n)}static{this.NONE=new t("none","No Columns",()=>!1)}constructor(e,n,r){this.key=e,this.name=n,this.viewableFunction=r}static values(){return[t.ALL,t.ONLY_PK,t.PK_OR_FK,t.NONE]}viewable(e,n){return this.viewableFunction(e,n)}toJSON(){return{style:this.key}}static toObject(e){if(!("style"in e))return t.ALL;let n=e.style;for(let r of t.values())if(r.key===n)return r;return t.ALL}equals(e){return this.key===e.key}};var ln=class t{constructor({fileName:e,withTable:n=!0,withIndex:r=!0,withForeignKey:o=!0,withSchema:i=!0,withComment:a=!0,commentStyle:s="logical_name",commentSeparator:l=" : "}){this.fileName=e,this.withTable=n,this.withIndex=r,this.withForeignKey=o,this.withSchema=i,this.withComment=a,this.commentStyle=s,this.commentSeparator=l}equals(e){return!(this.fileName!==e.fileName||this.withTable!==e.withTable||this.withIndex!==e.withIndex||this.withForeignKey!==e.withForeignKey||this.withSchema!==e.withSchema||this.withComment!==e.withComment||this.commentStyle!==e.commentStyle||this.commentSeparator!==e.commentSeparator)}toJSON(){return{fileName:this.fileName,withTable:this.withTable,withIndex:this.withIndex,withForeignKey:this.withForeignKey,withSchema:this.withSchema,withComment:this.withComment,commentStyle:this.commentStyle,commentSeparator:this.commentSeparator}}static toObject(e){S(e,"fileName");let n="withTable"in e?e.withTable:!0,r="withIndex"in e?e.withIndex:!0,o="withForeignKey"in e?e.withForeignKey:!0,i="withSchema"in e?e.withSchema:!0,a="withComment"in e?e.withComment:!0,s="commentStyle"in e?e.commentStyle:"logical_name",l="commentSeparator"in e?e.commentSeparator:" : ";return new t({fileName:e.fileName,withTable:n,withIndex:r,withForeignKey:o,withSchema:i,withComment:a,commentStyle:s,commentSeparator:l})}};var jo=class t{constructor({perspectiveId:e,perspectiveName:n,description:r,containIds:o}){this.perspectiveId=e,this.perspectiveName=n,this.description=r,this.containIds=new Set(o)}static create(e,n=""){return new t({perspectiveId:X(),perspectiveName:e,description:n,containIds:[]})}containsModel(e){return this.containIds.has(e)}getContainIds(){return Array.from(this.containIds)}update(e,n){return new t({perspectiveId:this.perspectiveId,perspectiveName:e,description:n,containIds:this.containIds})}updateContainId(e,n){let r=new Set(this.containIds);return n==="add"?r.add(e):r.delete(e),new t({perspectiveId:this.perspectiveId,perspectiveName:this.perspectiveName,description:this.description,containIds:r})}updateAllContainIds(e){return this.containIds.size===0&&e.length===0?this:this.containIds.size===e.length&&[...e].every(r=>this.containIds.has(r))?this:new t({perspectiveId:this.perspectiveId,perspectiveName:this.perspectiveName,description:this.description,containIds:e})}equals(e){return this.perspectiveId!==e.perspectiveId||this.perspectiveName!==e.perspectiveName||this.description!==e.description||this.containIds.size!==e.containIds.size?!1:[...this.containIds].every(n=>e.containIds.has(n))}toJSON(){let e=Array.from(this.containIds).sort();return{perspectiveId:this.perspectiveId,perspectiveName:this.perspectiveName,...this.description!==""&&{description:this.description},containIds:e}}static toObject(e){return S(e,"perspectiveId"),S(e,"perspectiveName"),new t({perspectiveId:e.perspectiveId,perspectiveName:e.perspectiveName,description:"description"in e?e.description:"",containIds:"containIds"in e?e.containIds:[]})}},pc=jo;var Wo=class t{constructor(e){this.perspectiveIds=e.map(n=>n.perspectiveId),this.perspectiveMap=new Map(e.map(n=>[n.perspectiveId,n]))}findModel(e){return this.perspectiveMap.get(e)||null}getModels(){return this.perspectiveIds.map(e=>this.perspectiveMap.get(e))}updateModel(e){let n=this.perspectiveMap.get(e.perspectiveId);if(n==null){let o=[...this.getModels(),e];return new t(o)}if(n.equals(e)===!0)return this;let r=this.getModels().map(o=>o.perspectiveId!==e.perspectiveId?o:e);return new t(r)}equals(e){return an(this.perspectiveIds,e.perspectiveIds)===!1?!1:Xe(this.perspectiveMap,e.perspectiveMap)}},_r=Wo;var cn=class t{constructor({displayNameStyle:e=qt.BOTH,displayColumnStyle:n=ft.ALL,exportDdlSetting:r,perspectiveModelStorage:o,showRelationNames:i=!1,syncRemoteChanges:a=!1}){this.displayNameStyle=e,this.displayColumnStyle=n,this.exportDdlSetting=r,this.perspectiveModelStorage=o,this.showRelationNames=i,this.syncRemoteChanges=a}static create(e){let n=new ln({fileName:e}),r=new _r([]);return new t({exportDdlSetting:n,perspectiveModelStorage:r})}findPerspectiveModel(e){return this.perspectiveModelStorage.findModel(e)}getPerspectiveModels(){return this.perspectiveModelStorage.getModels()}update({displayNameStyle:e=null,displayColumnStyle:n=null,exportDdlSetting:r=null,perspectiveModels:o=null,showRelationNames:i=null,syncRemoteChanges:a=null}){return e==null&&n==null&&r==null&&o==null&&i==null&&a==null?this:new t({displayNameStyle:e??this.displayNameStyle,displayColumnStyle:n??this.displayColumnStyle,exportDdlSetting:r??this.exportDdlSetting,perspectiveModelStorage:o!=null?new _r(o):this.perspectiveModelStorage,showRelationNames:i??this.showRelationNames,syncRemoteChanges:a??this.syncRemoteChanges})}updatePerspective(e){let n=this.perspectiveModelStorage.updateModel(e);return n===this.perspectiveModelStorage?this:new t({displayNameStyle:this.displayNameStyle,displayColumnStyle:this.displayColumnStyle,exportDdlSetting:this.exportDdlSetting,perspectiveModelStorage:n,showRelationNames:this.showRelationNames,syncRemoteChanges:this.syncRemoteChanges})}toJSON(){let e=this.perspectiveModelStorage.getModels().map(n=>n.toJSON());return{displayStyle:this.displayNameStyle.toJSON(),...this.displayColumnStyle.key!==ft.ALL.key&&{displayColumn:this.displayColumnStyle.toJSON()},exportDdlSetting:this.exportDdlSetting.toJSON(),...e.length>0&&{perspectiveModels:e},...this.showRelationNames&&{showRelationNames:!0},...this.syncRemoteChanges&&{syncRemoteChanges:!0}}}static toObject(e){S(e,"exportDdlSetting");let n="displayStyle"in e?qt.toObject(e.displayStyle):qt.BOTH,r="displayColumn"in e?ft.toObject(e.displayColumn):ft.ALL,o=ln.toObject(e.exportDdlSetting),i="perspectiveModels"in e?j(e.perspectiveModels,"perspectiveModels",l=>pc.toObject(l)):[],a="showRelationNames"in e?e.showRelationNames:!1,s="syncRemoteChanges"in e?e.syncRemoteChanges:!1;return new t({displayNameStyle:n,displayColumnStyle:r,exportDdlSetting:o,perspectiveModelStorage:new _r(i),showRelationNames:a,syncRemoteChanges:s})}equals(e){return!(this.displayNameStyle.equals(e.displayNameStyle)===!1||this.displayColumnStyle.equals(e.displayColumnStyle)===!1||this.exportDdlSetting.equals(e.exportDdlSetting)===!1||this.perspectiveModelStorage.equals(e.perspectiveModelStorage)===!1||this.showRelationNames!==e.showRelationNames||this.syncRemoteChanges!==e.syncRemoteChanges)}};var Gh=/^#[0-9A-Fa-f]{6}$/,re=class t{static{this.WHITE=new t({red:255,green:255,blue:255})}static{this.BLACK=new t({red:0,green:0,blue:0})}constructor({red:e,green:n,blue:r}){this.red=e,this.green=n,this.blue=r}static fromHex(e){if(Gh.test(e)===!1)throw new Error(`Invalid color hex string: ${e}`);let n=parseInt(e.substring(1,3),16),r=parseInt(e.substring(3,5),16),o=parseInt(e.substring(5,7),16);return new t({red:n,green:r,blue:o})}toHex(){let e=this.red.toString(16).padStart(2,"0"),n=this.green.toString(16).padStart(2,"0"),r=this.blue.toString(16).padStart(2,"0");return`#${e}${n}${r}`.toUpperCase()}toRgba(e=1){return`rgba(${this.red}, ${this.green}, ${this.blue}, ${e})`}reverseGrayscale(){let e=255-(this.red+this.green+this.blue)/3;return new t({red:e,green:e,blue:e})}equals(e){return this.red===e.red&&this.green===e.green&&this.blue===e.blue}static toObject(e){return S(e,"red"),S(e,"green"),S(e,"blue"),new t({red:e.red,green:e.green,blue:e.blue})}toJSON(){return{red:this.red,green:this.green,blue:this.blue}}};var Qn=class t{constructor({positionX:e,positionY:n,width:r,height:o}){this.positionX=e,this.positionY=n,this.width=r,this.height=o}static createFromPoints(e,n){let r=Math.min(e.x,n.x),o=Math.min(e.y,n.y),i=Math.max(Math.abs(e.x-n.x),2),a=Math.max(Math.abs(e.y-n.y),2);return new t({positionX:r,positionY:o,width:i,height:a})}static createFromEdges(e){let n=e.left,r=e.top,o=e.right-e.left,i=e.bottom-e.top;return new t({positionX:n,positionY:r,width:o,height:i})}move(e){return new t({positionX:this.positionX+e.x,positionY:this.positionY+e.y,width:this.width,height:this.height})}get left(){return this.positionX}get right(){return this.positionX+this.width}get xCenter(){return this.positionX+this.width/2}get top(){return this.positionY}get bottom(){return this.positionY+this.height}get yCenter(){return this.positionY+this.height/2}get center(){return{x:this.xCenter,y:this.yCenter}}contains(e){return e instanceof t?this.containsArea(e):this.containsPoint(e)}containsArea(e){return!(this.left>e.left||this.right<e.right||this.top>e.top||this.bottom<e.bottom)}containsPoint(e){return!(e.x<this.left||e.x>this.right||e.y<this.top||e.y>this.bottom)}static toObject(e){return S(e,"positionX"),S(e,"positionY"),S(e,"width"),S(e,"height"),new t({positionX:e.positionX,positionY:e.positionY,width:e.width,height:e.height})}toJSON(){return{positionX:this.positionX,positionY:this.positionY,width:this.width,height:this.height}}equals(e){return!(this.positionX!==e.positionX||this.positionY!==e.positionY||this.width!==e.width||this.height!==e.height)}};var hc="center",fc="center",Jo=9,un=class t{constructor({memoId:e,memo:n,rectangleViewModel:r,backgroundColor:o,foregroundColor:i,verticalAlign:a=hc,horizontalAlign:s=fc,fontSize:l=Jo,createdAt:c=null}){this.memoId=e,this.memo=n,this.rectangleViewModel=r,this.backgroundColor=o,this.foregroundColor=i,this.verticalAlign=a,this.horizontalAlign=s,this.fontSize=l>=1?l:1,this.createdAt=c||new Date}static create(e,n,r=Jo){return new t({memoId:X(),memo:"",rectangleViewModel:e,backgroundColor:n.background,foregroundColor:n.foreground,fontSize:r})}updateMemo(e){return this.memo===e?this:new t({...this,memo:e})}updateRectangle(e){return e.equals(this.rectangleViewModel)?this:new t({...this,rectangleViewModel:e})}updateColor(e=null,n=null){let r=e||this.backgroundColor,o=n||this.foregroundColor;return this.backgroundColor.equals(r)&&this.foregroundColor.equals(o)?this:new t({...this,backgroundColor:r,foregroundColor:o})}updateVerticalAlign(e){return this.verticalAlign===e?this:new t({...this,verticalAlign:e})}updateHorizontalAlign(e){return this.horizontalAlign===e?this:new t({...this,horizontalAlign:e})}updateFontSize(e){return this.fontSize===e||e<1?this:new t({...this,fontSize:e})}move(e){let n=this.rectangleViewModel.move(e);return new t({...this,rectangleViewModel:n})}toJSON(){return{memoId:this.memoId,memo:this.memo,rectangleViewModel:this.rectangleViewModel.toJSON(),backgroundColor:this.backgroundColor.toJSON(),foregroundColor:this.foregroundColor.toJSON(),verticalAlign:this.verticalAlign,horizontalAlign:this.horizontalAlign,fontSize:this.fontSize,createdAt:this.createdAt}}static toObject(e){S(e,"memoId"),S(e,"memo"),S(e,"rectangleViewModel");let n="backgroundColor"in e?re.toObject(e.backgroundColor):re.WHITE,r="foregroundColor"in e?re.toObject(e.foregroundColor):re.BLACK,o="verticalAlign"in e?e.verticalAlign:hc,i="horizontalAlign"in e?e.horizontalAlign:fc,a="fontSize"in e?e.fontSize:Jo,s="createdAt"in e?Ve(e.createdAt):new Date;return new t({memoId:e.memoId,memo:e.memo,rectangleViewModel:Qn.toObject(e.rectangleViewModel),backgroundColor:n,foregroundColor:r,verticalAlign:o,horizontalAlign:i,fontSize:a,createdAt:s})}equals(e){return!(this.memoId!==e.memoId||this.memo!==e.memo||this.rectangleViewModel.equals(e.rectangleViewModel)===!1||this.backgroundColor.equals(e.backgroundColor)===!1||this.foregroundColor.equals(e.foregroundColor)===!1||this.verticalAlign!==e.verticalAlign||this.horizontalAlign!==e.horizontalAlign||this.fontSize!==e.fontSize||this.createdAt.getTime()!==e.createdAt.getTime())}};var Bn=class t{constructor(e,n,r){this.memoIdMap=new Map(e),this.foregroundIds=n,this.backgroundIds=r}static create(e,n){return new t(new Map(e.concat(n).map(r=>[r.memoId,r])),e.map(r=>r.memoId),n.map(r=>r.memoId))}find(e){return this.memoIdMap.get(e)||null}getMemos(){let e=this.foregroundIds.map(r=>this.memoIdMap.get(r)).filter(r=>r!=null),n=this.backgroundIds.map(r=>this.memoIdMap.get(r)).filter(r=>r!=null);return{frontMemos:e,backMemos:n}}addMemo(e,n="front"){let r=new Map(this.memoIdMap);r.set(e.memoId,e);let o=n==="front"?[...this.foregroundIds,e.memoId]:this.foregroundIds,i=n==="back"?[e.memoId,...this.backgroundIds]:this.backgroundIds;return new t(r,o,i)}updateMemo(e){let n=new Map(this.memoIdMap);return n.set(e.memoId,e),new t(n,this.foregroundIds,this.backgroundIds)}deleteMemo(e){let n=new Map(this.memoIdMap);if(n.delete(e)===!1)return this;let o=this.foregroundIds.indexOf(e),i=o<0?this.backgroundIds.indexOf(e):-1,a=o>=0?Nr(this.foregroundIds,o):this.foregroundIds,s=i>=0?Nr(this.backgroundIds,i):this.backgroundIds;return new t(n,a,s)}moveMemo(e,n){let r=new Map(this.memoIdMap);return e.forEach(o=>{let i=r.get(o);i!=null&&r.set(o,i.move(n))}),new t(r,this.foregroundIds,this.backgroundIds)}arrangeMemo(e,n){if(this.memoIdMap.get(e)==null)return this;let o=this.foregroundIds.indexOf(e);if(n==="front"&&this.foregroundIds.length>0&&o===this.foregroundIds.length-1)return this;let i=o<0?this.backgroundIds.indexOf(e):-1;if(n==="back"&&this.backgroundIds.length>0&&i===0)return this;let a=o>=0?Nr(this.foregroundIds,o):this.foregroundIds,s=i>=0?Nr(this.backgroundIds,i):this.backgroundIds;return new t(this.memoIdMap,n==="front"?[...a,e]:a,n==="back"?[e,...s]:s)}equals(e){return Xe(this.memoIdMap,e.memoIdMap)===!1||an(this.foregroundIds,e.foregroundIds)===!1?!1:an(this.backgroundIds,e.backgroundIds)}reuseInstancesFrom(e){let n=Vt(e.memoIdMap,this.memoIdMap),r=Fo(e.foregroundIds,this.foregroundIds),o=Fo(e.backgroundIds,this.backgroundIds);return(n===e.memoIdMap&&r===e.foregroundIds&&o===e.backgroundIds)===!0?e:new t(new Map(n),r,o)}},Nr=(t,e)=>t.length===0||e<0||e>=t.length?t:t.slice(0,e).concat(t.slice(e+1));var Yh={segment:-1,fraction:0,offsetX:0,offsetY:0},jh={bold:!1,italic:!1,strikethrough:!1,fontSize:10},et=class t{constructor({label:e,position:n=Yh,color:r=re.BLACK,style:o=jh}){this.label=e,this.position=n,this.color=r,this.style=o}updateLabelPosition(e){return gc(this.position,e)?this:new t({...this,position:e})}updateLabelStyle(e){return yc(this.style,e)?this:new t({...this,style:e})}updateColor(e){return this.color.equals(e)?this:new t({...this,color:e})}equals(e){return!(this.label!==e.label||gc(this.position,e.position)===!1||this.color.equals(e.color)===!1||yc(this.style,e.style)===!1)}toJSON(){return{label:this.label,position:this.position,color:this.color.toJSON(),style:this.style}}static toObject(e){return S(e,"label"),S(e,"position"),S(e,"color"),S(e,"style"),new t({label:e.label,position:e.position,color:re.toObject(e.color),style:e.style})}},gc=(t,e)=>t.segment===e.segment&&t.fraction===e.fraction&&t.offsetX===e.offsetX&&t.offsetY===e.offsetY,yc=(t,e)=>t.bold===e.bold&&t.italic===e.italic&&t.strikethrough===e.strikethrough&&t.fontSize===e.fontSize;var gt=class t{constructor({strokeWidth:e=1,edges:n=[],orthogonalLines:r=[],color:o=re.BLACK}){this.strokeWidth=e>0?e:1,this.edges=[...n],this.orthogonalLines=[...r],this.color=o}get lineType(){return this.orthogonalLines.length>0?"orthogonal":"straight"}updateEdge(e){if(e.edgeType==="virtual"){let r=[...this.edges];return r.splice(e.edgeId,0,e.point),new t({...this,edges:r,orthogonalLines:[]})}if(e.edgeId<0||e.edgeId>=this.edges.length)return this;let n=[...this.edges];return n[e.edgeId]=e.point,new t({...this,edges:n,orthogonalLines:[]})}updateOrthogonalLines(e){return new t({...this,orthogonalLines:[...e],edges:[]})}updateStrokeWidth(e){return this.strokeWidth===e||e<=0?this:new t({...this,strokeWidth:e})}updateColor(e){return this.color.equals(e)?this:new t({...this,color:e})}deleteEdge(e){if(e<0||e>=this.edges.length)return this;let n=[...this.edges];return n.splice(e,1),new t({...this,edges:n})}equals(e){return this===e?!0:this.strokeWidth!==e.strokeWidth||this.edges.length!==e.edges.length||this.color.equals(e.color)===!1||this.edges.every((r,o)=>{let i=e.edges[o];return r.x===i.x&&r.y===i.y})===!1||this.orthogonalLines.length!==e.orthogonalLines.length?!1:this.orthogonalLines.every((r,o)=>{let i=e.orthogonalLines[o];return r.direction===i.direction&&r.position===i.position})}toJSON(){return{strokeWidth:this.strokeWidth,edges:this.edges,orthogonalLines:this.orthogonalLines,color:this.color.toJSON()}}static toObject(e){S(e,"strokeWidth");let n="edges"in e?e.edges:[],r="orthogonalLines"in e?e.orthogonalLines:[],o="color"in e?re.toObject(e.color):re.BLACK;return new t({strokeWidth:e.strokeWidth,edges:n,orthogonalLines:r,color:o})}};var Ne=class t{constructor({relationModel:e,lineViewModel:n,labelViewModel:r=null,createdAt:o=null}){this.relationModel=e,this.lineViewModel=n,this.labelViewModel=r??new et({label:e.relationName}),this.createdAt=o||new Date}get relationId(){return this.relationModel.relationModelId}get parentTableModelId(){return this.relationModel.parentTableModelId}get childTableModelId(){return this.relationModel.childTableModelId}updateRelationModel(e){let n=e.relationName===this.labelViewModel.label?this.labelViewModel:new et({...this.labelViewModel,label:e.relationName});return new t({relationModel:e,lineViewModel:this.lineViewModel,labelViewModel:n,createdAt:this.createdAt})}toJSON(){return{relationModel:this.relationModel.toJSON(),lineViewModel:this.lineViewModel.toJSON(),...this.labelViewModel.label!=""&&{labelViewModel:this.labelViewModel.toJSON()},createdAt:this.createdAt}}static toObject(e){S(e,"relationModel"),S(e,"lineViewModel");let n="labelViewModel"in e?et.toObject(e.labelViewModel):null,r="createdAt"in e?Ve(e.createdAt):new Date;return new t({relationModel:qe.toObject(e.relationModel),lineViewModel:gt.toObject(e.lineViewModel),labelViewModel:n,createdAt:r})}equals(e){return this.relationModel.equals(e.relationModel)&&this.lineViewModel.equals(e.lineViewModel)&&this.labelViewModel.equals(e.labelViewModel)}};var dn=class t{constructor(e){this.relationIdMap=new Map(e.map(n=>[n.relationId,n])),this.parentTableModelIdMap=t.toTableIdMapping(e,n=>n.parentTableModelId),this.childTableModelIdMap=t.toTableIdMapping(e,n=>n.childTableModelId),this.childColumnModelIdMap=new Map(e.filter(n=>n.relationModel.relationPairs.length>0).flatMap(n=>n.relationModel.relationPairs.map(r=>[`${n.relationModel.childTableModelId}:${r.childColumnModelId}`,{tableModelId:n.relationModel.parentTableModelId,columnModelId:r.parentColumnModelId}])))}static toTableIdMapping(e,n){let r=new Map;return e.forEach(o=>{let i=n(o.relationModel),a=r.get(i);a!=null?a.push(o):r.set(i,[o])}),r}getModels(){return Array.from(this.relationIdMap.values()).sort((e,n)=>e.relationId.localeCompare(n.relationId,"en"))}findByRelationId(e){let n=this.relationIdMap.get(e);return n??null}fetchRelationsByParent(e){let n=this.parentTableModelIdMap.get(e);return n||[]}fetchRelationsByChild(e){let n=this.childTableModelIdMap.get(e);return n||[]}fetchRelationsByTableIds(e){let n=e.flatMap(i=>this.parentTableModelIdMap.get(i)||[]).map(i=>i.relationId),r=e.flatMap(i=>this.childTableModelIdMap.get(i)||[]).map(i=>i.relationId),o=new Set([...n,...r]);return o.size===0?[]:[...o].flatMap(i=>this.relationIdMap.get(i)||[])}inChildRelation(e,n){return this.childColumnModelIdMap.has(`${e}:${n}`)}findParentRelation(e,n){return this.childColumnModelIdMap.get(`${e}:${n}`)??null}updateRelationView(e){return this.update([e])}updateRelationModel(e){if(e.length===0)return this;let n=e.map(r=>{let o=this.relationIdMap.get(r.relationModelId);return o!=null?o.updateRelationModel(r):new Ne({relationModel:r,lineViewModel:new gt({})})});return this.update(n)}deleteRelation(e){if(e.length===0)return this;let n=new Map(this.relationIdMap);return e.forEach(r=>n.delete(r)),n.size===this.relationIdMap.size?this:new t(Array.from(n.values()))}deleteFromTableId(e){if(e.length===0)return this;let n=new Map(this.relationIdMap);for(let r of e)(this.childTableModelIdMap.get(r)||[]).forEach(i=>{n.delete(i.relationId)});return n.size===this.relationIdMap.size?this:new t(Array.from(n.values()))}updateLineView(e,n){let r=this.relationIdMap.get(e);if(r==null)return this;if(r.lineViewModel.equals(n))return this;let o=new Ne({...r,lineViewModel:n});return this.update([o])}updateLabelView(e,n){let r=this.relationIdMap.get(e);if(r==null)return this;if(r.labelViewModel.equals(n))return this;let o=new Ne({...r,labelViewModel:n});return this.update([o])}updateRelationOrthogonal(e){if(e.length===0)return this;let n=e.map(({relationId:r,orthogonalLines:o,changedIndex:i})=>{let a=this.findByRelationId(r);if(a==null)return null;let s=a.lineViewModel,l=s.updateOrthogonalLines(o);if(s.equals(l))return null;let c=a.labelViewModel,m=c.position.segment;if(i<0||m<i)return new Ne({...a,lineViewModel:l});let d=l.orthogonalLines.length-s.orthogonalLines.length,h=i===0&&m===0?0:Math.min(Math.max(0,m+d),l.orthogonalLines.length-1),g=new et({...c,position:{...c.position,segment:h}});return new Ne({...a,lineViewModel:l,labelViewModel:g})}).filter(r=>r!=null);return this.update(n)}update(e){if(e.length===0)return this;let n=new Map(this.relationIdMap);return e.forEach(r=>n.set(r.relationId,r)),new t(Array.from(n.values()))}moveRelation(e,n){if(this.relationIdMap.size===0)return this;if(e.size<=1)return this;if(n.x===0&&n.y===0)return this;let r=!1,o=[...this.relationIdMap.values()].map(i=>{let a=i.relationModel;if(e.has(a.parentTableModelId)==!1||e.has(a.childTableModelId)==!1||i.lineViewModel.edges.length===0)return i;r=!0;let s=i.lineViewModel.edges.map(c=>({x:c.x+n.x,y:c.y+n.y})),l=new gt({...i.lineViewModel,edges:s});return new Ne({...i,lineViewModel:l})});return r===!1?this:new t(o)}equals(e){return Xe(this.relationIdMap,e.relationIdMap)}reuseInstancesFrom(e){let n=Vt(e.relationIdMap,this.relationIdMap);return n===e.relationIdMap?e:new t(Array.from(n.values()))}};var be=class t{constructor({tableModel:e,corner:n,headerColor:r,createdAt:o=null}){this.tableModel=e,this.corner={...n},this.headerColor={...r},this.createdAt=o||new Date}get tableId(){return this.tableModel.tableModelId}toJSON(){return{tableModel:this.tableModel.toJSON(),top:this.corner.top,left:this.corner.left,headerBackgroundColor:this.headerColor.background.toJSON(),headerForegroundColor:this.headerColor.foreground.toJSON(),createdAt:this.createdAt}}static toObject(e){return S(e,"tableModel"),S(e,"top"),S(e,"left"),S(e,"headerBackgroundColor"),S(e,"headerForegroundColor"),new t({tableModel:Ze.toObject(e.tableModel),corner:{top:e.top,left:e.left},headerColor:{background:re.toObject(e.headerBackgroundColor),foreground:re.toObject(e.headerForegroundColor)},createdAt:"createdAt"in e?Ve(e.createdAt):new Date})}equals(e){return!(this.tableModel.equals(e.tableModel)===!1||this.corner.top!==e.corner.top||this.corner.left!==e.corner.left||this.headerColor.background.equals(e.headerColor.background)===!1||this.headerColor.foreground.equals(e.headerColor.foreground)===!1||this.createdAt.getTime()!==e.createdAt.getTime())}};var mn=class t{constructor(e,n,r,o,i,a,s,l,c,m,d,h=null){this.documentName=e,this.erdSettingModel=n,this.databaseSettingModel=r,this.schemaConfig=o,this.tableViewModelIds=i,this.tableViewModelMap=a,this.columnGroupModelMap=s,this.columnModelMap=l,this.columnShareStorage=c,this.relationViewModelStorage=m,this.memoViewModelStorage=d,this.lastUpdatedAt=h||new Date}static create({documentName:e,databaseSettingModel:n,erdSettingModel:r=cn.create(e),schemaConfig:o=Cr.create(),tableViewModels:i=[],columnGroupModels:a=[],structShareModels:s=[],columnModels:l=[],columnShareModels:c=[],relationViewModels:m=[],foregroundMemoViewModels:d=[],backgroundMemoViewModels:h=[],lastUpdatedAt:g=null}){return new t(e,r,n,o,i.map(b=>b.tableId),new Map(i.map(b=>[b.tableId,b])),new Map(a.map(b=>[b.columnGroupId,b])),new Map(l.map(b=>[b.columnModelId,b])),Un.create(c,s),new dn(m),Bn.create(d,h),g)}doUpdate(e){let n=e.columnModelMap!=null||e.columnGroupModelMap!=null||e.columnShareModelStorage!=null,r=e.tableViewModelMap??this.tableViewModelMap,o=e.columnGroupModelMap??this.columnGroupModelMap,i=e.columnModelMap??this.columnModelMap,a=e.columnShareModelStorage??this.columnShareStorage,s=n?this.doCollectReachableModelIds(r,o,i,a):null,l=s==null?i:this.doRetainColumnModels(i,s.columnModelIds),c=s==null?a:a.retain(s.columnShareModelIds,s.structShareModelIds,new Set(l.keys()),new Set(o.keys()));return new t(e.documentName??this.documentName,e.erdSettingModel??this.erdSettingModel,e.databaseSettingModel??this.databaseSettingModel,e.schemaConfig??this.schemaConfig,e.tableViewModelIds??this.tableViewModelIds,e.tableViewModelMap??this.tableViewModelMap,o,l,c,e.relationViewModelStorage??this.relationViewModelStorage,e.memoViewModelStorage??this.memoViewModelStorage,e.lastUpdatedAt??null)}doCollectReachableModelIds(e,n,r,o){let i=Array.from(e.values()).flatMap(d=>bc(d.tableModel.columnEntries)),a=Array.from(n.values()).flatMap(d=>d.columnModelIds),s=new Set,l=new Set,c=new Set,m=[...i,...a];for(;m.length>0;){let d=m.pop();if(d==null||s.has(d))continue;s.add(d);let h=r.get(d);if(h==null)continue;if(ce.isSimpleColumn(h)){l.add(h.columnShareModelId);continue}let g=h.structShareModelId;if(c.has(g))continue;c.add(g);let b=o.findStructShare(g);b!=null&&m.push(...bc(b.columnEntries))}return{columnModelIds:s,columnShareModelIds:l,structShareModelIds:c}}doRetainColumnModels(e,n){let r=Array.from(e.keys()).filter(i=>n.has(i)===!1);if(r.length===0)return e;let o=new Map(e);return r.forEach(i=>o.delete(i)),o}getDatabase(){return this.databaseSettingModel.getDatabase()}getDisplayNameStyle(){return this.erdSettingModel.displayNameStyle}getDisplayColumnStyle(){return this.erdSettingModel.displayColumnStyle}findSchema(e){return this.getDatabase().supportsSchema===!1?null:this.schemaConfig.findSchema(e)}findDefaultSchema(){return this.getDatabase().supportsSchema===!1?null:this.schemaConfig.findDefaultSchema()}findTableViewModel(e){let n=this.tableViewModelMap.get(e);return n||null}getTableViewModels(){return this.tableViewModelIds.map(e=>this.tableViewModelMap.get(e))}findColumnGroupModel(e){let n=this.columnGroupModelMap.get(e);return n||null}getColumnGroupModels(){return Array.from(this.columnGroupModelMap.values()).sort((n,r)=>{let o=n.groupName.localeCompare(r.groupName,"en");return o!==0?o:n.columnGroupId.localeCompare(r.columnGroupId,"en")})}findStructColumnShareModel(e){return this.columnShareStorage.findStructShare(e)}getStructColumnShareModels(){return this.columnShareStorage.getStructShareModels()}findColumnModel(e){let n=this.columnModelMap.get(e);return n||null}toAllColumnsWithStruct(e){return e.columnEntries.flatMap(n=>{if(n.modelType==="single")return[n.columnModelId];let r=this.findColumnGroupModel(n.columnGroupId);return r==null?[]:r.columnModelIds}).map(n=>this.findColumnModel(n)).filter(n=>n!=null)}toAllColumnsExceptStruct(e){return this.toAllColumnsWithStruct(e).filter(ce.isSimpleColumn)}findColumnShareModel(e){return this.columnShareStorage.findColumnShare(e)}fetchReferencedColumnModelsForShareModel(e){return Array.from(this.columnModelMap.values()).filter(ce.isSimpleColumn).filter(n=>n.columnShareModelId===e).sort((n,r)=>{let o=n.physicalName.localeCompare(r.physicalName,"en");return o!==0?o:n.columnModelId.localeCompare(r.columnModelId,"en")})}getColumnShareModelStorage(){return this.columnShareStorage.copy()}findRelationViewModel(e){return this.relationViewModelStorage.findByRelationId(e)}fetchRelationsByTableIds(e){return e.length===0?[]:this.relationViewModelStorage.fetchRelationsByTableIds(e)}getRelationViewModels(){return this.relationViewModelStorage.getModels()}inChildRelation(e,n){return this.relationViewModelStorage.inChildRelation(e,n)}findParentRelation(e,n){return this.relationViewModelStorage.findParentRelation(e,n)}findRelatedRelations(e){let n=this.relationViewModelStorage.fetchRelationsByParent(e),r=this.relationViewModelStorage.fetchRelationsByChild(e);return{parentRelations:n,childRelations:r}}findMemoViewModel(e){return this.memoViewModelStorage.find(e)}getMemoViewModels(){return this.memoViewModelStorage.getMemos()}updateSchema(e){return this.schemaConfig.equals(e)?this:this.doUpdate({schemaConfig:e})}updateTableMeta(...e){let n=new Map(this.tableViewModelMap);return e.forEach(r=>{n.set(r.tableId,r)}),this.doUpdate({tableViewModelMap:n})}updateTableViewWithColumns(e,n,r=null){let o=r||this.columnShareStorage,i=this.tableViewModelMap.get(e.tableId);if(i==null)return this.doAddTableViewModel(e,n,o);let{nextTableViewModels:a,nextColumnModelMap:s,nextRelationViewModelStorage:l}=this.doUpdateTableViewModelWithRelation(i,e,n,o),c=new Map(this.tableViewModelMap);a.forEach(d=>{c.set(d.tableId,d)});let m=new Map(this.columnModelMap);return s.forEach(d=>m.set(d.columnModelId,d)),this.doUpdate({tableViewModelMap:c,columnModelMap:m,columnShareModelStorage:o.copy(),relationViewModelStorage:l})}doAddTableViewModel(e,n,r){let o=[...this.tableViewModelIds,e.tableId],i=new Map(this.tableViewModelMap);i.set(e.tableId,e);let a=new Map(this.columnModelMap);return n.forEach(l=>a.set(l.columnModelId,l)),this.doUpdateTableCheckExpression(e,a,r).forEach(l=>i.set(l.tableId,l)),this.doUpdate({tableViewModelIds:o,tableViewModelMap:i,columnModelMap:a,columnShareModelStorage:r.copy()})}doUpdateTableCheckExpression(e,n,r){if(r.equals(this.columnShareStorage)===!0)return[];let o=e.tableModel.columnEntries.map(s=>{if(s.modelType!=="single")return null;let l=n.get(s.columnModelId);if(l==null||ce.isSimpleColumn(l)===!1)return null;let c=this.columnShareStorage.findColumnShare(l.columnShareModelId),m=r.findColumnShare(l.columnShareModelId);return c==null||m==null||c.physicalName===m.physicalName?null:{previousColumnShare:c,nextColumnShare:m}}).filter(s=>s!==null);if(o.length===0)return[];let i=new Map(o.map(s=>[s.nextColumnShare.columnShareModelId,s]));return Array.from(this.tableViewModelMap.entries()).map(([s,l])=>{let c=l.tableModel;if(c.checkExpression==""||s===e.tableId)return null;let m=this.toAllColumnsExceptStruct(c).map(h=>{let g=i.get(h.columnShareModelId);if(g==null)return null;let b=mt(h,g.previousColumnShare),y=mt(h,g.nextColumnShare);return b.physicalName===y.physicalName?null:{previousName:b,nextName:y}}).filter(h=>h!==null),d=c.updateCheckExpression(m);return d===c?null:(console.debug(`Update checkExpression. tableId: ${s}, tableName: ${c.physicalName}, before: ${c.checkExpression}, after: ${d.checkExpression}`),new be({...l,tableModel:d}))}).filter(s=>s!==null)}doUpdateTableViewModelWithRelation(e,n,r,o){let i=new Map(r.map(M=>[M.columnModelId,M])),a=this.relationViewModelStorage.fetchRelationsByParent(n.tableId),s=new Map(this.columnModelMap);r.forEach(M=>s.set(M.columnModelId,M));let l=this.doUpdateTableCheckExpression(n,s,o),c=[n,...l];if(a.length===0)return{nextTableViewModels:c,nextColumnModelMap:i,nextRelationViewModelStorage:this.relationViewModelStorage};let m=n.tableModel.columnEntries.flatMap(M=>{if(M.modelType==="single"){let v=i.get(M.columnModelId);return v!=null?[v]:[]}let R=this.columnGroupModelMap.get(M.columnGroupId);return R==null?[]:R.columnModelIds.map(v=>this.findColumnModel(v)).filter(v=>v!=null)}).filter(ce.isSimpleColumn).filter(M=>M.primaryKey===!0),d=this.toAllColumnsExceptStruct(e.tableModel),h=d.filter(M=>M.primaryKey===!0&&m.some(R=>R.columnModelId===M.columnModelId)===!1).map(M=>M.columnModelId),g=d.filter(M=>M.primaryKey===!0).map(M=>M.columnModelId),b=m.filter(M=>g.includes(M.columnModelId)===!1);if(h.length===0&&b.length===0)return{nextTableViewModels:c,nextColumnModelMap:i,nextRelationViewModelStorage:this.relationViewModelStorage};let y=new Map(c.map(M=>[M.tableId,M])),N=this.doUpdateRelationWithPrimaryKeyChanged(a,y,i,b,h);return{...N,nextTableViewModels:Array.from(N.nextTableViewMap.values())}}doUpdateRelationWithPrimaryKeyChanged(e,n,r,o,i,a=null){let s=new Map(n),l=new Map(r),c=new Map,m=new Set;if(i.length>0)for(let d of e){let h=d.relationModel,g=h.relationPairs.filter(y=>i.includes(y.parentColumnModelId)===!1);if(h.relationPairs.length===g.length)continue;g.length===0&&m.add(d.relationId);let b=new qe({...d.relationModel,relationPairs:g});c.set(b.relationModelId,b)}if(o.length>0)for(let d of e){let h=c.get(d.relationId)||d.relationModel,g=s.get(h.childTableModelId)||this.tableViewModelMap.get(h.childTableModelId);if(g==null)continue;if(a===null?!1:g.tableModel.columnEntries.some(H=>H.modelType==="group"&&H.columnGroupId===a.columnGroupId)){let H=[...h.relationPairs,...o.map(ci=>new dt({parentColumnModelId:ci.columnModelId,childColumnModelId:ci.columnModelId}))],Ge=new qe({...h,relationPairs:H});c.set(Ge.relationModelId,Ge),m.delete(Ge.relationModelId);continue}let y=Sc(h.childCardinality),N=o.map(H=>{let Ge=new ut({columnModelId:X(),columnShareModelId:H.columnShareModelId,physicalName:H.physicalName,logicalName:H.logicalName,notNull:y});return{columnModel:Ge,relationPair:new dt({parentColumnModelId:H.columnModelId,childColumnModelId:Ge.columnModelId})}}),M=N.map(H=>H.columnModel),R=N.map(H=>H.relationPair);M.forEach(H=>{l.set(H.columnModelId,H)});let v=g.tableModel,z=new be({...g,tableModel:new Ze({...v,columnEntries:[...v.columnEntries,...M.map(H=>({modelType:"single",columnModelId:H.columnModelId}))]})});s.set(z.tableId,z);let me=[...h.relationPairs,...R],pe=new qe({...h,relationPairs:me});c.set(pe.relationModelId,pe),m.delete(pe.relationModelId)}return m.forEach(d=>c.delete(d)),{nextTableViewMap:s,nextColumnModelMap:l,nextRelationViewModelStorage:this.relationViewModelStorage.updateRelationModel(Array.from(c.values())).deleteRelation(Array.from(m))}}deleteTable(e){if(this.tableViewModelMap.get(e)==null)return this;let r=this.tableViewModelIds.filter(i=>i!==e),o=new Map(this.tableViewModelMap);return o.delete(e),this.doUpdate({tableViewModelIds:r,tableViewModelMap:o,columnModelMap:this.columnModelMap,relationViewModelStorage:this.relationViewModelStorage.deleteFromTableId([e])})}updateColumnGroup(e,n,r){let o=this.columnGroupModelMap.get(e.columnGroupId)||null,i=new Map(this.columnGroupModelMap);i.set(e.columnGroupId,e);let a=new Map(this.columnModelMap);n.forEach(m=>{a.set(m.columnModelId,m)});let{nextTableViewMap:s,nextColumnModelMap:l,nextRelationViewModelStorage:c}=this.doUpdateTableViewModelsWithUpdatingColumnGroup(o,e,n,a,r);return this.doUpdate({tableViewModelMap:s.size>0?new Map([...this.tableViewModelMap,...s]):this.tableViewModelMap,columnGroupModelMap:i,columnModelMap:l,columnShareModelStorage:r.copy(),relationViewModelStorage:c})}doUpdateTableViewModelsWithUpdatingColumnGroup(e,n,r,o,i){let a=Array.from(this.tableViewModelMap.values()).filter(M=>M.tableModel.columnEntries.some(R=>R.modelType==="group"&&R.columnGroupId===n.columnGroupId)),s=new Map;if(a.length===0)return{nextTableViewMap:s,nextColumnModelMap:o,nextRelationViewModelStorage:this.relationViewModelStorage};let l=r.filter(ce.isSimpleColumn).map(M=>{let R=this.columnModelMap.get(M.columnModelId);if(R==null||ce.isSimpleColumn(R)===!1)return null;let v=this.columnShareStorage.findColumnShare(R.columnShareModelId);if(v==null)return null;let z=i.findColumnShare(M.columnShareModelId);if(z==null)return null;let me=mt(R,v),pe=mt(M,z);return me.physicalName===pe.physicalName?null:{previousName:me,nextName:pe}}).filter(M=>M!==null),c=new Set,m=a.map(M=>{let R=M.tableModel,v=R.updateCheckExpression(l);if(v===R)return M;c.add(M.tableId),console.debug(`Update checkExpression. tableId: ${M.tableId}, tableName: ${R.physicalName}, before: ${R.checkExpression}, after: ${v.checkExpression}`);let z=new be({...M,tableModel:v});return s.set(z.tableId,z),z}),d=new Set(e==null?[]:e.columnModelIds.filter(M=>n.columnModelIds.includes(M)===!1));if(d.size>0)for(let M of m){let R=M.tableModel,v=ht.filterColumns(R.uniqueKeysModels,pe=>d.has(pe.columnModelId)===!1),z=pt.filterColumns(R.tableIndexModels,pe=>d.has(pe.columnModelId)===!1);if(c.has(M.tableId)===!1&&v.hasChanged===!1&&z.hasChanged===!1)continue;let me=new be({...M,tableModel:new Ze({...R,uniqueKeysModels:v.tableUniqueKeysModels,tableIndexModels:z.tableIndexModels})});s.set(me.tableId,me)}let h=e==null?[]:e.columnModelIds.map(M=>this.columnModelMap.get(M)).filter(M=>M!=null&&ce.isSimpleColumn(M)&&M.primaryKey===!0).map(M=>M.columnModelId),g=n.columnModelIds.map(M=>o.get(M)).filter(M=>M!=null&&ce.isSimpleColumn(M)&&M.primaryKey===!0),b=h.filter(M=>g.every(R=>R.columnModelId!==M)),y=g.filter(M=>h.includes(M.columnModelId)===!1),N=a.flatMap(M=>this.relationViewModelStorage.fetchRelationsByParent(M.tableId));return this.doUpdateRelationWithPrimaryKeyChanged(N,s,o,y,b,n)}deleteColumnGroup(e){let n=this.columnGroupModelMap.get(e);if(n==null)return this;let r=new Map(this.columnGroupModelMap);r.delete(e);let{nextTableViewModelMap:o,nextRelationViewModelStorage:i}=this.doUpdateTableViewModelsWithDeletingColumnGroup(n);return this.doUpdate({tableViewModelMap:o,columnGroupModelMap:r,columnModelMap:this.columnModelMap,relationViewModelStorage:i})}doUpdateTableViewModelsWithDeletingColumnGroup(e){let r=e.columnModelIds.map(g=>this.columnModelMap.get(g)).filter(g=>g!=null&&ce.isSimpleColumn(g)).filter(g=>g.primaryKey===!0).map(g=>g.columnModelId),o=new Map(this.tableViewModelMap),i=[],a=[],s=new Set,l=!1;for(let[g,b]of this.tableViewModelMap.entries()){let y=b.tableModel.columnEntries.filter(z=>z.modelType!=="group"||z.columnGroupId!==e.columnGroupId);if(b.tableModel.columnEntries.length===y.length)continue;if(l=!0,y.length===0){o.delete(g),a.push(g);continue}i.push(b.tableModel);let N=z=>e.columnModelIds.includes(z)===!1,M=ht.filterColumns(b.tableModel.uniqueKeysModels,z=>N(z.columnModelId)),R=pt.filterColumns(b.tableModel.tableIndexModels,z=>N(z.columnModelId)),v=new be({...b,tableModel:new Ze({...b.tableModel,columnEntries:y,uniqueKeysModels:M.tableUniqueKeysModels,tableIndexModels:R.tableIndexModels})});o.set(g,v)}let c=r.length===0?new Map:new Map(i.flatMap(g=>this.relationViewModelStorage.fetchRelationsByParent(g.tableModelId).map(b=>{let y=b.relationModel.relationPairs.filter(N=>r.includes(N.parentColumnModelId)===!1);return y.length===0?(s.add(b.relationId),null):new qe({...b.relationModel,relationPairs:y})}).filter(b=>b!=null)).map(g=>[g.relationModelId,g])),m=new Set(e.columnModelIds);i.flatMap(g=>this.relationViewModelStorage.fetchRelationsByChild(g.tableModelId)).filter(g=>s.has(g.relationId)===!1).map(g=>c.get(g.relationId)??g.relationModel).filter(g=>g.relationPairs.some(b=>m.has(b.childColumnModelId))).map(g=>g.relationModelId).forEach(g=>s.add(g));let h=this.relationViewModelStorage.updateRelationModel(Array.from(c.values())).deleteFromTableId(a).deleteRelation(Array.from(s));return{nextTableViewModelMap:l?o:this.tableViewModelMap,nextRelationViewModelStorage:h}}updateStructColumnShare(e,n=[]){let r=this.columnShareStorage.addStructShare(...e);if(n.length===0)return this.doUpdate({columnShareModelStorage:r});let o=new Map(this.columnModelMap);return n.forEach(i=>o.set(i.columnModelId,i)),this.doUpdate({columnModelMap:o,columnShareModelStorage:r})}deleteStructColumnShare(e){if(this.columnShareStorage.findStructShare(e)==null)return this;let r=new Set(Array.from(this.columnModelMap.values()).filter(d=>d.entityType==="struct"&&d.structShareModelId===e).map(d=>d.columnModelId)),o=[...this.tableViewModelIds],i=new Map(this.tableViewModelMap),a=[];for(let[d,h]of this.tableViewModelMap.entries()){let g=h.tableModel.columnEntries.filter(y=>y.modelType!=="single"||r.has(y.columnModelId)===!1);if(g.length===h.tableModel.columnEntries.length)continue;if(g.length===0){i.delete(d),a.push(d);continue}let b=new be({...h,tableModel:new Ze({...h.tableModel,columnEntries:g})});i.set(d,b)}let s=a.length>0?this.relationViewModelStorage.deleteFromTableId(a):this.relationViewModelStorage,l=a.length>0?o.filter(d=>a.includes(d)===!1):o,c=new Map(this.columnGroupModelMap);for(let[d,h]of this.columnGroupModelMap.entries()){let g=h.columnModelIds.filter(b=>r.has(b)===!1);g.length!==h.columnModelIds.length&&c.set(d,new sn({...h,columnModelIds:g}))}let m=this.columnShareStorage.getStructShareModels().filter(d=>d.structShareModelId!==e).reduce((d,h)=>{let g=h.columnEntries.filter(b=>b.modelType!=="single"||r.has(b.columnModelId)===!1);return g.length===h.columnEntries.length?d:d.addStructShare(new ct({...h,columnEntries:g}))},this.columnShareStorage).deleteStructShare([e]);return this.doUpdate({tableViewModelIds:l,tableViewModelMap:i,columnGroupModelMap:c,columnModelMap:this.columnModelMap,columnShareModelStorage:m,relationViewModelStorage:s})}updateColumnModels(e,n){if(e.length===0&&n.length===0)return this;let r=this.columnShareStorage.addColumnShare(...n);if(e.length===0)return this.doUpdate({columnShareModelStorage:r});let o=new Map(this.columnModelMap);return e.forEach(i=>{o.set(i.columnModelId,i)}),this.doUpdate({columnModelMap:o,columnShareModelStorage:r})}updateRelation(e){let n=e.relationModel,r=this.tableViewModelMap.get(n.childTableModelId);if(r==null)return this;let o=r.tableModel,a=n.relationPairs.map(c=>({parentColumnModelId:c.parentColumnModelId,childColumnModelId:c.childColumnModelId,childColumnModel:this.findColumnModel(c.childColumnModelId)})).filter(c=>c.childColumnModel==null).map(c=>{let m=this.findColumnModel(c.parentColumnModelId);return new ut({columnModelId:c.childColumnModelId,columnShareModelId:m.columnShareModelId,physicalName:m.physicalName,logicalName:m.logicalName,notNull:Sc(n.childCardinality)})}),s;a.length>0?(s=new Map(this.tableViewModelMap),s.set(o.tableModelId,new be({...r,tableModel:o.addColumnModelIds(a.map(c=>c.columnModelId))}))):s=this.tableViewModelMap;let l;return a.length>0?(l=new Map(this.columnModelMap),a.forEach(c=>l.set(c.columnModelId,c))):l=this.columnModelMap,this.doUpdate({tableViewModelMap:s,columnModelMap:l,relationViewModelStorage:this.relationViewModelStorage.updateRelationView(e)})}deleteRelation(e){return this.doUpdateRelationStorage(()=>this.relationViewModelStorage.deleteRelation([e]))}updateRelationLine(e,n){return this.doUpdateRelationStorage(()=>this.relationViewModelStorage.updateLineView(e,n))}updateRelationLabel(e,n){return this.doUpdateRelationStorage(()=>this.relationViewModelStorage.updateLabelView(e,n))}updateRelationLineBy(e,n){let r=this.findRelationViewModel(e);if(r==null)return this;let o=r.lineViewModel,i=n(o);return o.equals(i)?this:this.updateRelationLine(e,i)}updateRelationLabelBy(e,n){let r=this.findRelationViewModel(e);if(r==null)return this;let o=r.labelViewModel,i=n(o);return i.equals(o)?this:this.updateRelationLabel(e,i)}deleteSelectedElements(e){let n=e.relationId!=null&&e.relationId!==""?this.deleteRelation(e.relationId):this,r=Array.from(e.tableIds).reduce((o,i)=>o.deleteTable(i),n);return Array.from(e.memoIds).reduce((o,i)=>o.deleteMemo(i),r)}updateRelationOrthogonal(e){return this.doUpdateRelationStorage(()=>this.relationViewModelStorage.updateRelationOrthogonal(e))}doUpdateRelationStorage(e){let n=e();return this.relationViewModelStorage===n?this:this.doUpdate({relationViewModelStorage:n})}updateTableViewColor(e,n,r){if(e.length===0)return this;let o=i=>new be({...i,headerColor:{background:n,foreground:r}});return this.doUpdateTableRectangle(e,o)}moveTableView(e,n,r){if(e.size===0)return this;let o=a=>new be({...a,corner:{left:a.corner.left+n.x,top:a.corner.top+n.y}}),i=this.relationViewModelStorage.moveRelation(e,n).updateRelationOrthogonal(r);return this.doUpdateTableRectangle([...e],o,i)}doUpdateTableRectangle(e,n,r=null){if(e.length===0)return this;let o=new Map(this.tableViewModelMap);return e.forEach(i=>{let a=this.tableViewModelMap.get(i);a!=null&&o.set(i,n(a))}),this.doUpdate({tableViewModelMap:o,relationViewModelStorage:r??this.relationViewModelStorage})}addMemo(e){return this.doUpdateMemoViewModel(()=>this.memoViewModelStorage.addMemo(e))}updateMemo(e){return this.doUpdateMemoViewModel(()=>this.memoViewModelStorage.updateMemo(e))}deleteMemo(e){return this.doUpdateMemoViewModel(()=>this.memoViewModelStorage.deleteMemo(e))}arrangeMemo(e,n){return this.doUpdateMemoViewModel(()=>this.memoViewModelStorage.arrangeMemo(e,n))}doUpdateMemoViewModel(e){let n=e();return n===this.memoViewModelStorage?this:this.doUpdate({memoViewModelStorage:n})}moveMemoView(e,n){if(e.size===0)return this;let r=this.memoViewModelStorage.moveMemo(e,n);return r===this.memoViewModelStorage?this:this.doUpdate({memoViewModelStorage:r})}updateDocumentName(e){return this.documentName===e?this:this.doUpdate({documentName:e})}updateErdSetting(e){return this.erdSettingModel===e?this:this.doUpdate({erdSettingModel:e})}importDdl({tableViewModels:e,columnModels:n,columnShareModels:r,relationViewModels:o}){let i=[...this.tableViewModelIds,...e.map(m=>m.tableId)],a=new Map(this.tableViewModelMap);e.forEach(m=>a.set(m.tableId,m));let s=new Map(this.columnModelMap);n.forEach(m=>s.set(m.columnModelId,m));let l=this.columnShareStorage.addColumnShare(...r),c=new dn([...this.relationViewModelStorage.getModels(),...o]);return this.doUpdate({tableViewModelIds:i,tableViewModelMap:a,columnModelMap:s,columnShareModelStorage:l,relationViewModelStorage:c})}toJSON(){let e=this.getDatabase(),n=this.tableViewModelIds.map(l=>this.tableViewModelMap.get(l)).filter(l=>l!=null).map(l=>l.toJSON()),r=Array.from(this.columnGroupModelMap.values()).sort((l,c)=>l.groupName.localeCompare(c.groupName,"en")).map(l=>l.toJSON()),o=this.getStructColumnShareModels().map(l=>l.toJSON()),i=Array.from(this.columnModelMap.values()).sort((l,c)=>l.columnModelId.localeCompare(c.columnModelId,"en")).map(l=>l.toJSON()),{frontMemos:a,backMemos:s}=this.memoViewModelStorage.getMemos();return{documentName:this.documentName,lastUpdatedAt:this.lastUpdatedAt,...e.supportsSchema&&{schemaConfig:this.schemaConfig.toJSON()},tableViewModels:n,columnGroupModels:r,...o.length>0&&{structColumnShareModels:o},columnModels:i,columnShareModels:this.columnShareStorage.getColumnShareModels().map(l=>l.toJSON()),relationViewModels:this.relationViewModelStorage.getModels().map(l=>l.toJSON()),foregroundMemos:a.map(l=>l.toJSON()),backgroundMemos:s.map(l=>l.toJSON()),erdSettingModel:this.erdSettingModel.toJSON(),databaseSetting:this.databaseSettingModel.toJSON()}}static toObject(e){S(e,"documentName"),S(e,"tableViewModels"),S(e,"columnModels"),S(e,"columnShareModels"),S(e,"relationViewModels"),S(e,"erdSettingModel"),S(e,"databaseSetting");let n=cn.toObject(e.erdSettingModel),r=Fn.toObject(e.databaseSetting),o=r.initToColumnTypeMapping(),i="schemaConfig"in e?Cr.toObject(e.schemaConfig):Cr.create(),a=j(e.tableViewModels,"tableViewModels",y=>be.toObject(y)),s="columnGroupModels"in e?j(e.columnGroupModels,"columnGroupModels",y=>sn.toObject(y)):[],l="structColumnShareModels"in e?j(e.structColumnShareModels,"structColumnShareModels",y=>ct.toObject(y)):[],c=j(e.columnModels,"columnModels",y=>ce.toObject(y)),m=j(e.columnShareModels,"columnShareModels",y=>qn.toObject(y,o)),d=j(e.relationViewModels,"relationViewModels",y=>Ne.toObject(y)),h="foregroundMemos"in e?j(e.foregroundMemos,"foregroundMemos",y=>un.toObject(y)):[],g="backgroundMemos"in e?j(e.backgroundMemos,"backgroundMemos",y=>un.toObject(y)):[],b="lastUpdatedAt"in e?Ve(e.lastUpdatedAt):new Date;return t.create({documentName:e.documentName,erdSettingModel:n,schemaConfig:i,tableViewModels:a,columnGroupModels:s,structShareModels:l,columnModels:c,columnShareModels:m,relationViewModels:d,foregroundMemoViewModels:h,backgroundMemoViewModels:g,databaseSettingModel:r,lastUpdatedAt:b})}equals(e){if(this===e)return!0;if(this.documentName!==e.documentName||this.tableViewModelIds.length!==e.tableViewModelIds.length)return!1;for(let n=0;n<this.tableViewModelIds.length;n++)if(this.tableViewModelIds[n]!==e.tableViewModelIds[n])return!1;if(this.tableViewModelMap.size!==e.tableViewModelMap.size)return!1;for(let[n,r]of this.tableViewModelMap.entries()){let o=e.tableViewModelMap.get(n);if(o==null||r.equals(o)===!1)return!1}if(this.columnGroupModelMap.size!==e.columnGroupModelMap.size)return!1;for(let[n,r]of this.columnGroupModelMap.entries()){let o=e.columnGroupModelMap.get(n);if(o==null||r.equals(o)===!1)return!1}if(this.columnModelMap.size!==e.columnModelMap.size)return!1;for(let[n,r]of this.columnModelMap.entries()){let o=e.columnModelMap.get(n);if(o==null||ce.equals(r,o)===!1)return!1}return!(this.columnShareStorage.equals(e.columnShareStorage)===!1||this.relationViewModelStorage.equals(e.relationViewModelStorage)===!1||this.memoViewModelStorage.equals(e.memoViewModelStorage)===!1||this.erdSettingModel.equals(e.erdSettingModel)===!1||this.databaseSettingModel.equals(e.databaseSettingModel)===!1||this.schemaConfig.equals(e.schemaConfig)===!1)}reuseInstancesFrom(e){let n=Wh(e.tableViewModelIds,this.tableViewModelIds),r=Ho(e.tableViewModelMap,this.tableViewModelMap,(g,b)=>g.equals(b)),o=Ho(e.columnGroupModelMap,this.columnGroupModelMap,(g,b)=>g.equals(b)),i=Ho(e.columnModelMap,this.columnModelMap,(g,b)=>ce.equals(g,b)),a=this.columnShareStorage.reuseInstancesFrom(e.columnShareStorage),s=this.relationViewModelStorage.reuseInstancesFrom(e.relationViewModelStorage),l=this.memoViewModelStorage.reuseInstancesFrom(e.memoViewModelStorage),c=this.erdSettingModel.equals(e.erdSettingModel)===!0?e.erdSettingModel:this.erdSettingModel,m=this.databaseSettingModel.equals(e.databaseSettingModel)===!0?e.databaseSettingModel:this.databaseSettingModel,d=this.schemaConfig.equals(e.schemaConfig)===!0?e.schemaConfig:this.schemaConfig;return(this.documentName===e.documentName&&n===e.tableViewModelIds&&r===e.tableViewModelMap&&o===e.columnGroupModelMap&&i===e.columnModelMap&&a===e.columnShareStorage&&s===e.relationViewModelStorage&&l===e.memoViewModelStorage&&c===e.erdSettingModel&&m===e.databaseSettingModel&&d===e.schemaConfig)===!0?e:new t(this.documentName,c,m,d,n,r,o,i,a,s,l,this.lastUpdatedAt)}},bc=t=>t.flatMap(e=>e.modelType==="single"?[e.columnModelId]:[]),Wh=(t,e)=>t.length!==e.length?e:e.every((r,o)=>t[o]===r)?t:e,Ho=(t,e,n)=>{let r=t.size===e.size,o=Array.from(e.entries()).map(([i,a])=>{let s=t.get(i);return s!=null&&n(s,a)?[i,s]:(r=!1,[i,a])});return r?t:new Map(o)},Sc=t=>t==="1"||t==="1..N";var vr=class{constructor(){this.uriToIdMap=new Map,this.idToBudgetMap=new Map}async create(e,n){let r=Zt.resolve(e);if(Fe.existsSync(r))throw qo(`File already exists: ${r}`);let o=Zt.dirname(r);if(Fe.existsSync(o)===!1)throw qo(`Directory does not exist: ${o}`);let i=wc(n);return Fe.writeFileSync(r,i),this.doRegister(r,n)}tryRegister(e){let n=Zt.resolve(e);return Fe.existsSync(n)===!1?null:this.register(n)}register(e){let n=Zt.resolve(e),r=Fe.readFileSync(n,"utf-8"),o=mn.toObject(JSON.parse(r));return this.doRegister(n,o).documentId}load(e){let n=Zt.resolve(e),r=Fe.readFileSync(n,"utf-8"),o=mn.toObject(JSON.parse(r));return this.doRegister(n,o),o}doRegister(e,n){let r=(0,xc.pathToFileURL)(e).href,o=gi(r);return this.uriToIdMap.set(r,o),this.idToBudgetMap.set(o,{documentId:o,fileUri:r,filePath:e,erdDocument:n}),{documentId:o,fileUri:r}}notify(e,n){let r=this.idToBudgetMap.get(e);if(r==null||r.erdDocument===n)return;let o=wc(n);Fe.writeFileSync(r.filePath,o),this.idToBudgetMap.set(e,{...r,erdDocument:n})}fetchDocuments(){return Array.from(this.idToBudgetMap.values()).map(e=>Mc(e))}findById(e){let n=this.idToBudgetMap.get(e);return n==null?null:Mc(n)}findByUri(e){let n=this.uriToIdMap.get(e);return n==null?null:this.findById(n)}},wc=t=>JSON.stringify(t.toJSON(),null,4),Mc=t=>new fn({documentId:t.documentId,uri:t.fileUri,erdDocument:t.erdDocument,rectangles:new Map});var Qe=class{constructor(){}static load(e){let n=ic(e);try{return{resultType:"loaded",erdDocument:new vr().load(n)}}catch(r){let o=r instanceof Error?r.message:String(r);return{resultType:"failed",message:`Failed to load document: ${n}
28
- cause: ${o}`}}}};var Er=class{static find(e,n){return Zn(e).find(i=>Jh(i,n))||null}},Jh=(t,e)=>{let n=t.baseQuery.replace("[[PARAM]]","").toUpperCase(),r=e.timezone!==""?` ${e.timezone}`:"",o=e.precision==="max"?"(MAX)":"",i=`${e.columnType}${r}${o}`.toUpperCase();return n!==i?!1:e.precision==="max"?!0:!(e.precision!=null&&t.withPrecision===!1||e.scale!=null&&t.withScale===!1)};var Ar=(t,e,n,r)=>{if(r.withComment===!1)return"";if(r.commentStyle==="logical_name")return e!==t?e:"";let o=n!==""?`${e}${r.commentSeparator}${n}`:e;return o!==t?o:""};var yt=class{static ofDesignedColumn(e,n){let r=e.columnShare.columnType,o=Hh(r,e.columnModel.autoIncrement),i=Ic(o.resolvedType,e.columnShare.precision,e.columnShare.scale,e.columnShare.isArray),a=Ar(e.physicalName,e.logicalName,e.columnShare.description,e.commentOption);return{columnName:e.physicalName,logicalName:n.withLogicalName?e.logicalName:"",typeExpression:i,unsigned:e.columnShare.unsigned,notNull:e.columnModel.notNull,defaultValue:Tc(e.columnModel.defaultValue),autoIncrement:o.autoIncrement,comment:a}}static ofDatabaseColumn(e){let n=Xh(e.databaseType,e.typeQuery,e.declaredExpression),r=e.autoIncrement===!0?"":Tc(e.defaultValue??"");return{columnName:e.columnName,logicalName:"",typeExpression:n,unsigned:e.unsigned,notNull:e.notNull,defaultValue:r,autoIncrement:e.autoIncrement,comment:e.comment}}},Hh=(t,e)=>{let n=t.foreignColumn!=null,r=n?t.foreignColumn:t,o=e&&t.withAutoIncrement||n;return{resolvedType:r,autoIncrement:o}},Xh=(t,e,n)=>{let r=Er.find(t,e);return r==null?n.toUpperCase():Ic(r,String(e.precision??""),String(e.scale??""),e.isArray)},Ic=(t,e,n,r)=>t.specifiedType({precision:e,scale:n,isArray:r,inChildRelation:!1}).toUpperCase(),Tc=t=>{let e=t.trim();if(e===""||e.toUpperCase()==="NULL")return"";let n=e.replace(ef,"");return tf(n).trim().toUpperCase()},ef=/::([A-Za-z_][A-Za-z0-9_]*\.)?[A-Za-z_][A-Za-z0-9_ ]*(\[\])?$/,tf=t=>{let e=t.trim();return e.length>=2&&e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1).replaceAll("''","'"):e};var we=class{constructor(){}static toSchemaSnapshot(e,n){let r=e.getDatabase().databaseType,o=nf(e,n),i=rf(e,n),a=e.getTableViewModels().map(c=>af(e,c,n,i)),s=a.map(c=>c.table),l=a.flatMap(c=>c.warnings);return{databaseType:r,schemaNames:o,tables:s,warnings:l}}static toDeclaredTableSchemaNames(e){let n=e.tables.map(r=>r.schemaName).filter(r=>r!=="");return Array.from(new Set(n))}},nf=(t,e)=>{let n=t.getDatabase();if(n.supportsSchema===!1||e.withSchema===!1)return[];let r=t.schemaConfig.getSchemas().map(o=>o.schemaName);return r.length===0&&n.defaultSchemaName!==""?[n.defaultSchemaName]:r},rf=(t,e)=>{let n=new Map;return e.withForeignKey===!1||t.getRelationViewModels().forEach(r=>{let o=r.relationModel,i=of(t,o),a=n.get(o.childTableModelId)??[];a.push(i),n.set(o.childTableModelId,a)}),n},of=(t,e)=>{let r=t.findTableViewModel(e.parentTableModelId).tableModel,o=e.relationPairs.map(a=>Cc(t,a.childColumnModelId)),i=e.relationPairs.map(a=>Cc(t,a.parentColumnModelId));return{constraintName:"",columnNames:o,parentSchemaName:_c(t,r),parentTableName:r.physicalName,parentColumnNames:i,onUpdate:e.onUpdateAction,onDelete:e.onDeleteAction}},Cc=(t,e)=>{let n=t.findColumnModel(e),r=t.findColumnShareModel(n.columnShareModelId);return mt(n,r).physicalName},af=(t,e,n,r)=>{let o=t.getDatabase(),i=e.tableModel,a=_c(t,i),s=sf(t),l=lf(t,i,s,n),c=Ar(i.physicalName,i.logicalName,i.description,s),m=n.withLogicalName?i.logicalName:"",d=l.contexts.filter(b=>b.columnModel.primaryKey).map(b=>b.physicalName),h={schemaName:a,tableName:i.physicalName,logicalName:m,comment:c,columns:l.columns,primaryKeyColumnNames:d,uniqueKeys:df(i,l.contexts),indexes:mf(i,l.contexts,n,o.databaseType),foreignKeys:r.get(i.tableModelId)??[]},g=l.warnings.map(b=>({...b,schemaName:a,tableName:i.physicalName}));return{table:h,warnings:g}},_c=(t,e)=>{let n=t.getDatabase();if(n.supportsSchema===!1)return"";let r=t.findSchema(e.schemaId);return r!=null?r.schemaName:n.defaultSchemaName},sf=t=>{let e=t.erdSettingModel.exportDdlSetting;return{withComment:!0,commentStyle:e.commentStyle,commentSeparator:e.commentSeparator}},lf=(t,e,n,r)=>{let o=t.toAllColumnsWithStruct(e),i=o.filter(ce.isStructColumn).length,a=i>0?[{category:"struct.skipped",schemaName:"",tableName:"",message:`${i} struct column(s) are not supported by schema verification and were excluded from comparison.`}]:[],s=o.filter(ce.isSimpleColumn).map(c=>cf(t,c));return{columns:s.map(c=>uf(c,n,r)),contexts:s,warnings:a}},cf=(t,e)=>{let n=t.findColumnShareModel(e.columnShareModelId),r=mt(e,n);return{columnModelId:e.columnModelId,columnModel:e,columnShareModel:n,physicalName:r.physicalName,logicalName:r.logicalName}},uf=(t,e,n)=>{let r={columnModel:t.columnModel,columnShare:t.columnShareModel,physicalName:t.physicalName,logicalName:t.logicalName,commentOption:e};return yt.ofDesignedColumn(r,n)},df=(t,e)=>{let n=new Map(e.map(a=>[a.columnModelId,a.physicalName])),r=t.uniqueKeysModels.map(a=>{let s=a.uniqueKeysColumnModels.map(l=>n.get(l.columnModelId)).filter(l=>l!=null);return{constraintName:a.physicalName,columnNames:s}}),o=e.filter(a=>a.columnModel.unique).map(a=>({constraintName:"",columnNames:[a.physicalName]})),i=t.tableIndexModels.filter(a=>a.indexOption==="UNIQUE").map(a=>{let s=a.indexColumnModels.map(l=>n.get(l.columnModelId)).filter(l=>l!=null);return{constraintName:a.physicalName,columnNames:s}});return[...r,...o,...i]},mf=(t,e,n,r)=>{if(n.withIndex===!1)return[];let o=new Map(e.map(i=>[i.columnModelId,i.physicalName]));return t.tableIndexModels.filter(i=>i.indexOption!=="UNIQUE").map(i=>{let a=i.indexColumnModels.map(l=>o.get(l.columnModelId)).filter(l=>l!=null),s=pf(i.indexType,i.indexOption,r);return{indexName:i.physicalName,columnNames:a,indexOption:i.indexOption,indexType:s}})},pf=(t,e,n)=>t!==""||e==="FULLTEXT"||e==="SPATIAL"?t:hf[n],hf={postgres:"BTREE",mysql:"BTREE",mariadb:"BTREE",ms_sqlserver:"",sqlite:"",bigquery:"",snowflake:""};var Ft=(t,e)=>t.length===e.length&&t.every((n,r)=>n===e[r]);var Qt=class{constructor(){}static match(e,n,r){return ff(e,n,r)}},ff=(t,e,n)=>{let r=d=>n?`${d.schemaName} ${d.tableName}`:d.tableName,o=new Map(e.map(d=>[r(d),d])),i=new Map(e.map(d=>[r(d).toUpperCase(),d])),a=new Set,s=[],l=[],c=[];t.forEach(d=>{let h=r(d),g=o.get(h);if(g!=null){s.push({expected:d,actual:g}),a.add(r(g));return}let b=i.get(h.toUpperCase());if(b==null||a.has(r(b))){l.push(d);return}let y={expected:d,actual:b};s.push(y),c.push(y),a.add(r(b))});let m=e.filter(d=>a.has(r(d))===!1);return{pairs:s,missingExpected:l,unexpectedActual:m,caseFoldedPairs:c}};var pn=class{constructor(){}static compare(e,n,r){let o=Qt.match(e.tables,n.tables,r.withSchema),a=ee.get(n.databaseType).caseSensitiveColumnName,s=yf(e.schemaNames,n.schemaNames),l=o.missingExpected.map(b=>W("table.missing",b.schemaName,b.tableName,b.tableName,Pr,ve)),c=o.unexpectedActual.map(b=>W("table.unexpected",b.schemaName,b.tableName,b.tableName,ve,Pr)),m=o.pairs.map(b=>bf(b.expected,b.actual,r,a)),d=o.caseFoldedPairs.map(b=>gf(b)),h=[...s,...l,...c,...m.flatMap(b=>b.differences)],g=[...e.warnings,...n.warnings,...d,...m.flatMap(b=>b.warnings)];return{differences:h,warnings:g}}},gf=t=>({category:"name.caseFolded",schemaName:t.expected.schemaName,tableName:t.expected.tableName,message:`Table name differs only in case: design="${t.expected.tableName}" database="${t.actual.tableName}".`}),yf=(t,e)=>{let n=new Set(e),r=new Set(t),o=t.filter(a=>n.has(a)===!1).map(a=>W("schema.missing",a,"",a,Pr,ve)),i=e.filter(a=>r.has(a)===!1).map(a=>W("schema.unexpected",a,"",a,ve,Pr));return[...o,...i]},bf=(t,e,n,r)=>{let o=t.schemaName,i=t.tableName,a=n.withComment&&t.comment!==e.comment?[W("table.comment",o,i,i,Oe(t.comment),Oe(e.comment))]:[],s=Sf(t.columns,e.columns,n,o,i,r),l=xf(t.primaryKeyColumnNames,e.primaryKeyColumnNames,o,i),c=Tf(t.uniqueKeys,e.uniqueKeys,o,i),m=If(t.indexes,e.indexes,o,i),d=Cf(t.foreignKeys,e.foreignKeys,o,i);return{differences:[...a,...s.differences,...l,...c,...m,...d],warnings:s.warnings}},Sf=(t,e,n,r,o,i)=>{let a=new Map(e.map(y=>[y.columnName,y])),s=new Map(e.map(y=>[y.columnName.toUpperCase(),y])),l=new Set,c=[],m=[],d=[];t.forEach(y=>{let N=a.get(y.columnName),M=s.get(y.columnName.toUpperCase()),R=i===!1&&N==null&&M!=null&&l.has(M.columnName)===!1?M:null,v=N??R;if(v==null){let z=Nc(y),me=W("column.missing",r,o,y.columnName,Be(z),ve);c.push(me);return}l.add(v.columnName),d.push({expectedName:y.columnName,actualName:v.columnName}),R!=null&&m.push({category:"name.caseFolded",schemaName:r,tableName:o,message:`Column name differs only in case: design="${y.columnName}" database="${v.columnName}".`}),c.push(...Mf(y,v,n,r,o))}),e.filter(y=>l.has(y.columnName)===!1).forEach(y=>{let N=W("column.unexpected",r,o,y.columnName,ve,Be(Nc(y)));c.push(N)});let g=new Map(e.map((y,N)=>[y.columnName,N])),b=d.map(y=>g.get(y.actualName));if(wf(b)===!1){let y=e.filter(N=>l.has(N.columnName)).map(N=>N.columnName);m.push({category:"column.order",schemaName:r,tableName:o,message:`Column order differs (design: ${d.map(N=>N.expectedName).join(", ")} / database: ${y.join(", ")}).`})}return{differences:c,warnings:m}},wf=t=>t.every((e,n)=>n===0||t[n-1]<=e),Kn=t=>t.unsigned?`${t.typeExpression} UNSIGNED`:t.typeExpression,Nc=t=>{let e=Kn(t);return t.notNull?`${e} NOT NULL`:e},Mf=(t,e,n,r,o)=>{let i=t.columnName,a=[];if(Kn(t)!==Kn(e)){let c=W("column.type",r,o,i,Be(Kn(t)),Be(Kn(e)));a.push(c)}if(t.notNull!==e.notNull){let c=W("column.nullability",r,o,i,Be(vc(t.notNull)),Be(vc(e.notNull)));a.push(c)}if(t.defaultValue!==e.defaultValue){let c=W("column.default",r,o,i,Oe(t.defaultValue),Oe(e.defaultValue));a.push(c)}if(t.autoIncrement!==e.autoIncrement){let c=W("column.autoIncrement",r,o,i,Pc(t.autoIncrement),Pc(e.autoIncrement));a.push(c)}let s=n.withLogicalName&&t.logicalName!==e.logicalName;if(s){let c=W("column.logicalName",r,o,i,Oe(t.logicalName),Oe(e.logicalName));a.push(c)}let l=n.commentStyle==="logical_name"&&s;if(n.withComment&&l===!1&&t.comment!==e.comment){let c=W("column.comment",r,o,i,Oe(t.comment),Oe(e.comment));a.push(c)}return a},vc=t=>t?"NOT NULL":"NULL",xf=(t,e,n,r)=>Ft(t,e)?[]:[W("primaryKey",n,r,r,Ke(t),Ke(e))],zc=t=>t.length>0?`(${t.join(", ")})`:"",Tf=(t,e,n,r)=>{let o=[...e],i=[];return t.forEach(a=>{let s=o.findIndex(m=>Ft(m.columnNames,a.columnNames));if(s>=0){o.splice(s,1);return}let l=a.constraintName!==""?o.findIndex(m=>m.constraintName===a.constraintName):-1;if(l>=0){let m=o[l];o.splice(l,1);let d=W("uniqueKey.columns",n,r,a.constraintName,Ke(a.columnNames),Ke(m.columnNames));i.push(d);return}let c=W("uniqueKey.missing",n,r,Ec(a),Ke(a.columnNames),ve);i.push(c)}),o.forEach(a=>{let s=W("uniqueKey.unexpected",n,r,Ec(a),ve,Ke(a.columnNames));i.push(s)}),i},Ec=t=>t.constraintName!==""?t.constraintName:zc(t.columnNames),If=(t,e,n,r)=>{let o=[...e],i=[];return t.forEach(a=>{let s=o.findIndex(d=>d.indexName.toUpperCase()===a.indexName.toUpperCase()),l=s<0?o.findIndex(d=>Ft(d.columnNames,a.columnNames)):-1,c=s>=0?s:l;if(c<0){let d=W("index.missing",n,r,a.indexName,Ke(a.columnNames),ve);i.push(d);return}let m=o[c];if(o.splice(c,1),Ft(a.columnNames,m.columnNames)===!1){let d=W("index.columns",n,r,a.indexName,Ke(a.columnNames),Ke(m.columnNames));i.push(d)}if(Rr(a)!==Rr(m)){let d=W("index.type",n,r,a.indexName,Oe(Rr(a)),Oe(Rr(m)));i.push(d)}}),o.forEach(a=>{let s=W("index.unexpected",n,r,a.indexName,ve,Ke(a.columnNames));i.push(s)}),i},Rr=t=>{let e=[t.indexOption,t.indexType].filter(n=>n!=="");return e.length>0?e.join(" "):""},Cf=(t,e,n,r)=>{let o=[...e],i=[];return t.forEach(a=>{let s=o.findIndex(c=>_f(a,c));if(s<0){let c=Xo(a),m=W("foreignKey.missing",n,r,c,Be(Ac(a)),ve);i.push(m);return}let l=o[s];if(o.splice(s,1),a.onUpdate!==l.onUpdate||a.onDelete!==l.onDelete){let c=Xo(a),m=W("foreignKey.reference",n,r,c,Be(Rc(a)),Be(Rc(l)));i.push(m)}}),o.forEach(a=>{let s=Xo(a),l=W("foreignKey.unexpected",n,r,s,ve,Be(Ac(a)));i.push(l)}),i},_f=(t,e)=>Ft(t.columnNames,e.columnNames)&&t.parentSchemaName===e.parentSchemaName&&t.parentTableName===e.parentTableName&&Ft(t.parentColumnNames,e.parentColumnNames),Xo=t=>t.columnNames.join(", "),Ac=t=>`${t.parentSchemaName!==""?`${t.parentSchemaName}.${t.parentTableName}`:t.parentTableName} (${t.parentColumnNames.join(", ")})`,Rc=t=>`ON UPDATE ${t.onUpdate} ON DELETE ${t.onDelete}`,W=(t,e,n,r,o,i)=>({category:t,schemaName:e,tableName:n,targetName:r,expected:o,actual:i}),Be=t=>({state:"value",text:t}),Oe=t=>t!==""?{state:"value",text:t}:{state:"blank"},Ke=t=>{let e=zc(t);return Oe(e)},Pc=t=>t?{state:"value",text:"AUTO_INCREMENT"}:{state:"blank"},ve={state:"absent"},Pr={state:"present"};var hn=class{constructor(){}static format(e,n,r){let o=Nf(e.warnings);return r==="json"?{stdout:vf(e,n),stderr:o}:r==="markdown"?{stdout:Df(e,n),stderr:o}:{stdout:Ef(e,n),stderr:o}}},Nf=t=>t.length===0?"":`${t.map(n=>`warn: ${n.message}`).join(`
27
+ })));`),h.write(`newResult[${wt(R)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let M=h.compile();return(R,v)=>M(d,R,v)},o,i=Kt,a=!Hn.jitless,l=a&&Kr.value,c=e.catchall,m;t._zod.parse=(d,h)=>{m??(m=n.value);let g=d.value;if(!i(g))return d.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),d;let b=[];if(a&&l&&h?.async===!1&&h.jitless!==!0)o||(o=r(e.shape)),d=o(d,h);else{d.value={};let v=m.shape;for(let z of m.keys){let me=v[z],pe=me._zod.run({value:g[z],issues:[]},h),H=me._zod.optin==="optional"&&me._zod.optout==="optional";pe instanceof Promise?b.push(pe.then(Ge=>H?ba(Ge,d,z,g):or(Ge,d,z))):H?ba(pe,d,z,g):or(pe,d,z)}}if(!c)return b.length?Promise.all(b).then(()=>d):d;let y=[],N=m.keySet,M=c._zod,R=M.def.type;for(let v of Object.keys(g)){if(N.has(v))continue;if(R==="never"){y.push(v);continue}let z=M.run({value:g[v],issues:[]},h);z instanceof Promise?b.push(z.then(me=>or(me,d,v))):or(z,d,v)}return y.length&&d.issues.push({code:"unrecognized_keys",keys:y,input:g,inst:t}),b.length?Promise.all(b).then(()=>d):d}});function Sa(t,e,n,r){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(i=>Pe(i,r,Me())))}),e}var so=f("$ZodUnion",(t,e)=>{Z.init(t,e),q(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),q(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),q(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),q(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>Sn(r.source)).join("|")})$`)}}),t._zod.parse=(n,r)=>{let o=!1,i=[];for(let a of e.options){let s=a._zod.run({value:n.value,issues:[]},r);if(s instanceof Promise)i.push(s),o=!0;else{if(s.issues.length===0)return s;i.push(s)}}return o?Promise.all(i).then(a=>Sa(a,n,t,r)):Sa(i,n,t,r)}}),rs=f("$ZodDiscriminatedUnion",(t,e)=>{so.init(t,e);let n=t._zod.parse;q(t._zod,"propValues",()=>{let o={};for(let i of e.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let[s,l]of Object.entries(a)){o[s]||(o[s]=new Set);for(let c of l)o[s].add(c)}}return o});let r=yn(()=>{let o=e.options,i=new Map;for(let a of o){let s=a._zod.propValues[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let l of s){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,a)}}return i});t._zod.parse=(o,i)=>{let a=o.value;if(!Kt(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),o;let s=r.value.get(a?.[e.discriminator]);return s?s._zod.run(o,i):e.unionFallback?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[e.discriminator],inst:t}),o)}}),os=f("$ZodIntersection",(t,e)=>{Z.init(t,e),t._zod.parse=(n,r)=>{let o=n.value,i=e.left._zod.run({value:o,issues:[]},r),a=e.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,c])=>wa(n,l,c)):wa(n,i,a)}});function io(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Gt(t)&&Gt(e)){let n=Object.keys(e),r=Object.keys(t).filter(i=>n.indexOf(i)!==-1),o={...t,...e};for(let i of r){let a=io(t[i],e[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};o[i]=a.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e[r],a=io(o,i);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wa(t,e,n){if(e.issues.length&&t.issues.push(...e.issues),n.issues.length&&t.issues.push(...n.issues),Mt(t))return t;let r=io(e.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return t.value=r.data,t}var is=f("$ZodRecord",(t,e)=>{Z.init(t,e),t._zod.parse=(n,r)=>{let o=n.value;if(!Gt(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),n;let i=[];if(e.keyType._zod.values){let a=e.keyType._zod.values;n.value={};for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){let c=e.valueType._zod.run({value:o[l],issues:[]},r);c instanceof Promise?i.push(c.then(m=>{m.issues.length&&n.issues.push(...De(l,m.issues)),n.value[l]=m.value})):(c.issues.length&&n.issues.push(...De(l,c.issues)),n.value[l]=c.value)}let s;for(let l in o)a.has(l)||(s=s??[],s.push(l));s&&s.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:s})}else{n.value={};for(let a of Reflect.ownKeys(o)){if(a==="__proto__")continue;let s=e.keyType._zod.run({value:a,issues:[]},r);if(s instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(s.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:s.issues.map(c=>Pe(c,r,Me())),input:a,path:[a],inst:t}),n.value[s.value]=s.value;continue}let l=e.valueType._zod.run({value:o[a],issues:[]},r);l instanceof Promise?i.push(l.then(c=>{c.issues.length&&n.issues.push(...De(a,c.issues)),n.value[s.value]=c.value})):(l.issues.length&&n.issues.push(...De(a,l.issues)),n.value[s.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}});var as=f("$ZodEnum",(t,e)=>{Z.init(t,e);let n=Zr(e.entries);t._zod.values=new Set(n),t._zod.pattern=new RegExp(`^(${n.filter(r=>Gr.has(typeof r)).map(r=>typeof r=="string"?rt(r):r.toString()).join("|")})$`),t._zod.parse=(r,o)=>{let i=r.value;return t._zod.values.has(i)||r.issues.push({code:"invalid_value",values:n,input:i,inst:t}),r}}),ss=f("$ZodLiteral",(t,e)=>{Z.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?rt(n):n?n.toString():String(n)).join("|")})$`),t._zod.parse=(n,r)=>{let o=n.value;return t._zod.values.has(o)||n.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),n}});var ls=f("$ZodTransform",(t,e)=>{Z.init(t,e),t._zod.parse=(n,r)=>{let o=e.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(n.value=a,n));if(o instanceof Promise)throw new Ye;return n.value=o,n}}),cs=f("$ZodOptional",(t,e)=>{Z.init(t,e),t._zod.optin="optional",t._zod.optout="optional",q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),q(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Sn(n.source)})?$`):void 0}),t._zod.parse=(n,r)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(n,r):n.value===void 0?n:e.innerType._zod.run(n,r)}),us=f("$ZodNullable",(t,e)=>{Z.init(t,e),q(t._zod,"optin",()=>e.innerType._zod.optin),q(t._zod,"optout",()=>e.innerType._zod.optout),q(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Sn(n.source)}|null)$`):void 0}),q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,r)=>n.value===null?n:e.innerType._zod.run(n,r)}),ds=f("$ZodDefault",(t,e)=>{Z.init(t,e),t._zod.optin="optional",q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=e.defaultValue,n;let o=e.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Ma(i,e)):Ma(o,e)}});function Ma(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var ms=f("$ZodPrefault",(t,e)=>{Z.init(t,e),t._zod.optin="optional",q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>(n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,r))}),ps=f("$ZodNonOptional",(t,e)=>{Z.init(t,e),q(t._zod,"values",()=>{let n=e.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),t._zod.parse=(n,r)=>{let o=e.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>xa(i,t)):xa(o,t)}});function xa(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var hs=f("$ZodCatch",(t,e)=>{Z.init(t,e),t._zod.optin="optional",q(t._zod,"optout",()=>e.innerType._zod.optout),q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{let o=e.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=e.catchValue({...n,error:{issues:i.issues.map(a=>Pe(a,r,Me()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=e.catchValue({...n,error:{issues:o.issues.map(i=>Pe(i,r,Me()))},input:n.value}),n.issues=[]),n)}});var fs=f("$ZodPipe",(t,e)=>{Z.init(t,e),q(t._zod,"values",()=>e.in._zod.values),q(t._zod,"optin",()=>e.in._zod.optin),q(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(n,r)=>{let o=e.in._zod.run(n,r);return o instanceof Promise?o.then(i=>Ta(i,e,r)):Ta(o,e,r)}});function Ta(t,e,n){return Mt(t)?t:e.out._zod.run({value:t.value,issues:t.issues},n)}var gs=f("$ZodReadonly",(t,e)=>{Z.init(t,e),q(t._zod,"propValues",()=>e.innerType._zod.propValues),q(t._zod,"values",()=>e.innerType._zod.values),q(t._zod,"optin",()=>e.innerType._zod.optin),q(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(n,r)=>{let o=e.innerType._zod.run(n,r);return o instanceof Promise?o.then(Ia):Ia(o)}});function Ia(t){return t.value=Object.freeze(t.value),t}var ys=f("$ZodCustom",(t,e)=>{ue.init(t,e),Z.init(t,e),t._zod.parse=(n,r)=>n,t._zod.check=n=>{let r=n.value,o=e.fn(r);if(o instanceof Promise)return o.then(i=>Ca(i,n,r,t));Ca(o,n,r,t)}});function Ca(t,e,n,r){if(!t){let o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),e.issues.push(Wr(o))}}var $u=t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},Uu=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(r){return t[r]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Invalid input: expected ${r.expected}, received ${$u(r.input)}`;case"invalid_value":return r.values.length===1?`Invalid input: expected ${tr(r.values[0])}`:`Invalid option: expected one of ${Xn(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",i=e(r.origin);return i?`Too big: expected ${r.origin??"value"} to have ${o}${r.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",i=e(r.origin);return i?`Too small: expected ${r.origin} to have ${o}${r.minimum.toString()} ${i.unit}`:`Too small: expected ${r.origin} to be ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${Xn(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function bs(){return{localeError:Uu()}}var lo=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...n){let r=n[0];if(this._map.set(e,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){let n=e._zod.parent;if(n){let r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function Lu(){return new lo}var xn=Lu();function Ss(t,e){return new t({type:"string",...E(e)})}function ws(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...E(e)})}function co(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...E(e)})}function Ms(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...E(e)})}function xs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(e)})}function Ts(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(e)})}function Is(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(e)})}function Cs(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...E(e)})}function _s(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...E(e)})}function Ns(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(e)})}function vs(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...E(e)})}function Es(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(e)})}function As(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...E(e)})}function Rs(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...E(e)})}function Ps(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(e)})}function zs(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(e)})}function Os(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(e)})}function ks(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(e)})}function Ds(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(e)})}function $s(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...E(e)})}function Us(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...E(e)})}function Ls(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...E(e)})}function Vs(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...E(e)})}function qs(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(e)})}function Zs(t,e){return new t({type:"string",format:"date",check:"string_format",...E(e)})}function Fs(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...E(e)})}function Qs(t,e){return new t({type:"string",format:"duration",check:"string_format",...E(e)})}function Bs(t,e){return new t({type:"number",checks:[],...E(e)})}function Ks(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...E(e)})}function Gs(t,e){return new t({type:"boolean",...E(e)})}function Ys(t,e){return new t({type:"null",...E(e)})}function js(t){return new t({type:"unknown"})}function Ws(t,e){return new t({type:"never",...E(e)})}function ar(t,e){return new ro({check:"less_than",...E(e),value:t,inclusive:!1})}function Tn(t,e){return new ro({check:"less_than",...E(e),value:t,inclusive:!0})}function sr(t,e){return new oo({check:"greater_than",...E(e),value:t,inclusive:!1})}function In(t,e){return new oo({check:"greater_than",...E(e),value:t,inclusive:!0})}function lr(t,e){return new ra({check:"multiple_of",...E(e),value:t})}function cr(t,e){return new ia({check:"max_length",...E(e),maximum:t})}function Yt(t,e){return new aa({check:"min_length",...E(e),minimum:t})}function ur(t,e){return new sa({check:"length_equals",...E(e),length:t})}function uo(t,e){return new la({check:"string_format",format:"regex",...E(e),pattern:t})}function mo(t){return new ca({check:"string_format",format:"lowercase",...E(t)})}function po(t){return new ua({check:"string_format",format:"uppercase",...E(t)})}function ho(t,e){return new da({check:"string_format",format:"includes",...E(e),includes:t})}function fo(t,e){return new ma({check:"string_format",format:"starts_with",...E(e),prefix:t})}function go(t,e){return new pa({check:"string_format",format:"ends_with",...E(e),suffix:t})}function xt(t){return new ha({check:"overwrite",tx:t})}function yo(t){return xt(e=>e.normalize(t))}function bo(){return xt(t=>t.trim())}function So(){return xt(t=>t.toLowerCase())}function wo(){return xt(t=>t.toUpperCase())}function Js(t,e,n){return new t({type:"array",element:e,...E(n)})}function Hs(t,e,n){let r=E(n);return r.abort??(r.abort=!0),new t({type:"custom",check:"custom",fn:e,...r})}function Xs(t,e,n){return new t({type:"custom",check:"custom",fn:e,...E(n)})}var _n={};Lr(_n,{ZodISODate:()=>tl,ZodISODateTime:()=>el,ZodISODuration:()=>rl,ZodISOTime:()=>nl,date:()=>xo,datetime:()=>Mo,duration:()=>Io,time:()=>To});var el=f("ZodISODateTime",(t,e)=>{$a.init(t,e),K.init(t,e)});function Mo(t){return qs(el,t)}var tl=f("ZodISODate",(t,e)=>{Ua.init(t,e),K.init(t,e)});function xo(t){return Zs(tl,t)}var nl=f("ZodISOTime",(t,e)=>{La.init(t,e),K.init(t,e)});function To(t){return Fs(nl,t)}var rl=f("ZodISODuration",(t,e)=>{Va.init(t,e),K.init(t,e)});function Io(t){return Qs(rl,t)}var ol=(t,e)=>{nr.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>xi(t,n)},flatten:{value:n=>Mi(t,n)},addIssue:{value:n=>t.issues.push(n)},addIssues:{value:n=>t.issues.push(...n)},isEmpty:{get(){return t.issues.length===0}}})},$b=f("ZodError",ol),Nn=f("ZodError",ol,{Parent:Error});var il=Ti(Nn),al=Ii(Nn),sl=Hr(Nn),ll=Xr(Nn);var J=f("ZodType",(t,e)=>(Z.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...n)=>t.clone({...e,checks:[...e.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),t.clone=(n,r)=>ke(t,n,r),t.brand=()=>t,t.register=((n,r)=>(n.add(t,r),t)),t.parse=(n,r)=>il(t,n,r,{callee:t.parse}),t.safeParse=(n,r)=>sl(t,n,r),t.parseAsync=async(n,r)=>al(t,n,r,{callee:t.parseAsync}),t.safeParseAsync=async(n,r)=>ll(t,n,r),t.spa=t.safeParseAsync,t.refine=(n,r)=>t.check(Dd(n,r)),t.superRefine=n=>t.check($d(n)),t.overwrite=n=>t.check(xt(n)),t.optional=()=>Y(t),t.nullable=()=>dl(t),t.nullish=()=>Y(dl(t)),t.nonoptional=n=>Ed(t,n),t.array=()=>$(t),t.or=n=>B([t,n]),t.and=n=>mr(t,n),t.transform=n=>_o(t,yl(n)),t.default=n=>_d(t,n),t.prefault=n=>vd(t,n),t.catch=n=>Rd(t,n),t.pipe=n=>_o(t,n),t.readonly=()=>Od(t),t.describe=n=>{let r=t.clone();return xn.add(r,{description:n}),r},Object.defineProperty(t,"description",{get(){return xn.get(t)?.description},configurable:!0}),t.meta=(...n)=>{if(n.length===0)return xn.get(t);let r=t.clone();return xn.add(r,n[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),ml=f("_ZodString",(t,e)=>{ir.init(t,e),J.init(t,e);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,t.regex=(...r)=>t.check(uo(...r)),t.includes=(...r)=>t.check(ho(...r)),t.startsWith=(...r)=>t.check(fo(...r)),t.endsWith=(...r)=>t.check(go(...r)),t.min=(...r)=>t.check(Yt(...r)),t.max=(...r)=>t.check(cr(...r)),t.length=(...r)=>t.check(ur(...r)),t.nonempty=(...r)=>t.check(Yt(1,...r)),t.lowercase=r=>t.check(mo(r)),t.uppercase=r=>t.check(po(r)),t.trim=()=>t.check(bo()),t.normalize=(...r)=>t.check(yo(...r)),t.toLowerCase=()=>t.check(So()),t.toUpperCase=()=>t.check(wo())}),Yu=f("ZodString",(t,e)=>{ir.init(t,e),ml.init(t,e),t.email=n=>t.check(ws(ju,n)),t.url=n=>t.check(Cs(Wu,n)),t.jwt=n=>t.check(Vs(dd,n)),t.emoji=n=>t.check(_s(Ju,n)),t.guid=n=>t.check(co(cl,n)),t.uuid=n=>t.check(Ms(dr,n)),t.uuidv4=n=>t.check(xs(dr,n)),t.uuidv6=n=>t.check(Ts(dr,n)),t.uuidv7=n=>t.check(Is(dr,n)),t.nanoid=n=>t.check(Ns(Hu,n)),t.guid=n=>t.check(co(cl,n)),t.cuid=n=>t.check(vs(Xu,n)),t.cuid2=n=>t.check(Es(ed,n)),t.ulid=n=>t.check(As(td,n)),t.base64=n=>t.check($s(ld,n)),t.base64url=n=>t.check(Us(cd,n)),t.xid=n=>t.check(Rs(nd,n)),t.ksuid=n=>t.check(Ps(rd,n)),t.ipv4=n=>t.check(zs(od,n)),t.ipv6=n=>t.check(Os(id,n)),t.cidrv4=n=>t.check(ks(ad,n)),t.cidrv6=n=>t.check(Ds(sd,n)),t.e164=n=>t.check(Ls(ud,n)),t.datetime=n=>t.check(Mo(n)),t.date=n=>t.check(xo(n)),t.time=n=>t.check(To(n)),t.duration=n=>t.check(Io(n))});function p(t){return Ss(Yu,t)}var K=f("ZodStringFormat",(t,e)=>{Q.init(t,e),ml.init(t,e)}),ju=f("ZodEmail",(t,e)=>{va.init(t,e),K.init(t,e)});var cl=f("ZodGUID",(t,e)=>{_a.init(t,e),K.init(t,e)});var dr=f("ZodUUID",(t,e)=>{Na.init(t,e),K.init(t,e)});var Wu=f("ZodURL",(t,e)=>{Ea.init(t,e),K.init(t,e)});var Ju=f("ZodEmoji",(t,e)=>{Aa.init(t,e),K.init(t,e)});var Hu=f("ZodNanoID",(t,e)=>{Ra.init(t,e),K.init(t,e)});var Xu=f("ZodCUID",(t,e)=>{Pa.init(t,e),K.init(t,e)});var ed=f("ZodCUID2",(t,e)=>{za.init(t,e),K.init(t,e)});var td=f("ZodULID",(t,e)=>{Oa.init(t,e),K.init(t,e)});var nd=f("ZodXID",(t,e)=>{ka.init(t,e),K.init(t,e)});var rd=f("ZodKSUID",(t,e)=>{Da.init(t,e),K.init(t,e)});var od=f("ZodIPv4",(t,e)=>{qa.init(t,e),K.init(t,e)});var id=f("ZodIPv6",(t,e)=>{Za.init(t,e),K.init(t,e)});var ad=f("ZodCIDRv4",(t,e)=>{Fa.init(t,e),K.init(t,e)});var sd=f("ZodCIDRv6",(t,e)=>{Qa.init(t,e),K.init(t,e)});var ld=f("ZodBase64",(t,e)=>{Ka.init(t,e),K.init(t,e)});var cd=f("ZodBase64URL",(t,e)=>{Ga.init(t,e),K.init(t,e)});var ud=f("ZodE164",(t,e)=>{Ya.init(t,e),K.init(t,e)});var dd=f("ZodJWT",(t,e)=>{ja.init(t,e),K.init(t,e)});var pl=f("ZodNumber",(t,e)=>{ao.init(t,e),J.init(t,e),t.gt=(r,o)=>t.check(sr(r,o)),t.gte=(r,o)=>t.check(In(r,o)),t.min=(r,o)=>t.check(In(r,o)),t.lt=(r,o)=>t.check(ar(r,o)),t.lte=(r,o)=>t.check(Tn(r,o)),t.max=(r,o)=>t.check(Tn(r,o)),t.int=r=>t.check(ul(r)),t.safe=r=>t.check(ul(r)),t.positive=r=>t.check(sr(0,r)),t.nonnegative=r=>t.check(In(0,r)),t.negative=r=>t.check(ar(0,r)),t.nonpositive=r=>t.check(Tn(0,r)),t.multipleOf=(r,o)=>t.check(lr(r,o)),t.step=(r,o)=>t.check(lr(r,o)),t.finite=()=>t;let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function L(t){return Bs(pl,t)}var md=f("ZodNumberFormat",(t,e)=>{Wa.init(t,e),pl.init(t,e)});function ul(t){return Ks(md,t)}var pd=f("ZodBoolean",(t,e)=>{Ja.init(t,e),J.init(t,e)});function re(t){return Gs(pd,t)}var hd=f("ZodNull",(t,e)=>{Ha.init(t,e),J.init(t,e)});function hl(t){return Ys(hd,t)}var fd=f("ZodUnknown",(t,e)=>{Xa.init(t,e),J.init(t,e)});function G(){return js(fd)}var gd=f("ZodNever",(t,e)=>{es.init(t,e),J.init(t,e)});function yd(t){return Ws(gd,t)}var bd=f("ZodArray",(t,e)=>{ts.init(t,e),J.init(t,e),t.element=e.element,t.min=(n,r)=>t.check(Yt(n,r)),t.nonempty=n=>t.check(Yt(1,n)),t.max=(n,r)=>t.check(cr(n,r)),t.length=(n,r)=>t.check(ur(n,r)),t.unwrap=()=>t.element});function $(t,e){return Js(bd,t,e)}var fl=f("ZodObject",(t,e)=>{ns.init(t,e),J.init(t,e),U.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>fe(Object.keys(t._zod.def.shape)),t.catchall=n=>t.clone({...t._zod.def,catchall:n}),t.passthrough=()=>t.clone({...t._zod.def,catchall:G()}),t.loose=()=>t.clone({...t._zod.def,catchall:G()}),t.strict=()=>t.clone({...t._zod.def,catchall:yd()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=n=>U.extend(t,n),t.merge=n=>U.merge(t,n),t.pick=n=>U.pick(t,n),t.omit=n=>U.omit(t,n),t.partial=(...n)=>U.partial(bl,t,n[0]),t.required=(...n)=>U.required(Sl,t,n[0])});function I(t,e){let n={type:"object",get shape(){return U.assignProp(this,"shape",{...t}),this.shape},...U.normalizeParams(e)};return new fl(n)}function he(t,e){return new fl({type:"object",get shape(){return U.assignProp(this,"shape",{...t}),this.shape},catchall:G(),...U.normalizeParams(e)})}var gl=f("ZodUnion",(t,e)=>{so.init(t,e),J.init(t,e),t.options=e.options});function B(t,e){return new gl({type:"union",options:t,...U.normalizeParams(e)})}var Sd=f("ZodDiscriminatedUnion",(t,e)=>{gl.init(t,e),rs.init(t,e)});function No(t,e,n){return new Sd({type:"union",options:e,discriminator:t,...U.normalizeParams(n)})}var wd=f("ZodIntersection",(t,e)=>{os.init(t,e),J.init(t,e)});function mr(t,e){return new wd({type:"intersection",left:t,right:e})}var Md=f("ZodRecord",(t,e)=>{is.init(t,e),J.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function F(t,e,n){return new Md({type:"record",keyType:t,valueType:e,...U.normalizeParams(n)})}var Co=f("ZodEnum",(t,e)=>{as.init(t,e),J.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let n=new Set(Object.keys(e.entries));t.extract=(r,o)=>{let i={};for(let a of r)if(n.has(a))i[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Co({...e,checks:[],...U.normalizeParams(o),entries:i})},t.exclude=(r,o)=>{let i={...e.entries};for(let a of r)if(n.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new Co({...e,checks:[],...U.normalizeParams(o),entries:i})}});function fe(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new Co({type:"enum",entries:n,...U.normalizeParams(e)})}var xd=f("ZodLiteral",(t,e)=>{ss.init(t,e),J.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function _(t,e){return new xd({type:"literal",values:Array.isArray(t)?t:[t],...U.normalizeParams(e)})}var Td=f("ZodTransform",(t,e)=>{ls.init(t,e),J.init(t,e),t._zod.parse=(n,r)=>{n.addIssue=i=>{if(typeof i=="string")n.issues.push(U.issue(i,n.value,e));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=t),a.continue??(a.continue=!0),n.issues.push(U.issue(a))}};let o=e.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function yl(t){return new Td({type:"transform",transform:t})}var bl=f("ZodOptional",(t,e)=>{cs.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Y(t){return new bl({type:"optional",innerType:t})}var Id=f("ZodNullable",(t,e)=>{us.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType});function dl(t){return new Id({type:"nullable",innerType:t})}var Cd=f("ZodDefault",(t,e)=>{ds.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function _d(t,e){return new Cd({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}var Nd=f("ZodPrefault",(t,e)=>{ms.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType});function vd(t,e){return new Nd({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}var Sl=f("ZodNonOptional",(t,e)=>{ps.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Ed(t,e){return new Sl({type:"nonoptional",innerType:t,...U.normalizeParams(e)})}var Ad=f("ZodCatch",(t,e)=>{hs.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Rd(t,e){return new Ad({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var Pd=f("ZodPipe",(t,e)=>{fs.init(t,e),J.init(t,e),t.in=e.in,t.out=e.out});function _o(t,e){return new Pd({type:"pipe",in:t,out:e})}var zd=f("ZodReadonly",(t,e)=>{gs.init(t,e),J.init(t,e)});function Od(t){return new zd({type:"readonly",innerType:t})}var wl=f("ZodCustom",(t,e)=>{ys.init(t,e),J.init(t,e)});function kd(t){let e=new ue({check:"custom"});return e._zod.check=t,e}function Ml(t,e){return Hs(wl,t??(()=>!0),e)}function Dd(t,e={}){return Xs(wl,t,e)}function $d(t){let e=kd(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(U.issue(r,n.value,e._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),o.continue??(o.continue=!e._zod.def.abort),n.issues.push(U.issue(o))}},t(n.value,n)));return e}function vo(t,e){return _o(yl(t),e)}Me(bs());var Ud="io.modelcontextprotocol/related-task",hr="2.0",te=Ml(t=>t!==null&&(typeof t=="object"||typeof t=="function")),xl=B([p(),L().int()]),Tl=p(),AS=he({ttl:L().optional(),pollInterval:L().optional()}),Ld=I({ttl:L().optional()}),Vd=I({taskId:p()}),Ao=he({progressToken:xl.optional(),[Ud]:Vd.optional()}),Se=I({_meta:Ao.optional()}),fr=Se.extend({task:Ld.optional()});var ie=I({method:p(),params:Se.loose().optional()}),xe=I({_meta:Ao.optional()}),Te=I({method:p(),params:xe.loose().optional()}),ae=he({_meta:Ao.optional()}),gr=B([p(),L().int()]),qd=I({jsonrpc:_(hr),id:gr,...ie.shape}).strict();var Zd=I({jsonrpc:_(hr),...Te.shape}).strict();var Il=I({jsonrpc:_(hr),id:gr,result:ae}).strict();var Tt;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Tt||(Tt={}));var Cl=I({jsonrpc:_(hr),id:gr.optional(),error:I({code:L().int(),message:p(),data:G().optional()})}).strict();var RS=B([qd,Zd,Il,Cl]),PS=B([Il,Cl]),_l=ae.strict(),Fd=xe.extend({requestId:gr.optional(),reason:p().optional()}),Nl=Te.extend({method:_("notifications/cancelled"),params:Fd}),Qd=I({src:p(),mimeType:p().optional(),sizes:$(p()).optional(),theme:fe(["light","dark"]).optional()}),En=I({icons:$(Qd).optional()}),jt=I({name:p(),title:p().optional()}),vl=jt.extend({...jt.shape,...En.shape,version:p(),websiteUrl:p().optional(),description:p().optional()}),Bd=mr(I({applyDefaults:re().optional()}),F(p(),G())),Kd=vo(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,mr(I({form:Bd.optional(),url:te.optional()}),F(p(),G()).optional())),Gd=he({list:te.optional(),cancel:te.optional(),requests:he({sampling:he({createMessage:te.optional()}).optional(),elicitation:he({create:te.optional()}).optional()}).optional()}),Yd=he({list:te.optional(),cancel:te.optional(),requests:he({tools:he({call:te.optional()}).optional()}).optional()}),jd=I({experimental:F(p(),te).optional(),sampling:I({context:te.optional(),tools:te.optional()}).optional(),elicitation:Kd.optional(),roots:I({listChanged:re().optional()}).optional(),tasks:Gd.optional(),extensions:F(p(),te).optional()}),Wd=Se.extend({protocolVersion:p(),capabilities:jd,clientInfo:vl}),Jd=ie.extend({method:_("initialize"),params:Wd});var Hd=I({experimental:F(p(),te).optional(),logging:te.optional(),completions:te.optional(),prompts:I({listChanged:re().optional()}).optional(),resources:I({subscribe:re().optional(),listChanged:re().optional()}).optional(),tools:I({listChanged:re().optional()}).optional(),tasks:Yd.optional(),extensions:F(p(),te).optional()}),Xd=ae.extend({protocolVersion:p(),capabilities:Hd,serverInfo:vl,instructions:p().optional()}),em=Te.extend({method:_("notifications/initialized"),params:xe.optional()});var El=ie.extend({method:_("ping"),params:Se.optional()}),tm=I({progress:L(),total:Y(L()),message:Y(p())}),nm=I({...xe.shape,...tm.shape,progressToken:xl}),Al=Te.extend({method:_("notifications/progress"),params:nm}),rm=Se.extend({cursor:Tl.optional()}),An=ie.extend({params:rm.optional()}),Rn=ae.extend({nextCursor:Tl.optional()}),om=fe(["working","input_required","completed","failed","cancelled"]),Pn=I({taskId:p(),status:om,ttl:B([L(),hl()]),createdAt:p(),lastUpdatedAt:p(),pollInterval:Y(L()),statusMessage:Y(p())}),Rl=ae.extend({task:Pn}),im=xe.merge(Pn),Pl=Te.extend({method:_("notifications/tasks/status"),params:im}),zl=ie.extend({method:_("tasks/get"),params:Se.extend({taskId:p()})}),Ol=ae.merge(Pn),kl=ie.extend({method:_("tasks/result"),params:Se.extend({taskId:p()})}),zS=ae.loose(),Dl=An.extend({method:_("tasks/list")}),$l=Rn.extend({tasks:$(Pn)}),Ul=ie.extend({method:_("tasks/cancel"),params:Se.extend({taskId:p()})}),OS=ae.merge(Pn),Ll=I({uri:p(),mimeType:Y(p()),_meta:F(p(),G()).optional()}),Vl=Ll.extend({text:p()}),Ro=p().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),ql=Ll.extend({blob:Ro}),zn=fe(["user","assistant"]),Wt=I({audience:$(zn).optional(),priority:L().min(0).max(1).optional(),lastModified:_n.datetime({offset:!0}).optional()}),Zl=I({...jt.shape,...En.shape,uri:p(),description:Y(p()),mimeType:Y(p()),size:Y(L()),annotations:Wt.optional(),_meta:Y(he({}))}),am=I({...jt.shape,...En.shape,uriTemplate:p(),description:Y(p()),mimeType:Y(p()),annotations:Wt.optional(),_meta:Y(he({}))}),sm=An.extend({method:_("resources/list")}),lm=Rn.extend({resources:$(Zl)}),cm=An.extend({method:_("resources/templates/list")}),um=Rn.extend({resourceTemplates:$(am)}),Po=Se.extend({uri:p()}),dm=Po,mm=ie.extend({method:_("resources/read"),params:dm}),pm=ae.extend({contents:$(B([Vl,ql]))}),hm=Te.extend({method:_("notifications/resources/list_changed"),params:xe.optional()}),fm=Po,gm=ie.extend({method:_("resources/subscribe"),params:fm}),ym=Po,bm=ie.extend({method:_("resources/unsubscribe"),params:ym}),Sm=xe.extend({uri:p()}),wm=Te.extend({method:_("notifications/resources/updated"),params:Sm}),Mm=I({name:p(),description:Y(p()),required:Y(re())}),xm=I({...jt.shape,...En.shape,description:Y(p()),arguments:Y($(Mm)),_meta:Y(he({}))}),Tm=An.extend({method:_("prompts/list")}),Im=Rn.extend({prompts:$(xm)}),Cm=Se.extend({name:p(),arguments:F(p(),p()).optional()}),_m=ie.extend({method:_("prompts/get"),params:Cm}),zo=I({type:_("text"),text:p(),annotations:Wt.optional(),_meta:F(p(),G()).optional()}),Oo=I({type:_("image"),data:Ro,mimeType:p(),annotations:Wt.optional(),_meta:F(p(),G()).optional()}),ko=I({type:_("audio"),data:Ro,mimeType:p(),annotations:Wt.optional(),_meta:F(p(),G()).optional()}),Nm=I({type:_("tool_use"),name:p(),id:p(),input:F(p(),G()),_meta:F(p(),G()).optional()}),vm=I({type:_("resource"),resource:B([Vl,ql]),annotations:Wt.optional(),_meta:F(p(),G()).optional()}),Em=Zl.extend({type:_("resource_link")}),Do=B([zo,Oo,ko,Em,vm]),Am=I({role:zn,content:Do}),Rm=ae.extend({description:p().optional(),messages:$(Am)}),Pm=Te.extend({method:_("notifications/prompts/list_changed"),params:xe.optional()}),zm=I({title:p().optional(),readOnlyHint:re().optional(),destructiveHint:re().optional(),idempotentHint:re().optional(),openWorldHint:re().optional()}),Om=I({taskSupport:fe(["required","optional","forbidden"]).optional()}),Fl=I({...jt.shape,...En.shape,description:p().optional(),inputSchema:I({type:_("object"),properties:F(p(),te).optional(),required:$(p()).optional()}).catchall(G()),outputSchema:I({type:_("object"),properties:F(p(),te).optional(),required:$(p()).optional()}).catchall(G()).optional(),annotations:zm.optional(),execution:Om.optional(),_meta:F(p(),G()).optional()}),km=An.extend({method:_("tools/list")}),Dm=Rn.extend({tools:$(Fl)}),Ql=ae.extend({content:$(Do).default([]),structuredContent:F(p(),G()).optional(),isError:re().optional()}),kS=Ql.or(ae.extend({toolResult:G()})),$m=fr.extend({name:p(),arguments:F(p(),G()).optional()}),Um=ie.extend({method:_("tools/call"),params:$m}),Lm=Te.extend({method:_("notifications/tools/list_changed"),params:xe.optional()}),DS=I({autoRefresh:re().default(!0),debounceMs:L().int().nonnegative().default(300)}),Bl=fe(["debug","info","notice","warning","error","critical","alert","emergency"]),Vm=Se.extend({level:Bl}),qm=ie.extend({method:_("logging/setLevel"),params:Vm}),Zm=xe.extend({level:Bl,logger:p().optional(),data:G()}),Fm=Te.extend({method:_("notifications/message"),params:Zm}),Qm=I({name:p().optional()}),Bm=I({hints:$(Qm).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),Km=I({mode:fe(["auto","required","none"]).optional()}),Gm=I({type:_("tool_result"),toolUseId:p().describe("The unique identifier for the corresponding tool call."),content:$(Do).default([]),structuredContent:I({}).loose().optional(),isError:re().optional(),_meta:F(p(),G()).optional()}),Ym=No("type",[zo,Oo,ko]),pr=No("type",[zo,Oo,ko,Nm,Gm]),jm=I({role:zn,content:B([pr,$(pr)]),_meta:F(p(),G()).optional()}),Wm=fr.extend({messages:$(jm),modelPreferences:Bm.optional(),systemPrompt:p().optional(),includeContext:fe(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:$(p()).optional(),metadata:te.optional(),tools:$(Fl).optional(),toolChoice:Km.optional()}),Jm=ie.extend({method:_("sampling/createMessage"),params:Wm}),Hm=ae.extend({model:p(),stopReason:Y(fe(["endTurn","stopSequence","maxTokens"]).or(p())),role:zn,content:Ym}),Xm=ae.extend({model:p(),stopReason:Y(fe(["endTurn","stopSequence","maxTokens","toolUse"]).or(p())),role:zn,content:B([pr,$(pr)])}),ep=I({type:_("boolean"),title:p().optional(),description:p().optional(),default:re().optional()}),tp=I({type:_("string"),title:p().optional(),description:p().optional(),minLength:L().optional(),maxLength:L().optional(),format:fe(["email","uri","date","date-time"]).optional(),default:p().optional()}),np=I({type:fe(["number","integer"]),title:p().optional(),description:p().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),rp=I({type:_("string"),title:p().optional(),description:p().optional(),enum:$(p()),default:p().optional()}),op=I({type:_("string"),title:p().optional(),description:p().optional(),oneOf:$(I({const:p(),title:p()})),default:p().optional()}),ip=I({type:_("string"),title:p().optional(),description:p().optional(),enum:$(p()),enumNames:$(p()).optional(),default:p().optional()}),ap=B([rp,op]),sp=I({type:_("array"),title:p().optional(),description:p().optional(),minItems:L().optional(),maxItems:L().optional(),items:I({type:_("string"),enum:$(p())}),default:$(p()).optional()}),lp=I({type:_("array"),title:p().optional(),description:p().optional(),minItems:L().optional(),maxItems:L().optional(),items:I({anyOf:$(I({const:p(),title:p()}))}),default:$(p()).optional()}),cp=B([sp,lp]),up=B([ip,ap,cp]),dp=B([up,ep,tp,np]),mp=fr.extend({mode:_("form").optional(),message:p(),requestedSchema:I({type:_("object"),properties:F(p(),dp),required:$(p()).optional()})}),pp=fr.extend({mode:_("url"),message:p(),elicitationId:p(),url:p().url()}),hp=B([mp,pp]),fp=ie.extend({method:_("elicitation/create"),params:hp}),gp=xe.extend({elicitationId:p()}),yp=Te.extend({method:_("notifications/elicitation/complete"),params:gp}),bp=ae.extend({action:fe(["accept","decline","cancel"]),content:vo(t=>t===null?void 0:t,F(p(),B([p(),L(),re(),$(p())])).optional())}),Sp=I({type:_("ref/resource"),uri:p()});var wp=I({type:_("ref/prompt"),name:p()}),Mp=Se.extend({ref:B([wp,Sp]),argument:I({name:p(),value:p()}),context:I({arguments:F(p(),p()).optional()}).optional()}),xp=ie.extend({method:_("completion/complete"),params:Mp});var Tp=ae.extend({completion:he({values:$(p()).max(100),total:Y(L().int()),hasMore:Y(re())})}),Ip=I({uri:p().startsWith("file://"),name:p().optional(),_meta:F(p(),G()).optional()}),Cp=ie.extend({method:_("roots/list"),params:Se.optional()}),_p=ae.extend({roots:$(Ip)}),Np=Te.extend({method:_("notifications/roots/list_changed"),params:xe.optional()}),$S=B([El,Jd,xp,qm,_m,Tm,sm,cm,mm,gm,bm,Um,km,zl,kl,Dl,Ul]),US=B([Nl,Al,em,Np,Pl]),LS=B([_l,Hm,Xm,bp,_p,Ol,$l,Rl]),VS=B([El,Jm,fp,Cp,zl,kl,Dl,Ul]),qS=B([Nl,Al,Fm,wm,hm,Lm,Pm,Pl,yp]),ZS=B([_l,Xd,Tp,Rm,Im,lm,um,pm,Ql,Dm,Ol,$l,Rl]),vn=class t extends Error{constructor(e,n,r){super(`MCP error ${e}: ${n}`),this.code=e,this.data=r,this.name="McpError"}static fromError(e,n,r){if(e===Tt.UrlElicitationRequired&&r){let o=r;if(o.elicitations)return new Eo(o.elicitations,n)}return new t(e,n,r)}},Eo=class extends vn{constructor(e,n=`URL elicitation${e.length>1?"s":""} required`){super(Tt.UrlElicitationRequired,n,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};var oc=require("url");var Vo={};Lr(Vo,{BRAND:()=>Xp,DIRTY:()=>It,EMPTY_PATH:()=>Rp,INVALID:()=>A,NEVER:()=>$h,OK:()=>de,ParseStatus:()=>se,Schema:()=>k,ZodAny:()=>at,ZodArray:()=>He,ZodBigInt:()=>_t,ZodBoolean:()=>Nt,ZodBranded:()=>kn,ZodCatch:()=>Ut,ZodDate:()=>vt,ZodDefault:()=>$t,ZodDiscriminatedUnion:()=>Sr,ZodEffects:()=>_e,ZodEnum:()=>kt,ZodError:()=>ge,ZodFirstPartyTypeKind:()=>P,ZodFunction:()=>Mr,ZodIntersection:()=>Pt,ZodIssueCode:()=>w,ZodLazy:()=>zt,ZodLiteral:()=>Ot,ZodMap:()=>nn,ZodNaN:()=>on,ZodNativeEnum:()=>Dt,ZodNever:()=>ze,ZodNull:()=>At,ZodNullable:()=>Le,ZodNumber:()=>Ct,ZodObject:()=>ye,ZodOptional:()=>Ie,ZodParsedType:()=>T,ZodPipeline:()=>Dn,ZodPromise:()=>st,ZodReadonly:()=>Lt,ZodRecord:()=>wr,ZodSchema:()=>k,ZodSet:()=>rn,ZodString:()=>it,ZodSymbol:()=>en,ZodTransformer:()=>_e,ZodTuple:()=>Ue,ZodType:()=>k,ZodUndefined:()=>Et,ZodUnion:()=>Rt,ZodUnknown:()=>Je,ZodVoid:()=>tn,addIssueToContext:()=>x,any:()=>lh,array:()=>mh,bigint:()=>rh,boolean:()=>nc,coerce:()=>Dh,custom:()=>Xl,date:()=>oh,datetimeRegex:()=>Jl,defaultErrorMap:()=>je,discriminatedUnion:()=>gh,effect:()=>vh,enum:()=>Ch,function:()=>xh,getErrorMap:()=>Jt,getParsedType:()=>$e,instanceof:()=>th,intersection:()=>yh,isAborted:()=>yr,isAsync:()=>Ht,isDirty:()=>br,isValid:()=>ot,late:()=>eh,lazy:()=>Th,literal:()=>Ih,makeIssue:()=>On,map:()=>wh,nan:()=>nh,nativeEnum:()=>_h,never:()=>uh,null:()=>sh,nullable:()=>Ah,number:()=>tc,object:()=>ph,objectUtil:()=>$o,oboolean:()=>kh,onumber:()=>Oh,optional:()=>Eh,ostring:()=>zh,pipeline:()=>Ph,preprocess:()=>Rh,promise:()=>Nh,quotelessJson:()=>vp,record:()=>Sh,set:()=>Mh,setErrorMap:()=>Ap,strictObject:()=>hh,string:()=>ec,symbol:()=>ih,transformer:()=>vh,tuple:()=>bh,undefined:()=>ah,union:()=>fh,unknown:()=>ch,util:()=>D,void:()=>dh});var D;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},t.getValidEnumValues=o=>{let i=t.objectKeys(o).filter(s=>typeof o[o[s]]!="number"),a={};for(let s of i)a[s]=o[s];return t.objectValues(a)},t.objectValues=o=>t.objectKeys(o).map(function(i){return o[i]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},t.find=(o,i)=>{for(let a of o)if(i(a))return a},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(D||(D={}));var $o;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})($o||($o={}));var T=D.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$e=t=>{switch(typeof t){case"undefined":return T.undefined;case"string":return T.string;case"number":return Number.isNaN(t)?T.nan:T.number;case"boolean":return T.boolean;case"function":return T.function;case"bigint":return T.bigint;case"symbol":return T.symbol;case"object":return Array.isArray(t)?T.array:t===null?T.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?T.promise:typeof Map<"u"&&t instanceof Map?T.map:typeof Set<"u"&&t instanceof Set?T.set:typeof Date<"u"&&t instanceof Date?T.date:T.object;default:return T.unknown}};var w=D.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),vp=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ge=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(i){return i.message},r={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return o(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,D.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];n[i]=n[i]||[],n[i].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};ge.create=t=>new ge(t);var Ep=(t,e)=>{let n;switch(t.code){case w.invalid_type:t.received===T.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case w.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,D.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:n=`Unrecognized key(s) in object: ${D.joinValues(t.keys,", ")}`;break;case w.invalid_union:n="Invalid input";break;case w.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${D.joinValues(t.options)}`;break;case w.invalid_enum_value:n=`Invalid enum value. Expected ${D.joinValues(t.options)}, received '${t.received}'`;break;case w.invalid_arguments:n="Invalid function arguments";break;case w.invalid_return_type:n="Invalid function return type";break;case w.invalid_date:n="Invalid date";break;case w.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:D.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case w.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case w.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case w.custom:n="Invalid input";break;case w.invalid_intersection_types:n="Intersection results could not be merged";break;case w.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case w.not_finite:n="Number must be finite";break;default:n=e.defaultError,D.assertNever(t)}return{message:n}},je=Ep;var Kl=je;function Ap(t){Kl=t}function Jt(){return Kl}var On=t=>{let{data:e,path:n,errorMaps:r,issueData:o}=t,i=[...n,...o.path||[]],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let s="",l=r.filter(c=>!!c).slice().reverse();for(let c of l)s=c(a,{data:e,defaultError:s}).message;return{...o,path:i,message:s}},Rp=[];function x(t,e){let n=Jt(),r=On({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===je?void 0:je].filter(o=>!!o)});t.common.issues.push(r)}var se=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return A;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n){let i=await o.key,a=await o.value;r.push({key:i,value:a})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return A;i.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(r[i.value]=a.value)}return{status:e.value,value:r}}},A=Object.freeze({status:"aborted"}),It=t=>({status:"dirty",value:t}),de=t=>({status:"valid",value:t}),yr=t=>t.status==="aborted",br=t=>t.status==="dirty",ot=t=>t.status==="valid",Ht=t=>typeof Promise<"u"&&t instanceof Promise;var C;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(C||(C={}));var Ce=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Gl=(t,e)=>{if(ot(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new ge(t.common.issues);return this._error=n,this._error}}};function O(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(a,s)=>{let{message:l}=t;return a.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??r??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:l??n??s.defaultError}},description:o}}var k=class{get description(){return this._def.description}_getType(e){return $e(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:$e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new se,ctx:{common:e.parent.common,data:e.data,parsedType:$e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Ht(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$e(e)},o=this._parseSync({data:e,path:r.path,parent:r});return Gl(r,o)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$e(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return ot(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>ot(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$e(e)},o=this._parse({data:e,path:r.path,parent:r}),i=await(Ht(o)?o:Promise.resolve(o));return Gl(r,i)}refine(e,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{let a=e(o),s=()=>i.addIssue({code:w.custom,...r(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new _e({schema:this,typeName:P.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ie.create(this,this._def)}nullable(){return Le.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return He.create(this)}promise(){return st.create(this,this._def)}or(e){return Rt.create([this,e],this._def)}and(e){return Pt.create(this,e,this._def)}transform(e){return new _e({...O(this._def),schema:this,typeName:P.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new $t({...O(this._def),innerType:this,defaultValue:n,typeName:P.ZodDefault})}brand(){return new kn({typeName:P.ZodBranded,type:this,...O(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Ut({...O(this._def),innerType:this,catchValue:n,typeName:P.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Dn.create(this,e)}readonly(){return Lt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Pp=/^c[^\s-]{8,}$/i,zp=/^[0-9a-z]+$/,Op=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kp=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Dp=/^[a-z0-9_-]{21}$/i,$p=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Up=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Lp=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Vp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Uo,qp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Zp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Fp=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Qp=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Bp=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Kp=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,jl="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Gp=new RegExp(`^${jl}$`);function Wl(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Yp(t){return new RegExp(`^${Wl(t)}$`)}function Jl(t){let e=`${jl}T${Wl(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function jp(t,e){return!!((e==="v4"||!e)&&qp.test(t)||(e==="v6"||!e)&&Fp.test(t))}function Wp(t,e){if(!$p.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function Jp(t,e){return!!((e==="v4"||!e)&&Zp.test(t)||(e==="v6"||!e)&&Qp.test(t))}var it=class t extends k{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==T.string){let i=this._getOrReturnCtx(e);return x(i,{code:w.invalid_type,expected:T.string,received:i.parsedType}),A}let r=new se,o;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:w.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:w.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let a=e.data.length>i.value,s=e.data.length<i.value;(a||s)&&(o=this._getOrReturnCtx(e,o),a?x(o,{code:w.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&x(o,{code:w.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Lp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"email",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Uo||(Uo=new RegExp(Vp,"u")),Uo.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"emoji",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")kp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"uuid",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Dp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"nanoid",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")Pp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cuid",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")zp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cuid2",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Op.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"ulid",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),x(o,{validation:"url",code:w.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"regex",code:w.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?Jl(i).test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Gp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Yp(i).test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Up.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"duration",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?jp(e.data,i.version)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"ip",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?Wp(e.data,i.alg)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"jwt",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?Jp(e.data,i.version)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cidr",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Bp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"base64",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?Kp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"base64url",code:w.invalid_string,message:i.message}),r.dirty()):D.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:w.invalid_string,...C.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...C.errToObj(e)})}url(e){return this._addCheck({kind:"url",...C.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...C.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...C.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...C.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...C.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...C.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...C.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...C.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...C.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...C.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...C.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...C.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...C.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...C.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...C.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...C.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...C.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...C.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...C.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...C.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...C.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...C.errToObj(n)})}nonempty(e){return this.min(1,C.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};it.create=t=>new it({checks:[],typeName:P.ZodString,coerce:t?.coerce??!1,...O(t)});function Hp(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,i=Number.parseInt(t.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return i%a/10**o}var Ct=class t extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==T.number){let i=this._getOrReturnCtx(e);return x(i,{code:w.invalid_type,expected:T.number,received:i.parsedType}),A}let r,o=new se;for(let i of this._def.checks)i.kind==="int"?D.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),x(r,{code:w.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?Hp(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),x(r,{code:w.not_finite,message:i.message}),o.dirty()):D.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,C.toString(n))}gt(e,n){return this.setLimit("min",e,!1,C.toString(n))}lte(e,n){return this.setLimit("max",e,!0,C.toString(n))}lt(e,n){return this.setLimit("max",e,!1,C.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:C.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:C.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:C.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&D.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};Ct.create=t=>new Ct({checks:[],typeName:P.ZodNumber,coerce:t?.coerce||!1,...O(t)});var _t=class t extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==T.bigint)return this._getInvalidInput(e);let r,o=new se;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):D.assertNever(i);return{status:o.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return x(n,{code:w.invalid_type,expected:T.bigint,received:n.parsedType}),A}gte(e,n){return this.setLimit("min",e,!0,C.toString(n))}gt(e,n){return this.setLimit("min",e,!1,C.toString(n))}lte(e,n){return this.setLimit("max",e,!0,C.toString(n))}lt(e,n){return this.setLimit("max",e,!1,C.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:C.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};_t.create=t=>new _t({checks:[],typeName:P.ZodBigInt,coerce:t?.coerce??!1,...O(t)});var Nt=class extends k{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==T.boolean){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.boolean,received:r.parsedType}),A}return de(e.data)}};Nt.create=t=>new Nt({typeName:P.ZodBoolean,coerce:t?.coerce||!1,...O(t)});var vt=class t extends k{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==T.date){let i=this._getOrReturnCtx(e);return x(i,{code:w.invalid_type,expected:T.date,received:i.parsedType}),A}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return x(i,{code:w.invalid_date}),A}let r=new se,o;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:w.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:w.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):D.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:C.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:C.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};vt.create=t=>new vt({checks:[],coerce:t?.coerce||!1,typeName:P.ZodDate,...O(t)});var en=class extends k{_parse(e){if(this._getType(e)!==T.symbol){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.symbol,received:r.parsedType}),A}return de(e.data)}};en.create=t=>new en({typeName:P.ZodSymbol,...O(t)});var Et=class extends k{_parse(e){if(this._getType(e)!==T.undefined){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.undefined,received:r.parsedType}),A}return de(e.data)}};Et.create=t=>new Et({typeName:P.ZodUndefined,...O(t)});var At=class extends k{_parse(e){if(this._getType(e)!==T.null){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.null,received:r.parsedType}),A}return de(e.data)}};At.create=t=>new At({typeName:P.ZodNull,...O(t)});var at=class extends k{constructor(){super(...arguments),this._any=!0}_parse(e){return de(e.data)}};at.create=t=>new at({typeName:P.ZodAny,...O(t)});var Je=class extends k{constructor(){super(...arguments),this._unknown=!0}_parse(e){return de(e.data)}};Je.create=t=>new Je({typeName:P.ZodUnknown,...O(t)});var ze=class extends k{_parse(e){let n=this._getOrReturnCtx(e);return x(n,{code:w.invalid_type,expected:T.never,received:n.parsedType}),A}};ze.create=t=>new ze({typeName:P.ZodNever,...O(t)});var tn=class extends k{_parse(e){if(this._getType(e)!==T.undefined){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.void,received:r.parsedType}),A}return de(e.data)}};tn.create=t=>new tn({typeName:P.ZodVoid,...O(t)});var He=class t extends k{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==T.array)return x(n,{code:w.invalid_type,expected:T.array,received:n.parsedType}),A;if(o.exactLength!==null){let a=n.data.length>o.exactLength.value,s=n.data.length<o.exactLength.value;(a||s)&&(x(n,{code:a?w.too_big:w.too_small,minimum:s?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(x(n,{code:w.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(x(n,{code:w.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>o.type._parseAsync(new Ce(n,a,n.path,s)))).then(a=>se.mergeArray(r,a));let i=[...n.data].map((a,s)=>o.type._parseSync(new Ce(n,a,n.path,s)));return se.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:C.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:C.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:C.toString(n)}})}nonempty(e){return this.min(1,e)}};He.create=(t,e)=>new He({type:t,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...O(e)});function Xt(t){if(t instanceof ye){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Ie.create(Xt(r))}return new ye({...t._def,shape:()=>e})}else return t instanceof He?new He({...t._def,type:Xt(t.element)}):t instanceof Ie?Ie.create(Xt(t.unwrap())):t instanceof Le?Le.create(Xt(t.unwrap())):t instanceof Ue?Ue.create(t.items.map(e=>Xt(e))):t}var ye=class t extends k{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=D.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==T.object){let c=this._getOrReturnCtx(e);return x(c,{code:w.invalid_type,expected:T.object,received:c.parsedType}),A}let{status:r,ctx:o}=this._processInputParams(e),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof ze&&this._def.unknownKeys==="strip"))for(let c in o.data)a.includes(c)||s.push(c);let l=[];for(let c of a){let m=i[c],d=o.data[c];l.push({key:{status:"valid",value:c},value:m._parse(new Ce(o,d,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof ze){let c=this._def.unknownKeys;if(c==="passthrough")for(let m of s)l.push({key:{status:"valid",value:m},value:{status:"valid",value:o.data[m]}});else if(c==="strict")s.length>0&&(x(o,{code:w.unrecognized_keys,keys:s}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let m of s){let d=o.data[m];l.push({key:{status:"valid",value:m},value:c._parse(new Ce(o,d,o.path,m)),alwaysSet:m in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let c=[];for(let m of l){let d=await m.key,h=await m.value;c.push({key:d,value:h,alwaysSet:m.alwaysSet})}return c}).then(c=>se.mergeObjectSync(r,c)):se.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return C.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:C.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:P.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of D.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of D.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return Xt(this)}partial(e){let n={};for(let r of D.objectKeys(this.shape)){let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of D.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Ie;)i=i._def.innerType;n[r]=i}return new t({...this._def,shape:()=>n})}keyof(){return Hl(D.objectKeys(this.shape))}};ye.create=(t,e)=>new ye({shape:()=>t,unknownKeys:"strip",catchall:ze.create(),typeName:P.ZodObject,...O(e)});ye.strictCreate=(t,e)=>new ye({shape:()=>t,unknownKeys:"strict",catchall:ze.create(),typeName:P.ZodObject,...O(e)});ye.lazycreate=(t,e)=>new ye({shape:t,unknownKeys:"strip",catchall:ze.create(),typeName:P.ZodObject,...O(e)});var Rt=class extends k{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(s=>new ge(s.ctx.common.issues));return x(n,{code:w.invalid_union,unionErrors:a}),A}if(n.common.async)return Promise.all(r.map(async i=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(o);{let i,a=[];for(let l of r){let c={...n,common:{...n.common,issues:[]},parent:null},m=l._parseSync({data:n.data,path:n.path,parent:c});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let s=a.map(l=>new ge(l));return x(n,{code:w.invalid_union,unionErrors:s}),A}}get options(){return this._def.options}};Rt.create=(t,e)=>new Rt({options:t,typeName:P.ZodUnion,...O(e)});var We=t=>t instanceof zt?We(t.schema):t instanceof _e?We(t.innerType()):t instanceof Ot?[t.value]:t instanceof kt?t.options:t instanceof Dt?D.objectValues(t.enum):t instanceof $t?We(t._def.innerType):t instanceof Et?[void 0]:t instanceof At?[null]:t instanceof Ie?[void 0,...We(t.unwrap())]:t instanceof Le?[null,...We(t.unwrap())]:t instanceof kn||t instanceof Lt?We(t.unwrap()):t instanceof Ut?We(t._def.innerType):[],Sr=class t extends k{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==T.object)return x(n,{code:w.invalid_type,expected:T.object,received:n.parsedType}),A;let r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(x(n,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),A)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=new Map;for(let i of n){let a=We(i.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of a){if(o.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);o.set(s,i)}}return new t({typeName:P.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...O(r)})}};function Lo(t,e){let n=$e(t),r=$e(e);if(t===e)return{valid:!0,data:t};if(n===T.object&&r===T.object){let o=D.objectKeys(e),i=D.objectKeys(t).filter(s=>o.indexOf(s)!==-1),a={...t,...e};for(let s of i){let l=Lo(t[s],e[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===T.array&&r===T.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let i=0;i<t.length;i++){let a=t[i],s=e[i],l=Lo(a,s);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===T.date&&r===T.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Pt=class extends k{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=(i,a)=>{if(yr(i)||yr(a))return A;let s=Lo(i.value,a.value);return s.valid?((br(i)||br(a))&&n.dirty(),{status:n.value,value:s.data}):(x(r,{code:w.invalid_intersection_types}),A)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,a])=>o(i,a)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Pt.create=(t,e,n)=>new Pt({left:t,right:e,typeName:P.ZodIntersection,...O(n)});var Ue=class t extends k{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==T.array)return x(r,{code:w.invalid_type,expected:T.array,received:r.parsedType}),A;if(r.data.length<this._def.items.length)return x(r,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&r.data.length>this._def.items.length&&(x(r,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((a,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Ce(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(i).then(a=>se.mergeArray(n,a)):se.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Ue.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ue({items:t,typeName:P.ZodTuple,rest:null,...O(e)})};var wr=class t extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==T.object)return x(r,{code:w.invalid_type,expected:T.object,received:r.parsedType}),A;let o=[],i=this._def.keyType,a=this._def.valueType;for(let s in r.data)o.push({key:i._parse(new Ce(r,s,r.path,s)),value:a._parse(new Ce(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?se.mergeObjectAsync(n,o):se.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof k?new t({keyType:e,valueType:n,typeName:P.ZodRecord,...O(r)}):new t({keyType:it.create(),valueType:e,typeName:P.ZodRecord,...O(n)})}},nn=class extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==T.map)return x(r,{code:w.invalid_type,expected:T.map,received:r.parsedType}),A;let o=this._def.keyType,i=this._def.valueType,a=[...r.data.entries()].map(([s,l],c)=>({key:o._parse(new Ce(r,s,r.path,[c,"key"])),value:i._parse(new Ce(r,l,r.path,[c,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of a){let c=await l.key,m=await l.value;if(c.status==="aborted"||m.status==="aborted")return A;(c.status==="dirty"||m.status==="dirty")&&n.dirty(),s.set(c.value,m.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let l of a){let c=l.key,m=l.value;if(c.status==="aborted"||m.status==="aborted")return A;(c.status==="dirty"||m.status==="dirty")&&n.dirty(),s.set(c.value,m.value)}return{status:n.value,value:s}}}};nn.create=(t,e,n)=>new nn({valueType:e,keyType:t,typeName:P.ZodMap,...O(n)});var rn=class t extends k{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==T.set)return x(r,{code:w.invalid_type,expected:T.set,received:r.parsedType}),A;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(x(r,{code:w.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(x(r,{code:w.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let i=this._def.valueType;function a(l){let c=new Set;for(let m of l){if(m.status==="aborted")return A;m.status==="dirty"&&n.dirty(),c.add(m.value)}return{status:n.value,value:c}}let s=[...r.data.values()].map((l,c)=>i._parse(new Ce(r,l,r.path,c)));return r.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(e,n){return new t({...this._def,minSize:{value:e,message:C.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:C.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};rn.create=(t,e)=>new rn({valueType:t,minSize:null,maxSize:null,typeName:P.ZodSet,...O(e)});var Mr=class t extends k{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==T.function)return x(n,{code:w.invalid_type,expected:T.function,received:n.parsedType}),A;function r(s,l){return On({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Jt(),je].filter(c=>!!c),issueData:{code:w.invalid_arguments,argumentsError:l}})}function o(s,l){return On({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Jt(),je].filter(c=>!!c),issueData:{code:w.invalid_return_type,returnTypeError:l}})}let i={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof st){let s=this;return de(async function(...l){let c=new ge([]),m=await s._def.args.parseAsync(l,i).catch(g=>{throw c.addIssue(r(l,g)),c}),d=await Reflect.apply(a,this,m);return await s._def.returns._def.type.parseAsync(d,i).catch(g=>{throw c.addIssue(o(d,g)),c})})}else{let s=this;return de(function(...l){let c=s._def.args.safeParse(l,i);if(!c.success)throw new ge([r(l,c.error)]);let m=Reflect.apply(a,this,c.data),d=s._def.returns.safeParse(m,i);if(!d.success)throw new ge([o(m,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Ue.create(e).rest(Je.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||Ue.create([]).rest(Je.create()),returns:n||Je.create(),typeName:P.ZodFunction,...O(r)})}},zt=class extends k{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};zt.create=(t,e)=>new zt({getter:t,typeName:P.ZodLazy,...O(e)});var Ot=class extends k{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return x(n,{received:n.data,code:w.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ot.create=(t,e)=>new Ot({value:t,typeName:P.ZodLiteral,...O(e)});function Hl(t,e){return new kt({values:t,typeName:P.ZodEnum,...O(e)})}var kt=class t extends k{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return x(n,{expected:D.joinValues(r),received:n.parsedType,code:w.invalid_type}),A}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return x(n,{received:n.data,code:w.invalid_enum_value,options:r}),A}return de(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};kt.create=Hl;var Dt=class extends k{_parse(e){let n=D.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==T.string&&r.parsedType!==T.number){let o=D.objectValues(n);return x(r,{expected:D.joinValues(o),received:r.parsedType,code:w.invalid_type}),A}if(this._cache||(this._cache=new Set(D.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=D.objectValues(n);return x(r,{received:r.data,code:w.invalid_enum_value,options:o}),A}return de(e.data)}get enum(){return this._def.values}};Dt.create=(t,e)=>new Dt({values:t,typeName:P.ZodNativeEnum,...O(e)});var st=class extends k{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==T.promise&&n.common.async===!1)return x(n,{code:w.invalid_type,expected:T.promise,received:n.parsedType}),A;let r=n.parsedType===T.promise?n.data:Promise.resolve(n.data);return de(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};st.create=(t,e)=>new st({type:t,typeName:P.ZodPromise,...O(e)});var _e=class extends k{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,i={addIssue:a=>{x(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(r.data,i);if(r.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return A;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?A:l.status==="dirty"?It(l.value):n.value==="dirty"?It(l.value):l});{if(n.value==="aborted")return A;let s=this._def.schema._parseSync({data:a,path:r.path,parent:r});return s.status==="aborted"?A:s.status==="dirty"?It(s.value):n.value==="dirty"?It(s.value):s}}if(o.type==="refinement"){let a=s=>{let l=o.refinement(s,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?A:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?A:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(o.type==="transform")if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ot(a))return A;let s=o.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>ot(a)?Promise.resolve(o.transform(a.value,i)).then(s=>({status:n.value,value:s})):A);D.assertNever(o)}};_e.create=(t,e,n)=>new _e({schema:t,typeName:P.ZodEffects,effect:e,...O(n)});_e.createWithPreprocess=(t,e,n)=>new _e({schema:e,effect:{type:"preprocess",transform:t},typeName:P.ZodEffects,...O(n)});var Ie=class extends k{_parse(e){return this._getType(e)===T.undefined?de(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ie.create=(t,e)=>new Ie({innerType:t,typeName:P.ZodOptional,...O(e)});var Le=class extends k{_parse(e){return this._getType(e)===T.null?de(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Le.create=(t,e)=>new Le({innerType:t,typeName:P.ZodNullable,...O(e)});var $t=class extends k{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===T.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};$t.create=(t,e)=>new $t({innerType:t,typeName:P.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...O(e)});var Ut=class extends k{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ht(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ge(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ge(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Ut.create=(t,e)=>new Ut({innerType:t,typeName:P.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...O(e)});var on=class extends k{_parse(e){if(this._getType(e)!==T.nan){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.nan,received:r.parsedType}),A}return{status:"valid",value:e.data}}};on.create=t=>new on({typeName:P.ZodNaN,...O(t)});var Xp=Symbol("zod_brand"),kn=class extends k{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Dn=class t extends k{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?A:i.status==="dirty"?(n.dirty(),It(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?A:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:P.ZodPipeline})}},Lt=class extends k{_parse(e){let n=this._def.innerType._parse(e),r=o=>(ot(o)&&(o.value=Object.freeze(o.value)),o);return Ht(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}};Lt.create=(t,e)=>new Lt({innerType:t,typeName:P.ZodReadonly,...O(e)});function Yl(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function Xl(t,e={},n){return t?at.create().superRefine((r,o)=>{let i=t(r);if(i instanceof Promise)return i.then(a=>{if(!a){let s=Yl(e,r),l=s.fatal??n??!0;o.addIssue({code:"custom",...s,fatal:l})}});if(!i){let a=Yl(e,r),s=a.fatal??n??!0;o.addIssue({code:"custom",...a,fatal:s})}}):at.create()}var eh={object:ye.lazycreate},P;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(P||(P={}));var th=(t,e={message:`Input not instance of ${t.name}`})=>Xl(n=>n instanceof t,e),ec=it.create,tc=Ct.create,nh=on.create,rh=_t.create,nc=Nt.create,oh=vt.create,ih=en.create,ah=Et.create,sh=At.create,lh=at.create,ch=Je.create,uh=ze.create,dh=tn.create,mh=He.create,ph=ye.create,hh=ye.strictCreate,fh=Rt.create,gh=Sr.create,yh=Pt.create,bh=Ue.create,Sh=wr.create,wh=nn.create,Mh=rn.create,xh=Mr.create,Th=zt.create,Ih=Ot.create,Ch=kt.create,_h=Dt.create,Nh=st.create,vh=_e.create,Eh=Ie.create,Ah=Le.create,Rh=_e.createWithPreprocess,Ph=Dn.create,zh=()=>ec().optional(),Oh=()=>tc().optional(),kh=()=>nc().optional(),Dh={string:(t=>it.create({...t,coerce:!0})),number:(t=>Ct.create({...t,coerce:!0})),boolean:(t=>Nt.create({...t,coerce:!0})),bigint:(t=>_t.create({...t,coerce:!0})),date:(t=>vt.create({...t,coerce:!0}))};var $h=A;var rc=Vo;var Uh={ResourceNotFound:-32002,InvalidParams:Tt.InvalidParams,InternalError:Tt.InternalError};var Mw=rc.string().regex(/^#[0-9A-Fa-f]{6}$/,"Color must be in hex format (e.g., #FFFFFF).");var ic=t=>t.startsWith("file://")?(0,oc.fileURLToPath)(t):t;var qo=t=>new vn(Uh.InvalidParams,t);var le=[];for(let t=0;t<256;++t)le.push((t+256).toString(16).slice(1));function ac(t,e=0){return(le[t[e+0]]+le[t[e+1]]+le[t[e+2]]+le[t[e+3]]+"-"+le[t[e+4]]+le[t[e+5]]+"-"+le[t[e+6]]+le[t[e+7]]+"-"+le[t[e+8]]+le[t[e+9]]+"-"+le[t[e+10]]+le[t[e+11]]+le[t[e+12]]+le[t[e+13]]+le[t[e+14]]+le[t[e+15]]).toLowerCase()}var Lh=new Uint8Array(16);function Zo(){return crypto.getRandomValues(Lh)}function Vh(t,e,n){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():qh(t,e,n)}function qh(t,e,n){t=t||{};let r=t.random??t.rng?.()??Zo();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){if(n=n||0,n<0||n+16>e.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let o=0;o<16;++o)e[n+o]=r[o];return e}return ac(r)}var X=Vh;var Zh={equalsEntries(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],o=e[n];if(r.modelType!==o.modelType||r.modelType==="single"&&o.modelType==="single"&&r.columnModelId!==o.columnModelId||r.modelType==="group"&&o.modelType==="group"&&r.columnGroupId!==o.columnGroupId)return!1}return!0},serializeEntries(t){return t.map(e=>e.modelType==="group"?`group:${e.columnGroupId}`:e.columnModelId)},deserializeEntries(t){return t.map(e=>e.startsWith("group:")?{modelType:"group",columnGroupId:e.substring(6)}:{modelType:"single",columnModelId:e})}},lt=Zh;var $n=class extends Error{constructor(e){super(e)}},xr=class extends $n{constructor(e,n){super(`Not exists property '${e}' in object : ${n}`),this.propertyName=e}},Tr=class extends $n{constructor(e,n){super(`The property '${e}' is not array : ${n}`),this.propertyName=e}},Ir=class extends $n{constructor(e,n){super(`The property '${e}' is not Object : ${n}`),this.propertyName=e}};function S(t,e){if(!(e in t))throw new xr(e,t)}function j(t,e,n){if(Fh(t)===!1)throw new Tr(e,t);if(t.length===0)return[];if(Qh(t)===!1)throw new Ir(e,t);return t.map(r=>n(r))}function Fh(t){return Array.isArray(t)}function Qh(t){return t.every(e=>typeof e=="object"&&e!==null)}function Ve(t,e=null){return t==null?e??new Date:t instanceof Date?t:typeof t=="string"?new Date(t):new Date}var ct=class t{constructor({structShareModelId:e="",physicalName:n="",logicalName:r="",columnEntries:o=[],isArray:i=!1,description:a=""}){this.structShareModelId=e||X(),this.physicalName=n.trim(),this.logicalName=r.trim(),this.columnEntries=o,this.isArray=i,this.description=a.trim()}simpleColumnType(){return this.isArray===!0?"ARRAY<STRUCT>":"STRUCT"}toJSON(){let e=lt.serializeEntries(this.columnEntries);return{structShareModelId:this.structShareModelId,physicalName:this.physicalName,...this.logicalName!==""&&{logicalName:this.logicalName},columnModelIds:e,...this.isArray===!0&&{isArray:this.isArray},...this.description!==""&&{description:this.description}}}static toObject(e){S(e,"structShareModelId"),S(e,"physicalName"),S(e,"columnModelIds");let n="logicalName"in e?e.logicalName:"",r=lt.deserializeEntries(e.columnModelIds),o="isArray"in e?e.isArray:!1,i="description"in e?e.description:"";return new t({structShareModelId:e.structShareModelId,physicalName:e.physicalName,logicalName:n,columnEntries:r,isArray:o,description:i})}equals(e){return this.structShareModelId!==e.structShareModelId||this.physicalName!==e.physicalName||this.logicalName!==e.logicalName||this.description!==e.description||this.isArray!==e.isArray?!1:lt.equalsEntries(this.columnEntries,e.columnEntries)}};function Xe(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([n,r])=>{let o=e.get(n);return o!=null&&r.equals(o)})}function Vt(t,e){let n=t.size===e.size,r=Array.from(e.entries()).map(([o,i])=>{let a=t.get(o);return a!=null&&a.equals(i)?[o,a]:(n=!1,[o,i])});return n?t:new Map(r)}function Fo(t,e){return an(t,e)?t:e}function an(t,e){return t.length!==e.length?!1:t.every((n,r)=>n===e[r])}var Un=class t{constructor(e,n){this.columnShareModelMap=e,this.structShareModelMap=n}static create(e=null,n=null){let r=new Map(e==null?[]:e.map(i=>[i.columnShareModelId,i])),o=new Map(n==null?[]:n.map(i=>[i.structShareModelId,i]));return new t(r,o)}getColumnShareModels(){return Array.from(this.columnShareModelMap.values()).sort((e,n)=>{let r=e.physicalName.localeCompare(n.physicalName,"en");if(r!==0)return r;let o=e.logicalName.localeCompare(n.logicalName,"en");if(o!==0)return o;let i=e.columnType.name.localeCompare(n.columnType.name,"en");return i!==0?i:e.columnShareModelId.localeCompare(n.columnShareModelId,"en")})}findColumnShare(e){if(e==="")return null;let n=this.columnShareModelMap.get(e);return n??null}addColumnShare(...e){if(e.length===0)return this;let n=new Map(this.columnShareModelMap);return e.forEach(r=>n.set(r.columnShareModelId,r)),new t(n,this.structShareModelMap)}getStructShareModels(){return this.structShareModelMap.size===0?[]:Array.from(this.structShareModelMap.values()).sort((e,n)=>{let r=e.physicalName.localeCompare(n.physicalName,"en");return r!==0?r:e.structShareModelId.localeCompare(n.structShareModelId,"en")})}findStructShare(e){if(e==="")return null;let n=this.structShareModelMap.get(e);return n??null}addStructShare(...e){if(e.length===0)return this;let n=new Map(this.structShareModelMap);return e.forEach(r=>n.set(r.structShareModelId,r)),new t(this.columnShareModelMap,n)}deleteStructShare(e){if(e.length===0)return this;let n=new Map(this.structShareModelMap);return e.forEach(r=>n.delete(r)),new t(this.columnShareModelMap,n)}retain(e,n,r,o){let i=Array.from(this.columnShareModelMap.keys()).filter(s=>e.has(s)===!1),a=Array.from(this.structShareModelMap.keys()).filter(s=>n.has(s)===!1);return this.deleteColumnShare(i).deleteStructShare(a).deleteDanglingColumnEntries(r,o)}deleteColumnShare(e){if(e.length===0)return this;let n=new Map(this.columnShareModelMap);return e.forEach(r=>n.delete(r)),new t(n,this.structShareModelMap)}deleteDanglingColumnEntries(e,n){let r=!1,o=new Map(this.structShareModelMap);for(let[i,a]of this.structShareModelMap.entries()){let s=a.columnEntries.filter(c=>c.modelType==="single"?e.has(c.columnModelId):n.has(c.columnGroupId));if(s.length===a.columnEntries.length)continue;r=!0;let l=new ct({...a,columnEntries:s});o.set(i,l)}return r?new t(this.columnShareModelMap,o):this}copy(){return new t(new Map(this.columnShareModelMap),new Map(this.structShareModelMap))}equals(e){return Xe(this.columnShareModelMap,e.columnShareModelMap)&&Xe(this.structShareModelMap,e.structShareModelMap)}reuseInstancesFrom(e){let n=Vt(e.columnShareModelMap,this.columnShareModelMap),r=Vt(e.structShareModelMap,this.structShareModelMap);return(n===e.columnShareModelMap&&r===e.structShareModelMap)===!0?e:new t(new Map(n),new Map(r))}};var sn=class t{constructor({columnGroupId:e="",groupName:n="",columnModelIds:r=[],description:o=""}){this.columnGroupId=e||X(),this.groupName=n.trim(),this.columnModelIds=[...r],this.description=o}toJSON(){return{columnGroupId:this.columnGroupId,groupName:this.groupName,columnModelIds:this.columnModelIds,...this.description!==""&&{description:this.description}}}static toObject(e){return S(e,"columnGroupId"),S(e,"groupName"),S(e,"columnModelIds"),new t({columnGroupId:e.columnGroupId,groupName:e.groupName,columnModelIds:e.columnModelIds,description:"description"in e?e.description:""})}equals(e){return this.columnGroupId===e.columnGroupId&&this.groupName===e.groupName&&this.description===e.description&&this.columnModelIds.length===e.columnModelIds.length&&this.columnModelIds.every((n,r)=>n===e.columnModelIds[r])}};var ut=class t{constructor(e){this.entityType="simple";this.columnModelId=e.columnModelId?e.columnModelId:X(),this.physicalName=(e.physicalName??"").trim(),this.logicalName=(e.logicalName??"").trim(),this.notNull=e.notNull??!1,this.columnShareModelId=e.columnShareModelId,this.primaryKey=e.primaryKey??!1,this.unique=e.unique??!1,this.autoIncrement=e.autoIncrement??!1,this.defaultValue=(e.defaultValue??"").trim()}toJSON(){return{columnModelId:this.columnModelId,columnShareModelId:this.columnShareModelId,...this.physicalName!==""&&{physicalName:this.physicalName},...this.logicalName!==""&&{logicalName:this.logicalName},...this.primaryKey&&{primaryKey:this.primaryKey},...this.notNull&&{notNull:this.notNull},...this.unique&&{unique:this.unique},...this.autoIncrement&&{autoIncrement:this.autoIncrement},...this.defaultValue!==""&&{defaultValue:this.defaultValue}}}static toObject(e){S(e,"columnModelId"),S(e,"columnShareModelId");let n="physicalName"in e?e.physicalName:"",r="logicalName"in e?e.logicalName:"",o="notNull"in e?e.notNull:!1,i="primaryKey"in e?e.primaryKey:!1,a="unique"in e?e.unique:!1,s="autoIncrement"in e?e.autoIncrement:!1,l="defaultValue"in e?e.defaultValue:"";return new t({columnModelId:e.columnModelId,columnShareModelId:e.columnShareModelId,physicalName:n,logicalName:r,primaryKey:i,notNull:o,unique:a,autoIncrement:s,defaultValue:l})}equals(e){return this.columnModelId===e.columnModelId&&this.physicalName===e.physicalName&&this.logicalName===e.logicalName&&this.notNull===e.notNull&&this.columnShareModelId===e.columnShareModelId&&this.primaryKey===e.primaryKey&&this.unique===e.unique&&this.autoIncrement===e.autoIncrement&&this.defaultValue===e.defaultValue}};var Ln=class t{constructor(e){this.entityType="struct";this.columnModelId=e.columnModelId?e.columnModelId:X(),this.physicalName=(e.physicalName??"").trim(),this.logicalName=(e.logicalName??"").trim(),this.notNull=e.notNull??!1,this.structShareModelId=e.structShareModelId}toJSON(){return{columnModelId:this.columnModelId,entityType:"struct",structShareModelId:this.structShareModelId,...this.physicalName!==""&&{physicalName:this.physicalName},...this.logicalName!==""&&{logicalName:this.logicalName},...this.notNull&&{notNull:this.notNull}}}static toObject(e){S(e,"columnModelId"),S(e,"structShareModelId");let n="physicalName"in e?e.physicalName:"",r="logicalName"in e?e.logicalName:"",o="notNull"in e?e.notNull:!1;return new t({columnModelId:e.columnModelId,physicalName:n,logicalName:r,notNull:o,structShareModelId:e.structShareModelId})}equals(e){return this.columnModelId===e.columnModelId&&this.physicalName===e.physicalName&&this.logicalName===e.logicalName&&this.notNull===e.notNull&&this.structShareModelId===e.structShareModelId}};var Vn={isSimpleColumn(t){return t.entityType==="simple"},isStructColumn(t){return t.entityType==="struct"},equals(t,e){return Vn.isSimpleColumn(t)&&Vn.isSimpleColumn(e)||Vn.isStructColumn(t)&&Vn.isStructColumn(e)?t.equals(e):!1},toObject(t){return("entityType"in t?t.entityType:"simple")==="struct"?Ln.toObject(t):ut.toObject(t)}},ce=Vn;var qn=class t{constructor({columnShareModelId:e,physicalName:n,logicalName:r,columnType:o,precision:i="",scale:a="",unsigned:s=!1,isArray:l=!1,description:c="",checkExpression:m="",characterSet:d="",collate:h="",optionExpression:g="",createdAt:b=null}){this.columnShareModelId=e,this.physicalName=n,this.logicalName=r,this.columnType=o,this.precision=o.withPrecision?i:"",this.scale=o.withScale?a:"",this.unsigned=o.withUnsigned?s:!1,this.isArray=l,this.description=c.trim(),this.checkExpression=m.trim(),this.characterSetValue=d.trim(),this.collateValue=h.trim(),this.optionExpression=g.trim(),this.createdAt=b||new Date}get collate(){return this.columnType.category==="text"?this.collateValue:""}characterSet(e){return this.columnType.category==="text"&&e.editableCharacterSet?this.characterSetValue:""}specifiedColumnType(e=!1){return this.columnType.specifiedType({precision:this.precision,scale:this.scale,isArray:this.isArray,inChildRelation:e})}matchForReferenceType(e){let n=this.specifiedColumnType(!0),r=e.specifiedColumnType(!0);return!(n!==r||this.columnType.withUnsigned&&this.unsigned!==e.unsigned)}toJSON(){return{columnShareModelId:this.columnShareModelId,physicalName:this.physicalName,logicalName:this.logicalName,columnTypeId:this.columnType.id,...this.precision!==""&&{precision:this.precision},...this.scale!==""&&{scale:this.scale},...this.unsigned&&{unsigned:this.unsigned},...this.isArray&&{isArray:this.isArray},...this.description!==""&&{description:this.description},...this.checkExpression!==""&&{checkExpression:this.checkExpression},...this.characterSetValue!==""&&this.columnType.category==="text"&&{characterSet:this.characterSetValue},...this.collateValue!==""&&this.columnType.category==="text"&&{collate:this.collateValue},...this.optionExpression!==""&&{optionExpression:this.optionExpression},createdAt:this.createdAt}}static toObject(e,n){return S(e,"columnShareModelId"),S(e,"physicalName"),S(e,"logicalName"),S(e,"columnTypeId"),new t({columnShareModelId:e.columnShareModelId,physicalName:e.physicalName,logicalName:e.logicalName,columnType:n(e.columnTypeId),precision:"precision"in e?e.precision:"",scale:"scale"in e?e.scale:"",unsigned:"unsigned"in e?e.unsigned:!1,isArray:"isArray"in e?e.isArray:!1,description:"description"in e?e.description:"",checkExpression:"checkExpression"in e?e.checkExpression:"",characterSet:"characterSet"in e?e.characterSet:"",collate:"collate"in e?e.collate:"",optionExpression:"optionExpression"in e?e.optionExpression:"",createdAt:"createdAt"in e?Ve(e.createdAt):new Date})}equals(e){return this.columnShareModelId===e.columnShareModelId&&this.physicalName===e.physicalName&&this.logicalName===e.logicalName&&this.columnType.id===e.columnType.id&&this.precision===e.precision&&this.scale===e.scale&&this.unsigned===e.unsigned&&this.isArray===e.isArray&&this.description===e.description&&this.checkExpression===e.checkExpression&&this.characterSetValue===e.characterSetValue&&this.collateValue===e.collateValue&&this.optionExpression===e.optionExpression}};var dt=class t{constructor({parentColumnModelId:e,childColumnModelId:n}){this.parentColumnModelId=e,this.childColumnModelId=n}toJSON(){return{parentColumnModelId:this.parentColumnModelId,childColumnModelId:this.childColumnModelId}}static toObject(e){return S(e,"parentColumnModelId"),S(e,"childColumnModelId"),new t({parentColumnModelId:e.parentColumnModelId,childColumnModelId:e.childColumnModelId})}equals(e){return this.parentColumnModelId===e.parentColumnModelId&&this.childColumnModelId===e.childColumnModelId}};var qe=class t{constructor({relationModelId:e="",relationName:n="",parentTableModelId:r,parentCardinality:o="1",childTableModelId:i,childCardinality:a="1",relationPairs:s=[],onUpdateAction:l="RESTRICT",onDeleteAction:c="RESTRICT"}){this.relationModelId=e||X(),this.relationName=n,this.parentTableModelId=r,this.parentCardinality=o,this.childTableModelId=i,this.childCardinality=a,this.relationPairs=[...s],this.onUpdateAction=l,this.onDeleteAction=c}toJSON(){return{relationModelId:this.relationModelId,...this.relationName!==""&&{relationName:this.relationName},parentTableModelId:this.parentTableModelId,parentCardinality:this.parentCardinality,childTableModelId:this.childTableModelId,childCardinality:this.childCardinality,relationPairs:this.relationPairs.map(e=>e.toJSON()),onUpdateAction:this.onUpdateAction,onDeleteAction:this.onDeleteAction}}static toObject(e){return S(e,"relationModelId"),S(e,"parentTableModelId"),S(e,"childTableModelId"),S(e,"relationPairs"),new t({relationModelId:e.relationModelId,relationName:"relationName"in e?e.relationName:"",parentTableModelId:e.parentTableModelId,parentCardinality:"parentCardinality"in e?e.parentCardinality:"1",childTableModelId:e.childTableModelId,childCardinality:"childCardinality"in e?e.childCardinality:"1",relationPairs:j(e.relationPairs,"relationPairs",n=>dt.toObject(n)),onUpdateAction:"onUpdateAction"in e?e.onUpdateAction:"RESTRICT",onDeleteAction:"onDeleteAction"in e?e.onDeleteAction:"RESTRICT"})}equals(e){if(this.relationModelId!==e.relationModelId||this.relationName!==e.relationName||this.parentTableModelId!==e.parentTableModelId||this.parentCardinality!==e.parentCardinality||this.childTableModelId!==e.childTableModelId||this.childCardinality!==e.childCardinality||this.relationPairs.length!==e.relationPairs.length)return!1;for(let n=0;n<this.relationPairs.length;n++)if(this.relationPairs[n].equals(e.relationPairs[n])===!1)return!1;return!(this.onUpdateAction!==e.onUpdateAction||this.onDeleteAction!==e.onDeleteAction)}};var mt=(t,e)=>{let n=t.physicalName!=""?t.physicalName:e.physicalName,r=t.logicalName!=""?t.logicalName:e.logicalName;return{physicalName:n,logicalName:r}};var pt=class t{constructor({tableIndexModelId:e,physicalName:n,indexColumnModels:r,indexOption:o="",indexType:i="",clustered:a=!1,description:s=""}){this.tableIndexModelId=e,this.physicalName=n.trim(),this.indexColumnModels=[...r],this.indexOption=o,this.indexType=i,this.clustered=a,this.description=s}static filterColumns(e,n){let r=!1;return{tableIndexModels:e.flatMap(i=>{let a=i.indexColumnModels.filter(n);return a.length===i.indexColumnModels.length?[i]:(r=!0,a.length===0?[]:[new t({...i,indexColumnModels:a})])}),hasChanged:r}}toJSON(){return{tableIndexModelId:this.tableIndexModelId,physicalName:this.physicalName,indexColumnModels:this.indexColumnModels.map(e=>e.toJSON()),...this.indexOption!==""&&{indexOption:this.indexOption},...this.indexType!==""&&{indexType:this.indexType},...this.clustered&&{clustered:this.clustered},...this.description!==""&&{description:this.description}}}static toObject(e){S(e,"tableIndexModelId"),S(e,"physicalName"),S(e,"indexColumnModels");let n=j(e.indexColumnModels,"indexColumnModels",r=>Qo.toObject(r));return new t({tableIndexModelId:e.tableIndexModelId,physicalName:e.physicalName,indexColumnModels:n,indexOption:Bh(e),indexType:"indexType"in e?e.indexType:"",clustered:"clustered"in e?e.clustered:!1,description:"description"in e?e.description:""})}equals(e){if(this.tableIndexModelId!==e.tableIndexModelId||this.physicalName!==e.physicalName||this.indexColumnModels.length!==e.indexColumnModels.length)return!1;for(let n=0;n<this.indexColumnModels.length;n++){let r=this.indexColumnModels[n],o=e.indexColumnModels[n];if(r.equals(o)===!1)return!1}return!(this.indexOption!==e.indexOption||this.indexType!==e.indexType||this.clustered!==e.clustered||this.description!==e.description)}},Bh=t=>"indexOption"in t?t.indexOption:"indexOptioin"in t?t.indexOptioin:"",Qo=class t{constructor({columnModelId:e,sortOrderType:n="",nullsOrderType:r=""}){this.columnModelId=e,this.sortOrderType=n,this.nullsOrderType=r}querySort(){return this.sortOrderType===""?"":this.nullsOrderType===""?this.sortOrderType:`${this.sortOrderType} NULLS ${this.nullsOrderType}`}toJSON(){return{columnModelId:this.columnModelId,...this.sortOrderType!==""&&{sortOrderType:this.sortOrderType},...this.nullsOrderType!==""&&{nullsOrderType:this.nullsOrderType}}}static toObject(e){return S(e,"columnModelId"),new t({columnModelId:e.columnModelId,sortOrderType:"sortOrderType"in e?e.sortOrderType:"",nullsOrderType:"nullsOrderType"in e?e.nullsOrderType:""})}equals(e){return!(this.columnModelId!==e.columnModelId||this.sortOrderType!==e.sortOrderType||this.nullsOrderType!==e.nullsOrderType)}};var ht=class t{constructor({tableUniqueKeysModelId:e,physicalName:n="",uniqueKeysColumnModels:r,description:o=""}){this.tableUniqueKeysModelId=e,this.physicalName=n.trim(),this.uniqueKeysColumnModels=[...r],this.description=o}static filterColumns(e,n){let r=!1;return{tableUniqueKeysModels:e.flatMap(i=>{let a=i.uniqueKeysColumnModels.filter(n);return a.length===i.uniqueKeysColumnModels.length?[i]:(r=!0,a.length===0?[]:[new t({...i,uniqueKeysColumnModels:a})])}),hasChanged:r}}toJSON(){return{tableUniqueKeysModelId:this.tableUniqueKeysModelId,...this.physicalName!==""&&{physicalName:this.physicalName},uniqueKeysColumnModels:this.uniqueKeysColumnModels.map(e=>e.toJSON()),...this.description!==""&&{description:this.description}}}static toObject(e){S(e,"tableUniqueKeysModelId"),S(e,"uniqueKeysColumnModels");let n="physicalName"in e?e.physicalName:"",r=j(e.uniqueKeysColumnModels,"uniqueKeysColumnModels",o=>Bo.toObject(o));return new t({tableUniqueKeysModelId:e.tableUniqueKeysModelId,physicalName:n,uniqueKeysColumnModels:r,description:"description"in e?e.description:""})}equals(e){if(this.tableUniqueKeysModelId!==e.tableUniqueKeysModelId||this.physicalName!==e.physicalName||this.uniqueKeysColumnModels.length!==e.uniqueKeysColumnModels.length)return!1;for(let n=0;n<this.uniqueKeysColumnModels.length;n++){let r=this.uniqueKeysColumnModels[n],o=e.uniqueKeysColumnModels[n];if(r.equals(o)===!1)return!1}return this.description===e.description}},Bo=class t{constructor({columnModelId:e,sortOrderType:n}){this.columnModelId=e,this.sortOrderType=n}toJSON(){return{columnModelId:this.columnModelId,...this.sortOrderType!==""&&{sortOrderType:this.sortOrderType}}}static toObject(e){return S(e,"columnModelId"),new t({columnModelId:e.columnModelId,sortOrderType:"sortOrderType"in e?e.sortOrderType:""})}equals(e){return!(this.columnModelId!==e.columnModelId||this.sortOrderType!==e.sortOrderType)}};var Ze=class t{constructor({tableModelId:e="",physicalName:n="",logicalName:r="",schemaId:o="",columnEntries:i=[],uniqueKeysModels:a=[],tableIndexModels:s=[],description:l="",checkExpression:c="",characterSet:m="",collate:d="",definitionExpression:h="",optionExpression:g=""}){this.tableModelId=e||X(),this.physicalName=n.trim(),this.logicalName=r.trim(),this.schemaId=o,this.columnEntries=i,this.uniqueKeysModels=a,this.tableIndexModels=s,this.description=l.trim(),this.checkExpression=c.trim(),this.characterSet=m.trim(),this.collate=d.trim(),this.definitionExpression=h.trim(),this.optionExpression=g.trim()}addColumnModelIds(e){let n=new Set(this.columnEntries.filter(o=>o.modelType==="single").map(o=>o.columnModelId)),r=e.filter(o=>n.has(o)===!1).map(o=>({modelType:"single",columnModelId:o}));return r.length===0?this:new t({...this,columnEntries:this.columnEntries.concat(r)})}updateCheckExpression(e){if(this.checkExpression===""||e.length===0)return this;let n=this.checkExpression;for(let r of e){let o=`\${${r.previousName.physicalName}}`,i=`\${${r.nextName.physicalName}}`;n=n.replaceAll(o,i)}return n===this.checkExpression?this:new t({...this,checkExpression:n})}equals(e){if(this.tableModelId!==e.tableModelId||this.physicalName!==e.physicalName||this.logicalName!==e.logicalName||this.schemaId!==e.schemaId||lt.equalsEntries(this.columnEntries,e.columnEntries)===!1||this.uniqueKeysModels.length!==e.uniqueKeysModels.length)return!1;for(let n=0;n<this.uniqueKeysModels.length;n++){let r=this.uniqueKeysModels[n],o=e.uniqueKeysModels[n];if(r.equals(o)===!1)return!1}if(this.tableIndexModels.length!==e.tableIndexModels.length)return!1;for(let n=0;n<this.tableIndexModels.length;n++){let r=this.tableIndexModels[n],o=e.tableIndexModels[n];if(r.equals(o)===!1)return!1}return!(this.description!==e.description||this.checkExpression!==e.checkExpression||this.characterSet!==e.characterSet||this.collate!==e.collate||this.definitionExpression!==e.definitionExpression||this.optionExpression!==e.optionExpression)}toJSON(){let e=lt.serializeEntries(this.columnEntries);return{tableModelId:this.tableModelId,physicalName:this.physicalName,logicalName:this.logicalName,...this.schemaId!=""&&{schemaId:this.schemaId},columnModelIds:e,...this.uniqueKeysModels.length>0&&{uniqueKeysModels:this.uniqueKeysModels.map(n=>n.toJSON())},...this.tableIndexModels.length>0&&{tableIndexModels:this.tableIndexModels.map(n=>n.toJSON())},...this.description!==""&&{description:this.description},...this.checkExpression!==""&&{checkExpression:this.checkExpression},...this.characterSet!==""&&{characterSet:this.characterSet},...this.collate!==""&&{collate:this.collate},...this.definitionExpression!==""&&{definitionExpression:this.definitionExpression},...this.optionExpression!==""&&{optionExpression:this.optionExpression}}}static toObject(e){S(e,"tableModelId"),S(e,"physicalName"),S(e,"logicalName"),S(e,"columnModelIds");let n="schemaId"in e?e.schemaId:"",r=lt.deserializeEntries(e.columnModelIds),o="uniqueKeysModels"in e?j(e.uniqueKeysModels,"uniqueKeysModels",h=>ht.toObject(h)):[],i="tableIndexModels"in e?j(e.tableIndexModels,"tableIndexModels",h=>pt.toObject(h)):[],a="description"in e?e.description:"",s="checkExpression"in e?e.checkExpression:"",l="characterSet"in e?e.characterSet:"",c="collate"in e?e.collate:"",m="definitionExpression"in e?e.definitionExpression:"",d="optionExpression"in e?e.optionExpression:"";return new t({tableModelId:e.tableModelId,physicalName:e.physicalName,logicalName:e.logicalName,schemaId:n,columnEntries:r,uniqueKeysModels:o,tableIndexModels:i,description:a,checkExpression:s,characterSet:l,collate:c,definitionExpression:m,optionExpression:d})}};var Ko="[[TYPE]][]",u=class t{static{this.EMPTY=new t({id:0,name:"",description:"",baseQuery:""})}constructor({id:e,name:n,description:r,baseQuery:o,category:i="other",withPrecision:a=!1,withScale:s=!1,withUnsigned:l=!1,withAutoIncrement:c=!1,foreignColumn:m=null,defaultValueCandidates:d=[],arrayQueryTemplate:h=Ko}){this.id=e,this.name=n,this.description=r,this.baseQuery=o,this.category=i,this.withPrecision=a,this.withScale=s,this.withUnsigned=l,this.withAutoIncrement=c,this.foreignColumn=m??null,this.defaultValueCandidates=d,this.arrayQueryTemplate=h}specifiedType({precision:e="",scale:n="",isArray:r=!1,inChildRelation:o=!1}){if(this.foreignColumn&&o)return this.foreignColumn.specifiedType({precision:e,scale:n,isArray:r});if(this.baseQuery.indexOf("[[PARAM]]")<0)return this.applyArrayTemplate(this.baseQuery,r);let i=this.initTypeParam(e,n),a=this.baseQuery.replace("[[PARAM]]",i);return this.applyArrayTemplate(a,r)}applyArrayTemplate(e,n){return n===!1?e:this.arrayQueryTemplate.replace("[[TYPE]]",e)}candidateDefaultValues(e,n){return this.defaultValueCandidates.map(r=>{if(r.indexOf("[[PARAM]]")<0)return r;let o=this.initTypeParam(e,n);return r.replaceAll("[[PARAM]]",o)})}initTypeParam(e,n){return n&&this.withScale?`(${e}, ${n})`:e&&this.withPrecision?`(${e})`:""}toJSON(){return{id:this.id,name:this.name,description:this.description,baseQuery:this.baseQuery,category:this.category,...this.withPrecision&&{withPrecision:this.withPrecision},...this.withScale&&{withScale:this.withScale},...this.withUnsigned&&{withUnsigned:this.withUnsigned},...this.withAutoIncrement&&{withAutoIncrement:this.withAutoIncrement},...this.foreignColumn!=null&&{foreignColumn:this.foreignColumn.toJSON()},...this.defaultValueCandidates.length>0&&{defaultValueCandidates:this.defaultValueCandidates},...this.arrayQueryTemplate!==Ko&&{arrayQueryTemplate:this.arrayQueryTemplate}}}static toObject(e){S(e,"id"),S(e,"name"),S(e,"description"),S(e,"baseQuery");let n="category"in e?e.category:"other",r="withPrecision"in e?e.withPrecision:!1,o="withScale"in e?e.withScale:!1,i="withUnsigned"in e?e.withUnsigned:!1,a="withAutoIncrement"in e?e.withAutoIncrement:"withAuthIncrement"in e?e.withAuthIncrement:!1,s="foreignColumn"in e&&e.foreignColumn!=null?t.toObject(e.foreignColumn):null,l="defaultValueCandidates"in e?e.defaultValueCandidates:[],c="arrayQueryTemplate"in e?e.arrayQueryTemplate:Ko;return new t({id:e.id,name:e.name,description:e.description,baseQuery:e.baseQuery,category:n,withPrecision:r,withScale:o,withUnsigned:i,withAutoIncrement:a,foreignColumn:s,defaultValueCandidates:l,arrayQueryTemplate:c})}equals(e){return this.id===e.id&&this.name===e.name&&this.description===e.description&&this.baseQuery===e.baseQuery&&this.withPrecision===e.withPrecision&&this.withScale===e.withScale&&this.withUnsigned===e.withUnsigned&&this.withAutoIncrement===e.withAutoIncrement&&(this.foreignColumn===null&&e.foreignColumn===null||this.foreignColumn!==null&&e.foreignColumn!==null&&this.foreignColumn.equals(e.foreignColumn))&&this.defaultValueCandidates.length===e.defaultValueCandidates.length&&this.defaultValueCandidates.every((n,r)=>n===e.defaultValueCandidates[r])&&this.arrayQueryTemplate===e.arrayQueryTemplate}static migrateDefaultValueCandidates(e,n,r){if(e.name!==n.name||n.defaultValueCandidates.length===0)return e;if(r<20250612)return new t({...e,defaultValueCandidates:[...n.defaultValueCandidates]});if(r<20260321){let o=new Set(e.defaultValueCandidates);if(n.defaultValueCandidates.some(i=>o.has(i)===!1))return new t({...e,defaultValueCandidates:[...n.defaultValueCandidates]})}return e}};var sc=new u({id:11,name:"smallint",description:"2\u30D0\u30A4\u30C8\u7B26\u53F7\u4ED8\u304D\u6574\u6570",baseQuery:"SMALLINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),lc=new u({id:15,name:"integer",description:"4\u30D0\u30A4\u30C8\u7B26\u53F7\u4ED8\u304D\u6574\u6570",baseQuery:"INTEGER",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),cc=new u({id:17,name:"bigint",description:"8\u30D0\u30A4\u30C8\u7B26\u53F7\u4ED8\u304D\u6574\u6570",baseQuery:"BIGINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),Kh={postgres:[new u({id:1,name:"bit",description:"\u56FA\u5B9A\u9577\u30D3\u30C3\u30C8\u5217",baseQuery:"BIT",category:"bit",withPrecision:!1,withScale:!1}),new u({id:2,name:"bit (n)",description:"\u56FA\u5B9A\u9577\u30D3\u30C3\u30C8\u5217",baseQuery:"BIT[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1}),new u({id:4,name:"bit varying",description:"\u53EF\u5909\u9577\u30D3\u30C3\u30C8\u5217",baseQuery:"BIT VARYING",category:"bit",withPrecision:!1,withScale:!1}),new u({id:5,name:"bit varying (n)",description:"\u53EF\u5909\u9577\u30D3\u30C3\u30C8\u5217",baseQuery:"BIT VARYING[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1}),new u({id:6,name:"boolean",description:"\u8AD6\u7406\u5024 (\u771F/\u507D)",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1}),new u({id:367,name:"bytea",description:"\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF (\u300C\u30D0\u30A4\u30C8\u306E\u914D\u5217 (byte array)\u300D)",baseQuery:"BYTEA",category:"bit",withPrecision:!1,withScale:!1}),sc,new u({id:51,name:"smallserial",description:"\u81EA\u52D5\u5897\u52062\u30D0\u30A4\u30C8\u6574\u6570",baseQuery:"SMALLSERIAL",category:"integer",withPrecision:!1,withScale:!1,foreignColumn:sc}),lc,new u({id:55,name:"serial",description:"\u81EA\u52D5\u5897\u52064\u30D0\u30A4\u30C8\u6574\u6570",baseQuery:"SERIAL",category:"integer",withPrecision:!1,withScale:!1,foreignColumn:lc}),cc,new u({id:57,name:"bigserial",description:"\u81EA\u52D5\u5897\u52068\u30D0\u30A4\u30C8\u6574\u6570",baseQuery:"BIGSERIAL",category:"integer",withPrecision:!1,withScale:!1,foreignColumn:cc}),new u({id:31,name:"real",description:"\u5358\u7CBE\u5EA6\u6D6E\u52D5\u5C0F\u6570\u70B9 (4\u30D0\u30A4\u30C8)",baseQuery:"REAL",category:"decimal",withPrecision:!1,withScale:!1}),new u({id:33,name:"double precision",description:"\u500D\u7CBE\u5EA6\u6D6E\u52D5\u5C0F\u6570\u70B9 (8\u30D0\u30A4\u30C8)",baseQuery:"DOUBLE PRECISION",category:"decimal",withPrecision:!1,withScale:!1}),new u({id:35,name:"decimal",description:"\u7CBE\u5EA6\u306E\u9078\u629E\u53EF\u80FD\u306A\u9AD8\u7CBE\u5EA6\u6570\u5024",baseQuery:"DECIMAL",category:"decimal",withPrecision:!1,withScale:!1}),new u({id:36,name:"numeric",description:"\u7CBE\u5EA6\u306E\u9078\u629E\u53EF\u80FD\u306A\u9AD8\u7CBE\u5EA6\u6570\u5024",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1}),new u({id:45,name:"decimal (p, s)",description:"\u7CBE\u5EA6\u306E\u9078\u629E\u53EF\u80FD\u306A\u9AD8\u7CBE\u5EA6\u6570\u5024",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0}),new u({id:46,name:"numeric (p, s)",description:"\u7CBE\u5EA6\u306E\u9078\u629E\u53EF\u80FD\u306A\u9AD8\u7CBE\u5EA6\u6570\u5024",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0}),new u({id:101,name:"date",description:"\u66A6\u306E\u65E5\u4ED8 (\u5E74\u6708\u65E5)",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:131,name:"time without time zone",description:"\u6642\u523B (\u6642\u9593\u5E2F\u306A\u3057)",baseQuery:"TIME WITHOUT TIME ZONE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:132,name:"time with time zone",description:"\u6642\u9593\u5E2F\u4ED8\u304D\u6642\u523B",baseQuery:"TIME WITH TIME ZONE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:141,name:"time (p) without time zone",description:"\u6642\u523B (\u6642\u9593\u5E2F\u306A\u3057)",baseQuery:"TIME[[PARAM]] WITHOUT TIME ZONE",category:"timestamp",withPrecision:!0,withScale:!1}),new u({id:142,name:"time (p) with time zone",description:"\u6642\u9593\u5E2F\u4ED8\u304D\u6642\u523B",baseQuery:"TIME[[PARAM]] WITH TIME ZONE",category:"timestamp",withPrecision:!0,withScale:!1}),new u({id:111,name:"timestamp without time zone",description:"\u65E5\u4ED8\u3068\u6642\u523B (\u6642\u9593\u5E2F\u306A\u3057)",baseQuery:"TIMESTAMP WITHOUT TIME ZONE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:112,name:"timestamp with time zone",description:"\u6642\u9593\u5E2F\u4ED8\u304D\u65E5\u4ED8\u3068\u6642\u523B",baseQuery:"TIMESTAMP WITH TIME ZONE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:121,name:"timestamp (p) without time zone",description:"\u65E5\u4ED8\u3068\u6642\u523B (\u6642\u9593\u5E2F\u306A\u3057)",baseQuery:"TIMESTAMP[[PARAM]] WITHOUT TIME ZONE",category:"timestamp",withPrecision:!0,withScale:!1}),new u({id:122,name:"timestamp (p) with time zone",description:"\u6642\u9593\u5E2F\u4ED8\u304D\u65E5\u4ED8\u3068\u6642\u523B",baseQuery:"TIMESTAMP[[PARAM]] WITH TIME ZONE",category:"timestamp",withPrecision:!0,withScale:!1}),new u({id:301,name:"char",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1}),new u({id:302,name:"varchar",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217",baseQuery:"VARCHAR",category:"text",withPrecision:!1,withScale:!1}),new u({id:311,name:"char (n)",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1}),new u({id:312,name:"varchar (n)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1}),new u({id:325,name:"text",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1}),new u({id:411,name:"uuid",description:"\u6C4E\u7528\u4E00\u610F\u8B58\u5225\u5B50",baseQuery:"UUID",category:"other",withPrecision:!1,withScale:!1}),new u({id:421,name:"json",description:"\u30C6\u30AD\u30B9\u30C8\u306EJSON\u30C7\u30FC\u30BF",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1}),new u({id:422,name:"jsonb",description:"\u30D0\u30A4\u30CA\u30EA JSON \u30C7\u30FC\u30BF, \u5C55\u958B\u578B",baseQuery:"JSONB",category:"other",withPrecision:!1,withScale:!1}),new u({id:431,name:"xml",description:"XML\u30C7\u30FC\u30BF",baseQuery:"XML",category:"other",withPrecision:!1,withScale:!1}),new u({id:441,name:"money",description:"\u8CA8\u5E63\u91D1\u984D",baseQuery:"MONEY",category:"other",withPrecision:!1,withScale:!1}),new u({id:451,name:"tsquery",description:"\u30C6\u30AD\u30B9\u30C8\u691C\u7D22\u554F\u3044\u5408\u308F\u305B",baseQuery:"TSQUERY",category:"other",withPrecision:!1,withScale:!1}),new u({id:453,name:"tsvector",description:"\u30C6\u30AD\u30B9\u30C8\u691C\u7D22\u6587\u66F8",baseQuery:"TSVECTOR",category:"other",withPrecision:!1,withScale:!1}),new u({id:1011,name:"point",description:"\u5E73\u9762\u4E0A\u306E\u5E7E\u4F55\u5B66\u7684\u70B9",baseQuery:"POINT",category:"other",withPrecision:!1,withScale:!1}),new u({id:1021,name:"line",description:"\u5E73\u9762\u4E0A\u306E\u7121\u9650\u76F4\u7DDA",baseQuery:"LINE",category:"other",withPrecision:!1,withScale:!1}),new u({id:1022,name:"lseg",description:"\u5E73\u9762\u4E0A\u306E\u7DDA\u5206",baseQuery:"LSEG",category:"other",withPrecision:!1,withScale:!1}),new u({id:1031,name:"box",description:"\u5E73\u9762\u4E0A\u306E\u77E9\u5F62",baseQuery:"BOX",category:"other",withPrecision:!1,withScale:!1}),new u({id:1032,name:"circle",description:"\u5E73\u9762\u4E0A\u306E\u5186",baseQuery:"CIRCLE",category:"other",withPrecision:!1,withScale:!1}),new u({id:1041,name:"path",description:"\u5E73\u9762\u4E0A\u306E\u5E7E\u4F55\u5B66\u7684\u7D4C\u8DEF",baseQuery:"PATH",category:"other",withPrecision:!1,withScale:!1}),new u({id:1042,name:"polygon",description:"\u5E73\u9762\u4E0A\u306E\u9589\u3058\u305F\u5E7E\u4F55\u5B66\u7684\u7D4C\u8DEF",baseQuery:"POLYGON",category:"other",withPrecision:!1,withScale:!1}),new u({id:1111,name:"cidr",description:"IPv4\u3082\u3057\u304F\u306FIPv6\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30A2\u30C9\u30EC\u30B9",baseQuery:"CIDR",category:"other",withPrecision:!1,withScale:!1}),new u({id:1112,name:"inet",description:"IPv4\u3082\u3057\u304F\u306FIPv6\u30DB\u30B9\u30C8\u30A2\u30C9\u30EC\u30B9",baseQuery:"INET",category:"other",withPrecision:!1,withScale:!1}),new u({id:1121,name:"macaddr",description:"MAC (Media Access Control)\u30A2\u30C9\u30EC\u30B9",baseQuery:"MACADDR",category:"other",withPrecision:!1,withScale:!1}),new u({id:1122,name:"macaddr8",description:"MAC (Media Access Control) \u30A2\u30C9\u30EC\u30B9 (EUI-64 \u5F62\u5F0F)",baseQuery:"MACADDR8",category:"other",withPrecision:!1,withScale:!1}),new u({id:9101,name:"pg_lsn",description:"PostgreSQL\u30ED\u30B0\u30B7\u30FC\u30B1\u30F3\u30B9\u756A\u53F7",baseQuery:"PG_LSN",category:"other",withPrecision:!1,withScale:!1}),new u({id:9102,name:"pg_snapshot",description:"\u30E6\u30FC\u30B6\u30EC\u30D9\u30EB\u306E\u30C8\u30E9\u30F3\u30B6\u30AF\u30B7\u30E7\u30F3ID\u30B9\u30CA\u30C3\u30D7\u30B7\u30E7\u30C3\u30C8",baseQuery:"PG_SNAPSHOT",category:"other",withPrecision:!1,withScale:!1}),new u({id:9103,name:"oid",description:"\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u8B58\u5225\u5B50\u30C7\u30FC\u30BF",baseQuery:"OID",category:"other",withPrecision:!1,withScale:!1}),u.EMPTY],mysql:[new u({id:1,name:"bit",description:"\u30D3\u30C3\u30C8\u5024\u578B",baseQuery:"BIT",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2,name:"bit (m)",description:"\u30D3\u30C3\u30C8\u5024\u578B",baseQuery:"BIT[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:6,name:"boolean",description:"TINYINT(1) \u306E\u30B7\u30CE\u30CB\u30E0",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:10,name:"tinyint",description:"\u975E\u5E38\u306B\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -128 \u304B\u3089 127 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 255 \u3067\u3059\u3002",baseQuery:"TINYINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:11,name:"smallint",description:"\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -32768 \u304B\u3089 32767 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 65535 \u3067\u3059\u3002",baseQuery:"SMALLINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:13,name:"mediumint",description:"\u4E2D\u9593\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -8388608 \u304B\u3089 8388607 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 16777215 \u3067\u3059\u3002",baseQuery:"MEDIUMINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:15,name:"int",description:"\u666E\u901A\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -2147483648 \u304B\u3089 2147483647 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 4294967295 \u3067\u3059\u3002",baseQuery:"INT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:17,name:"bigint",description:"\u5927\u304D\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -9223372036854775808 \u304B\u3089 9223372036854775807 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 18446744073709551615 \u3067\u3059\u3002",baseQuery:"BIGINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:20,name:"tinyint (m)",description:"\u975E\u5E38\u306B\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -128 \u304B\u3089 127 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 255 \u3067\u3059\u3002",baseQuery:"TINYINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!1}),new u({id:21,name:"smallint (m)",description:"\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -32768 \u304B\u3089 32767 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 65535 \u3067\u3059\u3002",baseQuery:"SMALLINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:23,name:"mediumint (m)",description:"\u4E2D\u9593\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -8388608 \u304B\u3089 8388607 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 16777215 \u3067\u3059\u3002",baseQuery:"MEDIUMINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:25,name:"int (m)",description:"\u666E\u901A\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -2147483648 \u304B\u3089 2147483647 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 4294967295 \u3067\u3059\u3002",baseQuery:"INT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:27,name:"bigint (m)",description:"\u5927\u304D\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -9223372036854775808 \u304B\u3089 9223372036854775807 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 18446744073709551615 \u3067\u3059\u3002",baseQuery:"BIGINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:31,name:"float",description:"\u5C0F\u3055\u3044 (\u5358\u7CBE\u5EA6) \u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u308B\u5024\u306F\u3001-3.402823466E+38 \u304B\u3089 -1.175494351E-38\u30010\u3001\u304A\u3088\u3073 1.175494351E-38 \u304B\u3089 3.402823466E+38 \u3067\u3059\u3002",baseQuery:"FLOAT",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:33,name:"double",description:"\u666E\u901A\u30B5\u30A4\u30BA (\u500D\u7CBE\u5EA6) \u306E\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u5024\u306F\u3001-1.7976931348623157E+308 \u304B\u3089 -2.2250738585072014E-308\u30010\u3001\u304A\u3088\u3073 2.2250738585072014E-308 \u304B\u3089 1.7976931348623157E+308 \u3067\u3059\u3002",baseQuery:"DOUBLE",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:35,name:"decimal",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 \u6841\u657010 (\u7CBE\u5EA6) \u3067\u3001\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u65700\u3067\u3059\u3002",baseQuery:"DECIMAL",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:36,name:"numeric",description:"DECIMAL \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059\u3002\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 \u6841\u657010 (\u7CBE\u5EA6) \u3067\u3001\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u65700\u3067\u3059\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:41,name:"float (m, d)",description:"\u5C0F\u3055\u3044 (\u5358\u7CBE\u5EA6) \u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u308B\u5024\u306F\u3001-3.402823466E+38 \u304B\u3089 -1.175494351E-38\u30010\u3001\u304A\u3088\u3073 1.175494351E-38 \u304B\u3089 3.402823466E+38 \u3067\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:42,name:"float (p)",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3067\u3059\u3002p \u306F\u7CBE\u5EA6\u3092\u30D3\u30C3\u30C8\u3067\u8868\u73FE\u3057\u307E\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:43,name:"double (m, d)",description:"\u666E\u901A\u30B5\u30A4\u30BA (\u500D\u7CBE\u5EA6) \u306E\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u5024\u306F\u3001-1.7976931348623157E+308 \u304B\u3089 -2.2250738585072014E-308\u30010\u3001\u304A\u3088\u3073 2.2250738585072014E-308 \u304B\u3089 1.7976931348623157E+308 \u3067\u3059\u3002",baseQuery:"DOUBLE[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:45,name:"decimal (m, d)",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 M \u306F\u6841\u6570\u306E\u5408\u8A08 (\u7CBE\u5EA6) \u3067\u3001D \u306F\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570 (\u30B9\u30B1\u30FC\u30EB) \u3067\u3059\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:46,name:"numeric (m, d)",description:"DECIMAL \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059\u3002\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 M \u306F\u6841\u6570\u306E\u5408\u8A08 (\u7CBE\u5EA6) \u3067\u3001D \u306F\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570 (\u30B9\u30B1\u30FC\u30EB) \u3067\u3059\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:'\u65E5\u4ED8\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01" \u304B\u3089 "9999-12-31" \u3067\u3059\u3002',baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_DATE)"]}),new u({id:131,name:"time",description:'\u6642\u9593\u3067\u3059\u3002 \u7BC4\u56F2\u306F\u3001"-838:59:59.000000" \u304B\u3089 "838:59:59.000000" \u3067\u3059\u3002',baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_TIME)"]}),new u({id:141,name:"time (p)",description:'\u6642\u9593\u3067\u3059\u3002 \u7BC4\u56F2\u306F\u3001"-838:59:59.000000" \u304B\u3089 "838:59:59.000000" \u3067\u3059\u3002',baseQuery:"TIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_TIME)"]}),new u({id:112,name:"datetime",description:'\u65E5\u4ED8\u3068\u6642\u9593\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01 00:00:00.000000" \u304B\u3089 "9999-12-31 23:59:59.999999" \u3067\u3059\u3002',baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP","CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"]}),new u({id:115,name:"timestamp",description:'\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3067\u3059\u3002 \u7BC4\u56F2\u306F "1970-01-01 00:00:01.000000" UTC \u304B\u3089 "2038-01-19 03:14:07.999999" UTC \u3067\u3059\u3002',baseQuery:"TIMESTAMP",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP","CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"]}),new u({id:122,name:"datetime (p)",description:'\u65E5\u4ED8\u3068\u6642\u9593\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01 00:00:00.000000" \u304B\u3089 "9999-12-31 23:59:59.999999" \u3067\u3059\u3002',baseQuery:"DATETIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP[[PARAM]]","CURRENT_TIMESTAMP[[PARAM]] ON UPDATE CURRENT_TIMESTAMP[[PARAM]]"]}),new u({id:125,name:"timestamp (p)",description:'\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3067\u3059\u3002 \u7BC4\u56F2\u306F "1970-01-01 00:00:01.000000" UTC \u304B\u3089 "2038-01-19 03:14:07.999999" UTC \u3067\u3059\u3002',baseQuery:"TIMESTAMP[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP[[PARAM]]","CURRENT_TIMESTAMP[[PARAM]] ON UPDATE CURRENT_TIMESTAMP[[PARAM]]"]}),new u({id:151,name:"year",description:"4 \u6841\u5F62\u5F0F\u306E\u5E74\u3002",baseQuery:"YEAR",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:301,name:"char",description:"\u683C\u7D0D\u6642\u306B\u5FC5\u305A\u3001\u6307\u5B9A\u3055\u308C\u305F\u9577\u3055\u306B\u306A\u308B\u3088\u3046\u306B\u53F3\u5074\u304C\u30B9\u30DA\u30FC\u30B9\u3067\u57CB\u3081\u3089\u308C\u308B\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:311,name:"char (m)",description:"\u683C\u7D0D\u6642\u306B\u5FC5\u305A\u3001\u6307\u5B9A\u3055\u308C\u305F\u9577\u3055\u306B\u306A\u308B\u3088\u3046\u306B\u53F3\u5074\u304C\u30B9\u30DA\u30FC\u30B9\u3067\u57CB\u3081\u3089\u308C\u308B\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (m)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:321,name:"tinytext",description:"\u6700\u5927\u9577\u304C 255 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TINYTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:322,name:"text",description:"\u6700\u5927\u9577\u304C 65,535 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:323,name:"text (m)",description:"\u6700\u5927\u9577\u304C 65,535 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TEXT[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:324,name:"mediumtext",description:"\u6700\u5927\u9577\u304C 16,777,215 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"MEDIUMTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:325,name:"longtext",description:"\u6700\u5927\u9577\u304C 4G \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"LONGTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:3,name:"binary (m)",description:"\u30D0\u30A4\u30CA\u30EA\u30D0\u30A4\u30C8\u6587\u5B57\u5217\u3092\u683C\u7D0D\u3057\u307E\u3059\u3002",baseQuery:"BINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:5,name:"varbinary (m)",description:"\u30D0\u30A4\u30CA\u30EA\u30D0\u30A4\u30C8\u6587\u5B57\u5217\u3092\u683C\u7D0D\u3057\u307E\u3059\u3002",baseQuery:"VARBINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:361,name:"tinyblob",description:"\u6700\u5927\u9577\u304C 255 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"TINYBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:363,name:"blob",description:"\u6700\u5927\u9577\u304C 65,535 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"BLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:364,name:"blob (m)",description:"\u6700\u5927\u9577\u304C 65,535 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"BLOB[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:365,name:"mediumblob",description:"\u6700\u5927\u9577\u304C 16,777,215 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"MEDIUMBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:367,name:"longblob",description:"\u6700\u5927\u9577\u304C 4G \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"LONGBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:422,name:"json",description:"\u6587\u66F8\u306E\u578B\u5F0F\u3067\u3042\u308BJSON\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2001,name:"geometry",description:"\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002\u70B9\u3001\u7DDA\u3001\u591A\u89D2\u5F62\u3001\u304A\u3088\u3073\u305D\u306E\u4ED6\u306E\u5F62\u72B6\u3092\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002",baseQuery:"GEOMETRY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2011,name:"point",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u7A7A\u9593\u4E0A\u306E\u5358\u4E00\u306E\u70B9\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"POINT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2012,name:"linestring",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u7A7A\u9593\u4E0A\u306E\u8907\u6570\u306E\u70B9\u3092\u7D50\u3076\u76F4\u7DDA\u30BB\u30B0\u30E1\u30F3\u30C8\u306E\u9023\u7D9A\u3057\u305F\u30BB\u30C3\u30C8\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"LINESTRING",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2013,name:"polygon",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u5E73\u9762\u4E0A\u306E\u5358\u4E00\u306E\u9818\u57DF\u3092\u8868\u3059\u9589\u3058\u305F\u30EB\u30FC\u30D7\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"POLYGON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2021,name:"multipoint",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u70B9\u3092\u8868\u3059\u8907\u6570\u306EPOINT\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTIPOINT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2022,name:"multilinestring",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u7DDA\u5206\u3092\u8868\u3059\u8907\u6570\u306ELINESTRING\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTILINESTRING",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2023,name:"multipolygon",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u30DD\u30EA\u30B4\u30F3\u3092\u8868\u3059\u8907\u6570\u306EPOLYGON\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTIPOLYGON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2031,name:"geometrycollection",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306EGEOMETRY\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"GEOMETRYCOLLECTION",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2101,name:"enum",description:"\u6587\u5B57\u5217\u306E\u30EA\u30B9\u30C8\u306E\u4E2D\u304B\u30891\u3064\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"ENUM",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2102,name:"set",description:"ENUM\u306E\u62E1\u5F35\u7248\u3067\u3042\u308A\u3001\u6587\u5B57\u5217\u306E\u30EA\u30B9\u30C8\u304B\u3089\u8907\u6570\u306E\u9078\u629E\u80A2\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"SET",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),u.EMPTY],ms_sqlserver:[new u({id:1,name:"bit",description:"1\u30010\u3001\u307E\u305F\u306FNULL\u306E\u5024\u3092\u53D7\u3051\u53D6\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u6574\u6570\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"BIT",category:"bit",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:3,name:"binary (n)",description:"n \u30D0\u30A4\u30C8\u306E\u56FA\u5B9A\u9577\u306E binary \u30C7\u30FC\u30BF\u3067\u3059\u3002\u3053\u3053\u3067\u3001n \u306F 1 \u304B\u3089 8,000 \u306E\u5024\u306B\u306A\u308A\u307E\u3059\u3002",baseQuery:"BINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:4,name:"binary",description:"\u56FA\u5B9A\u9577\u306E binary \u30C7\u30FC\u30BF\u3067\u3059\u3002",baseQuery:"BINARY",category:"bit",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:5,name:"varbinary (n)",description:"\u53EF\u5909\u9577 binary \u30C7\u30FC\u30BF\u3002 n \u306B\u306F 1 \uFF5E 8,000 \u306E\u5024\u3092\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002",baseQuery:"VARBINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:9,name:"varbinary (max)",description:"\u53EF\u5909\u9577 binary \u30C7\u30FC\u30BF\u3002",baseQuery:"VARBINARY(MAX)",category:"bit",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:10,name:"tinyint",description:"\u6574\u6570\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5B9F\u6570\u30C7\u30FC\u30BF\u578B\u3067\u3059\u30020 to 255 (2^0-1 to 2^8-1)",baseQuery:"TINYINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:11,name:"smallint",description:"\u6574\u6570\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5B9F\u6570\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002-32,768 to 32,767 (-2^15 to 2^15-1)",baseQuery:"SMALLINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:15,name:"int",description:"\u6574\u6570\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5B9F\u6570\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002-2,147,483,648 to 2,147,483,647 (-2^31 to 2^31-1)",baseQuery:"INT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:17,name:"bigint",description:"\u6574\u6570\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5B9F\u6570\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (-2^63 to 2^63-1)",baseQuery:"BIGINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:31,name:"real",description:"real \u306E ISO \u30B7\u30CE\u30CB\u30E0\u306F\u3001 float (24) \u3067\u3059\u3002",baseQuery:"REAL",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:33,name:"float",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u30C7\u30FC\u30BF\u3067\u4F7F\u7528\u3059\u308B\u6982\u6570\u578B\u3067\u3059\u3002",baseQuery:"FLOAT",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:35,name:"decimal",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"DECIMAL",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:36,name:"numeric",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002decimal \u3068 numeric \u306F\u30B7\u30CE\u30CB\u30E0\u3067\u3042\u308A\u3001\u540C\u3058\u610F\u5473\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:42,name:"float (n)",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u30C7\u30FC\u30BF\u3067\u4F7F\u7528\u3059\u308B\u6982\u6570\u578B\u3067\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:45,name:"decimal (m, s)",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withAutoIncrement:!1}),new u({id:46,name:"numeric (m, s)",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002decimal \u3068 numeric \u306F\u30B7\u30CE\u30CB\u30E0\u3067\u3042\u308A\u3001\u540C\u3058\u610F\u5473\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withAutoIncrement:!1}),new u({id:47,name:"decimal (m)",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withAutoIncrement:!0}),new u({id:48,name:"numeric (m)",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002decimal \u3068 numeric \u306F\u30B7\u30CE\u30CB\u30E0\u3067\u3042\u308A\u3001\u540C\u3058\u610F\u5473\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withAutoIncrement:!0}),new u({id:65,name:"smallmoney",description:"\u91D1\u984D\u5024\u307E\u305F\u306F\u901A\u8CA8\u5024\u3092\u8868\u3059\u30C7\u30FC\u30BF\u578B\u3002-214,748.3648 to 214,748.3647",baseQuery:"SMALLMONEY",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:67,name:"money",description:"\u91D1\u984D\u5024\u307E\u305F\u306F\u901A\u8CA8\u5024\u3092\u8868\u3059\u30C7\u30FC\u30BF\u578B\u3002-922,337,203,685,477.5808 to 922,337,203,685,477.5807",baseQuery:"MONEY",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:"\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:111,name:"datetime2",description:"24 \u6642\u9593\u5F62\u5F0F\u306E\u6642\u523B\u3068\u7D44\u307F\u5408\u308F\u305B\u305F\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002",baseQuery:"DATETIME2",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["SYSDATETIME()","SYSUTCDATETIME()"]}),new u({id:112,name:"datetimeoffset",description:"datetime2 \u306A\u3069\u306E 24 \u6642\u9593\u5236\u306B\u57FA\u3065\u3044\u3066 1 \u65E5\u306E\u6642\u523B\u3068\u7D44\u307F\u5408\u308F\u3055\u308C\u308B\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u3001\u5354\u5B9A\u4E16\u754C\u6642 (UTC) \u306B\u57FA\u3065\u3044\u3066\u30BF\u30A4\u30E0 \u30BE\u30FC\u30F3\u8A8D\u8B58\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002",baseQuery:"DATETIMEOFFSET",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["SYSDATETIMEOFFSET()"]}),new u({id:121,name:"datetime2 (p)",description:"24 \u6642\u9593\u5F62\u5F0F\u306E\u6642\u523B\u3068\u7D44\u307F\u5408\u308F\u305B\u305F\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002",baseQuery:"DATETIME2[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["SYSDATETIME()","SYSUTCDATETIME()"]}),new u({id:122,name:"datetimeoffset (p)",description:"datetime2 \u306A\u3069\u306E 24 \u6642\u9593\u5236\u306B\u57FA\u3065\u3044\u3066 1 \u65E5\u306E\u6642\u523B\u3068\u7D44\u307F\u5408\u308F\u3055\u308C\u308B\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u3001\u5354\u5B9A\u4E16\u754C\u6642 (UTC) \u306B\u57FA\u3065\u3044\u3066\u30BF\u30A4\u30E0 \u30BE\u30FC\u30F3\u8A8D\u8B58\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002",baseQuery:"DATETIMEOFFSET[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["SYSDATETIMEOFFSET()"]}),new u({id:131,name:"time",description:"1 \u65E5\u306E\u6642\u523B\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002 \u6642\u523B\u306F 24 \u6642\u9593\u5F62\u5F0F\u3067\u3001\u30BF\u30A4\u30E0 \u30BE\u30FC\u30F3\u306F\u8A8D\u8B58\u3055\u308C\u307E\u305B\u3093\u3002",baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:141,name:"time (s)",description:"",baseQuery:"TIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:191,name:"smalldatetime (deprecated)",description:"(deprecated)",baseQuery:"SMALLDATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["GETDATE()","GETUTCDATE()"]}),new u({id:192,name:"datetime (deprecated)",description:"(deprecated)",baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["GETDATE()","GETUTCDATE()"]}),new u({id:301,name:"char",description:"\u56FA\u5B9A\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:302,name:"varchar",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"VARCHAR",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:306,name:"nchar",description:"\u56FA\u5B9A\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002",baseQuery:"NCHAR",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:307,name:"nvarchar",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002 ",baseQuery:"NVARCHAR",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:311,name:"char (n)",description:"\u56FA\u5B9A\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (n)",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:316,name:"nchar (n)",description:"\u56FA\u5B9A\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002",baseQuery:"NCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:317,name:"nvarchar (n)",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002 ",baseQuery:"NVARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:325,name:"varchar (max)",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"VARCHAR(MAX)",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:326,name:"nvarchar (max)",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002 ",baseQuery:"NVARCHAR(MAX)",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:395,name:"text (deprecated)",description:"(deprecated)",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:396,name:"ntext (deprecated)",description:"(deprecated)",baseQuery:"NTEXT",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:397,name:"image (deprecated)",description:"(deprecated)",baseQuery:"IMAGE",category:"bit",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:422,name:"json",description:"The native json data type that stores JSON documents in a native binary format.",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:431,name:"xml",description:"XML \u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"XML",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:453,name:"vector",description:"vector \u30C7\u30FC\u30BF\u578B\u306F\u3001\u985E\u4F3C\u6027\u691C\u7D22\u3084\u6A5F\u68B0\u5B66\u7FD2\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306A\u3069\u306E\u64CD\u4F5C\u7528\u306B\u6700\u9069\u5316\u3055\u308C\u305F\u30D9\u30AF\u30C8\u30EB \u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u3088\u3046\u306B\u8A2D\u8A08\u3055\u308C\u3066\u3044\u307E\u3059\u3002",baseQuery:"VECTOR",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:2001,name:"geometry",description:"\u5E73\u9762\u7A7A\u9593\u30C7\u30FC\u30BF\u578B\u306E geometry \u306F\u3001SQL Server \u3067\u306F\u5171\u901A\u8A00\u8A9E\u30E9\u30F3\u30BF\u30A4\u30E0 (CLR) \u306E\u30C7\u30FC\u30BF\u578B\u3068\u3057\u3066\u5B9F\u88C5\u3055\u308C\u3066\u3044\u307E\u3059\u3002 \u3053\u306E\u578B\u306F\u3001\u30E6\u30FC\u30AF\u30EA\u30C3\u30C9 (\u5E73\u9762) \u5EA7\u6A19\u7CFB\u306E\u30C7\u30FC\u30BF\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"GEOMETRY",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:2002,name:"geography",description:"\u5730\u7406\u7A7A\u9593\u30C7\u30FC\u30BF\u578B\u306E geography \u306F\u3001SQL Server \u3067\u306F .NET \u5171\u901A\u8A00\u8A9E\u30E9\u30F3\u30BF\u30A4\u30E0 (CLR) \u306E\u30C7\u30FC\u30BF\u578B\u3068\u3057\u3066\u5B9F\u88C5\u3055\u308C\u3066\u3044\u307E\u3059\u3002 \u3053\u306E\u578B\u306F\u3001\u7403\u4F53\u5730\u7403\u5EA7\u6A19\u7CFB\u306E\u30C7\u30FC\u30BF\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"GEOGRAPHY",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:2061,name:"hierarchyid",description:"hierarchyid \u30C7\u30FC\u30BF\u578B\u306F\u53EF\u5909\u9577\u306E\u30B7\u30B9\u30C6\u30E0 \u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002 hierarchyid \u306F\u3001\u968E\u5C64\u5185\u306E\u4F4D\u7F6E\u3092\u8868\u3059\u305F\u3081\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002",baseQuery:"HIERARCHYID",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:9301,name:"uniqueidentifier",description:"16 \u30D0\u30A4\u30C8\u306E GUID \u3067\u3059\u3002",baseQuery:"UNIQUEIDENTIFIER",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:9302,name:"sql_variant",description:"SQL Server \u3067\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u5404\u7A2E\u30C7\u30FC\u30BF\u578B\u306E\u5024\u304C\u683C\u7D0D\u3055\u308C\u307E\u3059\u3002",baseQuery:"SQL_VARIANT",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),u.EMPTY],mariadb:[new u({id:1,name:"bit",description:"\u30D3\u30C3\u30C8\u5024\u578B",baseQuery:"BIT",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2,name:"bit (m)",description:"\u30D3\u30C3\u30C8\u5024\u578B",baseQuery:"BIT[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:6,name:"boolean",description:"TINYINT(1) \u306E\u30B7\u30CE\u30CB\u30E0",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:10,name:"tinyint",description:"\u975E\u5E38\u306B\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -128 \u304B\u3089 127 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 255 \u3067\u3059\u3002",baseQuery:"TINYINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:11,name:"smallint",description:"\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -32768 \u304B\u3089 32767 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 65535 \u3067\u3059\u3002",baseQuery:"SMALLINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:13,name:"mediumint",description:"\u4E2D\u9593\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -8388608 \u304B\u3089 8388607 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 16777215 \u3067\u3059\u3002",baseQuery:"MEDIUMINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:15,name:"int",description:"\u666E\u901A\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -2147483648 \u304B\u3089 2147483647 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 4294967295 \u3067\u3059\u3002",baseQuery:"INT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:17,name:"bigint",description:"\u5927\u304D\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -9223372036854775808 \u304B\u3089 9223372036854775807 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 18446744073709551615 \u3067\u3059\u3002",baseQuery:"BIGINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:20,name:"tinyint (m)",description:"\u975E\u5E38\u306B\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -128 \u304B\u3089 127 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 255 \u3067\u3059\u3002",baseQuery:"TINYINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!1}),new u({id:21,name:"smallint (m)",description:"\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -32768 \u304B\u3089 32767 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 65535 \u3067\u3059\u3002",baseQuery:"SMALLINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:23,name:"mediumint (m)",description:"\u4E2D\u9593\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -8388608 \u304B\u3089 8388607 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 16777215 \u3067\u3059\u3002",baseQuery:"MEDIUMINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:25,name:"int (m)",description:"\u666E\u901A\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -2147483648 \u304B\u3089 2147483647 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 4294967295 \u3067\u3059\u3002",baseQuery:"INT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:27,name:"bigint (m)",description:"\u5927\u304D\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -9223372036854775808 \u304B\u3089 9223372036854775807 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 18446744073709551615 \u3067\u3059\u3002",baseQuery:"BIGINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:31,name:"float",description:"\u5C0F\u3055\u3044 (\u5358\u7CBE\u5EA6) \u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u308B\u5024\u306F\u3001-3.402823466E+38 \u304B\u3089 -1.175494351E-38\u30010\u3001\u304A\u3088\u3073 1.175494351E-38 \u304B\u3089 3.402823466E+38 \u3067\u3059\u3002",baseQuery:"FLOAT",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:33,name:"double",description:"\u666E\u901A\u30B5\u30A4\u30BA (\u500D\u7CBE\u5EA6) \u306E\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u5024\u306F\u3001-1.7976931348623157E+308 \u304B\u3089 -2.2250738585072014E-308\u30010\u3001\u304A\u3088\u3073 2.2250738585072014E-308 \u304B\u3089 1.7976931348623157E+308 \u3067\u3059\u3002",baseQuery:"DOUBLE",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:35,name:"decimal",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 \u6841\u657010 (\u7CBE\u5EA6) \u3067\u3001\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u65700\u3067\u3059\u3002",baseQuery:"DECIMAL",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:36,name:"numeric",description:"DECIMAL \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059\u3002\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 \u6841\u657010 (\u7CBE\u5EA6) \u3067\u3001\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u65700\u3067\u3059\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:41,name:"float (m, d)",description:"\u5C0F\u3055\u3044 (\u5358\u7CBE\u5EA6) \u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u308B\u5024\u306F\u3001-3.402823466E+38 \u304B\u3089 -1.175494351E-38\u30010\u3001\u304A\u3088\u3073 1.175494351E-38 \u304B\u3089 3.402823466E+38 \u3067\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:42,name:"float (p)",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3067\u3059\u3002p \u306F\u7CBE\u5EA6\u3092\u30D3\u30C3\u30C8\u3067\u8868\u73FE\u3057\u307E\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:43,name:"double (m, d)",description:"\u666E\u901A\u30B5\u30A4\u30BA (\u500D\u7CBE\u5EA6) \u306E\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u5024\u306F\u3001-1.7976931348623157E+308 \u304B\u3089 -2.2250738585072014E-308\u30010\u3001\u304A\u3088\u3073 2.2250738585072014E-308 \u304B\u3089 1.7976931348623157E+308 \u3067\u3059\u3002",baseQuery:"DOUBLE[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:45,name:"decimal (m, d)",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 M \u306F\u6841\u6570\u306E\u5408\u8A08 (\u7CBE\u5EA6) \u3067\u3001D \u306F\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570 (\u30B9\u30B1\u30FC\u30EB) \u3067\u3059\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:46,name:"numeric (m, d)",description:"DECIMAL \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059\u3002\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 M \u306F\u6841\u6570\u306E\u5408\u8A08 (\u7CBE\u5EA6) \u3067\u3001D \u306F\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570 (\u30B9\u30B1\u30FC\u30EB) \u3067\u3059\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:'\u65E5\u4ED8\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01" \u304B\u3089 "9999-12-31" \u3067\u3059\u3002',baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_DATE)"]}),new u({id:131,name:"time",description:'\u6642\u9593\u3067\u3059\u3002 \u7BC4\u56F2\u306F\u3001"-838:59:59.000000" \u304B\u3089 "838:59:59.000000" \u3067\u3059\u3002',baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_TIME)"]}),new u({id:141,name:"time (p)",description:'\u6642\u9593\u3067\u3059\u3002 \u7BC4\u56F2\u306F\u3001"-838:59:59.000000" \u304B\u3089 "838:59:59.000000" \u3067\u3059\u3002',baseQuery:"TIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_TIME)"]}),new u({id:112,name:"datetime",description:'\u65E5\u4ED8\u3068\u6642\u9593\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01 00:00:00.000000" \u304B\u3089 "9999-12-31 23:59:59.999999" \u3067\u3059\u3002',baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP","CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"]}),new u({id:115,name:"timestamp",description:'\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3067\u3059\u3002 \u7BC4\u56F2\u306F "1970-01-01 00:00:01.000000" UTC \u304B\u3089 "2038-01-19 03:14:07.999999" UTC \u3067\u3059\u3002',baseQuery:"TIMESTAMP",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP","CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"]}),new u({id:122,name:"datetime (p)",description:'\u65E5\u4ED8\u3068\u6642\u9593\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01 00:00:00.000000" \u304B\u3089 "9999-12-31 23:59:59.999999" \u3067\u3059\u3002',baseQuery:"DATETIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP[[PARAM]]","CURRENT_TIMESTAMP[[PARAM]] ON UPDATE CURRENT_TIMESTAMP[[PARAM]]"]}),new u({id:125,name:"timestamp (p)",description:'\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3067\u3059\u3002 \u7BC4\u56F2\u306F "1970-01-01 00:00:01.000000" UTC \u304B\u3089 "2038-01-19 03:14:07.999999" UTC \u3067\u3059\u3002',baseQuery:"TIMESTAMP[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP[[PARAM]]","CURRENT_TIMESTAMP[[PARAM]] ON UPDATE CURRENT_TIMESTAMP[[PARAM]]"]}),new u({id:151,name:"year",description:"4 \u6841\u5F62\u5F0F\u306E\u5E74\u3002",baseQuery:"YEAR",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:301,name:"char",description:"\u683C\u7D0D\u6642\u306B\u5FC5\u305A\u3001\u6307\u5B9A\u3055\u308C\u305F\u9577\u3055\u306B\u306A\u308B\u3088\u3046\u306B\u53F3\u5074\u304C\u30B9\u30DA\u30FC\u30B9\u3067\u57CB\u3081\u3089\u308C\u308B\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:311,name:"char (m)",description:"\u683C\u7D0D\u6642\u306B\u5FC5\u305A\u3001\u6307\u5B9A\u3055\u308C\u305F\u9577\u3055\u306B\u306A\u308B\u3088\u3046\u306B\u53F3\u5074\u304C\u30B9\u30DA\u30FC\u30B9\u3067\u57CB\u3081\u3089\u308C\u308B\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (m)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:321,name:"tinytext",description:"\u6700\u5927\u9577\u304C 255 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TINYTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:322,name:"text",description:"\u6700\u5927\u9577\u304C 65,535 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:323,name:"text (m)",description:"\u6700\u5927\u9577\u304C 65,535 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TEXT[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:324,name:"mediumtext",description:"\u6700\u5927\u9577\u304C 16,777,215 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"MEDIUMTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:325,name:"longtext",description:"\u6700\u5927\u9577\u304C 4G \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"LONGTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:3,name:"binary (m)",description:"\u30D0\u30A4\u30CA\u30EA\u30D0\u30A4\u30C8\u6587\u5B57\u5217\u3092\u683C\u7D0D\u3057\u307E\u3059\u3002",baseQuery:"BINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:5,name:"varbinary (m)",description:"\u30D0\u30A4\u30CA\u30EA\u30D0\u30A4\u30C8\u6587\u5B57\u5217\u3092\u683C\u7D0D\u3057\u307E\u3059\u3002",baseQuery:"VARBINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:361,name:"tinyblob",description:"\u6700\u5927\u9577\u304C 255 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"TINYBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:363,name:"blob",description:"\u6700\u5927\u9577\u304C 65,535 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"BLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:364,name:"blob (m)",description:"\u6700\u5927\u9577\u304C 65,535 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"BLOB[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:365,name:"mediumblob",description:"\u6700\u5927\u9577\u304C 16,777,215 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"MEDIUMBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:367,name:"longblob",description:"\u6700\u5927\u9577\u304C 4G \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"LONGBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:422,name:"json",description:"\u6587\u66F8\u306E\u578B\u5F0F\u3067\u3042\u308BJSON\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2001,name:"geometry",description:"\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002\u70B9\u3001\u7DDA\u3001\u591A\u89D2\u5F62\u3001\u304A\u3088\u3073\u305D\u306E\u4ED6\u306E\u5F62\u72B6\u3092\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002",baseQuery:"GEOMETRY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2011,name:"point",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u7A7A\u9593\u4E0A\u306E\u5358\u4E00\u306E\u70B9\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"POINT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2012,name:"linestring",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u7A7A\u9593\u4E0A\u306E\u8907\u6570\u306E\u70B9\u3092\u7D50\u3076\u76F4\u7DDA\u30BB\u30B0\u30E1\u30F3\u30C8\u306E\u9023\u7D9A\u3057\u305F\u30BB\u30C3\u30C8\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"LINESTRING",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2013,name:"polygon",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u5E73\u9762\u4E0A\u306E\u5358\u4E00\u306E\u9818\u57DF\u3092\u8868\u3059\u9589\u3058\u305F\u30EB\u30FC\u30D7\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"POLYGON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2021,name:"multipoint",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u70B9\u3092\u8868\u3059\u8907\u6570\u306EPOINT\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTIPOINT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2022,name:"multilinestring",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u7DDA\u5206\u3092\u8868\u3059\u8907\u6570\u306ELINESTRING\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTILINESTRING",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2023,name:"multipolygon",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u30DD\u30EA\u30B4\u30F3\u3092\u8868\u3059\u8907\u6570\u306EPOLYGON\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTIPOLYGON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2031,name:"geometrycollection",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306EGEOMETRY\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"GEOMETRYCOLLECTION",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2101,name:"enum",description:"\u6587\u5B57\u5217\u306E\u30EA\u30B9\u30C8\u306E\u4E2D\u304B\u30891\u3064\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"ENUM",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2102,name:"set",description:"ENUM\u306E\u62E1\u5F35\u7248\u3067\u3042\u308A\u3001\u6587\u5B57\u5217\u306E\u30EA\u30B9\u30C8\u304B\u3089\u8907\u6570\u306E\u9078\u629E\u80A2\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"SET",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:411,name:"uuid",description:"128\u30D3\u30C3\u30C8\u306EUUID\u5024\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B (MariaDB 10.7+)\u3002",baseQuery:"UUID",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:1113,name:"inet4",description:"IPv4\u30A2\u30C9\u30EC\u30B9\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B (MariaDB 10.10+)\u3002",baseQuery:"INET4",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:1114,name:"inet6",description:"IPv6\u30A2\u30C9\u30EC\u30B9\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B (MariaDB 10.5+)\u3002",baseQuery:"INET6",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),u.EMPTY],sqlite:[new u({id:15,name:"integer",description:"\u6574\u6570\u5024\u3002INTEGER\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u3002\u5358\u4E00\u5217\u306EPRIMARY KEY\u306B\u8A2D\u5B9A\u3059\u308B\u3068rowid\u30A8\u30A4\u30EA\u30A2\u30B9\u3068\u306A\u308A\u81EA\u52D5\u63A1\u756A\u76F8\u5F53\u306B\u306A\u308B\u3002",baseQuery:"INTEGER",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:33,name:"real",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u3002REAL\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u3002",baseQuery:"REAL",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:325,name:"text",description:"\u6587\u5B57\u5217\u3002TEXT\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u3002",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:363,name:"blob",description:"\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002BLOB\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3(\u578B\u6307\u5B9A\u306A\u3057\u3068\u540C\u7FA9)\u3002",baseQuery:"BLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:36,name:"numeric",description:"\u6570\u5024\u3002NUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:6,name:"boolean",description:"\u8AD6\u7406\u5024\u3002NUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:311,name:"char (n)",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002n\u306F\u69CB\u6587\u4E0A\u66F8\u3051\u308B\u304C\u7121\u8996\u3055\u308CTEXT\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (n)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002n\u306F\u69CB\u6587\u4E0A\u66F8\u3051\u308B\u304C\u7121\u8996\u3055\u308CTEXT\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:"\u65E5\u4ED8\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002NUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u6163\u7528\u578B\u3002",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:112,name:"datetime",description:"\u65E5\u6642\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002NUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u6163\u7528\u578B\u3002",baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:45,name:"decimal (p, s)",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002p,s\u306F\u69CB\u6587\u4E0A\u66F8\u3051\u308B\u304C\u7121\u8996\u3055\u308CNUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),u.EMPTY],bigquery:[new u({id:17,name:"int64",description:"8\u30D0\u30A4\u30C8\u7B26\u53F7\u4ED8\u304D\u6574\u6570\u3002INT/SMALLINT/INTEGER/BIGINT/TINYINT/BYTEINT \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"INT64",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:33,name:"float64",description:"\u500D\u7CBE\u5EA6\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u3002FLOAT \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"FLOAT64",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:36,name:"numeric",description:"\u7CBE\u5EA638\u6841\u30FB\u30B9\u30B1\u30FC\u30EB9\u6841\u306E\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u5024\u3002DECIMAL \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:46,name:"numeric (p, s)",description:"\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u3092\u6307\u5B9A\u3059\u308B\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u5024\u3002DECIMAL \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002\u7CBE\u5EA6\u6307\u5B9A\u4ED8\u304D DDL \u306E\u8AAD\u8FBC\u306F node-sql-parser \u975E\u5BFE\u5FDC\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:37,name:"bignumeric",description:"\u7CBE\u5EA676.76\u6841\u30FB\u30B9\u30B1\u30FC\u30EB38\u6841\u306E\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u5024\u3002BIGDECIMAL \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"BIGNUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:49,name:"bignumeric (p, s)",description:"\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u3092\u6307\u5B9A\u3059\u308B\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u5024\u3002BIGDECIMAL \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002\u7CBE\u5EA6\u6307\u5B9A\u4ED8\u304D DDL \u306E\u8AAD\u8FBC\u306F node-sql-parser \u975E\u5BFE\u5FDC\u3002",baseQuery:"BIGNUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:6,name:"bool",description:"\u8AD6\u7406\u5024 (\u771F/\u507D)\u3002BOOLEAN \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"BOOL",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:325,name:"string",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217 (Unicode)\u3002",baseQuery:"STRING",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:312,name:"string (n)",description:"\u6700\u5927\u9577\u3092\u6307\u5B9A\u3059\u308B\u53EF\u5909\u9577\u6587\u5B57\u5217 (Unicode)\u3002\u7CBE\u5EA6\u6307\u5B9A\u4ED8\u304D DDL \u306E\u8AAD\u8FBC\u306F node-sql-parser \u975E\u5BFE\u5FDC\u3002",baseQuery:"STRING[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:367,name:"bytes",description:"\u53EF\u5909\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002",baseQuery:"BYTES",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:5,name:"bytes (n)",description:"\u6700\u5927\u9577\u3092\u6307\u5B9A\u3059\u308B\u53EF\u5909\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002",baseQuery:"BYTES[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:101,name:"date",description:"\u66A6\u306E\u65E5\u4ED8 (\u5E74\u6708\u65E5)\u3002",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:111,name:"datetime",description:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u306A\u3057\u306E\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:131,name:"time",description:"\u6642\u523B\u3002",baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:112,name:"timestamp",description:"UTC \u57FA\u6E96\u306E\u7D76\u5BFE\u6642\u70B9\u3092\u8868\u3059\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"TIMESTAMP",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:422,name:"json",description:"JSON \u5F62\u5F0F\u306E\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:2002,name:"geography",description:"\u7403\u4F53\u5730\u7403\u5EA7\u6A19\u7CFB\u306E\u5730\u7406\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"GEOGRAPHY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),u.EMPTY],snowflake:[new u({id:36,name:"number",description:"\u6570\u5024\u578B\u3002\u65E2\u5B9A\u306E\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u306F (38, 0)\u3002INT/INTEGER/BIGINT \u7B49\u306E\u6574\u6570\u578B\u306F\u3059\u3079\u3066 NUMBER(38,0) \u306E\u30B7\u30CE\u30CB\u30E0\u3068\u3057\u3066\u6271\u308F\u308C\u308B\u3002",baseQuery:"NUMBER",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:46,name:"number (p, s)",description:"\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u3092\u6307\u5B9A\u3059\u308B\u6570\u5024\u578B\u3002INT/INTEGER/BIGINT \u7B49\u306F NUMBER(38,0) \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3042\u308A\u3001\u3053\u306E\u578B\u3067\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u3092\u660E\u793A\u7684\u306B\u6307\u5B9A\u3057\u305F\u3082\u306E\u306B\u76F8\u5F53\u3059\u308B\u3002",baseQuery:"NUMBER[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!0}),new u({id:33,name:"float",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u3002\u500D\u7CBE\u5EA6\u6D6E\u52D5\u5C0F\u6570\u70B9\u3068\u3057\u3066\u683C\u7D0D\u3055\u308C\u308B\u3002",baseQuery:"FLOAT",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:301,name:"char",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217 (\u5B9F\u969B\u306B\u306F\u53EF\u5909\u9577\u3068\u3057\u3066\u683C\u7D0D\u3055\u308C\u308B)\u3002",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:311,name:"char (n)",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217 (\u5B9F\u969B\u306B\u306F\u53EF\u5909\u9577\u3068\u3057\u3066\u683C\u7D0D\u3055\u308C\u308B)\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:302,name:"varchar",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u3002STRING/TEXT \u306F\u30B7\u30CE\u30CB\u30E0\u3002",baseQuery:"VARCHAR",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (n)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u3002STRING/TEXT \u306F\u30B7\u30CE\u30CB\u30E0\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:4,name:"binary",description:"\u56FA\u5B9A\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002",baseQuery:"BINARY",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:3,name:"binary (n)",description:"\u56FA\u5B9A\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002",baseQuery:"BINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:5,name:"varbinary (n)",description:"\u53EF\u5909\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002BINARY \u306E\u30B7\u30CE\u30CB\u30E0\u3002",baseQuery:"VARBINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:6,name:"boolean",description:"\u8AD6\u7406\u5024 (\u771F/\u507D)\u3002",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:"\u66A6\u306E\u65E5\u4ED8 (\u5E74\u6708\u65E5)\u3002",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:131,name:"time",description:"\u6642\u523B\u3002\u65E2\u5B9A\u306E\u7CBE\u5EA6\u306F\u79D2\u306E\u5C0F\u6570\u70B9\u4EE5\u4E0B9\u6841\u3002",baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:141,name:"time (p)",description:"\u7CBE\u5EA6 (\u79D2\u306E\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570) \u3092\u6307\u5B9A\u3059\u308B\u6642\u523B\u578B\u3002",baseQuery:"TIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:111,name:"timestamp_ntz",description:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u306A\u3057\u306E\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"TIMESTAMP_NTZ",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:112,name:"timestamp_tz",description:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u4ED8\u304D\u306E\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"TIMESTAMP_TZ",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:113,name:"timestamp_ltz",description:"\u30BB\u30C3\u30B7\u30E7\u30F3\u306E\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u3067\u89E3\u91C8\u3055\u308C\u308B\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"TIMESTAMP_LTZ",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:9601,name:"variant",description:"\u4EFB\u610F\u306E\u4ED6\u306E\u30C7\u30FC\u30BF\u578B\u306E\u5024\u3092\u683C\u7D0D\u3067\u304D\u308B\u534A\u69CB\u9020\u5316\u30C7\u30FC\u30BF\u578B\u3002DDL \u8AAD\u8FBC (\u30A4\u30F3\u30DD\u30FC\u30C8) \u306F node-sql-parser \u306E snowflake \u30C0\u30A4\u30A2\u30EC\u30AF\u30C8\u306E\u5236\u7D04\u306B\u3088\u308A\u975E\u5BFE\u5FDC\u3002",baseQuery:"VARIANT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:9602,name:"object",description:"\u30AD\u30FC\u3068\u5024\u306E\u30DA\u30A2\u306E\u96C6\u5408\u3092\u683C\u7D0D\u3059\u308B\u534A\u69CB\u9020\u5316\u30C7\u30FC\u30BF\u578B\u3002DDL \u8AAD\u8FBC (\u30A4\u30F3\u30DD\u30FC\u30C8) \u306F node-sql-parser \u306E snowflake \u30C0\u30A4\u30A2\u30EC\u30AF\u30C8\u306E\u5236\u7D04\u306B\u3088\u308A\u975E\u5BFE\u5FDC\u3002",baseQuery:"OBJECT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:9603,name:"array",description:"\u5024\u306E\u914D\u5217\u3092\u683C\u7D0D\u3059\u308B\u534A\u69CB\u9020\u5316\u30C7\u30FC\u30BF\u578B\u3002DDL \u8AAD\u8FBC (\u30A4\u30F3\u30DD\u30FC\u30C8) \u306F node-sql-parser \u306E snowflake \u30C0\u30A4\u30A2\u30EC\u30AF\u30C8\u306E\u5236\u7D04\u306B\u3088\u308A\u975E\u5BFE\u5FDC\u3002",baseQuery:"ARRAY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2001,name:"geometry",description:"\u5E73\u9762 (\u30E6\u30FC\u30AF\u30EA\u30C3\u30C9) \u5EA7\u6A19\u7CFB\u306E\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"GEOMETRY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2002,name:"geography",description:"\u7403\u4F53\u5730\u7403\u5EA7\u6A19\u7CFB\u306E\u5730\u7406\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"GEOGRAPHY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),u.EMPTY]},Zn=t=>Kh[t],uc=(t,e,n)=>{let r=new Map(Zn(t).map(i=>[i.id,i])),o=e;if(n<20260321&&(o=o.map(i=>{let a=r.get(i.id);return a==null?i:u.migrateDefaultValueCandidates(i,a,n)})),n<20250718&&t==="postgres"){let i=r.get(9103);i!=null&&o.every(a=>a.id!==9103)&&o.push(i)}return n<20251130&&t==="postgres"&&(o=o.map(i=>{let a=r.get(i.id);return a==null||a.withAutoIncrement===!1?i:new u({...i,withAutoIncrement:!0})})),n<20260504&&(o=o.map(i=>{let a=r.get(i.id);return a==null?i:new u({...i,category:a.category})})),o};var dc=20260504,Fn=class t{constructor({databaseType:e,columnTypes:n,version:r}){this.databaseType=e,this.columnTypes=n,this.version=r}static create(e){let n=Zn(e);return new t({databaseType:e,columnTypes:n,version:dc})}getDatabase(){return ee.get(this.databaseType)}initToColumnTypeMapping(){let e=new Map(this.columnTypes.map(n=>[n.id,n]));return n=>e.get(n)??u.EMPTY}findColumnType(e){return this.columnTypes.find(n=>n.id===e)??null}toJSON(){return{databaseType:this.databaseType,columnTypes:this.columnTypes.map(e=>e.toJSON()),version:this.version}}static toObject(e){S(e,"databaseType"),S(e,"columnTypes");let n=e.databaseType,r=j(e.columnTypes,"columnTypes",a=>u.toObject(a)),o="version"in e?e.version:0,i=uc(n,r,o);return new t({databaseType:n,columnTypes:i,version:dc})}equals(e){if(this.databaseType!==e.databaseType||this.columnTypes.length!==e.columnTypes.length)return!1;for(let n=0;n<this.columnTypes.length;n++)if(this.columnTypes[n].equals(e.columnTypes[n])===!1)return!1;return!0}};var Go=class t{constructor({schemaId:e,schemaName:n,description:r}){this.schemaId=e,this.schemaName=n,this.description=r}static create(e,n){return new t({schemaId:X(),schemaName:e,description:n})}update(e){return new t({schemaId:this.schemaId,schemaName:e.schemaName??this.schemaName,description:e.description??this.description})}toJSON(){return{schemaId:this.schemaId,schemaName:this.schemaName,description:this.description}}static toObject(e){return S(e,"schemaId"),S(e,"schemaName"),new t({schemaId:e.schemaId,schemaName:e.schemaName,description:"description"in e?e.description:""})}equals(e){return this.schemaId===e.schemaId&&this.schemaName===e.schemaName&&this.description===e.description}},mc=Go;var Yo=class t{constructor(e,n,r){this.defaultSchemaId=r.has(e)?e:"",this.schemaIds=n,this.schemaMap=r}static create(e={}){let n=e.defaultSchemaId||"",r=e.schemas||[],o=r.map(a=>a.schemaId),i=new Map(r.map(a=>[a.schemaId,a]));return new t(n,o,i)}findSchema(e){if(e==="")return this.findDefaultSchema();let n=this.schemaMap.get(e);return n??this.findDefaultSchema()}findDefaultSchema(){return this.defaultSchemaId===""?null:this.schemaMap.get(this.defaultSchemaId)||null}hasSchemas(){return this.schemaIds.length>0}getSchemas(){return this.schemaIds.map(e=>this.schemaMap.get(e))}equals(e){if(this===e)return!0;if(this.defaultSchemaId!==e.defaultSchemaId||this.schemaIds.length!==e.schemaIds.length)return!1;for(let[n,r]of this.schemaIds.entries()){let o=e.schemaIds[n];if(r!==o)return!1;let i=this.schemaMap.get(r),a=e.schemaMap.get(r);if(i==null||a==null||i.equals(a)===!1)return!1}return!0}toJSON(){return{defaultSchemaId:this.defaultSchemaId,schemas:this.getSchemas().map(e=>e.toJSON())}}static toObject(e){S(e,"defaultSchemaId"),S(e,"schemas");let n=e.defaultSchemaId,r=j(e.schemas,"schemas",a=>mc.toObject(a)),o=r.map(a=>a.schemaId),i=new Map(r.map(a=>[a.schemaId,a]));return new t(n,o,i)}},Cr=Yo;var qt=class t{constructor(e,n,r){this.name=e;this.displayFunction=n;this.logicalNameIncluded=r}static{this.PHYSICAL=new t("Physical",(e,n)=>e,!1)}static{this.LOGICAL=new t("Logical",(e,n)=>n,!0)}static{this.BOTH=new t("Both",(e,n)=>`${n} / ${e}`,!0)}static values(){return[t.PHYSICAL,t.LOGICAL,t.BOTH]}displayName(e,n){return this.displayFunction(e,n)}withLogicalName(){return this.logicalNameIncluded}toJSON(){return{styleName:this.name}}static toObject(e){if(!("styleName"in e))return t.BOTH;let n=e.styleName;for(let r of t.values())if(r.name===n)return r;return t.BOTH}equals(e){return this.name===e.name}};var ft=class t{static{this.ALL=new t("all","All Columns",()=>!0)}static{this.ONLY_PK=new t("pk","Only PK Columns",e=>e.primaryKey)}static{this.PK_OR_FK=new t("pk_fk","PK or FK Columns",(e,n)=>e.primaryKey||n)}static{this.NONE=new t("none","No Columns",()=>!1)}constructor(e,n,r){this.key=e,this.name=n,this.viewableFunction=r}static values(){return[t.ALL,t.ONLY_PK,t.PK_OR_FK,t.NONE]}viewable(e,n){return this.viewableFunction(e,n)}toJSON(){return{style:this.key}}static toObject(e){if(!("style"in e))return t.ALL;let n=e.style;for(let r of t.values())if(r.key===n)return r;return t.ALL}equals(e){return this.key===e.key}};var ln=class t{constructor({fileName:e,withTable:n=!0,withIndex:r=!0,withForeignKey:o=!0,withSchema:i=!0,withComment:a=!0,commentStyle:s="logical_name",commentSeparator:l=" : "}){this.fileName=e,this.withTable=n,this.withIndex=r,this.withForeignKey=o,this.withSchema=i,this.withComment=a,this.commentStyle=s,this.commentSeparator=l}equals(e){return!(this.fileName!==e.fileName||this.withTable!==e.withTable||this.withIndex!==e.withIndex||this.withForeignKey!==e.withForeignKey||this.withSchema!==e.withSchema||this.withComment!==e.withComment||this.commentStyle!==e.commentStyle||this.commentSeparator!==e.commentSeparator)}toJSON(){return{fileName:this.fileName,withTable:this.withTable,withIndex:this.withIndex,withForeignKey:this.withForeignKey,withSchema:this.withSchema,withComment:this.withComment,commentStyle:this.commentStyle,commentSeparator:this.commentSeparator}}static toObject(e){S(e,"fileName");let n="withTable"in e?e.withTable:!0,r="withIndex"in e?e.withIndex:!0,o="withForeignKey"in e?e.withForeignKey:!0,i="withSchema"in e?e.withSchema:!0,a="withComment"in e?e.withComment:!0,s="commentStyle"in e?e.commentStyle:"logical_name",l="commentSeparator"in e?e.commentSeparator:" : ";return new t({fileName:e.fileName,withTable:n,withIndex:r,withForeignKey:o,withSchema:i,withComment:a,commentStyle:s,commentSeparator:l})}};var jo=class t{constructor({perspectiveId:e,perspectiveName:n,description:r,containIds:o}){this.perspectiveId=e,this.perspectiveName=n,this.description=r,this.containIds=new Set(o)}static create(e,n=""){return new t({perspectiveId:X(),perspectiveName:e,description:n,containIds:[]})}containsModel(e){return this.containIds.has(e)}getContainIds(){return Array.from(this.containIds)}update(e,n){return new t({perspectiveId:this.perspectiveId,perspectiveName:e,description:n,containIds:this.containIds})}updateContainId(e,n){let r=new Set(this.containIds);return n==="add"?r.add(e):r.delete(e),new t({perspectiveId:this.perspectiveId,perspectiveName:this.perspectiveName,description:this.description,containIds:r})}updateAllContainIds(e){return this.containIds.size===0&&e.length===0?this:this.containIds.size===e.length&&[...e].every(r=>this.containIds.has(r))?this:new t({perspectiveId:this.perspectiveId,perspectiveName:this.perspectiveName,description:this.description,containIds:e})}equals(e){return this.perspectiveId!==e.perspectiveId||this.perspectiveName!==e.perspectiveName||this.description!==e.description||this.containIds.size!==e.containIds.size?!1:[...this.containIds].every(n=>e.containIds.has(n))}toJSON(){let e=Array.from(this.containIds).sort();return{perspectiveId:this.perspectiveId,perspectiveName:this.perspectiveName,...this.description!==""&&{description:this.description},containIds:e}}static toObject(e){return S(e,"perspectiveId"),S(e,"perspectiveName"),new t({perspectiveId:e.perspectiveId,perspectiveName:e.perspectiveName,description:"description"in e?e.description:"",containIds:"containIds"in e?e.containIds:[]})}},pc=jo;var Wo=class t{constructor(e){this.perspectiveIds=e.map(n=>n.perspectiveId),this.perspectiveMap=new Map(e.map(n=>[n.perspectiveId,n]))}findModel(e){return this.perspectiveMap.get(e)||null}getModels(){return this.perspectiveIds.map(e=>this.perspectiveMap.get(e))}updateModel(e){let n=this.perspectiveMap.get(e.perspectiveId);if(n==null){let o=[...this.getModels(),e];return new t(o)}if(n.equals(e)===!0)return this;let r=this.getModels().map(o=>o.perspectiveId!==e.perspectiveId?o:e);return new t(r)}equals(e){return an(this.perspectiveIds,e.perspectiveIds)===!1?!1:Xe(this.perspectiveMap,e.perspectiveMap)}},_r=Wo;var cn=class t{constructor({displayNameStyle:e=qt.BOTH,displayColumnStyle:n=ft.ALL,exportDdlSetting:r,perspectiveModelStorage:o,showRelationNames:i=!1,syncRemoteChanges:a=!1}){this.displayNameStyle=e,this.displayColumnStyle=n,this.exportDdlSetting=r,this.perspectiveModelStorage=o,this.showRelationNames=i,this.syncRemoteChanges=a}static create(e){let n=new ln({fileName:e}),r=new _r([]);return new t({exportDdlSetting:n,perspectiveModelStorage:r})}findPerspectiveModel(e){return this.perspectiveModelStorage.findModel(e)}getPerspectiveModels(){return this.perspectiveModelStorage.getModels()}update({displayNameStyle:e=null,displayColumnStyle:n=null,exportDdlSetting:r=null,perspectiveModels:o=null,showRelationNames:i=null,syncRemoteChanges:a=null}){return e==null&&n==null&&r==null&&o==null&&i==null&&a==null?this:new t({displayNameStyle:e??this.displayNameStyle,displayColumnStyle:n??this.displayColumnStyle,exportDdlSetting:r??this.exportDdlSetting,perspectiveModelStorage:o!=null?new _r(o):this.perspectiveModelStorage,showRelationNames:i??this.showRelationNames,syncRemoteChanges:a??this.syncRemoteChanges})}updatePerspective(e){let n=this.perspectiveModelStorage.updateModel(e);return n===this.perspectiveModelStorage?this:new t({displayNameStyle:this.displayNameStyle,displayColumnStyle:this.displayColumnStyle,exportDdlSetting:this.exportDdlSetting,perspectiveModelStorage:n,showRelationNames:this.showRelationNames,syncRemoteChanges:this.syncRemoteChanges})}toJSON(){let e=this.perspectiveModelStorage.getModels().map(n=>n.toJSON());return{displayStyle:this.displayNameStyle.toJSON(),...this.displayColumnStyle.key!==ft.ALL.key&&{displayColumn:this.displayColumnStyle.toJSON()},exportDdlSetting:this.exportDdlSetting.toJSON(),...e.length>0&&{perspectiveModels:e},...this.showRelationNames&&{showRelationNames:!0},...this.syncRemoteChanges&&{syncRemoteChanges:!0}}}static toObject(e){S(e,"exportDdlSetting");let n="displayStyle"in e?qt.toObject(e.displayStyle):qt.BOTH,r="displayColumn"in e?ft.toObject(e.displayColumn):ft.ALL,o=ln.toObject(e.exportDdlSetting),i="perspectiveModels"in e?j(e.perspectiveModels,"perspectiveModels",l=>pc.toObject(l)):[],a="showRelationNames"in e?e.showRelationNames:!1,s="syncRemoteChanges"in e?e.syncRemoteChanges:!1;return new t({displayNameStyle:n,displayColumnStyle:r,exportDdlSetting:o,perspectiveModelStorage:new _r(i),showRelationNames:a,syncRemoteChanges:s})}equals(e){return!(this.displayNameStyle.equals(e.displayNameStyle)===!1||this.displayColumnStyle.equals(e.displayColumnStyle)===!1||this.exportDdlSetting.equals(e.exportDdlSetting)===!1||this.perspectiveModelStorage.equals(e.perspectiveModelStorage)===!1||this.showRelationNames!==e.showRelationNames||this.syncRemoteChanges!==e.syncRemoteChanges)}};var Gh=/^#[0-9A-Fa-f]{6}$/,ne=class t{static{this.WHITE=new t({red:255,green:255,blue:255})}static{this.BLACK=new t({red:0,green:0,blue:0})}constructor({red:e,green:n,blue:r}){this.red=e,this.green=n,this.blue=r}static fromHex(e){if(Gh.test(e)===!1)throw new Error(`Invalid color hex string: ${e}`);let n=parseInt(e.substring(1,3),16),r=parseInt(e.substring(3,5),16),o=parseInt(e.substring(5,7),16);return new t({red:n,green:r,blue:o})}toHex(e="light"){let n=this.to(e),r=n.red.toString(16).padStart(2,"0"),o=n.green.toString(16).padStart(2,"0"),i=n.blue.toString(16).padStart(2,"0");return`#${r}${o}${i}`.toUpperCase()}toRgba(e="light",n=1){let r=this.to(e);return`rgba(${r.red}, ${r.green}, ${r.blue}, ${n})`}to(e){if(e==="light")return this;let n=Wh(this),r=Yh+jh*(1-n.lightness);return Hh({hue:n.hue,saturation:n.saturation,lightness:r})}reverseGrayscale(){let e=255-(this.red+this.green+this.blue)/3;return new t({red:e,green:e,blue:e})}equals(e){return this.red===e.red&&this.green===e.green&&this.blue===e.blue}static toObject(e){return S(e,"red"),S(e,"green"),S(e,"blue"),new t({red:e.red,green:e.green,blue:e.blue})}toJSON(){return{red:this.red,green:this.green,blue:this.blue}}},Yh=.1,jh=.8,Wh=t=>{let e=t.red/255,n=t.green/255,r=t.blue/255,o=Math.max(e,n,r),i=Math.min(e,n,r),a=(o+i)/2,s=o-i;if(s===0)return{hue:0,saturation:0,lightness:a};let l=Jh(e,n,r,o,s),c=s/(1-Math.abs(2*a-1));return{hue:l,saturation:c,lightness:a}},Jh=(t,e,n,r,o)=>r===t?60*(((e-n)/o+6)%6):r===e?60*((n-t)/o+2):60*((t-e)/o+4),Hh=({hue:t,saturation:e,lightness:n})=>{let r=(1-Math.abs(2*n-1))*e,o=n-r/2,i=a=>{let s=(t/60+a)%6,l=Math.min(Math.max(Math.abs(s-3)-1,0),1);return Math.round((o+r*l)*255)};return new ne({red:i(0),green:i(4),blue:i(2)})};var Qn=class t{constructor({positionX:e,positionY:n,width:r,height:o}){this.positionX=e,this.positionY=n,this.width=r,this.height=o}static createFromPoints(e,n){let r=Math.min(e.x,n.x),o=Math.min(e.y,n.y),i=Math.max(Math.abs(e.x-n.x),2),a=Math.max(Math.abs(e.y-n.y),2);return new t({positionX:r,positionY:o,width:i,height:a})}static createFromEdges(e){let n=e.left,r=e.top,o=e.right-e.left,i=e.bottom-e.top;return new t({positionX:n,positionY:r,width:o,height:i})}move(e){return new t({positionX:this.positionX+e.x,positionY:this.positionY+e.y,width:this.width,height:this.height})}get left(){return this.positionX}get right(){return this.positionX+this.width}get xCenter(){return this.positionX+this.width/2}get top(){return this.positionY}get bottom(){return this.positionY+this.height}get yCenter(){return this.positionY+this.height/2}get center(){return{x:this.xCenter,y:this.yCenter}}contains(e){return e instanceof t?this.containsArea(e):this.containsPoint(e)}containsArea(e){return!(this.left>e.left||this.right<e.right||this.top>e.top||this.bottom<e.bottom)}containsPoint(e){return!(e.x<this.left||e.x>this.right||e.y<this.top||e.y>this.bottom)}static toObject(e){return S(e,"positionX"),S(e,"positionY"),S(e,"width"),S(e,"height"),new t({positionX:e.positionX,positionY:e.positionY,width:e.width,height:e.height})}toJSON(){return{positionX:this.positionX,positionY:this.positionY,width:this.width,height:this.height}}equals(e){return!(this.positionX!==e.positionX||this.positionY!==e.positionY||this.width!==e.width||this.height!==e.height)}};var hc="center",fc="center",Jo=9,un=class t{constructor({memoId:e,memo:n,rectangleViewModel:r,backgroundColor:o,foregroundColor:i,verticalAlign:a=hc,horizontalAlign:s=fc,fontSize:l=Jo,createdAt:c=null}){this.memoId=e,this.memo=n,this.rectangleViewModel=r,this.backgroundColor=o,this.foregroundColor=i,this.verticalAlign=a,this.horizontalAlign=s,this.fontSize=l>=1?l:1,this.createdAt=c||new Date}static create(e,n,r=Jo){return new t({memoId:X(),memo:"",rectangleViewModel:e,backgroundColor:n.background,foregroundColor:n.foreground,fontSize:r})}updateMemo(e){return this.memo===e?this:new t({...this,memo:e})}updateRectangle(e){return e.equals(this.rectangleViewModel)?this:new t({...this,rectangleViewModel:e})}updateColor(e=null,n=null){let r=e||this.backgroundColor,o=n||this.foregroundColor;return this.backgroundColor.equals(r)&&this.foregroundColor.equals(o)?this:new t({...this,backgroundColor:r,foregroundColor:o})}updateVerticalAlign(e){return this.verticalAlign===e?this:new t({...this,verticalAlign:e})}updateHorizontalAlign(e){return this.horizontalAlign===e?this:new t({...this,horizontalAlign:e})}updateFontSize(e){return this.fontSize===e||e<1?this:new t({...this,fontSize:e})}move(e){let n=this.rectangleViewModel.move(e);return new t({...this,rectangleViewModel:n})}toJSON(){return{memoId:this.memoId,memo:this.memo,rectangleViewModel:this.rectangleViewModel.toJSON(),backgroundColor:this.backgroundColor.toJSON(),foregroundColor:this.foregroundColor.toJSON(),verticalAlign:this.verticalAlign,horizontalAlign:this.horizontalAlign,fontSize:this.fontSize,createdAt:this.createdAt}}static toObject(e){S(e,"memoId"),S(e,"memo"),S(e,"rectangleViewModel");let n="backgroundColor"in e?ne.toObject(e.backgroundColor):ne.WHITE,r="foregroundColor"in e?ne.toObject(e.foregroundColor):ne.BLACK,o="verticalAlign"in e?e.verticalAlign:hc,i="horizontalAlign"in e?e.horizontalAlign:fc,a="fontSize"in e?e.fontSize:Jo,s="createdAt"in e?Ve(e.createdAt):new Date;return new t({memoId:e.memoId,memo:e.memo,rectangleViewModel:Qn.toObject(e.rectangleViewModel),backgroundColor:n,foregroundColor:r,verticalAlign:o,horizontalAlign:i,fontSize:a,createdAt:s})}equals(e){return!(this.memoId!==e.memoId||this.memo!==e.memo||this.rectangleViewModel.equals(e.rectangleViewModel)===!1||this.backgroundColor.equals(e.backgroundColor)===!1||this.foregroundColor.equals(e.foregroundColor)===!1||this.verticalAlign!==e.verticalAlign||this.horizontalAlign!==e.horizontalAlign||this.fontSize!==e.fontSize||this.createdAt.getTime()!==e.createdAt.getTime())}};var Bn=class t{constructor(e,n,r){this.memoIdMap=new Map(e),this.foregroundIds=n,this.backgroundIds=r}static create(e,n){return new t(new Map(e.concat(n).map(r=>[r.memoId,r])),e.map(r=>r.memoId),n.map(r=>r.memoId))}find(e){return this.memoIdMap.get(e)||null}getMemos(){let e=this.foregroundIds.map(r=>this.memoIdMap.get(r)).filter(r=>r!=null),n=this.backgroundIds.map(r=>this.memoIdMap.get(r)).filter(r=>r!=null);return{frontMemos:e,backMemos:n}}addMemo(e,n="front"){let r=new Map(this.memoIdMap);r.set(e.memoId,e);let o=n==="front"?[...this.foregroundIds,e.memoId]:this.foregroundIds,i=n==="back"?[e.memoId,...this.backgroundIds]:this.backgroundIds;return new t(r,o,i)}updateMemo(e){let n=new Map(this.memoIdMap);return n.set(e.memoId,e),new t(n,this.foregroundIds,this.backgroundIds)}deleteMemo(e){let n=new Map(this.memoIdMap);if(n.delete(e)===!1)return this;let o=this.foregroundIds.indexOf(e),i=o<0?this.backgroundIds.indexOf(e):-1,a=o>=0?Nr(this.foregroundIds,o):this.foregroundIds,s=i>=0?Nr(this.backgroundIds,i):this.backgroundIds;return new t(n,a,s)}moveMemo(e,n){let r=new Map(this.memoIdMap);return e.forEach(o=>{let i=r.get(o);i!=null&&r.set(o,i.move(n))}),new t(r,this.foregroundIds,this.backgroundIds)}arrangeMemo(e,n){if(this.memoIdMap.get(e)==null)return this;let o=this.foregroundIds.indexOf(e);if(n==="front"&&this.foregroundIds.length>0&&o===this.foregroundIds.length-1)return this;let i=o<0?this.backgroundIds.indexOf(e):-1;if(n==="back"&&this.backgroundIds.length>0&&i===0)return this;let a=o>=0?Nr(this.foregroundIds,o):this.foregroundIds,s=i>=0?Nr(this.backgroundIds,i):this.backgroundIds;return new t(this.memoIdMap,n==="front"?[...a,e]:a,n==="back"?[e,...s]:s)}equals(e){return Xe(this.memoIdMap,e.memoIdMap)===!1||an(this.foregroundIds,e.foregroundIds)===!1?!1:an(this.backgroundIds,e.backgroundIds)}reuseInstancesFrom(e){let n=Vt(e.memoIdMap,this.memoIdMap),r=Fo(e.foregroundIds,this.foregroundIds),o=Fo(e.backgroundIds,this.backgroundIds);return(n===e.memoIdMap&&r===e.foregroundIds&&o===e.backgroundIds)===!0?e:new t(new Map(n),r,o)}},Nr=(t,e)=>t.length===0||e<0||e>=t.length?t:t.slice(0,e).concat(t.slice(e+1));var Xh={segment:-1,fraction:0,offsetX:0,offsetY:0},ef={bold:!1,italic:!1,strikethrough:!1,fontSize:10},et=class t{constructor({label:e,position:n=Xh,color:r=ne.BLACK,style:o=ef}){this.label=e,this.position=n,this.color=r,this.style=o}updateLabelPosition(e){return gc(this.position,e)?this:new t({...this,position:e})}updateLabelStyle(e){return yc(this.style,e)?this:new t({...this,style:e})}updateColor(e){return this.color.equals(e)?this:new t({...this,color:e})}equals(e){return!(this.label!==e.label||gc(this.position,e.position)===!1||this.color.equals(e.color)===!1||yc(this.style,e.style)===!1)}toJSON(){return{label:this.label,position:this.position,color:this.color.toJSON(),style:this.style}}static toObject(e){return S(e,"label"),S(e,"position"),S(e,"color"),S(e,"style"),new t({label:e.label,position:e.position,color:ne.toObject(e.color),style:e.style})}},gc=(t,e)=>t.segment===e.segment&&t.fraction===e.fraction&&t.offsetX===e.offsetX&&t.offsetY===e.offsetY,yc=(t,e)=>t.bold===e.bold&&t.italic===e.italic&&t.strikethrough===e.strikethrough&&t.fontSize===e.fontSize;var gt=class t{constructor({strokeWidth:e=1,edges:n=[],orthogonalLines:r=[],color:o=ne.BLACK}){this.strokeWidth=e>0?e:1,this.edges=[...n],this.orthogonalLines=[...r],this.color=o}get lineType(){return this.orthogonalLines.length>0?"orthogonal":"straight"}updateEdge(e){if(e.edgeType==="virtual"){let r=[...this.edges];return r.splice(e.edgeId,0,e.point),new t({...this,edges:r,orthogonalLines:[]})}if(e.edgeId<0||e.edgeId>=this.edges.length)return this;let n=[...this.edges];return n[e.edgeId]=e.point,new t({...this,edges:n,orthogonalLines:[]})}updateOrthogonalLines(e){return new t({...this,orthogonalLines:[...e],edges:[]})}updateStrokeWidth(e){return this.strokeWidth===e||e<=0?this:new t({...this,strokeWidth:e})}updateColor(e){return this.color.equals(e)?this:new t({...this,color:e})}deleteEdge(e){if(e<0||e>=this.edges.length)return this;let n=[...this.edges];return n.splice(e,1),new t({...this,edges:n})}equals(e){return this===e?!0:this.strokeWidth!==e.strokeWidth||this.edges.length!==e.edges.length||this.color.equals(e.color)===!1||this.edges.every((r,o)=>{let i=e.edges[o];return r.x===i.x&&r.y===i.y})===!1||this.orthogonalLines.length!==e.orthogonalLines.length?!1:this.orthogonalLines.every((r,o)=>{let i=e.orthogonalLines[o];return r.direction===i.direction&&r.position===i.position})}toJSON(){return{strokeWidth:this.strokeWidth,edges:this.edges,orthogonalLines:this.orthogonalLines,color:this.color.toJSON()}}static toObject(e){S(e,"strokeWidth");let n="edges"in e?e.edges:[],r="orthogonalLines"in e?e.orthogonalLines:[],o="color"in e?ne.toObject(e.color):ne.BLACK;return new t({strokeWidth:e.strokeWidth,edges:n,orthogonalLines:r,color:o})}};var Ne=class t{constructor({relationModel:e,lineViewModel:n,labelViewModel:r=null,createdAt:o=null}){this.relationModel=e,this.lineViewModel=n,this.labelViewModel=r??new et({label:e.relationName}),this.createdAt=o||new Date}get relationId(){return this.relationModel.relationModelId}get parentTableModelId(){return this.relationModel.parentTableModelId}get childTableModelId(){return this.relationModel.childTableModelId}updateRelationModel(e){let n=e.relationName===this.labelViewModel.label?this.labelViewModel:new et({...this.labelViewModel,label:e.relationName});return new t({relationModel:e,lineViewModel:this.lineViewModel,labelViewModel:n,createdAt:this.createdAt})}toJSON(){return{relationModel:this.relationModel.toJSON(),lineViewModel:this.lineViewModel.toJSON(),...this.labelViewModel.label!=""&&{labelViewModel:this.labelViewModel.toJSON()},createdAt:this.createdAt}}static toObject(e){S(e,"relationModel"),S(e,"lineViewModel");let n="labelViewModel"in e?et.toObject(e.labelViewModel):null,r="createdAt"in e?Ve(e.createdAt):new Date;return new t({relationModel:qe.toObject(e.relationModel),lineViewModel:gt.toObject(e.lineViewModel),labelViewModel:n,createdAt:r})}equals(e){return this.relationModel.equals(e.relationModel)&&this.lineViewModel.equals(e.lineViewModel)&&this.labelViewModel.equals(e.labelViewModel)}};var dn=class t{constructor(e){this.relationIdMap=new Map(e.map(n=>[n.relationId,n])),this.parentTableModelIdMap=t.toTableIdMapping(e,n=>n.parentTableModelId),this.childTableModelIdMap=t.toTableIdMapping(e,n=>n.childTableModelId),this.childColumnModelIdMap=new Map(e.filter(n=>n.relationModel.relationPairs.length>0).flatMap(n=>n.relationModel.relationPairs.map(r=>[`${n.relationModel.childTableModelId}:${r.childColumnModelId}`,{tableModelId:n.relationModel.parentTableModelId,columnModelId:r.parentColumnModelId}])))}static toTableIdMapping(e,n){let r=new Map;return e.forEach(o=>{let i=n(o.relationModel),a=r.get(i);a!=null?a.push(o):r.set(i,[o])}),r}getModels(){return Array.from(this.relationIdMap.values()).sort((e,n)=>e.relationId.localeCompare(n.relationId,"en"))}findByRelationId(e){let n=this.relationIdMap.get(e);return n??null}fetchRelationsByParent(e){let n=this.parentTableModelIdMap.get(e);return n||[]}fetchRelationsByChild(e){let n=this.childTableModelIdMap.get(e);return n||[]}fetchRelationsByTableIds(e){let n=e.flatMap(i=>this.parentTableModelIdMap.get(i)||[]).map(i=>i.relationId),r=e.flatMap(i=>this.childTableModelIdMap.get(i)||[]).map(i=>i.relationId),o=new Set([...n,...r]);return o.size===0?[]:[...o].flatMap(i=>this.relationIdMap.get(i)||[])}inChildRelation(e,n){return this.childColumnModelIdMap.has(`${e}:${n}`)}findParentRelation(e,n){return this.childColumnModelIdMap.get(`${e}:${n}`)??null}updateRelationView(e){return this.update([e])}updateRelationModel(e){if(e.length===0)return this;let n=e.map(r=>{let o=this.relationIdMap.get(r.relationModelId);return o!=null?o.updateRelationModel(r):new Ne({relationModel:r,lineViewModel:new gt({})})});return this.update(n)}deleteRelation(e){if(e.length===0)return this;let n=new Map(this.relationIdMap);return e.forEach(r=>n.delete(r)),n.size===this.relationIdMap.size?this:new t(Array.from(n.values()))}deleteFromTableId(e){if(e.length===0)return this;let n=new Map(this.relationIdMap);for(let r of e)(this.childTableModelIdMap.get(r)||[]).forEach(i=>{n.delete(i.relationId)});return n.size===this.relationIdMap.size?this:new t(Array.from(n.values()))}updateLineView(e,n){let r=this.relationIdMap.get(e);if(r==null)return this;if(r.lineViewModel.equals(n))return this;let o=new Ne({...r,lineViewModel:n});return this.update([o])}updateLabelView(e,n){let r=this.relationIdMap.get(e);if(r==null)return this;if(r.labelViewModel.equals(n))return this;let o=new Ne({...r,labelViewModel:n});return this.update([o])}updateRelationOrthogonal(e){if(e.length===0)return this;let n=e.map(({relationId:r,orthogonalLines:o,changedIndex:i})=>{let a=this.findByRelationId(r);if(a==null)return null;let s=a.lineViewModel,l=s.updateOrthogonalLines(o);if(s.equals(l))return null;let c=a.labelViewModel,m=c.position.segment;if(i<0||m<i)return new Ne({...a,lineViewModel:l});let d=l.orthogonalLines.length-s.orthogonalLines.length,h=i===0&&m===0?0:Math.min(Math.max(0,m+d),l.orthogonalLines.length-1),g=new et({...c,position:{...c.position,segment:h}});return new Ne({...a,lineViewModel:l,labelViewModel:g})}).filter(r=>r!=null);return this.update(n)}update(e){if(e.length===0)return this;let n=new Map(this.relationIdMap);return e.forEach(r=>n.set(r.relationId,r)),new t(Array.from(n.values()))}moveRelation(e,n){if(this.relationIdMap.size===0)return this;if(e.size<=1)return this;if(n.x===0&&n.y===0)return this;let r=!1,o=[...this.relationIdMap.values()].map(i=>{let a=i.relationModel;if(e.has(a.parentTableModelId)==!1||e.has(a.childTableModelId)==!1||i.lineViewModel.edges.length===0)return i;r=!0;let s=i.lineViewModel.edges.map(c=>({x:c.x+n.x,y:c.y+n.y})),l=new gt({...i.lineViewModel,edges:s});return new Ne({...i,lineViewModel:l})});return r===!1?this:new t(o)}equals(e){return Xe(this.relationIdMap,e.relationIdMap)}reuseInstancesFrom(e){let n=Vt(e.relationIdMap,this.relationIdMap);return n===e.relationIdMap?e:new t(Array.from(n.values()))}};var be=class t{constructor({tableModel:e,corner:n,headerColor:r,createdAt:o=null}){this.tableModel=e,this.corner={...n},this.headerColor={...r},this.createdAt=o||new Date}get tableId(){return this.tableModel.tableModelId}toJSON(){return{tableModel:this.tableModel.toJSON(),top:this.corner.top,left:this.corner.left,headerBackgroundColor:this.headerColor.background.toJSON(),headerForegroundColor:this.headerColor.foreground.toJSON(),createdAt:this.createdAt}}static toObject(e){return S(e,"tableModel"),S(e,"top"),S(e,"left"),S(e,"headerBackgroundColor"),S(e,"headerForegroundColor"),new t({tableModel:Ze.toObject(e.tableModel),corner:{top:e.top,left:e.left},headerColor:{background:ne.toObject(e.headerBackgroundColor),foreground:ne.toObject(e.headerForegroundColor)},createdAt:"createdAt"in e?Ve(e.createdAt):new Date})}equals(e){return!(this.tableModel.equals(e.tableModel)===!1||this.corner.top!==e.corner.top||this.corner.left!==e.corner.left||this.headerColor.background.equals(e.headerColor.background)===!1||this.headerColor.foreground.equals(e.headerColor.foreground)===!1||this.createdAt.getTime()!==e.createdAt.getTime())}};var mn=class t{constructor(e,n,r,o,i,a,s,l,c,m,d,h=null){this.documentName=e,this.erdSettingModel=n,this.databaseSettingModel=r,this.schemaConfig=o,this.tableViewModelIds=i,this.tableViewModelMap=a,this.columnGroupModelMap=s,this.columnModelMap=l,this.columnShareStorage=c,this.relationViewModelStorage=m,this.memoViewModelStorage=d,this.lastUpdatedAt=h||new Date}static create({documentName:e,databaseSettingModel:n,erdSettingModel:r=cn.create(e),schemaConfig:o=Cr.create(),tableViewModels:i=[],columnGroupModels:a=[],structShareModels:s=[],columnModels:l=[],columnShareModels:c=[],relationViewModels:m=[],foregroundMemoViewModels:d=[],backgroundMemoViewModels:h=[],lastUpdatedAt:g=null}){return new t(e,r,n,o,i.map(b=>b.tableId),new Map(i.map(b=>[b.tableId,b])),new Map(a.map(b=>[b.columnGroupId,b])),new Map(l.map(b=>[b.columnModelId,b])),Un.create(c,s),new dn(m),Bn.create(d,h),g)}doUpdate(e){let n=e.columnModelMap!=null||e.columnGroupModelMap!=null||e.columnShareModelStorage!=null,r=e.tableViewModelMap??this.tableViewModelMap,o=e.columnGroupModelMap??this.columnGroupModelMap,i=e.columnModelMap??this.columnModelMap,a=e.columnShareModelStorage??this.columnShareStorage,s=n?this.doCollectReachableModelIds(r,o,i,a):null,l=s==null?i:this.doRetainColumnModels(i,s.columnModelIds),c=s==null?a:a.retain(s.columnShareModelIds,s.structShareModelIds,new Set(l.keys()),new Set(o.keys()));return new t(e.documentName??this.documentName,e.erdSettingModel??this.erdSettingModel,e.databaseSettingModel??this.databaseSettingModel,e.schemaConfig??this.schemaConfig,e.tableViewModelIds??this.tableViewModelIds,e.tableViewModelMap??this.tableViewModelMap,o,l,c,e.relationViewModelStorage??this.relationViewModelStorage,e.memoViewModelStorage??this.memoViewModelStorage,e.lastUpdatedAt??null)}doCollectReachableModelIds(e,n,r,o){let i=Array.from(e.values()).flatMap(d=>bc(d.tableModel.columnEntries)),a=Array.from(n.values()).flatMap(d=>d.columnModelIds),s=new Set,l=new Set,c=new Set,m=[...i,...a];for(;m.length>0;){let d=m.pop();if(d==null||s.has(d))continue;s.add(d);let h=r.get(d);if(h==null)continue;if(ce.isSimpleColumn(h)){l.add(h.columnShareModelId);continue}let g=h.structShareModelId;if(c.has(g))continue;c.add(g);let b=o.findStructShare(g);b!=null&&m.push(...bc(b.columnEntries))}return{columnModelIds:s,columnShareModelIds:l,structShareModelIds:c}}doRetainColumnModels(e,n){let r=Array.from(e.keys()).filter(i=>n.has(i)===!1);if(r.length===0)return e;let o=new Map(e);return r.forEach(i=>o.delete(i)),o}getDatabase(){return this.databaseSettingModel.getDatabase()}getDisplayNameStyle(){return this.erdSettingModel.displayNameStyle}getDisplayColumnStyle(){return this.erdSettingModel.displayColumnStyle}findSchema(e){return this.getDatabase().supportsSchema===!1?null:this.schemaConfig.findSchema(e)}findDefaultSchema(){return this.getDatabase().supportsSchema===!1?null:this.schemaConfig.findDefaultSchema()}findTableViewModel(e){let n=this.tableViewModelMap.get(e);return n||null}getTableViewModels(){return this.tableViewModelIds.map(e=>this.tableViewModelMap.get(e))}findColumnGroupModel(e){let n=this.columnGroupModelMap.get(e);return n||null}getColumnGroupModels(){return Array.from(this.columnGroupModelMap.values()).sort((n,r)=>{let o=n.groupName.localeCompare(r.groupName,"en");return o!==0?o:n.columnGroupId.localeCompare(r.columnGroupId,"en")})}findStructColumnShareModel(e){return this.columnShareStorage.findStructShare(e)}getStructColumnShareModels(){return this.columnShareStorage.getStructShareModels()}findColumnModel(e){let n=this.columnModelMap.get(e);return n||null}toAllColumnsWithStruct(e){return e.columnEntries.flatMap(n=>{if(n.modelType==="single")return[n.columnModelId];let r=this.findColumnGroupModel(n.columnGroupId);return r==null?[]:r.columnModelIds}).map(n=>this.findColumnModel(n)).filter(n=>n!=null)}toAllColumnsExceptStruct(e){return this.toAllColumnsWithStruct(e).filter(ce.isSimpleColumn)}findColumnShareModel(e){return this.columnShareStorage.findColumnShare(e)}fetchReferencedColumnModelsForShareModel(e){return Array.from(this.columnModelMap.values()).filter(ce.isSimpleColumn).filter(n=>n.columnShareModelId===e).sort((n,r)=>{let o=n.physicalName.localeCompare(r.physicalName,"en");return o!==0?o:n.columnModelId.localeCompare(r.columnModelId,"en")})}getColumnShareModelStorage(){return this.columnShareStorage.copy()}findRelationViewModel(e){return this.relationViewModelStorage.findByRelationId(e)}fetchRelationsByTableIds(e){return e.length===0?[]:this.relationViewModelStorage.fetchRelationsByTableIds(e)}getRelationViewModels(){return this.relationViewModelStorage.getModels()}inChildRelation(e,n){return this.relationViewModelStorage.inChildRelation(e,n)}findParentRelation(e,n){return this.relationViewModelStorage.findParentRelation(e,n)}findRelatedRelations(e){let n=this.relationViewModelStorage.fetchRelationsByParent(e),r=this.relationViewModelStorage.fetchRelationsByChild(e);return{parentRelations:n,childRelations:r}}findMemoViewModel(e){return this.memoViewModelStorage.find(e)}getMemoViewModels(){return this.memoViewModelStorage.getMemos()}updateSchema(e){return this.schemaConfig.equals(e)?this:this.doUpdate({schemaConfig:e})}updateTableMeta(...e){let n=new Map(this.tableViewModelMap);return e.forEach(r=>{n.set(r.tableId,r)}),this.doUpdate({tableViewModelMap:n})}updateTableViewWithColumns(e,n,r=null){let o=r||this.columnShareStorage,i=this.tableViewModelMap.get(e.tableId);if(i==null)return this.doAddTableViewModel(e,n,o);let{nextTableViewModels:a,nextColumnModelMap:s,nextRelationViewModelStorage:l}=this.doUpdateTableViewModelWithRelation(i,e,n,o),c=new Map(this.tableViewModelMap);a.forEach(d=>{c.set(d.tableId,d)});let m=new Map(this.columnModelMap);return s.forEach(d=>m.set(d.columnModelId,d)),this.doUpdate({tableViewModelMap:c,columnModelMap:m,columnShareModelStorage:o.copy(),relationViewModelStorage:l})}doAddTableViewModel(e,n,r){let o=[...this.tableViewModelIds,e.tableId],i=new Map(this.tableViewModelMap);i.set(e.tableId,e);let a=new Map(this.columnModelMap);return n.forEach(l=>a.set(l.columnModelId,l)),this.doUpdateTableCheckExpression(e,a,r).forEach(l=>i.set(l.tableId,l)),this.doUpdate({tableViewModelIds:o,tableViewModelMap:i,columnModelMap:a,columnShareModelStorage:r.copy()})}doUpdateTableCheckExpression(e,n,r){if(r.equals(this.columnShareStorage)===!0)return[];let o=e.tableModel.columnEntries.map(s=>{if(s.modelType!=="single")return null;let l=n.get(s.columnModelId);if(l==null||ce.isSimpleColumn(l)===!1)return null;let c=this.columnShareStorage.findColumnShare(l.columnShareModelId),m=r.findColumnShare(l.columnShareModelId);return c==null||m==null||c.physicalName===m.physicalName?null:{previousColumnShare:c,nextColumnShare:m}}).filter(s=>s!==null);if(o.length===0)return[];let i=new Map(o.map(s=>[s.nextColumnShare.columnShareModelId,s]));return Array.from(this.tableViewModelMap.entries()).map(([s,l])=>{let c=l.tableModel;if(c.checkExpression==""||s===e.tableId)return null;let m=this.toAllColumnsExceptStruct(c).map(h=>{let g=i.get(h.columnShareModelId);if(g==null)return null;let b=mt(h,g.previousColumnShare),y=mt(h,g.nextColumnShare);return b.physicalName===y.physicalName?null:{previousName:b,nextName:y}}).filter(h=>h!==null),d=c.updateCheckExpression(m);return d===c?null:(console.debug(`Update checkExpression. tableId: ${s}, tableName: ${c.physicalName}, before: ${c.checkExpression}, after: ${d.checkExpression}`),new be({...l,tableModel:d}))}).filter(s=>s!==null)}doUpdateTableViewModelWithRelation(e,n,r,o){let i=new Map(r.map(M=>[M.columnModelId,M])),a=this.relationViewModelStorage.fetchRelationsByParent(n.tableId),s=new Map(this.columnModelMap);r.forEach(M=>s.set(M.columnModelId,M));let l=this.doUpdateTableCheckExpression(n,s,o),c=[n,...l];if(a.length===0)return{nextTableViewModels:c,nextColumnModelMap:i,nextRelationViewModelStorage:this.relationViewModelStorage};let m=n.tableModel.columnEntries.flatMap(M=>{if(M.modelType==="single"){let v=i.get(M.columnModelId);return v!=null?[v]:[]}let R=this.columnGroupModelMap.get(M.columnGroupId);return R==null?[]:R.columnModelIds.map(v=>this.findColumnModel(v)).filter(v=>v!=null)}).filter(ce.isSimpleColumn).filter(M=>M.primaryKey===!0),d=this.toAllColumnsExceptStruct(e.tableModel),h=d.filter(M=>M.primaryKey===!0&&m.some(R=>R.columnModelId===M.columnModelId)===!1).map(M=>M.columnModelId),g=d.filter(M=>M.primaryKey===!0).map(M=>M.columnModelId),b=m.filter(M=>g.includes(M.columnModelId)===!1);if(h.length===0&&b.length===0)return{nextTableViewModels:c,nextColumnModelMap:i,nextRelationViewModelStorage:this.relationViewModelStorage};let y=new Map(c.map(M=>[M.tableId,M])),N=this.doUpdateRelationWithPrimaryKeyChanged(a,y,i,b,h);return{...N,nextTableViewModels:Array.from(N.nextTableViewMap.values())}}doUpdateRelationWithPrimaryKeyChanged(e,n,r,o,i,a=null){let s=new Map(n),l=new Map(r),c=new Map,m=new Set;if(i.length>0)for(let d of e){let h=d.relationModel,g=h.relationPairs.filter(y=>i.includes(y.parentColumnModelId)===!1);if(h.relationPairs.length===g.length)continue;g.length===0&&m.add(d.relationId);let b=new qe({...d.relationModel,relationPairs:g});c.set(b.relationModelId,b)}if(o.length>0)for(let d of e){let h=c.get(d.relationId)||d.relationModel,g=s.get(h.childTableModelId)||this.tableViewModelMap.get(h.childTableModelId);if(g==null)continue;if(a===null?!1:g.tableModel.columnEntries.some(H=>H.modelType==="group"&&H.columnGroupId===a.columnGroupId)){let H=[...h.relationPairs,...o.map(ci=>new dt({parentColumnModelId:ci.columnModelId,childColumnModelId:ci.columnModelId}))],Ge=new qe({...h,relationPairs:H});c.set(Ge.relationModelId,Ge),m.delete(Ge.relationModelId);continue}let y=Sc(h.childCardinality),N=o.map(H=>{let Ge=new ut({columnModelId:X(),columnShareModelId:H.columnShareModelId,physicalName:H.physicalName,logicalName:H.logicalName,notNull:y});return{columnModel:Ge,relationPair:new dt({parentColumnModelId:H.columnModelId,childColumnModelId:Ge.columnModelId})}}),M=N.map(H=>H.columnModel),R=N.map(H=>H.relationPair);M.forEach(H=>{l.set(H.columnModelId,H)});let v=g.tableModel,z=new be({...g,tableModel:new Ze({...v,columnEntries:[...v.columnEntries,...M.map(H=>({modelType:"single",columnModelId:H.columnModelId}))]})});s.set(z.tableId,z);let me=[...h.relationPairs,...R],pe=new qe({...h,relationPairs:me});c.set(pe.relationModelId,pe),m.delete(pe.relationModelId)}return m.forEach(d=>c.delete(d)),{nextTableViewMap:s,nextColumnModelMap:l,nextRelationViewModelStorage:this.relationViewModelStorage.updateRelationModel(Array.from(c.values())).deleteRelation(Array.from(m))}}deleteTable(e){if(this.tableViewModelMap.get(e)==null)return this;let r=this.tableViewModelIds.filter(i=>i!==e),o=new Map(this.tableViewModelMap);return o.delete(e),this.doUpdate({tableViewModelIds:r,tableViewModelMap:o,columnModelMap:this.columnModelMap,relationViewModelStorage:this.relationViewModelStorage.deleteFromTableId([e])})}updateColumnGroup(e,n,r){let o=this.columnGroupModelMap.get(e.columnGroupId)||null,i=new Map(this.columnGroupModelMap);i.set(e.columnGroupId,e);let a=new Map(this.columnModelMap);n.forEach(m=>{a.set(m.columnModelId,m)});let{nextTableViewMap:s,nextColumnModelMap:l,nextRelationViewModelStorage:c}=this.doUpdateTableViewModelsWithUpdatingColumnGroup(o,e,n,a,r);return this.doUpdate({tableViewModelMap:s.size>0?new Map([...this.tableViewModelMap,...s]):this.tableViewModelMap,columnGroupModelMap:i,columnModelMap:l,columnShareModelStorage:r.copy(),relationViewModelStorage:c})}doUpdateTableViewModelsWithUpdatingColumnGroup(e,n,r,o,i){let a=Array.from(this.tableViewModelMap.values()).filter(M=>M.tableModel.columnEntries.some(R=>R.modelType==="group"&&R.columnGroupId===n.columnGroupId)),s=new Map;if(a.length===0)return{nextTableViewMap:s,nextColumnModelMap:o,nextRelationViewModelStorage:this.relationViewModelStorage};let l=r.filter(ce.isSimpleColumn).map(M=>{let R=this.columnModelMap.get(M.columnModelId);if(R==null||ce.isSimpleColumn(R)===!1)return null;let v=this.columnShareStorage.findColumnShare(R.columnShareModelId);if(v==null)return null;let z=i.findColumnShare(M.columnShareModelId);if(z==null)return null;let me=mt(R,v),pe=mt(M,z);return me.physicalName===pe.physicalName?null:{previousName:me,nextName:pe}}).filter(M=>M!==null),c=new Set,m=a.map(M=>{let R=M.tableModel,v=R.updateCheckExpression(l);if(v===R)return M;c.add(M.tableId),console.debug(`Update checkExpression. tableId: ${M.tableId}, tableName: ${R.physicalName}, before: ${R.checkExpression}, after: ${v.checkExpression}`);let z=new be({...M,tableModel:v});return s.set(z.tableId,z),z}),d=new Set(e==null?[]:e.columnModelIds.filter(M=>n.columnModelIds.includes(M)===!1));if(d.size>0)for(let M of m){let R=M.tableModel,v=ht.filterColumns(R.uniqueKeysModels,pe=>d.has(pe.columnModelId)===!1),z=pt.filterColumns(R.tableIndexModels,pe=>d.has(pe.columnModelId)===!1);if(c.has(M.tableId)===!1&&v.hasChanged===!1&&z.hasChanged===!1)continue;let me=new be({...M,tableModel:new Ze({...R,uniqueKeysModels:v.tableUniqueKeysModels,tableIndexModels:z.tableIndexModels})});s.set(me.tableId,me)}let h=e==null?[]:e.columnModelIds.map(M=>this.columnModelMap.get(M)).filter(M=>M!=null&&ce.isSimpleColumn(M)&&M.primaryKey===!0).map(M=>M.columnModelId),g=n.columnModelIds.map(M=>o.get(M)).filter(M=>M!=null&&ce.isSimpleColumn(M)&&M.primaryKey===!0),b=h.filter(M=>g.every(R=>R.columnModelId!==M)),y=g.filter(M=>h.includes(M.columnModelId)===!1),N=a.flatMap(M=>this.relationViewModelStorage.fetchRelationsByParent(M.tableId));return this.doUpdateRelationWithPrimaryKeyChanged(N,s,o,y,b,n)}deleteColumnGroup(e){let n=this.columnGroupModelMap.get(e);if(n==null)return this;let r=new Map(this.columnGroupModelMap);r.delete(e);let{nextTableViewModelMap:o,nextRelationViewModelStorage:i}=this.doUpdateTableViewModelsWithDeletingColumnGroup(n);return this.doUpdate({tableViewModelMap:o,columnGroupModelMap:r,columnModelMap:this.columnModelMap,relationViewModelStorage:i})}doUpdateTableViewModelsWithDeletingColumnGroup(e){let r=e.columnModelIds.map(g=>this.columnModelMap.get(g)).filter(g=>g!=null&&ce.isSimpleColumn(g)).filter(g=>g.primaryKey===!0).map(g=>g.columnModelId),o=new Map(this.tableViewModelMap),i=[],a=[],s=new Set,l=!1;for(let[g,b]of this.tableViewModelMap.entries()){let y=b.tableModel.columnEntries.filter(z=>z.modelType!=="group"||z.columnGroupId!==e.columnGroupId);if(b.tableModel.columnEntries.length===y.length)continue;if(l=!0,y.length===0){o.delete(g),a.push(g);continue}i.push(b.tableModel);let N=z=>e.columnModelIds.includes(z)===!1,M=ht.filterColumns(b.tableModel.uniqueKeysModels,z=>N(z.columnModelId)),R=pt.filterColumns(b.tableModel.tableIndexModels,z=>N(z.columnModelId)),v=new be({...b,tableModel:new Ze({...b.tableModel,columnEntries:y,uniqueKeysModels:M.tableUniqueKeysModels,tableIndexModels:R.tableIndexModels})});o.set(g,v)}let c=r.length===0?new Map:new Map(i.flatMap(g=>this.relationViewModelStorage.fetchRelationsByParent(g.tableModelId).map(b=>{let y=b.relationModel.relationPairs.filter(N=>r.includes(N.parentColumnModelId)===!1);return y.length===0?(s.add(b.relationId),null):new qe({...b.relationModel,relationPairs:y})}).filter(b=>b!=null)).map(g=>[g.relationModelId,g])),m=new Set(e.columnModelIds);i.flatMap(g=>this.relationViewModelStorage.fetchRelationsByChild(g.tableModelId)).filter(g=>s.has(g.relationId)===!1).map(g=>c.get(g.relationId)??g.relationModel).filter(g=>g.relationPairs.some(b=>m.has(b.childColumnModelId))).map(g=>g.relationModelId).forEach(g=>s.add(g));let h=this.relationViewModelStorage.updateRelationModel(Array.from(c.values())).deleteFromTableId(a).deleteRelation(Array.from(s));return{nextTableViewModelMap:l?o:this.tableViewModelMap,nextRelationViewModelStorage:h}}updateStructColumnShare(e,n=[]){let r=this.columnShareStorage.addStructShare(...e);if(n.length===0)return this.doUpdate({columnShareModelStorage:r});let o=new Map(this.columnModelMap);return n.forEach(i=>o.set(i.columnModelId,i)),this.doUpdate({columnModelMap:o,columnShareModelStorage:r})}deleteStructColumnShare(e){if(this.columnShareStorage.findStructShare(e)==null)return this;let r=new Set(Array.from(this.columnModelMap.values()).filter(d=>d.entityType==="struct"&&d.structShareModelId===e).map(d=>d.columnModelId)),o=[...this.tableViewModelIds],i=new Map(this.tableViewModelMap),a=[];for(let[d,h]of this.tableViewModelMap.entries()){let g=h.tableModel.columnEntries.filter(y=>y.modelType!=="single"||r.has(y.columnModelId)===!1);if(g.length===h.tableModel.columnEntries.length)continue;if(g.length===0){i.delete(d),a.push(d);continue}let b=new be({...h,tableModel:new Ze({...h.tableModel,columnEntries:g})});i.set(d,b)}let s=a.length>0?this.relationViewModelStorage.deleteFromTableId(a):this.relationViewModelStorage,l=a.length>0?o.filter(d=>a.includes(d)===!1):o,c=new Map(this.columnGroupModelMap);for(let[d,h]of this.columnGroupModelMap.entries()){let g=h.columnModelIds.filter(b=>r.has(b)===!1);g.length!==h.columnModelIds.length&&c.set(d,new sn({...h,columnModelIds:g}))}let m=this.columnShareStorage.getStructShareModels().filter(d=>d.structShareModelId!==e).reduce((d,h)=>{let g=h.columnEntries.filter(b=>b.modelType!=="single"||r.has(b.columnModelId)===!1);return g.length===h.columnEntries.length?d:d.addStructShare(new ct({...h,columnEntries:g}))},this.columnShareStorage).deleteStructShare([e]);return this.doUpdate({tableViewModelIds:l,tableViewModelMap:i,columnGroupModelMap:c,columnModelMap:this.columnModelMap,columnShareModelStorage:m,relationViewModelStorage:s})}updateColumnModels(e,n){if(e.length===0&&n.length===0)return this;let r=this.columnShareStorage.addColumnShare(...n);if(e.length===0)return this.doUpdate({columnShareModelStorage:r});let o=new Map(this.columnModelMap);return e.forEach(i=>{o.set(i.columnModelId,i)}),this.doUpdate({columnModelMap:o,columnShareModelStorage:r})}updateRelation(e){let n=e.relationModel,r=this.tableViewModelMap.get(n.childTableModelId);if(r==null)return this;let o=r.tableModel,a=n.relationPairs.map(c=>({parentColumnModelId:c.parentColumnModelId,childColumnModelId:c.childColumnModelId,childColumnModel:this.findColumnModel(c.childColumnModelId)})).filter(c=>c.childColumnModel==null).map(c=>{let m=this.findColumnModel(c.parentColumnModelId);return new ut({columnModelId:c.childColumnModelId,columnShareModelId:m.columnShareModelId,physicalName:m.physicalName,logicalName:m.logicalName,notNull:Sc(n.childCardinality)})}),s;a.length>0?(s=new Map(this.tableViewModelMap),s.set(o.tableModelId,new be({...r,tableModel:o.addColumnModelIds(a.map(c=>c.columnModelId))}))):s=this.tableViewModelMap;let l;return a.length>0?(l=new Map(this.columnModelMap),a.forEach(c=>l.set(c.columnModelId,c))):l=this.columnModelMap,this.doUpdate({tableViewModelMap:s,columnModelMap:l,relationViewModelStorage:this.relationViewModelStorage.updateRelationView(e)})}deleteRelation(e){return this.doUpdateRelationStorage(()=>this.relationViewModelStorage.deleteRelation([e]))}updateRelationLine(e,n){return this.doUpdateRelationStorage(()=>this.relationViewModelStorage.updateLineView(e,n))}updateRelationLabel(e,n){return this.doUpdateRelationStorage(()=>this.relationViewModelStorage.updateLabelView(e,n))}updateRelationLineBy(e,n){let r=this.findRelationViewModel(e);if(r==null)return this;let o=r.lineViewModel,i=n(o);return o.equals(i)?this:this.updateRelationLine(e,i)}updateRelationLabelBy(e,n){let r=this.findRelationViewModel(e);if(r==null)return this;let o=r.labelViewModel,i=n(o);return i.equals(o)?this:this.updateRelationLabel(e,i)}deleteSelectedElements(e){let n=e.relationId!=null&&e.relationId!==""?this.deleteRelation(e.relationId):this,r=Array.from(e.tableIds).reduce((o,i)=>o.deleteTable(i),n);return Array.from(e.memoIds).reduce((o,i)=>o.deleteMemo(i),r)}updateRelationOrthogonal(e){return this.doUpdateRelationStorage(()=>this.relationViewModelStorage.updateRelationOrthogonal(e))}doUpdateRelationStorage(e){let n=e();return this.relationViewModelStorage===n?this:this.doUpdate({relationViewModelStorage:n})}updateTableViewColor(e,n,r){if(e.length===0)return this;let o=i=>new be({...i,headerColor:{background:n,foreground:r}});return this.doUpdateTableRectangle(e,o)}moveTableView(e,n,r){if(e.size===0)return this;let o=a=>new be({...a,corner:{left:a.corner.left+n.x,top:a.corner.top+n.y}}),i=this.relationViewModelStorage.moveRelation(e,n).updateRelationOrthogonal(r);return this.doUpdateTableRectangle([...e],o,i)}doUpdateTableRectangle(e,n,r=null){if(e.length===0)return this;let o=new Map(this.tableViewModelMap);return e.forEach(i=>{let a=this.tableViewModelMap.get(i);a!=null&&o.set(i,n(a))}),this.doUpdate({tableViewModelMap:o,relationViewModelStorage:r??this.relationViewModelStorage})}addMemo(e){return this.doUpdateMemoViewModel(()=>this.memoViewModelStorage.addMemo(e))}updateMemo(e){return this.doUpdateMemoViewModel(()=>this.memoViewModelStorage.updateMemo(e))}deleteMemo(e){return this.doUpdateMemoViewModel(()=>this.memoViewModelStorage.deleteMemo(e))}arrangeMemo(e,n){return this.doUpdateMemoViewModel(()=>this.memoViewModelStorage.arrangeMemo(e,n))}doUpdateMemoViewModel(e){let n=e();return n===this.memoViewModelStorage?this:this.doUpdate({memoViewModelStorage:n})}moveMemoView(e,n){if(e.size===0)return this;let r=this.memoViewModelStorage.moveMemo(e,n);return r===this.memoViewModelStorage?this:this.doUpdate({memoViewModelStorage:r})}updateDocumentName(e){return this.documentName===e?this:this.doUpdate({documentName:e})}updateErdSetting(e){return this.erdSettingModel===e?this:this.doUpdate({erdSettingModel:e})}importDdl({tableViewModels:e,columnModels:n,columnShareModels:r,relationViewModels:o}){let i=[...this.tableViewModelIds,...e.map(m=>m.tableId)],a=new Map(this.tableViewModelMap);e.forEach(m=>a.set(m.tableId,m));let s=new Map(this.columnModelMap);n.forEach(m=>s.set(m.columnModelId,m));let l=this.columnShareStorage.addColumnShare(...r),c=new dn([...this.relationViewModelStorage.getModels(),...o]);return this.doUpdate({tableViewModelIds:i,tableViewModelMap:a,columnModelMap:s,columnShareModelStorage:l,relationViewModelStorage:c})}toJSON(){let e=this.getDatabase(),n=this.tableViewModelIds.map(l=>this.tableViewModelMap.get(l)).filter(l=>l!=null).map(l=>l.toJSON()),r=Array.from(this.columnGroupModelMap.values()).sort((l,c)=>l.groupName.localeCompare(c.groupName,"en")).map(l=>l.toJSON()),o=this.getStructColumnShareModels().map(l=>l.toJSON()),i=Array.from(this.columnModelMap.values()).sort((l,c)=>l.columnModelId.localeCompare(c.columnModelId,"en")).map(l=>l.toJSON()),{frontMemos:a,backMemos:s}=this.memoViewModelStorage.getMemos();return{documentName:this.documentName,lastUpdatedAt:this.lastUpdatedAt,...e.supportsSchema&&{schemaConfig:this.schemaConfig.toJSON()},tableViewModels:n,columnGroupModels:r,...o.length>0&&{structColumnShareModels:o},columnModels:i,columnShareModels:this.columnShareStorage.getColumnShareModels().map(l=>l.toJSON()),relationViewModels:this.relationViewModelStorage.getModels().map(l=>l.toJSON()),foregroundMemos:a.map(l=>l.toJSON()),backgroundMemos:s.map(l=>l.toJSON()),erdSettingModel:this.erdSettingModel.toJSON(),databaseSetting:this.databaseSettingModel.toJSON()}}static toObject(e){S(e,"documentName"),S(e,"tableViewModels"),S(e,"columnModels"),S(e,"columnShareModels"),S(e,"relationViewModels"),S(e,"erdSettingModel"),S(e,"databaseSetting");let n=cn.toObject(e.erdSettingModel),r=Fn.toObject(e.databaseSetting),o=r.initToColumnTypeMapping(),i="schemaConfig"in e?Cr.toObject(e.schemaConfig):Cr.create(),a=j(e.tableViewModels,"tableViewModels",y=>be.toObject(y)),s="columnGroupModels"in e?j(e.columnGroupModels,"columnGroupModels",y=>sn.toObject(y)):[],l="structColumnShareModels"in e?j(e.structColumnShareModels,"structColumnShareModels",y=>ct.toObject(y)):[],c=j(e.columnModels,"columnModels",y=>ce.toObject(y)),m=j(e.columnShareModels,"columnShareModels",y=>qn.toObject(y,o)),d=j(e.relationViewModels,"relationViewModels",y=>Ne.toObject(y)),h="foregroundMemos"in e?j(e.foregroundMemos,"foregroundMemos",y=>un.toObject(y)):[],g="backgroundMemos"in e?j(e.backgroundMemos,"backgroundMemos",y=>un.toObject(y)):[],b="lastUpdatedAt"in e?Ve(e.lastUpdatedAt):new Date;return t.create({documentName:e.documentName,erdSettingModel:n,schemaConfig:i,tableViewModels:a,columnGroupModels:s,structShareModels:l,columnModels:c,columnShareModels:m,relationViewModels:d,foregroundMemoViewModels:h,backgroundMemoViewModels:g,databaseSettingModel:r,lastUpdatedAt:b})}equals(e){if(this===e)return!0;if(this.documentName!==e.documentName||this.tableViewModelIds.length!==e.tableViewModelIds.length)return!1;for(let n=0;n<this.tableViewModelIds.length;n++)if(this.tableViewModelIds[n]!==e.tableViewModelIds[n])return!1;if(this.tableViewModelMap.size!==e.tableViewModelMap.size)return!1;for(let[n,r]of this.tableViewModelMap.entries()){let o=e.tableViewModelMap.get(n);if(o==null||r.equals(o)===!1)return!1}if(this.columnGroupModelMap.size!==e.columnGroupModelMap.size)return!1;for(let[n,r]of this.columnGroupModelMap.entries()){let o=e.columnGroupModelMap.get(n);if(o==null||r.equals(o)===!1)return!1}if(this.columnModelMap.size!==e.columnModelMap.size)return!1;for(let[n,r]of this.columnModelMap.entries()){let o=e.columnModelMap.get(n);if(o==null||ce.equals(r,o)===!1)return!1}return!(this.columnShareStorage.equals(e.columnShareStorage)===!1||this.relationViewModelStorage.equals(e.relationViewModelStorage)===!1||this.memoViewModelStorage.equals(e.memoViewModelStorage)===!1||this.erdSettingModel.equals(e.erdSettingModel)===!1||this.databaseSettingModel.equals(e.databaseSettingModel)===!1||this.schemaConfig.equals(e.schemaConfig)===!1)}reuseInstancesFrom(e){let n=tf(e.tableViewModelIds,this.tableViewModelIds),r=Ho(e.tableViewModelMap,this.tableViewModelMap,(g,b)=>g.equals(b)),o=Ho(e.columnGroupModelMap,this.columnGroupModelMap,(g,b)=>g.equals(b)),i=Ho(e.columnModelMap,this.columnModelMap,(g,b)=>ce.equals(g,b)),a=this.columnShareStorage.reuseInstancesFrom(e.columnShareStorage),s=this.relationViewModelStorage.reuseInstancesFrom(e.relationViewModelStorage),l=this.memoViewModelStorage.reuseInstancesFrom(e.memoViewModelStorage),c=this.erdSettingModel.equals(e.erdSettingModel)===!0?e.erdSettingModel:this.erdSettingModel,m=this.databaseSettingModel.equals(e.databaseSettingModel)===!0?e.databaseSettingModel:this.databaseSettingModel,d=this.schemaConfig.equals(e.schemaConfig)===!0?e.schemaConfig:this.schemaConfig;return(this.documentName===e.documentName&&n===e.tableViewModelIds&&r===e.tableViewModelMap&&o===e.columnGroupModelMap&&i===e.columnModelMap&&a===e.columnShareStorage&&s===e.relationViewModelStorage&&l===e.memoViewModelStorage&&c===e.erdSettingModel&&m===e.databaseSettingModel&&d===e.schemaConfig)===!0?e:new t(this.documentName,c,m,d,n,r,o,i,a,s,l,this.lastUpdatedAt)}},bc=t=>t.flatMap(e=>e.modelType==="single"?[e.columnModelId]:[]),tf=(t,e)=>t.length!==e.length?e:e.every((r,o)=>t[o]===r)?t:e,Ho=(t,e,n)=>{let r=t.size===e.size,o=Array.from(e.entries()).map(([i,a])=>{let s=t.get(i);return s!=null&&n(s,a)?[i,s]:(r=!1,[i,a])});return r?t:new Map(o)},Sc=t=>t==="1"||t==="1..N";var vr=class{constructor(){this.uriToIdMap=new Map,this.idToBudgetMap=new Map}async create(e,n){let r=Zt.resolve(e);if(Fe.existsSync(r))throw qo(`File already exists: ${r}`);let o=Zt.dirname(r);if(Fe.existsSync(o)===!1)throw qo(`Directory does not exist: ${o}`);let i=wc(n);return Fe.writeFileSync(r,i),this.doRegister(r,n)}tryRegister(e){let n=Zt.resolve(e);return Fe.existsSync(n)===!1?null:this.register(n)}register(e){let n=Zt.resolve(e),r=Fe.readFileSync(n,"utf-8"),o=mn.toObject(JSON.parse(r));return this.doRegister(n,o).documentId}load(e){let n=Zt.resolve(e),r=Fe.readFileSync(n,"utf-8"),o=mn.toObject(JSON.parse(r));return this.doRegister(n,o),o}doRegister(e,n){let r=(0,xc.pathToFileURL)(e).href,o=gi(r);return this.uriToIdMap.set(r,o),this.idToBudgetMap.set(o,{documentId:o,fileUri:r,filePath:e,erdDocument:n}),{documentId:o,fileUri:r}}notify(e,n){let r=this.idToBudgetMap.get(e);if(r==null||r.erdDocument===n)return;let o=wc(n);Fe.writeFileSync(r.filePath,o),this.idToBudgetMap.set(e,{...r,erdDocument:n})}fetchDocuments(){return Array.from(this.idToBudgetMap.values()).map(e=>Mc(e))}findById(e){let n=this.idToBudgetMap.get(e);return n==null?null:Mc(n)}findByUri(e){let n=this.uriToIdMap.get(e);return n==null?null:this.findById(n)}},wc=t=>JSON.stringify(t.toJSON(),null,4),Mc=t=>new fn({documentId:t.documentId,uri:t.fileUri,erdDocument:t.erdDocument,rectangles:new Map});var Qe=class{constructor(){}static load(e){let n=ic(e);try{return{resultType:"loaded",erdDocument:new vr().load(n)}}catch(r){let o=r instanceof Error?r.message:String(r);return{resultType:"failed",message:`Failed to load document: ${n}
28
+ cause: ${o}`}}}};var Er=class{static find(e,n){return Zn(e).find(i=>nf(i,n))||null}},nf=(t,e)=>{let n=t.baseQuery.replace("[[PARAM]]","").toUpperCase(),r=e.timezone!==""?` ${e.timezone}`:"",o=e.precision==="max"?"(MAX)":"",i=`${e.columnType}${r}${o}`.toUpperCase();return n!==i?!1:e.precision==="max"?!0:!(e.precision!=null&&t.withPrecision===!1||e.scale!=null&&t.withScale===!1)};var Ar=(t,e,n,r)=>{if(r.withComment===!1)return"";if(r.commentStyle==="logical_name")return e!==t?e:"";let o=n!==""?`${e}${r.commentSeparator}${n}`:e;return o!==t?o:""};var yt=class{static ofDesignedColumn(e,n){let r=e.columnShare.columnType,o=rf(r,e.columnModel.autoIncrement),i=Ic(o.resolvedType,e.columnShare.precision,e.columnShare.scale,e.columnShare.isArray),a=Ar(e.physicalName,e.logicalName,e.columnShare.description,e.commentOption);return{columnName:e.physicalName,logicalName:n.withLogicalName?e.logicalName:"",typeExpression:i,unsigned:e.columnShare.unsigned,notNull:e.columnModel.notNull,defaultValue:Tc(e.columnModel.defaultValue),autoIncrement:o.autoIncrement,comment:a}}static ofDatabaseColumn(e){let n=of(e.databaseType,e.typeQuery,e.declaredExpression),r=e.autoIncrement===!0?"":Tc(e.defaultValue??"");return{columnName:e.columnName,logicalName:"",typeExpression:n,unsigned:e.unsigned,notNull:e.notNull,defaultValue:r,autoIncrement:e.autoIncrement,comment:e.comment}}},rf=(t,e)=>{let n=t.foreignColumn!=null,r=n?t.foreignColumn:t,o=e&&t.withAutoIncrement||n;return{resolvedType:r,autoIncrement:o}},of=(t,e,n)=>{let r=Er.find(t,e);return r==null?n.toUpperCase():Ic(r,String(e.precision??""),String(e.scale??""),e.isArray)},Ic=(t,e,n,r)=>t.specifiedType({precision:e,scale:n,isArray:r,inChildRelation:!1}).toUpperCase(),Tc=t=>{let e=t.trim();if(e===""||e.toUpperCase()==="NULL")return"";let n=e.replace(af,"");return sf(n).trim().toUpperCase()},af=/::([A-Za-z_][A-Za-z0-9_]*\.)?[A-Za-z_][A-Za-z0-9_ ]*(\[\])?$/,sf=t=>{let e=t.trim();return e.length>=2&&e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1).replaceAll("''","'"):e};var we=class{constructor(){}static toSchemaSnapshot(e,n){let r=e.getDatabase().databaseType,o=lf(e,n),i=cf(e,n),a=e.getTableViewModels().map(c=>df(e,c,n,i)),s=a.map(c=>c.table),l=a.flatMap(c=>c.warnings);return{databaseType:r,schemaNames:o,tables:s,warnings:l}}static toDeclaredTableSchemaNames(e){let n=e.tables.map(r=>r.schemaName).filter(r=>r!=="");return Array.from(new Set(n))}},lf=(t,e)=>{let n=t.getDatabase();if(n.supportsSchema===!1||e.withSchema===!1)return[];let r=t.schemaConfig.getSchemas().map(o=>o.schemaName);return r.length===0&&n.defaultSchemaName!==""?[n.defaultSchemaName]:r},cf=(t,e)=>{let n=new Map;return e.withForeignKey===!1||t.getRelationViewModels().forEach(r=>{let o=r.relationModel,i=uf(t,o),a=n.get(o.childTableModelId)??[];a.push(i),n.set(o.childTableModelId,a)}),n},uf=(t,e)=>{let r=t.findTableViewModel(e.parentTableModelId).tableModel,o=e.relationPairs.map(a=>Cc(t,a.childColumnModelId)),i=e.relationPairs.map(a=>Cc(t,a.parentColumnModelId));return{constraintName:"",columnNames:o,parentSchemaName:_c(t,r),parentTableName:r.physicalName,parentColumnNames:i,onUpdate:e.onUpdateAction,onDelete:e.onDeleteAction}},Cc=(t,e)=>{let n=t.findColumnModel(e),r=t.findColumnShareModel(n.columnShareModelId);return mt(n,r).physicalName},df=(t,e,n,r)=>{let o=t.getDatabase(),i=e.tableModel,a=_c(t,i),s=mf(t),l=pf(t,i,s,n),c=Ar(i.physicalName,i.logicalName,i.description,s),m=n.withLogicalName?i.logicalName:"",d=l.contexts.filter(b=>b.columnModel.primaryKey).map(b=>b.physicalName),h={schemaName:a,tableName:i.physicalName,logicalName:m,comment:c,columns:l.columns,primaryKeyColumnNames:d,uniqueKeys:gf(i,l.contexts),indexes:yf(i,l.contexts,n,o.databaseType),foreignKeys:r.get(i.tableModelId)??[]},g=l.warnings.map(b=>({...b,schemaName:a,tableName:i.physicalName}));return{table:h,warnings:g}},_c=(t,e)=>{let n=t.getDatabase();if(n.supportsSchema===!1)return"";let r=t.findSchema(e.schemaId);return r!=null?r.schemaName:n.defaultSchemaName},mf=t=>{let e=t.erdSettingModel.exportDdlSetting;return{withComment:!0,commentStyle:e.commentStyle,commentSeparator:e.commentSeparator}},pf=(t,e,n,r)=>{let o=t.toAllColumnsWithStruct(e),i=o.filter(ce.isStructColumn).length,a=i>0?[{category:"struct.skipped",schemaName:"",tableName:"",message:`${i} struct column(s) are not supported by schema verification and were excluded from comparison.`}]:[],s=o.filter(ce.isSimpleColumn).map(c=>hf(t,c));return{columns:s.map(c=>ff(c,n,r)),contexts:s,warnings:a}},hf=(t,e)=>{let n=t.findColumnShareModel(e.columnShareModelId),r=mt(e,n);return{columnModelId:e.columnModelId,columnModel:e,columnShareModel:n,physicalName:r.physicalName,logicalName:r.logicalName}},ff=(t,e,n)=>{let r={columnModel:t.columnModel,columnShare:t.columnShareModel,physicalName:t.physicalName,logicalName:t.logicalName,commentOption:e};return yt.ofDesignedColumn(r,n)},gf=(t,e)=>{let n=new Map(e.map(a=>[a.columnModelId,a.physicalName])),r=t.uniqueKeysModels.map(a=>{let s=a.uniqueKeysColumnModels.map(l=>n.get(l.columnModelId)).filter(l=>l!=null);return{constraintName:a.physicalName,columnNames:s}}),o=e.filter(a=>a.columnModel.unique).map(a=>({constraintName:"",columnNames:[a.physicalName]})),i=t.tableIndexModels.filter(a=>a.indexOption==="UNIQUE").map(a=>{let s=a.indexColumnModels.map(l=>n.get(l.columnModelId)).filter(l=>l!=null);return{constraintName:a.physicalName,columnNames:s}});return[...r,...o,...i]},yf=(t,e,n,r)=>{if(n.withIndex===!1)return[];let o=new Map(e.map(i=>[i.columnModelId,i.physicalName]));return t.tableIndexModels.filter(i=>i.indexOption!=="UNIQUE").map(i=>{let a=i.indexColumnModels.map(l=>o.get(l.columnModelId)).filter(l=>l!=null),s=bf(i.indexType,i.indexOption,r);return{indexName:i.physicalName,columnNames:a,indexOption:i.indexOption,indexType:s}})},bf=(t,e,n)=>t!==""||e==="FULLTEXT"||e==="SPATIAL"?t:Sf[n],Sf={postgres:"BTREE",mysql:"BTREE",mariadb:"BTREE",ms_sqlserver:"",sqlite:"",bigquery:"",snowflake:""};var Ft=(t,e)=>t.length===e.length&&t.every((n,r)=>n===e[r]);var Qt=class{constructor(){}static match(e,n,r){return wf(e,n,r)}},wf=(t,e,n)=>{let r=d=>n?`${d.schemaName} ${d.tableName}`:d.tableName,o=new Map(e.map(d=>[r(d),d])),i=new Map(e.map(d=>[r(d).toUpperCase(),d])),a=new Set,s=[],l=[],c=[];t.forEach(d=>{let h=r(d),g=o.get(h);if(g!=null){s.push({expected:d,actual:g}),a.add(r(g));return}let b=i.get(h.toUpperCase());if(b==null||a.has(r(b))){l.push(d);return}let y={expected:d,actual:b};s.push(y),c.push(y),a.add(r(b))});let m=e.filter(d=>a.has(r(d))===!1);return{pairs:s,missingExpected:l,unexpectedActual:m,caseFoldedPairs:c}};var pn=class{constructor(){}static compare(e,n,r){let o=Qt.match(e.tables,n.tables,r.withSchema),a=ee.get(n.databaseType).caseSensitiveColumnName,s=xf(e.schemaNames,n.schemaNames),l=o.missingExpected.map(b=>W("table.missing",b.schemaName,b.tableName,b.tableName,Pr,ve)),c=o.unexpectedActual.map(b=>W("table.unexpected",b.schemaName,b.tableName,b.tableName,ve,Pr)),m=o.pairs.map(b=>Tf(b.expected,b.actual,r,a)),d=o.caseFoldedPairs.map(b=>Mf(b)),h=[...s,...l,...c,...m.flatMap(b=>b.differences)],g=[...e.warnings,...n.warnings,...d,...m.flatMap(b=>b.warnings)];return{differences:h,warnings:g}}},Mf=t=>({category:"name.caseFolded",schemaName:t.expected.schemaName,tableName:t.expected.tableName,message:`Table name differs only in case: design="${t.expected.tableName}" database="${t.actual.tableName}".`}),xf=(t,e)=>{let n=new Set(e),r=new Set(t),o=t.filter(a=>n.has(a)===!1).map(a=>W("schema.missing",a,"",a,Pr,ve)),i=e.filter(a=>r.has(a)===!1).map(a=>W("schema.unexpected",a,"",a,ve,Pr));return[...o,...i]},Tf=(t,e,n,r)=>{let o=t.schemaName,i=t.tableName,a=n.withComment&&t.comment!==e.comment?[W("table.comment",o,i,i,Oe(t.comment),Oe(e.comment))]:[],s=If(t.columns,e.columns,n,o,i,r),l=Nf(t.primaryKeyColumnNames,e.primaryKeyColumnNames,o,i),c=vf(t.uniqueKeys,e.uniqueKeys,o,i),m=Ef(t.indexes,e.indexes,o,i),d=Af(t.foreignKeys,e.foreignKeys,o,i);return{differences:[...a,...s.differences,...l,...c,...m,...d],warnings:s.warnings}},If=(t,e,n,r,o,i)=>{let a=new Map(e.map(y=>[y.columnName,y])),s=new Map(e.map(y=>[y.columnName.toUpperCase(),y])),l=new Set,c=[],m=[],d=[];t.forEach(y=>{let N=a.get(y.columnName),M=s.get(y.columnName.toUpperCase()),R=i===!1&&N==null&&M!=null&&l.has(M.columnName)===!1?M:null,v=N??R;if(v==null){let z=Nc(y),me=W("column.missing",r,o,y.columnName,Be(z),ve);c.push(me);return}l.add(v.columnName),d.push({expectedName:y.columnName,actualName:v.columnName}),R!=null&&m.push({category:"name.caseFolded",schemaName:r,tableName:o,message:`Column name differs only in case: design="${y.columnName}" database="${v.columnName}".`}),c.push(..._f(y,v,n,r,o))}),e.filter(y=>l.has(y.columnName)===!1).forEach(y=>{let N=W("column.unexpected",r,o,y.columnName,ve,Be(Nc(y)));c.push(N)});let g=new Map(e.map((y,N)=>[y.columnName,N])),b=d.map(y=>g.get(y.actualName));if(Cf(b)===!1){let y=e.filter(N=>l.has(N.columnName)).map(N=>N.columnName);m.push({category:"column.order",schemaName:r,tableName:o,message:`Column order differs (design: ${d.map(N=>N.expectedName).join(", ")} / database: ${y.join(", ")}).`})}return{differences:c,warnings:m}},Cf=t=>t.every((e,n)=>n===0||t[n-1]<=e),Kn=t=>t.unsigned?`${t.typeExpression} UNSIGNED`:t.typeExpression,Nc=t=>{let e=Kn(t);return t.notNull?`${e} NOT NULL`:e},_f=(t,e,n,r,o)=>{let i=t.columnName,a=[];if(Kn(t)!==Kn(e)){let c=W("column.type",r,o,i,Be(Kn(t)),Be(Kn(e)));a.push(c)}if(t.notNull!==e.notNull){let c=W("column.nullability",r,o,i,Be(vc(t.notNull)),Be(vc(e.notNull)));a.push(c)}if(t.defaultValue!==e.defaultValue){let c=W("column.default",r,o,i,Oe(t.defaultValue),Oe(e.defaultValue));a.push(c)}if(t.autoIncrement!==e.autoIncrement){let c=W("column.autoIncrement",r,o,i,Pc(t.autoIncrement),Pc(e.autoIncrement));a.push(c)}let s=n.withLogicalName&&t.logicalName!==e.logicalName;if(s){let c=W("column.logicalName",r,o,i,Oe(t.logicalName),Oe(e.logicalName));a.push(c)}let l=n.commentStyle==="logical_name"&&s;if(n.withComment&&l===!1&&t.comment!==e.comment){let c=W("column.comment",r,o,i,Oe(t.comment),Oe(e.comment));a.push(c)}return a},vc=t=>t?"NOT NULL":"NULL",Nf=(t,e,n,r)=>Ft(t,e)?[]:[W("primaryKey",n,r,r,Ke(t),Ke(e))],zc=t=>t.length>0?`(${t.join(", ")})`:"",vf=(t,e,n,r)=>{let o=[...e],i=[];return t.forEach(a=>{let s=o.findIndex(m=>Ft(m.columnNames,a.columnNames));if(s>=0){o.splice(s,1);return}let l=a.constraintName!==""?o.findIndex(m=>m.constraintName===a.constraintName):-1;if(l>=0){let m=o[l];o.splice(l,1);let d=W("uniqueKey.columns",n,r,a.constraintName,Ke(a.columnNames),Ke(m.columnNames));i.push(d);return}let c=W("uniqueKey.missing",n,r,Ec(a),Ke(a.columnNames),ve);i.push(c)}),o.forEach(a=>{let s=W("uniqueKey.unexpected",n,r,Ec(a),ve,Ke(a.columnNames));i.push(s)}),i},Ec=t=>t.constraintName!==""?t.constraintName:zc(t.columnNames),Ef=(t,e,n,r)=>{let o=[...e],i=[];return t.forEach(a=>{let s=o.findIndex(d=>d.indexName.toUpperCase()===a.indexName.toUpperCase()),l=s<0?o.findIndex(d=>Ft(d.columnNames,a.columnNames)):-1,c=s>=0?s:l;if(c<0){let d=W("index.missing",n,r,a.indexName,Ke(a.columnNames),ve);i.push(d);return}let m=o[c];if(o.splice(c,1),Ft(a.columnNames,m.columnNames)===!1){let d=W("index.columns",n,r,a.indexName,Ke(a.columnNames),Ke(m.columnNames));i.push(d)}if(Rr(a)!==Rr(m)){let d=W("index.type",n,r,a.indexName,Oe(Rr(a)),Oe(Rr(m)));i.push(d)}}),o.forEach(a=>{let s=W("index.unexpected",n,r,a.indexName,ve,Ke(a.columnNames));i.push(s)}),i},Rr=t=>{let e=[t.indexOption,t.indexType].filter(n=>n!=="");return e.length>0?e.join(" "):""},Af=(t,e,n,r)=>{let o=[...e],i=[];return t.forEach(a=>{let s=o.findIndex(c=>Rf(a,c));if(s<0){let c=Xo(a),m=W("foreignKey.missing",n,r,c,Be(Ac(a)),ve);i.push(m);return}let l=o[s];if(o.splice(s,1),a.onUpdate!==l.onUpdate||a.onDelete!==l.onDelete){let c=Xo(a),m=W("foreignKey.reference",n,r,c,Be(Rc(a)),Be(Rc(l)));i.push(m)}}),o.forEach(a=>{let s=Xo(a),l=W("foreignKey.unexpected",n,r,s,ve,Be(Ac(a)));i.push(l)}),i},Rf=(t,e)=>Ft(t.columnNames,e.columnNames)&&t.parentSchemaName===e.parentSchemaName&&t.parentTableName===e.parentTableName&&Ft(t.parentColumnNames,e.parentColumnNames),Xo=t=>t.columnNames.join(", "),Ac=t=>`${t.parentSchemaName!==""?`${t.parentSchemaName}.${t.parentTableName}`:t.parentTableName} (${t.parentColumnNames.join(", ")})`,Rc=t=>`ON UPDATE ${t.onUpdate} ON DELETE ${t.onDelete}`,W=(t,e,n,r,o,i)=>({category:t,schemaName:e,tableName:n,targetName:r,expected:o,actual:i}),Be=t=>({state:"value",text:t}),Oe=t=>t!==""?{state:"value",text:t}:{state:"blank"},Ke=t=>{let e=zc(t);return Oe(e)},Pc=t=>t?{state:"value",text:"AUTO_INCREMENT"}:{state:"blank"},ve={state:"absent"},Pr={state:"present"};var hn=class{constructor(){}static format(e,n,r){let o=Pf(e.warnings);return r==="json"?{stdout:zf(e,n),stderr:o}:r==="markdown"?{stdout:qf(e,n),stderr:o}:{stdout:Of(e,n),stderr:o}}},Pf=t=>t.length===0?"":`${t.map(n=>`warn: ${n.message}`).join(`
29
29
  `)}
30
- `,vf=(t,e)=>JSON.stringify({direction:e.direction,databaseType:e.databaseType,expected:e.expectedLabel,actual:e.actualLabel,ignoredTableNames:e.ignoredTableNames,differences:t.differences,warnings:t.warnings}),$c=(t,e)=>e==="designToDatabase"?{left:t.expected,right:t.actual}:{left:t.actual,right:t.expected},Ef=(t,e)=>{let n=Af(e);if(t.differences.length===0)return`${n}
30
+ `,zf=(t,e)=>JSON.stringify({direction:e.direction,databaseType:e.databaseType,expected:e.expectedLabel,actual:e.actualLabel,ignoredTableNames:e.ignoredTableNames,differences:t.differences,warnings:t.warnings}),$c=(t,e)=>e==="designToDatabase"?{left:t.expected,right:t.actual}:{left:t.actual,right:t.expected},Of=(t,e)=>{let n=kf(e);if(t.differences.length===0)return`${n}
31
31
 
32
32
  No differences found.
33
- `;let r=Uc(e.direction),o=zf(t.differences,e.direction,r),i=Vc(t.differences,e.direction);return`${n}
33
+ `;let r=Uc(e.direction),o=Uf(t.differences,e.direction,r),i=Vc(t.differences,e.direction);return`${n}
34
34
 
35
35
  ${o}
36
36
  ${i}
37
- `},Af=t=>{let[e,n]=t.direction==="designToDatabase"?["design ","database"]:["current ","from "],r=["ERD Designer schema check",` ${e} : ${t.expectedLabel} (${t.databaseType} / ${t.expectedTableCount} tables)`,` ${n} : ${t.actualLabel}`];return t.ignoredTableNames.length>0&&r.push(` ignored : ${t.ignoredTableNames.length} tables (${t.ignoredTableNames.join(", ")})`),r.join(`
38
- `)},Uc=t=>t==="designToDatabase"?Rf:Pf,Rf={"schema.missing":"Missing schema","schema.unexpected":"Schema not in the design","table.missing":"Missing table","table.unexpected":"Table not in the design","table.comment":"Table comment mismatch","column.missing":"Missing column","column.unexpected":"Column not in the design","column.type":"Type mismatch","column.nullability":"Nullability mismatch","column.default":"Default value mismatch","column.autoIncrement":"Auto-increment mismatch","column.comment":"Column comment mismatch","column.logicalName":"Logical name mismatch",primaryKey:"Primary key mismatch","uniqueKey.missing":"Missing unique key","uniqueKey.unexpected":"Unique key not in the design","uniqueKey.columns":"Unique key columns mismatch","index.missing":"Missing index","index.unexpected":"Index not in the design","index.columns":"Index columns mismatch","index.type":"Index type mismatch","foreignKey.missing":"Missing foreign key","foreignKey.unexpected":"Foreign key not in the design","foreignKey.reference":"Foreign key reference mismatch"},Pf={"schema.missing":"Added schema","schema.unexpected":"Removed schema","table.missing":"Added table","table.unexpected":"Removed table","table.comment":"Table comment changed","column.missing":"Added column","column.unexpected":"Removed column","column.type":"Type changed","column.nullability":"Nullability changed","column.default":"Default value changed","column.autoIncrement":"Auto-increment changed","column.comment":"Comment changed","column.logicalName":"Logical name changed",primaryKey:"Primary key changed","uniqueKey.missing":"Added unique key","uniqueKey.unexpected":"Removed unique key","uniqueKey.columns":"Unique key columns changed","index.missing":"Added index","index.unexpected":"Removed index","index.columns":"Index columns changed","index.type":"Index type changed","foreignKey.missing":"Added foreign key","foreignKey.unexpected":"Removed foreign key","foreignKey.reference":"Foreign key reference changed"},zf=(t,e,n)=>{let r=t.filter(l=>ei(l.category)),o=t.filter(l=>l.category==="table.missing"),i=t.filter(l=>l.category==="table.unexpected"),a=Of(t);return[...r.map(l=>ti(l,e,n)),...a.map(l=>kf(l.tableName,l.differences,e,n)),...Oc("Missing tables",o,e,n),...Oc("Tables not in the design",i,e,n)].join(`
37
+ `},kf=t=>{let[e,n]=t.direction==="designToDatabase"?["design ","database"]:["current ","from "],r=["ERD Designer schema check",` ${e} : ${t.expectedLabel} (${t.databaseType} / ${t.expectedTableCount} tables)`,` ${n} : ${t.actualLabel}`];return t.ignoredTableNames.length>0&&r.push(` ignored : ${t.ignoredTableNames.length} tables (${t.ignoredTableNames.join(", ")})`),r.join(`
38
+ `)},Uc=t=>t==="designToDatabase"?Df:$f,Df={"schema.missing":"Missing schema","schema.unexpected":"Schema not in the design","table.missing":"Missing table","table.unexpected":"Table not in the design","table.comment":"Table comment mismatch","column.missing":"Missing column","column.unexpected":"Column not in the design","column.type":"Type mismatch","column.nullability":"Nullability mismatch","column.default":"Default value mismatch","column.autoIncrement":"Auto-increment mismatch","column.comment":"Column comment mismatch","column.logicalName":"Logical name mismatch",primaryKey:"Primary key mismatch","uniqueKey.missing":"Missing unique key","uniqueKey.unexpected":"Unique key not in the design","uniqueKey.columns":"Unique key columns mismatch","index.missing":"Missing index","index.unexpected":"Index not in the design","index.columns":"Index columns mismatch","index.type":"Index type mismatch","foreignKey.missing":"Missing foreign key","foreignKey.unexpected":"Foreign key not in the design","foreignKey.reference":"Foreign key reference mismatch"},$f={"schema.missing":"Added schema","schema.unexpected":"Removed schema","table.missing":"Added table","table.unexpected":"Removed table","table.comment":"Table comment changed","column.missing":"Added column","column.unexpected":"Removed column","column.type":"Type changed","column.nullability":"Nullability changed","column.default":"Default value changed","column.autoIncrement":"Auto-increment changed","column.comment":"Comment changed","column.logicalName":"Logical name changed",primaryKey:"Primary key changed","uniqueKey.missing":"Added unique key","uniqueKey.unexpected":"Removed unique key","uniqueKey.columns":"Unique key columns changed","index.missing":"Added index","index.unexpected":"Removed index","index.columns":"Index columns changed","index.type":"Index type changed","foreignKey.missing":"Added foreign key","foreignKey.unexpected":"Removed foreign key","foreignKey.reference":"Foreign key reference changed"},Uf=(t,e,n)=>{let r=t.filter(l=>ei(l.category)),o=t.filter(l=>l.category==="table.missing"),i=t.filter(l=>l.category==="table.unexpected"),a=Lf(t);return[...r.map(l=>ti(l,e,n)),...a.map(l=>Vf(l.tableName,l.differences,e,n)),...Oc("Missing tables",o,e,n),...Oc("Tables not in the design",i,e,n)].join(`
39
39
 
40
- `)},Of=t=>{let e=t.filter(r=>Lc(r.category)===!1&&ei(r.category)===!1);return Array.from(new Set(e.map(r=>r.tableName))).map(r=>{let o=e.filter(i=>i.tableName===r);return{tableName:r,differences:o}})},Lc=t=>t==="table.missing"||t==="table.unexpected",ei=t=>t==="schema.missing"||t==="schema.unexpected",kf=(t,e,n,r)=>{let o=e.map(i=>` ${ti(i,n,r)}`);return`${ni(t)}
40
+ `)},Lf=t=>{let e=t.filter(r=>Lc(r.category)===!1&&ei(r.category)===!1);return Array.from(new Set(e.map(r=>r.tableName))).map(r=>{let o=e.filter(i=>i.tableName===r);return{tableName:r,differences:o}})},Lc=t=>t==="table.missing"||t==="table.unexpected",ei=t=>t==="schema.missing"||t==="schema.unexpected",Vf=(t,e,n,r)=>{let o=e.map(i=>` ${ti(i,n,r)}`);return`${ni(t)}
41
41
  ${o.join(`
42
42
  `)}`},Oc=(t,e,n,r)=>{if(e.length===0)return[];let o=e.map(i=>` ${ti(i,n,r)}`);return[`${t}
43
43
  ${o.join(`
44
- `)}`]},ti=(t,e,n)=>{let r=n[t.category],{left:o,right:i}=$c(t,e),[a,s]=e==="designToDatabase"?["design","database"]:["before","after"],l=[t.targetName!==""?ni(t.targetName):null,kc(a,o),kc(s,i)].filter(c=>c!=null);return l.length>0?`${r}: ${l.join(", ")}`:r},kc=(t,e)=>e.state==="absent"||e.state==="present"?null:e.state==="blank"?`${t}=(empty)`:`${t}=${ni(e.text)}`,ni=t=>`\`${t}\``,Vc=(t,e)=>{let n=new Set(t.filter(c=>Lc(c.category)===!1&&ei(c.category)===!1).map(c=>c.tableName)).size,r=t.filter(c=>c.category==="table.unexpected").length,o=t.filter(c=>c.category==="table.missing").length,i=e==="designToDatabase"?"unexpected table":"removed table",a=e==="designToDatabase"?"missing table":"added table",s=[n>0?`${n} table(s) changed`:null,o>0?`${o} ${a}(s)`:null,r>0?`${r} ${i}(s)`:null].filter(c=>c!=null),l=s.length>0?` (${s.join(", ")})`:"";return`${t.length} differences${l}`},Df=(t,e)=>{let n=e.direction==="designToDatabase"?"### \u26A0\uFE0F Schema differences detected":"### \u{1F4D0} Schema changes",r=`\`${e.expectedLabel}\` \u2194 \`${e.actualLabel}\` (${e.databaseType})`;if(t.differences.length===0)return`${n}
44
+ `)}`]},ti=(t,e,n)=>{let r=n[t.category],{left:o,right:i}=$c(t,e),[a,s]=e==="designToDatabase"?["design","database"]:["before","after"],l=[t.targetName!==""?ni(t.targetName):null,kc(a,o),kc(s,i)].filter(c=>c!=null);return l.length>0?`${r}: ${l.join(", ")}`:r},kc=(t,e)=>e.state==="absent"||e.state==="present"?null:e.state==="blank"?`${t}=(empty)`:`${t}=${ni(e.text)}`,ni=t=>`\`${t}\``,Vc=(t,e)=>{let n=new Set(t.filter(c=>Lc(c.category)===!1&&ei(c.category)===!1).map(c=>c.tableName)).size,r=t.filter(c=>c.category==="table.unexpected").length,o=t.filter(c=>c.category==="table.missing").length,i=e==="designToDatabase"?"unexpected table":"removed table",a=e==="designToDatabase"?"missing table":"added table",s=[n>0?`${n} table(s) changed`:null,o>0?`${o} ${a}(s)`:null,r>0?`${r} ${i}(s)`:null].filter(c=>c!=null),l=s.length>0?` (${s.join(", ")})`:"";return`${t.length} differences${l}`},qf=(t,e)=>{let n=e.direction==="designToDatabase"?"### \u26A0\uFE0F Schema differences detected":"### \u{1F4D0} Schema changes",r=`\`${e.expectedLabel}\` \u2194 \`${e.actualLabel}\` (${e.databaseType})`;if(t.differences.length===0)return`${n}
45
45
 
46
46
  ${r}
47
47
 
48
48
  No differences found.
49
- `;let o=Uc(e.direction),[i,a]=e.direction==="designToDatabase"?["Design","Database"]:["Before","After"],s=["| Table | Kind | Target | "+i+" | "+a+" |","|---|---|---|---|---|"],l=t.differences.map(m=>$f(m,e.direction,o)),c=Vc(t.differences,e.direction);return[n,"",r,"",...s,...l,"",c,""].join(`
50
- `)},$f=(t,e,n)=>{let r=n[t.category],{left:o,right:i}=$c(t,e),a=t.tableName!==""?`\`${t.tableName}\``:"\u2014",s=t.targetName!==""?`\`${t.targetName}\``:"\u2014";return`| ${a} | ${r} | ${s} | ${Dc(o)} | ${Dc(i)} |`},Dc=t=>t.state==="absent"||t.state==="present"?"\u2014":t.state==="blank"?"*(empty)*":Uf(t.text),Uf=t=>{let e=t.replaceAll("|","&#124;");return e.includes("`")===!1?`\`${e}\``:`\`\` ${e} \`\``};var Lf=`erd-cli erd-diff --file <path.erd> --from <path.erd> [options]
49
+ `;let o=Uc(e.direction),[i,a]=e.direction==="designToDatabase"?["Design","Database"]:["Before","After"],s=["| Table | Kind | Target | "+i+" | "+a+" |","|---|---|---|---|---|"],l=t.differences.map(m=>Zf(m,e.direction,o)),c=Vc(t.differences,e.direction);return[n,"",r,"",...s,...l,"",c,""].join(`
50
+ `)},Zf=(t,e,n)=>{let r=n[t.category],{left:o,right:i}=$c(t,e),a=t.tableName!==""?`\`${t.tableName}\``:"\u2014",s=t.targetName!==""?`\`${t.targetName}\``:"\u2014";return`| ${a} | ${r} | ${s} | ${Dc(o)} | ${Dc(i)} |`},Dc=t=>t.state==="absent"||t.state==="present"?"\u2014":t.state==="blank"?"*(empty)*":Ff(t.text),Ff=t=>{let e=t.replaceAll("|","&#124;");return e.includes("`")===!1?`\`${e}\``:`\`\` ${e} \`\``};var Qf=`erd-cli erd-diff --file <path.erd> --from <path.erd> [options]
51
51
 
52
52
  --file <path.erd> The revision to check (usually the working tree).
53
53
  --from <path.erd> The revision to compare against.
@@ -57,12 +57,12 @@ No differences found.
57
57
  --no-comment Skip table/column comment comparison.
58
58
  --no-schema Compare by table name only, ignoring schema qualification.
59
59
  --format text|json|markdown Output format. Defaults to text.
60
- `,Vf=[{name:"--file",arity:"single"},{name:"--from",arity:"single"},...oe.OPTION_SPECS],qf=async t=>{let e=t.findValue("--file");if(e==null)return console.error("Missing required option: --file <path.erd>"),"error";let n=t.findValue("--from");if(n==null)return console.error("Missing required option: --from <path.erd>"),"error";let r=oe.toDiffFormat(t);if(r.resultType==="invalid")return console.error(r.message),"error";let o=nt.create(t.listValues("--ignore-table"));if(o.resultType==="invalid")return console.error(o.message),"error";let i=Qe.load(e);if(i.resultType==="failed")return console.error(i.message),"error";let a=Qe.load(n);if(a.resultType==="failed")return console.error(a.message),"error";let s=oe.toCompareScope(t,"designToRevision",i.erdDocument.erdSettingModel.exportDdlSetting.commentStyle),l=o.filter,c=we.toSchemaSnapshot(a.erdDocument,s),m=l.filterTables(c),d=we.toSchemaSnapshot(i.erdDocument,s),h=l.ignoredTableNames(d),g=l.filterTables(d),b=pn.compare(g,m,s),y={direction:"designToRevision",databaseType:g.databaseType,expectedLabel:e,actualLabel:n,expectedTableCount:g.tables.length,ignoredTableNames:h},N=hn.format(b,y,r.format);return console.log(N.stdout),N.stderr!==""&&console.error(N.stderr),"ok"},qc={name:"erd-diff",usage:Lf,optionSpecs:Vf,create:()=>qf};var Zf=10,Ff=30,bt=class{static{this.OPTION_SPECS=[{name:"--connect-timeout",arity:"single"},{name:"--query-timeout",arity:"single"}]}constructor(){}static toConnectionTimeouts(e){let n=Zc(e.findValue("--connect-timeout"),"--connect-timeout",Zf);if(n.resultType==="invalid")return n;let r=Zc(e.findValue("--query-timeout"),"--query-timeout",Ff);return r.resultType==="invalid"?r:{resultType:"parsed",timeouts:{connectSeconds:n.seconds,querySeconds:r.seconds}}}},Zc=(t,e,n)=>{if(t==null)return{resultType:"parsed",seconds:n};let r=Number(t);return Number.isFinite(r)===!1||r<=0?{resultType:"invalid",message:`Invalid ${e} value: ${t}. Expected a positive number of seconds.`}:{resultType:"parsed",seconds:r}};var Gc=require("node:module"),Yc=tt(require("node:path"),1),kr=tt(require("node:process"),1);var zr=class t{constructor(e){this.connection=e}async fetchSnapshot(e,n){let r=await this.fetchCurrentDatabaseName(),o=await this.fetchRawRows(r);return t.toSnapshot(o,e,n)}async fetchCurrentDatabaseName(){let n=(await this.connection.selectRows(Qf,[]))[0]?.database_name;if(n==null)throw new Error("No database selected. Include the database name in the connection URL (e.g. mysql://user@host:3306/<database>).");return String(n)}async fetchRawRows(e){let n=await this.connection.selectRows(Bf,[e]),r=await this.connection.selectRows(Kf,[e]),o=await this.connection.selectRows(Gf,[e]),i=await this.connection.selectRows(Yf,[e]),a=await this.connection.selectRows(jf,[]);return{tables:n,columns:r,indexColumns:o,foreignKeys:i,versionRows:a}}static toSnapshot(e,n,r){let o=Wf(e),i=eg(e.versionRows),a=o.map(l=>tg(l,n,r)),s=sg(n,i);return{databaseType:n,schemaNames:[],tables:a.map(l=>l.table),warnings:[...s!=null?[s]:[],...a.flatMap(l=>l.warnings)]}}},Qf="SELECT DATABASE() AS database_name",Bf=`SELECT
60
+ `,Bf=[{name:"--file",arity:"single"},{name:"--from",arity:"single"},...oe.OPTION_SPECS],Kf=async t=>{let e=t.findValue("--file");if(e==null)return console.error("Missing required option: --file <path.erd>"),"error";let n=t.findValue("--from");if(n==null)return console.error("Missing required option: --from <path.erd>"),"error";let r=oe.toDiffFormat(t);if(r.resultType==="invalid")return console.error(r.message),"error";let o=nt.create(t.listValues("--ignore-table"));if(o.resultType==="invalid")return console.error(o.message),"error";let i=Qe.load(e);if(i.resultType==="failed")return console.error(i.message),"error";let a=Qe.load(n);if(a.resultType==="failed")return console.error(a.message),"error";let s=oe.toCompareScope(t,"designToRevision",i.erdDocument.erdSettingModel.exportDdlSetting.commentStyle),l=o.filter,c=we.toSchemaSnapshot(a.erdDocument,s),m=l.filterTables(c),d=we.toSchemaSnapshot(i.erdDocument,s),h=l.ignoredTableNames(d),g=l.filterTables(d),b=pn.compare(g,m,s),y={direction:"designToRevision",databaseType:g.databaseType,expectedLabel:e,actualLabel:n,expectedTableCount:g.tables.length,ignoredTableNames:h},N=hn.format(b,y,r.format);return console.log(N.stdout),N.stderr!==""&&console.error(N.stderr),"ok"},qc={name:"erd-diff",usage:Qf,optionSpecs:Bf,create:()=>Kf};var Gf=10,Yf=30,bt=class{static{this.OPTION_SPECS=[{name:"--connect-timeout",arity:"single"},{name:"--query-timeout",arity:"single"}]}constructor(){}static toConnectionTimeouts(e){let n=Zc(e.findValue("--connect-timeout"),"--connect-timeout",Gf);if(n.resultType==="invalid")return n;let r=Zc(e.findValue("--query-timeout"),"--query-timeout",Yf);return r.resultType==="invalid"?r:{resultType:"parsed",timeouts:{connectSeconds:n.seconds,querySeconds:r.seconds}}}},Zc=(t,e,n)=>{if(t==null)return{resultType:"parsed",seconds:n};let r=Number(t);return Number.isFinite(r)===!1||r<=0?{resultType:"invalid",message:`Invalid ${e} value: ${t}. Expected a positive number of seconds.`}:{resultType:"parsed",seconds:r}};var Gc=require("node:module"),Yc=tt(require("node:path"),1),kr=tt(require("node:process"),1);var zr=class t{constructor(e){this.connection=e}async fetchSnapshot(e,n){let r=await this.fetchCurrentDatabaseName(),o=await this.fetchRawRows(r);return t.toSnapshot(o,e,n)}async fetchCurrentDatabaseName(){let n=(await this.connection.selectRows(jf,[]))[0]?.database_name;if(n==null)throw new Error("No database selected. Include the database name in the connection URL (e.g. mysql://user@host:3306/<database>).");return String(n)}async fetchRawRows(e){let n=await this.connection.selectRows(Wf,[e]),r=await this.connection.selectRows(Jf,[e]),o=await this.connection.selectRows(Hf,[e]),i=await this.connection.selectRows(Xf,[e]),a=await this.connection.selectRows(eg,[]);return{tables:n,columns:r,indexColumns:o,foreignKeys:i,versionRows:a}}static toSnapshot(e,n,r){let o=tg(e),i=ig(e.versionRows),a=o.map(l=>ag(l,n,r)),s=mg(n,i);return{databaseType:n,schemaNames:[],tables:a.map(l=>l.table),warnings:[...s!=null?[s]:[],...a.flatMap(l=>l.warnings)]}}},jf="SELECT DATABASE() AS database_name",Wf=`SELECT
61
61
  TABLE_NAME AS table_name,
62
62
  TABLE_COMMENT AS table_comment
63
63
  FROM information_schema.tables
64
64
  WHERE TABLE_SCHEMA = ? AND TABLE_TYPE = 'BASE TABLE'
65
- ORDER BY TABLE_NAME;`,Kf=`SELECT
65
+ ORDER BY TABLE_NAME;`,Jf=`SELECT
66
66
  TABLE_NAME AS table_name,
67
67
  COLUMN_NAME AS column_name,
68
68
  COLUMN_TYPE AS column_type,
@@ -72,7 +72,7 @@ ORDER BY TABLE_NAME;`,Kf=`SELECT
72
72
  COLUMN_COMMENT AS comment
73
73
  FROM information_schema.columns
74
74
  WHERE TABLE_SCHEMA = ?
75
- ORDER BY TABLE_NAME, ORDINAL_POSITION;`,Gf=`SELECT
75
+ ORDER BY TABLE_NAME, ORDINAL_POSITION;`,Hf=`SELECT
76
76
  TABLE_NAME AS table_name,
77
77
  INDEX_NAME AS index_name,
78
78
  COLUMN_NAME AS column_name,
@@ -81,7 +81,7 @@ ORDER BY TABLE_NAME, ORDINAL_POSITION;`,Gf=`SELECT
81
81
  INDEX_TYPE AS index_type
82
82
  FROM information_schema.statistics
83
83
  WHERE TABLE_SCHEMA = ?
84
- ORDER BY TABLE_NAME, INDEX_NAME, SEQ_IN_INDEX;`,Yf=`SELECT
84
+ ORDER BY TABLE_NAME, INDEX_NAME, SEQ_IN_INDEX;`,Xf=`SELECT
85
85
  kcu.TABLE_NAME AS table_name,
86
86
  kcu.CONSTRAINT_NAME AS constraint_name,
87
87
  kcu.COLUMN_NAME AS column_name,
@@ -98,10 +98,10 @@ FROM information_schema.key_column_usage kcu
98
98
  )
99
99
  WHERE kcu.TABLE_SCHEMA = ?
100
100
  AND kcu.REFERENCED_TABLE_NAME IS NOT NULL
101
- ORDER BY kcu.TABLE_NAME, kcu.CONSTRAINT_NAME, kcu.ORDINAL_POSITION;`,jf="SELECT VERSION() AS version",Wf=t=>{let e=t.tables.map(l=>({tableName:String(l.table_name),tableComment:String(l.table_comment??"")})),n=t.columns.map(l=>Jf(l)),r=t.indexColumns.map(l=>({tableName:String(l.table_name),indexName:String(l.index_name),columnName:String(l.column_name),seqInIndex:Number(l.seq_in_index),unique:Bc(l.non_unique)===!1,indexType:String(l.index_type??"")})),o=t.foreignKeys.map(l=>({tableName:String(l.table_name),constraintName:String(l.constraint_name),columnName:String(l.column_name),ordinalPosition:Number(l.ordinal_position),parentTableName:String(l.parent_table_name),parentColumnName:String(l.parent_column_name),onUpdate:String(l.on_update),onDelete:String(l.on_delete)})),i=ri(n),a=ri(r),s=ri(o);return e.map(l=>({tableName:l.tableName,tableComment:l.tableComment,columns:i.get(l.tableName)??[],indexColumnRows:a.get(l.tableName)??[],foreignKeyRows:s.get(l.tableName)??[]}))},ri=t=>{let e=new Map;return t.forEach(n=>{let r=e.get(n.tableName)??[];r.push(n),e.set(n.tableName,r)}),e},Jf=t=>{let e=String(t.extra??""),n=t.column_default==null?null:String(t.column_default),r=Hf.exec(e),o=r!=null?`ON UPDATE ${r[1]}`:"",i=[n,o].filter(l=>l!=null&&l!==""),a=i.length>0?i.join(" "):null,s=a!=null?a.replace(Xf,"CURRENT_TIMESTAMP"):null;return{tableName:String(t.table_name),columnName:String(t.column_name),columnType:String(t.column_type),isNotNull:Bc(t.not_null),columnDefault:s,extra:e,comment:String(t.comment??"")}},Hf=/on update (.+)$/i,Xf=/current_timestamp\(\)/gi,Bc=t=>t===!0||t===1||t==="1",eg=t=>String(t[0]?.version??"").toUpperCase().includes("MARIADB"),tg=(t,e,n)=>{let r=ng(t.columns,e),o=n.withForeignKey?ag(t.foreignKeyRows):[],i=lg(t.indexColumnRows,n),a={schemaName:"",tableName:t.tableName,logicalName:"",comment:t.tableComment,columns:r.columns,primaryKeyColumnNames:i.primaryKeyColumnNames,uniqueKeys:i.uniqueKeys,indexes:i.indexes,foreignKeys:o},s=[...r.warnings,...i.warnings].map(l=>({...l,tableName:t.tableName}));return{table:a,warnings:s}},ng=(t,e)=>{let n=t.map(r=>rg(r,e));return{columns:n.map(r=>r.column),warnings:n.flatMap(r=>r.warnings)}},rg=(t,e)=>{let n=og(t.columnType),r=n.zeroFill?[Fc("zeroFill.ignored",t.columnName,"ZEROFILL is not represented in .erd and was ignored.")]:[],o=n.hasIgnoredEnumValues?[Fc("enumValues.ignored",t.columnName,"ENUM/SET value lists are not compared.")]:[],i=[...r,...o],a={databaseType:e,columnName:t.columnName,typeQuery:{columnType:n.columnType,timezone:n.timezone,precision:n.precision,scale:n.scale,isArray:!1},declaredExpression:t.columnType,unsigned:n.unsigned,notNull:t.isNotNull,defaultValue:t.columnDefault,autoIncrement:t.extra.includes("auto_increment"),comment:t.comment};return{column:yt.ofDatabaseColumn(a),warnings:i}},Fc=(t,e,n)=>({category:t,schemaName:"",tableName:"",message:`Column "${e}": ${n}`}),og=t=>{let e=t.match(/ zerofill$/i),n=e!=null?t.slice(0,-e[0].length):t,r=n.match(/ unsigned$/i),o=r!=null?n.slice(0,-r[0].length):n,i=r!=null,a=e!=null,s=o.match(/^(enum|set)\(/i);if(s!=null)return{columnType:s[1].toUpperCase(),timezone:"",precision:null,scale:null,unsigned:i,zeroFill:a,hasIgnoredEnumValues:!0};let l=o.match(/\((\d+)(?:,\s*(\d+))?\)$/),c=l!=null?Number(l[1]):null,m=l!=null&&l[2]!=null?Number(l[2]):null,h=(l!=null?o.slice(0,-l[0].length):o).trim().toUpperCase();return h==="TINYINT"&&c===1&&m==null?{columnType:"BOOLEAN",timezone:"",precision:null,scale:null,unsigned:!1,zeroFill:a,hasIgnoredEnumValues:!1}:ig.has(h)?{columnType:h,timezone:"",precision:null,scale:null,unsigned:i,zeroFill:a,hasIgnoredEnumValues:!1}:{columnType:h,timezone:"",precision:c,scale:m,unsigned:i,zeroFill:a,hasIgnoredEnumValues:!1}},ig=new Set(["TINYINT","SMALLINT","MEDIUMINT","INT","INTEGER","BIGINT"]),ag=t=>{let e=new Map;return t.forEach(n=>{let r=e.get(n.constraintName)??[];r.push(n),e.set(n.constraintName,r)}),Array.from(e.entries()).map(([n,r])=>{let o=[...r].sort((a,s)=>a.ordinalPosition-s.ordinalPosition),i=o[0];return{constraintName:n,columnNames:o.map(a=>a.columnName),parentSchemaName:"",parentTableName:i.parentTableName,parentColumnNames:o.map(a=>a.parentColumnName),onUpdate:Qc(i.onUpdate),onDelete:Qc(i.onDelete)}})},Qc=t=>{let e=t.toUpperCase();return["RESTRICT","SET NULL","CASCADE","NO ACTION","SET DEFAULT"].find(o=>o===e)??"NO ACTION"},sg=(t,e)=>t==="mariadb"===e?null:{category:"databaseType.mismatch",schemaName:"",tableName:"",message:`The .erd file declares "${t}", but the connected server reports ${e?"MariaDB":"MySQL"}.`},lg=(t,e)=>{let n=new Map;t.forEach(d=>{let h=n.get(d.indexName)??[];h.push(d),n.set(d.indexName,h)});let o=[...n.get("PRIMARY")??[]].sort((d,h)=>d.seqInIndex-h.seqInIndex).map(d=>d.columnName),a=Array.from(n.keys()).filter(d=>d!=="PRIMARY").map(d=>{let h=n.get(d),g=[...h].sort((b,y)=>b.seqInIndex-y.seqInIndex).map(b=>b.columnName);return{indexName:d,columnNames:g,isUnique:h[0].unique,indexType:h[0].indexType}}),s=a.filter(d=>d.isUnique).map(d=>({constraintName:d.indexName,columnNames:d.columnNames}));if(e.withIndex===!1)return{primaryKeyColumnNames:o,uniqueKeys:s,indexes:[],warnings:[]};let l=a.filter(d=>d.isUnique===!1).map(d=>({group:d,kind:cg(d.indexName,d.indexType)})),c=l.flatMap(({group:d,kind:h})=>h.resultType!=="resolved"?[]:[{indexName:d.indexName,columnNames:d.columnNames,indexOption:h.indexOption,indexType:h.indexType}]),m=l.flatMap(({kind:d})=>d.resultType==="unsupported"?[d.warning]:[]);return{primaryKeyColumnNames:o,uniqueKeys:s,indexes:c,warnings:m}},cg=(t,e)=>{let n=e.toUpperCase();return n==="FULLTEXT"||n==="SPATIAL"?{resultType:"resolved",indexOption:n,indexType:""}:n==="BTREE"||n==="HASH"?{resultType:"resolved",indexOption:"",indexType:n}:{resultType:"unsupported",warning:{category:"index.unsupported",schemaName:"",tableName:"",message:`Index "${t}" has an unsupported index type (${e}), which .erd cannot represent; excluded from comparison.`}}};var Or=class t{constructor(e){this.connection=e}async fetchSnapshot(e,n){let r=await this.fetchRawRows(e);return t.toSnapshot(r,n)}async fetchRawRows(e){let n=await this.connection.selectRows(pg,[e]);return{tables:await this.connection.selectRows(hg,[e]),schemaNames:n}}static toSnapshot(e,n){let r=e.tables.map(a=>({schemaName:String(a.schema_name),tableName:String(a.table_name),tableComment:String(a.table_comment??""),columns:a.columns.map(ug),primaryKeyColumns:a.primary_key_columns,uniqueKeys:a.unique_keys.map(dg),indexes:a.indexes.map(mg),foreignKeys:a.foreign_keys})),o=n.withSchema?e.schemaNames.map(a=>String(a.schema_name)):[],i=r.map(a=>fg(a,n));return{databaseType:"postgres",schemaNames:o,tables:i.map(a=>a.table),warnings:i.flatMap(a=>a.warnings)}}},ug=t=>({columnName:String(t.column_name),formattedType:String(t.formatted_type),isNotNull:t.not_null===!0,isIdentity:t.is_identity===!0,defaultExpr:t.default_expr==null?null:String(t.default_expr),comment:String(t.comment??"")}),dg=t=>({constraintName:String(t.constraint_name),columns:t.columns}),mg=t=>({indexName:String(t.index_name),columns:t.columns,accessMethod:String(t.access_method),isPartial:t.is_partial===!0,isExpression:t.is_expression===!0}),pg=`SELECT nspname AS schema_name
101
+ ORDER BY kcu.TABLE_NAME, kcu.CONSTRAINT_NAME, kcu.ORDINAL_POSITION;`,eg="SELECT VERSION() AS version",tg=t=>{let e=t.tables.map(l=>({tableName:String(l.table_name),tableComment:String(l.table_comment??"")})),n=t.columns.map(l=>ng(l)),r=t.indexColumns.map(l=>({tableName:String(l.table_name),indexName:String(l.index_name),columnName:String(l.column_name),seqInIndex:Number(l.seq_in_index),unique:Bc(l.non_unique)===!1,indexType:String(l.index_type??"")})),o=t.foreignKeys.map(l=>({tableName:String(l.table_name),constraintName:String(l.constraint_name),columnName:String(l.column_name),ordinalPosition:Number(l.ordinal_position),parentTableName:String(l.parent_table_name),parentColumnName:String(l.parent_column_name),onUpdate:String(l.on_update),onDelete:String(l.on_delete)})),i=ri(n),a=ri(r),s=ri(o);return e.map(l=>({tableName:l.tableName,tableComment:l.tableComment,columns:i.get(l.tableName)??[],indexColumnRows:a.get(l.tableName)??[],foreignKeyRows:s.get(l.tableName)??[]}))},ri=t=>{let e=new Map;return t.forEach(n=>{let r=e.get(n.tableName)??[];r.push(n),e.set(n.tableName,r)}),e},ng=t=>{let e=String(t.extra??""),n=t.column_default==null?null:String(t.column_default),r=rg.exec(e),o=r!=null?`ON UPDATE ${r[1]}`:"",i=[n,o].filter(l=>l!=null&&l!==""),a=i.length>0?i.join(" "):null,s=a!=null?a.replace(og,"CURRENT_TIMESTAMP"):null;return{tableName:String(t.table_name),columnName:String(t.column_name),columnType:String(t.column_type),isNotNull:Bc(t.not_null),columnDefault:s,extra:e,comment:String(t.comment??"")}},rg=/on update (.+)$/i,og=/current_timestamp\(\)/gi,Bc=t=>t===!0||t===1||t==="1",ig=t=>String(t[0]?.version??"").toUpperCase().includes("MARIADB"),ag=(t,e,n)=>{let r=sg(t.columns,e),o=n.withForeignKey?dg(t.foreignKeyRows):[],i=pg(t.indexColumnRows,n),a={schemaName:"",tableName:t.tableName,logicalName:"",comment:t.tableComment,columns:r.columns,primaryKeyColumnNames:i.primaryKeyColumnNames,uniqueKeys:i.uniqueKeys,indexes:i.indexes,foreignKeys:o},s=[...r.warnings,...i.warnings].map(l=>({...l,tableName:t.tableName}));return{table:a,warnings:s}},sg=(t,e)=>{let n=t.map(r=>lg(r,e));return{columns:n.map(r=>r.column),warnings:n.flatMap(r=>r.warnings)}},lg=(t,e)=>{let n=cg(t.columnType),r=n.zeroFill?[Fc("zeroFill.ignored",t.columnName,"ZEROFILL is not represented in .erd and was ignored.")]:[],o=n.hasIgnoredEnumValues?[Fc("enumValues.ignored",t.columnName,"ENUM/SET value lists are not compared.")]:[],i=[...r,...o],a={databaseType:e,columnName:t.columnName,typeQuery:{columnType:n.columnType,timezone:n.timezone,precision:n.precision,scale:n.scale,isArray:!1},declaredExpression:t.columnType,unsigned:n.unsigned,notNull:t.isNotNull,defaultValue:t.columnDefault,autoIncrement:t.extra.includes("auto_increment"),comment:t.comment};return{column:yt.ofDatabaseColumn(a),warnings:i}},Fc=(t,e,n)=>({category:t,schemaName:"",tableName:"",message:`Column "${e}": ${n}`}),cg=t=>{let e=t.match(/ zerofill$/i),n=e!=null?t.slice(0,-e[0].length):t,r=n.match(/ unsigned$/i),o=r!=null?n.slice(0,-r[0].length):n,i=r!=null,a=e!=null,s=o.match(/^(enum|set)\(/i);if(s!=null)return{columnType:s[1].toUpperCase(),timezone:"",precision:null,scale:null,unsigned:i,zeroFill:a,hasIgnoredEnumValues:!0};let l=o.match(/\((\d+)(?:,\s*(\d+))?\)$/),c=l!=null?Number(l[1]):null,m=l!=null&&l[2]!=null?Number(l[2]):null,h=(l!=null?o.slice(0,-l[0].length):o).trim().toUpperCase();return h==="TINYINT"&&c===1&&m==null?{columnType:"BOOLEAN",timezone:"",precision:null,scale:null,unsigned:!1,zeroFill:a,hasIgnoredEnumValues:!1}:ug.has(h)?{columnType:h,timezone:"",precision:null,scale:null,unsigned:i,zeroFill:a,hasIgnoredEnumValues:!1}:{columnType:h,timezone:"",precision:c,scale:m,unsigned:i,zeroFill:a,hasIgnoredEnumValues:!1}},ug=new Set(["TINYINT","SMALLINT","MEDIUMINT","INT","INTEGER","BIGINT"]),dg=t=>{let e=new Map;return t.forEach(n=>{let r=e.get(n.constraintName)??[];r.push(n),e.set(n.constraintName,r)}),Array.from(e.entries()).map(([n,r])=>{let o=[...r].sort((a,s)=>a.ordinalPosition-s.ordinalPosition),i=o[0];return{constraintName:n,columnNames:o.map(a=>a.columnName),parentSchemaName:"",parentTableName:i.parentTableName,parentColumnNames:o.map(a=>a.parentColumnName),onUpdate:Qc(i.onUpdate),onDelete:Qc(i.onDelete)}})},Qc=t=>{let e=t.toUpperCase();return["RESTRICT","SET NULL","CASCADE","NO ACTION","SET DEFAULT"].find(o=>o===e)??"NO ACTION"},mg=(t,e)=>t==="mariadb"===e?null:{category:"databaseType.mismatch",schemaName:"",tableName:"",message:`The .erd file declares "${t}", but the connected server reports ${e?"MariaDB":"MySQL"}.`},pg=(t,e)=>{let n=new Map;t.forEach(d=>{let h=n.get(d.indexName)??[];h.push(d),n.set(d.indexName,h)});let o=[...n.get("PRIMARY")??[]].sort((d,h)=>d.seqInIndex-h.seqInIndex).map(d=>d.columnName),a=Array.from(n.keys()).filter(d=>d!=="PRIMARY").map(d=>{let h=n.get(d),g=[...h].sort((b,y)=>b.seqInIndex-y.seqInIndex).map(b=>b.columnName);return{indexName:d,columnNames:g,isUnique:h[0].unique,indexType:h[0].indexType}}),s=a.filter(d=>d.isUnique).map(d=>({constraintName:d.indexName,columnNames:d.columnNames}));if(e.withIndex===!1)return{primaryKeyColumnNames:o,uniqueKeys:s,indexes:[],warnings:[]};let l=a.filter(d=>d.isUnique===!1).map(d=>({group:d,kind:hg(d.indexName,d.indexType)})),c=l.flatMap(({group:d,kind:h})=>h.resultType!=="resolved"?[]:[{indexName:d.indexName,columnNames:d.columnNames,indexOption:h.indexOption,indexType:h.indexType}]),m=l.flatMap(({kind:d})=>d.resultType==="unsupported"?[d.warning]:[]);return{primaryKeyColumnNames:o,uniqueKeys:s,indexes:c,warnings:m}},hg=(t,e)=>{let n=e.toUpperCase();return n==="FULLTEXT"||n==="SPATIAL"?{resultType:"resolved",indexOption:n,indexType:""}:n==="BTREE"||n==="HASH"?{resultType:"resolved",indexOption:"",indexType:n}:{resultType:"unsupported",warning:{category:"index.unsupported",schemaName:"",tableName:"",message:`Index "${t}" has an unsupported index type (${e}), which .erd cannot represent; excluded from comparison.`}}};var Or=class t{constructor(e){this.connection=e}async fetchSnapshot(e,n){let r=await this.fetchRawRows(e);return t.toSnapshot(r,n)}async fetchRawRows(e){let n=await this.connection.selectRows(bg,[e]);return{tables:await this.connection.selectRows(Sg,[e]),schemaNames:n}}static toSnapshot(e,n){let r=e.tables.map(a=>({schemaName:String(a.schema_name),tableName:String(a.table_name),tableComment:String(a.table_comment??""),columns:a.columns.map(fg),primaryKeyColumns:a.primary_key_columns,uniqueKeys:a.unique_keys.map(gg),indexes:a.indexes.map(yg),foreignKeys:a.foreign_keys})),o=n.withSchema?e.schemaNames.map(a=>String(a.schema_name)):[],i=r.map(a=>wg(a,n));return{databaseType:"postgres",schemaNames:o,tables:i.map(a=>a.table),warnings:i.flatMap(a=>a.warnings)}}},fg=t=>({columnName:String(t.column_name),formattedType:String(t.formatted_type),isNotNull:t.not_null===!0,isIdentity:t.is_identity===!0,defaultExpr:t.default_expr==null?null:String(t.default_expr),comment:String(t.comment??"")}),gg=t=>({constraintName:String(t.constraint_name),columns:t.columns}),yg=t=>({indexName:String(t.index_name),columns:t.columns,accessMethod:String(t.access_method),isPartial:t.is_partial===!0,isExpression:t.is_expression===!0}),bg=`SELECT nspname AS schema_name
102
102
  FROM pg_namespace
103
103
  WHERE nspname = ANY($1::text[])
104
- ORDER BY nspname;`,hg=`SELECT
104
+ ORDER BY nspname;`,Sg=`SELECT
105
105
  n.nspname AS schema_name,
106
106
  c.relname AS table_name,
107
107
  COALESCE(obj_description(c.oid, 'pg_class'), '') AS table_comment,
@@ -223,18 +223,18 @@ FROM pg_class c
223
223
  JOIN pg_namespace n
224
224
  ON (n.oid = c.relnamespace)
225
225
  WHERE c.relkind = 'r' AND n.nspname = ANY($1::text[])
226
- ORDER BY n.nspname, c.relname;`,fg=(t,e)=>{let n=gg(t,e),r={schemaName:t.schemaName,tableName:t.tableName,logicalName:"",comment:t.tableComment,columns:t.columns.map(i=>Sg(i)),primaryKeyColumnNames:t.primaryKeyColumns,uniqueKeys:t.uniqueKeys.map(Tg),indexes:n.indexes,foreignKeys:e.withForeignKey?t.foreignKeys.map(Ig):[]},o=n.warnings.map(i=>({...i,schemaName:t.schemaName,tableName:t.tableName}));return{table:r,warnings:o}},gg=(t,e)=>{if(e.withIndex===!1)return{indexes:[],warnings:[]};let n=t.indexes.filter(a=>a.isPartial===!1&&a.isExpression===!1),r=t.indexes.filter(a=>a.isPartial||a.isExpression),o=n.map(a=>({indexName:a.indexName,columnNames:a.columns,indexOption:"",indexType:bg(a.accessMethod)})),i=r.map(a=>({category:"index.unsupported",schemaName:"",tableName:"",message:`Index "${a.indexName}" is a partial or expression index, which .erd cannot represent; excluded from comparison.`}));return{indexes:o,warnings:i}},yg=new Set(ee.get("postgres").tableIndexSupport.indexTypes),bg=t=>{let e=t.toUpperCase();return yg.has(e)?e:""},Sg=t=>{let e=wg(t.formattedType),n={databaseType:"postgres",columnName:t.columnName,typeQuery:e,declaredExpression:t.formattedType,unsigned:!1,notNull:t.isNotNull,defaultValue:t.defaultExpr,autoIncrement:t.isIdentity,comment:t.comment};return yt.ofDatabaseColumn(n)},wg=t=>{let e=t.endsWith("[]"),n=e?t.slice(0,-2):t,r=n.match(/ (with(?:out)? time zone)$/i),o=r!=null?r[1].toLowerCase():"",i=r!=null?n.slice(0,-r[0].length):n,a=i.match(/\((\d+)(?:,\s*(\d+))?\)$/),s=a!=null?Number(a[1]):null,l=a!=null&&a[2]!=null?Number(a[2]):null,c=a!=null?i.slice(0,-a[0].length):i;return{columnType:Mg(c.trim()),timezone:o,precision:s,scale:l,isArray:e}},Mg=t=>{let e=t.toLowerCase();return xg[e]??t.toUpperCase()},xg={"character varying":"VARCHAR",character:"CHAR",bpchar:"CHAR"},Tg=t=>({constraintName:t.constraintName,columnNames:t.columns}),Kc={a:"NO ACTION",r:"RESTRICT",c:"CASCADE",n:"SET NULL",d:"SET DEFAULT"},Ig=t=>({constraintName:t.constraint_name,columnNames:t.columns,parentSchemaName:t.parent_schema_name,parentTableName:t.parent_table_name,parentColumnNames:t.parent_columns,onUpdate:Kc[t.on_update]??"NO ACTION",onDelete:Kc[t.on_delete]??"NO ACTION"});var Cg={postgres:!0,mysql:!0,mariadb:!0,ms_sqlserver:!1,sqlite:!1,bigquery:!1,snowflake:!1},Ee=class{static supports(e){return Cg[e]}static async fetchSnapshot(e,n,r,o,i){return e==="postgres"?oi.fetchSnapshot(n,r,o,i):e==="mysql"||e==="mariadb"?ii.fetchSnapshot(n,e,o,i):{resultType:"failed",message:`Unsupported database type for db-diff: ${e}`}}static maskConnectionUrl(e){return Gn(e)}},oi=class t{static async fetchSnapshot(e,n,r,o){let i=await t.connect(e,o);if(i.resultType==="failed")return i;let a=i.connection;try{let s=vg(n);return{resultType:"fetched",snapshot:await new Or(a).fetchSnapshot(s,r)}}catch(s){let l=s instanceof Error?s.message:String(s),c=`Failed to read schema from ${Gn(e)}.
227
- cause: ${l}`;return{resultType:"failed",message:Dr(c,l,"query",o.querySeconds)}}finally{await a.close()}}static async connect(e,n){let r=jc("pg");if(r.resultType==="missing")return{resultType:"failed",message:r.message};let o=t.initClientConstructor(r.driverModule);if(o==null)return{resultType:"failed",message:"The 'pg' module does not export a usable Client constructor."};try{let i=new o(_g(e,n));return Eg(i)}catch(i){let a=i instanceof Error?i.message:String(i),s=`Failed to connect to the database.
226
+ ORDER BY n.nspname, c.relname;`,wg=(t,e)=>{let n=Mg(t,e),r={schemaName:t.schemaName,tableName:t.tableName,logicalName:"",comment:t.tableComment,columns:t.columns.map(i=>Ig(i)),primaryKeyColumnNames:t.primaryKeyColumns,uniqueKeys:t.uniqueKeys.map(vg),indexes:n.indexes,foreignKeys:e.withForeignKey?t.foreignKeys.map(Eg):[]},o=n.warnings.map(i=>({...i,schemaName:t.schemaName,tableName:t.tableName}));return{table:r,warnings:o}},Mg=(t,e)=>{if(e.withIndex===!1)return{indexes:[],warnings:[]};let n=t.indexes.filter(a=>a.isPartial===!1&&a.isExpression===!1),r=t.indexes.filter(a=>a.isPartial||a.isExpression),o=n.map(a=>({indexName:a.indexName,columnNames:a.columns,indexOption:"",indexType:Tg(a.accessMethod)})),i=r.map(a=>({category:"index.unsupported",schemaName:"",tableName:"",message:`Index "${a.indexName}" is a partial or expression index, which .erd cannot represent; excluded from comparison.`}));return{indexes:o,warnings:i}},xg=new Set(ee.get("postgres").tableIndexSupport.indexTypes),Tg=t=>{let e=t.toUpperCase();return xg.has(e)?e:""},Ig=t=>{let e=Cg(t.formattedType),n={databaseType:"postgres",columnName:t.columnName,typeQuery:e,declaredExpression:t.formattedType,unsigned:!1,notNull:t.isNotNull,defaultValue:t.defaultExpr,autoIncrement:t.isIdentity,comment:t.comment};return yt.ofDatabaseColumn(n)},Cg=t=>{let e=t.endsWith("[]"),n=e?t.slice(0,-2):t,r=n.match(/ (with(?:out)? time zone)$/i),o=r!=null?r[1].toLowerCase():"",i=r!=null?n.slice(0,-r[0].length):n,a=i.match(/\((\d+)(?:,\s*(\d+))?\)$/),s=a!=null?Number(a[1]):null,l=a!=null&&a[2]!=null?Number(a[2]):null,c=a!=null?i.slice(0,-a[0].length):i;return{columnType:_g(c.trim()),timezone:o,precision:s,scale:l,isArray:e}},_g=t=>{let e=t.toLowerCase();return Ng[e]??t.toUpperCase()},Ng={"character varying":"VARCHAR",character:"CHAR",bpchar:"CHAR"},vg=t=>({constraintName:t.constraintName,columnNames:t.columns}),Kc={a:"NO ACTION",r:"RESTRICT",c:"CASCADE",n:"SET NULL",d:"SET DEFAULT"},Eg=t=>({constraintName:t.constraint_name,columnNames:t.columns,parentSchemaName:t.parent_schema_name,parentTableName:t.parent_table_name,parentColumnNames:t.parent_columns,onUpdate:Kc[t.on_update]??"NO ACTION",onDelete:Kc[t.on_delete]??"NO ACTION"});var Ag={postgres:!0,mysql:!0,mariadb:!0,ms_sqlserver:!1,sqlite:!1,bigquery:!1,snowflake:!1},Ee=class{static supports(e){return Ag[e]}static async fetchSnapshot(e,n,r,o,i){return e==="postgres"?oi.fetchSnapshot(n,r,o,i):e==="mysql"||e==="mariadb"?ii.fetchSnapshot(n,e,o,i):{resultType:"failed",message:`Unsupported database type for db-diff: ${e}`}}static maskConnectionUrl(e){return Gn(e)}},oi=class t{static async fetchSnapshot(e,n,r,o){let i=await t.connect(e,o);if(i.resultType==="failed")return i;let a=i.connection;try{let s=zg(n);return{resultType:"fetched",snapshot:await new Or(a).fetchSnapshot(s,r)}}catch(s){let l=s instanceof Error?s.message:String(s),c=`Failed to read schema from ${Gn(e)}.
227
+ cause: ${l}`;return{resultType:"failed",message:Dr(c,l,"query",o.querySeconds)}}finally{await a.close()}}static async connect(e,n){let r=jc("pg");if(r.resultType==="missing")return{resultType:"failed",message:r.message};let o=t.initClientConstructor(r.driverModule);if(o==null)return{resultType:"failed",message:"The 'pg' module does not export a usable Client constructor."};try{let i=new o(Rg(e,n));return Og(i)}catch(i){let a=i instanceof Error?i.message:String(i),s=`Failed to connect to the database.
228
228
  target: ${Gn(e)}
229
- cause : ${a}`;return{resultType:"failed",message:Dr(s,a,"connection",n.connectSeconds)}}}static initClientConstructor(e){if(typeof e!="object"||e==null)return null;let n=e.Client;return typeof n=="function"?n:null}},_g=(t,e)=>({connectionString:t,connectionTimeoutMillis:e.connectSeconds*1e3,statement_timeout:e.querySeconds*1e3,query_timeout:e.querySeconds*1e3}),Ng=/^(pg_|information_schema$)/,vg=t=>t.schemaOption!==""?[t.schemaOption]:t.designSchemaNames.filter(e=>Ng.test(e)===!1),Eg=async t=>(await t.connect(),{resultType:"connected",connection:{selectRows:async(e,n)=>(await t.query(e,n)).rows,close:async()=>await t.end()}}),ii=class t{static async fetchSnapshot(e,n,r,o){let i=await t.connect(e,o);if(i.resultType==="failed")return i;let a=i.connection;try{return await t.applyQueryTimeout(a,n,o.querySeconds),{resultType:"fetched",snapshot:await new zr(a).fetchSnapshot(n,r)}}catch(s){let l=s instanceof Error?s.message:String(s),c=`Failed to read schema from ${Gn(e)}.
230
- cause: ${l}`;return{resultType:"failed",message:Dr(c,l,"query",o.querySeconds)}}finally{await a.close()}}static async applyQueryTimeout(e,n,r){if(n==="mariadb"){await e.selectRows("SET SESSION max_statement_time = ?",[r]);return}await e.selectRows("SET SESSION MAX_EXECUTION_TIME = ?",[r*1e3])}static async connect(e,n){let r=jc("mysql2/promise");if(r.resultType==="missing")return{resultType:"failed",message:r.message};let o=t.initModule(r.driverModule);if(o==null)return{resultType:"failed",message:"The 'mysql2' module does not export a usable createConnection()."};try{let i=await o.createConnection(Ag(e,n));return{resultType:"connected",connection:{selectRows:async(a,s)=>{let[l]=await i.query(a,s);return l},close:async()=>await i.end()}}}catch(i){let a=i instanceof Error?i.message:String(i),s=`Failed to connect to the database.
229
+ cause : ${a}`;return{resultType:"failed",message:Dr(s,a,"connection",n.connectSeconds)}}}static initClientConstructor(e){if(typeof e!="object"||e==null)return null;let n=e.Client;return typeof n=="function"?n:null}},Rg=(t,e)=>({connectionString:t,connectionTimeoutMillis:e.connectSeconds*1e3,statement_timeout:e.querySeconds*1e3,query_timeout:e.querySeconds*1e3}),Pg=/^(pg_|information_schema$)/,zg=t=>t.schemaOption!==""?[t.schemaOption]:t.designSchemaNames.filter(e=>Pg.test(e)===!1),Og=async t=>(await t.connect(),{resultType:"connected",connection:{selectRows:async(e,n)=>(await t.query(e,n)).rows,close:async()=>await t.end()}}),ii=class t{static async fetchSnapshot(e,n,r,o){let i=await t.connect(e,o);if(i.resultType==="failed")return i;let a=i.connection;try{return await t.applyQueryTimeout(a,n,o.querySeconds),{resultType:"fetched",snapshot:await new zr(a).fetchSnapshot(n,r)}}catch(s){let l=s instanceof Error?s.message:String(s),c=`Failed to read schema from ${Gn(e)}.
230
+ cause: ${l}`;return{resultType:"failed",message:Dr(c,l,"query",o.querySeconds)}}finally{await a.close()}}static async applyQueryTimeout(e,n,r){if(n==="mariadb"){await e.selectRows("SET SESSION max_statement_time = ?",[r]);return}await e.selectRows("SET SESSION MAX_EXECUTION_TIME = ?",[r*1e3])}static async connect(e,n){let r=jc("mysql2/promise");if(r.resultType==="missing")return{resultType:"failed",message:r.message};let o=t.initModule(r.driverModule);if(o==null)return{resultType:"failed",message:"The 'mysql2' module does not export a usable createConnection()."};try{let i=await o.createConnection(kg(e,n));return{resultType:"connected",connection:{selectRows:async(a,s)=>{let[l]=await i.query(a,s);return l},close:async()=>await i.end()}}}catch(i){let a=i instanceof Error?i.message:String(i),s=`Failed to connect to the database.
231
231
  target: ${Gn(e)}
232
- cause : ${a}`;return{resultType:"failed",message:Dr(s,a,"connection",n.connectSeconds)}}}static initModule(e){return typeof e!="object"||e==null?null:typeof e.createConnection=="function"?e:null}},Ag=(t,e)=>({uri:t,connectTimeout:e.connectSeconds*1e3}),Rg=/timeout|timedout/i,Dr=(t,e,n,r)=>Rg.test(e)===!1?t:`${t}
233
- hint : ${n} timed out after ${r}s.`;var jc=t=>{let e=kr.default.argv[1],n=Yc.join(kr.default.cwd(),"noop.cjs"),o=[e,n].filter(i=>i!=null&&i!=="").map(i=>Pg(i,t)).find(i=>i.resultType==="loaded");return o??{resultType:"missing",message:`Driver not found: '${t}'.
232
+ cause : ${a}`;return{resultType:"failed",message:Dr(s,a,"connection",n.connectSeconds)}}}static initModule(e){return typeof e!="object"||e==null?null:typeof e.createConnection=="function"?e:null}},kg=(t,e)=>({uri:t,connectTimeout:e.connectSeconds*1e3}),Dg=/timeout|timedout/i,Dr=(t,e,n,r)=>Dg.test(e)===!1?t:`${t}
233
+ hint : ${n} timed out after ${r}s.`;var jc=t=>{let e=kr.default.argv[1],n=Yc.join(kr.default.cwd(),"noop.cjs"),o=[e,n].filter(i=>i!=null&&i!=="").map(i=>$g(i,t)).find(i=>i.resultType==="loaded");return o??{resultType:"missing",message:`Driver not found: '${t}'.
234
234
  Could not resolve '${t}' from ${kr.default.cwd()}.
235
235
  Run one of the following:
236
236
  npm install ${t.split("/")[0]}
237
- npx @kajitiluna/erd-cli db-diff ... # drivers bundled`}},Pg=(t,e)=>{try{return{resultType:"loaded",driverModule:(0,Gc.createRequire)(t)(e)}}catch{return{resultType:"missing",message:""}}},Gn=t=>{let e=Og(t);if(e.resultType==="invalid")return"(invalid connection URL)";let n=e.dsn,r=zg(n.username,n.password),o=n.port!==""?`:${n.port}`:"";return`${n.protocol}://${r}${n.host}${o}/${n.databaseName}`},zg=(t,e)=>t===""?"":e!==""?`${t}:****@`:`${t}@`,Og=t=>{try{let e=new URL(t);return{resultType:"parsed",dsn:{protocol:e.protocol.replace(/:$/,""),username:decodeURIComponent(e.username),password:decodeURIComponent(e.password),host:e.hostname,port:e.port,databaseName:e.pathname.replace(/^\//,""),searchParams:e.searchParams}}}catch(e){return{resultType:"invalid",message:`Invalid connection URL: ${e instanceof Error?e.message:String(e)}`}}};var kg=`erd-cli db-diff --file <path.erd> [options]
237
+ npx @kajitiluna/erd-cli db-diff ... # drivers bundled`}},$g=(t,e)=>{try{return{resultType:"loaded",driverModule:(0,Gc.createRequire)(t)(e)}}catch{return{resultType:"missing",message:""}}},Gn=t=>{let e=Lg(t);if(e.resultType==="invalid")return"(invalid connection URL)";let n=e.dsn,r=Ug(n.username,n.password),o=n.port!==""?`:${n.port}`:"";return`${n.protocol}://${r}${n.host}${o}/${n.databaseName}`},Ug=(t,e)=>t===""?"":e!==""?`${t}:****@`:`${t}@`,Lg=t=>{try{let e=new URL(t);return{resultType:"parsed",dsn:{protocol:e.protocol.replace(/:$/,""),username:decodeURIComponent(e.username),password:decodeURIComponent(e.password),host:e.hostname,port:e.port,databaseName:e.pathname.replace(/^\//,""),searchParams:e.searchParams}}}catch(e){return{resultType:"invalid",message:`Invalid connection URL: ${e instanceof Error?e.message:String(e)}`}}};var Vg=`erd-cli db-diff --file <path.erd> [options]
238
238
 
239
239
  --dsn <url> Connection string. ERD_DB_URL takes precedence.
240
240
  --schema <name> Target schema (PostgreSQL only). Defaults to the schemas the .erd design uses.
@@ -246,17 +246,17 @@ ORDER BY n.nspname, c.relname;`,fg=(t,e)=>{let n=gg(t,e),r={schemaName:t.schemaN
246
246
  --format text|json|markdown Output format. Defaults to text.
247
247
  --connect-timeout <seconds> Connection timeout. Defaults to 10 seconds.
248
248
  --query-timeout <seconds> Query timeout. Defaults to 30 seconds.
249
- `,Dg=[{name:"--file",arity:"single"},{name:"--dsn",arity:"single"},{name:"--schema",arity:"single"},...oe.OPTION_SPECS,...bt.OPTION_SPECS],$g=t=>async e=>{let n=Ug(e);if(n.resultType==="error")return"error";let r=n.input,o=we.toSchemaSnapshot(r.erdDocument,r.scope),i=oe.toSnapshotTarget(e,r.databaseType,we.toDeclaredTableSchemaNames(o)),a=await t(r.databaseType,r.connectionUrl,i,r.scope,r.timeouts);if(a.resultType==="failed")return console.error(`Error: ${a.message}`),"error";let s=r.filter.ignoredTableNames(o),l=r.filter.filterTables(o),c=r.filter.filterTables(a.snapshot),m=pn.compare(l,c,r.scope),d={direction:"designToDatabase",databaseType:r.databaseType,expectedLabel:r.fileOption,actualLabel:Ee.maskConnectionUrl(r.connectionUrl),expectedTableCount:l.tables.length,ignoredTableNames:s},h=hn.format(m,d,r.format);return console.log(h.stdout),h.stderr!==""&&console.error(h.stderr),m.differences.length>0?"detected":"ok"},Ug=t=>{let e=t.findValue("--file");if(e==null)return console.error("Missing required option: --file <path.erd>"),{resultType:"error"};let n=oe.findConnectionUrl(t);if(n==null)return console.error("Missing database connection. Set ERD_DB_URL or pass --dsn <url>."),{resultType:"error"};let r=oe.toDiffFormat(t);if(r.resultType==="invalid")return console.error(r.message),{resultType:"error"};let o=nt.create(t.listValues("--ignore-table"));if(o.resultType==="invalid")return console.error(o.message),{resultType:"error"};let i=bt.toConnectionTimeouts(t);if(i.resultType==="invalid")return console.error(i.message),{resultType:"error"};let a=Qe.load(e);if(a.resultType==="failed")return console.error(a.message),{resultType:"error"};let s=a.erdDocument,l=s.getDatabase().databaseType;if(Ee.supports(l)===!1)return console.error(`Error: Unsupported database type for db-diff: ${l}`),{resultType:"error"};let c=oe.toCompareScope(t,"designToDatabase",s.erdSettingModel.exportDdlSetting.commentStyle);return{resultType:"ready",input:{fileOption:e,connectionUrl:n,format:r.format,filter:o.filter,erdDocument:s,databaseType:l,scope:c,timeouts:i.timeouts}}},Wc={name:"db-diff",usage:kg,optionSpecs:Dg,create:$g};var tu=tt(require("node:fs"),1);var Lg=new Set(["dropForeignKey","dropIndex","dropUnique","dropColumn","dropTable"]),V=class{constructor(){}static unsupported(e,n){return{kind:"unsupported",schemaName:e.schemaName,tableName:e.tableName,sql:`-- unsupported: ${n}`}}static destructive(e,n,r,o){let i=o==="emit"?r:`-- destructive: pass --allow-destructive to emit this as executable SQL
250
- -- ${r}`;return{kind:e,schemaName:n.schemaName,tableName:n.tableName,sql:i}}static isDestructive(e){return Lg.has(e.kind)}};var Bt=class{static columnAttributes(e,n,r){return Vg(e,n,r)}static defaultLiteral(e,n){return Jc(e,n)}},Vg=(t,e,n)=>{let r=t.unsigned?`${t.typeExpression}${e}`:t.typeExpression,o=t.notNull?"NOT NULL":"NULL",i=Jc(t.defaultValue,n),a=t.defaultValue!==""?` DEFAULT ${i}`:"";return`${r} ${o}${a}`},qg=new Set(["CURRENT_TIMESTAMP","TRUE","FALSE","NULL"]),Zg=/^-?\d+(\.\d+)?$/,Fg=/^CURRENT_TIMESTAMP( ON UPDATE CURRENT_TIMESTAMP)?$/,Jc=(t,e)=>qg.has(t)||Zg.test(t)||Fg.test(t)?t:`'${(e?t.replaceAll("\\","\\\\"):t).replaceAll("'","''")}'`;var Hc=(t,e)=>{let n=i=>`"${i.replaceAll('"','""')}"`,r=i=>ai(i.schemaName,i.tableName,n),o=(i,a,s)=>({kind:"comment",schemaName:i.schemaName,tableName:i.tableName,sql:`COMMENT ON COLUMN ${r(i)}.${n(a)} IS '${s.replaceAll("'","''")}';`});return{formatAddColumn:Qg(r,e,n,o),formatModifyColumn:Bg(r,e,n,o),formatDropColumn:Kg(r,t,n),formatCreateUnique:Gg(r,n),formatDropUnique:Yg(r,t,n),formatCreateIndex:jg(r,n),formatDropIndex:Wg(t,n),formatAddForeignKey:Jg(r,n),formatDropForeignKey:Hg(r,t,n),formatDropTable:Xg(r,t)}},Qg=(t,e,n,r)=>(o,i)=>{let a=Bt.columnAttributes(i,"",!1),s={kind:"addColumn",schemaName:o.schemaName,tableName:o.tableName,sql:`ALTER TABLE ${t(o)} ADD COLUMN ${n(i.columnName)} ${a};
251
- -- note: PostgreSQL appends new columns at the end; column order may not match the design.`},l=i.autoIncrement?[V.unsupported(o,"auto-increment for a new PostgreSQL column is not generated; add IDENTITY manually if needed.")]:[],c=e&&i.comment!==""?[r(o,i.columnName,i.comment)]:[];return[s,...l,...c]},Bg=(t,e,n,r)=>{let o=(i,a)=>({kind:"modifyColumn",schemaName:i.schemaName,tableName:i.tableName,sql:a});return(i,a,s)=>{let l=[];if(a.typeExpression!==s.typeExpression){let c=`ALTER TABLE ${t(i)} ALTER COLUMN ${n(a.columnName)} TYPE ${a.typeExpression} USING ${n(a.columnName)}::${a.typeExpression};`,m=o(i,c);l.push(m)}if(a.notNull!==s.notNull){let c=`ALTER TABLE ${t(i)} ALTER COLUMN ${n(a.columnName)} ${a.notNull?"SET NOT NULL":"DROP NOT NULL"};`,m=o(i,c);l.push(m)}if(a.defaultValue!==s.defaultValue){let c=a.defaultValue!==""?`SET DEFAULT ${Bt.defaultLiteral(a.defaultValue,!1)}`:"DROP DEFAULT",m=`ALTER TABLE ${t(i)} ALTER COLUMN ${n(a.columnName)} ${c};`,d=o(i,m);l.push(d)}if(a.autoIncrement!==s.autoIncrement){let m=V.unsupported(i,"changing auto-increment on an existing PostgreSQL column requires IDENTITY/sequence changes that are not generated.");l.push(m)}if(e&&a.comment!==s.comment){let c=r(i,a.columnName,a.comment);l.push(c)}return l}},Kg=(t,e,n)=>(r,o)=>{let i=`ALTER TABLE ${t(r)} DROP COLUMN ${n(o)};`;return V.destructive("dropColumn",r,i,e)},Gg=(t,e)=>(n,r)=>{let o=r.columnNames.map(e).join(", ");return{kind:"createUnique",schemaName:n.schemaName,tableName:n.tableName,sql:`ALTER TABLE ${t(n)} ADD UNIQUE (${o});`}},Yg=(t,e,n)=>(r,o)=>{if(o.constraintName==="")return V.unsupported(r,`dropping an unnamed unique constraint on (${o.columnNames.join(", ")}) requires its name, which was not available.`);let i=`ALTER TABLE ${t(r)} DROP CONSTRAINT ${n(o.constraintName)};`;return V.destructive("dropUnique",r,i,e)},jg=(t,e)=>(n,r)=>{let o=r.columnNames.map(e).join(", "),i=r.indexType!==""?` USING ${r.indexType}`:"";return{kind:"createIndex",schemaName:n.schemaName,tableName:n.tableName,sql:`CREATE INDEX ${e(r.indexName)} ON ${t(n)}${i} (${o});`}},Wg=(t,e)=>(n,r)=>{let i=`DROP INDEX ${ai(n.schemaName,r.indexName,e)};`;return V.destructive("dropIndex",n,i,t)},Jg=(t,e)=>(n,r)=>{let o=r.columnNames.map(e).join(", "),i=r.parentColumnNames.map(e).join(", "),a=ai(r.parentSchemaName,r.parentTableName,e);return{kind:"addForeignKey",schemaName:n.schemaName,tableName:n.tableName,sql:`ALTER TABLE ${t(n)}
249
+ `,qg=[{name:"--file",arity:"single"},{name:"--dsn",arity:"single"},{name:"--schema",arity:"single"},...oe.OPTION_SPECS,...bt.OPTION_SPECS],Zg=t=>async e=>{let n=Fg(e);if(n.resultType==="error")return"error";let r=n.input,o=we.toSchemaSnapshot(r.erdDocument,r.scope),i=oe.toSnapshotTarget(e,r.databaseType,we.toDeclaredTableSchemaNames(o)),a=await t(r.databaseType,r.connectionUrl,i,r.scope,r.timeouts);if(a.resultType==="failed")return console.error(`Error: ${a.message}`),"error";let s=r.filter.ignoredTableNames(o),l=r.filter.filterTables(o),c=r.filter.filterTables(a.snapshot),m=pn.compare(l,c,r.scope),d={direction:"designToDatabase",databaseType:r.databaseType,expectedLabel:r.fileOption,actualLabel:Ee.maskConnectionUrl(r.connectionUrl),expectedTableCount:l.tables.length,ignoredTableNames:s},h=hn.format(m,d,r.format);return console.log(h.stdout),h.stderr!==""&&console.error(h.stderr),m.differences.length>0?"detected":"ok"},Fg=t=>{let e=t.findValue("--file");if(e==null)return console.error("Missing required option: --file <path.erd>"),{resultType:"error"};let n=oe.findConnectionUrl(t);if(n==null)return console.error("Missing database connection. Set ERD_DB_URL or pass --dsn <url>."),{resultType:"error"};let r=oe.toDiffFormat(t);if(r.resultType==="invalid")return console.error(r.message),{resultType:"error"};let o=nt.create(t.listValues("--ignore-table"));if(o.resultType==="invalid")return console.error(o.message),{resultType:"error"};let i=bt.toConnectionTimeouts(t);if(i.resultType==="invalid")return console.error(i.message),{resultType:"error"};let a=Qe.load(e);if(a.resultType==="failed")return console.error(a.message),{resultType:"error"};let s=a.erdDocument,l=s.getDatabase().databaseType;if(Ee.supports(l)===!1)return console.error(`Error: Unsupported database type for db-diff: ${l}`),{resultType:"error"};let c=oe.toCompareScope(t,"designToDatabase",s.erdSettingModel.exportDdlSetting.commentStyle);return{resultType:"ready",input:{fileOption:e,connectionUrl:n,format:r.format,filter:o.filter,erdDocument:s,databaseType:l,scope:c,timeouts:i.timeouts}}},Wc={name:"db-diff",usage:Vg,optionSpecs:qg,create:Zg};var tu=tt(require("node:fs"),1);var Qg=new Set(["dropForeignKey","dropIndex","dropUnique","dropColumn","dropTable"]),V=class{constructor(){}static unsupported(e,n){return{kind:"unsupported",schemaName:e.schemaName,tableName:e.tableName,sql:`-- unsupported: ${n}`}}static destructive(e,n,r,o){let i=o==="emit"?r:`-- destructive: pass --allow-destructive to emit this as executable SQL
250
+ -- ${r}`;return{kind:e,schemaName:n.schemaName,tableName:n.tableName,sql:i}}static isDestructive(e){return Qg.has(e.kind)}};var Bt=class{static columnAttributes(e,n,r){return Bg(e,n,r)}static defaultLiteral(e,n){return Jc(e,n)}},Bg=(t,e,n)=>{let r=t.unsigned?`${t.typeExpression}${e}`:t.typeExpression,o=t.notNull?"NOT NULL":"NULL",i=Jc(t.defaultValue,n),a=t.defaultValue!==""?` DEFAULT ${i}`:"";return`${r} ${o}${a}`},Kg=new Set(["CURRENT_TIMESTAMP","TRUE","FALSE","NULL"]),Gg=/^-?\d+(\.\d+)?$/,Yg=/^CURRENT_TIMESTAMP( ON UPDATE CURRENT_TIMESTAMP)?$/,Jc=(t,e)=>Kg.has(t)||Gg.test(t)||Yg.test(t)?t:`'${(e?t.replaceAll("\\","\\\\"):t).replaceAll("'","''")}'`;var Hc=(t,e)=>{let n=i=>`"${i.replaceAll('"','""')}"`,r=i=>ai(i.schemaName,i.tableName,n),o=(i,a,s)=>({kind:"comment",schemaName:i.schemaName,tableName:i.tableName,sql:`COMMENT ON COLUMN ${r(i)}.${n(a)} IS '${s.replaceAll("'","''")}';`});return{formatAddColumn:jg(r,e,n,o),formatModifyColumn:Wg(r,e,n,o),formatDropColumn:Jg(r,t,n),formatCreateUnique:Hg(r,n),formatDropUnique:Xg(r,t,n),formatCreateIndex:ey(r,n),formatDropIndex:ty(t,n),formatAddForeignKey:ny(r,n),formatDropForeignKey:ry(r,t,n),formatDropTable:oy(r,t)}},jg=(t,e,n,r)=>(o,i)=>{let a=Bt.columnAttributes(i,"",!1),s={kind:"addColumn",schemaName:o.schemaName,tableName:o.tableName,sql:`ALTER TABLE ${t(o)} ADD COLUMN ${n(i.columnName)} ${a};
251
+ -- note: PostgreSQL appends new columns at the end; column order may not match the design.`},l=i.autoIncrement?[V.unsupported(o,"auto-increment for a new PostgreSQL column is not generated; add IDENTITY manually if needed.")]:[],c=e&&i.comment!==""?[r(o,i.columnName,i.comment)]:[];return[s,...l,...c]},Wg=(t,e,n,r)=>{let o=(i,a)=>({kind:"modifyColumn",schemaName:i.schemaName,tableName:i.tableName,sql:a});return(i,a,s)=>{let l=[];if(a.typeExpression!==s.typeExpression){let c=`ALTER TABLE ${t(i)} ALTER COLUMN ${n(a.columnName)} TYPE ${a.typeExpression} USING ${n(a.columnName)}::${a.typeExpression};`,m=o(i,c);l.push(m)}if(a.notNull!==s.notNull){let c=`ALTER TABLE ${t(i)} ALTER COLUMN ${n(a.columnName)} ${a.notNull?"SET NOT NULL":"DROP NOT NULL"};`,m=o(i,c);l.push(m)}if(a.defaultValue!==s.defaultValue){let c=a.defaultValue!==""?`SET DEFAULT ${Bt.defaultLiteral(a.defaultValue,!1)}`:"DROP DEFAULT",m=`ALTER TABLE ${t(i)} ALTER COLUMN ${n(a.columnName)} ${c};`,d=o(i,m);l.push(d)}if(a.autoIncrement!==s.autoIncrement){let m=V.unsupported(i,"changing auto-increment on an existing PostgreSQL column requires IDENTITY/sequence changes that are not generated.");l.push(m)}if(e&&a.comment!==s.comment){let c=r(i,a.columnName,a.comment);l.push(c)}return l}},Jg=(t,e,n)=>(r,o)=>{let i=`ALTER TABLE ${t(r)} DROP COLUMN ${n(o)};`;return V.destructive("dropColumn",r,i,e)},Hg=(t,e)=>(n,r)=>{let o=r.columnNames.map(e).join(", ");return{kind:"createUnique",schemaName:n.schemaName,tableName:n.tableName,sql:`ALTER TABLE ${t(n)} ADD UNIQUE (${o});`}},Xg=(t,e,n)=>(r,o)=>{if(o.constraintName==="")return V.unsupported(r,`dropping an unnamed unique constraint on (${o.columnNames.join(", ")}) requires its name, which was not available.`);let i=`ALTER TABLE ${t(r)} DROP CONSTRAINT ${n(o.constraintName)};`;return V.destructive("dropUnique",r,i,e)},ey=(t,e)=>(n,r)=>{let o=r.columnNames.map(e).join(", "),i=r.indexType!==""?` USING ${r.indexType}`:"";return{kind:"createIndex",schemaName:n.schemaName,tableName:n.tableName,sql:`CREATE INDEX ${e(r.indexName)} ON ${t(n)}${i} (${o});`}},ty=(t,e)=>(n,r)=>{let i=`DROP INDEX ${ai(n.schemaName,r.indexName,e)};`;return V.destructive("dropIndex",n,i,t)},ny=(t,e)=>(n,r)=>{let o=r.columnNames.map(e).join(", "),i=r.parentColumnNames.map(e).join(", "),a=ai(r.parentSchemaName,r.parentTableName,e);return{kind:"addForeignKey",schemaName:n.schemaName,tableName:n.tableName,sql:`ALTER TABLE ${t(n)}
252
252
  ADD FOREIGN KEY (${o})
253
253
  REFERENCES ${a} (${i})
254
254
  ON UPDATE ${r.onUpdate}
255
- ON DELETE ${r.onDelete};`}},Hg=(t,e,n)=>(r,o)=>{if(o.constraintName===""){let a=`dropping an unnamed foreign key on (${o.columnNames.join(", ")}) requires its name, which was not available.`;return V.unsupported(r,a)}let i=`ALTER TABLE ${t(r)} DROP CONSTRAINT ${n(o.constraintName)};`;return V.destructive("dropForeignKey",r,i,e)},Xg=(t,e)=>n=>{let r=`DROP TABLE ${t(n)};`;return V.destructive("dropTable",n,r,e)},ai=(t,e,n)=>t!==""?`${n(t)}.${n(e)}`:n(e);var si=(t,e)=>{let n=i=>`\`${i.replaceAll("`","``")}\``,r=i=>n(i.tableName),o=(i,a)=>{let s=Bt.columnAttributes(i," UNSIGNED",!0),l=i.autoIncrement?" AUTO_INCREMENT":"",c=a!==""?` COMMENT '${a.replaceAll("'","''")}'`:"";return`${s}${l}${c}`};return{formatAddColumn:ey(r,e,n,o),formatModifyColumn:ty(r,e,n,o),formatDropColumn:ny(r,t,n),formatCreateUnique:ry(r,n),formatDropUnique:oy(r,t,n),formatCreateIndex:iy(r,n),formatDropIndex:ay(r,t,n),formatAddForeignKey:sy(r,n),formatDropForeignKey:ly(r,t,n),formatDropTable:cy(r,t)}},ey=(t,e,n,r)=>(o,i,a)=>{let s=a!=null?` AFTER ${n(a)}`:" FIRST",l=e?i.comment:"",c=`ALTER TABLE ${t(o)} ADD COLUMN ${n(i.columnName)} ${r(i,l)}${s};`;return[{kind:"addColumn",schemaName:o.schemaName,tableName:o.tableName,sql:c}]},ty=(t,e,n,r)=>(o,i,a)=>{let s=e?i.comment:a.comment,l=`ALTER TABLE ${t(o)} MODIFY COLUMN ${n(i.columnName)} ${r(i,s)};`;return[{kind:"modifyColumn",schemaName:o.schemaName,tableName:o.tableName,sql:l}]},ny=(t,e,n)=>(r,o)=>{let i=`ALTER TABLE ${t(r)} DROP COLUMN ${n(o)};`;return V.destructive("dropColumn",r,i,e)},ry=(t,e)=>(n,r)=>{let o=r.columnNames.map(e).join(", "),i=`ALTER TABLE ${t(n)} ADD UNIQUE (${o});`;return{kind:"createUnique",schemaName:n.schemaName,tableName:n.tableName,sql:i}},oy=(t,e,n)=>(r,o)=>{if(o.constraintName===""){let a=`dropping an unnamed unique key on (${o.columnNames.join(", ")}) requires its name, which was not available.`;return V.unsupported(r,a)}let i=`ALTER TABLE ${t(r)} DROP INDEX ${n(o.constraintName)};`;return V.destructive("dropUnique",r,i,e)},iy=(t,e)=>(n,r)=>{let o=r.columnNames.map(e).join(", "),i=r.indexType!==""?` USING ${r.indexType}`:"",s=`${uy(r.indexOption)} ${e(r.indexName)}${i} ON ${t(n)} (${o});`;return{kind:"createIndex",schemaName:n.schemaName,tableName:n.tableName,sql:s}},ay=(t,e,n)=>(r,o)=>{let i=`ALTER TABLE ${t(r)} DROP INDEX ${n(o.indexName)};`;return V.destructive("dropIndex",r,i,e)},sy=(t,e)=>(n,r)=>{let o=r.columnNames.map(e).join(", "),i=r.parentColumnNames.map(e).join(", "),a=`ALTER TABLE ${t(n)}
255
+ ON DELETE ${r.onDelete};`}},ry=(t,e,n)=>(r,o)=>{if(o.constraintName===""){let a=`dropping an unnamed foreign key on (${o.columnNames.join(", ")}) requires its name, which was not available.`;return V.unsupported(r,a)}let i=`ALTER TABLE ${t(r)} DROP CONSTRAINT ${n(o.constraintName)};`;return V.destructive("dropForeignKey",r,i,e)},oy=(t,e)=>n=>{let r=`DROP TABLE ${t(n)};`;return V.destructive("dropTable",n,r,e)},ai=(t,e,n)=>t!==""?`${n(t)}.${n(e)}`:n(e);var si=(t,e)=>{let n=i=>`\`${i.replaceAll("`","``")}\``,r=i=>n(i.tableName),o=(i,a)=>{let s=Bt.columnAttributes(i," UNSIGNED",!0),l=i.autoIncrement?" AUTO_INCREMENT":"",c=a!==""?` COMMENT '${a.replaceAll("'","''")}'`:"";return`${s}${l}${c}`};return{formatAddColumn:iy(r,e,n,o),formatModifyColumn:ay(r,e,n,o),formatDropColumn:sy(r,t,n),formatCreateUnique:ly(r,n),formatDropUnique:cy(r,t,n),formatCreateIndex:uy(r,n),formatDropIndex:dy(r,t,n),formatAddForeignKey:my(r,n),formatDropForeignKey:py(r,t,n),formatDropTable:hy(r,t)}},iy=(t,e,n,r)=>(o,i,a)=>{let s=a!=null?` AFTER ${n(a)}`:" FIRST",l=e?i.comment:"",c=`ALTER TABLE ${t(o)} ADD COLUMN ${n(i.columnName)} ${r(i,l)}${s};`;return[{kind:"addColumn",schemaName:o.schemaName,tableName:o.tableName,sql:c}]},ay=(t,e,n,r)=>(o,i,a)=>{let s=e?i.comment:a.comment,l=`ALTER TABLE ${t(o)} MODIFY COLUMN ${n(i.columnName)} ${r(i,s)};`;return[{kind:"modifyColumn",schemaName:o.schemaName,tableName:o.tableName,sql:l}]},sy=(t,e,n)=>(r,o)=>{let i=`ALTER TABLE ${t(r)} DROP COLUMN ${n(o)};`;return V.destructive("dropColumn",r,i,e)},ly=(t,e)=>(n,r)=>{let o=r.columnNames.map(e).join(", "),i=`ALTER TABLE ${t(n)} ADD UNIQUE (${o});`;return{kind:"createUnique",schemaName:n.schemaName,tableName:n.tableName,sql:i}},cy=(t,e,n)=>(r,o)=>{if(o.constraintName===""){let a=`dropping an unnamed unique key on (${o.columnNames.join(", ")}) requires its name, which was not available.`;return V.unsupported(r,a)}let i=`ALTER TABLE ${t(r)} DROP INDEX ${n(o.constraintName)};`;return V.destructive("dropUnique",r,i,e)},uy=(t,e)=>(n,r)=>{let o=r.columnNames.map(e).join(", "),i=r.indexType!==""?` USING ${r.indexType}`:"",s=`${fy(r.indexOption)} ${e(r.indexName)}${i} ON ${t(n)} (${o});`;return{kind:"createIndex",schemaName:n.schemaName,tableName:n.tableName,sql:s}},dy=(t,e,n)=>(r,o)=>{let i=`ALTER TABLE ${t(r)} DROP INDEX ${n(o.indexName)};`;return V.destructive("dropIndex",r,i,e)},my=(t,e)=>(n,r)=>{let o=r.columnNames.map(e).join(", "),i=r.parentColumnNames.map(e).join(", "),a=`ALTER TABLE ${t(n)}
256
256
  ADD FOREIGN KEY (${o})
257
257
  REFERENCES ${e(r.parentTableName)} (${i})
258
258
  ON UPDATE ${r.onUpdate}
259
- ON DELETE ${r.onDelete};`;return{kind:"addForeignKey",schemaName:n.schemaName,tableName:n.tableName,sql:a}},ly=(t,e,n)=>(r,o)=>{if(o.constraintName===""){let a=`dropping an unnamed foreign key on (${o.columnNames.join(", ")}) requires its name, which was not available.`;return V.unsupported(r,a)}let i=`ALTER TABLE ${t(r)} DROP FOREIGN KEY ${n(o.constraintName)};`;return V.destructive("dropForeignKey",r,i,e)},cy=(t,e)=>n=>{let r=`DROP TABLE ${t(n)};`;return V.destructive("dropTable",n,r,e)},uy=t=>t==="FULLTEXT"?"CREATE FULLTEXT INDEX":t==="SPATIAL"?"CREATE SPATIAL INDEX":"CREATE INDEX";var Yn=class{constructor(){}static findDialect(e,n,r){let o=dy[e];return o==null?null:o(n,r)}},dy={postgres:Hc,mysql:si,mariadb:si,ms_sqlserver:null,sqlite:null,bigquery:null,snowflake:null};var jn=class{constructor(){}static toStatements({expectedTable:e,actualTable:n,dialect:r,withComment:o,isCaseSensitive:i}){return my(e,n,r,o,i)}},my=(t,e,n,r,o)=>{let i=new Map(e.columns.map(y=>[y.columnName,y])),a=new Map(e.columns.map(y=>[y.columnName.toUpperCase(),y])),s=new Map(t.columns.map(y=>[y.columnName,y])),l=new Map(t.columns.map(y=>[y.columnName.toUpperCase(),y])),c=y=>{let N=i.get(y);return N!=null||o===!0?N:a.get(y.toUpperCase())},m=y=>s.has(y)?!0:o===!1&&l.has(y.toUpperCase()),d=t.columns.map(y=>c(y.columnName)!=null||Xc(y)),h=t.columns.flatMap((y,N)=>{let M=c(y.columnName);if(M==null){let v=hy(t.columns,d,N);return fy(t,y,v,n)}return y.typeExpression===M.typeExpression&&y.unsigned===M.unsigned&&y.notNull===M.notNull&&y.defaultValue===M.defaultValue&&y.autoIncrement===M.autoIncrement&&(r===!1||y.comment===M.comment)?[]:n.formatModifyColumn(t,y,M)}),g=e.columns.filter(y=>m(y.columnName)===!1).map(y=>n.formatDropColumn(e,y.columnName)),b=py(t,e,o);return{additive:[...h,...b],destructive:g}},py=(t,e,n)=>{if(n===!0)return[];let r=new Map(e.columns.map(o=>[o.columnName.toUpperCase(),o]));return t.columns.flatMap(o=>{let i=r.get(o.columnName.toUpperCase());if(i==null||i.columnName===o.columnName)return[];let a=`Column name differs only in case: design="${o.columnName}", database="${i.columnName}". Treated as the same column; review the naming difference manually.`;return[V.unsupported(e,a)]})},Xc=t=>(t.notNull&&t.defaultValue===""&&t.autoIncrement===!1)===!1,hy=(t,e,n)=>{let r=t.slice(0,n).filter((o,i)=>e[i]);return r.length>0?r[r.length-1].columnName:null},fy=(t,e,n,r)=>{if(Xc(e)===!1){let o=`adding NOT NULL column "${e.columnName}" without a DEFAULT depends on existing row values, so it is not generated.`;return[V.unsupported(t,o)]}return r.formatAddColumn(t,e,n)};var Wn=class{constructor(){}static toStatements(e){return gy(e)}},gy=({expectedTable:t,actualTable:e,dialect:n,withComment:r,isCaseSensitiveColumnName:o})=>{let i=jn.toStatements({expectedTable:t,actualTable:e,dialect:n,withComment:r,isCaseSensitive:o}),a=yy(t,e,n),s=by(t,e,n),l=Sy(t,e,n),c=[...i.additive,...a.additive,...s.additive,...l.additive],m=[...l.destructive,...s.destructive,...a.destructive,...i.destructive];return{additive:c,destructive:m}},yy=(t,e,n)=>{let r=i=>JSON.stringify(i.columnNames),o=li(t.uniqueKeys,e.uniqueKeys,r);return{additive:o.missing.map(i=>n.formatCreateUnique(t,i)),destructive:o.unexpected.map(i=>n.formatDropUnique(e,i))}},by=(t,e,n)=>{let r=i=>JSON.stringify([i.columnNames,i.indexOption,i.indexType]),o=li(t.indexes,e.indexes,r);return{additive:o.missing.map(i=>n.formatCreateIndex(t,i)),destructive:o.unexpected.map(i=>n.formatDropIndex(e,i))}},Sy=(t,e,n)=>{let r=i=>{let a=[i.columnNames,i.parentSchemaName,i.parentTableName,i.parentColumnNames,i.onUpdate,i.onDelete];return JSON.stringify(a)},o=li(t.foreignKeys,e.foreignKeys,r);return{additive:o.missing.map(i=>n.formatAddForeignKey(t,i)),destructive:o.unexpected.map(i=>n.formatDropForeignKey(e,i))}},li=(t,e,n)=>{let r=eu(e,n),o=t.filter(s=>{let l=n(s),c=r.get(l)??0;return c===0?!0:(r.set(l,c-1),!1)}),i=eu(t,n),a=e.filter(s=>{let l=n(s),c=i.get(l)??0;return c===0?!0:(i.set(l,c-1),!1)});return{missing:o,unexpected:a}},eu=(t,e)=>{let n=new Map;return t.forEach(r=>{let o=e(r);n.set(o,(n.get(o)??0)+1)}),n};var Jn=class{constructor(){}static build(e){let{databaseType:n,destructivePolicy:r,withComment:o}=e,i=Yn.findDialect(n,r,o);return i==null?{statements:[wy(n)],unsupportedCount:1,destructiveCount:0}:My(i,e)}},wy=t=>({kind:"unsupported",schemaName:"",tableName:"",sql:`-- unsupported: migrate-ddl has no dialect implemented for database type "${t}".`}),My=(t,e)=>{let{expected:n,actual:r,withComment:o,databaseType:i}=e,s=ee.get(i).caseSensitiveColumnName,l=Qt.match(n.tables,r.tables,!0),c=l.pairs.map(N=>Wn.toStatements({expectedTable:N.expected,actualTable:N.actual,dialect:t,withComment:o,isCaseSensitiveColumnName:s})),m=c.flatMap(N=>N.additive),d=c.flatMap(N=>N.destructive),h=l.missingExpected.map(N=>xy(N)),g=l.unexpectedActual.map(N=>t.formatDropTable(N)),b=l.caseFoldedPairs.map(N=>Ty(N)),y=[...m,...h,...b,...d,...g];return{statements:y,unsupportedCount:y.filter(N=>N.kind==="unsupported").length,destructiveCount:y.filter(N=>V.isDestructive(N)).length}},xy=t=>{let e=`Table "${t.tableName}" does not exist. Run 'export-ddl' to generate its CREATE TABLE statement.`;return V.unsupported(t,e)},Ty=t=>{let e=`Table name differs only in case: design="${t.expected.tableName}" database="${t.actual.tableName}". Treated as the same table; review the naming difference manually.`;return V.unsupported(t.actual,e)};var Iy=`erd-cli migrate-ddl --file <path.erd> [options]
259
+ ON DELETE ${r.onDelete};`;return{kind:"addForeignKey",schemaName:n.schemaName,tableName:n.tableName,sql:a}},py=(t,e,n)=>(r,o)=>{if(o.constraintName===""){let a=`dropping an unnamed foreign key on (${o.columnNames.join(", ")}) requires its name, which was not available.`;return V.unsupported(r,a)}let i=`ALTER TABLE ${t(r)} DROP FOREIGN KEY ${n(o.constraintName)};`;return V.destructive("dropForeignKey",r,i,e)},hy=(t,e)=>n=>{let r=`DROP TABLE ${t(n)};`;return V.destructive("dropTable",n,r,e)},fy=t=>t==="FULLTEXT"?"CREATE FULLTEXT INDEX":t==="SPATIAL"?"CREATE SPATIAL INDEX":"CREATE INDEX";var Yn=class{constructor(){}static findDialect(e,n,r){let o=gy[e];return o==null?null:o(n,r)}},gy={postgres:Hc,mysql:si,mariadb:si,ms_sqlserver:null,sqlite:null,bigquery:null,snowflake:null};var jn=class{constructor(){}static toStatements({expectedTable:e,actualTable:n,dialect:r,withComment:o,isCaseSensitive:i}){return yy(e,n,r,o,i)}},yy=(t,e,n,r,o)=>{let i=new Map(e.columns.map(y=>[y.columnName,y])),a=new Map(e.columns.map(y=>[y.columnName.toUpperCase(),y])),s=new Map(t.columns.map(y=>[y.columnName,y])),l=new Map(t.columns.map(y=>[y.columnName.toUpperCase(),y])),c=y=>{let N=i.get(y);return N!=null||o===!0?N:a.get(y.toUpperCase())},m=y=>s.has(y)?!0:o===!1&&l.has(y.toUpperCase()),d=t.columns.map(y=>c(y.columnName)!=null||Xc(y)),h=t.columns.flatMap((y,N)=>{let M=c(y.columnName);if(M==null){let v=Sy(t.columns,d,N);return wy(t,y,v,n)}return y.typeExpression===M.typeExpression&&y.unsigned===M.unsigned&&y.notNull===M.notNull&&y.defaultValue===M.defaultValue&&y.autoIncrement===M.autoIncrement&&(r===!1||y.comment===M.comment)?[]:n.formatModifyColumn(t,y,M)}),g=e.columns.filter(y=>m(y.columnName)===!1).map(y=>n.formatDropColumn(e,y.columnName)),b=by(t,e,o);return{additive:[...h,...b],destructive:g}},by=(t,e,n)=>{if(n===!0)return[];let r=new Map(e.columns.map(o=>[o.columnName.toUpperCase(),o]));return t.columns.flatMap(o=>{let i=r.get(o.columnName.toUpperCase());if(i==null||i.columnName===o.columnName)return[];let a=`Column name differs only in case: design="${o.columnName}", database="${i.columnName}". Treated as the same column; review the naming difference manually.`;return[V.unsupported(e,a)]})},Xc=t=>(t.notNull&&t.defaultValue===""&&t.autoIncrement===!1)===!1,Sy=(t,e,n)=>{let r=t.slice(0,n).filter((o,i)=>e[i]);return r.length>0?r[r.length-1].columnName:null},wy=(t,e,n,r)=>{if(Xc(e)===!1){let o=`adding NOT NULL column "${e.columnName}" without a DEFAULT depends on existing row values, so it is not generated.`;return[V.unsupported(t,o)]}return r.formatAddColumn(t,e,n)};var Wn=class{constructor(){}static toStatements(e){return My(e)}},My=({expectedTable:t,actualTable:e,dialect:n,withComment:r,isCaseSensitiveColumnName:o})=>{let i=jn.toStatements({expectedTable:t,actualTable:e,dialect:n,withComment:r,isCaseSensitive:o}),a=xy(t,e,n),s=Ty(t,e,n),l=Iy(t,e,n),c=[...i.additive,...a.additive,...s.additive,...l.additive],m=[...l.destructive,...s.destructive,...a.destructive,...i.destructive];return{additive:c,destructive:m}},xy=(t,e,n)=>{let r=i=>JSON.stringify(i.columnNames),o=li(t.uniqueKeys,e.uniqueKeys,r);return{additive:o.missing.map(i=>n.formatCreateUnique(t,i)),destructive:o.unexpected.map(i=>n.formatDropUnique(e,i))}},Ty=(t,e,n)=>{let r=i=>JSON.stringify([i.columnNames,i.indexOption,i.indexType]),o=li(t.indexes,e.indexes,r);return{additive:o.missing.map(i=>n.formatCreateIndex(t,i)),destructive:o.unexpected.map(i=>n.formatDropIndex(e,i))}},Iy=(t,e,n)=>{let r=i=>{let a=[i.columnNames,i.parentSchemaName,i.parentTableName,i.parentColumnNames,i.onUpdate,i.onDelete];return JSON.stringify(a)},o=li(t.foreignKeys,e.foreignKeys,r);return{additive:o.missing.map(i=>n.formatAddForeignKey(t,i)),destructive:o.unexpected.map(i=>n.formatDropForeignKey(e,i))}},li=(t,e,n)=>{let r=eu(e,n),o=t.filter(s=>{let l=n(s),c=r.get(l)??0;return c===0?!0:(r.set(l,c-1),!1)}),i=eu(t,n),a=e.filter(s=>{let l=n(s),c=i.get(l)??0;return c===0?!0:(i.set(l,c-1),!1)});return{missing:o,unexpected:a}},eu=(t,e)=>{let n=new Map;return t.forEach(r=>{let o=e(r);n.set(o,(n.get(o)??0)+1)}),n};var Jn=class{constructor(){}static build(e){let{databaseType:n,destructivePolicy:r,withComment:o}=e,i=Yn.findDialect(n,r,o);return i==null?{statements:[Cy(n)],unsupportedCount:1,destructiveCount:0}:_y(i,e)}},Cy=t=>({kind:"unsupported",schemaName:"",tableName:"",sql:`-- unsupported: migrate-ddl has no dialect implemented for database type "${t}".`}),_y=(t,e)=>{let{expected:n,actual:r,withComment:o,databaseType:i}=e,s=ee.get(i).caseSensitiveColumnName,l=Qt.match(n.tables,r.tables,!0),c=l.pairs.map(N=>Wn.toStatements({expectedTable:N.expected,actualTable:N.actual,dialect:t,withComment:o,isCaseSensitiveColumnName:s})),m=c.flatMap(N=>N.additive),d=c.flatMap(N=>N.destructive),h=l.missingExpected.map(N=>Ny(N)),g=l.unexpectedActual.map(N=>t.formatDropTable(N)),b=l.caseFoldedPairs.map(N=>vy(N)),y=[...m,...h,...b,...d,...g];return{statements:y,unsupportedCount:y.filter(N=>N.kind==="unsupported").length,destructiveCount:y.filter(N=>V.isDestructive(N)).length}},Ny=t=>{let e=`Table "${t.tableName}" does not exist. Run 'export-ddl' to generate its CREATE TABLE statement.`;return V.unsupported(t,e)},vy=t=>{let e=`Table name differs only in case: design="${t.expected.tableName}" database="${t.actual.tableName}". Treated as the same table; review the naming difference manually.`;return V.unsupported(t.actual,e)};var Ey=`erd-cli migrate-ddl --file <path.erd> [options]
260
260
 
261
261
  --dsn <url> Target database. ERD_DB_URL takes precedence over --dsn, but --from
262
262
  takes precedence over both (no connection is attempted when --from is given).
@@ -273,7 +273,7 @@ ORDER BY n.nspname, c.relname;`,fg=(t,e)=>{let n=gg(t,e),r={schemaName:t.schemaN
273
273
  migrate-ddl always keeps each table's own schema qualification.
274
274
  --connect-timeout <seconds> Connection timeout (database connections only). Defaults to 10 seconds.
275
275
  --query-timeout <seconds> Query timeout (database connections only). Defaults to 30 seconds.
276
- `,Cy=[{name:"--file",arity:"single"},{name:"--dsn",arity:"single"},{name:"--from",arity:"single"},{name:"--schema",arity:"single"},{name:"--out",arity:"single"},{name:"--allow-destructive",arity:"flag"},...oe.OPTION_SPECS.filter(t=>t.name!=="--format"),...bt.OPTION_SPECS],_y=t=>async e=>{let n=Ny(e);if(n.resultType==="error")return"error";let r=n.input,o=r.fromOption!=null?vy(r.fromOption,r.scope,r.filter):await Ey(r.databaseType,r.connectionUrl,e,r.scope,r.filter,r.expectedSnapshot,r.timeouts,t);if(o.resultType==="failed")return console.error(o.message),"error";let i=e.hasFlag("--allow-destructive")?"emit":"commentOut",a=Jn.build({expected:r.expectedSnapshot,actual:o.snapshot,databaseType:r.databaseType,destructivePolicy:i,withComment:r.scope.withComment}),s=Ay(a,{fileLabel:r.fileOption,targetLabel:o.targetLabel,databaseType:r.databaseType});return Ry(s,a,e.findValue("--out")),"ok"},Ny=t=>{let e=t.findValue("--file");if(e==null)return console.error("Missing required option: --file <path.erd>"),{resultType:"error"};let n=t.findValue("--from"),r=t.findValue("--dsn");if(n!=null&&r!=null)return console.error("Pass either --from or a database connection (ERD_DB_URL/--dsn), not both."),{resultType:"error"};let o=n!=null?null:oe.findConnectionUrl(t);if(n==null&&o==null)return console.error("Missing target: pass --from <path.erd>, or set ERD_DB_URL / --dsn <url>."),{resultType:"error"};let i=nt.create(t.listValues("--ignore-table"));if(i.resultType==="invalid")return console.error(i.message),{resultType:"error"};let a=bt.toConnectionTimeouts(t);if(a.resultType==="invalid")return console.error(a.message),{resultType:"error"};let s=Qe.load(e);if(s.resultType==="failed")return console.error(s.message),{resultType:"error"};let l=s.erdDocument,c=l.getDatabase().databaseType;if(Ee.supports(c)===!1)return console.error(`Error: Unsupported database type for migrate-ddl: ${c}`),{resultType:"error"};let m=oe.toCompareScope(t,"designToDatabase",l.erdSettingModel.exportDdlSetting.commentStyle),d=we.toSchemaSnapshot(l,m),h=i.filter.filterTables(d);return{resultType:"ready",input:{fileOption:e,fromOption:n,connectionUrl:o,filter:i.filter,databaseType:c,scope:m,expectedSnapshot:h,timeouts:a.timeouts}}},vy=(t,e,n)=>{let r=Qe.load(t);if(r.resultType==="failed")return{resultType:"failed",message:r.message};let o=we.toSchemaSnapshot(r.erdDocument,e);return{resultType:"loaded",snapshot:n.filterTables(o),targetLabel:t}},Ey=async(t,e,n,r,o,i,a,s)=>{if(Ee.supports(t)===!1)return{resultType:"failed",message:`Error: Unsupported database type for migrate-ddl: ${t}`};let l=oe.toSnapshotTarget(n,t,we.toDeclaredTableSchemaNames(i)),c=await s(t,e,l,r,a);return c.resultType==="failed"?{resultType:"failed",message:`Error: ${c.message}`}:{resultType:"loaded",snapshot:o.filterTables(c.snapshot),targetLabel:Ee.maskConnectionUrl(e)}},Ay=(t,e)=>{let n=["-- Generated by erd-designer (erd-cli migrate-ddl)",`-- design : ${e.fileLabel} (${e.databaseType})`,`-- target : ${e.targetLabel}`,`-- diff : ${t.statements.length} statement(s)`,"--","-- This script is not applied automatically. Review it before executing."].join(`
276
+ `,Ay=[{name:"--file",arity:"single"},{name:"--dsn",arity:"single"},{name:"--from",arity:"single"},{name:"--schema",arity:"single"},{name:"--out",arity:"single"},{name:"--allow-destructive",arity:"flag"},...oe.OPTION_SPECS.filter(t=>t.name!=="--format"),...bt.OPTION_SPECS],Ry=t=>async e=>{let n=Py(e);if(n.resultType==="error")return"error";let r=n.input,o=r.fromOption!=null?zy(r.fromOption,r.scope,r.filter):await Oy(r.databaseType,r.connectionUrl,e,r.scope,r.filter,r.expectedSnapshot,r.timeouts,t);if(o.resultType==="failed")return console.error(o.message),"error";let i=e.hasFlag("--allow-destructive")?"emit":"commentOut",a=Jn.build({expected:r.expectedSnapshot,actual:o.snapshot,databaseType:r.databaseType,destructivePolicy:i,withComment:r.scope.withComment}),s=ky(a,{fileLabel:r.fileOption,targetLabel:o.targetLabel,databaseType:r.databaseType});return Dy(s,a,e.findValue("--out")),"ok"},Py=t=>{let e=t.findValue("--file");if(e==null)return console.error("Missing required option: --file <path.erd>"),{resultType:"error"};let n=t.findValue("--from"),r=t.findValue("--dsn");if(n!=null&&r!=null)return console.error("Pass either --from or a database connection (ERD_DB_URL/--dsn), not both."),{resultType:"error"};let o=n!=null?null:oe.findConnectionUrl(t);if(n==null&&o==null)return console.error("Missing target: pass --from <path.erd>, or set ERD_DB_URL / --dsn <url>."),{resultType:"error"};let i=nt.create(t.listValues("--ignore-table"));if(i.resultType==="invalid")return console.error(i.message),{resultType:"error"};let a=bt.toConnectionTimeouts(t);if(a.resultType==="invalid")return console.error(a.message),{resultType:"error"};let s=Qe.load(e);if(s.resultType==="failed")return console.error(s.message),{resultType:"error"};let l=s.erdDocument,c=l.getDatabase().databaseType;if(Ee.supports(c)===!1)return console.error(`Error: Unsupported database type for migrate-ddl: ${c}`),{resultType:"error"};let m=oe.toCompareScope(t,"designToDatabase",l.erdSettingModel.exportDdlSetting.commentStyle),d=we.toSchemaSnapshot(l,m),h=i.filter.filterTables(d);return{resultType:"ready",input:{fileOption:e,fromOption:n,connectionUrl:o,filter:i.filter,databaseType:c,scope:m,expectedSnapshot:h,timeouts:a.timeouts}}},zy=(t,e,n)=>{let r=Qe.load(t);if(r.resultType==="failed")return{resultType:"failed",message:r.message};let o=we.toSchemaSnapshot(r.erdDocument,e);return{resultType:"loaded",snapshot:n.filterTables(o),targetLabel:t}},Oy=async(t,e,n,r,o,i,a,s)=>{if(Ee.supports(t)===!1)return{resultType:"failed",message:`Error: Unsupported database type for migrate-ddl: ${t}`};let l=oe.toSnapshotTarget(n,t,we.toDeclaredTableSchemaNames(i)),c=await s(t,e,l,r,a);return c.resultType==="failed"?{resultType:"failed",message:`Error: ${c.message}`}:{resultType:"loaded",snapshot:o.filterTables(c.snapshot),targetLabel:Ee.maskConnectionUrl(e)}},ky=(t,e)=>{let n=["-- Generated by erd-designer (erd-cli migrate-ddl)",`-- design : ${e.fileLabel} (${e.databaseType})`,`-- target : ${e.targetLabel}`,`-- diff : ${t.statements.length} statement(s)`,"--","-- This script is not applied automatically. Review it before executing."].join(`
277
277
  `),r=t.statements.map(o=>o.sql).join(`
278
278
 
279
279
  `);return r!==""?`${n}
@@ -282,9 +282,9 @@ ${r}
282
282
  `:`${n}
283
283
 
284
284
  -- No differences found.
285
- `},Ry=(t,e,n)=>{if(n==null){console.log(t);return}tu.writeFileSync(n,t),console.log(`Wrote ${e.statements.length} statement(s) to ${n} (${e.destructiveCount} destructive).`),e.unsupportedCount>0&&console.log(`${e.unsupportedCount} unsupported difference(s) remain. Check 'unsupported' entries in the file.`)},nu={name:"migrate-ddl",usage:Iy,optionSpecs:Cy,create:_y};var ru=[qc,Wc,nu],St=class{constructor(){}static find(e){return ru.find(n=>n.name===e)??null}static usages(){return ru.map(e=>e.usage)}static async execute(e,n){let r=ui(n,e.optionSpecs);return r.resultType==="invalid"?(console.error(r.message),"error"):e.create(Ee.fetchSnapshot)(r.options)}static toExitCode(e){return e==="ok"?0:e==="detected"?1:2}};var ou=`erd-cli : Verify that a designed .erd schema matches a live database or another .erd revision.
285
+ `},Dy=(t,e,n)=>{if(n==null){console.log(t);return}tu.writeFileSync(n,t),console.log(`Wrote ${e.statements.length} statement(s) to ${n} (${e.destructiveCount} destructive).`),e.unsupportedCount>0&&console.log(`${e.unsupportedCount} unsupported difference(s) remain. Check 'unsupported' entries in the file.`)},nu={name:"migrate-ddl",usage:Ey,optionSpecs:Ay,create:Ry};var ru=[qc,Wc,nu],St=class{constructor(){}static find(e){return ru.find(n=>n.name===e)??null}static usages(){return ru.map(e=>e.usage)}static async execute(e,n){let r=ui(n,e.optionSpecs);return r.resultType==="invalid"?(console.error(r.message),"error"):e.create(Ee.fetchSnapshot)(r.options)}static toExitCode(e){return e==="ok"?0:e==="detected"?1:2}};var ou=`erd-cli : Verify that a designed .erd schema matches a live database or another .erd revision.
286
286
 
287
287
  USAGE:
288
288
  ${St.usages().join(`
289
- `)}`,Py=async()=>{let t=$r.default.argv.slice(2),e=t[0];if(e==null||e==="help"||e==="--help")return console.log(ou),0;let n=St.find(e);if(n==null)return console.error(`Unknown command: ${e}
290
- `),console.error(ou),2;let r=await St.execute(n,t.slice(1));return St.toExitCode(r)};Py().then(t=>{$r.default.exitCode=t}).catch(t=>{let e=t instanceof Error?t.message:String(t);console.error(`Error: ${e}`),$r.default.exitCode=2});
289
+ `)}`,$y=async()=>{let t=$r.default.argv.slice(2),e=t[0];if(e==null||e==="help"||e==="--help")return console.log(ou),0;let n=St.find(e);if(n==null)return console.error(`Unknown command: ${e}
290
+ `),console.error(ou),2;let r=await St.execute(n,t.slice(1));return St.toExitCode(r)};$y().then(t=>{$r.default.exitCode=t}).catch(t=>{let e=t instanceof Error?t.message:String(t);console.error(`Error: ${e}`),$r.default.exitCode=2});