46 lines
136 KiB
JavaScript
46 lines
136 KiB
JavaScript
|
|
"use strict";var Ds=Object.create;var Ee=Object.defineProperty;var Ns=Object.getOwnPropertyDescriptor;var Vs=Object.getOwnPropertyNames;var Os=Object.getPrototypeOf,Ms=Object.prototype.hasOwnProperty;var E=(s,t)=>()=>{try{return t||s((t={exports:{}}).exports,t),t.exports}catch(e){throw t=0,e}},Fs=(s,t)=>{for(var e in t)Ee(s,e,{get:t[e],enumerable:!0})},Pt=(s,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Vs(t))!Ms.call(s,n)&&n!==e&&Ee(s,n,{get:()=>t[n],enumerable:!(i=Ns(t,n))||i.enumerable});return s};var Et=(s,t,e)=>(e=s!=null?Ds(Os(s)):{},Pt(t||!s||!s.__esModule?Ee(e,"default",{value:s,enumerable:!0}):e,s)),Gs=s=>Pt(Ee({},"__esModule",{value:!0}),s);var ie=E((Yo,wt)=>{"use strict";var Us="2.0.0",qs=Number.MAX_SAFE_INTEGER||9007199254740991,Hs=16,js=250,zs=["major","premajor","minor","preminor","patch","prepatch","prerelease"];wt.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Hs,MAX_SAFE_BUILD_LENGTH:js,MAX_SAFE_INTEGER:qs,RELEASE_TYPES:zs,SEMVER_SPEC_VERSION:Us,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var se=E((Zo,Rt)=>{"use strict";var _s=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...s)=>console.error("SEMVER",...s):()=>{};Rt.exports=_s});var Q=E((q,yt)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:_e,MAX_SAFE_BUILD_LENGTH:Xs,MAX_LENGTH:Ws}=ie(),Ks=se();q=yt.exports={};var Ys=q.re=[],Zs=q.safeRe=[],b=q.src=[],Js=q.safeSrc=[],T=q.t={},Qs=0,Xe="[a-zA-Z0-9-]",en=[["\\s",1],["\\d",Ws],[Xe,Xs]],tn=s=>{for(let[t,e]of en)s=s.split(`${t}*`).join(`${t}{0,${e}}`).split(`${t}+`).join(`${t}{1,${e}}`);return s},w=(s,t,e)=>{let i=tn(t),n=Qs++;Ks(s,n,t),T[s]=n,b[n]=t,Js[n]=i,Ys[n]=new RegExp(t,e?"g":void 0),Zs[n]=new RegExp(i,e?"g":void 0)};w("NUMERICIDENTIFIER","0|[1-9]\\d*");w("NUMERICIDENTIFIERLOOSE","\\d+");w("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Xe}*`);w("MAINVERSION",`(${b[T.NUMERICIDENTIFIER]})\\.(${b[T.NUMERICIDENTIFIER]})\\.(${b[T.NUMERICIDENTIFIER]})`);w("MAINVERSIONLOOSE",`(${b[T.NUMERICIDENTIFIERLOOSE]})\\.(${b[T.NUMERICIDENTIFIERLOOSE]})\\.(${b[T.NUMERICIDENTIFIERLOOSE]})`);w("PRERELEASEIDENTIFIER",`(?:${b[T.NONNUMERICIDENTIFIER]}|${b[T.NUMERICIDENTIFIER]})`);w("PRERELEASEIDENTIFIERLOOSE",`(?:${b[T.NONNUMERICIDENTIFIER]}|${b[T.NUMERICIDENTIFIERLOOSE]})`);w("PRERELEASE",`(?:-(${b[T.PRERELEASEIDENTIFIER]}(?:\\.${b[T.PRERELEASEIDENTIFIER]})*))`);w("PRERELEASELOOSE",`(?:-?(${b[T.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${b[T.PRERELEASEIDENTIFIERLOOSE]})*))`);w("BUILDIDENTIFIER",`${Xe}+`);w("BUILD",`(?:\\+(${b[T.BUILDIDENTIFIER]}(?:\\.${b[T.BUILDIDENTIFIER]})*))`);w("FULLPLAIN",`v?${b[T.MAINVERSION]}${b[T.PRERELEASE]}?${b[T.BUILD]}?`);w("FULL",`^${b[T.FULLPLAIN]}$`);w("LOOSEPLAIN",`[v=\\s]*${b[T.MAINVERSIONLOOSE]}${b[T.PRERELEASELOOSE]}?${b[T.BUILD]}?`);w("LOOSE",`^${b[T.LOOSEPLAIN]}$`);w("GTLT","((?:<|>)?=?)");w("XRANGEIDENTIFIERLOOSE",`${b[T.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);w("XRANGEIDENTIFIER",`${b[T.NUMERICIDENTIFIER]}|x|X|\\*`);w("XRANGEPLAIN",`[v=\\s]*(${b[T.XRANGEIDENTIFIER]})(?:\\.(${b[T.XRANGEIDENTIFIER]})(?:\\.(${b[T.XRANGEIDENTIFIER]})(?:${b[T.PRERELEASE]})?${b[T.BUILD]}?)?)?`);w("XRANGEPLAINLOOSE",`[v=\\s]*(${b[T.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[T.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[T.XRANGEIDENTIFIERLOOSE]})(?:${b[T.PRERELEASELOOSE]})?${b[T.BUILD]}?)?)?`);w("XRANGE",`^${b[T.GTLT]}\\s*${b[T.XRANGEPLAIN]}$`);w("XRANGELOOSE",`^${b[T.GTLT]}\\s*${b[T.XRANGEPLAINLOOSE]}$`);w("COERCEPLAIN",`(^|[^\\d])(\\d{1,${_e}})(?:\\.(\\d{1,${_e}}))?(?:\\.(\\d{1,${_e}}))?`);w("COERCE",`${b[T.COERCEPLAIN]}(?:$|[^\\d])`);w("COERCEFULL",b[T.COERCEPLAIN]+`(?:${b[T.PRERELEASE]})?(?:${b[T.BUILD]})?(?:$|[^\\d])`);w("COERCERTL",b[T.COERCE],!0);w("COERCERTLFULL",b[T.COERCEFULL],!0);w("LONETILDE","(?:~>?)");w("TILDETRIM",`(\\s*)${b[T.LONETILDE]}\\s+`,!0);q.tildeTrimReplace="$1~";w("TILDE",`^${b[T.LONETILDE]}${b[T.XRANGEPLAIN]}$`);w("TILDELOOSE",`^${b[T.LONETILDE]}${b[T.XRANGEPLAINLOOSE]}$`);w("LONECARET","(?:\\^)");w("CARETTRIM",`(\\s*)${b[T.LONECARET]}\\s+`,!0);q.caretTrimReplace="$1^";w("CARET",`^${b[T.LONECARET]}${b[T.XRANGEPLAIN]}$`);w("CARETLOOSE",`^${b
|
||
|
|
GitHub API rate limit exceeded:`,`
|
||
|
|
Request: ${l.requestUrl}`,`
|
||
|
|
Rate limits - Remaining: ${l.remaining}`,`
|
||
|
|
Reset in: ${l.getMinutesToReset()} minutes`),l}throw t&&console.error("GitHub request failed:",r),o}};var ht={pluginList:[],pluginSubListFrozenVersion:[],themesList:[],updateAtStartup:!0,updateThemesAtStartup:!0,enableAfterInstall:!0,loggingEnabled:!1,loggingPath:"BRAT-log",loggingVerboseEnabled:!1,debuggingMode:!1,notificationsEnabled:!0,globalTokenName:"",personalAccessToken:"",selectLatestPluginVersionByDefault:!1,allowIncompatiblePlugins:!1};function fs(s,t,e="latest",i=!1,n=""){let r=!1;s.settings.pluginList.contains(t)||(s.settings.pluginList.unshift(t),r=!0);let o=s.settings.pluginSubListFrozenVersion.find(a=>a.repo===t);o?(Object.assign(o,{repo:t,version:e,token:void 0,tokenName:n||o.tokenName,isIncompatible:i||void 0}),r=!0):(s.settings.pluginSubListFrozenVersion.unshift({repo:t,version:e,token:void 0,tokenName:n||void 0,isIncompatible:i||void 0}),r=!0),r&&s.saveSettings()}function Me(s,t){return s.settings.pluginList.contains(t)}function bs(s,t,e){let i={repo:t,lastUpdate:pe(e)};s.settings.themesList.unshift(i),s.saveSettings()}function Ts(s,t){return!!s.settings.themesList.find(i=>i.repo===t)}function ft(s,t,e){let i=s.settings.pluginSubListFrozenVersion.find(n=>n.repo===t);i&&(i.tokenName=e||void 0,s.saveSettings())}function vs(s,t,e){for(let i of s.settings.themesList)i.repo===t&&(i.lastUpdate=e,s.saveSettings())}var V=require("obsidian");var Fe=class{constructor(t){this.statusEl=t}async validateToken(t,e){var i,n,r,o,a,l,c,p,d;if(!t)return(i=this.statusEl)==null||i.setText("No token provided"),(n=this.statusEl)==null||n.addClass("invalid"),(r=this.statusEl)==null||r.removeClass("valid"),!1;try{let g=await Ne(t,e);return(o=this.statusEl)==null||o.removeClass("invalid","valid"),(a=this.statusEl)==null||a.empty(),g.validToken?((l=this.statusEl)==null||l.addClass("valid"),this.showValidTokenInfo(g),!0):((c=this.statusEl)==null||c.addClass("invalid"),this.showErrorMessage(g.error),!1)}catch(g){return console.error("Token validation error:",g),(p=this.statusEl)==null||p.setText("Failed to validate token"),(d=this.statusEl)==null||d.addClass("invalid"),!1}}showValidTokenInfo(t){var i,n;let e=(i=this.statusEl)==null?void 0:i.createDiv({cls:"brat-token-details"});if(e&&(e.createDiv({text:"\u2713 Valid token",cls:"brat-token-status valid"}),(n=t.currentScopes)!=null&&n.length&&e.createDiv({text:`Scopes: ${t.currentScopes.join(", ")}`,cls:"brat-token-scopes"}),t.rateLimit&&e.createDiv({text:`Rate Limit: ${t.rateLimit.remaining}/${t.rateLimit.limit}`,cls:"brat-token-rate"}),t.expirationDate)){let r=new Date(t.expirationDate),o=Math.ceil((r.getTime()-Date.now())/(1e3*60*60*24));o<7&&e.createDiv({text:`\u26A0\uFE0F Token expires in ${o} days`,cls:"brat-token-warning"})}}showErrorMessage(t){var i,n,r;let e=(i=this.statusEl)==null?void 0:i.createDiv({cls:"brat-token-error"});if(e&&(e.createDiv({text:t.message}),t.details))switch(t.type){case"invalid_prefix":e.createDiv({text:`Valid prefixes: ${(n=t.details.validPrefixes)==null?void 0:n.join(", ")}`});break;case"insufficient_scope":e.createDiv({text:`Required scopes: ${(r=t.details.requiredScopes)==null?void 0:r.join(", ")}`});break}}};function W(s,t){let e=new DocumentFragment,i=document.createElement("a");if(i.textContent=s,i.href=`https://github.com/${s}`,i.target="_blank",e.appendChild(i),t){let n=document.createTextNode(t);e.appendChild(n)}return e}function bt({prependText:s,url:t,text:e,appendText:i}){let n=new DocumentFragment,r=document.createElement("a");if(r.textContent=e,r.href=t,s){let o=document.createTextNode(s);n.appendChild(o)}if(n.appendChild(r),i){let o=document.createTextNode(i);n.appendChild(o)}return n}var Rs=require("obsidian");var Ps={common:{and:" und ",promotional:{learnMore:"Mehr \xFCber meine Arbeit:"}},settings:{general:{autoEnablePluginsAfterInstallation:{name:"Beta-Plugins nach der Installation automatisch aktivieren",desc:"Wenn aktiviert, werden neu installierte Beta-Plugins standardm\xE4\xDFig automatisch aktiviert. Diese Option kann im Formular zum Hinzuf\xFCgen eines Plugins pro Plugin angepasst werden."},autoUpdatePluginsAtStartup:{name:"
|
||
|
|
${t}
|
||
|
|
${n}`,e*1e3);i&&(r.messageEl.oncontextmenu=()=>{i()})}var Ue=(s,t=!0)=>{let e=R().common.promotional,i=s.createEl("div",{cls:"brat-promotional-links"});t?i.addClass("brat-promotional-links-settings"):i.addClass("brat-promotional-links-modal");let n=i.createDiv("coffee");n.addClass("ex-twitter-span"),n.addClass("brat-promotional-links-coffee");let r=n.createDiv();r.innerText=e.learnMore,n.appendChild(r);let o=n.createEl("a",{href:"https://tfthacker.com"});return o.innerText="https://tfthacker.com",i};var ys=require("obsidian");var qe=class extends ys.SuggestModal{constructor(t,e,i,n,r){super(t);let o=R().versionSuggestModal;this.versions=i,this.selected=n,this.onChoose=r,this.setTitle(o.title),this.setPlaceholder(o.placeholder(e)),this.setInstructions([{command:"\u2191\u2193",purpose:o.instructions.navigateVersions},{command:"\u21B5",purpose:o.instructions.selectVersion},{command:"esc",purpose:o.instructions.dismissModal}])}getSuggestions(t){let e=t.toLowerCase();return this.versions.filter(i=>i.version.toLowerCase().contains(e))}renderSuggestion(t,e){let i=R().versionSuggestModal;e.createEl("div",{text:`${i.versionLabel(t.version)} ${t.prerelease?i.prereleaseSuffix:""}`})}onChooseSuggestion(t){this.onChoose(t.version)}onNoSuggestion(){this.onChoose(this.selected?this.selected:""),this.close()}};var K=class extends V.Modal{constructor(e,i,n=!1,r=!1,o="",a="",l="",c){super(e.app);this.versionSetting=null;this.repositoryAddressEl=null;this.tokenInputEl=null;this.validateButton=null;this.validator=null;this.addPluginButton=null;this.cancelButton=null;this.plugin=e,this.betaPlugins=i,this.address=o,this.version=a,this.secretName=l,this.openSettingsTabAfterwards=n,this.updateVersion=r,this.enableAfterInstall=e.settings.enableAfterInstall,this.onSubmitted=c}async submitForm(){var o,a,l,c,p,d,g,u,m,h;let e=R().addBetaPluginModal;if(this.address==="")return;let i=De(this.address);if(this.plugin.settings.pluginSubListFrozenVersion.find(f=>f.repo===i)){await this.betaPlugins.addPlugin(i,!1,!1,!1,this.version,!0,this.enableAfterInstall,this.secretName)&&((o=this.onSubmitted)==null||o.call(this),this.close()),(a=this.cancelButton)==null||a.setDisabled(!1),(l=this.addPluginButton)==null||l.setDisabled(!1),(c=this.addPluginButton)==null||c.setButtonText(e.buttons.addPlugin),(p=this.versionSetting)==null||p.setDisabled(!1);return}if(!this.version&&Me(this.plugin,i)){v(this.plugin,e.alreadyInList,10);return}await this.betaPlugins.addPlugin(i,!1,!1,!1,this.version,!1,this.enableAfterInstall,this.secretName)&&((d=this.onSubmitted)==null||d.call(this),this.close()),(g=this.cancelButton)==null||g.setDisabled(!1),(u=this.addPluginButton)==null||u.setDisabled(!1),(m=this.addPluginButton)==null||m.setButtonText(e.buttons.addPlugin),(h=this.versionSetting)==null||h.setDisabled(!1)}updateVersionDropdown(e,i,n=""){let r=R().addBetaPluginModal,o;e.clear(),i.length>0&&!n&&this.plugin.settings.selectLatestPluginVersionByDefault?(o="latest",this.version="latest"):o=n,i.length<20||V.Platform.isMobile?e.addDropdown(l=>{l.addOption("",r.version.selectVersion),l.addOption("latest",r.version.latestVersion);for(let c of i)l.addOption(c.version,`${c.version} ${c.prerelease?r.version.prereleaseSuffix:""}`);l.onChange(c=>{var p;this.version=c,(p=this.addPluginButton)==null||p.setDisabled(this.version==="")}),l.setValue(o),l.selectEl.addClass("brat-version-selector")}):e.addButton(l=>{l.setButtonText(o==="latest"?r.version.latestVersion:o||r.version.selectVersionEllipsis).setClass("brat-version-selector").setClass("button").onClick(()=>{let p=[{version:"latest",prerelease:!1},...i];new qe(this.app,this.address,p,o,g=>{var u;this.version=g,l.setButtonText(g==="latest"?r.version.latestVersion:g||r.version.selectVersionEllipsis),(u=this.addPluginButton)==null||u.setDisabled(this.version==="")}).open()})})}onOpen(){let e=R().addBetaPluginModal,i=this.contentEl.createEl("h4");this.address?(i.appendText(e.heading.changePluginVersion),i.appendChild(W(this.address))):i.setText(e.heading.githubRepositoryForBetaPlugin),this.contentEl.createEl("form",{},n=>{var d;let r=R
|
||
|
|
This does not seem to be an obsidian plugin with valid releases, as there are no releases available.`,15),console.error("BRAT: validateRepository",t,e,i)),null;let p=await ge(c,"manifest.json",this.plugin.settings.debuggingMode,l,a);if(!p)return i&&(v(this.plugin,`${t}
|
||
|
|
This does not seem to be an obsidian plugin, as there is no manifest.json file.`,15),console.error("BRAT: validateRepository",t,e,i)),null;let d=JSON.parse(p);if(!("id"in d))return i&&v(this.plugin,`${t}
|
||
|
|
The plugin id attribute for the release is missing from the manifest file`,15),null;if(!("version"in d))return i&&v(this.plugin,`${t}
|
||
|
|
The version attribute for the release is missing from the manifest file`,15),null;let g=(0,U.coerce)(c.tag_name,{includePrerelease:!0,loose:!0}),u=(0,U.coerce)(d.version,{includePrerelease:!0,loose:!0});return(g&&u?(0,U.compare)(g.version,u.version)!==0:g!==null&&d.version!==c.tag_name)&&g&&(i&&v(this.plugin,`${t}
|
||
|
|
Version mismatch detected:
|
||
|
|
Release tag version: ${c.tag_name}
|
||
|
|
Manifest version: ${d.version}
|
||
|
|
|
||
|
|
The release tag version will be used to ensure consistency.`,15),d.version=g.version),d}catch(l){if(l instanceof G){let c=`GitHub API rate limit exceeded. Reset in ${l.getMinutesToReset()} minutes.`;throw i&&v(this.plugin,c,15),console.error(`BRAT: validateRepository ${l}`),v(this.plugin,`${l.message} Consider adding a personal access token in BRAT settings for higher limits. See documentation for details.`,20,()=>{window.open("https://github.com/TfTHacker/obsidian42-brat/blob/main/BRAT-DEVELOPER-GUIDE.md#github-api-rate-limits")}),l}if(l instanceof H)throw i&&(l.status===401?v(this.plugin,`${t}
|
||
|
|
GitHub API Authentication error. Please verify that your personal access token is valid and set correctly.`,15):v(this.plugin,`${t}
|
||
|
|
GitHub API error ${l.status}: ${l.message}`,15)),console.error(`BRAT: validateRepository ${l}`),l;return i&&v(this.plugin,`${t}
|
||
|
|
Unspecified error encountered: ${String(l)}, verify debug for more information.`,15),null}}async getAllReleaseFiles(t,e,i="",n=""){let r=n,o=await mt(t,this.plugin.settings.debuggingMode,r),a=await Ve(t,i,e,this.plugin.settings.debuggingMode,o,r);if(!a)throw new Error("No release found");let l=e||i!=="";return console.debug({reallyGetManifestOrNot:l,version:a.tag_name}),{mainJs:await ge(a,"main.js",this.plugin.settings.debuggingMode,o,r),manifest:l?await ge(a,"manifest.json",this.plugin.settings.debuggingMode,o,r):"",styles:await ge(a,"styles.css",this.plugin.settings.debuggingMode,o,r)}}async writeReleaseFilesToPluginFolder(t,e){var r,o;let i=`${(0,O.normalizePath)(`${this.plugin.app.vault.configDir}/plugins/${t}`)}/`,{adapter:n}=this.plugin.app.vault;await n.exists(i)||await n.mkdir(i),await n.write(`${i}main.js`,(r=e.mainJs)!=null?r:""),await n.write(`${i}manifest.json`,(o=e.manifest)!=null?o:""),e.styles&&await n.write(`${i}styles.css`,e.styles)}async addPlugin(t,e=!1,i=!1,n=!1,r="",o=!1,a=this.plugin.settings.enableAfterInstall,l=""){try{this.plugin.settings.debuggingMode&&console.debug("BRAT: addPlugin",t,e,i,n,r,o,a,l?"with secret":"public");let c="";l&&l.trim()!==""?(c=this.plugin.app.secretStorage.getSecret(l)||"",c||v(this.plugin,`Secret not found for token name: ${l}. Please add it to SecretStorage or clear the token name for this plugin.`,10)):this.plugin.settings.globalTokenName&&(c=this.plugin.app.secretStorage.getSecret(this.plugin.settings.globalTokenName)||"");let p=10,d=await this.validateRepository(t,!0,!0,r,c),g=!!d;if(g||(d=await this.validateRepository(t,!1,!0,r,c)),d===null){let h=`${t}
|
||
|
|
A manifest.json file does not exist in the latest release of the repository. This plugin cannot be installed.`;return await this.plugin.log(h,!0),v(this.plugin,h,p),!1}if(!Object.hasOwn(d,"version")){let h=`${t}
|
||
|
|
The manifest.json file in the latest release or pre-release of the repository does not have a version number in the file. This plugin cannot be installed.`;return await this.plugin.log(h,!0),v(this.plugin,h,p),!1}let u=!1;if(Object.hasOwn(d,"minAppVersion")&&!(0,O.requireApiVersion)(d.minAppVersion)){if(r===""||r==="latest"||!this.plugin.settings.allowIncompatiblePlugins){let f=`Plugin: ${t}
|
||
|
|
|
||
|
|
The manifest.json for this plugin indicates that the Obsidian version of the app needs to be ${d.minAppVersion}, but this installation of Obsidian is ${O.apiVersion}.
|
||
|
|
|
||
|
|
You will need to update your Obsidian to use this plugin or contact the plugin developer for more information.`;return await this.plugin.log(f,!0),v(this.plugin,f,30),!1}if(!await pt({app:this.plugin.app,message:createFragment(f=>{f.appendText("Plugin: "),f.createEl("code",{text:t}),f.createEl("br"),f.appendText("The "),f.createEl("code",{text:"manifest.json"}),f.appendText(" for this plugin indicates that the Obsidian version of the app needs to be "),f.createEl("code",{text:d.minAppVersion}),f.appendText(", but this installation of Obsidian is "),f.createEl("code",{text:O.apiVersion}),f.appendText("."),f.createEl("br"),f.appendText("Using this plugin is not recommended and may not work as expected. Use at your own risk."),f.createEl("br"),f.appendText("Do you want to install it anyways?")})}))return!1;u=!0}let m=async()=>{var P,L;let h=await this.getAllReleaseFiles(t,g,r,c);console.debug("rFiles",h),(g||h.manifest==="")&&(h.manifest=JSON.stringify(d));let f=JSON.parse((P=h.manifest)!=null?P:"");if(u&&(f.brat={isIncompatible:!0,minAppVersionOriginal:f.minAppVersion},f.minAppVersion=O.apiVersion),O.Platform.isMobile&&f.isDesktopOnly)if(this.plugin.settings.allowIncompatiblePlugins){if(!await pt({app:this.plugin.app,message:createFragment(I=>{I.appendText("Plugin: "),I.createEl("code",{text:t}),I.createEl("br"),I.appendText("The "),I.createEl("code",{text:"manifest.json"}),I.appendText(" for this plugin indicates that the plugin has "),I.createEl("code",{text:"isDesktopOnly: true"}),I.appendText(", but you are using a mobile device."),I.createEl("br"),I.appendText("Using this plugin is not recommended and may not work as expected. Use at your own risk."),I.createEl("br"),I.appendText("Do you want to forcefully run it on mobile anyways?")})}))return null;f.isDesktopOnly=!1,(L=f.brat)!=null||(f.brat={}),f.brat.isDesktopOnlyOriginal=!0,f.brat.isIncompatible=!0,u=!0}else{let A=`Plugin: ${t}
|
||
|
|
|
||
|
|
The manifest.json for this plugin indicates that the plugin has isDesktopOnly: true, but you are using a mobile device.
|
||
|
|
|
||
|
|
The plugin will not be installed.`;return await this.plugin.log(A,!0),v(this.plugin,A,30),null}if(u&&(h.manifest=JSON.stringify(f)),this.plugin.settings.debuggingMode&&console.debug("BRAT: rFiles.manifest",g,h),h.mainJs===null){let A=`${t}
|
||
|
|
The release is not complete and cannot be downloaded. main.js is missing from the Release`;return await this.plugin.log(A,!0),v(this.plugin,A,p),null}return h};if(!e||o){let h=await m();if(h===null)return!1;if(await this.writeReleaseFilesToPluginFolder(d.id,h),fs(this.plugin,t,r,u,l),a){let{plugins:f}=this.plugin.app,P=(0,O.normalizePath)(`${f.getPluginFolder()}/${d.id}`);await f.loadManifest(P),await f.enablePluginAndSave(d.id)}if(await this.plugin.app.plugins.loadManifests(),o)await this.reloadPlugin(d.id),await this.plugin.log(`${t} reinstalled`,!0),v(this.plugin,`${t}
|
||
|
|
Plugin has been reinstalled and reloaded with version ${d.version}`,p);else{let f=r===""?"":` (version: ${r})`,P=`${t}${f}
|
||
|
|
The plugin has been registered with BRAT.`;a||(P+=" You may still need to enable it the Community Plugin List."),await this.plugin.log(P,!0),v(this.plugin,P,p)}}else{let h=`${this.plugin.app.vault.configDir}/plugins/${d.id}/`,f="";try{f=await this.plugin.app.vault.adapter.read(`${h}manifest.json`)}catch(S){if(S.errno===-4058||S.errno===-2)return await this.addPlugin(t,!1,g,!1,r,!1,a,l),!0;console.error("BRAT - Local Manifest Load",d.id,JSON.stringify(S,null,2))}if(r!==""&&r!=="latest")return v(this.plugin,`The version of ${t} is frozen, not updating.`,3),!1;let P=JSON.parse(f),L=(0,U.coerce)(P.version,{includePrerelease:!0,loose:!0}),A=(0,U.coerce)(d.version,{includePrerelease:!0,loose:!0});if(L&&A?(0,U.compare)(L.version,A.version)===-1:P.version!==d.version){let S=await m();if(S===null)return!1;if(i){let z=`There is an update available for ${d.id} from version ${P.version} to ${d.version}. `;return await this.plugin.log(`${z}[Release Info](https://github.com/${t}/releases/tag/${d.version})`,!0),v(this.plugin,z,30,()=>{d&&window.open(`https://github.com/${t}/releases/tag/${d.version}`)}),!1}await this.writeReleaseFilesToPluginFolder(d.id,S),await this.plugin.app.plugins.loadManifests(),await this.reloadPlugin(d.id);let k=`${d.id}
|
||
|
|
Plugin has been updated from version ${P.version} to ${d.version}. `;return await this.plugin.log(`${k}[Release Info](https://github.com/${t}/releases/tag/${d.version})`,!0),v(this.plugin,k,30,()=>{d&&window.open(`https://github.com/${t}/releases/tag/${d.version}`)}),!0}return n&&v(this.plugin,`No update available for ${t}`,3),!0}}catch(c){console.error(`BRAT: Error adding plugin ${t}:`,{error:c,updatePluginFiles:e,seeIfUpdatedOnly:i,specifyVersion:r,forceReinstall:o});let p=c instanceof Error?c.message:"Unknown error occurred";return await this.plugin.log(`Error ${e?"updating":"adding"} plugin ${t}: ${p}`,!0),!1}return!0}async reloadPlugin(t){let{plugins:e}=this.plugin.app;try{await e.disablePlugin(t),await e.enablePlugin(t)}catch(i){this.plugin.settings.debuggingMode&&console.error("reload plugin",i)}}async updatePlugin(t,e=!1,i=!1,n=!1,r=""){let o=await this.addPlugin(t,!0,e,i,"",n,!1,r);return!o&&!e&&v(this.plugin,`${t}
|
||
|
|
Update of plugin failed.`),o}async checkForPluginUpdatesAndInstallUpdates(t=!1,e=!1){if(!await He()){console.debug("BRAT: No internet detected.");return}let i,n="Checking for plugin updates STARTED";await this.plugin.log(n,!0),t&&this.plugin.settings.notificationsEnabled&&(i=new O.Notice(`BRAT
|
||
|
|
${n}`,3e4));let r=new Map(this.plugin.settings.pluginSubListFrozenVersion.map(l=>[l.repo,l.version])),o=new Map(this.plugin.settings.pluginSubListFrozenVersion.map(l=>[l.repo,l.tokenName||""]));for(let l of this.plugin.settings.pluginList){let c=r.get(l);c&&c!=="latest"||await this.updatePlugin(l,e,!1,!1,o.get(l)||"")}let a="Checking for plugin updates COMPLETED";await this.plugin.log(a,!0),t&&(i&&i.hide(),v(this.plugin,a,10)),await this.checkForOfficiallyReleasedPlugins()}deletePlugin(t){let e=`Removed ${t} from BRAT plugin list`;this.plugin.log(e,!0),this.plugin.settings.pluginList=this.plugin.settings.pluginList.filter(i=>i!==t),this.plugin.settings.pluginSubListFrozenVersion=this.plugin.settings.pluginSubListFrozenVersion.filter(i=>i.repo!==t),this.plugin.saveSettings()}getEnabledDisabledPlugins(t){let e=this.plugin.app.plugins,i=Object.values(e.manifests),n=Object.values(e.plugins).map(r=>r.manifest);return t?i.filter(r=>n.find(o=>r.id===o.id)):i.filter(r=>!n.find(o=>r.id===o.id))}checkIncompatiblePlugins(){let t=this.plugin.settings.pluginSubListFrozenVersion.filter(e=>e.isIncompatible).map(e=>e.repo);t.length>0&&v(this.plugin,`The following incompatible plugins were forcefully installed by BRAT and may not work as expected:
|
||
|
|
${t.join(`
|
||
|
|
`)}`,30)}async getOfficiallyReleasedPlugins(){var o;let t=await de(this.plugin.settings.debuggingMode);if(!t)return[];let e=new Set(t.map(a=>a.repo)),i=new Map(this.plugin.settings.pluginSubListFrozenVersion.map(a=>[a.repo,a.version])),n=new Map(this.plugin.settings.pluginSubListFrozenVersion.map(a=>[a.repo,a.tokenName||""])),r=[];for(let a of this.plugin.settings.pluginList){let l=i.get(a);if(!(l&&l!=="latest")&&e.has(a))try{let c="",p=n.get(a)||"";p?c=this.plugin.app.secretStorage.getSecret(p)||"":this.plugin.settings.globalTokenName&&(c=this.plugin.app.secretStorage.getSecret(this.plugin.settings.globalTokenName)||"");let d=await Ve(a,void 0,!1,this.plugin.settings.debuggingMode,!1,c||void 0);if(!d)continue;let g=(o=t.find(f=>f.repo===a))==null?void 0:o.id;if(!g)continue;let u=this.plugin.app.plugins.manifests[g];if(!u)continue;let m=(0,U.coerce)(u.version,{includePrerelease:!0,loose:!0}),h=(0,U.coerce)(d.tag_name,{includePrerelease:!0,loose:!0});if(!m||!h)continue;(0,U.compare)(h.version,m.version)>=0&&r.push({repo:a,installedVersion:u.version,stableVersion:d.tag_name})}catch(c){this.plugin.settings.debuggingMode&&console.debug(`BRAT: Error checking graduation for ${a}:`,c)}}return r}async checkForOfficiallyReleasedPlugins(){try{let t=await this.getOfficiallyReleasedPlugins();for(let e of t){let i=`${e.repo} has been officially released (stable: ${e.stableVersion}). You can remove it from BRAT and use Obsidian's built-in updates.`;await this.plugin.log(i,!0),v(this.plugin,i,30,()=>{window.open(`https://github.com/${e.repo}/releases/tag/${e.stableVersion}`)})}}catch(t){this.plugin.settings.debuggingMode&&console.debug("BRAT: Error checking for officially released plugins:",t)}}};var Y=require("obsidian");var fe=async(s,t,e)=>{let i=R().themeMessages,n=await ee(t,!0,s.settings.debuggingMode);if(n||(n=await ee(t,!1,s.settings.debuggingMode)),!n)return v(s,i.noThemeCssFile),!1;let r=await ms(t,s.settings.debuggingMode);if(!r)return v(s,i.noManifestFile),!1;let o=await JSON.parse(r),a=(0,Y.normalizePath)(jo(s)+o.name),{adapter:l}=s.app.vault;await l.exists(a)||await l.mkdir(a),await l.write((0,Y.normalizePath)(`${a}/theme.css`),n),await l.write((0,Y.normalizePath)(`${a}/manifest.json`),r),vs(s,t,pe(n));let c="";return e?(bs(s,t,n),c=i.installed(o.name,t),window.setTimeout(()=>{s.app.customCss.setTheme(o.name)},500)):c=i.updated(o.name,t),s.log(`${c}[Theme Info](https://github.com/${t})`,!1),v(s,c,20,()=>{window.open(`https://github.com/${t}`)}),!0},te=async(s,t)=>{if(!await He()){console.debug("BRAT: No internet detected.");return}let e,i="Checking for beta theme updates STARTED";await s.log(i,!0),t&&s.settings.notificationsEnabled&&(e=new Y.Notice(`BRAT
|
||
|
|
${i}`,3e4));for(let r of s.settings.themesList){let o=await me(r.repo,!0,s.settings.debuggingMode);o==="0"&&(o=await me(r.repo,!1,s.settings.debuggingMode)),console.debug("BRAT: lastUpdateOnline",o),o!==r.lastUpdate&&await fe(s,r.repo,!1)}let n="Checking for beta theme updates COMPLETED";await s.log(n,!0),t&&(s.settings.notificationsEnabled&&e&&e.hide(),v(s,n))},be=(s,t)=>{let e=R().themeMessages;s.settings.themesList=s.settings.themesList.filter(n=>n.repo!==t),s.saveSettings();let i=e.removed(t);s.log(i,!0),v(s,i)},jo=s=>`${(0,Y.normalizePath)(`${s.app.vault.configDir}/themes`)}/`;var Ls="brat-migrations";async function zo(s,t){try{let e=await s.vault.adapter.read(`${s.vault.configDir}/plugins/obsidian42-brat/${Ls}.json`);return JSON.parse(e).appliedMigrations.includes(t)}catch(e){return!1}}async function _o(s,t){try{let e=`${s.vault.configDir}/plugins/obsidian42-brat/${Ls}.json`,i={appliedMigrations:[]};try{let n=await s.vault.adapter.read(e);i=JSON.parse(n)}catch(n){}i.appliedMigrations.includes(t)||(i.appliedMigrations.push(t),await s.vault.adapter.write(e,JSON.stringify(i,null,2)))}catch(e){console.error(`BRAT: Failed to mark migration ${t} complete:`,e)}}async function As(s,t,e){let i="tokens-to-secretstorage-v1";if(!await zo(s,i))try{let n=0,r=l=>{let p=`brat-gh-${l.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}`;return p.length>64?p.substring(0,64).replace(/-$/,""):p},o=l=>{let c=s.secretStorage.listSecrets();for(let p of c)if(s.secretStorage.getSecret(p)===l)return p;return null},a=(l,c)=>{let p=o(l);return p?(console.debug(`BRAT: Reusing existing secret "${p}"`),p):(s.secretStorage.setSecret(c,l),console.debug(`BRAT: Created new secret "${c}"`),c)};if(t.personalAccessToken&&t.personalAccessToken.trim()!==""){let l=t.personalAccessToken.trim(),p=a(l,"brat-gh-global");t.globalTokenName=p,t.personalAccessToken="",n++}if(t.pluginSubListFrozenVersion){for(let l of t.pluginSubListFrozenVersion)if(l.token&&l.token.trim()!==""){let c=l.token.trim(),p=r(l.repo),d=a(c,p);l.tokenName=d,l.token=void 0,n++}}n>0&&(await e(),console.debug(`BRAT: Migrated ${n} token(s) to SecretStorage`)),await _o(s,i)}catch(n){console.error("BRAT: Failed to migrate tokens to SecretStorage:",n)}}var Z=require("obsidian");var j=class extends Z.Modal{constructor(t,e=!1,i){super(t.app),this.plugin=t,this.address="",this.openSettingsTabAfterwards=e,this.onSubmitted=i}async submitForm(){var i;let t=R();if(this.address==="")return;let e=this.address.replace("https://github.com/","");if(Ts(this.plugin,e)){v(this.plugin,t.addBetaThemeModal.alreadyInList,10);return}await fe(this.plugin,e,!0)&&((i=this.onSubmitted)==null||i.call(this),this.close())}onOpen(){let t=R(),e=t.common;this.contentEl.createEl("h4",{text:t.addBetaThemeModal.heading.githubRepositoryForBetaTheme}),this.contentEl.createEl("form",{},i=>{i.addClass("brat-modal"),new Z.Setting(i).addText(o=>{o.setPlaceholder(t.addBetaPluginModal.repository.placeholder),o.setValue(this.address),o.onChange(a=>{this.address=a.trim()}),o.inputEl.addEventListener("keydown",a=>{a.key==="Enter"&&this.address!==" "&&(a.preventDefault(),this.submitForm())}),o.inputEl.addClass("brat-full-width-input"),window.setTimeout(()=>{let a=document.querySelector(".setting-item-info");a&&a.remove(),o.inputEl.focus()},10)}),i.createDiv("modal-button-container",o=>{new Z.ButtonComponent(o).setButtonText(t.addBetaPluginModal.buttons.neverMind).onClick(()=>{this.close()}),new Z.ButtonComponent(o).setButtonText(t.settings.betaThemeList.addBetaTheme).setCta().onClick(a=>{a.preventDefault(),console.debug("Add theme button clicked"),this.address!==""&&this.submitForm()})});let n=i.createDiv();n.addClass("brat-modal-divider");let r=n.createSpan();r.createEl("a",{href:"https://bit.ly/o42-twitter",text:"TFTHacker"}),r.appendText(e.and),r.createEl("a",{href:"https://github.com/johannrichard",text:"johannrichard"}),r.addClass("brat-credits"),n.appendChild(r),Ue(n,!1),window.setTimeout(()=>{let o=i.querySelectorAll(".brat-modal .setting-item-info");for(let a of Array.from(o))a.remove()},50)})}onClose
|
||
|
|
${r}`,3),this.plugin.betaPlugins.updatePlugin(n.info,!1,!0,!1,o==null?void 0:o.tokenName)})}},{id:"reinstallOnePlugin",icon:"BratIcon",name:"Plugins: Choose a single plugin to reinstall",showInRibbon:!0,callback:()=>{let t=new Set(this.plugin.settings.pluginSubListFrozenVersion.map(n=>n.repo)),e=Object.values(this.plugin.settings.pluginList).filter(n=>!t.has(n)).map(n=>({display:n,info:n})),i=new N(this.plugin);i.setSuggesterData(e),i.display(n=>{let r=`Reinstalling ${n.info}`;v(this.plugin,`
|
||
|
|
${r}`,3),this.plugin.log(r,!0),this.plugin.betaPlugins.updatePlugin(n.info,!1,!1,!0)})}},{id:"restartPlugin",icon:"BratIcon",name:"Plugins: Restart a plugin that is already installed",showInRibbon:!0,callback:()=>{let t=Object.values(this.plugin.app.plugins.manifests).map(i=>({display:i.id,info:i.id})),e=new N(this.plugin);e.setSuggesterData(t),e.display(i=>{v(this.plugin,`${i.info}
|
||
|
|
Plugin reloading .....`,5),this.plugin.betaPlugins.reloadPlugin(i.info)})}},{id:"disablePlugin",icon:"BratIcon",name:"Plugins: Disable a plugin - toggle it off",showInRibbon:!0,callback:()=>{let t=this.plugin.betaPlugins.getEnabledDisabledPlugins(!0).map(i=>({display:`${i.name} (${i.id})`,info:i.id})),e=new N(this.plugin);e.setSuggesterData(t),e.display(i=>{this.plugin.log(`${i.display} plugin disabled`,!1),this.plugin.settings.debuggingMode&&console.debug(i.info),this.plugin.app.plugins.disablePluginAndSave(i.info)})}},{id:"enablePlugin",icon:"BratIcon",name:"Plugins: Enable a plugin - toggle it on",showInRibbon:!0,callback:()=>{let t=this.plugin.betaPlugins.getEnabledDisabledPlugins(!1).map(i=>({display:`${i.name} (${i.id})`,info:i.id})),e=new N(this.plugin);e.setSuggesterData(t),e.display(i=>{this.plugin.log(`${i.display} plugin enabled`,!1),this.plugin.app.plugins.enablePluginAndSave(i.info)})}},{id:"openGitHubZRepository",icon:"BratIcon",name:"Plugins: Open the GitHub repository for a plugin",showInRibbon:!0,callback:async()=>{let t=await de(this.plugin.settings.debuggingMode);if(t){let e=Object.values(t).map(r=>({display:`Plugin: ${r.name} (${r.repo})`,info:r.repo})),i=Object.values(this.plugin.settings.pluginList).map(r=>({display:`BRAT: ${r}`,info:r}));for(let r of e)i.push(r);let n=new N(this.plugin);n.setSuggesterData(i),n.display(r=>{r.info&&window.open(`https://github.com/${r.info}`)})}}},{id:"openCommunityPagePlugin",icon:"BratIcon",name:"Plugins: Open the community page for a plugin",showInRibbon:!0,callback:async()=>{let t=await de(this.plugin.settings.debuggingMode);if(!t){v(this.plugin,"Could not load the Obsidian community plugin list.",5);return}let e=new Map(t.map(a=>[a.repo,a])),i=new Set,n=this.plugin.settings.pluginList.map(a=>e.get(a)).filter(a=>!!a).map(a=>(i.add(a.id),{display:`BRAT: ${a.name} (${a.id})`,info:a.id})),r=t.filter(a=>!i.has(a.id)).map(a=>({display:`Plugin: ${a.name} (${a.id})`,info:a.id})),o=new N(this.plugin);o.setSuggesterData([...n,...r]),o.display(a=>{a.info&&window.open(`https://obsidian.md/plugins?id=${encodeURIComponent(a.info)}`)})}},{id:"openGitHubRepoTheme",icon:"BratIcon",name:"Themes: Open the GitHub repository for a theme (appearance)",showInRibbon:!0,callback:async()=>{let t=await ps(this.plugin.settings.debuggingMode);if(t){let e=Object.values(t).map(n=>({display:`Theme: ${n.name} (${n.repo})`,info:n.repo})),i=new N(this.plugin);i.setSuggesterData(e),i.display(n=>{n.info&&window.open(`https://github.com/${n.info}`)})}}},{id:"opentPluginSettings",icon:"BratIcon",name:"Plugins: Open Plugin Settings Tab",showInRibbon:!0,callback:()=>{let t=this.plugin.app.setting,e=Object.values(t.pluginTabs).map(r=>({display:`Plugin: ${r.name}`,info:r.id})),i=new N(this.plugin),n=Object.values(t.settingTabs).map(r=>({display:`Core: ${r.name}`,info:r.id}));for(let r of e)n.push(r);i.setSuggesterData(n),i.display(r=>{t.open(),t.openTabById(r.info)})}},{id:"GrabBetaTheme",icon:"BratIcon",name:"Themes: Grab a beta theme for testing from a Github repository",showInRibbon:!0,callback:()=>{new j(this.plugin).open()}},{id:"updateBetaThemes",icon:"BratIcon",name:"Themes: Update beta themes",showInRibbon:!0,callback:async()=>{await te(this.plugin,!0)}},{id:"removeGraduatedFromBrat",icon:"BratIcon",name:"Plugins: Remove a graduated plugin from BRAT (keep installed)",showInRibbon:!0,callback:async()=>{let t=await this.plugin.betaPlugins.getOfficiallyReleasedPlugins();if(t.length===0){v(this.plugin,"No graduated plugins found. All BRAT plugins are still in beta.",5);return}let e=t.map(n=>({display:`${n.repo} (installed: ${n.installedVersion}, stable: ${n.stableVersion})`,info:n.repo})),i=new N(this.plugin);i.setSuggesterData(e),i.display(n=>{let r=n.info;this.plugin.betaPlugins.deletePlugin(r),this.plugin.settingsTab.update(),v(this.plugin,`${r} removed from BRAT. Obsidian will now manage updates via the community plugin list.`,10)})}},{id:"updateGraduatedToStableAndRemove",icon:"BratIcon",name:"Plugins: Update a graduated plugin to stable release and remove from BRAT",showInRibbon:!0,callback:a
|
||
|
|
`)}};var ve=class{constructor(t){this.console=(t,...e)=>{console.debug(`BRAT: ${t}`,...e)};this.themes={themeseCheckAndUpates:async t=>{await te(this.plugin,t)},themeInstallTheme:async t=>{let e=t.replace("https://github.com/","");await fe(this.plugin,e,!0)},themesDelete:t=>{let e=t.replace("https://github.com/","");be(this.plugin,e)},grabCommmunityThemeCssFile:async(t,e=!1)=>await ee(t,e,this.plugin.settings.debuggingMode),grabChecksumOfThemeCssFile:async(t,e=!1)=>await me(t,e,this.plugin.settings.debuggingMode),grabLastCommitDateForFile:async(t,e)=>await hs(t,e)};this.plugin=t}};var J=require("obsidian"),xs="YYYY-MM-DD";function Xo(s){var n,r,o,a,l;let t=s.app.plugins.getPlugin("periodic-notes"),e=(n=t==null?void 0:t.settings)==null?void 0:n.daily;if(e!=null&&e.enabled)return(r=e.format)!=null?r:xs;let i=s.app.internalPlugins.getPluginById("daily-notes");return(l=(a=(o=i==null?void 0:i.instance)==null?void 0:o.options)==null?void 0:a.format)!=null?l:xs}async function Bs(s,t,e=!1){if(s.settings.debuggingMode&&console.debug(`BRAT: ${t}`),s.settings.loggingEnabled){if(!s.settings.loggingVerboseEnabled&&e)return;let i=`${s.settings.loggingPath}.md`,n=J.moment.unix(Math.floor(Date.now()/1e3)),r=`[[${n.format(Xo(s)).toString()}]] ${n.format("HH:mm")}`,o=J.Platform.isDesktop?window.require("os"):null,a=J.Platform.isDesktop?o==null?void 0:o.hostname():"MOBILE",l=`${r} ${a} ${t.replace(`
|
||
|
|
`," ")}
|
||
|
|
`,c=s.app.vault.getAbstractFileByPath(i);c instanceof J.TFile?await s.app.vault.append(c,l):await s.app.vault.create(i,l)}}var ze=class extends Cs.Plugin{constructor(){super(...arguments);this.APP_NAME="BRAT";this.APP_ID="obsidian42-brat";this.settings=ht;this.settingsTab=new je(this.app,this);this.betaPlugins=new he(this);this.commands=new Te(this);this.bratApi=new ve(this);this.obsidianProtocolHandler=e=>{if(!e.plugin&&!e.theme){v(this,"Could not locate the repository from the URL.",10);return}for(let i of["plugin","theme"])if(e[i]){let n;switch(i){case"plugin":n=new K(this,this.betaPlugins,!0,!1,e[i],e.version?e.version:void 0),n.open();break;case"theme":n=new j(this),n.address=e[i],n.open();break}return}}}onload(){console.debug(`loading ${this.APP_NAME}`),Is(),this.addRibbonIcon("BratIcon","BRAT",()=>{this.commands.ribbonDisplayCommands()}),this.loadSettings().then(async()=>{await As(this.app,this.settings,()=>this.saveSettings()),this.app.workspace.onLayoutReady(()=>{this.addSettingTab(this.settingsTab),this.registerObsidianProtocolHandler("brat",this.obsidianProtocolHandler),this.betaPlugins.checkIncompatiblePlugins(),this.settings.updateAtStartup&&window.setTimeout(()=>{this.betaPlugins.checkForPluginUpdatesAndInstallUpdates(!1)},6e4),this.settings.updateThemesAtStartup&&window.setTimeout(()=>{te(this,!1)},12e4),window.setTimeout(()=>{window.bratAPI=this.bratApi},500)})}).catch(e=>{console.error("Failed to load settings:",e)})}async log(e,i=!1){await Bs(this,e,i)}onunload(){console.debug(`unloading ${this.APP_NAME}`)}async loadSettings(){let e=await this.loadData();this.settings=Object.assign({},ht,e!=null?e:{})}async saveSettings(){await this.saveData(this.settings)}};
|
||
|
|
|
||
|
|
/* nosourcemap */
|