1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7716],{1217:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSchedulerAnswerPreview=function(e,t=new Date,n){return{again:i((0,r.scheduleCardReview)(e,a.CARD_RATINGS.AGAIN,t,n),t),hard:i((0,r.scheduleCardReview)(e,a.CARD_RATINGS.HARD,t,n),t),good:i((0,r.scheduleCardReview)(e,a.CARD_RATINGS.GOOD,t,n),t),easy:i((0,r.scheduleCardReview)(e,a.CARD_RATINGS.EASY,t,n),t)}},t.formatScheduledDue=i;let a=n(60744),r=n(16864);function i(e,t=new Date){if("review"===e.queue&&e.intervalDays>=1)return`${e.intervalDays}d`;let n=e.learningDueAt??e.due;if(!n)return"Now";let a=Math.ceil(Math.max(0,n.getTime()-t.getTime())/6e4);if(a<60)return`${a}m`;let r=Math.ceil(a/60);if(r<24)return`${r}h`;let s=Math.ceil(r/24);return`${s}d`}},2305:(e,t)=>{function n(e,t){for(let n of t)if(!(e<n.min)&&(null===n.max||e<n.max))return n.key;return null}Object.defineProperty(t,"__esModule",{value:!0}),t.EASE_HISTOGRAM_BUCKETS=t.INTERVAL_HISTOGRAM_BUCKETS=t.MATURE_INTERVAL_DAYS=void 0,t.classifyCardMaturity=function(e,n){return"new"===e?"new":"learning"===e?"learning":n>=t.MATURE_INTERVAL_DAYS?"mature":"young"},t.bucketKeyFor=n,t.buildHistogram=function(e,t){let a=new Map(t.map(e=>[e.key,0]));for(let r of e){let e=n(r.value,t);null!==e&&a.set(e,(a.get(e)??0)+r.count)}return t.map(e=>({...e,count:a.get(e.key)??0}))},t.MATURE_INTERVAL_DAYS=21,t.INTERVAL_HISTOGRAM_BUCKETS=[{key:"1d",label:"1 day",min:1,max:2},{key:"2-3d",label:"2â3 days",min:2,max:4},{key:"4-7d",label:"4â7 days",min:4,max:8},{key:"8-14d",label:"1â2 weeks",min:8,max:15},{key:"15-30d",label:"2â4 weeks",min:15,max:31},{key:"31-90d",label:"1â3 months",min:31,max:91},{key:"91-180d",label:"3â6 months",min:91,max:181},{key:"181-365d",label:"6â12 months",min:181,max:366},{key:"365d+",label:"1 year+",min:366,max:null}],t.EASE_HISTOGRAM_BUCKETS=[{key:"lt1500",label:"< 1.5\xd7",min:0,max:1500},{key:"1500-1799",label:"1.5â1.8\xd7",min:1500,max:1800},{key:"1800-2099",label:"1.8â2.1\xd7",min:1800,max:2100},{key:"2100-2399",label:"2.1â2.4\xd7",min:2100,max:2400},{key:"2400-2599",label:"2.4â2.6\xd7",min:2400,max:2600},{key:"2600-2899",label:"2.6â2.9\xd7",min:2600,max:2900},{key:"2900+",label:"2.9\xd7+",min:2900,max:null}]},8887:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PLAN_SOURCES=t.PLAN_TYPES=void 0,t.PLAN_TYPES=["free","pro"],t.PLAN_SOURCES=["none","stripe","revenuecat","manual"]},9857:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FSRS_TUNED_PARAMETER_INDICES=t.FSRS_OPTIMIZER_MIN_IMPROVEMENT=t.FSRS_OPTIMIZER_MIN_CARDS=t.FSRS_OPTIMIZER_MIN_PREDICTIONS=void 0,t.evaluateFsrsParameters=o,t.optimizeFsrsParameters=function(e){let n=o(e,a.FSRS_DEFAULT_PARAMETERS),r=function(e){let t=0;for(let n of e){let e=n.reviews.map(e=>e.reviewedAt.getTime()).sort((e,t)=>e-t);e.some((t,n)=>n>0&&(t-e[n-1])/864e5>=1)&&(t+=1)}return t}(e),l={parameters:[...a.FSRS_DEFAULT_PARAMETERS],cardCount:r,predictionCount:n.predictionCount,requiredCards:t.FSRS_OPTIMIZER_MIN_CARDS,requiredPredictions:t.FSRS_OPTIMIZER_MIN_PREDICTIONS,baseline:n,optimized:n};if(n.predictionCount<t.FSRS_OPTIMIZER_MIN_PREDICTIONS||r<t.FSRS_OPTIMIZER_MIN_CARDS)return{...l,status:"insufficient_history"};let u=[...a.FSRS_DEFAULT_PARAMETERS],c=n.logLoss;for(let n of s)for(let a of t.FSRS_TUNED_PARAMETER_INDICES){let t=i[a];for(let r of[1+n,1-n]){var d,T,m;let n=(d=u[a]*r,T=t.min,m=t.max,Number.isFinite(d)?Math.max(T,Math.min(m,d)):T);if(n===u[a])continue;let i=[...u];i[a]=n;let s=o(e,i).logLoss;s<c&&(u=i,c=s)}}let _=o(e,u);return n.logLoss-_.logLoss<t.FSRS_OPTIMIZER_MIN_IMPROVEMENT?{...l,status:"no_improvement"}:{...l,status:"optimized",parameters:u,optimized:_}};let a=n(86307),r=n(60744);t.FSRS_OPTIMIZER_MIN_PREDICTIONS=400,t.FSRS_OPTIMIZER_MIN_CARDS=50,t.FSRS_OPTIMIZER_MIN_IMPROVEMENT=.002,t.FSRS_TUNED_PARAMETER_INDICES=Object.freeze([0,1,2,3,8,9,10,11,14,15,16]);let i={0:{min:.01,max:60},1:{min:.01,max:60},2:{min:.01,max:100},3:{min:.01,max:200},8:{min:0,max:3},9:{min:0,max:.8},10:{min:.01,max:3.5},11:{min:.1,max:5},14:{min:0,max:5},15:{min:.05,max:1},16:{min:1,max:6}},s=[.5,.3,.18,.1,.05,.025];function o(e,t){let n=0,i=0,s=0;for(let l of e){let e=[...l.reviews].sort((e,t)=>
1e.reviewedAt.getTime()-t.reviewedAt.getTime());if(e.length<2)continue;let u=(0,a.fsrsInitialMemory)(e[0].rating,t),c=e[0].reviewedAt.getTime();for(let l=1;l<e.length;l+=1){let d=e[l],T=(d.reviewedAt.getTime()-c)/864e5;if(T>=1){var o;let e=Number.isFinite(o=(0,a.fsrsRetrievability)(T,u.stability))?Math.max(1e-6,Math.min(.999999,o)):.999999,t=+(d.rating!==r.CARD_RATINGS.AGAIN);i-=t*Math.log(e)+(1-t)*Math.log(1-e),s+=(e-t)**2,n+=1}u=(0,a.fsrsNextMemory)(u,d.rating,T,t),c=d.reviewedAt.getTime()}}return 0===n?{predictionCount:0,logLoss:0,rmse:0}:{predictionCount:n,logLoss:i/n,rmse:Math.sqrt(s/n)}}if(a.FSRS_DEFAULT_PARAMETERS.length!==a.FSRS_PARAMETER_COUNT)throw Error("FSRS default parameter vector does not match FSRS_PARAMETER_COUNT")},11725:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.STUDY_CHAT_ACTION_MARKER=void 0,t.summarizeCardStruggle=i,t.buildStudyAssistantSystemPrompt=function(e={}){let t=["You are Repetio Study Assistant.","Your job is to help the user learn flashcards with concise, accurate, structured explanations.","When helpful, use markdown formatting:","- short headings","- bullet points","- numbered steps","- **bold** key terms","Write mathematics as LaTeX between $...$ (inline) or $$...$$ (display) â it is typeset for the user. Never put a LaTeX command outside those delimiters.","Prefer short, high-signal answers unless the user asks for depth.","If the user asks about the current flashcard, prioritize the provided flashcard context.","If asked for memory help, provide mnemonics and retrieval cues.","If uncertain, state uncertainty clearly instead of guessing.","","You can see things no outside chatbot can, and you are expected to use them:",'- The card\'s review history. When the user asks "why do I keep getting this wrong", answer it concretely from the lapse count and the recent grades: say what the pattern is, name the most likely reason (the card tests two things at once, the wording is ambiguous, it is being confused with a named sibling card, or it was simply never understood), and give one concrete fix.',"- The deck around the card. If a sibling question is likely being confused with this one, name it and draw the distinction.","- Where the card came from. If the user asks where a claim came from, cite the document and heading you were given, and say what else was in that section. Never invent a source you were not given.","Do not repeat the review statistics back as a list. Interpret them."];return e.canAct&&t.push("","You can also act on the deck, by calling the tools you have been given: create a new card from the conversation, propose a rewrite of a card that is badly worded, or suspend a card that is broken or a duplicate.","Rules for acting:","- Only act when the user asks you to, or after you have asked and they have agreed. Never act on your own initiative mid-explanation.","- Take one action per turn, then say plainly what you did.","- If an action fails, say so; do not claim it succeeded."),t.join("\n")},t.buildStudyAssistantUserPrompt=function(e,t){var n,o;let l,u,c,d,T=e.trim();if(!t)return`User question: 2${T}`;let m=[["Current flashcard context:",`Card ID: ${t.cardId}`,`Note type: ${t.noteType}`,`Front: 3${t.front}`,`Back: 4${t.back}`,"Fields:",s(t.fields)||"- (none)"].join("\n")],_=(0,a.formatCardSourceForPrompt)(t.source??null);return _&&m.push(_),t.performance&&m.push((l=(n=t.performance).recentGrades.slice(-8),u=["Review history for this card (this user only):",`- Reviews so far: ${n.reps}`,`- Lapses (times forgotten after learning it): ${n.lapses}`,`- Current interval: ${n.intervalDays} day${1===n.intervalDays?"":"s"}`,`- Ease factor: ${Math.round(n.easeFactor/10)}%`],l.length>0&&u.push(`- Recent answers, oldest first: ${l.map(e=>r[e]).join(", ")}`),void 0!==n.medianSecondsPerReview&&u.push(`- Typical time on this card: ${n.medianSecondsPerReview}s`),n.lastReviewedAt&&u.push(`- Last reviewed: ${n.lastReviewedAt}`),n.isLeech&&u.push("- Tagged as a leech."),(c=i(n))&&u.push(`- In plain terms: ${c}`),u.join("\n"))),t.deck&&m.push((o=t.deck,d=["Deck context:",`- Deck: ${o.name} (${o.cardCount} cards)`],o.siblingQuestions.length>0&&(d.push("- Other cards in this deck:"),d.push(...o.siblingQuestions.map(e=>` ⢠${e}`))),o.troubleQuestions.length>0&&(d.push("- Cards in this deck the user also struggles with:"),d.push(...o.troubleQuestions.map(e=>` ⢠${e}`))),d.join("\n"))),m.push(["User question:",T].join("\n")),m.join("\n\n")},t.buildStudyQuestionSuggestionsSystemPrompt=function(){return'You write the two questions a student is most likely to want to ask a tutor about the flashcard they are looking at.\nRules:\n- Write exactly two questions.\n- Each question must be at most 36 characters, including space
4s. They sit side by side on a single narrow row, so brevity matters more than completeness.\n- Write them in the student\'s own voice, addressed to the tutor.\n- Make every question specific to this card\'s subject matter. Never write filler such as "Explain this card" or "Tell me more".\n- Vary the angle across the two: one asks for an explanation or for why something works, the other asks for a memory aid or clears up a likely confusion.\n- Do not number them, do not add quotes, and do not add trailing punctuation beyond the question mark.'},t.buildStudyQuestionSuggestionsUserPrompt=function(e){let t=[["Flashcard the student is studying:",`Note type: ${e.noteType}`,`Front: 5${e.front}`,`Back: 6${e.back}`,"Fields:",s(e.fields)||"- (none)"].join("\n")],n=i(e.performance);return n&&t.push(["How this student is doing with this card:",n,"One of the two questions should be about why they keep getting it wrong, or how to finally remember it."].join("\n")),t.push("The student can already see the answer, so do not simply ask them to restate it.\nWrite questions that would deepen their understanding of this material."),t.join("\n\n")};let a=n(48637);t.STUDY_CHAT_ACTION_MARKER="\0notepilot-actions\0";let r={1:"Again",2:"Hard",3:"Good",4:"Easy"};function i(e){if(!e||0===e.reps&&0===e.recentGrades.length)return null;let t=e.recentGrades.slice(-8),n=t.filter(e=>1===e).length,a=e.easeFactor<=1300;if(!(!0===e.isLeech||e.lapses>=3||n>=2||a))return null;let r=[];return e.isLeech?r.push(`This card is a leech: it has been forgotten ${e.lapses} times and keeps coming back.`):e.lapses>0&&r.push(`The user has forgotten this card ${e.lapses} time${1===e.lapses?"":"s"} since first learning it.`),n>0&&t.length>0&&r.push(`They pressed Again on ${n} of the last ${t.length} reviews.`),a&&r.push("Its ease has bottomed out, so the scheduler already treats it as one of their hardest cards."),r.join(" ")}function s(e){return Object.entries(e).map(([e,t])=>`- ${e}: ${t}`).join("\n")}},11826:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAG_SEGMENT_PATTERN=t.MAX_TAG_LENGTH=t.TAG_SEPARATOR=void 0,t.normalizeTag=r,t.normalizeTags=function(e){if(!Array.isArray(e))return[];let t=new Set,n=[];for(let a of e){let e=r(a);if(!e)continue;let i=e.toLowerCase();t.has(i)||(t.add(i),n.push(e))}return n},t.normalizeTagInput=l,t.normalizeTagInputs=u,t.normalizeGeneratedTags=function(e,n=3){return Array.isArray(e)?u(e.filter(e=>"string"==typeof e).map(e=>e.split(t.TAG_SEPARATOR).filter(e=>e.trim().length>0).pop()??"")).slice(0,Math.max(0,n)):[]},t.foldTagVariants=function(e){let t=new Map;for(let n of e)for(let e of n)t.set(e,(t.get(e)??0)+1);let n=new Map;for(let[e,a]of t){let r=c(e),i=n.get(r);(!i||a>(t.get(i)??0))&&n.set(r,e)}return e.map(e=>{let t=new Set,a=[];for(let r of e){let e=n.get(c(r))??r;t.has(e)||(t.add(e),a.push(e))}return a})},t.tagLookupNames=function(e){let t=new Set,n=[];for(let a of[l(e),r(e)]){if(!a)continue;let e=a.toLowerCase();t.has(e)||(t.add(e),n.push(a))}return n},t.tagAncestors=d,t.tagWithAncestors=function(e){return[...d(e),e]},t.tagLeafName=function(e){let n=e.split(t.TAG_SEPARATOR);return n[n.length-1]??e},t.isTagOrDescendantOf=T,t.renameTagPath=function(e,n,a){if(!T(e,n))return null;let r=e.slice(n.length),i=`${a}${r}`;return i.length>t.MAX_TAG_LENGTH?null:i},t.TAG_SEPARATOR="::",t.MAX_TAG_LENGTH=200;let n=/\s+/gu,a=/[�-��-Â]/gu;function r(e){if("string"!=typeof e)return null;let r=e.replace(n,"_").replace(a,"").split(t.TAG_SEPARATOR).map(e=>e.replace(/^_+|_+$/g,"")).filter(e=>e.length>0);if(0===r.length)return null;let i=r.join(t.TAG_SEPARATOR);return i.length>t.MAX_TAG_LENGTH?null:i}t.TAG_SEGMENT_PATTERN=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;let i=[[/ø/g,"o"],[/æ/g,"ae"],[/Ã¥/g,"a"],[/Ã/g,"ss"],[/ð/g,"d"],[/þ/g,"th"]],s=/\p{Diacritic}/gu,o=/[^a-z0-9]+/gu;function l(e){if("string"!=typeof e)return null;let n=i.reduce((e,[t,n])=>e.replace(t,n),e.toLowerCase()).normalize("NFKD").replace(s,"").split(t.TAG_SEPARATOR).map(e=>e.replace(o,"-").replace(/^-+|-+$/g,"")).filter(e=>e.length>0);if(0===n.length)return null;let a=n.join(t.TAG_SEPARATOR);return a.length>t.MAX_TAG_LENGTH?null:a}function u(e){if(!Array.isArray(e))return[];let t=new Set,n=[];for(let a of e){let e=l(a);!e||t.has(e)||(t.add(e),n.push(e))}return n}function c(e){return e.replace(/-/g,"").replace(/s$/,"")}function d(e){let n=e.split(t.TAG_SEPARATOR),a=[];for(let e=1;e<n.length;e+=1)a.push(n.slice(0,e).join(t.TAG_SEPARATOR));return a}function T(e,n){let a=e.toLowerCase(),r=n.toLowerCase();return a===r||a.startsWith(`${r}${t.TAG_SEPARATOR}`)}},12783:(e,t)=>
6{Object.defineProperty(t,"__esModule",{value:!0}),t.CARD_REFINE_PRESET_DEFAULT_TEXT=t.CARD_REFINE_PRESET_EXAMPLE_TEXT=t.CARD_REFINE_PRESET_FIX_TEXT=t.CARD_REFINE_PRESET_BASIC_TEXT=t.CARD_REFINE_PRESET_CLOZE_TEXT=t.CARD_REFINE_PRESET_SIMPLER_TEXT=t.CARD_REFINE_PRESET_SHORTER_TEXT=t.CARD_REFINE_CLOSING_TEXT=t.CARD_REFINE_SIBLINGS_TEXT=t.CARD_REFINE_LANGUAGE_TEXT=t.CARD_REFINE_TARGET_CLOZE_TEXT=t.CARD_REFINE_TARGET_BASIC_TEXT=t.CARD_REFINE_TARGET_TYPE_TEXT=t.CARD_REFINE_INSTRUCTION_TEXT=t.CARD_REFINE_CARD_TEXT=t.CARD_REFINE_SYSTEM_PROMPT_TEXT=t.FLASHCARD_CLOSING_TEXT=t.FLASHCARD_PARSED_SOURCE_TEXT=t.FLASHCARD_SOURCE_HEADER_TEXT=t.FLASHCARD_GAP_FILL_TEXT=t.FLASHCARD_EXISTING_TAGS_TEXT=t.FLASHCARD_TAG_POLICY_TEXT=t.FLASHCARD_SOURCE_ATTRIBUTION_TEXT=t.FLASHCARD_NO_EXISTING_CARDS=t.FLASHCARD_EXISTING_CARDS_TEXT=t.FLASHCARD_NO_CUSTOM_INSTRUCTIONS=t.FLASHCARD_CUSTOM_INSTRUCTIONS_TEXT=t.FLASHCARD_ANSWER_LONGFORM_TEXT=t.FLASHCARD_ANSWER_CONCISE_TEXT=t.FLASHCARD_MATH_POLICY_TEXT=t.FLASHCARD_LANG_AUTO_TEXT=t.FLASHCARD_LANG_SELECTED_TEXT=t.FLASHCARD_CARDTYPE_CLOZE_TEXT=t.FLASHCARD_CARDTYPE_BASIC_TEXT=t.FLASHCARD_COUNT_AUTO_TEXT=t.FLASHCARD_COUNT_FIXED_TEXT=t.FLASHCARD_INVENTORY_TEXT=t.FLASHCARD_CHUNK_CONTEXT_TEXT=t.FLASHCARD_ATTACHED_FILE_TEXT=t.FLASHCARD_SOURCE_META_TEXT=t.FLASHCARD_SYSTEM_PROMPT_TEXT=void 0,t.FLASHCARD_SYSTEM_PROMPT_TEXT=`You turn study material into flashcards for spaced-repetition memorisation. The student will review every card many times, so each card must test one fact and be answerable from memory in a few seconds. 7 8How to work: 91) Read the whole source first. 102) Inventory every testable fact in the source, in source order. A fact is one thing a student could be asked and answer from memory: a definition, a criterion, a value with its unit, a dose, a route, an interval, a threshold, an indication, a step, a list (symptoms, causes, differentials, treatment steps), a mechanism, a contrast. Cover every section, including the opening definition or criteria, tables, lists, figures, differentials and follow-up. Skip only what nobody studies: titles, authors, dates, references, page furniture, logistics. 113) Write the cards from the inventory: one card per fact. 12 13Card rules: 14- One fact per card. A sentence that gives a dose, a route and a repeat interval is three cards. 15- Split variants into separate cards: adult vs child, each age or weight band, each route, each tier or stage. 16- For a list in the source, write one card that asks for the whole list, plus one card for each item that carries its own details (a dose, a route, a criterion). An item that is only a name in the list gets no card of its own, and never ask for "one of" the items. 17- When the source groups items under labels (e.g. "Skin: â¦", "Airways: â¦", "Circulation: â¦"), each labelled group is its own list card. Never merge groups into one card. 18- A list answer contains every item the source lists for it, in the source's wording. Never shorten a list to its first items. 19- Questions are short and specific, and read like something a teacher would ask. Telegraphic is fine ("First-line treatment of anaphylaxis in children?"), but never a "Label: field?" fragment ("Children secondary: fluid volume?"). Every question names its topic and, where it matters, the population, so it still makes sense in a shuffled deck ("How much fluid is given to children with anaphylaxis?"). 20- The answer is the shortest complete answer: a term, a value with its unit, or a list. Never a sentence that repeats the question. No preamble, and no explanation the question did not ask for. 21- "Complete" means a value keeps what the source attaches to it: its unit, route, dilution, maximum or condition ("0,5 ml in 2 ml NaCl", "0,01 mg/kg, max 0,5 mg"). 22- Copy numbers, units, doses, routes, intervals and names exactly as the source writes them. Never add a fact, number, route or unit the source does not state, and never "correct" the source. 23- Minimal HTML only (p, br, ul, ol, li, b/strong, i/em, sup, sub). Use <ul><li> for an answer with three or more items. Bold the key value or term of an answer. 24 25Examples. They show the form only: they are in English, but you write in the language the language policy names, never in the language of these examples. The rules are the same for every subject. 26Bad (three facts in one card, and the answer repeats the question): 27 Q: What is the primary treatment for adults with anaphylaxis? 28 A: The primary treatment for adults with anaphylaxis is 0.5 mg adrenaline given intramuscularly, which can be repeated after 5 minutes. 29Good (one fact each): 30 Q: First-line treatment of anaphylaxis in adults? A: <b>Adrenaline 0.5 mg</b> i.m. 31 Q: Injection site for i.m. adrenaline in adults? A: Lateral thigh, buttock or deltoid 32 Q: How often can adrenaline be repeated in anaphylaxis? A: Every <b>5 minutes</b> 33Good (a list card): 34 Q: Second-line treatment of anaphylaxis in adults? 35 A: <ul><li>Positioning</li><li>Fluids</li><li>Oxygen</li><li>β<sub>2</sub>-agonist</li></ul> 36Good (any subject): 37 Q: Year the Berlin Wall fell? A: <b>1989</b> 38 39Priority policy: 40- Follow the user's custom instructions at high priority. 41- Never violate the hard constraints: output schema, card type, card count policy, language policy and math policy. 42 43Output: valid JSON matching the provided strict schema. No markdown fences, no commentary.`,t.FLASHCARD_SOURCE_META_TEXT=`Source metadata: 44- Source filename: {{SOURCE_FILE}} 45- Declared file type: {{FILE_TYPE}}`,t.FLASHCARD_ATTACHED_FILE_TEXT="The original file is attached. Use it for anything the parsed text below lost: tables, figures, labels, emphasis and layout. Where they disagree on a word or number, trust the attached file.",t.FLASHCARD_CHUNK_CONTEXT_TEXT=`Document section context: 46- This is section {{CHUNK_INDEX}} of {{CHUNK_TOTAL}} from one larger document. Other sections are handled separately. 47- Inventory and cover every fact in THIS section, and only this
47section. 48- The whole document's headings, for context only (do not write cards from them): 49{{DOCUMENT_OUTLINE}} 50- Name the document's topic in your questions, so a card from this section still makes sense on its own.`,t.FLASHCARD_INVENTORY_TEXT=`Fact inventory: 51- Fill "facts" before "cards": every testable fact in the content below, in source order, each as a short phrase (e.g. "adult adrenaline dose", "differentials: shock states"). 52- Set each card's "fact" to the 1-based number of the fact it tests.`,t.FLASHCARD_COUNT_FIXED_TEXT=`Card count policy: 53Count mode: fixed ({{FIXED_COUNT}} cards). 54Return exactly {{FIXED_COUNT}} cards. Inventory every fact anyway, then write cards for the most important facts first.`,t.FLASHCARD_COUNT_AUTO_TEXT=`Card count policy: 55Count mode: auto (complete coverage). 56Write one card for every fact in your inventory. There is no target number: a dense page can need 40 cards, a sparse one 5. 57Never merge facts to save cards, and never pad with cards the source does not support. 58Return at most {{AUTO_MAX}} cards. If the content holds more facts than that, cover the most important ones.`,t.FLASHCARD_CARDTYPE_BASIC_TEXT=`Card type policy: 59Card type: basic only. 60For every card, question_html and answer_html must both be present and meaningful. 61Do not emit cloze notation.`,t.FLASHCARD_CARDTYPE_CLOZE_TEXT=`Card type policy: 62Card type: cloze only. 63Each question_html is one short statement with valid Anki cloze markers like {{c1::...}}. 64Delete only the shortest span that tests the fact: the value, the term, the name. One fact per card. 65answer_html is optional context and can be empty. 66Do not emit basic Q/A cards.`,t.FLASHCARD_LANG_SELECTED_TEXT=`Language policy: 67Required output language: {{LANGUAGE}}. 68Both question_html and answer_html must be in {{LANGUAGE}}. 69Source-native technical terms from a secondary language are allowed only when needed for c
69orrectness.`,t.FLASHCARD_LANG_AUTO_TEXT=`Language policy: 70Language policy (auto): infer primary and secondary language from the source. 71Output every question and every answer in the primary source language, even though these instructions and their examples are in English. 72Do not introduce languages that are not present in the source. 73Secondary language terms are allowed only for source-native technical terminology.`,t.FLASHCARD_MATH_POLICY_TEXT=`Math policy: 74- Render mathematics only with $...$ (inline) and $$...$$ (display). 75- Never emit \\(...\\) or \\[...\\] delimiters. 76- Never place raw LaTeX commands outside math delimiters. 77- Every backslash is JSON string data: write it as \\\\ so \\\\tan, \\\\theta and \\\\frac survive parsing. A single backslash before b, f, n, r or t is a JSON escape and destroys the command.`,t.FLASHCARD_ANSWER_CONCISE_TEXT=`Answer length policy: 78- An answer is a term, a value with its unit, or a list. Aim for 15 words or fewer. 79- Give only what the student must recall. Never restate the question ("X is characterised by â¦"). 80- A list answer is <ul><li> items of a few words each.`,t.FLASHCARD_ANSWER_LONGFORM_TEXT=`Answer length policy: 81- The user asked for longer answers, so an answer may explain as well as state. 82- Still lead with the fact itself, keep it exam-relevant and free of filler, and keep one fact per card.`,t.FLASHCARD_CUSTOM_INSTRUCTIONS_TEXT=`User custom instructions (high priority within hard constraints): 83{{CUSTOM_INSTRUCTIONS}}`,t.FLASHCARD_NO_CUSTOM_INSTRUCTIONS="No additional custom instructions.",t.FLASHCARD_EXISTING_CARDS_TEXT=`Existing cards already in this deck: 84{{EXISTING_CARDS}} 85- Avoid duplicates and near-duplicates of these existing cards.`,t.FLASHCARD_NO_EXISTING_CARDS="No cards exist in this deck yet.",t.FLASHCARD_SOURCE_ATTRIBUTION_TEXT=`Source attribution: 86The content below is organised under these headings: 87{{SECTION_HEADINGS}} 88- For every card, set source_heading to the heading whose material that card was written from. 89- Copy the heading exactly as it appears in the list above. Do not reword, shorten or translate it. 90- If a card's material does not sit under any listed heading, set source_heading to an empty string. Never invent a heading.`,t.FLASHCARD_TAG_POLICY_TEXT=`Tagging: 91Give every card a tags array. Tags are how the student later filters and groups cards to study one topic, so a tag is only useful if it separates some cards from others. 92- Give each card 1 to 3 tags: its subject area (e.g. "pharmacology") and the specific topic it tests (e.g. "anaphylaxis"). Add a second topic only when the card genuinely spans two, e.g. a card on the adrenaline dose for anaphylactic shock gets "anaphylaxis" and "pharmacology". 93- Write tags in the same language as the cards. In a Norwegian deck that card gets "anafylaksi" and "farmakologi". 94- Lowercase, words joined with hyphens: "beta-blocker", not "Beta Blocker". No spaces, no "#", no "::". 95- One spelling per concept across the whole deck: prefer the singular noun and the common term over a synonym, and reuse a tag you already gave another card instead of coining a variant. 96- Tag the content, never the card or the source: no card type, "important", "exam", "definition", "chapter-3", file names or "flashcard". 97- Do not give every card the same tag. A tag that every card in the deck carries filters nothing. 98{{EXISTING_TAGS}}`,t.FLASHCARD_EXISTING_TAGS_TEXT=`- The student already uses these tags. When one fits a card, use it exactly as written rather than a new spelling: 99{{TAG_LIST}}`,t.FLASHCARD_GAP_FILL_TEXT=`Coverage gap: 100Cards were already written from the content below (listed above as existing cards), but these facts from it still have no card: 101{{MISSING_FACTS}} 102- Write one card for each fact listed, and nothing else. 103- Repeat these facts in "facts" in the same order, and set each card's "fact" to its number.`,t.FLASHCARD_SOURCE_HEADER_TEXT="Generate flashcards from the content below.",t.FLASHCARD_PARSED_SOURCE_TEXT=`Parsed source content: 104{{PARSED_MARKDOWN}}`,t.FLASHCARD_CLOSING_TEXT="Return strict JSON only. No extra text.",t.CARD_REFINE_SYSTEM_PROMPT_TEXT=`You are an expert tutor revising one flashcard that a student already has in their deck. 105 106You are not writing a new deck. You are rewriting one flashcard so it is better at the one thing it is for: making the student recall a single idea. 107 108Hard rules: 109- Return exactly one card. 110- Keep the card about the same subject matter as the original, unless the instruction explicitly says to change it. 111- Follow the instruction precisely. It is the reason the student pressed the button. 112- Keep minimal HTML only (p, br, ul, ol, li, b/strong, i/em, sup, sub). 113- Render mathematics only with $...$ (inline) and $$...$$ (display). Never emit \\(...\\) or \\[...\\], and never place a raw LaTe
113X command outside math delimiters. 114- Every backslash is JSON string data: write it as \\\\ so \\\\tan, \\\\theta and \\\\frac survive parsing. 115- Return valid JSON only that matches the provided strict schema. No markdown fences, no commentary. 116 117Write a one-sentence note explaining what you changed and why, addressed to the student. If you could not honour the instruction, say so there instead of silently returning the card unchanged.`,t.CARD_REFINE_CARD_TEXT=`The card as it stands: 118- Card type: {{CARD_TYPE}} 119- Question: 120{{QUESTION_HTML}} 121- Answer: 122{{ANSWER_HTML}}`,t.CARD_REFINE_INSTRUCTION_TEXT=`What the student asked for: 123{{INSTRUCTION}}`,t.CARD_REFINE_TARGET_TYPE_TEXT="Required output card type: {{TARGET_CARD_TYPE}}.",t.CARD_REFINE_TARGET_BASIC_TEXT="Return a basic question/answer card. question_html and answer_html must both be present and meaningful. Do not emit cloze notation.",t.CARD_REFINE_TARGET_CLOZE_TEXT="Return a cloze card. question_html must contain valid Anki cloze markers like {{c1::...}}. answer_html is optional context and may be empty.",t.CARD_REFINE_LANGUAGE_TEXT="Write the card in {{LANGUAGE}}.",t.CARD_REFINE_SIBLINGS_TEXT=`Other cards already in this deck â the rewrite must not duplicate any of them: 124{{SIBLING_QUESTIONS}}`,t.CARD_REFINE_CLOSING_TEXT="Return strict JSON only. No extra text.",t.CARD_REFINE_PRESET_SHORTER_TEXT="Make this card shorter and more atomic. Cut the question down to the single idea it is testing, and cut the answer to one tight sentence. Do not lose the point of the card.",t.CARD_REFINE_PRESET_SIMPLER_TEXT=`Rewrite this card in plainer language, as if explaining to someone meeting the topic for the first time. Keep it technically correct â simplify the wording, not the facts.`,t.CARD_REFINE_PRESET_CLOZE_TEXT="Convert this card into a cloze deleti
124on. Write the answer as a complete statement and delete the single most testable span with {{c1::...}}. Do not delete more than is needed to test one idea.",t.CARD_REFINE_PRESET_BASIC_TEXT="Convert this cloze card into a plain question and answer. The question must stand on its own without the deleted text.",t.CARD_REFINE_PRESET_FIX_TEXT="The student says this answer is incorrect. Work out what the right answer is from the card and the source material you were given, and rewrite the card so it is correct. If the question itself is what is ambiguous or wrong, fix the question instead. If you cannot tell what the correct answer is, say so in your note rather than guessing.",t.CARD_REFINE_PRESET_EXAMPLE_TEXT="Add a concrete worked example or a memorable retrieval cue to the answer, so the card is easier to recall. Keep the question as it is unless it is what makes the card hard to answer.",t.CARD_REFINE_PRESET_DEFAULT_TEXT="Improve this card. Make it more precise, more atomic and easier to recall, without changing what it is testing."},12845:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_LEECH_ACTION=t.LEECH_TAG=t.DEFAULT_LEECH_THRESHOLD=t.CARD_FLAG_NAMES=t.CARD_FLAGS=void 0,t.isCardFlag=function(e){return"number"==typeof e&&Number.isInteger(e)&&e>=0&&e<=7},t.isLeechAction=function(e){return"suspend"===e||"tag_only"===e},t.normalizeLeechThreshold=function(e){return"number"==typeof e&&Number.isInteger(e)?Math.max(0,e):t.DEFAULT_LEECH_THRESHOLD},t.isLeechLapse=function(e,t){if(!Number.isInteger(e)||!Number.isInteger(t)||t<=0||e<t)return!1;let n=Math.max(1,Math.floor(t/2));return(e-t)%n==0},t.nextDayBoundary=function(e,t){return(0,a.startOfNextStudyDay)(e,{timeZone:t??null,dayStartHour:0})};let a=n(91332);t.CARD_FLAGS={none:0,red:1,orange:2,green:3,blue:4,pink:5,turquoise:6,purple:7},t.CARD_FLAG_NAMES=Object.keys(t.CARD_FLAGS).sort((e,n)=>t.CARD_FLAGS[e]-t.CARD_FLAGS[n]),t.DEFAULT_LEECH_THRESHOLD=8,t.LEECH_TAG="leech",t.DEFAULT_LEECH_ACTION="suspend"},13313:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYMENT_STATUSES=t.SUBSCRIPTION_STATUSES=t.BILLING_INTERVALS=void 0,t.BILLING_INTERVALS=["month","year"],t.SUBSCRIPTION_STATUSES=["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid","paused"],t.PAYMENT_STATUSES=["requires_payment_method","requires_action","processing","requires_capture","canceled","succeeded","draft","open","void","uncollectible","refunded","disputed"]},15630:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FLASHCARD_AMOUNT_CHOICES=t.MAX_AUTO_FLASHCARDS=t.DEFAULT_MAX_FLASHCARDS=void 0,t.DEFAULT_MAX_FLASHCARDS=150,t.MAX_AUTO_FLASHCARDS=300,t.FLASHCARD_AMOUNT_CHOICES=[10,25,50,75,100,150].filter(e=>e<=t.DEFAULT_MAX_FLASHCARDS)},16864:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createInitialSchedulerState=function(e=new Date,t){let{config:n,dayContext:a}=d(t);return{queue:"new",intervalDays:0,easeFactor:n.startingEase,reps:0,lapses:0,due:(0,s.studyDayDate)(e,a),learningDueAt:null,learningStep:0,relearning:!1,graduatingIntervalDays:null}},t.scheduleCardReview=function(e,t,n=new Date,i){var f,S,y,R;let D=d(i);if("fsrs"===D.config.algorithm)return function(e,t,n,{config:r,dayContext:i}){let l=r.fsrsParameters,u=e.reps+1,c=m(e.easeFactor,r),d={..."new"===e.queue?(0,o.fsrsInitialMemory)(t,l):(0,o.fsrsNextMemory)(A(e,l),t,g(e,n,i),l),lastReviewedAt:n},h=e=>E(Math.max(1,Math.round((0,o.fsrsIntervalDays)(e,r.desiredRetention))),r);return"new"===e.queue?function(e,t,n,{config:r,dayContext:i},{reps:o,easeFactor:l,memoryState:u,intervalFor:c}){let d=r.learningStepsSeconds,m=(t,a)=>({queue:"learning",intervalDays:0,easeFactor:l,reps:o,lapses:e.lapses,due:null,learningDueAt:T(n,a),learningStep:t,relearning:!1,graduatingIntervalDays:null,memory:u,reviewType:"learn"});if(t===a.CARD_RATINGS.AGAIN)return m(0,d[0]);if(t===a.CARD_RATINGS.HARD)return m(0,p(d,0));if(t===a.CARD_RATINGS.GOOD&&d.length>1)return m(1,d[1]);let _=c(u.stability);return{queue:"review",intervalDays:_,easeFactor:l,reps:o,lapses:e.lapses,due:(0,s.addStudyDays)(n,_,i),learningDueAt:null,learningStep:0,relearning:!1,graduatingIntervalDays:null,memory:u,reviewT
124ype:"learn"}}(e,t,n,{config:r,dayContext:i},{reps:u,easeFactor:c,memoryState:d,intervalFor:h}):"learning"===e.queue?function(e,t,n,{config:r,dayContext:i},{reps:o,easeFactor:l,memoryState:u,intervalFor:c}){let d=e.relearning?"relearn":"learn",m=e.relearning?r.relearningStepsSeconds:r.learningStepsSeconds,h=_(m,e.learningStep),E=c(u.stability),A=(t,a)=>({queue:"learning",intervalDays:e.relearning?E:0,easeFactor:l,reps:o,lapses:e.lapses,due:null,learningDueAt:T(n,a),learningStep:t,relearning:e.relearning,graduatingIntervalDays:e.relearning?E:null,memory:u,reviewType:d});return t===a.CARD_RATINGS.AGAIN?A(0,m[0]):t===a.CARD_RATINGS.HARD?A(h,p(m,h)):t===a.CARD_RATINGS.GOOD&&h+1<m.length?A(h+1,m[h+1]):{queue:"review",intervalDays:E,easeFactor:l,reps:o,lapses:e.lapses,due:(0,s.addStudyDays)(n,E,i),learningDueAt:null,learningStep:0,relearning:!1,graduatingIntervalDays:null,memory:u,reviewType:d}}(e,t,n,{config:r,dayContext:i},{reps:u,easeFactor:c,memoryState:d,intervalFor:h}):function(e,t,n,{config:r,dayContext:i},{reps:l,easeFactor:u,memoryState:c,intervalFor:d}){if(t===a.CARD_RATINGS.AGAIN){let t=d(c.stability),a=r.relearningStepsSeconds;return{queue:"learning",intervalDays:t,easeFactor:u,reps:l,lapses:e.lapses+1,due:null,learningDueAt:T(n,a[0]),learningStep:0,relearning:!0,graduatingIntervalDays:t,memory:c,reviewType:"relearn"}}let m=A(e,r.fsrsParameters),_=g(e,n,i),p=e=>e===t?c.stability:(0,o.fsrsNextMemory)(m,e,_,r.fsrsParameters).stability,h=d(p(a.CARD_RATINGS.HARD)),f=E(Math.max(h+1,d(p(a.CARD_RATINGS.GOOD))),r),S=E(Math.max(f+1,d(p(a.CARD_RATINGS.EASY))),r),y=t===a.CARD_RATINGS.HARD?h:t===a.CARD_RATINGS.GOOD?f:S;return{queue:"review",intervalDays:y,easeFactor:u,reps:l,lapses:e.lapses,due:(0,s.addStudyDays)(n,y,i),learningDueAt:null,learningStep:0,relearning:!1,graduatingIntervalDays:null,memory:c,reviewType:"review"}}(e,t,n,{config:r,dayContext:i},{reps:u,easeFactor:c,memoryState:d,intervalFor:h})}(e,t,n,D);let C=(f=e,S=t,y=n,R=D,"new"===f.queue?function(e,t,n,{config:i,dayContext:o}){let l=e.reps+1,u=m(e.easeFactor,i),d=i.learningStepsSeconds;return t===a.CARD_RATINGS.AGAIN?{queue:"learning",intervalDays:0,easeFactor:u,reps:l,lapses:e.lapses,due:null,learningDueAt:T(n,d[0]),learningStep:0,relearning:!1,graduatingIntervalDays:null,reviewType:"learn"}:t===a.CARD_RATINGS.HARD?{queue:"learning",intervalDays:0,easeFactor:u,reps:l,lapses:e.lapses,due:null,learningDueAt:T(n,p(d,0)),learningStep:0,relearning:!1,graduatingIntervalDays:null,reviewType:"learn"}:t===a.CARD_RATINGS.GOOD?d.length<=1?h(e,l,u,i.graduatingIntervalDays,n,{config:i,dayContext:o}):{queue:"learning",intervalDays:0,easeFactor:u,reps:l,lapses:e.lapses,due:null,learningDueAt:T(n,d[1]),learningStep:1,relearning:!1,graduatingIntervalDays:null,reviewType:"learn"}:{queue:"review",intervalDays:E(i.newCardEasyIntervalDays,i),easeFactor:Math.min(i.startingEase+r.SRS_SCHEDULER_CONSTANTS.easeFactor.easyBonus,c),reps:l,lapses:e.lapses,due:(0,s.addStudyDays)(n,E(i.newCardEasyIntervalDays,i),o),learningDueAt:null,learningStep:0,relearning:!1,graduatingIntervalDays:null,reviewType:"learn"}}(f,S,y,R):"learning"===f.queue?function(e,t,n,{config:i,dayContext:o}){let l=e.reps+1,u=m(e.easeFactor,i),d=e.relearning?"relearn":"learn",A=e.relearning?i.relearningStepsSeconds:i.learningStepsSeconds,g=_(A,e.learningStep),f=e.relearning?Math.max(1,e.graduatingIntervalDays??e.intervalDays):i.graduatingIntervalDays,S=(t,a)=>({queue:"learning",intervalDays:e.relearning?f:0,easeFactor:u,reps:l,lapses:e.lapses,due:null,learningDueAt:T(n,a),learningStep:t,relearning:e.relearning,graduatingIntervalDays:e.relearning?f:null,reviewType:d});if(t===a.CARD_RATINGS.AGAIN)return S(0,A[0]);if(t===a.CARD_RATINGS.HARD)return S(g,p(A,g));if(t===a.CARD_RATINGS.GOOD){let t=g+1;return t<A.length?S(t,A[t]):{...h(e,l,u,f,n,{config:i,dayContext:o}),reviewType:d}}let y=e.relearning?E(Math.max(f+1,Math.round(f*r.SRS_SCHEDULER_CONSTANTS.intervals.review.easyIntervalMultiplier)),i):E(i.easyIntervalDays,i);return{queue:"review",intervalDays:y,easeFactor:Math.min(u+r.SRS_SCHEDULER_CONSTANTS.easeFactor.easyBonus,c),reps:l,lapses:e.lapses,due:(0,s.addStudyDays)(n,y,o),learningDueAt:null,learningStep:0,relearning:!1,graduatingIntervalDays:null,reviewT
124ype:d}}(f,S,y,R):function(e,t,n,{config:i,dayContext:o}){let d=e.reps+1,_=Math.max(1,e.intervalDays),p=m(e.easeFactor,i);if(t===a.CARD_RATINGS.AGAIN){let t=E(Math.max(1,Math.round(_*r.SRS_SCHEDULER_CONSTANTS.intervals.review.againIntervalMultiplier)),i),a=i.relearningStepsSeconds;return{queue:"learning",intervalDays:t,easeFactor:Math.max(l,p-r.SRS_SCHEDULER_CONSTANTS.easeFactor.againPenalty),reps:d,lapses:e.lapses+1,due:null,learningDueAt:T(n,a[0]),learningStep:0,relearning:!0,graduatingIntervalDays:t,reviewType:"relearn"}}let h=Math.max(l,p-r.SRS_SCHEDULER_CONSTANTS.easeFactor.hardPenalty),A=Math.min(c,p+r.SRS_SCHEDULER_CONSTANTS.easeFactor.easyBonus),g=E(Math.max(1,Math.round(_*r.SRS_SCHEDULER_CONSTANTS.intervals.review.hardIntervalMultiplier*(p/u)*i.intervalModifier)),i),f=E(Math.max(g+1,Math.round(p/1e3*_*i.intervalModifier)),i),S=E(Math.max(f+1,Math.round(f*r.SRS_SCHEDULER_CONSTANTS.intervals.review.easyIntervalMultiplier)),i);return t===a.CARD_RATINGS.HARD?{queue:"review",intervalDays:g,easeFactor:h,reps:d,lapses:e.lapses,due:(0,s.addStudyDays)(n,g,o),learningDueAt:null,learningStep:0,relearning:!1,graduatingIntervalDays:null,reviewType:"review"}:t===a.CARD_RATINGS.GOOD?{queue:"review",intervalDays:f,easeFactor:p,reps:d,lapses:e.lapses,due:(0,s.addStudyDays)(n,f,o),learningDueAt:null,learningStep:0,relearning:!1,graduatingIntervalDays:null,reviewType:"review"}:{queue:"review",intervalDays:S,easeFactor:A,reps:d,lapses:e.lapses,due:(0,s.addStudyDays)(n,S,o),learningDueAt:null,learningStep:0,relearning:!1,graduatingIntervalDays:null,reviewType:"review"}}(f,S,y,R));return e.memory?{...C,memory:e.memory}:C},t.pickLearningDueAt=function(e){return"learning"!==e.queue?null:e.learningDueAt??null},t.stripToUtcDate=function(e){return(0,s.studyDayDate)(e,s.UTC_DAY_CONTEXT)},t.addMinutes=function(e,t){return new Date(e.getTime()+60*t*1e3)},t.addSeconds=T,t.addDaysAsUtcDate=function(e,t){return(0,s.addStudyDays)(e,t,s.UTC_DAY_CONTEXT)};let a=n(60744),r=n(47416),i=n(80329),s=n(91332),o=n(86307),l=r.SRS_SCHEDULER_CONSTANTS.easeFactor.min,u=r.DEFAULT_EASE_FACTOR,c=r.SRS_SCHEDULER_CONSTANTS.easeFactor.max;function d(e){return{config:e?.config??i.DEFAULT_SCHEDULER_CONFIG,dayContext:e?.dayContext??s.UTC_DAY_CONTEXT}}function T(e,t){return new Date(e.getTime()+1e3*t)}function m(e,t){return Math.max(l,Math.min(c,"number"==typeof e&&Number.isFinite(e)&&e>0?e:t.startingEase||u))}function _(e,t){return!Number.isInteger(t)||t<0?0:Math.min(t,e.length-1)}function p(e,t){let n=_(e,t);return 0===n&&e.length>1?(e[0]+e[1])/2:e[n]}function h(e,t,n,a,r,{config:i,dayContext:o}){let l=E(a,i);return{queue:"review",intervalDays:l,easeFactor:n,reps:t,lapses:e.lapses,due:(0,s.addStudyDays)(r,l,o),learningDueAt:null,learningStep:0,relearning:!1,graduatingIntervalDays:null,reviewType:"learn"}}function E(e,t){return Math.max(1,Math.min(e,t.maximumIntervalDays))}function A(e,t){let n=e.memory;return n&&Number.isFinite(n.stability)&&Number.isFinite(n.difficulty)&&n.stability>0?{stability:n.stability,difficulty:n.difficulty}:e.intervalDays>=1?(0,o.fsrsMemoryFromSm2)(e.intervalDays,e.easeFactor):(0,o.fsrsInitialMemory)(a.CARD_RATINGS.AGAIN,t)}function g(e,t,n){let a=e.memory?.lastReviewedAt;if(a instanceof Date&&!Number.isNaN(a.getTime()))return Math.max(0,(t.getTime()-a.getTime())/864e5);if(e.due&&e.intervalDays>=1){let a=Math.max(0,((0,s.studyDayDate)(t,n).getTime()-e.due.getTime())/864e5);return e.intervalDays+a}return 0}},20605:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},21717:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FEEDBACK_PROMPT_STATES=t.FEEDBACK_CATEGORIES=t.FEEDBACK_SOURCES=void 0,t.FEEDBACK_SOURCES=["widget","prompt"],t.FEEDBACK_CATEGORIES=["idea","bug","praise","other"],t.FEEDBACK_PROMPT_STATES=["shown","dismissed"]},24084:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARD_REFINEMENT_PRESETS=void 0,t.sourceLooksMathematical=s,t.normalizeSelectedLanguage=o,t.buildFlashcardSystemPrompt=function(){return r.FLASHCARD_SYSTEM_PROMPT_TEXT},t.buildFlashcardUserPrompt=function(e){let t=[];if(t.push(r.FLASHCARD_SOURCE_HEADER_TEXT),t.push(l(l(r.FLASHCARD_SOURCE_META_TEXT,"SOURCE_FILE",e.sourceFile),"FILE_TYPE",e.fileType)),e.hasAttachedFile&&t.push(r.FLASHCARD_ATTACHED_FILE_TEXT),e.chunkContext){let n=e.chunkContext.documentHeadings.slice(0,80).map(e=>` - ${e}`).join("\n"),a=l(r.FLASHCARD_CHUNK_CONTEXT_TEXT,"CHUNK_INDEX",e.chunkContext.index);a=l(a,"CHUNK_TOTAL",e.chunkContext.total),a=l(a,"DOCUMENT_OUTLINE",n||" (no headings)"),t.push(a)}t.push(r.FLASHCARD_INVENTORY_TEXT),t.push("fixed"===e.count.mode?l(r.FLASHCARD_COUNT_FIXED_TEXT,"FIXED_COUNT",e.count.exact):l(r.FLASHCARD_COUNT_AUTO_TEXT,"AUTO_MAX",e.count.max)),t.push("basic"===e.cardType?r.FLASHCARD_CARDTYPE_BASIC_TEXT:r.FLASHCARD_CARDTYPE_CLOZE_TEXT);let n=o(e.preferredLanguage);if(t.push(n?l(r.FLASHCARD_LANG_SELECTED_TEXT,"LANGUAGE",n):r.FLASHCARD_LANG_AUTO_TEXT),s(e.parsedMarkdown)&&t.push(r.FLASHCARD_MATH_POLICY_TEXT),t.push(e.allowLongForm?r.FLASHCARD_ANSWER_LONGFORM_TEXT:r.FLASHCARD_ANSWER_CONCISE_TEXT),e.tagging){let n=e.tagging.existingTags;t.push(l(r.FLASHCARD_TAG_POLICY_TEXT,"EXISTING_TAGS",n.length>0?l(r.FLASHCARD_EXISTING_TAGS_TEXT,"TAG_LIST",n.join(", ")):"").trimEnd())}let a=e.aiInstructions&&e.aiInstructions.trim().length>0?e.aiInstructions.trim():r.FLASHCARD_NO_CUSTOM_INSTRUCTIONS;t.push(l(r.FLASHCARD_CUSTOM_INSTRUCTIONS_TEXT,"CUSTOM_INSTRUCTIONS",a));let i=e.existingDeckCardPreviews.length>0?e.existingDeckCardPreviews.map((e,t)=>`${t+1}. ${e}`).join("\n"):r.FLASHCARD_NO_EXISTING_CARDS;t.push(l(r.FLASHCARD_EXISTING_CARDS_TEXT,"EXISTING_CARDS",i));let u=e.sectionHeadings??[];u.length>=2&&t.push(l(r.FLASHCARD_SOURCE_ATTRIBUTION_TEXT,"SECTION_HEADINGS",u.map(e=>`- ${e}`).join("\n")));let c=e.missingFacts??[];return c.length>0&&t.push(l(r.FLASHCARD_GAP_FILL_TEXT,"MISSING_FACTS",c.map((e,t)=>`${t+1}. ${e}`).join("\n"))),t.push(l(r.FLASHCARD_PARSED_SOURCE_TEXT,"PARSED_MARKDOWN",e.parsedMarkdown)),t.push(r.FLASHCARD_CLOSING_TEXT),t.join("\n\n")},t.resolveRefinementInstruction=function(e,t){let n=t?.trim();return n||(e&&u[e]?u[e]:r.CARD_REFINE_PRESET_DEFAULT_TEXT)},t.buildCardRefinementSystemPrompt=function(){return r.CARD_REFINE_SYSTEM_PROMPT_TEXT},t.buildCardRefinementUserPrompt=function(e){let t=e.targetCardType??e.cardType,n=[],i=l(r.CARD_REFINE_CARD_TEXT,"CARD_TYPE",e.cardType);i=l(i,"QUESTION_HTML",e.questionHtml),n.push(i=l(i,"ANSWER_HTML",e.answerHtml||"(empty)")),n.push(l(r.CARD_REFINE_INSTRUCTION_TEXT,"INSTRUCTION",e.instruction)),n.push([l(r.CARD_REFINE_TARGET_TYPE_TEXT,"TARGET_CARD_TYPE",t),"cloze"===t?r.CARD_REFINE_TARGET_CLOZE_TEXT:r.CARD_REFINE_TARGET_BASIC_TEXT].join("\n"));let s=o(e.preferredLanguage);s&&n.push(l(r.CARD_REFINE_LANGUAGE_TEXT,"LANGUAGE",s));let u=(0,a.formatCardSourceForPrompt)(e.source??null);u&&n.push(u);let c=e.siblingQuestions??[];return c.length>0&&n.push(l(r.CARD_REFINE_SIBLINGS_TEXT,"SIBLING_QUESTIONS",c.map((e,t)=>`${t+1}. ${e}`).join("\n"))),n.push(r.CARD_REFINE_CLOSING_TEXT),n.join("\n\n")};let a=n(48637),r=n(12783),i=/\$|\\[a-zA-Z]{2,}|\^|[ââ«âââ]/;function s(e){return i.test(e)}function o(e){if(!e)return null;let t=e.trim().toLowerCase();return t&&"auto-detect"!==t&&"auto detect"!==t&&"auto"!==t?"english"===t?"English":"norwegian"===t||"norsk"===t?"Norwegian":"spanish"===t?"Spanish":"french"===t?"French":"german"===t?"German":"portuguese"===t?"Portuguese":null:null}function l(e,t,n){return e.split(`{{${t}}}`).join(String(n))}t.CARD_REFINEMENT_PRESETS=["shorter","simpler","cloze","basic","fix","example"];let u={shorter:r.CARD_REFINE_PRESET_SHORTER_TEXT,simpler:r.CARD_REFINE_PRESET_SIMPLER_TEXT,cloze:r.CARD_REFINE_PRESET_CLOZE_TEXT,basic:r.CARD_REFINE_PRESET_BASIC_TEXT,fix:r.CARD_REFINE_PRESET_FIX_TEXT,example:r.CARD_REFINE_PRESET_EXAMPLE_TEXT}},29134:(e,t,n)=>
124{Object.defineProperty(t,"__esModule",{value:!0}),t.FORGETTING_CURVE_BUCKETS=void 0,t.buildForgettingCurve=function(e,n=t.FORGETTING_CURVE_BUCKETS){let i=new Map(n.map(e=>[e.key,{tests:0,recalled:0}]));for(let t of e){let e=(0,a.bucketKeyFor)(t.elapsedDays,n);if(null===e)continue;let r=i.get(e);r&&(r.tests+=t.tests,r.recalled+=t.recalled)}return n.map(e=>({...e,...(0,r.summariseRetention)(i.get(e.key)??{tests:0,recalled:0})}))};let a=n(2305),r=n(63817);t.FORGETTING_CURVE_BUCKETS=a.INTERVAL_HISTOGRAM_BUCKETS},33349:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.collectClozeNumbers=function(e){let t=new Set;for(let a of Object.values(e??{}))if("string"==typeof a)for(let e of a.matchAll(n)){let n=Number(e[1]);Number.isInteger(n)&&n>0&&t.add(n)}return[...t].sort((e,t)=>e-t)},t.clozeOrdinalToTemplateOrdinal=function(e){return e-1},t.templateOrdinalToClozeOrdinal=function(e){return e+1},t.removeClozeDeletion=a,t.removeClozeNumberFromFields=function(e,t){let n={};for(let[r,i]of Object.entries(e??{}))n[r]="string"==typeof i?a(i,t):i;return n};let n=/\{\{c(\d+)::/g;function a(e,t){if("string"!=typeof e||0===e.length||!Number.isInteger(t)||t<1)return e;let n=`{{c${t}::`,a="",r=0;for(;r<e.length;){let t=e.indexOf(n,r);if(t<0)break;let i=t+n.length,s=function(e,t){let n=1,a=t;for(;a<e.length-1;){if(e.startsWith("{{",a)){n+=1,a+=2;continue}if(e.startsWith("}}",a)){if(0==(n-=1))return a;a+=2;continue}a+=1}return -1}(e,i);if(s<0)break;let o=e.slice(i,s);a+=e.slice(r,t)+function(e){if(e.trimStart().toLowerCase().startsWith("image-occlusion:"))return"";let t=function(e){let t=0;for(let n=0;n<e.length-1;n+=1){if(e.startsWith("{{",n)){t+=1,n+=1;continue}if(e.startsWith("}}",n)){t=Math.max(0,t-1),n+=1;continue}if(0===t&&e.startsWith("::",n))return n}return -1}(e);return t<0?e:e.slice(0,t)}(o),r=s+2}return a+e.slice(r)}},36025:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DECK_NAMING_SYSTEM_PROMPT=void 0,t.normalizeSuggestedDeckName=function(e){let t=e.replace(/\s+/g," ").trim();for(let e of(t=(t=(t=t.replace(n,"").trim()).replace(a,"").trim()).replace(r,"").trim(),i)){let n=t.split(e)[0]?.trim()??"";n.length>=3&&(t=n)}let u=(t=l(t,s)).split(" ").filter(Boolean);if(u.length>3&&(t=u.slice(0,3).join(" ")),(t=l(t,o)).length>40){let e=t.slice(0,40),n=e.lastIndexOf(" ");t=(n>=3?e.slice(0,n):e).trim()}return t.replace(r,"").trim()},t.normalizeSuggestedDeckDescription=function(e){let t=e.replace(/\s+/g," ").trim(),n=(t=t.replace(a,"").trim()).replace(u,"").trim();if(n!==t&&(t=n.length>0?n[0].toUpperCase()+n.slice(1):n),t.length>280){let e=t.slice(0,280),n=Math.max(e.lastIndexOf(". "),e.lastIndexOf("! "),e.lastIndexOf("? "));if(n>140)t=e.slice(0,n+1).trim();else{let n=e.slice(0,277),a=n.lastIndexOf(" ");t=`${(a>0?n.slice(0,a):n).replace(r,"").trim()}...`}}return t},t.DECK_NAMING_SYSTEM_PROMPT=`You name and describe flashcard decks. 125 126Return JSON only: {"name": "...", "description": "..."} 127 128The name: 129- Name the ONE subject the cards share. Prefer a single word; never more than three. 130- Write it in the same language as the questions. 131- Never join two subjects with "and" / "og" / "y" / "et" / "und" â pick the dominant one. 132- No filler words: flashcards, cards, deck, quiz, study, overview, introduction, basics. 133- Capitalize it as that language capitalizes an ordinary noun phrase: first word and proper nouns only. 134 135The description â what a stranger browsing public decks needs to decide whether this one is for them: 136- One or two plain sentences, at most 200 characters. 137- Same language as the questions. 138- Say what the deck covers and at what level; name the concrete topics the cards actually test. 139- Do not repeat the name as a sentence, and do not open with "This deck" / "Dette kortsettet" or any other wrapper. Start with the subject matter. 140- No marketing, no promises about results, no emoji.`;let n=/^(?:deck\s*name|deck|title|name|navn|tittel)\s*[:\-â]\s*/i,a=/^["'«»ââââ]+|["'«»ââââ]+$/g,r=/[.,;:!?]+$/,i=[/\s+(?:and|og|y|et|und|e)\s+/i,/\s*[,;
140:/|]\s*/,/\s+[&+]\s+/,/\s+[ââ-]\s+/],s=/\s+(?:flashcards?|cards?|decks?|quiz|notes?|kort|kortstokk|fichas|tarjetas|karten|cartes|baralho)$/i,o=/\s+(?:of|the|a|an|in|on|at|for|to|with|about|and|i|pÃ¥|til|av|om|med|ved|hos|som|fra|for|og|en|et|de|del|sobre|con|para|la|el|los|las|du|des|sur|der|die|das|und|über|do|da|sobre)$/i;function l(e,t){let n=e;for(;;){let e=n.replace(t,"").trim();if(e===n||e.length<3)return n;n=e}}let u=RegExp("^(?:(?:this|these|the|dette|denne|det|disse|den)\\s+)?(?:deck|set|collection|flashcard deck|flashcards?|cards?|kortsettet|kortsett|settet|dekket|decket|kortene|samlingen)\\s+(?:covers?|contains?|includes?|is about|focuses on|teaches|dekker|inneholder|handler om|omhandler|fokuserer p\xe5|tar for seg)\\s+","i")},38291:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeTimeZone=i,t.isoDateInTimeZone=function(e,t){return o(i(t)).format(e)},t.diffIsoDays=function(e,t){return Math.round((s(e)-s(t))/864e5)},t.addDaysToIsoDate=function(e,t){return new Date(s(e)+864e5*t).toISOString().slice(0,10)},t.isIsoDate=function(e){if(!n.test(e))return!1;let t=new Date(`${e}T12:00:00.000Z`);return!Number.isNaN(t.getTime())&&t.toISOString().slice(0,10)===e};let n=/^\d{4}-\d{2}-\d{2}$/,a=/^[A-Za-z0-9+\-_/.]{1,64}$/,r=new Map;function i(e){if(!e||!a.test(e))return"UTC";try{return o(e),e}catch{return"UTC"}}function s(e){let t=new Date(`${e}T12:00:00.000Z`);if(Number.isNaN(t.getTime()))throw RangeError(`Not a calendar day: ${e}`);return t.getTime()}function o(e){let t=r.get(e);if(t)return t;let n=new Intl.DateTimeFormat("en-CA",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit"});return r.set(e,n),n}},46604:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.renderCardSide=function(e,t){let n=e.note.fields??{},o=(e.templateOrdinal??0)+1,l=e.template.front??"",u=e.template.back??"",c=(e,a)=>(function(e,t){let n=e;for(let e=0;e<16;e+=1){let e=n.replace(s,(e,n,a,r)=>{var i;return"#"===n==("string"==typeof(i=t[a])&&i.replace(/<[^>]*>/g,"").replace(/ /gi," ").trim().length>0)?r:""});if(e===n)break;n=e}return n})(e,n).replace(/\{\{\s*([^}]+?)\s*\}\}/g,(e,s)=>{let u=s.trim();if(a&&"FrontSide"===u)return c(l,!1);if(u.startsWith("cloze:"))return i(String(n[u.slice(6)]??""),o,t);if(u.startsWith(r.OCCLUSION_TEMPLATE_DIRECTIVE)){let e=u.slice(r.OCCLUSION_TEMPLATE_DIRECTIVE.length).trim();return(0,r.renderImageOcclusion)({imageHtml:String(n[r.OCCLUSION_IMAGE_FIELD]??""),occlusionField:String(n[e]??""),clozeNumber:o,side:t})}if(u.startsWith("type:")){let e=u.slice(5).trim().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return"front"===t?`<input class="np-type-answer" data-type-answer="${e}" type="text" autocapitalize="off" autocomplete="off" autocorrect="off" spellcheck="false" placeholder="Type the answer" />`:`<div class="np-type-answer-result" data-type-answer="${e}"></div>`}let d=String(n[u]??"");return/\{\{c\d+::/.test(d)&&(d=i(d,o,t)),d}),d=c("front"===t?l:u,"back"===t);return/\{\{c\d+::/.test(d)&&(d=i(d,o,t)),(0,a.repairMangledLatex)(d)};let a=n(49698),r=n(91681);function i(e,t,n){let a=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return e.replace(/\{\{c(\d+)::(.*?)(?:::(.*?))?\}\}/g,(e,r,i,s)=>{let o=Number(r);return"front"===n?o===t?s?`<strong>[${a(s)}]</strong>`:"<strong>[...]</strong>":a(i):`<strong>${a(i)}</strong>`})}let s=/\{\{([#^])\s*([^}\s]+?)\s*\}\}([\s\S]*?)\{\{\/\s*\2\s*\}\}/g},47416:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_EASE_FACTOR=t.SRS_SCHEDULER_CONSTANTS=void 0,t.SRS_SCHEDULER_CONSTANTS={easeFactor:{min:1300,starting:2500,max:3500,hardPenalty:150,againPenalty:200,easyBonus:150},intervals:{maxDays:3650,new:{againMinutes:1,hardMinutes:6,goodMinutes:10,easyDays:1},learning:{hardMinutes:10,goodDays:1,easyDays:3},relearning:{againMinutes:1,hardMinutes:10},review:{againIntervalMultiplier:.2,hardIntervalMultiplier:1.2,easyIntervalMultiplier:1.3}}},t.DEFAULT_EASE_FACTOR=t.SRS_SCHEDULER_CONSTANTS.easeFactor.starting},48637:(e,t)=>{function n(e){return e.replace(/\s+/g," ").trim()}function a(e){return"string"==typeof e&&e.trim().length>0?e:void 0}function r(e){return"number"==typeof e&&Number.isInteger(e)&&e>0?e:void 0}
140Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_SOURCE_EXCERPT_CHARS=t.CARD_SOURCE_NOTE_DATA_KEY=void 0,t.buildCardSourceReference=function(e){let a,r=n(e.file??"");if(!r)return null;let i={file:r},s=e.heading?n(e.heading.replace(/^\s*#{1,6}\s*/,"").replace(/#+\s*$/,"")):"";s&&(i.heading=s);let o="number"==typeof e.sectionCount&&Number.isInteger(e.sectionCount)&&e.sectionCount>0?e.sectionCount:void 0;void 0!==o&&(i.sectionCount=o),"number"==typeof e.section&&Number.isInteger(e.section)&&e.section>=1&&(void 0===o||e.section<=o)&&(i.section=e.section);let l=e.excerpt?(a=n(e.excerpt)).length<=t.MAX_SOURCE_EXCERPT_CHARS?a:`${a.slice(0,t.MAX_SOURCE_EXCERPT_CHARS)}â¦`:"";l&&(i.excerpt=l);let u=e.generatedAt?e.generatedAt.trim():"";return u&&(i.generatedAt=u),i},t.writeCardSourceReference=function(e,n){let a=e&&"object"==typeof e&&!Array.isArray(e)?{...e}:{};return n&&(a[t.CARD_SOURCE_NOTE_DATA_KEY]=n),a},t.readCardSourceReference=function(e){if(!e||"object"!=typeof e||Array.isArray(e))return null;let n=e[t.CARD_SOURCE_NOTE_DATA_KEY];if(!n||"object"!=typeof n||Array.isArray(n))return null;let i=a(n.file);if(!i)return null;let s={file:i},o=a(n.heading);o&&(s.heading=o);let l=r(n.sectionCount);void 0!==l&&(s.sectionCount=l);let u=r(n.section);void 0!==u&&(s.section=u);let c=a(n.excerpt);c&&(s.excerpt=c);let d=a(n.generatedAt);return d&&(s.generatedAt=d),s},t.describeCardSource=function(e){return e?e.heading?`${e.file} â ${e.heading}`:e.file:""},t.formatCardSourceForPrompt=function(e){if(!e)return"";let t=[`- Document: ${e.file}`];return e.heading&&t.push(`- Heading/slide: ${e.heading}`),void 0!==e.section&&void 0!==e.sectionCount&&t.push(`- Position: section ${e.section} of ${e.sectionCount}`),e.excerpt&&t.push(`- Surrounding text: ${e.excerpt}`),["Where this card came from:",...t].join("\n")},t.CARD_SOURCE_NOTE_DATA_KEY="source",t.MAX_SOURCE_EXCERPT_CHARS=400},49698:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.splitMathSegments=s,t.joinMathSegments=o,t.repairMangledLatex=function(e){return/[\b\f\n\r\t]/.test(e)?o(s(e).map(e=>e.isMath?{...e,value:e.value.replace(/([\b\f\n\r\t])([A-Za-z]{1,18})/g,(e,t,r)=>{let i=n[t];if(!i)return e;let s=Math.min(r.length,17);for(let e=s;e>=1;e-=1){let t=i+r.slice(0,e);if(a.has(t))return`\\${t}${r.slice(e)}`}return e}).replace(/[\b\f]/g," ")}:e)):e},t.containsMath=function(e){return s(e).some(e=>e.isMath)};let n={"\b":"b","\f":"f","\n":"n","\r":"r"," ":"t"},a=new Set(["backslash","bar","because","begin","beta","between","bf","big","bigcap","bigcup","bigoplus","bigotimes","bigsqcup","bigtriangledown","bigtriangleup","bigvee","bigwedge","binom","blacksquare","bmod","boldsymbol","bot","bowtie","boxed","breve","bullet","fbox","fcolorbox","flat","forall","frac","frown","nabla","natural","ne","nearrow","neg","neq","nexists","ngeq","ni","nleq","nmid","nolimits","nonumber","norm","not","notin","nparallel","nsubseteq","nsupseteq","nu","nwarrow","rangle","rbrace","rbrack","rceil","real","rfloor","rho","right","rightarrow","rightleftharpoons","rlap","rm","rvert","tan","tanh","tau","tbinom","text","textbf","textit","textnormal","textrm","textsf","texttt","tfrac","therefore","theta","thickapprox","thinspace","tilde","times","tiny","to","top","triangle","triangledown","triangleleft","triangleright","triangleq","tt"]),r=[{open:"$$",close:"$$",display:!0},{open:"\\[",close:"\\]",display:!0},{open:"\\(",close:"\\)",display:!1},{open:"$",close:"$",display:!1}];function i(e){return" "===e||"\xa0"===e}function s(e){let t=[],n="",a=0,s=()=>{n.length>0&&(t.push({value:n,isMath:!1,display:!1,open:"",close:""}),n="")};for(;a<e.length;){let o=r.find(t=>e.startsWith(t.open,a));if(o){let n=a+o.open.length,r=function(e,t,n,a){let r=n;for(;r<e.length;){let n=e.indexOf(t,r);if(-1===n)break;if(n>0&&"\\"===e[n-1]||a&&!a(n)){r=n+1;continue}return n}return -1}(e,o.close,n,"$"===o.open?t=>!(t===n||i(e[n])||i(e[t-1]))&&!/\d/.test(e[t+1]??""):void 0);if(-1!==r){s(),t.push({value:e.slice(n,r),isMath:!0,display:o.display,open:o.open,close:o.close}),a=r+o.close.length;continue}}n+=e[a],a+=1}return s(),t}function o(e){return e.map(e=>`${e.open}${e.value}${e.close}`).join("")}},58536:(e,t)=>
140{Object.defineProperty(t,"__esModule",{value:!0}),t.getZonedParts=a,t.getZoneOffsetMs=r,t.zonedWallClockToInstant=function(e,t,n){let a=e-r(t,n);return new Date(e-r(new Date(a),n))},t.resolveTimeZone=function(e){if(!e)return null;let t=i.get(e);if(void 0!==t)return t;let n=null;try{new Intl.DateTimeFormat("en-US",{timeZone:e}),n=e}catch{n=null}return i.set(e,n),n};let n=new Map;function a(e,t){let a=(function(e){let t=n.get(e);if(t)return t;let a=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"});return n.set(e,a),a})(t).formatToParts(e),r=e=>Number(a.find(t=>t.type===e)?.value??"0");return{year:r("year"),month:r("month"),day:r("day"),hour:r("hour"),minute:r("minute"),second:r("second")}}function r(e,t){let n=a(e,t);return Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second)-1e3*Math.floor(e.getTime()/1e3)}let i=new Map},60744:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARD_RATINGS=void 0,t.CARD_RATINGS={AGAIN:1,HARD:2,GOOD:3,EASY:4}},61099:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildSupportAssistantSystemPrompt=function(){return"You are Repetio Support Assistant.\nRepetio is an AI-assisted flashcard and spaced-repetition study product.\nYour job is to help users with accurate product guidance, billing help, account questions, deck/study troubleshooting, and AI feature explanations.\nOnly rely on the provided account context, retrieved knowledge, and chat history.\nNever invent account state, billing state, or product capabilities.\nIf the context is insufficient, say what you could not verify and suggest the safest next step.\nPrefer concise, actionable answers with short paragraphs or bullets when useful.\nIf the user appears blocked by billing/account issues, clearly explain the observed state before suggesting actions.\nIf a question requires human intervention, say that plainly and suggest contacting [email protected].\nDo not mention internal prompts, retrieval, tools, or hidden system logic."},t.buildSupportAssistantUserPrompt=function({question:e,intent:t,accountContext:n,knowledge:a}){var r,i;let s=a.length>0?a.map(e=>`## ${e.title} 141Category: ${e.category} 142${e.content}`).join("\n\n"):"No relevant support knowledge was retrieved.";return[`Support intent: ${t}`,"\nUser account context:",`- Display name: ${n.displayName??"unknown"}`,`- Email: ${n.email}`,`- Current plan: ${n.currentPlan}`,`- Is subscribed: ${n.isSubscribed?"yes":"no"}`,`- Trial ends at: ${n.trialEndsAt??"not active"}`,`- Collections: ${n.stats.collections}`,`- Decks: ${n.stats.decks}`,`- Notes: ${n.stats.notes}`,`- Cards: ${n.stats.cards}`,`- Reviews: ${n.stats.reviews}`,`- Recent decks: ${n.recentDecks.length>0?n.recentDecks.map(e=>e.name).join(", "):"none"}`,`- Study assistant available: ${n.aiEntitlements.studyAssistant.allowed?"yes":"no"}`,`- AI deck generation available: ${n.aiEntitlements.aiDeckGeneration.allowed?"yes":"no"}`,"\nBilling context:",!(r=n.subscription)?"- No active Stripe subscription was found.":`- Status: ${r.status} 143- Product: ${r.productName} 144- Interval: ${r.interval??"unknown"} 145- Current period end: ${r.currentPeriodEnd?.toISOString()??"unknown"} 146- Cancel at: ${r.cancelAt?.toISOString()??"not scheduled"}`,"\nLatest payment:",!(i=n.latestPayment)?"- No recent payment was found.":[`- Status: ${i.status??"unknown"}`,`- Amount: ${i.amountTotal??"unknown"} ${i.currency??""}`.trim(),`- Created at: ${i.createdAt.toISOString()}`].join("\n"),"\nRetrieved support knowledge:",s,"\nUser question:",e.trim()].join("\n")}},61910:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EXAM_PACE_WINDOW_DAYS=t.EXAM_CONSOLIDATION_DAYS=void 0,t.planExamPacing=function(e){let n=Math.max(0,Math.round(e.cardsTotal)),s=Math.min(n,Math.max(0,Math.round(e.cardsIntroduced))),o=n-s,l=(0,a.diffIsoDays)(e.examDate,e.today),u=r(l,e.consolidationDays??t.EXAM_CONSOLIDATION_DAYS),c=Math.max(0,l-u),d=i(e.dailyNewTarget)??i(e.observedNewPerDay),T=0===o?0:0===c?o:o/c,m=l<0,_=m?0:Math.ceil(T),p=null===d||0===o?null:Math.ceil(o/d),h=null===p||m?null:(0,a.addD
146aysToIsoDate)(e.today,p),E=(0,a.addDaysToIsoDate)(e.today,c),A=null===h?null!==d&&0===o?0:null:Math.max(0,(0,a.diffIsoDays)(h,E)),g=null===d?o:Math.min(o,d*c),f=m?s:s+g,S=function(e){if(e.isPast)return"past";if(0===e.cardsRemaining)return"complete";if(0===e.introductionDaysRemaining)return"unreachable";if(null===e.plannedNewPerDay)return"no_pace_yet";let t=e.exactRequired/e.plannedNewPerDay;return t<=1?"on_track":t<=1.25?"tight":t<=2?"at_risk":"unreachable"}({isPast:m,cardsRemaining:o,introductionDaysRemaining:c,plannedNewPerDay:d,exactRequired:T}),y=!m&&o>0&&null!==d&&null!==p;return{daysUntilExam:l,consolidationDays:u,introductionDaysRemaining:c,cardsTotal:n,cardsIntroduced:s,cardsRemaining:o,requiredNewPerDay:_,plannedNewPerDay:d,projectedFinishDate:h,projectedDaysLate:A,cardsReachableByExam:f,cardsAtRiskOfBeingUnseen:n-f,status:S,remediation:{achievableExamDate:y?(0,a.addDaysToIsoDate)(e.today,p+u):null,cardsToTrim:y?Math.max(0,o-g):0}}},t.consolidationDaysFor=r;let a=n(38291);function r(e,t){return e<=0?0:Math.max(0,Math.min(t,e-1))}function i(e){return null==e||!Number.isFinite(e)||e<=0?null:e}t.EXAM_CONSOLIDATION_DAYS=7,t.EXAM_PACE_WINDOW_DAYS=14},63817:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RETENTION_MIN_SAMPLE=t.RETENTION_RECALL_MIN_RATING=t.RETENTION_MIN_ELAPSED_HOURS=void 0,t.isRetentionTest=function(e){return null!==e.elapsedHours&&e.elapsedHours>=t.RETENTION_MIN_ELAPSED_HOURS},t.isRecalled=function(e){return e>=t.RETENTION_RECALL_MIN_RATING},t.summariseRetention=r,t.wilsonInterval=i,t.summariseRetentionByMaturity=function(e){let t={tests:0,recalled:0},n={tests:0,recalled:0},i={tests:0,recalled:0};for(let r of e){let e=r.elapsedDays>=a.MATURE_INTERVAL_DAYS?i:n;e.tests+=r.tests,e.recalled+=r.recalled,t.tests+=r.tests,t.recalled+=r.recalled}return{overall:r(t),young:r(n),mature:r(i)}};let a=n(2305);function r(e){let n=Math.max(0,Math.round(e.tests)),a=Math.min(n,Math.max(0,Math.round(e.recalled)));return 0===n?{tests:0,recalled:0,lapses:0,retentionRate:null,confidence:null,isReliable:!1}:{tests:n,recalled:a,lapses:n-a,retentionRate:a/n,confidence:i(a,n),isReliable:n>=t.RETENTION_MIN_SAMPLE}}function i(e,t,n=1.959963984540054){if(t<=0)return{low:0,high:1};let a=e/t,r=n*n,o=1+r/t,l=a+r/(2*t),u=n*Math.sqrt(a*(1-a)/t+r/(4*t*t));
146return{low:s((l-u)/o),high:s((l+u)/o)}}function s(e){return Math.min(1,Math.max(0,e))}t.RETENTION_MIN_ELAPSED_HOURS=21,t.RETENTION_RECALL_MIN_RATING=2,t.RETENTION_MIN_SAMPLE=20},66751:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FREE_PLAN=t.ENTITLING_STATUSES=t.ENTITLEMENT_SOURCES=void 0,t.isEntitlementActive=r,t.resolvePlan=function(e,n){let i=null;for(let t of e)r(t,n)&&(null===i||function(e,t){let n=a[e.plan],r=a[t.plan];return n!==r?n>r:null===e.currentPeriodEnd||null!==t.expiresAt&&e.currentPeriodEnd.getTime()>t.expiresAt.getTime()}(t,i))&&(i={plan:t.plan,source:t.source,expiresAt:t.currentPeriodEnd});return i??{...t.FREE_PLAN}},t.ENTITLEMENT_SOURCES=["stripe","revenuecat","manual"],t.ENTITLING_STATUSES=["active","trialing","past_due"];let n=["past_due"];t.FREE_PLAN={plan:"free",source:"none",expiresAt:null};let a={free:0,pro:1};function r(e,a){return!!t.ENTITLING_STATUSES.includes(e.status)&&(null===e.currentPeriodEnd?!n.includes(e.status):e.currentPeriodEnd.getTime()>a.getTime())}},67716:(e,t,n)=>{var a=Object.create?function(e,t,n,a){void 0===a&&(a=n);var r=Object.getOwnPropertyDescriptor(t,n);
146(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,r)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]},r=function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(93784),t),r(n(8887),t),r(n(81390),t),r(n(20605),t),r(n(46604),t),r(n(33349),t),r(n(91681),t),r(n(92948),t),r(n(49698),t),r(n(48637),t),r(n(79363),t),r(n(86039),t),r(n(11725),t),r(n(61099),t),r(n(36025),t),r(n(15630),t),r(n(12783),t),r(n(24084),t),r(n(84346),t),r(n(21717),t),r(n(82573),t),r(n(13313),t),r(n(66751),t),r(n(60744),t),r(n(80329),t),r(n(91332),t),r(n(58536),t),r(n(47416),t),r(n(16864),t),r(n(86307),t),r(n(9857),t),r(n(90988),t),r(n(12845),t),r(n(11826),t),r(n(1217),t),r(n(82825),t),r(n(98449),t),r(n(80289),t),r(n(63817),t),r(n(29134),t),r(n(2305),t),r(n(38291),t),r(n(74852),t),r(n(61910),t)},74852:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.summariseStreaks=function(e,t){let n=Array.from(new Set(e)).filter(e=>0>=(0,a.diffIsoDays)(e,t)).sort();if(0===n.length)return r;let i=1,s=n[0],o=n[0],l=n[0],u=1;for(let e=1;e<n.length;e+=1)1===(0,a.diffIsoDays)(n[e],n[e-1])?u+=1:(l=n[e],u=1),u>=i&&(i=u,s=l,o=n[e]);let c=n[n.length-1],d=(0,a.addDaysToIsoDate)(t,-1);return{currentDays:c===t||c===d?function(e){let t=1;for(let n=e.length-1;n>0&&1===(0,a.diffIsoDays)(e[n],e[n-1]);n-=1)t+=1;return t}(n):0,longestDays:i,longestStart:s,longestEnd:o,activeDays:n.length,firstDay:n[0],lastDay:c}};let a=n(38291),r={currentDays:0,longestDays:0,longestStart:null,longestEnd:null,activeDays:0,firstDay:null,lastDay:null}},79363:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NearDuplicateIndex=t.NEAR_DUPLICATE_SIMILARITY=void 0,t.normalizeQuestionForComparison=o,t.extractQuestionTokens=l,t.questionSimilarity=u,t.areQuestionsNearDuplicates=function(e,n){return u(e,n)>=t.NEAR_DUPLICATE_SIMILARITY},t.findNearDuplicateIndex=function(e,n){let a=new Set(l(e));if(0===a.size)return -1;for(let e=0;e<n.length;e+=1){let r=new Set(l(n[e]));if(0===r.size)continue;let i=0;for(let e of a)r.has(e)&&(i+=1);let s=a.size+r.size-i;if(s>0&&i/s>=t.NEAR_DUPLICATE_SIMILARITY)return e}return -1},t.NEAR_DUPLICATE_SIMILARITY=.85;let n=new Set(["a","an","the","and","or","but","if","of","to","in","on","at","by","for","with","from","as","is","are","was","were","be","been","being","do","does","did","have","has","had","it","its","this","that","these","those","there","here","into","than","then","so","such","not","no","can","could","will","would","should","may","might","must","about","between","during","both","each","any","all","some","many","much","one","two","up","out","what","which","who","whom","whose","when","where","why","how","define","definition","describe","explain","explanation","list","name","state","give","identify","outline","summarize","summarise","mean","means","meaning","called","og","det","er","som","p\xe5","til","av","en","et","med","for","den","de","har","ikke","hva","hvorfor","hvordan","hvilken","hvilke","v\xe6re","de","la","el","que","y","en","los","las","para","con","del","un","una","es","son","por","se","su","qu\xe9","cu\xe1l","c\xf3mo","por qu\xe9","le","les","des","du","au","aux","une","est","sont","ce","cette","dans","sur","pour","par","que","qui","quoi","comment","pourquoi","der","die","das","und","ist","sind","mit","den","dem","von","zu","ein","eine","einer","einen","im","auf","f\xfcr","was","wie","warum","welche","welcher","o","e","do","da","dos","das","em","no","na","os","as","um","uma","por","com","que","como","porque","qual"]),a=/\{\{c\d+::([\s\S]*?)(?:::[\s\S]*?)?\}\}/gi,r=/([<>â¤â¥])\s*(?=\p{N})/gu,i={"<":"lt",">":"gt","â¤":"le","â¥":"ge"},s="cloze:";function o(e){return e.replace(/<\/?[a-zA-Z][^>]*>/g," ").replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/&/gi,"&").toLowerCase().replace(/\s+/g," ").trim()}function l(e){let t=o(e).replace(r,(e,t)=>` ${i[t]}`).replace(a,(e,t)=>` ${String(t).split(/[^\p{L}\p{N}]+/u).filter(e=>e.length>0).map(e=>`${s}${e}`).join(" ")} `),l=[],u=new Set;for(let e of t.split(/[^\p{L}\p{N}:]+/u)){let t=e.replace(/^:+|:+$/g,"");if(0===t.length)continue;let a=t.startsWith(s),r=a?t.slice(s.length):t;!(0===r.length||!a&&n.has(r))&&(u.has(t)||(u.add(t),l.push(t)))}return l}function u(e,t){let n=new Set(l(e)),a=new Set(l(t));if(0===n.size||0===a.size)return 0;let r=0;for(let e of n)a.has(e)&&(r+=1);let i=n.size+a.size-r;return 0===i?0:r/i}class c{constructor(e=[]){for(const t of(this.entries=[],e))this.add(t)}add(e){let t=new Set(l(e));0!==t.size&&this.entries.push({question:e,tokens:t})}find(e){let n=new Set(l(e));if(0===n.size)return null;for(let e of this.entries){let a=0;for(let t of n)e.tokens.has(t)&&(a+=1);let r=n.size+e.tokens.size-a;if(r>0&&a/r>=t.NEAR_DUPLICATE_SIMILARITY)return e.question}return null}get size(){return this.entries.length}}t.NearDuplicateIndex=c},80289:(e,t)=>
146{function n(e){return t.DECK_CATEGORIES.includes(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.DECK_VISIBILITY_LABELS=t.DECK_VISIBILITIES=t.DECK_CATEGORY_LABELS=t.DECK_CATEGORIES=void 0,t.isDeckCategory=n,t.deckCategoryLabel=function(e){return n(e)?t.DECK_CATEGORY_LABELS[e]:e},t.DECK_CATEGORIES=["ArtsHumanities","BusinessEconomics","Geography","History","Languages","Law","Mathematics","Medicine","Other","ProgrammingTech","Science","TestPrep"],t.DECK_CATEGORY_LABELS={ArtsHumanities:"Arts & Humanities",BusinessEconomics:"Business & Economics",Geography:"Geography",History:"History",Languages:"Languages",Law:"Law",Mathematics:"Mathematics",Medicine:"Medicine",Other:"Other",ProgrammingTech:"Programming & Tech",Science:"Science",TestPrep:"Test Prep"},t.DECK_VISIBILITIES=["private","unlisted","public"],t.DECK_VISIBILITY_LABELS={private:"Private",unlisted:"Link only",public:"Public"}},80329:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ANKI_PRESET_SCHEDULER_CONFIG=t.DEFAULT_SCHEDULER_CONFIG=void 0,t.normalizeSchedulerConfig=function(e){var n,a,c;let d=e??{};return Object.freeze({learningStepsSeconds:o(d.learningStepsSeconds,t.DEFAULT_SCHEDULER_CONFIG.learningStepsSeconds),relearningStepsSeconds:o(d.relearningStepsSeconds,t.DEFAULT_SCHEDULER_CONFIG.relearningStepsSeconds),graduatingIntervalDays:l(d.graduatingIntervalDays,t.DEFAULT_SCHEDULER_CONFIG.graduatingIntervalDays),easyIntervalDays:l(d.easyIntervalDays,t.DEFAULT_SCHEDULER_CONFIG.easyIntervalDays),newCardEasyIntervalDays:l(d.newCardEasyIntervalDays,t.DEFAULT_SCHEDULER_CONFIG.newCardEasyIntervalDays),startingEase:"number"==typeof(n=d.startingEase)&&Number.isFinite(n)?Math.max(i.min,Math.min(i.max,Math.round(n))):t.DEFAULT_SCHEDULER_CONFIG.startingEase,intervalModifier:"number"!=typeof(a=d.intervalModifier)||!Number.isFinite(a)||a<=0?1:a,maximumIntervalDays:"number"==typeof(c=d.maximumIntervalDays)&&Number.isFinite(c)?Math.max(1,Math.min(Math.round(c),s.maxDays)):t.DEFAULT_SCHEDULER_CONFIG.maximumIntervalDays,newPerDay:u(d.newPerDay),reviewPerDay:u(d.reviewPerDay),algorithm:"fsrs"===d.algorithm?"fsrs":"sm2",desiredRetention:(0,r.normalizeDesiredRetention)(d.desiredRetention),fsrsParameters:(0,r.normalizeFsrsParameters)(d.fsrsParameters)})},t.resolveDailyLimit=function(e,t){return null===e?1/0:Math.max(0,e-t)};let a=n(47416),r=n(86307),i=a.SRS_SCHEDULER_CONSTANTS.easeFactor,s=a.SRS_SCHEDULER_CONSTANTS.intervals;function o(e,t){if(!Array.isArray(e))return[...t];let n=e.filter(e=>"number"==typeof e&&Number.isFinite(e)&&e>0);return n.length>0?n:[...t]}function l(e,t){return"number"==typeof e&&Number.isFinite(e)?Math.max(1,Math.round(e)):t}function u(e){return"number"==typeof e&&Number.isFinite(e)&&e>0?Math.floor(e):null}t.DEFAULT_SCHEDULER_CONFIG=Object.freeze({learningStepsSeconds:Object.freeze([60,600]),relearningStepsSeconds:Object.freeze([60,600]),graduatingIntervalDays:s.learning.goodDays,easyIntervalDays:s.learning.easyDays,newCardEasyIntervalDays:s.new.easyDays,startingEase:i.starting,intervalModifier:1,maximumIntervalDays:s.maxDays,newPerDay:null,reviewPerDay:null,algorithm:"sm2",desiredRetention:r.DEFAULT_DESIRED_RETENTION,fsrsParameters:Object.freeze([...r.FSRS_DEFAULT_PARAMETERS])}),t.ANKI_PRESET_SCHEDULER_CONFIG=Object.freeze({learningStepsSeconds:Object.freeze([60,600]),relearningStepsSeconds:Object.freeze([600]),graduatingIntervalDays:1,easyIntervalDays:4,newCardEasyIntervalDays:4,startingEase:2500,intervalModifier:1,maximumIntervalDays:s.maxDays,newPerDay:20,reviewPerDay:200,algorithm:"sm2",desiredRetention:r.DEFAULT_DESIRED_RETENTION,fsrsParameters:Object.freeze([...r.FSRS_DEFAULT_PARAMETERS])})},81390:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},82573:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_AI_USAGE_SNAPSHOT=t.AI_FEATURES=t.FREE_AI_USAGE_LIMITS=void 0,t.getFreeUsageWindow=r,t.getAiFeatureEntitlement=function(e,i,s,o=new Date){let l=i[a[s]];if("pro"===e)return{feature:s,plan:e,allowed:!0,requiresUpgrade:!1,used:l,limit:null,remaining:null,resetsAt:null};let u=t.FREE_AI_USAGE_LIMITS[n[s]],c=Math.max(u-l,0);return{feature:s,plan:e,allowed:l<u,requiresUpgrade:l>=u,used:l,limit:u,remaining:c,resetsAt:r(o).resetsAt}},t.FREE_AI_USAGE_LIMITS={aiDeckCreations:3,studyAssistantQuestions:20},t.AI_FEATURES=["aiDeckGeneration","studyAssistant"];let n={aiDeckGeneration:"aiDeckCreations",studyAssistant:"studyAssistantQuestions"},a={aiDeckGeneration:"aiDeckCreationsUsed",studyAssistant:"studyAssistantQuestionsUsed"};function r(e){let t=e.getUTCFullYear(),n=e.getUTCMonth();return{start:new Date(Date.UTC(t,n,1)),resetsAt:new Date(Date.UTC(t,n+1,1))}}t.EMPTY_AI_USAGE_SNAPSHOT={aiDeckCreationsUsed:0,studyAssistantQuestionsUsed:0}},82825:(e,t,n)=>
146{Object.defineProperty(t,"__esModule",{value:!0}),t.createInitialCardState=function(e=new Date){return{intervalDays:0,easeFactor:2.5,due:e,reps:0,lapses:0}},t.scheduleReview=function(e,t,n=new Date){var i;let s=e.intervalDays>0?"review":"new",o=(0,r.scheduleCardReview)({queue:s,intervalDays:e.intervalDays,easeFactor:Math.round(1e3*e.easeFactor),reps:e.reps,lapses:e.lapses,due:e.due,learningDueAt:null,learningStep:0,relearning:!1,graduatingIntervalDays:null},t,n),l=o.learningDueAt??o.due??new Date(n.getTime()+60*((i=t)===a.CARD_RATINGS.AGAIN?1:i===a.CARD_RATINGS.HARD?6:10)*1e3);return{intervalDays:o.intervalDays,easeFactor:o.easeFactor/1e3,due:l,reps:o.reps,lapses:o.lapses}};let a=n(60744),r=n(16864)},84346:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOTIFICATION_TYPES=void 0,t.NOTIFICATION_TYPES=["study_due","welcome_free_ai"]},86039:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.collectNumbers=r,t.findUnsupportedNumbers=function(e,t){let n="string"==typeof t?r(t):t;return[...r(e)].filter(e=>!n.has(e))};let n={"â":"0","â":"1","â":"2","â":"3","â":"4","â
":"5","â":"6","â":"7","â":"8","â":"9","â°":"0","\xb9":"1","\xb2":"2","\xb3":"3","â´":"4","âµ":"5","â¶":"6","â·":"7","â¸":"8","â¹":"9"},a=/\d+(?:[.,]\d+)?/g;function r(e){let t=new Set;for(let r of e.replace(/<\/?[a-zA-Z][^>]*>/g," ").replace(/[â-ââ°Â¹Â²Â³â´-â¹]/g,e=>n[e]??e).match(a)??[])t.add(String(Number(r.replace(",","."))));return t}},86307:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FSRS_MAX_STABILITY_DAYS=t.FSRS_MIN_STABILITY_DAYS=t.MAX_DESIRED_RETENTION=t.MIN_DESIRED_RETENTION=t.DEFAULT_DESIRED_RETENTION=t.FSRS_DEFAULT_PARAMETERS=t.FSRS_PARAMETER_COUNT=t.FSRS_FACTOR=t.FSRS_DECAY=void 0,t.fsrsRetrievability=r,t.fsrsIntervalDays=function(e,n){let a=s(e),r=i(n);return a/t.FSRS_FACTOR*(r**(1/t.FSRS_DECAY)-1)},t.fsrsInitialMemory=function(e,t){return{stability:s(t[e-1]),difficulty:o(t[4]-Math.exp(t[5]*(e-1))+1)}},t.fsrsNextMemory=function(e,t,n,i){var l,u,c,d,T,m,_,p,h,E,A,g;let f,S,y,R,D=s(e.stability),C=o(e.difficulty),I=(l=C,u=t,f=-(c=i)[6]*(u-3),S=c[4]-Math.exp(3*c[5])+1,o(c[7]*S+(1-c[7])*(l+f*(10-l)/9)));if(n<1)return{stability:s(D*Math.exp(i[17]*(t-3+i[18]))),difficulty:I};let N=r(n,D);return t===a.CARD_RATINGS.AGAIN?{stability:s((d=D,T=C,m=N,Math.min((_=i)[11]*T**-_[12]*((d+1)**_[13]-1)*Math.exp(_[14]*(1-m)),d/Math.exp(_[17]*_[18])))),difficulty:I}:{stability:s((p=D,h=C,E=N,A=t,g=i,y=A===a.CARD_RATINGS.HARD?g[15]:1,R=A===a.CARD_RATINGS.EASY?g[16]:1,p*(1+Math.exp(g[8])*(11-h)*p**-g[9]*(Math.exp(g[10]*(1-E))-1)*y*R))),difficulty:I}},t.fsrsMemoryFromSm2=function(e,n){let a=Math.max(1300,Math.min(3500,n||2500));return{stability:s(e>0?e:t.FSRS_MIN_STABILITY_DAYS),difficulty:o(1+(3500-a)/2200*9)}},t.normalizeFsrsParameters=function(e){return Array.isArray(e)&&e.length===t.FSRS_PARAMETER_COUNT&&e.every(e=>"number"==typeof e&&Number.isFinite(e))?[...e]:[...t.FSRS_DEFAULT_PARAMETERS]},t.normalizeDesiredRetention=i;let a=n(60744);function r(e,n){let a=Math.max(0,e),r=s(n);return(1+t.FSRS_FACTOR*a/r)**t.FSRS_DECAY}function i(e){return"number"==typeof e&&Number.isFinite(e)?Math.max(t.MIN_DESIRED_RETENTION,Math.min(t.MAX_DESIRED_RETENTION,e)):t.DEFAULT_DESIRED_RETENTION}function s(e){return"number"==typeof e&&Number.isFinite(e)?Math.max(t.FSRS_MIN_STABILITY_DAYS,Math.min(t.FSRS_MAX_STABILITY_DAYS,e)):t.FSRS_MIN_STABILITY_DAYS}function o(e){return"number"==typeof e&&Number.isFinite(e)?Math.max(1,Math.min(10,e)):5}t.FSRS_DECAY=-.5,t.FSRS_FACTOR=.9**(1/t.FSRS_DECAY)-1,t.FSRS_PARAMETER_COUNT=19,t.FSRS_DEFAULT_PARAMETERS=Object.freeze([.40255,1.18385,3.173,15.69105,7.1949,.5345,1.4604,.0046,1.54575,.1192,1.01925,1.9395,.11,.29605,2.2698,.2315,2.9898,.51655,.6621]),t.DEFAULT_DESIRED_RETENTION=.9,t.MIN_DESIRED_RETENTION=.7,t.MAX_DESIRED_RETENTION=.99,t.FSRS_MIN_STABILITY_DAYS=.001,t.FSRS_MAX_STABILITY_DAYS=36500},90988:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleDtoToState=function(e){let t=e.dueAt?new Date(e.dueAt):null,n=t&&!Number.isNaN(t.getTime())?t:null;return{queue:e.queue,intervalDays:e.intervalDays,easeFactor:e.easeFactor,reps:e.reps,lapses:e.lapses,due:"learning"===e.queue?null:n,learningDueAt:"learning"===e.queue?n:null,learningStep:e.learningStep,relearning:e.relearning,graduatingIntervalDays:e.graduatingIntervalDays,...void 0!==e.memory?{memory:function(e){if(!e||"object"!=typeof e)return null;let{stability:t,difficulty:n,lastReviewedAt:a}=e;if("number"!=typeof t||!Number.isFinite(t)||t<=0||"number"!=typeof n||!Number.isFinite(n))return null;let r="string"==typeof a?new Date(a):null;return{stability:t,difficulty:n,lastReviewedAt:r&&!Number.isNaN(r.getTime())?r:null}}(e.memory)}:{}}},t.schedulerResultToScheduleDto=function(e,t){let n="learning"===e.queue?e.learningDueAt?.toISOString()??null:e.due?.toISOString()??null;return{queue:e.queue,dueAt:n,isDue:!n||new Date(n).getTime()<=t.getTime(),intervalDays:e.intervalDays,easeFactor:e.easeFactor,reps:e.reps,lapses:e.lapses,learningStep:e.learningStep,relearning:e.relearning,graduatingIntervalDays:e.graduatingIntervalDays,...e.memory?{memory:{stability:e.memory.stability,difficulty:e.memory.difficulty,lastReviewedAt:e.memory.lastReviewedAt?.toISOString()??null}}:{}}},t.resolveSchedulerOptions=function(e,t){if(!e)return{config:a.DEFAULT_SCHEDULER_CONFIG,dayContext:r.UTC_DAY_CONTEXT};let n=t?e.configsByDeckId?.[t]:void 0;return{config:(0,a.normalizeSchedulerConfig)(n??e.defaultConfig),dayContext:(0,r.resolveStudyDayContext)(e.dayContext?.timeZone,e.dayContext?.dayStartHour)}};let a=n(80329),r=n(91332)},91332:(e,t,n)=>
146{Object.defineProperty(t,"__esModule",{value:!0}),t.UTC_DAY_CONTEXT=t.DEFAULT_DAY_START_HOUR=void 0,t.resolveStudyDayContext=function(e,n){let r="number"==typeof n&&Number.isInteger(n)?Math.max(0,Math.min(23,n)):t.DEFAULT_DAY_START_HOUR;return{timeZone:(0,a.resolveTimeZone)(e),dayStartHour:r}},t.studyDayDate=r,t.addStudyDays=i,t.studyDayDueInstant=s,t.startOfStudyDay=function(e,n=t.UTC_DAY_CONTEXT){return s(r(e,n),n)},t.startOfNextStudyDay=function(e,n=t.UTC_DAY_CONTEXT){return s(i(e,1,n),n)},t.isStudyDayDue=function(e,n,a=t.UTC_DAY_CONTEXT){return!e||e.getTime()<=r(n,a).getTime()};let a=n(58536);function r(e,n=t.UTC_DAY_CONTEXT){let i=(0,a.resolveTimeZone)(n.timeZone);if(!i){let t=new Date(e.getTime()-60*n.dayStartHour*6e4);return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()))}let s=(0,a.getZonedParts)(e,i),o=s.hour<n.dayStartHour?-1:0;return new Date(Date.UTC(s.year,s.month-1,s.day+o))}function i(e,n,a=t.UTC_DAY_CONTEXT){let s=r(e,a);return new Date(Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()+n))}function s(e,n=t.UTC_DAY_CONTEXT){let r=(0,a.resolveTimeZone)(n.timeZone),i=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),n.dayStartHour);return r?(0,a.zonedWallClockToInstant)(i,new Date(i),r):new Date(i)}t.DEFAULT_DAY_START_HOUR=4,t.UTC_DAY_CONTEXT={timeZone:null,dayStartHour:0}},91681:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OCCLUSION_TEMPLATE_DIRECTIVE=t.OCCLUSION_COMMENTS_FIELD=t.OCCLUSION_BACK_EXTRA_FIELD=t.OCCLUSION_HEADER_FIELD=t.OCCLUSION_IMAGE_FIELD=t.OCCLUSION_SHAPES_FIELD=void 0,t.parseOcclusionShapes=a,t.serializeOcclusionShapes=function(e){return e.map(o).join("")},t.renderImageOcclusion=function(e){var t;let n,r=0===(n="string"==typeof(t=e.imageHtml)?t.trim():"").length?"":n.includes("<")?n:`<img src="${n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}" alt="" style="display:block;width:100%;height:auto;max-width:100%" />`,i=a(e.occlusionField);return 0===i.length?`<div class="np-occlusion" data-occlusion="1">${r}</div>`:'<div class="np-occlusion" data-occlusion="1" style="position:relative;display:inline-block;max-width:100%">
146'+r+'<svg class="np-occlusion-overlay" viewBox="0 0 100 100" preserveAspectRatio="none" style="position:absolute;inset:0;width:100%;height:100%;pointer-events:none" aria-hidden="true">'+i.map(t=>t.clozeNumber===e.clozeNumber?u(t,"front"===e.side?"question":"answer"):t.occludeInactive?u(t,"mask"):"").filter(e=>e.length>0).join("")+"</svg></div>"},t.OCCLUSION_SHAPES_FIELD="Occlusion",t.OCCLUSION_IMAGE_FIELD="Image",t.OCCLUSION_HEADER_FIELD="Header",t.OCCLUSION_BACK_EXTRA_FIELD="Back Extra",t.OCCLUSION_COMMENTS_FIELD="Comments",t.OCCLUSION_TEMPLATE_DIRECTIVE="image-occlusion:";let n=/\{\{c(\d+)::image-occlusion:([^}]*)\}\}/gi;function a(e){if("string"!=typeof e||0===e.length)return[];let t=[];for(let a of e.matchAll(n)){let e=Number(a[1]);if(!Number.isInteger(e)||e<1)continue;let n=a[2].split(":"),o=(n.shift()??"").trim().toLowerCase(),l=new Map;for(let e of n){let t=e.indexOf("=");t<0||l.set(e.slice(0,t).trim().toLowerCase(),e.slice(t+1).trim())}let u="1"===l.get("oi")||"true"===l.get("oi"),c=function(e,t,n,a){if("rect"===e){let e=r(n.get("left")),o=r(n.get("top")),l=r(n.get("width")),u=r(n.get("height"));return null===e||null===o||null===l||null===u?null:{clozeNumber:t,kind:"rect",left:e,top:o,width:s(i(l,0,1-e)),height:s(i(u,0,1-o)),occludeInactive:a}}if("ellipse"===e){let e=r(n.get("left")),i=r(n.get("top")),s=r(n.get("rx")),o=r(n.get("ry"));return null===e||null===i||null===s||null===o?null:{clozeNumber:t,kind:"ellipse",left:e,top:i,rx:s,ry:o,occludeInactive:a}}if("polygon"===e){let e=function(e){if(!e)return[];let t=[];for(let n of e.split(/\s+/)){let[e,a]=n.split(","),i=r(e),s=r(a);null!==i&&null!==s&&t.push({x:i,y:s})}return t}(n.get("points"));return e.length<3?null:{clozeNumber:t,kind:"polygon",points:e,occludeInactive:a}}return null}(o,e,l,u);c&&t.push(c)}return t}function r(e){if(void 0===e)return null;let t=Number(e);return Number.isFinite(t)?i(t>1?t/100:t,0,1):null}function i(e,t,n){return Math.min(Math.max(e,t),Math.max(t,n))}function s(e){return Number(e.toFixed(6))}function o(e){let t=[];return"rect"===e.kind?t.push(`left=${l(e.left)}`,`top=${l(e.top)}`,`width=${l(e.width)}`,`height=${l(e.height)}`):"ellipse"===e.kind?t.push(`left=${l(e.left)}`,`top=${l(e.top)}`,`rx=${l(e.rx)}`,`ry=${l(e.ry)}`):t.push(`points=${e.points.map(e=>`${l(e.x)},${l(e.y)}`).join(" ")}`),e.occludeInactive&&t.push("oi=1"),`{{c${e.clozeNumber}::image-occlusion:${e.kind}:${t.join(":")}}}`}function l(e){return String(Number(e.toFixed(6)))}function u(e,t){let n=`data-occlusion-role="${t}" data-cloze="${e.clozeNumber}" style="${"answer"===t?"fill:none;stroke:#f97316;stroke-width:0.8;vector-effect:non-scaling-stroke":"question"===t?"fill:#f97316;fill-opacity:0.92":"fill:#1f2937;fill-opacity:0.92"}"`;if("rect"===e.kind)return`<rect ${n} x="${c(e.left)}" y="${c(e.top)}" width="${c(e.width)}" height="${c(e.height)}" rx="0.6" />`;if("ellipse"===e.kind)return`<ellipse ${n} cx="${c(e.left)}" cy="${c(e.top)}" rx="${c(e.rx)}" ry="${c(e.ry)}" />`;let a=e.points.map(e=>`${c(e.x)},${c(e.y)}`).join(" ");return`<polygon ${n} points="${a}" />`}function c(e){return String(Number((100*e).toFixed(4)))}},92948:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ADDED_NOTE_TYPE_DEFINITIONS=t.NOTE_TYPE_NAME_BY_CARD_TYPE=t.NOTE_TYPE_DEFINITIONS=t.CARD_TYPE_KEYS=void 0,t.noteTypeDefinition=function(e){return a[e]},t.cardTypeForNoteTypeName=function(e){let n=t.NOTE_TYPE_DEFINITIONS.find(t=>t.name===e);return n?n.cardType:null},t.isClozeFamilyNoteType=function(e){let t=e.config;if(null!==t&&"object"==typeof t&&"isCloze"in t){let e=t.isCloze;if("boolean"==typeof e)return e}return e.templates.some(e=>"string"==typeof e.frontTemplate&&(e.frontTemplate.includes("{{cloze:")||e.frontTemplate.includes("{{image-occlusion:")))},t.CARD_TYPE_KEYS=["basic","cloze","reversed","type-in","image-occlusion"];let n='<hr id="answer">',a={basic:{cardType:"basic",name:"Basic",description:"Default question/answer note type",isClozeFamily:!1,seededByBootstrapTrigger:!0,fields:[{name:"Question",ordinal:0,isRequired:!0},{name:"Answer",ordinal:1,isRequired:!0}],templates:[{name:"Card 1",ordinal:0,frontTemplate:"{{Question}}",backTemplate:`{{FrontSide}} 147 148${n} 149 150{{Answer}}`,browserTemplate:"{{Question}}"}]},cloze:{cardType:"cloze",name:"Cloze",description:"Default cloze deleti
150on note type",isClozeFamily:!0,seededByBootstrapTrigger:!0,fields:[{name:"Text",ordinal:0,isRequired:!0},{name:"Extra",ordinal:1,isRequired:!1}],templates:[{name:"Cloze Card 1",ordinal:0,frontTemplate:"{{cloze:Text}}",backTemplate:"{{cloze:Text}}\n\n{{Extra}}",browserTemplate:"{{Text}}"}]},reversed:{cardType:"reversed",name:"Basic (and reversed card)",description:"Asks in both directions: one card front-to-back, one back-to-front",isClozeFamily:!1,seededByBootstrapTrigger:!1,fields:[{name:"Front",ordinal:0,isRequired:!0},{name:"Back",ordinal:1,isRequired:!0}],templates:[{name:"Card 1",ordinal:0,frontTemplate:"{{Front}}",backTemplate:`{{FrontSide}}${n}{{Back}}`,browserTemplate:"{{Front}}"},{name:"Card 2",ordinal:1,frontTemplate:"{{Back}}",backTemplate:`{{FrontSide}}${n}{{Front}}`,browserTemplate:"{{Back}}"}]},"type-in":{cardType:"type-in",name:"Basic (type in the answer)",description:"Answered by typing, for spelling, drug names and terminology",isClozeFamily:!1,seededByBootstrapTrigger:!1,fields:[{name:"Front",ordinal:0,isRequired:!0},{name:"Back",ordinal:1,isRequired:!0}],templates:[{name:"Card 1",ordinal:0,frontTemplate:'{{Front}}<div class="np-type-answer-row">{{type:Back}}</div>',backTemplate:`{{FrontSide}}${n}{{Back}}`,browserTemplate:"{{Front}}"}]},"image-occlusion":{cardType:"image-occlusion",name:"Image Occlusion",description:"Hide regions of a diagram and recall them one at a time",isClozeFamily:!0,seededByBootstrapTrigger:!1,fields:[{name:"Occlusion",ordinal:0,isRequired:!1},{name:"Image",ordinal:1,isRequired:!1},{name:"Header",ordinal:2,isRequired:!1},{name:"Back Extra",ordinal:3,isRequired:!1},{name:"Comments",ordinal:4,isRequired:!1}],templates:[{name:"Image Occlusion Card 1",ordinal:0,frontTemplate:'{{#Header}}<div class="np-occlusion-header">{{Header}}</div>{{/Header}}{{image-occlusion:Occlusion}}',backTemplate:"{{FrontSide}}{{#Back Extra}}"+n+'<div class="np-occlusion-extra">{{Back Extra}}</div>{{/Back Extra}}',browserTemplate:"{{Header}}"}]}};t.NOTE_TYPE_DEFINITIONS=t.CARD_TYPE_KEYS.map(e=>a[e]),t.NOTE_TYPE_NAME_BY_CARD_TYPE=Object.fromEntries(t.CARD_TYPE_KEYS.map(e=>[e,a[e].name])),t.ADDED_NOTE_TYPE_DEFINITIONS=t.NOTE_TYPE_DEFINITIONS.filter(e=>!e.seededByBootstrapTrigger)},93784:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},98449:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SUPPORTED_FORMAT_LABELS=t.UPLOAD_FORMATS=t.MAX_UPLOAD_BYTES=t.MAX_UPLOAD_MB=void 0,t.findUploadFormat=function(e){let n=e.lastIndexOf(".");if(n<0||n===e.length-1)return null;let a=e.slice(n).toLowerCase();return t.UPLOAD_FORMATS.find(e=>e.ext===a)??null},t.uploadAcceptAttribute=function(){return t.UPLOAD_FORMATS.map(e=>e.ext).join(",")},t.MAX_UPLOAD_MB=20,t.MAX_UPLOAD_BYTES=1024*t.MAX_UPLOAD_MB*1024,t.UPLOAD_FORMATS=[{ext:".pdf",apiFileType:"pdf",mimeType:"application/pdf",label:"PDF"},{ext:".docx",apiFileType:"docx",label:"Word",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".doc",apiFileType:"docx",label:"Word",mimeType:"application/msword"},{ext:".odt",apiFileType:"docx",label:"Word",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".pptx",apiFileType:"pptx",label:"PowerPoint",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".ppt",apiFileType:"pptx",label:"PowerPoint",mimeType:"application/vnd.ms-powerpoint"},{ext:".odp",apiFileType:"pptx",label:"PowerPoint",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".xlsx",apiFileType:"sheet",label:"Excel",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".xls",apiFileType:"sheet",label:"Excel",mimeType:"application/vnd.ms-excel"},{ext:".ods",apiFileType:"sheet",label:"Excel",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".html",apiFileType:"html",mimeType:"text/html",label:"Web"},{ext:".htm",apiFileType:"html",mimeType:"text/html",label:"Web"},{ext:".epub",apiFileType:"epub",mimeType:"application/epub+zip",label:"Ebook"},{ext:".txt",apiFileType:"txt",mimeType:"text/plain",label:"Text",parsedLocally:!0},{ext:".md",apiFileType:"txt",mimeType:"text/markdown",label:"Text",parsedLocally:!0},{ext:".png",apiFileType:"image",mimeType:"image/png",label:"Images"},{ext:".jpg",apiFileType:"image",mimeType:"image/jpeg",label:"Images"},{ext:".jpeg",apiFileType:"image",mimeType:"image/jpeg",label:"Images"},{ext:".webp",apiFileType:"image",mimeType:"image/webp",label:"Images"},{ext:".gif",apiFileType:"image",mimeType:"image/gif",label:"Images"},{ext:".tif",apiFileType:"image",mimeType:"image/tiff",label:"Images"},{ext:".tiff",apiFileType:"image",mimeType:"image/tiff",label:"Images"}],t.SUPPORTED_FORMAT_LABELS=Array.from(new Set(t.UPLOAD_FORMATS.map(e=>e.label)))}}]);
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.