varoe=Object.defineProperty;varTe=Object.getOwnPropertyDescriptor;varCe=Object.getOwnPropertyNames;varFe=Object.prototype.hasOwnProperty;varxe=(m,t)=>{for(vareint)oe(m,e,{get:t[e],enumerable:!0})},Se=(m,t,e,n)=>{if(t&&typeoft=="object"||typeoft=="function")for(letiofCe(t))!Fe.call(m,i)&&i!==e&&oe(m,i,{get:()=>t[i],enumerable:!(n=Te(t,i))||n.enumerable});returnm};varIe=m=>Se(oe({},"__esModule",{value:!0}),m);varLe={};xe(Le,{default:()=>re});module.exports=Ie(Le);varbe=require("obsidian");vark=require("obsidian");varJ=class{constructor(){this.values=newMap}put(t,e){this.values.set(t,e)}get(t,e){varn;return(n=this.values.get(t))!=null?n:e}getFirst(t,e){for(letn=0;n<t.length;n++){leti=t[n];if(this.containsKey(i))returnthis.get(i,e)}returne}containsKey(t){returnthis.values.has(t)}getKeys(){returnArray.from(this.values.keys())}removeKey(t){returnthis.values.delete(t)}clear(){this.values.clear()}};varae=require("obsidian"),R=class{staticgetFilePathWithNewExtension(t,e){return(0,ae.normalizePath)(t.parent.path+"/"+t.basename+"."+e)}staticgetFilePathExcludingExtension(t){return(0,ae.normalizePath)(t.parent.path+"/"+t.basename)}};varg=class{staticsetActive(t){g.isActive=t,g.isActive||this.clear()}staticsetAutoExpire(t){g.baseMinutesToExpire=t!=null?t:0,g.updateExpiryTime()}staticsetLevel(t){g.level!=t&&(g.allLevels.contains(t)&&(g.level=t),g.level=g.LevelFilename,this.clear())}staticupdateExpiryTime(){g.baseMinutesToExpire==0||g.baseMinutesToExpire==null?g.expiryTime=null:g.expiryTime=Date.now()+g.baseMinutesToExpire*1e3*60}staticputByFile(t,e){if(!g.isActive)return;letn=g.getFileCacheKey(e);this.cache.put(n,t),g.updateExpiryTime()}staticgetByFile(t){if(!g.isActive)returng.blankPasswordAndHint;this.clearIfExpired(),g.updateExpiryTime();lete=g.getFileCacheKey(t);returnthis.cache.get(e,g.blankPasswordAndHint)}staticputByPath(t,e){if(!g.isActive)return;letn=g.getPathCacheKey(e);this.cache.put(n,t),g.updateExpiryTime()}staticgetByPath(t){if(!g.isActive)returng.blankPasswordAndHint;this.clearIfExpired(),g.updateExpiryTime();lete=g.getPathCacheKey(t);returnthis.cache.get(e,g.blankPasswordAndHint)}staticgetPathCacheKey(t){lete=t.split("/").slice(0,-1).join("/");switch(g.level){caseg.LevelParentPath:returne;default:returnt}}staticgetFileCacheKey(t){switch(g.level){caseg.LevelParentPath:returnt.parent.path;default:returnR.getFilePathExcludingExtension(t)}}staticclearIfExpired(){g.expiryTime!=null&&(Date.now()<g.expiryTime||this.clear())}staticclearForFile(t){lete=g.getFileCacheKey(t);this.cache.removeKey(e)}staticclearForPath(t){lete=g.getPathCacheKey(t);this.cache.removeKey(e)}staticclear(){this.cache.clear()}},f=g;f.isActive=!0,f.blankPasswordAndHint={password:"",hint:""},f.cache=newJ,f.baseMinutesToExpire=0,f.expiryTime=null,f.LevelFilename="filename",f.LevelParentPath="parentPath",f.allLevels=[g.LevelFilename,g.LevelParentPath],f.level=g.LevelFilename;var_=classextendsk.PluginSettingTab{constructor(e,n,i,s){super(e,n);this.plugin=n,this.settings=i,this.features=s}display(){let{containerEl:e}=this;e.empty(),newk.Setting(e).setName("Confirm password?").setDesc("Confirm password when encrypting. (Recommended)").addToggle(r=>{r.setValue(this.settings.confirmPassword).onChange(asynco=>{this.settings.confirmPassword=o,awaitthis.plugin.saveSettings()})});letn=()=>{if(!this.settings.rememberPassword){i.settingEl.hide(),s.settingEl.hide();return}i.settingEl.show(),s.settingEl.show();letr=this.settings.rememberPasswordTimeout,o=`For ${r} minutes`;r==0&&(o="Until Obsidian is closed"),i.setName(`Remember Password (${o})`)};newk.Setting(e).setName("Remember password?").setDesc("Remember the last used passwords when encrypting or decrypting. Passwords are remembered until they timeout or Obsidian is closed").addToggle(r=>{r.setValue(this.settings.rememberPassword).onChange(asynco=>{this.settings.rememberPassword=o,awaitthis.plugin.saveSettings(),f.setActive(this.settings.rememberPassword),n()})});leti=newk.Setting(e).setDesc("The number of minutes to remember passwords.")