/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
*/
"use strict";var Fn=Object.defineProperty;var mo=Object.getOwnPropertyDescriptor;var ho=Object.getOwnPropertyNames;var ko=Object.prototype.hasOwnProperty;var We=(e,t)=>{for(var n in t)Fn(e,n,{get:t[n],enumerable:!0})},yo=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ho(t))!ko.call(e,i)&&i!==n&&Fn(e,i,{get:()=>t[i],enumerable:!(r=mo(t,i))||r.enumerable});return e};var bo=e=>yo(Fn({},"__esModule",{value:!0}),e);var dl={};We(dl,{default:()=>cl});module.exports=bo(dl);var fo=require("obsidian");function I(e,t){return`${e}:${t}`}function vn(e){return e?.cardType==="basic"}function jr(e){return e?.cardType==="cloze"}function G(e){return e?.cardType==="qa-group"}var Kr=require("obsidian");function ue(){return(0,Kr.getLanguage)()==="zh"?"zh":"en"}function se(e,t){return t.join(e==="zh"?"\u3001":", ")}var Mn={commands:{syncCurrentFileToAnki:"Sync current file to Anki",syncVaultToAnki:"Sync vault to Anki",clearCurrentFileSyncedCards:"Clear synced cards in current file",cleanupEmptyDecks:"Clean up empty decks"},settings:{pluginTitle:"Anki Heading Sync",ankiConnectUrl:{name:"AnkiConnect URL",desc:"Default is http://127.0.0.1:8765",placeholder:"http://127.0.0.1:8765"},qaHeadingLevel:{name:"QA heading level",desc:"Default is H4"},clozeHeadingLevel:{name:"Cloze heading level",desc:"Default is H5"},cardAnswerCutoffMode:{name:"Card answer cutoff mode",desc:"A valid sync marker always wins. Without a valid marker, either keep the whole heading block or stop before the first 2+ consecutive blank lines.",options:{headingBlock:"heading-block: whole heading block",doubleBlankLines:"double-blank-lines: stop before the first 2+ blank lines"}},qaGroup:{title:"QA Group list notes",marker:{name:"QA Group marker",desc:"When a QA heading ends with this hashtag marker, the whole heading block syncs as one QA Group list note.",placeholder:"#anki-list"},managedNoteType:"Current note type: {{modelName}}. This route syncs QA Group list notes using the field mapping shown below.",managedModelContract:"Current note type summary: {{fieldCount}} fields and {{templateCount}} templates are available for this route."},syncOptions:{addObsidianBacklink:{name:"Add Obsidian backlink",desc:"Append a backlink to the source heading into synced cards."},obsidianBacklinkLabel:{name:"Obsidian backlink label",desc:"The text shown for the backlink. Blank input falls back to Open in Obsidian.",placeholder:"Open in Obsidian"},obsidianBacklinkPlacement:{name:"Obsidian backlink placement",desc:"Choose whether the backlink is appended to the question field or placed at the start or end of the answer body.",options:{questionLastLine:"Last line of question field",answerFirstLine:"First line of answer body",answerLastLine:"Last line of answer body"}},highlightsToCloze:{name:"Highlights to Cloze",desc:"Convert ==highlight== segments into cloze deletions for cloze cards."},syncObsidianTagsToAnki:{name:"Sync Obsidian tags to Anki",desc:"Sync Obsidian-recognized tags from the current note into Anki note tags, including nested tags. On each sync, these tags overwrite the managed tags in Anki based on the current Obsidian content."},keepPureTagLinesInCardBody:{name:"Keep pure tag lines in card body",desc:'When turned off, remove every line in the card body that contains only tags, such as "#ProjectA #\u91CD\u70B9/\u6848\u4F8B". Inline tags like "This is a #tag example" and lines with ordinary text like "\u6807\u7B7E\uFF1A#\u9879\u76EEA" are kept. Extra blank lines created by removal are cleaned up automatically.'}},mapping:{title:"Note type field mappings",refresh:{name:"Refresh note types from Anki",button:"Refresh note types"},status:{idle:"Refresh note types from Anki to load the available note types.",loadedCount:"Loaded {{count}} note types from Anki.",empty:"Anki returned no note types.",failedLoadNoteTypes:"Failed to load note types from Anki.",loadedSavedMapping:"Loaded saved mapping for {{modelName}}.",selectedModel:"Selected {{modelName}}. Read fields from Anki to create or refresh its mapping.",loadedFieldsForModel:"Loaded fields for {{modelName}}. Review the suggested mapping and save it.",failedLoadFields:"Failed to load fields for {{modelName}}.",noLoadedFields:"No loaded fields for {{modelName}}. Read fields from Anki first.",savedMapping:"Saved mapping for {{modelName}}.",failedSaveMapping:"Failed to save mapping for {{modelName}}.",savedMappingReady:"Saved mapping is ready for {{title}}.",noSavedMapping:"No saved mapping for {{title}}. Read fields from Anki first."},section:{basic:{title:"QA / Basic",description:"Choose the QA note type, read its fields from Anki, then confirm the title/body mapping."},cloze:{title:"Cloze",description:"Choose the cloze note type, read its fields from Anki, then confirm the main field mapping."}},noteTypeLabel:"{{title}} note type",noteTypeDesc:"Loaded from Anki note types. Refresh if the latest models are not shown.",fieldsLabel:"{{title}} fields",fieldsDesc:"Load the current note type fields from Anki, then review the suggested mapping.",readFieldsButton:"Read fields from Anki",loadedFields:"Loaded fields: {{fields}}",loadedFieldsNone:"Loaded fields: none. Read fields from Anki first.",mappingLabel:"{{title}} mapping",mappingDesc:"Save the current field mapping for this specific note type.",saveMappingButton:"Save mapping",titleFieldLabel:"{{title}} title field",titleFieldDesc:"Which Anki field should receive the heading/title fragment.",bodyFieldLabel:"{{title}} body field",bodyFieldDesc:"Which Anki field should receive the body fragment.",mainField:{name:"Cloze main field",desc:"The selected field receives title +
=p))){a=o===61?1:2;break}}if(e.sCount[u]<0)continue;let f=!1;for(let m=0,p=r.length;m
3||e.sCount[a]<0)continue;let c=!1;for(let l=0,d=r.length;l ${t} ]*>.*?<\/a><\/p>/g,"").replace(/te((2147483647-i)/c)&&he("overflow"),i+=(s-r)*c,r=s;for(let l of e)if(l
${t}`:t,body:e.body};let r=`
]*>.*?<\/a>/g,"").trim()}function Vd(e){return e.includes("GroupId")&&e.includes("Src")&&e.some(n=>/^S\d+_Id$/i.test(n))&&e.some(n=>/^S\d+_Q$/i.test(n))&&e.some(n=>/^S\d+_A$/i.test(n))?e.filter(n=>n==="GroupId"||n==="Src"||/^S\d+_Id$/i.test(n)):[]}function jd(e){let t=[];return{text:e.replace(Pd,r=>{let i=`@@QA_GROUP_INLINE_CODE_${t.length}@@`;return t.push(r),i}),restore:r=>t.reduce((i,a,o)=>i.split(`@@QA_GROUP_INLINE_CODE_${o}@@`).join(a),r)}}var Kd="manual-render-v3",we=class{constructor(t=new He){this.deckResolutionService=t}resolve(t,n){let r=Zd(t.cardType,n),i=this.deckResolutionService.resolve(t,n.defaultDeck,n.folderDeckMode),a=i.resolvedDeck.value,o=n.noteFieldMappings[I(t.cardType,r)]??null,u={version:Kd,cardType:t.cardType,noteModel:r,mapping:o,addObsidianBacklink:n.addObsidianBacklink,obsidianBacklinkLabel:n.obsidianBacklinkLabel,obsidianBacklinkPlacement:n.obsidianBacklinkPlacement,convertHighlightsToCloze:n.convertHighlightsToCloze,keepPureTagLinesInCardBody:n.keepPureTagLinesInCardBody},s=W(JSON.stringify(u));return{deck:a,noteModel:r,renderConfigHash:s,warnings:i.warnings}}};function Zd(e,t){if(Mi(e)){if(!t.clozeNoteType.trim())throw new C("errors.noteFieldMapping.noteTypeNotSelected.cloze");return t.clozeNoteType}if(!t.qaNoteType.trim())throw new C("errors.noteFieldMapping.noteTypeNotSelected.basic");return t.qaNoteType}var bn=class{constructor(t=new we){this.renderConfigService=t}plan(t,n,r,i){let a=new Map,o=new Set(n.pendingWriteBack.filter(y=>y.markerKind!=="group-gi").map(y=>Ee(y.filePath,y.blockStartLine,y.rawBlockHash))),u=new Set,s=[],c=[],l=[],d=[],f=[],m=new Map,p=0;for(let y of t){if(a.has(y.syncKey))throw new Error(`Duplicate syncKey detected in current scan: ${y.syncKey}`);if(a.set(y.syncKey,y),y.noteId!==void 0){let b=P(y.noteId);if(u.has(b))throw new Error(`Duplicate noteId detected in current scan: ${y.noteId}`);u.add(b)}let S=y.noteId!==void 0?n.cards[P(y.noteId)]:void 0,x=this.renderConfigService.resolve(y,i);for(let b of x.warnings)m.set(ze(b),b);let h=y.noteId,v=Ee(y.filePath,y.blockStartLine,y.rawBlockHash),M={card:{...y,noteId:h},noteId:h,deck:x.deck,noteModel:x.noteModel,renderConfigHash:x.renderConfigHash};if(!h){s.push(M);continue}if(l.push(M),(y.idMarkerState!=="present-valid"||y.noteIdSource!=="marker"||o.has(v))&&f.push(M),!S){c.push(M);continue}let E=S.rawBlockHash!==y.rawBlockHash||S.renderConfigHash!==x.renderConfigHash||!Ui(S.tagsHint,y.tagsHint)||S.orphan,T=S.deck!==x.deck;E&&c.push(M),T&&d.push(M),!E&&!T&&(p+=1)}let F=new Set(r),k=Object.values(n.cards).filter(y=>F.has(y.filePath)&&!u.has(P(y.noteId)));return{toCreate:s,toUpdate:c,toVerifyDeck:l,toChangeDeck:d,toRewriteMarker:f,toOrphan:k,unchangedCards:p,warnings:Array.from(m.values())}}};var lo=new et({breaks:!0,html:!0,linkify:!0}),Yd=/`[^`\n]+`/g,Xd=/```[\s\S]*?```|~~~[\s\S]*?~~~/g,Jd=/(?`\\[${k.trim()}\\]`),c=c.replace(el,(F,k)=>`\\(${k.trim()}\\)`),i&&r.convertHighlightsToCloze&&(c=c.replace(po,"{$1}")),i&&(c=c.replace(nl,(F,k,y)=>`{{c${k?Number(k):d++}::${y}}}`)),c=c.replace(rl,(F,k)=>{let y=r.resourceResolver.resolveEmbed(k,n.card.filePath);return y?(l.push({kind:y.kind,fileName:y.fileName,absolutePath:y.absolutePath,altText:y.altText}),y.kind==="audio"?`[sound:${y.fileName}]`:``):F}),c=c.replace(il,(F,k)=>{let y=r.resourceResolver.resolveWikiLink(k,n.card.filePath);return y?`${nt(y.displayText)}`:F}),c=c.replace(po,"$1");let f=Ur(c,tl,"MATH");c=f.text,c=s.restore(c),c=u.restore(c);let m=(a?lo.renderInline(c):lo.render(c)).trim(),p=f.restore(m,nt);return{html:a?p:mn(p),media:l}}};function Ur(e,t,n){let r=[];return{text:e.replace(t,a=>{let o=`@@${n}_${r.length}@@`;return r.push(a),o}),restore:(a,o=u=>u)=>r.reduce((u,s,c)=>u.split(`@@${n}_${c}@@`).join(o(s)),a)}}function al(e){let t=new Set;return e.filter(n=>{let r=`${n.kind}:${n.absolutePath}:${n.fileName}`;return t.has(r)?!1:(t.add(r),!0)})}function nt(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}var rt=class extends C{constructor(t){super("errors.currentFileOutOfScope",{filePath:t}),this.name="CurrentFileOutOfScopeError"}},Oe=class extends C{constructor(){super("errors.runScopeNotConfigured"),this.name="RunScopeNotConfiguredError"}},Sn=class{constructor(t,n,r,i=new Vt(t),a=new bn,o=new xn,u=new Bt(r),s=new jt(t),c=new we,l=()=>Date.now()){this.vaultGateway=t;this.pluginStateRepository=n;this.ankiGateway=r;this.fileIndexerService=i;this.diffPlannerService=a;this.renderer=o;this.ankiBatchExecutor=u;this.markdownWriteBackService=s;this.scanScopeService=new Le;if(this.qaGroupSyncService=new yn(r,void 0,void 0,void 0,void 0,void 0,void 0,this.vaultGateway.createBacklink.bind(this.vaultGateway)),ol(c)){this.renderConfigService=c,this.now=l;return}this.renderConfigService=new we,this.now=c}async syncVault(t){le(t),this.assertRunScopeConfigured(t);let n=await this.pluginStateRepository.load(),r=await this.fileIndexerService.indexVault(t,n);return this.syncIndexedResult(r,n,t)}async syncFile(t,n){if(le(n),this.assertRunScopeConfigured(n),!this.scanScopeService.isPathInScope(t,n.scopeMode,n.includeFolders,n.excludeFolders))throw new rt(t);let r=await this.pluginStateRepository.load(),i=await this.fileIndexerService.indexFile(t,n,r);return this.syncIndexedResult(i,r,n)}assertRunScopeConfigured(t){if(!lt(t.scopeMode,t.includeFolders))throw new Oe}async syncIndexedResult(t,n,r){let i=this.diffPlannerService.plan(t.cards,n,t.scopedFilePaths,r),a={addObsidianBacklink:r.addObsidianBacklink,obsidianBacklinkLabel:r.obsidianBacklinkLabel,obsidianBacklinkPlacement:r.obsidianBacklinkPlacement,convertHighlightsToCloze:r.convertHighlightsToCloze,keepPureTagLinesInCardBody:r.keepPureTagLinesInCardBody,resourceResolver:this.vaultGateway},o=new Map;for(let m of[...i.toCreate,...i.toUpdate])o.has(m.card.syncKey)||o.set(m.card.syncKey,this.renderer.render(m,a));let u=await this.ankiBatchExecutor.execute(i,o,async m=>this.renderer.render(m,a),r.noteFieldMappings),s=await this.qaGroupSyncService.sync(t.groupBlocks,n,r),c=new Map(t.indexedFiles.map(m=>[m.filePath,m])),l=await this.markdownWriteBackService.write(u.markerWrites,c,s.markerWrites),d=ul(n,t.scopedFilePaths,s.syncedGroupBlocks),f=this.buildNextState(n,t.cards,t.indexedFiles,s.syncedGroupBlocks,r,new Set([...u.touchedSyncKeys,...s.touchedSyncKeys,...l.writtenSyncKeys]),u.resolvedNoteIds,i.toOrphan,d);if(f.pendingWriteBack=[...n.pendingWriteBack.filter(m=>!new Set(t.scopedFilePaths).has(m.filePath)),...l.pendingEntries],this.markFilesDirty(f,[...l.failureFiles.map(m=>m.filePath),...l.conflictFiles]),await this.pluginStateRepository.save(f),l.failureFiles.length>0)throw this.createWriteBackFailureError(l.failureFiles);return{scannedFiles:t.scannedFiles,scannedCards:t.cards.length+t.groupBlocks.length,created:u.created+s.created,updated:u.updated+s.updated,migratedNoteTypes:u.migratedNoteTypes+s.migratedNoteTypes,migratedDecks:u.migratedDecks+s.migratedDecks,orphaned:i.toOrphan.length+d.length,uploadedMedia:u.uploadedMedia,skippedUnchangedCards:t.skippedUnchangedCards,rewrittenMarkers:l.writtenSyncKeys.length,markerWriteConflictFiles:l.conflictFiles,warnings:sl(i.warnings,s.warnings)}}buildNextState(t,n,r,i,a,o,u,s,c){let l=this.now(),d=zn(a),f=new Set(r.filter(k=>k.content!==void 0).map(k=>k.filePath)),m=new Map;for(let k of i){let y=m.get(k.filePath);y?y.push(k):m.set(k.filePath,[k])}let p={files:{...t.files},cards:{...t.cards},groupBlocks:{...t.groupBlocks??{}},pendingWriteBack:[...t.pendingWriteBack]};for(let k of f)delete p.files[k];for(let[k,y]of Object.entries(p.cards))f.has(y.filePath)&&delete p.cards[k];for(let[k,y]of Object.entries(p.groupBlocks??{}))f.has(y.filePath)&&delete p.groupBlocks?.[k];let F=new Map;for(let k of n){let y=u.get(k.syncKey)??k.noteId;y!==void 0&&F.set(k.syncKey,y)}for(let k of r){if(k.content===void 0)continue;let y=Array.from(new Set(k.cards.map(S=>F.get(S.syncKey)).filter(S=>S!==void 0)));p.files[k.filePath]={filePath:k.filePath,fileHash:k.fileHash,fileStamp:k.fileStamp,deckRulesFingerprint:d,lastIndexedAt:l,noteIds:y,groupIds:(m.get(k.filePath)??[]).map(S=>S.groupId)}}for(let k of n){let y=F.get(k.syncKey);if(y===void 0)continue;let S=t.cards[P(y)]??(k.noteId!==void 0?t.cards[P(k.noteId)]:void 0),x=this.renderConfigService.resolve(k,a);p.cards[P(y)]={noteId:y,filePath:k.filePath,heading:k.heading,backlinkHeadingText:k.backlinkHeadingText,headingLevel:k.headingLevel,bodyMarkdown:k.bodyMarkdown,cardType:k.cardType,blockStartOffset:k.blockStartOffset,blockEndOffset:k.blockEndOffset,blockStartLine:k.blockStartLine,bodyStartLine:k.bodyStartLine,blockEndLine:k.blockEndLine,contentEndLine:k.contentEndLine,markerLine:k.markerLine,rawBlockText:k.rawBlockText,rawBlockHash:k.rawBlockHash,renderConfigHash:x.renderConfigHash,deck:x.deck,deckHint:k.deckHint,deckHintSource:k.deckHintSource,deckWarnings:[...k.deckWarnings],tagsHint:k.tagsHint,lastSyncedAt:o.has(k.syncKey)?l:S?.lastSyncedAt??0,orphan:!1}}for(let k of s)p.cards[P(k.noteId)]={...k,orphan:!0};for(let k of i)p.groupBlocks??(p.groupBlocks={}),p.groupBlocks[k.groupId]=k;for(let k of c)p.groupBlocks??(p.groupBlocks={}),p.groupBlocks[k.groupId]={...k,orphan:!0};return p}markFilesDirty(t,n){for(let r of new Set(n))t.files[r]&&(t.files[r]={...t.files[r],fileHash:"",fileStamp:""})}createWriteBackFailureError(t){return new C("errors.writeBack.summary",{fileCount:t.length},{failures:t})}};function ol(e){return typeof e=="object"&&e!==null&&"resolve"in e}function ul(e,t,n){let r=new Set(t),i=new Set(n.map(a=>a.groupId));return Object.values(e.groupBlocks??{}).filter(a=>r.has(a.filePath)&&!i.has(a.groupId)).map(a=>({...a,orphan:!0}))}function sl(...e){let t=new Map;for(let n of e)for(let r of n)t.set(ze(r),r);return[...t.values()]}var it=class extends fo.Plugin{constructor(){super(...arguments);this.settings=H;this.noticeService=new Et;this.ankiGateway=new Ct(()=>this.settings.ankiConnectUrl);this.deckTemplateInsertionService=new pt}async onload(){let n=new Ft(this);this.pluginConfigRepository=new Tt(n);let r=new At(n),i=new wt(this.app);this.vaultGateway=i;try{this.settings=await this.pluginConfigRepository.load()}catch(o){console.error("Failed to load plugin settings, falling back to defaults.",o),this.settings=H,this.noticeService.error(g("notice.invalidSettingsRestored"))}let a=new Sn(i,r,this.ankiGateway);this.syncCurrentFileUseCase=new xt(a),this.syncVaultUseCase=new St(a),this.clearCurrentFileSyncedCardsUseCase=new bt(r,this.ankiGateway,i),this.cleanupEmptyDecksUseCase=new ft(this.ankiGateway),vi(this),this.addSettingTab(new Nt(this))}async updateSettings(n){if(!this.pluginConfigRepository)return;let r=be({...this.settings,...n});try{await this.pluginConfigRepository.save(r),this.settings=r}catch(i){this.noticeService.error(ye(i,"notice.failedSavePluginSettings"))}}async listNoteModels(){return this.ankiGateway.listNoteModels()}async getModelFieldNamesByModelNames(n){return this.ankiGateway.getModelFieldNamesByModelNames(n)}async getNoteModelDetails(n){return this.ankiGateway.getModelDetails(n)}async listFolderTree(){return this.vaultGateway?this.vaultGateway.listFolderTree():[]}async runSyncCurrentFile(){let n=this.app.workspace.getActiveFile();if(!n||n.extension.toLowerCase()!=="md"){this.noticeService.error(g("notice.noActiveMarkdownForSync"));return}if(!this.syncCurrentFileUseCase){this.noticeService.error(g("notice.syncUseCaseNotInitialized"));return}try{let r=await this.syncCurrentFileUseCase.execute(n.path,this.settings);this.noticeService.showSyncSummary("currentFile",r)}catch(r){if(r instanceof rt||r instanceof Oe){this.noticeService.info(at(r));return}console.error("Current file sync failed.",r),this.noticeService.error(ye(r,"notice.currentFileSyncFailed"))}}async runSyncVault(){if(!this.syncVaultUseCase){this.noticeService.error(g("notice.syncUseCaseNotInitialized"));return}try{let n=await this.syncVaultUseCase.execute(this.settings);this.noticeService.showSyncSummary("vault",n)}catch(n){if(n instanceof Oe){this.noticeService.info(at(n));return}console.error("Vault sync failed.",n),this.noticeService.error(ye(n,"notice.vaultSyncFailed"))}}async insertDeckTemplateToCurrentFile(){let n=this.app.workspace.getActiveFile();if(!n||n.extension.toLowerCase()!=="md"){this.noticeService.error(g("notice.noActiveMarkdownForDeckTemplateInsertion"));return}if(!this.vaultGateway){this.noticeService.error(g("notice.vaultGatewayNotInitialized"));return}try{let r=await this.vaultGateway.readMarkdownFile(n.path);if(!r){this.noticeService.error(g("notice.markdownFileNotFound",{filePath:n.path}));return}let i=this.deckTemplateInsertionService.insert(r,this.settings.fileDeckMarker,this.settings.fileDeckTemplate,this.settings.fileDeckInsertLocation);if(i.nextContent===i.expectedContent){this.noticeService.info(g("notice.deckTemplateAlreadyCurrent"));return}await this.vaultGateway.replaceMarkdownFile(n.path,i.expectedContent,i.nextContent),this.noticeService.info(g("notice.deckTemplateInserted",{deck:i.insertedDeck}))}catch(r){console.error("Deck template insertion failed.",r),this.noticeService.error(ye(r,"notice.deckTemplateInsertionFailed"))}}async runClearCurrentFileSyncedCards(){let n=this.app.workspace.getActiveFile();if(!n||n.extension.toLowerCase()!=="md"){this.noticeService.error(g("notice.noActiveMarkdownForReset"));return}if(!this.clearCurrentFileSyncedCardsUseCase){this.noticeService.error(g("notice.clearCurrentFileUseCaseNotInitialized"));return}try{if(!await this.clearCurrentFileSyncedCardsUseCase.hasTrackedCards(n.path)){this.noticeService.info(g("notice.noTrackedCardsInCurrentFile"));return}let i=await this.clearCurrentFileSyncedCardsUseCase.execute(n.path);this.noticeService.showClearCurrentFileSummary(i)}catch(r){console.error("Clear current file synced cards failed.",r),this.noticeService.error(ye(r,"notice.clearCurrentFileFailed"))}}async runCleanupEmptyDecks(){if(!this.cleanupEmptyDecksUseCase){this.noticeService.error(g("notice.cleanupEmptyDecksUseCaseNotInitialized"));return}try{let n=await this.cleanupEmptyDecksUseCase.listCandidates();if(n.length===0){this.noticeService.info(g("notice.noEmptyDeckCandidates"));return}let r=await new Dt(this.app,n).openAndGetSelection();if(r===null){this.noticeService.info(g("notice.cleanupEmptyDecksCancelled"));return}let i=await this.cleanupEmptyDecksUseCase.execute(r,n);this.noticeService.showCleanupEmptyDecksSummary(i)}catch(n){console.error("Cleanup empty decks failed.",n),this.noticeService.error(ye(n,"notice.cleanupEmptyDecksFailed"))}}};var cl=it;