@redocly/replay 0.27.0-next.3 → 0.27.0-next.5

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 (62) hide show
  1. package/dist/replay-AiChatProvider-BGXsZqW2.js +6 -0
  2. package/dist/replay-AiChatProvider-CVvR1kSd.js +1004 -0
  3. package/dist/replay-AiChatSqliteDBStorage-BFHRKFlk.js +88 -0
  4. package/dist/replay-AiChatSqliteDBStorage-DVJ9f2EK.js +1 -0
  5. package/dist/replay-AiPanel-CynVcVmm.js +2873 -0
  6. package/dist/replay-AiPanel-qVp_s4gD.js +849 -0
  7. package/dist/replay-HistorySqliteDBStorage-BrILW8Fu.js +1 -0
  8. package/dist/replay-HistorySqliteDBStorage-CtF6-vY8.js +113 -0
  9. package/dist/replay-SqliteDBStorage-CSz7NYH4.js +2857 -0
  10. package/dist/replay-SqliteDBStorage-eRBPh4E8.js +14 -0
  11. package/dist/replay-StepContextSqliteDBStorage-BSepLyBI.js +1 -0
  12. package/dist/replay-StepContextSqliteDBStorage-BfAAKDwA.js +83 -0
  13. package/dist/replay-agent-loop-C60p47KY.js +1 -0
  14. package/dist/replay-agent-loop-CEZz1kj-.js +1533 -0
  15. package/dist/replay-ai-chat-mappers-BAHU6JIc.js +99 -0
  16. package/dist/replay-ai-chat-mappers-Dqg-QVZy.js +1 -0
  17. package/dist/replay-ai-message-parts.schema-BBdjwldJ.js +1 -0
  18. package/dist/replay-ai-message-parts.schema-E9u9-nqr.js +60 -0
  19. package/dist/replay-create-model-C2NQtDcL.js +38224 -0
  20. package/dist/replay-create-model-CUL-l-eX.js +104 -0
  21. package/dist/replay-db-C4jAfGtc.js +64 -0
  22. package/dist/replay-db-Dw-X2WGx.js +306 -0
  23. package/dist/replay-defaults-CzR6jw9a.js +32 -0
  24. package/dist/replay-defaults-DVvOnvnR.js +27 -0
  25. package/dist/replay-external-resolver-DAkLV0nr.js +34 -0
  26. package/dist/replay-external-resolver-DN_PWq_2.js +2 -0
  27. package/dist/replay-history.schema-5ce6X0R1.js +28 -0
  28. package/dist/replay-history.schema-miM3Etuf.js +1 -0
  29. package/dist/replay-index-BmX1FPBL.js +6877 -0
  30. package/dist/replay-index-DR1uVBvc.js +503 -0
  31. package/dist/replay-index-DSKZHOXq.js +1 -0
  32. package/dist/{replay-index-gw_CfN4i.js → replay-index-DT5gdiBA.js} +1 -1
  33. package/dist/replay-index-O_Pq5an3.js +92924 -0
  34. package/dist/{replay-index-CiP3e-cc.js → replay-index-m00jnWFr.js} +6 -6
  35. package/dist/replay-index-qZlgEmbq.js +1 -0
  36. package/dist/replay-index-rRWvC2pp.js +1 -0
  37. package/dist/replay-indexes-CfsvVMi_.js +1242 -0
  38. package/dist/replay-indexes-Dqjl8m6C.js +1 -0
  39. package/dist/replay-lint-CcVVykW7.js +33217 -0
  40. package/dist/replay-lint-ON47l7Vu.js +184 -0
  41. package/dist/{replay-lint-graphql-DV4sCSe6.js → replay-lint-graphql-5cGt2KR_.js} +5 -5
  42. package/dist/{replay-lint-graphql-Cbptkd8N.js → replay-lint-graphql-DlD7bblx.js} +2 -2
  43. package/dist/replay-resolve-BTzo-fSv.js +47 -0
  44. package/dist/replay-resolve-Ca3DUbGq.js +3683 -0
  45. package/dist/{replay-respect-run-ChMawzhr.js → replay-respect-run-BtC2agF9.js} +54 -54
  46. package/dist/{replay-respect-run-BscBAlnT.js → replay-respect-run-eSRzH2dk.js} +447 -447
  47. package/dist/replay-step-context.schema-BuuXkAck.js +1 -0
  48. package/dist/replay-step-context.schema-DBk4jufr.js +21 -0
  49. package/dist/{replay-tauri-path-BMmQuI9X.js → replay-tauri-path-C-oxFOHe.js} +4 -4
  50. package/dist/{replay-tauri-path-kR-IXn3X.js → replay-tauri-path-CKcvIl_h.js} +1 -1
  51. package/dist/replay-useAiChatQueries-CVTxcu2Z.js +192 -0
  52. package/dist/replay-useAiChatQueries-vdKvbmp2.js +3413 -0
  53. package/dist/replay-validate-key-CwIopif3.js +28 -0
  54. package/dist/replay-validate-key-VkgZoK1f.js +1 -0
  55. package/dist/replay.cjs +1 -1
  56. package/dist/replay.d.ts +2 -0
  57. package/dist/replay.js +21 -21
  58. package/package.json +22 -25
  59. package/dist/replay-index-CUY_5IyO.js +0 -8308
  60. package/dist/replay-index-CUdCFVnz.js +0 -178626
  61. package/dist/replay-index-D8qtqDhF.js +0 -1
  62. package/dist/replay-index-DgjC0DLq.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";const s=Symbol.for("drizzle:entityKind");function a(t,e){if(!t||typeof t!="object")return!1;if(t instanceof e)return!0;if(!Object.prototype.hasOwnProperty.call(e,s))throw new Error(`Class "${e.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let r=Object.getPrototypeOf(t).constructor;if(r)for(;r;){if(s in r&&r[s]===e[s])return!0;r=Object.getPrototypeOf(r)}return!1}const B=Symbol.for("drizzle:Name"),$=Symbol.for("drizzle:Schema"),A=Symbol.for("drizzle:Columns"),_=Symbol.for("drizzle:ExtraConfigColumns"),V=Symbol.for("drizzle:OriginalName"),P=Symbol.for("drizzle:BaseName"),F=Symbol.for("drizzle:IsAlias"),R=Symbol.for("drizzle:ExtraConfigBuilder"),te=Symbol.for("drizzle:IsDrizzleTable");class d{static[s]="Table";static Symbol={Name:B,Schema:$,OriginalName:V,Columns:A,ExtraConfigColumns:_,BaseName:P,IsAlias:F,ExtraConfigBuilder:R};[B];[V];[$];[A];[_];[P];[F]=!1;[te]=!0;[R]=void 0;constructor(e,r,n){this[B]=this[V]=e,this[$]=r,this[P]=n}}function O(t){return t[B]}function re(t){return`${t[$]??"public"}.${t[B]}`}class L{constructor(e,r){this.table=e,this.config=r,this.name=r.name,this.keyAsName=r.keyAsName,this.notNull=r.notNull,this.default=r.default,this.defaultFn=r.defaultFn,this.onUpdateFn=r.onUpdateFn,this.hasDefault=r.hasDefault,this.primary=r.primaryKey,this.isUnique=r.isUnique,this.uniqueName=r.uniqueName,this.uniqueType=r.uniqueType,this.dataType=r.dataType,this.columnType=r.columnType,this.generated=r.generated,this.generatedIdentity=r.generatedIdentity}static[s]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}class ne{static[s]="ColumnBuilder";config;constructor(e,r,n){this.config={name:e,keyAsName:e==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:r,columnType:n,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e){this.config.name===""&&(this.config.name=e)}}const W=Symbol.for("drizzle:isPgEnum");function ie(t){return!!t&&typeof t=="function"&&W in t&&t[W]===!0}class x{static[s]="Subquery";constructor(e,r,n,u=!1,o=[]){this._={brand:"Subquery",sql:e,selectedFields:r,alias:n,isWith:u,usedTables:o}}}class se extends x{static[s]="WithSubquery"}const oe={startActiveSpan(t,e){return e()}},N=Symbol.for("drizzle:ViewBaseConfig");function M(t){return t!=null&&typeof t.getSQL=="function"}function ue(t){const e={sql:"",params:[]};for(const r of t)e.sql+=r.sql,e.params.push(...r.params),r.typings?.length&&(e.typings||(e.typings=[]),e.typings.push(...r.typings));return e}class S{static[s]="StringChunk";value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new m([this])}}class m{constructor(e){this.queryChunks=e;for(const r of e)if(a(r,d)){const n=r[d.Symbol.Schema];this.usedTables.push(n===void 0?r[d.Symbol.Name]:n+"."+r[d.Symbol.Name])}}static[s]="SQL";decoder=G;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return oe.startActiveSpan("drizzle.buildSQL",r=>{const n=this.buildQueryFromSourceParams(this.queryChunks,e);return r?.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(e,r){const n=Object.assign({},r,{inlineParams:r.inlineParams||this.shouldInlineParams,paramStartIndex:r.paramStartIndex||{value:0}}),{casing:u,escapeName:o,escapeParam:g,prepareTyping:f,inlineParams:p,paramStartIndex:h}=n;return ue(e.map(i=>{if(a(i,S))return{sql:i.value.join(""),params:[]};if(a(i,v))return{sql:o(i.value),params:[]};if(i===void 0)return{sql:"",params:[]};if(Array.isArray(i)){const c=[new S("(")];for(const[y,D]of i.entries())c.push(D),y<i.length-1&&c.push(new S(", "));return c.push(new S(")")),this.buildQueryFromSourceParams(c,n)}if(a(i,m))return this.buildQueryFromSourceParams(i.queryChunks,{...n,inlineParams:p||i.shouldInlineParams});if(a(i,d)){const c=i[d.Symbol.Schema],y=i[d.Symbol.Name];return{sql:c===void 0||i[F]?o(y):o(c)+"."+o(y),params:[]}}if(a(i,L)){const c=u.getColumnCasing(i);if(r.invokeSource==="indexes")return{sql:o(c),params:[]};const y=i.table[d.Symbol.Schema];return{sql:i.table[F]||y===void 0?o(i.table[d.Symbol.Name])+"."+o(c):o(y)+"."+o(i.table[d.Symbol.Name])+"."+o(c),params:[]}}if(a(i,z)){const c=i[N].schema,y=i[N].name;return{sql:c===void 0||i[N].isAlias?o(y):o(c)+"."+o(y),params:[]}}if(a(i,T)){if(a(i.value,q))return{sql:g(h.value++,i),params:[i],typings:["none"]};const c=i.value===null?null:i.encoder.mapToDriverValue(i.value);if(a(c,m))return this.buildQueryFromSourceParams([c],n);if(p)return{sql:this.mapInlineParam(c,n),params:[]};let y=["none"];return f&&(y=[f(i.encoder)]),{sql:g(h.value++,c),params:[c],typings:y}}return a(i,q)?{sql:g(h.value++,i),params:[i],typings:["none"]}:a(i,m.Aliased)&&i.fieldAlias!==void 0?{sql:o(i.fieldAlias),params:[]}:a(i,x)?i._.isWith?{sql:o(i._.alias),params:[]}:this.buildQueryFromSourceParams([new S("("),i._.sql,new S(") "),new v(i._.alias)],n):ie(i)?i.schema?{sql:o(i.schema)+"."+o(i.enumName),params:[]}:{sql:o(i.enumName),params:[]}:M(i)?i.shouldOmitSQLParens?.()?this.buildQueryFromSourceParams([i.getSQL()],n):this.buildQueryFromSourceParams([new S("("),i.getSQL(),new S(")")],n):p?{sql:this.mapInlineParam(i,n),params:[]}:{sql:g(h.value++,i),params:[i],typings:["none"]}}))}mapInlineParam(e,{escapeString:r}){if(e===null)return"null";if(typeof e=="number"||typeof e=="boolean")return e.toString();if(typeof e=="string")return r(e);if(typeof e=="object"){const n=e.toString();return r(n==="[object Object]"?JSON.stringify(e):n)}throw new Error("Unexpected param value: "+e)}getSQL(){return this}as(e){return e===void 0?this:new m.Aliased(this,e)}mapWith(e){return this.decoder=typeof e=="function"?{mapFromDriverValue:e}:e,this}inlineParams(){return this.shouldInlineParams=!0,this}if(e){return e?this:void 0}}class v{constructor(e){this.value=e}static[s]="Name";brand;getSQL(){return new m([this])}}function ae(t){return typeof t=="object"&&t!==null&&"mapToDriverValue"in t&&typeof t.mapToDriverValue=="function"}const G={mapFromDriverValue:t=>t},H={mapToDriverValue:t=>t};({...G,...H});class T{constructor(e,r=H){this.value=e,this.encoder=r}static[s]="Param";brand;getSQL(){return new m([this])}}function l(t,...e){const r=[];(e.length>0||t.length>0&&t[0]!=="")&&r.push(new S(t[0]));for(const[n,u]of e.entries())r.push(u,new S(t[n+1]));return new m(r)}(t=>{function e(){return new m([])}t.empty=e;function r(p){return new m(p)}t.fromList=r;function n(p){return new m([new S(p)])}t.raw=n;function u(p,h){const i=[];for(const[c,y]of p.entries())c>0&&h!==void 0&&i.push(h),i.push(y);return new m(i)}t.join=u;function o(p){return new v(p)}t.identifier=o;function g(p){return new q(p)}t.placeholder=g;function f(p,h){return new T(p,h)}t.param=f})(l||(l={}));(t=>{class e{constructor(n,u){this.sql=n,this.fieldAlias=u}static[s]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new e(this.sql,this.fieldAlias)}}t.Aliased=e})(m||(m={}));class q{constructor(e){this.name=e}static[s]="Placeholder";getSQL(){return new m([this])}}function le(t,e){return t.map(r=>{if(a(r,q)){if(!(r.name in e))throw new Error(`No value for placeholder "${r.name}" was provided`);return e[r.name]}if(a(r,T)&&a(r.value,q)){if(!(r.value.name in e))throw new Error(`No value for placeholder "${r.value.name}" was provided`);return r.encoder.mapToDriverValue(e[r.value.name])}return r})}const me=Symbol.for("drizzle:IsDrizzleView");class z{static[s]="View";[N];[me]=!0;constructor({name:e,schema:r,selectedFields:n,query:u}){this[N]={name:e,originalName:e,schema:r,selectedFields:n,query:u,isExisting:!u,isAlias:!1}}getSQL(){return new m([this])}}L.prototype.getSQL=function(){return new m([this])};d.prototype.getSQL=function(){return new m([this])};x.prototype.getSQL=function(){return new m([this])};function ce(t,e,r){const n={},u=t.reduce((o,{path:g,field:f},p)=>{let h;a(f,L)?h=f:a(f,m)?h=f.decoder:a(f,x)?h=f._.sql.decoder:h=f.sql.decoder;let i=o;for(const[c,y]of g.entries())if(c<g.length-1)y in i||(i[y]={}),i=i[y];else{const D=e[p],ee=i[y]=D===null?null:h.mapFromDriverValue(D);if(r&&a(f,L)&&g.length===2){const C=g[0];C in n?typeof n[C]=="string"&&n[C]!==O(f.table)&&(n[C]=!1):n[C]=ee===null?O(f.table):!1}}return o},{});if(r&&Object.keys(n).length>0)for(const[o,g]of Object.entries(n))typeof g=="string"&&!r[g]&&(u[o]=null);return u}function j(t,e){return Object.entries(t).reduce((r,[n,u])=>{if(typeof n!="string")return r;const o=e?[...e,n]:[n];return a(u,L)||a(u,m)||a(u,m.Aliased)||a(u,x)?r.push({path:o,field:u}):a(u,d)?r.push(...j(u[d.Symbol.Columns],o)):r.push(...j(u,o)),r},[])}function fe(t,e){const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const[u,o]of r.entries())if(o!==n[u])return!1;return!0}function de(t,e){const r=Object.entries(e).filter(([,n])=>n!==void 0).map(([n,u])=>a(u,m)||a(u,L)?[n,u]:[n,new T(u,t[d.Symbol.Columns][n])]);if(r.length===0)throw new Error("No values to set");return Object.fromEntries(r)}function pe(t,e){for(const r of e)for(const n of Object.getOwnPropertyNames(r.prototype))n!=="constructor"&&Object.defineProperty(t.prototype,n,Object.getOwnPropertyDescriptor(r.prototype,n)||Object.create(null))}function ge(t){return t[d.Symbol.Columns]}function ye(t){return a(t,x)?t._.alias:a(t,z)?t[N].name:a(t,m)?void 0:t[d.Symbol.IsAlias]?t[d.Symbol.Name]:t[d.Symbol.BaseName]}function I(t,e){return{name:typeof t=="string"&&t.length>0?t:"",config:typeof t=="object"?t:e}}const X=typeof TextDecoder>"u"?null:new TextDecoder;function b(t,e){return ae(e)&&!M(t)&&!a(t,T)&&!a(t,q)&&!a(t,L)&&!a(t,d)&&!a(t,z)?new T(t,e):t}const he=(t,e)=>l`${t} = ${b(e,t)}`,Se=(t,e)=>l`${t} <> ${b(e,t)}`;function be(...t){const e=t.filter(r=>r!==void 0);if(e.length!==0)return e.length===1?new m(e):new m([new S("("),l.join(e,new S(" and ")),new S(")")])}function we(...t){const e=t.filter(r=>r!==void 0);if(e.length!==0)return e.length===1?new m(e):new m([new S("("),l.join(e,new S(" or ")),new S(")")])}function Qe(t){return l`not ${t}`}const Le=(t,e)=>l`${t} > ${b(e,t)}`,Be=(t,e)=>l`${t} >= ${b(e,t)}`,Ne=(t,e)=>l`${t} < ${b(e,t)}`,Te=(t,e)=>l`${t} <= ${b(e,t)}`;function xe(t,e){return Array.isArray(e)?e.length===0?l`false`:l`${t} in ${e.map(r=>b(r,t))}`:l`${t} in ${b(e,t)}`}function qe(t,e){return Array.isArray(e)?e.length===0?l`true`:l`${t} not in ${e.map(r=>b(r,t))}`:l`${t} not in ${b(e,t)}`}function Ce(t){return l`${t} is null`}function Ie(t){return l`${t} is not null`}function De(t){return l`exists ${t}`}function $e(t){return l`not exists ${t}`}function Fe(t,e,r){return l`${t} between ${b(e,t)} and ${b(r,t)}`}function ze(t,e,r){return l`${t} not between ${b(e,t)} and ${b(r,t)}`}function Ve(t,e){return l`${t} like ${e}`}function Pe(t,e){return l`${t} not like ${e}`}function Ae(t,e){return l`${t} ilike ${e}`}function Oe(t,e){return l`${t} not ilike ${e}`}function ve(t){return l`${t} asc`}function je(t){return l`${t} desc`}class Ue{static[s]="SQLiteForeignKeyBuilder";reference;_onUpdate;_onDelete;constructor(e,r){this.reference=()=>{const{name:n,columns:u,foreignColumns:o}=e();return{name:n,columns:u,foreignTable:o[0].table,foreignColumns:o}},r&&(this._onUpdate=r.onUpdate,this._onDelete=r.onDelete)}onUpdate(e){return this._onUpdate=e,this}onDelete(e){return this._onDelete=e,this}build(e){return new Ke(e,this)}}class Ke{constructor(e,r){this.table=e,this.reference=r.reference,this.onUpdate=r._onUpdate,this.onDelete=r._onDelete}static[s]="SQLiteForeignKey";reference;onUpdate;onDelete;getName(){const{name:e,columns:r,foreignColumns:n}=this.reference(),u=r.map(f=>f.name),o=n.map(f=>f.name),g=[this.table[B],...u,n[0].table[B],...o];return e??`${g.join("_")}_fk`}}function Ee(t,e){return`${t[B]}_${e.join("_")}_unique`}class Q extends ne{static[s]="SQLiteColumnBuilder";foreignKeyConfigs=[];references(e,r={}){return this.foreignKeyConfigs.push({ref:e,actions:r}),this}unique(e){return this.config.isUnique=!0,this.config.uniqueName=e,this}generatedAlwaysAs(e,r){return this.config.generated={as:e,type:"always",mode:r?.mode??"virtual"},this}buildForeignKeys(e,r){return this.foreignKeyConfigs.map(({ref:n,actions:u})=>((o,g)=>{const f=new Ue(()=>{const p=o();return{columns:[e],foreignColumns:[p]}});return g.onUpdate&&f.onUpdate(g.onUpdate),g.onDelete&&f.onDelete(g.onDelete),f.build(r)})(n,u))}}class w extends L{constructor(e,r){r.uniqueName||(r.uniqueName=Ee(e,[r.name])),super(e,r),this.table=e}static[s]="SQLiteColumn"}class Je extends Q{static[s]="SQLiteBigIntBuilder";constructor(e){super(e,"bigint","SQLiteBigInt")}build(e){return new _e(e,this.config)}}class _e extends w{static[s]="SQLiteBigInt";getSQLType(){return"blob"}mapFromDriverValue(e){if(typeof Buffer<"u"&&Buffer.from){const r=Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e);return BigInt(r.toString("utf8"))}return BigInt(X.decode(e))}mapToDriverValue(e){return Buffer.from(e.toString())}}class Re extends Q{static[s]="SQLiteBlobJsonBuilder";constructor(e){super(e,"json","SQLiteBlobJson")}build(e){return new We(e,this.config)}}class We extends w{static[s]="SQLiteBlobJson";getSQLType(){return"blob"}mapFromDriverValue(e){if(typeof Buffer<"u"&&Buffer.from){const r=Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e);return JSON.parse(r.toString("utf8"))}return JSON.parse(X.decode(e))}mapToDriverValue(e){return Buffer.from(JSON.stringify(e))}}class Me extends Q{static[s]="SQLiteBlobBufferBuilder";constructor(e){super(e,"buffer","SQLiteBlobBuffer")}build(e){return new Ge(e,this.config)}}class Ge extends w{static[s]="SQLiteBlobBuffer";mapFromDriverValue(e){return Buffer.isBuffer(e)?e:Buffer.from(e)}getSQLType(){return"blob"}}function He(t,e){const{name:r,config:n}=I(t,e);return n?.mode==="json"?new Re(r):n?.mode==="bigint"?new Je(r):new Me(r)}class Xe extends Q{static[s]="SQLiteCustomColumnBuilder";constructor(e,r,n){super(e,"custom","SQLiteCustomColumn"),this.config.fieldConfig=r,this.config.customTypeParams=n}build(e){return new Ye(e,this.config)}}class Ye extends w{static[s]="SQLiteCustomColumn";sqlName;mapTo;mapFrom;constructor(e,r){super(e,r),this.sqlName=r.customTypeParams.dataType(r.fieldConfig),this.mapTo=r.customTypeParams.toDriver,this.mapFrom=r.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(e){return typeof this.mapFrom=="function"?this.mapFrom(e):e}mapToDriverValue(e){return typeof this.mapTo=="function"?this.mapTo(e):e}}function Ze(t){return(e,r)=>{const{name:n,config:u}=I(e,r);return new Xe(n,u,t)}}class E extends Q{static[s]="SQLiteBaseIntegerBuilder";constructor(e,r,n){super(e,r,n),this.config.autoIncrement=!1}primaryKey(e){return e?.autoIncrement&&(this.config.autoIncrement=!0),this.config.hasDefault=!0,super.primaryKey()}}class J extends w{static[s]="SQLiteBaseInteger";autoIncrement=this.config.autoIncrement;getSQLType(){return"integer"}}class ke extends E{static[s]="SQLiteIntegerBuilder";constructor(e){super(e,"number","SQLiteInteger")}build(e){return new et(e,this.config)}}class et extends J{static[s]="SQLiteInteger"}class tt extends E{static[s]="SQLiteTimestampBuilder";constructor(e,r){super(e,"date","SQLiteTimestamp"),this.config.mode=r}defaultNow(){return this.default(l`(cast((julianday('now') - 2440587.5)*86400000 as integer))`)}build(e){return new rt(e,this.config)}}class rt extends J{static[s]="SQLiteTimestamp";mode=this.config.mode;mapFromDriverValue(e){return this.config.mode==="timestamp"?new Date(e*1e3):new Date(e)}mapToDriverValue(e){const r=e.getTime();return this.config.mode==="timestamp"?Math.floor(r/1e3):r}}class nt extends E{static[s]="SQLiteBooleanBuilder";constructor(e,r){super(e,"boolean","SQLiteBoolean"),this.config.mode=r}build(e){return new it(e,this.config)}}class it extends J{static[s]="SQLiteBoolean";mode=this.config.mode;mapFromDriverValue(e){return Number(e)===1}mapToDriverValue(e){return e?1:0}}function Y(t,e){const{name:r,config:n}=I(t,e);return n?.mode==="timestamp"||n?.mode==="timestamp_ms"?new tt(r,n.mode):n?.mode==="boolean"?new nt(r,n.mode):new ke(r)}class st extends Q{static[s]="SQLiteNumericBuilder";constructor(e){super(e,"string","SQLiteNumeric")}build(e){return new ot(e,this.config)}}class ot extends w{static[s]="SQLiteNumeric";mapFromDriverValue(e){return typeof e=="string"?e:String(e)}getSQLType(){return"numeric"}}class ut extends Q{static[s]="SQLiteNumericNumberBuilder";constructor(e){super(e,"number","SQLiteNumericNumber")}build(e){return new at(e,this.config)}}class at extends w{static[s]="SQLiteNumericNumber";mapFromDriverValue(e){return typeof e=="number"?e:Number(e)}mapToDriverValue=String;getSQLType(){return"numeric"}}class lt extends Q{static[s]="SQLiteNumericBigIntBuilder";constructor(e){super(e,"bigint","SQLiteNumericBigInt")}build(e){return new mt(e,this.config)}}class mt extends w{static[s]="SQLiteNumericBigInt";mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return"numeric"}}function ct(t,e){const{name:r,config:n}=I(t,e),u=n?.mode;return u==="number"?new ut(r):u==="bigint"?new lt(r):new st(r)}class ft extends Q{static[s]="SQLiteRealBuilder";constructor(e){super(e,"number","SQLiteReal")}build(e){return new dt(e,this.config)}}class dt extends w{static[s]="SQLiteReal";getSQLType(){return"real"}}function pt(t){return new ft(t??"")}class gt extends Q{static[s]="SQLiteTextBuilder";constructor(e,r){super(e,"string","SQLiteText"),this.config.enumValues=r.enum,this.config.length=r.length}build(e){return new yt(e,this.config)}}class yt extends w{static[s]="SQLiteText";enumValues=this.config.enumValues;length=this.config.length;constructor(e,r){super(e,r)}getSQLType(){return`text${this.config.length?`(${this.config.length})`:""}`}}class ht extends Q{static[s]="SQLiteTextJsonBuilder";constructor(e){super(e,"json","SQLiteTextJson")}build(e){return new St(e,this.config)}}class St extends w{static[s]="SQLiteTextJson";getSQLType(){return"text"}mapFromDriverValue(e){return JSON.parse(e)}mapToDriverValue(e){return JSON.stringify(e)}}function Z(t,e={}){const{name:r,config:n}=I(t,e);return n.mode==="json"?new ht(r):new gt(r,n)}function bt(){return{blob:He,customType:Ze,integer:Y,numeric:ct,real:pt,text:Z}}const U=Symbol.for("drizzle:SQLiteInlineForeignKeys");class K extends d{static[s]="SQLiteTable";static Symbol=Object.assign({},d.Symbol,{InlineForeignKeys:U});[d.Symbol.Columns];[U]=[];[d.Symbol.ExtraConfigBuilder]=void 0}function wt(t,e,r,n,u=t){const o=new K(t,n,u),g=typeof e=="function"?e(bt()):e,f=Object.fromEntries(Object.entries(g).map(([h,i])=>{const c=i;c.setName(h);const y=c.build(o);return o[U].push(...c.buildForeignKeys(y,o)),[h,y]})),p=Object.assign(o,f);return p[d.Symbol.Columns]=f,p[d.Symbol.ExtraConfigColumns]=f,r&&(p[K.Symbol.ExtraConfigBuilder]=r),p}const Qt=(t,e,r)=>wt(t,e,r);class k{constructor(e,r){this.name=e,this.unique=r}static[s]="SQLiteIndexBuilderOn";on(...e){return new Lt(this.name,e,this.unique)}}class Lt{static[s]="SQLiteIndexBuilder";config;constructor(e,r,n){this.config={name:e,columns:r,unique:n,where:void 0}}where(e){return this.config.where=e,this}build(e){return new Bt(this.config,e)}}class Bt{static[s]="SQLiteIndex";config;constructor(e,r){this.config={...e,table:r}}}function Nt(t){return new k(t,!1)}function Tt(t){return new k(t,!0)}exports.Column=L;exports.Columns=A;exports.Param=T;exports.SQL=m;exports.SQLiteColumn=w;exports.SQLiteTable=K;exports.Subquery=x;exports.Table=d;exports.View=z;exports.ViewBaseConfig=N;exports.WithSubquery=se;exports.and=be;exports.applyMixins=pe;exports.asc=ve;exports.between=Fe;exports.desc=je;exports.entityKind=s;exports.eq=he;exports.exists=De;exports.fillPlaceholders=le;exports.getTableColumns=ge;exports.getTableLikeName=ye;exports.getTableName=O;exports.getTableUniqueName=re;exports.gt=Le;exports.gte=Be;exports.haveSameKeys=fe;exports.ilike=Ae;exports.inArray=xe;exports.index=Nt;exports.integer=Y;exports.is=a;exports.isNotNull=Ie;exports.isNull=Ce;exports.like=Ve;exports.lt=Ne;exports.lte=Te;exports.mapResultRow=ce;exports.mapUpdateSet=de;exports.ne=Se;exports.not=Qe;exports.notBetween=ze;exports.notExists=$e;exports.notIlike=Oe;exports.notInArray=qe;exports.notLike=Pe;exports.or=we;exports.orderSelectedFields=j;exports.sql=l;exports.sqliteTable=Qt;exports.text=Z;exports.uniqueIndex=Tt;