/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD If you want to view the source, visit the plugins github repository https://github.com/ozntel/file-tree-alternative */ var Z9=Object.create;var o0=Object.defineProperty,b9=Object.defineProperties,T9=Object.getOwnPropertyDescriptor,I9=Object.getOwnPropertyDescriptors,_9=Object.getOwnPropertyNames,b5=Object.getOwnPropertySymbols,P9=Object.getPrototypeOf,T5=Object.prototype.hasOwnProperty,k9=Object.prototype.propertyIsEnumerable;var I5=(t,a,c)=>a in t?o0(t,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):t[a]=c,q1=(t,a)=>{for(var c in a||(a={}))T5.call(a,c)&&I5(t,c,a[c]);if(b5)for(var c of b5(a))k9.call(a,c)&&I5(t,c,a[c]);return t},p2=(t,a)=>b9(t,I9(a)),_5=t=>o0(t,"__esModule",{value:!0});var A2=(t,a)=>()=>(a||t((a={exports:{}}).exports,a),a.exports),D9=(t,a)=>{_5(t);for(var c in a)o0(t,c,{get:a[c],enumerable:!0})},E9=(t,a,c)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of _9(a))!T5.call(t,r)&&r!=="default"&&o0(t,r,{get:()=>a[r],enumerable:!(c=T9(a,r))||c.enumerable});return t},U1=t=>E9(_5(o0(t!=null?Z9(P9(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var L1=(t,a,c)=>new Promise((r,h)=>{var e=n=>{try{v(c.next(n))}catch(i){h(i)}},l=n=>{try{v(c.throw(n))}catch(i){h(i)}},v=n=>n.done?r(n.value):Promise.resolve(n.value).then(e,l);v((c=c.apply(t,a)).next())});var S6=A2((Fv,A6)=>{"use strict";var At="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";A6.exports=At});var R6=A2((yv,O6)=>{"use strict";var St=S6();function F6(){}function y6(){}y6.resetWarningCache=F6;O6.exports=function(){function t(r,h,e,l,v,n){if(n!==St){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}t.isRequired=t;function a(){return t}var c={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:a,element:t,elementType:t,instanceOf:a,node:t,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:y6,resetWarningCache:F6};return c.PropTypes=c,c}});var b6=A2((Zv,Z6)=>{Z6.exports=R6()();var Ov,Rv});var n8=A2((bv,X0)=>{var T6,I6,_6,P6,k6,D6,E6,N6,U6,W6,G6,q6,$6,Y0,h3,j6,K6,Q6,G2,Y6,J6,X6,t8,a8,c8,r8,h8,e8,J0,l8,v8;(function(t){var a=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){t(c(a,c(r)))}):typeof X0=="object"&&typeof X0.exports=="object"?t(c(a,c(X0.exports))):t(c(a));function c(r,h){return r!==a&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(e,l){return r[e]=h?h(e,l):l}}})(function(t){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,e){h.__proto__=e}||function(h,e){for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(h[l]=e[l])};T6=function(h,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");a(h,e);function l(){this.constructor=h}h.prototype=e===null?Object.create(e):(l.prototype=e.prototype,new l)},I6=Object.assign||function(h){for(var e,l=1,v=arguments.length;l=0;o--)(g=h[o])&&(i=(n<3?g(i):n>3?g(e,l,i):g(e,l))||i);return n>3&&i&&Object.defineProperty(e,l,i),i},k6=function(h,e){return function(l,v){e(l,v,h)}},D6=function(h,e,l,v,n,i){function g(L){if(L!==void 0&&typeof L!="function")throw new TypeError("Function expected");return L}for(var o=v.kind,A=o==="getter"?"get":o==="setter"?"set":"value",m=!e&&h?v.static?h:h.prototype:null,z=e||(m?Object.getOwnPropertyDescriptor(m,v.name):{}),w,F=!1,O=l.length-1;O>=0;O--){var S={};for(var B in v)S[B]=B==="access"?{}:v[B];for(var B in v.access)S.access[B]=v.access[B];S.addInitializer=function(L){if(F)throw new TypeError("Cannot add initializers after decoration has completed");i.push(g(L||null))};var d=(0,l[O])(o==="accessor"?{get:z.get,set:z.set}:z[A],S);if(o==="accessor"){if(d===void 0)continue;if(d===null||typeof d!="object")throw new TypeError("Object expected");(w=g(d.get))&&(z.get=w),(w=g(d.set))&&(z.set=w),(w=g(d.init))&&n.unshift(w)}else(w=g(d))&&(o==="field"?n.unshift(w):z[A]=w)}m&&Object.defineProperty(m,v.name,z),F=!0},E6=function(h,e,l){for(var v=arguments.length>2,n=0;n0&&i[i.length-1])&&(m[0]===6||m[0]===2)){l=0;continue}if(m[0]===3&&(!i||m[1]>i[0]&&m[1]=h.length&&(h=void 0),{value:h&&h[v++],done:!h}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},h3=function(h,e){var l=typeof Symbol=="function"&&h[Symbol.iterator];if(!l)return h;var v=l.call(h),n,i=[],g;try{for(;(e===void 0||e-- >0)&&!(n=v.next()).done;)i.push(n.value)}catch(o){g={error:o}}finally{try{n&&!n.done&&(l=v.return)&&l.call(v)}finally{if(g)throw g.error}}return i},j6=function(){for(var h=[],e=0;e1||o(F,O)})})}function o(F,O){try{A(v[F](O))}catch(S){w(i[0][3],S)}}function A(F){F.value instanceof G2?Promise.resolve(F.value.v).then(m,z):w(i[0][2],F)}function m(F){o("next",F)}function z(F){o("throw",F)}function w(F,O){F(O),i.shift(),i.length&&o(i[0][0],i[0][1])}},J6=function(h){var e,l;return e={},v("next"),v("throw",function(n){throw n}),v("return"),e[Symbol.iterator]=function(){return this},e;function v(n,i){e[n]=h[n]?function(g){return(l=!l)?{value:G2(h[n](g)),done:!1}:i?i(g):g}:i}},X6=function(h){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=h[Symbol.asyncIterator],l;return e?e.call(h):(h=typeof Y0=="function"?Y0(h):h[Symbol.iterator](),l={},v("next"),v("throw"),v("return"),l[Symbol.asyncIterator]=function(){return this},l);function v(i){l[i]=h[i]&&function(g){return new Promise(function(o,A){g=h[i](g),n(o,A,g.done,g.value)})}}function n(i,g,o,A){Promise.resolve(A).then(function(m){i({value:m,done:o})},g)}},t8=function(h,e){return Object.defineProperty?Object.defineProperty(h,"raw",{value:e}):h.raw=e,h};var c=Object.create?function(h,e){Object.defineProperty(h,"default",{enumerable:!0,value:e})}:function(h,e){h.default=e};a8=function(h){if(h&&h.__esModule)return h;var e={};if(h!=null)for(var l in h)l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)&&J0(e,h,l);return c(e,h),e},c8=function(h){return h&&h.__esModule?h:{default:h}},r8=function(h,e,l,v){if(l==="a"&&!v)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?h!==e||!v:!e.has(h))throw new TypeError("Cannot read private member from an object whose class did not declare it");return l==="m"?v:l==="a"?v.call(h):v?v.value:e.get(h)},h8=function(h,e,l,v,n){if(v==="m")throw new TypeError("Private method is not writable");if(v==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?h!==e||!n:!e.has(h))throw new TypeError("Cannot write private member to an object whose class did not declare it");return v==="a"?n.call(h,l):n?n.value=l:e.set(h,l),l},e8=function(h,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof h=="function"?e===h:h.has(e)},l8=function(h,e,l){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var v;if(l){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");v=e[Symbol.asyncDispose]}if(v===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");v=e[Symbol.dispose]}if(typeof v!="function")throw new TypeError("Object not disposable.");h.stack.push({value:e,dispose:v,async:l})}else l&&h.stack.push({async:!0});return e};var r=typeof SuppressedError=="function"?SuppressedError:function(h,e,l){var v=new Error(l);return v.name="SuppressedError",v.error=h,v.suppressed=e,v};v8=function(h){function e(v){h.error=h.hasError?new r(v,h.error,"An error was suppressed during disposal."):v,h.hasError=!0}function l(){for(;h.stack.length;){var v=h.stack.pop();try{var n=v.dispose&&v.dispose.call(v.value);if(v.async)return Promise.resolve(n).then(l,function(i){return e(i),l()})}catch(i){e(i)}}if(h.hasError)throw h.error}return l()},t("__extends",T6),t("__assign",I6),t("__rest",_6),t("__decorate",P6),t("__param",k6),t("__esDecorate",D6),t("__runInitializers",E6),t("__propKey",N6),t("__setFunctionName",U6),t("__metadata",W6),t("__awaiter",G6),t("__generator",q6),t("__exportStar",$6),t("__createBinding",J0),t("__values",Y0),t("__read",h3),t("__spread",j6),t("__spreadArrays",K6),t("__spreadArray",Q6),t("__await",G2),t("__asyncGenerator",Y6),t("__asyncDelegator",J6),t("__asyncValues",X6),t("__makeTemplateObject",t8),t("__importStar",a8),t("__importDefault",c8),t("__classPrivateFieldGet",r8),t("__classPrivateFieldSet",h8),t("__classPrivateFieldIn",e8),t("__addDisposableResource",l8),t("__disposeResources",v8)})});var u8=A2(v3=>{"use strict";v3.__esModule=!0;v3.default=function(t,a){if(t&&a){var c=Array.isArray(a)?a:a.split(","),r=t.name||"",h=(t.type||"").toLowerCase(),e=h.replace(/\/.*$/,"");return c.some(function(l){var v=l.trim().toLowerCase();return v.charAt(0)==="."?r.toLowerCase().endsWith(v):v.endsWith("/*")?e===v.replace(/\/.*$/,""):h===v})}return!0}});var Q8=A2((T3,I3)=>{(function(t,a){typeof T3=="object"&&typeof I3!="undefined"?I3.exports=a():typeof define=="function"&&define.amd?define(a):(t=typeof globalThis!="undefined"?globalThis:t||self).dayjs=a()})(T3,function(){"use strict";var t=1e3,a=6e4,c=36e5,r="millisecond",h="second",e="minute",l="hour",v="day",n="week",i="month",g="quarter",o="year",A="date",m="Invalid Date",z=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,F={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(D){var _=["th","st","nd","rd"],y=D%100;return"["+D+(_[(y-20)%10]||_[y]||_[0])+"]"}},O=function(D,_,y){var I=String(D);return!I||I.length>=_?D:""+Array(_+1-I.length).join(y)+D},S={s:O,z:function(D){var _=-D.utcOffset(),y=Math.abs(_),I=Math.floor(y/60),R=y%60;return(_<=0?"+":"-")+O(I,2,"0")+":"+O(R,2,"0")},m:function D(_,y){if(_.date()1)return D(G[0])}else{var a1=_.name;d[a1]=_,R=a1}return!I&&R&&(B=R),R||!I&&B},C=function(D,_){if(L(D))return D.clone();var y=typeof _=="object"?_:{};return y.date=D,y.args=arguments,new k(y)},P=S;P.l=b,P.i=L,P.w=function(D,_){return C(D,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var k=function(){function D(y){this.$L=b(y.locale,null,!0),this.parse(y)}var _=D.prototype;return _.parse=function(y){this.$d=function(I){var R=I.date,W=I.utc;if(R===null)return new Date(NaN);if(P.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var G=R.match(z);if(G){var a1=G[2]-1||0,v1=(G[7]||"0").substring(0,3);return W?new Date(Date.UTC(G[1],a1,G[3]||1,G[4]||0,G[5]||0,G[6]||0,v1)):new Date(G[1],a1,G[3]||1,G[4]||0,G[5]||0,G[6]||0,v1)}}return new Date(R)}(y),this.$x=y.x||{},this.init()},_.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},_.$utils=function(){return P},_.isValid=function(){return this.$d.toString()!==m},_.isSame=function(y,I){var R=C(y);return this.startOf(I)<=R&&R<=this.endOf(I)},_.isAfter=function(y,I){return C(y){"use strict";Object.defineProperty(N4,"__esModule",{value:!0});N4.LocalStorageHandler=void 0;var zv=function(){function t(a){var c=this;this.getTimeStampKey=function(h){return h+"-timestamp"},this.getFromLocalStorage=function(h){var e=h.key,l=h.checkCacheHours,v=h.cacheHours,n=localStorage.getItem(e),i=localStorage.getItem(c.getTimeStampKey(e));if(l!==void 0&&!l)return n;if(v&&(c.cacheHours=v),i!==null){var g=new Date(JSON.parse(i)),o=Math.abs(new Date().getTime()-g.getTime())/36e5;if(oZ5,eventTypes:()=>y1});var B2=U1(require("obsidian"));var F9=U1(require("obsidian"));var g0,j,P5,N9,S2,k5,D5,U4,E5,E2={},N5=[],U9=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,U0=Array.isArray;function o2(t,a){for(var c in a)t[c]=a[c];return t}function U5(t){var a=t.parentNode;a&&a.removeChild(t)}function t2(t,a,c){var r,h,e,l={};for(e in a)e=="key"?r=a[e]:e=="ref"?h=a[e]:l[e]=a[e];if(arguments.length>2&&(l.children=arguments.length>3?g0.call(arguments,2):c),typeof t=="function"&&t.defaultProps!=null)for(e in t.defaultProps)l[e]===void 0&&(l[e]=t.defaultProps[e]);return d0(t,l,r,h,null)}function d0(t,a,c,r,h){var e={type:t,props:a,key:c,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:h??++P5};return h==null&&j.vnode!=null&&j.vnode(e),e}function W4(){return{current:null}}function Q1(t){return t.children}function Y1(t,a){this.props=t,this.context=a}function W0(t,a){if(a==null)return t.__?W0(t.__,t.__.__k.indexOf(t)+1):null;for(var c;aa&&S2.sort(U4));G0.__r=0}function G5(t,a,c,r,h,e,l,v,n,i,g){var o,A,m,z,w,F,O,S,B,d,L=0,b=r&&r.__k||N5,C=b.length,P=C,k=a.length;for(c.__k=[],o=0;o0?d0(z.type,z.props,z.key,z.ref?z.ref:null,z.__v):z)!=null&&(z.__=c,z.__b=c.__b+1,(S=W9(z,b,O=o+L,P))===-1?m=E2:(m=b[S]||E2,b[S]=void 0,P--),q4(t,z,m,h,e,l,v,n,i,g),w=z.__e,(A=z.ref)&&m.ref!=A&&(m.ref&&$4(m.ref,null,z),g.push(A,z.__c||w,z)),w!=null&&(F==null&&(F=w),d=!(B=m===E2||m.__v===null)&&S===O,B?S==-1&&L--:S!==O&&(S===O+1?(L++,d=!0):S>O?P>k-O?(L+=S-O,d=!0):L--:L=S(n!=null?1:0))for(;l>=0||v=0){if((n=a[l])&&h==n.key&&e===n.type)return l;l--}if(v2&&(v.children=arguments.length>3?g0.call(arguments,2):c),d0(t.type,v,r||t.key,h||t.ref,null)}function K4(t,a){var c={__c:a="__cC"+E5++,__:t,Consumer:function(r,h){return r.children(h)},Provider:function(r){var h,e;return this.getChildContext||(h=[],(e={})[a]=this,this.getChildContext=function(){return e},this.shouldComponentUpdate=function(l){this.props.value!==l.value&&h.some(function(v){v.__e=!0,G4(v)})},this.sub=function(l){h.push(l);var v=l.componentWillUnmount;l.componentWillUnmount=function(){h.splice(h.indexOf(l),1),v&&v.call(l)}}),r.children}};return c.Provider.__=c.Consumer.contextType=c}g0=N5.slice,j={__e:function(t,a,c,r){for(var h,e,l;a=a.__;)if((h=a.__c)&&!h.__)try{if((e=h.constructor)&&e.getDerivedStateFromError!=null&&(h.setState(e.getDerivedStateFromError(t)),l=h.__d),h.componentDidCatch!=null&&(h.componentDidCatch(t,r||{}),l=h.__d),l)return h.__E=h}catch(v){t=v}throw t}},P5=0,N9=function(t){return t!=null&&t.constructor===void 0},Y1.prototype.setState=function(t,a){var c;c=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=o2({},this.state),typeof t=="function"&&(t=t(o2({},c),this.props)),t&&o2(c,t),t!=null&&this.__v&&(a&&this._sb.push(a),G4(this))},Y1.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),G4(this))},Y1.prototype.render=Q1,S2=[],D5=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,U4=function(t,a){return t.__v.__b-a.__v.__b},G0.__r=0,E5=0;var M2,B1,Q4,t6,U2=0,a6=[],$0=[],c6=j.__b,r6=j.__r,h6=j.diffed,e6=j.__c,l6=j.unmount;function W2(t,a){j.__h&&j.__h(B1,t,U2||a),U2=0;var c=B1.__H||(B1.__H={__:[],__h:[]});return t>=c.__.length&&c.__.push({__V:$0}),c.__[t]}function w1(t){return U2=1,z0(g6,t)}function z0(t,a,c){var r=W2(M2++,2);if(r.t=t,!r.__c&&(r.__=[c?c(a):g6(void 0,a),function(v){var n=r.__N?r.__N[0]:r.__[0],i=r.t(n,v);n!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=B1,!B1.u)){var h=function(v,n,i){if(!r.__c.__H)return!0;var g=r.__c.__H.__.filter(function(A){return A.__c});if(g.every(function(A){return!A.__N}))return!e||e.call(this,v,n,i);var o=!1;return g.forEach(function(A){if(A.__N){var m=A.__[0];A.__=A.__N,A.__N=void 0,m!==A.__[0]&&(o=!0)}}),!(!o&&r.__c.props===v)&&(!e||e.call(this,v,n,i))};B1.u=!0;var e=B1.shouldComponentUpdate,l=B1.componentWillUpdate;B1.componentWillUpdate=function(v,n,i){if(this.__e){var g=e;e=void 0,h(v,n,i),e=g}l&&l.call(this,v,n,i)},B1.shouldComponentUpdate=h}return r.__N||r.__}function m1(t,a){var c=W2(M2++,3);!j.__s&&J4(c.__H,a)&&(c.__=t,c.i=a,B1.__H.__h.push(c))}function s0(t,a){var c=W2(M2++,4);!j.__s&&J4(c.__H,a)&&(c.__=t,c.i=a,B1.__h.push(c))}function a2(t){return U2=5,k1(function(){return{current:t}},[])}function j0(t,a,c){U2=6,s0(function(){return typeof t=="function"?(t(a()),function(){return t(null)}):t?(t.current=a(),function(){return t.current=null}):void 0},c==null?c:c.concat(t))}function k1(t,a){var c=W2(M2++,7);return J4(c.__H,a)?(c.__V=t(),c.i=a,c.__h=t,c.__V):c.__}function _1(t,a){return U2=8,k1(function(){return t},a)}function v6(t){var a=B1.context[t.__c],c=W2(M2++,9);return c.c=t,a?(c.__==null&&(c.__=!0,a.sub(B1)),a.props.value):t.__}function n6(t,a){j.useDebugValue&&j.useDebugValue(a?a(t):t)}function i6(){var t=W2(M2++,11);if(!t.__){for(var a=B1.__v;a!==null&&!a.__m&&a.__!==null;)a=a.__;var c=a.__m||(a.__m=[0,0]);t.__="P"+c[0]+"-"+c[1]++}return t.__}function j9(){for(var t;t=a6.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(K0),t.__H.__h.forEach(Y4),t.__H.__h=[]}catch(a){t.__H.__h=[],j.__e(a,t.__v)}}j.__b=function(t){B1=null,c6&&c6(t)},j.__r=function(t){r6&&r6(t),M2=0;var a=(B1=t.__c).__H;a&&(Q4===B1?(a.__h=[],B1.__h=[],a.__.forEach(function(c){c.__N&&(c.__=c.__N),c.__V=$0,c.__N=c.i=void 0})):(a.__h.forEach(K0),a.__h.forEach(Y4),a.__h=[],M2=0)),Q4=B1},j.diffed=function(t){h6&&h6(t);var a=t.__c;a&&a.__H&&(a.__H.__h.length&&(a6.push(a)!==1&&t6===j.requestAnimationFrame||((t6=j.requestAnimationFrame)||K9)(j9)),a.__H.__.forEach(function(c){c.i&&(c.__H=c.i),c.__V!==$0&&(c.__=c.__V),c.i=void 0,c.__V=$0})),Q4=B1=null},j.__c=function(t,a){a.some(function(c){try{c.__h.forEach(K0),c.__h=c.__h.filter(function(r){return!r.__||Y4(r)})}catch(r){a.some(function(h){h.__h&&(h.__h=[])}),a=[],j.__e(r,c.__v)}}),e6&&e6(t,a)},j.unmount=function(t){l6&&l6(t);var a,c=t.__c;c&&c.__H&&(c.__H.__.forEach(function(r){try{K0(r)}catch(h){a=h}}),c.__H=void 0,a&&j.__e(a,c.__v))};var o6=typeof requestAnimationFrame=="function";function K9(t){var a,c=function(){clearTimeout(r),o6&&cancelAnimationFrame(a),setTimeout(t)},r=setTimeout(c,100);o6&&(a=requestAnimationFrame(c))}function K0(t){var a=B1,c=t.__c;typeof c=="function"&&(t.__c=void 0,c()),B1=a}function Y4(t){var a=B1;t.__c=t.__(),B1=a}function J4(t,a){return!t||t.length!==a.length||a.some(function(c,r){return c!==t[r]})}function g6(t,a){return typeof a=="function"?a(t):a}function d6(t,a){for(var c in a)t[c]=a[c];return t}function X4(t,a){for(var c in t)if(c!=="__source"&&!(c in a))return!0;for(var r in a)if(r!=="__source"&&t[r]!==a[r])return!0;return!1}function t3(t,a){return t===a&&(t!==0||1/t==1/a)||t!=t&&a!=a}function a3(t){this.props=t}function Q9(t,a){function c(h){var e=this.props.ref,l=e==h.ref;return!l&&e&&(e.call?e(null):e.current=null),a?!a(this.props,h)||!l:X4(this.props,h)}function r(h){return this.shouldComponentUpdate=c,t2(t,h)}return r.displayName="Memo("+(t.displayName||t.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(a3.prototype=new Y1).isPureReactComponent=!0,a3.prototype.shouldComponentUpdate=function(t,a){return X4(this.props,t)||X4(this.state,a)};var z6=j.__b;j.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),z6&&z6(t)};var Y9=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function c3(t){function a(c){var r=d6({},c);return delete r.ref,t(r,c.ref||null)}return a.$$typeof=Y9,a.render=a,a.prototype.isReactComponent=a.__f=!0,a.displayName="ForwardRef("+(t.displayName||t.name)+")",a}var s6=function(t,a){return t==null?null:e2(e2(t).map(a))},J9={map:s6,forEach:s6,count:function(t){return t?e2(t).length:0},only:function(t){var a=e2(t);if(a.length!==1)throw"Children.only";return a[0]},toArray:e2},X9=j.__e;j.__e=function(t,a,c,r){if(t.then){for(var h,e=a;e=e.__;)if((h=e.__c)&&h.__c)return a.__e==null&&(a.__e=c.__e,a.__k=c.__k),h.__c(t,a)}X9(t,a,c,r)};var u6=j.unmount;function p6(t,a,c){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),t.__c.__H=null),(t=d6({},t)).__c!=null&&(t.__c.__P===c&&(t.__c.__P=a),t.__c=null),t.__k=t.__k&&t.__k.map(function(r){return p6(r,a,c)})),t}function M6(t,a,c){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(r){return M6(r,a,c)}),t.__c&&t.__c.__P===a&&(t.__e&&c.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=c)),t}function Q0(){this.__u=0,this.t=null,this.__b=null}function H6(t){var a=t.__.__c;return a&&a.__a&&a.__a(t)}function tt(t){var a,c,r;function h(e){if(a||(a=t()).then(function(l){c=l.default||l},function(l){r=l}),r)throw r;if(!c)throw a;return t2(c,e)}return h.displayName="Lazy",h.__f=!0,h}function u0(){this.u=null,this.o=null}j.unmount=function(t){var a=t.__c;a&&a.__R&&a.__R(),a&&t.__h===!0&&(t.type=null),u6&&u6(t)},(Q0.prototype=new Y1).__c=function(t,a){var c=a.__c,r=this;r.t==null&&(r.t=[]),r.t.push(c);var h=H6(r.__v),e=!1,l=function(){e||(e=!0,c.__R=null,h?h(v):v())};c.__R=l;var v=function(){if(!--r.__u){if(r.state.__a){var i=r.state.__a;r.__v.__k[0]=M6(i,i.__c.__P,i.__c.__O)}var g;for(r.setState({__a:r.__b=null});g=r.t.pop();)g.forceUpdate()}},n=a.__h===!0;r.__u++||n||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(l,l)},Q0.prototype.componentWillUnmount=function(){this.t=[]},Q0.prototype.render=function(t,a){if(this.__b){if(this.__v.__k){var c=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=p6(this.__b,c,r.__O=r.__P)}this.__b=null}var h=a.__a&&t2(Q1,null,t.fallback);return h&&(h.__h=null),[t2(Q1,null,a.__a?null:t.children),h]};var f6=function(t,a,c){if(++c[1]===c[0]&&t.o.delete(a),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.o.size))for(c=t.u;c;){for(;c.length>3;)c.pop()();if(c[1]>>1,1),a.i.removeChild(r)}}),N2(t2(at,{context:a.context},t.__v),a.l)):a.l&&a.componentWillUnmount()}function rt(t,a){var c=t2(ct,{__v:t,i:a});return c.containerInfo=a,c}(u0.prototype=new Y1).__a=function(t){var a=this,c=H6(a.__v),r=a.o.get(t);return r[0]++,function(h){var e=function(){a.props.revealOrder?(r.push(h),f6(a,t,r)):h()};c?c(e):e()}},u0.prototype.render=function(t){this.u=null,this.o=new Map;var a=e2(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&a.reverse();for(var c=a.length;c--;)this.o.set(a[c],this.u=[1,0,this.u]);return t.children},u0.prototype.componentDidUpdate=u0.prototype.componentDidMount=function(){var t=this;this.o.forEach(function(a,c){f6(t,c,a)})};var x6=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,ht=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,et=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,lt=/[A-Z0-9]/g,vt=typeof document!="undefined",nt=function(t){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function it(t,a,c){return a.__k==null&&(a.textContent=""),N2(t,a),typeof c=="function"&&c(),t?t.__c:null}function ot(t,a,c){return j4(t,a),typeof c=="function"&&c(),t?t.__c:null}Y1.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(Y1.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(a){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:a})}})});var V6=j.event;function gt(){}function dt(){return this.cancelBubble}function zt(){return this.defaultPrevented}j.event=function(t){return V6&&(t=V6(t)),t.persist=gt,t.isPropagationStopped=dt,t.isDefaultPrevented=zt,t.nativeEvent=t};var r3,st={enumerable:!1,configurable:!0,get:function(){return this.class}},m6=j.vnode;j.vnode=function(t){typeof t.type=="string"&&function(a){var c=a.props,r=a.type,h={};for(var e in c){var l=c[e];if(!(e==="value"&&"defaultValue"in c&&l==null||vt&&e==="children"&&r==="noscript"||e==="class"||e==="className")){var v=e.toLowerCase();e==="defaultValue"&&"value"in c&&c.value==null?e="value":e==="download"&&l===!0?l="":v==="ondoubleclick"?e="ondblclick":v!=="onchange"||r!=="input"&&r!=="textarea"||nt(c.type)?v==="onfocus"?e="onfocusin":v==="onblur"?e="onfocusout":et.test(e)?e=v:r.indexOf("-")===-1&&ht.test(e)?e=e.replace(lt,"-$&").toLowerCase():l===null&&(l=void 0):v=e="oninput",v==="oninput"&&h[e=v]&&(e="oninputCapture"),h[e]=l}}r=="select"&&h.multiple&&Array.isArray(h.value)&&(h.value=e2(c.children).forEach(function(n){n.props.selected=h.value.indexOf(n.props.value)!=-1})),r=="select"&&h.defaultValue!=null&&(h.value=e2(c.children).forEach(function(n){n.props.selected=h.multiple?h.defaultValue.indexOf(n.props.value)!=-1:h.defaultValue==n.props.value})),c.class&&!c.className?(h.class=c.class,Object.defineProperty(h,"className",st)):(c.className&&!c.class||c.class&&c.className)&&(h.class=h.className=c.className),a.props=h}(t),t.$$typeof=x6,m6&&m6(t)};var C6=j.__r;j.__r=function(t){C6&&C6(t),r3=t.__c};var L6=j.diffed;j.diffed=function(t){L6&&L6(t);var a=t.props,c=t.__e;c!=null&&t.type==="textarea"&&"value"in a&&a.value!==c.value&&(c.value=a.value==null?"":a.value),r3=null};var ut={ReactCurrentDispatcher:{current:{readContext:function(t){return r3.__n[t.__c].props.value}}}};function pt(t){return t2.bind(null,t)}function B6(t){return!!t&&t.$$typeof===x6}function Mt(t){return B6(t)?X5.apply(null,arguments):t}function Ht(t){return!!t.__k&&(N2(null,t),!0)}function ft(t){return t&&(t.base||t.nodeType===1&&t)||null}var xt=function(t,a){return t(a)},Vt=function(t,a){return t(a)},mt=Q1;function w6(t){t()}function Ct(t){return t}function Lt(){return[!1,w6]}var Bt=s0;function wt(t,a){var c=a(),r=w1({h:{__:c,v:a}}),h=r[0].h,e=r[1];return s0(function(){h.__=c,h.v=a,t3(h.__,a())||e({h})},[t,c,a]),m1(function(){return t3(h.__,h.v())||e({h}),t(function(){t3(h.__,h.v())||e({h})})},[t]),c}var H={useState:w1,useId:i6,useReducer:z0,useEffect:m1,useLayoutEffect:s0,useInsertionEffect:Bt,useTransition:Lt,useDeferredValue:Ct,useSyncExternalStore:wt,startTransition:w6,useRef:a2,useImperativeHandle:j0,useMemo:k1,useCallback:_1,useContext:v6,useDebugValue:n6,version:"17.0.2",Children:J9,render:it,hydrate:ot,unmountComponentAtNode:Ht,createPortal:rt,createElement:t2,createContext:K4,createFactory:pt,cloneElement:Mt,createRef:W4,Fragment:Q1,isValidElement:B6,findDOMNode:ft,Component:Y1,PureComponent:a3,memo:Q9,forwardRef:c3,flushSync:Vt,unstable_batchedUpdates:xt,StrictMode:mt,Suspense:Q0,SuspenseList:u0,lazy:tt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ut};var i2=U1(require("obsidian"));var C1=U1(b6());var i8=U1(n8()),{__extends:Tv,__assign:Iv,__rest:_v,__decorate:Pv,__param:kv,__esDecorate:Dv,__runInitializers:Ev,__propKey:Nv,__setFunctionName:Uv,__metadata:Wv,__awaiter:F2,__generator:y2,__exportStar:Gv,__createBinding:qv,__values:$v,__read:jv,__spread:o8,__spreadArrays:Kv,__spreadArray:Qv,__await:Yv,__asyncGenerator:Jv,__asyncDelegator:Xv,__asyncValues:tn,__makeTemplateObject:an,__importStar:cn,__importDefault:rn,__classPrivateFieldGet:hn,__classPrivateFieldSet:en,__classPrivateFieldIn:ln,__addDisposableResource:vn,__disposeResources:nn}=i8.default;var Ft=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function q2(t,a){var c=yt(t);if(typeof c.path!="string"){var r=t.webkitRelativePath;Object.defineProperty(c,"path",{value:typeof a=="string"?a:typeof r=="string"&&r.length>0?r:t.name,writable:!1,configurable:!1,enumerable:!0})}return c}function yt(t){var a=t.name,c=a&&a.lastIndexOf(".")!==-1;if(c&&!t.type){var r=a.split(".").pop().toLowerCase(),h=Ft.get(r);h&&Object.defineProperty(t,"type",{value:h,writable:!1,configurable:!1,enumerable:!0})}return t}var Ot=[".DS_Store","Thumbs.db"];function e3(t){return F2(this,void 0,void 0,function(){return y2(this,function(a){return t4(t)&&Rt(t)?[2,It(t.dataTransfer,t.type)]:Zt(t)?[2,bt(t)]:Array.isArray(t)&&t.every(function(c){return"getFile"in c&&typeof c.getFile=="function"})?[2,Tt(t)]:[2,[]]})})}function Rt(t){return t4(t.dataTransfer)}function Zt(t){return t4(t)&&t4(t.target)}function t4(t){return typeof t=="object"&&t!==null}function bt(t){return l3(t.target.files).map(function(a){return q2(a)})}function Tt(t){return F2(this,void 0,void 0,function(){var a;return y2(this,function(c){switch(c.label){case 0:return[4,Promise.all(t.map(function(r){return r.getFile()}))];case 1:return a=c.sent(),[2,a.map(function(r){return q2(r)})]}})})}function It(t,a){return F2(this,void 0,void 0,function(){var c,r;return y2(this,function(h){switch(h.label){case 0:return t===null?[2,[]]:t.items?(c=l3(t.items).filter(function(e){return e.kind==="file"}),a!=="drop"?[2,c]:[4,Promise.all(c.map(_t))]):[3,2];case 1:return r=h.sent(),[2,g8(d8(r))];case 2:return[2,g8(l3(t.files).map(function(e){return q2(e)}))]}})})}function g8(t){return t.filter(function(a){return Ot.indexOf(a.name)===-1})}function l3(t){if(t===null)return[];for(var a=[],c=0;ct.length)&&(a=t.length);for(var c=0,r=new Array(a);cc)return[!1,m8(c)];if(t.sizec)return[!1,m8(c)]}return[!0,null]}function p0(t){return t!=null}function B8(t){var a=t.files,c=t.accept,r=t.minSize,h=t.maxSize,e=t.multiple,l=t.maxFiles;return!e&&a.length>1||e&&l>=1&&a.length>l?!1:a.every(function(v){var n=n3(v,c),i=f8(n,1),g=i[0],o=i3(v,r,h),A=f8(o,1),m=A[0];return g&&m})}function M0(t){return typeof t.isPropagationStopped=="function"?t.isPropagationStopped():typeof t.cancelBubble!="undefined"?t.cancelBubble:!1}function H0(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,function(a){return a==="Files"||a==="application/x-moz-file"}):!!t.target&&!!t.target.files}function o3(t){t.preventDefault()}function Kt(t){return t.indexOf("MSIE")!==-1||t.indexOf("Trident/")!==-1}function Qt(t){return t.indexOf("Edge/")!==-1}function w8(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Kt(t)||Qt(t)}function c2(){for(var t=arguments.length,a=new Array(t),c=0;c1?h-1:0),l=1;lt.length)&&(a=t.length);for(var c=0,r=new Array(a);c=0)&&(!Object.prototype.propertyIsEnumerable.call(t,r)||(c[r]=t[r]))}return c}function na(t,a){if(t==null)return{};var c={},r=Object.keys(t),h,e;for(e=0;e=0)&&(c[h]=t[h]);return c}var c4=c3(function(t,a){var c=t.children,r=a4(t,Yt),h=ia(r),e=h.open,l=a4(h,Jt);return j0(a,function(){return{open:e}},[e]),H.createElement(Q1,null,c(S1(S1({},l),{},{open:e})))});c4.displayName="Dropzone";var y8={disabled:!1,getFilesFromEvent:e3,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1};c4.defaultProps=y8;c4.propTypes={children:C1.default.func,accept:C1.default.oneOfType([C1.default.string,C1.default.arrayOf(C1.default.string)]),multiple:C1.default.bool,preventDropOnDocument:C1.default.bool,noClick:C1.default.bool,noKeyboard:C1.default.bool,noDrag:C1.default.bool,noDragEventsBubbling:C1.default.bool,minSize:C1.default.number,maxSize:C1.default.number,maxFiles:C1.default.number,disabled:C1.default.bool,getFilesFromEvent:C1.default.func,onFileDialogCancel:C1.default.func,onFileDialogOpen:C1.default.func,useFsAccessApi:C1.default.bool,onDragEnter:C1.default.func,onDragLeave:C1.default.func,onDragOver:C1.default.func,onDrop:C1.default.func,onDropAccepted:C1.default.func,onDropRejected:C1.default.func,validator:C1.default.func};var r4=c4,u3={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function ia(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=S1(S1({},y8),t),c=a.accept,r=a.disabled,h=a.getFilesFromEvent,e=a.maxSize,l=a.minSize,v=a.multiple,n=a.maxFiles,i=a.onDragEnter,g=a.onDragLeave,o=a.onDragOver,A=a.onDrop,m=a.onDropAccepted,z=a.onDropRejected,w=a.onFileDialogCancel,F=a.onFileDialogOpen,O=a.useFsAccessApi,S=a.preventDropOnDocument,B=a.noClick,d=a.noKeyboard,L=a.noDrag,b=a.noDragEventsBubbling,C=a.validator,P=k1(function(){return typeof F=="function"?F:O8},[F]),k=k1(function(){return typeof w=="function"?w:O8},[w]),Q=a2(null),D=a2(null),_=z0(oa,u3),y=d3(_,2),I=y[0],R=y[1],W=I.isFocused,G=I.isFileDialogActive,a1=I.draggedFiles,v1=function(){G&&setTimeout(function(){if(D.current){var c1=D.current.files;c1.length||(R({type:"closeDialog"}),k())}},300)};m1(function(){return O&&g3()?function(){}:(window.addEventListener("focus",v1,!1),function(){window.removeEventListener("focus",v1,!1)})},[D,G,k,O]);var r1=a2([]),u1=function(c1){Q.current&&Q.current.contains(c1.target)||(c1.preventDefault(),r1.current=[])};m1(function(){return S&&(document.addEventListener("dragover",o3,!1),document.addEventListener("drop",u1,!1)),function(){S&&(document.removeEventListener("dragover",o3),document.removeEventListener("drop",u1))}},[Q,S]);var $=_1(function(U){U.preventDefault(),U.persist(),i1(U),r1.current=[].concat(aa(r1.current),[U.target]),H0(U)&&Promise.resolve(h(U)).then(function(c1){M0(U)&&!b||(R({draggedFiles:c1,isDragActive:!0,type:"setDraggedFiles"}),i&&i(U))})},[h,i,b]),s1=_1(function(U){U.preventDefault(),U.persist(),i1(U);var c1=H0(U);if(c1&&U.dataTransfer)try{U.dataTransfer.dropEffect="copy"}catch(b1){}return c1&&o&&o(U),!1},[o,b]),e1=_1(function(U){U.preventDefault(),U.persist(),i1(U);var c1=r1.current.filter(function(T1){return Q.current&&Q.current.contains(T1)}),b1=c1.indexOf(U.target);b1!==-1&&c1.splice(b1,1),r1.current=c1,!(c1.length>0)&&(R({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),H0(U)&&g&&g(U))},[Q,g,b]),u=_1(function(U,c1){var b1=[],T1=[];U.forEach(function(N1){var w2=n3(N1,c),u2=d3(w2,2),r0=u2[0],h0=u2[1],e0=i3(N1,l,e),P2=d3(e0,2),k2=P2[0],l0=P2[1],v0=C?C(N1):null;if(r0&&k2&&!v0)b1.push(N1);else{var p=[h0,l0];v0&&(p=p.concat(v0)),T1.push({file:N1,errors:p.filter(function(s){return s})})}}),(!v&&b1.length>1||v&&n>=1&&b1.length>n)&&(b1.forEach(function(N1){T1.push({file:N1,errors:[L8]})}),b1.splice(0)),R({acceptedFiles:b1,fileRejections:T1,type:"setFiles"}),A&&A(b1,T1,c1),T1.length>0&&z&&z(T1,c1),b1.length>0&&m&&m(b1,c1)},[R,v,c,l,e,n,A,m,z,C]),x=_1(function(U){U.preventDefault(),U.persist(),i1(U),r1.current=[],H0(U)&&Promise.resolve(h(U)).then(function(c1){M0(U)&&!b||u(c1,U)}),R({type:"reset"})},[h,u,b]),V=_1(function(){if(O&&g3()){R({type:"openDialog"}),P();var U={multiple:v,types:A8(c)};window.showOpenFilePicker(U).then(function(c1){return h(c1)}).then(function(c1){return u(c1,null)}).catch(function(c1){return k(c1)}).finally(function(){return R({type:"closeDialog"})});return}D.current&&(R({type:"openDialog"}),P(),D.current.value=null,D.current.click())},[R,P,k,O,u,c,v]),T=_1(function(U){!Q.current||!Q.current.isEqualNode(U.target)||(U.keyCode===32||U.keyCode===13)&&(U.preventDefault(),V())},[Q,D,V]),M=_1(function(){R({type:"focus"})},[]),f=_1(function(){R({type:"blur"})},[]),K=_1(function(){B||(w8()?setTimeout(V,0):V())},[D,B,V]),h1=function(c1){return r?null:c1},n1=function(c1){return d?null:h1(c1)},p1=function(c1){return L?null:h1(c1)},i1=function(c1){b&&c1.stopPropagation()},t1=k1(function(){return function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c1=U.refKey,b1=c1===void 0?"ref":c1,T1=U.role,N1=U.onKeyDown,w2=U.onFocus,u2=U.onBlur,r0=U.onClick,h0=U.onDragEnter,e0=U.onDragOver,P2=U.onDragLeave,k2=U.onDrop,l0=a4(U,Xt);return S1(S1(s3({onKeyDown:n1(c2(N1,T)),onFocus:n1(c2(w2,M)),onBlur:n1(c2(u2,f)),onClick:h1(c2(r0,K)),onDragEnter:p1(c2(h0,$)),onDragOver:p1(c2(e0,s1)),onDragLeave:p1(c2(P2,e1)),onDrop:p1(c2(k2,x)),role:typeof T1=="string"&&T1!==""?T1:"button"},b1,Q),!r&&!d?{tabIndex:0}:{}),l0)}},[Q,T,M,f,K,$,s1,e1,x,d,L,r]),D1=_1(function(U){U.stopPropagation()},[]),Z1=k1(function(){return function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c1=U.refKey,b1=c1===void 0?"ref":c1,T1=U.onChange,N1=U.onClick,w2=a4(U,ta),u2=s3({accept:c,multiple:v,type:"file",style:{display:"none"},onChange:h1(c2(T1,x)),onClick:h1(c2(N1,D1)),autoComplete:"off",tabIndex:-1},b1,D);return S1(S1({},u2),w2)}},[D,c,v,x,r]),E1=a1.length,R1=E1>0&&B8({files:a1,accept:c,minSize:l,maxSize:e,multiple:v,maxFiles:n}),s2=E1>0&&!R1;return S1(S1({},I),{},{isDragAccept:R1,isDragReject:s2,isFocused:W&&!r,getRootProps:t1,getInputProps:Z1,rootRef:Q,inputRef:D,open:h1(V)})}function oa(t,a){switch(a.type){case"focus":return S1(S1({},t),{},{isFocused:!0});case"blur":return S1(S1({},t),{},{isFocused:!1});case"openDialog":return S1(S1({},u3),{},{isFileDialogActive:!0});case"closeDialog":return S1(S1({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":var c=a.isDragActive,r=a.draggedFiles;return S1(S1({},t),{},{draggedFiles:r,isDragActive:c});case"setFiles":return S1(S1({},t),{},{acceptedFiles:a.acceptedFiles,fileRejections:a.fileRejections});case"reset":return S1({},u3);default:return t}}function O8(){}var A5=U1(require("obsidian"));var p3={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},M3=H.createContext&&H.createContext(p3);var H2=function(){return H2=Object.assign||function(t){for(var a,c=1,r=arguments.length;cH.createElement("svg",p2(q1({},t),{viewBox:"64 -65 897 897"}),H.createElement("g",null,H.createElement("path",{d:`M888 760v0v0v-753v0h-752v0v753v0h752zM888 832h-752q-30 0 -51 -21t-21 -51v-753q0 -29 21 -50.5t51 -21.5h753q29 0 50.5 21.5t21.5 50.5v753q0 30 -21.5 51t-51.5 21v0zM732 347h-442q-14 0 -25 10.5t-11 25.5v0q0 15 11 25.5t25 10.5h442q14 0 25 -10.5t11 -25.5v0 q0 -15 -11 -25.5t-25 -10.5z`}))),sa=t=>H.createElement("svg",p2(q1({},t),{viewBox:"64 -65 897 897"}),H.createElement("g",null,H.createElement("path",{d:`M888 760v0v0v-753v0h-752v0v753v0h752zM888 832h-752q-30 0 -51 -21t-21 -51v-753q0 -29 21 -50.5t51 -21.5h753q29 0 50.5 21.5t21.5 50.5v753q0 30 -21.5 51t-51.5 21v0zM732 420h-184v183q0 15 -10.5 25.5t-25.5 10.5v0q-14 0 -25 -10.5t-11 -25.5v-183h-184 q-15 0 -25.5 -11t-10.5 -25v0q0 -15 10.5 -25.5t25.5 -10.5h184v-183q0 -15 11 -25.5t25 -10.5v0q15 0 25.5 10.5t10.5 25.5v183h184q15 0 25.5 10.5t10.5 25.5v0q0 14 -10.5 25t-25.5 11z`})));var ua=t=>H.createElement("svg",p2(q1({},t),{viewBox:"64 -65 897 897"}),H.createElement("g",null,H.createElement("path",{d:`M717.5 589.5q-10.5 10.5 -25.5 10.5t-26 -10l-154 -155l-154 155q-11 10 -26 10t-25.5 -10.5t-10.5 -25.5t11 -25l154 -155l-154 -155q-11 -10 -11 -25t10.5 -25.5t25.5 -10.5t26 10l154 155l154 -155q11 -10 26 -10t25.5 10.5t10.5 25t-11 25.5l-154 155l154 155 q11 10 11 25t-10.5 25.5zM888 760v0v0v-753v0h-752v0v753v0h752zM888 832h-752q-30 0 -51 -21t-21 -51v-753q0 -29 21 -50.5t51 -21.5h753q29 0 50.5 21.5t21.5 50.5v753q0 30 -21.5 51t-51.5 21v0z`}))),U8='',W8='',G8='',q8='',$8='',j8=(t,a,c)=>{let r=t.settings.folderIcon,h=za,e=ua,l=sa;return r==="box-folder"?(h=Z8,e=T8,l=b8):r==="icomoon"?(h=P8,e=I8,l=_8):r==="typicon"?(h=k8,e=x3,l=x3):r==="circle-gg"&&(h=N8,e=E8,l=D8),a?c?h:l:e};var f2=U1(require("obsidian"));var d2=U1(require("obsidian"));var pa=function(){function t(a,c){for(var r=0;r1?l-1:0),n=1;n0&&Array.isArray(r[0])&&(r=r[0]),this.transformers=r.map(function(e){return typeof e=="function"?e():e}),this.tag}return pa(t,[{key:"interimTag",value:function(c,r){for(var h=arguments.length,e=Array(h>2?h-2:0),l=2;l0&&arguments[0]!==void 0?arguments[0]:"";return{onEndResult:function(r){if(a==="")return r.trim();if(a=a.toLowerCase(),a==="start"||a==="left")return r.replace(/^\s*/,"");if(a==="end"||a==="right")return r.replace(/\s*$/,"");throw new Error("Side not supported: "+a)}}},f1=Va;function ma(t){if(Array.isArray(t)){for(var a=0,c=Array(t.length);a0&&arguments[0]!==void 0?arguments[0]:"initial";return{onEndResult:function(r){if(a==="initial"){var h=r.match(/^[^\S\n]*(?=\S)/gm),e=h&&Math.min.apply(Math,ma(h.map(function(v){return v.length})));if(e){var l=new RegExp("^.{"+e+"}","gm");return r.replace(l,"")}return r}if(a==="all")return r.replace(/^[^\S\n]+/gm,"");throw new Error("Unknown type: "+a)}}},P1=Ca;var La=function(a,c){return{onEndResult:function(h){if(a==null||c==null)throw new Error("replaceResultTransformer requires at least 2 arguments.");return h.replace(a,c)}}},G1=La;var Ba=function(a,c){return{onSubstitution:function(h,e){if(a==null||c==null)throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");return h==null?h:h.toString().replace(a,c)}}},g2=Ba;var Aa={separator:"",conjunction:"",serial:!1},Sa=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Aa;return{onSubstitution:function(r,h){if(Array.isArray(r)){var e=r.length,l=a.separator,v=a.conjunction,n=a.serial,i=h.match(/(\n?[^\S\n]+)$/);if(i?r=r.join(l+i[1]):r=r.join(l+" "),v&&e>1){var g=r.lastIndexOf(l);r=r.slice(0,g)+(n?l:"")+" "+v+r.slice(g+1)}}return r}}},F1=Sa;var Fa=function(a){return{onSubstitution:function(r,h){if(a!=null&&typeof a=="string")typeof r=="string"&&r.includes(a)&&(r=r.split(a));else throw new Error("You need to specify a string character to split by.");return r}}},$2=Fa;var K8=function(a){return a!=null&&!Number.isNaN(a)&&typeof a!="boolean"},ya=function(){return{onSubstitution:function(c){return Array.isArray(c)?c.filter(K8):K8(c)?c:""}}},h4=ya;var Di=new H1(F1({separator:","}),P1,f1);var ji=new H1(F1({separator:",",conjunction:"and"}),P1,f1);var co=new H1(F1({separator:",",conjunction:"or"}),P1,f1);var zo=new H1($2(` `),h4,F1,P1,f1);var Ao=new H1($2(` `),F1,P1,f1,g2(/&/g,"&"),g2(//g,">"),g2(/"/g,"""),g2(/'/g,"'"),g2(/`/g,"`"));var bo=new H1(G1(/(?:\n(?:\s*))+/g," "),f1);var Eo=new H1(G1(/(?:\n\s*)/g,""),f1);var Ko=new H1(F1({separator:","}),G1(/(?:\s+)/g," "),f1);var rg=new H1(F1({separator:",",conjunction:"or"}),G1(/(?:\s+)/g," "),f1);var gg=new H1(F1({separator:",",conjunction:"and"}),G1(/(?:\s+)/g," "),f1);var fg=new H1(F1,P1,f1);var Ag=new H1(F1,G1(/(?:\s+)/g," "),f1);var bg=new H1(P1,f1);var Ua=new H1(P1("all"),f1),e4=Ua;var Y8=U1(Q8());var O2=(t,a,c)=>{var r=[],h=c?!0:a.settings.showFilesFromSubFolders;e(t,a.app);function e(l,v){var n=v.vault.getAbstractFileByPath(l);if(n instanceof d2.TFolder&&n.children)for(let i of n.children)i instanceof d2.TFile&&r.push(i),i instanceof d2.TFolder&&h&&e(i.path,v)}return r},_3=t=>{let a={folder:t,children:[]};function c(r,h){if(!!(r&&r.children)){for(let e of r.children)if(e instanceof d2.TFolder){let l=e,v={folder:l,children:[]};h.children.push(v),l.children&&c(l,v)}}}return c(t,a),a},P3=t=>{let a={},c;return t.settings.folderCountOption==="notes"?c=t.app.vault.getMarkdownFiles():c=t.app.vault.getFiles(),t.settings.folderNote&&(c=c.filter(r=>r.extension!=="md"||r.extension==="md"&&r.basename!==r.parent.name)),c.forEach(r=>{for(let h=r.parent;h!=null;h=h.parent)a[h.path]||(a[h.path]={open:0,closed:0}),h==r.parent&&(a[h.path].open=1+a[h.path].open),a[h.path].closed=1+a[h.path].closed}),a},J8=t=>{let a=t.children;for(let c of a)if(c instanceof d2.TFolder)return!0;return!1},l4=t=>{var a=t.lastIndexOf(".");return{fileName:t.substring(0,a),extension:t.substring(a+1)}};var v4=(t,a)=>{if(t==="/")return a.vault.getName();let c=t.lastIndexOf("/");return c!==-1?t.substring(c+1):t},n4=(t,a)=>{var c;return(c=a.internalPlugins.plugins[t])==null?void 0:c._loaded},V0=t=>{let{file:a,app:c,newLeaf:r,leafBySplit:h}=t,e=c.workspace.getLeaf(r);h&&(e=c.workspace.createLeafBySplit(e,"vertical")),c.workspace.setActiveLeaf(e,!1),e.openFile(a,{eState:{focus:!0}})};var k3=(t,a)=>{V0({file:a,app:t,newLeaf:!0})},X8=(t,a)=>{V0({file:a,app:t,newLeaf:!1,leafBySplit:!0})},t7=t=>{let{plugin:a,fileName:c}=t;return e4` ${a.settings.createdYaml?` --- created: ${(0,Y8.default)(new Date).format("YYYY-MM-DD hh:mm:ss")} --- `:""} ${a.settings.fileNameIsHeader?`# ${c}`:""} `},a7=(t,a)=>t.plugins.getPlugin(a),i4=(t,a,c,r)=>L1(void 0,null,function*(){let h=yield t.app.fileManager.createNewMarkdownFile(a,c);r&&r!==""&&(yield t.app.vault.modify(h,r)),V0({file:h,app:t.app,newLeaf:!1});let e=new CustomEvent(y1.activeFileChange,{detail:{filePath:h.path}});window.dispatchEvent(e)});var j2=(t,a,c)=>L1(void 0,null,function*(){let r=c.app.vault.getAbstractFileByPath(a);if(!r)return;new l2(c,r,"create note").open()});var m0=class extends f2.Modal{constructor(a,c,r){super(a.app);this.confirmationNote=c,this.callBackAfterConfirmation=r,this.plugin=a}onOpen(){let{contentEl:a}=this,c=this;a.createEl("div",{text:this.confirmationNote}).addClass("modal-title"),this.confirmButton=a.createEl("button",{text:"Confirm"});let h=a.createEl("button",{text:"Cancel"});h.style.cssText="float: right;",h.addEventListener("click",()=>{c.close()}),this.onConfirmClickAction=e=>{this.callBackAfterConfirmation(),this.close()},this.confirmButton.addEventListener("click",this.onConfirmClickAction)}onClose(){let{contentEl:a}=this;a.empty(),this.confirmButton.removeEventListener("click",this.onConfirmClickAction)}},l2=class extends f2.Modal{constructor(a,c,r){super(a.app);this.file=c,this.action=r,this.plugin=a}onOpen(){let{contentEl:a}=this,c=this,r;this.action==="rename"?r="Rename: Provide a New Name":this.action==="create folder"?r="Create Folder: Provide Name":this.action==="create note"&&(r="Create Note: Provide Name"),a.createEl("div",{text:r}).addClass("modal-title");let e=a.createEl("input");e.style.cssText="width: 100%; height: 2.5em; margin-bottom: 15px;",this.action==="rename"&&(this.file.name.endsWith(".md")?e.value=this.file.name.substring(0,this.file.name.lastIndexOf(".")):e.value=this.file.name),e.focus();let l;this.action==="rename"?l="Change Name":this.action==="create folder"?l="Create Folder":this.action==="create note"&&(l="Create Note");let v=a.createEl("button",{text:l}),n=a.createEl("button",{text:"Cancel"});n.style.cssText="float: right;",n.addEventListener("click",()=>{c.close()});let i=()=>L1(this,null,function*(){let g=e.value;if(this.action==="rename"){if(this.file.name.endsWith(".md")&&(g=g+".md"),this.file instanceof f2.TFolder&&this.plugin.settings.folderNote){let o=this.app.vault.getAbstractFileByPath(this.file.path+"/"+this.file.name+".md");o&&this.app.fileManager.renameFile(o,this.file.path+"/"+g+".md")}this.app.fileManager.renameFile(this.file,this.file.parent.path+"/"+g)}else this.action==="create folder"?this.app.vault.createFolder(this.file.path+"/"+g):this.action==="create note"&&(yield i4(this.plugin,this.file,g,this.plugin.settings.createdYaml?t7({plugin:this.plugin,fileName:g}):""));c.close()});v.addEventListener("click",i),e.addEventListener("keydown",g=>{g.key==="Enter"&&i()})}onClose(){let{contentEl:a}=this;a.empty()}},C0=class extends f2.FuzzySuggestModal{constructor(a,c){super(a);this.fileOrFolderToMove=c}getItemText(a){return a.path}getItems(){return Wa(this.app)}onChooseItem(a,c){this.app.vault.rename(this.fileOrFolderToMove,a.path+"/"+this.fileOrFolderToMove.name)}};function Wa(t){let a=[],c=t.vault.getRoot();a.push(c);function r(h){for(let e of h.children)if(e instanceof f2.TFolder){let l=e;a.push(l),l.children&&r(l)}}return r(c),a}function Ga(t){return!!t&&typeof t.then=="function"}var O1=Ga;function qa(t,a){if(t!=null)return t;throw new Error(a??"Got unexpected null or undefined")}var x1=qa,D3=class{},$a=new D3,E3={valueMaybe(){},valueOrThrow(){throw new Error(`Loadable expected value, but in "${this.state}" state`)},errorMaybe(){},errorOrThrow(){throw new Error(`Loadable expected error, but in "${this.state}" state`)},promiseMaybe(){},promiseOrThrow(){throw new Error(`Loadable expected promise, but in "${this.state}" state`)},is(t){return t.state===this.state&&t.contents===this.contents},map(t){if(this.state==="hasError")return this;if(this.state==="hasValue")try{let c=t(this.contents);return O1(c)?K2(c.then(r=>({__value:r}))):N3(c)}catch(c){return O1(c)?K2(c.next(()=>t(this.contents))):U3(c)}if(this.state==="loading")return K2(this.contents.then(c=>({__value:t(c.__value)})).catch(c=>{if(O1(c))return c.then(()=>t(this.contents));throw c}));throw new Error("Invalid Loadable state")}};function N3(t){return Object.freeze({state:"hasValue",contents:t,...E3,getValue(){return this.contents},toPromise(){return Promise.resolve(this.contents)},valueMaybe(){return this.contents},valueOrThrow(){return this.contents}})}function U3(t){return Object.freeze({state:"hasError",contents:t,...E3,getValue(){throw this.contents},toPromise(){return Promise.reject(this.contents)},errorMaybe(){return this.contents},errorOrThrow(){return this.contents}})}function K2(t){return Object.freeze({state:"loading",contents:t,...E3,getValue(){throw this.contents.then(({__value:a})=>a)},toPromise(){return this.contents.then(({__value:a})=>a)},promiseMaybe(){return this.contents.then(({__value:a})=>a)},promiseOrThrow(){return this.contents.then(({__value:a})=>a)}})}function ja(){return K2(new Promise(()=>{}))}function Ka(t){return t.every(a=>a.state==="hasValue")?N3(t.map(a=>a.contents)):t.some(a=>a.state==="hasError")?U3(x1(t.find(a=>a.state==="hasError"),"Invalid loadable passed to loadableAll").contents):K2(Promise.all(t.map(a=>a.contents)).then(a=>({__value:a})))}var L0={loadableWithValue:N3,loadableWithError:U3,loadableWithPromise:K2,loadableLoading:ja,loadableAll:Ka,Canceled:D3,CANCELED:$a},W3,c7=(W3=H.useMutableSource)!==null&&W3!==void 0?W3:H.unstable_useMutableSource;function Qa(){return c7&&!(typeof window!="undefined"&&window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE)}var r7={mutableSourceExists:Qa,useMutableSource:c7},{mutableSourceExists:Ya}=r7,G3=new Map().set("recoil_hamt_2020",!0).set("recoil_memory_managament_2020",!0).set("recoil_suppress_rerender_in_callback",!0);function q3(t){var a;return t==="recoil_early_rendering_2021"&&!Ya()?!1:(a=G3.get(t))!==null&&a!==void 0?a:!1}q3.setPass=t=>{G3.set(t,!0)};q3.setFail=t=>{G3.set(t,!1)};var V1=q3;function Ja(t,a,{error:c}={}){return null}var Xa=Ja,v2=Xa;function tc(t,a){let c=new Set(t);return c.add(a),c}function ac(t,a){let c=new Set(t);return c.delete(a),c}function cc(t,a,c){let r=new Map(t);return r.set(a,c),r}function rc(t,a,c){let r=new Map(t);return r.set(a,c(r.get(a))),r}function hc(t,a){let c=new Map(t);return c.delete(a),c}function ec(t,a){let c=new Map(t);return a.forEach(r=>c.delete(r)),c}var h7={setByAddingToSet:tc,setByDeletingFromSet:ac,mapBySettingInMap:cc,mapByUpdatingInMap:rc,mapByDeletingFromMap:hc,mapByDeletingMultipleFromMap:ec};function*lc(t,a){let c=0;for(let r of t)a(r,c++)&&(yield r)}var e7=lc;function vc(t,a){return function*(){let c=0;for(let r of t)yield a(r,c++)}()}var l7=vc;function nc(t,...a){}var ic=nc,$3=ic;function z1(t,a,c){return a in t?Object.defineProperty(t,a,{value:c,enumerable:!0,configurable:!0,writable:!0}):t[a]=c,t}var o4=class{constructor(a){z1(this,"key",void 0),this.key=a}},j3=class extends o4{},K3=class extends o4{};function oc(t){return t instanceof j3||t instanceof K3}var g4={AbstractRecoilValue:o4,RecoilState:j3,RecoilValueReadOnly:K3,isRecoilValue:oc},gc=g4.AbstractRecoilValue,dc=g4.RecoilState,zc=g4.RecoilValueReadOnly,sc=g4.isRecoilValue,R2=Object.freeze({__proto__:null,AbstractRecoilValue:gc,RecoilState:dc,RecoilValueReadOnly:zc,isRecoilValue:sc}),Q3=class{},uc=new Q3,v7=class extends Error{constructor(a){super(`Tried to set the value of Recoil selector ${a} using an updater function, but it is an async selector in a pending or error state; this is not supported.`)}},Z2=new Map,Y3=new Map;function pc(t){return l7(t,a=>x1(Y3.get(a)))}function Mc(t){if(Z2.has(t.key)){let c=`Duplicate atom key "${t.key}". This is a FATAL ERROR in production. But it is safe to ignore this warning if it occurred because of hot module replacement.`;console.warn(c)}Z2.set(t.key,t);let a=t.set==null?new R2.RecoilValueReadOnly(t.key):new R2.RecoilState(t.key);return Y3.set(t.key,a),a}var J3=class extends Error{};function Hc(t){let a=Z2.get(t);if(a==null)throw new J3(`Missing definition for RecoilValue: "${t}""`);return a}function fc(t){return Z2.get(t)}var d4=new Map;function xc(t){var a;if(!V1("recoil_memory_managament_2020"))return;let c=Z2.get(t);if(c==null||(a=c.shouldDeleteConfigOnRelease)===null||a===void 0?void 0:a.call(c)){var r;Z2.delete(t),(r=n7(t))===null||r===void 0||r(),d4.delete(t)}}function Vc(t,a){!V1("recoil_memory_managament_2020")||(a===void 0?d4.delete(t):d4.set(t,a))}function n7(t){return d4.get(t)}var J1={nodes:Z2,recoilValues:Y3,registerNode:Mc,getNode:Hc,getNodeMaybe:fc,deleteNodeConfigIfPossible:xc,setConfigDeletionHandler:Vc,getConfigDeletionHandler:n7,recoilValuesForKeys:pc,NodeMissingError:J3,DefaultValue:Q3,DEFAULT_VALUE:uc,RecoilValueNotReady:v7},X3=class{};function mc(){return new X3}var z4={RetentionZone:X3,retentionZone:mc},{setByAddingToSet:Cc}=h7,{getNode:s4,getNodeMaybe:Lc,recoilValuesForKeys:i7}=J1,{RetentionZone:o7}=z4,Bc=Object.freeze(new Set),g7=class extends Error{};function wc(t,a,c){if(!V1("recoil_memory_managament_2020"))return()=>{};let{nodesRetainedByZone:r}=t.getState().retention;function h(e){let l=r.get(e);l||r.set(e,l=new Set),l.add(a)}if(c instanceof o7)h(c);else if(Array.isArray(c))for(let e of c)h(e);return()=>{if(!V1("recoil_memory_managament_2020"))return;let e=t.getState().retention.nodesRetainedByZone;function l(v){let n=e.get(v);n&&n.delete(a),n&&n.size===0&&e.delete(v)}if(c instanceof o7)l(c);else if(Array.isArray(c))for(let v of c)l(v)}}function t5(t,a,c,r){let h=t.getState();if(h.nodeCleanupFunctions.has(c))return;let e=s4(c),l=wc(t,c,e.retainedBy),v=e.init(t,a,r);h.nodeCleanupFunctions.set(c,()=>{v(),l()})}function Ac(t,a){var c;let r=t.getState();(c=r.nodeCleanupFunctions.get(a))===null||c===void 0||c(),r.nodeCleanupFunctions.delete(a)}function Sc(t,a,c){return t5(t,a,c,"get"),s4(c).get(t,a)}function d7(t,a,c){return s4(c).peek(t,a)}function Fc(t,a,c){var r;let h=Lc(a);return h==null||(r=h.invalidate)===null||r===void 0||r.call(h,t),{...t,atomValues:t.atomValues.clone().delete(a),nonvalidatedAtoms:t.nonvalidatedAtoms.clone().set(a,c),dirtyAtoms:Cc(t.dirtyAtoms,a)}}function yc(t,a,c,r){let h=s4(c);if(h.set==null)throw new g7(`Attempt to set read-only RecoilValue: ${c}`);let e=h.set;return t5(t,a,c,"set"),e(t,a,r)}function Oc(t,a,c){var r,h,e;let l=t.getState(),v=t.getGraph(a.version),n=l.knownAtoms.has(c)?"atom":l.knownSelectors.has(c)?"selector":void 0,i=e7(z7(t,a,new Set([c])),g=>g!==c);return{loadable:d7(t,a,c),isActive:l.knownAtoms.has(c)||l.knownSelectors.has(c),isSet:n==="selector"?!1:a.atomValues.has(c),isModified:a.dirtyAtoms.has(c),type:n,deps:i7((r=v.nodeDeps.get(c))!==null&&r!==void 0?r:[]),subscribers:{nodes:i7(i),components:l7((h=(e=l.nodeToComponentSubscriptions.get(c))===null||e===void 0?void 0:e.values())!==null&&h!==void 0?h:[],([g])=>({name:g}))}}}function z7(t,a,c){let r=new Set,h=Array.from(c),e=t.getGraph(a.version);for(let v=h.pop();v;v=h.pop()){var l;r.add(v);let n=(l=e.nodeToNodeSubscriptions.get(v))!==null&&l!==void 0?l:Bc;for(let i of n)r.has(i)||h.push(i)}return r}var Q2={getNodeLoadable:Sc,peekNodeLoadable:d7,setNodeValue:yc,cleanUpNode:Ac,setUnvalidatedAtomValue_DEPRECATED:Fc,peekNodeInfo:Oc,getDownstreamNodes:z7,initializeNodeIfNewToStore:t5},{CANCELED:Rc}=L0,{getDownstreamNodes:Zc,getNodeLoadable:s7,setNodeValue:bc}=Q2,{getNodeMaybe:u7}=J1,{DefaultValue:a5,RecoilValueNotReady:Tc}=J1,{AbstractRecoilValue:Ic,RecoilState:_c,RecoilValueReadOnly:Pc,isRecoilValue:kc}=R2;function Dc(t,{key:a},c=t.getState().currentTree){var r,h;let e=t.getState();c.version===e.currentTree.version||c.version===((r=e.nextTree)===null||r===void 0?void 0:r.version)||c.version===((h=e.previousTree)===null||h===void 0?void 0:h.version)||v2("Tried to read from a discarded tree");let l=s7(t,c,a);return l.state==="loading"&&l.contents.catch(()=>Rc),l}function Ec(t,a){let c=t.clone();return a.forEach((r,h)=>{r.state==="hasValue"&&r.contents instanceof a5?c.delete(h):c.set(h,r)}),c}function Nc(t,a,{key:c},r){if(typeof r=="function"){let h=s7(t,a,c);if(h.state==="loading")throw new Tc(c);if(h.state==="hasError")throw h.contents;return r(h.contents)}else return r}function Uc(t,a,c){if(c.type==="set"){let{recoilValue:h,valueOrUpdater:e}=c,l=Nc(t,a,h,e),v=bc(t,a,h.key,l);for(let[n,i]of v.entries())c5(a,n,i)}else if(c.type==="setLoadable"){let{recoilValue:{key:h},loadable:e}=c;c5(a,h,e)}else if(c.type==="markModified"){let{recoilValue:{key:h}}=c;a.dirtyAtoms.add(h)}else if(c.type==="setUnvalidated"){var r;let{recoilValue:{key:h},unvalidatedValue:e}=c,l=u7(h);l==null||(r=l.invalidate)===null||r===void 0||r.call(l,a),a.atomValues.delete(h),a.nonvalidatedAtoms.set(h,e),a.dirtyAtoms.add(h)}else v2(`Unknown action ${c.type}`)}function c5(t,a,c){c.state==="hasValue"&&c.contents instanceof a5?t.atomValues.delete(a):t.atomValues.set(a,c),t.dirtyAtoms.add(a),t.nonvalidatedAtoms.delete(a)}function p7(t,a){t.replaceState(c=>{let r=M7(c);for(let h of a)Uc(t,r,h);return r5(t,r),r})}function u4(t,a){if(B0.length){let c=B0[B0.length-1],r=c.get(t);r||c.set(t,r=[]),r.push(a)}else p7(t,[a])}var B0=[];function Wc(){let t=new Map;return B0.push(t),()=>{for(let[c,r]of t)p7(c,r);B0.pop()!==t&&v2("Incorrect order of batch popping")}}function M7(t){return{...t,atomValues:t.atomValues.clone(),nonvalidatedAtoms:t.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(t.dirtyAtoms)}}function r5(t,a){let c=Zc(t,a,a.dirtyAtoms);for(let e of c){var r,h;(r=u7(e))===null||r===void 0||(h=r.invalidate)===null||h===void 0||h.call(r,a)}}function H7(t,a,c){u4(t,{type:"set",recoilValue:a,valueOrUpdater:c})}function Gc(t,a,c){if(c instanceof a5)return H7(t,a,c);u4(t,{type:"setLoadable",recoilValue:a,loadable:c})}function qc(t,a){u4(t,{type:"markModified",recoilValue:a})}function $c(t,a,c){u4(t,{type:"setUnvalidated",recoilValue:a,unvalidatedValue:c})}var jc=0;function Kc(t,{key:a},c,r=null){let h=jc++,e=t.getState();if(e.nodeToComponentSubscriptions.has(a)||e.nodeToComponentSubscriptions.set(a,new Map),x1(e.nodeToComponentSubscriptions.get(a)).set(h,[r??"",c]),V1("recoil_early_rendering_2021")){let l=t.getState().nextTree;l&&l.dirtyAtoms.has(a)&&c(l)}return{release:()=>{let l=t.getState(),v=l.nodeToComponentSubscriptions.get(a);if(v===void 0||!v.has(h)){v2(`Subscription missing at release time for atom ${a}. This is a bug in Recoil.`);return}v.delete(h),v.size===0&&l.nodeToComponentSubscriptions.delete(a)}}}var b2={RecoilValueReadOnly:Pc,AbstractRecoilValue:Ic,RecoilState:_c,getRecoilValueAsLoadable:Dc,setRecoilValue:H7,setRecoilValueLoadable:Gc,markRecoilValueModified:qc,setUnvalidatedRecoilValue:$c,subscribeToRecoilValue:Kc,isRecoilValue:kc,applyAtomValueWrites:Ec,batchStart:Wc,writeLoadableToTreeState:c5,invalidateDownstreams:r5,copyTreeState:M7,invalidateDownstreams_FOR_TESTING:r5},{unstable_batchedUpdates:Qc}=H,Yc={unstable_batchedUpdates:Qc},{unstable_batchedUpdates:Jc}=Yc,Xc={unstable_batchedUpdates:Jc},{batchStart:tr}=b2,{unstable_batchedUpdates:ar}=Xc,h5=ar,cr=t=>{h5=t},rr=()=>h5,hr=t=>{h5(()=>{let a=()=>{};try{a=tr(),t()}finally{a()}})},e5={getBatcher:rr,setBatcher:cr,batchUpdates:hr};function er(t,a){a()}var lr={enqueueExecution:er};function vr(t,...a){let c=new Set;t:for(let r of t){for(let h of a)if(h.has(r))continue t;c.add(r)}return c}var p4=vr;function nr(t,a){let c=new Map;return t.forEach((r,h)=>{c.set(h,a(r,h))}),c}var M4=nr;function ir(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}}function or(t){return{nodeDeps:M4(t.nodeDeps,a=>new Set(a)),nodeToNodeSubscriptions:M4(t.nodeToNodeSubscriptions,a=>new Set(a))}}function l5(t,a,c){let{nodeDeps:r,nodeToNodeSubscriptions:h}=a;t.forEach((e,l)=>{let v=r.get(l);if(v&&c&&v!==c.nodeDeps.get(l))return;r.set(l,new Set(e)),(v==null?e:p4(e,v)).forEach(i=>{h.has(i)||h.set(i,new Set),x1(h.get(i)).add(l)}),v&&p4(v,e).forEach(g=>{if(!h.has(g))return;let o=x1(h.get(g));o.delete(l),o.size===0&&h.delete(g)})})}function gr(t,a,c){var r,h,e,l;let v=a.getState();c===v.currentTree.version||c===((r=v.nextTree)===null||r===void 0?void 0:r.version)||c===((h=v.previousTree)===null||h===void 0?void 0:h.version)||v2("Tried to save dependencies to a discarded tree");let n=a.getGraph(c);if(l5(t,n),c===((e=v.previousTree)===null||e===void 0?void 0:e.version)){let g=a.getGraph(v.currentTree.version);l5(t,g,n)}if(c===((l=v.previousTree)===null||l===void 0?void 0:l.version)||c===v.currentTree.version){var i;let g=(i=v.nextTree)===null||i===void 0?void 0:i.version;if(g!==void 0){let o=a.getGraph(g);l5(t,o,n)}}}function dr(t,a){t.forEach((c,r)=>{a.has(r)||a.set(r,new Set);let h=x1(a.get(r));c.forEach(e=>h.add(e))})}function zr(t,a,c){c.has(t)||c.set(t,new Set),x1(c.get(t)).add(a)}var w0={addToDependencyMap:zr,cloneGraph:or,graph:ir,mergeDepsIntoDependencyMap:dr,saveDependencyMapToStore:gr};function sr(t,a){return a={exports:{}},t(a,a.exports),a.exports}var ur=sr(function(t){var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},c={},r=5,h=Math.pow(2,r),e=h-1,l=h/2,v=h/4,n={},i=function(s){return function(){return s}},g=c.hash=function(p){var s=typeof p=="undefined"?"undefined":a(p);if(s==="number")return p;s!=="string"&&(p+="");for(var Z=0,E=0,N=p.length;E>1&1431655765,s=(s&858993459)+(s>>2&858993459),s=s+(s>>4)&252645135,s+=s>>8,s+=s>>16,s&127},A=function(s,Z){return Z>>>s&e},m=function(s){return 1<=Z;)N[X--]=N[X];return N[Z]=E,N}for(var Y=0,J=0,o1=new Array(q+1);Y>>=1;return X[Z]=E,D(s,J+1,X)},I=function(s,Z,E,N){for(var q=new Array(Z-1),X=0,Y=0,J=0,o1=N.length;J1?k(s,this.hash,o1):o1[0]}var A1=N();return A1===n?this:(++Y.value,R(s,E,this.hash,this,q,P(s,q,X,A1)))},r1=function(s,Z,E,N,q,X,Y){var J=this.mask,o1=this.children,A1=A(E,q),W1=m(A1),I1=z(J,W1),K1=J&W1,X1=K1?o1[I1]:b,D2=X1._modify(s,Z,E+r,N,q,X,Y);if(X1===D2)return this;var N0=G(s,this),n0=J,i0=void 0;if(K1&&C(D2)){if(n0&=~W1,!n0)return b;if(o1.length<=2&&_(o1[I1^1]))return o1[I1^1];i0=F(N0,I1,o1)}else if(!K1&&!C(D2)){if(o1.length>=l)return y(s,A1,D2,J,o1);n0|=W1,i0=O(N0,I1,D2,o1)}else i0=w(N0,I1,D2,o1);return N0?(this.mask=n0,this.children=i0,this):Q(s,n0,i0)},u1=function(s,Z,E,N,q,X,Y){var J=this.size,o1=this.children,A1=A(E,q),W1=o1[A1],I1=(W1||b)._modify(s,Z,E+r,N,q,X,Y);if(W1===I1)return this;var K1=G(s,this),X1=void 0;if(C(W1)&&!C(I1))++J,X1=w(K1,A1,I1,o1);else if(!C(W1)&&C(I1)){if(--J,J<=v)return I(s,J,A1,o1);X1=w(K1,A1,b,o1)}else X1=w(K1,A1,I1,o1);return K1?(this.size=J,this.children=X1,this):D(s,J,X1)};b._modify=function(p,s,Z,E,N,q,X){var Y=E();return Y===n?b:(++X.value,P(p,N,q,Y))};function $(p,s,Z,E,N){this._editable=p,this._edit=s,this._config=Z,this._root=E,this._size=N}$.prototype.setTree=function(p,s){return this._editable?(this._root=p,this._size=s,this):p===this._root?this:new $(this._editable,this._edit,this._config,p,s)};var s1=c.tryGetHash=function(p,s,Z,E){for(var N=E._root,q=0,X=E._config.keyEq;;)switch(N.type){case S:return X(Z,N.key)?N.value:p;case B:{if(s===N.hash)for(var Y=N.children,J=0,o1=Y.length;Jxr++;function m7(){let t=V7();return{version:t,stateID:t,transactionMetadata:{},dirtyAtoms:new Set,atomValues:x7(),nonvalidatedAtoms:x7()}}function Vr(){let t=m7();return{currentTree:t,nextTree:null,previousTree:null,commitDepth:0,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(t.version,fr()),versionsUsedByComponent:new Map,retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}var C7={makeEmptyTreeState:m7,makeEmptyStoreState:Vr,getNextTreeStateVersion:V7};function mr(...t){let a=new Set;for(let c of t)for(let r of c)a.add(r);return a}var Cr=mr;function Lr(t,a,c){let r=t.entries(),h=r.next();for(;!h.done;){let e=h.value;if(a.call(c,e[1],e[0],t))return!0;h=r.next()}return!1}var Br=Lr,{cleanUpNode:wr}=Q2,{deleteNodeConfigIfPossible:Ar,getNode:L7}=J1,{RetentionZone:B7}=z4,w7=new Set;function A7(t,a){let c=t.getState(),r=c.currentTree;if(c.nextTree){v2("releaseNodesNowOnCurrentTree should only be called at the end of a batch");return}let h=new Set;for(let l of a)if(l instanceof B7)for(let v of Or(c,l))h.add(v);else h.add(l);let e=Sr(t,h);for(let l of e)yr(t,r,l)}function Sr(t,a){let c=t.getState(),r=c.currentTree,h=t.getGraph(r.version),e=new Set,l=new Set;return v(a),e;function v(n){let i=new Set,g=Fr(t,r,n,e,l);for(let z of g){var o;if(L7(z).retainedBy==="recoilRoot"){l.add(z);continue}if(((o=c.retention.referenceCounts.get(z))!==null&&o!==void 0?o:0)>0){l.add(z);continue}if(S7(z).some(F=>c.retention.referenceCounts.get(F))){l.add(z);continue}let w=h.nodeToNodeSubscriptions.get(z);if(w&&Br(w,F=>l.has(F))){l.add(z);continue}e.add(z),i.add(z)}let A=new Set;for(let z of i)for(let w of(m=h.nodeDeps.get(z))!==null&&m!==void 0?m:w7){var m;e.has(w)||A.add(w)}A.size&&v(A)}}function Fr(t,a,c,r,h){let e=t.getGraph(a.version),l=[],v=new Set;for(;c.size>0;)n(x1(c.values().next().value));return l;function n(i){if(r.has(i)||h.has(i)){c.delete(i);return}if(v.has(i))return;let g=e.nodeToNodeSubscriptions.get(i);if(g)for(let o of g)n(o);v.add(i),c.delete(i),l.push(i)}}function yr(t,a,c){if(!V1("recoil_memory_managament_2020"))return;wr(t,c);let r=t.getState();r.knownAtoms.delete(c),r.knownSelectors.delete(c),r.nodeTransactionSubscriptions.delete(c),r.retention.referenceCounts.delete(c);let h=S7(c);for(let n of h){var e;(e=r.retention.nodesRetainedByZone.get(n))===null||e===void 0||e.delete(c)}a.atomValues.delete(c),a.dirtyAtoms.delete(c),a.nonvalidatedAtoms.delete(c);let l=r.graphsByVersion.get(a.version);if(l){let n=l.nodeDeps.get(c);if(n!==void 0){l.nodeDeps.delete(c);for(let i of n){var v;(v=l.nodeToNodeSubscriptions.get(i))===null||v===void 0||v.delete(c)}}l.nodeToNodeSubscriptions.delete(c)}Ar(c)}function Or(t,a){var c;return(c=t.retention.nodesRetainedByZone.get(a))!==null&&c!==void 0?c:w7}function S7(t){let a=L7(t).retainedBy;return a===void 0||a==="components"||a==="recoilRoot"?[]:a instanceof B7?[a]:a}function Rr(t,a){let c=t.getState();c.nextTree?c.retention.retainablesToCheckForRelease.add(a):A7(t,new Set([a]))}function Zr(t,a,c){var r;if(!V1("recoil_memory_managament_2020"))return;let h=t.getState().retention.referenceCounts,e=((r=h.get(a))!==null&&r!==void 0?r:0)+c;e===0?F7(t,a):h.set(a,e)}function F7(t,a){if(!V1("recoil_memory_managament_2020"))return;t.getState().retention.referenceCounts.delete(a),Rr(t,a)}function br(t){if(!V1("recoil_memory_managament_2020"))return;let a=t.getState();A7(t,a.retention.retainablesToCheckForRelease),a.retention.retainablesToCheckForRelease.clear()}function Tr(t){return t===void 0?"recoilRoot":t}var A0={updateRetainCount:Zr,updateRetainCountToZero:F7,releaseScheduledRetainablesNow:br,retainedByOptionWithDefault:Tr};function*Ir(t){for(let a of t)for(let c of a)yield c}var _r=Ir,Pr=typeof window=="undefined",kr=typeof navigator!="undefined"&&navigator.product==="ReactNative",y7={isSSR:Pr,isReactNative:kr},{isSSR:Dr}=y7,{batchUpdates:n5}=e5,{initializeNodeIfNewToStore:Er,peekNodeInfo:Nr}=Q2,{graph:Ur}=w0,{DEFAULT_VALUE:Wr,recoilValues:O7,recoilValuesForKeys:R7}=J1,{AbstractRecoilValue:Gr,getRecoilValueAsLoadable:qr,setRecoilValue:Z7,setUnvalidatedRecoilValue:$r}=b2,{updateRetainCount:f4}=A0,{getNextTreeStateVersion:jr,makeEmptyStoreState:Kr}=C7;var S0=class{constructor(a){z1(this,"_store",void 0),z1(this,"_refCount",0),z1(this,"getLoadable",c=>(this.checkRefCount_INTERNAL(),qr(this._store,c))),z1(this,"getPromise",c=>(this.checkRefCount_INTERNAL(),this.getLoadable(c).toPromise())),z1(this,"getNodes_UNSTABLE",c=>{if(this.checkRefCount_INTERNAL(),(c==null?void 0:c.isModified)===!0){if((c==null?void 0:c.isInitialized)===!1)return[];let e=this._store.getState().currentTree;return R7(e.dirtyAtoms)}let r=this._store.getState().knownAtoms,h=this._store.getState().knownSelectors;return(c==null?void 0:c.isInitialized)==null?O7.values():c.isInitialized===!0?R7(_r([this._store.getState().knownAtoms,this._store.getState().knownSelectors])):e7(O7.values(),({key:e})=>!r.has(e)&&!h.has(e))}),z1(this,"getInfo_UNSTABLE",({key:c})=>(this.checkRefCount_INTERNAL(),Nr(this._store,this._store.getState().currentTree,c))),z1(this,"map",c=>{this.checkRefCount_INTERNAL();let r=new x4(this,n5);return c(r),i5(r.getStore_INTERNAL())}),z1(this,"asyncMap",async c=>{this.checkRefCount_INTERNAL();let r=new x4(this,n5);return await c(r),i5(r.getStore_INTERNAL())}),this._store={getState:()=>a,replaceState:c=>{a.currentTree=c(a.currentTree)},getGraph:c=>{let r=a.graphsByVersion;if(r.has(c))return x1(r.get(c));let h=Ur();return r.set(c,h),h},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw new Error("Cannot subscribe to Snapshots")}};for(let c of this._store.getState().nodeCleanupFunctions.keys())Er(this._store,a.currentTree,c,"get"),f4(this._store,c,1);this.retain(),this.autorelease_INTERNAL()}retain(){if(!V1("recoil_memory_managament_2020"))return()=>{};this._refCount++;let a=!1;return()=>{a||(a=!0,this.release_INTERNAL())}}autorelease_INTERNAL(){!V1("recoil_memory_managament_2020")||Dr||window.setTimeout(()=>this.release_INTERNAL(),0)}release_INTERNAL(){!V1("recoil_memory_managament_2020")||(this._refCount--,this._refCount===0)}checkRefCount_INTERNAL(){V1("recoil_memory_managament_2020")&&this._refCount<=0}getStore_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store}getID(){return this.checkRefCount_INTERNAL(),this.getID_INTERNAL()}getID_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}};function b7(t,a,c=!1){let r=t.getState(),h=c?jr():a.version;return{currentTree:c?{version:h,stateID:h,transactionMetadata:{...a.transactionMetadata},dirtyAtoms:new Set(a.dirtyAtoms),atomValues:a.atomValues.clone(),nonvalidatedAtoms:a.nonvalidatedAtoms.clone()}:a,commitDepth:0,nextTree:null,previousTree:null,knownAtoms:new Set(r.knownAtoms),knownSelectors:new Set(r.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(h,t.getGraph(a.version)),versionsUsedByComponent:new Map,retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}function Qr(t){let a=new S0(Kr());return t!=null?a.map(t):a}function i5(t,a="current"){let c=t.getState(),r=a==="current"?c.currentTree:x1(c.previousTree);return new S0(b7(t,r))}var x4=class extends S0{constructor(a,c){super(b7(a.getStore_INTERNAL(),a.getStore_INTERNAL().getState().currentTree,!0));z1(this,"_batch",void 0),z1(this,"set",(r,h)=>{this.checkRefCount_INTERNAL();let e=this.getStore_INTERNAL();this._batch(()=>{f4(e,r.key,1),Z7(this.getStore_INTERNAL(),r,h)})}),z1(this,"reset",r=>{this.checkRefCount_INTERNAL();let h=this.getStore_INTERNAL();this._batch(()=>{f4(h,r.key,1),Z7(this.getStore_INTERNAL(),r,Wr)})}),z1(this,"setUnvalidatedAtomValues_DEPRECATED",r=>{this.checkRefCount_INTERNAL();let h=this.getStore_INTERNAL();n5(()=>{for(let[e,l]of r.entries())f4(h,e,1),$r(h,new Gr(e),l)})}),this._batch=c}},V4={Snapshot:S0,MutableSnapshot:x4,freshSnapshot:Qr,cloneSnapshot:i5},Yr=V4.Snapshot,Jr=V4.MutableSnapshot,Xr=V4.freshSnapshot,th=V4.cloneSnapshot,m4=Object.freeze({__proto__:null,Snapshot:Yr,MutableSnapshot:Jr,freshSnapshot:Xr,cloneSnapshot:th}),{getNextTreeStateVersion:ah,makeEmptyStoreState:T7}=C7,{cleanUpNode:ch,getDownstreamNodes:rh,setNodeValue:hh,setUnvalidatedAtomValue_DEPRECATED:eh}=Q2,{graph:lh}=w0,{cloneGraph:vh}=w0,{applyAtomValueWrites:nh}=b2,{releaseScheduledRetainablesNow:I7}=A0,{freshSnapshot:ih}=m4,{useCallback:oh,useContext:_7,useEffect:o5,useMemo:gh,useRef:g5,useState:dh}=H;function F0(){throw new Error("This component must be used inside a component.")}var P7=Object.freeze({getState:F0,replaceState:F0,getGraph:F0,subscribeToTransactions:F0,addTransactionMetadata:F0}),d5=!1;function k7(t){if(d5)throw new Error("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");let a=t.getState();if(a.nextTree===null){V1("recoil_memory_managament_2020")&&V1("recoil_release_on_cascading_update_killswitch_2021")&&a.commitDepth>0&&I7(t);let c=a.currentTree.version,r=ah();a.nextTree={...a.currentTree,version:r,stateID:r,dirtyAtoms:new Set,transactionMetadata:{}},a.graphsByVersion.set(r,vh(x1(a.graphsByVersion.get(c))))}}var D7=H.createContext({current:P7}),z5=()=>_7(D7),E7=H.createContext(null);function zh(){let t=_7(E7);return t==null&&$3("Attempted to use a Recoil hook outside of a . must be an ancestor of any component that uses Recoil hooks."),t}function s5(t,a,c){let r=rh(t,c,c.dirtyAtoms);for(let h of r){let e=a.nodeToComponentSubscriptions.get(h);if(e)for(let[l,[v,n]]of e)n(c)}}function N7(t){let a=t.getState(),c=a.currentTree,r=c.dirtyAtoms;if(r.size){for(let[h,e]of a.nodeTransactionSubscriptions)if(r.has(h))for(let[l,v]of e)v(t);for(let[h,e]of a.transactionSubscriptions)e(t);(!V1("recoil_early_rendering_2021")||a.suspendedComponentResolvers.size)&&(s5(t,a,c),a.suspendedComponentResolvers.forEach(h=>h()),a.suspendedComponentResolvers.clear())}a.queuedComponentCallbacks_DEPRECATED.forEach(h=>h(c)),a.queuedComponentCallbacks_DEPRECATED.splice(0,a.queuedComponentCallbacks_DEPRECATED.length)}function sh(t){let a=t.current.getState();a.commitDepth++;try{let{nextTree:c}=a;if(c===null)return;a.previousTree=a.currentTree,a.currentTree=c,a.nextTree=null,N7(t.current),a.previousTree!=null?a.graphsByVersion.delete(a.previousTree.version):v2("Ended batch with no previous state, which is unexpected","recoil"),a.previousTree=null,V1("recoil_memory_managament_2020")&&I7(t.current)}finally{a.commitDepth--}}function uh({setNotifyBatcherOfChange:t}){let a=z5(),[c,r]=dh([]);return t(()=>r({})),o5(()=>{lr.enqueueExecution("Batcher",()=>{sh(a)})}),o5(()=>()=>{t(()=>{})},[t]),null}function ph(t,a){let c=T7();return a({set:(r,h)=>{let e=c.currentTree,l=hh(t,e,r.key,h),v=new Set(l.keys()),n=e.nonvalidatedAtoms.clone();for(let i of v)n.delete(i);c.currentTree={...e,dirtyAtoms:Cr(e.dirtyAtoms,v),atomValues:nh(e.atomValues,l),nonvalidatedAtoms:n}},setUnvalidatedAtomValues:r=>{r.forEach((h,e)=>{c.currentTree=eh(c.currentTree,e,h)})}}),c}function Mh(t){return ih().map(t).getStore_INTERNAL().getState()}var U7=0;function Hh({initializeState_DEPRECATED:t,initializeState:a,store_INTERNAL:c,children:r}){var h;let e,l=F=>{let O=e.current.graphsByVersion;if(O.has(F))return x1(O.get(F));let S=lh();return O.set(F,S),S},v=(F,O)=>{if(O==null){let{transactionSubscriptions:S}=z.current.getState(),B=U7++;return S.set(B,F),{release:()=>{S.delete(B)}}}else{let{nodeTransactionSubscriptions:S}=z.current.getState();S.has(O)||S.set(O,new Map);let B=U7++;return x1(S.get(O)).set(B,F),{release:()=>{let d=S.get(O);d&&(d.delete(B),d.size===0&&S.delete(O))}}}},n=F=>{k7(z.current);for(let O of Object.keys(F))x1(z.current.getState().nextTree).transactionMetadata[O]=F[O]},i=F=>{let O=z.current.getState();k7(z.current);let S=x1(O.nextTree),B;try{d5=!0,B=F(S)}finally{d5=!1}B!==S&&(O.nextTree=B,V1("recoil_early_rendering_2021")&&s5(m,O,B),x1(g.current)())},g=g5(null),o=oh(F=>{g.current=F},[g]),A=(h=H.createMutableSource)!==null&&h!==void 0?h:H.unstable_createMutableSource,m=c??{getState:()=>e.current,replaceState:i,getGraph:l,subscribeToTransactions:v,addTransactionMetadata:n},z=g5(m);e=g5(t!=null?ph(m,t):a!=null?Mh(a):T7());let w=gh(()=>A?A(e,()=>e.current.currentTree.version):null,[A,e]);return o5(()=>()=>{for(let F of z.current.getState().knownAtoms)ch(z.current,F)},[]),H.createElement(D7.Provider,{value:z},H.createElement(E7.Provider,{value:w},H.createElement(uh,{setNotifyBatcherOfChange:o}),r))}function fh(t){let{override:a,...c}=t,r=z5();return a===!1&&r.current!==P7?t.children:H.createElement(Hh,c)}var C4={useStoreRef:z5,useRecoilMutableSource:zh,RecoilRoot:fh,notifyComponents_FOR_TESTING:s5,sendEndOfBatchNotifications_FOR_TESTING:N7},{loadableWithValue:xh}=L0,{DEFAULT_VALUE:Vh,getNode:mh}=J1,{copyTreeState:Ch,getRecoilValueAsLoadable:Lh,invalidateDownstreams:Bh,writeLoadableToTreeState:wh}=b2;function W7(t){return mh(t.key).nodeType==="atom"}var G7=class{constructor(a,c){z1(this,"_store",void 0),z1(this,"_treeState",void 0),z1(this,"_changes",void 0),z1(this,"get",r=>{if(this._changes.has(r.key))return this._changes.get(r.key);if(!W7(r))throw new Error("Reading selectors within atomicUpdate is not supported");let h=Lh(this._store,r,this._treeState);if(h.state==="hasValue")return h.contents;throw h.state==="hasError"?h.contents:new Error(`Expected Recoil atom ${r.key} to have a value, but it is in a loading state.`)}),z1(this,"set",(r,h)=>{if(!W7(r))throw new Error("Setting selectors within atomicUpdate is not supported");if(typeof h=="function"){let e=this.get(r);this._changes.set(r.key,h(e))}else this._changes.set(r.key,h)}),z1(this,"reset",r=>{this.set(r,Vh)}),this._store=a,this._treeState=c,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;let a=Ch(this._treeState);for(let[c,r]of this._changes)wh(a,c,xh(r));return Bh(this._store,a),a}};function Ah(t){return a=>{t.replaceState(c=>{let r=new G7(t,c);return a(r),r.newTreeState_INTERNAL()})}}var Sh={atomicUpdater:Ah},Fh=Sh.atomicUpdater,yh=Object.freeze({__proto__:null,atomicUpdater:Fh});function Oh(t,a){let c=new Map;for(let[r,h]of t)a(h,r)&&c.set(r,h);return c}var Rh=Oh;function Zh(t,a){let c=new Set;for(let r of t)a(r)&&c.add(r);return c}var bh=Zh;function Th(t,a){if(!t)throw new Error(a)}var Ih=Th,L4=Ih;function _h(...t){let a=new Map;for(let c=0;c"}var u5=Nh,{atomicUpdater:q7}=yh,{batchUpdates:p5}=e5,{DEFAULT_VALUE:B4,getNode:$7,nodes:Uh}=J1,{useRecoilMutableSource:Wh,useStoreRef:$1}=C4;var{AbstractRecoilValue:M5,getRecoilValueAsLoadable:y0,setRecoilValue:Y2,setRecoilValueLoadable:Gh,setUnvalidatedRecoilValue:qh,subscribeToRecoilValue:H5}=b2,{updateRetainCount:O0}=A0,{RetentionZone:$h}=z4,{Snapshot:Sd,cloneSnapshot:R0}=m4,{setByAddingToSet:jh}=h7,{isSSR:w4}=y7,{mutableSourceExists:Kh,useMutableSource:Qh}=r7,{useCallback:r2,useEffect:z2,useMemo:j7,useRef:x2,useState:f5}=H,K7=12e4;function Q7(t,a,c){if(t.state==="hasValue")return t.contents;throw t.state==="loading"?new Promise(h=>{c.current.getState().suspendedComponentResolvers.add(h)}):t.state==="hasError"?t.contents:new Error(`Invalid value of loadable atom "${a.key}"`)}function Yh(){let t=$1(),[a,c]=f5([]),r=x2(new Set);r.current=new Set;let h=x2(new Set),e=x2(new Map),l=r2(n=>{let i=e.current.get(n);i&&(i.release(),e.current.delete(n))},[e]),v=u5();return z2(()=>{let n=t.current;function i(g,o){!e.current.has(o)||c([])}p4(r.current,h.current).forEach(g=>{if(e.current.has(g)){$3(`Double subscription to RecoilValue "${g}"`);return}let o=H5(n,new M5(g),m=>{i(m,g)},v);e.current.set(g,o),n.getState().nextTree?n.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{i(n.getState(),g)}):i(n.getState(),g)}),p4(h.current,r.current).forEach(g=>{l(g)}),h.current=r.current}),z2(()=>{let n=e.current;return()=>n.forEach((i,g)=>l(g))},[l]),j7(()=>{function n(z){return w=>{Y2(t.current,z,w)}}function i(z){return()=>Y2(t.current,z,B4)}function g(z){var w;r.current.has(z.key)||(r.current=jh(r.current,z.key));let F=t.current.getState();return y0(t.current,z,V1("recoil_early_rendering_2021")&&(w=F.nextTree)!==null&&w!==void 0?w:F.currentTree)}function o(z){let w=g(z);return Q7(w,z,t)}function A(z){return[o(z),n(z)]}function m(z){return[g(z),n(z)]}return{getRecoilValue:o,getRecoilValueLoadable:g,getRecoilState:A,getRecoilStateLoadable:m,getSetRecoilState:n,getResetRecoilState:i}},[r,t])}var Jh={current:0};function Xh(t){let a=$1(),c=r2(()=>{var i;let g=a.current,o=g.getState(),A=V1("recoil_early_rendering_2021")&&(i=o.nextTree)!==null&&i!==void 0?i:o.currentTree;return y0(g,t,A)},[a,t]),r=r2(()=>c(),[c]),h=u5(),e=r2((i,g)=>{let o=a.current;return H5(o,t,()=>{if(!V1("recoil_suppress_rerender_in_callback"))return g();let m=c();n.current.is(m)||g(),n.current=m},h).release},[a,t,h,c]),l=Wh(),v=Qh(l,r,e),n=x2(v);return z2(()=>{n.current=v}),v}function te(t){let a=$1(),[c,r]=f5([]),h=u5();z2(()=>{let v=a.current,n=v.getState(),i=H5(v,t,o=>{var A;if(!V1("recoil_suppress_rerender_in_callback"))return r([]);let m=y0(v,t,v.getState().currentTree);((A=l.current)===null||A===void 0?void 0:A.is(m))||r(m),l.current=m},h);if(n.nextTree)v.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{l.current=null,r([])});else{var g;if(!V1("recoil_suppress_rerender_in_callback"))return r([]);let o=y0(v,t,v.getState().currentTree);((g=l.current)===null||g===void 0?void 0:g.is(o))||r(o),l.current=o}return i.release},[h,t,a]);let e=y0(a.current,t),l=x2(e);return z2(()=>{l.current=e}),e}function x5(t){return V1("recoil_memory_managament_2020")&&a9(t),Kh()?Xh(t):te(t)}function Y7(t){let a=$1(),c=x5(t);return Q7(c,t,a)}function V5(t){let a=$1();return r2(c=>{Y2(a.current,t,c)},[a,t])}function ae(t){let a=$1();return r2(()=>{Y2(a.current,t,B4)},[a,t])}function ce(t){return[Y7(t),V5(t)]}function re(t){return[x5(t),V5(t)]}function A4(t){let a=$1();z2(()=>a.current.subscribeToTransactions(t).release,[t,a])}function J7(t){let a=t.atomValues.toMap(),c=M4(Rh(a,(r,h)=>{let l=$7(h).persistence_UNSTABLE;return l!=null&&l.type!=="none"&&r.state==="hasValue"}),r=>r.contents);return Ph(t.nonvalidatedAtoms.toMap(),c)}function he(t){A4(r2(a=>{let c=a.getState().previousTree,r=a.getState().currentTree;c||(v2("Transaction subscribers notified without a previous tree being present -- this is a bug in Recoil"),c=a.getState().currentTree);let h=J7(r),e=J7(c),l=M4(Uh,n=>{var i,g,o,A;return{persistence_UNSTABLE:{type:(i=(g=n.persistence_UNSTABLE)===null||g===void 0?void 0:g.type)!==null&&i!==void 0?i:"none",backButton:(o=(A=n.persistence_UNSTABLE)===null||A===void 0?void 0:A.backButton)!==null&&o!==void 0?o:!1}}}),v=bh(r.dirtyAtoms,n=>h.has(n)||e.has(n));t({atomValues:h,previousAtomValues:e,atomInfo:l,modifiedAtoms:v,transactionMetadata:{...r.transactionMetadata}})},[t]))}function ee(t){A4(r2(a=>{let c=R0(a,"current"),r=R0(a,"previous");t({snapshot:c,previousSnapshot:r})},[t]))}function X7(t){let a=x2();return z2(()=>{a.current=t}),a.current}function le(){let t=$1(),[a,c]=f5(()=>R0(t.current)),r=X7(a),h=x2();return z2(()=>(h.current&&!w4&&window.clearTimeout(h.current),a.retain()),[a]),A4(r2(e=>c(R0(e)),[])),r!==a&&!w4&&(h.current&&(r==null||r.release_INTERNAL(),window.clearTimeout(h.current)),a.retain(),h.current=window.setTimeout(()=>{a.release_INTERNAL(),h.current=null},K7)),a}function t9(){let t=$1();return r2(a=>{var c;let r=t.current.getState(),h=(c=r.nextTree)!==null&&c!==void 0?c:r.currentTree,e=a.getStore_INTERNAL().getState().currentTree;p5(()=>{let l=new Set;for(let i of[h.atomValues.keys(),e.atomValues.keys()])for(let g of i){var v,n;((v=h.atomValues.get(g))===null||v===void 0?void 0:v.contents)!==((n=e.atomValues.get(g))===null||n===void 0?void 0:n.contents)&&$7(g).shouldRestoreFromSnapshots&&l.add(g)}l.forEach(i=>{Gh(t.current,new M5(i),e.atomValues.has(i)?x1(e.atomValues.get(i)):B4)}),t.current.replaceState(i=>({...i,stateID:a.getID_INTERNAL()}))})},[t])}function ve(){let t=$1();return(a,c={})=>{p5(()=>{t.current.addTransactionMetadata(c),a.forEach((r,h)=>qh(t.current,new M5(h),r))})}}var m5=class{},ne=new m5;function ie(t,a){let c=$1(),r=t9();return r2((...h)=>{function e(g,o){Y2(c.current,g,o)}function l(g){Y2(c.current,g,B4)}let v=R0(c.current),n=q7(c.current),i=ne;return p5(()=>{let g="useRecoilCallback expects a function that returns a function: it accepts a function of the type (RecoilInterface) => T = R and returns a callback function T => R, where RecoilInterface is an object {snapshot, set, ...} and T and R are the argument and return types of the callback you want to create. Please see the docs at recoiljs.org for details.";if(typeof t!="function")throw new Error(g);let o=t({set:e,reset:l,snapshot:v,gotoSnapshot:r,transact_UNSTABLE:n});if(typeof o!="function")throw new Error(g);i=o(...h)}),i instanceof m5&&L4(!1),i},a!=null?[...a,c]:void 0)}function a9(t){if(!!V1("recoil_memory_managament_2020"))return oe(t)}function oe(t){let c=(Array.isArray(t)?t:[t]).map(l=>l instanceof $h?l:l.key),r=$1();z2(()=>{if(!V1("recoil_memory_managament_2020"))return;let l=r.current;if(h.current&&!w4)window.clearTimeout(h.current),h.current=null;else for(let v of c)O0(l,v,1);return()=>{for(let v of c)O0(l,v,-1)}},[r,...c]);let h=x2(),e=X7(c);if(!w4&&(e===void 0||!Dh(e,c))){let l=r.current;for(let v of c)O0(l,v,1);if(e)for(let v of e)O0(l,v,-1);h.current&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>{h.current=null;for(let v of c)O0(l,v,-1)},K7)}}function ge(t,a){let c=$1();return j7(()=>(...r)=>{q7(c.current)(e=>{t(e)(...r)})},a!=null?[...a,c]:void 0)}var de={recoilComponentGetRecoilValueCount_FOR_TESTING:Jh,useGotoRecoilSnapshot:t9,useRecoilCallback:ie,useRecoilInterface:Yh,useRecoilSnapshot:le,useRecoilState:ce,useRecoilStateLoadable:re,useRecoilTransaction:ge,useRecoilTransactionObserver:ee,useRecoilValue:Y7,useRecoilValueLoadable:x5,useRetain:a9,useResetRecoilState:ae,useSetRecoilState:V5,useSetUnvalidatedAtomValues:ve,useTransactionObservation_DEPRECATED:he,useTransactionSubscription_DEPRECATED:A4},{peekNodeInfo:ze}=Q2,{useStoreRef:se}=C4;function ue(){let t=se();return({key:a})=>ze(t.current,t.current.getState().currentTree,a)}var pe=ue,{RecoilRoot:Me,useStoreRef:He}=C4,{useMemo:fe}=H;function xe(){let t=He().current;return fe(()=>{function a({children:c}){return H.createElement(Me,{store_INTERNAL:t},c)}return a},[t])}var Ve=xe;function h2(t,a,c){if(typeof t=="string"&&!t.includes('"')&&!t.includes("\\"))return`"${t}"`;switch(typeof t){case"undefined":return"";case"boolean":return t?"true":"false";case"number":case"symbol":return String(t);case"string":return JSON.stringify(t);case"function":if((a==null?void 0:a.allowFunctions)!==!0)throw new Error("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${t.name})__`}if(t===null)return"null";if(typeof t!="object"){var r;return(r=JSON.stringify(t))!==null&&r!==void 0?r:""}if(O1(t))return"__PROMISE__";if(Array.isArray(t))return`[${t.map((h,e)=>h2(h,a,e.toString()))}]`;if(typeof t.toJSON=="function")return h2(t.toJSON(c),a,c);if(t instanceof Map){let h={};for(let[e,l]of t)h[typeof e=="string"?e:h2(e,a)]=l;return h2(h,a,c)}return t instanceof Set?h2(Array.from(t).sort((h,e)=>h2(h,a).localeCompare(h2(e,a))),a,c):Symbol!==void 0&&t[Symbol.iterator]!=null&&typeof t[Symbol.iterator]=="function"?h2(Array.from(t),a,c):`{${Object.keys(t).filter(h=>t[h]!==void 0).sort().map(h=>`${h2(h,a)}:${h2(t[h],a,h)}`).join(",")}}`}function me(t,a={allowFunctions:!1}){return h2(t,a)}var S4=me,c9=class{constructor(a){var c,r,h;z1(this,"_numLeafs",void 0),z1(this,"_root",void 0),z1(this,"_onHit",void 0),z1(this,"_onSet",void 0),z1(this,"_mapNodeValue",void 0),this._numLeafs=0,this._root=null,this._onHit=(c=a==null?void 0:a.onHit)!==null&&c!==void 0?c:()=>{},this._onSet=(r=a==null?void 0:a.onSet)!==null&&r!==void 0?r:()=>{},this._mapNodeValue=(h=a==null?void 0:a.mapNodeValue)!==null&&h!==void 0?h:e=>e}size(){return this._numLeafs}root(){return this._root}get(a,c){var r;return(r=this.getLeafNode(a,c))===null||r===void 0?void 0:r.value}getLeafNode(a,c){return r9(this.root(),r=>this._mapNodeValue(a(r)),{onNodeVisit:r=>{c==null||c.onNodeVisit(r),r.type==="leaf"&&this._onHit(r)}})}set(a,c,r){let h,e=C5(this.root(),a.map(([l,v])=>[l,this._mapNodeValue(v)]),null,c,null,{onNodeVisit:l=>{r==null||r.onNodeVisit(l),l.type==="leaf"&&(h=l)}});this.root()||(this._root=e),this._numLeafs++,this._onSet(x1(h))}delete(a){if(!this.root())return!1;let c=x1(this.root());return Ce(c,a,a.parent)?a===c||c.type==="branch"&&!c.branches.size?(this._root=null,this._numLeafs=0,!0):(this._numLeafs-=e9(a),!0):!1}clear(){this._numLeafs=0,this._root=null}},r9=(t,a,c)=>{var r;if(t==null)return;if(c==null||(r=c.onNodeVisit)===null||r===void 0||r.call(c,t),t.type==="leaf")return t;let h=a(t.nodeKey);return r9(t.branches.get(h),a,c)},C5=(t,a,c,r,h,e)=>{var l;let v;if(t==null)if(a.length===0)v={type:"leaf",value:r,parent:c,branchKey:h};else{let[n,...i]=a,[g,o]=n;v={type:"branch",nodeKey:g,parent:c,branches:new Map,branchKey:h},v.branches.set(o,C5(null,i,v,r,o,e))}else if(v=t,a.length){let[n,...i]=a,[g,o]=n;t.type==="branch"&&t.nodeKey===g||L4(!1),t.branches.set(o,C5(t.branches.get(o),i,t,r,o,e))}return e==null||(l=e.onNodeVisit)===null||l===void 0||l.call(e,v),v},Ce=(t,a,c)=>c?(c.branches.delete(a.branchKey),h9(t,c,c.parent)):t===a,h9=(t,a,c)=>c?(a.branches.size===0&&c.branches.delete(a.branchKey),h9(t,c,c.parent)):t===a,e9=t=>t.type==="leaf"?1:Array.from(t.branches.values()).reduce((a,c)=>a+e9(c),0),Le={TreeCache:c9},Be=Le.TreeCache,l9=Object.freeze({__proto__:null,TreeCache:Be}),v9=class{constructor(a){var c;z1(this,"_maxSize",void 0),z1(this,"_size",void 0),z1(this,"_head",void 0),z1(this,"_tail",void 0),z1(this,"_map",void 0),z1(this,"_keyMapper",void 0),this._maxSize=a.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=(c=a.mapKey)!==null&&c!==void 0?c:r=>r}head(){return this._head}tail(){return this._tail}size(){return this._size}maxSize(){return this._maxSize}has(a){return this._map.has(this._keyMapper(a))}get(a){let c=this._keyMapper(a),r=this._map.get(c);if(!!r)return this.set(a,r.value),r.value}set(a,c){let r=this._keyMapper(a);this._map.get(r)&&this.delete(a);let e=this.head(),l={key:a,right:e,left:null,value:c};e?e.left=l:this._tail=l,this._map.set(r,l),this._head=l,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){let a=this.tail();a&&this.delete(a.key)}delete(a){let c=this._keyMapper(a);if(!this._size||!this._map.has(c))return;let r=x1(this._map.get(c)),h=r.right,e=r.left;h&&(h.left=r.left),e&&(e.right=r.right),r===this.head()&&(this._head=h),r===this.tail()&&(this._tail=e),this._map.delete(c),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}},we={LRUCache:v9},Ae=we.LRUCache,n9=Object.freeze({__proto__:null,LRUCache:Ae}),{LRUCache:Se}=n9,{TreeCache:Fe}=l9;function ye(t,a=c=>c){let c=new Se({maxSize:t}),r=new Fe({mapNodeValue:a,onHit:h=>{c.set(h,!0)},onSet:h=>{let e=c.tail();c.set(h,!0),e&&r.size()>t&&r.delete(e.key)}});return r}var i9=ye,{TreeCache:Oe}=l9,F4={equality:"reference",eviction:"keep-all",maxSize:1/0};function Re({equality:t=F4.equality,eviction:a=F4.eviction,maxSize:c=F4.maxSize}=F4){let r=Ze(t);return be(a,c,r)}function Ze(t){switch(t){case"reference":return a=>a;case"value":return a=>S4(a)}throw new Error(`Unrecognized equality policy ${t}`)}function be(t,a,c){switch(t){case"keep-all":return new Oe({mapNodeValue:c});case"lru":return i9(x1(a),c);case"most-recent":return i9(1,c)}throw new Error(`Unrecognized eviction policy ${t}`)}var Te=Re;function Ie(t){return()=>null}var _e={startPerfBlock:Ie},{CANCELED:Z0,Canceled:Pe,loadableWithError:b0,loadableWithPromise:ke,loadableWithValue:L5}=L0,{getNodeLoadable:o9,peekNodeLoadable:De,setNodeValue:Ee}=Q2,{saveDependencyMapToStore:Ne}=w0,{DEFAULT_VALUE:Ue,RecoilValueNotReady:We,getConfigDeletionHandler:Ge,registerNode:g9}=J1,{isRecoilValue:qe}=R2,{AbstractRecoilValue:$e}=R2,{setRecoilValueLoadable:je}=b2,{retainedByOptionWithDefault:Ke}=A0,{cloneSnapshot:Qe}=m4,{startPerfBlock:Ye}=_e,T0=[],y4=new Map,Je=(()=>{let t=0;return()=>t++})();function Xe(){return{depValuesDiscoveredSoFarDuringAsyncWork:null,latestLoadable:null,latestExecutionId:null,stateVersion:null}}function tl(t){let{key:a,get:c,cachePolicy_UNSTABLE:r}=t,h=t.set!=null?t.set:void 0,e=Te(r??{equality:"reference",eviction:"keep-all"}),l=Ke(t.retainedBy_UNSTABLE),v=new Map,n=0;function i(){return!V1("recoil_memory_managament_2020")||n>0}function g(u){return v.has(u)||v.set(u,Xe()),x1(v.get(u))}function o(u){return n++,u.getState().knownSelectors.add(a),()=>{n--,u.getState().knownSelectors.delete(a),v.delete(u)}}function A(){return Ge(a)!==void 0&&!i()}function m(u,x,V){if(x.state==="loading"){let T=y4.get(V);T==null&&y4.set(V,T=new Set),T.add(u)}}function z(u,x){let V=y4.get(x);if(V!==void 0){for(let T of V)je(T,new $e(a),u);y4.delete(x)}}function w(u,x,V){let T=u.getState().knownSelectors.has(V);if(T&&x.atomValues.has(V))return x1(x.atomValues.get(V));let M=o9(u,x,V);return M.state!=="loading"&&T&&x.atomValues.set(V,M),M}function F(u,x,V,T,M){return x.then(f=>{if(!i())return W(u,M),Z0;let K=L5(f);return v1(f),r1(V,C(T),K),B(u,V,new Set(T.keys()),M),S(u,K,M),{__value:f,__key:a}}).catch(f=>{if(!i())return W(u,M),Z0;if(G(u,M)&&R(T,u,M),O1(f))return O(u,f,V,T,M);let K=b0(f);throw v1(f),r1(V,C(T),K),B(u,V,new Set(T.keys()),M),S(u,K,M),f})}function O(u,x,V,T,M){return x.then(f=>{if(!i())return W(u,M),Z0;if(f instanceof Pe)return v2("Selector was released while it had dependencies"),Z0;let{__key:K,__value:h1}=f??{},n1=!0;K!=null&&(V.atomValues.set(K,L5(h1)),n1=!1);let p1=b(u,V);if(p1&&p1.state==="hasValue")return y(p1,u),{__value:p1.contents,__key:a};if(!G(u,M)){var i1;let Z1=Q(V);if((Z1==null||(i1=Z1.latestLoadable)===null||i1===void 0?void 0:i1.state)==="loading")return Z1.latestLoadable.contents}let[t1,D1]=L(u,V,M,n1);if(G(u,M)&&R(D1,u,M),a1(t1),t1.state!=="loading"&&(r1(V,C(D1),t1),B(u,V,new Set(D1.keys()),M),S(u,t1,M)),t1.state==="hasError")throw t1.contents;return t1.state==="hasValue"?{__value:t1.contents,__key:a}:t1.contents}).catch(f=>{if(!i())return W(u,M),Z0;let K=b0(f);throw v1(f),r1(V,C(T),b0(f)),B(u,V,new Set(T.keys()),M),S(u,K,M),f})}function S(u,x,V){G(u,V)&&(y(x,u),z(x,V))}function B(u,x,V,T){var M,f,K,h1;if(G(u,T)||x.version===((M=u.getState())===null||M===void 0||(f=M.currentTree)===null||f===void 0?void 0:f.version)||x.version===((K=u.getState())===null||K===void 0||(h1=K.nextTree)===null||h1===void 0?void 0:h1.version)){var n1,p1,i1;Ne(new Map([[a,V]]),u,(n1=(p1=u.getState())===null||p1===void 0||(i1=p1.nextTree)===null||i1===void 0?void 0:i1.version)!==null&&n1!==void 0?n1:u.getState().currentTree.version)}}function d(u,x,V,T,M){V.add(T),B(u,x,V,M)}function L(u,x,V,T=!1){let M=Ye(a),f,K=!1,h1,n1=new Map,p1=new Set;B(u,x,p1,V);function i1(Z1){let{key:E1}=Z1;d(u,x,p1,E1,V);let R1=T?o9(u,x,E1):w(u,x,E1);if(a1(R1),n1.set(E1,R1),R1.state==="hasValue")return R1.contents;throw R1.contents}let t1=!1,D1=Z1=>(...E1)=>{if(!t1)throw new Error("getCallback() should only be called asynchronously after the selector is evalutated. It can be used for selectors to return objects with callbacks that can obtain the current Recoil state without a subscription.");let R1=Qe(u),s2=Z1({snapshot:R1});if(typeof s2!="function")throw new Error("getCallback() expects a function that returns a function.");return s2(...E1)};try{f=c({get:i1,getCallback:D1}),f=qe(f)?i1(f):f,t1=!0,O1(f)?f=F(u,f,x,n1,V).finally(M):M()}catch(Z1){f=Z1,O1(f)?f=O(u,f,x,n1,V).finally(M):(K=!0,M())}return K?h1=b0(f):O1(f)?h1=ke(f):h1=L5(f),a1(h1),[h1,n1]}function b(u,x){let V=new Set,T=g(u),M=e.get(f=>(typeof f!="string"&&L4(!1),w(u,x,f).contents),{onNodeVisit:f=>{f.type==="branch"&&f.nodeKey!==a&&typeof f.nodeKey=="string"&&V.add(f.nodeKey)}});return M&&B(u,x,V,T.latestExecutionId),M}function C(u){return Array.from(u.entries()).map(([x,V])=>[x,V.contents])}function P(u,x){let V=Je(),[T,M]=L(u,x,V);return y(T,u,M,V,x),I(x,C(M),T),m(u,T,V),T}function k(u,x){let V=b(u,x);if(V!=null)return y(V,u),V;let T=Q(x);if(T){let M=T;return m(u,x1(M.latestLoadable),x1(M.latestExecutionId)),x1(M.latestLoadable)}return P(u,x)}function Q(u){var x;let[,V]=(x=Array.from(v.entries()).find(([T,M])=>M.latestLoadable!=null&&M.latestExecutionId!=null&&!_(T,u)))!==null&&x!==void 0?x:[];return V}let D=new Map;function _(u,x){var V,T;let M=g(u),f=(V=M.depValuesDiscoveredSoFarDuringAsyncWork)!==null&&V!==void 0?V:new Map,K=Array(((T=D.get(x.version))!==null&&T!==void 0?T:new Map).entries()),h1=D.has(x.version)&&K.length===f.size&&K.every(([n1,p1])=>f.get(n1)===p1);return f==null||x.version===M.stateVersion||h1?!1:(D.set(x.version,new Map(f)),Array.from(f).some(([n1,p1])=>w(u,x,n1).contents!==p1.contents))}function y(u,x,V,T,M){let f=g(x);u.state==="loading"?(f.depValuesDiscoveredSoFarDuringAsyncWork=V,f.latestExecutionId=T,f.latestLoadable=u,f.stateVersion=M==null?void 0:M.version):(f.depValuesDiscoveredSoFarDuringAsyncWork=null,f.latestExecutionId=null,f.latestLoadable=null,f.stateVersion=null)}function I(u,x,V){V.state!=="loading"&&r1(u,x,V)}function R(u,x,V){let T=g(x);G(x,V)&&(T.depValuesDiscoveredSoFarDuringAsyncWork=u)}function W(u,x){G(u,x)&&v.delete(u)}function G(u,x){let V=g(u);return x===V.latestExecutionId}function a1(u){u.state!=="loading"&&v1(u.contents)}function v1(u){}function r1(u,x,V){u.atomValues.set(a,V),e.set(x,V)}function u1(u){if(T0.includes(a)){let x=`Recoil selector has circular dependencies: ${T0.slice(T0.indexOf(a)).join(" \u2192 ")}`;return b0(new Error(x))}T0.push(a);try{return u()}finally{T0.pop()}}function $(u,x){return e.get(T=>{typeof T!="string"&&L4(!1);let M=De(u,x,T);return M==null?void 0:M.contents})}function s1(u,x){return u1(()=>k(u,x))}function e1(u){u.atomValues.delete(a)}return h!=null?g9({key:a,nodeType:"selector",peek:$,get:s1,set:(x,V,T)=>{let M=!1,f=new Map;function K({key:i1}){if(M)throw new Error("Recoil: Async selector sets are not currently supported.");let t1=w(x,V,i1);if(a1(t1),t1.state==="hasValue")return t1.contents;throw t1.state==="loading"?new We(i1):t1.contents}function h1(i1,t1){if(M)throw new Error("Recoil: Async selector sets are not currently supported.");let D1=typeof t1=="function"?t1(K(i1)):t1;Ee(x,V,i1.key,D1).forEach((E1,R1)=>f.set(R1,E1))}function n1(i1){h1(i1,Ue)}let p1=h({set:h1,get:K,reset:n1},T);if(p1!==void 0)throw O1(p1)?new Error("Recoil: Async selector sets are not currently supported."):new Error("Recoil: selector set should be a void function.");return M=!0,f},init:o,invalidate:e1,shouldDeleteConfigOnRelease:A,dangerouslyAllowMutability:t.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l}):g9({key:a,nodeType:"selector",peek:$,get:s1,init:o,invalidate:e1,shouldDeleteConfigOnRelease:A,dangerouslyAllowMutability:t.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l})}var O4=tl,{loadableWithError:d9,loadableWithPromise:z9,loadableWithValue:I0}=L0,{DEFAULT_VALUE:T2,DefaultValue:J2,getConfigDeletionHandler:s9,registerNode:al,setConfigDeletionHandler:cl}=J1,{isRecoilValue:rl}=R2,{markRecoilValueModified:hl,setRecoilValue:u9,setRecoilValueLoadable:el}=b2,{retainedByOptionWithDefault:ll}=A0;function vl(t){let{key:a,persistence_UNSTABLE:c}=t,r=ll(t.retainedBy_UNSTABLE),h=0,e=O1(t.default)?z9(t.default.then(F=>(e=I0(F),{__key:a,__value:F})).catch(F=>{throw e=d9(F),F})):I0(t.default),l,v=new Map;function n(F,O){let S=O.then(B=>{var d,L;return((L=((d=F.getState().nextTree)!==null&&d!==void 0?d:F.getState().currentTree).atomValues.get(a))===null||L===void 0?void 0:L.contents)===S&&u9(F,w,B),{__key:a,__value:B}}).catch(B=>{var d,L;throw((L=((d=F.getState().nextTree)!==null&&d!==void 0?d:F.getState().currentTree).atomValues.get(a))===null||L===void 0?void 0:L.contents)===S&&el(F,w,d9(B)),B});return S}function i(F,O,S){h++;let B=F.getState().knownAtoms.has(a);if(F.getState().knownAtoms.add(a),e.state==="loading"){let k=()=>{var Q;((Q=F.getState().nextTree)!==null&&Q!==void 0?Q:F.getState().currentTree).atomValues.has(a)||hl(F,w)};e.contents.then(k).catch(k)}let d=T2,L=null;if(t.effects_UNSTABLE!=null&&!B){let k=!0,Q=y=>I=>{if(k){let R=d instanceof J2||O1(d)?e.state==="hasValue"?e.contents:T2:d;d=typeof I=="function"?I(R):I,O1(d)&&(d=d.then(W=>(L={effect:y,value:W},W)))}else{if(O1(I))throw new Error("Setting atoms to async values is not implemented.");typeof I!="function"&&(L={effect:y,value:I}),u9(F,w,typeof I=="function"?R=>{let W=I(R);return L={effect:y,value:W},W}:I)}},D=y=>()=>Q(y)(T2),_=y=>I=>{F.subscribeToTransactions(R=>{var W;let{currentTree:G,previousTree:a1}=R.getState();a1||(v2("Transaction subscribers notified without a next tree being present -- this is a bug in Recoil"),a1=G);let v1=(W=G.atomValues.get(a))!==null&&W!==void 0?W:e;if(v1.state==="hasValue"){var r1,u1,$,s1;let e1=v1.contents,u=(r1=a1.atomValues.get(a))!==null&&r1!==void 0?r1:e,x=u.state==="hasValue"?u.contents:T2;((u1=L)===null||u1===void 0?void 0:u1.effect)!==y||(($=L)===null||$===void 0?void 0:$.value)!==e1?I(e1,x):((s1=L)===null||s1===void 0?void 0:s1.effect)===y&&(L=null)}},a)};for(let y of(b=t.effects_UNSTABLE)!==null&&b!==void 0?b:[]){var b;let I=y({node:w,trigger:S,setSelf:Q(y),resetSelf:D(y),onSet:_(y)});if(I!=null){var C;v.set(F,[...(C=v.get(F))!==null&&C!==void 0?C:[],I])}}k=!1}if(!(d instanceof J2)){var P;let k=O1(d)?z9(n(F,d)):I0(d);O.atomValues.set(a,k),(P=F.getState().nextTree)===null||P===void 0||P.atomValues.set(a,k)}return()=>{var k;h--,(k=v.get(F))===null||k===void 0||k.forEach(Q=>Q()),v.delete(F),F.getState().knownAtoms.delete(a)}}function g(F,O){var S,B,d;return(S=(B=O.atomValues.get(a))!==null&&B!==void 0?B:(d=l)===null||d===void 0?void 0:d[1])!==null&&S!==void 0?S:e}function o(F,O){if(O.atomValues.has(a))return x1(O.atomValues.get(a));if(O.nonvalidatedAtoms.has(a)){if(l!=null)return l;if(c==null)return $3(`Tried to restore a persisted value for atom ${a} but it has no persistence settings.`),e;let S=O.nonvalidatedAtoms.get(a),B=c.validator(S,T2);return l=B instanceof J2?e:I0(B),l}else return e}function A(){l=void 0}function m(F,O,S){if(O.atomValues.has(a)){let B=x1(O.atomValues.get(a));if(B.state==="hasValue"&&S===B.contents)return new Map}else if(!O.nonvalidatedAtoms.has(a)&&S instanceof J2)return new Map;return l=void 0,new Map().set(a,I0(S))}function z(){return s9(a)!==void 0&&h<=0}let w=al({key:a,nodeType:"atom",peek:g,get:o,set:m,init:i,invalidate:A,shouldDeleteConfigOnRelease:z,dangerouslyAllowMutability:t.dangerouslyAllowMutability,persistence_UNSTABLE:t.persistence_UNSTABLE?{type:t.persistence_UNSTABLE.type,backButton:t.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:r});return w}function p9(t){let{default:a,...c}=t;return rl(a)?nl({...c,default:a}):vl({...c,default:a})}function nl(t){let a=p9({...t,default:T2,persistence_UNSTABLE:t.persistence_UNSTABLE===void 0?void 0:{...t.persistence_UNSTABLE,validator:r=>r instanceof J2?r:x1(t.persistence_UNSTABLE).validator(r,T2)},effects_UNSTABLE:t.effects_UNSTABLE}),c=O4({key:`${t.key}__withFallback`,get:({get:r})=>{let h=r(a);return h instanceof J2?t.default:h},set:({set:r},h)=>r(a,h),dangerouslyAllowMutability:t.dangerouslyAllowMutability});return cl(c.key,s9(t.key)),c}var M9=p9,H9=class{constructor(a){var c;z1(this,"_map",void 0),z1(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=(c=a==null?void 0:a.mapKey)!==null&&c!==void 0?c:r=>r}size(){return this._map.size}has(a){return this._map.has(this._keyMapper(a))}get(a){return this._map.get(this._keyMapper(a))}set(a,c){this._map.set(this._keyMapper(a),c)}delete(a){this._map.delete(this._keyMapper(a))}clear(){this._map.clear()}},il={MapCache:H9},ol=il.MapCache,gl=Object.freeze({__proto__:null,MapCache:ol}),{LRUCache:f9}=n9,{MapCache:dl}=gl,R4={equality:"reference",eviction:"none",maxSize:1/0};function zl({equality:t=R4.equality,eviction:a=R4.eviction,maxSize:c=R4.maxSize}=R4){let r=sl(t);return ul(a,c,r)}function sl(t){switch(t){case"reference":return a=>a;case"value":return a=>S4(a)}throw new Error(`Unrecognized equality policy ${t}`)}function ul(t,a,c){switch(t){case"keep-all":return new dl({mapKey:c});case"lru":return new f9({mapKey:c,maxSize:x1(a)});case"most-recent":return new f9({mapKey:c,maxSize:1})}throw new Error(`Unrecognized eviction policy ${t}`)}var x9=zl,{setConfigDeletionHandler:pl}=J1;function Ml(t){var a,c;let r=x9({equality:(a=(c=t.cachePolicyForParams_UNSTABLE)===null||c===void 0?void 0:c.equality)!==null&&a!==void 0?a:"value",eviction:"keep-all"});return h=>{var e;let l=r.get(h);if(l!=null)return l;let{cachePolicyForParams_UNSTABLE:v,...n}=t,i=M9({...n,key:`${t.key}__${(e=S4(h))!==null&&e!==void 0?e:"void"}`,default:typeof t.default=="function"?t.default(h):t.default,retainedBy_UNSTABLE:typeof t.retainedBy_UNSTABLE=="function"?t.retainedBy_UNSTABLE(h):t.retainedBy_UNSTABLE,effects_UNSTABLE:typeof t.effects_UNSTABLE=="function"?t.effects_UNSTABLE(h):t.effects_UNSTABLE});return r.set(h,i),pl(i.key,()=>{r.delete(h)}),i}}var Hl=Ml,{setConfigDeletionHandler:fl}=J1,xl=0;function Vl(t){var a,c;let r=x9({equality:(a=(c=t.cachePolicyForParams_UNSTABLE)===null||c===void 0?void 0:c.equality)!==null&&a!==void 0?a:"value",eviction:"keep-all"});return h=>{var e;let l=r.get(h);if(l!=null)return l;let v=`${t.key}__selectorFamily/${(e=S4(h,{allowFunctions:!0}))!==null&&e!==void 0?e:"void"}/${xl++}`,n=A=>t.get(h)(A),i=t.cachePolicy_UNSTABLE,g=typeof t.retainedBy_UNSTABLE=="function"?t.retainedBy_UNSTABLE(h):t.retainedBy_UNSTABLE,o;if(t.set!=null){let A=t.set;o=O4({key:v,get:n,set:(z,w)=>A(h)(z,w),cachePolicy_UNSTABLE:i,dangerouslyAllowMutability:t.dangerouslyAllowMutability,retainedBy_UNSTABLE:g})}else o=O4({key:v,get:n,cachePolicy_UNSTABLE:i,dangerouslyAllowMutability:t.dangerouslyAllowMutability,retainedBy_UNSTABLE:g});return r.set(h,o),fl(o.key,()=>{r.delete(h)}),o}}var V2=Vl,ml=V2({key:"__constant",get:t=>()=>t,cachePolicyForParams_UNSTABLE:{equality:"reference"}});function Cl(t){return ml(t)}var Ll=Cl,Bl=V2({key:"__error",get:t=>()=>{throw new Error(t)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});function wl(t){return Bl(t)}var Al=wl;function Sl(t){return t}var Fl=Sl,{loadableWithError:V9,loadableWithPromise:m9,loadableWithValue:C9}=L0;function Z4(t,a){let c=Array(a.length).fill(void 0),r=Array(a.length).fill(void 0);for(let[h,e]of a.entries())try{c[h]=t(e)}catch(l){r[h]=l}return[c,r]}function yl(t){return t!=null&&!O1(t)}function b4(t){return Array.isArray(t)?t:Object.getOwnPropertyNames(t).map(a=>t[a])}function B5(t){return t!=null&&typeof t=="object"&&t.hasOwnProperty("__value")?t.__value:t}function w5(t,a){return Array.isArray(t)?a:Object.getOwnPropertyNames(t).reduce((c,r,h)=>({...c,[r]:a[h]}),{})}function X2(t,a,c){let r=c.map((h,e)=>h==null?C9(a[e]):O1(h)?m9(h):V9(h));return w5(t,r)}function Ol(t,a){return a.map((c,r)=>c===void 0?t[r]:c)}var Rl=V2({key:"__waitForNone",get:t=>({get:a})=>{let c=b4(t),[r,h]=Z4(a,c);return X2(t,r,h)},dangerouslyAllowMutability:!0}),Zl=V2({key:"__waitForAny",get:t=>({get:a})=>{let c=b4(t),[r,h]=Z4(a,c);return h.some(e=>!O1(e))?X2(t,r,h):new Promise(e=>{for(let[l,v]of h.entries())O1(v)&&v.then(n=>{r[l]=B5(n),h[l]=void 0,e(X2(t,r,h))}).catch(n=>{h[l]=n,e(X2(t,r,h))})})},dangerouslyAllowMutability:!0}),bl=V2({key:"__waitForAll",get:t=>({get:a})=>{let c=b4(t),[r,h]=Z4(a,c);if(h.every(l=>l==null))return w5(t,r);let e=h.find(yl);if(e!=null)throw e;return Promise.all(h).then(l=>w5(t,Ol(r,l).map(B5)))},dangerouslyAllowMutability:!0}),Tl=V2({key:"__waitForAllSettled",get:t=>({get:a})=>{let c=b4(t),[r,h]=Z4(a,c);return h.every(e=>!O1(e))?X2(t,r,h):Promise.all(h.map((e,l)=>O1(e)?e.then(v=>{r[l]=B5(v),h[l]=void 0}).catch(v=>{r[l]=void 0,h[l]=v}):null)).then(()=>X2(t,r,h))},dangerouslyAllowMutability:!0}),Il=V2({key:"__noWait",get:t=>({get:a})=>{try{return C9(a(t))}catch(c){return O1(c)?m9(c):V9(c)}},dangerouslyAllowMutability:!0}),_l={waitForNone:Rl,waitForAny:Zl,waitForAll:bl,waitForAllSettled:Tl,noWait:Il},{batchUpdates:Pl,setBatcher:kl}=e5,{DefaultValue:Dl}=J1,{RecoilRoot:El}=C4,{isRecoilValue:Nl}=R2,{retentionZone:Ul}=z4,{freshSnapshot:Wl}=m4,{useGotoRecoilSnapshot:Gl,useRecoilCallback:ql,useRecoilSnapshot:$l,useRecoilState:jl,useRecoilStateLoadable:Kl,useRecoilTransaction:Ql,useRecoilTransactionObserver:Yl,useRecoilValue:Jl,useRecoilValueLoadable:Xl,useResetRecoilState:tv,useRetain:av,useSetRecoilState:cv,useSetUnvalidatedAtomValues:rv,useTransactionObservation_DEPRECATED:hv}=de,{noWait:ev,waitForAll:lv,waitForAllSettled:vv,waitForAny:nv,waitForNone:iv}=_l,d1={DefaultValue:Dl,RecoilRoot:El,useRecoilBridgeAcrossReactRoots_UNSTABLE:Ve,atom:M9,selector:O4,retentionZone:Ul,atomFamily:Hl,selectorFamily:V2,constSelector:Ll,errorSelector:Al,readOnlySelector:Fl,useRecoilValue:Jl,useRecoilValueLoadable:Xl,useRecoilState:jl,useRecoilStateLoadable:Kl,useSetRecoilState:cv,useResetRecoilState:tv,useGetRecoilValueInfo_UNSTABLE:pe,useRetain:av,useRecoilCallback:ql,useRecoilTransaction_UNSTABLE:Ql,useGotoRecoilSnapshot:Gl,useRecoilSnapshot:$l,useRecoilTransactionObserver_UNSTABLE:Yl,useTransactionObservation_UNSTABLE:hv,useSetUnvalidatedAtomValues_UNSTABLE:rv,noWait:ev,waitForNone:iv,waitForAny:nv,waitForAll:lv,waitForAllSettled:vv,isRecoilValue:Nl,batchUpdates:Pl,setBatcher:kl,snapshot_UNSTABLE:Wl},Fd=d1.DefaultValue,L9=d1.RecoilRoot,yd=d1.useRecoilBridgeAcrossReactRoots_UNSTABLE,j1=d1.atom,Od=d1.selector,Rd=d1.retentionZone,Zd=d1.atomFamily,bd=d1.selectorFamily,Td=d1.constSelector,Id=d1.errorSelector,_d=d1.readOnlySelector,Pd=d1.useRecoilValue,kd=d1.useRecoilValueLoadable,l1=d1.useRecoilState,Dd=d1.useRecoilStateLoadable,Ed=d1.useSetRecoilState,Nd=d1.useResetRecoilState,Ud=d1.useGetRecoilValueInfo_UNSTABLE,Wd=d1.useRetain,Gd=d1.useRecoilCallback,qd=d1.useRecoilTransaction_UNSTABLE,$d=d1.useGotoRecoilSnapshot,jd=d1.useRecoilSnapshot,Kd=d1.useRecoilTransactionObserver_UNSTABLE,Qd=d1.useTransactionObservation_UNSTABLE,Yd=d1.useSetUnvalidatedAtomValues_UNSTABLE,Jd=d1.noWait,Xd=d1.waitForNone,tz=d1.waitForAny,az=d1.waitForAll,cz=d1.waitForAllSettled,rz=d1.isRecoilValue,hz=d1.batchUpdates,ez=d1.setBatcher,lz=d1.snapshot_UNSTABLE;var t0=j1({key:"fileTreeViewState",default:"folder"}),n2=j1({key:"fileTreeActiveFolderPathState",default:""}),T4=j1({key:"fileTreeActiveFile",default:null,dangerouslyAllowMutability:!0}),a0=j1({key:"fileTreeExcludedFoldersState",default:[]}),I4=j1({key:"fileTreeExcludedExtensions",default:[]}),m2=j1({key:"fileTreeFolderFileCountMapState",default:{}}),_4=j1({key:"fileTreeFolderTreeState",default:null,dangerouslyAllowMutability:!0}),P4=j1({key:"fileTreeFileListState",default:[],dangerouslyAllowMutability:!0}),_0=j1({key:"fileTreePinnedFilesState",default:[],dangerouslyAllowMutability:!0}),C2=j1({key:"fileTreeOpenFoldersState",default:[]}),k4=j1({key:"showSubFoldersInVault",default:!1}),L2=j1({key:"fileTreeFocusedFolder",default:null,dangerouslyAllowMutability:!0});function I2(){let[t,a]=w1(0);return()=>a(c=>c+1)}function B9(t){return t&&"screenX"in t}function P0(t=c=>{},a=300){let[c,r]=w1(!1),[h,e]=w1(null),[l,v]=w1(null);m1(()=>{let o;return c&&l?o=setTimeout(()=>{t(h),g(h)},a):clearTimeout(o),()=>{clearTimeout(o)}},[t,a,c,l]);let n=_1(o=>{r(!0),v(o.touches[0].clientY),e(o)},[]),i=_1(o=>{l&&Math.abs(o.touches[0].clientY-l)>=.5&&g(o)},[l]),g=_1(o=>{r(!1),e(null)},[]);return{onTouchStart:n,onTouchMove:i,onTouchEnd:g}}function k0(t){let a=H.useRef(null),c=t.plugin,[r,h]=l1(t0),[e,l]=l1(P4),[v]=l1(_0),[n,i]=l1(n2),[g]=l1(I4),[o]=l1(a0),[A,m]=l1(k4),[z,w]=l1(L2),[F,O]=w1(!1),[S,B]=w1(""),[d,L]=w1(!1),[b,C]=w1(v4(n,c.app)),P=I2();m1(()=>C(v4(n,c.app)),[n]),m1(()=>{l(O2(n,c))},[A]),m1(()=>{d&&a.current.focus()},[d]);let k=e1=>{e1.map(u=>L1(this,null,function*(){u.arrayBuffer().then(x=>{c.app.vault.adapter.writeBinary(n+"/"+u.name,x)})}))},Q=e1=>{let u;return g.length>0&&(u=e1.filter(x=>!g.contains(x.extension))),o.length>0&&(u=u.filter(x=>{for(let V of o)if(x.path.startsWith(V))return!1;return!0})),c.settings.folderNote&&(u=u.filter(x=>x.basename!==x.parent.name)),u=u.sort((x,V)=>{if(v.contains(x)&&!v.contains(V))return-1;if(!v.contains(x)&&v.contains(V))return 1;if(c.settings.sortReverse&&([x,V]=[V,x]),c.settings.sortFilesBy==="name")return c.settings.showFileNameAsFullPath?x.path.localeCompare(V.path,"en",{numeric:!0}):x.name.localeCompare(V.name,"en",{numeric:!0});if(c.settings.sortFilesBy==="last-update")return V.stat.mtime-x.stat.mtime;if(c.settings.sortFilesBy==="created")return V.stat.ctime-x.stat.ctime;if(c.settings.sortFilesBy==="file-size")return V.stat.size-x.stat.size}),u},D=k1(()=>Q(e),[o,g,v,e,c.settings.sortFilesBy,c.settings.sortReverse]),_=e1=>{h("folder"),i("")},y=()=>{B(""),L(!d),l(O2(n,c))},I=new RegExp("all:(.*)?"),R=new RegExp("tag:(.*)?"),W=e1=>{var u=e1.target.value;B(u);var x=n;let V=u.match(R);if(V){if(C("Files with Tag"),V[1]===void 0||V[1].replace(/\s/g,"").length===0){l([]);return}l([...v1(V[1])]);return}let T=u.match(I);T?(u=T[1]?T[1]:"",x=c.settings.allSearchOnlyInFocusedFolder?z.path:"/",C("All Files")):C(v4(n,c.app));let f=G(u,x,!!T);l(f)},G=(e1,u,x)=>{var V=O2(u,c,x),T=V.filter(M=>M.name.toLowerCase().includes(e1.toLowerCase().trimStart()));return T},a1=e1=>{let u=c.app.metadataCache.getFileCache(e1),x=[];if(u.tags)for(let V of u.tags)x.push(V.tag);if(u.frontmatter&&u.frontmatter.tags){let V=u.frontmatter.tags;if(typeof V=="string"){let T=V.split(",");for(let M=0;M{let u=new Set,x=O2(c.settings.allSearchOnlyInFocusedFolder?z.path:"/",c,!0);for(let V of x){let T=a1(V);for(let M of T)M.toLowerCase().contains(e1.toLowerCase().trimStart())&&(u.has(V)||u.add(V))}return u},r1=()=>L1(this,null,function*(){c.settings.showFilesFromSubFolders=!A,yield c.saveSettings(),m(!A)}),u1=()=>{let e1=new CustomEvent(y1.revealFile,{detail:{file:c.app.workspace.getActiveFile()}});window.dispatchEvent(e1)},$=e1=>{let u=new A5.Menu(c.app),x=T=>{c.settings.sortFilesBy=T,c.saveSettings(),P()},V=(T,M,f,K)=>{u.addItem(h1=>{let n1=c.settings.sortReverse?`${f} to ${M}`:`${M} to ${f}`;h1.setTitle(`${T} (${n1})`),h1.setIcon(K===c.settings.sortFilesBy?"checkmark":"spaceIcon"),h1.onClick(()=>x(K))})};V("File Name","A","Z","name"),V("Created","New","Old","created"),V("File Size","Big","Small","file-size"),V("Last Update","New","Old","last-update"),u.addSeparator(),u.addItem(T=>{T.setTitle("Reverse Order"),T.setIcon(c.settings.sortReverse?"checkmark":"spaceIcon"),T.onClick(()=>{c.settings.sortReverse=!c.settings.sortReverse,c.saveSettings(),P()})}),u.showAtPosition({x:e1.pageX,y:e1.pageY})},s1=19;return H.createElement(H.Fragment,null,H.createElement(r4,{onDrop:k,noClick:!0,onDragEnter:()=>O(!0),onDragLeave:()=>O(!1),onDropAccepted:()=>O(!1),onDropRejected:()=>O(!1)},({getRootProps:e1,getInputProps:u})=>H.createElement("div",p2(q1({},e1()),{className:F?"drag-entered":"",style:{width:"100%",height:"100%",position:"relative"}}),H.createElement("input",q1({},u())),H.createElement("div",{className:"oz-explorer-container"},H.createElement("div",{className:`oz-file-tree-header-wrapper${c.settings.fixedHeaderInFileList?" file-tree-header-fixed":""}`},H.createElement("div",{className:"oz-flex-container"},H.createElement("div",{className:"oz-nav-action-button",style:{marginLeft:"0px"}},["Horizontal","Vertical"].includes(c.settings.evernoteView)?H.createElement(F3,{onClick:x=>_(x),size:s1,"aria-label":"Close File Pane"}):H.createElement(S3,{onClick:x=>_(x),size:s1,"aria-label":"Go Back to Folder View"})),H.createElement("div",{className:"oz-nav-buttons-right-block"},c.settings.revealActiveFileButton&&H.createElement("div",{className:"oz-nav-action-button"},H.createElement(H3,{onClick:u1,size:s1,"aria-label":"Reveal Active File"})),c.settings.showFilesFromSubFoldersButton&&H.createElement("div",{className:"oz-nav-action-button"},A?H.createElement(y3,{onClick:r1,size:s1,"aria-label":"Hide Files from Sub-Folders"}):H.createElement(O3,{onClick:r1,size:s1,"aria-label":"Show Files from Sub-Folders"})),c.settings.searchFunction&&H.createElement("div",{className:"oz-nav-action-button"},H.createElement(R3,{onClick:y,size:s1,"aria-label":"Search File by Name or Tag"})),H.createElement("div",{className:"oz-nav-action-button"},H.createElement(f0,{size:s1+2,onClick:$,"aria-label":"Sorting Options"})),H.createElement("div",{className:"oz-nav-action-button"},H.createElement(A3,{onClick:x=>j2(x,n,c),size:s1,"aria-label":"Create a Note"})))),d&&H.createElement("div",{className:"oz-input-container"},H.createElement("input",{type:"search",placeholder:"Search...",ref:a,value:S,onChange:W,onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),y())}})),H.createElement("div",{className:"oz-file-tree-header"},b)),H.createElement("div",{className:`oz-file-tree-files${c.settings.fixedHeaderInFileList?d?" file-tree-files-fixed-with-search":" file-tree-files-fixed":""}`},D.map(x=>H.createElement(ov,{file:x,plugin:c,key:x.path})))))))}var ov=t=>{let{file:a,plugin:c}=t,[r,h]=l1(_0),[e,l]=l1(T4),[v,n]=w1(!1),i=P0(d=>{o(a,d)},500);m1(()=>{if(v&&c.settings.filePreviewOnHover)return document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A)}},[v]);let g=(d,L)=>{V0({file:d,app:c.app,newLeaf:(L.ctrlKey||L.metaKey)&&!(L.shiftKey||L.altKey),leafBySplit:(L.ctrlKey||L.metaKey)&&(L.shiftKey||L.altKey)}),l(d)},o=(d,L)=>{let b=new A5.Menu(c.app);return b.addItem(C=>{C.setIcon("pin"),r.contains(d)?C.setTitle("Unpin"):C.setTitle("Pin to Top"),C.onClick(P=>{if(r.contains(d)){let k=r.filter(Q=>Q!==d);h(k)}else h([...r,d])})}),b.addItem(C=>{C.setTitle("Rename"),C.setIcon("pencil"),C.onClick(P=>{new l2(c,d,"rename").open()})}),b.addItem(C=>{C.setTitle("Delete"),C.setIcon("trash"),C.onClick(P=>{new m0(c,`Are you sure you want to delete the file "${d.basename}${d.extension==="md"?"":d.extension}"?`,function(){let Q=c.settings.deleteFileOption;Q==="permanent"?c.app.vault.delete(d,!0):Q==="system-trash"?c.app.vault.trash(d,!0):Q==="trash"&&c.app.vault.trash(d,!1)}).open()})}),b.addItem(C=>{C.setIcon("go-to-file"),C.setTitle("Open in a new tab"),C.onClick(P=>{k3(c.app,d)})}),b.addItem(C=>{C.setIcon("go-to-file"),C.setTitle("Open to right"),C.onClick(P=>{X8(c.app,d)})}),b.addItem(C=>{C.setTitle("Make a copy"),C.setIcon("documents"),C.onClick(P=>{c.app.vault.copy(d,`${d.parent.path}/${d.basename} 1.${d.extension}`)})}),n4("file-explorer",c.app)||b.addItem(C=>{C.setTitle("Move file to..."),C.setIcon("paper-plane"),C.onClick(P=>{new C0(c.app,d).open()})}),c.app.workspace.trigger("file-menu",b,d,"file-explorer"),B9(L)?b.showAtPosition({x:L.pageX,y:L.pageY}):b.showAtPosition({x:L.nativeEvent.locationX,y:L.nativeEvent.locationY}),!1},A=d=>{if(d.key==="Control"||d.key==="Meta"){let L=document.querySelector(`.oz-nav-file-title[data-path="${a.path}"]`);L&&c.app.workspace.trigger("link-hover",{},L,a.path,a.path)}},m=(d,L)=>{n(!0),c.settings.filePreviewOnHover&&(d.ctrlKey||d.metaKey)&&c.app.workspace.trigger("link-hover",{},d.target,L.path,L.path)},z=(d,L)=>{n(!1)},w=(d,L)=>{d.dataTransfer.setData("application/json",JSON.stringify({filePath:L.path})),c.app.dragManager.onDragStart(d,{icon:D0,source:void 0,title:L.name,type:"file",file:L}),c.app.dragManager.dragFile(d,L,!0)},F=d=>{d.button===1&&k3(c.app,a)},O=()=>a.extension==="pdf"?B3:["png","jpg","jpeg","svg"].contains(a.extension)?L3:["doc","docx"].contains(a.extension)?w3:f3,S=k1(()=>O(),[c.settings.iconBeforeFileName]),B=k1(()=>{let d=c.settings.showFileNameAsFullPath?a.path:a.name;return l4(d).fileName},[c.settings.showFileNameAsFullPath,a.path]);return H.createElement("div",q1({className:"oz-nav-file"+(e===a?" is-active":""),key:a.path,draggable:!0,onDragStart:d=>w(d,a),onClick:d=>g(a,d),onAuxClick:F,onContextMenu:d=>o(a,d),onMouseEnter:d=>m(d,a),onMouseLeave:d=>z(d,a)},i),H.createElement("div",{className:"oz-nav-file-title","data-path":a.path},H.createElement("div",{className:"oz-nav-file-title-content"},c.settings.iconBeforeFileName&&H.createElement(S,{className:"oz-nav-file-icon",size:15}),B),r.contains(a)&&H.createElement(C3,{className:"oz-nav-file-tag",size:14}),l4(a.name).extension!=="md"&&H.createElement("span",{className:"oz-nav-file-tag"},l4(a.name).extension)))};var D4=U1(require("obsidian"));function c0(t){let[a,c]=l1(C2),[r]=l1(m2),[h]=l1(n2),e=P0(B=>{t.onContextMenu(B)},500),[l,v]=w1(t.open),[n,i]=w1(!1),g=t.folder.path===h;m1(()=>v(t.open),[t.open]);let o=()=>{if(t.children){if(!l)c([...a,t.folder.path]);else{let B=a.filter(d=>t.folder.path!==d);c(B)}v(!l)}},A=B=>{B.map(d=>L1(this,null,function*(){d.arrayBuffer().then(L=>{t.plugin.app.vault.adapter.writeBinary(t.folder.path+"/"+d.name,L)})}))},m=B=>{if(t.plugin.settings.folderNote&&B.shiftKey){let d=`${t.folder.path}/${t.folder.name}.md`,L=t.plugin.app.vault.getAbstractFileByPath(d);t.plugin.app.workspace.openLinkText(d,"/",!1)}else t.onClick()},z=()=>t.onContextMenu(),w=k1(()=>j8(t.plugin,t.children,l),[l,t.children]),F=r[t.folder.path],O=B=>{let d=B.dataTransfer.getData("application/json");if(d!==""){let L=JSON.parse(d);if(L.filePath){let b=L.filePath,C=t.plugin.app.vault.getAbstractFileByPath(b);C?t.plugin.app.vault.rename(C,`${t.folder.path}/${C.name}`):new D4.Notice("Couldnt find the file")}else if(L.folderPath){let b=L.folderPath,C=t.plugin.app.vault.getAbstractFileByPath(b);C?t.folder.path.startsWith(C.path)?new D4.Notice("You cant move folder under its child"):t.plugin.app.vault.rename(C,`${t.folder.path}/${C.name}`):new D4.Notice("Couldnt find the folder")}}i(!1),B.dataTransfer.clearData()},S=(B,d)=>{B.dataTransfer.setData("application/json",JSON.stringify({folderPath:d.path}))};return H.createElement(r4,{onDrop:A,noClick:!0,onDragEnter:()=>i(!0),onDragLeave:()=>i(!1),onDropAccepted:()=>i(!1),onDropRejected:()=>i(!1)},({getRootProps:B,getInputProps:d})=>H.createElement(H.Fragment,null,H.createElement("div",{style:q1({},t.style),className:"treeview",draggable:!0,onDragStart:L=>S(L,t.folder),onDrop:L=>O(L),onDragOver:()=>i(!0),onDragLeave:()=>i(!1)},H.createElement("div",p2(q1({},B({className:"dropzone"})),{className:"oz-folder-element"+(n?" drag-entered":""),"data-path":t.folder.path}),H.createElement("input",q1({},d())),H.createElement("div",{className:"oz-folder-line"},H.createElement("div",{className:"oz-icon-div"},H.createElement(w,{className:"oz-folder-toggle",style:{opacity:t.children?1:.3},onClick:o})),H.createElement("div",q1({className:"oz-folder-block",onClick:m,onContextMenu:z},e),H.createElement("div",{className:"oz-folder-type",style:{marginRight:t.type?10:0}},t.type),H.createElement("div",{className:`oz-folder-name ${g?"is-folder-active":""}${t.isRootFolder?" is-root-folder":""}`},t.content," ",t.plugin.settings.folderNote&&t.folder.children.some(L=>L.name===`${t.folder.name}.md`)?H.createElement(Z3,{size:10,className:"oz-folder-note-icon"}):""),t.plugin.settings.folderCount&&H.createElement("div",{className:"oz-folder-count"},H.createElement("span",{className:"oz-nav-file-tag"},F?l?F.open:F.closed:0)))))),t.children&&H.createElement("div",{className:"oz-folder-contents",style:{height:l?"auto":0,opacity:l?1:0,display:l?"inherit":"none"}},t.children)))}var gv=({condition:t,wrapper:a,children:c})=>t?a(c):c,w9=gv;var E4=U1(require("obsidian"));function S5(t){let a=t.plugin,c=a.app,r=c.vault.getRoot(),[h]=l1(C2),[e,l]=l1(n2),[v,n]=l1(a0),[i,g]=l1(L2),[o]=l1(m2),[A,m]=l1(t0),z=S=>l(S),w=S=>{let B=S;return v.length>0&&(B=B.filter(d=>!v.contains(d.folder.path))),B=B.sort((d,L)=>{if(a.settings.sortFoldersBy==="name")return d.folder.name.localeCompare(L.folder.name,"en",{numeric:!0});if(a.settings.sortFoldersBy==="item-number"){let b=o[d.folder.path]?o[d.folder.path].closed:0;return(o[L.folder.path]?o[L.folder.path].closed:0)-b}}),B},F=S=>{let{event:B,folder:d}=S,L=B;B===void 0&&(L=window.event);let b=new E4.Menu(a.app);J8(d)&&b.addItem(k=>{k.setTitle("Focus on Folder").setIcon("zoomInIcon").onClick(()=>g(d))}),i.isRoot()||b.addItem(k=>{k.setTitle("Focus Back to Root").setIcon("zoomOutIcon").onClick(()=>g(r))}),b.addItem(k=>{k.setTitle("New Folder").setIcon("folder").onClick(Q=>{new l2(a,d,"create folder").open()})}),b.addItem(k=>{k.setTitle("Delete").setIcon("trash").onClick(Q=>{new m0(a,`Are you sure you want to delete folder "${d.name}" and all folders & files under it?`,()=>{let _=a.settings.deleteFileOption;_==="permanent"?a.app.vault.delete(d,!0):_==="system-trash"?a.app.vault.trash(d,!0):_==="trash"&&a.app.vault.trash(d,!1),e===d.path&&(l(""),m("folder"))}).open()})}),b.addItem(k=>{k.setTitle("Rename").setIcon("pencil").onClick(Q=>{new l2(a,d,"rename").open()})}),b.addItem(k=>{k.setTitle("New File").setIcon("document").onClick(Q=>{j2(Q,d.path,a)})}),n4("file-explorer",c)||b.addItem(k=>{k.setTitle("Move folder to...").setIcon("paper-plane").onClick(Q=>{new C0(c,d).open()})}),b.addItem(k=>{k.setTitle("Add to Excluded Folders").setIcon("switch").onClick(Q=>{n([...v,d.path])})});let C=`${d.path}/${d.name}.md`,P=d.children.some(k=>`${d.name}.md`===k.name);return P&&b.addItem(k=>{k.setTitle("Open Folder Note").setIcon("go-to-file").onClick(Q=>{a.app.workspace.activeLeaf.setViewState({type:"markdown",state:{file:C}})})}),a7(a.app,"folder-note-core")||(P?b.addItem(k=>{k.setTitle("Delete Folder Note").setIcon("trash").onClick(Q=>{let D=a.app.vault.getAbstractFileByPath(C);D&&a.app.vault.delete(D,!0)})}):b.addItem(k=>{k.setTitle("Create Folder Note").setIcon("create-new").onClick(Q=>L1(this,null,function*(){i4(a,d,d.name,`# ${d.name}`)}))})),c.workspace.trigger("file-menu",b,d,"file-explorer"),L instanceof MouseEvent?b.showAtPosition({x:L.pageX,y:L.pageY}):b.showAtPosition({x:0,y:0}),!1};if(!t.folderTree.children)return null;let O=k1(()=>w(t.folderTree.children),[t.folderTree.children,v,a.settings.sortFoldersBy]);return H.createElement(H.Fragment,null,Array.isArray(t.folderTree.children)&&O.map(S=>H.createElement(H.Fragment,{key:S.folder.path},S.folder.children.some(B=>B instanceof E4.TFolder)?H.createElement(c0,{plugin:a,content:S.folder.name,open:h.contains(S.folder.path),onClick:()=>z(S.folder.path),onContextMenu:B=>F({event:B,folder:S.folder}),folder:S.folder},H.createElement(S5,{plugin:a,folderTree:S})):H.createElement(c0,{plugin:a,content:S.folder.name,onClick:()=>z(S.folder.path),onContextMenu:B=>F({event:B,folder:S.folder}),folder:S.folder}))))}var F5=U1(require("obsidian"));function E0(t){let a={color:"var(--text-muted)",fill:"#c16ff7",width:"100%"},c=t.plugin,r=c.app,h=r.vault.getRoot(),[e,l]=l1(n2),[v]=l1(_4),[n,i]=l1(L2),[g,o]=l1(C2),[A]=l1(m2),m=I2(),z=d=>{new l2(c,d,"create folder").open()},w=(d,L)=>{let b=d;d===void 0&&(b=window.event);let C=new F5.Menu(r);return C.addItem(P=>{P.setTitle("New Folder").setIcon("folder").onClick(k=>z(L))}),L.isRoot()||C.addItem(P=>{P.setTitle("Focus Back to Root").setIcon("zoomOutDoubleIcon").onClick(()=>i(h))}),L.parent&&!L.parent.isRoot()&&L.parent!==n&&C.addItem(P=>{P.setTitle("Focus to Parent Folder").setIcon("zoomOutIcon").onClick(()=>i(L.parent))}),r.workspace.trigger("root-folder-menu",C,L),C.showAtPosition({x:b.pageX,y:b.pageY}),!1},F=()=>o([]),O=()=>{let d=[];d.push(v.folder.path);let L=b=>{for(let C of b)d.push(C.folder.path),C.children.length>0&&L(C.children)};L(v.children),o(d)},S=d=>{let L=new F5.Menu(c.app),b=C=>{c.settings.sortFoldersBy=C,c.saveSettings(),m()};return L.addItem(C=>{C.setTitle("Folder Name (A to Z)"),C.onClick(P=>{b("name")})}),c.settings.folderCount&&L.addItem(C=>{C.setTitle("Item Numbers (Bigger to Smaller)"),C.onClick(P=>{b("item-number")})}),c.app.workspace.trigger("sort-menu",L),L.showAtPosition({x:d.pageX,y:d.pageY}),!1},B=22;return H.createElement("div",{className:"oz-folders-tree-wrapper"},H.createElement("div",{className:"oz-folders-action-items file-tree-header-fixed"},H.createElement(b3,{className:"oz-nav-action-button",size:B,onClick:d=>z(c.app.vault.getRoot()),"aria-label":"Create Folder"}),H.createElement(f0,{className:"oz-nav-action-button",size:B,onClick:S,"aria-label":"Sorting Options"}),H.createElement(m3,{className:"oz-nav-action-button",size:B,onClick:F,"aria-label":"Collapse Folders"}),H.createElement(V3,{className:"oz-nav-action-button",size:B,onClick:O,"aria-label":"Expand Folders"})),H.createElement(w9,{condition:n&&!n.isRoot()||n&&n.isRoot&&c.settings.showRootFolder,wrapper:d=>H.createElement(c0,{plugin:c,content:n.isRoot()?c.app.vault.getName():n.name,open:!0,isRootFolder:n.isRoot(),style:a,onClick:()=>l(n.path),folder:n,onContextMenu:L=>w(L,n)},d)},v&&H.createElement(S5,{plugin:c,folderTree:v})))}var A9=t=>{let{plugin:a}=t,[c,r]=w1(!1),[h,e]=w1(null),[l,v]=w1(null),n=a2(),i=a2(),g=localStorage.getItem(a.keys.customHeightKey);m1(()=>{h&&localStorage.setItem(a.keys.customHeightKey,h.toString())},[h]);function o(z){z.preventDefault(),r(!0);let w=i.current.offsetTop-n.current.offsetTop;e(w),v(z.nativeEvent.clientY)}function A(z){z.preventDefault(),!!c&&(e(h+(z.nativeEvent.clientY-l)),v(z.nativeEvent.clientY))}function m(z){z.preventDefault(),r(!1),v(z.nativeEvent.clientY)}return H.createElement("div",{className:"file-tree-container",onMouseMove:z=>A(z),onMouseUp:z=>m(z)},H.createElement("div",{className:"oz-folder-pane",ref:n,style:{height:h?`${h}px`:g&&g!==""?`${g}px`:"50%"}},H.createElement(E0,{plugin:a})),H.createElement("div",{id:"file-tree-divider",ref:i,onClick:z=>z.preventDefault(),onMouseDown:z=>o(z),className:c?"active-divider":""}),H.createElement("div",{className:"oz-file-list-pane"},H.createElement(k0,{plugin:a})))},S9=t=>{let{plugin:a}=t,[c,r]=w1(!1),[h,e]=w1(null),[l,v]=w1(null),n=a2(),i=a2(),g=localStorage.getItem(a.keys.customWidthKey);m1(()=>{h&&localStorage.setItem(a.keys.customWidthKey,h.toString())},[h]);function o(z){z.preventDefault(),r(!0);let w=i.current.offsetLeft-n.current.offsetLeft;e(w),v(z.nativeEvent.clientX)}function A(z){z.preventDefault(),!!c&&(e(h+(z.nativeEvent.clientX-l)),v(z.nativeEvent.clientX))}function m(z){z.preventDefault(),r(!1),v(z.nativeEvent.clientX)}return H.createElement("div",{className:"file-tree-container-horizontal",onMouseMove:z=>A(z),onMouseUp:z=>m(z)},H.createElement("div",{className:"oz-folder-pane-horizontal",ref:n,style:{width:h?`${h}px`:g&&g!==""?`${g}px`:"50%"}},H.createElement(E0,{plugin:a})),H.createElement("div",{id:"file-tree-divider-horizontal",ref:i,onClick:z=>z.preventDefault(),onMouseDown:z=>o(z),className:c?"active-divider":""}),H.createElement("div",{className:"oz-file-list-pane-horizontal"},H.createElement(k0,{plugin:a})))};function y5(t){let{plugin:a}=t,c=I2(),[r,h]=l1(t0),[e,l]=l1(n2),[v,n]=l1(P4),[i,g]=l1(_0),[o,A]=l1(C2),[m,z]=l1(_4),[w,F]=l1(a0),[O,S]=l1(m2),[B,d]=l1(I4),[L,b]=l1(k4),[C,P]=l1(L2),[k,Q]=l1(T4),D=M=>{n(O2(M||e,a))},_=()=>{if(["Horizontal","Vertical"].includes(a.settings.evernoteView)){let M=localStorage.getItem(a.keys.activeFolderPathKey);if(M){let f=a.app.vault.getAbstractFileByPath(M);f&&f instanceof i2.TFolder&&l(f.path)}}};m1(()=>(window.addEventListener(y1.vaultChange,I),window.addEventListener(y1.activeFileChange,R),window.addEventListener(y1.refreshView,c),window.addEventListener(y1.revealFile,u),window.addEventListener(y1.createNewNote,y),()=>{window.removeEventListener(y1.vaultChange,I),window.removeEventListener(y1.activeFileChange,R),window.removeEventListener(y1.refreshView,c),window.removeEventListener(y1.revealFile,u),window.removeEventListener(y1.revealFile,y)}),[]);let y=()=>{let M="/";l(f=>(M=f,f)),j2(null,M,a)},I=M=>{e1(M.detail.file,M.detail.changeType,M.detail.oldPath)},R=M=>{let f=M.detail.filePath,K=a.app.vault.getAbstractFileByPath(f);K&&Q(K)};m1(()=>{W(),F(a1()),d(G()),g(r1()),A(v1()),b(a.settings.showFilesFromSubFolders),_(),a.settings.folderCount&&S(P3(a))},[]),m1(()=>{C&&(z(_3(C)),localStorage.setItem(a.keys.focusedFolder,C.path))},[C]);let W=()=>{let M=localStorage.getItem(a.keys.focusedFolder);if(M){let f=a.app.vault.getAbstractFileByPath(M);if(f&&f instanceof i2.TFolder){P(f);return}}P(a.app.vault.getRoot())};m1(()=>$(),[i]),m1(()=>u1(),[o]),m1(()=>s1(),[w]),m1(()=>{e!==""&&(D(e),h("file")),localStorage.setItem(a.keys.activeFolderPathKey,e)},[e]);function G(){let M=a.settings.excludedExtensions,f=[];for(let K of M.split(","))f.push(K.trim());return f}function a1(){let M=a.settings.excludedFolders,f=[];if(M)for(let K of M.split(","))K!==""&&f.push(K.trim());return f}function v1(){let M=[],f=localStorage.getItem(a.keys.openFoldersKey);if(f){f=JSON.parse(f);for(let K of f){let h1=a.app.vault.getAbstractFileByPath(K);h1&&M.push(h1.path)}}return M}function r1(){let M=[],f=localStorage.getItem(a.keys.pinnedFilesKey);if(f){f=JSON.parse(f);for(let K of f){let h1=a.app.vault.getAbstractFileByPath(K);h1&&M.push(h1)}}return M}function u1(){let M=[];for(let f of o)M.push(f);localStorage.setItem(a.keys.openFoldersKey,JSON.stringify(M))}function $(){let M=[];for(let f of i)M.push(f.path);localStorage.setItem(a.keys.pinnedFilesKey,JSON.stringify(M))}function s1(){a.settings.excludedFolders=w.length>1?w.join(", "):w[0],a.saveSettings()}function e1(M,f,K){let h1=null,n1="",p1="",i1=[];if(P(t1=>(h1=t1,t1)),l(t1=>(n1=t1,t1)),h(t1=>(p1=t1,t1)),n(t1=>(i1=t1,t1)),M instanceof i2.TFile){if(p1==="file")if(f==="rename"||f==="modify"||f==="delete"){let t1=a.settings.sortFilesBy;if(f==="modify"&&!(t1==="last-update"||t1==="file-size"))return;let D1=M.path.substring(0,M.path.lastIndexOf("/")),Z1=i1.some(R1=>R1.path===M.path),E1=n1===D1||a.settings.showFilesFromSubFolders&&D1.startsWith(n1);Z1?f==="delete"?n(i1.filter(R1=>R1.path!==M.path)):(f==="rename"||f==="modify"&&(t1==="last-update"||t1==="file-size"))&&n([...i1.filter(R1=>R1.path!==M.path),...M.parent.path===n1?[M]:[]]):E1&&!Z1&&n([...i1,M])}else f==="create"&&M.path.match(new RegExp(n1+".*"))&&(i1.some(D1=>D1.path===M.path)||n([...i1,M]))}else M instanceof i2.TFolder&&(z(_3(h1)),f==="rename"&&K&&n1===K&&l(M.path));a.settings.folderCount&&f!=="modify"&&S(P3(a))}m1(()=>{k&&v.length>0&&x(k)},[v]);function u(M){let f=M.detail.file;f&&f instanceof i2.TFile?T(f):new i2.Notice("No active file")}function x(M){let f=`div.oz-file-tree-files div.oz-nav-file-title[data-path="${M.path}"]`,K=document.querySelector(f);K&&K.scrollIntoView(!1)}function V(M){let f=`div.oz-folder-contents div.oz-folder-element[data-path="${M.path}"]`,K=document.querySelector(f);K&&K.scrollIntoView(!1)}function T(M){let f=M.parent;C&&C.path!=="/"&&P(a.app.vault.getRoot());let K=h1=>{let n1=[],p1=i1=>{n1.push(i1.path),i1.parent&&p1(i1.parent)};return p1(h1.parent),n1};if(f instanceof i2.TFolder){l(f.path),Q(M);let h1=K(M),n1=new Set([...o,...h1]);A(Array.from(n1)),x(M),V(f)}}return H.createElement(H.Fragment,null,r==="folder"?H.createElement(E0,{plugin:a}):a.settings.evernoteView==="Horizontal"?H.createElement(S9,{plugin:a}):a.settings.evernoteView==="Vertical"?H.createElement(A9,{plugin:a}):H.createElement(k0,{plugin:a}))}var _2="file-tree-view",dv="File Tree",D0="sheets-in-box",O5=class extends F9.ItemView{constructor(a,c){super(a);this.navigation=!1;this.plugin=c}getViewType(){return _2}getDisplayText(){return dv}getIcon(){return D0}onClose(){return L1(this,null,function*(){this.destroy()})}destroy(){H.unmountComponentAtNode(this.contentEl)}onOpen(){return L1(this,null,function*(){this.destroy(),this.constructFileTree(this.app.vault.getRoot().path,"")})}constructFileTree(a,c){this.destroy(),H.render(H.createElement("div",{className:"file-tree-plugin-view"},H.createElement(L9,null,H.createElement(y5,{fileTreeView:this,plugin:this.plugin}))),this.contentEl)}};var M1=U1(require("obsidian")),O9=U1(y9()),R9={openViewOnStart:!0,ribbonIcon:!0,showRootFolder:!0,showFilesFromSubFolders:!0,searchFunction:!0,allSearchOnlyInFocusedFolder:!1,showFilesFromSubFoldersButton:!0,revealActiveFileButton:!1,excludedExtensions:"",excludedFolders:"",folderIcon:"default",folderCount:!0,folderCountOption:"notes",evernoteView:"Vertical",filePreviewOnHover:!1,iconBeforeFileName:!0,sortFilesBy:"name",sortReverse:!1,sortFoldersBy:"name",fixedHeaderInFileList:!0,createdYaml:!1,fileNameIsHeader:!1,folderNote:!1,deleteFileOption:"trash",showFileNameAsFullPath:!1},R5=class extends M1.PluginSettingTab{constructor(a,c){super(a,c);this.plugin=c}refreshView(){let a=new CustomEvent(y1.refreshView,{});window.dispatchEvent(a)}display(){let{containerEl:a}=this;a.empty();let c=new O9.LocalStorageHandler({}),r=a.createDiv("tip");r.addClass("oz-tip-div");let e=r.createEl("a",{href:"https://revolut.me/ozante"}).createEl("img",{attr:{src:"https://raw.githubusercontent.com/ozntel/file-tree-alternative/main/images/tip%20the%20artist_v2.png"}});e.height=55;let l=a.createDiv("coffee");l.addClass("oz-coffee-div");let n=l.createEl("a",{href:"https://ko-fi.com/L3L356V6Q"}).createEl("img",{attr:{src:"https://cdn.ko-fi.com/cdn/kofi2.png?v=3"}});n.height=45,a.createEl("h2",{text:"General"}),new M1.Setting(a).setName("Evernote View").setDesc("Turn on if you want to see the folders and files in a single view without switching between views. Similar experience to Evernote.").addDropdown(i=>{i.addOption("Disabled","Disabled").addOption("Horizontal","Horizontal").addOption("Vertical","Vertical").setValue(this.plugin.settings.evernoteView).onChange(g=>{this.plugin.settings.evernoteView=g,this.plugin.saveSettings(),this.refreshView()})}),new M1.Setting(a).setName("Ribbon Icon").setDesc("Turn on if you want Ribbon Icon for activating the File Tree.").addToggle(i=>i.setValue(this.plugin.settings.ribbonIcon).onChange(g=>{this.plugin.settings.ribbonIcon=g,this.plugin.saveSettings(),this.plugin.refreshIconRibbon()})),new M1.Setting(a).setName("Open on Start").setDesc("Turn off if you don't want file tree view to be opened automatically during vault start").addToggle(i=>i.setValue(this.plugin.settings.openViewOnStart).onChange(g=>{this.plugin.settings.openViewOnStart=g,this.plugin.saveSettings()})),a.createEl("h2",{text:"Folder Pane Settings"}),new M1.Setting(a).setName("Folder Icons").setDesc("Change the default folder icons your preferred option").addDropdown(i=>{i.addOption("default","Default").addOption("box-folder","Box Icons").addOption("icomoon","IcoMoon Icons").addOption("typicon","Typicons").addOption("circle-gg","Circle GG").setValue(this.plugin.settings.folderIcon).onChange(g=>{this.plugin.settings.folderIcon=g,this.plugin.saveSettings(),this.refreshView()})}),new M1.Setting(a).setName("Show Root Folder").setDesc(`Turn on if you want your Root Folder "${this.plugin.app.vault.getName()}" to be visible in the file tree`).addToggle(i=>i.setValue(this.plugin.settings.showRootFolder).onChange(g=>{this.plugin.settings.showRootFolder=g,this.plugin.saveSettings(),this.refreshView()})),new M1.Setting(a).setName("Folder Count").setDesc("Turn on if you want see the number of notes/files under file tree.").addToggle(i=>i.setValue(this.plugin.settings.folderCount).onChange(g=>{this.plugin.settings.folderCount=g,this.plugin.saveSettings(),this.plugin.refreshTreeLeafs()})),new M1.Setting(a).setName("Folder Count Details").setDesc("Select which files you want to be included into count").addDropdown(i=>{i.addOption("notes","Notes"),i.addOption("files","All Files"),i.setValue(this.plugin.settings.folderCountOption),i.onChange(g=>{this.plugin.settings.folderCountOption=g,this.plugin.saveSettings(),this.refreshView()})}),new M1.Setting(a).setName("Folder Note").setDesc(`Turn this option on if you want to create Folder Note same as Folder Note Plugin. By default, Click will open the list of files. You need to use "Shift+Click" to open the folder note. If folder has a folder note, you will see an arrow icon on the right side of folder. The note created as a folder note is hidden in the file list.`).addToggle(i=>{i.setValue(this.plugin.settings.folderNote).onChange(g=>{this.plugin.settings.folderNote=g,this.plugin.saveSettings(),this.refreshView()})}),a.createEl("h2",{text:"File Pane Settings"}),new M1.Setting(a).setName("Include Files From Subfolders to the File List").setDesc("Turn on this option if you want to see the list of files from all subfolders in addition to the selected folder").addToggle(i=>i.setValue(this.plugin.settings.showFilesFromSubFolders).onChange(g=>{this.plugin.settings.showFilesFromSubFolders=g,this.plugin.saveSettings(),this.refreshView()})),new M1.Setting(a).setName("Toggle Button for Include Files from Subfolders").setDesc('Turn on this option if you want to have an additional button on the top of the file list to toggle "Include Files From Subfolders"').addToggle(i=>i.setValue(this.plugin.settings.showFilesFromSubFoldersButton).onChange(g=>{this.plugin.settings.showFilesFromSubFoldersButton=g,this.plugin.saveSettings(),this.refreshView()})),new M1.Setting(a).setName("Reveal Active File in File Tree Button").setDesc("Turn on this option if you want to have an additional button to reveal the active file in the file tree. It will set the folder and file pane accordingly.").addToggle(i=>i.setValue(this.plugin.settings.revealActiveFileButton).onChange(g=>{this.plugin.settings.revealActiveFileButton=g,this.plugin.saveSettings(),this.refreshView()})),new M1.Setting(a).setName("Search in File List").setDesc("Turn on this option if you want to enable search function to filter files by name.").addToggle(i=>i.setValue(this.plugin.settings.searchFunction).onChange(g=>{this.plugin.settings.searchFunction=g,this.plugin.saveSettings(),this.refreshView()})),new M1.Setting(a).setName("All & Tag Search only in Focused Folder").setDesc('"all:" and "tag:" searches by default looks for all files in your vault. Turn on this option if you want search only in Focused Folder').addToggle(i=>i.setValue(this.plugin.settings.allSearchOnlyInFocusedFolder).onChange(g=>{this.plugin.settings.allSearchOnlyInFocusedFolder=g,this.plugin.saveSettings()})),new M1.Setting(a).setName("Icon Before File Name").setDesc("Turn on if you want to file icon before the file name in the file list.").addToggle(i=>i.setValue(this.plugin.settings.iconBeforeFileName).onChange(g=>{this.plugin.settings.iconBeforeFileName=g,this.plugin.saveSettings(),this.refreshView()})),new M1.Setting(a).setName("Preview File on Hover").setDesc("Turn on if you want to preview the files once you hover on them within the file list holding Ctrl/Cmd button.").addToggle(i=>i.setValue(this.plugin.settings.filePreviewOnHover).onChange(g=>{this.plugin.settings.filePreviewOnHover=g,this.plugin.saveSettings()})),new M1.Setting(a).setName("Fixed Buttons and Header in File Pane").setDesc("Turn on if you want buttons and header to be not scrolled within the file list.").addToggle(i=>i.setValue(this.plugin.settings.fixedHeaderInFileList).onChange(g=>{this.plugin.settings.fixedHeaderInFileList=g,this.plugin.saveSettings(),this.refreshView()})),new M1.Setting(a).setName("Show file names as full path").setDesc("Turn on if you want to see the full path within the file name list rather than only file name").addToggle(i=>{i.setValue(this.plugin.settings.showFileNameAsFullPath).onChange(g=>{this.plugin.settings.showFileNameAsFullPath=g,this.plugin.saveSettings(),this.refreshView()})}),new M1.Setting(a).setName("Deleted File Destination").setDesc("Select where you want files to be moved once they are deleted").addDropdown(i=>{i.addOption("permanent","Delete Permanently"),i.addOption("trash","Move to Obsidian Trash"),i.addOption("system-trash","Move to System Trash"),i.setValue(this.plugin.settings.deleteFileOption),i.onChange(g=>{this.plugin.settings.deleteFileOption=g,this.plugin.saveSettings()})}),a.createEl("h2",{text:"File Creation"}),a.createEl("p",{text:"The settings below are only applicable if the plus (+) button within the file pane of the plugin is used."}),new M1.Setting(a).setName("Created information in YAML").setDesc("Turn on if you want plugin to include created YAML key with the time of creation").addToggle(i=>{i.setValue(this.plugin.settings.createdYaml).onChange(g=>{this.plugin.settings.createdYaml=g,this.plugin.saveSettings()})}),new M1.Setting(a).setName("Set File Name as Header 1").setDesc("Turn on if you want plugin to add the initial file name as main header in the created file.").addToggle(i=>{i.setValue(this.plugin.settings.fileNameIsHeader).onChange(g=>{this.plugin.settings.fileNameIsHeader=g,this.plugin.saveSettings()})}),a.createEl("h2",{text:"Exclude Settings"}),new M1.Setting(a).setName("Excluded File Extensions").setDesc(`Provide extension of files, which you want to exclude from listing in file tree, divided by comma. i.e. 'png, pdf, jpeg'. You need to reload the vault or use "Reload File Tree" button below to make changes effective.`).addTextArea(i=>i.setValue(this.plugin.settings.excludedExtensions).onChange(g=>{this.plugin.settings.excludedExtensions=g,this.plugin.saveSettings()})),new M1.Setting(a).setName("Excluded Folder Paths").setDesc(`Provide full path of folders, which you want to exclude from listing in file tree, divided by comma. i.e. 'Personal/Attachments, Work/Documents/Folders'. All subfolders are going to be excluded, as well. You need to reload the vault or use "Reload File Tree" button below to make changes effective.`).addTextArea(i=>i.setValue(this.plugin.settings.excludedFolders).onChange(g=>{this.plugin.settings.excludedFolders=g,this.plugin.saveSettings()})),new M1.Setting(a).setDesc("Use this button to reload the file tree. Reloading the file tree is required for some of the settings. You can also restart your vault to have same effect.").addButton(i=>{i.setClass("reload-file-tree-button").setTooltip("Click here to reload the file tree").setButtonText("Reload File Tree").onClick(g=>{this.plugin.refreshTreeLeafs()})}),a.createEl("h2",{text:"Clear Data"}),new M1.Setting(a).setName("Clear All Cache Data").setDesc(`This button will clear the following cache data: "Last position of the divider" & "List of expanded folders in the folder pane", & "Last active folder path". It will not touch your settings above and list of pinned files. It is recommended to do this clearing once in a while.`).addButton(i=>{let g=i.setTooltip("Click here to clear the cache data").setButtonText("Click for Clearing the Cache").onClick(()=>L1(this,null,function*(){c.removeFromLocalStorage({key:this.plugin.keys.customHeightKey}),c.removeFromLocalStorage({key:this.plugin.keys.customWidthKey}),c.removeFromLocalStorage({key:this.plugin.keys.openFoldersKey}),c.removeFromLocalStorage({key:this.plugin.keys.activeFolderPathKey}),c.removeFromLocalStorage({key:this.plugin.keys.focusedFolder}),this.plugin.refreshTreeLeafs(),new M1.Notice("The plugin cache is cleared...")}))}),new M1.Setting(a).setName("Clear Pinned Files").setDesc("This button will clear the pinned files in the file list pane.").addButton(i=>{let g=i.setTooltip("Click here to clear the pinned files").setButtonText("Click for Clearing the Pinned files").onClick(()=>L1(this,null,function*(){c.removeFromLocalStorage({key:this.plugin.keys.pinnedFilesKey}),this.plugin.refreshTreeLeafs(),new M1.Notice("The pinned files are cleared...")}))})}};var y1={activeFileChange:"fta-active-file-change",refreshView:"fta-refresh-view",revealFile:"fta-reveal-file",vaultChange:"fta-vault-change",createNewNote:"fta-create-new-note"},Z5=class extends B2.Plugin{constructor(){super(...arguments);this.ribbonIconEl=void 0;this.keys={activeFolderPathKey:"fileTreePlugin-ActiveFolderPath",pinnedFilesKey:"fileTreePlugin-PinnedFiles",openFoldersKey:"fileTreePlugin-OpenFolders",customHeightKey:"fileTreePlugin-CustomHeight",customWidthKey:"fileTreePlugin-CustomWidth",focusedFolder:"fileTreePlugin-FocusedFolder"};this.triggerVaultChangeEvent=(a,c,r)=>{let h=new CustomEvent(y1.vaultChange,{detail:{file:a,changeType:c,oldPath:r||""}});window.dispatchEvent(h)};this.onCreate=a=>this.triggerVaultChangeEvent(a,"create","");this.onDelete=a=>this.triggerVaultChangeEvent(a,"delete","");this.onModify=a=>this.triggerVaultChangeEvent(a,"modify","");this.onRename=(a,c)=>this.triggerVaultChangeEvent(a,"rename",c);this.refreshIconRibbon=()=>{var a;(a=this.ribbonIconEl)==null||a.remove(),this.settings.ribbonIcon&&(this.ribbonIconEl=this.addRibbonIcon(D0,"File Tree Alternative Plugin",()=>L1(this,null,function*(){yield this.openFileTreeLeaf(!0)})))};this.openFileTreeLeaf=a=>L1(this,null,function*(){let c=this.app.workspace.getLeavesOfType(_2);if(c.length==0){let r=this.app.workspace.getLeftLeaf(!1);yield r.setViewState({type:_2}),a&&this.app.workspace.revealLeaf(r)}else a&&c.forEach(r=>this.app.workspace.revealLeaf(r))});this.detachFileTreeLeafs=()=>{let a=this.app.workspace.getLeavesOfType(_2);for(let c of a)c.view.destroy(),c.detach()};this.refreshTreeLeafs=()=>{this.detachFileTreeLeafs(),this.openFileTreeLeaf(!0)}}onload(){return L1(this,null,function*(){console.log("Loading Alternative File Tree Plugin"),(0,B2.addIcon)("zoomInIcon",q8),(0,B2.addIcon)("zoomOutIcon",W8),(0,B2.addIcon)("zoomOutDoubleIcon",G8),(0,B2.addIcon)("locationIcon",U8),(0,B2.addIcon)("spaceIcon",$8),this.addSettingTab(new R5(this.app,this)),yield this.loadSettings(),this.registerView(_2,a=>new O5(a,this)),this.app.workspace.onLayoutReady(()=>L1(this,null,function*(){this.settings.openViewOnStart&&(yield this.openFileTreeLeaf(!0))})),this.addCommand({id:"open-file-tree-view",name:"Open File Tree View",callback:()=>L1(this,null,function*(){return yield this.openFileTreeLeaf(!0)})}),this.addCommand({id:"reveal-active-file",name:"Reveal Active File",callback:()=>{let a=this.app.workspace.getLeavesOfType(_2);a.length===0&&this.openFileTreeLeaf(!0);for(let r of a)this.app.workspace.revealLeaf(r);let c=new CustomEvent(y1.revealFile,{detail:{file:this.app.workspace.getActiveFile()}});window.dispatchEvent(c)}}),this.addCommand({id:" create-new-note",name:"Create a New Note",callback:()=>{let a=new CustomEvent(y1.createNewNote,{detail:{}});window.dispatchEvent(a)}}),this.app.vault.on("create",this.onCreate),this.app.vault.on("delete",this.onDelete),this.app.vault.on("modify",this.onModify),this.app.vault.on("rename",this.onRename),this.refreshIconRibbon()})}onunload(){console.log("Unloading Alternative File Tree Plugin"),this.detachFileTreeLeafs(),this.app.vault.off("create",this.onCreate),this.app.vault.off("delete",this.onDelete),this.app.vault.off("modify",this.onModify),this.app.vault.off("rename",this.onRename)}loadSettings(){return L1(this,null,function*(){this.settings=Object.assign({},R9,yield this.loadData())})}saveSettings(){return L1(this,null,function*(){yield this.saveData(this.settings)})}};0&&(module.exports={eventTypes});