1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9141],{39141:(e,t,r)=>{r.d(t,{dp:()=>$.dp,Op:()=>k});var s=r(26079),i=r(22834),n=r(93474);function a(e,t){if("undefined"==typeof Convex||void 0===Convex.syscall)throw Error("The Convex database and auth objects are being used outside of a Convex backend. Did you mean to use `useQuery` or `useMutation` to call a Convex function?");return JSON.parse(Convex.syscall(e,JSON.stringify(t)))}async function o(e,t){let r;if("undefined"==typeof Convex||void 0===Convex.asyncSyscall)throw Error("The Convex database and auth objects are being used outside of a Convex backend. Did you mean to use `useQuery` or `useMutation` to call a Convex function?");try{r=await Convex.asyncSyscall(e,JSON.stringify(t))}catch(e){if(void 0!==e.data){let t=new i.i(e.message);throw t.data=(0,n.du)(e.data),t}throw Error(e.message)}return JSON.parse(r)}var d=r(8033),l=Object.defineProperty,u=(e,t,r)=>((e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class c{constructor(){u(this,"_isExpression"),u(this,"_value")}}var h=Object.defineProperty;class m extends c{constructor(e){super(),((e,t,r)=>((e,t,r)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r))(this,"inner"),this.inner=e}serialize(){return this.inner}}function y(e){return e instanceof m?e.serialize():{$literal:(0,n.cy)(e)}}let p={eq:(e,t)=>new m({$eq:[y(e),y(t)]}),neq:(e,t)=>new m({$neq:[y(e),y(t)]}),lt:(e,t)=>new m({$lt:[y(e),y(t)]}),lte:(e,t)=>new m({$lte:[y(e),y(t)]}),gt:(e,t)=>new m({$gt:[y(e),y(t)]}),gte:(e,t)=>new m({$gte:[y(e),y(t)]}),add:(e,t)=>new m({$add:[y(e),y(t)]}),sub:(e,t)=>new m({$sub:[y(e),y(t)]}),mul:(e,t)=>
1new m({$mul:[y(e),y(t)]}),div:(e,t)=>new m({$div:[y(e),y(t)]}),mod:(e,t)=>new m({$mod:[y(e),y(t)]}),neg:e=>new m({$neg:y(e)}),and:(...e)=>new m({$and:e.map(y)}),or:(...e)=>new m({$or:e.map(y)}),not:e=>new m({$not:y(e)}),field:e=>new m({$field:e})};function v(e,t,r,s){if(void 0===e)throw TypeError(`Must provide arg ${t} \`${s}\` to \`${r}\``)}var f=r(3862),b=Object.defineProperty,x=(e,t,r)=>((e,t,r)=>t in e?b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function g(e){throw Error("consumed"===e?"This query is closed and can't emit any more values.":"This query has been chained with another operator and can't be reused.")}Symbol.asyncIterator;class w{constructor(e){x(this,"state"),x(this,"tableNameForErrorMessages"),this.state={type:"preparing",query:e},"FullTableScan"===e.source.type?this.tableNameForErrorMessages=e.source.tableName:this.tableNameForErrorMessages=e.source.indexName.split(".")[0]}takeQuery(){if("preparing"!==this.state.type)throw Error("A query can only be chained once and can't be chained after iteration begins.");let e=this.state.query;return this.state={type:"closed"},e}startQuery(){if("executing"===this.state.type)throw Error("Iteration can only begin on a query once.");("closed"===this.state.type||"consumed"===this.state.type)&&g(this.state.type);let{queryId:e}=a("1.0/queryStream",{query:this.state.query,version:f.r});return this.state={type:"executing",queryId:e},e}closeQuery(){"executing"===this.state.type&&a("1.0/queryCleanup",{queryId:this.state.queryId}),this.state={type:"consumed"}}order(e){v(e,1,"order","order");let t=this.takeQuery();if("Search"===t.source.type)throw Error("Search queries must always be in relevance order. Can not set order manually.");if(null!==t.source.order)throw Error("Queries may only specify order at most once");return t.source.order=e,new w(t)}filter(e){v(e,1,"filter","predicate");let t=this.takeQuery();if(t.operators.length>=256)throw Error("Can't construct query with more than 256 operators");return t.operators.push({filter:y(e(p))}),new w(t)}limit(e){v(e,1,"limit","n");let t=this.takeQuery();return t.operators.push({limit:e}),new w(t)}[Symbol.asyncIterator](){return this.startQuery(),this}async next(){("closed"===this.state.type||"consumed"===this.state.type)&&g(this.state.type);let e="preparing"===this.state.type?this.startQuery():this.state.queryId,{value:t,done:r}=await o("1.0/queryStreamNext",{queryId:e});return r&&this.closeQuery(),{value:(0,s.du)(t),done:r}}return(){return this.closeQuery(),Promise.resolve({done:!0,value:void 0})}async paginate(e){if(v(e,1,"paginate","options"),"number"!=typeof e?.numItems||e.numItems<0)throw Error(`\`options.numItems\` must be a positive number. Received \`${e?.numItems}\`.`);
1let t=this.takeQuery(),r=e.numItems,i=e.cursor,n=e?.endCursor??null,a=e.maximumRowsRead??null,{page:d,isDone:l,continueCursor:u,splitCursor:c,pageStatus:h}=await o("1.0/queryPage",{query:t,cursor:i,endCursor:n,pageSize:r,maximumRowsRead:a,maximumBytesRead:e.maximumBytesRead,version:f.r});return{page:d.map(e=>(0,s.du)(e)),isDone:l,continueCursor:u,splitCursor:c,pageStatus:h}}async collect(){let e=[];for await(let t of this)e.push(t);return e}async take(e){v(e,1,"take","n");if(!Number.isInteger(e)||e<0)throw TypeError("Arg 1 `n` to `take` must be a non-negative integer");return this.limit(e).collect()}async first(){let e=await this.take(1);return 0===e.length?null:e[0]}async unique(){let e=await this.take(2);if(0===e.length)return null;if(2===e.length)throw Error(`unique() query returned more than one result from table ${this.tableNameForErrorMessages}: 2 [${e[0]._id}, ${e[1]._id}, ...]`);return e[0]}}var I=r(36021);I.v.object({numItems:I.v.number(),cursor:I.v.union(I.v.string(),I.v.null()),endCursor:I.v.optional(I.v.union(I.v.string(),I.v.null())),id:I.v.optional(I.v.number()),maximumRowsRead:I.v.optional(I.v.number()),maximumBytesRead:I.v.optional(I.v.number())});var $=r(45502),q=Object.defineProperty;let k=()=>(function e(t,r){return new Proxy({},{get(s,i){if("string"==typeof i)return e(t,[...r,i]);if(i===d.QY){if(r.length<1){let e=[t,...r].join(".");throw Error(`API path is expected to be of the form \`${t}.childComponent.functionName\`. Found: \`${e}\``)}return"_reference/childComponent/"+r.join("/")}}})})("components",[]);var E=Object.defineProperty,F=(e,t,r)=>((e,t,r)=>t in e?E(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class C{constructor(e){F(this,"indexes"),F(this,"stagedDbIndexes"),F(this,"searchIndexes"),F(this,"stagedSearchIndexes"),F(this,"vectorIndexes"),F(this,"stagedVectorIndexes"),F(this,"validator"),this.indexes=[],this.stagedDbIndexes=[],this.searchIndexes=[],this.stagedSearchIndexes=[],this.vectorIndexes=[],this.stagedVectorIndexes=[],this.validator=e}" indexes"(){return this.indexes}index(e,t){return Array.isArray(t)?this.indexes.push({indexDescriptor:e,fields:t}):t.staged?this.stagedDbIndexes.push({indexDescriptor:e,fields:t.fields}):this.indexes.push({indexDescriptor:e,fields:t.fields}),this}searchIndex(e,t){return t.staged?this.stagedSearchIndexes.push({indexDescriptor:e,searchField:t.searchField,filterFields:t.filterFields||[]}):this.searchIndexes.push({indexDescriptor:e,searchField:t.searchField,filterFields:t.filterFields||[]}),this}vectorIndex(e,t){return t.staged?this.stagedVectorIndexes.push({indexDescriptor:e,vectorField:t.vectorField,dimensions:t.dimensions,filterFields:t.filterFields||[]}):this.vectorIndexes.push({indexDescriptor:e,vectorField:t.vectorField,dimensions:t.dimensions,filterFields:t.filterFields||[]}),this}self(){return this}export(){let e=this.validator.json;if("object"!=typeof e)throw Error("Invalid validator: please make sure that the parameter of `defineTable` is valid (see https://docs.convex.dev/database/schemas)");return{indexes:this.indexes,stagedDbIndexes:this.stagedDbIndexes,searchIndexes:this.searchIndexes,stagedSearchIndexes:this.stagedSearchIndexes,vectorIndexes:this.vectorIndexes,stagedVectorIndexes:this.stagedVectorIndexes,documentType:e}}}function j(e){return new C((0,I.d)(e)?e:I.v.object(e))}class S{constructor(e,t){F(this,"tables"),F(this,"strictTableNameTypes"),F(this,"schemaValidation"),this.tables=e,this.schemaValidation=t?.schemaValidation===void 0||t.schemaValidation}export(){return JSON.stringify({tables:Object.entries(this.tables).map(([e,t])=>{let{indexes:r,stagedDbIndexes:s,searchIndexes:i,stagedSearchIndexes:n,vectorIndexes:a,stagedVectorIndexes:o,documentType:d}=t.export();return{tableName:e,indexes:r,stagedDbIndexes:s,searchIndexes:i,stagedSearchIndexes:n,vectorIndexes:a,stagedVectorIndexes:o,documentType:d}}),schemaValidation:this.schemaValidation})}}new S({_scheduled_functions:j({name:I.v.string(),args:I.v.array(I.v.any()),scheduledTime:I.v.float64(),completedTime:I.v.optional(I.v.float64()),state:I.v.union(I.v.object({kind:I.v.literal("pending")}),I.v.object({kind:I.v.literal("inProgress")}),I.v.object({kind:I.v.literal("success")}),I.v.object({kind:I.v.literal("failed"),error:I.v.string()}),I.v.object({kind:I.v.literal("canceled")}))}),_storage:j({sha256:I.v.string(),size:I.v.float64(),contentType:I.v.optional(I.v.string())})},void 0)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.