Oscar Plaisant 3a5cad8e48 update
2024-12-17 18:49:14 +01:00

15 lines
100 KiB
JavaScript

"use strict";var Fn=Object.defineProperty;var xo=Object.getOwnPropertyDescriptor;var ko=Object.getOwnPropertyNames;var Co=Object.prototype.hasOwnProperty;var Po=(t,e)=>{for(var n in e)Fn(t,n,{get:e[n],enumerable:!0})},Eo=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ko(e))!Co.call(t,i)&&i!==n&&Fn(t,i,{get:()=>e[i],enumerable:!(r=xo(e,i))||r.enumerable});return t};var To=t=>Eo(Fn({},"__esModule",{value:!0}),t);var na={};Po(na,{UPDATE_DEBOUNCE:()=>st,default:()=>Nn});module.exports=To(na);var ae=require("obsidian");var qe=require("obsidian"),$=new Map,Er=0,oe;function Tr(t){oe=t}function Le(){return $}var Wn=(t,e)=>{var n,r;if(!(oe.settings.enableIgnoreObsExcludeFoldersLinksFrom&&(t!=null&&t.path)&&oe.app.metadataCache.isUserIgnored(t==null?void 0:t.path))){for(let i of[e==null?void 0:e.links,e==null?void 0:e.embeds,e==null?void 0:e.frontmatterLinks])if(i)for(let o of i){let{path:l,subpath:s}=o.link.startsWith("#")?(0,qe.parseLinktext)(t.path.replace(`.${t.extension}`,"")+o.link):(0,qe.parseLinktext)(o.link),a=oe.app.metadataCache.getFirstLinkpathDest(l,"/");if(a){if(oe.settings.enableIgnoreObsExcludeFoldersLinksTo&&(a!=null&&a.path)&&oe.app.metadataCache.isUserIgnored(a.path)||((r=(n=oe.app.metadataCache.getFileCache(a))==null?void 0:n.frontmatter)==null?void 0:r["snw-index-exclude"])===!0)continue;let p=(a?a.path+s:l).toLocaleUpperCase();$.set(p,[...$.get(p)||[],{realLink:o.link,reference:o,resolvedFile:a,sourceFile:t}])}else{let p=o.link.toLocaleUpperCase();$.set(p,[...$.get(p)||[],{realLink:o.link,reference:o,resolvedFile:{path:`${l}.md`,name:`${l}.md`,basename:l,extension:"md"},sourceFile:t}])}}}},Sr=async t=>{for(let[e,n]of $.entries()){let r=n.filter(i=>{var o;return((o=i==null?void 0:i.sourceFile)==null?void 0:o.path)!==t.path});r.length===0?$.delete(e):$.set(e,r)}};function on(){if(oe.showCountsActive===!0){$=new Map;for(let t of oe.app.vault.getMarkdownFiles()){let e=oe.app.metadataCache.getFileCache(t);e&&Wn(t,e)}window.snwAPI&&(window.snwAPI.references=$),Er=Date.now()}}var Pr=new Map;function pe(t){var o;if(oe.showCountsActive!==!0)return{};let e=Pr.get(t.path.toLocaleUpperCase());if(e){let l=(o=e.createDate)!=null?o:0;if(Er<l&&l+1e3>Date.now())return e}let n={},r=oe.app.metadataCache.getFileCache(t);if(!r)return n;let i=t.path.toLocaleUpperCase();if($||on(),r!=null&&r.headings){let l=`${i}#`,s=r.headings.filter(a=>$.has(l+(0,qe.stripHeading)(a.heading).toLocaleUpperCase())).map(a=>{let p=l+(0,qe.stripHeading)(a.heading).toLocaleUpperCase();return{original:"#".repeat(a.level)+a.heading,key:p,headerMatch:a.heading.replace(/\[|\]/g,""),pos:a.position,page:t.basename,type:"heading",references:$.get(p)}});s.length>0&&(n.headings=s)}if(r!=null&&r.blocks){let l=Object.values(r.blocks).filter(s=>{var a;return(((a=$.get(`${i}#^${s.id.toUpperCase()}`))==null?void 0:a.length)||0)>0}).map(s=>{let a=`${i}#^${s.id.toLocaleUpperCase()}`;return{key:a,pos:s.position,page:t.basename,type:"block",references:$.get(a)}});l.length>0&&(n.blocks=l)}if(r!=null&&r.links){let l=r.links.filter(s=>{let a=J(s.link.startsWith("#")?i+s.link:s.link).toLocaleUpperCase()||s.link.toLocaleUpperCase(),p=$.get(a);return(p==null?void 0:p.length)>0}).map(s=>{let a=J(s.link.startsWith("#")?i+s.link:s.link).toLocaleUpperCase()||s.link.toLocaleUpperCase(),p={key:a,original:s.original,type:"link",pos:s.position,page:t.basename,references:$.get(a)||[]};return a.includes("#")&&!a.includes("#^")&&(p.original=a.split("#")[1]),p});l.length>0&&(n.links=l)}if(r!=null&&r.embeds){let l=r.embeds.filter(s=>{var f;let a=(s.link.startsWith("#")?J(i+s.link):J(s.link)).toLocaleUpperCase()||s.link.toLocaleUpperCase(),p=a.startsWith("#")?`${t.basename}${a}`:a;return((f=$.get(p))==null?void 0:f.length)>0}).map(s=>{var d;let p=(()=>{let v=s.link.startsWith("#")?i+s.link:s.link;return J(v).toLocaleUpperCase()||s.link.toLocaleUpperCase()})(),f=p.startsWith("#")?`${t.basename}${p}`:p,[u,g]=f.includes("#")&&!f.includes("#^")?f.split("#"):[];return{key:f,page:t.basename,type:"embed",pos:s.position,references:(d=$.get(f))!=null?d:[],...g&&{original:g}}});l.length>0&&(n.embeds=l)}if(r!=null&&r.frontmatterLinks){let l=r.frontmatterLinks.filter(s=>$.has(J(s.link).toLocaleUpperCase()||s.link.toLocaleUpperCase())).map(s=>{let a=J(s.link).toLocaleUpperCase()||s.link.toLocaleUpperCase();return{key:a,original:s.original,type:"frontmatterLink",pos:{start:{line:-1,col:-1,offset:-1},end:{line:-1,col:-1,offset:-1}},displayText:s.displayText,page:t.basename,references:$.get(a)||[]}});l.length>0&&(n.frontmatterLinks=l)}return n.cacheMetaData=r,n.createDate=Date.now(),Pr.set(t.path,n),n}function J(t){let e=(0,qe.parseLinktext)(t),n=oe.app.metadataCache.getFirstLinkpathDest(e.path,"/");return n===null?"":n.path+e.subpath}var sn={enableOnStartupDesktop:!0,enableOnStartupMobile:!0,minimumRefCountThreshold:1,maxFileCountToDisplay:100,displayIncomingFilesheader:!0,displayInlineReferencesLivePreview:!0,displayInlineReferencesMarkdown:!0,displayInlineReferencesInSourceMode:!1,displayEmbedReferencesInGutter:!1,displayEmbedReferencesInGutterMobile:!1,displayPropertyReferences:!0,displayPropertyReferencesMobile:!1,enableRenderingBlockIdInMarkdown:!0,enableRenderingLinksInMarkdown:!0,enableRenderingHeadersInMarkdown:!0,enableRenderingEmbedsInMarkdown:!0,enableRenderingBlockIdInLivePreview:!0,enableRenderingLinksInLivePreview:!0,enableRenderingHeadersInLivePreview:!0,enableRenderingEmbedsInLivePreview:!0,enableIgnoreObsExcludeFoldersLinksFrom:!1,enableIgnoreObsExcludeFoldersLinksTo:!1,requireModifierKeyToActivateSNWView:!1,sortOptionDefault:"name-asc",displayCustomPropertyList:"",pluginSupportKanban:!1};var Et=class{constructor(e){this.references=new Map;this.console=(e,...n)=>{console.log(`SNW: ${e}`,n)};this.getMetaInfoByCurrentFile=async()=>{var e;return this.getMetaInfoByFileName(((e=this.plugin.app.workspace.getActiveFile())==null?void 0:e.path)||"")};this.searchReferencesStartingWith=async e=>{for(let[n,r]of Le())n.startsWith(e)&&console.log(n,r)};this.searchReferencesContains=async e=>{for(let[n,r]of Le())n.contains(e)&&console.log(n,r)};this.getMetaInfoByFileName=async e=>{let n=this.plugin.app.metadataCache.getFirstLinkpathDest(e,"/");return{TFile:n,metadataCache:n?this.plugin.app.metadataCache.getFileCache(n):null,SnwTransformedCache:n?pe(n):null}};this.plugin=e}parseLinkTextToFullPath(e){return J(e)}};var Lr=require("obsidian"),Tt=class{constructor(e){this.snwCommands=[{id:"SNW-ToggleActiveState",icon:"dot-network",name:"Toggle active state of SNW plugin on/off",showInRibbon:!0,callback:async()=>{this.plugin.showCountsActive=!this.plugin.showCountsActive;let e=`SNW toggled ${this.plugin.showCountsActive?`ON
`:`OFF
`}`;e+="Tabs may require reloading for this change to take effect.",new Lr.Notice(e),this.plugin.toggleStateSNWMarkdownPreview(),this.plugin.toggleStateSNWLivePreview(),this.plugin.toggleStateSNWGutters()}}];this.plugin=e;for(let n of this.snwCommands)this.plugin.addCommand({id:n.id,name:n.name,icon:n.icon,callback:async()=>{await n.callback()}})}};var S=require("obsidian"),an=class extends S.PluginSettingTab{constructor(e,n){super(e,n),this.plugin=n}display(){let{containerEl:e}=this;e.empty(),new S.Setting(e).setHeading().setName("Enable on startup"),new S.Setting(e).setName("On the desktop enable SNW at startup").addToggle(n=>{n.setValue(this.plugin.settings.enableOnStartupDesktop),n.onChange(async r=>{this.plugin.settings.enableOnStartupDesktop=r,await this.plugin.saveSettings()})}),new S.Setting(e).setName("On mobile devices enable SNW at startup").addToggle(n=>{n.setValue(this.plugin.settings.enableOnStartupMobile),n.onChange(async r=>{this.plugin.settings.enableOnStartupMobile=r,await this.plugin.saveSettings()})}),new S.Setting(e).setHeading().setName("SNW Activation"),new S.Setting(e).setName("Require modifier key to activate SNW").setDesc(`If enabled, SNW will only activate when the modifier key is pressed when hovering the mouse over an SNW counter.
Otherwise, SNW will activate on a mouse hover. May require reopening open files to take effect.`).addToggle(n=>{n.setValue(this.plugin.settings.requireModifierKeyToActivateSNWView),n.onChange(async r=>{this.plugin.settings.requireModifierKeyToActivateSNWView=r,await this.plugin.saveSettings()})}),new S.Setting(e).setHeading().setName("Thresholds"),new S.Setting(e).setName("Minimal required count to show counter").setDesc(`This setting defines how many references there needs to be for the reference count box to appear. May require reloading open files.
Currently set to: ${this.plugin.settings.minimumRefCountThreshold} references.`).addSlider(n=>n.setLimits(1,1e3,1).setValue(this.plugin.settings.minimumRefCountThreshold).onChange(async r=>{this.plugin.settings.minimumRefCountThreshold=r,await this.plugin.saveSettings()}).setDynamicTooltip()),new S.Setting(e).setName("Maximum file references to show").setDesc(`This setting defines the max amount of files with their references are displayed in the popup or sidebar. Set to 1000 for no maximum.
Currently set to: ${this.plugin.settings.maxFileCountToDisplay} references. Keep in mind higher numbers can affect performance on larger vaults.`).addSlider(n=>n.setLimits(1,1e3,1).setValue(this.plugin.settings.maxFileCountToDisplay).onChange(async r=>{this.plugin.settings.maxFileCountToDisplay=r,await this.plugin.saveSettings()}).setDynamicTooltip()),new S.Setting(e).setHeading().setName("Use Obsidian's Excluded Files list (Settings > Files & Links)"),new S.Setting(e).setName("Outgoing links").setDesc("If enabled, links FROM files in the excluded folder will not be included in SNW's reference counters. May require restarting Obsidian.").addToggle(n=>{n.setValue(this.plugin.settings.enableIgnoreObsExcludeFoldersLinksFrom),n.onChange(async r=>{this.plugin.settings.enableIgnoreObsExcludeFoldersLinksFrom=r,await this.plugin.saveSettings()})}),new S.Setting(e).setName("Incoming links").setDesc("If enabled, links TO files in the excluded folder will not be included in SNW's reference counters. May require restarting Obsidian.").addToggle(n=>{n.setValue(this.plugin.settings.enableIgnoreObsExcludeFoldersLinksTo),n.onChange(async r=>{this.plugin.settings.enableIgnoreObsExcludeFoldersLinksTo=r,await this.plugin.saveSettings()})}),new S.Setting(e).setHeading().setName("Properties"),new S.Setting(e).setName("Show references in properties on Desktop").addToggle(n=>{n.setValue(this.plugin.settings.displayPropertyReferences),n.onChange(async r=>{this.plugin.settings.displayPropertyReferences=r,await this.plugin.saveSettings()})}),new S.Setting(e).setName("Show references in properties on mobile").addToggle(n=>{n.setValue(this.plugin.settings.displayPropertyReferencesMobile),n.onChange(async r=>{this.plugin.settings.displayPropertyReferencesMobile=r,await this.plugin.saveSettings()})}),new S.Setting(e).setHeading().setName("View Modes"),new S.Setting(e).setName("Incoming Links Header Count").setDesc("In header of a document, show number of incoming link to that file.").addToggle(n=>{n.setValue(this.plugin.settings.displayIncomingFilesheader),n.onChange(async r=>{this.plugin.settings.displayIncomingFilesheader=r,await this.plugin.saveSettings()})}),new S.Setting(e).setName("Show SNW indicators in Live Preview Editor").setDesc("While using Live Preview, Display inline of the text of documents all reference counts for links, blocks and embeds.Note: files may need to be closed and reopened for this setting to take effect.").addToggle(n=>{n.setValue(this.plugin.settings.displayInlineReferencesLivePreview),n.onChange(async r=>{this.plugin.settings.displayInlineReferencesLivePreview=r,this.plugin.toggleStateSNWLivePreview(),await this.plugin.saveSettings()})}),new S.Setting(e).setName("Show SNW indicators in Reading view ").setDesc("While in Reading View of a document, display inline of the text of documents all reference counts for links, blocks and embeds.Note: files may need to be closed and reopened for this setting to take effect.").addToggle(n=>{n.setValue(this.plugin.settings.displayInlineReferencesMarkdown),n.onChange(async r=>{this.plugin.settings.displayInlineReferencesMarkdown=r,this.plugin.toggleStateSNWMarkdownPreview(),await this.plugin.saveSettings()})}),new S.Setting(e).setName("Show SNW indicators in Source Mode ").setDesc("While in Source Mode of a document, display inline of the text of documents all reference counts for links, blocks and embeds.By default, this is turned off since the goal of Source Mode is to see the raw markdown.Note: files may need to be closed and reopened for this setting to take effect.").addToggle(n=>{n.setValue(this.plugin.settings.displayInlineReferencesInSourceMode),n.onChange(async r=>{this.plugin.settings.displayInlineReferencesInSourceMode=r,await this.plugin.saveSettings()})}),new S.Setting(e).setName("Embed references in Gutter in Live Preview Mode (Desktop)").setDesc(`Displays a count of references in the gutter while in live preview. This is done only in a
special scenario. It has to do with the way Obsidian renders embeds, example: ![[link]] when
they are on its own line. Strange New Worlds cannot embed the count in this scenario, so a hint is
displayed in the gutter. It is a hack, but at least we get some information.`).addToggle(n=>{n.setValue(this.plugin.settings.displayEmbedReferencesInGutter),n.onChange(async r=>{this.plugin.settings.displayEmbedReferencesInGutter=r,this.plugin.toggleStateSNWGutters(),await this.plugin.saveSettings()})}),new S.Setting(e).setName("Embed references in Gutter in Live Preview Mode (Mobile)").setDesc("This is off by default on mobile since the gutter takes up some space in the left margin.").addToggle(n=>{n.setValue(this.plugin.settings.displayEmbedReferencesInGutterMobile),n.onChange(async r=>{this.plugin.settings.displayEmbedReferencesInGutterMobile=r,this.plugin.toggleStateSNWGutters(),await this.plugin.saveSettings()})}),new S.Setting(e).setHeading().setName("Enable reference types in Reading Mode"),e.createEl("sup",{text:"(requires reopening documents to take effect)"}),new S.Setting(e).setName("Block ID").setDesc("Identifies block ID's, for example text blocks that end with a ^ and unique ID for that text block.").addToggle(n=>{n.setValue(this.plugin.settings.enableRenderingBlockIdInMarkdown),n.onChange(async r=>{this.plugin.settings.enableRenderingBlockIdInMarkdown=r,await this.plugin.saveSettings()})}),new S.Setting(e).setName("Embeds").setDesc("Identifies embedded links, that is links that start with an explanation mark. For example: ![[PageName]].").addToggle(n=>{n.setValue(this.plugin.settings.enableRenderingEmbedsInMarkdown),n.onChange(async r=>{this.plugin.settings.enableRenderingEmbedsInMarkdown=r,await this.plugin.saveSettings()})}),new S.Setting(e).setName("Links").setDesc("Identifies links in a document. For example: [[PageName]].").addToggle(n=>{n.setValue(this.plugin.settings.enableRenderingLinksInMarkdown),n.onChange(async r=>{this.plugin.settings.enableRenderingLinksInMarkdown=r,await this.plugin.saveSettings()})}),new S.Setting(e).setName("Headers").setDesc("Identifies headers, that is lines of text that start with a hash mark or multiple hash marks. For example: # Heading 1.").addToggle(n=>{n.setValue(this.plugin.settings.enableRenderingHeadersInMarkdown),n.onChange(async r=>{this.plugin.settings.enableRenderingHeadersInMarkdown=r,await this.plugin.saveSettings()})}),new S.Setting(e).setHeading().setName("Enable reference types in Live Preview Mode"),e.createEl("sup",{text:"(requires reopening documents to take effect)"}),new S.Setting(e).setName("Block ID").setDesc("Identifies block ID's, for example text blocks that end with a ^ and unique ID for that text block.").addToggle(n=>{n.setValue(this.plugin.settings.enableRenderingBlockIdInLivePreview),n.onChange(async r=>{this.plugin.settings.enableRenderingBlockIdInLivePreview=r,await this.plugin.saveSettings()})}),new S.Setting(e).setName("Embeds").setDesc("Identifies embedded links, that is links that start with an explanation mark. For example: ![[PageName]].").addToggle(n=>{n.setValue(this.plugin.settings.enableRenderingEmbedsInLivePreview),n.onChange(async r=>{this.plugin.settings.enableRenderingEmbedsInLivePreview=r,await this.plugin.saveSettings()})}),new S.Setting(e).setName("Links").setDesc("Identifies links in a document. For example: [[PageName]].").addToggle(n=>{n.setValue(this.plugin.settings.enableRenderingLinksInLivePreview),n.onChange(async r=>{this.plugin.settings.enableRenderingLinksInLivePreview=r,await this.plugin.saveSettings()})}),new S.Setting(e).setName("Headers").setDesc("Identifies headers, that is lines of text that start with a hash mark or multiple hash marks. For example: # Heading 1.").addToggle(n=>{n.setValue(this.plugin.settings.enableRenderingHeadersInLivePreview),n.onChange(async r=>{this.plugin.settings.enableRenderingHeadersInLivePreview=r,await this.plugin.saveSettings()})}),new S.Setting(e).setHeading().setName("Custom Display Settings"),new S.Setting(this.containerEl).setName("Custom Property List").setDesc("Displays properties from referenced files in the references list. The list is comma separated list of case-sensitive property names.").addText(n=>{n.setPlaceholder("Ex: Project, Summary").setValue(this.plugin.settings.displayCustomPropertyList).onChange(async r=>{this.plugin.settings.displayCustomPropertyList=r,await this.plugin.saveSettings()})}),new S.Setting(e).setHeading().setName("Support for Other Plugins"),new S.Setting(e).setName("Kanban by mgmeyers").setDesc(`Enables SNW support with in the preview mode of the Kanban plugin by mgmeyers at https://github.com/mgmeyers/obsidian-kanban.
SNW references will always show when editing a card. Changing this setting may require reopening files.`).addToggle(n=>{n.setValue(this.plugin.settings.pluginSupportKanban),n.onChange(async r=>{this.plugin.settings.pluginSupportKanban=r,await this.plugin.saveSettings()})})}};var io=require("obsidian");var fn,H,Nr,So,Ke,Ir,Rr,Hn,Ar,Bn,Vn,Un,Lo,St={},Fr=[],Io=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,jn=Array.isArray;function We(t,e){for(var n in e)t[n]=e[n];return t}function $n(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Mo(t,e,n){var r,i,o,l={};for(o in e)o=="key"?r=e[o]:o=="ref"?i=e[o]:l[o]=e[o];if(arguments.length>2&&(l.children=arguments.length>3?fn.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)l[o]===void 0&&(l[o]=t.defaultProps[o]);return pn(t,l,r,i,null)}function pn(t,e,n,r,i){var o={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++Nr:i,__i:-1,__u:0};return i==null&&H.vnode!=null&&H.vnode(o),o}function ze(t){return t.children}function cn(t,e){this.props=t,this.context=e}function dt(t,e){if(e==null)return t.__?dt(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?dt(t):null}function Wr(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Wr(t)}}function Mr(t){(!t.__d&&(t.__d=!0)&&Ke.push(t)&&!un.__r++||Ir!==H.debounceRendering)&&((Ir=H.debounceRendering)||Rr)(un)}function un(){var t,e,n,r,i,o,l,s;for(Ke.sort(Hn);t=Ke.shift();)t.__d&&(e=Ke.length,r=void 0,o=(i=(n=t).__v).__e,l=[],s=[],n.__P&&((r=We({},i)).__v=i.__v+1,H.vnode&&H.vnode(r),qn(n.__P,r,i,n.__n,n.__P.namespaceURI,32&i.__u?[o]:null,l,o==null?dt(i):o,!!(32&i.__u),s),r.__v=i.__v,r.__.__k[r.__i]=r,Ur(l,r,s),r.__e!=o&&Wr(r)),Ke.length>e&&Ke.sort(Hn));un.__r=0}function Hr(t,e,n,r,i,o,l,s,a,p,f){var u,g,d,v,y,h,w=r&&r.__k||Fr,_=e.length;for(a=Oo(n,e,w,a),u=0;u<_;u++)(d=n.__k[u])!=null&&(g=d.__i===-1?St:w[d.__i]||St,d.__i=u,h=qn(t,d,g,i,o,l,s,a,p,f),v=d.__e,d.ref&&g.ref!=d.ref&&(g.ref&&Kn(g.ref,null,d),f.push(d.ref,d.__c||v,d)),y==null&&v!=null&&(y=v),4&d.__u||g.__k===d.__k?a=Vr(d,a,t):typeof d.type=="function"&&h!==void 0?a=h:v&&(a=v.nextSibling),d.__u&=-7);return n.__e=y,a}function Oo(t,e,n,r){var i,o,l,s,a,p=e.length,f=n.length,u=f,g=0;for(t.__k=[],i=0;i<p;i++)(o=e[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(s=i+g,(o=t.__k[i]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?pn(null,o,null,null,null):jn(o)?pn(ze,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?pn(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=t,o.__b=t.__b+1,l=null,(a=o.__i=Do(o,n,s,u))!==-1&&(u--,(l=n[a])&&(l.__u|=2)),l==null||l.__v===null?(a==-1&&g--,typeof o.type!="function"&&(o.__u|=4)):a!==s&&(a==s-1?g--:a==s+1?g++:(a>s?g--:g++,o.__u|=4))):o=t.__k[i]=null;if(u)for(i=0;i<f;i++)(l=n[i])!=null&&!(2&l.__u)&&(l.__e==r&&(r=dt(l)),Br(l,l));return r}function Vr(t,e,n){var r,i;if(typeof t.type=="function"){for(r=t.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=t,e=Vr(r[i],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=dt(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function Do(t,e,n,r){var i=t.key,o=t.type,l=n-1,s=n+1,a=e[n];if(a===null||a&&i==a.key&&o===a.type&&!(2&a.__u))return n;if((typeof o!="function"||o===ze||i)&&r>(a!=null&&!(2&a.__u)?1:0))for(;l>=0||s<e.length;){if(l>=0){if((a=e[l])&&!(2&a.__u)&&i==a.key&&o===a.type)return l;l--}if(s<e.length){if((a=e[s])&&!(2&a.__u)&&i==a.key&&o===a.type)return s;s++}}return-1}function Or(t,e,n){e[0]==="-"?t.setProperty(e,n==null?"":n):t[e]=n==null?"":typeof n!="number"||Io.test(e)?n:n+"px"}function ln(t,e,n,r,i){var o;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||Or(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||Or(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(Ar,"$1")),e=e.toLowerCase()in t||e==="onFocusOut"||e==="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?r?n.u=r.u:(n.u=Bn,t.addEventListener(e,o?Un:Vn,o)):t.removeEventListener(e,o?Un:Vn,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n==null?"":n;break e}catch(l){}typeof n=="function"||(n==null||n===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Dr(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Bn++;else if(e.t<n.u)return;return n(H.event?H.event(e):e)}}}function qn(t,e,n,r,i,o,l,s,a,p){var f,u,g,d,v,y,h,w,_,P,c,C,b,T,A,F,D,M=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(a=!!(32&n.__u),o=[s=e.__e=n.__e]),(f=H.__b)&&f(e);e:if(typeof M=="function")try{if(w=e.props,_="prototype"in M&&M.prototype.render,P=(f=M.contextType)&&r[f.__c],c=f?P?P.props.value:f.__:r,n.__c?h=(u=e.__c=n.__c).__=u.__E:(_?e.__c=u=new M(w,c):(e.__c=u=new cn(w,c),u.constructor=M,u.render=Ro),P&&P.sub(u),u.props=w,u.state||(u.state={}),u.context=c,u.__n=r,g=u.__d=!0,u.__h=[],u._sb=[]),_&&u.__s==null&&(u.__s=u.state),_&&M.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=We({},u.__s)),We(u.__s,M.getDerivedStateFromProps(w,u.__s))),d=u.props,v=u.state,u.__v=e,g)_&&M.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),_&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(_&&M.getDerivedStateFromProps==null&&w!==d&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(w,c),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(w,u.__s,c)===!1||e.__v===n.__v)){for(e.__v!==n.__v&&(u.props=w,u.state=u.__s,u.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(R){R&&(R.__=e)}),C=0;C<u._sb.length;C++)u.__h.push(u._sb[C]);u._sb=[],u.__h.length&&l.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(w,u.__s,c),_&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(d,v,y)})}if(u.context=c,u.props=w,u.__P=t,u.__e=!1,b=H.__r,T=0,_){for(u.state=u.__s,u.__d=!1,b&&b(e),f=u.render(u.props,u.state,u.context),A=0;A<u._sb.length;A++)u.__h.push(u._sb[A]);u._sb=[]}else do u.__d=!1,b&&b(e),f=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++T<25);u.state=u.__s,u.getChildContext!=null&&(r=We(We({},r),u.getChildContext())),_&&!g&&u.getSnapshotBeforeUpdate!=null&&(y=u.getSnapshotBeforeUpdate(d,v)),s=Hr(t,jn(F=f!=null&&f.type===ze&&f.key==null?f.props.children:f)?F:[F],e,n,r,i,o,l,s,a,p),u.base=e.__e,e.__u&=-161,u.__h.length&&l.push(u),h&&(u.__E=u.__=null)}catch(R){if(e.__v=null,a||o!=null)if(R.then){for(e.__u|=a?160:128;s&&s.nodeType===8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,e.__e=s}else for(D=o.length;D--;)$n(o[D]);else e.__e=n.__e,e.__k=n.__k;H.__e(R,e,n)}else o==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):s=e.__e=No(n.__e,e,n,r,i,o,l,a,p);return(f=H.diffed)&&f(e),128&e.__u?void 0:s}function Ur(t,e,n){for(var r=0;r<n.length;r++)Kn(n[r],n[++r],n[++r]);H.__c&&H.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(o){o.call(i)})}catch(o){H.__e(o,i.__v)}})}function No(t,e,n,r,i,o,l,s,a){var p,f,u,g,d,v,y,h=n.props,w=e.props,_=e.type;if(_==="svg"?i="http://www.w3.org/2000/svg":_==="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(p=0;p<o.length;p++)if((d=o[p])&&"setAttribute"in d==!!_&&(_?d.localName===_:d.nodeType===3)){t=d,o[p]=null;break}}if(t==null){if(_===null)return document.createTextNode(w);t=document.createElementNS(i,_,w.is&&w),s&&(H.__m&&H.__m(e,o),s=!1),o=null}if(_===null)h===w||s&&t.data===w||(t.data=w);else{if(o=o&&fn.call(t.childNodes),h=n.props||St,!s&&o!=null)for(h={},p=0;p<t.attributes.length;p++)h[(d=t.attributes[p]).name]=d.value;for(p in h)if(d=h[p],p!="children"){if(p=="dangerouslySetInnerHTML")u=d;else if(!(p in w)){if(p=="value"&&"defaultValue"in w||p=="checked"&&"defaultChecked"in w)continue;ln(t,p,null,d,i)}}for(p in w)d=w[p],p=="children"?g=d:p=="dangerouslySetInnerHTML"?f=d:p=="value"?v=d:p=="checked"?y=d:s&&typeof d!="function"||h[p]===d||ln(t,p,d,h[p],i);if(f)s||u&&(f.__html===u.__html||f.__html===t.innerHTML)||(t.innerHTML=f.__html),e.__k=[];else if(u&&(t.innerHTML=""),Hr(t,jn(g)?g:[g],e,n,r,_==="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,l,o?o[0]:n.__k&&dt(n,0),s,a),o!=null)for(p=o.length;p--;)$n(o[p]);s||(p="value",_==="progress"&&v==null?t.removeAttribute("value"):v!==void 0&&(v!==t[p]||_==="progress"&&!v||_==="option"&&v!==h[p])&&ln(t,p,v,h[p],i),p="checked",y!==void 0&&y!==t[p]&&ln(t,p,y,h[p],i))}return t}function Kn(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){H.__e(i,n)}}function Br(t,e,n){var r,i;if(H.unmount&&H.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||Kn(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){H.__e(o,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&Br(r[i],e,n||typeof t.type!="function");n||$n(t.__e),t.__c=t.__=t.__e=void 0}function Ro(t,e,n){return this.constructor(t,n)}function ke(t,e,n){var r,i,o,l;e===document&&(e=document.documentElement),H.__&&H.__(t,e),i=(r=typeof n=="function")?null:n&&n.__k||e.__k,o=[],l=[],qn(e,t=(!r&&n||e).__k=Mo(ze,null,[t]),i||St,St,e.namespaceURI,!r&&n?[n]:i?null:e.firstChild?fn.call(e.childNodes):null,o,!r&&n?n:i?i.__e:e.firstChild,r,l),Ur(o,t,l)}fn=Fr.slice,H={__e:function(t,e,n,r){for(var i,o,l;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(t)),l=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),l=i.__d),l)return i.__E=i}catch(s){t=s}throw t}},Nr=0,So=function(t){return t!=null&&t.constructor==null},cn.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=We({},this.state),typeof t=="function"&&(t=t(We({},n),this.props)),t&&We(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Mr(this))},cn.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Mr(this))},cn.prototype.render=ze,Ke=[],Rr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Hn=function(t,e){return t.__v.__b-e.__v.__b},un.__r=0,Ar=/(PointerCapture)$|Capture$/i,Bn=0,Vn=Dr(!1),Un=Dr(!0),Lo=0;var Ao=(t,e)=>{let n=getComputedStyle(t),r=n.position==="absolute",i=e?/(auto|scroll|hidden)/:/(auto|scroll)/;if(n.position==="fixed")return document.body;for(let o=t.parentElement;o;o=o.parentElement)if(n=getComputedStyle(o),(!r||n.position!=="static")&&i.test(n.overflow+n.overflowY+n.overflowX))return o;return document.body},dn=t=>{let e=t.querySelectorAll(".search-result-file-matched-text");for(let n of Array.from(e))if(n instanceof HTMLElement){let r=Ao(n,!0);r&&(r.scrollTop=n.offsetTop-r.offsetTop-r.offsetHeight/2)}};var ot=require("obsidian");var eo=require("obsidian");var mt=require("obsidian");var Lt=(t,e)=>t.substring(e.start.offset,e.end.offset),jr=(t,e)=>t.substring(e.start.offset-e.start.col,e.end.offset),zn=(t,e)=>{try{return t.start.offset<=e.start.offset&&t.end.offset>=e.end.offset}catch(n){return!1}};var mn=class{constructor(e,{listItems:n=[],headings:r=[],sections:i=[]}){this.fileContents=e;this.getListItemIndexContaining=e=>this.listItems.findIndex(({position:n})=>zn(n,e));this.getSectionContaining=e=>this.sections.find(({position:n})=>zn(n,e));this.getListItemWithDescendants=e=>{let n=this.listItems[e],r=[n];for(let i=e+1;i<this.listItems.length;i++){let o=this.listItems[i];if(o.parent<n.position.start.line)return r;r.push(o)}return r};this.listItems=n,this.headings=r,this.sections=i}getListBreadcrumbs(e){let n=[];if(this.listItems.length===0)return n;let r=this.getListItemIndexContaining(e);if(r<0)return n;let o=this.listItems[r],l=o.parent;if(this.isTopLevelListItem(o))return n;for(let s=r-1;s>=0;s--){let a=this.listItems[s];if(a.parent<l&&(n.unshift(a),l=a.parent),this.isTopLevelListItem(a))return n}return n}getFirstSectionUnder(e){return this.sections.find(n=>n.position.start.line>e.start.line)}getHeadingContaining(e){let n=this.getHeadingIndexContaining(e);return this.headings[n]}getHeadingBreadcrumbs(e){let n=[];if(this.headings.length===0)return n;let r=a=>{let p=this.headings[a].level,f=a-1;for(let u=f;u>=0;u--){let g=this.headings[u];g.level<p&&(p=g.level,n.unshift(g))}},i=this.getHeadingIndexContaining(e);if(i>=0)return r(i),n;let l=this.getIndexOfHeadingAbove(e);if(l>=0){let a=this.headings[l];return n.unshift(a),r(l),n}return n}isTopLevelListItem(e){return e.parent<=0}getIndexOfHeadingAbove(e){return e===void 0?-1:this.headings.reduce((n,r,i)=>r.position.start.line<e.start.line?i:n,-1)}getHeadingIndexContaining(e){return e===void 0?-1:this.headings.findIndex(n=>n.position.start.line===e.start.line)}};var $r=t=>t.map(e=>e.trim()).filter(e=>e.length>0).join(" \u27A4 "),qr=(t,e)=>$r(e.map(n=>Lt(t,n.position)).map(n=>n.trim().replace(/^-\s+/,""))),Kr=(t,e)=>{let r=e[0].position.start.col;return e.map(i=>jr(t,i.position).slice(r)).join(`
`)},zr=t=>$r(t.map(e=>e.heading));var Fo=0,ya=Array.isArray;function L(t,e,n,r,i,o){e||(e={});var l,s,a=e;"ref"in e&&(l=e.ref,delete e.ref);var p={type:t,props:a,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Fo,__i:-1,__u:0,__source:i,__self:o};if(typeof t=="function"&&(l=t.defaultProps))for(s in l)a[s]===void 0&&(a[s]=l[s]);return H.vnode&&H.vnode(p),p}var se;function Gr(t){se=t}var Yr=async t=>{var i,o;let e=t.reference.position!==void 0?t.reference.position.start.line.toString():"0",n=L("div",{className:"snw-ref-item-info search-result-file-match","snw-data-line-number":e,"snw-data-file-name":(i=t==null?void 0:t.sourceFile)==null?void 0:i.path,"data-href":(o=t==null?void 0:t.sourceFile)==null?void 0:o.path,dangerouslySetInnerHTML:{__html:(await Wo(t)).innerHTML}}),r=createDiv();return ke(n,r),r},Wo=async t=>{var g;let e=await se.app.vault.cachedRead(t.sourceFile),n=se.app.metadataCache.getFileCache(t.sourceFile),r=t.reference.position,i=createDiv();if(i.setAttribute("uic","uic"),(g=t.reference)!=null&&g.key)return i.innerText=`Used in property: ${t.reference.key}`,i;let o=new mn(e,n),l=o.getHeadingBreadcrumbs(r);if(l.length>0){let d=i.createDiv();d.addClass("snw-breadcrumbs"),d.createEl("span",{text:"H"}),await mt.MarkdownRenderer.render(se.app,zr(l),d,t.sourceFile.path,se)}let s=o.getListItemIndexContaining(r);if(s>=0){let d=o.getListBreadcrumbs(r);if(d.length>0){let h=i.createDiv();h.addClass("snw-breadcrumbs"),h.createEl("span",{text:"L"}),await mt.MarkdownRenderer.render(se.app,qr(e,d),h,t.sourceFile.path,se)}let v=o.getListItemWithDescendants(s),y=i.createDiv();await mt.MarkdownRenderer.render(se.app,Kr(e,v),y,t.sourceFile.path,se)}else{let d=o.getSectionContaining(r),v="";(d==null?void 0:d.position)!==void 0&&(v=Lt(e,d.position)),/^\[\^([\w]+)\]:(.*)$/.test(v)&&(v=v.replace("[","").replace("]:","")),await mt.MarkdownRenderer.render(se.app,v,i,t.sourceFile.path,se)}let p=o.getHeadingContaining(r);if(p){let d=o.getFirstSectionUnder(p.position);if(d){let v=i.createDiv();await mt.MarkdownRenderer.render(se.app,Lt(e,d.position),v,t.sourceFile.path,se)}}let f=i.querySelectorAll("*"),u=Array.from(f).find(d=>d.textContent===t.reference.displayText);try{u.addClass("search-result-file-matched-text")}catch(d){}return i};var j="top",Y="bottom",z="right",q="left",gn="auto",He=[j,Y,z,q],Ie="start",Ge="end",Xr="clippingParents",hn="viewport",gt="popper",Jr="reference",Gn=He.reduce(function(t,e){return t.concat([e+"-"+Ie,e+"-"+Ge])},[]),vn=[].concat(He,[gn]).reduce(function(t,e){return t.concat([e,e+"-"+Ie,e+"-"+Ge])},[]),Ho="beforeRead",Vo="read",Uo="afterRead",Bo="beforeMain",jo="main",$o="afterMain",qo="beforeWrite",Ko="write",zo="afterWrite",Zr=[Ho,Vo,Uo,Bo,jo,$o,qo,Ko,zo];function Z(t){return t?(t.nodeName||"").toLowerCase():null}function B(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function ce(t){var e=B(t).Element;return t instanceof e||t instanceof Element}function X(t){var e=B(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function ht(t){if(typeof ShadowRoot=="undefined")return!1;var e=B(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Go(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!X(o)||!Z(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(l){var s=i[l];s===!1?o.removeAttribute(l):o.setAttribute(l,s===!0?"":s)}))})}function Yo(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},l=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),s=l.reduce(function(a,p){return a[p]="",a},{});!X(i)||!Z(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(a){i.removeAttribute(a)}))})}}var It={name:"applyStyles",enabled:!0,phase:"write",fn:Go,effect:Yo,requires:["computeStyles"]};function Q(t){return t.split("-")[0]}var ve=Math.max,Ye=Math.min,Me=Math.round;function vt(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Mt(){return!/^((?!chrome|android).)*safari/i.test(vt())}function ue(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&X(t)&&(i=t.offsetWidth>0&&Me(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Me(r.height)/t.offsetHeight||1);var l=ce(t)?B(t):window,s=l.visualViewport,a=!Mt()&&n,p=(r.left+(a&&s?s.offsetLeft:0))/i,f=(r.top+(a&&s?s.offsetTop:0))/o,u=r.width/i,g=r.height/o;return{width:u,height:g,top:f,right:p+u,bottom:f+g,left:p,x:p,y:f}}function Xe(t){var e=ue(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Ot(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&ht(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function re(t){return B(t).getComputedStyle(t)}function Yn(t){return["table","td","th"].indexOf(Z(t))>=0}function ee(t){return((ce(t)?t.ownerDocument:t.document)||window.document).documentElement}function Oe(t){return Z(t)==="html"?t:t.assignedSlot||t.parentNode||(ht(t)?t.host:null)||ee(t)}function Qr(t){return!X(t)||re(t).position==="fixed"?null:t.offsetParent}function Xo(t){var e=/firefox/i.test(vt()),n=/Trident/i.test(vt());if(n&&X(t)){var r=re(t);if(r.position==="fixed")return null}var i=Oe(t);for(ht(i)&&(i=i.host);X(i)&&["html","body"].indexOf(Z(i))<0;){var o=re(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function ye(t){for(var e=B(t),n=Qr(t);n&&Yn(n)&&re(n).position==="static";)n=Qr(n);return n&&(Z(n)==="html"||Z(n)==="body"&&re(n).position==="static")?e:n||Xo(t)||e}function Je(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ze(t,e,n){return ve(t,Ye(e,n))}function ei(t,e,n){var r=Ze(t,e,n);return r>n?n:r}function Dt(){return{top:0,right:0,bottom:0,left:0}}function Nt(t){return Object.assign({},Dt(),t)}function Rt(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var Jo=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Nt(typeof e!="number"?e:Rt(e,He))};function Zo(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,l=n.modifiersData.popperOffsets,s=Q(n.placement),a=Je(s),p=[q,z].indexOf(s)>=0,f=p?"height":"width";if(!(!o||!l)){var u=Jo(i.padding,n),g=Xe(o),d=a==="y"?j:q,v=a==="y"?Y:z,y=n.rects.reference[f]+n.rects.reference[a]-l[a]-n.rects.popper[f],h=l[a]-n.rects.reference[a],w=ye(o),_=w?a==="y"?w.clientHeight||0:w.clientWidth||0:0,P=y/2-h/2,c=u[d],C=_-g[f]-u[v],b=_/2-g[f]/2+P,T=Ze(c,b,C),A=a;n.modifiersData[r]=(e={},e[A]=T,e.centerOffset=T-b,e)}}function Qo(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Ot(e.elements.popper,i)&&(e.elements.arrow=i))}var ti={name:"arrow",enabled:!0,phase:"main",fn:Zo,effect:Qo,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fe(t){return t.split("-")[1]}var es={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ts(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Me(n*i)/i||0,y:Me(r*i)/i||0}}function ni(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,l=t.offsets,s=t.position,a=t.gpuAcceleration,p=t.adaptive,f=t.roundOffsets,u=t.isFixed,g=l.x,d=g===void 0?0:g,v=l.y,y=v===void 0?0:v,h=typeof f=="function"?f({x:d,y}):{x:d,y};d=h.x,y=h.y;var w=l.hasOwnProperty("x"),_=l.hasOwnProperty("y"),P=q,c=j,C=window;if(p){var b=ye(n),T="clientHeight",A="clientWidth";if(b===B(n)&&(b=ee(n),re(b).position!=="static"&&s==="absolute"&&(T="scrollHeight",A="scrollWidth")),b=b,i===j||(i===q||i===z)&&o===Ge){c=Y;var F=u&&b===C&&C.visualViewport?C.visualViewport.height:b[T];y-=F-r.height,y*=a?1:-1}if(i===q||(i===j||i===Y)&&o===Ge){P=z;var D=u&&b===C&&C.visualViewport?C.visualViewport.width:b[A];d-=D-r.width,d*=a?1:-1}}var M=Object.assign({position:s},p&&es),R=f===!0?ts({x:d,y},B(n)):{x:d,y};if(d=R.x,y=R.y,a){var U;return Object.assign({},M,(U={},U[c]=_?"0":"",U[P]=w?"0":"",U.transform=(C.devicePixelRatio||1)<=1?"translate("+d+"px, "+y+"px)":"translate3d("+d+"px, "+y+"px, 0)",U))}return Object.assign({},M,(e={},e[c]=_?y+"px":"",e[P]=w?d+"px":"",e.transform="",e))}function ns(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,l=o===void 0?!0:o,s=n.roundOffsets,a=s===void 0?!0:s,p={placement:Q(e.placement),variation:fe(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ni(Object.assign({},p,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:l,roundOffsets:a})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ni(Object.assign({},p,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var ri={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ns,data:{}};var yn={passive:!0};function rs(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,l=r.resize,s=l===void 0?!0:l,a=B(e.elements.popper),p=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&p.forEach(function(f){f.addEventListener("scroll",n.update,yn)}),s&&a.addEventListener("resize",n.update,yn),function(){o&&p.forEach(function(f){f.removeEventListener("scroll",n.update,yn)}),s&&a.removeEventListener("resize",n.update,yn)}}var ii={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:rs,data:{}};var is={left:"right",right:"left",bottom:"top",top:"bottom"};function yt(t){return t.replace(/left|right|bottom|top/g,function(e){return is[e]})}var os={start:"end",end:"start"};function wn(t){return t.replace(/start|end/g,function(e){return os[e]})}function Qe(t){var e=B(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function et(t){return ue(ee(t)).left+Qe(t).scrollLeft}function Xn(t,e){var n=B(t),r=ee(t),i=n.visualViewport,o=r.clientWidth,l=r.clientHeight,s=0,a=0;if(i){o=i.width,l=i.height;var p=Mt();(p||!p&&e==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}return{width:o,height:l,x:s+et(t),y:a}}function Jn(t){var e,n=ee(t),r=Qe(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=ve(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),l=ve(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+et(t),a=-r.scrollTop;return re(i||n).direction==="rtl"&&(s+=ve(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:l,x:s,y:a}}function tt(t){var e=re(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function bn(t){return["html","body","#document"].indexOf(Z(t))>=0?t.ownerDocument.body:X(t)&&tt(t)?t:bn(Oe(t))}function Ve(t,e){var n;e===void 0&&(e=[]);var r=bn(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=B(r),l=i?[o].concat(o.visualViewport||[],tt(r)?r:[]):r,s=e.concat(l);return i?s:s.concat(Ve(Oe(l)))}function wt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ss(t,e){var n=ue(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function oi(t,e,n){return e===hn?wt(Xn(t,n)):ce(e)?ss(e,n):wt(Jn(ee(t)))}function as(t){var e=Ve(Oe(t)),n=["absolute","fixed"].indexOf(re(t).position)>=0,r=n&&X(t)?ye(t):t;return ce(r)?e.filter(function(i){return ce(i)&&Ot(i,r)&&Z(i)!=="body"}):[]}function Zn(t,e,n,r){var i=e==="clippingParents"?as(t):[].concat(e),o=[].concat(i,[n]),l=o[0],s=o.reduce(function(a,p){var f=oi(t,p,r);return a.top=ve(f.top,a.top),a.right=Ye(f.right,a.right),a.bottom=Ye(f.bottom,a.bottom),a.left=ve(f.left,a.left),a},oi(t,l,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function At(t){var e=t.reference,n=t.element,r=t.placement,i=r?Q(r):null,o=r?fe(r):null,l=e.x+e.width/2-n.width/2,s=e.y+e.height/2-n.height/2,a;switch(i){case j:a={x:l,y:e.y-n.height};break;case Y:a={x:l,y:e.y+e.height};break;case z:a={x:e.x+e.width,y:s};break;case q:a={x:e.x-n.width,y:s};break;default:a={x:e.x,y:e.y}}var p=i?Je(i):null;if(p!=null){var f=p==="y"?"height":"width";switch(o){case Ie:a[p]=a[p]-(e[f]/2-n[f]/2);break;case Ge:a[p]=a[p]+(e[f]/2-n[f]/2);break;default:}}return a}function we(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,l=o===void 0?t.strategy:o,s=n.boundary,a=s===void 0?Xr:s,p=n.rootBoundary,f=p===void 0?hn:p,u=n.elementContext,g=u===void 0?gt:u,d=n.altBoundary,v=d===void 0?!1:d,y=n.padding,h=y===void 0?0:y,w=Nt(typeof h!="number"?h:Rt(h,He)),_=g===gt?Jr:gt,P=t.rects.popper,c=t.elements[v?_:g],C=Zn(ce(c)?c:c.contextElement||ee(t.elements.popper),a,f,l),b=ue(t.elements.reference),T=At({reference:b,element:P,strategy:"absolute",placement:i}),A=wt(Object.assign({},P,T)),F=g===gt?A:b,D={top:C.top-F.top+w.top,bottom:F.bottom-C.bottom+w.bottom,left:C.left-F.left+w.left,right:F.right-C.right+w.right},M=t.modifiersData.offset;if(g===gt&&M){var R=M[i];Object.keys(D).forEach(function(U){var te=[z,Y].indexOf(U)>=0?1:-1,k=[j,Y].indexOf(U)>=0?"y":"x";D[U]+=R[k]*te})}return D}function Qn(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,l=n.padding,s=n.flipVariations,a=n.allowedAutoPlacements,p=a===void 0?vn:a,f=fe(r),u=f?s?Gn:Gn.filter(function(v){return fe(v)===f}):He,g=u.filter(function(v){return p.indexOf(v)>=0});g.length===0&&(g=u);var d=g.reduce(function(v,y){return v[y]=we(t,{placement:y,boundary:i,rootBoundary:o,padding:l})[Q(y)],v},{});return Object.keys(d).sort(function(v,y){return d[v]-d[y]})}function ls(t){if(Q(t)===gn)return[];var e=yt(t);return[wn(t),e,wn(e)]}function ps(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,l=n.altAxis,s=l===void 0?!0:l,a=n.fallbackPlacements,p=n.padding,f=n.boundary,u=n.rootBoundary,g=n.altBoundary,d=n.flipVariations,v=d===void 0?!0:d,y=n.allowedAutoPlacements,h=e.options.placement,w=Q(h),_=w===h,P=a||(_||!v?[yt(h)]:ls(h)),c=[h].concat(P).reduce(function(Pe,he){return Pe.concat(Q(he)===gn?Qn(e,{placement:he,boundary:f,rootBoundary:u,padding:p,flipVariations:v,allowedAutoPlacements:y}):he)},[]),C=e.rects.reference,b=e.rects.popper,T=new Map,A=!0,F=c[0],D=0;D<c.length;D++){var M=c[D],R=Q(M),U=fe(M)===Ie,te=[j,Y].indexOf(R)>=0,k=te?"width":"height",N=we(e,{placement:M,boundary:f,rootBoundary:u,altBoundary:g,padding:p}),I=te?U?z:q:U?Y:j;C[k]>b[k]&&(I=yt(I));var V=yt(I),ie=[];if(o&&ie.push(N[R]<=0),s&&ie.push(N[I]<=0,N[V]<=0),ie.every(function(Pe){return Pe})){F=M,A=!1;break}T.set(M,ie)}if(A)for(var _e=v?3:1,Ue=function(he){var Ee=c.find(function(lt){var Te=T.get(lt);if(Te)return Te.slice(0,he).every(function(pt){return pt})});if(Ee)return F=Ee,"break"},xe=_e;xe>0;xe--){var Be=Ue(xe);if(Be==="break")break}e.placement!==F&&(e.modifiersData[r]._skip=!0,e.placement=F,e.reset=!0)}}var si={name:"flip",enabled:!0,phase:"main",fn:ps,requiresIfExists:["offset"],data:{_skip:!1}};function ai(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function li(t){return[j,z,Y,q].some(function(e){return t[e]>=0})}function cs(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,l=we(e,{elementContext:"reference"}),s=we(e,{altBoundary:!0}),a=ai(l,r),p=ai(s,i,o),f=li(a),u=li(p);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:p,isReferenceHidden:f,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":u})}var pi={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:cs};function us(t,e,n){var r=Q(t),i=[q,j].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,l=o[0],s=o[1];return l=l||0,s=(s||0)*i,[q,z].indexOf(r)>=0?{x:s,y:l}:{x:l,y:s}}function fs(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,l=vn.reduce(function(f,u){return f[u]=us(u,e.rects,o),f},{}),s=l[e.placement],a=s.x,p=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=a,e.modifiersData.popperOffsets.y+=p),e.modifiersData[r]=l}var ci={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:fs};function ds(t){var e=t.state,n=t.name;e.modifiersData[n]=At({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var ui={name:"popperOffsets",enabled:!0,phase:"read",fn:ds,data:{}};function er(t){return t==="x"?"y":"x"}function ms(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,l=n.altAxis,s=l===void 0?!1:l,a=n.boundary,p=n.rootBoundary,f=n.altBoundary,u=n.padding,g=n.tether,d=g===void 0?!0:g,v=n.tetherOffset,y=v===void 0?0:v,h=we(e,{boundary:a,rootBoundary:p,padding:u,altBoundary:f}),w=Q(e.placement),_=fe(e.placement),P=!_,c=Je(w),C=er(c),b=e.modifiersData.popperOffsets,T=e.rects.reference,A=e.rects.popper,F=typeof y=="function"?y(Object.assign({},e.rects,{placement:e.placement})):y,D=typeof F=="number"?{mainAxis:F,altAxis:F}:Object.assign({mainAxis:0,altAxis:0},F),M=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,R={x:0,y:0};if(b){if(o){var U,te=c==="y"?j:q,k=c==="y"?Y:z,N=c==="y"?"height":"width",I=b[c],V=I+h[te],ie=I-h[k],_e=d?-A[N]/2:0,Ue=_===Ie?T[N]:A[N],xe=_===Ie?-A[N]:-T[N],Be=e.elements.arrow,Pe=d&&Be?Xe(Be):{width:0,height:0},he=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Dt(),Ee=he[te],lt=he[k],Te=Ze(0,T[N],Pe[N]),pt=P?T[N]/2-_e-Te-Ee-D.mainAxis:Ue-Te-Ee-D.mainAxis,Ae=P?-T[N]/2+_e+Te+lt+D.mainAxis:xe+Te+lt+D.mainAxis,ct=e.elements.arrow&&ye(e.elements.arrow),zt=ct?c==="y"?ct.clientTop||0:ct.clientLeft||0:0,_t=(U=M==null?void 0:M[c])!=null?U:0,Gt=I+pt-_t-zt,Yt=I+Ae-_t,xt=Ze(d?Ye(V,Gt):V,I,d?ve(ie,Yt):ie);b[c]=xt,R[c]=xt-I}if(s){var kt,Xt=c==="x"?j:q,Jt=c==="x"?Y:z,Se=b[C],Fe=C==="y"?"height":"width",Ct=Se+h[Xt],je=Se-h[Jt],Pt=[j,q].indexOf(w)!==-1,Zt=(kt=M==null?void 0:M[C])!=null?kt:0,Qt=Pt?Ct:Se-T[Fe]-A[Fe]-Zt+D.altAxis,en=Pt?Se+T[Fe]+A[Fe]-Zt-D.altAxis:je,tn=d&&Pt?ei(Qt,Se,en):Ze(d?Qt:Ct,Se,d?en:je);b[C]=tn,R[C]=tn-Se}e.modifiersData[r]=R}}var fi={name:"preventOverflow",enabled:!0,phase:"main",fn:ms,requiresIfExists:["offset"]};function tr(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function nr(t){return t===B(t)||!X(t)?Qe(t):tr(t)}function gs(t){var e=t.getBoundingClientRect(),n=Me(e.width)/t.offsetWidth||1,r=Me(e.height)/t.offsetHeight||1;return n!==1||r!==1}function rr(t,e,n){n===void 0&&(n=!1);var r=X(e),i=X(e)&&gs(e),o=ee(e),l=ue(t,i,n),s={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!n)&&((Z(e)!=="body"||tt(o))&&(s=nr(e)),X(e)?(a=ue(e,!0),a.x+=e.clientLeft,a.y+=e.clientTop):o&&(a.x=et(o))),{x:l.left+s.scrollLeft-a.x,y:l.top+s.scrollTop-a.y,width:l.width,height:l.height}}function hs(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var l=[].concat(o.requires||[],o.requiresIfExists||[]);l.forEach(function(s){if(!n.has(s)){var a=e.get(s);a&&i(a)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function ir(t){var e=hs(t);return Zr.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function or(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function sr(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var di={placement:"bottom",modifiers:[],strategy:"absolute"};function mi(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function gi(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?di:i;return function(s,a,p){p===void 0&&(p=o);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},di,o),modifiersData:{},elements:{reference:s,popper:a},attributes:{},styles:{}},u=[],g=!1,d={state:f,setOptions:function(w){var _=typeof w=="function"?w(f.options):w;y(),f.options=Object.assign({},o,f.options,_),f.scrollParents={reference:ce(s)?Ve(s):s.contextElement?Ve(s.contextElement):[],popper:Ve(a)};var P=ir(sr([].concat(r,f.options.modifiers)));return f.orderedModifiers=P.filter(function(c){return c.enabled}),v(),d.update()},forceUpdate:function(){if(!g){var w=f.elements,_=w.reference,P=w.popper;if(mi(_,P)){f.rects={reference:rr(_,ye(P),f.options.strategy==="fixed"),popper:Xe(P)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(D){return f.modifiersData[D.name]=Object.assign({},D.data)});for(var c=0;c<f.orderedModifiers.length;c++){if(f.reset===!0){f.reset=!1,c=-1;continue}var C=f.orderedModifiers[c],b=C.fn,T=C.options,A=T===void 0?{}:T,F=C.name;typeof b=="function"&&(f=b({state:f,options:A,name:F,instance:d})||f)}}}},update:or(function(){return new Promise(function(h){d.forceUpdate(),h(f)})}),destroy:function(){y(),g=!0}};if(!mi(s,a))return d;d.setOptions(p).then(function(h){!g&&p.onFirstUpdate&&p.onFirstUpdate(h)});function v(){f.orderedModifiers.forEach(function(h){var w=h.name,_=h.options,P=_===void 0?{}:_,c=h.effect;if(typeof c=="function"){var C=c({state:f,name:w,instance:d,options:P}),b=function(){};u.push(C||b)}})}function y(){u.forEach(function(h){return h()}),u=[]}return d}}var vs=[ii,ui,ri,It,ci,si,fi,ti,pi],ar=gi({defaultModifiers:vs});var ys="tippy-box",Pi="tippy-content",ws="tippy-backdrop",Ei="tippy-arrow",Ti="tippy-svg-arrow",nt={passive:!0,capture:!0},Si=function(){return document.body};function lr(t,e,n){if(Array.isArray(t)){var r=t[e];return r==null?Array.isArray(n)?n[e]:n:r}return t}function dr(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function Li(t,e){return typeof t=="function"?t.apply(void 0,e):t}function hi(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function bs(t){return t.split(/\s+/).filter(Boolean)}function bt(t){return[].concat(t)}function vi(t,e){t.indexOf(e)===-1&&t.push(e)}function _s(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function xs(t){return t.split("-")[0]}function kn(t){return[].slice.call(t)}function yi(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Ft(){return document.createElement("div")}function Cn(t){return["Element","Fragment"].some(function(e){return dr(t,e)})}function ks(t){return dr(t,"NodeList")}function Cs(t){return dr(t,"MouseEvent")}function Ii(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function Ps(t){return Cn(t)?[t]:ks(t)?kn(t):Array.isArray(t)?t:kn(document.querySelectorAll(t))}function pr(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function wi(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function Es(t){var e,n=bt(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function Ts(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,l=i.popperState,s=i.props,a=s.interactiveBorder,p=xs(l.placement),f=l.modifiersData.offset;if(!f)return!0;var u=p==="bottom"?f.top.y:0,g=p==="top"?f.bottom.y:0,d=p==="right"?f.left.x:0,v=p==="left"?f.right.x:0,y=o.top-r+u>a,h=r-o.bottom-g>a,w=o.left-n+d>a,_=n-o.right-v>a;return y||h||w||_})}function cr(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function bi(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Ce={isTouch:!1},_i=0;function Ss(){Ce.isTouch||(Ce.isTouch=!0,window.performance&&document.addEventListener("mousemove",Mi))}function Mi(){var t=performance.now();t-_i<20&&(Ce.isTouch=!1,document.removeEventListener("mousemove",Mi)),_i=t}function Ls(){var t=document.activeElement;if(Ii(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function Is(){document.addEventListener("touchstart",Ss,nt),window.addEventListener("blur",Ls)}var Ms=typeof window!="undefined"&&typeof document!="undefined",Os=Ms?!!window.msCrypto:!1;var Ds={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Ns={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},be=Object.assign({appendTo:Si,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Ds,Ns),Rs=Object.keys(be),As=function(e){var n=Object.keys(e);n.forEach(function(r){be[r]=e[r]})};function Oi(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,l=i.defaultValue;if(o){var s;r[o]=t[o]!==void 0?t[o]:(s=be[o])!=null?s:l}return r},{});return Object.assign({},t,n)}function Fs(t,e){var n=e?Object.keys(Oi(Object.assign({},be,{plugins:e}))):Rs,r=n.reduce(function(i,o){var l=(t.getAttribute("data-tippy-"+o)||"").trim();if(!l)return i;if(o==="content")i[o]=l;else try{i[o]=JSON.parse(l)}catch(s){i[o]=l}return i},{});return r}function xi(t,e){var n=Object.assign({},e,{content:Li(e.content,[t])},e.ignoreAttributes?{}:Fs(t,e.plugins));return n.aria=Object.assign({},be.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var Ws=function(){return"innerHTML"};function ur(t,e){t[Ws()]=e}function ki(t){var e=Ft();return t===!0?e.className=Ei:(e.className=Ti,Cn(t)?e.appendChild(t):ur(e,t)),e}function Ci(t,e){Cn(e.content)?(ur(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?ur(t,e.content):t.textContent=e.content)}function fr(t){var e=t.firstElementChild,n=kn(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Pi)}),arrow:n.find(function(r){return r.classList.contains(Ei)||r.classList.contains(Ti)}),backdrop:n.find(function(r){return r.classList.contains(ws)})}}function Di(t){var e=Ft(),n=Ft();n.className=ys,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Ft();r.className=Pi,r.setAttribute("data-state","hidden"),Ci(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,l){var s=fr(e),a=s.box,p=s.content,f=s.arrow;l.theme?a.setAttribute("data-theme",l.theme):a.removeAttribute("data-theme"),typeof l.animation=="string"?a.setAttribute("data-animation",l.animation):a.removeAttribute("data-animation"),l.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth=typeof l.maxWidth=="number"?l.maxWidth+"px":l.maxWidth,l.role?a.setAttribute("role",l.role):a.removeAttribute("role"),(o.content!==l.content||o.allowHTML!==l.allowHTML)&&Ci(p,t.props),l.arrow?f?o.arrow!==l.arrow&&(a.removeChild(f),a.appendChild(ki(l.arrow))):a.appendChild(ki(l.arrow)):f&&a.removeChild(f)}return{popper:e,onUpdate:i}}Di.$$tippy=!0;var Hs=1,_n=[],xn=[];function Vs(t,e){var n=xi(t,Object.assign({},be,Oi(yi(e)))),r,i,o,l=!1,s=!1,a=!1,p=!1,f,u,g,d=[],v=hi(Gt,n.interactiveDebounce),y,h=Hs++,w=null,_=_s(n.plugins),P={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},c={id:h,reference:t,popper:Ft(),popperInstance:w,props:n,state:P,plugins:_,clearDelayTimeouts:Qt,setProps:en,setContent:tn,show:ho,hide:vo,hideWithInteractivity:yo,enable:Pt,disable:Zt,unmount:wo,destroy:bo};if(!n.render)return c;var C=n.render(c),b=C.popper,T=C.onUpdate;b.setAttribute("data-tippy-root",""),b.id="tippy-"+c.id,c.popper=b,t._tippy=c,b._tippy=c;var A=_.map(function(m){return m.fn(c)}),F=t.hasAttribute("aria-expanded");return ct(),_e(),I(),V("onCreate",[c]),n.showOnCreate&&Ct(),b.addEventListener("mouseenter",function(){c.props.interactive&&c.state.isVisible&&c.clearDelayTimeouts()}),b.addEventListener("mouseleave",function(){c.props.interactive&&c.props.trigger.indexOf("mouseenter")>=0&&te().addEventListener("mousemove",v)}),c;function D(){var m=c.props.touch;return Array.isArray(m)?m:[m,0]}function M(){return D()[0]==="hold"}function R(){var m;return!!((m=c.props.render)!=null&&m.$$tippy)}function U(){return y||t}function te(){var m=U().parentNode;return m?Es(m):document}function k(){return fr(b)}function N(m){return c.state.isMounted&&!c.state.isVisible||Ce.isTouch||f&&f.type==="focus"?0:lr(c.props.delay,m?0:1,be.delay)}function I(m){m===void 0&&(m=!1),b.style.pointerEvents=c.props.interactive&&!m?"":"none",b.style.zIndex=""+c.props.zIndex}function V(m,x,E){if(E===void 0&&(E=!0),A.forEach(function(O){O[m]&&O[m].apply(O,x)}),E){var W;(W=c.props)[m].apply(W,x)}}function ie(){var m=c.props.aria;if(m.content){var x="aria-"+m.content,E=b.id,W=bt(c.props.triggerTarget||t);W.forEach(function(O){var ne=O.getAttribute(x);if(c.state.isVisible)O.setAttribute(x,ne?ne+" "+E:E);else{var le=ne&&ne.replace(E,"").trim();le?O.setAttribute(x,le):O.removeAttribute(x)}})}}function _e(){if(!(F||!c.props.aria.expanded)){var m=bt(c.props.triggerTarget||t);m.forEach(function(x){c.props.interactive?x.setAttribute("aria-expanded",c.state.isVisible&&x===U()?"true":"false"):x.removeAttribute("aria-expanded")})}}function Ue(){te().removeEventListener("mousemove",v),_n=_n.filter(function(m){return m!==v})}function xe(m){if(!(Ce.isTouch&&(a||m.type==="mousedown"))){var x=m.composedPath&&m.composedPath()[0]||m.target;if(!(c.props.interactive&&bi(b,x))){if(bt(c.props.triggerTarget||t).some(function(E){return bi(E,x)})){if(Ce.isTouch||c.state.isVisible&&c.props.trigger.indexOf("click")>=0)return}else V("onClickOutside",[c,m]);c.props.hideOnClick===!0&&(c.clearDelayTimeouts(),c.hide(),s=!0,setTimeout(function(){s=!1}),c.state.isMounted||Ee())}}}function Be(){a=!0}function Pe(){a=!1}function he(){var m=te();m.addEventListener("mousedown",xe,!0),m.addEventListener("touchend",xe,nt),m.addEventListener("touchstart",Pe,nt),m.addEventListener("touchmove",Be,nt)}function Ee(){var m=te();m.removeEventListener("mousedown",xe,!0),m.removeEventListener("touchend",xe,nt),m.removeEventListener("touchstart",Pe,nt),m.removeEventListener("touchmove",Be,nt)}function lt(m,x){pt(m,function(){!c.state.isVisible&&b.parentNode&&b.parentNode.contains(b)&&x()})}function Te(m,x){pt(m,x)}function pt(m,x){var E=k().box;function W(O){O.target===E&&(cr(E,"remove",W),x())}if(m===0)return x();cr(E,"remove",u),cr(E,"add",W),u=W}function Ae(m,x,E){E===void 0&&(E=!1);var W=bt(c.props.triggerTarget||t);W.forEach(function(O){O.addEventListener(m,x,E),d.push({node:O,eventType:m,handler:x,options:E})})}function ct(){M()&&(Ae("touchstart",_t,{passive:!0}),Ae("touchend",Yt,{passive:!0})),bs(c.props.trigger).forEach(function(m){if(m!=="manual")switch(Ae(m,_t),m){case"mouseenter":Ae("mouseleave",Yt);break;case"focus":Ae(Os?"focusout":"blur",xt);break;case"focusin":Ae("focusout",xt);break}})}function zt(){d.forEach(function(m){var x=m.node,E=m.eventType,W=m.handler,O=m.options;x.removeEventListener(E,W,O)}),d=[]}function _t(m){var x,E=!1;if(!(!c.state.isEnabled||kt(m)||s)){var W=((x=f)==null?void 0:x.type)==="focus";f=m,y=m.currentTarget,_e(),!c.state.isVisible&&Cs(m)&&_n.forEach(function(O){return O(m)}),m.type==="click"&&(c.props.trigger.indexOf("mouseenter")<0||l)&&c.props.hideOnClick!==!1&&c.state.isVisible?E=!0:Ct(m),m.type==="click"&&(l=!E),E&&!W&&je(m)}}function Gt(m){var x=m.target,E=U().contains(x)||b.contains(x);if(!(m.type==="mousemove"&&E)){var W=Fe().concat(b).map(function(O){var ne,le=O._tippy,ut=(ne=le.popperInstance)==null?void 0:ne.state;return ut?{popperRect:O.getBoundingClientRect(),popperState:ut,props:n}:null}).filter(Boolean);Ts(W,m)&&(Ue(),je(m))}}function Yt(m){var x=kt(m)||c.props.trigger.indexOf("click")>=0&&l;if(!x){if(c.props.interactive){c.hideWithInteractivity(m);return}je(m)}}function xt(m){c.props.trigger.indexOf("focusin")<0&&m.target!==U()||c.props.interactive&&m.relatedTarget&&b.contains(m.relatedTarget)||je(m)}function kt(m){return Ce.isTouch?M()!==m.type.indexOf("touch")>=0:!1}function Xt(){Jt();var m=c.props,x=m.popperOptions,E=m.placement,W=m.offset,O=m.getReferenceClientRect,ne=m.moveTransition,le=R()?fr(b).arrow:null,ut=O?{getBoundingClientRect:O,contextElement:O.contextElement||U()}:t,Cr={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(nn){var ft=nn.state;if(R()){var _o=k(),An=_o.box;["placement","reference-hidden","escaped"].forEach(function(rn){rn==="placement"?An.setAttribute("data-placement",ft.placement):ft.attributes.popper["data-popper-"+rn]?An.setAttribute("data-"+rn,""):An.removeAttribute("data-"+rn)}),ft.attributes.popper={}}}},$e=[{name:"offset",options:{offset:W}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ne}},Cr];R()&&le&&$e.push({name:"arrow",options:{element:le,padding:3}}),$e.push.apply($e,(x==null?void 0:x.modifiers)||[]),c.popperInstance=ar(ut,b,Object.assign({},x,{placement:E,onFirstUpdate:g,modifiers:$e}))}function Jt(){c.popperInstance&&(c.popperInstance.destroy(),c.popperInstance=null)}function Se(){var m=c.props.appendTo,x,E=U();c.props.interactive&&m===Si||m==="parent"?x=E.parentNode:x=Li(m,[E]),x.contains(b)||x.appendChild(b),c.state.isMounted=!0,Xt()}function Fe(){return kn(b.querySelectorAll("[data-tippy-root]"))}function Ct(m){c.clearDelayTimeouts(),m&&V("onTrigger",[c,m]),he();var x=N(!0),E=D(),W=E[0],O=E[1];Ce.isTouch&&W==="hold"&&O&&(x=O),x?r=setTimeout(function(){c.show()},x):c.show()}function je(m){if(c.clearDelayTimeouts(),V("onUntrigger",[c,m]),!c.state.isVisible){Ee();return}if(!(c.props.trigger.indexOf("mouseenter")>=0&&c.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(m.type)>=0&&l)){var x=N(!1);x?i=setTimeout(function(){c.state.isVisible&&c.hide()},x):o=requestAnimationFrame(function(){c.hide()})}}function Pt(){c.state.isEnabled=!0}function Zt(){c.hide(),c.state.isEnabled=!1}function Qt(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function en(m){if(!c.state.isDestroyed){V("onBeforeUpdate",[c,m]),zt();var x=c.props,E=xi(t,Object.assign({},x,yi(m),{ignoreAttributes:!0}));c.props=E,ct(),x.interactiveDebounce!==E.interactiveDebounce&&(Ue(),v=hi(Gt,E.interactiveDebounce)),x.triggerTarget&&!E.triggerTarget?bt(x.triggerTarget).forEach(function(W){W.removeAttribute("aria-expanded")}):E.triggerTarget&&t.removeAttribute("aria-expanded"),_e(),I(),T&&T(x,E),c.popperInstance&&(Xt(),Fe().forEach(function(W){requestAnimationFrame(W._tippy.popperInstance.forceUpdate)})),V("onAfterUpdate",[c,m])}}function tn(m){c.setProps({content:m})}function ho(){var m=c.state.isVisible,x=c.state.isDestroyed,E=!c.state.isEnabled,W=Ce.isTouch&&!c.props.touch,O=lr(c.props.duration,0,be.duration);if(!(m||x||E||W)&&!U().hasAttribute("disabled")&&(V("onShow",[c],!1),c.props.onShow(c)!==!1)){if(c.state.isVisible=!0,R()&&(b.style.visibility="visible"),I(),he(),c.state.isMounted||(b.style.transition="none"),R()){var ne=k(),le=ne.box,ut=ne.content;pr([le,ut],0)}g=function(){var $e;if(!(!c.state.isVisible||p)){if(p=!0,b.offsetHeight,b.style.transition=c.props.moveTransition,R()&&c.props.animation){var Rn=k(),nn=Rn.box,ft=Rn.content;pr([nn,ft],O),wi([nn,ft],"visible")}ie(),_e(),vi(xn,c),($e=c.popperInstance)==null||$e.forceUpdate(),V("onMount",[c]),c.props.animation&&R()&&Te(O,function(){c.state.isShown=!0,V("onShown",[c])})}},Se()}}function vo(){var m=!c.state.isVisible,x=c.state.isDestroyed,E=!c.state.isEnabled,W=lr(c.props.duration,1,be.duration);if(!(m||x||E)&&(V("onHide",[c],!1),c.props.onHide(c)!==!1)){if(c.state.isVisible=!1,c.state.isShown=!1,p=!1,l=!1,R()&&(b.style.visibility="hidden"),Ue(),Ee(),I(!0),R()){var O=k(),ne=O.box,le=O.content;c.props.animation&&(pr([ne,le],W),wi([ne,le],"hidden"))}ie(),_e(),c.props.animation?R()&&lt(W,c.unmount):c.unmount()}}function yo(m){te().addEventListener("mousemove",v),vi(_n,v),v(m)}function wo(){c.state.isVisible&&c.hide(),c.state.isMounted&&(Jt(),Fe().forEach(function(m){m._tippy.unmount()}),b.parentNode&&b.parentNode.removeChild(b),xn=xn.filter(function(m){return m!==c}),c.state.isMounted=!1,V("onHidden",[c]))}function bo(){c.state.isDestroyed||(c.clearDelayTimeouts(),c.unmount(),zt(),delete t._tippy,c.state.isDestroyed=!0,V("onDestroy",[c]))}}function Wt(t,e){e===void 0&&(e={});var n=be.plugins.concat(e.plugins||[]);Is();var r=Object.assign({},e,{plugins:n}),i=Ps(t);if(0)var o,l;var s=i.reduce(function(a,p){var f=p&&Vs(p,r);return f&&a.push(f),a},[]);return Cn(t)?s[0]:s}Wt.defaultProps=be;Wt.setDefaultProps=As;Wt.currentInput=Ce;var Ni=function(e){var n=e===void 0?{}:e,r=n.exclude,i=n.duration;xn.forEach(function(o){var l=!1;if(r&&(l=Ii(r)?o.reference===r:o.popper===r.popper),!l){var s=o.props.duration;o.setProps({duration:i}),o.hide(),o.state.isDestroyed||o.setProps({duration:s})}})},ku=Object.assign({},It,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});Wt.setDefaultProps({render:Di});var Pn=Wt;var Ri=()=>L("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-more-horizontal",children:[L("title",{children:"More details icon"}),L("circle",{cx:"12",cy:"12",r:"1"}),L("circle",{cx:"19",cy:"12",r:"1"}),L("circle",{cx:"5",cy:"12",r:"1"})]});var Ht,K,mr,Ai,Tn=0,$i=[],G=H,Fi=G.__b,Wi=G.__r,Hi=G.diffed,Vi=G.__c,Ui=G.unmount,Bi=G.__;function hr(t,e){G.__h&&G.__h(K,t,Tn||e),Tn=0;var n=K.__H||(K.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function qi(t){return Tn=1,Us(Yi,t)}function Us(t,e,n){var r=hr(Ht++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):Yi(void 0,e),function(s){var a=r.__N?r.__N[0]:r.__[0],p=r.t(a,s);a!==p&&(r.__N=[p,r.__[1]],r.__c.setState({}))}],r.__c=K,!K.u)){var i=function(s,a,p){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(g){return!!g.__c});if(f.every(function(g){return!g.__N}))return!o||o.call(this,s,a,p);var u=r.__c.props!==s;return f.forEach(function(g){if(g.__N){var d=g.__[0];g.__=g.__N,g.__N=void 0,d!==g.__[0]&&(u=!0)}}),o&&o.call(this,s,a,p)||u};K.u=!0;var o=K.shouldComponentUpdate,l=K.componentWillUpdate;K.componentWillUpdate=function(s,a,p){if(this.__e){var f=o;o=void 0,i(s,a,p),o=f}l&&l.call(this,s,a,p)},K.shouldComponentUpdate=i}return r.__N||r.__}function Ki(t,e){var n=hr(Ht++,3);!G.__s&&Gi(n.__H,e)&&(n.__=t,n.i=e,K.__H.__h.push(n))}function zi(t){return Tn=5,Bs(function(){return{current:t}},[])}function Bs(t,e){var n=hr(Ht++,7);return Gi(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function js(){for(var t;t=$i.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(En),t.__H.__h.forEach(gr),t.__H.__h=[]}catch(e){t.__H.__h=[],G.__e(e,t.__v)}}G.__b=function(t){K=null,Fi&&Fi(t)},G.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Bi&&Bi(t,e)},G.__r=function(t){Wi&&Wi(t),Ht=0;var e=(K=t.__c).__H;e&&(mr===K?(e.__h=[],K.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(e.__h.forEach(En),e.__h.forEach(gr),e.__h=[],Ht=0)),mr=K},G.diffed=function(t){Hi&&Hi(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&($i.push(e)!==1&&Ai===G.requestAnimationFrame||((Ai=G.requestAnimationFrame)||$s)(js)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),mr=K=null},G.__c=function(t,e){e.some(function(n){try{n.__h.forEach(En),n.__h=n.__h.filter(function(r){return!r.__||gr(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],G.__e(r,n.__v)}}),Vi&&Vi(t,e)},G.unmount=function(t){Ui&&Ui(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{En(r)}catch(i){e=i}}),n.__H=void 0,e&&G.__e(e,n.__v))};var ji=typeof requestAnimationFrame=="function";function $s(t){var e,n=function(){clearTimeout(r),ji&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);ji&&(e=requestAnimationFrame(n))}function En(t){var e=K,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),K=e}function gr(t){var e=K;t.__c=t.__(),K=e}function Gi(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Yi(t,e){return typeof e=="function"?e(t):e}var Xi={"name-asc":{label:"Name",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-down-a-z"><path d="m3 16 4 4 4-4"/><path d="M7 20V4"/><path d="M20 8h-5"/><path d="M15 10V6.5a2.5 2.5 0 0 1 5 0V10"/><path d="M15 14h5l-5 6h5"/></svg>'},"name-desc":{label:"Name",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-z-a"><path d="m3 8 4-4 4 4"/><path d="M7 4v16"/><path d="M15 4h5l-5 6h5"/><path d="M15 20v-3.5a2.5 2.5 0 0 1 5 0V20"/><path d="M20 18h-5"/></svg>'},"mtime-asc":{label:"Date",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-down-0-1"><path d="m3 16 4 4 4-4"/><path d="M7 20V4"/><rect x="15" y="4" width="4" height="6" ry="2"/><path d="M17 20v-6h-2"/><path d="M15 20h4"/></svg>'},"mtime-desc":{label:"Date",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-1-0"><path d="m3 8 4-4 4 4"/><path d="M7 4v16"/><path d="M17 10V4h-2"/><path d="M15 10h4"/><rect x="15" y="14" width="4" height="6" ry="2"/></svg>'}},Ji=({plugin:t,onChange:e})=>{let[n,r]=qi(!1),i=zi(null),o=()=>{r(!n)},l=async s=>{r(!1),t.settings.sortOptionDefault=s,await t.saveSettings(),e()};return Ki(()=>{let s=a=>{i.current&&!i.current.contains(a.target)&&r(!1)};return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[]),L("div",{className:"snw-sort-dropdown-wrapper",ref:i,children:[L("button",{type:"button",onClick:o,class:"snw-sort-dropdown-button",children:L("div",{dangerouslySetInnerHTML:{__html:Xi[t.settings.sortOptionDefault].icon}})}),n&&L("ul",{className:"snw-sort-dropdown-list",children:Object.entries(Xi).map(([s,{label:a,icon:p}])=>L("li",{id:s,onClick:async f=>{f.stopPropagation(),await l(s)},class:"snw-sort-dropdown-list-item",children:[L("span",{dangerouslySetInnerHTML:{__html:p}}),L("span",{className:"snw-sort-dropdown-list-item-label",children:a})]}))})]})};var Zi=(t,e,n,r,i,o,l,s,a)=>{let p=L("div",{className:`${l?"snw-ref-title-popover":"snw-ref-title-side-pane"} tree-item-self is-clickable`,children:[L("div",{className:"snw-ref-title-popover-label","snw-ref-title-type":t,"snw-ref-title-reallink":e,"snw-ref-title-key":n,"snw-data-file-name":r,"snw-data-line-number":o.toString(),children:e}),L(Ji,{plugin:s,onChange:a}),l&&L("span",{className:"snw-ref-title-popover-open-sidepane-icon","snw-ref-title-type":t,"snw-ref-title-reallink":e,"snw-ref-title-key":n,"snw-data-file-name":r,"snw-data-line-number":o.toString(),children:L("span",{className:"snw-ref-title-popover-icon",onClick:u=>{u.stopPropagation(),Ni({duration:0}),s.activateView(t,e,n,r,Number(o))},children:L(Ri,{})})})]}),f=createDiv();return ke(p,f),f};var rt;function to(t){rt=t}var vr=async(t,e,n,r,i,o)=>{let l=await Qi(t,n,r),s=createDiv();s.append(Zi(t,e,n,r,l.refCount,i,o,rt,async()=>{let p=s.querySelector(".snw-ref-area");if(p){for(p.style.visibility="hidden";p.firstChild;)p.removeChild(p.firstChild);p.style.visibility="visible";let f=await Qi(t,n,r);p.prepend(f.response),setTimeout(async()=>{await Sn(!1,p)},500)}}));let a=createDiv({cls:"snw-ref-area"});return a.append(l.response),s.append(a),s},qs=(t,e)=>t.sort((n,r)=>{let i=n.sourceFile,o=r.sourceFile;switch(e){case"name-asc":return i==null?void 0:i.basename.localeCompare(o==null?void 0:o.basename);case"name-desc":return o==null?void 0:o.basename.localeCompare(i==null?void 0:i.basename);case"mtime-asc":return(i==null?void 0:i.stat.mtime)-(o==null?void 0:o.stat.mtime);case"mtime-desc":return(o==null?void 0:o.stat.mtime)-(i==null?void 0:i.stat.mtime);default:return 0}}),Qi=async(t,e,n)=>{var u,g,d;let r=0,i=null;if(t==="File"){let v=Le(),y=[];for(let h of v.values())for(let w of h)w!=null&&w.resolvedFile&&((u=w==null?void 0:w.resolvedFile)==null?void 0:u.path)===n&&y.push(w);r=y.length,i=y}else{let v=Le().get(e);v===void 0&&(v=Le().get(e));let y=await Ks(v);r=y.length,i=y}let o=Array.from(new Set(i.map(v=>{var y;return(y=v.sourceFile)==null?void 0:y.path}))).map(v=>i.find(y=>{var h;return((h=y.sourceFile)==null?void 0:h.path)===v})),l=qs(o,rt.settings.sortOptionDefault),s=createDiv(),a=rt.settings.maxFileCountToDisplay;r<a&&(a=r);let p=0,f=null;rt.settings.displayCustomPropertyList.trim()!==""&&(f=rt.settings.displayCustomPropertyList.split(",").map(v=>v.trim()));for(let v=0;v<l.length;v++){if(p>a)continue;let y=l[v],h=createDiv();h.addClass("snw-ref-item-container"),h.addClass("tree-item"),s.appendChild(h);let w=createDiv();w.addClass("snw-ref-item-file"),w.addClass("tree-item-self"),w.addClass("search-result-file-title"),w.addClass("is-clickable"),w.setAttribute("snw-data-line-number","-1"),w.setAttribute("snw-data-file-name",y.sourceFile.path),w.setAttribute("data-href",y.sourceFile.path),w.setAttribute("href",y.sourceFile.path);let _=createDiv();_.addClass("snw-ref-item-file-icon"),_.addClass("tree-item-icon"),_.addClass("collapse-icon"),(0,eo.setIcon)(_,"file-box");let P=createDiv();if(P.addClass("snw-ref-item-file-label"),P.addClass("tree-item-inner"),P.innerText=y.sourceFile.basename,w.append(_),w.append(P),h.appendChild(w),f!=null){let C=y.sourceFile?rt.app.metadataCache.getFileCache(y.sourceFile):null;f.forEach(b=>{var A;let T=(A=C==null?void 0:C.frontmatter)==null?void 0:A[b];if(T){let F=L("div",{class:"snw-custom-property-container",children:[L("span",{class:"snw-custom-property-name",children:b}),L("span",{class:"snw-custom-property-text",children:[": ",T]})]}),D=createDiv();ke(F,D),P.append(D)}})}let c=createDiv();c.addClass("snw-ref-item-collection-items"),c.addClass("search-result-file-matches"),h.appendChild(c);for(let C of i)((g=y.sourceFile)==null?void 0:g.path)===((d=C.sourceFile)==null?void 0:d.path)&&p<a&&(p+=1,c.appendChild(await Yr(C)))}return{response:s,refCount:r}},Ks=async t=>t.sort((e,n)=>{var o;let r=0;e.reference.position!==void 0&&(r=Number(e.reference.position.start.line));let i=0;return n.reference.position!==void 0&&(i=Number(n.reference.position.start.line)),((o=e.sourceFile)==null?void 0:o.basename.localeCompare(n.sourceFile.basename))||Number(r)-Number(i)});var it;function no(t){it=t,Gr(it)}var Ln=async t=>{let{refType:e,realLink:n,key:r,filePath:i,lineNu:o}=await zs(t),l=createDiv();l.addClass("snw-popover-container"),l.addClass("search-result-container"),l.appendChild(await vr(e,n,r,i,o,!0)),t.setContent(l),setTimeout(async()=>{await Sn(!1,l)},500),dn(l)},ro=async(t,e,n,r,i)=>{let o=createDiv();return o.addClass("snw-sidepane-container"),o.addClass("search-result-container"),o.append(await vr(t,e,n,r,i,!1)),setTimeout(async()=>{await Sn(!1,o)},500),o},Sn=async(t,e)=>{e.querySelectorAll(".snw-ref-item-file, .snw-ref-item-info, .snw-ref-title-popover-label").forEach(r=>{r.getAttribute("snw-has-handler")||(r.setAttribute("snw-has-handler","true"),r.addEventListener("click",async i=>{var f,u;i.preventDefault();let o=i.target.closest(".snw-ref-item-file, .snw-ref-item-info, .snw-ref-title-popover-label");if(!o)return;let l=Number(o.getAttribute("snw-data-line-number")),s=o.getAttribute("snw-data-file-name"),a=app.metadataCache.getFirstLinkpathDest(s,s);if(!a){new ot.Notice(`File not found: ${s}. It may be a broken link.`);return}it.app.workspace.getLeaf(ot.Keymap.isModEvent(i)).openFile(a);let p=o.getAttribute("snw-ref-title-key");if(p){if(p.contains("#^")){let g=Object.entries((f=it.app.metadataCache.getFileCache(a))==null?void 0:f.blocks);if(g){let d=p.match(/#\^(.+)$/g)[0].replace("#^","").toLowerCase();l=g.find(y=>y[0]===d)[1].position.start.line}}else if(p.contains("#")){let g=(u=it.app.metadataCache.getFileCache(a))==null?void 0:u.headings;if(g){let d=p.match(/#(.+)/g)[0].replace("#","");l=g.find(y=>y.heading.toLocaleUpperCase()===d).position.start.line}}}l>0&&setTimeout(()=>{try{let g=it.app.workspace.getActiveViewOfType(ot.MarkdownView);g&&g.setEphemeralState({line:l})}catch(g){}},400)}),it.app.internalPlugins.plugins["page-preview"].enabled===!0&&r.addEventListener("mouseover",i=>{i.preventDefault();let o=app.internalPlugins.plugins["page-preview"].instance.overrides["obsidian42-strange-new-worlds"]!==!1;if(o===!1||o===!0&&ot.Keymap.isModifier(i,"Mod")){let l=i.target,s={scroll:Number(l.getAttribute("snw-data-line-number"))},a=l.getAttribute("snw-data-file-name");a&&app.workspace.trigger("link-hover",{},l,a,"",s)}}))})},zs=async t=>{let e=t.reference,n=e.getAttribute("data-snw-type")||"",r=e.getAttribute("data-snw-reallink")||"",i=e.getAttribute("data-snw-key")||"",o=e.getAttribute("data-snw-filepath")||"",l=Number(e.getAttribute("snw-data-line-number"))||0;return{refType:n,realLink:r,key:i,filePath:o,lineNu:l}};var De="Strange New Worlds",In=class extends io.ItemView{constructor(e,n){super(e),this.plugin=n}getViewType(){return De}getDisplayText(){return De}getIcon(){return"file-digit"}async onOpen(){ke(L("div",{class:"snw-sidepane-loading",children:[L("div",{class:"snw-sidepane-loading-banner",children:"Discovering Strange New Worlds..."}),L("div",{class:"snw-sidepane-loading-subtext",children:"Click a reference counter in the main document for information to appear here."})]}),this.containerEl.querySelector(".view-content"))}async updateView(){let e=this.plugin;this.containerEl.replaceChildren(await ro(e.lastSelectedReferenceType,e.lastSelectedReferenceRealLink,e.lastSelectedReferenceKey,e.lastSelectedReferenceFilePath,e.lastSelectedLineNumber)),dn(this.containerEl)}async onClose(){}};var Bt=require("obsidian");var Vt=require("obsidian");var Ut;function oo(t){Ut=t}function de(t,e,n,r,i,o,l){let s=L("div",{className:`snw-reference snw-${e} ${o}`,"data-snw-type":e,"data-snw-reallink":n,"data-snw-key":r.toLocaleUpperCase(),"data-snw-filepath":i,"snw-data-line-number":l.toString(),children:t.toString()}),a=createDiv();ke(s,a);let p=a.firstElementChild;(Vt.Platform.isDesktop||Vt.Platform.isDesktopApp)&&(p.onclick=async d=>Mn(d.target));let f=Ut.settings.requireModifierKeyToActivateSNWView,u=!0;return Pn(p,{interactive:!0,appendTo:()=>document.body,allowHTML:!0,zIndex:9999,placement:"auto-end",onTrigger(d,v){let y=v;f!==!1&&(y.ctrlKey||y.metaKey?u=!0:u=!1)},onShow(d){if(!u)return!1;setTimeout(async()=>{await Ln(d)},1)}}).popper.classList.add("snw-tippy"),a}var Mn=async t=>{var l,s,a,p,f;let e=(l=t.getAttribute("data-snw-type"))!=null?l:"",n=(s=t.getAttribute("data-snw-realLink"))!=null?s:"",r=(a=t.getAttribute("data-snw-key"))!=null?a:"",i=(p=t.getAttribute("data-snw-filepath"))!=null?p:"",o=(f=t.getAttribute("snw-data-line-number"))!=null?f:"";Ut.activateView(e,n,r,i,Number(o))},yr=(0,Vt.debounce)(()=>{var e,n;let t=document.querySelectorAll(".snw-liveupdate");for(let r of Array.from(t)){let i=(n=(e=Ut.snwAPI.references.get(r.dataset.snwKey))==null?void 0:e.length)!=null?n:0;if(i<Ut.settings.minimumRefCountThreshold){r.remove();continue}let o=String(i);r.textContent!==o&&(r.textContent=o)}},st,!0);var at;function ao(t){at=t}function Gs(){at.app.workspace.iterateAllLeaves(t=>{(t.view.getViewType()==="markdown"||t.view.getViewType()==="file-properties")&&Ys(t.view)})}var On=(0,Bt.debounce)(()=>{Gs()},st,!0);function Ys(t){var i,o,l;if(!at.showCountsActive)return;let e=Bt.Platform.isMobile||Bt.Platform.isMobileApp?at.settings.displayPropertyReferencesMobile:at.settings.displayPropertyReferences,n=t;if(!e||!(n!=null&&n.rawFrontmatter))return;let r=n.file?pe(n.file):{};if((i=r.frontmatterLinks)!=null&&i.length)for(let s of n.metadataEditor.rendered){let a=s.valueEl.querySelector(".metadata-link-inner.internal-link");if(a){let f=a.textContent,u=(o=r.frontmatterLinks)==null?void 0:o.find(g=>g.displayText===f);u&&so(a,u)}let p=s.valueEl.querySelectorAll(".multi-select-pill.internal-link .multi-select-pill-content span");if(p.length)for(let f of Array.from(p)){let u=f.textContent,g=(l=r.frontmatterLinks)==null?void 0:l.find(v=>v.displayText===u),d=f.parentElement;g&&d&&so(d,g)}}}function so(t,e){var i,o,l,s;let n=(i=t.parentElement)==null?void 0:i.querySelector(".snw-frontmatter-wrapper"),r=e.references.length;if(!n&&r>=at.settings.minimumRefCountThreshold){n=createSpan({cls:"snw-frontmatter-wrapper"});let a=de(r,"link",e.references[0].realLink,e.key,(s=(l=(o=e.references[0])==null?void 0:o.resolvedFile)==null?void 0:l.path)!=null?s:"","snw-frontmatter-count",e.pos.start.line);n.appendChild(a),t.insertAdjacentElement("afterend",n)}else try{if(r>=at.settings.minimumRefCountThreshold){let a=n==null?void 0:n.querySelector(".snw-frontmatter-count");a&&(a.innerText=` ${r} `)}else n==null||n.remove()}catch(a){}}var $t=require("obsidian");var jt;function lo(t){jt=t}function Xs(){!jt.settings.displayIncomingFilesheader||!jt.showCountsActive||jt.app.workspace.iterateAllLeaves(t=>{t.view.getViewType()==="markdown"&&Js(t.view)})}var Dn=(0,$t.debounce)(()=>{Xs()},st,!0);function Js(t){var f,u,g;let e=t.file;if(!e)return;let n=Le(),r=0;for(let d of n.values())for(let v of d)v!=null&&v.resolvedFile&&((f=v==null?void 0:v.resolvedFile)==null?void 0:f.path)===e.path&&r++;let i=pe(e);if(((g=(u=i==null?void 0:i.cacheMetaData)==null?void 0:u.frontmatter)==null?void 0:g["snw-file-exclude"])===!0&&(r=0),r<1){let d=t.contentEl.querySelector(".snw-header-count-wrapper");d&&d.remove();return}let o=t.contentEl.querySelector(".snw-header-count");if(o&&o.dataset.snwKey===e.basename){o.innerText=` ${r.toString()} `;return}let l=t.contentEl,s=l.querySelector(".snw-header-count-wrapper");s?o=l.querySelector(".snw-header-count"):(s=createDiv({cls:"snw-reference snw-header-count-wrapper"}),o=createDiv({cls:"snw-header-count"}),s.appendChild(o),l.prepend(s)),o&&(o.innerText=` ${r.toString()} `),($t.Platform.isDesktop||$t.Platform.isDesktopApp)&&o&&(o.onclick=d=>{d.stopPropagation(),s&&Mn(s)}),s.setAttribute("data-snw-reallink",e.basename),s.setAttribute("data-snw-key",e.basename),s.setAttribute("data-snw-type","File"),s.setAttribute("data-snw-filepath",e.path),s.onclick=d=>{d.stopPropagation(),Mn(d.target)};let a=!0;Pn(s,{interactive:!0,appendTo:()=>document.body,allowHTML:!0,zIndex:9999,placement:"auto-end",onTrigger(d,v){let y=v;jt.settings.requireModifierKeyToActivateSNWView!==!1&&(y.ctrlKey||y.metaKey?a=!0:a=!1)},onShow(d){if(!a)return!1;setTimeout(async()=>{await Ln(d)},1)}}).popper.classList.add("snw-tippy")}var qt=require("@codemirror/view"),po=require("obsidian");var wr;function co(t){wr=t}var Zs=class extends qt.GutterMarker{constructor(t,e,n,r,i,o){super(),this.referenceCount=t,this.referenceType=e,this.realLink=n,this.key=r,this.filePath=i,this.addCssClass=o}toDOM(){return de(this.referenceCount,this.referenceType,this.realLink,this.key,this.filePath,this.addCssClass,0)}},Qs=new class extends qt.GutterMarker{toDOM(){return document.createTextNode("\xF8\xF8\xF8")}},ea=(0,qt.gutter)({class:"snw-gutter-ref",lineMarker(t,e){var l,s,a,p,f,u,g,d,v;let n=t.state.field(po.editorInfoField);if(((l=n.currentMode)==null?void 0:l.sourceMode)===!0&&wr.settings.displayInlineReferencesInSourceMode===!1||!n.file)return null;let r=pe(n.file);if(((a=(s=r==null?void 0:r.cacheMetaData)==null?void 0:s.frontmatter)==null?void 0:a["snw-file-exclude"])===!0||((f=(p=r==null?void 0:r.cacheMetaData)==null?void 0:p.frontmatter)==null?void 0:f["snw-canvas-exclude-edit"])===!0)return null;let i=(u=n.app.metadataCache.getFileCache(n.file))==null?void 0:u.embeds;if(!i||!i.length)return null;let o=t.state.doc.lineAt(e.from).number;for(let y of i)if(y.position.start.line+1===o){for(let h of(g=r==null?void 0:r.embeds)!=null?g:[])if((h==null?void 0:h.references.length)>=Math.max(2,wr.settings.minimumRefCountThreshold)&&(h==null?void 0:h.pos.start.line)+1===o){let w=t.state.doc.lineAt(e.from).text.trim();if(w.startsWith("!")){let _=w.replace("![[","").replace("]]","").split("|")[0];if((_.startsWith("#")?n.file+_:J(_)||_).toLocaleUpperCase()===h.key)return new Zs(h.references.length,"embed",h.references[0].realLink,h.key,(v=(d=h.references[0].resolvedFile)==null?void 0:d.path)!=null?v:"","snw-embed-special snw-liveupdate")}}}return null},initialSpacer:()=>Qs}),uo=ea;var Ne=require("@codemirror/view"),Re=require("obsidian");var me;function fo(t){me=t}var mo=Ne.ViewPlugin.fromClass(class{constructor(t){this.view=t;this.decorations=Ne.Decoration.none;this.regxPattern="";me.settings.enableRenderingBlockIdInLivePreview&&(this.regxPattern="(\\s\\^)(\\S+)$"),me.settings.enableRenderingEmbedsInLivePreview&&(this.regxPattern+=`${this.regxPattern!==""?"|":""}!\\[\\[(.*?)\\]\\]`),me.settings.enableRenderingLinksInLivePreview&&(this.regxPattern+=`${this.regxPattern!==""?"|":""}\\[\\[(.*?)\\]\\]`),me.settings.enableRenderingHeadersInLivePreview&&(this.regxPattern+=`${this.regxPattern!==""?"|":""}^#+\\s.+`),this.regxPattern!==""&&(this.decorator=new Ne.MatchDecorator({regexp:new RegExp(this.regxPattern,"g"),decorate:(e,n,r,i,o)=>{var f,u,g,d,v,y,h,w,_,P,c,C,b,T,A,F,D,M,R,U,te;let l=o.state.field(Re.editorInfoField),s=[],a=null;if(!l.file&&(me.settings.enableRenderingEmbedsInLivePreview||me.settings.enableRenderingLinksInLivePreview)){let k=i[0].replace(/^\[\[|\]\]$|^!\[\[|\]\]$/g,""),N=J(k).toLocaleUpperCase();if(N){let I=i.input.startsWith("!")?"embed":"link";a=me.app.metadataCache.getFirstLinkpathDest((0,Re.parseLinktext)(k).path,"/");let V=me.snwAPI.references.get(N),ie=[{key:N,page:a.path,type:I,pos:{start:{line:0,ch:0,col:0,offset:0},end:{line:0,ch:0,col:0,offset:0}},references:V!=null?V:[]}];s.push({key:N,transformedCachedItem:ie!=null?ie:null,refType:I,from:r,to:r})}}else{if(me.settings.displayInlineReferencesInSourceMode===!1&&((f=l.currentMode)==null?void 0:f.sourceMode)===!0)return null;a=l.file;let k=pe(a);if((k.links||k.headings||k.embeds||k.blocks)&&((g=(u=k==null?void 0:k.cacheMetaData)==null?void 0:u.frontmatter)==null?void 0:g["snw-file-exclude"])!==!0&&((v=(d=k==null?void 0:k.cacheMetaData)==null?void 0:d.frontmatter)==null?void 0:v["snw-canvas-exclude-edit"])!==!0){let N=i[0].charAt(0);if(N==="["&&((h=(y=k==null?void 0:k.links)==null?void 0:y.length)!=null?h:0)>0){let I=i[0].replace("[[","").replace("]]","");I.startsWith("#")&&(I=a.path+I),I=I.toLocaleUpperCase(),s.push({key:I,transformedCachedItem:(w=k.links)!=null?w:null,refType:"link",from:r,to:r})}else if(N==="#"&&((c=((_=k==null?void 0:k.headings)==null?void 0:_.length)||((P=k==null?void 0:k.links)==null?void 0:P.length))!=null?c:0)>0){if(s.push({key:(0,Re.stripHeading)(i[0].replace(/^#+/,"").substring(1)),transformedCachedItem:(C=k.headings)!=null?C:null,refType:"heading",from:r,to:r}),me.settings.enableRenderingLinksInLivePreview){let I=i[0].match(/\[\[(.*?)\]\]|!\[\[(.*?)\]\]/g);if(I)for(let V of I)s.push({key:V.replace("![[","").replace("[[","").replace("]]","").toLocaleUpperCase(),transformedCachedItem:V.startsWith("!")?(b=k.embeds)!=null?b:null:(T=k.links)!=null?T:null,refType:"link",from:r-i[0].length+(i[0].indexOf(V)+V.length),to:r-i[0].length+(i[0].indexOf(V)+V.length)})}}else if(N==="!"&&((F=(A=k==null?void 0:k.embeds)==null?void 0:A.length)!=null?F:0)>0){let I=i[0].replace("![[","").replace("]]","");I.startsWith("#")&&(I=a.path+(0,Re.stripHeading)(I)),s.push({key:I.toLocaleUpperCase(),transformedCachedItem:(D=k.embeds)!=null?D:null,refType:"embed",from:r,to:r})}else N===" "&&((R=(M=k==null?void 0:k.blocks)==null?void 0:M.length)!=null?R:0)>0&&s.push({key:(a.path+i[0].replace(" ^","#^")).toLocaleUpperCase(),transformedCachedItem:(U=k.blocks)!=null?U:null,refType:"block",from:r,to:r})}}if(s.length===0||!a)return;let p=s.sort((k,N)=>k.to===N.to?k.refType==="heading"?1:-1:k.to-N.to);for(let k of s)if(k.key!==""){let N=ta(k.refType,k.key,(te=k.transformedCachedItem)!=null?te:[],a.path,a.extension);N!=null&&e(k.from,k.to,Ne.Decoration.widget({widget:N,side:1}))}}}),this.decorations=this.decorator.createDeco(t))}update(t){this.regxPattern!==""&&(t.docChanged||t.viewportChanged)&&(this.decorations=this.decorator?this.decorator.updateDeco(t,this.decorations):this.decorations)}},{decorations:t=>t.decorations}),ta=(t,e,n,r,i)=>{var l,s;let o=e;for(let a=0;a<n.length;a++){let p=n[a],f=p.key;if(t==="heading"&&(f=(0,Re.stripHeading)((l=p.headerMatch)!=null?l:""),o=o.replace(/^\s+|\s+$/g,"")),!(t==="link"&&p.references.length===1)){if(t==="embed"||t==="link"){o.contains("|")&&(o=o.substring(0,e.search(/\|/)));let u=J(o).toLocaleUpperCase();o=u===""?o:u,f.startsWith("#")&&(f=r+(0,Re.stripHeading)(f))}if(f===o){let u=(s=p==null?void 0:p.references[0])!=null&&s.resolvedFile?p.references[0].resolvedFile.path.replace(`.${p.references[0].resolvedFile}`,""):o;return(p==null?void 0:p.references.length)>=me.settings.minimumRefCountThreshold?new br(p.references.length,p.type,p.references[0].realLink,p.key,u,"snw-liveupdate",p.pos.start.line):null}}}return null},br=class extends Ne.WidgetType{constructor(e,n,r,i,o,l,s){super(),this.referenceCount=e,this.referenceType=n,this.realLink=r,this.key=i,this.filePath=o,this.addCssClass=l,this.lineNu=s}toDOM(){return de(this.referenceCount,this.referenceType,this.realLink,this.key,this.filePath,this.addCssClass,this.lineNu)}destroy(){}ignoreEvent(){return!1}};var Kt=require("obsidian");var ge;function go(t){ge=t}function kr(t,e){var r;if(e.remainingNestLevel===4||t.hasAttribute("uic")||t.querySelectorAll(".contains-task-list").length>0)return;let n=ge.app.vault.fileMap[e.sourcePath];if(n===void 0)e.addChild(new _r(t));else{if(ge.settings.pluginSupportKanban===!1){let i=ge.app.metadataCache.getFileCache(n);if((r=i==null?void 0:i.frontmatter)!=null&&r["kanban-plugin"])return}e.addChild(new xr(t,e.getSectionInfo(t),n))}}var _r=class extends Kt.MarkdownRenderChild{constructor(e){super(e),this.containerEl=e}onload(){for(let e of Array.from(this.containerEl.querySelectorAll("a.internal-link, span.internal-embed"))){let n=e.dataset.href||e.getAttribute("src"),r=J(n).toLocaleUpperCase(),i=ge.app.metadataCache.getFirstLinkpathDest((0,Kt.parseLinktext)(n).path,"/"),o=ge.snwAPI.references.get(r),l=(o==null?void 0:o.length)||0;if(l<=0||l<ge.settings.minimumRefCountThreshold)continue;let s=e.classList.contains("internal-link")?"link":"embed";if(!i)continue;let a=de(l,s,n,r,i.path,`snw-liveupdate snw-${s}-preview`,1);e.after(a)}}},xr=class extends Kt.MarkdownRenderChild{constructor(e,n,r){super(e),this.containerEl=e,this.sectionInfo=n,this.currentFile=r}onload(){var r,i,o,l,s,a,p,f,u,g,d,v;let e=ge.settings.minimumRefCountThreshold,n=pe(this.currentFile);if(((i=(r=n==null?void 0:n.cacheMetaData)==null?void 0:r.frontmatter)==null?void 0:i["snw-file-exclude"])!==!0&&((l=(o=n==null?void 0:n.cacheMetaData)==null?void 0:o.frontmatter)==null?void 0:l["snw-canvas-exclude-preview"])!==!0&&(n!=null&&n.blocks||n.embeds||n.headings||n.links)){if(ge.settings.enableRenderingBlockIdInMarkdown&&(n!=null&&n.blocks)&&this.sectionInfo){for(let y of n.blocks)if(y.references.length>=e&&y.pos.start.line>=((s=this.sectionInfo)==null?void 0:s.lineStart)&&y.pos.end.line<=((a=this.sectionInfo)==null?void 0:a.lineEnd)){let h=de(y.references.length,"block",y.references[0].realLink,y.key,(u=(f=(p=y.references[0])==null?void 0:p.resolvedFile)==null?void 0:f.path)!=null?u:"","snw-liveupdate",y.pos.start.line),w=this.containerEl.querySelector("p"),_=y.pos.start.line-this.sectionInfo.lineStart;if(w)w.append(h);else{if(w=this.containerEl.querySelector(`li[data-line="${_}"]`),!w)continue;let P=w.querySelector("ul");P?P.before(h):w.append(h)}w&&!w.hasClass("snw-block-preview")&&h.addClass("snw-block-preview")}}if(ge.settings.enableRenderingEmbedsInMarkdown&&(n!=null&&n.embeds)&&this.containerEl.querySelectorAll(".internal-embed:not(.snw-embed-preview)").forEach(y=>{var _,P,c,C;let h=y.getAttribute("src");if(!h)return;let w=J(h[0]==="#"?this.currentFile.path.slice(0,-(this.currentFile.extension.length+1))+h:h)||h;for(let b of(_=n.embeds)!=null?_:[])if(b.references.length>=e&&w.toLocaleUpperCase()===b.key.toLocaleUpperCase()){let T=de(b.references.length,"embed",b.references[0].realLink,b.key.toLocaleUpperCase(),(C=(c=(P=b.references[0])==null?void 0:P.resolvedFile)==null?void 0:c.path)!=null?C:"","snw-liveupdate",b.pos.start.line);T.addClass("snw-embed-preview"),y.after(T);break}}),ge.settings.enableRenderingLinksInMarkdown&&(n!=null&&n.links)&&this.containerEl.querySelectorAll("a.internal-link").forEach(y=>{var _,P,c,C;let h=y.getAttribute("data-href");if(!h)return;let w=J(h[0]==="#"?this.currentFile.path.slice(0,-(this.currentFile.extension.length+1))+h:h)||h;for(let b of(_=n.links)!=null?_:[])if(b.references.length>=Math.max(2,e)&&b.key.toLocaleUpperCase()===w.toLocaleUpperCase()){let T=de(b.references.length,"link",b.references[0].realLink,b.key.toLocaleUpperCase(),(C=(c=(P=b.references[0])==null?void 0:P.resolvedFile)==null?void 0:c.path)!=null?C:"","snw-liveupdate",b.pos.start.line);T.addClass("snw-link-preview"),y.after(T);break}}),ge.settings.enableRenderingHeadersInMarkdown){let y=this.containerEl.querySelector("[data-heading]");if(n!=null&&n.headings&&y){let h=y.getAttribute("data-heading");for(let w of n.headings)if(w.references.length>=e&&w.headerMatch===(h==null?void 0:h.replace(/\[|\]/g,""))){let _=de(w.references.length,"heading",w.references[0].realLink,w.key,(v=(d=(g=w.references[0])==null?void 0:g.resolvedFile)==null?void 0:d.path)!=null?v:"","snw-liveupdate",w.pos.start.line);_.addClass("snw-heading-preview");let P=this.containerEl.querySelector("h1,h2,h3,h4,h5,h6");P&&P.insertAdjacentElement("beforeend",_);break}}}}}};var st=200,Nn=class extends ae.Plugin{constructor(){super(...arguments);this.appName=this.manifest.name;this.appID=this.manifest.id;this.APP_ABBREVIARTION="SNW";this.settings=sn;this.showCountsActive=sn.enableOnStartupDesktop;this.lastSelectedReferenceType="";this.lastSelectedReferenceRealLink="";this.lastSelectedReferenceKey="";this.lastSelectedReferenceFilePath="";this.lastSelectedLineNumber=0;this.snwAPI=new Et(this);this.markdownPostProcessor=null;this.editorExtensions=[];this.commands=new Tt(this)}async onload(){console.log(`loading ${this.appName}`),Tr(this),to(this),oo(this),co(this),lo(this),ao(this),go(this),fo(this),no(this),window.snwAPI=this.snwAPI,await this.loadSettings(),this.addSettingTab(new an(this.app,this)),ae.Platform.isMobile||ae.Platform.isMobileApp?this.showCountsActive=this.settings.enableOnStartupMobile:this.showCountsActive=this.settings.enableOnStartupDesktop,this.registerView(De,i=>new In(i,this));let n=(0,ae.debounce)(()=>{on(),Dn(),On(),yr()},3e3,!0),r=(0,ae.debounce)(async(i,o,l)=>{await Sr(i),Wn(i,l),Dn(),On(),yr()},1e3,!0);this.registerEvent(this.app.vault.on("rename",n)),this.registerEvent(this.app.vault.on("delete",n)),this.registerEvent(this.app.metadataCache.on("changed",r)),this.app.workspace.registerHoverLinkSource(this.appID,{display:this.appName,defaultMod:!0}),this.snwAPI.settings=this.settings,this.registerEditorExtension(this.editorExtensions),this.app.workspace.on("layout-change",()=>{Dn(),On()}),this.toggleStateSNWMarkdownPreview(),this.toggleStateSNWLivePreview(),this.toggleStateSNWGutters(),this.app.workspace.onLayoutReady(async()=>{var i,o;(i=this.app.workspace.getLeavesOfType(De))!=null&&i.length||await((o=this.app.workspace.getRightLeaf(!1))==null?void 0:o.setViewState({type:De,active:!1})),on()})}async activateView(n,r,i,o,l){this.lastSelectedReferenceType=n,this.lastSelectedReferenceRealLink=r,this.lastSelectedReferenceKey=i,this.lastSelectedReferenceFilePath=o,this.lastSelectedLineNumber=l;let{workspace:s}=this.app,a=null,p=s.getLeavesOfType(De);if(p.length>0)a=p[0];else{let f=s.getRightLeaf(!1);await(f==null?void 0:f.setViewState({type:De,active:!0}))}a&&s.revealLeaf(a),await this.app.workspace.getLeavesOfType(De)[0].view.updateView()}toggleStateSNWMarkdownPreview(){this.settings.displayInlineReferencesMarkdown&&this.showCountsActive&&this.markdownPostProcessor===null?this.markdownPostProcessor=this.registerMarkdownPostProcessor((n,r)=>kr(n,r),100):(this.markdownPostProcessor?ae.MarkdownPreviewRenderer.unregisterPostProcessor(this.markdownPostProcessor):console.log("Markdown post processor is not registered"),this.markdownPostProcessor=null)}toggleStateSNWLivePreview(){let n=this.settings.displayInlineReferencesLivePreview;n===!0&&(n=this.showCountsActive),this.updateCMExtensionState("inline-ref",n,mo)}toggleStateSNWGutters(){let n=ae.Platform.isMobile||ae.Platform.isMobileApp?this.settings.displayEmbedReferencesInGutterMobile:this.settings.displayEmbedReferencesInGutter;n===!0&&(n=this.showCountsActive),this.updateCMExtensionState("gutter",n,uo)}updateCMExtensionState(n,r,i){if(r===!0)this.editorExtensions.push(i),this.editorExtensions[this.editorExtensions.length-1].snwID=n;else for(let o=0;o<this.editorExtensions.length;o++)if(this.editorExtensions[o].snwID===n){this.editorExtensions.splice(o,1);break}this.app.workspace.updateOptions()}async loadSettings(){this.settings=Object.assign({},sn,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}onunload(){console.log(`unloading ${this.appName}`);try{this.markdownPostProcessor?ae.MarkdownPreviewRenderer.unregisterPostProcessor(this.markdownPostProcessor):console.log("Markdown post processor is not registered"),this.app.workspace.unregisterHoverLinkSource(this.appID)}catch(n){}}};
/* nosourcemap */