diff --git a/.obsidian/plugins/google-calendar/main.js b/.obsidian/plugins/google-calendar/main.js deleted file mode 100644 index 1784e3e..0000000 --- a/.obsidian/plugins/google-calendar/main.js +++ /dev/null @@ -1,203 +0,0 @@ -/* -THIS IS A GENERATED/BUNDLED FILE BY ESBUILD -if you want to view the source, please visit the github repository of this plugin -*/ - -var aM=Object.create;var za=Object.defineProperty,lM=Object.defineProperties,uM=Object.getOwnPropertyDescriptor,fM=Object.getOwnPropertyDescriptors,cM=Object.getOwnPropertyNames,f_=Object.getOwnPropertySymbols,dM=Object.getPrototypeOf,c_=Object.prototype.hasOwnProperty,pM=Object.prototype.propertyIsEnumerable;var d_=(t,e,n)=>e in t?za(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,zn=(t,e)=>{for(var n in e||(e={}))c_.call(e,n)&&d_(t,n,e[n]);if(f_)for(var n of f_(e))pM.call(e,n)&&d_(t,n,e[n]);return t},Ps=(t,e)=>lM(t,fM(e)),p_=t=>za(t,"__esModule",{value:!0});var B4=typeof require!="undefined"?require:t=>{throw new Error('Dynamic require of "'+t+'" is not supported')};var Oi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),hM=(t,e)=>{p_(t);for(var n in e)za(t,n,{get:e[n],enumerable:!0})},mM=(t,e,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of cM(e))!c_.call(t,r)&&r!=="default"&&za(t,r,{get:()=>e[r],enumerable:!(n=uM(e,r))||n.enumerable});return t},Oe=t=>mM(p_(za(t!=null?aM(dM(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var te=(t,e,n)=>new Promise((r,i)=>{var o=f=>{try{u(n.next(f))}catch(c){i(c)}},a=f=>{try{u(n.throw(f))}catch(c){i(c)}},u=f=>f.done?r(f.value):Promise.resolve(f.value).then(o,a);u((n=n.apply(t,e)).next())});var Bu=Oi(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});var Xt=require("obsidian"),Ep="YYYY-MM-DD",Tp="gggg-[W]ww",$_="YYYY-MM",e1="YYYY-[Q]Q",t1="YYYY";function el(t){var n,r;let e=window.app.plugins.getPlugin("periodic-notes");return e&&((r=(n=e.settings)==null?void 0:n[t])==null?void 0:r.enabled)}function tl(){var t,e,n,r;try{let{internalPlugins:i,plugins:o}=window.app;if(el("daily")){let{format:c,folder:p,template:h}=((e=(t=o.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.daily)||{};return{format:c||Ep,folder:(p==null?void 0:p.trim())||"",template:(h==null?void 0:h.trim())||""}}let{folder:a,format:u,template:f}=((r=(n=i.getPluginById("daily-notes"))==null?void 0:n.instance)==null?void 0:r.options)||{};return{format:u||Ep,folder:(a==null?void 0:a.trim())||"",template:(f==null?void 0:f.trim())||""}}catch(i){console.info("No custom daily note settings found!",i)}}function nl(){var t,e,n,r,i,o,a;try{let u=window.app.plugins,f=(t=u.getPlugin("calendar"))==null?void 0:t.options,c=(n=(e=u.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:n.weekly;if(el("weekly"))return{format:c.format||Tp,folder:((r=c.folder)==null?void 0:r.trim())||"",template:((i=c.template)==null?void 0:i.trim())||""};let p=f||{};return{format:p.weeklyNoteFormat||Tp,folder:((o=p.weeklyNoteFolder)==null?void 0:o.trim())||"",template:((a=p.weeklyNoteTemplate)==null?void 0:a.trim())||""}}catch(u){console.info("No custom weekly note settings found!",u)}}function rl(){var e,n,r,i;let t=window.app.plugins;try{let o=el("monthly")&&((n=(e=t.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:n.monthly)||{};return{format:o.format||$_,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((i=o.template)==null?void 0:i.trim())||""}}catch(o){console.info("No custom monthly note settings found!",o)}}function il(){var e,n,r,i;let t=window.app.plugins;try{let o=el("quarterly")&&((n=(e=t.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:n.quarterly)||{};return{format:o.format||e1,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((i=o.template)==null?void 0:i.trim())||""}}catch(o){console.info("No custom quarterly note settings found!",o)}}function ol(){var e,n,r,i;let t=window.app.plugins;try{let o=el("yearly")&&((n=(e=t.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:n.yearly)||{};return{format:o.format||t1,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((i=o.template)==null?void 0:i.trim())||""}}catch(o){console.info("No custom yearly note settings found!",o)}}function n1(...t){let e=[];for(let r=0,i=t.length;r{let O=r(),D=t.clone().set({hour:O.get("hour"),minute:O.get("minute"),second:O.get("second")});return v&&D.add(parseInt(b,10),E),y?D.format(y.substring(1).trim()):D.format(o)}).replace(/{{\s*yesterday\s*}}/gi,t.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,t.clone().add(1,"d").format(o)));return e.foldManager.save(h,f),h}catch(h){console.error(`Failed to create file: '${p}'`,h),new Xt.Notice("Unable to create new file.")}})}function iA(t,e){var n;return(n=e[Ur(t,"day")])!=null?n:null}function oA(){let{vault:t}=window.app,{folder:e}=tl(),n=t.getAbstractFileByPath(Xt.normalizePath(e));if(!n)throw new o1("Failed to find daily notes folder");let r={};return Xt.Vault.recurseChildren(n,i=>{if(i instanceof Xt.TFile){let o=Ws(i,"day");if(o){let a=Ur(o,"day");r[a]=i}}}),r}var a1=class extends Error{};function sA(){let{moment:t}=window,e=t.localeData()._week.dow,n=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;e;)n.push(n.shift()),e--;return n}function aA(t){return sA().indexOf(t.toLowerCase())}function l1(t){return te(this,null,function*(){let{vault:e}=window.app,{template:n,format:r,folder:i}=nl(),[o,a]=yield Ys(n),u=t.format(r),f=yield sl(i,u);try{let c=yield e.create(f,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(p,h,m,_,v,b)=>{let E=window.moment(),y=t.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return m&&y.add(parseInt(_,10),v),b?y.format(b.substring(1).trim()):y.format(r)}).replace(/{{\s*title\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(p,h,m)=>{let _=aA(h);return t.weekday(_).format(m.trim())}));return window.app.foldManager.save(c,a),c}catch(c){console.error(`Failed to create file: '${f}'`,c),new Xt.Notice("Unable to create new file.")}})}function lA(t,e){var n;return(n=e[Ur(t,"week")])!=null?n:null}function uA(){let t={};if(!p1())return t;let{vault:e}=window.app,{folder:n}=nl(),r=e.getAbstractFileByPath(Xt.normalizePath(n));if(!r)throw new a1("Failed to find weekly notes folder");return Xt.Vault.recurseChildren(r,i=>{if(i instanceof Xt.TFile){let o=Ws(i,"week");if(o){let a=Ur(o,"week");t[a]=i}}}),t}var u1=class extends Error{};function f1(t){return te(this,null,function*(){let{vault:e}=window.app,{template:n,format:r,folder:i}=rl(),[o,a]=yield Ys(n),u=t.format(r),f=yield sl(i,u);try{let c=yield e.create(f,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(p,h,m,_,v,b)=>{let E=window.moment(),y=t.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return m&&y.add(parseInt(_,10),v),b?y.format(b.substring(1).trim()):y.format(r)}).replace(/{{\s*date\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,u));return window.app.foldManager.save(c,a),c}catch(c){console.error(`Failed to create file: '${f}'`,c),new Xt.Notice("Unable to create new file.")}})}function fA(t,e){var n;return(n=e[Ur(t,"month")])!=null?n:null}function cA(){let t={};if(!h1())return t;let{vault:e}=window.app,{folder:n}=rl(),r=e.getAbstractFileByPath(Xt.normalizePath(n));if(!r)throw new u1("Failed to find monthly notes folder");return Xt.Vault.recurseChildren(r,i=>{if(i instanceof Xt.TFile){let o=Ws(i,"month");if(o){let a=Ur(o,"month");t[a]=i}}}),t}var c1=class extends Error{};function dA(t){return te(this,null,function*(){let{vault:e}=window.app,{template:n,format:r,folder:i}=il(),[o,a]=yield Ys(n),u=t.format(r),f=yield sl(i,u);try{let c=yield e.create(f,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(p,h,m,_,v,b)=>{let E=window.moment(),y=t.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return m&&y.add(parseInt(_,10),v),b?y.format(b.substring(1).trim()):y.format(r)}).replace(/{{\s*date\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,u));return window.app.foldManager.save(c,a),c}catch(c){console.error(`Failed to create file: '${f}'`,c),new Xt.Notice("Unable to create new file.")}})}function pA(t,e){var n;return(n=e[Ur(t,"quarter")])!=null?n:null}function hA(){let t={};if(!m1())return t;let{vault:e}=window.app,{folder:n}=il(),r=e.getAbstractFileByPath(Xt.normalizePath(n));if(!r)throw new c1("Failed to find quarterly notes folder");return Xt.Vault.recurseChildren(r,i=>{if(i instanceof Xt.TFile){let o=Ws(i,"quarter");if(o){let a=Ur(o,"quarter");t[a]=i}}}),t}var d1=class extends Error{};function mA(t){return te(this,null,function*(){let{vault:e}=window.app,{template:n,format:r,folder:i}=ol(),[o,a]=yield Ys(n),u=t.format(r),f=yield sl(i,u);try{let c=yield e.create(f,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(p,h,m,_,v,b)=>{let E=window.moment(),y=t.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return m&&y.add(parseInt(_,10),v),b?y.format(b.substring(1).trim()):y.format(r)}).replace(/{{\s*date\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,u));return window.app.foldManager.save(c,a),c}catch(c){console.error(`Failed to create file: '${f}'`,c),new Xt.Notice("Unable to create new file.")}})}function gA(t,e){var n;return(n=e[Ur(t,"year")])!=null?n:null}function _A(){let t={};if(!g1())return t;let{vault:e}=window.app,{folder:n}=ol(),r=e.getAbstractFileByPath(Xt.normalizePath(n));if(!r)throw new d1("Failed to find yearly notes folder");return Xt.Vault.recurseChildren(r,i=>{if(i instanceof Xt.TFile){let o=Ws(i,"year");if(o){let a=Ur(o,"year");t[a]=i}}}),t}function vA(){var r,i;let{app:t}=window,e=t.internalPlugins.plugins["daily-notes"];if(e&&e.enabled)return!0;let n=t.plugins.getPlugin("periodic-notes");return n&&((i=(r=n.settings)==null?void 0:r.daily)==null?void 0:i.enabled)}function p1(){var n,r;let{app:t}=window;if(t.plugins.getPlugin("calendar"))return!0;let e=t.plugins.getPlugin("periodic-notes");return e&&((r=(n=e.settings)==null?void 0:n.weekly)==null?void 0:r.enabled)}function h1(){var n,r;let{app:t}=window,e=t.plugins.getPlugin("periodic-notes");return e&&((r=(n=e.settings)==null?void 0:n.monthly)==null?void 0:r.enabled)}function m1(){var n,r;let{app:t}=window,e=t.plugins.getPlugin("periodic-notes");return e&&((r=(n=e.settings)==null?void 0:n.quarterly)==null?void 0:r.enabled)}function g1(){var n,r;let{app:t}=window,e=t.plugins.getPlugin("periodic-notes");return e&&((r=(n=e.settings)==null?void 0:n.yearly)==null?void 0:r.enabled)}function yA(t){return{day:tl,week:nl,month:rl,quarter:il,year:ol}[t]()}function wA(t,e){return{day:s1,month:f1,week:l1}[t](e)}ot.DEFAULT_DAILY_NOTE_FORMAT=Ep;ot.DEFAULT_MONTHLY_NOTE_FORMAT=$_;ot.DEFAULT_QUARTERLY_NOTE_FORMAT=e1;ot.DEFAULT_WEEKLY_NOTE_FORMAT=Tp;ot.DEFAULT_YEARLY_NOTE_FORMAT=t1;ot.appHasDailyNotesPluginLoaded=vA;ot.appHasMonthlyNotesPluginLoaded=h1;ot.appHasQuarterlyNotesPluginLoaded=m1;ot.appHasWeeklyNotesPluginLoaded=p1;ot.appHasYearlyNotesPluginLoaded=g1;ot.createDailyNote=s1;ot.createMonthlyNote=f1;ot.createPeriodicNote=wA;ot.createQuarterlyNote=dA;ot.createWeeklyNote=l1;ot.createYearlyNote=mA;ot.getAllDailyNotes=oA;ot.getAllMonthlyNotes=cA;ot.getAllQuarterlyNotes=hA;ot.getAllWeeklyNotes=uA;ot.getAllYearlyNotes=_A;ot.getDailyNote=iA;ot.getDailyNoteSettings=tl;ot.getDateFromFile=Ws;ot.getDateFromPath=rA;ot.getDateUID=Ur;ot.getMonthlyNote=fA;ot.getMonthlyNoteSettings=rl;ot.getPeriodicNoteSettings=yA;ot.getQuarterlyNote=pA;ot.getQuarterlyNoteSettings=il;ot.getTemplateInfo=Ys;ot.getWeeklyNote=lA;ot.getWeeklyNoteSettings=nl;ot.getYearlyNote=gA;ot.getYearlyNoteSettings=ol});var Ri=Oi((js,al)=>{(function(){var t,e="4.17.21",n=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",o="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",c=1,p=2,h=4,m=1,_=2,v=1,b=2,E=4,y=8,O=16,D=32,F=64,P=128,L=256,R=512,M=30,H="...",le=800,V=16,X=1,K=2,ce=3,S=1/0,Q=9007199254740991,j=17976931348623157e292,U=0/0,J=4294967295,re=J-1,Y=J>>>1,z=[["ary",P],["bind",v],["bindKey",b],["curry",y],["curryRight",O],["flip",R],["partial",D],["partialRight",F],["rearg",L]],ee="[object Arguments]",_e="[object Array]",Ce="[object AsyncFunction]",Fe="[object Boolean]",je="[object Date]",pt="[object DOMException]",ht="[object Error]",ge="[object Function]",Ee="[object GeneratorFunction]",vt="[object Map]",Ht="[object Number]",mr="[object Null]",rt="[object Object]",Ue="[object Promise]",Vn="[object Proxy]",tr="[object RegExp]",_n="[object Set]",vn="[object String]",Yn="[object Symbol]",Gt="[object Undefined]",Wn="[object WeakMap]",Cn="[object WeakSet]",yn="[object ArrayBuffer]",jn="[object DataView]",Kn="[object Float32Array]",Zn="[object Float64Array]",Hi="[object Int8Array]",ei="[object Int16Array]",Oo="[object Int32Array]",Mo="[object Uint8Array]",ne="[object Uint8ClampedArray]",De="[object Uint16Array]",bt="[object Uint32Array]",St=/\b__p \+= '';/g,nr=/\b(__p \+=) '' \+/g,_i=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ps=/&(?:amp|lt|gt|quot|#39);/g,hs=/[&<>"']/g,Tc=RegExp(ps.source),Sc=RegExp(hs.source),Cc=/<%-([\s\S]+?)%>/g,Dc=/<%([\s\S]+?)%>/g,Wl=/<%=([\s\S]+?)%>/g,Oc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mc=/^\w*$/,Ac=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sa=/[\\^$.*+?()[\]{}|]/g,Pc=RegExp(Sa.source),Ca=/^\s+/,Nc=/\s/,xc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ic=/\{\n\/\* \[wrapped with (.+)\] \*/,Rc=/,? & /,Lc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Fc=/[()=,{}\[\]\/\s]/,Yc=/\\(\\)?/g,Wc=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,jl=/\w*$/,jc=/^[-+]0x[0-9a-f]+$/i,Bc=/^0b[01]+$/i,Gc=/^\[object .+?Constructor\]$/,Uc=/^0o[0-7]+$/i,zc=/^(?:0|[1-9]\d*)$/,Hc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ms=/($^)/,qc=/['\n\r\u2028\u2029\\]/g,gs="\\ud800-\\udfff",Vc="\\u0300-\\u036f",Kc="\\ufe20-\\ufe2f",Zc="\\u20d0-\\u20ff",Bl=Vc+Kc+Zc,Gl="\\u2700-\\u27bf",Ul="a-z\\xdf-\\xf6\\xf8-\\xff",Xc="\\xac\\xb1\\xd7\\xf7",Jc="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",zl="\\u2000-\\u206f",x=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Be="A-Z\\xc0-\\xd6\\xd8-\\xde",Dt="\\ufe0e\\ufe0f",kt=Xc+Jc+zl+x,Ir="['\u2019]",Da="["+gs+"]",Ao="["+kt+"]",ti="["+Bl+"]",Oa="\\d+",Hl="["+Gl+"]",_s="["+Ul+"]",vi="[^"+gs+kt+Oa+Gl+Ul+Be+"]",Po="\\ud83c[\\udffb-\\udfff]",uE="(?:"+ti+"|"+Po+")",Zh="[^"+gs+"]",Qc="(?:\\ud83c[\\udde6-\\uddff]){2}",$c="[\\ud800-\\udbff][\\udc00-\\udfff]",vs="["+Be+"]",Xh="\\u200d",Jh="(?:"+_s+"|"+vi+")",fE="(?:"+vs+"|"+vi+")",Qh="(?:"+Ir+"(?:d|ll|m|re|s|t|ve))?",$h="(?:"+Ir+"(?:D|LL|M|RE|S|T|VE))?",em=uE+"?",tm="["+Dt+"]?",cE="(?:"+Xh+"(?:"+[Zh,Qc,$c].join("|")+")"+tm+em+")*",dE="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pE="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",nm=tm+em+cE,hE="(?:"+[Hl,Qc,$c].join("|")+")"+nm,mE="(?:"+[Zh+ti+"?",ti,Qc,$c,Da].join("|")+")",gE=RegExp(Ir,"g"),_E=RegExp(ti,"g"),ed=RegExp(Po+"(?="+Po+")|"+mE+nm,"g"),vE=RegExp([vs+"?"+_s+"+"+Qh+"(?="+[Ao,vs,"$"].join("|")+")",fE+"+"+$h+"(?="+[Ao,vs+Jh,"$"].join("|")+")",vs+"?"+Jh+"+"+Qh,vs+"+"+$h,pE,dE,Oa,hE].join("|"),"g"),yE=RegExp("["+Xh+gs+Bl+Dt+"]"),wE=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,bE=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],kE=-1,Ut={};Ut[Kn]=Ut[Zn]=Ut[Hi]=Ut[ei]=Ut[Oo]=Ut[Mo]=Ut[ne]=Ut[De]=Ut[bt]=!0,Ut[ee]=Ut[_e]=Ut[yn]=Ut[Fe]=Ut[jn]=Ut[je]=Ut[ht]=Ut[ge]=Ut[vt]=Ut[Ht]=Ut[rt]=Ut[tr]=Ut[_n]=Ut[vn]=Ut[Wn]=!1;var jt={};jt[ee]=jt[_e]=jt[yn]=jt[jn]=jt[Fe]=jt[je]=jt[Kn]=jt[Zn]=jt[Hi]=jt[ei]=jt[Oo]=jt[vt]=jt[Ht]=jt[rt]=jt[tr]=jt[_n]=jt[vn]=jt[Yn]=jt[Mo]=jt[ne]=jt[De]=jt[bt]=!0,jt[ht]=jt[ge]=jt[Wn]=!1;var EE={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},TE={"&":"&","<":"<",">":">",'"':""","'":"'"},SE={"&":"&","<":"<",">":">",""":'"',"'":"'"},CE={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},DE=parseFloat,OE=parseInt,rm=typeof global=="object"&&global&&global.Object===Object&&global,ME=typeof self=="object"&&self&&self.Object===Object&&self,wn=rm||ME||Function("return this")(),td=typeof js=="object"&&js&&!js.nodeType&&js,No=td&&typeof al=="object"&&al&&!al.nodeType&&al,im=No&&No.exports===td,nd=im&&rm.process,gr=function(){try{var q=No&&No.require&&No.require("util").types;return q||nd&&nd.binding&&nd.binding("util")}catch(ae){}}(),om=gr&&gr.isArrayBuffer,sm=gr&&gr.isDate,am=gr&&gr.isMap,lm=gr&&gr.isRegExp,um=gr&&gr.isSet,fm=gr&&gr.isTypedArray;function rr(q,ae,ie){switch(ie.length){case 0:return q.call(ae);case 1:return q.call(ae,ie[0]);case 2:return q.call(ae,ie[0],ie[1]);case 3:return q.call(ae,ie[0],ie[1],ie[2])}return q.apply(ae,ie)}function AE(q,ae,ie,be){for(var He=-1,Ct=q==null?0:q.length;++He-1}function rd(q,ae,ie){for(var be=-1,He=q==null?0:q.length;++be-1;);return ie}function vm(q,ae){for(var ie=q.length;ie--&&ys(ae,q[ie],0)>-1;);return ie}function WE(q,ae){for(var ie=q.length,be=0;ie--;)q[ie]===ae&&++be;return be}var jE=ad(EE),BE=ad(TE);function GE(q){return"\\"+CE[q]}function UE(q,ae){return q==null?t:q[ae]}function ws(q){return yE.test(q)}function zE(q){return wE.test(q)}function HE(q){for(var ae,ie=[];!(ae=q.next()).done;)ie.push(ae.value);return ie}function cd(q){var ae=-1,ie=Array(q.size);return q.forEach(function(be,He){ie[++ae]=[He,be]}),ie}function ym(q,ae){return function(ie){return q(ae(ie))}}function Ki(q,ae){for(var ie=-1,be=q.length,He=0,Ct=[];++ie-1}function NT(s,l){var d=this.__data__,g=uu(d,s);return g<0?(++this.size,d.push([s,l])):d[g][1]=l,this}yi.prototype.clear=OT,yi.prototype.delete=MT,yi.prototype.get=AT,yi.prototype.has=PT,yi.prototype.set=NT;function wi(s){var l=-1,d=s==null?0:s.length;for(this.clear();++l=l?s:l)),s}function wr(s,l,d,g,w,C){var I,W=l&c,Z=l&p,ue=l&h;if(d&&(I=w?d(s,g,w,C):d(s)),I!==t)return I;if(!Kt(s))return s;var fe=Ve(s);if(fe){if(I=L2(s),!W)return Xn(s,I)}else{var pe=In(s),ve=pe==ge||pe==Ee;if(to(s))return tg(s,W);if(pe==rt||pe==ee||ve&&!w){if(I=Z||ve?{}:wg(s),!W)return Z?S2(s,KT(I,s)):T2(s,Pm(I,s))}else{if(!jt[pe])return w?s:{};I=F2(s,pe,W)}}C||(C=new Lr);var Te=C.get(s);if(Te)return Te;C.set(s,I),Zg(s)?s.forEach(function(Re){I.add(wr(Re,l,d,Re,s,C))}):Vg(s)&&s.forEach(function(Re,lt){I.set(lt,wr(Re,l,d,lt,s,C))});var Ie=ue?Z?Fd:Ld:Z?Qn:bn,$e=fe?t:Ie(s);return _r($e||s,function(Re,lt){$e&&(lt=Re,Re=s[lt]),Ra(I,lt,wr(Re,l,d,lt,s,C))}),I}function ZT(s){var l=bn(s);return function(d){return Nm(d,s,l)}}function Nm(s,l,d){var g=d.length;if(s==null)return!g;for(s=Rt(s);g--;){var w=d[g],C=l[w],I=s[w];if(I===t&&!(w in s)||!C(I))return!1}return!0}function xm(s,l,d){if(typeof s!="function")throw new vr(i);return Ga(function(){s.apply(t,d)},l)}function La(s,l,d,g){var w=-1,C=ql,I=!0,W=s.length,Z=[],ue=l.length;if(!W)return Z;d&&(l=qt(l,ir(d))),g?(C=rd,I=!1):l.length>=n&&(C=Ma,I=!1,l=new Ro(l));e:for(;++ww?0:w+d),g=g===t||g>w?w:Xe(g),g<0&&(g+=w),g=d>g?0:Jg(g);d0&&d(W)?l>1?Dn(W,l-1,d,g,w):Vi(w,W):g||(w[w.length]=W)}return w}var vd=ag(),Lm=ag(!0);function ni(s,l){return s&&vd(s,l,bn)}function yd(s,l){return s&&Lm(s,l,bn)}function cu(s,l){return qi(l,function(d){return Si(s[d])})}function Fo(s,l){l=$i(l,s);for(var d=0,g=l.length;s!=null&&dl}function QT(s,l){return s!=null&&Nt.call(s,l)}function $T(s,l){return s!=null&&l in Rt(s)}function e2(s,l,d){return s>=xn(l,d)&&s=120&&fe.length>=120)?new Ro(I&&fe):t}fe=s[0];var pe=-1,ve=W[0];e:for(;++pe-1;)W!==s&&nu.call(W,Z,1),nu.call(s,Z,1);return s}function Vm(s,l){for(var d=s?l.length:0,g=d-1;d--;){var w=l[d];if(d==g||w!==C){var C=w;Ti(w)?nu.call(s,w,1):Md(s,w)}}return s}function Cd(s,l){return s+ou(Dm()*(l-s+1))}function p2(s,l,d,g){for(var w=-1,C=dn(iu((l-s)/(d||1)),0),I=ie(C);C--;)I[g?C:++w]=s,s+=d;return I}function Dd(s,l){var d="";if(!s||l<1||l>Q)return d;do l%2&&(d+=s),l=ou(l/2),l&&(s+=s);while(l);return d}function it(s,l){return zd(Eg(s,l,$n),s+"")}function h2(s){return Am(As(s))}function m2(s,l){var d=As(s);return ku(d,Lo(l,0,d.length))}function Wa(s,l,d,g){if(!Kt(s))return s;l=$i(l,s);for(var w=-1,C=l.length,I=C-1,W=s;W!=null&&++ww?0:w+l),d=d>w?w:d,d<0&&(d+=w),w=l>d?0:d-l>>>0,l>>>=0;for(var C=ie(w);++g>>1,I=s[C];I!==null&&!sr(I)&&(d?I<=l:I=n){var ue=l?null:M2(s);if(ue)return Kl(ue);I=!1,w=Ma,Z=new Ro}else Z=l?[]:W;e:for(;++g=g?s:br(s,l,d)}var eg=sT||function(s){return wn.clearTimeout(s)};function tg(s,l){if(l)return s.slice();var d=s.length,g=km?km(d):new s.constructor(d);return s.copy(g),g}function xd(s){var l=new s.constructor(s.byteLength);return new eu(l).set(new eu(s)),l}function w2(s,l){var d=l?xd(s.buffer):s.buffer;return new s.constructor(d,s.byteOffset,s.byteLength)}function b2(s){var l=new s.constructor(s.source,jl.exec(s));return l.lastIndex=s.lastIndex,l}function k2(s){return Ia?Rt(Ia.call(s)):{}}function ng(s,l){var d=l?xd(s.buffer):s.buffer;return new s.constructor(d,s.byteOffset,s.length)}function rg(s,l){if(s!==l){var d=s!==t,g=s===null,w=s===s,C=sr(s),I=l!==t,W=l===null,Z=l===l,ue=sr(l);if(!W&&!ue&&!C&&s>l||C&&I&&Z&&!W&&!ue||g&&I&&Z||!d&&Z||!w)return 1;if(!g&&!C&&!ue&&s=W)return Z;var ue=d[g];return Z*(ue=="desc"?-1:1)}}return s.index-l.index}function ig(s,l,d,g){for(var w=-1,C=s.length,I=d.length,W=-1,Z=l.length,ue=dn(C-I,0),fe=ie(Z+ue),pe=!g;++W1?d[w-1]:t,I=w>2?d[2]:t;for(C=s.length>3&&typeof C=="function"?(w--,C):t,I&&Gn(d[0],d[1],I)&&(C=w<3?t:C,w=1),l=Rt(l);++g-1?w[C?l[I]:I]:t}}function fg(s){return Ei(function(l){var d=l.length,g=d,w=yr.prototype.thru;for(s&&l.reverse();g--;){var C=l[g];if(typeof C!="function")throw new vr(i);if(w&&!I&&wu(C)=="wrapper")var I=new yr([],!0)}for(g=I?g:d;++g1&&mt.reverse(),fe&&ZW))return!1;var ue=C.get(s),fe=C.get(l);if(ue&&fe)return ue==l&&fe==s;var pe=-1,ve=!0,Te=d&_?new Ro:t;for(C.set(s,l),C.set(l,s);++pe1?"& ":"")+l[g],l=l.join(d>2?", ":" "),s.replace(xc,`{ -/* [wrapped with `+l+`] */ -`)}function W2(s){return Ve(s)||jo(s)||!!(Sm&&s&&s[Sm])}function Ti(s,l){var d=typeof s;return l=l==null?Q:l,!!l&&(d=="number"||d!="symbol"&&zc.test(s))&&s>-1&&s%1==0&&s0){if(++l>=le)return arguments[0]}else l=0;return s.apply(t,arguments)}}function ku(s,l){var d=-1,g=s.length,w=g-1;for(l=l===t?g:l;++d1?s[l-1]:t;return d=typeof d=="function"?(s.pop(),d):t,Rg(s,d)});function Lg(s){var l=T(s);return l.__chain__=!0,l}function XS(s,l){return l(s),s}function Eu(s,l){return l(s)}var JS=Ei(function(s){var l=s.length,d=l?s[0]:0,g=this.__wrapped__,w=function(C){return _d(C,s)};return l>1||this.__actions__.length||!(g instanceof ft)||!Ti(d)?this.thru(w):(g=g.slice(d,+d+(l?1:0)),g.__actions__.push({func:Eu,args:[w],thisArg:t}),new yr(g,this.__chain__).thru(function(C){return l&&!C.length&&C.push(t),C}))});function QS(){return Lg(this)}function $S(){return new yr(this.value(),this.__chain__)}function eC(){this.__values__===t&&(this.__values__=Xg(this.value()));var s=this.__index__>=this.__values__.length,l=s?t:this.__values__[this.__index__++];return{done:s,value:l}}function tC(){return this}function nC(s){for(var l,d=this;d instanceof lu;){var g=Mg(d);g.__index__=0,g.__values__=t,l?w.__wrapped__=g:l=g;var w=g;d=d.__wrapped__}return w.__wrapped__=s,l}function rC(){var s=this.__wrapped__;if(s instanceof ft){var l=s;return this.__actions__.length&&(l=new ft(this)),l=l.reverse(),l.__actions__.push({func:Eu,args:[Hd],thisArg:t}),new yr(l,this.__chain__)}return this.thru(Hd)}function iC(){return Qm(this.__wrapped__,this.__actions__)}var oC=mu(function(s,l,d){Nt.call(s,d)?++s[d]:bi(s,d,1)});function sC(s,l,d){var g=Ve(s)?cm:XT;return d&&Gn(s,l,d)&&(l=t),g(s,Pe(l,3))}function aC(s,l){var d=Ve(s)?qi:Rm;return d(s,Pe(l,3))}var lC=ug(Ag),uC=ug(Pg);function fC(s,l){return Dn(Tu(s,l),1)}function cC(s,l){return Dn(Tu(s,l),S)}function dC(s,l,d){return d=d===t?1:Xe(d),Dn(Tu(s,l),d)}function Fg(s,l){var d=Ve(s)?_r:Ji;return d(s,Pe(l,3))}function Yg(s,l){var d=Ve(s)?PE:Im;return d(s,Pe(l,3))}var pC=mu(function(s,l,d){Nt.call(s,d)?s[d].push(l):bi(s,d,[l])});function hC(s,l,d,g){s=Jn(s)?s:As(s),d=d&&!g?Xe(d):0;var w=s.length;return d<0&&(d=dn(w+d,0)),Mu(s)?d<=w&&s.indexOf(l,d)>-1:!!w&&ys(s,l,d)>-1}var mC=it(function(s,l,d){var g=-1,w=typeof l=="function",C=Jn(s)?ie(s.length):[];return Ji(s,function(I){C[++g]=w?rr(l,I,d):Fa(I,l,d)}),C}),gC=mu(function(s,l,d){bi(s,d,l)});function Tu(s,l){var d=Ve(s)?qt:Bm;return d(s,Pe(l,3))}function _C(s,l,d,g){return s==null?[]:(Ve(l)||(l=l==null?[]:[l]),d=g?t:d,Ve(d)||(d=d==null?[]:[d]),Hm(s,l,d))}var vC=mu(function(s,l,d){s[d?0:1].push(l)},function(){return[[],[]]});function yC(s,l,d){var g=Ve(s)?id:mm,w=arguments.length<3;return g(s,Pe(l,4),d,w,Ji)}function wC(s,l,d){var g=Ve(s)?NE:mm,w=arguments.length<3;return g(s,Pe(l,4),d,w,Im)}function bC(s,l){var d=Ve(s)?qi:Rm;return d(s,Du(Pe(l,3)))}function kC(s){var l=Ve(s)?Am:h2;return l(s)}function EC(s,l,d){(d?Gn(s,l,d):l===t)?l=1:l=Xe(l);var g=Ve(s)?HT:m2;return g(s,l)}function TC(s){var l=Ve(s)?qT:_2;return l(s)}function SC(s){if(s==null)return 0;if(Jn(s))return Mu(s)?bs(s):s.length;var l=In(s);return l==vt||l==_n?s.size:Ed(s).length}function CC(s,l,d){var g=Ve(s)?od:v2;return d&&Gn(s,l,d)&&(l=t),g(s,Pe(l,3))}var DC=it(function(s,l){if(s==null)return[];var d=l.length;return d>1&&Gn(s,l[0],l[1])?l=[]:d>2&&Gn(l[0],l[1],l[2])&&(l=[l[0]]),Hm(s,Dn(l,1),[])}),Su=aT||function(){return wn.Date.now()};function OC(s,l){if(typeof l!="function")throw new vr(i);return s=Xe(s),function(){if(--s<1)return l.apply(this,arguments)}}function Wg(s,l,d){return l=d?t:l,l=s&&l==null?s.length:l,ki(s,P,t,t,t,t,l)}function jg(s,l){var d;if(typeof l!="function")throw new vr(i);return s=Xe(s),function(){return--s>0&&(d=l.apply(this,arguments)),s<=1&&(l=t),d}}var Vd=it(function(s,l,d){var g=v;if(d.length){var w=Ki(d,Os(Vd));g|=D}return ki(s,g,l,d,w)}),Bg=it(function(s,l,d){var g=v|b;if(d.length){var w=Ki(d,Os(Bg));g|=D}return ki(l,g,s,d,w)});function Gg(s,l,d){l=d?t:l;var g=ki(s,y,t,t,t,t,t,l);return g.placeholder=Gg.placeholder,g}function Ug(s,l,d){l=d?t:l;var g=ki(s,O,t,t,t,t,t,l);return g.placeholder=Ug.placeholder,g}function zg(s,l,d){var g,w,C,I,W,Z,ue=0,fe=!1,pe=!1,ve=!0;if(typeof s!="function")throw new vr(i);l=Er(l)||0,Kt(d)&&(fe=!!d.leading,pe="maxWait"in d,C=pe?dn(Er(d.maxWait)||0,l):C,ve="trailing"in d?!!d.trailing:ve);function Te(nn){var Yr=g,Di=w;return g=w=t,ue=nn,I=s.apply(Di,Yr),I}function Ie(nn){return ue=nn,W=Ga(lt,l),fe?Te(nn):I}function $e(nn){var Yr=nn-Z,Di=nn-ue,u_=l-Yr;return pe?xn(u_,C-Di):u_}function Re(nn){var Yr=nn-Z,Di=nn-ue;return Z===t||Yr>=l||Yr<0||pe&&Di>=C}function lt(){var nn=Su();if(Re(nn))return mt(nn);W=Ga(lt,$e(nn))}function mt(nn){return W=t,ve&&g?Te(nn):(g=w=t,I)}function ar(){W!==t&&eg(W),ue=0,g=Z=w=W=t}function Un(){return W===t?I:mt(Su())}function lr(){var nn=Su(),Yr=Re(nn);if(g=arguments,w=this,Z=nn,Yr){if(W===t)return Ie(Z);if(pe)return eg(W),W=Ga(lt,l),Te(Z)}return W===t&&(W=Ga(lt,l)),I}return lr.cancel=ar,lr.flush=Un,lr}var MC=it(function(s,l){return xm(s,1,l)}),AC=it(function(s,l,d){return xm(s,Er(l)||0,d)});function PC(s){return ki(s,R)}function Cu(s,l){if(typeof s!="function"||l!=null&&typeof l!="function")throw new vr(i);var d=function(){var g=arguments,w=l?l.apply(this,g):g[0],C=d.cache;if(C.has(w))return C.get(w);var I=s.apply(this,g);return d.cache=C.set(w,I)||C,I};return d.cache=new(Cu.Cache||wi),d}Cu.Cache=wi;function Du(s){if(typeof s!="function")throw new vr(i);return function(){var l=arguments;switch(l.length){case 0:return!s.call(this);case 1:return!s.call(this,l[0]);case 2:return!s.call(this,l[0],l[1]);case 3:return!s.call(this,l[0],l[1],l[2])}return!s.apply(this,l)}}function NC(s){return jg(2,s)}var xC=y2(function(s,l){l=l.length==1&&Ve(l[0])?qt(l[0],ir(Pe())):qt(Dn(l,1),ir(Pe()));var d=l.length;return it(function(g){for(var w=-1,C=xn(g.length,d);++w=l}),jo=Ym(function(){return arguments}())?Ym:function(s){return Jt(s)&&Nt.call(s,"callee")&&!Tm.call(s,"callee")},Ve=ie.isArray,KC=om?ir(om):n2;function Jn(s){return s!=null&&Ou(s.length)&&!Si(s)}function tn(s){return Jt(s)&&Jn(s)}function ZC(s){return s===!0||s===!1||Jt(s)&&Bn(s)==Fe}var to=uT||op,XC=sm?ir(sm):r2;function JC(s){return Jt(s)&&s.nodeType===1&&!Ua(s)}function QC(s){if(s==null)return!0;if(Jn(s)&&(Ve(s)||typeof s=="string"||typeof s.splice=="function"||to(s)||Ms(s)||jo(s)))return!s.length;var l=In(s);if(l==vt||l==_n)return!s.size;if(Ba(s))return!Ed(s).length;for(var d in s)if(Nt.call(s,d))return!1;return!0}function $C(s,l){return Ya(s,l)}function eD(s,l,d){d=typeof d=="function"?d:t;var g=d?d(s,l):t;return g===t?Ya(s,l,t,d):!!g}function Zd(s){if(!Jt(s))return!1;var l=Bn(s);return l==ht||l==pt||typeof s.message=="string"&&typeof s.name=="string"&&!Ua(s)}function tD(s){return typeof s=="number"&&Cm(s)}function Si(s){if(!Kt(s))return!1;var l=Bn(s);return l==ge||l==Ee||l==Ce||l==Vn}function qg(s){return typeof s=="number"&&s==Xe(s)}function Ou(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Q}function Kt(s){var l=typeof s;return s!=null&&(l=="object"||l=="function")}function Jt(s){return s!=null&&typeof s=="object"}var Vg=am?ir(am):o2;function nD(s,l){return s===l||kd(s,l,Wd(l))}function rD(s,l,d){return d=typeof d=="function"?d:t,kd(s,l,Wd(l),d)}function iD(s){return Kg(s)&&s!=+s}function oD(s){if(G2(s))throw new He(r);return Wm(s)}function sD(s){return s===null}function aD(s){return s==null}function Kg(s){return typeof s=="number"||Jt(s)&&Bn(s)==Ht}function Ua(s){if(!Jt(s)||Bn(s)!=rt)return!1;var l=tu(s);if(l===null)return!0;var d=Nt.call(l,"constructor")&&l.constructor;return typeof d=="function"&&d instanceof d&&Jl.call(d)==rT}var Xd=lm?ir(lm):s2;function lD(s){return qg(s)&&s>=-Q&&s<=Q}var Zg=um?ir(um):a2;function Mu(s){return typeof s=="string"||!Ve(s)&&Jt(s)&&Bn(s)==vn}function sr(s){return typeof s=="symbol"||Jt(s)&&Bn(s)==Yn}var Ms=fm?ir(fm):l2;function uD(s){return s===t}function fD(s){return Jt(s)&&In(s)==Wn}function cD(s){return Jt(s)&&Bn(s)==Cn}var dD=yu(Td),pD=yu(function(s,l){return s<=l});function Xg(s){if(!s)return[];if(Jn(s))return Mu(s)?Rr(s):Xn(s);if(Aa&&s[Aa])return HE(s[Aa]());var l=In(s),d=l==vt?cd:l==_n?Kl:As;return d(s)}function Ci(s){if(!s)return s===0?s:0;if(s=Er(s),s===S||s===-S){var l=s<0?-1:1;return l*j}return s===s?s:0}function Xe(s){var l=Ci(s),d=l%1;return l===l?d?l-d:l:0}function Jg(s){return s?Lo(Xe(s),0,J):0}function Er(s){if(typeof s=="number")return s;if(sr(s))return U;if(Kt(s)){var l=typeof s.valueOf=="function"?s.valueOf():s;s=Kt(l)?l+"":l}if(typeof s!="string")return s===0?s:+s;s=gm(s);var d=Bc.test(s);return d||Uc.test(s)?OE(s.slice(2),d?2:8):jc.test(s)?U:+s}function Qg(s){return ri(s,Qn(s))}function hD(s){return s?Lo(Xe(s),-Q,Q):s===0?s:0}function Ot(s){return s==null?"":or(s)}var mD=Cs(function(s,l){if(Ba(l)||Jn(l)){ri(l,bn(l),s);return}for(var d in l)Nt.call(l,d)&&Ra(s,d,l[d])}),$g=Cs(function(s,l){ri(l,Qn(l),s)}),Au=Cs(function(s,l,d,g){ri(l,Qn(l),s,g)}),gD=Cs(function(s,l,d,g){ri(l,bn(l),s,g)}),_D=Ei(_d);function vD(s,l){var d=Ss(s);return l==null?d:Pm(d,l)}var yD=it(function(s,l){s=Rt(s);var d=-1,g=l.length,w=g>2?l[2]:t;for(w&&Gn(l[0],l[1],w)&&(g=1);++d1),C}),ri(s,Fd(s),d),g&&(d=wr(d,c|p|h,A2));for(var w=l.length;w--;)Md(d,l[w]);return d});function FD(s,l){return t_(s,Du(Pe(l)))}var YD=Ei(function(s,l){return s==null?{}:c2(s,l)});function t_(s,l){if(s==null)return{};var d=qt(Fd(s),function(g){return[g]});return l=Pe(l),qm(s,d,function(g,w){return l(g,w[0])})}function WD(s,l,d){l=$i(l,s);var g=-1,w=l.length;for(w||(w=1,s=t);++gl){var g=s;s=l,l=g}if(d||s%1||l%1){var w=Dm();return xn(s+w*(l-s+DE("1e-"+((w+"").length-1))),l)}return Cd(s,l)}var XD=Ds(function(s,l,d){return l=l.toLowerCase(),s+(d?i_(l):l)});function i_(s){return $d(Ot(s).toLowerCase())}function o_(s){return s=Ot(s),s&&s.replace(Hc,jE).replace(_E,"")}function JD(s,l,d){s=Ot(s),l=or(l);var g=s.length;d=d===t?g:Lo(Xe(d),0,g);var w=d;return d-=l.length,d>=0&&s.slice(d,w)==l}function QD(s){return s=Ot(s),s&&Sc.test(s)?s.replace(hs,BE):s}function $D(s){return s=Ot(s),s&&Pc.test(s)?s.replace(Sa,"\\$&"):s}var eO=Ds(function(s,l,d){return s+(d?"-":"")+l.toLowerCase()}),tO=Ds(function(s,l,d){return s+(d?" ":"")+l.toLowerCase()}),nO=lg("toLowerCase");function rO(s,l,d){s=Ot(s),l=Xe(l);var g=l?bs(s):0;if(!l||g>=l)return s;var w=(l-g)/2;return vu(ou(w),d)+s+vu(iu(w),d)}function iO(s,l,d){s=Ot(s),l=Xe(l);var g=l?bs(s):0;return l&&g>>0,d?(s=Ot(s),s&&(typeof l=="string"||l!=null&&!Xd(l))&&(l=or(l),!l&&ws(s))?eo(Rr(s),0,d):s.split(l,d)):[]}var cO=Ds(function(s,l,d){return s+(d?" ":"")+$d(l)});function dO(s,l,d){return s=Ot(s),d=d==null?0:Lo(Xe(d),0,s.length),l=or(l),s.slice(d,d+l.length)==l}function pO(s,l,d){var g=T.templateSettings;d&&Gn(s,l,d)&&(l=t),s=Ot(s),l=Au({},l,g,mg);var w=Au({},l.imports,g.imports,mg),C=bn(w),I=fd(w,C),W,Z,ue=0,fe=l.interpolate||ms,pe="__p += '",ve=dd((l.escape||ms).source+"|"+fe.source+"|"+(fe===Wl?Wc:ms).source+"|"+(l.evaluate||ms).source+"|$","g"),Te="//# sourceURL="+(Nt.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++kE+"]")+` -`;s.replace(ve,function(Re,lt,mt,ar,Un,lr){return mt||(mt=ar),pe+=s.slice(ue,lr).replace(qc,GE),lt&&(W=!0,pe+=`' + -__e(`+lt+`) + -'`),Un&&(Z=!0,pe+=`'; -`+Un+`; -__p += '`),mt&&(pe+=`' + -((__t = (`+mt+`)) == null ? '' : __t) + -'`),ue=lr+Re.length,Re}),pe+=`'; -`;var Ie=Nt.call(l,"variable")&&l.variable;if(!Ie)pe=`with (obj) { -`+pe+` -} -`;else if(Fc.test(Ie))throw new He(o);pe=(Z?pe.replace(St,""):pe).replace(nr,"$1").replace(_i,"$1;"),pe="function("+(Ie||"obj")+`) { -`+(Ie?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(W?", __e = _.escape":"")+(Z?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+pe+`return __p -}`;var $e=a_(function(){return Ct(C,Te+"return "+pe).apply(t,I)});if($e.source=pe,Zd($e))throw $e;return $e}function hO(s){return Ot(s).toLowerCase()}function mO(s){return Ot(s).toUpperCase()}function gO(s,l,d){if(s=Ot(s),s&&(d||l===t))return gm(s);if(!s||!(l=or(l)))return s;var g=Rr(s),w=Rr(l),C=_m(g,w),I=vm(g,w)+1;return eo(g,C,I).join("")}function _O(s,l,d){if(s=Ot(s),s&&(d||l===t))return s.slice(0,wm(s)+1);if(!s||!(l=or(l)))return s;var g=Rr(s),w=vm(g,Rr(l))+1;return eo(g,0,w).join("")}function vO(s,l,d){if(s=Ot(s),s&&(d||l===t))return s.replace(Ca,"");if(!s||!(l=or(l)))return s;var g=Rr(s),w=_m(g,Rr(l));return eo(g,w).join("")}function yO(s,l){var d=M,g=H;if(Kt(l)){var w="separator"in l?l.separator:w;d="length"in l?Xe(l.length):d,g="omission"in l?or(l.omission):g}s=Ot(s);var C=s.length;if(ws(s)){var I=Rr(s);C=I.length}if(d>=C)return s;var W=d-bs(g);if(W<1)return g;var Z=I?eo(I,0,W).join(""):s.slice(0,W);if(w===t)return Z+g;if(I&&(W+=Z.length-W),Xd(w)){if(s.slice(W).search(w)){var ue,fe=Z;for(w.global||(w=dd(w.source,Ot(jl.exec(w))+"g")),w.lastIndex=0;ue=w.exec(fe);)var pe=ue.index;Z=Z.slice(0,pe===t?W:pe)}}else if(s.indexOf(or(w),W)!=W){var ve=Z.lastIndexOf(w);ve>-1&&(Z=Z.slice(0,ve))}return Z+g}function wO(s){return s=Ot(s),s&&Tc.test(s)?s.replace(ps,ZE):s}var bO=Ds(function(s,l,d){return s+(d?" ":"")+l.toUpperCase()}),$d=lg("toUpperCase");function s_(s,l,d){return s=Ot(s),l=d?t:l,l===t?zE(s)?QE(s):RE(s):s.match(l)||[]}var a_=it(function(s,l){try{return rr(s,t,l)}catch(d){return Zd(d)?d:new He(d)}}),kO=Ei(function(s,l){return _r(l,function(d){d=ii(d),bi(s,d,Vd(s[d],s))}),s});function EO(s){var l=s==null?0:s.length,d=Pe();return s=l?qt(s,function(g){if(typeof g[1]!="function")throw new vr(i);return[d(g[0]),g[1]]}):[],it(function(g){for(var w=-1;++wQ)return[];var d=J,g=xn(s,J);l=Pe(l),s-=J;for(var w=ud(g,l);++d0||l<0)?new ft(d):(s<0?d=d.takeRight(-s):s&&(d=d.drop(s)),l!==t&&(l=Xe(l),d=l<0?d.dropRight(-l):d.take(l-s)),d)},ft.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},ft.prototype.toArray=function(){return this.take(J)},ni(ft.prototype,function(s,l){var d=/^(?:filter|find|map|reject)|While$/.test(l),g=/^(?:head|last)$/.test(l),w=T[g?"take"+(l=="last"?"Right":""):l],C=g||/^find/.test(l);!w||(T.prototype[l]=function(){var I=this.__wrapped__,W=g?[1]:arguments,Z=I instanceof ft,ue=W[0],fe=Z||Ve(I),pe=function(lt){var mt=w.apply(T,Vi([lt],W));return g&&ve?mt[0]:mt};fe&&d&&typeof ue=="function"&&ue.length!=1&&(Z=fe=!1);var ve=this.__chain__,Te=!!this.__actions__.length,Ie=C&&!ve,$e=Z&&!Te;if(!C&&fe){I=$e?I:new ft(this);var Re=s.apply(I,W);return Re.__actions__.push({func:Eu,args:[pe],thisArg:t}),new yr(Re,ve)}return Ie&&$e?s.apply(this,W):(Re=this.thru(pe),Ie?g?Re.value()[0]:Re.value():Re)})}),_r(["pop","push","shift","sort","splice","unshift"],function(s){var l=Zl[s],d=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",g=/^(?:pop|shift)$/.test(s);T.prototype[s]=function(){var w=arguments;if(g&&!this.__chain__){var C=this.value();return l.apply(Ve(C)?C:[],w)}return this[d](function(I){return l.apply(Ve(I)?I:[],w)})}}),ni(ft.prototype,function(s,l){var d=T[l];if(d){var g=d.name+"";Nt.call(Ts,g)||(Ts[g]=[]),Ts[g].push({name:l,func:d})}}),Ts[gu(t,b).name]=[{name:"wrapper",func:t}],ft.prototype.clone=wT,ft.prototype.reverse=bT,ft.prototype.value=kT,T.prototype.at=JS,T.prototype.chain=QS,T.prototype.commit=$S,T.prototype.next=eC,T.prototype.plant=nC,T.prototype.reverse=rC,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=iC,T.prototype.first=T.prototype.head,Aa&&(T.prototype[Aa]=tC),T},Zi=$E();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(wn._=Zi,define(function(){return Zi})):No?((No.exports=Zi)._=Zi,td._=Zi):wn._=Zi}).call(js)});var Up=Oi((W5,lf)=>{var j1,B1,G1,U1,z1,H1,q1,V1,K1,sf,Gp,Z1,X1,J1,Xs,Q1,$1,e0,t0,n0,r0,i0,o0,af;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){t(n(e,n(r)))}):typeof lf=="object"&&typeof lf.exports=="object"?t(n(e,n(lf.exports))):t(n(e));function n(r,i){return r!==e&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(o,a){return r[o]=i?i(o,a):a}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])};j1=function(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(r,i);function o(){this.constructor=r}r.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)},B1=Object.assign||function(r){for(var i,o=1,a=arguments.length;o=0;p--)(c=r[p])&&(f=(u<3?c(f):u>3?c(i,o,f):c(i,o))||f);return u>3&&f&&Object.defineProperty(i,o,f),f},z1=function(r,i){return function(o,a){i(o,a,r)}},H1=function(r,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,i)},q1=function(r,i,o,a){function u(f){return f instanceof o?f:new o(function(c){c(f)})}return new(o||(o=Promise))(function(f,c){function p(_){try{m(a.next(_))}catch(v){c(v)}}function h(_){try{m(a.throw(_))}catch(v){c(v)}}function m(_){_.done?f(_.value):u(_.value).then(p,h)}m((a=a.apply(r,i||[])).next())})},V1=function(r,i){var o={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},a,u,f,c;return c={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function p(m){return function(_){return h([m,_])}}function h(m){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,u&&(f=m[0]&2?u.return:m[0]?u.throw||((f=u.return)&&f.call(u),0):u.next)&&!(f=f.call(u,m[1])).done)return f;switch(u=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return o.label++,{value:m[1],done:!1};case 5:o.label++,u=m[1],m=[0];continue;case 7:m=o.ops.pop(),o.trys.pop();continue;default:if(f=o.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){o=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]=r.length&&(r=void 0),{value:r&&r[a++],done:!r}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},Gp=function(r,i){var o=typeof Symbol=="function"&&r[Symbol.iterator];if(!o)return r;var a=o.call(r),u,f=[],c;try{for(;(i===void 0||i-- >0)&&!(u=a.next()).done;)f.push(u.value)}catch(p){c={error:p}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(c)throw c.error}}return f},Z1=function(){for(var r=[],i=0;i1||p(b,E)})})}function p(b,E){try{h(a[b](E))}catch(y){v(f[0][3],y)}}function h(b){b.value instanceof Xs?Promise.resolve(b.value.v).then(m,_):v(f[0][2],b)}function m(b){p("next",b)}function _(b){p("throw",b)}function v(b,E){b(E),f.shift(),f.length&&p(f[0][0],f[0][1])}},$1=function(r){var i,o;return i={},a("next"),a("throw",function(u){throw u}),a("return"),i[Symbol.iterator]=function(){return this},i;function a(u,f){i[u]=r[u]?function(c){return(o=!o)?{value:Xs(r[u](c)),done:u==="return"}:f?f(c):c}:f}},e0=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],o;return i?i.call(r):(r=typeof sf=="function"?sf(r):r[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(f){o[f]=r[f]&&function(c){return new Promise(function(p,h){c=r[f](c),u(p,h,c.done,c.value)})}}function u(f,c,p,h){Promise.resolve(h).then(function(m){f({value:m,done:p})},c)}},t0=function(r,i){return Object.defineProperty?Object.defineProperty(r,"raw",{value:i}):r.raw=i,r};var n=Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:!0,value:i})}:function(r,i){r.default=i};n0=function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o in r)o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)&&af(i,r,o);return n(i,r),i},r0=function(r){return r&&r.__esModule?r:{default:r}},i0=function(r,i,o,a){if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?r!==i||!a:!i.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?a:o==="a"?a.call(r):a?a.value:i.get(r)},o0=function(r,i,o,a,u){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!u)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?r!==i||!u:!i.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?u.call(r,o):u?u.value=o:i.set(r,o),o},t("__extends",j1),t("__assign",B1),t("__rest",G1),t("__decorate",U1),t("__param",z1),t("__metadata",H1),t("__awaiter",q1),t("__generator",V1),t("__exportStar",K1),t("__createBinding",af),t("__values",sf),t("__read",Gp),t("__spread",Z1),t("__spreadArrays",X1),t("__spreadArray",J1),t("__await",Xs),t("__asyncGenerator",Q1),t("__asyncDelegator",$1),t("__asyncValues",e0),t("__makeTemplateObject",t0),t("__importStar",n0),t("__importDefault",r0),t("__classPrivateFieldGet",i0),t("__classPrivateFieldSet",o0)})});var P0=Oi((JF,hf)=>{var c0,d0,p0,h0,m0,g0,_0,v0,y0,pf,Kp,w0,b0,Qs,k0,E0,T0,S0,C0,D0,O0,M0,A0;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){t(n(e,n(r)))}):typeof hf=="object"&&typeof hf.exports=="object"?t(n(e,n(hf.exports))):t(n(e));function n(r,i){return r!==e&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(o,a){return r[o]=i?i(o,a):a}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i])};c0=function(n,r){e(n,r);function i(){this.constructor=n}n.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)},d0=Object.assign||function(n){for(var r,i=1,o=arguments.length;i=0;c--)(f=n[c])&&(u=(a<3?f(u):a>3?f(r,i,u):f(r,i))||u);return a>3&&u&&Object.defineProperty(r,i,u),u},m0=function(n,r){return function(i,o){r(i,o,n)}},g0=function(n,r){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,r)},_0=function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(f){f(u)})}return new(i||(i=Promise))(function(u,f){function c(m){try{h(o.next(m))}catch(_){f(_)}}function p(m){try{h(o.throw(m))}catch(_){f(_)}}function h(m){m.done?u(m.value):a(m.value).then(c,p)}h((o=o.apply(n,r||[])).next())})},v0=function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,f;return f={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function c(h){return function(m){return p([h,m])}}function p(h){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=h[0]&2?a.return:h[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,h[1])).done)return u;switch(a=0,u&&(h=[h[0]&2,u.value]),h[0]){case 0:case 1:u=h;break;case 4:return i.label++,{value:h[1],done:!1};case 5:i.label++,a=h[1],h=[0];continue;case 7:h=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(h[0]===6||h[0]===2)){i=0;continue}if(h[0]===3&&(!u||h[1]>u[0]&&h[1]=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")},Kp=function(n,r){var i=typeof Symbol=="function"&&n[Symbol.iterator];if(!i)return n;var o=i.call(n),a,u=[],f;try{for(;(r===void 0||r-- >0)&&!(a=o.next()).done;)u.push(a.value)}catch(c){f={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(f)throw f.error}}return u},w0=function(){for(var n=[],r=0;r1||c(v,b)})})}function c(v,b){try{p(o[v](b))}catch(E){_(u[0][3],E)}}function p(v){v.value instanceof Qs?Promise.resolve(v.value.v).then(h,m):_(u[0][2],v)}function h(v){c("next",v)}function m(v){c("throw",v)}function _(v,b){v(b),u.shift(),u.length&&c(u[0][0],u[0][1])}},E0=function(n){var r,i;return r={},o("next"),o("throw",function(a){throw a}),o("return"),r[Symbol.iterator]=function(){return this},r;function o(a,u){r[a]=n[a]?function(f){return(i=!i)?{value:Qs(n[a](f)),done:a==="return"}:u?u(f):f}:u}},T0=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n[Symbol.asyncIterator],i;return r?r.call(n):(n=typeof pf=="function"?pf(n):n[Symbol.iterator](),i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i);function o(u){i[u]=n[u]&&function(f){return new Promise(function(c,p){f=n[u](f),a(c,p,f.done,f.value)})}}function a(u,f,c,p){Promise.resolve(p).then(function(h){u({value:h,done:c})},f)}},S0=function(n,r){return Object.defineProperty?Object.defineProperty(n,"raw",{value:r}):n.raw=r,n},C0=function(n){if(n&&n.__esModule)return n;var r={};if(n!=null)for(var i in n)Object.hasOwnProperty.call(n,i)&&(r[i]=n[i]);return r.default=n,r},D0=function(n){return n&&n.__esModule?n:{default:n}},O0=function(n,r){if(!r.has(n))throw new TypeError("attempted to get private field on non-instance");return r.get(n)},M0=function(n,r,i){if(!r.has(n))throw new TypeError("attempted to set private field on non-instance");return r.set(n,i),i},t("__extends",c0),t("__assign",d0),t("__rest",p0),t("__decorate",h0),t("__param",m0),t("__metadata",g0),t("__awaiter",_0),t("__generator",v0),t("__exportStar",y0),t("__createBinding",A0),t("__values",pf),t("__read",Kp),t("__spread",w0),t("__spreadArrays",b0),t("__await",Qs),t("__asyncGenerator",k0),t("__asyncDelegator",E0),t("__asyncValues",T0),t("__makeTemplateObject",S0),t("__importStar",C0),t("__importDefault",D0),t("__classPrivateFieldGet",O0),t("__classPrivateFieldSet",M0)})});var ho=Oi((ih,oh)=>{(function(t,e){typeof ih=="object"&&typeof oh!="undefined"?oh.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis!="undefined"?globalThis:t||self).dayjs=e()})(ih,function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",o="minute",a="hour",u="day",f="week",c="month",p="quarter",h="year",m="date",_="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|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,E={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(V){var X=["th","st","nd","rd"],K=V%100;return"["+V+(X[(K-20)%10]||X[K]||X[0])+"]"}},y=function(V,X,K){var ce=String(V);return!ce||ce.length>=X?V:""+Array(X+1-ce.length).join(K)+V},O={s:y,z:function(V){var X=-V.utcOffset(),K=Math.abs(X),ce=Math.floor(K/60),S=K%60;return(X<=0?"+":"-")+y(ce,2,"0")+":"+y(S,2,"0")},m:function V(X,K){if(X.date()1)return V(j[0])}else{var U=X.name;F[U]=X,S=U}return!ce&&S&&(D=S),S||!ce&&D},R=function(V,X){if(P(V))return V.clone();var K=typeof X=="object"?X:{};return K.date=V,K.args=arguments,new H(K)},M=O;M.l=L,M.i=P,M.w=function(V,X){return R(V,{locale:X.$L,utc:X.$u,x:X.$x,$offset:X.$offset})};var H=function(){function V(K){this.$L=L(K.locale,null,!0),this.parse(K)}var X=V.prototype;return X.parse=function(K){this.$d=function(ce){var S=ce.date,Q=ce.utc;if(S===null)return new Date(NaN);if(M.u(S))return new Date;if(S instanceof Date)return new Date(S);if(typeof S=="string"&&!/Z$/i.test(S)){var j=S.match(v);if(j){var U=j[2]-1||0,J=(j[7]||"0").substring(0,3);return Q?new Date(Date.UTC(j[1],U,j[3]||1,j[4]||0,j[5]||0,j[6]||0,J)):new Date(j[1],U,j[3]||1,j[4]||0,j[5]||0,j[6]||0,J)}}return new Date(S)}(K),this.$x=K.x||{},this.init()},X.init=function(){var K=this.$d;this.$y=K.getFullYear(),this.$M=K.getMonth(),this.$D=K.getDate(),this.$W=K.getDay(),this.$H=K.getHours(),this.$m=K.getMinutes(),this.$s=K.getSeconds(),this.$ms=K.getMilliseconds()},X.$utils=function(){return M},X.isValid=function(){return this.$d.toString()!==_},X.isSame=function(K,ce){var S=R(K);return this.startOf(ce)<=S&&S<=this.endOf(ce)},X.isAfter=function(K,ce){return R(K){(function(t,e){typeof fh=="object"&&typeof ch!="undefined"?ch.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis!="undefined"?globalThis:t||self).dayjs_plugin_quarterOfYear=e()})(fh,function(){"use strict";var t="month",e="quarter";return function(n,r){var i=r.prototype;i.quarter=function(u){return this.$utils().u(u)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(u-1))};var o=i.add;i.add=function(u,f){return u=Number(u),this.$utils().p(f)===e?this.add(3*u,t):o.bind(this)(u,f)};var a=i.startOf;i.startOf=function(u,f){var c=this.$utils(),p=!!c.u(f)||f;if(c.p(u)===e){var h=this.quarter()-1;return p?this.month(3*h).startOf(t).startOf("day"):this.month(3*h+2).endOf(t).endOf("day")}return a.bind(this)(u,f)}}})});var yb=Oi(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.isDate=Eo.isComparable=Eo.isIterable=void 0;Eo.isIterable=t=>!(t==null||t[Symbol.iterator]==null);Eo.isComparable=t=>{let e=Object.prototype.toString,n=t;return n.compare!=null&&e.call(n.compare).endsWith("Function]")};Eo.isDate=t=>Object.prototype.toString.call(t).endsWith("Date]")});var bb=Oi(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0})});var kb=Oi(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});var PN=Up(),Fh=yb(),NN=(t,e)=>t-e,xN=(t,e)=>Number(t-e),IN=(t,e)=>t.localeCompare(e),RN=(t,e)=>t.getTime()-e.getTime(),wa={number:NN,string:IN,Date:RN,bigInt:xN,none:()=>0},LN=t=>{if(typeof t=="number")return wa.number;if(typeof t=="string")return wa.string;if(typeof t=="bigint")return wa.bigInt;if(Fh.isDate(t))return wa.Date;if(Fh.isComparable(t))return(e,n)=>e.compare(n);throw new Error("Cannot sort keys in this map. You have to specify compareFn if the type of key in this map is not number, string, or Date.")},fs=class extends Map{constructor(e,n){super();this.specifiedCompareFn=!1,this.isCompareFn=r=>typeof r=="function",this.compareFn=wa.none,this.sortedKeys=[],Fh.isIterable(e)&&this._constructor(e,n),this.isCompareFn(e)&&this._constructor(null,e),e==null&&this._constructor(null,n)}get comparator(){return this.compareFn}compare(e,n){return Math.sign(this.compareFn(e,n))}_constructor(e,n){if(this.compareFn=n==null?wa.none:n,this.specifiedCompareFn=n!=null,e!=null)for(let r of e)this.set(...r)}static fromMap(e,n){let r=new fs(n);return r.setAll(e),r}duplicate(){return fs.fromMap(this,this.compareFn)}toMap(){let e=new Map,n=Array.from(super.entries());return n.sort((r,i)=>this.compareFn(r[0],i[0])),n.forEach(([r,i])=>{e.set(r,i)}),e}reverseKeys(){return[...this.sortedKeys].reverse().values()}get(e){let n=this.sortedKeys.find(r=>this.comparator(r,e)===0);if(n!=null)return super.get(n)}set(e,n){this.sortedKeys.length===0&&!this.specifiedCompareFn&&(this.compareFn=LN(e),this.specifiedCompareFn=!0);let r=this.sortedKeys.find(i=>this.compareFn(i,e)===0);return r==null?(this.sortedKeys.push(e),super.set(e,n)):super.set(r,n),this.sortedKeys.sort(this.compareFn),this}setAll(e){return e.forEach((n,r)=>{this.set(r,n)}),this}delete(e){return super.delete(e)?(this.sortedKeys=this.sortedKeys.filter(n=>this.compare(n,e)!==0),!0):!1}clear(){super.clear(),this.sortedKeys=[]}keys(){return this.sortedKeys.values()}values(){return this.sortedKeys.map(e=>super.get(e)).values()}entries(){return this.toMap().entries()}firstEntry(){let e=this.firstKey();if(e==null)return;let n=this.get(e);return n===void 0?void 0:[e,n]}firstKey(){return this.sortedKeys[0]}lastEntry(){let e=this.lastKey();if(e==null)return;let n=this.get(e);return n===void 0?void 0:[e,n]}lastKey(){return[...this.sortedKeys].reverse()[0]}shiftEntry(){let e=this.firstEntry();if(e!=null)return this.delete(e[0]),e}popEntry(){let e=this.lastEntry();if(e!=null)return this.delete(e[0]),e}floorEntry(e){let n=this.floorKey(e);if(n!=null){let r=this.get(n);return r===void 0?void 0:[n,r]}}floorKey(e){return this.sortedKeys.filter(r=>this.compare(r,e)<=0).reverse()[0]}ceilingEntry(e){let n=this.ceilingKey(e);if(n!=null){let r=this.get(n);return r===void 0?void 0:[n,r]}}ceilingKey(e){return this.sortedKeys.filter(r=>this.compare(r,e)>=0)[0]}lowerEntry(e){let n=this.lowerKey(e);if(n!=null){let r=this.get(n);return r===void 0?void 0:[n,r]}}lowerKey(e){return this.sortedKeys.filter(r=>this.compare(r,e)<0).reverse()[0]}higherEntry(e){let n=this.higherKey(e);if(n!=null){let r=this.get(n);return r===void 0?void 0:[n,r]}}higherKey(e){return this.sortedKeys.filter(r=>this.compare(r,e)>0)[0]}splitLower(e,n=!0){let r=Array.from(this.entries()).filter(i=>{let o=this.compare(i[0],e)<0;return n?o||this.compare(i[0],e)===0:o});return new fs(r,this.compareFn)}splitHigher(e,n=!0){let r=Array.from(this.entries()).filter(i=>{let o=this.compare(i[0],e)>0;return n?o||this.compare(i[0],e)===0:o});return new fs(r,this.compareFn)}forEach(e,n){Array.from(this.entries()).forEach(([r,i])=>{e(i,r,this)},n)}};dc.default=fs;PN.__exportStar(bb(),dc)});hM(exports,{default:()=>ye});var Do=Oe(require("obsidian"));var sp=Oe(require("obsidian")),Pu=new Map;function Ke(t,e=!1){let n=window.moment();Pu.has(t)?(Pu.get(t).isBefore(n)||e)&&(new sp.Notice(t),Pu.set(t,n.add(1,"minute"))):(console.log(`[Google Calendar] ${t}`),new sp.Notice(t),Pu.set(t,n.add(0,"minute")))}var gt=Oe(require("obsidian"));var Nu=()=>{var t;return(t=window.localStorage.getItem("googleCalendarAccessToken"))!=null?t:""},Ns=()=>{var t;return(t=window.localStorage.getItem("googleCalendarRefreshToken"))!=null?t:""},xu=()=>{var e;let t=(e=window.localStorage.getItem("googleCalendarExpirationTime"))!=null?e:"0";return parseInt(t,10)},Mi=t=>{window.localStorage.setItem("googleCalendarAccessToken",t)},no=t=>{t!="undefined"&&window.localStorage.setItem("googleCalendarRefreshToken",t)},Ai=t=>{isNaN(t)||window.localStorage.setItem("googleCalendarExpirationTime",t+"")};var ro=Oe(require("obsidian"));var ap=42813,h_=`http://127.0.0.1:${ap}/callback`,m_="https://google-auth-obsidian-redirect.vercel.app/callback",Iu="783376961232-v90b17gr1mj1s2mnmdauvkp77u6htpke.apps.googleusercontent.com",Z4=window.moment().subtract(100,"seconds"),Lt={server:null,verifier:null,challenge:null,state:null};function g_(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function __(){return te(this,null,function*(){let t=new Uint32Array(56);return yield window.crypto.getRandomValues(t),Array.from(t,e=>("0"+e.toString(16)).substr(-2)).join("")})}function v_(t){return te(this,null,function*(){let e=new TextEncoder().encode(t),n=yield window.crypto.subtle.digest("SHA-256",e);return btoa(String.fromCharCode(...new Uint8Array(n))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")})}function gM(){if(!(!Nu()||Nu()=="")&&!!xu()&&!isNaN(xu())&&!(xu()<+new Date))return Nu()}var _M=t=>te(void 0,null,function*(){var i,o;let e=t.settings.useCustomClient,n={grant_type:"refresh_token",client_id:e?(i=t.settings.googleClientId)==null?void 0:i.trim():Iu,client_secret:e?(o=t.settings.googleClientSecret)==null?void 0:o.trim():null,refresh_token:Ns()},{json:r}=yield(0,ro.requestUrl)({method:"POST",url:e?"https://oauth2.googleapis.com/token":`${t.settings.googleOAuthServer}/api/google/refresh`,headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r){Ke("Error while refreshing authentication");return}return Mi(r.access_token),Ai(+new Date+r.expires_in*1e3),r.access_token}),vM=(t,e,n,r)=>te(void 0,null,function*(){return(yield(0,ro.requestUrl)({method:"POST",url:`${t.settings.googleOAuthServer}/api/google/token`,headers:{"content-type":"application/json"},body:JSON.stringify({client_id:Iu,code_verifier:n,code:r,state:e})})).json}),y_=(t,e,n,r,i)=>te(void 0,null,function*(){var u,f;let o=`https://oauth2.googleapis.com/token?grant_type=authorization_code&client_id=${(u=t.settings.googleClientId)==null?void 0:u.trim()}&client_secret=${(f=t.settings.googleClientSecret)==null?void 0:f.trim()}&code_verifier=${n}&code=${r}&state=${e}&redirect_uri=${i?m_:h_}`;return(yield fetch(o,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"}})).json()});function w_(t){return te(this,null,function*(){if(!Ft())return;let e=gM();if(e||(e=yield _M(t)),!!e)return e})}function b_(){return te(this,null,function*(){let t=ye.getInstance(),n=t.settings.useCustomClient?t.settings.googleClientId:Iu;Lt.state||(Lt.state=g_(),Lt.verifier=yield __(),Lt.challenge=yield v_(Lt.verifier));let r=`https://accounts.google.com/o/oauth2/v2/auth?client_id=${n}&response_type=code&redirect_uri=${m_}&prompt=consent&access_type=offline&state=${Lt.state}&code_challenge=${Lt.challenge}&code_challenge_method=S256&scope=email%20profile%20https://www.googleapis.com/auth/calendar`;window.open(r)})}function k_(t,e){return te(this,null,function*(){let n=ye.getInstance();if(e!==Lt.state)return;let r=yield y_(ye.getInstance(),e,Lt.verifier,t,!0);(r==null?void 0:r.refresh_token)&&(no(r.refresh_token),Mi(r.access_token),Ai(+new Date+r.expires_in*1e3),new ro.Notice("Login successful!"),n.settingsTab.display()),Lt={server:null,verifier:null,challenge:null,state:null}})}function E_(){return te(this,null,function*(){let t=ye.getInstance(),e=t.settings.useCustomClient,n=e?t.settings.googleClientId:Iu;if(!ro.Platform.isDesktop){new ro.Notice("Can't use this OAuth method on this device");return}if(!T_())return;Lt.state||(Lt.state=g_(),Lt.verifier=yield __(),Lt.challenge=yield v_(Lt.verifier));let r=`https://accounts.google.com/o/oauth2/v2/auth?client_id=${n}&response_type=code&redirect_uri=${h_}&prompt=consent&access_type=offline&state=${Lt.state}&code_challenge=${Lt.challenge}&code_challenge_method=S256&scope=email%20profile%20https://www.googleapis.com/auth/calendar`;if(Lt.server){window.open(r);return}let i=require("http"),o=require("url");Lt.server=i.createServer((a,u)=>te(this,null,function*(){try{if(a.url.indexOf("/callback")<0)return;let f=new o.URL(a.url,`http://127.0.0.1:${ap}`).searchParams,c=f.get("code");if(f.get("state")!==Lt.state)return;let h;e?h=yield y_(t,Lt.state,Lt.verifier,c,!1):h=yield vM(t,Lt.state,Lt.verifier,c),(h==null?void 0:h.refresh_token)&&(no(h.refresh_token),Mi(h.access_token),Ai(+new Date+h.expires_in*1e3)),console.info("Tokens acquired."),u.end("Authentication successful! Please return to obsidian."),Lt.server.close(()=>{console.log("Server closed")}),t.settingsTab.display()}catch(f){console.log("Auth failed"),Lt.server.close(()=>{console.log("Server closed")})}Lt={server:null,verifier:null,challenge:null,state:null}})).listen(ap,()=>te(this,null,function*(){window.open(r)}))})}var Mt=class extends Error{constructor(e,n,r,i){super(e);Object.setPrototypeOf(this,Mt.prototype),this.request=n,this.status=r,this.response=i}sayHello(){return"hello "+this.message}};var S_=Oe(require("obsidian")),Tr=(t,e,n,r=!1)=>te(void 0,null,function*(){let i=ye.getInstance(),o={"Content-Type":"application/json"};if(r==!1){let u=yield w_(i);if(!u)throw new Mt("Error Google API request",{method:e,url:t,body:n},401,{error:"Missing Auth Token"});o.Authorization="Bearer "+u}if(i.settings.debugMode){console.log(`New Request ${e}:${t}`);let u=zn({},o);u.Authorization&&(u.Authorization=u.Authorization.substring(0,15)+"..."),console.log({body:n,headers:u});let f;try{f=yield fetch(t,{method:e,body:n?JSON.stringify(n):null,headers:o})}catch(c){throw f?new Mt("Error Google API request",{method:e,url:t,body:n},f.status,yield f.json()):new Mt("Error Google API request",{method:e,url:t,body:n},500,{error:"Unknown Error"})}if(f.status>=300)throw new Mt("Error Google API request",{method:e,url:t,body:n},f.status,yield f.json());return e.toLowerCase()=="delete"?{status:"success"}:yield f.json()}let a;try{a=yield(0,S_.requestUrl)({method:e,url:t,body:n?JSON.stringify(n):null,headers:o,throw:!1})}catch(u){throw a?new Mt("Error Google API request",{method:e,url:t,body:n},a.status,yield a.json()):new Mt("Error Google API request",{method:e,url:t,body:n},500,{error:"Unknown Error"})}if(a.status>=300)throw new Mt("Error Google API request",{method:e,url:t,body:n},a.status,a.json);return e.toLowerCase()=="delete"?{status:"success"}:yield a.json});var lp=[];function C_(t,e){return e.filter(r=>!t.settings.calendarBlackList.some(i=>i[0]==r.id))}function Pi(){return te(this,null,function*(){if(!Ft())throw new Mt("Not logged in",null,401,{error:"Not logged in"});let t=ye.getInstance();if(lp.length)return C_(t,lp);let e=yield Tr("https://www.googleapis.com/calendar/v3/users/me/calendarList","GET",null);return lp=e.items,C_(t,e.items)})}function Sr(){return te(this,null,function*(){try{return yield Pi()}catch(t){switch(t.status){case 401:break;case 999:Ke(t.message);break;default:Ke("Could not list Google Calendars."),console.error("[GoogleCalendar]",t);break}return[]}})}var Gr=Oe(require("obsidian"));var K_=Oe(require("obsidian"));var Qt="top",pn="bottom",an="right",rn="left",Ru="auto",io=[Qt,pn,an,rn],Ni="start",Bo="end",D_="clippingParents",Lu="viewport",xs="popper",O_="reference",up=io.reduce(function(t,e){return t.concat([e+"-"+Ni,e+"-"+Bo])},[]),Fu=[].concat(io,[Ru]).reduce(function(t,e){return t.concat([e,e+"-"+Ni,e+"-"+Bo])},[]),yM="beforeRead",wM="read",bM="afterRead",kM="beforeMain",EM="main",TM="afterMain",SM="beforeWrite",CM="write",DM="afterWrite",M_=[yM,wM,bM,kM,EM,TM,SM,CM,DM];function kn(t){return t?(t.nodeName||"").toLowerCase():null}function Zt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Cr(t){var e=Zt(t).Element;return t instanceof e||t instanceof Element}function hn(t){var e=Zt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Is(t){if(typeof ShadowRoot=="undefined")return!1;var e=Zt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function OM(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!hn(o)||!kn(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var u=i[a];u===!1?o.removeAttribute(a):o.setAttribute(a,u===!0?"":u)}))})}function MM(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),u=a.reduce(function(f,c){return f[c]="",f},{});!hn(i)||!kn(i)||(Object.assign(i.style,u),Object.keys(o).forEach(function(f){i.removeAttribute(f)}))})}}var A_={name:"applyStyles",enabled:!0,phase:"write",fn:OM,effect:MM,requires:["computeStyles"]};function En(t){return t.split("-")[0]}var Wr=Math.max,Go=Math.min,xi=Math.round;function Rs(){var t=navigator.userAgentData;return t!=null&&t.brands?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ha(){return!/^((?!chrome|android).)*safari/i.test(Rs())}function Dr(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&hn(t)&&(i=t.offsetWidth>0&&xi(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&xi(r.height)/t.offsetHeight||1);var a=Cr(t)?Zt(t):window,u=a.visualViewport,f=!Ha()&&n,c=(r.left+(f&&u?u.offsetLeft:0))/i,p=(r.top+(f&&u?u.offsetTop:0))/o,h=r.width/i,m=r.height/o;return{width:h,height:m,top:p,right:c+h,bottom:p+m,left:c,x:c,y:p}}function Uo(t){var e=Dr(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function qa(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Is(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Hn(t){return Zt(t).getComputedStyle(t)}function fp(t){return["table","td","th"].indexOf(kn(t))>=0}function On(t){return((Cr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ii(t){return kn(t)==="html"?t:t.assignedSlot||t.parentNode||(Is(t)?t.host:null)||On(t)}function P_(t){return!hn(t)||Hn(t).position==="fixed"?null:t.offsetParent}function AM(t){var e=/firefox/i.test(Rs()),n=/Trident/i.test(Rs());if(n&&hn(t)){var r=Hn(t);if(r.position==="fixed")return null}var i=Ii(t);for(Is(i)&&(i=i.host);hn(i)&&["html","body"].indexOf(kn(i))<0;){var o=Hn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function jr(t){for(var e=Zt(t),n=P_(t);n&&fp(n)&&Hn(n).position==="static";)n=P_(n);return n&&(kn(n)==="html"||kn(n)==="body"&&Hn(n).position==="static")?e:n||AM(t)||e}function zo(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ho(t,e,n){return Wr(t,Go(e,n))}function N_(t,e,n){var r=Ho(t,e,n);return r>n?n:r}function Va(){return{top:0,right:0,bottom:0,left:0}}function Ka(t){return Object.assign({},Va(),t)}function Za(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var PM=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Ka(typeof e!="number"?e:Za(e,io))};function NM(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,u=En(n.placement),f=zo(u),c=[rn,an].indexOf(u)>=0,p=c?"height":"width";if(!(!o||!a)){var h=PM(i.padding,n),m=Uo(o),_=f==="y"?Qt:rn,v=f==="y"?pn:an,b=n.rects.reference[p]+n.rects.reference[f]-a[f]-n.rects.popper[p],E=a[f]-n.rects.reference[f],y=jr(o),O=y?f==="y"?y.clientHeight||0:y.clientWidth||0:0,D=b/2-E/2,F=h[_],P=O-m[p]-h[v],L=O/2-m[p]/2+D,R=Ho(F,L,P),M=f;n.modifiersData[r]=(e={},e[M]=R,e.centerOffset=R-L,e)}}function xM(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||!qa(e.elements.popper,i)||(e.elements.arrow=i))}var x_={name:"arrow",enabled:!0,phase:"main",fn:NM,effect:xM,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Or(t){return t.split("-")[1]}var IM={top:"auto",right:"auto",bottom:"auto",left:"auto"};function RM(t){var e=t.x,n=t.y,r=window,i=r.devicePixelRatio||1;return{x:xi(e*i)/i||0,y:xi(n*i)/i||0}}function I_(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,a=t.offsets,u=t.position,f=t.gpuAcceleration,c=t.adaptive,p=t.roundOffsets,h=t.isFixed,m=a.x,_=m===void 0?0:m,v=a.y,b=v===void 0?0:v,E=typeof p=="function"?p({x:_,y:b}):{x:_,y:b};_=E.x,b=E.y;var y=a.hasOwnProperty("x"),O=a.hasOwnProperty("y"),D=rn,F=Qt,P=window;if(c){var L=jr(n),R="clientHeight",M="clientWidth";if(L===Zt(n)&&(L=On(n),Hn(L).position!=="static"&&u==="absolute"&&(R="scrollHeight",M="scrollWidth")),L=L,i===Qt||(i===rn||i===an)&&o===Bo){F=pn;var H=h&&L===P&&P.visualViewport?P.visualViewport.height:L[R];b-=H-r.height,b*=f?1:-1}if(i===rn||(i===Qt||i===pn)&&o===Bo){D=an;var le=h&&L===P&&P.visualViewport?P.visualViewport.width:L[M];_-=le-r.width,_*=f?1:-1}}var V=Object.assign({position:u},c&&IM),X=p===!0?RM({x:_,y:b}):{x:_,y:b};if(_=X.x,b=X.y,f){var K;return Object.assign({},V,(K={},K[F]=O?"0":"",K[D]=y?"0":"",K.transform=(P.devicePixelRatio||1)<=1?"translate("+_+"px, "+b+"px)":"translate3d("+_+"px, "+b+"px, 0)",K))}return Object.assign({},V,(e={},e[F]=O?b+"px":"",e[D]=y?_+"px":"",e.transform="",e))}function LM(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,u=n.roundOffsets,f=u===void 0?!0:u;if(!1)var c;var p={placement:En(e.placement),variation:Or(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,I_(Object.assign({},p,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:f})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,I_(Object.assign({},p,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var R_={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:LM,data:{}};var Yu={passive:!0};function FM(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,u=a===void 0?!0:a,f=Zt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(p){p.addEventListener("scroll",n.update,Yu)}),u&&f.addEventListener("resize",n.update,Yu),function(){o&&c.forEach(function(p){p.removeEventListener("scroll",n.update,Yu)}),u&&f.removeEventListener("resize",n.update,Yu)}}var L_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:FM,data:{}};var YM={left:"right",right:"left",bottom:"top",top:"bottom"};function Ls(t){return t.replace(/left|right|bottom|top/g,function(e){return YM[e]})}var WM={start:"end",end:"start"};function Wu(t){return t.replace(/start|end/g,function(e){return WM[e]})}function qo(t){var e=Zt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Vo(t){return Dr(On(t)).left+qo(t).scrollLeft}function cp(t,e){var n=Zt(t),r=On(t),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,f=0;if(i){o=i.width,a=i.height;var c=Ha();(c||!c&&e==="fixed")&&(u=i.offsetLeft,f=i.offsetTop)}return{width:o,height:a,x:u+Vo(t),y:f}}function dp(t){var e,n=On(t),r=qo(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Wr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Wr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+Vo(t),f=-r.scrollTop;return Hn(i||n).direction==="rtl"&&(u+=Wr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:f}}function Ko(t){var e=Hn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function ju(t){return["html","body","#document"].indexOf(kn(t))>=0?t.ownerDocument.body:hn(t)&&Ko(t)?t:ju(Ii(t))}function oo(t,e){var n;e===void 0&&(e=[]);var r=ju(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Zt(r),a=i?[o].concat(o.visualViewport||[],Ko(r)?r:[]):r,u=e.concat(a);return i?u:u.concat(oo(Ii(a)))}function Fs(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function jM(t,e){var n=Dr(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function F_(t,e,n){return e===Lu?Fs(cp(t,n)):Cr(e)?jM(e,n):Fs(dp(On(t)))}function BM(t){var e=oo(Ii(t)),n=["absolute","fixed"].indexOf(Hn(t).position)>=0,r=n&&hn(t)?jr(t):t;return Cr(r)?e.filter(function(i){return Cr(i)&&qa(i,r)&&kn(i)!=="body"}):[]}function pp(t,e,n,r){var i=e==="clippingParents"?BM(t):[].concat(e),o=[].concat(i,[n]),a=o[0],u=o.reduce(function(f,c){var p=F_(t,c,r);return f.top=Wr(p.top,f.top),f.right=Go(p.right,f.right),f.bottom=Go(p.bottom,f.bottom),f.left=Wr(p.left,f.left),f},F_(t,a,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function Xa(t){var e=t.reference,n=t.element,r=t.placement,i=r?En(r):null,o=r?Or(r):null,a=e.x+e.width/2-n.width/2,u=e.y+e.height/2-n.height/2,f;switch(i){case Qt:f={x:a,y:e.y-n.height};break;case pn:f={x:a,y:e.y+e.height};break;case an:f={x:e.x+e.width,y:u};break;case rn:f={x:e.x-n.width,y:u};break;default:f={x:e.x,y:e.y}}var c=i?zo(i):null;if(c!=null){var p=c==="y"?"height":"width";switch(o){case Ni:f[c]=f[c]-(e[p]/2-n[p]/2);break;case Bo:f[c]=f[c]+(e[p]/2-n[p]/2);break;default:}}return f}function Br(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,a=o===void 0?t.strategy:o,u=n.boundary,f=u===void 0?D_:u,c=n.rootBoundary,p=c===void 0?Lu:c,h=n.elementContext,m=h===void 0?xs:h,_=n.altBoundary,v=_===void 0?!1:_,b=n.padding,E=b===void 0?0:b,y=Ka(typeof E!="number"?E:Za(E,io)),O=m===xs?O_:xs,D=t.rects.popper,F=t.elements[v?O:m],P=pp(Cr(F)?F:F.contextElement||On(t.elements.popper),f,p,a),L=Dr(t.elements.reference),R=Xa({reference:L,element:D,strategy:"absolute",placement:i}),M=Fs(Object.assign({},D,R)),H=m===xs?M:L,le={top:P.top-H.top+y.top,bottom:H.bottom-P.bottom+y.bottom,left:P.left-H.left+y.left,right:H.right-P.right+y.right},V=t.modifiersData.offset;if(m===xs&&V){var X=V[i];Object.keys(le).forEach(function(K){var ce=[an,pn].indexOf(K)>=0?1:-1,S=[Qt,pn].indexOf(K)>=0?"y":"x";le[K]+=X[S]*ce})}return le}function hp(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,u=n.flipVariations,f=n.allowedAutoPlacements,c=f===void 0?Fu:f,p=Or(r),h=p?u?up:up.filter(function(v){return Or(v)===p}):io,m=h.filter(function(v){return c.indexOf(v)>=0});m.length===0&&(m=h);var _=m.reduce(function(v,b){return v[b]=Br(t,{placement:b,boundary:i,rootBoundary:o,padding:a})[En(b)],v},{});return Object.keys(_).sort(function(v,b){return _[v]-_[b]})}function GM(t){if(En(t)===Ru)return[];var e=Ls(t);return[Wu(t),e,Wu(e)]}function UM(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!0:a,f=n.fallbackPlacements,c=n.padding,p=n.boundary,h=n.rootBoundary,m=n.altBoundary,_=n.flipVariations,v=_===void 0?!0:_,b=n.allowedAutoPlacements,E=e.options.placement,y=En(E),O=y===E,D=f||(O||!v?[Ls(E)]:GM(E)),F=[E].concat(D).reduce(function(_e,Ce){return _e.concat(En(Ce)===Ru?hp(e,{placement:Ce,boundary:p,rootBoundary:h,padding:c,flipVariations:v,allowedAutoPlacements:b}):Ce)},[]),P=e.rects.reference,L=e.rects.popper,R=new Map,M=!0,H=F[0],le=0;le=0,S=ce?"width":"height",Q=Br(e,{placement:V,boundary:p,rootBoundary:h,altBoundary:m,padding:c}),j=ce?K?an:rn:K?pn:Qt;P[S]>L[S]&&(j=Ls(j));var U=Ls(j),J=[];if(o&&J.push(Q[X]<=0),u&&J.push(Q[j]<=0,Q[U]<=0),J.every(function(_e){return _e})){H=V,M=!1;break}R.set(V,J)}if(M)for(var re=v?3:1,Y=function(Ce){var Fe=F.find(function(je){var pt=R.get(je);if(pt)return pt.slice(0,Ce).every(function(ht){return ht})});if(Fe)return H=Fe,"break"},z=re;z>0;z--){var ee=Y(z);if(ee==="break")break}e.placement!==H&&(e.modifiersData[r]._skip=!0,e.placement=H,e.reset=!0)}}var Y_={name:"flip",enabled:!0,phase:"main",fn:UM,requiresIfExists:["offset"],data:{_skip:!1}};function W_(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function j_(t){return[Qt,an,pn,rn].some(function(e){return t[e]>=0})}function zM(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,a=Br(e,{elementContext:"reference"}),u=Br(e,{altBoundary:!0}),f=W_(a,r),c=W_(u,i,o),p=j_(f),h=j_(c);e.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":h})}var B_={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:zM};function HM(t,e,n){var r=En(t),i=[rn,Qt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,a=o[0],u=o[1];return a=a||0,u=(u||0)*i,[rn,an].indexOf(r)>=0?{x:u,y:a}:{x:a,y:u}}function qM(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,a=Fu.reduce(function(p,h){return p[h]=HM(h,e.rects,o),p},{}),u=a[e.placement],f=u.x,c=u.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=f,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=a}var G_={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:qM};function VM(t){var e=t.state,n=t.name;e.modifiersData[n]=Xa({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var U_={name:"popperOffsets",enabled:!0,phase:"read",fn:VM,data:{}};function mp(t){return t==="x"?"y":"x"}function KM(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!1:a,f=n.boundary,c=n.rootBoundary,p=n.altBoundary,h=n.padding,m=n.tether,_=m===void 0?!0:m,v=n.tetherOffset,b=v===void 0?0:v,E=Br(e,{boundary:f,rootBoundary:c,padding:h,altBoundary:p}),y=En(e.placement),O=Or(e.placement),D=!O,F=zo(y),P=mp(F),L=e.modifiersData.popperOffsets,R=e.rects.reference,M=e.rects.popper,H=typeof b=="function"?b(Object.assign({},e.rects,{placement:e.placement})):b,le=typeof H=="number"?{mainAxis:H,altAxis:H}:Object.assign({mainAxis:0,altAxis:0},H),V=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,X={x:0,y:0};if(!!L){if(o){var K,ce=F==="y"?Qt:rn,S=F==="y"?pn:an,Q=F==="y"?"height":"width",j=L[F],U=j+E[ce],J=j-E[S],re=_?-M[Q]/2:0,Y=O===Ni?R[Q]:M[Q],z=O===Ni?-M[Q]:-R[Q],ee=e.elements.arrow,_e=_&&ee?Uo(ee):{width:0,height:0},Ce=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Va(),Fe=Ce[ce],je=Ce[S],pt=Ho(0,R[Q],_e[Q]),ht=D?R[Q]/2-re-pt-Fe-le.mainAxis:Y-pt-Fe-le.mainAxis,ge=D?-R[Q]/2+re+pt+je+le.mainAxis:z+pt+je+le.mainAxis,Ee=e.elements.arrow&&jr(e.elements.arrow),vt=Ee?F==="y"?Ee.clientTop||0:Ee.clientLeft||0:0,Ht=(K=V==null?void 0:V[F])!=null?K:0,mr=j+ht-Ht-vt,rt=j+ge-Ht,Ue=Ho(_?Go(U,mr):U,j,_?Wr(J,rt):J);L[F]=Ue,X[F]=Ue-j}if(u){var Vn,tr=F==="x"?Qt:rn,_n=F==="x"?pn:an,vn=L[P],Yn=P==="y"?"height":"width",Gt=vn+E[tr],Wn=vn-E[_n],Cn=[Qt,rn].indexOf(y)!==-1,yn=(Vn=V==null?void 0:V[P])!=null?Vn:0,jn=Cn?Gt:vn-R[Yn]-M[Yn]-yn+le.altAxis,Kn=Cn?vn+R[Yn]+M[Yn]-yn-le.altAxis:Wn,Zn=_&&Cn?N_(jn,vn,Kn):Ho(_?jn:Gt,vn,_?Kn:Wn);L[P]=Zn,X[P]=Zn-vn}e.modifiersData[r]=X}}var z_={name:"preventOverflow",enabled:!0,phase:"main",fn:KM,requiresIfExists:["offset"]};function gp(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function _p(t){return t===Zt(t)||!hn(t)?qo(t):gp(t)}function ZM(t){var e=t.getBoundingClientRect(),n=xi(e.width)/t.offsetWidth||1,r=xi(e.height)/t.offsetHeight||1;return n!==1||r!==1}function vp(t,e,n){n===void 0&&(n=!1);var r=hn(e),i=hn(e)&&ZM(e),o=On(e),a=Dr(t,i,n),u={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(r||!r&&!n)&&((kn(e)!=="body"||Ko(o))&&(u=_p(e)),hn(e)?(f=Dr(e,!0),f.x+=e.clientLeft,f.y+=e.clientTop):o&&(f.x=Vo(o))),{x:a.left+u.scrollLeft-f.x,y:a.top+u.scrollTop-f.y,width:a.width,height:a.height}}function XM(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(u){if(!n.has(u)){var f=e.get(u);f&&i(f)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function yp(t){var e=XM(t);return M_.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function wp(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function bp(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var H_={placement:"bottom",modifiers:[],strategy:"absolute"};function q_(){for(var t=arguments.length,e=new Array(t),n=0;n(t%e+e)%e,Z_=class{constructor(e,n,r){this.owner=e,this.containerEl=n,n.on("click",".suggestion-item",this.onSuggestionClick.bind(this)),n.on("mousemove",".suggestion-item",this.onSuggestionMouseover.bind(this)),r.register([],"ArrowUp",i=>{if(!i.isComposing)return this.setSelectedItem(this.selectedItem-1,!0),!1}),r.register([],"ArrowDown",i=>{if(!i.isComposing)return this.setSelectedItem(this.selectedItem+1,!0),!1}),r.register([],"Enter",i=>{if(!i.isComposing)return this.useSelectedItem(i),!1})}onSuggestionClick(e,n){e.preventDefault();let r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1),this.useSelectedItem(e)}onSuggestionMouseover(e,n){let r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1)}setSuggestions(e){this.containerEl.empty();let n=[];e.forEach(r=>{let i=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(r,i),n.push(i)}),this.values=e,this.suggestions=n,this.setSelectedItem(0,!1)}useSelectedItem(e){let n=this.values[this.selectedItem];n&&this.owner.selectSuggestion(n,e)}setSelectedItem(e,n){let r=QM(e,this.suggestions.length),i=this.suggestions[this.selectedItem],o=this.suggestions[r];i==null||i.removeClass("is-selected"),o==null||o.addClass("is-selected"),this.selectedItem=r,n&&o.scrollIntoView(!1)}},Ja=class{constructor(e){this.inputEl=e,this.scope=new K_.Scope,this.suggestEl=createDiv("suggestion-container");let n=this.suggestEl.createDiv("suggestion");this.suggest=new Z_(this,n,this.scope),this.scope.register([],"Escape",this.close.bind(this)),this.inputEl.addEventListener("input",this.onInputChanged.bind(this)),this.inputEl.addEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.addEventListener("blur",this.close.bind(this)),this.suggestEl.on("mousedown",".suggestion-container",r=>{r.preventDefault()})}onInputChanged(){let e=this.inputEl.value,n=this.getSuggestions(e);if(!n){this.close();return}n.length>0?(this.suggest.setSuggestions(n),this.open(app.dom.appContainerEl,this.inputEl)):this.close()}open(e,n){app.keymap.pushScope(this.scope),e.appendChild(this.suggestEl),this.popper=kp(n,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"sameWidth",enabled:!0,fn:({state:r,instance:i})=>{let o=`${r.rects.reference.width}px`;r.styles.popper.width!==o&&(r.styles.popper.width=o,i.update())},phase:"beforeWrite",requires:["computeStyles"]}]})}close(){app.keymap.popScope(this.scope),this.suggest.setSuggestions([]),this.popper&&this.popper.destroy(),this.suggestEl.detach()}};function $M(t){t=(0,Gr.normalizePath)(t);let e=app.vault.getAbstractFileByPath(t);return!e||!(e instanceof Gr.TFolder)?null:e}function X_(t){let e=$M(t),n=[];return Gr.Vault.recurseChildren(e,r=>{r instanceof Gr.TFile&&n.push(r)}),n.sort((r,i)=>r.basename.localeCompare(i.basename)),n}var J_;(function(n){n[n.TemplateFiles=0]="TemplateFiles",n[n.ScriptFiles=1]="ScriptFiles"})(J_||(J_={}));var Qa=class extends Ja{constructor(e,n){super(e);this.inputEl=e;this.plugin=n}getSuggestions(e){var a,u,f,c,p,h,m;let n=[];if(this.plugin.templaterPlugin){let _=(0,Gr.normalizePath)((f=(u=(a=this.plugin)==null?void 0:a.templaterPlugin)==null?void 0:u.settings)==null?void 0:f.templates_folder),v=X_(_);n=[...n,...v]}if(this.plugin.coreTemplatePlugin){let _=(0,Gr.normalizePath)((m=(h=(p=(c=this.plugin)==null?void 0:c.coreTemplatePlugin)==null?void 0:p.instance)==null?void 0:h.options)==null?void 0:m.folder),v=X_(_);n=[...n,...v]}if(!n)return[];let r=new Set(n),i=[],o=e.toLowerCase();return r.forEach(_=>{_ instanceof Gr.TFile&&_.extension==="md"&&_.path.toLowerCase().contains(o)&&i.push(_)}),i}renderSuggestion(e,n){n.setText(e.path)}selectSuggestion(e){this.inputEl.value=e.path,this.inputEl.trigger("input"),this.close()}};var Q_=Oe(require("obsidian"));var $a=class extends Ja{getSuggestions(e){let n=app.vault.getAllLoadedFiles(),r=[],i=e.toLowerCase();return n.forEach(o=>{o instanceof Q_.TFolder&&o.path.toLowerCase().contains(i)&&r.push(o)}),r}renderSuggestion(e,n){n.setText(e.path)}selectSuggestion(e){this.inputEl.value=e.path,this.inputEl.trigger("input"),this.close()}};var Mr=Oe(Bu()),Sp=Oe(Ri()),Gu={},Cp={},Bs=t=>te(void 0,null,function*(){if(!app.workspace.layoutReady||!t.settings.activateDailyNoteAddon)return;let e={};try{e=(0,Mr.getAllDailyNotes)()}catch(n){console.log("Daily note folder not set. Deactivated Show Daily notes setting."),t.settings.activateDailyNoteAddon=!1,t.saveSettings()}Sp.default.isEqual(Gu,e)==!1&&(Gu=e)}),so=t=>te(void 0,null,function*(){if(!app.workspace.layoutReady||!t.settings.activateDailyNoteAddon||!t.settings.useWeeklyNotes)return;let e={};try{e=(0,Mr.getAllWeeklyNotes)()}catch(n){console.log("Daily note folder not set. Deactivated Show Daily notes setting."),t.settings.activateDailyNoteAddon=!1,t.saveSettings()}Sp.default.isEqual(Cp,e)==!1&&(Cp=e)}),Uu=()=>Gu,Zo=t=>(0,Mr.getDailyNote)(t,Gu);var ll=t=>(0,Mr.getWeeklyNote)(t,Cp),_1=t=>te(void 0,null,function*(){var e,n,r,i;if(!t.type||t.type==="daily"){let o=Zo((e=t.date)!=null?e:window.moment());return o||(o=yield(0,Mr.createDailyNote)((n=t.date)!=null?n:window.moment()),Bs(ye.getInstance()),o)}if(t.type==="weekly"){let o=ll((r=t.date)!=null?r:window.moment());return o||(o=yield(0,Mr.createWeeklyNote)((i=t.date)!=null?i:window.moment()),so(ye.getInstance()),o)}}),Li=t=>te(void 0,null,function*(){var r,i;let e=yield _1(t);yield app.workspace.getLeaf((r=t.openInNewTab)!=null?r:!1,(i=t.openToRight)!=null?i:"horizontal").openFile(e,{active:!0})}),Dp=t=>te(void 0,null,function*(){let e=yield _1(t);yield app.workspace.openPopoutLeaf().openFile(e,{active:!0})});var v1=Oe(require("obsidian")),Op=class extends v1.Modal{constructor(e){super(e)}onOpen(){let{contentEl:e}=this;e.createEl("h1",{text:"Google Calendar Alert"}),e.createEl("p",{text:"The public client is full and will not work. Please activate `Use own authentication client` again. Press the link below to find out how to create a own client."}),e.createEl("a",{text:"Tutorial",href:"https://yukigasai.github.io/obsidian-google-calendar/#/Basics/Installation"})}onClose(){let{contentEl:e}=this;e.empty()}};var Mp=class extends gt.PluginSettingTab{constructor(e,n){super(e,n);this.plugin=n}display(){let{containerEl:e}=this,n=Ns();e.empty(),e.createEl("h2",{text:"Settings for Google Calendar"}),e.createEl("h4",{text:"Please restart Obsidian to let changes take effect"});let r=document.createDocumentFragment();r.append("Use own authentication client",r.createEl("br"),"Check the ",r.createEl("a",{href:"https://yukigasai.github.io/obsidian-google-calendar/#/Basics/Installation",text:"documentation"})," to find out how to create a own client."),new gt.Setting(e).setName("Use own authentication client").setDesc(r).addToggle(o=>o.setValue(this.plugin.settings.useCustomClient).onChange(a=>te(this,null,function*(){no(""),Mi(""),Ai(0),a===!1&&new Op(app).open(),this.plugin.settings.useCustomClient=a,yield this.plugin.saveSettings(),this.display()}))),this.plugin.settings.useCustomClient?(new gt.Setting(e).setName("ClientId").setDesc("Google client id").setClass("SubSettings").addText(o=>o.setPlaceholder("Enter your client id").setValue(this.plugin.settings.googleClientId).onChange(a=>te(this,null,function*(){this.plugin.settings.googleClientId=a.trim(),yield this.plugin.saveSettings()}))),new gt.Setting(e).setName("ClientSecret").setDesc("Google client secret").setClass("SubSettings").addText(o=>o.setPlaceholder("Enter your client secret").setValue(this.plugin.settings.googleClientSecret).onChange(a=>te(this,null,function*(){this.plugin.settings.googleClientSecret=a.trim(),yield this.plugin.saveSettings()})))):new gt.Setting(e).setName("Server url").setDesc("The url to the server where the oauth takes place").setClass("SubSettings").addText(o=>{o.setValue(this.plugin.settings.googleOAuthServer).onChange(a=>te(this,null,function*(){this.plugin.settings.googleOAuthServer=a.trim(),yield this.plugin.saveSettings()}))}),new gt.Setting(e).setName("Login with google").addButton(o=>{o.setButtonText(n?"Logout":"Login").onClick(()=>{n?(no(""),Mi(""),Ai(0),this.hide(),this.display()):gt.Platform.isMobileApp?this.plugin.settings.useCustomClient?b_():window.open(`${this.plugin.settings.googleOAuthServer}/api/google`):E_()})}),new gt.Setting(e).setName("Refresh Interval").setDesc("Time in seconds between refresh request from google server").addSlider(o=>{o.setValue(this.plugin.settings.refreshInterval),o.setLimits(this.plugin.settings.useCustomClient?10:60,360,1),o.setDynamicTooltip(),o.onChange(a=>te(this,null,function*(){a<60&&!this.plugin.settings.useCustomClient||(this.plugin.settings.refreshInterval=a,yield this.plugin.saveSettings())}))}),new gt.Setting(e).setName("Use event Notification").setDesc("Will send notification when an event starts").addToggle(o=>{o.setValue(this.plugin.settings.useNotification),o.onChange(a=>te(this,null,function*(){this.plugin.settings.useNotification=a,yield this.plugin.saveSettings(),this.hide(),this.display()}))}),new gt.Setting(e).setName("Show daily notes").setDesc("Will display daily notes and allow to open and create daily notes").addToggle(o=>{o.setValue(this.plugin.settings.activateDailyNoteAddon),o.onChange(a=>te(this,null,function*(){this.plugin.settings.activateDailyNoteAddon=a,yield this.plugin.saveSettings(),this.hide(),this.display()}))}),this.plugin.settings.activateDailyNoteAddon&&(new gt.Setting(e).setName("Use Weekly Notes").setDesc("Will show week numbers with weekly note dots").setClass("SubSettings").addToggle(o=>{o.setValue(this.plugin.settings.useWeeklyNotes),o.onChange(a=>te(this,null,function*(){this.plugin.settings.useWeeklyNotes=a,a&&so(this.plugin),yield this.plugin.saveSettings(),this.hide(),this.display()}))}),new gt.Setting(e).setName("Daily dot color").setDesc("Color for daily note dots in month view").setClass("SubSettings").addText(o=>{o.inputEl.type="color",o.setValue(this.plugin.settings.dailyNoteDotColor),o.onChange(a=>te(this,null,function*(){this.plugin.settings.dailyNoteDotColor=a,yield this.plugin.saveSettings()}))})),new gt.Setting(e).setName("Enable @ Annotations").setDesc("Will help you to easily link events from you calendar in your notes").addToggle(o=>{o.setValue(this.plugin.settings.atAnnotationEnabled),o.onChange(a=>te(this,null,function*(){this.plugin.settings.atAnnotationEnabled=a,yield this.plugin.saveSettings(),this.hide(),this.display()}))}),this.plugin.settings.atAnnotationEnabled&&new gt.Setting(e).setName("@ Annotation date format").setDesc("SWitch between mm/dd/yyyy and dd/mm/yyyy").setClass("SubSettings").addDropdown(o=>{o.addOption("mm/dd/yyyy","mm/dd/yyyy"),o.addOption("dd/mm/yyyy","dd/mm/yyyy"),o.setValue(this.plugin.settings.usDateFormat?"mm/dd/yyyy":"dd/mm/yyyy"),o.onChange(a=>te(this,null,function*(){a=="mm/dd/yyyy"?this.plugin.settings.usDateFormat=!0:this.plugin.settings.usDateFormat=!1,yield this.plugin.saveSettings(),this.hide(),this.display()}))}),new gt.Setting(e).setName("Auto create Event Notes").setDesc("Will create new notes from a event if the description contains :obsidian:").addToggle(o=>{o.setValue(this.plugin.settings.autoCreateEventNotes),o.onChange(a=>te(this,null,function*(){this.plugin.settings.autoCreateEventNotes=a,yield this.plugin.saveSettings(),this.hide(),this.display()}))}),new gt.Setting(e).setName("Auto create Event Notes Marker").setDesc("Specify the marker that will be used to find events to create notes. Keep empty to create a note for all events.").setClass("SubSettings").addText(o=>{o.setValue(this.plugin.settings.autoCreateEventNotesMarker),o.onChange(a=>te(this,null,function*(){this.plugin.settings.autoCreateEventNotesMarker=a,yield this.plugin.saveSettings()}))}),new gt.Setting(e).setName("Keep auto created Notes open").setDesc("When creating a new note should it stay open for direct editing").setClass("SubSettings").addToggle(o=>{o.setValue(this.plugin.settings.autoCreateEventKeepOpen),o.onChange(a=>te(this,null,function*(){this.plugin.settings.autoCreateEventKeepOpen=a,yield this.plugin.saveSettings(),this.hide(),this.display()}))}),new gt.Setting(e).setName("Import Start Offset").setDesc("Days in the past from events to import").setClass("SubSettings").addSlider(o=>{o.setValue(this.plugin.settings.importStartOffset),o.setLimits(0,7,1),o.setDynamicTooltip(),o.onChange(a=>te(this,null,function*(){o.showTooltip(),this.plugin.settings.importStartOffset=a,yield this.plugin.saveSettings()}))}),new gt.Setting(e).setName("Import End Offset").setDesc("Days in the future from events to import").setClass("SubSettings").addSlider(o=>{o.setValue(this.plugin.settings.importEndOffset),o.setLimits(0,7,1),o.setDynamicTooltip(),o.onChange(a=>te(this,null,function*(){this.plugin.settings.importEndOffset=a,yield this.plugin.saveSettings()}))}),new gt.Setting(e).setName("Event Note Prefix").setDesc("Optional prefix for event notes to improve performance").setClass("SubSettings").addText(o=>{o.setValue(this.plugin.settings.optionalNotePrefix),o.onChange(a=>te(this,null,function*(){this.plugin.settings.optionalNotePrefix=a,yield this.plugin.saveSettings()}))}),new gt.Setting(e).setName("Event Note Name Format").setDesc("Define how the event note name should look like").setClass("SubSettings").addText(o=>{o.setValue(this.plugin.settings.eventNoteNameFormat),o.onChange(a=>te(this,null,function*(){this.plugin.settings.eventNoteNameFormat=a,yield this.plugin.saveSettings()}))}),new gt.Setting(e).setName("Debug Mode").setDesc("Enable if something is not working").addToggle(o=>{o.setValue(this.plugin.settings.debugMode),o.onChange(a=>te(this,null,function*(){this.plugin.settings.debugMode=a,yield this.plugin.saveSettings()}))}),new gt.Setting(e).setName("Use defaults for note creation").setDesc("If active creating notes will be faster but less flexible").addToggle(o=>{o.setValue(this.plugin.settings.useDefaultTemplate),o.onChange(a=>te(this,null,function*(){this.plugin.settings.useDefaultTemplate=a,yield this.plugin.saveSettings(),this.display()}))}),this.plugin.settings.useDefaultTemplate&&(new gt.Setting(e).setName("Default Template").setDesc("Template to use at note creation").setClass("SubSettings").addSearch(o=>{new Qa(o.inputEl,this.plugin),o.setPlaceholder("Template").setValue(this.plugin.settings.defaultTemplate).onChange(a=>te(this,null,function*(){this.plugin.settings.defaultTemplate=a,yield this.plugin.saveSettings()})),o.containerEl.addClass("templater_search")}),new gt.Setting(e).setName("Default Folder").setDesc("Folder to save notes to after creation").setClass("SubSettings").addSearch(o=>{new $a(o.inputEl),o.setPlaceholder("Example: folder1/folder2").setValue(this.plugin.settings.defaultFolder).onChange(a=>te(this,null,function*(){this.plugin.settings.defaultFolder=a,yield this.plugin.saveSettings()})),o.containerEl.addClass("templater_search")}));let i=this.plugin.settings.insertTemplates;if(i.length&&(new gt.Setting(e).setName("Saved Templates"),i.forEach(o=>{let a=new gt.Setting(e).setClass("SubSettings").setName(o.name).addButton(u=>{u.setButtonText("Remove"),u.onClick(()=>te(this,null,function*(){this.plugin.settings.insertTemplates.remove(o),a.settingEl.remove(),yield this.plugin.saveSettings(),this.hide(),this.display()}))})})),Ft()){new gt.Setting(e).setName("Default Calendar").addDropdown(a=>te(this,null,function*(){a.addOption("Default","Select a calendar"),(yield Sr()).forEach(f=>{a.addOption(f.id,f.summary)}),a.setValue(this.plugin.settings.defaultCalendar),a.onChange(f=>te(this,null,function*(){this.plugin.settings.defaultCalendar=f,yield this.plugin.saveSettings()}))})),e.createEl("h3","Calendar Blacklist");let o=this.plugin.settings.calendarBlackList;new gt.Setting(e).setName("Add Item to BlackList").addDropdown(a=>te(this,null,function*(){a.addOption("Default","Select Option to add"),(yield Sr()).forEach(f=>{a.addOption(f.id+"_=_"+f.summary,f.summary)}),a.onChange(f=>te(this,null,function*(){let[c,p]=f.split("_=_");o.contains([c,p])||(this.plugin.settings.calendarBlackList=[...o,[c,p]],yield this.plugin.saveSettings());let h=new gt.Setting(e).setClass("SubSettings").setName(p).addButton(m=>{m.setButtonText("Remove"),m.onClick(()=>te(this,null,function*(){this.plugin.settings.calendarBlackList.remove([c,p]),h.settingEl.remove(),yield this.plugin.saveSettings()}))})}))})),o.forEach(a=>{let u=new gt.Setting(e).setClass("SubSettings").setName(a[1]).addButton(f=>{f.setButtonText("Remove"),f.onClick(()=>te(this,null,function*(){this.plugin.settings.calendarBlackList.remove(a),u.settingEl.remove(),yield this.plugin.saveSettings()}))})})}}};function T_(){let t=ye.getInstance();return t.settings.useCustomClient&&(t.settings.googleClientId==""||t.settings.googleClientSecret=="")?(Ke("Google Calendar missing settings"),!1):!0}function Ft(){return!Ns()||Ns()==""?(Ke("Google Calendar missing settings or not logged in"),!1):!0}var Ov=Oe(require("obsidian"));var Pp=Oe(Ri());var y1={"1":{hex:"#ac725e",name:"0"},"2":{hex:"#d06b64",name:"0"},"3":{hex:"#f83a22",name:"0"},"4":{hex:"#fa573c",name:"0"},"5":{hex:"#ff7537",name:"0"},"6":{hex:"#ffad46",name:"0"},"7":{hex:"#42d692",name:"0"},"8":{hex:"#16a765",name:"0"},"9":{hex:"#7bd148",name:"0"},"10":{hex:"#b3dc6c",name:"0"},"11":{hex:"#fbe983",name:"0"},"12":{hex:"#fad165",name:"0"},"13":{hex:"#92e1c0",name:"0"},"14":{hex:"#9fe1e7",name:"0"},"15":{hex:"#9fc6e7",name:"0"},"16":{hex:"#4986e7",name:"0"},"17":{hex:"#9a9cff",name:"0"},"18":{hex:"#b99aff",name:"0"},"19":{hex:"#c2c2c2",name:"0"},"20":{hex:"#cabdbf",name:"0"},"21":{hex:"#cca6ac",name:"0"},"22":{hex:"#f691b2",name:"0"},"23":{hex:"#cd74e6",name:"0"},"24":{hex:"#a47ae2",name:"0"}},zu={"1":{hex:"#a4bdfc",name:"Lavender"},"2":{hex:"#7ae7bf",name:"Sage"},"3":{hex:"#dbadff",name:"Grape"},"4":{hex:"#ff887c",name:"Flamingo"},"5":{hex:"#fbd75b",name:"Banana"},"6":{hex:"#ffb878",name:"Tangerine"},"7":{hex:"#46d6db",name:"Peacock"},"8":{hex:"#e1e1e1",name:"Graphite"},"9":{hex:"#5484ed",name:"Blueberry"},"10":{hex:"#51b749",name:"Basil"},"11":{hex:"#dc2127",name:"Tomato"}},Ap=[...new Set([...Object.values(zu).map(t=>t.name),...Object.values(y1).map(t=>t.name)])],ul=[...Object.values(zu).map(t=>t.name)];function Fi(t){return t.colorId?zu[t.colorId].hex:t.parent.colorId?y1[t.parent.colorId].hex:"#a4bdfc"}function fl(t){return t.colorId?zu[t.colorId].name:t.parent.colorId?"NOT IMPLEMENTED":"NO COLOR"}var Hu=new Map;function zr(){Hu.clear()}function Np(){return te(this,arguments,function*({startDate:t,endDate:e,exclude:n,include:r}={}){let i=ye.getInstance();t||(t=window.moment()),t=t.startOf("day"),e||(e=t.clone()),e=e.endOf("day");let o=yield Pi(),[a,u]=(r!=null?r:[]).reduce(([h,m],_)=>Ap.includes(_)?[h,[...m,_]]:[[...h,_],m],[[],[]]),[f,c]=(n!=null?n:[]).reduce(([h,m],_)=>Ap.includes(_)?[h,[...m,_]]:[[...h,_],m],[[],[]]);a.length?o=o.filter(h=>a.contains(h.id)||a.contains(h.summary)):f.length&&(o=o.filter(h=>!(f.contains(h.id)||f.contains(h.summary))));let p=[];for(let h=0;h{var m;return new Date((m=h.start.date)!=null?m:h.start.dateTime)}],"asc"),p})}function Yt(){return te(this,arguments,function*(t={}){try{return yield Np(t)}catch(e){if(!(e instanceof Mt))return[];switch(e.status){case 401:break;case 999:Ke(e.message);break;default:Ke("Google Events could not be loaded."),console.error("[GoogleCalendar]",e);break}return[]}})}function bA(t,e,n){return te(this,null,function*(){if(!Ft())throw new Mt("Not logged in",null,401,{error:"Not logged in"});let r,i=2500,o=[];do{let a=`https://www.googleapis.com/calendar/v3/calendars/${encodeURIComponent(t.id)}/events?`;a+=`maxResults=${i}`,a+="&futureevents=true",a+="&singleEvents=true",a+="&orderby=starttime",a+="&sortorder=ascending",a+=`&timeMin=${e}`,a+=`&timeMax=${n}`,r&&r.nextPageToken&&(a+=`&pageToken=${r.nextPageToken}`),r=yield Tr(a,"GET",null);let u=r.items.filter(f=>(f.parent=t,f.status!="cancelled"));o=[...o,...u]}while(r.items.length==i&&r.nextPageToken);return o})}function kA(t,e,n){let r=[];return t.forEach(i=>{if(!i.start.dateTime||!i.end.dateTime)return;let o=window.moment(i.end.dateTime),a=window.moment(i.start.dateTime);if(a.isSame(o,"day"))return;let u=[],f=o.endOf("day").diff(a.startOf("day"),"days")+1,c=i.summary,p=1;do i.summary=`${c} (Day ${p}/${f})`,i.eventType="multiDay",u=[...u,structuredClone(i)],p++,a=a.add(1,"days"),i.start.dateTime=a.format("YYYY-MM-DD HH:mm");while(!a.isAfter(o,"day"));u=u.filter(h=>{let m=window.moment(h.start.dateTime);return!(e&&m.isBefore(e,"day")||n&&m.isSameOrAfter(n,"day"))}),i.eventType="delete",r=[...r,...u]}),t=[...t,...r],t}function EA(t,e,n,r){let i=n.clone(),o=[];for(;i<=r;){let a=JSON.stringify({day:i.format("YYYY-MM-DD"),calendar:e.id});if(!Hu.has(a))return null;!t.settings.useCustomClient&&t.settings.refreshInterval<60&&(t.settings.refreshInterval=60);let{events:u,updated:f}=Hu.get(a);if(f.clone().add(t.settings.refreshInterval,"second").isBefore(window.moment()))return null;o=[...o,...u],i.add(1,"day")}return o}function TA(a,u,f,c){return te(this,arguments,function*(t,e,n,r,i=[],o=[]){let p=EA(t,e,n,r);if(p)return p.filter(v=>i.length>0?i.includes(fl(v)):o.length>0?!o.includes(fl(v)):!0);let h=yield bA(e,n.toISOString(),r.toISOString());h=kA(h,n,r);let m=Pp.default.groupBy(h,v=>{var E;return window.moment((E=v.start.dateTime)!=null?E:v.start.date).format("YYYY-MM-DD")}),_=n.clone();for(;_<=r;){let v=_.format("YYYY-MM-DD"),b=JSON.stringify({day:v,calendar:e.id});Hu.set(b,{events:m[v]||[],updated:window.moment()}),_.add(1,"day")}return h.filter(v=>v.eventType==="delete"?!1:i.length>0?i.includes(fl(v)):o.length>0?!o.includes(fl(v)):!0)})}var Cv=Oe(require("obsidian"));var Sv=Oe(require("obsidian"));function me(){}var Gs=t=>t;function mn(t,e){for(let n in e)t[n]=e[n];return t}function xp(t){return t()}function w1(){return Object.create(null)}function We(t){t.forEach(xp)}function $t(t){return typeof t=="function"}function Ge(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}var qu;function Xo(t,e){return qu||(qu=document.createElement("a")),qu.href=e,t===qu.href}function b1(t){return Object.keys(t).length===0}function Vu(t,...e){if(t==null)return me;let n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Ku(t,e,n){t.$$.on_destroy.push(Vu(e,n))}function Hr(t,e,n,r){if(t){let i=k1(t,e,n,r);return t[0](i)}}function k1(t,e,n,r){return t[1]&&r?mn(n.ctx.slice(),t[1](r(e))):n.ctx}function qr(t,e,n,r){if(t[2]&&r){let i=t[2](r(n));if(e.dirty===void 0)return i;if(typeof i=="object"){let o=[],a=Math.max(e.dirty.length,i.length);for(let u=0;u32){let e=[],n=t.ctx.length/32;for(let r=0;rwindow.performance.now():()=>Date.now(),Ip=E1?t=>requestAnimationFrame(t):me;var zs=new Set;function T1(t){zs.forEach(e=>{e.c(t)||(zs.delete(e),e.f())}),zs.size!==0&&Ip(T1)}function cl(t){let e;return zs.size===0&&Ip(T1),{promise:new Promise(n=>{zs.add(e={c:t,f:n})}),abort(){zs.delete(e)}}}var S1=!1;function SA(){S1=!0}function CA(){S1=!1}function A(t,e){t.appendChild(e)}function Et(t,e,n){let r=Rp(t);if(!r.getElementById(e)){let i=N("style");i.id=e,i.textContent=n,C1(r,i)}}function Rp(t){if(!t)return document;let e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function DA(t){let e=N("style");return C1(Rp(t),e),e.sheet}function C1(t,e){return A(t.head||t,e),e.sheet}function G(t,e,n){t.insertBefore(e,n||null)}function B(t){t.parentNode&&t.parentNode.removeChild(t)}function At(t,e){for(let n=0;nt.removeEventListener(e,n,r)}function oi(t){return function(e){return e.preventDefault(),t.call(this,e)}}function si(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function D1(t){return function(e){e.target===this&&t.call(this,e)}}function k(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function ai(t,e){for(let n in e)k(t,n,e[n])}function OA(t){return Array.from(t.childNodes)}function Ye(t,e){e=""+e,t.data!==e&&(t.data=e)}function er(t,e){t.value=e==null?"":e}function he(t,e,n,r){n===null?t.style.removeProperty(e):t.style.setProperty(e,n,r?"important":"")}function li(t,e,n){for(let r=0;r{a.source===r.contentWindow&&e()})):(r.src="about:blank",r.onload=()=>{o=oe(r.contentWindow,"resize",e),e()}),A(t,r),()=>{(i||o&&r.contentWindow)&&o(),B(r)}}function we(t,e,n){t.classList[n?"add":"remove"](e)}function M1(t,e,{bubbles:n=!1,cancelable:r=!1}={}){let i=document.createEvent("CustomEvent");return i.initCustomEvent(t,n,r,e),i}var Xu=class{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,n,r=null){this.e||(this.is_svg?this.e=Xr(n.nodeName):this.e=N(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(e)),this.i(r)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let n=0;n>>0}function PA(t,e){let n={stylesheet:DA(e),rules:{}};return Ju.set(t,n),n}function Lp(t,e,n,r,i,o,a,u=0){let f=16.666/r,c=`{ -`;for(let E=0;E<=1;E+=f){let y=e+(n-e)*o(E);c+=E*100+`%{${a(y,1-y)}} -`}let p=c+`100% {${a(n,1-n)}} -}`,h=`__svelte_${AA(p)}_${u}`,m=Rp(t),{stylesheet:_,rules:v}=Ju.get(m)||PA(m,t);v[h]||(v[h]=!0,_.insertRule(`@keyframes ${h} ${p}`,_.cssRules.length));let b=t.style.animation||"";return t.style.animation=`${b?`${b}, `:""}${h} ${r}ms linear ${i}ms 1 both`,Qu+=1,h}function $u(t,e){let n=(t.style.animation||"").split(", "),r=n.filter(e?o=>o.indexOf(e)<0:o=>o.indexOf("__svelte")===-1),i=n.length-r.length;i&&(t.style.animation=r.join(", "),Qu-=i,Qu||NA())}function NA(){Ip(()=>{Qu||(Ju.forEach(t=>{let{ownerNode:e}=t.stylesheet;e&&B(e)}),Ju.clear())})}function A1(t,e,n,r){if(!e)return me;let i=t.getBoundingClientRect();if(e.left===i.left&&e.right===i.right&&e.top===i.top&&e.bottom===i.bottom)return me;let{delay:o=0,duration:a=300,easing:u=Gs,start:f=Us()+o,end:c=f+a,tick:p=me,css:h}=n(t,{from:e,to:i},r),m=!0,_=!1,v;function b(){h&&(v=Lp(t,0,1,a,o,u,h)),o||(_=!0)}function E(){h&&$u(t,v),m=!1}return cl(y=>{if(!_&&y>=f&&(_=!0),_&&y>=c&&(p(1,0),E()),!m)return!1;if(_){let O=y-f,D=0+1*u(O/a);p(D,1-D)}return!0}),b(),p(0,1),E}function P1(t){let e=getComputedStyle(t);if(e.position!=="absolute"&&e.position!=="fixed"){let{width:n,height:r}=e,i=t.getBoundingClientRect();t.style.position="absolute",t.style.width=n,t.style.height=r,xA(t,i)}}function xA(t,e){let n=t.getBoundingClientRect();if(e.left!==n.left||e.top!==n.top){let r=getComputedStyle(t),i=r.transform==="none"?"":r.transform;t.style.transform=`${i} translate(${e.left-n.left}px, ${e.top-n.top}px)`}}var dl;function pl(t){dl=t}function Fp(){if(!dl)throw new Error("Function called outside component initialization");return dl}function Yi(t){Fp().$$.on_mount.push(t)}function Jo(t){Fp().$$.on_destroy.push(t)}function hl(){let t=Fp();return(e,n,{cancelable:r=!1}={})=>{let i=t.$$.callbacks[e];if(i){let o=M1(e,n,{cancelable:r});return i.slice().forEach(a=>{a.call(t,o)}),!o.defaultPrevented}return!0}}function Mn(t,e){let n=t.$$.callbacks[e.type];n&&n.slice().forEach(r=>r.call(this,e))}var qs=[];var Ne=[],Vs=[],Yp=[],N1=Promise.resolve(),Wp=!1;function x1(){Wp||(Wp=!0,N1.then(I1))}function ef(){return x1(),N1}function ln(t){Vs.push(t)}function et(t){Yp.push(t)}var jp=new Set,Ks=0;function I1(){if(Ks!==0)return;let t=dl;do{try{for(;Kst.indexOf(r)===-1?e.push(r):n.push(r)),n.forEach(r=>r()),Vs=e}var ml;function R1(){return ml||(ml=Promise.resolve(),ml.then(()=>{ml=null})),ml}function tf(t,e,n){t.dispatchEvent(M1(`${e?"intro":"outro"}${n}`))}var nf=new Set,ao;function Je(){ao={r:0,c:[],p:ao}}function Qe(){ao.r||We(ao.c),ao=ao.p}function se(t,e){t&&t.i&&(nf.delete(t),t.i(e))}function de(t,e,n,r){if(t&&t.o){if(nf.has(t))return;nf.add(t),ao.c.push(()=>{nf.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}var L1={duration:0};function rf(t,e,n){let r={direction:"in"},i=e(t,n,r),o=!1,a,u,f=0;function c(){a&&$u(t,a)}function p(){let{delay:m=0,duration:_=300,easing:v=Gs,tick:b=me,css:E}=i||L1;E&&(a=Lp(t,0,1,_,m,v,E,f++)),b(0,1);let y=Us()+m,O=y+_;u&&u.abort(),o=!0,ln(()=>tf(t,!0,"start")),u=cl(D=>{if(o){if(D>=O)return b(1,0),tf(t,!0,"end"),c(),o=!1;if(D>=y){let F=v((D-y)/_);b(F,1-F)}}return o})}let h=!1;return{start(){h||(h=!0,$u(t),$t(i)?(i=i(r),R1().then(p)):p())},invalidate(){h=!1},end(){o&&(c(),o=!1)}}}function F1(t,e,n){let r={direction:"out"},i=e(t,n,r),o=!0,a,u=ao;u.r+=1;function f(){let{delay:c=0,duration:p=300,easing:h=Gs,tick:m=me,css:_}=i||L1;_&&(a=Lp(t,1,0,p,c,h,_));let v=Us()+c,b=v+p;ln(()=>tf(t,!1,"start")),cl(E=>{if(o){if(E>=b)return m(0,1),tf(t,!1,"end"),--u.r||We(u.c),!1;if(E>=v){let y=h((E-v)/p);m(1-y,y)}}return o})}return $t(i)?R1().then(()=>{i=i(r),f()}):f(),{end(c){c&&i.tick&&i.tick(1,0),o&&(a&&$u(t,a),o=!1)}}}var of=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function Y1(t,e){t.d(1),e.delete(t.key)}function Bp(t,e){de(t,1,1,()=>{e.delete(t.key)})}function W1(t,e){t.f(),Bp(t,e)}function Zs(t,e,n,r,i,o,a,u,f,c,p,h){let m=t.length,_=o.length,v=m,b={};for(;v--;)b[t[v].key]=v;let E=[],y=new Map,O=new Map,D=[];for(v=_;v--;){let R=h(i,o,v),M=n(R),H=a.get(M);H?r&&D.push(()=>H.p(R,e)):(H=c(M,R),H.c()),y.set(M,E[v]=H),M in b&&O.set(M,Math.abs(v-b[M]))}let F=new Set,P=new Set;function L(R){se(R,1),R.m(u,p),a.set(R.key,R),p=R.first,_--}for(;m&&_;){let R=E[_-1],M=t[m-1],H=R.key,le=M.key;R===M?(p=R.first,m--,_--):y.has(le)?!a.has(H)||F.has(H)?L(R):P.has(le)?m--:O.get(H)>O.get(le)?(P.add(H),L(R)):(F.add(le),m--):(f(M,a),m--)}for(;m--;){let R=t[m];y.has(R.key)||f(R,a)}for(;_;)L(E[_-1]);return We(D),E}function lo(t,e){let n={},r={},i={$$scope:1},o=t.length;for(;o--;){let a=t[o],u=e[o];if(u){for(let f in a)f in u||(r[f]=1);for(let f in u)i[f]||(n[f]=u[f],i[f]=1);t[o]=u}else for(let f in a)i[f]=1}for(let a in r)a in n||(n[a]=void 0);return n}var LA=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],F5=new Set([...LA]);function tt(t,e,n){let r=t.$$.props[e];r!==void 0&&(t.$$.bound[r]=n,n(t.$$.ctx[r]))}function ct(t){t&&t.c()}function ut(t,e,n,r){let{fragment:i,after_update:o}=t.$$;i&&i.m(e,n),r||ln(()=>{let a=t.$$.on_mount.map(xp).filter($t);t.$$.on_destroy?t.$$.on_destroy.push(...a):We(a),t.$$.on_mount=[]}),o.forEach(ln)}function st(t,e){let n=t.$$;n.fragment!==null&&(RA(n.after_update),We(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function FA(t,e){t.$$.dirty[0]===-1&&(qs.push(t),x1(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{let v=_.length?_[0]:m;return c.ctx&&i(c.ctx[h],c.ctx[h]=v)&&(!c.skip_bound&&c.bound[h]&&c.bound[h](v),p&&FA(t,h)),m}):[],c.update(),p=!0,We(c.before_update),c.fragment=r?r(c.ctx):!1,e.target){if(e.hydrate){SA();let h=OA(e.target);c.fragment&&c.fragment.l(h),h.forEach(B)}else c.fragment&&c.fragment.c();e.intro&&se(t.$$.fragment),ut(t,e.target,e.anchor,e.customElement),CA(),I1()}pl(f)}var YA;typeof HTMLElement=="function"&&(YA=class extends HTMLElement{constructor(){super();this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(xp).filter($t);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){We(this.$$.on_disconnect)}$destroy(){st(this,1),this.$destroy=me}$on(t,e){if(!$t(e))return me;let n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{let r=n.indexOf(e);r!==-1&&n.splice(r,1)}}$set(t){this.$$set&&!b1(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var ze=class{$destroy(){st(this,1),this.$destroy=me}$on(e,n){if(!$t(n))return me;let r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{let i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(e){this.$$set&&!b1(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var s0=Oe(Up()),{__extends:j5,__assign:B5,__rest:G5,__decorate:U5,__param:z5,__metadata:H5,__awaiter:Tt,__generator:q5,__exportStar:V5,__createBinding:K5,__values:Z5,__read:X5,__spread:J5,__spreadArrays:Q5,__spreadArray:$5,__await:eF,__asyncGenerator:tF,__asyncDelegator:nF,__asyncValues:rF,__makeTemplateObject:iF,__importStar:oF,__importDefault:sF,__classPrivateFieldGet:aF,__classPrivateFieldSet:lF}=s0.default;function zp(t,e=!1){return te(this,null,function*(){var a,u,f;let n=ye.getInstance();if(!Ft())throw new Mt("Not logged in",null,401,{error:"Not logged in"});let r=(a=t.parent)==null?void 0:a.id;if(r||(r=(u=n.settings.defaultCalendar)!=null?u:""),r==="")throw new Mt("Could not delete Google Event because no default calendar selected in Settings",null,999,{error:"No calendar set"});let i=(f=t.recurringEventId)!=null?f:t.id;return!e&&t.recurringEventId&&(i=t.id),yield Tr(`https://www.googleapis.com/calendar/v3/calendars/${r}/events/${i}`,"DELETE",null)})}function uf(t,e=!1){return te(this,null,function*(){try{let n=yield zp(t,e);return Ke(`Google Event ${t.summary} deleted.`),n}catch(n){if(!(n instanceof Mt))return!1;switch(n.status){case 401:break;case 999:Ke(n.message);break;default:Ke(`Google Event ${t.summary} could not be deleted.`),console.error("[GoogleCalendar]",n);break}return!1}})}function Hp(t,e){return te(this,null,function*(){if(!Ft())throw new Mt("Not logged in",null,401,{error:"Not logged in"});let n=yield Tr(`https://www.googleapis.com/calendar/v3/calendars/${e}/events/${t}`,"GET",null);return n.parent=(yield Pi()).find(r=>r.id===e),n})}function uo(t,e){return te(this,null,function*(){try{return yield Hp(t,e)}catch(n){if(!(n instanceof Mt))return null;switch(n.status){case 401:break;case 999:Ke(n.message);break;default:Ke("Could not get Google Event."),console.error("[GoogleCalendar]",n);break}return null}})}function Js(t,e=!1){return te(this,null,function*(){var o;let n=ye.getInstance();if(!Ft())throw new Mt("Not logged in",null,401,{error:"Not logged in"});if(e&&t.recurringEventId){let a=yield uo(t.recurringEventId,t.parent.id);t=zn(zn({},a),t),t.start.dateTime?(t.start.dateTime=window.moment(t.start.dateTime).date(window.moment(a.start.dateTime).date()).format(),t.end.dateTime=window.moment(t.end.dateTime).date(window.moment(a.end.dateTime).date()).format()):(t.start.date=window.moment(a.start.date).format("YYYY-MM-DD"),t.end.date=window.moment(a.end.date).format("YYYY-MM-DD")),t.id=a.id,t.recurrence=a.recurrence,t.id=a.id,delete t.recurringEventId,delete t.originalStartTime}let r="";if(((o=t==null?void 0:t.parent)==null?void 0:o.id)?(r=t.parent.id,t.start.timeZone=t.parent.timeZone,t.end.timeZone=t.parent.timeZone,delete t.parent):r=n.settings.defaultCalendar,r==="")throw new Mt("Could not create Google Event because no default calendar selected in Settings",null,999,{error:"No calendar set"});return yield Tr(`https://www.googleapis.com/calendar/v3/calendars/${r}/events/${t.id}`,"PUT",t)})}function a0(t){return window.moment(t).format("YYYY-MM-DD")}function l0(t){return window.moment(t).format()}function qp(t){return te(this,null,function*(){var i;let e=ye.getInstance();if(t.start.date?(t.start.date=a0(t.start.date),t.end.date=a0(t.end.date)):(t.start.dateTime=l0(t.start.dateTime),t.end.dateTime=l0(t.end.dateTime)),!Ft())throw new Mt("Not logged in",null,401,{error:"Not logged in"});let n="";if(((i=t==null?void 0:t.parent)==null?void 0:i.id)?(n=t.parent.id,t.start.timeZone=t.parent.timeZone,t.end.timeZone=t.parent.timeZone,delete t.parent):n=e.settings.defaultCalendar,n==="")throw new Mt("Could not create Google Event because no default calendar selected in Settings",null,999,{error:"No calendar set"});return yield Tr(`https://www.googleapis.com/calendar/v3/calendars/${n}/events?conferenceDataVersion=1`,"POST",t)})}function ff(t){return te(this,null,function*(){try{let e=yield qp(t);return Ke(`Google Event ${t.summary} created.`),e}catch(e){if(!(e instanceof Mt))return null;switch(e.status){case 401:break;case 999:Ke(e.message);break;default:Ke(`Google Event ${t.summary} could not be created.`),console.error("[GoogleCalendar]",e);break}return null}})}var cf=["MO","TU","WE","TH","FR","SA","SU"],un=function(){function t(e,n){if(n===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=n}return t.fromStr=function(e){return new t(cf.indexOf(e))},t.prototype.nth=function(e){return this.n===e?this:new t(this.weekday,e)},t.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},t.prototype.toString=function(){var e=cf[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},t.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},t}();var Bt=function(t){return t!=null},ur=function(t){return typeof t=="number"},Vp=function(t){return cf.indexOf(t)>=0},An=Array.isArray,Ar=function(t,e){e===void 0&&(e=t),arguments.length===1&&(e=t,t=0);for(var n=[],r=t;r>0,r.length>e?String(r):(e=e-r.length,e>n.length&&(n+=dt(n,e/n.length)),n.slice(0,e)+String(r))}var f0=function(t,e,n){var r=t.split(e);return n?r.slice(0,n).concat([r.slice(n).join(e)]):r},Rn=function(t,e){var n=t%e;return n*e<0?n+e:n},df=function(t,e){return{div:Math.floor(t/e),mod:Rn(t,e)}},fr=function(t){return!Bt(t)||t.length===0},on=function(t){return!fr(t)},_t=function(t,e){return on(t)&&t.indexOf(e)!==-1};var fo;(function(t){t.MONTH_DAYS=[31,28,31,30,31,30,31,31,30,31,30,31],t.ONE_DAY=1e3*60*60*24,t.MAXYEAR=9999,t.ORDINAL_BASE=new Date(Date.UTC(1970,0,1)),t.PY_WEEKDAYS=[6,0,1,2,3,4,5],t.getYearDay=function(e){var n=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate());return Math.ceil((n.valueOf()-new Date(e.getUTCFullYear(),0,1).valueOf())/t.ONE_DAY)+1},t.isLeapYear=function(e){return e%4==0&&e%100!=0||e%400==0},t.isDate=function(e){return e instanceof Date},t.isValidDate=function(e){return t.isDate(e)&&!isNaN(e.getTime())},t.tzOffset=function(e){return e.getTimezoneOffset()*60*1e3},t.daysBetween=function(e,n){var r=e.getTime()-t.tzOffset(e),i=n.getTime()-t.tzOffset(n),o=r-i;return Math.round(o/t.ONE_DAY)},t.toOrdinal=function(e){return t.daysBetween(e,t.ORDINAL_BASE)},t.fromOrdinal=function(e){return new Date(t.ORDINAL_BASE.getTime()+e*t.ONE_DAY)},t.getMonthDays=function(e){var n=e.getUTCMonth();return n===1&&t.isLeapYear(e.getUTCFullYear())?29:t.MONTH_DAYS[n]},t.getWeekday=function(e){return t.PY_WEEKDAYS[e.getUTCDay()]},t.monthRange=function(e,n){var r=new Date(Date.UTC(e,n,1));return[t.getWeekday(r),t.getMonthDays(r)]},t.combine=function(e,n){return n=n||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()))},t.clone=function(e){var n=new Date(e.getTime());return n},t.cloneDates=function(e){for(var n=[],r=0;rthis.maxDate;if(this.method==="between"){if(n)return!0;if(r)return!1}else if(this.method==="before"){if(r)return!1}else if(this.method==="after")return n?!0:(this.add(e),!1);return this.add(e)},t.prototype.add=function(e){return this._result.push(e),!0},t.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;case"before":case"after":default:return e.length?e[e.length-1]:null}},t.prototype.clone=function(){return new t(this.method,this.args)},t}(),Wi=WA;var N0=Oe(P0()),{__extends:$s,__assign:qn,__rest:QF,__decorate:$F,__param:e8,__metadata:t8,__awaiter:n8,__generator:r8,__exportStar:i8,__createBinding:o8,__values:s8,__read:a8,__spread:l8,__spreadArrays:$o,__await:u8,__asyncGenerator:f8,__asyncDelegator:c8,__asyncValues:d8,__makeTemplateObject:p8,__importStar:h8,__importDefault:m8,__classPrivateFieldGet:g8,__classPrivateFieldSet:_8}=N0.default;var jA=function(t){$s(e,t);function e(n,r,i){var o=t.call(this,n,r)||this;return o.iterator=i,o}return e.prototype.add=function(n){return this.iterator(n,this._result.length)?(this._result.push(n),!0):!1},e}(Wi),Zp=jA;var BA={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},es=BA;var x0=function(t,e){return t.indexOf(e)!==-1},GA=function(t){return t.toString()},UA=function(t,e,n){return e+" "+n+", "+t},zA=function(){function t(e,n,r,i){if(n===void 0&&(n=GA),r===void 0&&(r=es),i===void 0&&(i=UA),this.text=[],this.language=r||es,this.gettext=n,this.dateFormatter=i,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var o=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);o.sort(function(p,h){return p-h}),a.sort(function(p,h){return h-p}),this.bymonthday=o.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(Bt(this.origOptions.byweekday)){var u=An(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],f=String(u);this.byweekday={allWeeks:u.filter(function(p){return!p.n}),someWeeks:u.filter(function(p){return Boolean(p.n)}),isWeekdays:f.indexOf("MO")!==-1&&f.indexOf("TU")!==-1&&f.indexOf("WE")!==-1&&f.indexOf("TH")!==-1&&f.indexOf("FR")!==-1&&f.indexOf("SA")===-1&&f.indexOf("SU")===-1,isEveryDay:f.indexOf("MO")!==-1&&f.indexOf("TU")!==-1&&f.indexOf("WE")!==-1&&f.indexOf("TH")!==-1&&f.indexOf("FR")!==-1&&f.indexOf("SA")!==-1&&f.indexOf("SU")!==-1};var c=function(p,h){return p.weekday-h.weekday};this.byweekday.allWeeks.sort(c),this.byweekday.someWeeks.sort(c),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return t.isFullyConvertible=function(e){var n=!0;if(!(e.options.freq in t.IMPLEMENTED)||e.origOptions.until&&e.origOptions.count)return!1;for(var r in e.origOptions){if(x0(["dtstart","wkst","freq"],r))return!0;if(!x0(t.IMPLEMENTED[e.options.freq],r))return!1}return n},t.prototype.isFullyConvertible=function(){return t.isFullyConvertible(this.rrule)},t.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in t.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[Se.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var n=this.options.until;this.add(this.dateFormatter(n.getUTCFullYear(),this.language.monthNames[n.getUTCMonth()],n.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},t.prototype.HOURLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("hours"):e("hour"))},t.prototype.MINUTELY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("minutes"):e("minute"))},t.prototype.DAILY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(this.plural(this.options.interval)?e("days"):e("day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},t.prototype.WEEKLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e("weeks"):e("week")),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(e("on")).add(e("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?e("days"):e("day")):(this.options.interval===1&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())},t.prototype.MONTHLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("months"):e("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()},t.prototype.YEARLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("years"):e("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e("on the")).add(this.list(this.options.byyearday,this.nth,e("and"))).add(e("day")),this.options.byweekno&&this.add(e("in")).add(this.plural(this.options.byweekno.length)?e("weeks"):e("week")).add(this.list(this.options.byweekno,void 0,e("and")))},t.prototype._bymonthday=function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e("or"))).add(e("the")).add(this.list(this.bymonthday,this.nth,e("or"))):this.add(e("on the")).add(this.list(this.bymonthday,this.nth,e("and")))},t.prototype._byweekday=function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e("and")),this.add(e("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e("and"))))},t.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},t.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},t.prototype.nth=function(e){e=parseInt(e.toString(),10);var n,r,i=this.gettext;if(e===-1)return i("last");switch(r=Math.abs(e),r){case 1:case 21:case 31:n=r+i("st");break;case 2:case 22:n=r+i("nd");break;case 3:case 23:n=r+i("rd");break;default:n=r+i("th")}return e<0?n+" "+i("last"):n},t.prototype.monthtext=function(e){return this.language.monthNames[e-1]},t.prototype.weekdaytext=function(e){var n=ur(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[n]},t.prototype.plural=function(e){return e%100!=1},t.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},t.prototype.list=function(e,n,r,i){i===void 0&&(i=","),An(e)||(e=[e]);var o=function(f,c,p){for(var h="",m=0;me[0].length)&&(e=a,n=o)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===""&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(n==="SKIP");return this.symbol=n,this.value=e,!0},t.prototype.accept=function(e){if(this.symbol===e){if(this.value){var n=this.value;return this.nextSymbol(),n}return this.nextSymbol(),!0}return!1},t.prototype.acceptNumber=function(){return this.accept("number")},t.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},t}();function gl(t,e){e===void 0&&(e=es);var n={},r=new HA(e.tokens);if(!r.start(t))return null;return i(),n;function i(){r.expect("every");var m=r.acceptNumber();if(m&&(n.interval=parseInt(m[0],10)),r.isDone())throw new Error("Unexpected end");switch(r.symbol){case"day(s)":n.freq=Se.DAILY,r.nextSymbol()&&(a(),h());break;case"weekday(s)":n.freq=Se.WEEKLY,n.byweekday=[Se.MO,Se.TU,Se.WE,Se.TH,Se.FR],r.nextSymbol(),h();break;case"week(s)":n.freq=Se.WEEKLY,r.nextSymbol()&&(o(),h());break;case"hour(s)":n.freq=Se.HOURLY,r.nextSymbol()&&(o(),h());break;case"minute(s)":n.freq=Se.MINUTELY,r.nextSymbol()&&(o(),h());break;case"month(s)":n.freq=Se.MONTHLY,r.nextSymbol()&&(o(),h());break;case"year(s)":n.freq=Se.YEARLY,r.nextSymbol()&&(o(),h());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=Se.WEEKLY;var _=r.symbol.substr(0,2).toUpperCase();if(n.byweekday=[Se[_]],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var v=f();if(!v)throw new Error("Unexpected symbol "+r.symbol+", expected weekday");n.byweekday.push(Se[v]),r.nextSymbol()}p(),h();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(n.freq=Se.YEARLY,n.bymonth=[u()],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var b=u();if(!b)throw new Error("Unexpected symbol "+r.symbol+", expected month");n.bymonth.push(b),r.nextSymbol()}o(),h();break;default:throw new Error("Unknown symbol")}}function o(){var m=r.accept("on"),_=r.accept("the");if(!!(m||_))do{var v=c(),b=f(),E=u();if(v)b?(r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Se[b].nth(v))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(v),r.accept("day(s)"));else if(b)r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Se[b]);else if(r.symbol==="weekday(s)")r.nextSymbol(),n.byweekday||(n.byweekday=[Se.MO,Se.TU,Se.WE,Se.TH,Se.FR]);else if(r.symbol==="week(s)"){r.nextSymbol();var y=r.acceptNumber();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected week number");for(n.byweekno=[parseInt(y[0],10)];r.accept("comma");){if(y=r.acceptNumber(),!y)throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.byweekno.push(parseInt(y[0],10))}}else if(E)r.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(E);else return}while(r.accept("comma")||r.accept("the")||r.accept("on"))}function a(){var m=r.accept("at");if(!!m)do{var _=r.acceptNumber();if(!_)throw new Error("Unexpected symbol "+r.symbol+", expected hour");for(n.byhour=[parseInt(_[0],10)];r.accept("comma");){if(_=r.acceptNumber(),!_)throw new Error("Unexpected symbol "+r.symbol+"; expected hour");n.byhour.push(parseInt(_[0],10))}}while(r.accept("comma")||r.accept("at"))}function u(){switch(r.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function f(){switch(r.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return r.symbol.substr(0,2).toUpperCase();default:return!1}}function c(){switch(r.symbol){case"last":return r.nextSymbol(),-1;case"first":return r.nextSymbol(),1;case"second":return r.nextSymbol(),r.accept("last")?-2:2;case"third":return r.nextSymbol(),r.accept("last")?-3:3;case"nth":var m=parseInt(r.value[1],10);if(m<-366||m>366)throw new Error("Nth out of range: "+m);return r.nextSymbol(),r.accept("last")?-m:m;default:return!1}}function p(){r.accept("on"),r.accept("the");var m=c();if(!!m)for(n.bymonthday=[m],r.nextSymbol();r.accept("comma");){if(m=c(),!m)throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.bymonthday.push(m),r.nextSymbol()}}function h(){if(r.symbol==="until"){var m=Date.parse(r.text);if(!m)throw new Error("Cannot parse until date:"+r.text);n.until=new Date(m)}else r.accept("for")&&(n.count=parseInt(r.value[0],10),r.expect("number"))}}var at;(function(t){t[t.YEARLY=0]="YEARLY",t[t.MONTHLY=1]="MONTHLY",t[t.WEEKLY=2]="WEEKLY",t[t.DAILY=3]="DAILY",t[t.HOURLY=4]="HOURLY",t[t.MINUTELY=5]="MINUTELY",t[t.SECONDLY=6]="SECONDLY"})(at||(at={}));function _l(t){return t12){var r=Math.floor(this.month/12),i=Rn(this.month,12);this.month=i,this.year+=r,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(n,r){r>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-r))+n*7:this.day+=-(this.getWeekday()-r)+n*7,this.fixDay()},e.prototype.addDaily=function(n){this.day+=n,this.fixDay()},e.prototype.addHours=function(n,r,i){for(r&&(this.hour+=Math.floor((23-this.hour)/n)*n);;){this.hour+=n;var o=df(this.hour,24),a=o.div,u=o.mod;if(a&&(this.hour=u,this.addDaily(a)),fr(i)||_t(i,this.hour))break}},e.prototype.addMinutes=function(n,r,i,o){for(r&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/n)*n);;){this.minute+=n;var a=df(this.minute,60),u=a.div,f=a.mod;if(u&&(this.minute=f,this.addHours(u,!1,i)),(fr(i)||_t(i,this.hour))&&(fr(o)||_t(o,this.minute)))break}},e.prototype.addSeconds=function(n,r,i,o,a){for(r&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/n)*n);;){this.second+=n;var u=df(this.second,60),f=u.div,c=u.mod;if(f&&(this.second=c,this.addMinutes(f,!1,i,o)),(fr(i)||_t(i,this.hour))&&(fr(o)||_t(o,this.minute))&&(fr(a)||_t(a,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var n=fo.monthRange(this.year,this.month-1)[1];if(!(this.day<=n))for(;this.day>n;){if(this.day-=n,++this.month,this.month===13&&(this.month=1,++this.year,this.year>fo.MAXYEAR))return;n=fo.monthRange(this.year,this.month-1)[1]}}},e.prototype.add=function(n,r){var i=n.freq,o=n.interval,a=n.wkst,u=n.byhour,f=n.byminute,c=n.bysecond;switch(i){case at.YEARLY:return this.addYears(o);case at.MONTHLY:return this.addMonths(o);case at.WEEKLY:return this.addWeekly(o,a);case at.DAILY:return this.addDaily(o);case at.HOURLY:return this.addHours(o,r,u);case at.MINUTELY:return this.addMinutes(o,r,u,f);case at.SECONDLY:return this.addSeconds(o,r,u,f,c)}},e}(ta);function Xp(t){for(var e=[],n=Object.keys(t),r=0,i=n;r=-366&&r<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||on(e.byweekno)||on(e.byyearday)||Boolean(e.bymonthday)||on(e.bymonthday)||Bt(e.byweekday)||Bt(e.byeaster)))switch(e.freq){case Se.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case Se.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case Se.WEEKLY:e.byweekday=[Le.getWeekday(e.dtstart)];break}if(Bt(e.bymonth)&&!An(e.bymonth)&&(e.bymonth=[e.bymonth]),Bt(e.byyearday)&&!An(e.byyearday)&&ur(e.byyearday)&&(e.byyearday=[e.byyearday]),!Bt(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(An(e.bymonthday)){for(var i=[],o=[],n=0;n0?i.push(r):r<0&&o.push(r)}e.bymonthday=i,e.bynmonthday=o}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(Bt(e.byweekno)&&!An(e.byweekno)&&(e.byweekno=[e.byweekno]),!Bt(e.byweekday))e.bynweekday=null;else if(ur(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(Vp(e.byweekday))e.byweekday=[un.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof un)!e.byweekday.n||e.freq>Se.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var a=[],u=[],n=0;nSe.MONTHLY?a.push(f.weekday):u.push([f.weekday,f.n])}e.byweekday=on(a)?a:null,e.bynweekday=on(u)?u:null}return Bt(e.byhour)?ur(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq=4?(p=0,c=u.yearlen+Rn(a-e.wkst,7)):c=r-p;for(var h=Math.floor(c/7),m=Rn(c,7),_=Math.floor(h+m/4),v=0;v0&&b<=_){var E=void 0;b>1?(E=p+(b-1)*7,p!==f&&(E-=7-f)):E=p;for(var y=0;y<7&&(u.wnomask[E]=1,E++,u.wdaymask[E]!==e.wkst);y++);}}if(_t(e.byweekno,1)){var E=p+_*7;if(p!==f&&(E-=7-f),E=4?(F=0,L=P+Rn(D-e.wkst,7)):L=r-p,O=Math.floor(52+Rn(L,7)/4)}if(_t(e.byweekno,O))for(var E=0;Eo)return ji(t);if(O>=n){var D=rv(O,e);if(!t.accept(D)||u&&(--u,!u))return ji(t)}}else for(var y=_;yo)return ji(t);if(O>=n){var D=rv(O,e);if(!t.accept(D)||u&&(--u,!u))return ji(t)}}}if(e.interval===0||(f.add(e,b),f.year>Le.MAXYEAR))return ji(t);_l(r)||(p=c.gettimeset(r)(f.hour,f.minute,f.second,0)),c.rebuild(f.year,f.month)}}function r3(t,e,n){var r=n.bymonth,i=n.byweekno,o=n.byweekday,a=n.byeaster,u=n.bymonthday,f=n.bynmonthday,c=n.byyearday;return on(r)&&!_t(r,t.mmask[e])||on(i)&&!t.wnomask[e]||on(o)&&!_t(o,t.wdaymask[e])||on(t.nwdaymask)&&!t.nwdaymask[e]||a!==null&&!_t(t.eastermask,e)||(on(u)||on(f))&&!_t(u,t.mdaymask[e])&&!_t(f,t.nmdaymask[e])||on(c)&&(e=t.yearlen&&!_t(c,e+1-t.yearlen)&&!_t(c,-t.nextyearlen+e-t.yearlen))}function rv(t,e){return new ts(t,e.tzid).rezonedDate()}function ji(t){return t.getValue()}function i3(t,e,n,r,i){for(var o=!1,a=e;a=Se.HOURLY&&on(i)&&!_t(i,e.hour)||r>=Se.MINUTELY&&on(o)&&!_t(o,e.minute)||r>=Se.SECONDLY&&on(a)&&!_t(a,e.second)?[]:t.gettimeset(r)(e.hour,e.minute,e.second,e.millisecond)}var Pr={MO:new un(0),TU:new un(1),WE:new un(2),TH:new un(3),FR:new un(4),SA:new un(5),SU:new un(6)},vl={freq:at.YEARLY,dtstart:null,interval:1,wkst:Pr.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},j0=Object.keys(vl),Se=function(){function t(e,n){e===void 0&&(e={}),n===void 0&&(n=!1),this._cache=n?null:new U0,this.origOptions=Xp(e);var r=Y0(e).parsedOptions;this.options=r}return t.parseText=function(e,n){return gl(e,n)},t.fromText=function(e,n){return I0(e,n)},t.fromString=function(e){return new t(t.parseString(e)||void 0)},t.prototype._iter=function(e){return mf(e,this.options)},t.prototype._cacheGet=function(e,n){return this._cache?this._cache._cacheGet(e,n):!1},t.prototype._cacheAdd=function(e,n,r){if(!!this._cache)return this._cache._cacheAdd(e,n,r)},t.prototype.all=function(e){if(e)return this._iter(new Zp("all",{},e));var n=this._cacheGet("all");return n===!1&&(n=this._iter(new Wi("all",{})),this._cacheAdd("all",n)),n},t.prototype.between=function(e,n,r,i){if(r===void 0&&(r=!1),!Le.isValidDate(e)||!Le.isValidDate(n))throw new Error("Invalid date passed in to RRule.between");var o={before:n,after:e,inc:r};if(i)return this._iter(new Zp("between",o,i));var a=this._cacheGet("between",o);return a===!1&&(a=this._iter(new Wi("between",o)),this._cacheAdd("between",a,o)),a},t.prototype.before=function(e,n){if(n===void 0&&(n=!1),!Le.isValidDate(e))throw new Error("Invalid date passed in to RRule.before");var r={dt:e,inc:n},i=this._cacheGet("before",r);return i===!1&&(i=this._iter(new Wi("before",r)),this._cacheAdd("before",i,r)),i},t.prototype.after=function(e,n){if(n===void 0&&(n=!1),!Le.isValidDate(e))throw new Error("Invalid date passed in to RRule.after");var r={dt:e,inc:n},i=this._cacheGet("after",r);return i===!1&&(i=this._iter(new Wi("after",r)),this._cacheAdd("after",i,r)),i},t.prototype.count=function(){return this.all().length},t.prototype.toString=function(){return bl(this.origOptions)},t.prototype.toText=function(e,n,r){return R0(this,e,n,r)},t.prototype.isFullyConvertibleToText=function(){return L0(this)},t.prototype.clone=function(){return new t(this.origOptions)},t.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],t.YEARLY=at.YEARLY,t.MONTHLY=at.MONTHLY,t.WEEKLY=at.WEEKLY,t.DAILY=at.DAILY,t.HOURLY=at.HOURLY,t.MINUTELY=at.MINUTELY,t.SECONDLY=at.SECONDLY,t.MO=Pr.MO,t.TU=Pr.TU,t.WE=Pr.WE,t.TH=Pr.TH,t.FR=Pr.FR,t.SA=Pr.SA,t.SU=Pr.SU,t.parseString=yl,t.optionsToString=bl,t}();function iv(t,e,n,r,i,o){var a={},u=t.accept;function f(m,_){n.forEach(function(v){v.between(m,_,!0).forEach(function(b){a[Number(b)]=!0})})}i.forEach(function(m){var _=new ts(m,o).rezonedDate();a[Number(_)]=!0}),t.accept=function(m){var _=Number(m);return isNaN(_)?u.call(this,m):!a[_]&&(f(new Date(_-1),new Date(_+1)),!a[_])?(a[_]=!0,u.call(this,m)):!0},t.method==="between"&&(f(t.args.after,t.args.before),t.accept=function(m){var _=Number(m);return a[_]?!0:(a[_]=!0,u.call(this,m))});for(var c=0;c1||i.length||o.length||a.length){var p=new ns(c);return p.dtstart(u),p.tzid(f||void 0),r.forEach(function(m){p.rrule(new Se(Qp(m,u,f),c))}),i.forEach(function(m){p.rdate(m)}),o.forEach(function(m){p.exrule(new Se(Qp(m,u,f),c))}),a.forEach(function(m){p.exdate(m)}),e.compatible&&e.dtstart&&p.rdate(u),p}var h=r[0]||{};return new Se(Qp(h,h.dtstart||e.dtstart||u,h.tzid||e.tzid||f),c)}function na(t,e){return e===void 0&&(e={}),a3(t,l3(e))}function Qp(t,e,n){return qn(qn({},t),{dtstart:e,tzid:n})}function l3(t){var e=[],n=Object.keys(t),r=Object.keys(ov);if(n.forEach(function(i){_t(r,i)||e.push(i)}),e.length)throw new Error("Invalid options: "+e.join(", "));return qn(qn({},ov),t)}function u3(t){if(t.indexOf(":")===-1)return{name:"RRULE",value:t};var e=f0(t,":",1),n=e[0],r=e[1];return{name:n,value:r}}function f3(t){var e=u3(t),n=e.name,r=e.value,i=n.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:r}}function c3(t,e){if(e===void 0&&(e=!1),t=t&&t.trim(),!t)throw new Error("Invalid empty string");if(!e)return t.split(/\s/);for(var n=t.split(` -`),r=0;r0&&i[0]===" "?(n[r-1]+=i.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}function d3(t){t.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function sv(t,e){return d3(e),t.split(",").map(function(n){return Le.untilStringToDate(n)})}function av(t){var e=this;return function(n){if(n!==void 0&&(e["_"+t]=n),e["_"+t]!==void 0)return e["_"+t];for(var r=0;rapp.vault.config.theme?app.vault.config.theme=="obsidian"?"dark":"light":"dark",$p=t=>t?t.trim().replace("<","lt").replace(">","gt").replace('"',"''").replace("\\","-").replace("/","-").replace(":","-").replace("|","-").replace("*","").replace("?",""):"",mv=(t,e)=>t.reduce(([n,r,i],o)=>{let a=app.metadataCache.getFileCache(o).frontmatter;return(a==null?void 0:a["event-id"])===e?[[...n,o],r,i]:(a==null?void 0:a["event-id"])?[n,r,[...i,o]]:[n,[...r,o],i]},[[],[],[]]),p3=t=>{let e=app.vault.getFiles().filter(i=>i.basename==$p(t.summary)),[n,r]=mv(e,t.id);return{event:t,file:n[0]||r[0]||null,match:n.length>0?"id":"title"}};var h3=(t,e)=>{let n=app.vault.getFiles().filter(o=>o.basename.startsWith(e.settings.optionalNotePrefix)),[r,i]=mv(n,t.id);return{event:t,file:r[0]||i[0]||null,match:r.length>0?"id":"title"}},oa=(t,e)=>{let n=p3(t);return n.match=="id"&&n.file?n:h3(t,e)};var eh=t=>te(void 0,null,function*(){var a,u;if(!t.settings.autoCreateEventNotes||!Ft())return;let e=Math.abs(t.settings.importStartOffset),n=Math.abs(t.settings.importEndOffset),r=window.moment().local().subtract(e,"day"),i=window.moment().local().add(n,"day"),o=yield Yt({startDate:r,endDate:i});for(let f=0;f{var a,u,f,c;let r=(u=(a=n==null?void 0:n.start)==null?void 0:a.offset)!=null?u:0,i=(c=(f=n==null?void 0:n.end)==null?void 0:f.offset)!=null?c:0,o=e.substring(r,i);return o.contains("event-id:")||(o.contains("---")?o=o.replace("---",`--- -event-id: ${t.id}`):o=`--- -event-id: ${t.id} ---- -`,e=e.substring(0,r)+o+e.substring(i)),e},m3=(t,e)=>{let n=/{{gEvent\.([^}>]*)}}/gm,r,i=[];do r=n.exec(e),i.push(r);while(r);return i.forEach(o=>{if(o){let a="";if(o[1]=="attendees"){let u=gf.default.get(t,o[1],"");for(let f=0;fo=a).open()),o}})}var cr=(t,e,n,r=!1)=>te(void 0,null,function*(){let i=ye.getInstance(),{vault:o}=app,{adapter:a}=o;e&&(e=th(i,t,e));let u=yield g3(i,t,e),f=yield _3(t,u,r);if(f)return f;let c;try{c=yield o.create(u,""),Ke(`EventNote ${t.summary} created.`)}catch(m){return null}if(!i.coreTemplatePlugin&&!i.templaterPlugin||!n){let m=gv(t,"",null);yield a.write(u,m);let _=o.getAbstractFileByPath(u);return(i.settings.autoCreateEventKeepOpen||!r)&&(yield app.workspace.getLeaf(!0).openFile(_)),_}n.match(/.*\.md/)||(n=n+".md");let p=yield app.workspace.getLeaf(!0);return yield p.setViewState({type:"MarkdownView"}),yield app.workspace.setActiveLeaf(p,!1,!0),yield p.openFile(c,{state:{mode:"source"},active:!0}),i.templaterPlugin&&i.coreTemplatePlugin?(yield h(!0))||(yield h(!1))||Ke("Template not compatible"):i.templaterPlugin?(yield h(!0))||Ke("Template not compatible"):i.coreTemplatePlugin&&((yield h(!1))||Ke("Template not compatible")),!i.settings.autoCreateEventKeepOpen&&r&&p.detach(),o.getAbstractFileByPath(u);function h(m){return te(this,null,function*(){var F,P,L,R,M,H;let _;m?_=(0,rs.normalizePath)((P=(F=i==null?void 0:i.templaterPlugin)==null?void 0:F.settings)==null?void 0:P.templates_folder):_=(0,rs.normalizePath)((M=(R=(L=i==null?void 0:i.coreTemplatePlugin)==null?void 0:L.instance)==null?void 0:R.options)==null?void 0:M.folder);let v;if((yield a.exists(n))?v=n:(v=`${_}/${n}`,_==="/"&&(v=n)),!(yield a.exists(v)))return Ke(`Template: ${n} doesn't exit.`),!1;let b=o.getAbstractFileByPath(v);if(!(b instanceof rs.TFile))return!1;let E=yield o.cachedRead(b),y=gv(t,E,(H=app.metadataCache.getFileCache(b).frontmatter)==null?void 0:H.position);if(y=m3(t,y),m&&y.contains("{{")&&y.contains("}}"))return!1;if(!m&&y.contains("<%")&&y.contains("%>"))return!1;let O=b.path+".tmp";yield a.write(O,y);let D=app.vault.getAbstractFileByPath(O);if(!(D instanceof rs.TFile))return!1;try{return m?yield i.templaterPlugin.templater.append_template_to_active_file(D):yield i.coreTemplatePlugin.instance.insertTemplate(D),a.remove(O),!0}catch(le){return a.remove(O),!1}})}});var fi=class extends sa.Modal{constructor(e,n){super(window.app);this.template=null;this.folder=null;this.plugin=ye.getInstance();this.event=e,this.onSubmit=n}onOpen(){let{contentEl:e}=this;e.createEl("h1",{text:"You can now select a template to use"}),new sa.Setting(e).setName("Template").addSearch(n=>{new Qa(n.inputEl,this.plugin),n.setPlaceholder("Template").setValue("").onChange(r=>this.template=r),n.containerEl.addClass("templater_search")}),new sa.Setting(e).setName("Folder").addSearch(n=>{new $a(n.inputEl),n.setPlaceholder("Example: folder1/folder2").setValue(app.vault.config.newFileFolderPath).onChange(r=>this.folder=r),n.containerEl.addClass("templater_search")}),new sa.Setting(e).setName("").addButton(n=>{n.setButtonText("Create Note"),n.onClick(()=>te(this,null,function*(){let r=yield cr(this.event,this.folder,this.template);this.onSubmit(r),this.close()}))})}onClose(){let{contentEl:e}=this;e.empty()}};function v3(t){Et(t,"svelte-47446l",".buttonRow.svelte-47446l.svelte-47446l{display:flex;flex-direction:row;align-items:center;justify-content:space-around;padding:5px}.summaryInput.svelte-47446l.svelte-47446l{border:none;border-bottom:2px solid;border-radius:0px;height:40px;font-size:35px;text-align:center}label.svelte-47446l.svelte-47446l{margin-top:5px}.googleFullDayContainer.svelte-47446l.svelte-47446l{margin-top:10px;display:flex;flex-direction:row;justify-content:space-between;align-items:center}.googleEventButtonContainer.svelte-47446l.svelte-47446l{margin-top:10px;display:flex;flex-direction:column;justify-content:space-around}.googleEventButtonContainer.svelte-47446l button.svelte-47446l{width:40%}")}function vv(t,e,n){let r=t.slice();return r[31]=e[n],r}function y3(t){let e,n,r,i,o,a,u=t[3],f=[];for(let c=0;cTt(void 0,void 0,void 0,function*(){var U,J,re,Y,z;if(n(5,u=((U=r==null?void 0:r.start)===null||U===void 0?void 0:U.dateTime)==null&&((J=r==null?void 0:r.start)===null||J===void 0?void 0:J.date)!==void 0),(r==null?void 0:r.transparency)?n(6,f=(r==null?void 0:r.transparency)=="opaque"):n(6,f=!0),n(3,o=yield Sr()),n(4,a=!1),r.id==null){n(0,r.summary=(re=r.summary)!==null&&re!==void 0?re:"",r),n(0,r.description=(Y=r.description)!==null&&Y!==void 0?Y:"",r),n(0,r.parent=o.find(_e=>_e.id===c.settings.defaultCalendar),r),r.parent||n(0,r.parent=o[o.length-1],r),n(8,_="");let ee=kv();n(1,p=ee.format("YYYY-MM-DDTHH:mm")),n(2,h=ee.add(1,"hour").format("YYYY-MM-DDTHH:mm")),n(7,m=ee.format("YYYY-MM-DD")),r.start.date&&n(7,m=window.moment(r.start.date).format("YYYY-MM-DD")),r.start.dateTime&&r.end.dateTime&&(n(1,p=window.moment(r.start.dateTime).format("YYYY-MM-DDTHH:mm")),n(2,h=window.moment(r.end.dateTime).format("YYYY-MM-DDTHH:mm")))}else{let ee=yield uo((z=r.recurringEventId)!==null&&z!==void 0?z:r.id,r.parent.id);if(ee==null?void 0:ee.recurrence){let _e=na(ee.recurrence[0]);n(8,_=_e.toText())}else n(8,_="");if(u){let _e=kv();n(1,p=_e.format("YYYY-MM-DDTHH:mm")),n(2,h=_e.add(1,"hour").format("YYYY-MM-DDTHH:mm")),n(7,m=window.moment(r.start.date).format("YYYY-MM-DD"))}else n(1,p=window.moment(r.start.dateTime).format("YYYY-MM-DDTHH:mm")),n(2,h=window.moment(r.end.dateTime).format("YYYY-MM-DDTHH:mm")),n(7,m=window.moment().format("YYYY-MM-DD"))}}));let E=()=>r.description?r.description.replace(/<\/?[^>]+(>|$)/g,""):"",y=U=>{U.target instanceof HTMLTextAreaElement&&n(0,r.description=U.target.value,r)},O=U=>{let J=U.target;if(J instanceof HTMLSelectElement){let re=J.value;n(0,r.parent.id=re,r)}},D=()=>Tt(void 0,void 0,void 0,function*(){if(_&&_!="")try{let J=Se.fromText(_),re=new ns;re.rrule(J);let Y=re.valueOf();if(_&&Y[0]==""){Ke("Event not created. Error in recurrence text.",!0);return}n(0,r.recurrence=Y,r)}catch(J){Ke("Event not created. Error in recurrence text.",!0);return}let U=yield ff(b(r));(U==null?void 0:U.id)&&i()}),F=U=>Tt(void 0,void 0,void 0,function*(){let J=!1;r.recurringEventId?J=yield uf(r):J=yield uf(r),J&&i()}),P=()=>Tt(void 0,void 0,void 0,function*(){(yield uf(b(r),!0))&&i()}),L=()=>Tt(void 0,void 0,void 0,function*(){let U=b(r),J;U.recurringEventId?J=yield Js(U):J=yield Js(U),J.id&&i()}),R=()=>Tt(void 0,void 0,void 0,function*(){(yield Js(b(r),!0)).id&&i()}),M=()=>Tt(void 0,void 0,void 0,function*(){app.workspace.getLeaf(!0).openFile(v.file),i()}),H=()=>Tt(void 0,void 0,void 0,function*(){c.settings.useDefaultTemplate&&c.settings.defaultFolder&&c.settings.defaultFolder?cr(r,c.settings.defaultFolder,c.settings.defaultTemplate):new fi(r,U=>n(9,v.file=U,v)).open()}),le=()=>{window.open(r.htmlLink)};function V(){r.summary=this.value,n(0,r)}function X(){u=this.checked,n(5,u)}function K(){m=this.value,n(7,m)}function ce(){p=this.value,n(1,p)}function S(){h=this.value,n(2,h),n(1,p)}function Q(){_=this.value,n(8,_)}function j(){f=this.checked,n(6,f)}return t.$$set=U=>{"event"in U&&n(0,r=U.event),"closeFunction"in U&&n(21,i=U.closeFunction)},t.$$.update=()=>{if(t.$$.dirty[0]&6){e:{let U=window.moment(p);window.moment(h).isBefore(U)&&n(2,h=U.add(1,"hour").format("YYYY-MM-DDTHH:mm"))}}},[r,p,h,o,a,u,f,m,_,v,E,y,O,D,F,P,L,R,M,H,le,i,V,X,K,ce,S,Q,j]}var Ev=class extends ze{constructor(e){super();qe(this,e,A3,M3,Ge,{event:0,closeFunction:21},v3,[-1,-1])}},Tv=Ev;var Nr=class extends Sv.Modal{constructor(e,n){super(ye.getInstance().app);this.selectedEvent=e,n&&(this.closeFunction=n)}onOpen(){return te(this,null,function*(){let{contentEl:e}=this;new Tv({target:e,props:{event:this.selectedEvent,closeFunction:()=>{this.closeFunction&&this.closeFunction(),this.close()}}})})}onClose(){let{contentEl:e}=this;e.empty()}};var Dv=Oe(Bu());var dr=class extends Cv.FuzzySuggestModal{constructor(e,n,r=window.moment(),i=!1,o){super(window.app);this.plugin=ye.getInstance();this.eventList=[...e],this.modalSelectMode=n,this.setPlaceholder(`${r.format("MM/DD/YYYY")} Arrow left/right to switch day`),this.emptyStateText="No events found enter to create a new one",this.eventsChanged=i,this.currentDate=r.clone(),o&&(this.closeFunction=o),this.inputEl.addEventListener("keydown",a=>te(this,null,function*(){let u=!1;!this.getSuggestions(this.inputEl.value).length&&a.key=="Enter"&&new Nr({summary:this.inputEl.value,start:{date:r.format()},end:{}},()=>{this.eventsChanged=!0,this.close()}).open(),a.key=="ArrowRight"?(a.ctrlKey?this.currentDate=this.currentDate.add(1,"month"):a.shiftKey?this.currentDate=this.currentDate.add(1,"week"):this.currentDate=this.currentDate.add(1,"day"),u=!0):a.key=="ArrowLeft"&&(a.ctrlKey?this.currentDate=this.currentDate.subtract(1,"month"):a.shiftKey?this.currentDate=this.currentDate.subtract(1,"week"):this.currentDate=this.currentDate.subtract(1,"day"),u=!0),u&&(this.setPlaceholder("Loading"),this.eventList=yield Yt({startDate:this.currentDate}),this.inputEl.dispatchEvent(new Event("input")),this.setPlaceholder(`${this.currentDate.format("MM/DD/YYYY")} Arrow left and right to switch day`))}))}getItems(){return this.plugin.settings.activateDailyNoteAddon?[{id:"xxx",start:null,end:null},...this.eventList]:this.eventList}getItemText(e){return e.id=="xxx"?Zo(this.currentDate)?"Open daily note":"Create daily note":e.start.date?`${e.start.date} | ${e.summary} `:`${window.moment(e.start.dateTime).format("YYYY-MM-DD HH:mm")} | ${e.summary} `}onChooseItem(e){return te(this,null,function*(){if(e.id=="xxx"){let n=Zo(this.currentDate);n||(n=yield(0,Dv.createDailyNote)(this.currentDate)),yield app.workspace.getLeaf(!1).openFile(n,{active:!0});return}this.modalSelectMode=="details"?(this.open(),new Nr(e,()=>this.eventsChanged=!0).open()):this.modalSelectMode=="createNote"&&(this.plugin.settings.useDefaultTemplate?cr(e,this.plugin.settings.defaultFolder,this.plugin.settings.defaultTemplate):new fi(e,()=>{}).open())})}onClose(){this.closeFunction&&this.eventsChanged&&this.closeFunction()}};var nh=class extends Ov.FuzzySuggestModal{constructor(e){super(ye.getInstance().app);this.calendarList=e,this.setPlaceholder("Select a calendar to view it")}getItems(){return this.calendarList}getItemText(e){return`${e.summary} `}onChooseItem(e){return te(this,null,function*(){let n=yield Yt({include:[e.id]});new dr(n,"details").open()})}};function rh(t,e){let n=e.replace(/\((?!\?)/g,"(?:");return`${t}${n}\\s{0,5}(?:,?\\s{0,5}${n}){0,10}`}function P3(t){let e;return t instanceof Array?e=[...t]:t instanceof Map?e=Array.from(t.keys()):e=Object.keys(t),e}function Pn(t){return`(?:${P3(t).sort((n,r)=>r.length-n.length).join("|").replace(/\./g,"\\.")})`}var Mv=Oe(ho());function _f(t){return t<100&&(t>50?t=t+1900:t=t+2e3),t}function mo(t,e,n){let r=(0,Mv.default)(t),i=r;i=i.month(n-1),i=i.date(e),i=i.year(r.year());let o=i.add(1,"y"),a=i.add(-1,"y");return Math.abs(o.diff(r))Lv(t,pr.MARCH,fn.SUNDAY,2),dstEnd:t=>Lv(t,pr.OCTOBER,fn.SUNDAY,3)},CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CT:{timezoneOffsetDuringDst:-5*60,timezoneOffsetNonDst:-6*60,dstStart:t=>_o(t,pr.MARCH,fn.SUNDAY,2,2),dstEnd:t=>_o(t,pr.NOVEMBER,fn.SUNDAY,1,2)},CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:{timezoneOffsetDuringDst:-4*60,timezoneOffsetNonDst:-5*60,dstStart:t=>_o(t,pr.MARCH,fn.SUNDAY,2,2),dstEnd:t=>_o(t,pr.NOVEMBER,fn.SUNDAY,1,2)},FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MT:{timezoneOffsetDuringDst:-6*60,timezoneOffsetNonDst:-7*60,dstStart:t=>_o(t,pr.MARCH,fn.SUNDAY,2,2),dstEnd:t=>_o(t,pr.NOVEMBER,fn.SUNDAY,1,2)},MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:{timezoneOffsetDuringDst:-7*60,timezoneOffsetNonDst:-8*60,dstStart:t=>_o(t,pr.MARCH,fn.SUNDAY,2,2),dstEnd:t=>_o(t,pr.NOVEMBER,fn.SUNDAY,1,2)},PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function _o(t,e,n,r,i=0){let o=0,a=0;for(;a31)return n.index=n.index+n[Yv].length,null;if(r.start.assign("month",i),r.start.assign("day",o),n[jv]){let a=fa(n[jv]);r.start.assign("year",a)}else{let a=mo(e.refDate,o,i);r.start.imply("year",a)}if(n[Wv]){let a=la(n[Wv]);r.end=r.start.clone(),r.end.assign("day",a)}return r}};var B3=new RegExp(`(${Pn(xr)})(?:-|/|\\s*,?\\s*)(${aa})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${aa})\\s*)?(?:(?:-|/|\\s*,?\\s*)(${ua}))?(?=\\W|$)(?!\\:\\d)`,"i"),G3=1,U3=2,Bv=3,Gv=4,kf=class extends xt{innerPattern(){return B3}innerExtract(e,n){let r=xr[n[G3].toLowerCase()],i=la(n[U3]);if(i>31)return null;let o=e.createParsingComponents({day:i,month:r});if(n[Gv]){let f=fa(n[Gv]);o.assign("year",f)}else{let f=mo(e.refDate,i,r);o.imply("year",f)}if(!n[Bv])return o;let a=la(n[Bv]),u=e.createParsingResult(n.index,n[0]);return u.start=o,u.end=o.clone(),u.end.assign("day",a),u}};var z3=new RegExp(`((?:in)\\s*)?(${Pn(xr)})\\s*(?:[,-]?\\s*(${ua})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),H3=1,q3=2,Uv=3,Ef=class extends xt{innerPattern(){return z3}innerExtract(e,n){let r=n[q3].toLowerCase();if(n[0].length<=3&&!ah[r])return null;let i=e.createParsingResult(n.index+(n[H3]||"").length,n.index+n[0].length);i.start.imply("day",1);let o=xr[r];if(i.start.assign("month",o),n[Uv]){let a=fa(n[Uv]);i.start.assign("year",a)}else{let a=mo(e.refDate,1,o);i.start.imply("year",a)}return i}};var V3=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${Pn(xr)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),K3=1,Z3=2,zv=3,X3=4,Tf=class extends xt{innerPattern(){return V3}innerExtract(e,n){let r=n[zv]?parseInt(n[zv]):xr[n[Z3].toLowerCase()];if(r<1||r>12)return null;let i=parseInt(n[K3]);return{day:parseInt(n[X3]),month:r,year:i}}};var J3=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),Q3=1,$3=2,Sf=class extends xt{innerPattern(){return J3}innerExtract(e,n){let r=parseInt(n[$3]),i=parseInt(n[Q3]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",r)}};function e6(t,e,n,r){return new RegExp(`${t}${e}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${n}`,r)}function t6(t,e){return new RegExp(`^(${t})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${e}`,"i")}var Hv=2,da=3,Cf=4,Df=5,Cl=6,ph=class{constructor(e=!1){this.cachedPrimaryPrefix=null,this.cachedPrimarySuffix=null,this.cachedPrimaryTimePattern=null,this.cachedFollowingPhase=null,this.cachedFollowingSuffix=null,this.cachedFollowingTimePatten=null,this.strictMode=e}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?=\\W|$)"}followingSuffix(){return"(?=\\W|$)"}pattern(e){return this.getPrimaryTimePatternThroughCache()}extract(e,n){let r=this.extractPrimaryTimeComponents(e,n);if(!r)return n.index+=n[0].length,null;let i=n.index+n[1].length,o=n[0].substring(n[1].length),a=e.createParsingResult(i,o,r);n.index+=n[0].length;let u=e.text.substring(n.index),c=this.getFollowingTimePatternThroughCache().exec(u);return o.match(/^\d{3,4}/)&&c&&c[0].match(/^\s*([+-])\s*\d{2,4}$/)?null:!c||c[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(a):(a.end=this.extractFollowingTimeComponents(e,c,a),a.end&&(a.text+=c[0]),this.checkAndReturnWithFollowingPattern(a))}extractPrimaryTimeComponents(e,n,r=!1){let i=e.createParsingComponents(),o=0,a=null,u=parseInt(n[Hv]);if(u>100){if(this.strictMode||n[da]!=null)return null;o=u%100,u=Math.floor(u/100)}if(u>24)return null;if(n[da]!=null){if(n[da].length==1&&!n[Cl])return null;o=parseInt(n[da])}if(o>=60)return null;if(u>12&&(a=yt.PM),n[Cl]!=null){if(u>12)return null;let f=n[Cl][0].toLowerCase();f=="a"&&(a=yt.AM,u==12&&(u=0)),f=="p"&&(a=yt.PM,u!=12&&(u+=12))}if(i.assign("hour",u),i.assign("minute",o),a!==null?i.assign("meridiem",a):u<12?i.imply("meridiem",yt.AM):i.imply("meridiem",yt.PM),n[Df]!=null){let f=parseInt(n[Df].substring(0,3));if(f>=1e3)return null;i.assign("millisecond",f)}if(n[Cf]!=null){let f=parseInt(n[Cf]);if(f>=60)return null;i.assign("second",f)}return i}extractFollowingTimeComponents(e,n,r){let i=e.createParsingComponents();if(n[Df]!=null){let f=parseInt(n[Df].substring(0,3));if(f>=1e3)return null;i.assign("millisecond",f)}if(n[Cf]!=null){let f=parseInt(n[Cf]);if(f>=60)return null;i.assign("second",f)}let o=parseInt(n[Hv]),a=0,u=-1;if(n[da]!=null?a=parseInt(n[da]):o>100&&(a=o%100,o=Math.floor(o/100)),a>=60||o>24)return null;if(o>=12&&(u=yt.PM),n[Cl]!=null){if(o>12)return null;let f=n[Cl][0].toLowerCase();f=="a"&&(u=yt.AM,o==12&&(o=0,i.isCertain("day")||i.imply("day",i.get("day")+1))),f=="p"&&(u=yt.PM,o!=12&&(o+=12)),r.start.isCertain("meridiem")||(u==yt.AM?(r.start.imply("meridiem",yt.AM),r.start.get("hour")==12&&r.start.assign("hour",0)):(r.start.imply("meridiem",yt.PM),r.start.get("hour")!=12&&r.start.assign("hour",r.start.get("hour")+12)))}return i.assign("hour",o),i.assign("minute",a),u>=0?i.assign("meridiem",u):r.start.isCertain("meridiem")&&r.start.get("hour")>12?r.start.get("hour")-12>o?i.imply("meridiem",yt.AM):o<=12&&(i.assign("hour",o+12),i.assign("meridiem",yt.PM)):o>12?i.imply("meridiem",yt.PM):o<=12&&i.imply("meridiem",yt.AM),i.date().getTime()24)return null}return e}checkAndReturnWithFollowingPattern(e){if(e.text.match(/^\d+-\d+$/))return null;let n=e.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(n){if(this.strictMode)return null;let r=n[1],i=n[2];if(i.includes(".")&&!i.match(/\d(\.\d{2})+$/))return null;let o=parseInt(i),a=parseInt(r);if(o>24||a>24)return null}return e}getPrimaryTimePatternThroughCache(){let e=this.primaryPrefix(),n=this.primarySuffix();return this.cachedPrimaryPrefix===e&&this.cachedPrimarySuffix===n?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=e6(this.primaryPatternLeftBoundary(),e,n,this.patternFlags()),this.cachedPrimaryPrefix=e,this.cachedPrimarySuffix=n,this.cachedPrimaryTimePattern)}getFollowingTimePatternThroughCache(){let e=this.followingPhase(),n=this.followingSuffix();return this.cachedFollowingPhase===e&&this.cachedFollowingSuffix===n?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=t6(e,n),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=n,this.cachedFollowingTimePatten)}};var Of=class extends ph{constructor(e){super(e)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|until|through|till|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,n){let r=super.extractPrimaryTimeComponents(e,n);if(r){if(n[0].endsWith("night")){let i=r.get("hour");i>=6&&i<12?(r.assign("hour",r.get("hour")+12),r.assign("meridiem",yt.PM)):i<6&&r.assign("meridiem",yt.AM)}if(n[0].endsWith("afternoon")){r.assign("meridiem",yt.PM);let i=r.get("hour");i>=0&&i<=6&&r.assign("hour",r.get("hour")+12)}n[0].endsWith("morning")&&(r.assign("meridiem",yt.AM),r.get("hour")<12&&r.assign("hour",r.get("hour")))}return r}};function pa(t){let e={};for(let n in t)e[n]=-t[n];return e}function qv(t,e){let n=t.clone(),r=t.dayjs();for(let i in e)r=r.add(e[i],i);return("day"in e||"d"in e||"week"in e||"month"in e||"year"in e)&&(n.imply("day",r.date()),n.imply("month",r.month()+1),n.imply("year",r.year())),("second"in e||"minute"in e||"hour"in e)&&(n.imply("second",r.second()),n.imply("minute",r.minute()),n.imply("hour",r.hour())),n}var n6=new RegExp(`(${Bi})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),r6=new RegExp(`(${go})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),Mf=class extends xt{constructor(e){super();this.strictMode=e}innerPattern(){return this.strictMode?r6:n6}innerExtract(e,n){let r=ci(n[1]),i=pa(r);return wt.createRelativeFromReference(e.reference,i)}};var i6=new RegExp(`(${Bi})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),o6=new RegExp("("+go+")(later|from now)(?=(?:\\W|$))","i"),s6=1,Af=class extends xt{constructor(e){super();this.strictMode=e}innerPattern(){return this.strictMode?o6:i6}innerExtract(e,n){let r=ci(n[s6]);return wt.createRelativeFromReference(e.reference,r)}};var hh=class{refine(e,n){return n.filter(r=>this.isValid(e,r))}},Gi=class{refine(e,n){if(n.length<2)return n;let r=[],i=n[0],o=null;for(let a=1;a{console.log(`${this.constructor.name} merged ${f} and ${c} into ${p}`)}),i=p}}return i!=null&&r.push(i),r}};var Pf=class extends Gi{shouldMergeResults(e,n,r){return!n.end&&!r.end&&e.match(this.patternBetween())!=null}mergeResults(e,n,r){if(!n.start.isOnlyWeekdayComponent()&&!r.start.isOnlyWeekdayComponent()&&(r.start.getCertainComponents().forEach(o=>{n.start.isCertain(o)||n.start.imply(o,r.start.get(o))}),n.start.getCertainComponents().forEach(o=>{r.start.isCertain(o)||r.start.imply(o,n.start.get(o))})),n.start.date().getTime()>r.start.date().getTime()){let o=n.start.dayjs(),a=r.start.dayjs();r.start.isOnlyWeekdayComponent()&&a.add(7,"days").isAfter(o)?(a=a.add(7,"days"),r.start.imply("day",a.date()),r.start.imply("month",a.month()+1),r.start.imply("year",a.year())):n.start.isOnlyWeekdayComponent()&&o.add(-7,"days").isBefore(a)?(o=o.add(-7,"days"),n.start.imply("day",o.date()),n.start.imply("month",o.month()+1),n.start.imply("year",o.year())):r.start.isDateWithUnknownYear()&&a.add(1,"years").isAfter(o)?(a=a.add(1,"years"),r.start.imply("year",a.year())):n.start.isDateWithUnknownYear()&&o.add(-1,"years").isBefore(a)?(o=o.add(-1,"years"),n.start.imply("year",o.year())):[r,n]=[n,r]}let i=n.clone();return i.start=n.start,i.end=r.start,i.index=Math.min(n.index,r.index),n.index{var _,v;let a=e.text.substring(o.index+o.text.length),u=a6.exec(a);if(!u)return;let f=u[1].toUpperCase(),c=(v=(_=o.start.date())!=null?_:o.refDate)!=null?v:new Date,p=zn(zn({},this.timezoneOverrides),r),h=yf(f,c,p);if(h==null)return;e.debug(()=>{console.log(`Extracting timezone: '${f}' into: ${h} for: ${o.start}`)});let m=o.start.get("timezoneOffset");m!==null&&h!=m&&(o.start.isCertain("timezoneOffset")||f!=u[1])||o.start.isOnlyDate()&&f!=u[1]||(o.text+=u[0],o.start.isCertain("timezoneOffset")||o.start.assign("timezoneOffset",h),o.end!=null&&!o.end.isCertain("timezoneOffset")&&o.end.assign("timezoneOffset",h))}),n}};var l6=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),u6=1,f6=2,c6=3,Lf=class{refine(e,n){return n.forEach(function(r){if(r.start.isCertain("timezoneOffset"))return;let i=e.text.substring(r.index+r.text.length),o=l6.exec(i);if(!o)return;e.debug(()=>{console.log(`Extracting timezone: '${o[0]}' into : ${r}`)});let a=parseInt(o[f6]),u=parseInt(o[c6]||"0"),f=a*60+u;f>14*60||(o[u6]==="-"&&(f=-f),r.end!=null&&r.end.assign("timezoneOffset",f),r.start.assign("timezoneOffset",f),r.text+=o[0])}),n}};var Dl=class{refine(e,n){if(n.length<2)return n;let r=[],i=n[0];for(let o=1;oi.text.length&&(i=a):(r.push(i),i=a)}return i!=null&&r.push(i),r}};var Kv=Oe(ho());var Ff=class{refine(e,n){return e.option.forwardDate&&n.forEach(function(r){let i=(0,Kv.default)(e.refDate);if(r.start.isOnlyTime()&&i.isAfter(r.start.dayjs())&&(i=i.add(1,"day"),is(r.start,i),r.end&&r.end.isOnlyTime()&&(is(r.end,i),r.start.dayjs().isAfter(r.end.dayjs())&&(i=i.add(1,"day"),is(r.end,i)))),r.start.isOnlyWeekdayComponent()&&i.isAfter(r.start.dayjs())&&(i.day()>=r.start.get("weekday")?i=i.day(r.start.get("weekday")+7):i=i.day(r.start.get("weekday")),r.start.imply("day",i.date()),r.start.imply("month",i.month()+1),r.start.imply("year",i.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${r} (${r.start})`)}),r.end&&r.end.isOnlyWeekdayComponent()&&(i.day()>r.end.get("weekday")?i=i.day(r.end.get("weekday")+7):i=i.day(r.end.get("weekday")),r.end.imply("day",i.date()),r.end.imply("month",i.month()+1),r.end.imply("year",i.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${r} (${r.end})`)}))),r.start.isDateWithUnknownYear()&&i.isAfter(r.start.dayjs()))for(let o=0;o<3&&i.isAfter(r.start.dayjs());o++)r.start.imply("year",r.start.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${r} (${r.start})`)}),r.end&&!r.end.isCertain("year")&&(r.end.imply("year",r.end.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${r} (${r.end})`)}))}),n}};var Yf=class extends hh{constructor(e){super();this.strictMode=e}isValid(e,n){return n.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(e.debug(()=>{console.log(`Removing unlikely result '${n.text}'`)}),!1):n.start.isValidDate()?n.end&&!n.end.isValidDate()?(e.debug(()=>{console.log(`Removing invalid result: ${n} (${n.end})`)}),!1):this.strictMode?this.isStrictModeValid(e,n):!0:(e.debug(()=>{console.log(`Removing invalid result: ${n} (${n.start})`)}),!1)}isStrictModeValid(e,n){return n.start.isOnlyWeekdayComponent()?(e.debug(()=>{console.log(`(Strict) Removing weekday only component: ${n} (${n.end})`)}),!1):n.start.isOnlyTime()&&(!n.start.isCertain("hour")||!n.start.isCertain("minute"))?(e.debug(()=>{console.log(`(Strict) Removing uncertain time component: ${n} (${n.end})`)}),!1):!0}};var d6=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(?:Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),p6=1,h6=2,m6=3,Zv=4,g6=5,Xv=6,Jv=7,Qv=8,$v=9,Wf=class extends xt{innerPattern(){return d6}innerExtract(e,n){let r={};if(r.year=parseInt(n[p6]),r.month=parseInt(n[h6]),r.day=parseInt(n[m6]),n[Zv]!=null)if(r.hour=parseInt(n[Zv]),r.minute=parseInt(n[g6]),n[Xv]!=null&&(r.second=parseInt(n[Xv])),n[Jv]!=null&&(r.millisecond=parseInt(n[Jv])),n[Qv]==null)r.timezoneOffset=0;else{let i=parseInt(n[Qv]),o=0;n[$v]!=null&&(o=parseInt(n[$v]));let a=i*60;a<0?a-=o:a+=o,r.timezoneOffset=a}return r}};var jf=class extends Gi{mergeResults(e,n,r){let i=r.clone();return i.index=n.index,i.text=n.text+e+i.text,i.start.assign("weekday",n.start.get("weekday")),i.end&&i.end.assign("weekday",n.start.get("weekday")),i}shouldMergeResults(e,n,r){return n.start.isOnlyWeekdayComponent()&&!n.start.isCertain("hour")&&r.start.isCertain("day")&&e.match(/^,?\s*$/)!=null}};function ey(t,e=!1){return t.parsers.unshift(new Wf),t.refiners.unshift(new jf),t.refiners.unshift(new Lf),t.refiners.unshift(new Dl),t.refiners.push(new Rf),t.refiners.push(new Dl),t.refiners.push(new Ff),t.refiners.push(new Yf(e)),t}var dy=Oe(ho());var ha=Oe(ho());function ty(t){let e=(0,ha.default)(t.instant),n=new wt(t,{});return Jr(n,e),vf(n,e),t.timezoneOffset!==null&&n.assign("timezoneOffset",e.utcOffset()),n}function ny(t){let e=(0,ha.default)(t.instant),n=new wt(t,{});return Jr(n,e),ca(n,e),n}function ry(t){return _6(t,1)}function _6(t,e){return oy(t,-e)}function iy(t){return oy(t,1)}function oy(t,e){let n=(0,ha.default)(t.instant),r=new wt(t,{});return n=n.add(e,"day"),Jr(r,n),ca(r,n),r}function sy(t,e=22){let n=(0,ha.default)(t.instant),r=new wt(t,{});return r.imply("hour",e),r.imply("meridiem",yt.PM),Jr(r,n),r}function ay(t,e=20){let n=new wt(t,{});return n.imply("meridiem",yt.PM),n.imply("hour",e),n}function ly(t){let e=new wt(t,{}),n=(0,ha.default)(t.instant);return n.hour()>2&&Rv(e,n),e.assign("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("millisecond",0),e}function uy(t,e=6){let n=new wt(t,{});return n.imply("meridiem",yt.AM),n.imply("hour",e),n.imply("minute",0),n.imply("second",0),n.imply("millisecond",0),n}function fy(t,e=15){let n=new wt(t,{});return n.imply("meridiem",yt.PM),n.imply("hour",e),n.imply("minute",0),n.imply("second",0),n.imply("millisecond",0),n}function cy(t){let e=new wt(t,{});return e.imply("meridiem",yt.AM),e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("millisecond",0),e}var v6=/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,Bf=class extends xt{innerPattern(e){return v6}innerExtract(e,n){let r=(0,dy.default)(e.refDate),i=n[0].toLowerCase(),o=e.createParsingComponents();switch(i){case"now":return ty(e.reference);case"today":return ny(e.reference);case"yesterday":return ry(e.reference);case"tomorrow":case"tmr":case"tmrw":return iy(e.reference);case"tonight":return sy(e.reference);default:i.match(/last\s*night/)&&(r.hour()>6&&(r=r.add(-1,"day")),Jr(o,r),o.imply("hour",0));break}return o}};var y6=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|midday|noon)(?=\W|$)/i,Gf=class extends xt{innerPattern(){return y6}innerExtract(e,n){switch(n[1].toLowerCase()){case"afternoon":return fy(e.reference);case"evening":case"night":return ay(e.reference);case"midnight":return ly(e.reference);case"morning":return uy(e.reference);case"noon":case"midday":return cy(e.reference)}return null}};function py(t,e,n){let r=t.getDateWithAdjustedTimezone(),i=w6(r,e,n),o=new wt(t);return o=qv(o,{day:i}),o.assign("weekday",e),o}function w6(t,e,n){let r=t.getDay();switch(n){case"this":return Uf(t,e);case"last":return hy(t,e);case"next":return r==fn.SUNDAY?e==fn.SUNDAY?7:e:r==fn.SATURDAY?e==fn.SATURDAY?7:e==fn.SUNDAY?8:1+e:e=0&&(r-=7),r}var k6=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${Pn(sh)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),E6=1,T6=2,S6=3,zf=class extends xt{innerPattern(){return k6}innerExtract(e,n){let r=n[T6].toLowerCase(),i=sh[r],o=n[E6],a=n[S6],u=o||a;u=u||"",u=u.toLowerCase();let f=null;return u=="last"||u=="past"?f="last":u=="next"?f="next":u=="this"&&(f="this"),py(e.reference,i,f)}};var my=Oe(ho());var C6=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${Pn(El)})(?=\\s*)(?=\\W|$)`,"i"),D6=1,O6=2,Hf=class extends xt{innerPattern(){return C6}innerExtract(e,n){let r=n[D6].toLowerCase(),i=n[O6].toLowerCase(),o=El[i];if(r=="next"||r.startsWith("after")){let f={};return f[o]=1,wt.createRelativeFromReference(e.reference,f)}if(r=="last"||r=="past"){let f={};return f[o]=-1,wt.createRelativeFromReference(e.reference,f)}let a=e.createParsingComponents(),u=(0,my.default)(e.reference.instant);return i.match(/week/i)?(u=u.add(-u.get("d"),"d"),a.imply("day",u.date()),a.imply("month",u.month()+1),a.imply("year",u.year())):i.match(/month/i)?(u=u.add(-u.date()+1,"d"),a.imply("day",u.date()),a.assign("year",u.year()),a.assign("month",u.month()+1)):i.match(/year/i)&&(u=u.add(-u.date()+1,"d"),u=u.add(-u.month(),"month"),a.imply("day",u.date()),a.imply("month",u.month()+1),a.assign("year",u.year())),a}};var yo=class{constructor(e){e=e||gh(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new yo({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(e,n,r){let i=this.parse(e,n,r);return i.length>0?i[0].start.date():null}parse(e,n,r){let i=new gy(e,n,r),o=[];return this.parsers.forEach(a=>{let u=yo.executeParser(i,a);o=o.concat(u)}),o.sort((a,u)=>a.index-u.index),this.refiners.forEach(function(a){o=a.refine(i,o)}),o}static executeParser(e,n){let r=[],i=n.pattern(e),o=e.text,a=e.text,u=i.exec(a);for(;u;){let f=u.index+o.length-a.length;u.index=f;let c=n.extract(e,u);if(!c){a=o.substring(u.index+1),u=i.exec(a);continue}let p=null;c instanceof vo?p=c:c instanceof wt?(p=e.createParsingResult(u.index,u[0]),p.start=c):p=e.createParsingResult(u.index,u[0],c),e.debug(()=>console.log(`${n.constructor.name} extracted result ${p}`)),r.push(p),a=o.substring(f+p.text.length),u=i.exec(a)}return r}},gy=class{constructor(e,n,r){this.text=e,this.reference=new Sl(n),this.option=r!=null?r:{},this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof wt?e:new wt(this.reference,e)}createParsingResult(e,n,r,i){let o=typeof n=="string"?n:this.text.substring(e,n),a=r?this.createParsingComponents(r):null,u=i?this.createParsingComponents(i):null;return new vo(this.reference,e,o,a,u)}debug(e){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(e):this.option.debug.debug(e))}};var M6=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),qf=1,A6=5,_y=2,vy=3,_h=4,Vf=class{constructor(e){this.groupNumberMonth=e?vy:_y,this.groupNumberDay=e?_y:vy}pattern(){return M6}extract(e,n){if(n[qf].length==0&&n.index>0&&n.index="0"&&f<="9")return}let r=n.index+n[qf].length,i=n[0].substr(n[qf].length,n[0].length-n[qf].length-n[A6].length);if(i.match(/^\d\.\d$/)||i.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!n[_h]&&n[0].indexOf("/")<0)return;let o=e.createParsingResult(r,i),a=parseInt(n[this.groupNumberMonth]),u=parseInt(n[this.groupNumberDay]);if((a<1||a>12)&&a>12)if(u>=1&&u<=12&&a<=31)[u,a]=[a,u];else return null;if(u<1||u>31)return null;if(o.start.assign("day",u),o.start.assign("month",a),n[_h]){let f=parseInt(n[_h]),c=_f(f);o.start.assign("year",c)}else{let f=mo(e.refDate,u,a);o.start.imply("year",f)}return o}};var P6=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${Bi})(?=\\W|$)`,"i"),N6=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${go})(?=\\W|$)`,"i"),Kf=class extends xt{constructor(e=!0){super();this.allowAbbreviations=e}innerPattern(){return this.allowAbbreviations?P6:N6}innerExtract(e,n){let r=n[1].toLowerCase(),i=ci(n[2]);switch(r){case"last":case"past":case"-":i=pa(i);break}return wt.createRelativeFromReference(e.reference,i)}};function yy(t){return t.text.match(/\s+(before|from)$/i)!=null}function x6(t){return t.text.match(/\s+(after|since)$/i)!=null}var Zf=class extends Gi{patternBetween(){return/^\s*$/i}shouldMergeResults(e,n,r){return!e.match(this.patternBetween())||!yy(n)&&!x6(n)?!1:!!r.start.get("day")&&!!r.start.get("month")&&!!r.start.get("year")}mergeResults(e,n,r){let i=ci(n.text);yy(n)&&(i=pa(i));let o=wt.createRelativeFromReference(new Sl(r.start.date()),i);return new vo(r.reference,n.index,`${n.text}${e}${r.text}`,o)}};var I6=new yo(gh(!1)),fB=new yo(vh(!0,!1)),cB=new yo(vh(!1,!0));function gh(t=!1){let e=vh(!1,t);return e.parsers.unshift(new Bf),e.parsers.unshift(new Gf),e.parsers.unshift(new Ef),e.parsers.unshift(new Hf),e.parsers.unshift(new Kf),e}function vh(t=!0,e=!1){return ey({parsers:[new Vf(e),new wf(t),new bf,new kf,new zf,new Tf,new Sf,new Of(t),new Mf(t),new Af(t)],refiners:[new Zf,new If,new Nf]},t)}var yt;(function(t){t[t.AM=0]="AM",t[t.PM=1]="PM"})(yt||(yt={}));var fn;(function(t){t[t.SUNDAY=0]="SUNDAY",t[t.MONDAY=1]="MONDAY",t[t.TUESDAY=2]="TUESDAY",t[t.WEDNESDAY=3]="WEDNESDAY",t[t.THURSDAY=4]="THURSDAY",t[t.FRIDAY=5]="FRIDAY",t[t.SATURDAY=6]="SATURDAY"})(fn||(fn={}));var pr;(function(t){t[t.JANUARY=1]="JANUARY",t[t.FEBRUARY=2]="FEBRUARY",t[t.MARCH=3]="MARCH",t[t.APRIL=4]="APRIL",t[t.MAY=5]="MAY",t[t.JUNE=6]="JUNE",t[t.JULY=7]="JULY",t[t.AUGUST=8]="AUGUST",t[t.SEPTEMBER=9]="SEPTEMBER",t[t.OCTOBER=10]="OCTOBER",t[t.NOVEMBER=11]="NOVEMBER",t[t.DECEMBER=12]="DECEMBER"})(pr||(pr={}));var R6=I6;function wy(t,e,n){return R6.parseDate(t,e,n)}var vc=Oe(require("obsidian"));function L6(t){Et(t,"svelte-66wdl1","div.svelte-66wdl1{display:inline-block;vertical-align:middle;margin:0 3pt;border-width:calc(1em / 5);border-style:solid;border-radius:50%;animation:var(--duration) infinite svelte-66wdl1-rotate}@keyframes svelte-66wdl1-rotate{100%{transform:rotate(360deg)}}")}function F6(t){let e,n=`${t[0]} transparent ${t[0]} - ${t[0]}`;return{c(){e=N("div"),he(e,"--duration",t[1]),k(e,"class","svelte-66wdl1"),he(e,"border-color",n),he(e,"width",t[2]),he(e,"height",t[2])},m(r,i){G(r,e,i)},p(r,[i]){i&2&&he(e,"--duration",r[1]);let o=i&2;(o||i&3&&n!==(n=`${r[0]} transparent ${r[0]} - ${r[0]}`))&&he(e,"border-color",n),(o||i&6)&&he(e,"width",r[2]),(o||i&6)&&he(e,"height",r[2])},i:me,o:me,d(r){r&&B(e)}}}function Y6(t,e,n){let{color:r="cornflowerblue"}=e,{duration:i="1.5s"}=e,{size:o="1em"}=e;return t.$$set=a=>{"color"in a&&n(0,r=a.color),"duration"in a&&n(1,i=a.duration),"size"in a&&n(2,o=a.size)},[r,i,o]}var by=class extends ze{constructor(e){super();qe(this,e,Y6,F6,Ge,{color:0,duration:1,size:2},L6)}},yh=by;function Xf(t){let e=t-1;return e*e*e+1}function Jf(t){return--t*t*t*t*t+1}function W6(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);iMath.sqrt(R)*30,easing:m=Xf}=mn(mn({},n),c),_=u.getBoundingClientRect(),v=f.getBoundingClientRect(),b=_.left-v.left,E=_.top-v.top,y=_.width/v.width,O=_.height/v.height,D=Math.sqrt(b*b+E*E),F=getComputedStyle(f),P=F.transform==="none"?"":F.transform,L=+F.opacity;return{delay:p,duration:$t(h)?h(D):h,easing:m,css:(R,M)=>` - opacity: ${R*L}; - transform-origin: top left; - transform: ${P} translate(${M*b}px,${M*E}px) scale(${R+(1-R)*y}, ${R+(1-R)*O}); - `}}function a(u,f,c){return(p,h)=>(u.set(h.key,p),()=>{if(f.has(h.key)){let m=f.get(h.key);return f.delete(h.key),o(m,p,h)}return u.delete(h.key),e&&e(p,h,c)})}return[a(i,r,!1),a(r,i,!0)]}function ky(t,{from:e,to:n},r={}){let i=getComputedStyle(t),o=i.transform==="none"?"":i.transform,[a,u]=i.transformOrigin.split(" ").map(parseFloat),f=e.left+e.width*a/n.width-(n.left+a),c=e.top+e.height*u/n.height-(n.top+u),{delay:p=0,duration:h=_=>Math.sqrt(_)*120,easing:m=Xf}=r;return{delay:p,duration:$t(h)?h(Math.sqrt(f*f+c*c)):h,easing:m,css:(_,v)=>{let b=v*f,E=v*c,y=_+v*e.width/n.width,O=_+v*e.height/n.height;return`transform: ${o} translate(${b}px, ${E}px) scale(${y}, ${O});`}}}function j6(t){let e,n,r=[t[0],{fill:"currentColor"},{viewBox:"0 0 16 16"}],i={};for(let o=0;o{n(0,e=mn(mn({},e),Zr(r)))},e=Zr(e),[e]}var Ey=class extends ze{constructor(e){super();qe(this,e,B6,j6,Ge,{})}},wh=Ey;function G6(t){let e,n,r=[t[0],{viewBox:"0 0 24 24"},{fill:"currentColor"}],i={};for(let o=0;o{n(0,e=mn(mn({},e),Zr(r)))},e=Zr(e),[e]}var Ty=class extends ze{constructor(e){super();qe(this,e,U6,G6,Ge,{})}},$f=Ty;function z6(t){let e,n,r=[t[0],{viewBox:"0 0 24 24"},{fill:"currentColor"}],i={};for(let o=0;o{n(0,e=mn(mn({},e),Zr(r)))},e=Zr(e),[e]}var Sy=class extends ze{constructor(e){super();qe(this,e,H6,z6,Ge,{})}},bh=Sy;var{Boolean:q6}=of;function V6(t){Et(t,"svelte-1h68wu3",".svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect){position:relative;align-items:center;display:flex;cursor:text;box-sizing:border-box;border:var(--sms-border, 1pt solid lightgray);border-radius:var(--sms-border-radius, 3pt);background:var(--sms-bg);width:var(--sms-width);max-width:var(--sms-max-width);padding:var(--sms-padding, 0 3pt);color:var(--sms-text-color);font-size:var(--sms-font-size, inherit);min-height:var(--sms-min-height, 22pt);margin:var(--sms-margin)}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect.open){z-index:var(--sms-open-z-index, 4)}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect:focus-within){border:var(--sms-focus-border, 1pt solid var(--sms-active-color, cornflowerblue))}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect.disabled){background:var(--sms-disabled-bg, lightgray);cursor:not-allowed}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.selected){display:flex;flex:1;padding:0;margin:0;flex-wrap:wrap}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.selected > li){align-items:center;border-radius:3pt;display:flex;margin:2pt;line-height:normal;transition:0.3s;white-space:nowrap;background:var(--sms-selected-bg, rgba(0, 0, 0, 0.15));padding:var(--sms-selected-li-padding, 1pt 5pt);color:var(--sms-selected-text-color, var(--sms-text-color))}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.selected > li[draggable='true']){cursor:grab}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.selected > li.active){background:var(--sms-li-active-bg, var(--sms-active-color, rgba(0, 0, 0, 0.15)))}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect button){border-radius:50%;display:flex;transition:0.2s;color:inherit;background:transparent;border:none;cursor:pointer;outline:none;padding:0;margin:0 0 0 3pt}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect button.remove-all){margin:0 3pt}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(ul.selected > li button:hover, button.remove-all:hover, button:focus){color:var(--sms-remove-btn-hover-color, lightskyblue);background:var(--sms-remove-btn-hover-bg, rgba(0, 0, 0, 0.2))}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect input){margin:auto 0;padding:0}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.selected > input){border:none;outline:none;background:none;flex:1;min-width:2em;color:var(--sms-text-color);font-size:inherit;cursor:inherit;border-radius:0}div.multiselect.svelte-1h68wu3>ul.selected.svelte-1h68wu3>input.svelte-1h68wu3::placeholder{padding-left:5pt;color:var(--sms-placeholder-color);opacity:var(--sms-placeholder-opacity)}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > input.form-control){width:2em;position:absolute;background:transparent;border:none;outline:none;z-index:-1;opacity:0;pointer-events:none}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.options){list-style:none;top:100%;left:0;width:100%;position:absolute;overflow:auto;transition:all 0.2s;box-sizing:border-box;background:var(--sms-options-bg, white);max-height:var(--sms-options-max-height, 50vh);overscroll-behavior:var(--sms-options-overscroll, none);box-shadow:var(--sms-options-shadow, 0 0 14pt -8pt black);border:var(--sms-options-border);border-width:var(--sms-options-border-width);border-radius:var(--sms-options-border-radius, 1ex);padding:var(--sms-options-padding);margin:var(--sms-options-margin, inherit)}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.options.hidden){visibility:hidden;opacity:0;transform:translateY(50px)}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.options > li){padding:3pt 2ex;cursor:pointer;scroll-margin:var(--sms-options-scroll-margin, 100px)}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.options span){padding:3pt 2ex}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.options > li.selected){background:var(--sms-li-selected-bg);color:var(--sms-li-selected-color)}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.options > li.active){background:var(--sms-li-active-bg, var(--sms-active-color, rgba(0, 0, 0, 0.15)))}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.options > li.disabled){cursor:not-allowed;background:var(--sms-li-disabled-bg, #f5f5f6);color:var(--sms-li-disabled-text, #b8b8b8)}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(span.max-select-msg){padding:0 3pt}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3::highlight(search-results){color:var(--sms-highlight-color, orange);background:var(--sms-highlight-bg);text-decoration:var(--sms-highlight-text-decoration);text-decoration-color:var(--sms-highlight-text-decoration-color)}")}function Cy(t,e,n){let r=t.slice();r[111]=e[n],r[118]=n;let i=r[111]instanceof Object?r[111]:{label:r[111]};r[112]=i.label,r[41]=i.disabled!==void 0?i.disabled:null,r[113]=i.title!==void 0?i.title:null,r[114]=i.selectedTitle!==void 0?i.selectedTitle:null,r[115]=i.disabledTitle!==void 0?i.disabledTitle:r[13];let o=r[0]===r[118];return r[116]=o,r}var K6=t=>({option:t[0]&2}),Dy=t=>({option:t[111],idx:t[118]}),Z6=t=>({}),Oy=t=>({}),X6=t=>({}),My=t=>({}),J6=t=>({}),Ay=t=>({});function Py(t,e,n){let r=t.slice();return r[111]=e[n],r[118]=n,r}var Q6=t=>({}),Ny=t=>({}),$6=t=>({option:t[0]&16,idx:t[0]&16}),xy=t=>({option:t[111],idx:t[118]}),eP=t=>({open:t[0]&256}),Iy=t=>({open:t[8]});function tP(t){let e,n;return e=new wh({props:{width:"15px",style:"min-width: 1em; padding: 0 1pt; cursor: pointer;"}}),{c(){ct(e.$$.fragment)},m(r,i){ut(e,r,i),n=!0},p:me,i(r){n||(se(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){st(e,r)}}}function nP(t){let e=t[48](t[111])+"",n;return{c(){n=Me(e)},m(r,i){G(r,n,i)},p(r,i){i[0]&16&&e!==(e=r[48](r[111])+"")&&Ye(n,e)},d(r){r&&B(n)}}}function rP(t){let e,n=t[48](t[111])+"",r;return{c(){e=new Xu(!1),r=zt(),e.a=r},m(i,o){e.m(n,i,o),G(i,r,o)},p(i,o){o[0]&16&&n!==(n=i[48](i[111])+"")&&e.p(n)},d(i){i&&B(r),i&&e.d()}}}function iP(t){let e;function n(o,a){return o[31]?rP:nP}let r=n(t,[-1,-1,-1,-1]),i=r(t);return{c(){i.c(),e=zt()},m(o,a){i.m(o,a),G(o,e,a)},p(o,a){r===(r=n(o,a))&&i?i.p(o,a):(i.d(1),i=r(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&B(e)}}}function Ry(t){let e,n,r,i,o,a=t[69]["remove-icon"],u=Hr(a,t,t[108],Ny),f=u||oP(t);function c(){return t[89](t[111])}function p(){return t[90](t[111])}return{c(){e=N("button"),f&&f.c(),k(e,"type","button"),k(e,"title",n=""+(t[35]+" "+t[48](t[111]))),k(e,"class","remove svelte-1h68wu3")},m(h,m){G(h,e,m),f&&f.m(e,null),r=!0,i||(o=[oe(e,"mouseup",si(c)),oe(e,"keydown",function(){$t(t[54](p))&&t[54](p).apply(this,arguments)})],i=!0)},p(h,m){t=h,u&&u.p&&(!r||m[3]&32768)&&Vr(u,a,t,t[108],r?qr(a,t[108],m,Q6):Kr(t[108]),Ny),(!r||m[0]&16|m[1]&16&&n!==(n=""+(t[35]+" "+t[48](t[111]))))&&k(e,"title",n)},i(h){r||(se(f,h),r=!0)},o(h){de(f,h),r=!1},d(h){h&&B(e),f&&f.d(h),i=!1,We(o)}}}function oP(t){let e,n;return e=new $f({props:{width:"15px"}}),{c(){ct(e.$$.fragment)},m(r,i){ut(e,r,i),n=!0},p:me,i(r){n||(se(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){st(e,r)}}}function Ly(t,e){let n,r,i,o,a,u=me,f,c,p,h=e[69].selected,m=Hr(h,e,e[108],xy),_=m||iP(e),v=!e[41]&&(e[36]===null||e[4].length>e[36])&&Ry(e);function b(){return e[91](e[118])}return{key:t,first:null,c(){n=N("li"),_&&_.c(),r=$(),v&&v.c(),k(n,"class",i=""+(en(e[23])+" svelte-1h68wu3")),k(n,"draggable",o=e[38]&&!e[41]&&e[4].length>1),we(n,"active",e[45]===e[118]),this.first=n},m(E,y){G(E,n,y),_&&_.m(n,null),A(n,r),v&&v.m(n,null),f=!0,c||(p=[oe(n,"dragstart",function(){$t(e[57](e[118]))&&e[57](e[118]).apply(this,arguments)}),oe(n,"drop",oi(function(){$t(e[56](e[118]))&&e[56](e[118]).apply(this,arguments)})),oe(n,"dragenter",b),oe(n,"dragover",oi(e[85]))],c=!0)},p(E,y){e=E,m?m.p&&(!f||y[0]&16|y[3]&32768)&&Vr(m,h,e,e[108],f?qr(h,e[108],y,$6):Kr(e[108]),xy):_&&_.p&&(!f||y[0]&16|y[1]&1)&&_.p(e,f?y:[-1,-1,-1,-1]),!e[41]&&(e[36]===null||e[4].length>e[36])?v?(v.p(e,y),y[0]&16|y[1]&1056&&se(v,1)):(v=Ry(e),v.c(),se(v,1),v.m(n,null)):v&&(Je(),de(v,1,1,()=>{v=null}),Qe()),(!f||y[0]&8388608&&i!==(i=""+(en(e[23])+" svelte-1h68wu3")))&&k(n,"class",i),(!f||y[0]&16|y[1]&1152&&o!==(o=e[38]&&!e[41]&&e[4].length>1))&&k(n,"draggable",o),(!f||y[0]&8388624|y[1]&16384)&&we(n,"active",e[45]===e[118])},r(){a=n.getBoundingClientRect()},f(){P1(n),u()},a(){u(),u=A1(n,a,ky,{duration:100})},i(E){f||(se(_,E),se(v),f=!0)},o(E){de(_,E),de(v),f=!1},d(E){E&&B(n),_&&_.d(E),v&&v.d(),c=!1,We(p)}}}function Fy(t){let e,n=t[69].spinner,r=Hr(n,t,t[108],Ay),i=r||sP(t);return{c(){i&&i.c()},m(o,a){i&&i.m(o,a),e=!0},p(o,a){r&&r.p&&(!e||a[3]&32768)&&Vr(r,n,o,o[108],e?qr(n,o[108],a,J6):Kr(o[108]),Ay)},i(o){e||(se(i,o),e=!0)},o(o){de(i,o),e=!1},d(o){i&&i.d(o)}}}function sP(t){let e,n;return e=new yh({}),{c(){ct(e.$$.fragment)},m(r,i){ut(e,r,i),n=!0},i(r){n||(se(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){st(e,r)}}}function aP(t){let e,n,r,i=t[25]&&(t[25]>1||t[26])&&Yy(t),o=t[25]!==1&&t[4].length>1&&Wy(t);return{c(){i&&i.c(),e=$(),o&&o.c(),n=zt()},m(a,u){i&&i.m(a,u),G(a,e,u),o&&o.m(a,u),G(a,n,u),r=!0},p(a,u){a[25]&&(a[25]>1||a[26])?i?(i.p(a,u),u[0]&100663296&&se(i,1)):(i=Yy(a),i.c(),se(i,1),i.m(e.parentNode,e)):i&&(Je(),de(i,1,1,()=>{i=null}),Qe()),a[25]!==1&&a[4].length>1?o?(o.p(a,u),u[0]&33554448&&se(o,1)):(o=Wy(a),o.c(),se(o,1),o.m(n.parentNode,n)):o&&(Je(),de(o,1,1,()=>{o=null}),Qe())},i(a){r||(se(i),se(o),r=!0)},o(a){de(i),de(o),r=!1},d(a){i&&i.d(a),a&&B(e),o&&o.d(a),a&&B(n)}}}function lP(t){let e,n=t[69]["disabled-icon"],r=Hr(n,t,t[108],My),i=r||cP(t);return{c(){i&&i.c()},m(o,a){i&&i.m(o,a),e=!0},p(o,a){r&&r.p&&(!e||a[3]&32768)&&Vr(r,n,o,o[108],e?qr(n,o[108],a,X6):Kr(o[108]),My)},i(o){e||(se(i,o),e=!0)},o(o){de(i,o),e=!1},d(o){i&&i.d(o)}}}function Yy(t){let e,n,r;function i(a){t[94](a)}let o={angle:20,$$slots:{default:[uP]},$$scope:{ctx:t}};return t[42]!==void 0&&(o.wiggle=t[42]),e=new kh({props:o}),Ne.push(()=>tt(e,"wiggle",i)),{c(){ct(e.$$.fragment)},m(a,u){ut(e,a,u),r=!0},p(a,u){let f={};u[0]&234881040|u[3]&32768&&(f.$$scope={dirty:u,ctx:a}),!n&&u[1]&2048&&(n=!0,f.wiggle=a[42],et(()=>n=!1)),e.$set(f)},i(a){r||(se(e.$$.fragment,a),r=!0)},o(a){de(e.$$.fragment,a),r=!1},d(a){st(e,a)}}}function uP(t){var o;let e,n=((o=t[26])==null?void 0:o.call(t,t[4].length,t[25]))+"",r,i;return{c(){e=N("span"),r=Me(n),k(e,"class",i="max-select-msg "+t[27]+" svelte-1h68wu3")},m(a,u){G(a,e,u),A(e,r)},p(a,u){var f;u[0]&100663312&&n!==(n=((f=a[26])==null?void 0:f.call(a,a[4].length,a[25]))+"")&&Ye(r,n),u[0]&134217728&&i!==(i="max-select-msg "+a[27]+" svelte-1h68wu3")&&k(e,"class",i)},d(a){a&&B(e)}}}function Wy(t){let e,n,r,i,o=t[69]["remove-icon"],a=Hr(o,t,t[108],Oy),u=a||fP(t);return{c(){e=N("button"),u&&u.c(),k(e,"type","button"),k(e,"class","remove remove-all svelte-1h68wu3"),k(e,"title",t[34])},m(f,c){G(f,e,c),u&&u.m(e,null),n=!0,r||(i=[oe(e,"mouseup",si(t[53])),oe(e,"keydown",t[54](t[53]))],r=!0)},p(f,c){a&&a.p&&(!n||c[3]&32768)&&Vr(a,o,f,f[108],n?qr(o,f[108],c,Z6):Kr(f[108]),Oy),(!n||c[1]&8)&&k(e,"title",f[34])},i(f){n||(se(u,f),n=!0)},o(f){de(u,f),n=!1},d(f){f&&B(e),u&&u.d(f),r=!1,We(i)}}}function fP(t){let e,n;return e=new $f({props:{width:"15px"}}),{c(){ct(e.$$.fragment)},m(r,i){ut(e,r,i),n=!0},p:me,i(r){n||(se(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){st(e,r)}}}function cP(t){let e,n;return e=new bh({props:{width:"14pt",style:"margin: 0 2pt;","data-name":"disabled-icon"}}),{c(){ct(e.$$.fragment)},m(r,i){ut(e,r,i),n=!0},p:me,i(r){n||(se(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){st(e,r)}}}function jy(t){let e,n,r,i=t[1],o=[];for(let f=0;fde(o[f],1,1,()=>{o[f]=null}),u=null;return i.length||(u=By(t)),{c(){e=N("ul");for(let f=0;fY[48](Y[111]);for(let Y=0;Y0?1:-1}~(O=U(t,[-1,-1,-1,-1]))&&(D=j[O]=Q[O](t));let J=(t[3]&&t[29]||((re=t[2])==null?void 0:re.length)>0)&&jy(t);return{c(){e=N("div"),n=N("input"),o=$(),X&&X.c(),a=$(),u=N("ul");for(let Y=0;Y=t[37]?JSON.stringify(t[4]):null,k(n,"tabindex","-1"),k(n,"aria-hidden","true"),k(n,"aria-label","ignore this, used only to prevent form submission if select is required but empty"),k(n,"class","form-control svelte-1h68wu3"),k(h,"class",m=""+(en(t[19])+" svelte-1h68wu3")),k(h,"id",t[18]),h.disabled=t[41],k(h,"autocomplete",t[12]),k(h,"inputmode",t[20]),k(h,"pattern",t[32]),k(h,"placeholder",_=t[4].length==0?t[33]:null),k(h,"aria-invalid",v=t[7]?"true":null),k(h,"ondrop","return false"),k(u,"class",b="selected "+t[40]+" svelte-1h68wu3"),k(u,"aria-label","selected options"),k(e,"class",P="multiselect "+t[30]+" svelte-1h68wu3"),k(e,"title",L=t[41]?t[14]:null),k(e,"data-id",t[18]),we(e,"disabled",t[41]),we(e,"single",t[25]===1),we(e,"open",t[8]),we(e,"invalid",t[7])},m(Y,z){G(Y,e,z),A(e,n),t[87](n),A(e,o),X&&X.m(e,null),A(e,a),A(e,u);for(let ee=0;ee=Y[37]?JSON.stringify(Y[4]):null)&&n.value!==i)&&(n.value=i),V&&V.p&&(!R||z[0]&256|z[3]&32768)&&Vr(V,le,Y,Y[108],R?qr(le,Y[108],z,eP):Kr(Y[108]),Iy),z[0]&8388624|z[1]&109724849|z[3]&32768){K=Y[4],Je();for(let Ce=0;Ce{S=null}),Qe());let ee=O;O=U(Y,z),O===ee?~O&&j[O].p(Y,z):(D&&(Je(),de(j[ee],1,1,()=>{j[ee]=null}),Qe()),~O?(D=j[O],D?D.p(Y,z):(D=j[O]=Q[O](Y),D.c()),se(D,1),D.m(e,F)):D=null),Y[3]&&Y[29]||((_e=Y[2])==null?void 0:_e.length)>0?J?(J.p(Y,z),z[0]&536870924&&se(J,1)):(J=jy(Y),J.c(),se(J,1),J.m(e,null)):J&&(Je(),de(J,1,1,()=>{J=null}),Qe()),(!R||z[0]&1073741824&&P!==(P="multiselect "+Y[30]+" svelte-1h68wu3"))&&k(e,"class",P),(!R||z[0]&16384|z[1]&1024&&L!==(L=Y[41]?Y[14]:null))&&k(e,"title",L),(!R||z[0]&262144)&&k(e,"data-id",Y[18]),(!R||z[0]&1073741824|z[1]&1024)&&we(e,"disabled",Y[41]),(!R||z[0]&1107296256)&&we(e,"single",Y[25]===1),(!R||z[0]&1073742080)&&we(e,"open",Y[8]),(!R||z[0]&1073741952)&&we(e,"invalid",Y[7])},i(Y){if(!R){se(X,Y);for(let z=0;z`${Gt(x)}`.toLowerCase()===`${Gt(Be)}`.toLowerCase()}=e,{duplicateOptionMsg:O="This option is already selected"}=e,{duplicates:D=!1}=e,{filterFunc:F=(x,Be)=>Be?`${Gt(x)}`.toLowerCase().includes(Be.toLowerCase()):!0}=e,{focusInputOnSelect:P="desktop"}=e,{form_input:L=null}=e,{highlightMatches:R=!0}=e,{id:M=null}=e,{input:H=null}=e,{inputClass:le=""}=e,{inputmode:V=null}=e,{invalid:X=!1}=e,{liActiveOptionClass:K=""}=e,{liOptionClass:ce=""}=e,{liSelectedClass:S=""}=e,{loading:Q=!1}=e,{matchingOptions:j=[]}=e,{maxSelect:U=null}=e,{maxSelectMsg:J=(x,Be)=>Be>1?`${x}/${Be}`:""}=e,{maxSelectMsgClass:re=""}=e,{name:Y=null}=e,{noMatchingOptionsMsg:z="No matching options"}=e,{open:ee=!1}=e,{options:_e}=e,{outerDiv:Ce=null}=e,{outerDivClass:Fe=""}=e,{parseLabelsAsHtml:je=!1}=e,{pattern:pt=null}=e,{placeholder:ht=null}=e,{removeAllTitle:ge="Remove all"}=e,{removeBtnTitle:Ee="Remove"}=e,{minSelect:vt=null}=e,{required:Ht=!1}=e,{resetFilterOnAdd:mr=!0}=e,{searchText:rt=""}=e,{selected:Ue=(zl=_e==null?void 0:_e.filter(x=>x instanceof Object&&(x==null?void 0:x.preselected)).slice(0,U!=null?U:void 0))!=null?zl:[]}=e,{sortSelected:Vn=!1}=e,{selectedOptionsDraggable:tr=!Vn}=e,{ulOptionsClass:_n=""}=e,{ulSelectedClass:vn=""}=e,{value:Yn=null}=e,Gt=x=>x instanceof Object?(x.label===void 0&&console.error(`MultiSelect option ${JSON.stringify(x)} is an object but has no label key`),x.label):x,Wn=!1;(_e==null?void 0:_e.length)>0||(c||Q||b||p?_e=[]:console.error("MultiSelect received no options")),U!==null&&U<1&&console.error(`MultiSelect's maxSelect must be null or positive integer, got ${U}`),Array.isArray(Ue)||console.error(`MultiSelect's selected prop should always be an array, got ${Ue}`),U&&typeof Ht=="number"&&Ht>U&&console.error(`MultiSelect maxSelect=${U} < required=${Ht}, makes it impossible for users to submit a valid form`),je&&c&&console.warn("Don't combine parseLabelsAsHtml and allowUserOptions. It's susceptible to XSS attacks!"),Vn&&tr&&console.warn("MultiSelect's sortSelected and selectedOptionsDraggable should not be combined as any user re-orderings of selected options will be undone by sortSelected on component re-renders.");let Cn=hl(),yn=!1,jn;if(a!==null&&!j[a])throw`Run time error, activeIndex=${a} is out of bounds, matchingOptions.length=${j.length}`;function Kn(x,Be){U&&U>1&&Ue.length>=U&&n(42,Wn=!0),!isNaN(Number(x))&&typeof Ue.map(Gt)[0]=="number"&&(x=Number(x));let Dt=Ue.some(kt=>y(kt,x));if((U===null||U===1||Ue.lengthGt(Ir)===x);if(!kt&&[!0,"append"].includes(c)&&rt.length>0&&(typeof _e[0]=="object"?kt={label:rt}:(["number","undefined"].includes(typeof _e[0])&&!isNaN(Number(rt))?kt=Number(rt):kt=rt,Cn("create",{option:kt})),c==="append"&&n(2,_e=[..._e,kt])),kt===void 0)throw`Run time error, option with label ${x} not found in options list`;if(mr&&n(3,rt=""),["",void 0,null].includes(kt)){console.error(`MultiSelect: encountered missing option with label ${x} (or option is poorly labeled)`);return}U===1?n(4,Ue=[kt]):(n(4,Ue=[...Ue,kt]),Vn===!0?n(4,Ue=Ue.sort((Ir,Da)=>{let[Ao,ti]=[Gt(Ir),Gt(Da)];return`${Ao}`.localeCompare(`${ti}`)})):typeof Vn=="function"&&n(4,Ue=Ue.sort(Vn))),Ue.length===U?ei(Be):(P===!0||P==="desktop"&&jn>_)&&(H==null||H.focus()),Cn("add",{option:kt}),Cn("change",{option:kt,type:"add"}),n(7,X=!1),L==null||L.setCustomValidity("")}}function Zn(x){if(Ue.length===0)return;let Be=Ue.find(Dt=>Gt(Dt)===x);if(Be===void 0&&c&&(Be=typeof _e[0]=="object"?{label:x}:x),Be===void 0)return console.error(`Multiselect can't remove selected option ${x}, not found in selected list`);n(4,Ue=Ue.filter(Dt=>Gt(Dt)!==x)),n(7,X=!1),L==null||L.setCustomValidity(""),Cn("remove",{option:Be}),Cn("change",{option:Be,type:"remove"})}function Hi(x){b||(n(8,ee=!0),x instanceof FocusEvent||H==null||H.focus(),Cn("open",{event:x}))}function ei(x){n(8,ee=!1),H==null||H.blur(),n(0,a=null),Cn("close",{event:x})}function Oo(x){return te(this,null,function*(){var Be;if(x.key==="Escape"||x.key==="Tab")ei(x),n(3,rt="");else if(x.key==="Enter")if(x.preventDefault(),u){let Dt=Gt(u);Ue.map(Gt).includes(Dt)?Zn(Dt):Kn(Dt,x),n(3,rt="")}else c&&rt.length>0?Kn(rt,x):Hi(x);else if(["ArrowDown","ArrowUp"].includes(x.key)){if(a===null&&j.length>0){n(0,a=0);return}else if(c&&!j.length&&rt.length>0){n(43,yn=!yn);return}else if(a===null)return;x.preventDefault();let Dt=x.key==="ArrowUp"?-1:1;if(n(0,a=(a+Dt)%j.length),a<0&&n(0,a=j.length-1),m){yield ef();let kt=document.querySelector("ul.options > li.active");kt&&((Be=kt.scrollIntoViewIfNeeded)==null||Be.call(kt))}}else x.key==="Backspace"&&Ue.length>0&&!rt?Zn(Ue.map(Gt).at(-1)):j.length>0&&n(0,a=0)})}function Mo(){n(4,Ue=[]),n(3,rt=""),Cn("removeAll",{options:Ue}),Cn("change",{options:Ue,type:"removeAll"})}let ne=x=>Be=>{["Enter","Space"].includes(Be.code)&&(Be.preventDefault(),x())};function De(x){Ce&&!Ce.contains(x.target)&&ei(x)}let bt=null,St=x=>Be=>{if(!Be.dataTransfer)return;Be.dataTransfer.dropEffect="move";let Dt=parseInt(Be.dataTransfer.getData("text/plain")),kt=[...Ue];DtBe=>{!Be.dataTransfer||(Be.dataTransfer.effectAllowed="move",Be.dataTransfer.dropEffect="move",Be.dataTransfer.setData("text/plain",`${x}`))},_i;function ps(x){var Ao;if(!R||typeof CSS=="undefined"||!CSS.highlights)return;CSS.highlights.clear();let Be=(Ao=x==null?void 0:x.target)==null?void 0:Ao.value.trim().toLowerCase();if(!Be)return;let Dt=document.createTreeWalker(_i,NodeFilter.SHOW_TEXT),kt=[],Ir=Dt.nextNode();for(;Ir;)kt.push(Ir),Ir=Dt.nextNode();let Da=kt.map(ti=>{let Oa=ti.textContent.toLowerCase(),Hl=[],_s=0;for(;_s{let Po=new Range;return Po.setStart(ti,vi),Po.setEnd(ti,vi+Be.length),Po})});CSS.highlights.set("search-results",new Highlight(...Da.flat()))}function hs(x){Mn.call(this,t,x)}function Tc(x){Mn.call(this,t,x)}function Sc(x){Mn.call(this,t,x)}function Cc(x){Mn.call(this,t,x)}function Dc(x){Mn.call(this,t,x)}function Wl(x){Mn.call(this,t,x)}function Oc(x){Mn.call(this,t,x)}function Mc(x){Mn.call(this,t,x)}function Ac(x){Mn.call(this,t,x)}function Sa(x){Mn.call(this,t,x)}function Pc(x){Mn.call(this,t,x)}function Ca(x){Mn.call(this,t,x)}function Nc(x){Mn.call(this,t,x)}function xc(x){Mn.call(this,t,x)}function Ic(x){Mn.call(this,t,x)}function Rc(x){Mn.call(this,t,x)}function Lc(){n(44,jn=window.innerWidth)}function Fc(x){Ne[x?"unshift":"push"](()=>{L=x,n(5,L)})}let Yc=()=>{n(7,X=!0);let x;U&&U>1&&Ht>1?x=`Please select between ${Ht} and ${U} options`:Ht>1?x=`Please select at least ${Ht} options`:x="Please select an option",L==null||L.setCustomValidity(x)},Wc=x=>Zn(Gt(x)),jl=x=>Zn(Gt(x)),jc=x=>n(45,bt=x);function Bc(x){Ne[x?"unshift":"push"](()=>{H=x,n(6,H)})}function Gc(){rt=this.value,n(3,rt)}function Uc(x){Wn=x,n(42,Wn)}let zc=(x,Be,Dt)=>{x||Kn(Be,Dt)},Hc=(x,Be)=>{x||n(0,a=Be)},ms=(x,Be)=>{x||n(0,a=Be)},qc=()=>n(0,a=null),gs=()=>n(0,a=null),Vc=x=>y(x,rt),Kc=x=>Kn(rt,x),Zc=()=>n(43,yn=!0),Bl=()=>n(43,yn=!0),Gl=()=>n(43,yn=!1),Ul=()=>n(43,yn=!1);function Xc(x){Ne[x?"unshift":"push"](()=>{_i=x,n(46,_i)})}function Jc(x){Ne[x?"unshift":"push"](()=>{Ce=x,n(9,Ce)})}return t.$$set=x=>{"activeIndex"in x&&n(0,a=x.activeIndex),"activeOption"in x&&n(59,u=x.activeOption),"createOptionMsg"in x&&n(10,f=x.createOptionMsg),"allowUserOptions"in x&&n(11,c=x.allowUserOptions),"allowEmpty"in x&&n(61,p=x.allowEmpty),"autocomplete"in x&&n(12,h=x.autocomplete),"autoScroll"in x&&n(62,m=x.autoScroll),"breakpoint"in x&&n(63,_=x.breakpoint),"defaultDisabledTitle"in x&&n(13,v=x.defaultDisabledTitle),"disabled"in x&&n(41,b=x.disabled),"disabledInputTitle"in x&&n(14,E=x.disabledInputTitle),"duplicateFunc"in x&&n(15,y=x.duplicateFunc),"duplicateOptionMsg"in x&&n(16,O=x.duplicateOptionMsg),"duplicates"in x&&n(17,D=x.duplicates),"filterFunc"in x&&n(64,F=x.filterFunc),"focusInputOnSelect"in x&&n(65,P=x.focusInputOnSelect),"form_input"in x&&n(5,L=x.form_input),"highlightMatches"in x&&n(66,R=x.highlightMatches),"id"in x&&n(18,M=x.id),"input"in x&&n(6,H=x.input),"inputClass"in x&&n(19,le=x.inputClass),"inputmode"in x&&n(20,V=x.inputmode),"invalid"in x&&n(7,X=x.invalid),"liActiveOptionClass"in x&&n(21,K=x.liActiveOptionClass),"liOptionClass"in x&&n(22,ce=x.liOptionClass),"liSelectedClass"in x&&n(23,S=x.liSelectedClass),"loading"in x&&n(24,Q=x.loading),"matchingOptions"in x&&n(1,j=x.matchingOptions),"maxSelect"in x&&n(25,U=x.maxSelect),"maxSelectMsg"in x&&n(26,J=x.maxSelectMsg),"maxSelectMsgClass"in x&&n(27,re=x.maxSelectMsgClass),"name"in x&&n(28,Y=x.name),"noMatchingOptionsMsg"in x&&n(29,z=x.noMatchingOptionsMsg),"open"in x&&n(8,ee=x.open),"options"in x&&n(2,_e=x.options),"outerDiv"in x&&n(9,Ce=x.outerDiv),"outerDivClass"in x&&n(30,Fe=x.outerDivClass),"parseLabelsAsHtml"in x&&n(31,je=x.parseLabelsAsHtml),"pattern"in x&&n(32,pt=x.pattern),"placeholder"in x&&n(33,ht=x.placeholder),"removeAllTitle"in x&&n(34,ge=x.removeAllTitle),"removeBtnTitle"in x&&n(35,Ee=x.removeBtnTitle),"minSelect"in x&&n(36,vt=x.minSelect),"required"in x&&n(37,Ht=x.required),"resetFilterOnAdd"in x&&n(67,mr=x.resetFilterOnAdd),"searchText"in x&&n(3,rt=x.searchText),"selected"in x&&n(4,Ue=x.selected),"sortSelected"in x&&n(68,Vn=x.sortSelected),"selectedOptionsDraggable"in x&&n(38,tr=x.selectedOptionsDraggable),"ulOptionsClass"in x&&n(39,_n=x.ulOptionsClass),"ulSelectedClass"in x&&n(40,vn=x.ulSelectedClass),"value"in x&&n(60,Yn=x.value),"$$scope"in x&&n(108,o=x.$$scope)},t.$$.update=()=>{var x,Be;if(t.$$.dirty[0]&33554448){e:n(60,Yn=U===1?(x=Ue[0])!=null?x:null:Ue)}if(t.$$.dirty[0]&28|t.$$.dirty[2]&4){e:n(1,j=_e.filter(Dt=>F(Dt,rt)&&!Ue.map(Gt).includes(Gt(Dt))))}if(t.$$.dirty[0]&3){e:n(59,u=(Be=j[a!=null?a:-1])!=null?Be:null)}if(t.$$.dirty[0]&16){e:n(47,r=Dt=>Ue.map(Gt).includes(Dt))}},[a,j,_e,rt,Ue,L,H,X,ee,Ce,f,c,h,v,E,y,O,D,M,le,V,K,ce,S,Q,U,J,re,Y,z,Fe,je,pt,ht,ge,Ee,vt,Ht,tr,_n,vn,b,Wn,yn,jn,bt,_i,r,Gt,Kn,Zn,Hi,Oo,Mo,ne,De,St,nr,ps,u,Yn,p,m,_,F,P,R,mr,Vn,i,hs,Tc,Sc,Cc,Dc,Wl,Oc,Mc,Ac,Sa,Pc,Ca,Nc,xc,Ic,Rc,Lc,Fc,Yc,Wc,jl,jc,Bc,Gc,Uc,zc,Hc,ms,qc,gs,Vc,Kc,Zc,Bl,Gl,Ul,Xc,Jc,o]}var Uy=class extends ze{constructor(e){super();qe(this,e,vP,_P,Ge,{activeIndex:0,activeOption:59,createOptionMsg:10,allowUserOptions:11,allowEmpty:61,autocomplete:12,autoScroll:62,breakpoint:63,defaultDisabledTitle:13,disabled:41,disabledInputTitle:14,duplicateFunc:15,duplicateOptionMsg:16,duplicates:17,filterFunc:64,focusInputOnSelect:65,form_input:5,highlightMatches:66,id:18,input:6,inputClass:19,inputmode:20,invalid:7,liActiveOptionClass:21,liOptionClass:22,liSelectedClass:23,loading:24,matchingOptions:1,maxSelect:25,maxSelectMsg:26,maxSelectMsgClass:27,name:28,noMatchingOptionsMsg:29,open:8,options:2,outerDiv:9,outerDivClass:30,parseLabelsAsHtml:31,pattern:32,placeholder:33,removeAllTitle:34,removeBtnTitle:35,minSelect:36,required:37,resetFilterOnAdd:67,searchText:3,selected:4,sortSelected:68,selectedOptionsDraggable:38,ulOptionsClass:39,ulSelectedClass:40,value:60},V6,[-1,-1,-1,-1])}},ma=Uy;var ga=[];function zy(t,e){return{subscribe:Eh(t,e).subscribe}}function Eh(t,e=me){let n,r=new Set;function i(u){if(Ge(t,u)&&(t=u,n)){let f=!ga.length;for(let c of r)c[1](),ga.push(c,t);if(f){for(let c=0;c{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:i,update:o,subscribe:a}}function Hy(t){return Object.prototype.toString.call(t)==="[object Date]"}function Th(t,e,n,r){if(typeof n=="number"||Hy(n)){let i=r-n,o=(n-e)/(t.dt||1/60),a=t.opts.stiffness*i,u=t.opts.damping*o,f=(a-u)*t.inv_mass,c=(o+f)*t.dt;return Math.abs(c)Th(t,e[o],n[o],r[o]));if(typeof n=="object"){let i={};for(let o in n)i[o]=Th(t,e[o],n[o],r[o]);return i}else throw new Error(`Cannot spring ${typeof n} values`)}}function ec(t,e={}){let n=Eh(t),{stiffness:r=.15,damping:i=.8,precision:o=.01}=e,a,u,f,c=t,p=t,h=1,m=0,_=!1;function v(E,y={}){p=E;let O=f={};if(t==null||y.hard||b.stiffness>=1&&b.damping>=1)return _=!0,a=Us(),c=E,n.set(t=p),Promise.resolve();if(y.soft){let D=y.soft===!0?.5:+y.soft;m=1/(D*60),h=0}return u||(a=Us(),_=!1,u=cl(D=>{if(_)return _=!1,u=null,!1;h=Math.min(h+m,1);let F={inv_mass:h,opts:b,settled:!0,dt:(D-a)*60/1e3},P=Th(F,c,t,p);return a=D,c=t,n.set(t=P),F.settled&&(u=null),!F.settled})),new Promise(D=>{u.promise.then(()=>{O===f&&D()})})}let b={set:v,update:(E,y)=>v(E(p,t),y),subscribe:n.subscribe,stiffness:r,damping:i,precision:o};return b}function yP(t){let e,n=`rotate(${t[0].angle}deg) scale(${t[0].scale}) translate(${t[0].dx}px, - ${t[0].dy}px)`,r,i=t[11].default,o=Hr(i,t,t[10],null);return{c(){e=N("span"),o&&o.c(),he(e,"transform",n)},m(a,u){G(a,e,u),o&&o.m(e,null),r=!0},p(a,[u]){o&&o.p&&(!r||u&1024)&&Vr(o,i,a,a[10],r?qr(i,a[10],u,null):Kr(a[10]),null),u&1&&n!==(n=`rotate(${a[0].angle}deg) scale(${a[0].scale}) translate(${a[0].dx}px, - ${a[0].dy}px)`)&&he(e,"transform",n)},i(a){r||(se(o,a),r=!0)},o(a){de(o,a),r=!1},d(a){a&&B(e),o&&o.d(a)}}}function wP(t,e,n){let r,{$$slots:i={},$$scope:o}=e,{wiggle:a=!1}=e,{angle:u=0}=e,{scale:f=1}=e,{dx:c=0}=e,{dy:p=0}=e,{duration:h=200}=e,{stiffness:m=.05}=e,{damping:_=.1}=e,v={angle:0,scale:1,dx:0,dy:0},b=ec(v,{stiffness:m,damping:_});return Ku(t,b,E=>n(0,r=E)),t.$$set=E=>{"wiggle"in E&&n(2,a=E.wiggle),"angle"in E&&n(3,u=E.angle),"scale"in E&&n(4,f=E.scale),"dx"in E&&n(5,c=E.dx),"dy"in E&&n(6,p=E.dy),"duration"in E&&n(7,h=E.duration),"stiffness"in E&&n(8,m=E.stiffness),"damping"in E&&n(9,_=E.damping),"$$scope"in E&&n(10,o=E.$$scope)},t.$$.update=()=>{if(t.$$.dirty&132){e:a&&setTimeout(()=>n(2,a=!1),h)}if(t.$$.dirty&124){e:b.set(a?{scale:f,angle:u,dx:c,dy:p}:v)}},[r,b,a,u,f,c,p,h,m,_,o,i]}var qy=class extends ze{constructor(e){super();qe(this,e,wP,yP,Ge,{wiggle:2,angle:3,scale:4,dx:5,dy:6,duration:7,stiffness:8,damping:9})}},kh=qy;function bP(t=!0){let e=this,n=new IntersectionObserver(function([r]){let i=r.intersectionRatio;if(i<1){let o=i<=0&&t?"center":"nearest";e.scrollIntoView({block:o,inline:o})}this.disconnect()});return n.observe(this),n}var Vy;typeof Element!="undefined"&&!((Vy=Element.prototype)==null?void 0:Vy.scrollIntoViewIfNeeded)&&typeof IntersectionObserver!="undefined"&&(Element.prototype.scrollIntoViewIfNeeded=bP);function kP(t){Et(t,"svelte-1hozll4",'.switch.svelte-1hozll4.svelte-1hozll4{position:relative;display:inline-block;width:60px;height:34px}.switch.svelte-1hozll4 input.svelte-1hozll4{opacity:0;width:0;height:0}.slider.svelte-1hozll4.svelte-1hozll4{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#99a2a2;-webkit-transition:0.4s;transition:0.4s;border-radius:34px}.slider.svelte-1hozll4.svelte-1hozll4:before{position:absolute;content:"";height:26px;width:26px;left:4px;bottom:4px;background-color:#d7dada;-webkit-transition:0.4s;transition:0.4s;border-radius:50%}input.svelte-1hozll4:checked+.slider.svelte-1hozll4{background-color:#2a4f4f}input.svelte-1hozll4:checked+.slider.svelte-1hozll4{box-shadow:0 0 1px #2a4f4f}input.svelte-1hozll4:checked+.slider.svelte-1hozll4:before{-webkit-transform:translateX(26px);-ms-transform:translateX(26px);transform:translateX(26px)}')}function EP(t){let e,n,r,i,o,a;return{c(){e=N("label"),n=N("input"),r=$(),i=N("span"),k(n,"type","checkbox"),k(n,"class","svelte-1hozll4"),k(i,"class","slider svelte-1hozll4"),k(e,"class","switch svelte-1hozll4")},m(u,f){G(u,e,f),A(e,n),n.checked=t[0],A(e,r),A(e,i),o||(a=oe(n,"change",t[1]),o=!0)},p(u,[f]){f&1&&(n.checked=u[0])},i:me,o:me,d(u){u&&B(e),o=!1,a()}}}function TP(t,e,n){let{checked:r=!1}=e;function i(){r=this.checked,n(0,r)}return t.$$set=o=>{"checked"in o&&n(0,r=o.checked)},[r,i]}var Ky=class extends ze{constructor(e){super();qe(this,e,TP,EP,Ge,{checked:0},kP)}},Sh=Ky;function SP(t){Et(t,"svelte-19a3n3k",".rangeSlider{--pip:var(--range-pip, lightslategray);--pip-text:var(--range-pip-text, var(--pip));--pip-active:var(--range-pip-active, darkslategrey);--pip-active-text:var(--range-pip-active-text, var(--pip-active));--pip-hover:var(--range-pip-hover, darkslategrey);--pip-hover-text:var(--range-pip-hover-text, var(--pip-hover));--pip-in-range:var(--range-pip-in-range, var(--pip-active));--pip-in-range-text:var(--range-pip-in-range-text, var(--pip-active-text))}.rangePips{position:absolute;height:1em;left:0;right:0;bottom:-1em}.rangePips.vertical{height:auto;width:1em;left:100%;right:auto;top:0;bottom:0}.rangePips .pip{height:0.4em;position:absolute;top:0.25em;width:1px;white-space:nowrap}.rangePips.vertical .pip{height:1px;width:0.4em;left:0.25em;top:auto;bottom:auto}.rangePips .pipVal{position:absolute;top:0.4em;transform:translate(-50%, 25%)}.rangePips.vertical .pipVal{position:absolute;top:0;left:0.4em;transform:translate(25%, -50%)}.rangePips .pip{transition:all 0.15s ease}.rangePips .pipVal{transition:all 0.15s ease, font-weight 0s linear}.rangePips .pip{color:lightslategray;color:var(--pip-text);background-color:lightslategray;background-color:var(--pip)}.rangePips .pip.selected{color:darkslategrey;color:var(--pip-active-text);background-color:darkslategrey;background-color:var(--pip-active)}.rangePips.hoverable:not(.disabled) .pip:hover{color:darkslategrey;color:var(--pip-hover-text);background-color:darkslategrey;background-color:var(--pip-hover)}.rangePips .pip.in-range{color:darkslategrey;color:var(--pip-in-range-text);background-color:darkslategrey;background-color:var(--pip-in-range)}.rangePips .pip.selected{height:0.75em}.rangePips.vertical .pip.selected{height:1px;width:0.75em}.rangePips .pip.selected .pipVal{font-weight:bold;top:0.75em}.rangePips.vertical .pip.selected .pipVal{top:0;left:0.75em}.rangePips.hoverable:not(.disabled) .pip:not(.selected):hover{transition:none}.rangePips.hoverable:not(.disabled) .pip:not(.selected):hover .pipVal{transition:none;font-weight:bold}")}function Zy(t,e,n){let r=t.slice();return r[28]=e[n],r[30]=n,r}function Xy(t){let e,n,r,i,o=(t[6]==="label"||t[7]==="label")&&Jy(t);return{c(){e=N("span"),o&&o.c(),k(e,"class","pip first"),k(e,"style",n=""+(t[14]+": 0%;")),we(e,"selected",t[18](t[0])),we(e,"in-range",t[17](t[0]))},m(a,u){G(a,e,u),o&&o.m(e,null),r||(i=[oe(e,"click",function(){$t(t[21](t[0]))&&t[21](t[0]).apply(this,arguments)}),oe(e,"touchend",oi(function(){$t(t[21](t[0]))&&t[21](t[0]).apply(this,arguments)}))],r=!0)},p(a,u){t=a,t[6]==="label"||t[7]==="label"?o?o.p(t,u):(o=Jy(t),o.c(),o.m(e,null)):o&&(o.d(1),o=null),u&16384&&n!==(n=""+(t[14]+": 0%;"))&&k(e,"style",n),u&262145&&we(e,"selected",t[18](t[0])),u&131073&&we(e,"in-range",t[17](t[0]))},d(a){a&&B(e),o&&o.d(),r=!1,We(i)}}}function Jy(t){let e,n=t[12](t[16](t[0]),0,0)+"",r,i=t[10]&&Qy(t),o=t[11]&&$y(t);return{c(){e=N("span"),i&&i.c(),r=Me(n),o&&o.c(),k(e,"class","pipVal")},m(a,u){G(a,e,u),i&&i.m(e,null),A(e,r),o&&o.m(e,null)},p(a,u){a[10]?i?i.p(a,u):(i=Qy(a),i.c(),i.m(e,r)):i&&(i.d(1),i=null),u&69633&&n!==(n=a[12](a[16](a[0]),0,0)+"")&&Ye(r,n),a[11]?o?o.p(a,u):(o=$y(a),o.c(),o.m(e,null)):o&&(o.d(1),o=null)},d(a){a&&B(e),i&&i.d(),o&&o.d()}}}function Qy(t){let e,n;return{c(){e=N("span"),n=Me(t[10]),k(e,"class","pipVal-prefix")},m(r,i){G(r,e,i),A(e,n)},p(r,i){i&1024&&Ye(n,r[10])},d(r){r&&B(e)}}}function $y(t){let e,n;return{c(){e=N("span"),n=Me(t[11]),k(e,"class","pipVal-suffix")},m(r,i){G(r,e,i),A(e,n)},p(r,i){i&2048&&Ye(n,r[11])},d(r){r&&B(e)}}}function ew(t){let e,n=Array(t[20]+1),r=[];for(let i=0;iS}=e,{focus:H=void 0}=e,{orientationStart:le=void 0}=e,{percentOf:V=void 0}=e,{moveHandle:X=void 0}=e,{fixFloat:K=void 0}=e;function ce(S){E||X(void 0,S)}return t.$$set=S=>{"range"in S&&n(22,f=S.range),"min"in S&&n(0,c=S.min),"max"in S&&n(1,p=S.max),"step"in S&&n(23,h=S.step),"values"in S&&n(24,m=S.values),"vertical"in S&&n(2,_=S.vertical),"reversed"in S&&n(3,v=S.reversed),"hoverable"in S&&n(4,b=S.hoverable),"disabled"in S&&n(5,E=S.disabled),"pipstep"in S&&n(25,y=S.pipstep),"all"in S&&n(6,O=S.all),"first"in S&&n(7,D=S.first),"last"in S&&n(8,F=S.last),"rest"in S&&n(9,P=S.rest),"prefix"in S&&n(10,L=S.prefix),"suffix"in S&&n(11,R=S.suffix),"formatter"in S&&n(12,M=S.formatter),"focus"in S&&n(13,H=S.focus),"orientationStart"in S&&n(14,le=S.orientationStart),"percentOf"in S&&n(15,V=S.percentOf),"moveHandle"in S&&n(26,X=S.moveHandle),"fixFloat"in S&&n(16,K=S.fixFloat)},t.$$.update=()=>{if(t.$$.dirty&41943047){e:n(27,r=y||((p-c)/h>=(_?50:100)?(p-c)/(_?10:20):1))}if(t.$$.dirty&142606339){e:n(20,i=parseInt((p-c)/(h*r),10))}if(t.$$.dirty&142671873){e:n(19,o=function(S){return K(c+S*h*r)})}if(t.$$.dirty&16842752){e:n(18,a=function(S){return m.some(Q=>K(Q)===K(S))})}if(t.$$.dirty&20971520){e:n(17,u=function(S){if(f==="min")return m[0]>S;if(f==="max")return m[0]S})}},[c,p,_,v,b,E,O,D,F,P,L,R,M,H,le,V,K,u,a,o,i,ce,f,h,m,y,X,r]}var fw=class extends ze{constructor(e){super();qe(this,e,DP,CP,Ge,{range:22,min:0,max:1,step:23,values:24,vertical:2,reversed:3,hoverable:4,disabled:5,pipstep:25,all:6,first:7,last:8,rest:9,prefix:10,suffix:11,formatter:12,focus:13,orientationStart:14,percentOf:15,moveHandle:26,fixFloat:16},SP)}},cw=fw;function OP(t){Et(t,"svelte-1wc6jll",'.rangeSlider{--slider:var(--range-slider, #d7dada);--handle-inactive:var(--range-handle-inactive, #99a2a2);--handle:var(--range-handle, #838de7);--handle-focus:var(--range-handle-focus, #4a40d4);--handle-border:var(--range-handle-border, var(--handle));--range-inactive:var(--range-range-inactive, var(--handle-inactive));--range:var(--range-range, var(--handle-focus));--float-inactive:var(--range-float-inactive, var(--handle-inactive));--float:var(--range-float, var(--handle-focus));--float-text:var(--range-float-text, white)}.rangeSlider{position:relative;border-radius:100px;height:0.5em;margin:1em;transition:opacity 0.2s ease;user-select:none}.rangeSlider *{user-select:none}.rangeSlider.pips{margin-bottom:1.8em}.rangeSlider.pip-labels{margin-bottom:2.8em}.rangeSlider.vertical{display:inline-block;border-radius:100px;width:0.5em;min-height:200px}.rangeSlider.vertical.pips{margin-right:1.8em;margin-bottom:1em}.rangeSlider.vertical.pip-labels{margin-right:2.8em;margin-bottom:1em}.rangeSlider .rangeHandle{position:absolute;display:block;height:1.4em;width:1.4em;top:0.25em;bottom:auto;transform:translateY(-50%) translateX(-50%);outline-offset:2px;outline:2px solid transparent;border-radius:100px;z-index:2}.rangeSlider.reversed .rangeHandle{transform:translateY(-50%) translateX(50%)}.rangeSlider.vertical .rangeHandle{left:0.25em;top:auto;transform:translateY(50%) translateX(-50%)}.rangeSlider.vertical.reversed .rangeHandle{transform:translateY(-50%) translateX(-50%)}.rangeSlider .rangeNub,.rangeSlider .rangeHandle:before{position:absolute;left:0;top:0;display:block;border-radius:10em;height:100%;width:100%;transition:box-shadow 0.2s ease}.rangeSlider .rangeHandle:before{content:"";left:1px;top:1px;bottom:1px;right:1px;height:auto;width:auto;box-shadow:0 0 0 0px var(--handle-border);opacity:0}.rangeSlider.hoverable:not(.disabled) .rangeHandle:hover:before{box-shadow:0 0 0 8px var(--handle-border);opacity:0.2}.rangeSlider.hoverable:not(.disabled) .rangeHandle.press:before,.rangeSlider.hoverable:not(.disabled) .rangeHandle.press:hover:before{box-shadow:0 0 0 12px var(--handle-border);opacity:0.4}.rangeSlider.range .rangeNub{border-radius:10em 10em 10em 1.6em}.rangeSlider.range.min .rangeNub{border-radius:10em 1.6em 10em 10em}.rangeSlider.range .rangeHandle:nth-of-type(1) .rangeNub{transform:rotate(-135deg)}.rangeSlider.range .rangeHandle:nth-of-type(2) .rangeNub{transform:rotate(45deg)}.rangeSlider.range.reversed .rangeHandle:nth-of-type(1) .rangeNub{transform:rotate(45deg)}.rangeSlider.range.reversed .rangeHandle:nth-of-type(2) .rangeNub{transform:rotate(-135deg)}.rangeSlider.range.vertical .rangeHandle:nth-of-type(1) .rangeNub{transform:rotate(135deg)}.rangeSlider.range.vertical .rangeHandle:nth-of-type(2) .rangeNub{transform:rotate(-45deg)}.rangeSlider.range.vertical.reversed .rangeHandle:nth-of-type(1) .rangeNub{transform:rotate(-45deg)}.rangeSlider.range.vertical.reversed .rangeHandle:nth-of-type(2) .rangeNub{transform:rotate(135deg)}.rangeSlider .rangeFloat{display:block;position:absolute;left:50%;top:-0.5em;transform:translate(-50%, -100%);font-size:1em;text-align:center;opacity:0;pointer-events:none;white-space:nowrap;transition:all 0.2s ease;font-size:0.9em;padding:0.2em 0.4em;border-radius:0.2em}.rangeSlider .rangeHandle.active .rangeFloat,.rangeSlider.hoverable .rangeHandle:hover .rangeFloat{opacity:1;top:-0.2em;transform:translate(-50%, -100%)}.rangeSlider .rangeHandle.active:focus-visible .rangeFloat{top:-0.35em}.rangeSlider .rangeBar{position:absolute;display:block;transition:background 0.2s ease;border-radius:1em;height:0.5em;top:0;user-select:none;z-index:1}.rangeSlider.vertical .rangeBar{width:0.5em;height:auto}.rangeSlider{background-color:#d7dada;background-color:var(--slider)}.rangeSlider .rangeBar{background-color:#99a2a2;background-color:var(--range-inactive)}.rangeSlider.focus .rangeBar{background-color:#838de7;background-color:var(--range)}.rangeSlider .rangeNub{background-color:#99a2a2;background-color:var(--handle-inactive)}.rangeSlider.focus .rangeNub{background-color:#838de7;background-color:var(--handle)}.rangeSlider .rangeHandle.active .rangeNub{background-color:#4a40d4;background-color:var(--handle-focus)}.rangeSlider .rangeFloat{color:white;color:var(--float-text);background-color:#99a2a2;background-color:var(--float-inactive)}.rangeSlider.focus .rangeFloat{background-color:#4a40d4;background-color:var(--float)}.rangeSlider.disabled{opacity:0.5}.rangeSlider.disabled .rangeNub{background-color:#d7dada;background-color:var(--slider)}.rangeSlider .rangeHandle:focus{outline:none}.rangeSlider .rangeHandle:focus-visible{outline:2px solid #334}@supports not selector(:focus-visible){.rangeSlider .rangeHandle:focus{outline:1px solid #334;outline-offset:1px}}')}function dw(t,e,n){let r=t.slice();return r[64]=e[n],r[66]=n,r}function pw(t){let e,n=t[21](t[64],t[66],t[23](t[64]))+"",r,i=t[18]&&hw(t),o=t[19]&&mw(t);return{c(){e=N("span"),i&&i.c(),r=Me(n),o&&o.c(),k(e,"class","rangeFloat")},m(a,u){G(a,e,u),i&&i.m(e,null),A(e,r),o&&o.m(e,null)},p(a,u){a[18]?i?i.p(a,u):(i=hw(a),i.c(),i.m(e,r)):i&&(i.d(1),i=null),u[0]&10485761&&n!==(n=a[21](a[64],a[66],a[23](a[64]))+"")&&Ye(r,n),a[19]?o?o.p(a,u):(o=mw(a),o.c(),o.m(e,null)):o&&(o.d(1),o=null)},d(a){a&&B(e),i&&i.d(),o&&o.d()}}}function hw(t){let e,n;return{c(){e=N("span"),n=Me(t[18]),k(e,"class","rangeFloat-prefix")},m(r,i){G(r,e,i),A(e,n)},p(r,i){i[0]&262144&&Ye(n,r[18])},d(r){r&&B(e)}}}function mw(t){let e,n;return{c(){e=N("span"),n=Me(t[19]),k(e,"class","rangeFloat-suffix")},m(r,i){G(r,e,i),A(e,n)},p(r,i){i[0]&524288&&Ye(n,r[19])},d(r){r&&B(e)}}}function gw(t){let e,n,r,i,o,a,u,f,c,p,h,m,_,v=t[7]&&pw(t);return{c(){e=N("span"),n=N("span"),r=$(),v&&v.c(),k(n,"class","rangeNub"),k(e,"role","slider"),k(e,"class","rangeHandle"),k(e,"data-handle",i=t[66]),k(e,"style",o=""+(t[28]+": "+t[29][t[66]]+"%; z-index: "+(t[26]===t[66]?3:2)+";")),k(e,"aria-valuemin",a=t[2]===!0&&t[66]===1?t[0][0]:t[3]),k(e,"aria-valuemax",u=t[2]===!0&&t[66]===0?t[0][1]:t[4]),k(e,"aria-valuenow",f=t[64]),k(e,"aria-valuetext",c=""+(t[18]+t[21](t[64],t[66],t[23](t[64]))+t[19])),k(e,"aria-orientation",p=t[6]?"vertical":"horizontal"),k(e,"aria-disabled",t[10]),k(e,"disabled",t[10]),k(e,"tabindex",h=t[10]?-1:0),we(e,"active",t[24]&&t[26]===t[66]),we(e,"press",t[25]&&t[26]===t[66])},m(b,E){G(b,e,E),A(e,n),A(e,r),v&&v.m(e,null),m||(_=[oe(e,"blur",t[34]),oe(e,"focus",t[35]),oe(e,"keydown",t[36])],m=!0)},p(b,E){b[7]?v?v.p(b,E):(v=pw(b),v.c(),v.m(e,null)):v&&(v.d(1),v=null),E[0]&872415232&&o!==(o=""+(b[28]+": "+b[29][b[66]]+"%; z-index: "+(b[26]===b[66]?3:2)+";"))&&k(e,"style",o),E[0]&13&&a!==(a=b[2]===!0&&b[66]===1?b[0][0]:b[3])&&k(e,"aria-valuemin",a),E[0]&21&&u!==(u=b[2]===!0&&b[66]===0?b[0][1]:b[4])&&k(e,"aria-valuemax",u),E[0]&1&&f!==(f=b[64])&&k(e,"aria-valuenow",f),E[0]&11272193&&c!==(c=""+(b[18]+b[21](b[64],b[66],b[23](b[64]))+b[19]))&&k(e,"aria-valuetext",c),E[0]&64&&p!==(p=b[6]?"vertical":"horizontal")&&k(e,"aria-orientation",p),E[0]&1024&&k(e,"aria-disabled",b[10]),E[0]&1024&&k(e,"disabled",b[10]),E[0]&1024&&h!==(h=b[10]?-1:0)&&k(e,"tabindex",h),E[0]&83886080&&we(e,"active",b[24]&&b[26]===b[66]),E[0]&100663296&&we(e,"press",b[25]&&b[26]===b[66])},d(b){b&&B(e),v&&v.d(),m=!1,We(_)}}}function _w(t){let e,n;return{c(){e=N("span"),k(e,"class","rangeBar"),k(e,"style",n=""+(t[28]+": "+t[32](t[29])+"%; "+t[27]+": "+t[33](t[29])+"%;"))},m(r,i){G(r,e,i)},p(r,i){i[0]&939524096&&n!==(n=""+(r[28]+": "+r[32](r[29])+"%; "+r[27]+": "+r[33](r[29])+"%;"))&&k(e,"style",n)},d(r){r&&B(e)}}}function vw(t){let e,n;return e=new cw({props:{values:t[0],min:t[3],max:t[4],step:t[5],range:t[2],vertical:t[6],reversed:t[8],orientationStart:t[28],hoverable:t[9],disabled:t[10],all:t[13],first:t[14],last:t[15],rest:t[16],pipstep:t[12],prefix:t[18],suffix:t[19],formatter:t[20],focus:t[24],percentOf:t[23],moveHandle:t[31],fixFloat:t[30]}}),{c(){ct(e.$$.fragment)},m(r,i){ut(e,r,i),n=!0},p(r,i){let o={};i[0]&1&&(o.values=r[0]),i[0]&8&&(o.min=r[3]),i[0]&16&&(o.max=r[4]),i[0]&32&&(o.step=r[5]),i[0]&4&&(o.range=r[2]),i[0]&64&&(o.vertical=r[6]),i[0]&256&&(o.reversed=r[8]),i[0]&268435456&&(o.orientationStart=r[28]),i[0]&512&&(o.hoverable=r[9]),i[0]&1024&&(o.disabled=r[10]),i[0]&8192&&(o.all=r[13]),i[0]&16384&&(o.first=r[14]),i[0]&32768&&(o.last=r[15]),i[0]&65536&&(o.rest=r[16]),i[0]&4096&&(o.pipstep=r[12]),i[0]&262144&&(o.prefix=r[18]),i[0]&524288&&(o.suffix=r[19]),i[0]&1048576&&(o.formatter=r[20]),i[0]&16777216&&(o.focus=r[24]),i[0]&8388608&&(o.percentOf=r[23]),e.$set(o)},i(r){n||(se(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){st(e,r)}}}function MP(t){let e,n,r,i,o,a,u=t[0],f=[];for(let h=0;h{p=null}),Qe()),(!i||m[0]&131072)&&k(e,"id",h[17]),(!i||m[0]&4)&&we(e,"range",h[2]),(!i||m[0]&1024)&&we(e,"disabled",h[10]),(!i||m[0]&512)&&we(e,"hoverable",h[9]),(!i||m[0]&64)&&we(e,"vertical",h[6]),(!i||m[0]&256)&&we(e,"reversed",h[8]),(!i||m[0]&16777216)&&we(e,"focus",h[24]),(!i||m[0]&4)&&we(e,"min",h[2]==="min"),(!i||m[0]&4)&&we(e,"max",h[2]==="max"),(!i||m[0]&2048)&&we(e,"pips",h[11]),(!i||m[0]&122880)&&we(e,"pip-labels",h[13]==="label"||h[14]==="label"||h[15]==="label"||h[16]==="label")},i(h){i||(se(p),i=!0)},o(h){de(p),i=!1},d(h){h&&B(e),At(f,h),c&&c.d(),p&&p.d(),t[50](null),o=!1,We(a)}}}function yw(t){if(!t)return-1;for(var e=0;t=t.previousElementSibling;)e++;return e}function Ch(t){return t.type.includes("touch")?t.touches[0]:t}function AP(t,e,n){let r,i,o,a,u,f,c=me,p=()=>(c(),c=Vu(ht,ne=>n(29,f=ne)),ht);t.$$.on_destroy.push(()=>c());let{slider:h=void 0}=e,{range:m=!1}=e,{pushy:_=!1}=e,{min:v=0}=e,{max:b=100}=e,{step:E=1}=e,{values:y=[(b+v)/2]}=e,{vertical:O=!1}=e,{float:D=!1}=e,{reversed:F=!1}=e,{hoverable:P=!0}=e,{disabled:L=!1}=e,{pips:R=!1}=e,{pipstep:M=void 0}=e,{all:H=void 0}=e,{first:le=void 0}=e,{last:V=void 0}=e,{rest:X=void 0}=e,{id:K=void 0}=e,{prefix:ce=""}=e,{suffix:S=""}=e,{formatter:Q=(ne,De,bt)=>ne}=e,{handleFormatter:j=Q}=e,{precision:U=2}=e,{springValues:J={stiffness:.15,damping:.4}}=e,re=hl(),Y=0,z=!1,ee=!1,_e=!1,Ce=!1,Fe=y.length-1,je,pt,ht,ge=ne=>parseFloat(ne.toFixed(U));function Ee(ne){let De=h.querySelectorAll(".handle"),bt=Array.prototype.includes.call(De,ne),St=Array.prototype.some.call(De,nr=>nr.contains(ne));return bt||St}function vt(ne){return m==="min"||m==="max"?ne.slice(0,1):m?ne.slice(0,2):ne}function Ht(){return h.getBoundingClientRect()}function mr(ne){let De=Ht(),bt=0,St=0,nr=0;O?(bt=ne.clientY-De.top,St=bt/De.height*100,St=F?St:100-St):(bt=ne.clientX-De.left,St=bt/De.width*100,St=F?100-St:St),nr=(b-v)/100*St+v;let _i;return m===!0&&y[0]===y[1]?nr>y[1]?1:0:(_i=y.indexOf([...y].sort((ps,hs)=>Math.abs(nr-ps)-Math.abs(nr-hs))[0]),_i)}function rt(ne){let De=Ht(),bt=0,St=0,nr=0;O?(bt=ne.clientY-De.top,St=bt/De.height*100,St=F?St:100-St):(bt=ne.clientX-De.left,St=bt/De.width*100,St=F?100-St:St),nr=(b-v)/100*St+v,Ue(Fe,nr)}function Ue(ne,De){return De=o(De),typeof ne=="undefined"&&(ne=Fe),m&&(ne===0&&De>y[1]?_?n(0,y[1]=De,y):De=y[1]:ne===1&&Deo(ne))})}function ei(){!L&&re("stop",{activeHandle:Fe,startValue:je,value:y[Fe],values:y.map(ne=>o(ne))})}function Oo(){!L&&re("change",{activeHandle:Fe,startValue:je,previousValue:typeof pt=="undefined"?je:pt,value:y[Fe],values:y.map(ne=>o(ne))})}function Mo(ne){Ne[ne?"unshift":"push"](()=>{h=ne,n(1,h)})}return t.$$set=ne=>{"slider"in ne&&n(1,h=ne.slider),"range"in ne&&n(2,m=ne.range),"pushy"in ne&&n(44,_=ne.pushy),"min"in ne&&n(3,v=ne.min),"max"in ne&&n(4,b=ne.max),"step"in ne&&n(5,E=ne.step),"values"in ne&&n(0,y=ne.values),"vertical"in ne&&n(6,O=ne.vertical),"float"in ne&&n(7,D=ne.float),"reversed"in ne&&n(8,F=ne.reversed),"hoverable"in ne&&n(9,P=ne.hoverable),"disabled"in ne&&n(10,L=ne.disabled),"pips"in ne&&n(11,R=ne.pips),"pipstep"in ne&&n(12,M=ne.pipstep),"all"in ne&&n(13,H=ne.all),"first"in ne&&n(14,le=ne.first),"last"in ne&&n(15,V=ne.last),"rest"in ne&&n(16,X=ne.rest),"id"in ne&&n(17,K=ne.id),"prefix"in ne&&n(18,ce=ne.prefix),"suffix"in ne&&n(19,S=ne.suffix),"formatter"in ne&&n(20,Q=ne.formatter),"handleFormatter"in ne&&n(21,j=ne.handleFormatter),"precision"in ne&&n(45,U=ne.precision),"springValues"in ne&&n(46,J=ne.springValues)},t.$$.update=()=>{if(t.$$.dirty[0]&24){e:n(49,i=function(ne){return ne<=v?v:ne>=b?b:ne})}if(t.$$.dirty[0]&56|t.$$.dirty[1]&262144){e:n(48,o=function(ne){if(ne<=v)return ge(v);if(ne>=b)return ge(b);let De=(ne-v)%E,bt=ne-De;return Math.abs(De)*2>=E&&(bt+=De>0?E:-E),bt=i(bt),ge(bt)})}if(t.$$.dirty[0]&24){e:n(23,r=function(ne){let De=(ne-v)/(b-v)*100;return isNaN(De)||De<=0?0:De>=100?100:ge(De)})}if(t.$$.dirty[0]&12582937|t.$$.dirty[1]&229376){e:Array.isArray(y)||(n(0,y=[(b+v)/2]),console.error("'values' prop should be an Array (https://github.com/simeydotme/svelte-range-slider-pips#slider-props)")),n(0,y=vt(y.map(ne=>o(ne)))),Y!==y.length?p(n(22,ht=ec(y.map(ne=>r(ne)),J))):ht.set(y.map(ne=>r(ne))),n(47,Y=y.length)}if(t.$$.dirty[0]&320){e:n(28,a=O?F?"top":"bottom":F?"right":"left")}if(t.$$.dirty[0]&320){e:n(27,u=O?F?"bottom":"top":F?"left":"right")}},[y,h,m,v,b,E,O,D,F,P,L,R,M,H,le,V,X,K,ce,S,Q,j,ht,r,z,_e,Fe,u,a,f,ge,Ue,Vn,tr,_n,vn,Yn,Gt,Wn,Cn,yn,jn,Kn,Zn,_,U,J,Y,o,i,Mo]}var ww=class extends ze{constructor(e){super();qe(this,e,AP,MP,Ge,{slider:1,range:2,pushy:44,min:3,max:4,step:5,values:0,vertical:6,float:7,reversed:8,hoverable:9,disabled:10,pips:11,pipstep:12,all:13,first:14,last:15,rest:16,id:17,prefix:18,suffix:19,formatter:20,handleFormatter:21,precision:45,springValues:46},OP,[-1,-1,-1])}},_a=ww;var bw=Oe(require("obsidian"));function PP(t){Et(t,"svelte-1665e1",`.settingsContainerOpen.svelte-1665e1{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:5px;border-radius:10px;padding:10px;width:auto;margin-bottom:10px;box-shadow:-5px 5px 3px 3px #161616}.settingsWrapper.svelte-1665e1{display:grid;gap:10px;grid-template-columns:1fr auto}label.svelte-1665e1{display:flex;align-items:center;height:30px;min-width:80px}.rangeSettings.svelte-1665e1{width:300px}.setting.svelte-1665e1{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:5px}.copyButton.svelte-1665e1{filter:saturate(0) - }`)}function kw(t){var Fe,je,pt,ht;let e,n,r,i,o,a,u,f,c=["day","week","year","schedule"].includes(t[0].type),p,h=["day","week","schedule"].includes(t[0].type),m,_=["day","week","schedule"].includes(t[0].type),v,b=["week","schedule"].includes(t[0].type),E,y=["day","week","month","year","schedule","web"].includes(t[0].type),O,D=["year"].includes(t[0].type),F,P,L,R=["web"].includes(t[0].type),M,H=["web"].includes(t[0].type),le,V=["web"].includes(t[0].type),X,K,ce,S=c&&Ew(t),Q=h&&Tw(t),j=_&&Sw(t),U=b&&Cw(t),J=y&&Dw(t),re=D&&Ow(t),Y=t[6]!==void 0&&(((Fe=t[7])==null?void 0:Fe.length)===0||((je=t[6])==null?void 0:je.length)>0)&&Mw(t),z=t[7]!==void 0&&(((pt=t[6])==null?void 0:pt.length)===0||((ht=t[7])==null?void 0:ht.length)>0)&&Aw(t),ee=R&&Pw(t),_e=H&&Nw(t),Ce=V&&xw(t);return{c(){e=N("div"),n=N("label"),n.textContent="Copy to Codeblock",r=$(),i=N("div"),o=N("button"),o.textContent="\u{1F4CB}",a=$(),u=N("button"),u.textContent="x",f=$(),S&&S.c(),p=$(),Q&&Q.c(),m=$(),j&&j.c(),v=$(),U&&U.c(),E=$(),J&&J.c(),O=$(),re&&re.c(),F=$(),Y&&Y.c(),P=$(),z&&z.c(),L=$(),ee&&ee.c(),M=$(),_e&&_e.c(),le=$(),Ce&&Ce.c(),k(n,"for","hourRange"),k(n,"class","svelte-1665e1"),k(o,"class","copyButton svelte-1665e1"),k(i,"class","setting svelte-1665e1"),k(e,"class","settingsWrapper svelte-1665e1")},m(ge,Ee){G(ge,e,Ee),A(e,n),A(e,r),A(e,i),A(i,o),A(i,a),A(i,u),A(e,f),S&&S.m(e,null),A(e,p),Q&&Q.m(e,null),A(e,m),j&&j.m(e,null),A(e,v),U&&U.m(e,null),A(e,E),J&&J.m(e,null),A(e,O),re&&re.m(e,null),A(e,F),Y&&Y.m(e,null),A(e,P),z&&z.m(e,null),A(e,L),ee&&ee.m(e,null),A(e,M),_e&&_e.m(e,null),A(e,le),Ce&&Ce.m(e,null),X=!0,K||(ce=[oe(o,"click",t[14]),oe(u,"click",t[15])],K=!0)},p(ge,Ee){var vt,Ht,mr,rt;Ee&1&&(c=["day","week","year","schedule"].includes(ge[0].type)),c?S?(S.p(ge,Ee),Ee&1&&se(S,1)):(S=Ew(ge),S.c(),se(S,1),S.m(e,p)):S&&(Je(),de(S,1,1,()=>{S=null}),Qe()),Ee&1&&(h=["day","week","schedule"].includes(ge[0].type)),h?Q?(Q.p(ge,Ee),Ee&1&&se(Q,1)):(Q=Tw(ge),Q.c(),se(Q,1),Q.m(e,m)):Q&&(Je(),de(Q,1,1,()=>{Q=null}),Qe()),Ee&1&&(_=["day","week","schedule"].includes(ge[0].type)),_?j?(j.p(ge,Ee),Ee&1&&se(j,1)):(j=Sw(ge),j.c(),se(j,1),j.m(e,v)):j&&(Je(),de(j,1,1,()=>{j=null}),Qe()),Ee&1&&(b=["week","schedule"].includes(ge[0].type)),b?U?(U.p(ge,Ee),Ee&1&&se(U,1)):(U=Cw(ge),U.c(),se(U,1),U.m(e,E)):U&&(Je(),de(U,1,1,()=>{U=null}),Qe()),Ee&1&&(y=["day","week","month","year","schedule","web"].includes(ge[0].type)),y?J?(J.p(ge,Ee),Ee&1&&se(J,1)):(J=Dw(ge),J.c(),se(J,1),J.m(e,O)):J&&(Je(),de(J,1,1,()=>{J=null}),Qe()),Ee&1&&(D=["year"].includes(ge[0].type)),D?re?(re.p(ge,Ee),Ee&1&&se(re,1)):(re=Ow(ge),re.c(),se(re,1),re.m(e,F)):re&&(Je(),de(re,1,1,()=>{re=null}),Qe()),ge[6]!==void 0&&(((vt=ge[7])==null?void 0:vt.length)===0||((Ht=ge[6])==null?void 0:Ht.length)>0)?Y?(Y.p(ge,Ee),Ee&192&&se(Y,1)):(Y=Mw(ge),Y.c(),se(Y,1),Y.m(e,P)):Y&&(Je(),de(Y,1,1,()=>{Y=null}),Qe()),ge[7]!==void 0&&(((mr=ge[6])==null?void 0:mr.length)===0||((rt=ge[7])==null?void 0:rt.length)>0)?z?(z.p(ge,Ee),Ee&192&&se(z,1)):(z=Aw(ge),z.c(),se(z,1),z.m(e,L)):z&&(Je(),de(z,1,1,()=>{z=null}),Qe()),Ee&1&&(R=["web"].includes(ge[0].type)),R?ee?ee.p(ge,Ee):(ee=Pw(ge),ee.c(),ee.m(e,M)):ee&&(ee.d(1),ee=null),Ee&1&&(H=["web"].includes(ge[0].type)),H?_e?_e.p(ge,Ee):(_e=Nw(ge),_e.c(),_e.m(e,le)):_e&&(_e.d(1),_e=null),Ee&1&&(V=["web"].includes(ge[0].type)),V?Ce?Ce.p(ge,Ee):(Ce=xw(ge),Ce.c(),Ce.m(e,null)):Ce&&(Ce.d(1),Ce=null)},i(ge){X||(se(S),se(Q),se(j),se(U),se(J),se(re),se(Y),se(z),X=!0)},o(ge){de(S),de(Q),de(j),de(U),de(J),de(re),de(Y),de(z),X=!1},d(ge){ge&&B(e),S&&S.d(),Q&&Q.d(),j&&j.d(),U&&U.d(),J&&J.d(),re&&re.d(),Y&&Y.d(),z&&z.d(),ee&&ee.d(),_e&&_e.d(),Ce&&Ce.d(),K=!1,We(ce)}}}function Ew(t){let e,n,r,i,o,a;function u(c){t[17](c)}let f={};return t[4]!==void 0&&(f.checked=t[4]),i=new Sh({props:f}),Ne.push(()=>tt(i,"checked",u)),{c(){e=N("label"),e.textContent="Navigation",n=$(),r=N("div"),ct(i.$$.fragment),k(e,"for","navigation"),k(e,"class","svelte-1665e1"),k(r,"class","setting svelte-1665e1")},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),ut(i,r,null),a=!0},p(c,p){let h={};!o&&p&16&&(o=!0,h.checked=c[4],et(()=>o=!1)),i.$set(h)},i(c){a||(se(i.$$.fragment,c),a=!0)},o(c){de(i.$$.fragment,c),a=!1},d(c){c&&B(e),c&&B(n),c&&B(r),st(i)}}}function Tw(t){let e,n,r,i,o,a;function u(c){t[18](c)}let f={};return t[11]!==void 0&&(f.checked=t[11]),i=new Sh({props:f}),Ne.push(()=>tt(i,"checked",u)),{c(){e=N("label"),e.textContent="Show All Day",n=$(),r=N("div"),ct(i.$$.fragment),k(e,"for","allDay"),k(e,"class","svelte-1665e1"),k(r,"class","setting svelte-1665e1")},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),ut(i,r,null),a=!0},p(c,p){let h={};!o&&p&2048&&(o=!0,h.checked=c[11],et(()=>o=!1)),i.$set(h)},i(c){a||(se(i.$$.fragment,c),a=!0)},o(c){de(i.$$.fragment,c),a=!1},d(c){c&&B(e),c&&B(n),c&&B(r),st(i)}}}function Sw(t){let e,n,r,i,o,a;function u(c){t[19](c)}let f={pipstep:4,range:!0,min:0,max:24,step:1,all:"label",pips:!0,float:!0};return t[3]!==void 0&&(f.values=t[3]),i=new _a({props:f}),Ne.push(()=>tt(i,"values",u)),{c(){e=N("label"),e.textContent="Hour Range",n=$(),r=N("div"),ct(i.$$.fragment),k(e,"for","hourRange"),k(e,"class","svelte-1665e1"),k(r,"class","setting rangeSettings svelte-1665e1")},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),ut(i,r,null),a=!0},p(c,p){let h={};!o&&p&8&&(o=!0,h.values=c[3],et(()=>o=!1)),i.$set(h)},i(c){a||(se(i.$$.fragment,c),a=!0)},o(c){de(i.$$.fragment,c),a=!1},d(c){c&&B(e),c&&B(n),c&&B(r),st(i)}}}function Cw(t){let e,n,r,i,o,a;function u(c){t[20](c)}let f={pipstep:5,min:0,max:15,step:1,all:"label",pips:!0,float:!0};return t[5]!==void 0&&(f.values=t[5]),i=new _a({props:f}),Ne.push(()=>tt(i,"values",u)),{c(){e=N("label"),e.textContent="Timespan",n=$(),r=N("div"),ct(i.$$.fragment),k(e,"for","timespan"),k(e,"class","svelte-1665e1"),k(r,"class","setting rangeSettings svelte-1665e1")},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),ut(i,r,null),a=!0},p(c,p){let h={};!o&&p&32&&(o=!0,h.values=c[5],et(()=>o=!1)),i.$set(h)},i(c){a||(se(i.$$.fragment,c),a=!0)},o(c){de(i.$$.fragment,c),a=!1},d(c){c&&B(e),c&&B(n),c&&B(r),st(i)}}}function Dw(t){let e,n,r,i,o,a;function u(c){t[21](c)}let f={pipstep:5,min:-15,max:15,step:1,all:"label",pips:!0,float:!0};return t[10]!==void 0&&(f.values=t[10]),i=new _a({props:f}),Ne.push(()=>tt(i,"values",u)),{c(){e=N("label"),e.textContent="Offset",n=$(),r=N("div"),ct(i.$$.fragment),k(e,"for","offset"),k(e,"class","svelte-1665e1"),k(r,"class","setting rangeSettings svelte-1665e1")},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),ut(i,r,null),a=!0},p(c,p){let h={};!o&&p&1024&&(o=!0,h.values=c[10],et(()=>o=!1)),i.$set(h)},i(c){a||(se(i.$$.fragment,c),a=!0)},o(c){de(i.$$.fragment,c),a=!1},d(c){c&&B(e),c&&B(n),c&&B(r),st(i)}}}function Ow(t){let e,n,r,i,o,a;function u(c){t[22](c)}let f={pipstep:5,min:5,max:30,step:1,all:"label",pips:!0,float:!0};return t[12]!==void 0&&(f.values=t[12]),i=new _a({props:f}),Ne.push(()=>tt(i,"values",u)),{c(){e=N("label"),e.textContent="Size",n=$(),r=N("div"),ct(i.$$.fragment),k(e,"for","size"),k(e,"class","svelte-1665e1"),k(r,"class","setting rangeSettings svelte-1665e1")},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),ut(i,r,null),a=!0},p(c,p){let h={};!o&&p&4096&&(o=!0,h.values=c[12],et(()=>o=!1)),i.$set(h)},i(c){a||(se(i.$$.fragment,c),a=!0)},o(c){de(i.$$.fragment,c),a=!1},d(c){c&&B(e),c&&B(n),c&&B(r),st(i)}}}function Mw(t){let e,n,r,i,o,a;function u(c){t[23](c)}let f={options:[...t[13],...ul]};return t[6]!==void 0&&(f.selected=t[6]),i=new ma({props:f}),Ne.push(()=>tt(i,"selected",u)),{c(){e=N("label"),e.textContent="Include",n=$(),r=N("div"),ct(i.$$.fragment),k(e,"for","include"),k(e,"class","svelte-1665e1"),k(r,"class","setting svelte-1665e1")},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),ut(i,r,null),a=!0},p(c,p){let h={};p&8192&&(h.options=[...c[13],...ul]),!o&&p&64&&(o=!0,h.selected=c[6],et(()=>o=!1)),i.$set(h)},i(c){a||(se(i.$$.fragment,c),a=!0)},o(c){de(i.$$.fragment,c),a=!1},d(c){c&&B(e),c&&B(n),c&&B(r),st(i)}}}function Aw(t){let e,n,r,i,o,a;function u(c){t[24](c)}let f={options:[...t[13],...ul]};return t[7]!==void 0&&(f.selected=t[7]),i=new ma({props:f}),Ne.push(()=>tt(i,"selected",u)),{c(){e=N("label"),e.textContent="Exclude",n=$(),r=N("div"),ct(i.$$.fragment),k(e,"for","exclude"),k(e,"class","svelte-1665e1"),k(r,"class","setting svelte-1665e1")},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),ut(i,r,null),a=!0},p(c,p){let h={};p&8192&&(h.options=[...c[13],...ul]),!o&&p&128&&(o=!0,h.selected=c[7],et(()=>o=!1)),i.$set(h)},i(c){a||(se(i.$$.fragment,c),a=!0)},o(c){de(i.$$.fragment,c),a=!1},d(c){c&&B(e),c&&B(n),c&&B(r),st(i)}}}function Pw(t){let e,n,r,i,o,a,u,f,c;return{c(){e=N("label"),e.textContent="Default view",n=$(),r=N("select"),i=N("option"),i.textContent="Day",o=N("option"),o.textContent="Week",a=N("option"),a.textContent="Month",u=N("option"),u.textContent="Agenda",k(e,"for","defaultView<"),k(e,"class","svelte-1665e1"),i.__value="day",i.value=i.__value,o.__value="week",o.value=o.__value,a.__value="month",a.value=a.__value,u.__value="agenda",u.value=u.__value,k(r,"name","view"),t[8]===void 0&&ln(()=>t[25].call(r))},m(p,h){G(p,e,h),G(p,n,h),G(p,r,h),A(r,i),A(r,o),A(r,a),A(r,u),li(r,t[8],!0),f||(c=oe(r,"change",t[25]),f=!0)},p(p,h){h&256&&li(r,p[8])},d(p){p&&B(e),p&&B(n),p&&B(r),f=!1,c()}}}function Nw(t){let e,n,r,i,o,a,u,f;return{c(){e=N("label"),e.textContent="Color theme",n=$(),r=N("select"),i=N("option"),i.textContent="Auto",o=N("option"),o.textContent="Light",a=N("option"),a.textContent="Dark",k(e,"for","ColorTheme"),k(e,"class","svelte-1665e1"),i.__value="auto",i.value=i.__value,o.__value="light",o.value=o.__value,a.__value="dark",a.value=a.__value,k(r,"name","theme"),t[9]===void 0&&ln(()=>t[26].call(r))},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),A(r,i),A(r,o),A(r,a),li(r,t[9],!0),u||(f=oe(r,"change",t[26]),u=!0)},p(c,p){p&512&&li(r,c[9])},d(c){c&&B(e),c&&B(n),c&&B(r),u=!1,f()}}}function xw(t){let e,n,r;return{c(){e=N("button"),e.textContent="Open Login"},m(i,o){G(i,e,o),n||(r=oe(e,"click",t[27]),n=!0)},p:me,d(i){i&&B(e),n=!1,r()}}}function NP(t){let e,n,r,i=t[1]&&kw(t);return{c(){e=N("div"),i&&i.c(),k(e,"class",n=""+(en(t[1]?"settingsContainerOpen":"")+" svelte-1665e1"))},m(o,a){G(o,e,a),i&&i.m(e,null),r=!0},p(o,[a]){o[1]?i?(i.p(o,a),a&2&&se(i,1)):(i=kw(o),i.c(),se(i,1),i.m(e,null)):i&&(Je(),de(i,1,1,()=>{i=null}),Qe()),(!r||a&2&&n!==(n=""+(en(o[1]?"settingsContainerOpen":"")+" svelte-1665e1")))&&k(e,"class",n)},i(o){r||(se(i),r=!0)},o(o){de(i),r=!1},d(o){o&&B(e),i&&i.d()}}}function xP(t,e,n){let{codeBlockOptions:r}=e,{showSettings:i=!1}=e,{webViewUrl:o=""}=e,a=[],u=ye.getInstance();Yi(()=>Tt(void 0,void 0,void 0,function*(){n(13,a=yield Pi()),n(13,a=a.map(S=>S.summary))}));let f=r.hourRange,c=r.navigation,p=[r.timespan],h=r.include,m=r.exclude,_=r.view,v=r.theme,b=[r.offset],E=r.showAllDay,y=[r.size],O=()=>{let S=u.settings.viewSettings[r.type];delete S.width,delete S.height,S.type==="day"&&delete S.timespan;let j=`\`\`\`gEvent -${(0,bw.stringifyYaml)(u.settings.viewSettings[r.type])} -\`\`\``;navigator.clipboard.writeText(j)},D=()=>{n(1,i=!1)};function F(S){c=S,n(4,c)}function P(S){E=S,n(11,E)}function L(S){f=S,n(3,f)}function R(S){p=S,n(5,p)}function M(S){b=S,n(10,b)}function H(S){y=S,n(12,y)}function le(S){h=S,n(6,h)}function V(S){m=S,n(7,m)}function X(){_=Hs(this),n(8,_)}function K(){v=Hs(this),n(9,v)}let ce=()=>n(2,o="https://accounts.google.com");return t.$$set=S=>{"codeBlockOptions"in S&&n(0,r=S.codeBlockOptions),"showSettings"in S&&n(1,i=S.showSettings),"webViewUrl"in S&&n(2,o=S.webViewUrl)},t.$$.update=()=>{if(t.$$.dirty&73721){e:n(0,r.hourRange=f,r),n(0,r.navigation=c,r),n(0,r.timespan=p[0],r),n(0,r.include=h,r),n(0,r.exclude=m,r),n(0,r.view=_,r),n(0,r.theme=v,r),n(0,r.offset=b[0],r),n(0,r.size=y[0],r),n(0,r.showAllDay=E,r),n(16,u.settings.viewSettings[r.type]=Object.assign(Object.assign({},u.settings.viewSettings[r.type]),{hourRange:f,navigation:c,timespan:p[0],include:h,exclude:m,view:_,theme:v,offset:b[0],showAllDay:E,size:y[0]}),u),u.saveSettings()}},[r,i,o,f,c,p,h,m,_,v,b,E,y,a,O,D,u,F,P,L,R,M,H,le,V,X,K,ce]}var Iw=class extends ze{constructor(e){super();qe(this,e,xP,NP,Ge,{codeBlockOptions:0,showSettings:1,webViewUrl:2},PP)}},di=Iw;function IP(t){Et(t,"svelte-1ficnkj",".fullSize.svelte-1ficnkj,.content.svelte-1ficnkj,.box.svelte-1ficnkj{width:100%;height:100%;overflow:scoll !important}")}function Rw(t){let e,n,r,i,o;function a(p){t[5](p)}function u(p){t[6](p)}function f(p){t[7](p)}let c={};return t[0]!==void 0&&(c.codeBlockOptions=t[0]),t[1]!==void 0&&(c.showSettings=t[1]),t[3]!==void 0&&(c.webViewUrl=t[3]),e=new di({props:c}),Ne.push(()=>tt(e,"codeBlockOptions",a)),Ne.push(()=>tt(e,"showSettings",u)),Ne.push(()=>tt(e,"webViewUrl",f)),{c(){ct(e.$$.fragment)},m(p,h){ut(e,p,h),o=!0},p(p,h){let m={};!n&&h&1&&(n=!0,m.codeBlockOptions=p[0],et(()=>n=!1)),!r&&h&2&&(r=!0,m.showSettings=p[1],et(()=>r=!1)),!i&&h&8&&(i=!0,m.webViewUrl=p[3],et(()=>i=!1)),e.$set(m)},i(p){o||(se(e.$$.fragment,p),o=!0)},o(p){de(e.$$.fragment,p),o=!1},d(p){st(e,p)}}}function RP(t){let e,n,r=`${t[0].width}px`,i=`${t[0].height}px`;return{c(){e=N("webview"),Xo(e.src,n=t[3])||k(e,"src",n),k(e,"allowpopups",""),he(e,"width",r),he(e,"height",i)},m(o,a){G(o,e,a),t[10](e)},p(o,a){a&8&&!Xo(e.src,n=o[3])&&k(e,"src",n),a&1&&r!==(r=`${o[0].width}px`)&&he(e,"width",r),a&1&&i!==(i=`${o[0].height}px`)&&he(e,"height",i)},d(o){o&&B(e),t[10](null)}}}function LP(t){let e,n,r=`${t[0].height}px`;return{c(){e=N("webview"),Xo(e.src,n=t[3])||k(e,"src",n),k(e,"allowpopups",""),he(e,"height",r)},m(i,o){G(i,e,o),t[9](e)},p(i,o){o&8&&!Xo(e.src,n=i[3])&&k(e,"src",n),o&1&&r!==(r=`${i[0].height}px`)&&he(e,"height",r)},d(i){i&&B(e),t[9](null)}}}function FP(t){let e,n;return{c(){e=N("webview"),Xo(e.src,n=t[3])||k(e,"src",n),k(e,"allowpopups",""),k(e,"class","fullSize svelte-1ficnkj")},m(r,i){G(r,e,i),t[8](e)},p(r,i){i&8&&!Xo(e.src,n=r[3])&&k(e,"src",n)},d(r){r&&B(e),t[8](null)}}}function YP(t){let e,n,r,i,o=t[2]&&Rw(t);function a(c,p){return c[0].width==-1?FP:c[0].width?RP:LP}let u=a(t,-1),f=u(t);return{c(){e=N("div"),o&&o.c(),n=$(),r=N("div"),f.c(),k(r,"class","content svelte-1ficnkj"),k(e,"class","box svelte-1ficnkj")},m(c,p){G(c,e,p),o&&o.m(e,null),A(e,n),A(e,r),f.m(r,null),i=!0},p(c,[p]){c[2]?o?(o.p(c,p),p&4&&se(o,1)):(o=Rw(c),o.c(),se(o,1),o.m(e,n)):o&&(Je(),de(o,1,1,()=>{o=null}),Qe()),u===(u=a(c,p))&&f?f.p(c,p):(f.d(1),f=u(c),f&&(f.c(),f.m(r,null)))},i(c){i||(se(o),i=!0)},o(c){de(o),i=!1},d(c){c&&B(e),o&&o.d(),f.d()}}}function WP(t,e,n){let{codeBlockOptions:r}=e,{isObsidianView:i=!1}=e,{showSettings:o=!1}=e,a,u,f;r.height||(r.height=500);let c=y=>{if(a)return a;if(!f.isValid())return`https://calendar.google.com/calendar/u/0/r/${y}/`;let O=f.format("yyyy/M/D");return`https://calendar.google.com/calendar/u/0/r/${y}/${O}`};function p(y){if(u)if(y=="dark"||y=="auto"&&hv()=="dark"){try{u.removeEventListener("dom-ready",O=>{u.executeJavaScript(` - const menu = document.querySelectorAll('[aria-label][aria-expanded]')[0] - if(menu.getAttribute("aria-expanded") == "true"){ - menu.click(); - } - `),u.insertCSS("html { filter: hue-rotate(180deg)invert(100)contrast(93%) !important; }")})}catch(O){}try{u.removeEventListener("dom-ready",O=>{u.executeJavaScript(` - const menu = document.querySelectorAll('[aria-label][aria-expanded]')[0] - if(menu.getAttribute("aria-expanded") == "true"){ - menu.click(); - } - `)})}catch(O){}u.addEventListener("dom-ready",O=>{u.executeJavaScript(` - const menu = document.querySelectorAll('[aria-label][aria-expanded]')[0] - if(menu.getAttribute("aria-expanded") == "true"){ - menu.click(); - } - `),u.insertCSS("html { filter: hue-rotate(180deg)invert(100)contrast(93%) !important; }")})}else u.addEventListener("dom-ready",O=>{u.executeJavaScript(` - const menu = document.querySelectorAll('[aria-label][aria-expanded]')[0] - if(menu.getAttribute("aria-expanded") == "true"){ - menu.click(); - } - `)})}function h(y){r=y,n(0,r)}function m(y){o=y,n(1,o)}function _(y){a=y,n(3,a),n(0,r)}function v(y){Ne[y?"unshift":"push"](()=>{u=y,n(4,u)})}function b(y){Ne[y?"unshift":"push"](()=>{u=y,n(4,u)})}function E(y){Ne[y?"unshift":"push"](()=>{u=y,n(4,u)})}return t.$$set=y=>{"codeBlockOptions"in y&&n(0,r=y.codeBlockOptions),"isObsidianView"in y&&n(2,i=y.isObsidianView),"showSettings"in y&&n(1,o=y.showSettings)},t.$$.update=()=>{if(t.$$.dirty&1){e:f=r.date?window.moment(r.date).add(r.offset,"day"):window.moment().add(r.offset,"day"),n(3,a=c(r.view)),p(r.theme)}},[r,o,i,a,u,h,m,_,v,b,E]}var Lw=class extends ze{constructor(e){super();qe(this,e,WP,YP,Ge,{codeBlockOptions:0,isObsidianView:2,showSettings:1},IP)}},tc=Lw;var GG=Oe(require("obsidian"));function Tn(){}function Ol(t,e){for(let n in e)t[n]=e[n];return t}function jP(t){return t&&typeof t=="object"&&typeof t.then=="function"}function Fw(t){return t()}function Yw(){return Object.create(null)}function wo(t){t.forEach(Fw)}function pi(t){return typeof t=="function"}function Dh(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function nc(t,e){return t!=t?e==e:t!==e}function BP(t){return Object.keys(t).length===0}function Ww(t,e,n,r){if(t){let i=jw(t,e,n,r);return t[0](i)}}function jw(t,e,n,r){return t[1]&&r?Ol(n.ctx.slice(),t[1](r(e))):n.ctx}function GP(t,e,n,r){if(t[2]&&r){let i=t[2](r(n));if(e.dirty===void 0)return i;if(typeof i=="object"){let o=[],a=Math.max(e.dirty.length,i.length);for(let u=0;ut.removeEventListener(e,n,r)}function Ze(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Gw(t,e){let n=Object.getOwnPropertyDescriptors(t.__proto__);for(let r in e)e[r]==null?t.removeAttribute(r):r==="style"?t.style.cssText=e[r]:r==="__value"?t.value=t[r]=e[r]:n[r]&&n[r].set?t[r]=e[r]:Ze(t,r,e[r])}function UP(t){return Array.from(t.childNodes)}function Ml(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function sn(t,e,n){t.classList[n?"add":"remove"](e)}var oc;function bo(t){oc=t}function zP(){if(!oc)throw new Error("Function called outside component initialization");return oc}var Al=[],Uw=[],sc=[],zw=[],HP=Promise.resolve(),Oh=!1;function qP(){Oh||(Oh=!0,HP.then(Nh))}function Mh(t){sc.push(t)}var Ah=!1,Ph=new Set;function Nh(){if(!Ah){Ah=!0;do{for(let t=0;t{ac.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}}function Hw(t,e){let n=e.token={};function r(i,o,a,u){if(e.token!==n)return;e.resolved=u;let f=e.ctx;a!==void 0&&(f=f.slice(),f[a]=u);let c=i&&(e.current=i)(f),p=!1;e.block&&(e.blocks?e.blocks.forEach((h,m)=>{m!==o&&h&&(as(),Vt(h,1,1,()=>{e.blocks[m]===h&&(e.blocks[m]=null)}),ls())}):e.block.d(1),c.c(),It(c,1),c.m(e.mount(),e.anchor),p=!0),e.block=c,e.blocks&&(e.blocks[o]=c),p&&Nh()}if(jP(t)){let i=zP();if(t.then(o=>{bo(i),r(e.then,1,e.value,o),bo(null)},o=>{if(bo(i),r(e.catch,2,e.error,o),bo(null),!e.hasCatch)throw o}),e.current!==e.pending)return r(e.pending,0),!0}else{if(e.current!==e.then)return r(e.then,1,e.value,t),!0;e.resolved=t}}function qw(t,e){Vt(t,1,1,()=>{e.delete(t.key)})}function Vw(t,e,n,r,i,o,a,u,f,c,p,h){let m=t.length,_=o.length,v=m,b={};for(;v--;)b[t[v].key]=v;let E=[],y=new Map,O=new Map;for(v=_;v--;){let L=h(i,o,v),R=n(L),M=a.get(R);M?r&&M.p(L,e):(M=c(R,L),M.c()),y.set(R,E[v]=M),R in b&&O.set(R,Math.abs(v-b[R]))}let D=new Set,F=new Set;function P(L){It(L,1),L.m(u,p),a.set(L.key,L),p=L.first,_--}for(;m&&_;){let L=E[_-1],R=t[m-1],M=L.key,H=R.key;L===R?(p=L.first,m--,_--):y.has(H)?!a.has(M)||D.has(M)?P(L):F.has(H)?m--:O.get(M)>O.get(H)?(F.add(M),P(L)):(D.add(H),m--):(f(R,a),m--)}for(;m--;){let L=t[m];y.has(L.key)||f(L,a)}for(;_;)P(E[_-1]);return E}function lc(t,e){let n={},r={},i={$$scope:1},o=t.length;for(;o--;){let a=t[o],u=e[o];if(u){for(let f in a)f in u||(r[f]=1);for(let f in u)i[f]||(n[f]=u[f],i[f]=1);t[o]=u}else for(let f in a)i[f]=1}for(let a in r)a in n||(n[a]=void 0);return n}function xh(t){return typeof t=="object"&&t!==null?t:{}}function zi(t){t&&t.c()}function hi(t,e,n,r){let{fragment:i,on_mount:o,on_destroy:a,after_update:u}=t.$$;i&&i.m(e,n),r||Mh(()=>{let f=o.map(Fw).filter(pi);a?a.push(...f):wo(f),t.$$.on_mount=[]}),u.forEach(Mh)}function mi(t,e){let n=t.$$;n.fragment!==null&&(wo(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function KP(t,e){t.$$.dirty[0]===-1&&(Al.push(t),qP(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{let _=m.length?m[0]:h;return f.ctx&&i(f.ctx[p],f.ctx[p]=_)&&(!f.skip_bound&&f.bound[p]&&f.bound[p](_),c&&KP(t,p)),h}):[],f.update(),c=!0,wo(f.before_update),f.fragment=r?r(f.ctx):!1,e.target){if(e.hydrate){let p=UP(e.target);f.fragment&&f.fragment.l(p),p.forEach(gn)}else f.fragment&&f.fragment.c();e.intro&&It(t.$$.fragment),hi(t,e.target,e.anchor,e.customElement),Nh()}bo(u)}var ko=class{$destroy(){mi(this,1),this.$destroy=Tn}$on(e,n){let r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{let i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(e){this.$$set&&!BP(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};function ZP(t,e="day"){let n=t.clone().startOf(e).format();return`${e}-${n}`}var uc=ZP;function XP(){var t=Pt("style");t.id="svelte-1widvzq-style",t.textContent=".dot.svelte-1widvzq,.hollow.svelte-1widvzq{display:inline-block;height:6px;width:6px;margin:0 1px}.filled.svelte-1widvzq{fill:var(--color-dot)}.active.filled.svelte-1widvzq{fill:var(--text-on-accent)}.hollow.svelte-1widvzq{fill:none;stroke:var(--color-dot)}.active.hollow.svelte-1widvzq{fill:none;stroke:var(--text-on-accent)}",nt(document.head,t)}function JP(t){let e,n,r;return{c(){e=ya("svg"),n=ya("circle"),Ze(n,"cx","3"),Ze(n,"cy","3"),Ze(n,"r","2"),Ze(e,"class",r=""+(va(`hollow ${t[0]}`)+" svelte-1widvzq")),Ze(e,"viewBox","0 0 6 6"),Ze(e,"xmlns","http://www.w3.org/2000/svg"),sn(e,"active",t[2])},m(i,o){Sn(i,e,o),nt(e,n)},p(i,o){o&1&&r!==(r=""+(va(`hollow ${i[0]}`)+" svelte-1widvzq"))&&Ze(e,"class",r),o&5&&sn(e,"active",i[2])},d(i){i&&gn(e)}}}function QP(t){let e,n,r;return{c(){e=ya("svg"),n=ya("circle"),Ze(n,"cx","3"),Ze(n,"cy","3"),Ze(n,"r","2"),Ze(e,"class",r=""+(va(`dot filled ${t[0]}`)+" svelte-1widvzq")),Ze(e,"viewBox","0 0 6 6"),Ze(e,"xmlns","http://www.w3.org/2000/svg"),sn(e,"active",t[2])},m(i,o){Sn(i,e,o),nt(e,n)},p(i,o){o&1&&r!==(r=""+(va(`dot filled ${i[0]}`)+" svelte-1widvzq"))&&Ze(e,"class",r),o&5&&sn(e,"active",i[2])},d(i){i&&gn(e)}}}function $P(t){let e;function n(o,a){return o[1]?QP:JP}let r=n(t),i=r(t);return{c(){i.c(),e=ic()},m(o,a){i.m(o,a),Sn(o,e,a)},p(o,[a]){r===(r=n(o))&&i?i.p(o,a):(i.d(1),i=r(o),i&&(i.c(),i.m(e.parentNode,e)))},i:Tn,o:Tn,d(o){i.d(o),o&&gn(e)}}}function eN(t,e,n){let{className:r=""}=e,{isFilled:i}=e,{isActive:o}=e;return t.$$set=a=>{"className"in a&&n(0,r=a.className),"isFilled"in a&&n(1,i=a.isFilled),"isActive"in a&&n(2,o=a.isActive)},[r,i,o]}var Ih=class extends ko{constructor(e){super();document.getElementById("svelte-1widvzq-style")||XP(),us(this,e,eN,$P,Dh,{className:0,isFilled:1,isActive:2})}},tN=t=>({}),Kw=t=>({metadata:null}),nN=t=>({metadata:t&1}),Zw=t=>({metadata:t[3]});function rN(t){let e,n=t[2].default,r=Ww(n,t,t[1],Kw);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&o&2&&Bw(r,n,i,i[1],o,tN,Kw)},i(i){e||(It(r,i),e=!0)},o(i){Vt(r,i),e=!1},d(i){r&&r.d(i)}}}function iN(t){let e,n,r,i={ctx:t,current:null,token:null,hasCatch:!1,pending:aN,then:sN,catch:oN,value:3,blocks:[,,,]};return Hw(n=t[0],i),{c(){e=ic(),i.block.c()},m(o,a){Sn(o,e,a),i.block.m(o,i.anchor=a),i.mount=()=>e.parentNode,i.anchor=e,r=!0},p(o,a){if(t=o,i.ctx=t,!(a&1&&n!==(n=t[0])&&Hw(n,i))){let u=t.slice();u[3]=i.resolved,i.block.p(u,a)}},i(o){r||(It(i.block),r=!0)},o(o){for(let a=0;a<3;a+=1){let u=i.blocks[a];Vt(u)}r=!1},d(o){o&&gn(e),i.block.d(o),i.token=null,i=null}}}function oN(t){return{c:Tn,m:Tn,p:Tn,i:Tn,o:Tn,d:Tn}}function sN(t){let e,n=t[2].default,r=Ww(n,t,t[1],Zw);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&o&3&&Bw(r,n,i,i[1],o,nN,Zw)},i(i){e||(It(r,i),e=!0)},o(i){Vt(r,i),e=!1},d(i){r&&r.d(i)}}}function aN(t){return{c:Tn,m:Tn,p:Tn,i:Tn,o:Tn,d:Tn}}function lN(t){let e,n,r,i,o=[iN,rN],a=[];function u(f,c){return f[0]?0:1}return e=u(t),n=a[e]=o[e](t),{c(){n.c(),r=ic()},m(f,c){a[e].m(f,c),Sn(f,r,c),i=!0},p(f,[c]){let p=e;e=u(f),e===p?a[e].p(f,c):(as(),Vt(a[p],1,1,()=>{a[p]=null}),ls(),n=a[e],n?n.p(f,c):(n=a[e]=o[e](f),n.c()),It(n,1),n.m(r.parentNode,r))},i(f){i||(It(n),i=!0)},o(f){Vt(n),i=!1},d(f){a[e].d(f),f&&gn(r)}}}function uN(t,e,n){let{$$slots:r={},$$scope:i}=e,{metadata:o}=e;return t.$$set=a=>{"metadata"in a&&n(0,o=a.metadata),"$$scope"in a&&n(1,i=a.$$scope)},[o,i,r]}var Rh=class extends ko{constructor(e){super();us(this,e,uN,lN,nc,{metadata:0})}};function fN(){return navigator.appVersion.indexOf("Mac")!==-1}function fc(t){return fN()?t.metaKey:t.ctrlKey}function cN(...t){return window.moment.weekdaysShort(!0)}function Xw(t){return t.isoWeekday()===6||t.isoWeekday()===7}function dN(t){return t[0].weekday(0)}function pN(t,...e){let n=window.moment().locale(),r=[],i,o=t.clone().locale(n).date(1),a=o.weekday(),u=o.clone().subtract(a,"days");for(let f=0;f<42;f++)f%7==0&&(i={days:[],weekNum:u.week()},r.push(i)),i.days.push(u),u=u.clone().add(1,"days");return r}function hN(){var t=Pt("style");t.id="svelte-q3wqg9-style",t.textContent=".day.svelte-q3wqg9{background-color:var(--color-background-day);border-radius:4px;color:var(--color-text-day);cursor:pointer;font-size:0.8em;height:100%;padding:4px;position:relative;text-align:center;transition:background-color 0.1s ease-in, color 0.1s ease-in;vertical-align:baseline}.day.svelte-q3wqg9:hover{background-color:var(--interactive-hover)}.day.active.svelte-q3wqg9:hover{background-color:var(--interactive-accent-hover)}.adjacent-month.svelte-q3wqg9{opacity:0.25}.today.svelte-q3wqg9{color:var(--color-text-today)}.day.svelte-q3wqg9:active,.active.svelte-q3wqg9,.active.today.svelte-q3wqg9{color:var(--text-on-accent);background-color:var(--interactive-accent)}.dot-container.svelte-q3wqg9{display:flex;flex-wrap:wrap;justify-content:center;line-height:6px;min-height:6px}",nt(document.head,t)}function Jw(t,e,n){let r=t.slice();return r[11]=e[n],r}function Qw(t){let e,n,r=[t[11]],i={};for(let o=0;oVt(h[b],1,1,()=>{h[b]=null}),_=[{class:a=`day ${t[7].classes.join(" ")}`},t[7].dataAttributes||{}],v={};for(let b=0;b<_.length;b+=1)v=Ol(v,_[b]);return{c(){e=Pt("div"),r=os(n),i=hr(),o=Pt("div");for(let b=0;b({7:i}),({metadata:i})=>i?128:0]},$$scope:{ctx:t}}}),{c(){e=Pt("td"),zi(n.$$.fragment)},m(i,o){Sn(i,e,o),hi(n,e,null),r=!0},p(i,[o]){let a={};o&128&&(a.metadata=i[7]),o&16639&&(a.$$scope={dirty:o,ctx:i}),n.$set(a)},i(i){r||(It(n.$$.fragment,i),r=!0)},o(i){Vt(n.$$.fragment,i),r=!1},d(i){i&&gn(e),mi(n)}}}function _N(t,e,n){let{date:r}=e,{metadata:i}=e,{onHover:o}=e,{onClick:a}=e,{onContextMenu:u}=e,{today:f}=e,{displayedMonth:c=null}=e,{selectedId:p=null}=e,h=v=>a(r,fc(v)),m=v=>u(r,v),_=v=>o(r,v.target,fc(v));return t.$$set=v=>{"date"in v&&n(0,r=v.date),"metadata"in v&&n(7,i=v.metadata),"onHover"in v&&n(1,o=v.onHover),"onClick"in v&&n(2,a=v.onClick),"onContextMenu"in v&&n(3,u=v.onContextMenu),"today"in v&&n(4,f=v.today),"displayedMonth"in v&&n(5,c=v.displayedMonth),"selectedId"in v&&n(6,p=v.selectedId)},[r,o,a,u,f,c,p,i,h,m,_]}var $w=class extends ko{constructor(e){super();document.getElementById("svelte-q3wqg9-style")||hN(),us(this,e,_N,gN,nc,{date:0,metadata:7,onHover:1,onClick:2,onContextMenu:3,today:4,displayedMonth:5,selectedId:6})}};function vN(){var t=Pt("style");t.id="svelte-156w7na-style",t.textContent=".arrow.svelte-156w7na.svelte-156w7na{align-items:center;cursor:pointer;display:flex;justify-content:center;width:24px}.arrow.is-mobile.svelte-156w7na.svelte-156w7na{width:32px}.right.svelte-156w7na.svelte-156w7na{transform:rotate(180deg)}.arrow.svelte-156w7na svg.svelte-156w7na{color:var(--color-arrow);height:16px;width:16px}",nt(document.head,t)}function yN(t){let e,n,r,i,o;return{c(){e=Pt("div"),n=ya("svg"),r=ya("path"),Ze(r,"fill","currentColor"),Ze(r,"d","M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"),Ze(n,"focusable","false"),Ze(n,"role","img"),Ze(n,"xmlns","http://www.w3.org/2000/svg"),Ze(n,"viewBox","0 0 320 512"),Ze(n,"class","svelte-156w7na"),Ze(e,"class","arrow svelte-156w7na"),Ze(e,"aria-label",t[1]),sn(e,"is-mobile",t[3]),sn(e,"right",t[2]==="right")},m(a,u){Sn(a,e,u),nt(e,n),nt(n,r),i||(o=Ui(e,"click",function(){pi(t[0])&&t[0].apply(this,arguments)}),i=!0)},p(a,[u]){t=a,u&2&&Ze(e,"aria-label",t[1]),u&4&&sn(e,"right",t[2]==="right")},i:Tn,o:Tn,d(a){a&&gn(e),i=!1,o()}}}function wN(t,e,n){let{onClick:r}=e,{tooltip:i}=e,{direction:o}=e,a=window.app.isMobile;return t.$$set=u=>{"onClick"in u&&n(0,r=u.onClick),"tooltip"in u&&n(1,i=u.tooltip),"direction"in u&&n(2,o=u.direction)},[r,i,o,a]}var Lh=class extends ko{constructor(e){super();document.getElementById("svelte-156w7na-style")||vN(),us(this,e,wN,yN,Dh,{onClick:0,tooltip:1,direction:2})}};function bN(){var t=Pt("style");t.id="svelte-1vwr9dd-style",t.textContent=".nav.svelte-1vwr9dd.svelte-1vwr9dd{align-items:center;display:flex;margin:0.6em 0 1em;padding:0 8px;width:100%}.nav.is-mobile.svelte-1vwr9dd.svelte-1vwr9dd{padding:0}.title.svelte-1vwr9dd.svelte-1vwr9dd{color:var(--color-text-title);font-size:1.5em;margin:0}.is-mobile.svelte-1vwr9dd .title.svelte-1vwr9dd{font-size:1.3em}.month.svelte-1vwr9dd.svelte-1vwr9dd{font-weight:500;text-transform:capitalize}.year.svelte-1vwr9dd.svelte-1vwr9dd{color:var(--interactive-accent)}.right-nav.svelte-1vwr9dd.svelte-1vwr9dd{display:flex;justify-content:center;margin-left:auto}.reset-button.svelte-1vwr9dd.svelte-1vwr9dd{cursor:pointer;border-radius:4px;color:var(--text-muted);font-size:0.7em;font-weight:600;letter-spacing:1px;margin:0 4px;padding:0px 4px;text-transform:uppercase}.is-mobile.svelte-1vwr9dd .reset-button.svelte-1vwr9dd{display:none}",nt(document.head,t)}function kN(t){let e,n,r,i=t[0].format("MMM")+"",o,a,u,f=t[0].format("YYYY")+"",c,p,h,m,_,v,b,E,y,O,D;return m=new Lh({props:{direction:"left",onClick:t[3],tooltip:"Previous Month"}}),E=new Lh({props:{direction:"right",onClick:t[2],tooltip:"Next Month"}}),{c(){e=Pt("div"),n=Pt("h3"),r=Pt("span"),o=os(i),a=hr(),u=Pt("span"),c=os(f),p=hr(),h=Pt("div"),zi(m.$$.fragment),_=hr(),v=Pt("div"),v.textContent=`${t[4]}`,b=hr(),zi(E.$$.fragment),Ze(r,"class","month svelte-1vwr9dd"),Ze(u,"class","year svelte-1vwr9dd"),Ze(n,"class","title svelte-1vwr9dd"),Ze(v,"class","reset-button svelte-1vwr9dd"),Ze(h,"class","right-nav svelte-1vwr9dd"),Ze(e,"class","nav svelte-1vwr9dd"),sn(e,"is-mobile",t[5])},m(F,P){Sn(F,e,P),nt(e,n),nt(n,r),nt(r,o),nt(n,a),nt(n,u),nt(u,c),nt(e,p),nt(e,h),hi(m,h,null),nt(h,_),nt(h,v),nt(h,b),hi(E,h,null),y=!0,O||(D=[Ui(n,"click",function(){pi(t[1])&&t[1].apply(this,arguments)}),Ui(v,"click",function(){pi(t[1])&&t[1].apply(this,arguments)})],O=!0)},p(F,[P]){t=F,(!y||P&1)&&i!==(i=t[0].format("MMM")+"")&&Ml(o,i),(!y||P&1)&&f!==(f=t[0].format("YYYY")+"")&&Ml(c,f);let L={};P&8&&(L.onClick=t[3]),m.$set(L);let R={};P&4&&(R.onClick=t[2]),E.$set(R)},i(F){y||(It(m.$$.fragment,F),It(E.$$.fragment,F),y=!0)},o(F){Vt(m.$$.fragment,F),Vt(E.$$.fragment,F),y=!1},d(F){F&&gn(e),mi(m),mi(E),O=!1,wo(D)}}}function EN(t,e,n){let{displayedMonth:r}=e,{today:i}=e,{resetDisplayedMonth:o}=e,{incrementDisplayedMonth:a}=e,{decrementDisplayedMonth:u}=e,f=i.calendar().split(/\d|\s/)[0],c=window.app.isMobile;return t.$$set=p=>{"displayedMonth"in p&&n(0,r=p.displayedMonth),"today"in p&&n(6,i=p.today),"resetDisplayedMonth"in p&&n(1,o=p.resetDisplayedMonth),"incrementDisplayedMonth"in p&&n(2,a=p.incrementDisplayedMonth),"decrementDisplayedMonth"in p&&n(3,u=p.decrementDisplayedMonth)},[r,o,a,u,f,c,i]}var eb=class extends ko{constructor(e){super();document.getElementById("svelte-1vwr9dd-style")||bN(),us(this,e,EN,kN,Dh,{displayedMonth:0,today:6,resetDisplayedMonth:1,incrementDisplayedMonth:2,decrementDisplayedMonth:3})}};function TN(){var t=Pt("style");t.id="svelte-egt0yd-style",t.textContent="td.svelte-egt0yd{border-right:1px solid var(--background-modifier-border)}.week-num.svelte-egt0yd{background-color:var(--color-background-weeknum);border-radius:4px;color:var(--color-text-weeknum);cursor:pointer;font-size:0.65em;height:100%;padding:4px;text-align:center;transition:background-color 0.1s ease-in, color 0.1s ease-in;vertical-align:baseline}.week-num.svelte-egt0yd:hover{background-color:var(--interactive-hover)}.week-num.active.svelte-egt0yd:hover{background-color:var(--interactive-accent-hover)}.active.svelte-egt0yd{color:var(--text-on-accent);background-color:var(--interactive-accent)}.dot-container.svelte-egt0yd{display:flex;flex-wrap:wrap;justify-content:center;line-height:6px;min-height:6px}",nt(document.head,t)}function tb(t,e,n){let r=t.slice();return r[11]=e[n],r}function nb(t){let e,n,r=[t[11]],i={};for(let o=0;oVt(p[m],1,1,()=>{p[m]=null});return{c(){e=Pt("div"),n=os(t[0]),r=hr(),i=Pt("div");for(let m=0;m({6:i}),({metadata:i})=>i?64:0]},$$scope:{ctx:t}}}),{c(){e=Pt("td"),zi(n.$$.fragment),Ze(e,"class","svelte-egt0yd")},m(i,o){Sn(i,e,o),hi(n,e,null),r=!0},p(i,[o]){let a={};o&64&&(a.metadata=i[6]),o&16639&&(a.$$scope={dirty:o,ctx:i}),n.$set(a)},i(i){r||(It(n.$$.fragment,i),r=!0)},o(i){Vt(n.$$.fragment,i),r=!1},d(i){i&&gn(e),mi(n)}}}function DN(t,e,n){let{weekNum:r}=e,{days:i}=e,{metadata:o}=e,{onHover:a}=e,{onClick:u}=e,{onContextMenu:f}=e,{selectedId:c=null}=e,p,h=v=>u(p,fc(v)),m=v=>f(i[0],v),_=v=>a(p,v.target,fc(v));return t.$$set=v=>{"weekNum"in v&&n(0,r=v.weekNum),"days"in v&&n(1,i=v.days),"metadata"in v&&n(6,o=v.metadata),"onHover"in v&&n(2,a=v.onHover),"onClick"in v&&n(3,u=v.onClick),"onContextMenu"in v&&n(4,f=v.onContextMenu),"selectedId"in v&&n(5,c=v.selectedId)},t.$$.update=()=>{t.$$.dirty&2&&n(7,p=dN(i))},[r,i,a,u,f,c,o,p,h,m,_]}var rb=class extends ko{constructor(e){super();document.getElementById("svelte-egt0yd-style")||TN(),us(this,e,DN,CN,nc,{weekNum:0,days:1,metadata:6,onHover:2,onClick:3,onContextMenu:4,selectedId:5})}};function ib(t){return te(this,null,function*(){let e={dots:[],classes:[],dataAttributes:{}};return(yield Promise.all(t)).reduce((r,i)=>({classes:[...r.classes,...i.classes||[]],dataAttributes:Object.assign(r.dataAttributes,i.dataAttributes),dots:[...r.dots,...i.dots||[]]}),e)})}function ob(t,e,...n){return ib(t.map(r=>r.getDailyMetadata(e)))}function sb(t,e,...n){return ib(t.map(r=>r.getWeeklyMetadata(e)))}function ON(){var t=Pt("style");t.id="svelte-pcimu8-style",t.textContent=".container.svelte-pcimu8{--color-background-heading:transparent;--color-background-day:transparent;--color-background-weeknum:transparent;--color-background-weekend:transparent;--color-dot:var(--text-muted);--color-arrow:var(--text-muted);--color-button:var(--text-muted);--color-text-title:var(--text-normal);--color-text-heading:var(--text-muted);--color-text-day:var(--text-normal);--color-text-today:var(--interactive-accent);--color-text-weeknum:var(--text-muted)}.container.svelte-pcimu8{padding:0 8px}.container.is-mobile.svelte-pcimu8{padding:0}th.svelte-pcimu8{text-align:center}.weekend.svelte-pcimu8{background-color:var(--color-background-weekend)}.calendar.svelte-pcimu8{border-collapse:collapse;width:100%}th.svelte-pcimu8{background-color:var(--color-background-heading);color:var(--color-text-heading);font-size:0.6em;letter-spacing:1px;padding:4px;text-transform:uppercase}",nt(document.head,t)}function ab(t,e,n){let r=t.slice();return r[18]=e[n],r}function lb(t,e,n){let r=t.slice();return r[21]=e[n],r}function ub(t,e,n){let r=t.slice();return r[24]=e[n],r}function fb(t,e,n){let r=t.slice();return r[27]=e[n],r}function cb(t){let e;return{c(){e=Pt("col")},m(n,r){Sn(n,e,r)},d(n){n&&gn(e)}}}function db(t){let e;return{c(){e=Pt("col"),Ze(e,"class","svelte-pcimu8"),sn(e,"weekend",Xw(t[27]))},m(n,r){Sn(n,e,r)},p(n,r){r&16384&&sn(e,"weekend",Xw(n[27]))},d(n){n&&gn(e)}}}function pb(t){let e;return{c(){e=Pt("th"),e.textContent="W",Ze(e,"class","svelte-pcimu8")},m(n,r){Sn(n,e,r)},d(n){n&&gn(e)}}}function hb(t){let e,n=t[24]+"",r;return{c(){e=Pt("th"),r=os(n),Ze(e,"class","svelte-pcimu8")},m(i,o){Sn(i,e,o),nt(e,r)},p(i,o){o&32768&&n!==(n=i[24]+"")&&Ml(r,n)},d(i){i&&gn(e)}}}function mb(t){let e,n,r=[t[18],{metadata:sb(t[8],t[18].days[0],t[10])},{onClick:t[7]},{onContextMenu:t[5]},{onHover:t[3]},{selectedId:t[9]}],i={};for(let o=0;oh[21].format();for(let h=0;h{f=null}),ls()),m&18261&&(c=e[18].days,as(),i=Vw(i,m,p,1,e,c,o,n,qw,gb,a,lb),ls())},i(h){if(!u){It(f);for(let m=0;mM[18].weekNum;for(let M=0;M{"localeData"in P&&n(17,r=P.localeData),"showWeekNums"in P&&n(1,i=P.showWeekNums),"onHoverDay"in P&&n(2,o=P.onHoverDay),"onHoverWeek"in P&&n(3,a=P.onHoverWeek),"onContextMenuDay"in P&&n(4,u=P.onContextMenuDay),"onContextMenuWeek"in P&&n(5,f=P.onContextMenuWeek),"onClickDay"in P&&n(6,c=P.onClickDay),"onClickWeek"in P&&n(7,p=P.onClickWeek),"sources"in P&&n(8,h=P.sources),"selectedId"in P&&n(9,m=P.selectedId),"today"in P&&n(10,_=P.today),"displayedMonth"in P&&n(0,v=P.displayedMonth)},t.$$.update=()=>{t.$$.dirty&131073&&n(14,b=pN(v,r)),t.$$.dirty&132096&&n(15,E=cN(_,r))},[v,i,o,a,u,f,c,p,h,m,_,O,D,F,b,E,y,r]}var cc=class extends ko{constructor(e){super();document.getElementById("svelte-pcimu8-style")||ON(),us(this,e,AN,MN,nc,{localeData:17,showWeekNums:1,onHoverDay:2,onHoverWeek:3,onContextMenuDay:4,onContextMenuWeek:5,onClickDay:6,onClickWeek:7,sources:8,selectedId:9,today:10,displayedMonth:0,incrementDisplayedMonth:11,decrementDisplayedMonth:12,resetDisplayedMonth:13})}get incrementDisplayedMonth(){return this.$$.ctx[11]}get decrementDisplayedMonth(){return this.$$.ctx[12]}get resetDisplayedMonth(){return this.$$.ctx[13]}};var mc=Oe(Ri());var sk=Oe(Bu()),xl=Oe(require("obsidian"));var Xb=Oe(require("obsidian"));function vb(){return zy(null,t=>{let e=()=>t(new Date);e();let n=setInterval(e,1e3*60);return()=>clearInterval(n)})}var Eb=Oe(kb());function FN(t){Et(t,"svelte-19ut8a9",".googleCalendarEvent.svelte-19ut8a9{display:flex;padding:0 10px 10px;position:absolute;cursor:pointer;width:150px;border-radius:5px;color:black;font-size:small;box-shadow:3px 2px 8px 4px rgba(0, 0, 0, 0.36);overflow:hidden}.gcal-timeline-container.svelte-19ut8a9{display:flex;gap:5px}.gcal-hour-line.svelte-19ut8a9::after{content:'';position:absolute;width:100%;border-bottom:1px solid grey}.gcal-timeline.svelte-19ut8a9,.hourText.svelte-19ut8a9{overflow:hidden}.gcal-time-display.svelte-19ut8a9{position:absolute;width:95%;height:3px;background:red;overflow:visible;z-index:1}.gcal-timeline.svelte-19ut8a9{position:relative;display:flex;flex-direction:row;padding-top:5px;flex-shrink:1000;min-height:0;overflow:hidden}")}function Tb(t,e,n){let r=t.slice();return r[16]=e[n],r[18]=n,r}function Sb(t,e,n){let r=t.slice();return r[19]=e[n],r[18]=n,r}function Cb(t){let e,n,r=`${t[0]/24}px`;return{c(){e=N("div"),k(e,"class",n=""+(en(t[8]>3?"gcal-hour-line gcal-hour-line-large":"gcal-hour-line")+" svelte-19ut8a9")),he(e,"height",r)},m(i,o){G(i,e,o)},p(i,o){o&1&&r!==(r=`${i[0]/24}px`)&&he(e,"height",r)},d(i){i&&B(e)}}}function Db(t){let e,n=`${t[7](t[6])}px`;return{c(){e=N("div"),k(e,"class","gcal-time-display svelte-19ut8a9"),he(e,"top",n)},m(r,i){G(r,e,i)},p(r,i){i&64&&n!==(n=`${r[7](r[6])}px`)&&he(e,"top",n)},d(r){r&&B(e)}}}function Ob(t,e){let n,r,i=e[16].event.summary+"",o,a,u,f,c,p,h=`${e[16].y}px`,m=`${e[16].x}%`,_=`${e[16].width}%`,v=`${e[16].height}px`,b,E;function y(...D){return e[12](e[16],...D)}function O(...D){return e[13](e[16],...D)}return{key:t,first:null,c(){n=N("div"),r=N("span"),o=Me(i),u=$(),k(r,"class",a="googleCalendarName googleCalendarName_Calendar_Color_"+e[16].event.parent.colorId+" googleCalendarName_Event_Color_"+e[16].event.parent.colorId+" googleCalendarName_Id_"+e[16].event.parent.id+" svelte-19ut8a9"),k(n,"class",f="googleCalendarEvent googleCalendarEvent_Calendar_Color_"+e[16].event.parent.colorId+" googleCalendarEvent_Event_Color_"+e[16].event.parent.colorId+" googleCalendarEvent_Id_"+e[16].event.parent.id+" svelte-19ut8a9"),k(n,"id",c=e[16].event.id),he(n,"top",h),he(n,"left",m),he(n,"width",_),he(n,"height",v),he(n,"background",Fi(e[16].event)),this.first=n},m(D,F){G(D,n,F),A(n,r),A(r,o),A(n,u),b||(E=[oe(n,"click",y),oe(n,"keypress",O)],b=!0)},p(D,F){e=D,F&4&&i!==(i=e[16].event.summary+"")&&Ye(o,i),F&4&&a!==(a="googleCalendarName googleCalendarName_Calendar_Color_"+e[16].event.parent.colorId+" googleCalendarName_Event_Color_"+e[16].event.parent.colorId+" googleCalendarName_Id_"+e[16].event.parent.id+" svelte-19ut8a9")&&k(r,"class",a),F&4&&f!==(f="googleCalendarEvent googleCalendarEvent_Calendar_Color_"+e[16].event.parent.colorId+" googleCalendarEvent_Event_Color_"+e[16].event.parent.colorId+" googleCalendarEvent_Id_"+e[16].event.parent.id+" svelte-19ut8a9")&&k(n,"class",f),F&4&&c!==(c=e[16].event.id)&&k(n,"id",c),F&4&&h!==(h=`${e[16].y}px`)&&he(n,"top",h),F&4&&m!==(m=`${e[16].x}%`)&&he(n,"left",m),F&4&&_!==(_=`${e[16].width}%`)&&he(n,"width",_),F&4&&v!==(v=`${e[16].height}px`)&&he(n,"height",v),F&4&&he(n,"background",Fi(e[16].event))},i(D){p||ln(()=>{p=rf(n,e[11],{key:e[18]}),p.start()})},o:me,d(D){D&&B(n),b=!1,We(E)}}}function YN(t){let e,n,r,i,o=window.moment().isSame(t[3],"day"),a,u=[],f=new Map,c=`${t[0]}px`,p=`${t[1]}px`,h=` -${ra(t[0],t[4][0])}px 0px -${ia(t[0],t[4][1])}px 0px`,m={length:24},_=[];for(let y=0;yy[18];for(let y=0;y{let F=kl(D);return Math.floor(i*F)},m=ye.getInstance().settings.timelineHourFormat,_=vb();Ku(t,_,D=>n(6,r=D));let v=D=>{let F=[],P=new Eb.default;D.forEach(M=>{let H=M.start.date||M.start.dateTime;P.has(H)?P.get(H).push(M):P.set(H,[M])});let L=0,R=null;for(let M of P.values()){if(M[0].start.dateTime){let H=window.moment(M[0].start.dateTime);R&&H.isBefore(R,"minutes")?L++:L=0,R=window.moment(M[0].end.dateTime)}M.forEach((H,le)=>{let V=L*5,X=(100-V)/M.length;F=[...F,{event:H,x:V+X*le,y:dv(H,i),width:X,height:pv(H,i),fullDay:H.start.date!=null}]})}return F},[b,E]=Qf({duration:D=>Math.sqrt(D*200),fallback(D,F){let P=getComputedStyle(D),L=P.transform==="none"?"":P.transform;return{duration:600,easing:Jf,css:R=>` - transform: ${L} scale(${R}); - opacity: ${R} - `}}}),y=(D,F)=>c(D.event,F),O=(D,F)=>c(D.event,F);return t.$$set=D=>{"height"in D&&n(0,i=D.height),"width"in D&&n(1,o=D.width),"events"in D&&n(2,a=D.events),"day"in D&&n(3,u=D.day),"hourRange"in D&&n(4,f=D.hourRange),"goToEvent"in D&&n(5,c=D.goToEvent)},[i,o,a,u,f,c,r,p,m,_,v,E,y,O]}var Mb=class extends ze{constructor(e){super();qe(this,e,WN,YN,Ge,{height:0,width:1,events:2,day:3,hourRange:4,goToEvent:5},FN)}},Ab=Mb;function jN(t){Et(t,"svelte-1uh2awq",'.gcal-hour-text-container.svelte-1uh2awq{display:flex;flex-direction:column;min-height:0;overflow:hidden}.gcal-hour-text.svelte-1uh2awq{font-family:"consolas";display:block}')}function Pb(t,e,n){let r=t.slice();return r[6]=e[n],r[8]=n,r}function Nb(t){let e,n=t[4](t[8],t[2])+"",r,i=`${t[0]/24}px`,o=`${t[0]/50}px`,a,u;return{c(){e=N("span"),r=Me(n),k(e,"class","gcal-hour-text svelte-1uh2awq"),he(e,"height",i),he(e,"font-size",o)},m(f,c){G(f,e,c),A(e,r),a||(u=[oe(e,"click",t[3]),oe(e,"keypress",t[3])],a=!0)},p(f,c){c&4&&n!==(n=f[4](f[8],f[2])+"")&&Ye(r,n),c&1&&i!==(i=`${f[0]/24}px`)&&he(e,"height",i),c&1&&o!==(o=`${f[0]/50}px`)&&he(e,"font-size",o)},d(f){f&&B(e),a=!1,We(u)}}}function BN(t){let e,n=` -${ra(t[0],t[1][0])}px 0px -${ia(t[0],t[1][1])}px 0px`,r={length:24},i=[];for(let o=0;o{n(2,i+=1),i>5&&n(2,i=0),r.settings.timelineHourFormat=i,r.saveSettings()},f=(c,p)=>{let h=window.moment(`${c}:00:00`,"H:mm:ss");switch(p){case 0:return h.format("H");case 1:return h.format("HH");case 2:return h.format("h");case 3:return h.format("hh");case 4:return h.format("h A");case 5:return h.format("hh A")}};return t.$$set=c=>{"height"in c&&n(0,o=c.height),"hourRange"in c&&n(1,a=c.hourRange)},[o,a,i,u,f]}var xb=class extends ze{constructor(e){super();qe(this,e,GN,BN,Ge,{height:0,hourRange:1},jN)}},Ib=xb;function UN(t){Et(t,"svelte-oeb4qr",".gcal-date-container.svelte-oeb4qr{margin-bottom:10px}.gcal-date-dayofweek.svelte-oeb4qr,.gcal-date-main.svelte-oeb4qr{margin:0px}.gcal-nav-container.svelte-oeb4qr{margin-bottom:1em}")}function zN(t){let e,n,r,i=t[0].format("dddd")+"",o,a,u,f=t[0].format("MMMM DD, YYYY")+"",c,p,h,m,_,v,b,E,y=(window.moment().isSame(t[1],"day")?"Today":"Start")+"",O,D,F,P,L,R,M,H,le;return{c(){e=N("div"),n=N("div"),r=N("h3"),o=Me(i),a=$(),u=N("h1"),c=Me(f),p=$(),h=N("div"),m=N("button"),m.textContent="<<",_=$(),v=N("button"),v.textContent="<",b=$(),E=N("button"),O=Me(y),D=$(),F=N("button"),F.textContent=">",P=$(),L=N("button"),L.textContent=">>",R=$(),M=N("button"),M.textContent="+",k(r,"class","gcal-date-dayofweek svelte-oeb4qr"),k(u,"class","gcal-date-main svelte-oeb4qr"),k(m,"class","gcal-nav-button"),k(m,"aria-label","Back 1 week"),k(v,"class","gcal-nav-button"),k(v,"aria-label","Back 1 day"),k(E,"class","gcal-nav-button"),k(E,"aria-label","Jump to today"),k(F,"class","gcal-nav-button"),k(F,"aria-label","Forward 1 day"),k(L,"class","gcal-nav-button"),k(L,"aria-label","Forward 1 week"),k(M,"class","gcal-new-event-button"),k(M,"aria-label","Create Event"),k(h,"class","gcal-nav-container svelte-oeb4qr"),k(n,"class","gcal-date-container svelte-oeb4qr"),k(e,"class","gcal-title-container")},m(V,X){G(V,e,X),A(e,n),A(n,r),A(r,o),A(n,a),A(n,u),A(u,c),A(n,p),A(n,h),A(h,m),A(h,_),A(h,v),A(h,b),A(h,E),A(E,O),A(h,D),A(h,F),A(h,P),A(h,L),A(h,R),A(h,M),H||(le=[oe(m,"click",t[2]),oe(v,"click",t[3]),oe(E,"click",t[4]),oe(F,"click",t[6]),oe(L,"click",t[5]),oe(M,"click",t[7])],H=!0)},p(V,[X]){X&1&&i!==(i=V[0].format("dddd")+"")&&Ye(o,i),X&1&&f!==(f=V[0].format("MMMM DD, YYYY")+"")&&Ye(c,f),X&2&&y!==(y=(window.moment().isSame(V[1],"day")?"Today":"Start")+"")&&Ye(O,y)},i:me,o:me,d(V){V&&B(e),H=!1,We(le)}}}function HN(t,e,n){let{date:r}=e,{startDate:i}=e,{dateOffset:o}=e,a=()=>n(8,o-=7),u=()=>n(8,o-=1),f=()=>n(8,o=0),c=()=>n(8,o+=7),p=()=>n(8,o+=1),h=m=>{new Nr({start:{},end:{}},()=>{zr(),n(0,r)}).open()};return t.$$set=m=>{"date"in m&&n(0,r=m.date),"startDate"in m&&n(1,i=m.startDate),"dateOffset"in m&&n(8,o=m.dateOffset)},[r,i,a,u,f,c,p,h,o]}var Rb=class extends ze{constructor(e){super();qe(this,e,HN,zN,Ge,{date:0,startDate:1,dateOffset:8},UN)}},pc=Rb;function qN(t){Et(t,"svelte-7dzwom",".googleCalendarEvent.svelte-7dzwom{display:flex;padding:0 10px 10px;cursor:pointer;border-radius:5px;color:black;font-size:small;box-shadow:3px 2px 8px 4px rgba(0,0,0,0.36);overflow:hidden}.eventContainer.svelte-7dzwom{grid-row:1 ;display:flex;flex-direction:column;gap:5px}.googleCalendarEvent_AllDay.svelte-7dzwom{border-radius:5px;width:100%;height:23px}")}function Lb(t,e,n){let r=t.slice();return r[5]=e[n],r}function Fb(t){let e,n,r=t[5].summary+"",i,o,a,u,f,c,p;function h(..._){return t[3](t[5],..._)}function m(..._){return t[4](t[5],..._)}return{c(){e=N("div"),n=N("span"),i=Me(r),a=$(),k(n,"class",o="googleCalendarName googleCalendarName_Calendar_Color_"+t[5].parent.colorId+" googleCalendarName_Event_Color_"+t[5].parent.colorId+" googleCalendarName_Id_"+t[5].parent.id+" googleCalendarName_AllDay svelte-7dzwom"),k(e,"class",u="googleCalendarEvent googleCalendarEvent_Calendar_Color_"+t[5].parent.colorId+" googleCalendarEvent_Event_Color_"+t[5].parent.colorId+" googleCalendarEvent_Id_"+t[5].parent.id+" googleCalendarEvent_AllDay svelte-7dzwom"),k(e,"id",f=t[5].id),he(e,"background",Fi(t[5])),he(e,"width",t[2]>0?t[2]+"px":"100%")},m(_,v){G(_,e,v),A(e,n),A(n,i),A(e,a),c||(p=[oe(e,"click",h),oe(e,"keypress",m)],c=!0)},p(_,v){t=_,v&1&&r!==(r=t[5].summary+"")&&Ye(i,r),v&1&&o!==(o="googleCalendarName googleCalendarName_Calendar_Color_"+t[5].parent.colorId+" googleCalendarName_Event_Color_"+t[5].parent.colorId+" googleCalendarName_Id_"+t[5].parent.id+" googleCalendarName_AllDay svelte-7dzwom")&&k(n,"class",o),v&1&&u!==(u="googleCalendarEvent googleCalendarEvent_Calendar_Color_"+t[5].parent.colorId+" googleCalendarEvent_Event_Color_"+t[5].parent.colorId+" googleCalendarEvent_Id_"+t[5].parent.id+" googleCalendarEvent_AllDay svelte-7dzwom")&&k(e,"class",u),v&1&&f!==(f=t[5].id)&&k(e,"id",f),v&1&&he(e,"background",Fi(t[5])),v&4&&he(e,"width",t[2]>0?t[2]+"px":"100%")},d(_){_&&B(e),c=!1,We(p)}}}function VN(t){let e,n=t[0],r=[];for(let i=0;ii(f,c),u=(f,c)=>i(f,c);return t.$$set=f=>{"events"in f&&n(0,r=f.events),"goToEvent"in f&&n(1,i=f.goToEvent),"width"in f&&n(2,o=f.width)},[r,i,o,a,u]}var Yb=class extends ze{constructor(e){super();qe(this,e,KN,VN,Ge,{events:0,goToEvent:1,width:2},qN)}},Wb=Yb;function ZN(t){Et(t,"svelte-12s6vs0",".gcal-stop-overflow.svelte-12s6vs0.svelte-12s6vs0{overflow:hidden;min-width:0;min-height:0}.gcal-week-container.svelte-12s6vs0.svelte-12s6vs0{position:relative;display:inline-grid;gap:1em;grid-auto-flow:row;overflow:hidden}.gcal-week-container.svelte-12s6vs0>.svelte-12s6vs0{min-width:0px;min-height:0px}.gcal-day-container.svelte-12s6vs0.svelte-12s6vs0{width:100%;display:grid;justify-content:center;align-items:center}.gcal-day.svelte-12s6vs0.svelte-12s6vs0,.gcal-dayofweek.svelte-12s6vs0.svelte-12s6vs0{display:flex;align-items:center;justify-content:center;font-size:medium}.gcal-day.svelte-12s6vs0.svelte-12s6vs0{font-weight:700;font-size:x-large}")}function jb(t,e,n){let r=t.slice();return r[20]=e[n],r[22]=n,r}function Bb(t,e,n){let r=t.slice();return r[20]=e[n],r[22]=n,r}function Gb(t,e,n){let r=t.slice();return r[20]=e[n],r[22]=n,r}function Ub(t){let e,n,r,i;function o(f){t[10](f)}function a(f){t[11](f)}let u={};return t[0]!==void 0&&(u.codeBlockOptions=t[0]),t[1]!==void 0&&(u.showSettings=t[1]),e=new di({props:u}),Ne.push(()=>tt(e,"codeBlockOptions",o)),Ne.push(()=>tt(e,"showSettings",a)),{c(){ct(e.$$.fragment)},m(f,c){ut(e,f,c),i=!0},p(f,c){let p={};!n&&c&1&&(n=!0,p.codeBlockOptions=f[0],et(()=>n=!1)),!r&&c&2&&(r=!0,p.showSettings=f[1],et(()=>r=!1)),e.$set(p)},i(f){i||(se(e.$$.fragment,f),i=!0)},o(f){de(e.$$.fragment,f),i=!1},d(f){st(e,f)}}}function zb(t){let e,n,r,i,o;function a(p){t[12](p)}function u(p){t[13](p)}function f(p){t[14](p)}let c={};return t[4]!==void 0&&(c.dateOffset=t[4]),t[5]!==void 0&&(c.date=t[5]),t[3]!==void 0&&(c.startDate=t[3]),e=new pc({props:c}),Ne.push(()=>tt(e,"dateOffset",a)),Ne.push(()=>tt(e,"date",u)),Ne.push(()=>tt(e,"startDate",f)),{c(){ct(e.$$.fragment)},m(p,h){ut(e,p,h),o=!0},p(p,h){let m={};!n&&h&16&&(n=!0,m.dateOffset=p[4],et(()=>n=!1)),!r&&h&32&&(r=!0,m.date=p[5],et(()=>r=!1)),!i&&h&8&&(i=!0,m.startDate=p[3],et(()=>i=!1)),e.$set(m)},i(p){o||(se(e.$$.fragment,p),o=!0)},o(p){de(e.$$.fragment,p),o=!1},d(p){st(e,p)}}}function XN(t){let e,n,r;return{c(){e=N("div"),n=$(),r=N("div"),k(e,"class","gcal-stop-overflow svelte-12s6vs0"),k(r,"class","gcal-stop-overflow svelte-12s6vs0")},m(i,o){G(i,e,o),G(i,n,o),G(i,r,o)},p:me,d(i){i&&B(e),i&&B(n),i&&B(r)}}}function JN(t){let e,n,r,i=t[8](t[5]),o=[];for(let a=0;ade(a[f],1,1,()=>{a[f]=null});return{c(){e=N("div"),n=$();for(let f=0;f1?JN:XN}let b=v(t,-1),E=b(t),y=t[0].showAllDay&&qb(t);f=new Ib({props:{hourRange:t[0].hourRange}});let O=t[8](t[5]),D=[];for(let P=0;Pde(D[P],1,1,()=>{D[P]=null});return{c(){m&&m.c(),e=$(),n=N("div"),_&&_.c(),r=$(),i=N("div"),E.c(),o=$(),y&&y.c(),a=$(),u=N("div"),ct(f.$$.fragment),c=$();for(let P=0;P{m=null}),Qe()),P[0].navigation&&P[5]?_?(_.p(P,L),L&33&&se(_,1)):(_=zb(P),_.c(),se(_,1),_.m(n,r)):_&&(Je(),de(_,1,1,()=>{_=null}),Qe()),b===(b=v(P,L))&&E?E.p(P,L):(E.d(1),E=b(P),E&&(E.c(),E.m(i,o))),P[0].showAllDay?y?(y.p(P,L),L&1&&se(y,1)):(y=qb(P),y.c(),se(y,1),y.m(i,a)):y&&(Je(),de(y,1,1,()=>{y=null}),Qe());let R={};if(L&1&&(R.hourRange=P[0].hourRange),f.$set(R),L&481){O=P[8](P[5]);let M;for(M=0;MTt(void 0,void 0,void 0,function*(){if(!(R==null?void 0:R.isValid())){c=!1;return}let M=yield Yt({startDate:R,endDate:R.clone().add(r.timespan,"days"),include:r.include,exclude:r.exclude});JSON.stringify(M)!=JSON.stringify(p)&&n(6,p=M)}),_=R=>Tt(void 0,void 0,void 0,function*(){c||(c=!0,yield m(R),c=!1)}),v=(R,M)=>{M.shiftKey?window.open(R.htmlLink):new Nr(R,()=>{zr(),_(f)}).open()},b=R=>{let M=[];for(let H=0;H{clearInterval(h)});function E(R){r=R,n(0,r)}function y(R){o=R,n(1,o)}function O(R){u=R,n(4,u)}function D(R){f=R,n(5,f),n(0,r),n(3,a),n(4,u),n(9,h)}function F(R){a=R,n(3,a),n(0,r),n(4,u),n(9,h),n(5,f)}let P=(R,M)=>M.start.date&&window.moment(M.start.date).isSame(R,"day"),L=(R,M)=>M.start.dateTime&&window.moment(M.start.dateTime).isSame(R,"day");return t.$$set=R=>{"codeBlockOptions"in R&&n(0,r=R.codeBlockOptions),"isObsidianView"in R&&n(2,i=R.isObsidianView),"showSettings"in R&&n(1,o=R.showSettings)},t.$$.update=()=>{if(t.$$.dirty&569){e:n(3,a=r.date?window.moment(r.date).add(r.offset,"days"):window.moment().add(r.offset,"days")),n(5,f=r.navigation?a.clone().local().add(u,"days"):a),h&&clearInterval(h),n(9,h=setInterval(()=>_(f),5e3)),_(f)}},[r,o,i,a,u,f,p,v,b,h,E,y,O,D,F,P,L]}var Zb=class extends ze{constructor(e){super();qe(this,e,$N,QN,Ge,{codeBlockOptions:0,isObsidianView:2,showSettings:1},ZN)}},cs=Zb;var ds="google-calendar-view-day",Pl=class extends Xb.ItemView{constructor(e,n=window.moment()){super(e);this.showSettings=!1;this.setDate=e=>{this.startDate=e,this.onClose(),this.onOpen()};this.startDate=n}getViewType(){return ds}getDisplayText(){return"Timeline View"}getIcon(){return"calendar-with-checkmark"}onPaneMenu(e,n){super.onPaneMenu(e,n),this.showSettings=this.timeline.$$.ctx[1],e.addItem(r=>{r.setTitle("Refresh"),r.setIcon("sync"),r.onClick(()=>{this.onClose(),this.onOpen()})}).addSeparator().addItem(r=>{r.setTitle(this.showSettings?"Hide Settings":"Settings"),r.setIcon("gear"),r.onClick(()=>{this.showSettings=!this.showSettings,this.timeline.$set({showSettings:this.showSettings})})})}onOpen(){return te(this,null,function*(){let n=ye.getInstance().settings.viewSettings.day;n.timespan=1,this.timeline=new cs({target:this.contentEl,props:{codeBlockOptions:n,isObsidianView:!0,showSettings:this.showSettings}})})}onClose(){return te(this,null,function*(){this.timeline.$destroy()})}};var ik=Oe(require("obsidian"));function e4(t){Et(t,"svelte-tlsedz",`.gcal-schedule-day-container.svelte-tlsedz{display:flex;flex-direction:row;align-items:flex-start;border-bottom:1px solid gray;margin:2px 0px;padding:2px 0px;width:100% - }.gcal-schedule-date-display.svelte-tlsedz{display:flex;flex-direction:row;align-items:center;gap:5px;padding:0px}.gcal-schedule-day-circle.svelte-tlsedz{border-radius:50%;-moz-border-radius:50%;-webkit-border-radius:50%;display:inline-block;border:solid 1px gray;min-height:40px;min-width:40px;width:50px;height:50px;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center}.today.svelte-tlsedz{color:white;background:#4285f4;text-decoration:none}.gcal-schedule-month-text.svelte-tlsedz{font-size:small}.gcal-schedule-day-number.svelte-tlsedz{font-size:large;font-weight:700}.gcal-schedule-day-text.svelte-tlsedz{font-size:medium}.gcal-schedule-event-container.svelte-tlsedz{display:flex;flex-direction:column;overflow:hidden;width:100%}.gcal-schedule-event.svelte-tlsedz{display:flex;padding:5px;border-radius:10px;cursor:pointer}.gcal-schedule-event.svelte-tlsedz:hover{background-color:rgba(128, 128, 128, 0.129)}.gcal-schedule-event-info.svelte-tlsedz{display:flex;align-items:center}.gcal-schedule-circle-container-recurring.svelte-tlsedz,.gcal-schedule-circle-container.svelte-tlsedz{position:relative;display:flex;min-width:30px;height:30px;align-items:center;justify-content:center}.gcal-schedule-circle-container-recurring.svelte-tlsedz::after{content:"\u21BA";position:absolute;width:30px;height:30px;text-align:center;line-height:30px;font-size:30px;color:rgb(164, 164, 164);top:1.5px;white-space:nowrap}.gcal-schedule-event-circle.svelte-tlsedz{width:10px;min-width:10px;height:10px;border-radius:50%}.gcal-schedule-time-container.svelte-tlsedz{min-width:150px;padding-right:1em}.gcal-schedule-event-title-container.svelte-tlsedz{display:flex;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.gcal-schedule-event-title.svelte-tlsedz{font-size:medium;font-weight:400;overflow:hidden;text-overflow:ellipsis}.breakLine.svelte-tlsedz{flex-direction:column;margin-bottom:10px}`)}function Jb(t,e,n){let r=t.slice();return r[30]=e[n][0],r[9]=e[n][1],r}function Qb(t,e,n){let r=t.slice();return r[33]=e[n],r}function $b(t){let e,n,r,i;function o(f){t[16](f)}function a(f){t[17](f)}let u={};return t[0]!==void 0&&(u.codeBlockOptions=t[0]),t[1]!==void 0&&(u.showSettings=t[1]),e=new di({props:u}),Ne.push(()=>tt(e,"codeBlockOptions",o)),Ne.push(()=>tt(e,"showSettings",a)),{c(){ct(e.$$.fragment)},m(f,c){ut(e,f,c),i=!0},p(f,c){let p={};!n&&c[0]&1&&(n=!0,p.codeBlockOptions=f[0],et(()=>n=!1)),!r&&c[0]&2&&(r=!0,p.showSettings=f[1],et(()=>r=!1)),e.$set(p)},i(f){i||(se(e.$$.fragment,f),i=!0)},o(f){de(e.$$.fragment,f),i=!1},d(f){st(e,f)}}}function ek(t){let e,n,r,i,o;function a(p){t[18](p)}function u(p){t[19](p)}function f(p){t[20](p)}let c={};return t[4]!==void 0&&(c.dateOffset=t[4]),t[5]!==void 0&&(c.date=t[5]),t[3]!==void 0&&(c.startDate=t[3]),e=new pc({props:c}),Ne.push(()=>tt(e,"dateOffset",a)),Ne.push(()=>tt(e,"date",u)),Ne.push(()=>tt(e,"startDate",f)),{c(){ct(e.$$.fragment)},m(p,h){ut(e,p,h),o=!0},p(p,h){let m={};!n&&h[0]&16&&(n=!0,m.dateOffset=p[4],et(()=>n=!1)),!r&&h[0]&32&&(r=!0,m.date=p[5],et(()=>r=!1)),!i&&h[0]&8&&(i=!0,m.startDate=p[3],et(()=>i=!1)),e.$set(m)},i(p){o||(se(e.$$.fragment,p),o=!0)},o(p){de(e.$$.fragment,p),o=!1},d(p){st(e,p)}}}function tk(t){let e,n,r,i,o,a,u,f,c=t[10](t[33],t[7])+"",p,h,m,_,v=t[33].summary+"",b,E,y,O,D;function F(...L){return t[23](t[33],...L)}function P(...L){return t[24](t[33],...L)}return{c(){e=N("div"),n=N("div"),r=N("div"),i=N("div"),a=$(),u=N("div"),f=N("span"),p=Me(c),h=$(),m=N("div"),_=N("span"),b=Me(v),E=$(),k(i,"class","gcal-schedule-event-circle svelte-tlsedz"),he(i,"background",Fi(t[33])),k(r,"class",o=""+(en(t[33].recurringEventId?"gcal-schedule-circle-container-recurring":"gcal-schedule-circle-container")+" svelte-tlsedz")),k(u,"class","gcal-schedule-time-container svelte-tlsedz"),k(n,"class","gcal-schedule-event-info svelte-tlsedz"),k(_,"class","gcal-schedule-event-title svelte-tlsedz"),k(m,"class","gcal-schedule-event-title-container svelte-tlsedz"),k(e,"class",y=""+(en(t[8]<200?"gcal-schedule-event breakLine":"gcal-schedule-event")+" svelte-tlsedz"))},m(L,R){G(L,e,R),A(e,n),A(n,r),A(r,i),A(n,a),A(n,u),A(u,f),A(f,p),A(e,h),A(e,m),A(m,_),A(_,b),A(e,E),O||(D=[oe(e,"click",F),oe(e,"keypress",P)],O=!0)},p(L,R){t=L,R[0]&64&&he(i,"background",Fi(t[33])),R[0]&64&&o!==(o=""+(en(t[33].recurringEventId?"gcal-schedule-circle-container-recurring":"gcal-schedule-circle-container")+" svelte-tlsedz"))&&k(r,"class",o),R[0]&192&&c!==(c=t[10](t[33],t[7])+"")&&Ye(p,c),R[0]&64&&v!==(v=t[33].summary+"")&&Ye(b,v),R[0]&256&&y!==(y=""+(en(t[8]<200?"gcal-schedule-event breakLine":"gcal-schedule-event")+" svelte-tlsedz"))&&k(e,"class",y)},d(L){L&&B(e),O=!1,We(D)}}}function nk(t){let e,n,r,i,o=t[30].slice(3,6)+"",a,u,f,c=t[30].slice(0,2)+"",p,h,m,_,v=t[30].slice(7)+"",b,E,y,O,D,F,P;function L(){return t[21](t[9])}function R(){return t[22](t[9])}let M=t[9],H=[];for(let le=0;let[25].call(n))},m(p,h){a&&a.m(p,h),G(p,e,h),G(p,n,h),u&&u.m(n,null),A(n,r);for(let m=0;m{a=null}),Qe()),p[0].navigation&&p[5]?u?(u.p(p,h),h[0]&33&&se(u,1)):(u=ek(p),u.c(),se(u,1),u.m(n,r)):u&&(Je(),de(u,1,1,()=>{u=null}),Qe()),h[0]&32192){f=[...p[6]];let m;for(m=0;mTt(void 0,void 0,void 0,function*(){if(p)return;if(!(j==null?void 0:j.isValid())){p=!1;return}n(7,v=a.settings.timelineHourFormat);let U=yield Yt({startDate:j,endDate:j.clone().add(r.timespan-1,"day"),include:r.include,exclude:r.exclude});if(U=U.filter(J=>{if(J.start.date)return r.showAllDay;let re=window.moment(J.start.dateTime),Y=window.moment(J.end.dateTime),z=re.minutes()>0?re.hour()+1:re.hour(),ee=Y.minutes()>0?Y.hour()+1:Y.hour();return z>=r.hourRange[0]&&z<=r.hourRange[1]||ee>=r.hourRange[0]&&ee<=r.hourRange[1]||zr.hourRange[1]}),JSON.stringify(U)==JSON.stringify(h)){p=!1;return}_.clear(),n(9,h=U),h.forEach(J=>{let re=J.start.date?window.moment(J.start.date).format("DD MMM, ddd"):window.moment(J.start.dateTime).format("DD MMM, ddd");_.has(re)?_.get(re).push(J):_.set(re,[J])}),n(6,_)}),y=(j,U)=>{switch(U){case 0:return j.format("H:mm");case 1:return j.format("HH:mm");case 2:return j.format("h:mm");case 3:return j.format("hh:mm");case 4:return j.format("h:mm A");case 5:return j.format("hh:mm A")}},O=(j,U)=>{if(j.start.date)return"All day";{let J=y(window.moment(j.start.dateTime),U),re=y(window.moment(j.end.dateTime),U);return`${J}-${re}`}},D=(j,U)=>{U.shiftKey?window.open(j.htmlLink):new Nr(j,()=>{zr(),E(c)}).open()},F=j=>Tt(void 0,void 0,void 0,function*(){let U=window.moment(j.start.date||j.start.dateTime),J=yield Yt({startDate:U});new dr(J,"details",U,!1,()=>{zr(),E(c)}).open()}),P=j=>{let U=window.moment(j.start.date||j.start.dateTime);return window.moment().local().isSame(U,"day")};Jo(()=>{clearInterval(m)});let L=()=>{n(7,v+=1),v>5&&n(7,v=0),a.settings.timelineHourFormat=v,a.saveSettings()};function R(j){r=j,n(0,r)}function M(j){o=j,n(1,o)}function H(j){f=j,n(4,f)}function le(j){c=j,n(5,c),n(0,r),n(3,u),n(4,f),n(15,m)}function V(j){u=j,n(3,u),n(0,r),n(4,f),n(15,m),n(5,c)}let X=j=>F(j[0]),K=j=>F(j[0]),ce=(j,U)=>D(j,U),S=(j,U)=>D(j,U);function Q(){b=this.clientWidth,n(8,b)}return t.$$set=j=>{"codeBlockOptions"in j&&n(0,r=j.codeBlockOptions),"isObsidianView"in j&&n(2,i=j.isObsidianView),"showSettings"in j&&n(1,o=j.showSettings)},t.$$.update=()=>{if(t.$$.dirty[0]&32825){e:n(3,u=r.date?window.moment(r.date).add(r.offset,"days"):window.moment().add(r.offset,"days")),n(5,c=r.navigation?u.clone().local().add(f,"days"):u),m&&clearInterval(m),n(15,m=setInterval(()=>E(c),5e3)),E(c)}},[r,o,i,u,f,c,_,v,b,h,O,D,F,P,L,m,R,M,H,le,V,X,K,ce,S,Q]}var rk=class extends ze{constructor(e){super();qe(this,e,n4,t4,Ge,{codeBlockOptions:0,isObsidianView:2,showSettings:1},e4,[-1,-1])}},hc=rk;var To="google-calendar-view-schedule",ba=class extends ik.ItemView{constructor(e,n=window.moment()){super(e);this.showSettings=!1;this.setDate=e=>{this.startDate=e,this.onClose(),this.onOpen()};this.startDate=n}getViewType(){return To}getDisplayText(){return"Schedule View"}getIcon(){return"calendar-with-checkmark"}onPaneMenu(e,n){super.onPaneMenu(e,n),this.showSettings=this.calendar.$$.ctx[1],e.addItem(r=>{r.setTitle("Refresh"),r.setIcon("sync"),r.onClick(()=>{this.onClose(),this.onOpen()})}).addSeparator().addItem(r=>{r.setTitle(this.showSettings?"Hide Settings":"Settings"),r.setIcon("gear"),r.onClick(()=>{this.showSettings=!this.showSettings,this.calendar.$set({showSettings:this.showSettings})})})}onOpen(){return te(this,null,function*(){let n=ye.getInstance().settings.viewSettings.schedule;this.calendar=new hc({target:this.contentEl,props:{codeBlockOptions:n,isObsidianView:!0,showSettings:this.showSettings}})})}onClose(){return te(this,null,function*(){this.calendar.$destroy()})}};var ok=Oe(require("obsidian"));var So="google-calendar-view-week",Nl=class extends ok.ItemView{constructor(e,n=window.moment()){super(e);this.showSettings=!1;this.setDate=e=>{this.startDate=e,this.onClose(),this.onOpen()};this.startDate=n}getViewType(){return So}getDisplayText(){return"Week View"}getIcon(){return"calendar-with-checkmark"}onPaneMenu(e,n){super.onPaneMenu(e,n),this.showSettings=this.calendar.$$.ctx[1],e.addItem(r=>{r.setTitle("Refresh"),r.setIcon("sync"),r.onClick(()=>{this.onClose(),this.onOpen()})}).addSeparator().addItem(r=>{r.setTitle(this.showSettings?"Hide Settings":"Settings"),r.setIcon("gear"),r.onClick(()=>{this.showSettings=!this.showSettings,this.calendar.$set({showSettings:this.showSettings})})})}onOpen(){return te(this,null,function*(){let n=ye.getInstance().settings.viewSettings.week;this.calendar=new cs({target:this.contentEl,props:{codeBlockOptions:n,isObsidianView:!0,showSettings:this.showSettings}})})}onClose(){return te(this,null,function*(){this.calendar.$destroy()})}};function ak(t){let e,n,r,i;function o(f){t[14](f)}function a(f){t[15](f)}let u={};return t[0]!==void 0&&(u.codeBlockOptions=t[0]),t[1]!==void 0&&(u.showSettings=t[1]),e=new di({props:u}),Ne.push(()=>tt(e,"codeBlockOptions",o)),Ne.push(()=>tt(e,"showSettings",a)),{c(){ct(e.$$.fragment)},m(f,c){ut(e,f,c),i=!0},p(f,c){let p={};!n&&c&1&&(n=!0,p.codeBlockOptions=f[0],et(()=>n=!1)),!r&&c&2&&(r=!0,p.showSettings=f[1],et(()=>r=!1)),e.$set(p)},i(f){i||(se(e.$$.fragment,f),i=!0)},o(f){de(e.$$.fragment,f),i=!1},d(f){st(e,f)}}}function r4(t){let e,n,r,i=`${t[0].width}px`,o=`${t[0].height}px`,a,u=[s4,o4],f=[];function c(p,h){return p[4]?0:1}return n=c(t,-1),r=f[n]=u[n](t),{c(){e=N("div"),r.c(),k(e,"class","gcal-calendar-container"),he(e,"width",i),he(e,"height",o)},m(p,h){G(p,e,h),f[n].m(e,null),a=!0},p(p,h){let m=n;n=c(p,h),n===m?f[n].p(p,h):(Je(),de(f[m],1,1,()=>{f[m]=null}),Qe(),r=f[n],r?r.p(p,h):(r=f[n]=u[n](p),r.c()),se(r,1),r.m(e,null)),h&1&&i!==(i=`${p[0].width}px`)&&he(e,"width",i),h&1&&o!==(o=`${p[0].height}px`)&&he(e,"height",o)},i(p){a||(se(r),a=!0)},o(p){de(r),a=!1},d(p){p&&B(e),f[n].d()}}}function i4(t){let e,n,r,i,o=[l4,a4],a=[];function u(f,c){return f[4]?0:1}return n=u(t,-1),r=a[n]=o[n](t),{c(){e=N("div"),r.c(),k(e,"class","gcal-calendar-container")},m(f,c){G(f,e,c),a[n].m(e,null),i=!0},p(f,c){let p=n;n=u(f,c),n===p?a[n].p(f,c):(Je(),de(a[p],1,1,()=>{a[p]=null}),Qe(),r=a[n],r?r.p(f,c):(r=a[n]=o[n](f),r.c()),se(r,1),r.m(e,null))},i(f){i||(se(r),i=!0)},o(f){de(r),i=!1},d(f){f&&B(e),a[n].d()}}}function o4(t){let e,n,r,i,o,a;function u(h){t[19](h)}function f(h){t[20](h)}function c(h){t[21](h)}let p={showWeekNums:!1,onClickDay:t[8]};return t[5]!==void 0&&(p.sources=t[5]),t[3]!==void 0&&(p.displayedMonth=t[3]),t[6]!==void 0&&(p.today=t[6]),n=new cc({props:p}),Ne.push(()=>tt(n,"sources",u)),Ne.push(()=>tt(n,"displayedMonth",f)),Ne.push(()=>tt(n,"today",c)),{c(){e=N("div"),ct(n.$$.fragment),he(e,"--theme-color",t[7].settings.dailyNoteDotColor)},m(h,m){G(h,e,m),ut(n,e,null),a=!0},p(h,m){let _={};!r&&m&32&&(r=!0,_.sources=h[5],et(()=>r=!1)),!i&&m&8&&(i=!0,_.displayedMonth=h[3],et(()=>i=!1)),!o&&m&64&&(o=!0,_.today=h[6],et(()=>o=!1)),n.$set(_),(!a||m&128)&&he(e,"--theme-color",h[7].settings.dailyNoteDotColor)},i(h){a||(se(n.$$.fragment,h),a=!0)},o(h){de(n.$$.fragment,h),a=!1},d(h){h&&B(e),st(n)}}}function s4(t){let e;return{c(){e=N("p"),e.textContent="Loading..."},m(n,r){G(n,e,r)},p:me,i:me,o:me,d(n){n&&B(e)}}}function a4(t){let e,n,r,i,o,a;function u(h){t[16](h)}function f(h){t[17](h)}function c(h){t[18](h)}let p={showWeekNums:t[7].settings.useWeeklyNotes,onClickDay:t[8],onClickWeek:t[9],onContextMenuDay:t[10],onContextMenuWeek:t[11]};return t[5]!==void 0&&(p.sources=t[5]),t[3]!==void 0&&(p.displayedMonth=t[3]),t[6]!==void 0&&(p.today=t[6]),n=new cc({props:p}),Ne.push(()=>tt(n,"sources",u)),Ne.push(()=>tt(n,"displayedMonth",f)),Ne.push(()=>tt(n,"today",c)),{c(){e=N("div"),ct(n.$$.fragment),he(e,"--daily-dot-color",t[7].settings.dailyNoteDotColor)},m(h,m){G(h,e,m),ut(n,e,null),a=!0},p(h,m){let _={};m&128&&(_.showWeekNums=h[7].settings.useWeeklyNotes),!r&&m&32&&(r=!0,_.sources=h[5],et(()=>r=!1)),!i&&m&8&&(i=!0,_.displayedMonth=h[3],et(()=>i=!1)),!o&&m&64&&(o=!0,_.today=h[6],et(()=>o=!1)),n.$set(_),(!a||m&128)&&he(e,"--daily-dot-color",h[7].settings.dailyNoteDotColor)},i(h){a||(se(n.$$.fragment,h),a=!0)},o(h){de(n.$$.fragment,h),a=!1},d(h){h&&B(e),st(n)}}}function l4(t){let e;return{c(){e=N("p"),e.textContent="Loading..."},m(n,r){G(n,e,r)},p:me,i:me,o:me,d(n){n&&B(e)}}}function u4(t){let e,n,r,i,o,a=t[2]&&ak(t),u=[i4,r4],f=[];function c(p,h){return!p[0].width||!p[0].height?0:1}return n=c(t,-1),r=f[n]=u[n](t),{c(){a&&a.c(),e=$(),r.c(),i=zt()},m(p,h){a&&a.m(p,h),G(p,e,h),f[n].m(p,h),G(p,i,h),o=!0},p(p,[h]){p[2]?a?(a.p(p,h),h&4&&se(a,1)):(a=ak(p),a.c(),se(a,1),a.m(e.parentNode,e)):a&&(Je(),de(a,1,1,()=>{a=null}),Qe());let m=n;n=c(p,h),n===m?f[n].p(p,h):(Je(),de(f[m],1,1,()=>{f[m]=null}),Qe(),r=f[n],r?r.p(p,h):(r=f[n]=u[n](p),r.c()),se(r,1),r.m(i.parentNode,i))},i(p){o||(se(a),se(r),o=!0)},o(p){de(a),de(r),o=!1},d(p){a&&a.d(p),p&&B(e),f[n].d(p),p&&B(i)}}}function f4(t,e,n){let{codeBlockOptions:r}=e,{isObsidianView:i=!1}=e,{showSettings:o=!1}=e,a,u=Uu(),f,c,p,h=!0,m,_=window.moment(),v=ye.getInstance();function b(S){return Tt(this,void 0,void 0,function*(){n(7,v);let Q=S.clone().startOf("month").subtract(6,"days"),j=S.clone().endOf("month").add(12,"days"),U=yield Yt({startDate:Q,endDate:j,include:r.include,exclude:r.exclude});if(mc.default.isEqual(U,p)&&mc.default.isEqual(u,Uu()))return;u=Uu();let J=mc.default.groupBy(U,Y=>{var z;return window.moment((z=Y.start.date)!==null&&z!==void 0?z:Y.start.dateTime).startOf("day").format()});p=U;let re={getWeeklyMetadata:Y=>Tt(this,void 0,void 0,function*(){let z=[];return v.settings.activateDailyNoteAddon&&v.settings.useWeeklyNotes&&ll(Y)&&(z=[{isFilled:!0,className:"googleCalendarDailyDot",color:"default"}]),{dataAttributes:{amount:z.length+""},dots:z}}),getDailyMetadata:Y=>Tt(this,void 0,void 0,function*(){let z=[];v.settings.activateDailyNoteAddon&&Zo(Y)&&(z=[{isFilled:!0,className:"googleCalendarDailyDot",color:"default"}]);let ee=J[Y.startOf("day").format()];return ee?(z=[...z,...Array(ee.length).fill({isFilled:!0,className:"googleCalendarDot",color:"default"})],{dataAttributes:{amount:ee.length+""},dots:z}):{dataAttributes:{amount:z.length+""},dots:z}})};n(4,h=!1),n(5,m=null),n(5,m=[re])})}let E=(S,Q)=>S.filter(j=>j.start.date?window.moment(j.start.date).isSame(Q,"day"):window.moment(j.start.dateTime).isSame(Q,"day")),y=(S,Q)=>{new dr(E(p,S),"details",S,!1,()=>{zr(),n(3,a)}).open()},O=(S,Q)=>Tt(void 0,void 0,void 0,function*(){let j=ll(S);j||(j=yield(0,sk.createWeeklyNote)(S)),yield app.workspace.getLeaf(!1).openFile(j,{active:!0})}),D=(S,Q,j)=>Q.ctrlKey?(Li({date:S,openInNewTab:!0,type:j}),!1):Q.shiftKey?(Li({date:S,openInNewTab:!1,type:j}),!1):Q.altKey&&xl.Platform.isDesktop?(Dp({date:S,type:j}),!1):!0,F=(S,Q)=>{let j=Q==="daily"?Zo(S):ll(S),U=Q.charAt(0).toUpperCase()+Q.slice(1),J=new xl.Menu;return j?(J.addItem(re=>{re.setTitle(`Open ${U} Note`),re.setIcon("file"),re.onClick(()=>{Li({date:S,openInNewTab:!1,type:Q})})}),J.addItem(re=>{re.setTitle(`Open ${U} Note Split Right`),re.setIcon("vertical-split"),re.onClick(()=>{Li({date:S,openInNewTab:!0,openToRight:"horizontal",type:Q})})}),J.addItem(re=>{re.setTitle(`Open ${U} Note Split Down`),re.setIcon("horizontal-split"),re.onClick(()=>{Li({date:S,openInNewTab:!0,openToRight:"vertical",type:Q})})}),xl.Platform.isDesktop&&J.addItem(re=>{re.setTitle(`Open ${U} Note in new Window`),re.setIcon("fullscreen"),re.onClick(()=>{Dp({date:S,type:Q})})})):(J.addItem(re=>{re.setTitle(`Create ${U} Note`),re.setIcon("create-new"),re.onClick(()=>{Li({date:S,openInNewTab:!1,type:Q})})}),J.addItem(re=>{re.setTitle(`Create ${U} Note Split Right`),re.setIcon("vertical-split"),re.onClick(()=>{Li({date:S,openInNewTab:!0,openToRight:"horizontal",type:Q})})}),J.addItem(re=>{re.setTitle(`Create ${U} Note Split Down`),re.setIcon("horizontal-split"),re.onClick(()=>{Li({date:S,openInNewTab:!0,openToRight:"vertical",type:Q})})})),Q==="daily"?(J.addSeparator(),J.addItem(re=>{re.setTitle("Open Timeline View"),re.setIcon("calendar"),re.onClick(()=>Tt(void 0,void 0,void 0,function*(){let Y=yield v.initView(ds);Y.view instanceof Pl&&Y.view.setDate(S)}))}),J.addItem(re=>{re.setTitle("Open Schedule View"),re.setIcon("bullet-list"),re.onClick(()=>Tt(void 0,void 0,void 0,function*(){let Y=yield v.initView(To);Y.view instanceof ba&&Y.view.setDate(S)}))})):(J.addSeparator(),J.addItem(re=>{re.setTitle("Open Weekly View"),re.setIcon("calendar"),re.onClick(()=>Tt(void 0,void 0,void 0,function*(){let Y=yield v.initView(So);Y.view instanceof Nl&&Y.view.setDate(S)}))}),J.addItem(re=>{re.setTitle("Open Schedule View"),re.setIcon("bullet-list"),re.onClick(()=>Tt(void 0,void 0,void 0,function*(){let Y=yield v.initView(To);Y.view instanceof ba&&Y.view.setDate(S)}))})),J},P=(S,Q)=>(D(S,Q,"daily")&&F(S,"daily").showAtPosition({x:Q.clientX,y:Q.clientY}),!0),L=(S,Q)=>(D(S,Q,"weekly")&&F(S,"weekly").showAtPosition({x:Q.clientX,y:Q.clientY}),!0);Yi(()=>{n(3,a=r.date?window.moment(r.date).add(r.offset,"month"):window.moment().add(r.offset,"month"))}),Jo(()=>{clearInterval(f),clearInterval(c)});function R(S){r=S,n(0,r)}function M(S){o=S,n(1,o)}function H(S){m=S,n(5,m)}function le(S){a=S,n(3,a)}function V(S){_=S,n(6,_),n(3,a),n(12,f),n(13,c)}function X(S){m=S,n(5,m)}function K(S){a=S,n(3,a)}function ce(S){_=S,n(6,_),n(3,a),n(12,f),n(13,c)}return t.$$set=S=>{"codeBlockOptions"in S&&n(0,r=S.codeBlockOptions),"isObsidianView"in S&&n(2,i=S.isObsidianView),"showSettings"in S&&n(1,o=S.showSettings)},t.$$.update=()=>{if(t.$$.dirty&12296){e:a&&(f&&clearInterval(f),n(12,f=setInterval(()=>b(a),1e3)),c&&clearInterval(c),n(13,c=setInterval(()=>n(6,_=window.moment()),6e4)),b(a))}},[r,o,i,a,h,m,_,v,y,O,P,L,f,c,R,M,H,le,V,X,K,ce]}var lk=class extends ze{constructor(e){super();qe(this,e,f4,u4,Ge,{codeBlockOptions:0,isObsidianView:2,showSettings:1})}},gc=lk;var{Map:c4}=of;function d4(t){Et(t,"svelte-f5i6ri",".yearNav.svelte-f5i6ri{margin-bottom:10px}.yearContainer.svelte-f5i6ri{overflow-x:scroll;width:fit-content}.monthLabelContainer.svelte-f5i6ri{display:flex;flex-direction:row;justify-content:space-between}.dayContainer.svelte-f5i6ri{display:grid;grid-template-rows:repeat(7, minmax(0, 1fr));gap:2px 2px;grid-auto-flow:column dense;overflow-x:scroll;cursor:pointer}.square.svelte-f5i6ri{display:inline-flex;align-items:center;justify-content:center;min-width:0;min-height:0;display:inline-block;border-radius:2px}.square.svelte-f5i6ri:hover{filter:drop-shadow(0 0 5px #00e1ff)}.fistDayOfMonth.svelte-f5i6ri{outline:2px solid #ff000080}.weekDayName.svelte-f5i6ri{display:flex;grid-row:span 2;line-height:1;justify-self:flex-end}")}function uk(t,e,n){let r=t.slice();return r[26]=e[n][0],r[6]=e[n][1],r[28]=n,r}function fk(t,e,n){let r=t.slice();return r[29]=e[n],r[28]=n,r}function ck(t,e,n){let r=t.slice();return r[31]=e[n],r[28]=n,r}function dk(t){let e,n,r,i;function o(f){t[13](f)}function a(f){t[14](f)}let u={};return t[0]!==void 0&&(u.codeBlockOptions=t[0]),t[1]!==void 0&&(u.showSettings=t[1]),e=new di({props:u}),Ne.push(()=>tt(e,"codeBlockOptions",o)),Ne.push(()=>tt(e,"showSettings",a)),{c(){ct(e.$$.fragment)},m(f,c){ut(e,f,c),i=!0},p(f,c){let p={};!n&&c[0]&1&&(n=!0,p.codeBlockOptions=f[0],et(()=>n=!1)),!r&&c[0]&2&&(r=!0,p.showSettings=f[1],et(()=>r=!1)),e.$set(p)},i(f){i||(se(e.$$.fragment,f),i=!0)},o(f){de(e.$$.fragment,f),i=!1},d(f){st(e,f)}}}function pk(t){let e,n,r,i,o,a,u,f;return{c(){e=N("div"),n=N("button"),n.textContent="<",r=$(),i=N("button"),i.textContent="START",o=$(),a=N("button"),a.textContent=">",k(n,"class","yearNavButton"),k(i,"class","yearNavButton"),k(a,"class","yearNavButton"),k(e,"class","yearNav svelte-f5i6ri")},m(c,p){G(c,e,p),A(e,n),A(e,r),A(e,i),A(e,o),A(e,a),u||(f=[oe(n,"click",t[15]),oe(i,"click",t[16]),oe(a,"click",t[17])],u=!0)},p:me,d(c){c&&B(e),u=!1,We(f)}}}function hk(t){let e,n=t[31]+"",r,i=`${t[0].size}px`;return{c(){e=N("span"),r=Me(n),k(e,"class","monthLabel"),he(e,"font-size",i)},m(o,a){G(o,e,a),A(e,r)},p(o,a){a[0]&1&&i!==(i=`${o[0].size}px`)&&he(e,"font-size",i)},d(o){o&&B(e)}}}function mk(t){let e,n=Array.from({length:7-window.moment(t[26]).day()}),r=[];for(let i=0;i{!m||(c&&c.end(1),f=rf(o,e[8],{key:e[28]}),f.start())}),m=!0)},o(O){f&&f.invalidate(),c=F1(o,e[7],{key:e[28]}),m=!1},d(O){O&&B(n),b&&b.d(O),O&&B(i),O&&B(o),O&&c&&c.end(),_=!1,We(v)}}}function p4(t){let e,n,r,i,o,a,u=window.moment(t[4]).year()+"",f,c=`${t[0].size}px`,p,h,m,_=`${t[0].size}px`,v,b,E,y,O,D=`${t[0].size}px`,F,P,L=`${t[0].size}px`,R,M,H=`${t[0].size}px`,le,V=[],X=new c4,K,ce,S=t[2]&&dk(t),Q=t[0].navigation&&pk(t),j=t[11],U=[];for(let Y=0;YY[28];for(let Y=0;Y{S=null}),Qe()),Y[0].navigation?Q?Q.p(Y,z):(Q=pk(Y),Q.c(),Q.m(e,r)):Q&&(Q.d(1),Q=null),(!ce||z[0]&16)&&u!==(u=window.moment(Y[4]).year()+"")&&Ye(f,u),z[0]&1&&c!==(c=`${Y[0].size}px`)&&he(a,"font-size",c),z[0]&2049){j=Y[11];let ee;for(ee=0;eeMath.sqrt(K*200),fallback(K,ce){let S=getComputedStyle(K),Q=S.transform==="none"?"":S.transform;return{duration:600,easing:Jf,css:j=>` - transform: ${Q} scale(${j}); - opacity: ${j} - `}}}),b=K=>Tt(void 0,void 0,void 0,function*(){if(!(K==null?void 0:K.isValid())){c=!1;return}let ce=yield Yt({startDate:K.clone().startOf("year"),endDate:K.clone().endOf("year"),include:r.include,exclude:r.exclude});console.log("newEvents",ce),JSON.stringify(ce)!=JSON.stringify(p)&&n(6,p=ce)}),E=K=>Tt(void 0,void 0,void 0,function*(){c||(c=!0,y(K),yield b(K),O(p),n(5,h),m=Array.from(h.values()).reduce((ce,S)=>Math.max(ce,S.length),0),c=!1)}),y=K=>{h.clear();let ce=window.moment(K).startOf("year"),S=window.moment(K).endOf("year");for(;ce.isSameOrBefore(S);)h.set(ce.format("YYYY-MM-DD"),[]),ce.add(1,"days")},O=K=>{K.forEach(ce=>{let Q=window.moment(ce.start.dateTime||ce.start.date).format("YYYY-MM-DD");h.has(Q)?h.get(Q).push(ce):h.set(Q,[ce])})};function D(K){let ce=0,S=m;if(K==0)return"rgb(22, 27, 34)";if(K==S)return"rgb(57, 211, 83)";let Q=(K-ce)/(S-ce),j=[{percent:0,color:{r:22,g:27,b:34}},{percent:.25,color:{r:14,g:68,b:41}},{percent:.5,color:{r:0,g:109,b:50}},{percent:.75,color:{r:38,g:166,b:65}},{percent:1,color:{r:57,g:211,b:83}}],U=null,J=null;for(let je=j.length-1;je>=0;je--){if(Q>=j[je].percent){U=je;break}J=je}U===null&&(U=J);let re=j[U].color,Y=j[J].color,z=j[U].percent-j[J].percent,ee=(Q-j[J].percent)/z,_e=Math.floor(re.r*(1-ee)+Y.r*ee),Ce=Math.floor(re.g*(1-ee)+Y.g*ee),Fe=Math.floor(re.b*(1-ee)+Y.b*ee);return`rgb(${_e}, ${Ce}, ${Fe})`}let F=K=>{new dr(h.get(K),"details",window.moment(K),!1,()=>{}).open()},P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function L(K){r=K,n(0,r)}function R(K){o=K,n(1,o)}let M=()=>n(3,u--,u),H=()=>n(3,u=0),le=()=>n(3,u++,u),V=K=>F(K),X=K=>F(K);return t.$$set=K=>{"codeBlockOptions"in K&&n(0,r=K.codeBlockOptions),"isObsidianView"in K&&n(2,i=K.isObsidianView),"showSettings"in K&&n(1,o=K.showSettings)},t.$$.update=()=>{if(t.$$.dirty[0]&4121){e:n(12,a=r.date?window.moment(r.date).add(r.offset,"years"):window.moment().add(r.offset,"years")),n(4,f=r.navigation?a.clone().local().add(u,"years"):a),E(f)}},[r,o,i,u,f,h,p,_,v,D,F,P,a,L,R,M,H,le,V,X]}var yk=class extends ze{constructor(e){super();qe(this,e,h4,p4,Ge,{codeBlockOptions:0,isObsidianView:2,showSettings:1},d4,[-1,-1])}},_c=yk;var wk=Oe(require("obsidian")),Co=class extends wk.MarkdownRenderChild{constructor(e,n,r){super(n);this.a=e,this.b=r}load(){this.comp=new this.a({target:this.containerEl,props:this.b})}unload(){this.comp.$destroy()}};function bk(t,e,n){return te(this,null,function*(){var a,u,f,c,p,h,m,_,v,b,E;e.style.padding="10px";let i=(a=(0,vc.parseYaml)(t))!=null?a:{};i.type=(u=i.type)!=null?u:"day",i.date=(f=i.date)!=null?f:"today",i.exclude=(c=i.exclude)!=null?c:[],i.include=(p=i.include)!=null?p:[],i.hourRange=(h=i.hourRange)!=null?h:[0,24],i.timespan=(m=i.timespan)!=null?m:7,i.offset=(_=i.offset)!=null?_:0,i.navigation=(v=i.navigation)!=null?v:!1,i.showAllDay=(b=i.showAllDay)!=null?b:!0,i.size=(E=i.size)!=null?E:10,i.dayOffset&&(i.offset=i.dayOffset);let o=["YYYY-MM-DD","YYYY.MM.DD","YYYY/MM/DD","MM-DD-YYYY","MM.DD.YYYY","MM/DD/YYYY","DD-MM-YYYY","DD.MM.YYYY","DD/MM/YYYY"];if(!window.moment(i.date,o,!0).isValid()){let y=wy(i.date);if(y==null||!window.moment(y).isValid())return;i.date=window.moment(y).format("YYYY-MM-DD")}i.type=="web"?vc.Platform.isDesktopApp&&n.addChild(new Co(tc,e,{codeBlockOptions:i})):i.type=="day"?(i.timespan=1,n.addChild(new Co(cs,e,{codeBlockOptions:i}))):i.type=="month"?n.addChild(new Co(gc,e,{codeBlockOptions:i})):i.type=="schedule"?n.addChild(new Co(hc,e,{codeBlockOptions:i})):i.type=="week"?n.addChild(new Co(cs,e,{codeBlockOptions:i})):i.type=="year"&&n.addChild(new Co(_c,e,{codeBlockOptions:i}))})}var kk=Oe(require("obsidian"));var Il="google-calendar-view-month",Yh=class extends kk.ItemView{constructor(e){super(e);this.showSettings=!1}getViewType(){return Il}getDisplayText(){return"Calendar Month View"}getIcon(){return"calendar-with-checkmark"}onPaneMenu(e,n){super.onPaneMenu(e,n),this.showSettings=this.calendar.$$.ctx[1],e.addItem(r=>{r.setTitle("Refresh"),r.setIcon("sync"),r.onClick(()=>{this.onClose(),this.onOpen()})}).addSeparator().addItem(r=>{r.setTitle(this.showSettings?"Hide Settings":"Settings"),r.setIcon("gear"),r.onClick(()=>{this.showSettings=!this.showSettings,this.calendar.$set({showSettings:this.showSettings})})})}onOpen(){return te(this,null,function*(){let n=ye.getInstance().settings.viewSettings.month;this.calendar=new gc({target:this.contentEl,props:{codeBlockOptions:n,isObsidianView:!0,showSettings:this.showSettings}})})}onClose(){return te(this,null,function*(){this.calendar.$destroy()})}};var Ek=Oe(require("obsidian"));var Rl="google-calendar-view-year",Wh=class extends Ek.ItemView{constructor(e){super(e);this.showSettings=!1}getViewType(){return Rl}getDisplayText(){return"Calendar Year View"}onPaneMenu(e,n){super.onPaneMenu(e,n),this.showSettings=this.calendar.$$.ctx[1],e.addItem(r=>{r.setTitle("Refresh"),r.setIcon("sync"),r.onClick(()=>{this.onClose(),this.onOpen()})}).addSeparator().addItem(r=>{r.setTitle(this.showSettings?"Hide Settings":"Settings"),r.setIcon("gear"),r.onClick(()=>{this.showSettings=!this.showSettings,this.calendar.$set({showSettings:this.showSettings})})})}getIcon(){return"calendar-with-checkmark"}onOpen(){return te(this,null,function*(){let e=ye.getInstance(),n=e.settings.viewSettings.year;n||(e.settings.viewSettings.year={type:"year",exclude:[],include:[],offset:0,navigation:!1,size:15},e.saveSettings(),n=e.settings.viewSettings.year),this.calendar=new _c({target:this.contentEl,props:{codeBlockOptions:n,isObsidianView:!0,showSettings:this.showSettings}})})}onClose(){return te(this,null,function*(){this.calendar.$destroy()})}};var Tk=Oe(require("obsidian"));var ka="google-calendar-view-web",jh=class extends Tk.ItemView{constructor(e){super(e);this.showSettings=!1}getViewType(){return ka}getDisplayText(){return"Calendar Web View"}onPaneMenu(e,n){super.onPaneMenu(e,n),this.showSettings=this.calendar.$$.ctx[1],e.addItem(r=>{r.setTitle("Refresh"),r.setIcon("sync"),r.onClick(()=>{this.onClose(),this.onOpen()})}).addSeparator().addItem(r=>{r.setTitle(this.showSettings?"Hide Settings":"Settings"),r.setIcon("gear"),r.onClick(()=>{this.showSettings=!this.showSettings,this.calendar.$set({showSettings:this.showSettings})})})}getIcon(){return"calendar-with-checkmark"}onOpen(){return te(this,null,function*(){let n=ye.getInstance().settings.viewSettings.web;n.width=-1,this.calendar=new tc({target:this.contentEl,props:{codeBlockOptions:n,isObsidianView:!0,showSettings:this.showSettings}})})}onClose(){return te(this,null,function*(){this.calendar.$destroy()})}};var Sk=Oe(require("obsidian")),Bh=class extends Sk.FuzzySuggestModal{constructor(e,n,r,i,o){super(ye.getInstance().app);this.eventList=e,this.setPlaceholder("Select an event to insert"),this.editor=n,this.start=r,this.end=i,this.word=o}getItems(){return this.eventList}getItemText(e){return`${e.summary} `}onChooseItem(e){return te(this,null,function*(){let n=`[${e.summary}](${e.htmlLink}&cal=${e.parent.id})`;this.editor.replaceRange(n,this.start,this.end,this.word)})}};function Ck(t,e){e.settings.atAnnotationEnabled!=!1&&(Ll("@today",t,e)||Ll("@tomorrow",t,e)||Ll("@yesterday",t,e)||Ll("@REGEX",t,e)||Ll("@YYYY-MM-DD",t,e))}function Ll(t,e,n){var u;let r=e.getCursor(),i=e.getCursor(),o="",a=window.moment();if(t==="@REGEX"){let f=e.getLine(r.line);if(f.length>2e3)return!1;let c=(u=f.match(/.*@([+,-])(\d+) /))!=null?u:[];if(c.length!=3||e.getCursor().ch!=c.index+c[0].length)return!1;if(i=Ps(zn({},r),{ch:r.ch-c[1].length-c[2].length-1}),i.ch<0)return;o=e.getRange(i,r),c[1]=="+"?a=window.moment().add(c[2],"day"):a=window.moment().subtract(c[2],"day")}else if(t==="@YYYY-MM-DD"){if(i=Ps(zn({},r),{ch:r.ch-t.length}),o=e.getRange(i,r),!o.startsWith("@")||o.length!="@YYYY-MM-DD".length)return!1;let f=["YYYY-MM-DD","YYYY/MM/DD","YYYY.MM.DD","YYYY MM DD","MM-DD-YYYY","MM/DD/YYYY","MM.DD.YYYY","MM DD YYYY","DD-MM-YYYY","DD/MM/YYYY","DD.MM.YYYY","DD MM YYYY"],c=["DD-MM-YYYY","DD/MM/YYYY","DD.MM.YYYY","DD MM YYYY","YYYY-MM-DD","YYYY/MM/DD","YYYY.MM.DD","YYYY MM DD","MM-DD-YYYY","MM/DD/YYYY","MM.DD.YYYY","MM DD YYYY"],p=window.moment(o.substring(1),n.settings.usDateFormat?f:c,!0);if(p.isValid())a=p;else return!1}else{if(i=Ps(zn({},r),{ch:r.ch-t.length}),i.ch<0||e.getRange(i,r)!=t)return!1;switch(t){case"@today":a=window.moment();break;case"@tomorrow":a=window.moment().add(1,"day");break;case"@yesterday":a=window.moment().add(-1,"day");break;default:return!1}}return Yt({startDate:a}).then(f=>{new Bh(f,e,i,r,o).open()}),!0}var Dk=Oe(Ri());function m4(t){return te(this,null,function*(){let e=/\[.*]\(https:\/\/www\.google\.com\/calendar\/event\?eid=(.*)&cal=(.*)\)/g,n,r=[];do n=e.exec(t),n&&r.push(n);while(n);return r.length?yield Promise.all(r.map(o=>te(this,null,function*(){if(o){let a=atob(o[1]).split(" ")[0];return yield uo(a,o[2])}}))):[]})}function Ok(t){return te(this,null,function*(){let e=t.getCursor(),n=t.getValue(),r=/{{gEvent(\d?).(.*)}} /g,i,o=[];do i=r.exec(n),i&&o.push(i);while(i);if(!o.length)return;let a=yield m4(n);!a.length||o.forEach(u=>te(this,null,function*(){let f=u[1]?parseInt(u[1]):0,c=t.getCursor();if(c.ch-=3,t.getRange(c,t.getCursor())!="}} ")return!1;let p=Dk.default.get(a[f],u[2],"");p===Object(p)&&(p=JSON.stringify(p)),n=n.replace(u[0],p!=null?p:""),t.setValue(n),e.ch+=p.length-u[0].length,t.setCursor(e)}))})}var Mk=Oe(require("obsidian"));var Ea=[".anyoneCanAddSelf",".attachments",".attachments[0]",".attachments[0]fileId",".attachments[0]fileUrl",".attachments[0]iconLink",".attachments[0]mimeType",".attachments[0]title",".attendees",".attendeesOmitted",".attendees[0]",".attendees[0].additionalGuests",".attendees[0].comment",".attendees[0].displayName",".attendees[0].email",".attendees[0].id",".attendees[0].optional",".attendees[0].organizer",".attendees[0].resource",".attendees[0].responseStatus",".attendees[0].self",".colorId",".conferenceData",".conferenceData.conferenceId",".conferenceData.conferenceSolution",".conferenceData.conferenceSolution.iconUri",".conferenceData.conferenceSolution.key",".conferenceData.conferenceSolution.key.type",".conferenceData.conferenceSolution.name",".conferenceData.createRequest",".conferenceData.createRequest.conferenceSolutionKey",".conferenceData.createRequest.conferenceSolutionKey.type",".conferenceData.createRequest.requestId",".conferenceData.createRequest.status",".conferenceData.createRequest.status.statusCode",".conferenceData.entryPoints",".conferenceData.entryPoints[0]",".conferenceData.entryPoints[0].accessCode",".conferenceData.entryPoints[0].entryPointType",".conferenceData.entryPoints[0].label",".conferenceData.entryPoints[0].meetingCode",".conferenceData.entryPoints[0].passcode",".conferenceData.entryPoints[0].password",".conferenceData.entryPoints[0].pin",".conferenceData.entryPoints[0].uri",".conferenceData.notes",".conferenceData.signature",".created",".creator",".creator.displayName",".creator.email",".creator.id",".creator.self",".description",".end",".end.date",".end.dateTime",".end.timeZone",".endTimeUnspecified",".etag",".eventType",".extendedProperties",".extendedProperties.private",".extendedProperties.shared",".gadget",".gadget.display",".gadget.height",".gadget.iconLink",".gadget.link",".gadget.preferences",".gadget.title",".gadget.type",".gadget.width",".guestsCanInviteOthers",".guestsCanModify",".guestsCanSeeOtherGuests",".hangoutLink",".htmlLink",".iCalUID",".id",".kind",".location",".locked",".organizer",".organizer.displayName",".organizer.email",".organizer.id",".organizer.self",".originalStartTime",".originalStartTime.date",".originalStartTime.dateTime",".originalStartTime.timeZone",".privateCopy",".parent",".parent.kind",".parent.id",".parent.summary",".parent.description",".parent.location",".parent.timeZone",".parent.conferenceProperties",".parent.conferenceProperties.allowedConferenceSolutionTypes",".recurrence",".recurrence[0]",".recurringEventId",".reminders",".reminders.overrides",".reminders.overrides[0]",".reminders.overrides[0].method",".reminders.overrides[0].minutes",".reminders.useDefault",".sequence",".source",".source.title",".source.url",".start",".start.date",".start.dateTime",".start.timeZone",".status",".summary",".transparency",".updated",".visibility"];var Gh=class extends Mk.EditorSuggest{constructor(e){super(e)}onTrigger(e,n){let i=n.getLine(e.line).substring(0,e.ch).match(/{{gEvent(\d)?(\S+$)/);if(i){let o="{{gEvent".length;return i[1]&&o++,{end:e,start:{ch:i.index+o,line:e.line},query:i[2]}}}getSuggestions(e){return Ea.filter(n=>e.query===n.substring(0,e.query.length))}renderSuggestion(e,n){n.createEl("span",{text:e,cls:"suggestionText"})}selectSuggestion(e){if(!this.context)return;let{editor:n}=this.context;if(n.replaceRange(e,this.context.start,this.context.end),Ea.filter(i=>i.startsWith(`${e}.`)).length==0){let i=n.getCursor(),o=structuredClone(i);o.ch+=2,(n.getLine(o.line).lengthn.onChange(r=>{this.result=r})),new Fl.Setting(e).addButton(n=>n.setButtonText("Save").setCta().onClick(()=>{this.close(),this.onSubmit(this.result)}))}onClose(){let{contentEl:e}=this;e.empty()}};function g4(t){Et(t,"svelte-6isfqn",".optionContainer.svelte-6isfqn{display:flex;flex-direction:column}.header.svelte-6isfqn{display:grid;grid-template-columns:[first] 30% auto [last] 30%}.center.svelte-6isfqn{text-align:center}.settingsContainer.svelte-6isfqn{display:flex;flex-direction:row;flex:1 1;gap:20px}.optionItem.svelte-6isfqn{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.input.svelte-6isfqn,.eventList.svelte-6isfqn,.optionList.svelte-6isfqn,.calendarList.svelte-6isfqn{width:100%;display:flex;flex-direction:column}.eventList.svelte-6isfqn,.optionList.svelte-6isfqn,.calendarList.svelte-6isfqn{padding-left:16px}button.svelte-6isfqn{align-self:center}")}function Ak(t,e,n){let r=t.slice();return r[21]=e[n],r}function Pk(t,e,n){let r=t.slice();return r[21]=e[n],r}function Nk(t,e,n){let r=t.slice();return r[26]=e[n],r[27]=e,r[28]=n,r}function xk(t,e,n){let r=t.slice();return r[29]=e[n],r[30]=e,r[31]=n,r}function Ik(t,e,n){let r=t.slice();return r[32]=e[n],r}function Rk(t){let e,n=t[0].settings.insertTemplates,r=[];for(let i=0;it[15].call(r)),k(a,"class","center svelte-6isfqn"),k(f,"class","right svelte-6isfqn"),k(n,"class","header svelte-6isfqn"),k(v,"for","insertType"),y.selected=O=!0,y.__value="bullet",y.value=y.__value,D.__value="table",D.value=D.__value,k(E,"class","dropdown"),t[2]===void 0&&ln(()=>t[16].call(E)),k(_,"class","input svelte-6isfqn"),k(L,"for","date"),k(M,"type","date"),k(M,"name","date"),k(M,"id","date"),M.value=H=window.moment().format("YYYY-MM-DD"),k(P,"class","input svelte-6isfqn"),k(m,"class","settingsContainer svelte-6isfqn"),k(K,"class","calendarList svelte-6isfqn"),k(j,"class","eventList svelte-6isfqn"),k(re,"class","svelte-6isfqn"),k(e,"class","optionContainer svelte-6isfqn")},m(Ee,vt){G(Ee,e,vt),A(e,n),A(n,r),A(r,i),ee&&ee.m(r,null),li(r,t[1],!0),A(n,o),A(n,a),A(n,u),A(n,f),A(e,c),A(e,p),A(e,h),A(e,m),A(m,_),A(_,v),A(_,b),A(_,E),A(E,y),A(E,D),li(E,t[2],!0),A(m,F),A(m,P),A(P,L),A(P,R),A(P,M),A(e,le),A(e,V),A(e,X),A(e,K),Fe.m(K,null),A(e,ce),A(e,S),A(e,Q),A(e,j),ht.m(j,null),A(e,U),ge&&ge.m(e,null),A(e,J),A(e,re),Y||(z=[oe(r,"change",t[15]),oe(r,"change",t[12]),oe(f,"click",t[11]),oe(E,"change",t[16]),oe(M,"change",t[10]),oe(re,"click",t[6])],Y=!0)},p(Ee,vt){Ee[0].settings.insertTemplates.length?ee?ee.p(Ee,vt):(ee=Rk(Ee),ee.c(),ee.m(r,null)):ee&&(ee.d(1),ee=null),vt[0]&3&&li(r,Ee[1]),vt[0]&4&&li(E,Ee[2]),Ce===(Ce=_e(Ee,vt))&&Fe?Fe.p(Ee,vt):(Fe.d(1),Fe=Ce(Ee),Fe&&(Fe.c(),Fe.m(K,null))),pt===(pt=je(Ee,vt))&&ht?ht.p(Ee,vt):(ht.d(1),ht=pt(Ee),ht&&(ht.c(),ht.m(j,null))),Ee[2]=="table"?ge?ge.p(Ee,vt):(ge=Wk(Ee),ge.c(),ge.m(e,J)):ge&&(ge.d(1),ge=null)},i:me,o:me,d(Ee){Ee&&B(e),ee&&ee.d(),Fe.d(),ht.d(),ge&&ge.d(),Y=!1,We(z)}}}function k4(t,e,n){let{onSubmit:r}=e,{insertEventsModal:i}=e,o=ye.getInstance(),a,u,f,c,p=[".summary",".description"];Yi(()=>Tt(void 0,void 0,void 0,function*(){let M=yield Sr();n(4,c=M.map(le=>[le,!0]));let H=yield Yt();n(3,f=H.map(le=>[le,!0]))}));let h=()=>{let M=f.filter(H=>H[1]).map(H=>H[0]);r(u,M,p,i)},m=M=>{f.forEach(H=>{H[0].parent.id==M.target.id&&(H[1]=M.target.checked)}),n(3,f)},_=M=>{let H=M.target.value;H=="on"&&(H=M.target.id),p.contains(H)?p.remove(H):p.push(H),n(5,p)},v=M=>{p.contains(M)&&p.remove(M),n(5,p)},b=M=>Tt(void 0,void 0,void 0,function*(){let H=yield Sr();n(4,c=H.map(V=>[V,!0]));let le=yield Yt({startDate:window.moment(M.target.value).local()});n(3,f=le.map(V=>[V,!0])),n(3,f)}),E=()=>c.filter(M=>M[1]).map(M=>M[0].id),y=()=>{new Uh(app,M=>{let H={name:M,insertType:u,tableOptions:p,calendarList:E()};n(0,o.settings.insertTemplates=[...o.settings.insertTemplates,H],o),o.saveSettings(),Ke("Added template")}).open()},O=M=>{let H=M.target.value;if(H=="None")return;let V=o.settings.insertTemplates.find(X=>X.name==H);!V||(n(2,u=V.insertType),n(5,p=V.tableOptions),c.forEach(X=>X[1]=V.calendarList.contains(X[0].id)),f.forEach(X=>X[1]=V.calendarList.contains(X[0].parent.id)),n(4,c),n(3,f))};function D(){a=Hs(this),n(1,a),n(0,o)}function F(){u=Hs(this),n(2,u)}function P(M,H){M[H][1]=this.checked,n(4,c)}function L(M,H){M[H][1]=this.checked,n(3,f)}let R=M=>v(M);return t.$$set=M=>{"onSubmit"in M&&n(13,r=M.onSubmit),"insertEventsModal"in M&&n(14,i=M.insertEventsModal)},[o,a,u,f,c,p,h,m,_,v,b,y,O,r,i,D,F,P,L,R]}var Gk=class extends ze{constructor(e){super();qe(this,e,k4,b4,Ge,{onSubmit:13,insertEventsModal:14},g4,[-1,-1])}},Uk=Gk;var Hk=Oe(Ri()),zh=class extends zk.Modal{constructor(e){super(ye.getInstance().app);this.editor=e}onOpen(){return te(this,null,function*(){let{contentEl:e}=this;new Uk({target:e,props:{onSubmit:this.onSubmit,insertEventsModal:this}})})}onClose(){let{contentEl:e}=this;e.empty()}onSubmit(e,n,r,i){let o="",a="",u="";e=="bullet"?(n.forEach(f=>{u+=` -- ${`[${f.summary}](${f.htmlLink}&cal=${f.parent.id})`}`}),i.editor.replaceRange(u,i.editor.getCursor())):e=="table"&&(r.forEach(f=>{f=f.split(".").join(" ").toLocaleUpperCase(),o+=`| ${f} `,a+="| --- "}),o+=`| -`,a+=`| -`,n.forEach(f=>{r.forEach(c=>{let p=Hk.default.get(f,c.substring(1),"");c==".summary"&&(p=`[${p}](${f.htmlLink}&cal=${f.parent.id})`),c.startsWith(".start")&&!c.contains("timeZone")&&(p=(f.start.date?window.moment(f.start.date):window.moment(f.start.dateTime)).format("YYYY-MM-DD HH:mm")),c.startsWith(".end")&&!c.contains("timeZone")&&(p=(f.start.date?window.moment(f.end.date):window.moment(f.end.dateTime)).format("YYYY-MM-DD HH:mm")),u+=`| ${p} `}),u+=`| -`}),i.editor.replaceRange(o+a+u,i.editor.getCursor())),i.close()}};var Hh=class{constructor(){}make(){return{getCalendars:()=>Pi(),getEvent:(e,n)=>Hp(e,n),getEvents:e=>Np(e),createEvent:e=>qp(e),deleteEvent:(e,n=!1)=>zp(e,n),updateEvent:(e,n=!1)=>Js(e,n),createEventNote:(e,n,r)=>cr(e,n,r)}}};var Kh=Oe(require("obsidian"));var Yl=Oe(Ri());function qk(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}var Ta=qk();function E4(t){Ta=t}var Vk=/[&<>"']/,T4=new RegExp(Vk.source,"g"),Kk=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,S4=new RegExp(Kk.source,"g"),C4={"&":"&","<":"<",">":">",'"':""","'":"'"},Zk=t=>C4[t];function Nn(t,e){if(e){if(Vk.test(t))return t.replace(T4,Zk)}else if(Kk.test(t))return t.replace(S4,Zk);return t}var D4=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Xk(t){return t.replace(D4,(e,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}var O4=/(^|[^\[])\^/g;function Wt(t,e){t=typeof t=="string"?t:t.source,e=e||"";let n={replace:(r,i)=>(i=i.source||i,i=i.replace(O4,"$1"),t=t.replace(r,i),n),getRegex:()=>new RegExp(t,e)};return n}var M4=/[^\w:]/g,A4=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Jk(t,e,n){if(t){let r;try{r=decodeURIComponent(Xk(n)).replace(M4,"").toLowerCase()}catch(i){return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}e&&!A4.test(n)&&(n=I4(e,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(r){return null}return n}var yc={},P4=/^[^:]+:\/*[^/]*$/,N4=/^([^:]+:)[\s\S]*$/,x4=/^([^:]+:\/*[^/]*)[\s\S]*$/;function I4(t,e){yc[" "+t]||(P4.test(t)?yc[" "+t]=t+"/":yc[" "+t]=bc(t,"/",!0)),t=yc[" "+t];let n=t.indexOf(":")===-1;return e.substring(0,2)==="//"?n?e:t.replace(N4,"$1")+e:e.charAt(0)==="/"?n?e:t.replace(x4,"$1")+e:t+e}var wc={exec:function(){}};function Qr(t){let e=1,n,r;for(;e{let f=!1,c=a;for(;--c>=0&&u[c]==="\\";)f=!f;return f?"|":" |"}),r=n.split(/ \|/),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>e)r.splice(e);else for(;r.length1;)e&1&&(n+=t),e>>=1,t+=t;return n+t}function tE(t,e,n,r){let i=e.href,o=e.title?Nn(e.title):null,a=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){r.state.inLink=!0;let u={type:"link",raw:n,href:i,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,u}return{type:"image",raw:n,href:i,title:o,text:Nn(a)}}function L4(t,e){let n=t.match(/^(\s+)(?:```)/);if(n===null)return e;let r=n[1];return e.split(` -`).map(i=>{let o=i.match(/^\s+/);if(o===null)return i;let[a]=o;return a.length>=r.length?i.slice(r.length):i}).join(` -`)}var kc=class{constructor(e){this.options=e||Ta}space(e){let n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){let n=this.rules.block.code.exec(e);if(n){let r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:bc(r,` -`)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let r=n[0],i=L4(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:i}}}heading(e){let n=this.rules.block.heading.exec(e);if(n){let r=n[2].trim();if(/#$/.test(r)){let i=bc(r,"#");(this.options.pedantic||!i||/ $/.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:n[0]}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let r=n[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;let o=this.lexer.blockTokens(r);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:o,text:r}}}list(e){let n=this.rules.block.list.exec(e);if(n){let r,i,o,a,u,f,c,p,h,m,_,v,b=n[1].trim(),E=b.length>1,y={type:"list",raw:"",ordered:E,start:E?+b.slice(0,-1):"",loose:!1,items:[]};b=E?`\\d{1,9}\\${b.slice(-1)}`:`\\${b}`,this.options.pedantic&&(b=E?b:"[*+-]");let O=new RegExp(`^( {0,3}${b})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;e&&(v=!1,!(!(n=O.exec(e))||this.rules.block.hr.test(e)));){if(r=n[0],e=e.substring(r.length),p=n[2].split(` -`,1)[0],h=e.split(` -`,1)[0],this.options.pedantic?(a=2,_=p.trimLeft()):(a=n[2].search(/[^ ]/),a=a>4?1:a,_=p.slice(a),a+=n[1].length),f=!1,!p&&/^ *$/.test(h)&&(r+=h+` -`,e=e.substring(h.length+1),v=!0),!v){let F=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`),P=new RegExp(`^ {0,${Math.min(3,a-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),L=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:\`\`\`|~~~)`),R=new RegExp(`^ {0,${Math.min(3,a-1)}}#`);for(;e&&(m=e.split(` -`,1)[0],p=m,this.options.pedantic&&(p=p.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(L.test(p)||R.test(p)||F.test(p)||P.test(e)));){if(p.search(/[^ ]/)>=a||!p.trim())_+=` -`+p.slice(a);else if(!f)_+=` -`+p;else break;!f&&!p.trim()&&(f=!0),r+=m+` -`,e=e.substring(m.length+1)}}y.loose||(c?y.loose=!0:/\n *\n *$/.test(r)&&(c=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(_),i&&(o=i[0]!=="[ ] ",_=_.replace(/^\[[ xX]\] +/,""))),y.items.push({type:"list_item",raw:r,task:!!i,checked:o,loose:!1,text:_}),y.raw+=r}y.items[y.items.length-1].raw=r.trimRight(),y.items[y.items.length-1].text=_.trimRight(),y.raw=y.raw.trimRight();let D=y.items.length;for(u=0;uL.type==="space"),P=F.length>0&&F.some(L=>/\n.*\n/.test(L.raw));y.loose=P}if(y.loose)for(u=0;u$/,"$1").replace(this.rules.inline._escapes,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:i,title:o}}}table(e){let n=this.rules.block.table.exec(e);if(n){let r={type:"table",header:Qk(n[1]).map(i=>({text:i})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(` -`):[]};if(r.header.length===r.align.length){r.raw=n[0];let i=r.align.length,o,a,u,f;for(o=0;o({text:c}));for(i=r.header.length,a=0;a/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):Nn(n[0]):n[0]}}link(e){let n=this.rules.inline.link.exec(e);if(n){let r=n[2].trim();if(!this.options.pedantic&&/^$/.test(r))return;let a=bc(r.slice(0,-1),"\\");if((r.length-a.length)%2==0)return}else{let a=R4(n[2],"()");if(a>-1){let f=(n[0].indexOf("!")===0?5:4)+n[1].length+a;n[2]=n[2].substring(0,a),n[0]=n[0].substring(0,f).trim(),n[3]=""}}let i=n[2],o="";if(this.options.pedantic){let a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);a&&(i=a[1],o=a[3])}else o=n[3]?n[3].slice(1,-1):"";return i=i.trim(),/^$/.test(r)?i=i.slice(1):i=i.slice(1,-1)),tE(n,{href:i&&i.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(e,n){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let i=(r[2]||r[1]).replace(/\s+/g," ");if(i=n[i.toLowerCase()],!i){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return tE(r,i,r[0],this.lexer)}}emStrong(e,n,r=""){let i=this.rules.inline.emStrong.lDelim.exec(e);if(!i||i[3]&&r.match(/[\p{L}\p{N}]/u))return;let o=i[1]||i[2]||"";if(!o||o&&(r===""||this.rules.inline.punctuation.exec(r))){let a=i[0].length-1,u,f,c=a,p=0,h=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,n=n.slice(-1*e.length+a);(i=h.exec(n))!=null;){if(u=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!u)continue;if(f=u.length,i[3]||i[4]){c+=f;continue}else if((i[5]||i[6])&&a%3&&!((a+f)%3)){p+=f;continue}if(c-=f,c>0)continue;f=Math.min(f,f+c+p);let m=e.slice(0,a+i.index+(i[0].length-u.length)+f);if(Math.min(a,f)%2){let v=m.slice(1,-1);return{type:"em",raw:m,text:v,tokens:this.lexer.inlineTokens(v)}}let _=m.slice(2,-2);return{type:"strong",raw:m,text:_,tokens:this.lexer.inlineTokens(_)}}}}codespan(e){let n=this.rules.inline.code.exec(e);if(n){let r=n[2].replace(/\n/g," "),i=/[^ ]/.test(r),o=/^ /.test(r)&&/ $/.test(r);return i&&o&&(r=r.substring(1,r.length-1)),r=Nn(r,!0),{type:"codespan",raw:n[0],text:r}}}br(e){let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){let n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e,n){let r=this.rules.inline.autolink.exec(e);if(r){let i,o;return r[2]==="@"?(i=Nn(this.options.mangle?n(r[1]):r[1]),o="mailto:"+i):(i=Nn(r[1]),o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(e,n){let r;if(r=this.rules.inline.url.exec(e)){let i,o;if(r[2]==="@")i=Nn(this.options.mangle?n(r[0]):r[0]),o="mailto:"+i;else{let a;do a=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(a!==r[0]);i=Nn(r[0]),r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e,n){let r=this.rules.inline.text.exec(e);if(r){let i;return this.lexer.state.inRawBlock?i=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):Nn(r[0]):r[0]:i=Nn(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}}}},Ae={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:wc,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};Ae._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;Ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;Ae.def=Wt(Ae.def).replace("label",Ae._label).replace("title",Ae._title).getRegex();Ae.bullet=/(?:[*+-]|\d{1,9}[.)])/;Ae.listItemStart=Wt(/^( *)(bull) */).replace("bull",Ae.bullet).getRegex();Ae.list=Wt(Ae.list).replace(/bull/g,Ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ae.def.source+")").getRegex();Ae._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";Ae._comment=/|$)/;Ae.html=Wt(Ae.html,"i").replace("comment",Ae._comment).replace("tag",Ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();Ae.paragraph=Wt(Ae._paragraph).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ae._tag).getRegex();Ae.blockquote=Wt(Ae.blockquote).replace("paragraph",Ae.paragraph).getRegex();Ae.normal=Qr({},Ae);Ae.gfm=Qr({},Ae.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});Ae.gfm.table=Wt(Ae.gfm.table).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ae._tag).getRegex();Ae.gfm.paragraph=Wt(Ae._paragraph).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Ae.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ae._tag).getRegex();Ae.pedantic=Qr({},Ae.normal,{html:Wt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ae._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:wc,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Wt(Ae.normal._paragraph).replace("hr",Ae.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",Ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ke={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:wc,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:wc,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";ke.punctuation=Wt(ke.punctuation).replace(/punctuation/g,ke._punctuation).getRegex();ke.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;ke.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;ke._comment=Wt(Ae._comment).replace("(?:-->|$)","-->").getRegex();ke.emStrong.lDelim=Wt(ke.emStrong.lDelim).replace(/punct/g,ke._punctuation).getRegex();ke.emStrong.rDelimAst=Wt(ke.emStrong.rDelimAst,"g").replace(/punct/g,ke._punctuation).getRegex();ke.emStrong.rDelimUnd=Wt(ke.emStrong.rDelimUnd,"g").replace(/punct/g,ke._punctuation).getRegex();ke._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;ke._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;ke._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;ke.autolink=Wt(ke.autolink).replace("scheme",ke._scheme).replace("email",ke._email).getRegex();ke._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;ke.tag=Wt(ke.tag).replace("comment",ke._comment).replace("attribute",ke._attribute).getRegex();ke._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;ke._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;ke._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;ke.link=Wt(ke.link).replace("label",ke._label).replace("href",ke._href).replace("title",ke._title).getRegex();ke.reflink=Wt(ke.reflink).replace("label",ke._label).replace("ref",Ae._label).getRegex();ke.nolink=Wt(ke.nolink).replace("ref",Ae._label).getRegex();ke.reflinkSearch=Wt(ke.reflinkSearch,"g").replace("reflink",ke.reflink).replace("nolink",ke.nolink).getRegex();ke.normal=Qr({},ke);ke.pedantic=Qr({},ke.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Wt(/^!?\[(label)\]\((.*?)\)/).replace("label",ke._label).getRegex(),reflink:Wt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ke._label).getRegex()});ke.gfm=Qr({},ke.normal,{escape:Wt(ke.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(r="x"+r.toString(16)),e+="&#"+r+";";return e}var gi=class{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ta,this.options.tokenizer=this.options.tokenizer||new kc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={block:Ae.normal,inline:ke.normal};this.options.pedantic?(n.block=Ae.pedantic,n.inline=ke.pedantic):this.options.gfm&&(n.block=Ae.gfm,this.options.breaks?n.inline=ke.breaks:n.inline=ke.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ae,inline:ke}}static lex(e,n){return new gi(n).lex(e)}static lexInline(e,n){return new gi(n).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,` -`),this.blockTokens(e,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(e,n=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(u,f,c)=>f+" ".repeat(c.length));let r,i,o,a;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(u=>(r=u.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=` -`:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=` -`+r.raw,i.text+=` -`+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=` -`+r.raw,i.text+=` -`+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(o=e,this.options.extensions&&this.options.extensions.startBlock){let u=1/0,f=e.slice(1),c;this.options.extensions.startBlock.forEach(function(p){c=p.call({lexer:this},f),typeof c=="number"&&c>=0&&(u=Math.min(u,c))}),u<1/0&&u>=0&&(o=e.substring(0,u+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){i=n[n.length-1],a&&i.type==="paragraph"?(i.raw+=` -`+r.raw,i.text+=` -`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r),a=o.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length),i=n[n.length-1],i&&i.type==="text"?(i.raw+=` -`+r.raw,i.text+=` -`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let r,i,o,a=e,u,f,c;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(u=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)p.includes(u[0].slice(u[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,u.index)+"["+eE("a",u[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(u=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,u.index)+"["+eE("a",u[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(u=this.tokenizer.rules.inline.escapedEmSt.exec(a))!=null;)a=a.slice(0,u.index+u[0].length-2)+"++"+a.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(f||(c=""),f=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(p=>(r=p.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(e,a,c)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(e,nE)){e=e.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e,nE))){e=e.substring(r.raw.length),n.push(r);continue}if(o=e,this.options.extensions&&this.options.extensions.startInline){let p=1/0,h=e.slice(1),m;this.options.extensions.startInline.forEach(function(_){m=_.call({lexer:this},h),typeof m=="number"&&m>=0&&(p=Math.min(p,m))}),p<1/0&&p>=0&&(o=e.substring(0,p+1))}if(r=this.tokenizer.inlineText(o,F4)){e=e.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(c=r.raw.slice(-1)),f=!0,i=n[n.length-1],i&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(e){let p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return n}},Ec=class{constructor(e){this.options=e||Ta}code(e,n,r){let i=(n||"").match(/\S*/)[0];if(this.options.highlight){let o=this.options.highlight(e,i);o!=null&&o!==e&&(r=!0,e=o)}return e=e.replace(/\n$/,"")+` -`,i?'
'+(r?e:Nn(e,!0))+`
-`:"
"+(r?e:Nn(e,!0))+`
-`}blockquote(e){return`
-${e}
-`}html(e){return e}heading(e,n,r,i){if(this.options.headerIds){let o=this.options.headerPrefix+i.slug(r);return`${e} -`}return`${e} -`}hr(){return this.options.xhtml?`
-`:`
-`}list(e,n,r){let i=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+i+o+`> -`+e+" -`}listitem(e){return`
  • ${e}
  • -`}checkbox(e){return" "}paragraph(e){return`

    ${e}

    -`}table(e,n){return n&&(n=`${n}`),` - -`+e+` -`+n+`
    -`}tablerow(e){return` -${e} -`}tablecell(e,n){let r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+e+` -`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return this.options.xhtml?"
    ":"
    "}del(e){return`${e}`}link(e,n,r){if(e=Jk(this.options.sanitize,this.options.baseUrl,e),e===null)return r;let i='",i}image(e,n,r){if(e=Jk(this.options.sanitize,this.options.baseUrl,e),e===null)return r;let i=`${r}":">",i}text(e){return e}},qh=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,n,r){return""+r}image(e,n,r){return""+r}br(){return""}},Vh=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,n){let r=e,i=0;if(this.seen.hasOwnProperty(r)){i=this.seen[e];do i++,r=e+"-"+i;while(this.seen.hasOwnProperty(r))}return n||(this.seen[e]=i,this.seen[r]=0),r}slug(e,n={}){let r=this.serialize(e);return this.getNextSafeSlug(r,n.dryrun)}},$r=class{constructor(e){this.options=e||Ta,this.options.renderer=this.options.renderer||new Ec,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new qh,this.slugger=new Vh}static parse(e,n){return new $r(n).parse(e)}static parseInline(e,n){return new $r(n).parseInline(e)}parse(e,n=!0){let r="",i,o,a,u,f,c,p,h,m,_,v,b,E,y,O,D,F,P,L,R=e.length;for(i=0;i0&&O.tokens[0].type==="paragraph"?(O.tokens[0].text=P+" "+O.tokens[0].text,O.tokens[0].tokens&&O.tokens[0].tokens.length>0&&O.tokens[0].tokens[0].type==="text"&&(O.tokens[0].tokens[0].text=P+" "+O.tokens[0].tokens[0].text)):O.tokens.unshift({type:"text",text:P}):y+=P),y+=this.parse(O.tokens,E),m+=this.renderer.listitem(y,F,D);r+=this.renderer.list(m,v,b);continue}case"html":{r+=this.renderer.html(_.text);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(_.tokens));continue}case"text":{for(m=_.tokens?this.parseInline(_.tokens):_.text;i+1{i(f.text,f.lang,function(c,p){if(c)return a(c);p!=null&&p!==f.text&&(f.text=p,f.escaped=!0),u--,u===0&&a()})},0))}),u===0&&a();return}function r(i){if(i.message+=` -Please report this to https://github.com/markedjs/marked.`,e.silent)return"

    An error occurred:

    "+Nn(i.message+"",!0)+"
    ";throw i}try{let i=gi.lex(t,e);if(e.walkTokens){if(e.async)return Promise.all(xe.walkTokens(i,e.walkTokens)).then(()=>$r.parse(i,e)).catch(r);xe.walkTokens(i,e.walkTokens)}return $r.parse(i,e)}catch(i){r(i)}}xe.options=xe.setOptions=function(t){return Qr(xe.defaults,t),E4(xe.defaults),xe};xe.getDefaults=qk;xe.defaults=Ta;xe.use=function(...t){let e=xe.defaults.extensions||{renderers:{},childTokens:{}};t.forEach(n=>{let r=Qr({},n);if(r.async=xe.defaults.async||r.async,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if(i.renderer){let o=e.renderers[i.name];o?e.renderers[i.name]=function(...a){let u=i.renderer.apply(this,a);return u===!1&&(u=o.apply(this,a)),u}:e.renderers[i.name]=i.renderer}if(i.tokenizer){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");e[i.level]?e[i.level].unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),r.extensions=e),n.renderer){let i=xe.defaults.renderer||new Ec;for(let o in n.renderer){let a=i[o];i[o]=(...u)=>{let f=n.renderer[o].apply(i,u);return f===!1&&(f=a.apply(i,u)),f}}r.renderer=i}if(n.tokenizer){let i=xe.defaults.tokenizer||new kc;for(let o in n.tokenizer){let a=i[o];i[o]=(...u)=>{let f=n.tokenizer[o].apply(i,u);return f===!1&&(f=a.apply(i,u)),f}}r.tokenizer=i}if(n.walkTokens){let i=xe.defaults.walkTokens;r.walkTokens=function(o){let a=[];return a.push(n.walkTokens.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}xe.setOptions(r)})};xe.walkTokens=function(t,e){let n=[];for(let r of t)switch(n=n.concat(e.call(xe,r)),r.type){case"table":{for(let i of r.header)n=n.concat(xe.walkTokens(i.tokens,e));for(let i of r.rows)for(let o of i)n=n.concat(xe.walkTokens(o.tokens,e));break}case"list":{n=n.concat(xe.walkTokens(r.items,e));break}default:xe.defaults.extensions&&xe.defaults.extensions.childTokens&&xe.defaults.extensions.childTokens[r.type]?xe.defaults.extensions.childTokens[r.type].forEach(function(i){n=n.concat(xe.walkTokens(r[i],e))}):r.tokens&&(n=n.concat(xe.walkTokens(r.tokens,e)))}return n};xe.parseInline=function(t,e){if(typeof t=="undefined"||t===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof t!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");e=Qr({},xe.defaults,e||{}),$k(e);try{let n=gi.lexInline(t,e);return e.walkTokens&&xe.walkTokens(n,e.walkTokens),$r.parseInline(n,e)}catch(n){if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e.silent)return"

    An error occurred:

    "+Nn(n.message+"",!0)+"
    ";throw n}};xe.Parser=$r;xe.parser=$r.parse;xe.Renderer=Ec;xe.TextRenderer=qh;xe.Lexer=gi;xe.lexer=gi.lex;xe.Tokenizer=kc;xe.Slugger=Vh;xe.parse=xe;var NH=xe.options,xH=xe.setOptions,IH=xe.use,RH=xe.walkTokens,LH=xe.parseInline;var FH=$r.parse,YH=gi.lex;var rE=(t,e,n)=>{if(t<0&&(t=e.length+t),!(t>=e.length&&t>=0))return t+1te(void 0,null,function*(){var h,m,_,v,b,E;let e=ye.getInstance(),n=yield app.vault.adapter.read((0,Kh.normalizePath)(t.file.path)),r=(m=Yl.default.cloneDeep((h=app==null?void 0:app.metadataCache)==null?void 0:h.getFileCache(t.file).frontmatter))!=null?m:{},i=/\[([^[]*)::([^[]*)\]/gm,o,a=[];do o=i.exec(n),a.push(o);while(o);if(a.forEach(y=>{y&&Yl.default.set(r,y[1].trim(),y[2].trim())}),!r){Ke("No frontmatter found in note",!0);return}let u=Y4(r);for(let[y,O]of Object.entries(u)){let D=Yl.default.get(r,y,null);D&&Yl.default.set(r,O,D)}let f=yield Sr(),c=r.position;delete r.position;let p=f.find(y=>{var O,D;return y.id==((O=r.calendar)!=null?O:e.settings.defaultCalendar)||y.summary==((D=r.calendar)!=null?D:e.settings.defaultCalendar)});if(!p){Ke("Event not created. Calendar not defined. Set a default calendar in the settings or set the field calendar");return}if(r.parent=p,r.summary||(r.summary=t.file.basename),r.description){if(typeof r.description=="string"){if(((_=r.description)==null?void 0:_.toLowerCase())=="header"&&(r.description="",((v=app==null?void 0:app.metadataCache)==null?void 0:v.getFileCache(t.file).headings).forEach(O=>{r.description+=`${O.heading}`})),((b=r.description)==null?void 0:b.toLowerCase())=="file"){let y=xe.parse(n.substring(c.end.offset));r.description=y}}else if(typeof r.description=="object"){let y=(E=app==null?void 0:app.metadataCache)==null?void 0:E.getFileCache(t.file).headings,O=r.description.map(F=>{if(typeof F=="number"){let P=rE(F,y,n);return P||-1}else if(typeof F=="object"){if(F.length!=2)return-1;let[P,L]=F;if(P<0&&(P=y.length+P),L<0&&(L=y.length+L),P>=y.length||L>=y.length||P<0||L<0||P>L)return-1;let R="";for(let M=P;M<=L;M++){let H=rE(M,y,n);if(!H)return-1;R+=H+` -`}return R}});if(O.contains(-1)){Ke("Event not created.A Header in the header list is out of range",!0);return}let D=xe.parse(O.join(` -`));r.description=D}}if(!r.start&&!r.startTime&&(r.start={date:window.moment()}),!r.end&&!r.endTime&&(r.end=r.start),r.start.date?(r.start.date=window.moment(r.start.date).format("YYYY-MM-DD"),r.end.date=window.moment(r.end.date).format("YYYY-MM-DD")):(r.start.dateTime=window.moment(r.start.dateTime).format(),r.end.dateTime=window.moment(r.end.dateTime).format()),r.recurrence)try{let y=cv.fromText(r.recurrence),O=new ns;O.rrule(y),r.recurrence=O.valueOf()}catch(y){Ke("Event not created. Error in recurrence text.",!0);return}return r}),Y4=t=>{var n;let e=new Map;if(typeof t.mapping=="string"){t.mapping.endsWith(".md")||(t.mapping+=".md");let r=(0,Kh.normalizePath)(t.mapping),i=app.vault.getAbstractFileByPath(r);if(!i)return Ke(`Mapping Error, file "${r}" not found.`),e;if(t=(n=app==null?void 0:app.metadataCache)==null?void 0:n.getFileCache(i).frontmatter,!t)return Ke(`Mapping Error, file "${r}" does not contain frontmatter.`),e}return t.mapping?t.mapping:e};var oE=Oe(require("obsidian"));var sE=t=>te(void 0,null,function*(){var f,c;if(oE.Platform.isMobile)return;let e=ye.getInstance(),{remote:n}=require("electron"),{file:r}=oa(t,e),i=r?"Open Note":"Create Note",o=(f=t.summary)!=null?f:"Event started",a=(c=t.description)!=null?c:"",u;process.platform==="win32"?u=new n.Notification({toastXml:` - - - - Google event now - Title: ${o} - Description: ${a} - - - - - - - - - `}):process.platform==="darwin"&&(u=new n.Notification({title:o,body:a,actions:[{type:"button",text:i},{type:"button",text:"Dismiss"}]}),u.on("action",(p,h)=>{h===0&&window.open(`obsidian://googleOpenNote?event=${t.id}::${t.parent.id}`)})),u.show()});var aE=Oe(require("obsidian"));var W4=(...e)=>te(void 0,[...e],function*(t={}){return(yield Yt(t)).map(i=>{var f;if(!((f=i.description)==null?void 0:f.includes("~obsidianTask~")))return null;let o=i.description.replace(/
    /g,` -`).replace(/<\/?[^>]+(>|$)/g,""),a=(0,aE.parseYaml)(o);return{event:i,current:a.current||0,steps:a.steps||0,goal:a.goal||0,done:a.done||!1}}).filter(i=>i!==null)}),lE=()=>te(void 0,null,function*(){return yield W4()});var j4={googleClientId:"",googleClientSecret:"",googleRefreshToken:"",useCustomClient:!0,googleOAuthServer:"https://obsidian-google-calendar.vercel.app",refreshInterval:10,useNotification:!1,showNotice:!0,autoCreateEventNotes:!0,autoCreateEventNotesMarker:"obsidian",autoCreateEventKeepOpen:!1,importStartOffset:1,importEndOffset:1,optionalNotePrefix:"",eventNoteNameFormat:"{{prefix}}{{event-title}}",defaultCalendar:"",calendarBlackList:[],insertTemplates:[],useDefaultTemplate:!1,defaultTemplate:"",defaultFolder:app.vault.config.newFileFolderPath,activateDailyNoteAddon:!1,dailyNoteDotColor:"#6aa1d8",useWeeklyNotes:!1,debugMode:!1,timelineHourFormat:0,atAnnotationEnabled:!0,usDateFormat:!0,viewSettings:{day:{type:"day",exclude:[],include:[],hourRange:[0,24],offset:0,timespan:1,showAllDay:!0,navigation:!0},week:{type:"week",exclude:[],include:[],hourRange:[0,24],offset:0,timespan:7,showAllDay:!0,navigation:!0},schedule:{type:"schedule",exclude:[],include:[],hourRange:[0,24],offset:0,timespan:7,showAllDay:!0,navigation:!0},month:{type:"month",exclude:[],include:[],offset:0},year:{type:"year",exclude:[],include:[],offset:0,size:15},web:{type:"web",theme:"auto",view:"day",offset:0}}},ye=class extends Do.Plugin{constructor(){super(...arguments);this.events=[];this.initView=e=>te(this,null,function*(){this.app.workspace.getLeavesOfType(e).length===0&&(Do.Platform.isMobile||e===ka||e===So?yield this.app.workspace.getLeaf(!0).setViewState({type:e}):yield this.app.workspace.getRightLeaf(!1).setViewState({type:e}));let n=this.app.workspace.getLeavesOfType(e).first();return this.app.workspace.revealLeaf(n),n});this.onLayoutReady=()=>te(this,null,function*(){var r;Bs(this),so(this);let e=(r=this.app.internalPlugins)==null?void 0:r.plugins.templates;e&&e.enabled&&(this.coreTemplatePlugin=e);let n=this.app.plugins.plugins["templater-obsidian"];n&&n._loaded&&(this.templaterPlugin=n),yield eh(this)})}static getInstance(){return ye.instance}onload(){return te(this,null,function*(){if(ye.instance=this,this.api=new Hh().make(),yield this.loadSettings(),this.app.workspace.onLayoutReady(this.onLayoutReady),this.events.push(this.app.vault.on("create",()=>{Bs(this),so(this)})),this.events.push(this.app.vault.on("delete",()=>{Bs(this),so(this)})),this.events.push(this.app.vault.on("rename",()=>{Bs(this),so(this)})),this.events.forEach(e=>{this.registerEvent(e)}),this.settings.useNotification){let e=window.setInterval(()=>te(this,null,function*(){let n=yield Yt(),r=window.moment();n.filter(o=>o.start.date?!1:window.moment(o.start.dateTime).isSame(r,"minute")).forEach(o=>{sE(o)})}),1e3*60);this.registerInterval(e)}this.registerMarkdownCodeBlockProcessor("gEvent",(e,n,r)=>bk(e,n,r)),this.registerEditorSuggest(new Gh(this.app)),this.registerView(ds,e=>new Pl(e)),this.registerView(So,e=>new Nl(e)),this.registerView(Il,e=>new Yh(e)),this.registerView(Rl,e=>new Wh(e)),this.registerView(ka,e=>new jh(e)),this.registerView(To,e=>new ba(e)),this.registerEvent(this.app.workspace.on("editor-change",e=>{Ck(e,this),Ok(e)})),this.addCommand({id:"open-google-calendar-timline-view",name:"Open gCal Timeline View",callback:()=>this.initView(ds)}),this.addCommand({id:"open-google-calendar-week-view",name:"Open gCal week view",callback:()=>this.initView(So)}),this.addCommand({id:"open-google-calendar-month-view",name:"Open gCal month view",callback:()=>this.initView(Il)}),this.addCommand({id:"open-google-calendar-year-view",name:"Open gCal year view",callback:()=>this.initView(Rl)}),this.addCommand({id:"open-google-calendar-web-view",name:"Open gCal Web View",callback:()=>this.initView(ka)}),this.addCommand({id:"open-google-calendar-schedule-view",name:"Open gCal Schedule View",callback:()=>this.initView(To)}),this.addCommand({id:"create-google-calendar-event",name:"Create gCal Event",checkCallback:e=>{let n=Ft();if(e)return n;!n||new Nr({start:{},end:{}},()=>{zr()}).open()}}),this.addCommand({id:"list-google-calendars",name:"List Google Calendars",checkCallback:e=>{let n=Ft();if(e)return n;!n||Sr().then(r=>{new nh(r).open()})}}),this.addCommand({id:"list-google-events",name:"List gCal Events",checkCallback:e=>{let n=Ft();if(e)return n;!n||Yt().then(r=>{new dr(r,"details").open()})}}),this.addCommand({id:"google-calendar-trigger-auto-import",name:"gCal Trigger Auto Import",checkCallback:e=>{let n=Ft();if(e)return n;!n||eh(this)}}),this.addCommand({id:"google-calendar-create-event-note",name:"Create Event Note",checkCallback:e=>{let n=Ft();if(e)return n;!n||Yt().then(r=>{new dr(r,"createNote").open()})}}),this.addCommand({id:"google-calendar-get-todays-tasks",name:"Get Today's gCal Tasks",checkCallback:e=>{let n=Ft();if(e)return n;!n||lE().then(r=>{console.log(r)})}}),this.addCommand({id:"google-calendar-create-event-note-current-event",name:"Create Event Note for Current gCal Event",checkCallback:e=>{let n=Ft();if(e)return n;!n||Yt().then(r=>{let i=r.filter(o=>{if(o.start.date)return!1;let a=window.moment(o.start.dateTime),u=window.moment(o.end.dateTime),f=window.moment();return!(f.isBefore(a)||f.isAfter(u))});i.length==0&&(i=r.filter(o=>{if(o.start.date)return!1;let a=window.moment(o.start.dateTime).subtract(1,"hour"),u=window.moment(o.end.dateTime),f=window.moment();return!(f.isBefore(a)||f.isAfter(u))})),i.length==0&&(i=r.filter(o=>!!o.start.date)),i.length==1?this.settings.useDefaultTemplate&&this.settings.defaultFolder&&this.settings.defaultFolder?cr(i[0],this.settings.defaultFolder,this.settings.defaultTemplate):new fi(i[0],()=>{}).open():new dr(i,"createNote").open()})}}),this.addCommand({id:"insert-google-event-codeblock",name:"Insert gCal Event CodeBlock",editorCallback:e=>{e.replaceRange("```gEvent\ndate: "+window.moment().format("YYYY-MM-DD")+"\ntype: day\n```",e.getCursor())}}),this.addCommand({id:"insert-google-event-template",name:"Insert gCal Event Template",editorCallback:e=>{e.replaceRange("{{gEvent.}}",e.getCursor());let n=e.getCursor();n.ch+="{{gEvent.".length,e.setCursor(n)}}),this.addCommand({id:"insert-google-events",name:"Insert gCal Events",editorCheckCallback:(e,n)=>{let r=Ft();if(e)return r;!r||new zh(n).open()}}),this.addCommand({id:"create-google-calendar-event-from-frontmatter ",name:"Create gCal Event From Frontmatter",editorCheckCallback:(e,n,r)=>{let i=Ft();if(e)return i;!i||!r.file||iE(r).then(o=>{!o||ff(o)})}}),this.settingsTab=new Mp(this.app,this),this.addSettingTab(this.settingsTab),this.registerObsidianProtocolHandler("googleLogin",e=>te(this,null,function*(){if(!Do.Platform.isDesktop&&e.code){k_(e.code,e.state);return}Do.Platform.isMobile&&e.at&&(Mi(e.at),no(e.rt),Ai(+new Date+36e5),new Do.Notice("Login successful!"),this.settingsTab.display())})),this.registerObsidianProtocolHandler("googleOpenNote",e=>te(this,null,function*(){if(!e.event)return;let[n,r]=e.event.split("::"),i=yield uo(n,r),{file:o}=oa(i,this);o?app.workspace.getLeaf(!0).openFile(o):this.settings.useDefaultTemplate&&this.settings.defaultFolder&&this.settings.defaultFolder?cr(i,this.settings.defaultFolder,this.settings.defaultTemplate):new fi(i,a=>o=a).open()}))})}onunload(){this.app.workspace.detachLeavesOfType(ds),this.app.workspace.detachLeavesOfType(So),this.app.workspace.detachLeavesOfType(Il),this.app.workspace.detachLeavesOfType(Rl),this.app.workspace.detachLeavesOfType(ka),this.app.workspace.detachLeavesOfType(To);for(let e in this.events)this.app.vault.offref(e);this.events=[]}loadSettings(){return te(this,null,function*(){this.settings=Object.assign({},j4,yield this.loadData())})}saveSettings(){return te(this,null,function*(){yield this.saveData(this.settings)})}}; -/*! - * rrule.js - Library for working with recurrence rules for calendar dates. - * https://github.com/jakubroztocil/rrule - * - * Copyright 2010, Jakub Roztocil and Lars Schoning - * Licenced under the BSD licence. - * https://github.com/jakubroztocil/rrule/blob/master/LICENCE - * - * Based on: - * python-dateutil - Extensions to the standard Python datetime module. - * Copyright (c) 2003-2011 - Gustavo Niemeyer - * Copyright (c) 2012 - Tomi Pieviläinen - * https://github.com/jakubroztocil/rrule/blob/master/LICENCE - * - */ -/*! -* rrule.js - Library for working with recurrence rules for calendar dates. -* https://github.com/jakubroztocil/rrule -* -* Copyright 2010, Jakub Roztocil and Lars Schoning -* Licenced under the BSD licence. -* https://github.com/jakubroztocil/rrule/blob/master/LICENCE -* -*/ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ diff --git a/.obsidian/plugins/google-calendar/manifest.json b/.obsidian/plugins/google-calendar/manifest.json deleted file mode 100644 index 1ebc17e..0000000 --- a/.obsidian/plugins/google-calendar/manifest.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "google-calendar", - "name": "Google Calendar", - "version": "1.9.19", - "minAppVersion": "0.12.0", - "description": "Interact with your Google Calendar from Inside Obsidian", - "author": "YukiGasai", - "authorUrl": "https://github.com/YukiGasai", - "isDesktopOnly": false, - "fundingUrl": "https://ko-fi.com/YukiGasai" -} \ No newline at end of file diff --git a/.obsidian/plugins/google-calendar/styles.css b/.obsidian/plugins/google-calendar/styles.css deleted file mode 100644 index 8482407..0000000 --- a/.obsidian/plugins/google-calendar/styles.css +++ /dev/null @@ -1,50 +0,0 @@ -#calendar-container .today { - font-weight: bold; - color: red; -} - -input[type='date'], -input[type='datetime-local'] { - background: var(--background-modifier-form-field); - border: 1px solid var(--background-modifier-border); - color: var(--text-normal); - font-family: inherit; - padding: 5px 14px; - font-size: 16px; - border-radius: 4px; - outline: none; - height: 30px; -} - -.googleEventDetails { - display: flex; - flex-direction: column; -} - -.SubSettings { - margin-left: 40px; -} - -.suggestionText { - font-size: 20px; -} - -.templater_search { - width: calc(100% - 20px); -} - -.googleCalendarDailyDot { - fill: var(--daily-dot-color) !important; -} - -.block-language-gEvent { - padding: 0px; -} - -.setting .multiselect .options { - background-color: #262626 !important; -} - -.rangeSettings .rangeSlider { - width: 300px; -} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-frontmatter-tag-suggest/main.js b/.obsidian/plugins/obsidian-frontmatter-tag-suggest/main.js deleted file mode 100644 index 44d635a..0000000 --- a/.obsidian/plugins/obsidian-frontmatter-tag-suggest/main.js +++ /dev/null @@ -1,129 +0,0 @@ -/* -THIS IS A GENERATED/BUNDLED FILE BY ESBUILD -if you want to view the source, please visit the github repository of this plugin -*/ - -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); -var __export = (target, all) => { - __markAsModule(target); - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __reExport = (target, module2, desc) => { - if (module2 && typeof module2 === "object" || typeof module2 === "function") { - for (let key of __getOwnPropNames(module2)) - if (!__hasOwnProp.call(target, key) && key !== "default") - __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); - } - return target; -}; -var __toModule = (module2) => { - return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); -}; -var __async = (__this, __arguments, generator) => { - return new Promise((resolve, reject) => { - var fulfilled = (value) => { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - }; - var rejected = (value) => { - try { - step(generator.throw(value)); - } catch (e) { - reject(e); - } - }; - var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); - step((generator = generator.apply(__this, __arguments)).next()); - }); -}; - -// main.ts -__export(exports, { - default: () => FrontmatterTagSuggestPlugin -}); -var import_obsidian = __toModule(require("obsidian")); -var FrontmatterTagSuggestPlugin = class extends import_obsidian.Plugin { - onload() { - return __async(this, null, function* () { - this.registerEditorSuggest(new TagSuggest(this)); - }); - } -}; -var TagSuggest = class extends import_obsidian.EditorSuggest { - constructor(plugin) { - super(plugin.app); - this.inline = false; - this.plugin = plugin; - } - getTags() { - const tags = this.plugin.app.metadataCache.getTags(); - return [...Object.keys(tags)].map((p) => p.split("#").pop()); - } - inRange(range) { - var _a; - if (!range || !range.length) - return false; - if (((_a = range.match(/^---\n/gm)) == null ? void 0 : _a.length) != 1) - return false; - if (!/^tags?:/gm.test(range)) - return false; - const split = range.split(/(^\w+:?\s*\n?)/gm); - for (let i = split.length - 1; i >= 0; i--) { - if (/(^\w+:?\s*\n?)/gm.test(split[i])) - return split[i].startsWith("tags:"); - } - return false; - } - onTrigger(cursor, editor, _) { - var _a; - const lineContents = editor.getLine(cursor.line).toLowerCase(); - const onFrontmatterTagLine = lineContents.startsWith("tags:") || lineContents.startsWith("tag:") || this.inRange(editor.getRange({ line: 0, ch: 0 }, cursor)); - if (onFrontmatterTagLine) { - this.inline = lineContents.startsWith("tags:") || lineContents.startsWith("tag:"); - const sub = editor.getLine(cursor.line).substring(0, cursor.ch); - const match = (_a = sub.match(/(\S+)$/)) == null ? void 0 : _a.first(); - if (match) { - this.tags = this.getTags(); - const matchData = { - end: cursor, - start: { - ch: sub.lastIndexOf(match), - line: cursor.line - }, - query: match - }; - return matchData; - } - } - return null; - } - getSuggestions(context) { - const suggestions = this.tags.filter((p) => p.toLowerCase().contains(context.query.toLowerCase())); - return suggestions; - } - renderSuggestion(suggestion, el) { - const outer = el.createDiv({ cls: "ES-suggester-container" }); - outer.createDiv({ cls: "ES-tags" }).setText(`#${suggestion}`); - } - selectSuggestion(suggestion) { - if (this.context) { - if (this.inline) { - suggestion = `${suggestion}`; - } else { - suggestion = `${suggestion} - -`; - } - this.context.editor.replaceRange(`${suggestion} `, this.context.start, this.context.end); - } - } -}; diff --git a/.obsidian/plugins/obsidian-frontmatter-tag-suggest/manifest.json b/.obsidian/plugins/obsidian-frontmatter-tag-suggest/manifest.json deleted file mode 100644 index 1e8bd32..0000000 --- a/.obsidian/plugins/obsidian-frontmatter-tag-suggest/manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "obsidian-frontmatter-tag-suggest", - "name": "Frontmatter Tag Suggest", - "version": "0.4.1", - "minAppVersion": "0.12.0", - "description": "Autocompletes tags in the frontmatter tags field", - "author": "Jonathan Miller", - "authorUrl": "https://jmill.dev", - "isDesktopOnly": false -} diff --git a/.obsidian/plugins/quick-explorer/main.js b/.obsidian/plugins/quick-explorer/main.js deleted file mode 100644 index 7d575ad..0000000 --- a/.obsidian/plugins/quick-explorer/main.js +++ /dev/null @@ -1 +0,0 @@ -var ee=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Xe=Object.getOwnPropertyNames;var Ye=Object.prototype.hasOwnProperty;var Je=(r,i)=>{for(var e in i)ee(r,e,{get:i[e],enumerable:!0})},Z=(r,i,e,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of Xe(i))!Ye.call(r,o)&&o!==e&&ee(r,o,{get:()=>i[o],enumerable:!(t=Ge(i,o))||t.enumerable});return r},K=(r,i,e)=>(Z(r,i,"default"),e&&Z(e,i,"default"));var Qe=r=>Z(ee({},"__esModule",{value:!0}),r);var mt={};Je(mt,{default:()=>Q});module.exports=Qe(mt);var c={};K(c,require("obsidian"));var h={};K(h,require("obsidian"));var te=Symbol.for("v1.to-use.peak-dev.org"),oe=Symbol.for("v1.factory.to-use.peak-dev.org"),A,H,y=function(){return Object.defineProperties(r(),{this:{get(){if(A)return A;throw new TypeError("No current context")}},me:{value:te},factory:{value:oe}});function r(o){let n=new Map;n.prev=o;let s=Object.assign(o?l=>{let u=n.get(l);if(!u){for(let f=n.prev;f;f=f.prev)if(u=f.get(l)){u=Object.assign(Object.assign({},u),{s:u.s||1});break}u=u||{s:2,v:e},n.set(l,u)}let p,m,d;for(;;)switch(u.s){case 0:return A===s&&H&&H.push(l),u.v;case 1:if(p=u.d,!p||a(()=>p.k.every(f=>s(f)===p.c(f)))){u.s=0;break}u.v=p.f;case 2:u.s=4;try{i(n,l,0,a(m=u.v,l,d=[])),d.length&&(u.d={c:s,f:m,k:d});break}catch(f){u.s=3,u.v=f,u.d=null}case 3:throw u.v;case 4:throw new Error(`Factory ${String(u.v)} didn't resolve ${String(l)}`)}}:l=>y.this(l),{def(l,u){return i(n,l,2,u),s},set(l,u){return i(n,l,1,u),s},fork(l){let u=r(n);return l!=null?u(l):u}});return o?s.use=s:s;function a(l,u,p){let m=A,d=H;try{return A=s,H=p,l(u)}finally{A=m,H=d}}}function i(o,n,s,a){if(o.has(n)){let l=o.get(n);if(!l.s)throw new Error(`Already read: ${String(n)}`);l.s=s,l.v=a,l.d=null}else o.set(n,{s,v:a})}function e(o){if(typeof o[te]=="function")return o[te](o);if(t(o))return typeof o.prototype[oe]=="function"?o.prototype[oe]():new o;throw new ReferenceError(`No config for ${String(o)}`)}function t(o){return typeof o=="function"&&o.prototype!==void 0&&(Object.getPrototypeOf(o.prototype)!==Object.prototype||Object.getOwnPropertyNames(o.prototype).length>1||o.toString().startsWith("class"))}}();var be,C=(be=window.queueMicrotask)!=null?be:(r=>i=>r.then(i))(Promise.resolve());y.def(h.Plugin,()=>{throw new Error("Plugin not created yet")});var L=class extends h.Component{constructor(){super(...arguments);this.use=y.service(this)}};y.service=function(r){return y(j).addChild(r),y.this};y.plugin=function(r){let i=y.fork().set(h.Plugin,r).set(r.constructor,r);return r.addChild(i.use(j)),i};var j=class extends h.Component{constructor(){super(...arguments);this.children=new Set([this])}onload(){this.loaded=!0}onunload(){this.loaded=!1,this.children.clear()}addChild(e){return this.children.has(e)||(this.children.add(e),this.loaded?C(()=>super.addChild(e)):super.addChild(e)),e}};function U(r,i){r._loaded&&r.removeChild(i)}function ye(r,i){let e=new h.Component;e.onload=()=>{U(r,e),i()},r.addChild(e)}function E(r,i){let e=Object.keys(i).map(t=>Ze(r,t,i[t]));return e.length===1?e[0]:function(){e.forEach(t=>t())}}function Ze(r,i,e){let t=r[i],o=r.hasOwnProperty(i),n=e(t);return t&&Object.setPrototypeOf(n,t),Object.setPrototypeOf(s,n),r[i]=s,a;function s(...l){return n===t&&r[i]===s&&a(),n.apply(this,l)}function a(){r[i]===s&&(o?r[i]=t:delete r[i]),n!==t&&(n=t,Object.setPrototypeOf(s,t||Function))}}function z(r){let i=app.workspace;switch(r==null?void 0:r.getRoot()){case i.rootSplit:case i.floatingSplit:case i.leftSplit:case i.rightSplit:return!0;default:return!1}}var ie=2,jt=Symbol.for(`v${ie}.layout-storage-events.ophidian.peak-dev.org`);var Ut=`ophidian-layout-storage:v${ie}:item-load`,zt=`ophidian-layout-storage:v${ie}:item-save`;function Ee(r,i=window,e="plugin-"+r.use(h.Plugin).manifest.id.toLowerCase().replace(/[^_a-zA-Z0-9-]/,"-")){let t=i.document.querySelector("body > .app-container"),o=t.find(".status-bar")||t.createDiv("status-bar"),n=o.find(".status-bar-item."+e)||o.createDiv(`status-bar-item ${e.replace(/\./g," ")}`);return t=null,r.register(()=>C(()=>{n=xe(n),o=xe(o)})),r.use(h.Plugin).register(()=>n&&n.detach()),n}function xe(r){return r&&!r.hasChildNodes()?(r.detach(),null):r}var q=class extends h.Component{constructor(e,t){super();this.use=e;this.container=t;this.win=this.container.win}[y.factory](){return new ne(this.constructor)}static onload(e){}static onunload(e){}},ne=class extends L{constructor(e){super();this.factory=e;this.instances=new Map;this.watching=!1;this.layoutReadyCallbacks=[]}onload(){var e,t;this.registerEvent(app.workspace.on("layout-change",()=>{app.workspace.layoutReady&&this.layoutReadyCallbacks.length&&(this.layoutReadyCallbacks.forEach(C),this.layoutReadyCallbacks=[])})),(t=(e=this.factory).onload)==null||t.call(e,this.use)}onLeafChange(e,t){return this.onLayoutReady(()=>e.call(t,app.workspace.activeLeaf)),app.workspace.on("active-leaf-change",o=>{app.workspace.layoutReady&&e.call(t,o)})}onLayoutReady(e){app.workspace.layoutReady?C(e):this.layoutReadyCallbacks.push(e)}onunload(){var e,t;(t=(e=this.factory).onunload)==null||t.call(e,this.use)}watch(){if(!this._loaded)ye(this,()=>this.watch());else if(!this.watching){let{workspace:e}=app,t=this;this.watching=!0,this.registerEvent(e.on("window-open",o=>{this.onLayoutReady(()=>this.forContainer(o))})),this.register(E(e,{clearLayout(o){return async function(){try{return await o.call(this)}finally{t.onLayoutReady(()=>t.forAll())}}}})),this.onLayoutReady(()=>this.forAll())}return this}forWindow(e=(o=>(o=window.activeWindow)!=null?o:window)(),t=!0){let n=tt(e);if(n)return this.forContainer(n,t)}forContainer(e,t=!0){e=e.getContainer();let o=this.instances.get(e);return!o&&t&&(o=new this.factory(this.use,e),o&&(this.instances.set(e,o),this.addChild(o),e.component.addChild(o),o.register(()=>{U(this,o),U(e.component,o),this.instances.delete(e)}))),o}forDom(e,t=!0){return this.forWindow(re(e),t)}forLeaf(e=app.workspace.activeLeaf,t=!0){if(z(e))return this.forContainer(e.getContainer(),t)}forView(e,t=!0){return this.forLeaf(e.leaf,t)}forAll(e=!0){return et().map(t=>this.forContainer(t,e)).filter(t=>t)}};function et(){return[app.workspace.rootSplit].concat(app.workspace.floatingSplit.children)}function re(r){return r.win||(r.ownerDocument||r).defaultView||window}function tt(r){if(r===window)return app.workspace.rootSplit;let{floatingSplit:i}=app.workspace;if(i){for(let e of i.children)if(r===e.win)return e}}var $=class extends L{onload(){let i=this,e=this.use(h.Plugin);this.register(E(e,{loadCSS(t){return async function(){await t.call(this),i.triggerReparse(),this.register(()=>i.triggerReparse())}}}))}triggerReparse(){app.workspace.layoutReady&&app.workspace.trigger("parse-style-settings")}};function W(r,i,e,t,o){return r.on(i,e,t,o),()=>r.off(i,e,t,o)}var Fe={};function D(r,i,e=[],t={}){typeof e=="string"&&(e=[e]),typeof e=="object"&&e.key&&(e=[e]);let o=e.map(function(s){if(typeof s=="object")return s;let a=s.split("+");return{modifiers:a,key:a.pop()||"+"}});Object.assign(t,{id:r,name:i,hotkeys:o});let n=Symbol("cmd:"+r);return Fe[n]=t,n}function Ce(r,i=r.constructor.prototype){Object.getOwnPropertySymbols(i).forEach(e=>{let t=Fe[e],o=i[e];t&&r.addCommand(Object.assign({},t,{checkCallback(n){let s=o.call(r);return n||typeof s!="function"?!!s:(s(),!0)}}))})}function ot(r){for(var i=r.split(/([#.])/),e="",t="",o=[],n=0;n0;)i[e]=arguments[e+1];var t,o=typeof r;if(o==="string")t=Re(r).cloneNode(!1);else if(X(r))t=r.cloneNode(!1);else if(o==="function"){var n=r;t=new(Function.prototype.bind.apply(n,[null].concat(i)))}else throw new Error("At least one argument required");return ae(w(t),i,!0),t}var O=R;R.extend=function(i){for(var e=[],t=arguments.length-1;t-- >0;)e[t]=arguments[t+1];var o=Re(i);return R.bind.apply(R,[this,o].concat(e))};function Re(r){return Pe[r]||(Pe[r]=Se(r))}function Oe(r){for(var i=[],e=arguments.length-1;e-- >0;)i[e]=arguments[e+1];for(var t=w(r),o=Ve(r,i,t.firstChild);o;){var n=o.nextSibling;M(r,o),o=n}}function Ve(r,i,e){for(var t=e,o=new Array(i.length),n=0;n0;)i[e]=arguments[e+1];var t,o=typeof r;if(o==="string")t=Ke(r).cloneNode(!1);else if(X(r))t=r.cloneNode(!1);else if(o==="function"){var n=r;t=new(Function.prototype.bind.apply(n,[null].concat(i)))}else throw new Error("At least one argument required");return ae(w(t),i,!0),t}se.extend=function(i){var e=Ke(i);return se.bind(this,e)};se.ns=Be;function Ke(r){return Le[r]||(Le[r]=Se(r,Be))}var ce=class extends c.MenuItem{setTitle(e){return this.title=typeof e=="string"?e:e.textContent,super.setTitle(e)}},F=class extends c.Menu{constructor(e,t=e instanceof c.App?e:e.app){var n;super(t);this.parent=e;this.app=t;this.match="";this.resetSearchOnTimeout=(0,c.debounce)(()=>{this.match=""},1500,!0);this.visible=!1;(n=this.setUseNativeMenu)==null||n.call(this,!1),e instanceof F&&e.setChildMenu(this),this.scope=new c.Scope,this.scope.register([],"ArrowUp",this.onArrowUp.bind(this)),this.scope.register([],"ArrowDown",this.onArrowDown.bind(this)),this.scope.register([],"Enter",this.onEnter.bind(this)),this.scope.register([],"Escape",this.onEscape.bind(this)),this.scope.register([],"ArrowLeft",this.onArrowLeft.bind(this)),this.scope.register([],"Home",this.onHome.bind(this)),this.scope.register([],"End",this.onEnd.bind(this)),this.scope.register([],"ArrowRight",this.onArrowRight.bind(this));let o=this;E(this.dom,{contains(s){return function(a){var u;return s.call(this,a)||((u=o.child)==null?void 0:u.dom.contains(a))}}}),this.dom.addClass("qe-popup-menu"),this.onMouseOver&&this.dom.removeEventListener("mouseover",this.onMouseOver)}onEscape(){return this.hide(),!1}onload(){this.scope.register(null,null,this.onKeyDown.bind(this)),super.onload(),this.visible=!0,this.showSelected();let e,t;this.register(pt(this.dom,"mouseover",".menu-item",(o,n)=>{(e!==o.clientX||t!==o.clientY)&&!n.hasClass("is-disabled")&&!this.child&&this.onItemHover(this.items.find(s=>s.dom===n),o,n),e=o.clientX,t=o.clientY}))}onItemHover(e,t,o){this.select(this.items.indexOf(e),!1)}onunload(){this.visible=!1,super.onunload()}addItem(e){let t=new ce(this);return this.items.push(t),e(t),this._loaded&&this.sort&&this.sort(),this}onKeyDown(e){let t=c.Keymap.getModifiers(e);if(e.key.length===1&&!e.isComposing&&(!t||t==="Shift")){let o=this.match+e.key;for(;o&&!this.searchFor(o);)o=o.slice(1);this.match=o,this.resetSearchOnTimeout()}return!1}searchFor(e){let t=e.split("").map(ut);return this.find(new RegExp("^"+t.join(""),"ui"))||this.find(new RegExp("^"+t.join(".*"),"ui"))||this.find(new RegExp(t.join(".*"),"ui"))}find(e){var o,n,s;let t=Math.min(0,this.selected);for(let a=this.items.length;a;++t,a--)if(!((o=this.items[t])!=null&&o.disabled)&&(s=(n=this.items[t])==null?void 0:n.title)!=null&&s.match(e))return this.select(t),!0;return!1}onEnter(e){let t=this.items[this.selected];return t&&(t.handleEvent(e),this.child||this.hide()),!1}select(e,t=!0){this.match="",super.select(e),t&&this.showSelected()}showSelected(){var t;let e=(t=this.items[this.selected])==null?void 0:t.dom;if(e){let o=this.dom.getBoundingClientRect(),n=e.getBoundingClientRect();(n.topo.bottom)&&e.scrollIntoView()}}unselect(){var e;(e=this.items[this.selected])==null||e.dom.removeClass("selected")}onEnd(e){return this.unselect(),this.selected=this.items.length,this.onArrowUp(e),this.selected===this.items.length&&(this.selected=-1),!1}onHome(e){return this.unselect(),this.selected=-1,this.onArrowDown(e),!1}onArrowLeft(){return this.rootMenu()!==this&&this.hide(),!1}onArrowRight(){return!1}hide(){return this.setChildMenu(),super.hide()}setChildMenu(e){var t;(t=this.child)==null||t.hide(),this.child=e}rootMenu(){return this.parent instanceof c.App?this:this.parent.rootMenu()}cascade(e,t,o,n=15,s=5){var we,ge;let{left:a,top:l,bottom:u,width:p}=e.getBoundingClientRect(),m=a+(e.matchParent(".menu")?Math.min(150,p/3):0),d=(we=window.activeWindow)!=null?we:window,{innerHeight:f,innerWidth:v}=d,g={x:t?t.clientX-n:m,y:u-s};(ge=this.sort)==null||ge.call(this),d.document.body.appendChild(this.dom);let{offsetWidth:S,offsetHeight:b}=this.dom,ve=g.y+b0,$e=g.x+S<=v;return ve||(qe?g.y=l-s:g.y=u>f-(u-l)?l+s:f),$e||(g.x=b{this.parent instanceof c.App?e.toggleClass("selected",!1):this.parent instanceof F&&this.parent.setChildMenu(),o&&o()}),this}};function ut(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pt(r,i,e,t,o=!1){return r.on(i,e,t,o),()=>r.off(i,e,t,o)}function V(r){return i18next.t(`plugins.file-explorer.menu-opt-${r}`)}var k=class extends F{constructor(i,e){super(i);let{workspace:t}=this.app,o=this.app.internalPlugins.plugins["file-explorer"].enabled;e instanceof c.TFolder&&(this.addItem(n=>n.setTitle(V("new-note")).setIcon("create-new").onClick(async s=>{this.rootMenu().hide();let a=await this.app.fileManager.createNewMarkdownFile(e);a&&await this.app.workspace.getLeaf(c.Keymap.isModEvent(s)).openFile(a,{active:!0,state:{mode:"source"},eState:{rename:"all"}})})),this.addItem(n=>n.setTitle(V("new-folder")).setIcon("folder").setDisabled(!o).onClick(s=>{var a;o?(this.rootMenu().hide(),(a=this.withExplorer(e))==null||a.createAbstractFile("folder",e)):(new c.Notice("The File Explorer core plugin must be enabled to create new folders"),s.stopPropagation())})),this.addItem(n=>n.setTitle(V("set-attachment-folder")).setIcon("image-file").onClick(()=>{this.app.setAttachmentFolder(e)})),this.addSeparator()),this.addItem(n=>{n.setTitle(V("rename")).setIcon("pencil").onClick(s=>{this.app.fileManager.promptForFileRename(e)})}),this.addItem(n=>n.setTitle(V("delete")).setIcon("trash").onClick(()=>{e instanceof c.TFolder?this.app.fileManager.promptForFolderDeletion(e):e instanceof c.TFile&&this.app.fileManager.promptForFileDeletion(e)})),e instanceof c.TFolder&&o&&this.addItem(n=>n.setIcon("folder").setTitle(i18next.t("plugins.file-explorer.action-reveal-file")).onClick(()=>{this.rootMenu().hide(),this.withExplorer(e)})),t.trigger("file-menu",this,e,"quick-explorer")}onEnter(i){return this.rootMenu().hide(),super.onEnter(i)}withExplorer(i){let e=this.app.internalPlugins.plugins["file-explorer"];if(e.enabled)return e.instance.revealInFolder(i),this.app.workspace.getLeavesOfType("file-explorer")[0].view}};var pe={markdown:"document",image:"image-file",audio:"audio-file",pdf:"pdf-file"},dt={...pe,excalidraw:"excalidraw-icon"};function Y(r){var i;if(r instanceof c.TFolder)return"folder";if(r instanceof c.TFile){let e=app.viewRegistry.getTypeByExtension(r.extension);if(e)return(i=dt[e])!=null?i:"document"}}function J(r){return app.vault.getAbstractFileByPath(ht(r))}function ht(r){return`${r.path}/${r.name}.md`}var ue=new Intl.Collator(void 0,{usage:"sort",sensitivity:"base",numeric:!0}).compare;function de(r,i=app.vault.getConfig("showUnsupportedFiles")){let{children:e}=r,t=J(r),o=e.slice().sort((a,l)=>ue(a.name,l.name)),n=o.filter(a=>a instanceof c.TFolder),s=o.filter(a=>a instanceof c.TFile&&a!==t&&(i||Y(a)));return n.sort((a,l)=>ue(a.name,l.name)),s.sort((a,l)=>ue(a.basename,l.basename)),{folderNote:t,folders:n,files:s}}function je(r,i){let{folderNote:e,folders:t,files:o}=de(r,!1);return(e?[e]:[]).concat(t,o)}function Ue(r,i,e){let t=new Set;for(;(r==null?void 0:r.parent)&&!t.has(r);){t.add(r);let o=je(r.parent,!1),n=o.indexOf(r);if(n===-1)return;for(e?n+=i:n=i<0?0:o.length-1,r=r.parent;n>=0&&n0?0:o.length-1):n+=i}}}var x=!0,P=class extends F{constructor(e,t,o,n){super(e);this.parent=e;this.folder=t;this.selectedFile=o;this.crumb=n;this.parentFolder=this.parent instanceof P?this.parent.folder:null;this.fileCount=e=>e instanceof c.TFolder?e.children.map(this.fileCount).reduce((t,o)=>t+o,0):Y(e)?1:0;this.refreshFiles=(0,c.debounce)(()=>this.loadFiles(this.folder,this.currentFile()),100,!0);this.showPopover=(0,c.debounce)(()=>{var e;this.hidePopover(),x&&this.maybeHover((e=this.currentItem())==null?void 0:e.dom,t=>this.app.workspace.trigger("link-hover",this,re(this.dom).document.body,t.path,""))},50,!0);this.onItemClick=(e,t)=>{if(e.type==="auxclick"&&!c.Keymap.isModEvent(e))return;let o=this.fileForDom(t);if(!!o&&!this.onClickFile(o,t,e))return e.stopPropagation(),e.preventDefault(),!1};this.onItemMenu=(e,t)=>{let o=this.fileForDom(t);if(o){let n=this.itemForPath(o.path);n>=0&&this.selected!=n&&this.select(n),new k(this,o).cascade(t,e),e.stopPropagation()}};this.loadFiles(t,o),this.scope.register([],"Tab",this.togglePreviewMode.bind(this)),this.scope.register(["Mod"],"Enter",this.onEnter.bind(this)),this.scope.register(["Alt"],"Enter",this.onKeyboardContextMenu.bind(this)),this.scope.register([],"\\",this.onKeyboardContextMenu.bind(this)),this.scope.register([],"ContextMenu",this.onKeyboardContextMenu.bind(this)),this.scope.register([],"F2",this.doRename.bind(this)),this.scope.register(["Shift"],"F2",this.doMove.bind(this)),this.scope.register([],"PageUp",this.doScroll.bind(this,-1,!1)),this.scope.register([],"PageDown",this.doScroll.bind(this,1,!1)),this.scope.register(["Mod"],"Home",this.doScroll.bind(this,0,!0)),this.scope.register(["Mod"],"End",this.doScroll.bind(this,1,!0));let{dom:s}=this,a=".menu-item[data-file-path]";s.on("click",a,this.onItemClick,!0),s.on("auxclick",a,this.onItemClick,!0),s.on("contextmenu",a,this.onItemMenu),s.on("mousedown",a,u=>{u.stopPropagation()},!0),s.on("dragstart",a,(u,p)=>{he(this.app,p.dataset.filePath,u)}),this.register(()=>{x&&this.parent instanceof P&&this.parent.showPopover()});let l=this;E(this.dom,{contains(u){return function(p){var d;return u.call(this,p)||((d=l._popover)==null?void 0:d.hoverEl.contains(p))}}})}onArrowLeft(){var e;return super.onArrowLeft(),this.rootMenu()===this&&this.openBreadcrumb((e=this.crumb)==null?void 0:e.prev()),!1}onKeyboardContextMenu(e){var n;if(e.code==="ContextMenu"){let s=function(a){if(a.code==="ContextMenu")return a.preventDefault(),a.view.removeEventListener("keyup",s,{capture:!0}),!1};e.view.addEventListener("keyup",s,{capture:!0})}let t=(n=this.items[this.selected])==null?void 0:n.dom,o=t&&this.fileForDom(t);return o&&new k(this,o).cascade(t),!1}doScroll(e,t,o){var a,l;let n=(a=this.hoverPopover)==null?void 0:a.hoverEl,s=n==null?void 0:n.find((l=this.hoverPopover)!=null&&l.rootSplit?'[data-mode="preview"] .markdown-preview-view, [data-mode="source"] .cm-scroller':".markdown-preview-view");if(s){s.style.scrollBehavior=t?"auto":"smooth";let u=s.scrollTop,p=(t?0:s.scrollTop)+e*(t?s.scrollHeight:s.clientHeight);s.scrollTop=p,t||(p>=s.scrollHeight?this.onArrowDown(o):p<0&&(u>0?s.scrollTop=0:this.onArrowUp(o)))}else x?e>0?this.onArrowDown(o):this.onArrowUp(o):(x=!0,this.showPopover());return!1}doRename(){let e=this.currentFile();return this.rootMenu().hide(),e&&this.app.fileManager.promptForFileRename(e),!1}doMove(){let e=this.app.internalPlugins.plugins["file-explorer"];if(!e.enabled)return new c.Notice("File explorer core plugin must be enabled to move files or folders"),!1;this.rootMenu().hide();let t=e.instance.moveFileModal;return t.setCurrentFile(this.currentFile()),t.open(),!1}currentItem(){return this.items[this.selected]}currentFile(){var e;return this.fileForDom((e=this.currentItem())==null?void 0:e.dom)}fileForDom(e){let{filePath:t}=e==null?void 0:e.dataset;if(t)return this.app.vault.getAbstractFileByPath(t)}itemForPath(e){return this.items.findIndex(t=>t.dom.dataset.filePath===e)}openBreadcrumb(e){if(e&&this.rootMenu()===this)return this.hide(),e.open(),!1}onArrowRight(){var t;let e=this.currentFile();if(e instanceof c.TFolder)e!==this.selectedFile?this.onClickFile(e,this.currentItem().dom):this.openBreadcrumb((t=this.crumb)==null?void 0:t.next());else if(e instanceof c.TFile){let o=this.hoverPopover;o&&o.rootSplit&&this.app.workspace.iterateLeaves(n=>{var s;return n.view instanceof c.FileView&&n.view.file===e&&(o.togglePin(!0),this._popover=null,this.onEscape(),n.view instanceof c.MarkdownView?n.setViewState({type:n.view.getViewType(),state:{file:e.path,mode:"source"}}).then(()=>this.app.workspace.setActiveLeaf(n,!1,!0)):((s=this.dom.ownerDocument.activeElement)==null||s.blur(),this.app.workspace.setActiveLeaf(n,!1,!0))),!0},o.rootSplit)}return!1}loadFiles(e,t){this.dom.empty(),this.items=[];let{folderNote:o,folders:n,files:s}=de(e);o&&this.addFile(o),n.length&&(o&&this.addSeparator(),n.map(this.addFile,this)),s.length&&((n.length||o)&&this.addSeparator(),s.map(this.addFile,this)),this.select(t?this.itemForPath(t.path):0)}addFile(e){let t=Y(e);this.addItem(o=>{if(o.setTitle(e.name),o.dom.dataset.filePath=e.path,o.dom.setAttr("draggable","true"),o.dom.addClass(e instanceof c.TFolder?"is-qe-folder":"is-qe-file"),t&&o.setIcon(t),e instanceof c.TFile)o.setTitle(e.basename),e.extension!=="md"&&o.dom.createDiv({text:e.extension,cls:["nav-file-tag","qe-extension"]});else if(e!==this.folder.parent){let n=this.fileCount(e);n&&o.dom.createDiv({text:""+n,cls:"nav-file-tag qe-file-count"})}o.onClick(n=>this.onClickFile(e,o.dom,n))})}togglePreviewMode(){return(x=!x)?this.showPopover():this.hidePopover(),!1}onload(){super.onload(),this.register(W(this.dom.ownerDocument.body,"pointerdown",".hover-popover",(e,t)=>{var o,n,s;((o=this.hoverPopover)==null?void 0:o.hoverEl)===t&&((s=(n=this.hoverPopover).togglePin)==null||s.call(n,!0),this._popover=null)},{capture:!0})),this.registerEvent(this.app.vault.on("create",e=>{this.folder===e.parent&&this.refreshFiles()})),this.registerEvent(this.app.vault.on("rename",(e,t)=>{if(this.folder===e.parent){let o=this.itemForPath(t)>=0?e:this.currentFile();this.loadFiles(this.folder,o)}else this.removeItemForPath(t)})),this.registerEvent(this.app.vault.on("delete",e=>this.removeItemForPath(e.path))),x&&this.selected!=-1&&this.showPopover()}removeItemForPath(e){let t=this.itemForPath(e);if(t<0)return;let o=this.items[t];this.selected>t&&(this.selected-=1),o.dom.detach(),this.items.remove(o)}onEscape(){return super.onEscape(),this.parent instanceof F&&this.parent.onEscape(),!1}hide(){return this.hidePopover(),super.hide()}setChildMenu(e){super.setChildMenu(e),x&&this.canShowPopover()&&this.showPopover()}select(e,t=!0){let o=this.selected;super.select(e,t),o!==this.selected&&(x?this.showPopover():this.hidePopover())}hidePopover(){this.hoverPopover=null}canShowPopover(){return!this.child&&this.visible}onItemHover(e,t,o){super.onItemHover(e,t,o),o.matches(".menu-item[data-file-path]")&&(x||this.maybeHover(o,n=>this.app.workspace.trigger("hover-link",{event:t,source:N,hoverParent:this,targetEl:o,linktext:n.path})))}maybeHover(e,t){if(!this.canShowPopover())return;let o=this.fileForDom(e);o instanceof c.TFolder&&(o=J(o)),o instanceof c.TFile&&pe[this.app.viewRegistry.getTypeByExtension(o.extension)]&&t(o)}get hoverPopover(){return this._popover}set hoverPopover(e){var n;let t=this._popover;if(e===t)return;t&&e!==t&&(this._popover=null,t.onHover=t.onTarget=!1,(!t.isPinned||x)&&t.hide()),e&&!this.canShowPopover()&&(e.onHover=!1,e.hide(),e=null),this._popover=e;let o=e==null?void 0:e.targetEl;if(o&&o===o.ownerDocument.body&&(o.removeEventListener("mouseover",e.onMouseIn),o.removeEventListener("mouseout",e.onMouseOut)),x&&e&&this.currentItem()){(n=e.togglePin)==null||n.call(e,!1),Promise.resolve().then(()=>{var a,l;return(l=(a=e.abortController)==null?void 0:a.unload)==null?void 0:l.call(a)});let s=()=>{var v;let a=e.hoverEl;if(!a.parentElement)return;let l=this.dom.getBoundingClientRect(),u=this.currentItem().dom.getBoundingClientRect(),p=a.offsetParent||this.dom.ownerDocument.documentElement,m=a.offsetHeight,d=Math.min(l.right+2,p.clientWidth-a.offsetWidth),f=Math.min(Math.max(0,u.top-m/8),p.clientHeight-m);da.offsetWidth&&(d=l.left-a.offsetWidth),e.position({x:d,y:f}),a.style.top=f+"px",a.style.left=d+"px",(v=e.togglePin)==null||v.call(e,!0)};"onShowCallback"in e?E(e,{onShowCallback(a){return()=>(e.hoverEl.win.requestAnimationFrame(s),a==null?void 0:a.call(e))}}):this.dom.win.requestAnimationFrame(s)}}onClickFile(e,t,o){var s;this.hidePopover();let n=this.itemForPath(e.path);if(n>=0&&this.selected!=n&&this.select(n),e instanceof c.TFile){if(this.app.viewRegistry.isExtensionRegistered(e.extension))return this.app.workspace.openLinkText(e.path,"",o&&c.Keymap.isModEvent(o)),this.rootMenu().hide(),o==null||o.stopPropagation(),!0;new c.Notice(`.${e.extension} files cannot be opened in Obsidian; Use "Open in Default App" to open them externally`)}else e===this.selectedFile?this.openBreadcrumb((s=this.crumb)==null?void 0:s.next()):new P(this,e,J(e)).cascade(t,o instanceof MouseEvent?o:void 0)}};var N="quick-explorer:folder-menu";function he(r,i,e){if(!i||i==="/")return;let t=r.vault.getAbstractFileByPath(i);if(!t)return;let{dragManager:o}=r,n=t instanceof c.TFile?o.dragFile(e,t):o.dragFolder(e,t);o.onDragStart(e,n)}var me=class{constructor(){this.nameEl=O("span",{class:"explorable-name"});this.sepEl=O("span",{class:"explorable-separator"});this.el=O("span",{draggable:!0,class:"explorable titlebar-button"},this.nameEl,this.sepEl)}update(i,e,t){var a,l;let{file:o,path:n}=i,s=o.name||n;this.sepEl.toggle(e{var n;return(n=this.lastMenu)==null?void 0:n.hide()}),(0,c.requireApiVersion)("0.15.6")){let n=this.win.document.body.find(".titlebar .titlebar-inner .titlebar-text"),s=n==null?void 0:n.cloneNode(!0);s&&(s.addClass("qe-replacement"),s.textContent=(o=(t=app.getAppTitle)==null?void 0:t.call(app))!=null?o:this.win.document.title,n.replaceWith(s),this.register(()=>s.replaceWith(n)))}if((0,c.requireApiVersion)("0.16.0")&&this.win.document.body.addClass("obsidian-themepocalypse"),(0,c.requireApiVersion)("0.16.3")){let n=".view-header .view-header-breadcrumb, .view-header .view-header-title-parent";this.register(W(this.win.document.body,"click",n,(s,a)=>{var l;if(!s.target.matches(".view-header-breadcrumb-separator, .is-exploring"))return(l=fe(a))==null||l.open(s),s.stopPropagation(),!1},{capture:!0})),this.register(W(this.win.document.body,"contextmenu",".view-header .view-header-breadcrumb",(s,a)=>{var u,p;if(s.target.matches(".view-header-breadcrumb-separator"))return;let l=(p=(u=fe(a))==null?void 0:u.file)==null?void 0:p.parent;if(l)return new k(this.app,l).cascade(a,s),s.stopImmediatePropagation(),!1},{capture:!0}))}let e=this.win.document.body.find("body:not(.is-hidden-frameless) .titlebar .titlebar-button-container.mod-left")||Ee(this,this.win,"left-region");if(this.register(()=>M(e,this)),T(e,this),this.isCurrent())this.update(this.app.workspace.getActiveFile());else{let n=app.workspace.getMostRecentLeaf(this.container),s=(n==null?void 0:n.view)instanceof c.FileView&&n.view.file;s&&this.update(s)}this.registerEvent(this.app.vault.on("rename",this.onFileChange,this)),this.registerEvent(this.app.vault.on("delete",this.onFileDelete,this)),this.el.on("contextmenu",".explorable",(n,s)=>{let{filePath:a}=s.dataset,l=this.app.vault.getAbstractFileByPath(a);new k(this.app,l).cascade(s,n)}),this.el.on("click",".explorable",(n,s)=>{this.folderMenu(s,n.isTrusted&&n)}),this.el.on("dragstart",".explorable",(n,s)=>{he(this.app,s.dataset.filePath,n)})}onFileChange(e){e===this.lastFile&&this.update(e)}onFileDelete(e){e===this.lastFile&&this.update()}visibleCrumb(e){let t=ft(this,e);if(!e.isShown()){let o=app.workspace.getActiveViewOfType(c.View).containerEl.find(".view-header .view-header-title-parent");if(o!=null&&o.isShown()){let{file:n}=t;t=fe(o),t=t.peers.find(s=>s.file===n)||t}}return t}folderMenu(e=this.el.firstElementChild,t){var o;return this.lastMenu=(o=this.visibleCrumb(e))==null?void 0:o.open(t)}browseVault(){return this.folderMenu()}browseCurrent(){return this.folderMenu(this.el.lastElementChild)}browseFile(e){if(e===this.lastFile)return this.browseCurrent();let t,o=this.el.firstElementChild,n=[],s=e.path.split("/").filter(a=>a);for(;o&&s.length;){if(n.push(s[0]),o.dataset.filePath!==n.join("/")){t=this.folderMenu(o),n.pop();break}s.shift(),o=o.nextElementSibling}for(;t&&s.length;){n.push(s.shift());let a=t.itemForPath(n.join("/"));if(a==-1)break;t.select(a),(s.length||e instanceof c.TFolder)&&(t.onArrowRight(),t=t.child)}return t}isCurrent(){return this===this.use(I).forLeaf(app.workspace.activeLeaf)}update(e){if(this.isOpen||(e!=null||(e=this.app.vault.getAbstractFileByPath("/")),e==this.lastFile&&e.path==this.lastPath))return;this.lastFile=e,this.lastPath=e.path;let t=ze(e);this.list.update(t)}},B=class{constructor(i,e,t,o,n){this.peers=i;this.el=e;this.file=t;this.onOpen=o;this.onClose=n;i.push(this)}next(){let i=this.peers.indexOf(this);if(i>-1)return this.peers[i+1]}prev(){let i=this.peers.indexOf(this);if(i>0)return this.peers[i-1]}open(i){var t;let e=this.file;if(e){(t=this.onOpen)==null||t.call(this,this);let o=this.file.parent||e;return new P(app,o,e,this).cascade(this.el,i&&i.isTrusted&&i,()=>this.onClose(this))}}};function fe(r){var m,d,f,v,g,S;let i=[],e=r.matchParent(".workspace-leaf"),t,o;app.workspace.iterateAllLeaves(b=>b.containerEl===e&&(t=b)&&!0);let n=app.vault.getAbstractFileByPath("/"),s=(d=(m=t==null?void 0:t.view)==null?void 0:m.file)!=null?d:n,a=ze(s),l=r.matchParent(".view-header-title-parent");o=new B(i,l,(v=(f=a.shift())==null?void 0:f.file)!=null?v:n,u,p);for(let b of l.findAll(".view-header-breadcrumb"))new B(i,b,(S=(g=a.shift())==null?void 0:g.file)!=null?S:n,u,p),b===r&&(o=i[i.length-1]);return o;function u(b){b.el.toggleClass("is-exploring",!0)}function p(b){b.el.toggleClass("is-exploring",!1)}}function ft(r,i){let e=[],t=i.matchParent("#quick-explorer"),o;for(let a of t.findAll(".explorable"))new B(e,a,app.vault.getAbstractFileByPath(a.dataset.filePath),n,s),a===i&&(o=e[e.length-1]);return o;function n(){r.isOpen++}function s(){r.isOpen--,r.lastMenu=null,!r.isOpen&&r.isCurrent()&&r.update(app.workspace.getActiveFile())}}function ze(r){let i=[];for(;r;)i.unshift({file:r,path:r.path}),r=r.parent;return i.length>1&&i.shift(),i}var Q=class extends c.Plugin{constructor(){super(...arguments);this.use=y.plugin(this);this.explorers=this.use(I).watch();this.ss=this.use($)}updateCurrent(e=this.app.workspace.activeLeaf,t=this.app.workspace.getActiveFile()){z(e)&&this.explorers.forLeaf(e).update(t)}onload(){this.app.workspace.registerHoverLinkSource(N,{display:"Quick Explorer",defaultMod:!0}),this.registerEvent(this.app.workspace.on("file-open",()=>this.updateCurrent())),this.registerEvent(this.explorers.onLeafChange(e=>this.updateCurrent(e))),this.addCommand({id:"browse-vault",name:"Browse vault",callback:()=>{var e;(e=this.explorers.forWindow())==null||e.browseVault()}}),this.addCommand({id:"browse-current",name:"Browse current folder",callback:()=>{var e;(e=this.explorers.forWindow())==null||e.browseCurrent()}}),Ce(this),this.registerEvent(this.app.workspace.on("file-menu",(e,t,o)=>{let n;if(o!=="quick-explorer"&&e.addItem(s=>{var a;s.setIcon("folder").setTitle("Show in Quick Explorer").onClick(l=>{var u;(u=this.explorers.forDom(n.dom))==null||u.browseFile(t)}),n=s,(a=n.setSection)==null||a.call(n,"view")}),n){let s=i18next.t("plugins.file-explorer.action-reveal-file"),a=e.items.findIndex(l=>{var u;return((u=l.titleEl)==null?void 0:u.textContent)===s});a>-1&&(e.sections||e.dom.insertBefore(n.dom,e.items[a].dom),e.items.remove(n),e.items.splice(a,0,n))}})),Object.defineProperty(c.TFolder.prototype,"basename",{get(){return this.name},configurable:!0})}[D("go-next","Go to next file in folder")](){return this.goFile(1,!0)}[D("go-prev","Go to previous file in folder")](){return this.goFile(-1,!0)}[D("go-first","Go to first file in folder")](){return this.goFile(-1,!1)}[D("go-last","Go to last file in folder")](){return this.goFile(1,!1)}goFile(e,t){return()=>{let o=app.workspace.getActiveFile(),n=o&&Ue(o,e,t);n&&n!==o&&app.workspace.activeLeaf.openFile(n)}}onunload(){this.app.workspace.unregisterHoverLinkSource(N)}}; diff --git a/.obsidian/plugins/quick-explorer/manifest.json b/.obsidian/plugins/quick-explorer/manifest.json deleted file mode 100644 index 76067c7..0000000 --- a/.obsidian/plugins/quick-explorer/manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "quick-explorer", - "name": "Quick Explorer", - "author": "PJ Eby", - "authorUrl": "https://github.com/pjeby", - "version": "0.2.8", - "description": "Perform file explorer operations (and see your current file path) from the title bar, using the mouse or keyboard", - "minAppVersion": "0.15.9", - "isDesktopOnly": true -} diff --git a/.obsidian/plugins/quick-explorer/styles.css b/.obsidian/plugins/quick-explorer/styles.css deleted file mode 100644 index 91ded54..0000000 --- a/.obsidian/plugins/quick-explorer/styles.css +++ /dev/null @@ -1,23 +0,0 @@ -@charset "UTF-8";.titlebar-button-container.mod-left{opacity:1}body:not(.qe-title-center):not(.qe-title-hide) .titlebar-text.qe-replacement{text-align:right;justify-content:flex-end;align-items:flex-end}body.qe-title-hide .titlebar-text.qe-replacement{display:none}body.obsidian-themepocalypse:not(.qe-hide-breadcrumbs) #quick-explorer{display:inherit}body.obsidian-themepocalypse:not(.qe-hide-breadcrumbs) #quick-explorer .explorable{display:inherit}body.qe-hide-breadcrumbs #quick-explorer{display:none}body.is-frameless.is-hidden-frameless:not(.qe-hide-breadcrumbs) .status-bar,body:not(.is-frameless):not(.qe-hide-breadcrumbs) .status-bar{position:static}body.is-frameless.is-hidden-frameless:not(.qe-hide-breadcrumbs) .status-bar .status-bar-item.left-region,body:not(.is-frameless):not(.qe-hide-breadcrumbs) .status-bar .status-bar-item.left-region{order:-9999;flex-grow:1}#quick-explorer{display:inline-block;padding-left:10px;padding-right:10px;z-index:var(--layer-cover);background-color:var(--background-translucent)!important}#quick-explorer .explorable{font-size:var(--font-ui-small, 12px);opacity:.75;cursor:pointer;padding:0;display:unset}.status-bar #quick-explorer .explorable{font-size:var(--status-bar-font-size, var(--font-ui-small, 12px));opacity:1}#quick-explorer .explorable.selected,#quick-explorer .explorable:hover{background-color:var(--interactive-accent-hover);color:var(--text-on-accent);opacity:1}#quick-explorer .explorable-separator:before{content:"\a0/\a0"}.menu.qe-popup-menu~.popover.hover-popover{z-index:var(--layer-menu)}.qe-popup-menu .menu-item:not(.is-disabled):not(.is-label){display:flex;align-items:center}.qe-popup-menu .menu-item:not(.is-disabled):not(.is-label).selected{background-color:var(--interactive-accent-hover)}.qe-popup-menu .menu-item:not(.is-disabled):not(.is-label):hover:not(.selected){background-color:var(--background-primary);color:var(--text-normal)}.qe-popup-menu .menu-item:not(.is-disabled):not(.is-label):hover:not(.selected) .menu-item-icon{color:var(--text-muted)}.qe-popup-menu .menu-item:not(.is-disabled):not(.is-label) .menu-item-title{flex-grow:1}.qe-popup-menu .menu-item:not(.is-disabled):not(.is-label) .nav-file-tag{margin-left:1.5em;opacity:.5;background-color:transparent}.qe-popup-menu .menu-item:not(.is-disabled):not(.is-label) .nav-file-tag.qe-file-count{font-size:75%}.qe-popup-menu .menu-item:not(.is-disabled):not(.is-label):hover,.qe-popup-menu .menu-item:not(.is-disabled):not(.is-label).selected{color:var(--text-on-accent)}.qe-popup-menu .menu-item:not(.is-disabled):not(.is-label):hover .menu-item-icon,.qe-popup-menu .menu-item:not(.is-disabled):not(.is-label).selected .menu-item-icon{color:var(--text-on-accent)}.qe-popup-menu .menu-item:not(.is-disabled):not(.is-label):hover .nav-file-tag,.qe-popup-menu .menu-item:not(.is-disabled):not(.is-label).selected .nav-file-tag{opacity:1}.view-header-title-parent:before{content:"/";padding:2px 1px;color:var(--text-faint)}.view-header-breadcrumb.is-exploring,.view-header-title-parent.is-exploring:before{background-color:var(--background-modifier-hover);color:var(--text-normal)} -/*! /* @settings -name: Quick Explorer -id: quick-explorer -settings: - - id: qe-obsidian-title - title: Obsidian Title (Vault+Version) - description: What should happen to the Obsidian title text? - type: class-select - default: qe-title-right - options: - - label: Show it on the right - value: qe-title-right - - label: Show it in the center - value: qe-title-center - - label: Hide it entirely - value: qe-title-hide - - - id: qe-hide-breadcrumbs - title: Hide Quick Explorer - description: Hide quick explorer (and use tab titlebar breadcrumbs on 0.16) - type: class-toggle -*/