PageSourceSearch

https://www.n7.education/assets/topics-BRiBAZUj.js

js n7.education collected 2026-10-10 00:21:01 UTC 3,388 bytes, 59 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0f4db-76da-7031-9c12-e77b01577ea8")}catch(e){}}();import{Bn as e,Vn as t,ot as n,st as r}from"./auth-BkqRpX8G.js";import{t as i}from"./infiniteQueryOptions-Dfvzj6n2.js";import{t as a}from"./compiler-runtime-rsGP3YMw.js";var o=a(),s=500;async function c(e,{search:t,syllabusId:n,parentId:i,type:a,page:o,limit:s},c){let{from:l,to:u}=r(o,s),d=e.rpc(`search_topics`,{search:t},{count:`exact`});n&&(d=d.eq(`syllabus_id`,n)),i&&(d=d.eq(`parent_id`,i)),a&&(d=d.eq(`type`,a)),c&&(d=d.abortSignal(c));let{data:f,count:p,error:m}=await d.select(`
2      id,
3      type,
4      parentId:parent_id,
5      parentIds:parent_ids,
6      label,
7      title,
8      notes,
9      group,
10      purpose,
11      level,
12      syllabusId:syllabus_id,
13      syllabus:syllabuses!topics_syllabus_id_fkey(
14        id,
15        name,
16        course,
17        accreditationPeriod:accreditation_period,
18        topicLabel:topic_label,
19        subtopicLabel:subtopic_label,
20        assessmentStatementLabel:assessment_statement_label,
21        purposeLabel:purpose_label,
22        notesLabel:notes_label
23      )
24    `).range(l,u).returns();if(m)throw m;return{topics:f??[],count:p??0}}var l=(e,t)=>i({queryKey:[`topics`,t&&{search:t.search,syllabusId:t.syllabusId,parentId:t.parentId,type:t.type,limit:t.limit}],queryFn:({signal:n,pageParam:r})=>c(e,{...t,page:r,limit:t?.limit??s},n),initialPageParam:0,getNextPageParam:(e,n)=>e.topics.length<(t?.limit??s)?void 0:n.length});async function u(e,t,n){let r=e.from(`syllabuses`).select(`
25        id,
26        name,
27        course,
28        accreditationPeriod:accreditation_period,
29        topicLabel:topic_label,
30        subtopicLabel:subtopic_label,
31        assessmentStatementLabel:assessment_statement_label,
32        purposeLabel:purpose_label,
33        notesLabel:notes_label,
34        topics:visible_topics!topics_syllabus_id_fkey!inner(id,
35          type,
36          parentId:parent_id,
37          parentIds:parent_ids,
38          label,
39          title,
40          notes,
41          group,
42          purpose,
43          level,
44          syllabus_id,
45          label_sort,
46          syllabus:syllabuses!topics_syllabus_id_fkey(
47            id,
48            name,
49            course,
50            accreditationPeriod:accreditation_period,
51            topicLabel:topic_label,
52            subtopicLabel:subtopic_label,
53            assessmentStatementLabel:assessment_statement_label,
54            purposeLabel:purpose_label,
55            notesLabel:notes_label
56          )
57        )
58      `).in(`visible_topics.id`,t).order(`label_sort`,{ascending:!0,referencedTable:`visible_topics`}).returns();n&&(r=r.abortSignal(n));let{data:i,count:a,error:o}=await r;if(o)throw o;return{syllabuses:i??[],count:a??0}}var d=(e,n)=>t({queryKey:[`selectedTopics`,n],queryFn:({signal:t})=>u(e,n,t)});function f({topicIdToRemove:e,topicIds:t},r){return n(`/topics/filter`,`POST`,{topicIdToRemove:e,topicIds:t},r)}var p=()=>{let t=(0,o.c)(1),n;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={mutationFn:m},t[0]=n):n=t[0],e(n)};function m(e){return f(e)}export{p as i,l as n,d as r,u as t};
59//# chunkId=01a0f4db-76da-7031-9c12-e77b01577ea8

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.