~ianmjones/snippetexpander

24fde5fc3fa1d47e7c490f983f0cc2a98a4089d8 — Ian M. Jones 2 months ago 3617d6d
gui: update snippets when changed in daemon through any means
M cmd/snippetexpanderd/dbus.go => cmd/snippetexpanderd/dbus.go +9 -0
@@ 43,6 43,11 @@ func (s *service) Stop() *dbus.Error {
	return nil
}

// snippetsUpdated lets any interested parties know that they might want to refresh their list of snippets.
func (s *service) snippetsUpdated() {
	_ = s.dbusConn.Emit(dbusservice.BasePath, dbusservice.BaseDest+".Event.SnippetsUpdated", true)
}

// AddSnippet creates a new Snippet with given abbreviation and body.
func (s *service) AddSnippet(abbreviation string, body string) (*dbusservice.Snippet, *dbus.Error) {
	theSnippet, err := s.snippets.GetSnippetWithAbbreviation(abbreviation)


@@ 77,6 82,7 @@ func (s *service) AddSnippet(abbreviation string, body string) (*dbusservice.Sni
	if err != nil {
		return nil, dbus.MakeFailedError(err)
	}
	defer s.snippetsUpdated()

	return dbusSnippet, nil
}


@@ 110,6 116,7 @@ func (s *service) UpdateSnippetWithID(id string, snippet *dbusservice.Snippet) *
	if err != nil {
		return dbus.MakeFailedError(err)
	}
	defer s.snippetsUpdated()

	return nil
}


@@ 143,6 150,7 @@ func (s *service) RemoveSnippet(abbreviation string) (bool, *dbus.Error) {
	if err != nil {
		return false, dbus.MakeFailedError(err)
	}
	defer s.snippetsUpdated()

	return true, nil
}


@@ 323,6 331,7 @@ func (s *service) SyncSnippets(dbusSnippets []dbusservice.Snippet, options dbuss
	if err != nil {
		return nil, dbus.MakeFailedError(err)
	}
	defer s.snippetsUpdated()

	return stats, nil
}

M cmd/snippetexpanderd/main.go => cmd/snippetexpanderd/main.go +6 -2
@@ 9,6 9,7 @@ import (
	"os"
	"os/signal"
	"path/filepath"
	"syscall"

	"git.sr.ht/~ianmjones/snippetexpander/internal/manager"
	"github.com/adrg/xdg"


@@ 25,7 26,7 @@ func main() {
	ctx, cancel := context.WithCancel(ctx)

	signalChan := make(chan os.Signal, 1)
	signal.Notify(signalChan, os.Interrupt, os.Kill)
	signal.Notify(signalChan, os.Interrupt, syscall.SIGTERM)

	c := &config{}



@@ 39,7 40,7 @@ func main() {
			select {
			case s := <-signalChan:
				switch s {
				case os.Interrupt, os.Kill:
				case os.Interrupt, syscall.SIGTERM:
					log.Printf("Got SIGINT/SIGTERM, exiting.")
					cancel()
					os.Exit(1)


@@ 118,6 119,9 @@ func run(ctx context.Context, c *config, out io.Writer) error {

	// Get snippet manager and store in service.
	serv.snippets, err = manager.New(serv.db)
	if err != nil {
		return err
	}

	for {
		select {

M cmd/snippetexpandergui/app.go => cmd/snippetexpandergui/app.go +36 -0
@@ 22,10 22,13 @@ import (
type App struct {
	ctx            context.Context
	dbusConn       *dbus.Conn
	eventBus       *dbus.Conn
	serv           dbusservice.DBusService
	SearchAndPaste bool
}

var quitEventBusListener chan struct{}

// NewApp creates a new App application struct
func NewApp() *App {
	return &App{}


@@ 35,20 38,53 @@ func NewApp() *App {
func (a *App) startup(ctx context.Context) {
	// Perform your setup here
	a.ctx = ctx
	quitEventBusListener = make(chan struct{})

	dbusConn, serv, err := service.NewDBusService()
	if err != nil {
		return
	}

	eventBus, err := dbus.ConnectSessionBus()
	if err != nil {
		return
	}

	a.dbusConn = dbusConn
	a.eventBus = eventBus
	a.serv = serv

	// Set up the event bus listener.
	err = a.eventBus.AddMatchSignal(
		dbus.WithMatchSender(dbusservice.BaseDest),
	)
	if err != nil {
		return
	}

	sigc := make(chan *dbus.Signal, 10)
	eventBus.Signal(sigc)

	go func() {
		for {
			select {
			case sig := <-sigc:
				if sig.Name == dbusservice.BaseDest+".Event.SnippetsUpdated" {
					runtime.EventsEmit(a.ctx, "SnippetsUpdated")
				}
			case <-quitEventBusListener:
				return
			}
		}
	}()
}

// beforeClose is called when the application is about to quit,
// either by clicking the window close button or calling runtime.Quit.
// Returning true will cause the application to continue, false will continue shutdown as normal.
func (a *App) beforeClose(ctx context.Context) (prevent bool) {
	close(quitEventBusListener)
	_ = a.eventBus.Close()
	_ = a.dbusConn.Close()

	return false

A cmd/snippetexpandergui/frontend/dist/assets/index-5bae17e4.js => cmd/snippetexpandergui/frontend/dist/assets/index-5bae17e4.js +5 -0
@@ 0,0 1,5 @@
var Gi=Object.defineProperty;var $i=(e,t,n)=>t in e?Gi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ft=(e,t,n)=>($i(e,typeof t!="symbol"?t+"":t,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();const ji="modulepreload",Fi=function(e){return"/"+e},Nn={},zi=function(t,n,i){if(!n||n.length===0)return t();const r=document.getElementsByTagName("link");return Promise.all(n.map(s=>{if(s=Fi(s),s in Nn)return;Nn[s]=!0;const o=s.endsWith(".css"),l=o?'[rel="stylesheet"]':"";if(!!i)for(let f=r.length-1;f>=0;f--){const m=r[f];if(m.href===s&&(!o||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${l}`))return;const a=document.createElement("link");if(a.rel=o?"stylesheet":ji,o||(a.as="script",a.crossOrigin=""),a.href=s,document.head.appendChild(a),o)return new Promise((f,m)=>{a.addEventListener("load",f),a.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>t()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};function G(){}function pn(e,t){for(const n in t)e[n]=t[n];return e}function li(e){return e()}function Pn(){return Object.create(null)}function Ee(e){e.forEach(li)}function Qe(e){return typeof e=="function"}function Z(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let bt;function Vi(e,t){return e===t?!0:(bt||(bt=document.createElement("a")),bt.href=t,e===bt.href)}function Wi(e){return Object.keys(e).length===0}function mn(e,...t){if(e==null){for(const i of t)i(void 0);return G}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function On(e){let t;return mn(e,n=>t=n)(),t}function ne(e,t,n){e.$$.on_destroy.push(mn(t,n))}function ht(e,t,n,i){if(e){const r=ai(e,t,n,i);return e[0](r)}}function ai(e,t,n,i){return e[1]&&i?pn(n.ctx.slice(),e[1](i(t))):n.ctx}function pt(e,t,n,i){if(e[2]&&i){const r=e[2](i(n));if(t.dirty===void 0)return r;if(typeof r=="object"){const s=[],o=Math.max(t.dirty.length,r.length);for(let l=0;l<o;l+=1)s[l]=t.dirty[l]|r[l];return s}return t.dirty|r}return t.dirty}function mt(e,t,n,i,r,s){if(r){const o=ai(t,n,i,s);e.p(o,r)}}function dt(e){if(e.ctx.length>32){const t=[],n=e.ctx.length/32;for(let i=0;i<n;i++)t[i]=-1;return t}return-1}function Xi(e,t,n){return e.set(n),t}function dn(e){return e&&Qe(e.destroy)?e.destroy:G}function A(e,t){e.appendChild(t)}function g(e,t,n){e.insertBefore(t,n||null)}function _(e){e.parentNode&&e.parentNode.removeChild(e)}function qi(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function C(e){return document.createElement(e)}function V(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function $(e){return document.createTextNode(e)}function R(){return $(" ")}function ye(){return $("")}function re(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function vt(e){return function(t){return t.preventDefault(),e.call(this,t)}}function c(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Zi(e){return Array.from(e.childNodes)}function z(e,t){t=""+t,e.data!==t&&(e.data=t)}function ze(e,t){e.value=t??""}function X(e,t,n){e.classList.toggle(t,!!n)}function Qi(e,t,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:i})}function Ve(e,t){return new e(t)}let at;function st(e){at=e}function Ct(){if(!at)throw new Error("Function called outside component initialization");return at}function Je(e){Ct().$$.on_mount.push(e)}function ui(e){Ct().$$.after_update.push(e)}function _n(e){Ct().$$.on_destroy.push(e)}function _t(){const e=Ct();return(t,n,{cancelable:i=!1}={})=>{const r=e.$$.callbacks[t];if(r){const s=Qi(t,n,{cancelable:i});return r.slice().forEach(o=>{o.call(e,s)}),!s.defaultPrevented}return!0}}function ut(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(i=>i.call(this,t))}const Ue=[],ve=[];let De=[];const en=[],fi=Promise.resolve();let tn=!1;function ci(){tn||(tn=!0,fi.then(hi))}function gn(){return ci(),fi}function nn(e){De.push(e)}function Ge(e){en.push(e)}const zt=new Set;let xe=0;function hi(){if(xe!==0)return;const e=at;do{try{for(;xe<Ue.length;){const t=Ue[xe];xe++,st(t),Ji(t.$$)}}catch(t){throw Ue.length=0,xe=0,t}for(st(null),Ue.length=0,xe=0;ve.length;)ve.pop()();for(let t=0;t<De.length;t+=1){const n=De[t];zt.has(n)||(zt.add(n),n())}De.length=0}while(Ue.length);for(;en.length;)en.pop()();tn=!1,zt.clear(),st(e)}function Ji(e){if(e.fragment!==null){e.update(),Ee(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(nn)}}function Yi(e){const t=[],n=[];De.forEach(i=>e.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),De=t}const yt=new Set;let Oe;function ue(){Oe={r:0,c:[],p:Oe}}function fe(){Oe.r||Ee(Oe.c),Oe=Oe.p}function w(e,t){e&&e.i&&(yt.delete(e),e.i(t))}function S(e,t,n,i){if(e&&e.o){if(yt.has(e))return;yt.add(e),Oe.c.push(()=>{yt.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function Mn(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function Bt(e,t){const n={},i={},r={$$scope:1};let s=e.length;for(;s--;){const o=e[s],l=t[s];if(l){for(const u in o)u in l||(i[u]=1);for(const u in l)r[u]||(n[u]=l[u],r[u]=1);e[s]=l}else for(const u in o)r[u]=1}for(const o in i)o in n||(n[o]=void 0);return n}function Tt(e){return typeof e=="object"&&e!==null?e:{}}function $e(e,t,n){const i=e.$$.props[t];i!==void 0&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function U(e){e&&e.c()}function O(e,t,n){const{fragment:i,after_update:r}=e.$$;i&&i.m(t,n),nn(()=>{const s=e.$$.on_mount.map(li).filter(Qe);e.$$.on_destroy?e.$$.on_destroy.push(...s):Ee(s),e.$$.on_mount=[]}),r.forEach(nn)}function M(e,t){const n=e.$$;n.fragment!==null&&(Yi(n.after_update),Ee(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Ki(e,t){e.$$.dirty[0]===-1&&(Ue.push(e),ci(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function J(e,t,n,i,r,s,o,l=[-1]){const u=at;st(e);const a=e.$$={fragment:null,ctx:[],props:s,update:G,not_equal:r,bound:Pn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:Pn(),dirty:l,skip_bound:!1,root:t.target||u.$$.root};o&&o(a.root);let f=!1;if(a.ctx=n?n(e,t.props||{},(m,h,...p)=>{const d=p.length?p[0]:h;return a.ctx&&r(a.ctx[m],a.ctx[m]=d)&&(!a.skip_bound&&a.bound[m]&&a.bound[m](d),f&&Ki(e,m)),h}):[],a.update(),f=!0,Ee(a.before_update),a.fragment=i?i(a.ctx):!1,t.target){if(t.hydrate){const m=Zi(t.target);a.fragment&&a.fragment.l(m),m.forEach(_)}else a.fragment&&a.fragment.c();t.intro&&w(e.$$.fragment),O(e,t.target,t.anchor),hi()}st(u)}class Y{constructor(){Ft(this,"$$");Ft(this,"$$set")}$destroy(){M(this,1),this.$destroy=G}$on(t,n){if(!Qe(n))return G;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(t){this.$$set&&!Wi(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const er="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(er);function Vt(e){window.runtime.LogError(e)}function tr(e,t,n){return window.runtime.EventsOnMultiple(e,t,n)}function nr(e,t){return tr(e,t,-1)}function wt(e){window.runtime.BrowserOpenURL(e)}function ir(){window.runtime.Quit()}function rr(e,t){return window.go.main.App.AddSnippet(e,t)}function sr(){return window.go.main.App.CustomShortcutsEnabled()}function or(){return window.go.main.App.DaemonInstalled()}function lr(e,t){return window.go.main.App.DeleteCustomShortcut(e,t)}function ar(){return window.go.main.App.ExportSnippets()}function ur(){return window.go.main.App.GetAllSnippets()}function fr(){return window.go.main.App.GetAutoexpandStatus()}function cr(){return window.go.main.App.GetAutostartStatus()}function hr(e){return window.go.main.App.GetCustomShortcutBinding(e)}function pi(e){return window.go.main.App.GetSetting(e)}function mi(e){return window.go.main.App.GetSnippetWithAbbreviation(e)}function pr(e){return window.go.main.App.GetSnippetWithID(e)}function mr(e,t){return window.go.main.App.GetSnippets(e,t)}function dr(){return window.go.main.App.GetVersion()}function di(e){return window.go.main.App.ImportSnippets(e)}function _r(e){return window.go.main.App.NilUUID(e)}function gr(e,t){return window.go.main.App.PasteSnippetAndQuit(e,t)}function br(e){return window.go.main.App.Ping(e)}function vr(e){return window.go.main.App.RemoveSnippet(e)}function wr(e,t,n,i){return window.go.main.App.SaveCustomShortcut(e,t,n,i)}function Er(e,t){return window.go.main.App.SaveSetting(e,t)}function yr(){return window.go.main.App.SearchAndPasteMode()}function ae(e,t){return window.go.main.App.ShowError(e,t)}function Sr(){return window.go.main.App.StartDaemon()}function kr(e){return window.go.main.App.UpdateAutoexpand(e)}function Ar(e){return window.go.main.App.UpdateAutostart(e)}function Br(e,t){return window.go.main.App.UpdateSnippetWithID(e,t)}const Re=[];function _i(e,t){return{subscribe:Te(e,t).subscribe}}function Te(e,t=G){let n;const i=new Set;function r(l){if(Z(e,l)&&(e=l,n)){const u=!Re.length;for(const a of i)a[1](),Re.push(a,e);if(u){for(let a=0;a<Re.length;a+=2)Re[a][0](Re[a+1]);Re.length=0}}}function s(l){r(l(e))}function o(l,u=G){const a=[l,u];return i.add(a),i.size===1&&(n=t(r,s)||G),l(e),()=>{i.delete(a),i.size===0&&n&&(n(),n=null)}}return{set:r,update:s,subscribe:o}}function Le(e,t,n){const i=!Array.isArray(e),r=i?[e]:e;if(!r.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=t.length<2;return _i(n,(o,l)=>{let u=!1;const a=[];let f=0,m=G;const h=()=>{if(f)return;m();const d=t(i?a[0]:a,o,l);s?o(d):m=Qe(d)?d:G},p=r.map((d,b)=>mn(d,I=>{a[b]=I,f&=~(1<<b),u&&h()},()=>{f|=1<<b}));return u=!0,h(),function(){Ee(p),m(),u=!1}})}function Tr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ir=function(t){return Hr(t)&&!Cr(t)};function Hr(e){return!!e&&typeof e=="object"}function Cr(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Pr(e)}var Lr=typeof Symbol=="function"&&Symbol.for,Nr=Lr?Symbol.for("react.element"):60103;function Pr(e){return e.$$typeof===Nr}function Or(e){return Array.isArray(e)?[]:{}}function ft(e,t){return t.clone!==!1&&t.isMergeableObject(e)?We(Or(e),e,t):e}function Mr(e,t,n){return e.concat(t).map(function(i){return ft(i,n)})}function xr(e,t){if(!t.customMerge)return We;var n=t.customMerge(e);return typeof n=="function"?n:We}function Rr(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function xn(e){return Object.keys(e).concat(Rr(e))}function gi(e,t){try{return t in e}catch{return!1}}function Ur(e,t){return gi(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function Dr(e,t,n){var i={};return n.isMergeableObject(e)&&xn(e).forEach(function(r){i[r]=ft(e[r],n)}),xn(t).forEach(function(r){Ur(e,r)||(gi(e,r)&&n.isMergeableObject(t[r])?i[r]=xr(r,n)(e[r],t[r],n):i[r]=ft(t[r],n))}),i}function We(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||Mr,n.isMergeableObject=n.isMergeableObject||Ir,n.cloneUnlessOtherwiseSpecified=ft;var i=Array.isArray(t),r=Array.isArray(e),s=i===r;return s?i?n.arrayMerge(e,t,n):Dr(e,t,n):ft(t,n)}We.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(i,r){return We(i,r,n)},{})};var Gr=We,$r=Gr;const jr=Tr($r);var rn=function(e,t){return rn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},rn(e,t)};function Lt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");rn(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var te=function(){return te=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},te.apply(this,arguments)};function Wt(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,s;i<r;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))}var q;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(q||(q={}));var le;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(le||(le={}));var Xe;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(Xe||(Xe={}));function Rn(e){return e.type===le.literal}function Fr(e){return e.type===le.argument}function bi(e){return e.type===le.number}function vi(e){return e.type===le.date}function wi(e){return e.type===le.time}function Ei(e){return e.type===le.select}function yi(e){return e.type===le.plural}function zr(e){return e.type===le.pound}function Si(e){return e.type===le.tag}function ki(e){return!!(e&&typeof e=="object"&&e.type===Xe.number)}function sn(e){return!!(e&&typeof e=="object"&&e.type===Xe.dateTime)}var Ai=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,Vr=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function Wr(e){var t={};return e.replace(Vr,function(n){var i=n.length;switch(n[0]){case"G":t.era=i===4?"long":i===5?"narrow":"short";break;case"y":t.year=i===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][i-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][i-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=i===4?"short":i===5?"narrow":"short";break;case"e":if(i<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][i-4];break;case"c":if(i<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][i-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][i-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][i-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][i-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][i-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][i-1];break;case"s":t.second=["numeric","2-digit"][i-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=i<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var Xr=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function qr(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(Xr).filter(function(h){return h.length>0}),n=[],i=0,r=t;i<r.length;i++){var s=r[i],o=s.split("/");if(o.length===0)throw new Error("Invalid number skeleton");for(var l=o[0],u=o.slice(1),a=0,f=u;a<f.length;a++){var m=f[a];if(m.length===0)throw new Error("Invalid number skeleton")}n.push({stem:l,options:u})}return n}function Zr(e){return e.replace(/^(.*?)-/,"")}var Un=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Bi=/^(@+)?(\+|#+)?[rs]?$/g,Qr=/(\*)(0+)|(#+)(0+)|(0+)/g,Ti=/^(0+)$/;function Dn(e){var t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace(Bi,function(n,i,r){return typeof r!="string"?(t.minimumSignificantDigits=i.length,t.maximumSignificantDigits=i.length):r==="+"?t.minimumSignificantDigits=i.length:i[0]==="#"?t.maximumSignificantDigits=i.length:(t.minimumSignificantDigits=i.length,t.maximumSignificantDigits=i.length+(typeof r=="string"?r.length:0)),""}),t}function Ii(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function Jr(e){var t;if(e[0]==="E"&&e[1]==="E"?(t={notation:"engineering"},e=e.slice(2)):e[0]==="E"&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if(n==="+!"?(t.signDisplay="always",e=e.slice(2)):n==="+?"&&(t.signDisplay="exceptZero",e=e.slice(2)),!Ti.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function Gn(e){var t={},n=Ii(e);return n||t}function Yr(e){for(var t={},n=0,i=e;n<i.length;n++){var r=i[n];switch(r.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=r.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=Zr(r.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=te(te(te({},t),{notation:"scientific"}),r.options.reduce(function(u,a){return te(te({},u),Gn(a))},{}));continue;case"engineering":t=te(te(te({},t),{notation:"engineering"}),r.options.reduce(function(u,a){return te(te({},u),Gn(a))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(r.options[0]);continue;case"integer-width":if(r.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace(Qr,function(u,a,f,m,h,p){if(a)t.minimumIntegerDigits=f.length;else{if(m&&h)throw new Error("We currently do not support maximum integer digits");if(p)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Ti.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(Un.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(Un,function(u,a,f,m,h,p){return f==="*"?t.minimumFractionDigits=a.length:m&&m[0]==="#"?t.maximumFractionDigits=m.length:h&&p?(t.minimumFractionDigits=h.length,t.maximumFractionDigits=h.length+p.length):(t.minimumFractionDigits=a.length,t.maximumFractionDigits=a.length),""});var s=r.options[0];s==="w"?t=te(te({},t),{trailingZeroDisplay:"stripIfInteger"}):s&&(t=te(te({},t),Dn(s)));continue}if(Bi.test(r.stem)){t=te(te({},t),Dn(r.stem));continue}var o=Ii(r.stem);o&&(t=te(te({},t),o));var l=Jr(r.stem);l&&(t=te(te({},t),l))}return t}var Et={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function Kr(e,t){for(var n="",i=0;i<e.length;i++){var r=e.charAt(i);if(r==="j"){for(var s=0;i+1<e.length&&e.charAt(i+1)===r;)s++,i++;var o=1+(s&1),l=s<2?1:3+(s>>1),u="a",a=es(t);for((a=="H"||a=="k")&&(l=0);l-- >0;)n+=u;for(;o-- >0;)n=a+n}else r==="J"?n+="H":n+=r}return n}function es(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n=e.language,i;n!=="root"&&(i=e.maximize().region);var r=Et[i||""]||Et[n||""]||Et["".concat(n,"-001")]||Et["001"];return r[0]}var Xt,ts=new RegExp("^".concat(Ai.source,"*")),ns=new RegExp("".concat(Ai.source,"*$"));function Q(e,t){return{start:e,end:t}}var is=!!String.prototype.startsWith,rs=!!String.fromCodePoint,ss=!!Object.fromEntries,os=!!String.prototype.codePointAt,ls=!!String.prototype.trimStart,as=!!String.prototype.trimEnd,us=!!Number.isSafeInteger,fs=us?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},on=!0;try{var cs=Ci("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");on=((Xt=cs.exec("a"))===null||Xt===void 0?void 0:Xt[0])==="a"}catch{on=!1}var $n=is?function(t,n,i){return t.startsWith(n,i)}:function(t,n,i){return t.slice(i,i+n.length)===n},ln=rs?String.fromCodePoint:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i="",r=t.length,s=0,o;r>s;){if(o=t[s++],o>1114111)throw RangeError(o+" is not a valid code point");i+=o<65536?String.fromCharCode(o):String.fromCharCode(((o-=65536)>>10)+55296,o%1024+56320)}return i},jn=ss?Object.fromEntries:function(t){for(var n={},i=0,r=t;i<r.length;i++){var s=r[i],o=s[0],l=s[1];n[o]=l}return n},Hi=os?function(t,n){return t.codePointAt(n)}:function(t,n){var i=t.length;if(!(n<0||n>=i)){var r=t.charCodeAt(n),s;return r<55296||r>56319||n+1===i||(s=t.charCodeAt(n+1))<56320||s>57343?r:(r-55296<<10)+(s-56320)+65536}},hs=ls?function(t){return t.trimStart()}:function(t){return t.replace(ts,"")},ps=as?function(t){return t.trimEnd()}:function(t){return t.replace(ns,"")};function Ci(e,t){return new RegExp(e,t)}var an;if(on){var Fn=Ci("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");an=function(t,n){var i;Fn.lastIndex=n;var r=Fn.exec(t);return(i=r[1])!==null&&i!==void 0?i:""}}else an=function(t,n){for(var i=[];;){var r=Hi(t,n);if(r===void 0||Li(r)||gs(r))break;i.push(r),n+=r>=65536?2:1}return ln.apply(void 0,i)};var ms=function(){function e(t,n){n===void 0&&(n={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.locale=n.locale,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,n,i){for(var r=[];!this.isEOF();){var s=this.char();if(s===123){var o=this.parseArgument(t,i);if(o.err)return o;r.push(o.val)}else{if(s===125&&t>0)break;if(s===35&&(n==="plural"||n==="selectordinal")){var l=this.clonePosition();this.bump(),r.push({type:le.pound,location:Q(l,this.clonePosition())})}else if(s===60&&!this.ignoreTag&&this.peek()===47){if(i)break;return this.error(q.UNMATCHED_CLOSING_TAG,Q(this.clonePosition(),this.clonePosition()))}else if(s===60&&!this.ignoreTag&&un(this.peek()||0)){var o=this.parseTag(t,n);if(o.err)return o;r.push(o.val)}else{var o=this.parseLiteral(t,n);if(o.err)return o;r.push(o.val)}}}return{val:r,err:null}},e.prototype.parseTag=function(t,n){var i=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:le.literal,value:"<".concat(r,"/>"),location:Q(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var s=this.parseMessage(t+1,n,!0);if(s.err)return s;var o=s.val,l=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!un(this.char()))return this.error(q.INVALID_TAG,Q(l,this.clonePosition()));var u=this.clonePosition(),a=this.parseTagName();return r!==a?this.error(q.UNMATCHED_CLOSING_TAG,Q(u,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:le.tag,value:r,children:o,location:Q(i,this.clonePosition())},err:null}:this.error(q.INVALID_TAG,Q(l,this.clonePosition())))}else return this.error(q.UNCLOSED_TAG,Q(i,this.clonePosition()))}else return this.error(q.INVALID_TAG,Q(i,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&_s(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,n){for(var i=this.clonePosition(),r="";;){var s=this.tryParseQuote(n);if(s){r+=s;continue}var o=this.tryParseUnquoted(t,n);if(o){r+=o;continue}var l=this.tryParseLeftAngleBracket();if(l){r+=l;continue}break}var u=Q(i,this.clonePosition());return{val:{type:le.literal,value:r,location:u},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!ds(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var n=[this.char()];for(this.bump();!this.isEOF();){var i=this.char();if(i===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(i);this.bump()}return ln.apply(void 0,n)},e.prototype.tryParseUnquoted=function(t,n){if(this.isEOF())return null;var i=this.char();return i===60||i===123||i===35&&(n==="plural"||n==="selectordinal")||i===125&&t>0?null:(this.bump(),ln(i))},e.prototype.parseArgument=function(t,n){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Q(i,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(q.EMPTY_ARGUMENT,Q(i,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(q.MALFORMED_ARGUMENT,Q(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Q(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:le.argument,value:r,location:Q(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Q(i,this.clonePosition())):this.parseArgumentOptions(t,n,r,i);default:return this.error(q.MALFORMED_ARGUMENT,Q(i,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),n=this.offset(),i=an(this.message,n),r=n+i.length;this.bumpTo(r);var s=this.clonePosition(),o=Q(t,s);return{value:i,location:o}},e.prototype.parseArgumentOptions=function(t,n,i,r){var s,o=this.clonePosition(),l=this.parseIdentifierIfPossible().value,u=this.clonePosition();switch(l){case"":return this.error(q.EXPECT_ARGUMENT_TYPE,Q(o,u));case"number":case"date":case"time":{this.bumpSpace();var a=null;if(this.bumpIf(",")){this.bumpSpace();var f=this.clonePosition(),m=this.parseSimpleArgStyleIfPossible();if(m.err)return m;var h=ps(m.val);if(h.length===0)return this.error(q.EXPECT_ARGUMENT_STYLE,Q(this.clonePosition(),this.clonePosition()));var p=Q(f,this.clonePosition());a={style:h,styleLocation:p}}var d=this.tryParseArgumentClose(r);if(d.err)return d;var b=Q(r,this.clonePosition());if(a&&$n(a==null?void 0:a.style,"::",0)){var I=hs(a.style.slice(2));if(l==="number"){var m=this.parseNumberSkeletonFromString(I,a.styleLocation);return m.err?m:{val:{type:le.number,value:i,location:b,style:m.val},err:null}}else{if(I.length===0)return this.error(q.EXPECT_DATE_TIME_SKELETON,b);var B=I;this.locale&&(B=Kr(I,this.locale));var h={type:Xe.dateTime,pattern:B,location:a.styleLocation,parsedOptions:this.shouldParseSkeletons?Wr(B):{}},E=l==="date"?le.date:le.time;return{val:{type:E,value:i,location:b,style:h},err:null}}}return{val:{type:l==="number"?le.number:l==="date"?le.date:le.time,value:i,location:b,style:(s=a==null?void 0:a.style)!==null&&s!==void 0?s:null},err:null}}case"plural":case"selectordinal":case"select":{var H=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(q.EXPECT_SELECT_ARGUMENT_OPTIONS,Q(H,te({},H)));this.bumpSpace();var y=this.parseIdentifierIfPossible(),T=0;if(l!=="select"&&y.value==="offset"){if(!this.bumpIf(":"))return this.error(q.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Q(this.clonePosition(),this.clonePosition()));this.bumpSpace();var m=this.tryParseDecimalInteger(q.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,q.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(m.err)return m;this.bumpSpace(),y=this.parseIdentifierIfPossible(),T=m.val}var L=this.tryParsePluralOrSelectOptions(t,l,n,y);if(L.err)return L;var d=this.tryParseArgumentClose(r);if(d.err)return d;var k=Q(r,this.clonePosition());return l==="select"?{val:{type:le.select,value:i,options:jn(L.val),location:k},err:null}:{val:{type:le.plural,value:i,options:jn(L.val),offset:T,pluralType:l==="plural"?"cardinal":"ordinal",location:k},err:null}}default:return this.error(q.INVALID_ARGUMENT_TYPE,Q(o,u))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Q(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,n=this.clonePosition();!this.isEOF();){var i=this.char();switch(i){case 39:{this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(q.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Q(r,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(n.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(n.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,n){var i=[];try{i=qr(t)}catch{return this.error(q.INVALID_NUMBER_SKELETON,n)}return{val:{type:Xe.number,tokens:i,location:n,parsedOptions:this.shouldParseSkeletons?Yr(i):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,n,i,r){for(var s,o=!1,l=[],u=new Set,a=r.value,f=r.location;;){if(a.length===0){var m=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var h=this.tryParseDecimalInteger(q.EXPECT_PLURAL_ARGUMENT_SELECTOR,q.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;f=Q(m,this.clonePosition()),a=this.message.slice(m.offset,this.offset())}else break}if(u.has(a))return this.error(n==="select"?q.DUPLICATE_SELECT_ARGUMENT_SELECTOR:q.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,f);a==="other"&&(o=!0),this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?q.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:q.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Q(this.clonePosition(),this.clonePosition()));var d=this.parseMessage(t+1,n,i);if(d.err)return d;var b=this.tryParseArgumentClose(p);if(b.err)return b;l.push([a,{value:d.val,location:Q(p,this.clonePosition())}]),u.add(a),this.bumpSpace(),s=this.parseIdentifierIfPossible(),a=s.value,f=s.location}return l.length===0?this.error(n==="select"?q.EXPECT_SELECT_ARGUMENT_SELECTOR:q.EXPECT_PLURAL_ARGUMENT_SELECTOR,Q(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(q.MISSING_OTHER_CLAUSE,Q(this.clonePosition(),this.clonePosition())):{val:l,err:null}},e.prototype.tryParseDecimalInteger=function(t,n){var i=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var s=!1,o=0;!this.isEOF();){var l=this.char();if(l>=48&&l<=57)s=!0,o=o*10+(l-48),this.bump();else break}var u=Q(r,this.clonePosition());return s?(o*=i,fs(o)?{val:o,err:null}:this.error(n,u)):this.error(t,u)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var n=Hi(this.message,t);if(n===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return n},e.prototype.error=function(t,n){return{val:null,err:{kind:t,message:this.message,location:n}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if($n(this.message,t,this.offset())){for(var n=0;n<t.length;n++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(t){var n=this.offset(),i=this.message.indexOf(t,n);return i>=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var n=this.offset();if(n===t)break;if(n>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Li(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),n=this.offset(),i=this.message.charCodeAt(n+(t>=65536?2:1));return i??null},e}();function un(e){return e>=97&&e<=122||e>=65&&e<=90}function ds(e){return un(e)||e===47}function _s(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Li(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function gs(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function fn(e){e.forEach(function(t){if(delete t.location,Ei(t)||yi(t))for(var n in t.options)delete t.options[n].location,fn(t.options[n].value);else bi(t)&&ki(t.style)||(vi(t)||wi(t))&&sn(t.style)?delete t.style.location:Si(t)&&fn(t.children)})}function bs(e,t){t===void 0&&(t={}),t=te({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new ms(e,t).parse();if(n.err){var i=SyntaxError(q[n.err.kind]);throw i.location=n.err.location,i.originalMessage=n.err.message,i}return t!=null&&t.captureLocation||fn(n.val),n.val}function qt(e,t){var n=t&&t.cache?t.cache:ks,i=t&&t.serializer?t.serializer:Ss,r=t&&t.strategy?t.strategy:ws;return r(e,{cache:n,serializer:i})}function vs(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Ni(e,t,n,i){var r=vs(i)?i:n(i),s=t.get(r);return typeof s>"u"&&(s=e.call(this,i),t.set(r,s)),s}function Pi(e,t,n){var i=Array.prototype.slice.call(arguments,3),r=n(i),s=t.get(r);return typeof s>"u"&&(s=e.apply(this,i),t.set(r,s)),s}function bn(e,t,n,i,r){return n.bind(t,e,i,r)}function ws(e,t){var n=e.length===1?Ni:Pi;return bn(e,this,n,t.cache.create(),t.serializer)}function Es(e,t){return bn(e,this,Pi,t.cache.create(),t.serializer)}function ys(e,t){return bn(e,this,Ni,t.cache.create(),t.serializer)}var Ss=function(){return JSON.stringify(arguments)};function vn(){this.cache=Object.create(null)}vn.prototype.get=function(e){return this.cache[e]};vn.prototype.set=function(e,t){this.cache[e]=t};var ks={create:function(){return new vn}},Zt={variadic:Es,monadic:ys},qe;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(qe||(qe={}));var Nt=function(e){Lt(t,e);function t(n,i,r){var s=e.call(this,n)||this;return s.code=i,s.originalMessage=r,s}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),zn=function(e){Lt(t,e);function t(n,i,r,s){return e.call(this,'Invalid values for "'.concat(n,'": "').concat(i,'". Options are "').concat(Object.keys(r).join('", "'),'"'),qe.INVALID_VALUE,s)||this}return t}(Nt),As=function(e){Lt(t,e);function t(n,i,r){return e.call(this,'Value for "'.concat(n,'" must be of type ').concat(i),qe.INVALID_VALUE,r)||this}return t}(Nt),Bs=function(e){Lt(t,e);function t(n,i){return e.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(i,'"'),qe.MISSING_VALUE,i)||this}return t}(Nt),me;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(me||(me={}));function Ts(e){return e.length<2?e:e.reduce(function(t,n){var i=t[t.length-1];return!i||i.type!==me.literal||n.type!==me.literal?t.push(n):i.value+=n.value,t},[])}function Is(e){return typeof e=="function"}function St(e,t,n,i,r,s,o){if(e.length===1&&Rn(e[0]))return[{type:me.literal,value:e[0].value}];for(var l=[],u=0,a=e;u<a.length;u++){var f=a[u];if(Rn(f)){l.push({type:me.literal,value:f.value});continue}if(zr(f)){typeof s=="number"&&l.push({type:me.literal,value:n.getNumberFormat(t).format(s)});continue}var m=f.value;if(!(r&&m in r))throw new Bs(m,o);var h=r[m];if(Fr(f)){(!h||typeof h=="string"||typeof h=="number")&&(h=typeof h=="string"||typeof h=="number"?String(h):""),l.push({type:typeof h=="string"?me.literal:me.object,value:h});continue}if(vi(f)){var p=typeof f.style=="string"?i.date[f.style]:sn(f.style)?f.style.parsedOptions:void 0;l.push({type:me.literal,value:n.getDateTimeFormat(t,p).format(h)});continue}if(wi(f)){var p=typeof f.style=="string"?i.time[f.style]:sn(f.style)?f.style.parsedOptions:i.time.medium;l.push({type:me.literal,value:n.getDateTimeFormat(t,p).format(h)});continue}if(bi(f)){var p=typeof f.style=="string"?i.number[f.style]:ki(f.style)?f.style.parsedOptions:void 0;p&&p.scale&&(h=h*(p.scale||1)),l.push({type:me.literal,value:n.getNumberFormat(t,p).format(h)});continue}if(Si(f)){var d=f.children,b=f.value,I=r[b];if(!Is(I))throw new As(b,"function",o);var B=St(d,t,n,i,r,s),E=I(B.map(function(T){return T.value}));Array.isArray(E)||(E=[E]),l.push.apply(l,E.map(function(T){return{type:typeof T=="string"?me.literal:me.object,value:T}}))}if(Ei(f)){var H=f.options[h]||f.options.other;if(!H)throw new zn(f.value,h,Object.keys(f.options),o);l.push.apply(l,St(H.value,t,n,i,r));continue}if(yi(f)){var H=f.options["=".concat(h)];if(!H){if(!Intl.PluralRules)throw new Nt(`Intl.PluralRules is not available in this environment.
Try polyfilling it using "@formatjs/intl-pluralrules"
`,qe.MISSING_INTL_API,o);var y=n.getPluralRules(t,{type:f.pluralType}).select(h-(f.offset||0));H=f.options[y]||f.options.other}if(!H)throw new zn(f.value,h,Object.keys(f.options),o);l.push.apply(l,St(H.value,t,n,i,r,h-(f.offset||0)));continue}}return Ts(l)}function Hs(e,t){return t?te(te(te({},e||{}),t||{}),Object.keys(e).reduce(function(n,i){return n[i]=te(te({},e[i]),t[i]||{}),n},{})):e}function Cs(e,t){return t?Object.keys(e).reduce(function(n,i){return n[i]=Hs(e[i],t[i]),n},te({},e)):e}function Qt(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function Ls(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:qt(function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return new((t=Intl.NumberFormat).bind.apply(t,Wt([void 0],n,!1)))},{cache:Qt(e.number),strategy:Zt.variadic}),getDateTimeFormat:qt(function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return new((t=Intl.DateTimeFormat).bind.apply(t,Wt([void 0],n,!1)))},{cache:Qt(e.dateTime),strategy:Zt.variadic}),getPluralRules:qt(function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return new((t=Intl.PluralRules).bind.apply(t,Wt([void 0],n,!1)))},{cache:Qt(e.pluralRules),strategy:Zt.variadic})}}var Ns=function(){function e(t,n,i,r){var s=this;if(n===void 0&&(n=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(o){var l=s.formatToParts(o);if(l.length===1)return l[0].value;var u=l.reduce(function(a,f){return!a.length||f.type!==me.literal||typeof a[a.length-1]!="string"?a.push(f.value):a[a.length-1]+=f.value,a},[]);return u.length<=1?u[0]||"":u},this.formatToParts=function(o){return St(s.ast,s.locales,s.formatters,s.formats,o,void 0,s.message)},this.resolvedOptions=function(){return{locale:s.resolvedLocale.toString()}},this.getAst=function(){return s.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=e.__parse(t,{ignoreTag:r==null?void 0:r.ignoreTag,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Cs(e.formats,i),this.formatters=r&&r.formatters||Ls(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(t){var n=Intl.NumberFormat.supportedLocalesOf(t);return n.length>0?new Intl.Locale(n[0]):new Intl.Locale(typeof t=="string"?t:t[0])},e.__parse=bs,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();const Ce={},Ps=(e,t,n)=>n&&(t in Ce||(Ce[t]={}),e in Ce[t]||(Ce[t][e]=n),n),Oi=(e,t)=>{if(t==null)return;if(t in Ce&&e in Ce[t])return Ce[t][e];const n=gt(t);for(let i=0;i<n.length;i++){const r=Os(n[i],e);if(r)return Ps(e,t,r)}};let wn;const Ye=Te({});function En(e){return e in wn}function Os(e,t){if(!En(e))return null;const n=function(i){return wn[i]||null}(e);return function(i,r){if(r==null)return;if(r in i)return i[r];const s=r.split(".");let o=i;for(let l=0;l<s.length;l++)if(typeof o=="object"){if(l>0){const u=s.slice(l,s.length).join(".");if(u in o){o=o[u];break}}o=o[s[l]]}else o=void 0;return o}(n,t)}function Ms(e,...t){delete Ce[e],Ye.update(n=>(n[e]=jr.all([n[e]||{},...t]),n))}Le([Ye],([e])=>Object.keys(e));Ye.subscribe(e=>wn=e);const ot={};function lt(e){return ot[e]}function It(e){return e!=null&&gt(e).some(t=>{var n;return(n=lt(t))===null||n===void 0?void 0:n.size})}function xs(e,t){return Promise.all(t.map(i=>(function(r,s){ot[r].delete(s),ot[r].size===0&&delete ot[r]}(e,i),i().then(r=>r.default||r)))).then(i=>Ms(e,...i))}const nt={};function Mi(e){if(!It(e))return e in nt?nt[e]:Promise.resolve();const t=function(n){return gt(n).map(i=>{const r=lt(i);return[i,r?[...r]:[]]}).filter(([,i])=>i.length>0)}(e);return nt[e]=Promise.all(t.map(([n,i])=>xs(n,i))).then(()=>{if(It(e))return Mi(e);delete nt[e]}),nt[e]}function Rs(e,t){lt(e)||function(i){ot[i]=new Set}(e);const n=lt(e);lt(e).has(t)||(En(e)||Ye.update(i=>(i[e]={},i)),n.add(t))}function Us({locale:e,id:t}){console.warn(`[svelte-i18n] The message "${t}" was not found in "${gt(e).join('", "')}".${It(Ne())?`

Note: there are at least one loader still registered to this locale that wasn't executed.`:""}`)}const it={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function Ze(){return it}function Ds(e){const{formats:t,...n}=e,i=e.initialLocale||e.fallbackLocale;return n.warnOnMissingMessages&&(delete n.warnOnMissingMessages,n.handleMissingMessage==null?n.handleMissingMessage=Us:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(it,n,{initialLocale:i}),t&&("number"in t&&Object.assign(it.formats.number,t.number),"date"in t&&Object.assign(it.formats.date,t.date),"time"in t&&Object.assign(it.formats.time,t.time)),Ke.set(i)}const kt=Te(!1);let cn;const At=Te(null);function Vn(e){return e.split("-").map((t,n,i)=>i.slice(0,n+1).join("-")).reverse()}function gt(e,t=Ze().fallbackLocale){const n=Vn(e);return t?[...new Set([...n,...Vn(t)])]:n}function Ne(){return cn??void 0}At.subscribe(e=>{cn=e??void 0,typeof window<"u"&&e!=null&&document.documentElement.setAttribute("lang",e)});const Ke={...At,set:e=>{if(e&&function(t){if(t==null)return;const n=gt(t);for(let i=0;i<n.length;i++){const r=n[i];if(En(r))return r}}(e)&&It(e)){const{loadingDelay:t}=Ze();let n;return typeof window<"u"&&Ne()!=null&&t?n=window.setTimeout(()=>kt.set(!0),t):kt.set(!0),Mi(e).then(()=>{At.set(e)}).finally(()=>{clearTimeout(n),kt.set(!1)})}return At.set(e)}},Gs=()=>typeof window>"u"?null:window.navigator.language||window.navigator.languages[0],Pt=e=>{const t=Object.create(null);return n=>{const i=JSON.stringify(n);return i in t?t[i]:t[i]=e(n)}},ct=(e,t)=>{const{formats:n}=Ze();if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},$s=Pt(({locale:e,format:t,...n})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return t&&(n=ct("number",t)),new Intl.NumberFormat(e,n)}),js=Pt(({locale:e,format:t,...n})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return t?n=ct("date",t):Object.keys(n).length===0&&(n=ct("date","short")),new Intl.DateTimeFormat(e,n)}),Fs=Pt(({locale:e,format:t,...n})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return t?n=ct("time",t):Object.keys(n).length===0&&(n=ct("time","short")),new Intl.DateTimeFormat(e,n)}),zs=({locale:e=Ne(),...t}={})=>$s({locale:e,...t}),Vs=({locale:e=Ne(),...t}={})=>js({locale:e,...t}),Ws=({locale:e=Ne(),...t}={})=>Fs({locale:e,...t}),Xs=Pt((e,t=Ne())=>new Ns(e,t,Ze().formats,{ignoreTag:Ze().ignoreTag})),qs=(e,t={})=>{var n,i,r,s;let o=t;typeof e=="object"&&(o=e,e=o.id);const{values:l,locale:u=Ne(),default:a}=o;if(u==null)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let f=Oi(e,u);if(f){if(typeof f!="string")return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof f}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),f}else f=(s=(r=(i=(n=Ze()).handleMissingMessage)===null||i===void 0?void 0:i.call(n,{locale:u,id:e,defaultValue:a}))!==null&&r!==void 0?r:a)!==null&&s!==void 0?s:e;if(!l)return f;let m=f;try{m=Xs(f,u).format(l)}catch(h){h instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,h.message)}return m},Zs=(e,t)=>Ws(t).format(e),Qs=(e,t)=>Vs(t).format(e),Js=(e,t)=>zs(t).format(e),Ys=(e,t=Ne())=>Oi(e,t),Se=Le([Ke,Ye],()=>qs);Le([Ke],()=>Zs);Le([Ke],()=>Qs);Le([Ke],()=>Js);Le([Ke,Ye],()=>Ys);function Ks(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,i,r,s,o=[],l="",u=e.split("/");for(u[0]||u.shift();r=u.shift();)n=r[0],n==="*"?(o.push("wild"),l+="/(.*)"):n===":"?(i=r.indexOf("?",1),s=r.indexOf(".",1),o.push(r.substring(1,~i?i:~s?s:r.length)),l+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(l+=(~i?"?":"")+"\\"+r.substring(s))):l+="/"+r;return{keys:o,pattern:new RegExp("^"+l+(t?"(?=$|/)":"/?$"),"i")}}function eo(e){let t,n,i;const r=[e[2]];var s=e[0];function o(l,u){let a={};if(u!==void 0&&u&4)a=Bt(r,[Tt(l[2])]);else for(let f=0;f<r.length;f+=1)a=pn(a,r[f]);return{props:a}}return s&&(t=Ve(s,o(e)),t.$on("routeEvent",e[7])),{c(){t&&U(t.$$.fragment),n=ye()},m(l,u){t&&O(t,l,u),g(l,n,u),i=!0},p(l,u){if(u&1&&s!==(s=l[0])){if(t){ue();const a=t;S(a.$$.fragment,1,0,()=>{M(a,1)}),fe()}s?(t=Ve(s,o(l,u)),t.$on("routeEvent",l[7]),U(t.$$.fragment),w(t.$$.fragment,1),O(t,n.parentNode,n)):t=null}else if(s){const a=u&4?Bt(r,[Tt(l[2])]):{};t.$set(a)}},i(l){i||(t&&w(t.$$.fragment,l),i=!0)},o(l){t&&S(t.$$.fragment,l),i=!1},d(l){l&&_(n),t&&M(t,l)}}}function to(e){let t,n,i;const r=[{params:e[1]},e[2]];var s=e[0];function o(l,u){let a={};if(u!==void 0&&u&6)a=Bt(r,[u&2&&{params:l[1]},u&4&&Tt(l[2])]);else for(let f=0;f<r.length;f+=1)a=pn(a,r[f]);return{props:a}}return s&&(t=Ve(s,o(e)),t.$on("routeEvent",e[6])),{c(){t&&U(t.$$.fragment),n=ye()},m(l,u){t&&O(t,l,u),g(l,n,u),i=!0},p(l,u){if(u&1&&s!==(s=l[0])){if(t){ue();const a=t;S(a.$$.fragment,1,0,()=>{M(a,1)}),fe()}s?(t=Ve(s,o(l,u)),t.$on("routeEvent",l[6]),U(t.$$.fragment),w(t.$$.fragment,1),O(t,n.parentNode,n)):t=null}else if(s){const a=u&6?Bt(r,[u&2&&{params:l[1]},u&4&&Tt(l[2])]):{};t.$set(a)}},i(l){i||(t&&w(t.$$.fragment,l),i=!0)},o(l){t&&S(t.$$.fragment,l),i=!1},d(l){l&&_(n),t&&M(t,l)}}}function no(e){let t,n,i,r;const s=[to,eo],o=[];function l(u,a){return u[1]?0:1}return t=l(e),n=o[t]=s[t](e),{c(){n.c(),i=ye()},m(u,a){o[t].m(u,a),g(u,i,a),r=!0},p(u,[a]){let f=t;t=l(u),t===f?o[t].p(u,a):(ue(),S(o[f],1,1,()=>{o[f]=null}),fe(),n=o[t],n?n.p(u,a):(n=o[t]=s[t](u),n.c()),w(n,1),n.m(i.parentNode,i))},i(u){r||(w(n),r=!0)},o(u){S(n),r=!1},d(u){u&&_(i),o[t].d(u)}}}function Wn(){const e=window.location.href.indexOf("#/");let t=e>-1?window.location.href.substr(e+1):"/";const n=t.indexOf("?");let i="";return n>-1&&(i=t.substr(n+1),t=t.substr(0,n)),{location:t,querystring:i}}const yn=_i(null,function(t){t(Wn());const n=()=>{t(Wn())};return window.addEventListener("hashchange",n,!1),function(){window.removeEventListener("hashchange",n,!1)}});Le(yn,e=>e.location);Le(yn,e=>e.querystring);const Xn=Te(void 0);async function je(e){if(!e||e.length<1||e.charAt(0)!="/"&&e.indexOf("#/")!==0)throw Error("Invalid parameter location");await gn(),history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=(e.charAt(0)=="#"?"":"#")+e}async function Be(){await gn(),window.history.back()}function io(e){e?window.scrollTo(e.__svelte_spa_router_scrollX,e.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function ro(e,t,n){let{routes:i={}}=t,{prefix:r=""}=t,{restoreScrollState:s=!1}=t;class o{constructor(T,L){if(!L||typeof L!="function"&&(typeof L!="object"||L._sveltesparouter!==!0))throw Error("Invalid component object");if(!T||typeof T=="string"&&(T.length<1||T.charAt(0)!="/"&&T.charAt(0)!="*")||typeof T=="object"&&!(T instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:k,keys:x}=Ks(T);this.path=T,typeof L=="object"&&L._sveltesparouter===!0?(this.component=L.component,this.conditions=L.conditions||[],this.userData=L.userData,this.props=L.props||{}):(this.component=()=>Promise.resolve(L),this.conditions=[],this.props={}),this._pattern=k,this._keys=x}match(T){if(r){if(typeof r=="string")if(T.startsWith(r))T=T.substr(r.length)||"/";else return null;else if(r instanceof RegExp){const v=T.match(r);if(v&&v[0])T=T.substr(v[0].length)||"/";else return null}}const L=this._pattern.exec(T);if(L===null)return null;if(this._keys===!1)return L;const k={};let x=0;for(;x<this._keys.length;){try{k[this._keys[x]]=decodeURIComponent(L[x+1]||"")||null}catch{k[this._keys[x]]=null}x++}return k}async checkConditions(T){for(let L=0;L<this.conditions.length;L++)if(!await this.conditions[L](T))return!1;return!0}}const l=[];i instanceof Map?i.forEach((y,T)=>{l.push(new o(T,y))}):Object.keys(i).forEach(y=>{l.push(new o(y,i[y]))});let u=null,a=null,f={};const m=_t();async function h(y,T){await gn(),m(y,T)}let p=null,d=null;s&&(d=y=>{y.state&&(y.state.__svelte_spa_router_scrollY||y.state.__svelte_spa_router_scrollX)?p=y.state:p=null},window.addEventListener("popstate",d),ui(()=>{io(p)}));let b=null,I=null;const B=yn.subscribe(async y=>{b=y;let T=0;for(;T<l.length;){const L=l[T].match(y.location);if(!L){T++;continue}const k={route:l[T].path,location:y.location,querystring:y.querystring,userData:l[T].userData,params:L&&typeof L=="object"&&Object.keys(L).length?L:null};if(!await l[T].checkConditions(k)){n(0,u=null),I=null,h("conditionsFailed",k);return}h("routeLoading",Object.assign({},k));const x=l[T].component;if(I!=x){x.loading?(n(0,u=x.loading),I=x,n(1,a=x.loadingParams),n(2,f={}),h("routeLoaded",Object.assign({},k,{component:u,name:u.name,params:a}))):(n(0,u=null),I=null);const v=await x();if(y!=b)return;n(0,u=v&&v.default||v),I=x}L&&typeof L=="object"&&Object.keys(L).length?n(1,a=L):n(1,a=null),n(2,f=l[T].props),h("routeLoaded",Object.assign({},k,{component:u,name:u.name,params:a})).then(()=>{Xn.set(a)});return}n(0,u=null),I=null,Xn.set(void 0)});_n(()=>{B(),d&&window.removeEventListener("popstate",d)});function E(y){ut.call(this,e,y)}function H(y){ut.call(this,e,y)}return e.$$set=y=>{"routes"in y&&n(3,i=y.routes),"prefix"in y&&n(4,r=y.prefix),"restoreScrollState"in y&&n(5,s=y.restoreScrollState)},e.$$.update=()=>{e.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[u,a,f,i,r,s,E,H]}class so extends Y{constructor(t){super(),J(this,t,ro,no,Z,{routes:3,prefix:4,restoreScrollState:5})}}const we=Te(!1),rt=Te(!1),Ht=Te(!1);function xi(){const{subscribe:e,set:t,update:n}=Te([]);return{subscribe:e,fetch:async()=>{if(!On(we))return;const i=await ur();n(r=>i)},search:async(i,r)=>{if(!On(we))return;const s=await mr(i,r);n(o=>s)},reset:()=>t([])}}const Me=xi(),Sn=Te(0),Jt=Te(""),Yt=xi();function oo(e){let t,n,i,r;return{c(){t=V("svg"),n=V("polyline"),i=V("polyline"),c(n,"points","11 17 6 12 11 7"),c(i,"points","18 17 13 12 18 7"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",r="feather feather-chevrons-left "+e[2])},m(s,o){g(s,t,o),A(t,n),A(t,i)},p(s,[o]){o&1&&c(t,"width",s[0]),o&1&&c(t,"height",s[0]),o&2&&c(t,"stroke-width",s[1]),o&4&&r!==(r="feather feather-chevrons-left "+s[2])&&c(t,"class",r)},i:G,o:G,d(s){s&&_(t)}}}function lo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Ri extends Y{constructor(t){super(),J(this,t,lo,oo,Z,{size:0,strokeWidth:1,class:2})}}function ao(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("path"),i=V("line"),r=V("line"),c(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),c(i,"x1","18"),c(i,"y1","9"),c(i,"x2","12"),c(i,"y2","15"),c(r,"x1","12"),c(r,"y1","9"),c(r,"x2","18"),c(r,"y2","15"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-delete "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-delete "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function uo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class fo extends Y{constructor(t){super(),J(this,t,uo,ao,Z,{size:0,strokeWidth:1,class:2})}}function co(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("path"),i=V("polyline"),r=V("line"),c(n,"d","M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"),c(i,"points","7 10 12 15 17 10"),c(r,"x1","12"),c(r,"y1","15"),c(r,"x2","12"),c(r,"y2","3"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-download "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-download "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function ho(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class po extends Y{constructor(t){super(),J(this,t,ho,co,Z,{size:0,strokeWidth:1,class:2})}}function mo(e){let t,n,i,r;return{c(){t=V("svg"),n=V("path"),i=V("path"),c(n,"d","M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"),c(i,"d","M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",r="feather feather-edit "+e[2])},m(s,o){g(s,t,o),A(t,n),A(t,i)},p(s,[o]){o&1&&c(t,"width",s[0]),o&1&&c(t,"height",s[0]),o&2&&c(t,"stroke-width",s[1]),o&4&&r!==(r="feather feather-edit "+s[2])&&c(t,"class",r)},i:G,o:G,d(s){s&&_(t)}}}function _o(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class go extends Y{constructor(t){super(),J(this,t,_o,mo,Z,{size:0,strokeWidth:1,class:2})}}function bo(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("circle"),i=V("path"),r=V("line"),c(n,"cx","12"),c(n,"cy","12"),c(n,"r","10"),c(i,"d","M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"),c(r,"x1","12"),c(r,"y1","17"),c(r,"x2","12.01"),c(r,"y2","17"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-help-circle "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-help-circle "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function vo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class wo extends Y{constructor(t){super(),J(this,t,vo,bo,Z,{size:0,strokeWidth:1,class:2})}}function Eo(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("circle"),i=V("line"),r=V("line"),c(n,"cx","12"),c(n,"cy","12"),c(n,"r","10"),c(i,"x1","12"),c(i,"y1","16"),c(i,"x2","12"),c(i,"y2","12"),c(r,"x1","12"),c(r,"y1","8"),c(r,"x2","12.01"),c(r,"y2","8"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-info "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-info "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function yo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class So extends Y{constructor(t){super(),J(this,t,yo,Eo,Z,{size:0,strokeWidth:1,class:2})}}function ko(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("rect"),i=V("line"),r=V("line"),c(n,"x","3"),c(n,"y","3"),c(n,"width","18"),c(n,"height","18"),c(n,"rx","2"),c(n,"ry","2"),c(i,"x1","12"),c(i,"y1","8"),c(i,"x2","12"),c(i,"y2","16"),c(r,"x1","8"),c(r,"y1","12"),c(r,"x2","16"),c(r,"y2","12"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-plus-square "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-plus-square "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function Ao(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Ot extends Y{constructor(t){super(),J(this,t,Ao,ko,Z,{size:0,strokeWidth:1,class:2})}}function Bo(e){let t,n,i,r;return{c(){t=V("svg"),n=V("circle"),i=V("line"),c(n,"cx","11"),c(n,"cy","11"),c(n,"r","8"),c(i,"x1","21"),c(i,"y1","21"),c(i,"x2","16.65"),c(i,"y2","16.65"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",r="feather feather-search "+e[2])},m(s,o){g(s,t,o),A(t,n),A(t,i)},p(s,[o]){o&1&&c(t,"width",s[0]),o&1&&c(t,"height",s[0]),o&2&&c(t,"stroke-width",s[1]),o&4&&r!==(r="feather feather-search "+s[2])&&c(t,"class",r)},i:G,o:G,d(s){s&&_(t)}}}function To(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Io extends Y{constructor(t){super(),J(this,t,To,Bo,Z,{size:0,strokeWidth:1,class:2})}}function Ho(e){let t,n,i,r;return{c(){t=V("svg"),n=V("circle"),i=V("path"),c(n,"cx","12"),c(n,"cy","12"),c(n,"r","3"),c(i,"d","M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",r="feather feather-settings "+e[2])},m(s,o){g(s,t,o),A(t,n),A(t,i)},p(s,[o]){o&1&&c(t,"width",s[0]),o&1&&c(t,"height",s[0]),o&2&&c(t,"stroke-width",s[1]),o&4&&r!==(r="feather feather-settings "+s[2])&&c(t,"class",r)},i:G,o:G,d(s){s&&_(t)}}}function Co(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Ui extends Y{constructor(t){super(),J(this,t,Co,Ho,Z,{size:0,strokeWidth:1,class:2})}}function Lo(e){let t,n,i,r,s,o;return{c(){t=V("svg"),n=V("polyline"),i=V("path"),r=V("line"),s=V("line"),c(n,"points","3 6 5 6 21 6"),c(i,"d","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"),c(r,"x1","10"),c(r,"y1","11"),c(r,"x2","10"),c(r,"y2","17"),c(s,"x1","14"),c(s,"y1","11"),c(s,"x2","14"),c(s,"y2","17"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",o="feather feather-trash-2 "+e[2])},m(l,u){g(l,t,u),A(t,n),A(t,i),A(t,r),A(t,s)},p(l,[u]){u&1&&c(t,"width",l[0]),u&1&&c(t,"height",l[0]),u&2&&c(t,"stroke-width",l[1]),u&4&&o!==(o="feather feather-trash-2 "+l[2])&&c(t,"class",o)},i:G,o:G,d(l){l&&_(t)}}}function No(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Po extends Y{constructor(t){super(),J(this,t,No,Lo,Z,{size:0,strokeWidth:1,class:2})}}function Oo(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("path"),i=V("polyline"),r=V("line"),c(n,"d","M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"),c(i,"points","17 8 12 3 7 8"),c(r,"x1","12"),c(r,"y1","3"),c(r,"x2","12"),c(r,"y2","15"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-upload "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-upload "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function Mo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class hn extends Y{constructor(t){super(),J(this,t,Mo,Oo,Z,{size:0,strokeWidth:1,class:2})}}function xo(e){let t,n;const i=e[5].default,r=ht(i,e,e[4],null);return{c(){t=C("p"),r&&r.c(),c(t,"class","svelte-hclhr3"),X(t,"error",e[3]),X(t,"warning",e[0]),X(t,"success",e[1]),X(t,"info",e[2])},m(s,o){g(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&16)&&mt(r,i,s,s[4],n?pt(i,s[4],o,null):dt(s[4]),null),(!n||o&8)&&X(t,"error",s[3]),(!n||o&1)&&X(t,"warning",s[0]),(!n||o&2)&&X(t,"success",s[1]),(!n||o&4)&&X(t,"info",s[2])},i(s){n||(w(r,s),n=!0)},o(s){S(r,s),n=!1},d(s){s&&_(t),r&&r.d(s)}}}function Ro(e,t,n){let{$$slots:i={},$$scope:r}=t,{error:s=!1}=t,{warning:o=!1}=t,{success:l=!1}=t,{info:u=!1}=t;return o=s&&o?!1:o,l=(s||o)&&l?!1:l,u=!(s||o||l),e.$$set=a=>{"error"in a&&n(3,s=a.error),"warning"in a&&n(0,o=a.warning),"success"in a&&n(1,l=a.success),"info"in a&&n(2,u=a.info),"$$scope"in a&&n(4,r=a.$$scope)},[o,l,u,s,r,i]}class Mt extends Y{constructor(t){super(),J(this,t,Ro,xo,Z,{error:3,warning:0,success:1,info:2})}}function Uo(e){let t=e[0]("no_connection")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("no_connection")+"")&&z(n,t)},d(i){i&&_(n)}}}function Do(e){let t,n;return t=new Mt({props:{error:!0,$$slots:{default:[Uo]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&3&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Go(e,t,n){let i;return ne(e,Se,r=>n(0,i=r)),[i]}class $o extends Y{constructor(t){super(),J(this,t,Go,Do,Z,{})}}function jo(e){let t,n,i,r;const s=e[5].default,o=ht(s,e,e[4],null);return{c(){t=C("button"),o&&o.c(),t.disabled=e[3],c(t,"class","svelte-1jbd97"),X(t,"primary",e[0]),X(t,"danger",e[1]),X(t,"secondary",e[2])},m(l,u){g(l,t,u),o&&o.m(t,null),n=!0,i||(r=re(t,"click",e[6]),i=!0)},p(l,[u]){o&&o.p&&(!n||u&16)&&mt(o,s,l,l[4],n?pt(s,l[4],u,null):dt(l[4]),null),(!n||u&8)&&(t.disabled=l[3]),(!n||u&1)&&X(t,"primary",l[0]),(!n||u&2)&&X(t,"danger",l[1]),(!n||u&4)&&X(t,"secondary",l[2])},i(l){n||(w(o,l),n=!0)},o(l){S(o,l),n=!1},d(l){l&&_(t),o&&o.d(l),i=!1,r()}}}function Fo(e,t,n){let{$$slots:i={},$$scope:r}=t,{primary:s=!1}=t,{danger:o=!1}=t,{secondary:l=!1}=t,{disabled:u=!1}=t;s=!s&&!l&&!o?!0:s,o=s&&o?!1:o,l=(s||o)&&l?!1:l;function a(f){ut.call(this,e,f)}return e.$$set=f=>{"primary"in f&&n(0,s=f.primary),"danger"in f&&n(1,o=f.danger),"secondary"in f&&n(2,l=f.secondary),"disabled"in f&&n(3,u=f.disabled),"$$scope"in f&&n(4,r=f.$$scope)},[s,o,l,u,r,i,a]}class Fe extends Y{constructor(t){super(),J(this,t,Fo,jo,Z,{primary:0,danger:1,secondary:2,disabled:3})}}function zo(e){let t=e[0]("daemon.start")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("daemon.start")+"")&&z(n,t)},d(i){i&&_(n)}}}function Vo(e){let t=e[0]("daemon.installed")+"",n,i,r,s;return r=new Fe({props:{$$slots:{default:[zo]},$$scope:{ctx:e}}}),r.$on("click",e[1]),{c(){n=$(t),i=R(),U(r.$$.fragment)},m(o,l){g(o,n,l),g(o,i,l),O(r,o,l),s=!0},p(o,l){(!s||l&1)&&t!==(t=o[0]("daemon.installed")+"")&&z(n,t);const u={};l&5&&(u.$$scope={dirty:l,ctx:o}),r.$set(u)},i(o){s||(w(r.$$.fragment,o),s=!0)},o(o){S(r.$$.fragment,o),s=!1},d(o){o&&(_(n),_(i)),M(r,o)}}}function Wo(e){let t,n;return t=new Mt({props:{warning:!0,$$slots:{default:[Vo]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&5&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Xo(e,t,n){let i;ne(e,Se,s=>n(0,i=s));async function r(){Ht.update(s=>!0);try{const s=await Sr()}catch(s){await ae(i("daemon.start_error_title"),s),Ht.update(o=>!1)}await Me.fetch()}return[i,r]}class qo extends Y{constructor(t){super(),J(this,t,Xo,Wo,Z,{})}}function Zo(e){let t=e[0]("daemon.not_installed")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("daemon.not_installed")+"")&&z(n,t)},d(i){i&&_(n)}}}function Qo(e){let t,n;return t=new Mt({props:{error:!0,$$slots:{default:[Zo]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&3&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Jo(e,t,n){let i;return ne(e,Se,r=>n(0,i=r)),[i]}class Yo extends Y{constructor(t){super(),J(this,t,Jo,Qo,Z,{})}}function Ko(e){let t=e[0]("daemon.starting")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("daemon.starting")+"")&&z(n,t)},d(i){i&&_(n)}}}function el(e){let t,n;return t=new Mt({props:{warning:!0,$$slots:{default:[Ko]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&3&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function tl(e,t,n){let i;return ne(e,Se,r=>n(0,i=r)),[i]}class nl extends Y{constructor(t){super(),J(this,t,tl,el,Z,{})}}function qn(e){let t,n,i,r,s,o;t=new $o({});const l=[sl,rl,il],u=[];function a(f,m){return f[2]&&!f[3]?0:f[2]&&f[3]?1:2}return i=a(e),r=u[i]=l[i](e),{c(){U(t.$$.fragment),n=R(),r.c(),s=ye()},m(f,m){O(t,f,m),g(f,n,m),u[i].m(f,m),g(f,s,m),o=!0},p(f,m){let h=i;i=a(f),i!==h&&(ue(),S(u[h],1,1,()=>{u[h]=null}),fe(),r=u[i],r||(r=u[i]=l[i](f),r.c()),w(r,1),r.m(s.parentNode,s))},i(f){o||(w(t.$$.fragment,f),w(r),o=!0)},o(f){S(t.$$.fragment,f),S(r),o=!1},d(f){f&&(_(n),_(s)),M(t,f),u[i].d(f)}}}function il(e){let t,n;return t=new Yo({}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function rl(e){let t,n;return t=new nl({}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function sl(e){let t,n;return t=new qo({}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function ol(e){let t,n,i,r,s,o=!e[1]&&qn(e);const l=e[6].default,u=ht(l,e,e[5],null);return{c(){t=C("div"),o&&o.c(),n=R(),u&&u.c(),c(t,"class","screen svelte-i096ea"),X(t,"centered",e[0])},m(a,f){g(a,t,f),o&&o.m(t,null),A(t,n),u&&u.m(t,null),i=!0,r||(s=[re(t,"keyup",e[4]),re(t,"keyup",e[7])],r=!0)},p(a,[f]){a[1]?o&&(ue(),S(o,1,1,()=>{o=null}),fe()):o?(o.p(a,f),f&2&&w(o,1)):(o=qn(a),o.c(),w(o,1),o.m(t,n)),u&&u.p&&(!i||f&32)&&mt(u,l,a,a[5],i?pt(l,a[5],f,null):dt(a[5]),null),(!i||f&1)&&X(t,"centered",a[0])},i(a){i||(w(o),w(u,a),i=!0)},o(a){S(o),S(u,a),i=!1},d(a){a&&_(t),o&&o.d(),u&&u.d(a),r=!1,Ee(s)}}}function ll(e,t,n){let i,r,s;ne(e,we,h=>n(1,i=h)),ne(e,rt,h=>n(2,r=h)),ne(e,Ht,h=>n(3,s=h));let{$$slots:o={},$$scope:l}=t,{centered:u=!1}=t;const a=_t();function f(h){h.key==="Escape"&&(h.preventDefault(),a("cancel"))}function m(h){ut.call(this,e,h)}return e.$$set=h=>{"centered"in h&&n(0,u=h.centered),"$$scope"in h&&n(5,l=h.$$scope)},[u,i,r,s,f,l,o,m]}class et extends Y{constructor(t){super(),J(this,t,ll,ol,Z,{centered:0})}}function al(e){let t,n,i,r,s,o,l,u;var a=e[0];function f(p,d){return{props:{size:p[2],strokeWidth:p[3]}}}a&&(i=Ve(a,f(e)));const m=e[10].default,h=ht(m,e,e[9],null);return{c(){t=C("div"),n=C("div"),i&&U(i.$$.fragment),s=R(),h&&h.c(),c(n,"class",r="icon-wrapper "+e[1]+" svelte-bhj2u4"),c(t,"class","content svelte-bhj2u4"),c(t,"tabindex","0"),c(t,"title",e[5]),X(t,"centered",e[6]),X(t,"horizontal",e[4])},m(p,d){g(p,t,d),A(t,n),i&&O(i,n,null),A(t,s),h&&h.m(t,null),o=!0,l||(u=[re(t,"click",e[7]),re(t,"keyup",e[8])],l=!0)},p(p,[d]){if(d&1&&a!==(a=p[0])){if(i){ue();const b=i;S(b.$$.fragment,1,0,()=>{M(b,1)}),fe()}a?(i=Ve(a,f(p)),U(i.$$.fragment),w(i.$$.fragment,1),O(i,n,null)):i=null}else if(a){const b={};d&4&&(b.size=p[2]),d&8&&(b.strokeWidth=p[3]),i.$set(b)}(!o||d&2&&r!==(r="icon-wrapper "+p[1]+" svelte-bhj2u4"))&&c(n,"class",r),h&&h.p&&(!o||d&512)&&mt(h,m,p,p[9],o?pt(m,p[9],d,null):dt(p[9]),null),(!o||d&32)&&c(t,"title",p[5]),(!o||d&16)&&X(t,"horizontal",p[4])},i(p){o||(i&&w(i.$$.fragment,p),w(h,p),o=!0)},o(p){i&&S(i.$$.fragment,p),S(h,p),o=!1},d(p){p&&_(t),i&&M(i),h&&h.d(p),l=!1,Ee(u)}}}function ul(e,t,n){let{$$slots:i={},$$scope:r}=t,{icon:s=wo}=t,{iconClass:o}=t,{size:l="24"}=t,{strokeWidth:u="2"}=t,{horizontal:a=!1}=t,{title:f=""}=t;const m=!a,h=_t();function p(){h("activate")}function d(b){(b.key==="Enter"||b.key===" ")&&h("activate")}return e.$$set=b=>{"icon"in b&&n(0,s=b.icon),"iconClass"in b&&n(1,o=b.iconClass),"size"in b&&n(2,l=b.size),"strokeWidth"in b&&n(3,u=b.strokeWidth),"horizontal"in b&&n(4,a=b.horizontal),"title"in b&&n(5,f=b.title),"$$scope"in b&&n(9,r=b.$$scope)},[s,o,l,u,a,f,m,p,d,r,i]}class de extends Y{constructor(t){super(),J(this,t,ul,al,Z,{icon:0,iconClass:1,size:2,strokeWidth:3,horizontal:4,title:5})}}function fl(e,t){t&&setTimeout(()=>{e.focus(),e.select()},250)}function Zn(e){let t,n;return{c(){t=C("label"),n=$(e[4]),c(t,"for",e[3])},m(i,r){g(i,t,r),A(t,n)},p(i,r){r&16&&z(n,i[4]),r&8&&c(t,"for",i[3])},d(i){i&&_(t)}}}function Qn(e){let t,n,i,r,s;return n=new Io({}),{c(){t=C("button"),U(n.$$.fragment),c(t,"class","search-icon svelte-8p6spj"),c(t,"tabindex",-1),c(t,"title",e[6]),X(t,"focussed",e[2])},m(o,l){g(o,t,l),O(n,t,null),i=!0,r||(s=re(t,"click",e[14]),r=!0)},p(o,l){(!i||l&64)&&c(t,"title",o[6]),(!i||l&4)&&X(t,"focussed",o[2])},i(o){i||(w(n.$$.fragment,o),i=!0)},o(o){S(n.$$.fragment,o),i=!1},d(o){o&&_(t),M(n),r=!1,s()}}}function Jn(e){let t,n,i,r,s;return n=new fo({}),{c(){t=C("button"),U(n.$$.fragment),c(t,"class","clear-icon svelte-8p6spj"),c(t,"tabindex",-1),c(t,"title",e[7]),X(t,"focussed",e[2])},m(o,l){g(o,t,l),O(n,t,null),i=!0,r||(s=re(t,"click",e[15]),r=!0)},p(o,l){(!i||l&128)&&c(t,"title",o[7]),(!i||l&4)&&X(t,"focussed",o[2])},i(o){i||(w(n.$$.fragment,o),i=!0)},o(o){S(n.$$.fragment,o),i=!1},d(o){o&&_(t),M(n),r=!1,s()}}}function Yn(e){let t;return{c(){t=C("div"),c(t,"class","error-message svelte-8p6spj")},m(n,i){g(n,t,i),t.innerHTML=e[11]},p(n,i){i&2048&&(t.innerHTML=n[11])},d(n){n&&_(t)}}}function cl(e){let t,n,i,r,s,o,l,u,a,f,m,h,p=e[4]&&Zn(e),d=e[9]&&Qn(e),b=e[9]&&e[0]&&Jn(e),I=!e[9]&&Yn(e);return{c(){t=C("div"),p&&p.c(),n=R(),i=C("div"),d&&d.c(),r=R(),s=C("input"),l=R(),b&&b.c(),u=R(),I&&I.c(),a=ye(),c(s,"type","text"),c(s,"id",e[3]),c(s,"name",e[3]),c(s,"placeholder",e[5]),c(s,"tabindex",e[10]),c(s,"class","svelte-8p6spj"),X(s,"search",e[9]),X(s,"focussed",e[2]),X(s,"value",e[0]),c(i,"class","input-control svelte-8p6spj"),c(t,"class","input svelte-8p6spj")},m(B,E){g(B,t,E),p&&p.m(t,null),A(t,n),A(t,i),d&&d.m(i,null),A(i,r),A(i,s),ze(s,e[0]),e[18](s),A(i,l),b&&b.m(i,null),g(B,u,E),I&&I.m(B,E),g(B,a,E),f=!0,m||(h=[re(s,"input",e[17]),re(s,"focusin",e[12]),re(s,"focusout",e[13]),dn(o=fl.call(null,s,e[8]))],m=!0)},p(B,[E]){B[4]?p?p.p(B,E):(p=Zn(B),p.c(),p.m(t,n)):p&&(p.d(1),p=null),B[9]?d?(d.p(B,E),E&512&&w(d,1)):(d=Qn(B),d.c(),w(d,1),d.m(i,r)):d&&(ue(),S(d,1,1,()=>{d=null}),fe()),(!f||E&8)&&c(s,"id",B[3]),(!f||E&8)&&c(s,"name",B[3]),(!f||E&32)&&c(s,"placeholder",B[5]),(!f||E&1024)&&c(s,"tabindex",B[10]),E&1&&s.value!==B[0]&&ze(s,B[0]),o&&Qe(o.update)&&E&256&&o.update.call(null,B[8]),(!f||E&512)&&X(s,"search",B[9]),(!f||E&4)&&X(s,"focussed",B[2]),(!f||E&1)&&X(s,"value",B[0]),B[9]&&B[0]?b?(b.p(B,E),E&513&&w(b,1)):(b=Jn(B),b.c(),w(b,1),b.m(i,null)):b&&(ue(),S(b,1,1,()=>{b=null}),fe()),B[9]?I&&(I.d(1),I=null):I?I.p(B,E):(I=Yn(B),I.c(),I.m(a.parentNode,a))},i(B){f||(w(d),w(b),f=!0)},o(B){S(d),S(b),f=!1},d(B){B&&(_(t),_(u),_(a)),p&&p.d(),d&&d.d(),e[18](null),b&&b.d(),I&&I.d(B),m=!1,Ee(h)}}}function hl(e,t,n){let i;const r=_t();let{name:s="input"}=t,{label:o=""}=t,{value:l=""}=t,{errorMessage:u=""}=t,{placeholder:a=""}=t,{searchButtonTitle:f=""}=t,{clearButtonTitle:m=""}=t,{autofocus:h=!1}=t,{search:p=!1}=t,{tabindex:d=0}=t,{ref:b}=t,{focussed:I=h}=t;function B(){n(2,I=!0)}function E(){n(2,I=!1)}function H(){r("query",l),document.getElementById(s).focus()}function y(){n(0,l=""),document.getElementById(s).focus()}function T(){l=this.value,n(0,l)}function L(k){ve[k?"unshift":"push"](()=>{b=k,n(1,b)})}return e.$$set=k=>{"name"in k&&n(3,s=k.name),"label"in k&&n(4,o=k.label),"value"in k&&n(0,l=k.value),"errorMessage"in k&&n(16,u=k.errorMessage),"placeholder"in k&&n(5,a=k.placeholder),"searchButtonTitle"in k&&n(6,f=k.searchButtonTitle),"clearButtonTitle"in k&&n(7,m=k.clearButtonTitle),"autofocus"in k&&n(8,h=k.autofocus),"search"in k&&n(9,p=k.search),"tabindex"in k&&n(10,d=k.tabindex),"ref"in k&&n(1,b=k.ref),"focussed"in k&&n(2,I=k.focussed)},e.$$.update=()=>{e.$$.dirty&65536&&n(11,i=u||"&nbsp;")},[l,b,I,s,o,a,f,m,h,p,d,i,B,E,H,y,u,T,L]}class kn extends Y{constructor(t){super(),J(this,t,hl,cl,Z,{name:3,label:4,value:0,errorMessage:16,placeholder:5,searchButtonTitle:6,clearButtonTitle:7,autofocus:8,search:9,tabindex:10,ref:1,focussed:2})}}function Di(e,t){t&&e.focus()}function pl(e){let t;return{c(){t=$(e[0])},m(n,i){g(n,t,i)},p(n,i){i&1&&z(t,n[0])},d(n){n&&_(t)}}}function ml(e){let t;return{c(){t=$(" ")},m(n,i){g(n,t,i)},p:G,d(n){n&&_(t)}}}function dl(e){let t;function n(s,o){return s[1]?ml:pl}let r=n(e)(e);return{c(){t=C("span"),r.c(),c(t,"class","shortcut-button svelte-11t060e"),X(t,"hide",e[1])},m(s,o){g(s,t,o),r.m(t,null)},p(s,[o]){r.p(s,o)},i:G,o:G,d(s){s&&_(t),r.d()}}}function _l(e,t,n){let{shortcut:i=""}=t;const r=i.length===0;return e.$$set=s=>{"shortcut"in s&&n(0,i=s.shortcut)},[i,r]}class xt extends Y{constructor(t){super(),J(this,t,_l,dl,Z,{shortcut:0})}}function Kn(e){let t,n;return t=new xt({props:{shortcut:e[6]}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r&64&&(s.shortcut=i[6]),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function ei(e){let t,n,i;return n=new go({props:{size:"1.25x"}}),{c(){t=C("div"),U(n.$$.fragment),c(t,"class","edit-icon-wrapper svelte-1ebkg7o")},m(r,s){g(r,t,s),O(n,t,null),i=!0},i(r){i||(w(n.$$.fragment,r),i=!0)},o(r){S(n.$$.fragment,r),i=!1},d(r){r&&_(t),M(n)}}}function gl(e){let t,n,i,r,s,o=e[0].body+"",l,u,a,f,m,h=e[4]&&Kn(e);i=new xt({props:{shortcut:e[0].abbreviation}});let p=!e[4]&&ei();return{c(){t=C("li"),h&&h.c(),n=R(),U(i.$$.fragment),r=R(),s=C("span"),l=$(o),u=R(),p&&p.c(),c(s,"class","body svelte-1ebkg7o"),c(t,"tabindex",e[1]),c(t,"title",e[7]),c(t,"class","svelte-1ebkg7o"),X(t,"focussed",e[2]),X(t,"active",e[3])},m(d,b){g(d,t,b),h&&h.m(t,null),A(t,n),O(i,t,null),A(t,r),A(t,s),A(s,l),A(t,u),p&&p.m(t,null),e[13](t),a=!0,f||(m=re(t,"click",e[12]),f=!0)},p(d,[b]){d[4]?h?(h.p(d,b),b&16&&w(h,1)):(h=Kn(d),h.c(),w(h,1),h.m(t,n)):h&&(ue(),S(h,1,1,()=>{h=null}),fe());const I={};b&1&&(I.shortcut=d[0].abbreviation),i.$set(I),(!a||b&1)&&o!==(o=d[0].body+"")&&z(l,o),d[4]?p&&(ue(),S(p,1,1,()=>{p=null}),fe()):p?b&16&&w(p,1):(p=ei(),p.c(),w(p,1),p.m(t,null)),(!a||b&2)&&c(t,"tabindex",d[1]),(!a||b&4)&&X(t,"focussed",d[2]),(!a||b&8)&&X(t,"active",d[3])},i(d){a||(w(h),w(i.$$.fragment,d),w(p),a=!0)},o(d){S(h),S(i.$$.fragment,d),S(p),a=!1},d(d){d&&_(t),h&&h.d(),M(i),p&&p.d(),e[13](null),f=!1,m()}}}function bl(e,t,n){let i;ne(e,Se,E=>n(14,i=E));let{snippet:r}=t,{index:s=-1}=t,{tabindex:o=-1}=t,{focussed:l=!1}=t,{active:u=!1}=t,{selectMode:a=!1}=t,{observer:f=null}=t,m,h=i(a?"use_snippet.title":"edit_snippet.title"),p=s>=0&&s<10?s+1:"";p===10&&(p=0);function d(){return m.classList.contains("is-visible")}function b(E){m.scrollIntoView({behavior:"smooth",block:E})}Je(()=>{f&&f.observe(m)}),_n(()=>{f&&f.unobserve(m)});function I(E){ut.call(this,e,E)}function B(E){ve[E?"unshift":"push"](()=>{m=E,n(5,m)})}return e.$$set=E=>{"snippet"in E&&n(0,r=E.snippet),"index"in E&&n(8,s=E.index),"tabindex"in E&&n(1,o=E.tabindex),"focussed"in E&&n(2,l=E.focussed),"active"in E&&n(3,u=E.active),"selectMode"in E&&n(4,a=E.selectMode),"observer"in E&&n(9,f=E.observer)},[r,o,l,u,a,m,p,h,s,f,d,b,I,B]}class vl extends Y{constructor(t){super(),J(this,t,bl,gl,Z,{snippet:0,index:8,tabindex:1,focussed:2,active:3,selectMode:4,observer:9,isVisible:10,scrollIntoView:11})}get isVisible(){return this.$$.ctx[10]}get scrollIntoView(){return this.$$.ctx[11]}}function ti(e,t,n){const i=e.slice();return i[22]=t[n],i[23]=t,i[24]=n,i}function ni(e){let t,n=e[24],i;const r=()=>e[14](t,n),s=()=>e[14](null,n);function o(){return e[15](e[24])}let l={snippet:e[22],index:e[24],focussed:e[24]===e[4],active:e[5],observer:e[8],selectMode:e[2]};return t=new vl({props:l}),r(),t.$on("click",o),{c(){U(t.$$.fragment)},m(u,a){O(t,u,a),i=!0},p(u,a){e=u,n!==e[24]&&(s(),n=e[24],r());const f={};a&128&&(f.snippet=e[22]),a&16&&(f.focussed=e[24]===e[4]),a&32&&(f.active=e[5]),a&4&&(f.selectMode=e[2]),t.$set(f)},i(u){i||(w(t.$$.fragment,u),i=!0)},o(u){S(t.$$.fragment,u),i=!1},d(u){s(),M(t,u)}}}function wl(e){let t,n,i,r,s,o=Mn(e[7]),l=[];for(let a=0;a<o.length;a+=1)l[a]=ni(ti(e,o,a));const u=a=>S(l[a],1,1,()=>{l[a]=null});return{c(){t=C("ul");for(let a=0;a<l.length;a+=1)l[a].c();c(t,"tabindex",e[1]),c(t,"class","svelte-1wnqbvs")},m(a,f){g(a,t,f);for(let m=0;m<l.length;m+=1)l[m]&&l[m].m(t,null);e[16](t),i=!0,r||(s=[re(t,"focus",e[9]),re(t,"blur",e[10]),re(t,"keydown",e[12]),dn(n=Di.call(null,t,e[3]))],r=!0)},p(a,[f]){if(f&2548){o=Mn(a[7]);let m;for(m=0;m<o.length;m+=1){const h=ti(a,o,m);l[m]?(l[m].p(h,f),w(l[m],1)):(l[m]=ni(h),l[m].c(),w(l[m],1),l[m].m(t,null))}for(ue(),m=o.length;m<l.length;m+=1)u(m);fe()}(!i||f&2)&&c(t,"tabindex",a[1]),n&&Qe(n.update)&&f&8&&n.update.call(null,a[3])},i(a){if(!i){for(let f=0;f<o.length;f+=1)w(l[f]);i=!0}},o(a){l=l.filter(Boolean);for(let f=0;f<l.length;f+=1)S(l[f]);i=!1},d(a){a&&_(t),qi(l,a),e[16](null),r=!1,Ee(s)}}}function El(e,t,n){let i;const r=_t();let{snippets:s=null}=t,{tabindex:o=0}=t,{selectMode:l=!1}=t,{autofocus:u=!1}=t,{ref:a}=t,f=0,m=u,h=[];const p=new IntersectionObserver(function(v){for(let N=0;N<v.length;N++)v[N].isIntersecting?v[N].target.classList.add("is-visible"):v[N].target.classList.remove("is-visible")},{root:a,threshold:[.6]});function d(v){return n(4,f=0),v}function b(){n(5,m=!0)}function I(){n(5,m=!1)}function B(v){l?y(i[v]):T(i[v])}function E(v){!s||s.length===0||H(v)&&v.preventDefault()}function H(v){if(v.key==="Home"||v.key==="g")return n(4,f=0),h[f].scrollIntoView("nearest"),!0;if(v.key==="End"||v.key==="G")return n(4,f=s.length-1),h[f].scrollIntoView("nearest"),!0;if(f<s.length-1&&(v.key==="ArrowDown"||v.key==="j"))return n(4,f++,f),h[f].scrollIntoView("nearest"),!0;if(f>0&&(v.key==="ArrowUp"||v.key==="k"))return n(4,f--,f),h[f].scrollIntoView("nearest"),!0;if(v.key==="PageDown"||v.key==="d"){let N=-1,K=-1;for(let oe=0;oe<h.length;oe++)if(h[oe].isVisible())K=oe,N<0&&(N=oe);else if(K>=0)break;const P=h.length-1,ie=K-N;return K+ie>P?n(4,f=P):n(4,f=K),h[f].scrollIntoView("start"),!0}if(v.key==="PageUp"||v.key==="u"){let N=-1,K=-1;for(let ie=0;ie<h.length;ie++){const oe=h[ie];if(oe.isVisible()&&N<0)N=ie,K=ie;else if(oe.isVisible())K=ie;else if(N>=0)break}const P=K-N;return N-P<=0?n(4,f=0):n(4,f=N),h[f].scrollIntoView("end"),!0}if(l&&f>=0&&f<s.length&&v.key==="Enter")return y(i[f]),!0;if(l&&["1","2","3","4","5","6","7","8","9","0"].includes(v.key)){let N=v.key-1;return N===-1&&(N=9),N+1>i.length?!1:(y(i[N]),!0)}return!l&&f>=0&&f<s.length&&(v.key==="ArrowRight"||v.key==="Enter")?(T(i[f]),!0):!1}function y(v){r("itemActivated",{snippet:v})}function T(v){r("itemEdit",{snippet:v})}ui(()=>{h.length!==i.length&&n(6,h.length=i.length,h)});function L(v,N){ve[v?"unshift":"push"](()=>{h[N]=v,n(6,h)})}const k=v=>B(v);function x(v){ve[v?"unshift":"push"](()=>{a=v,n(0,a)})}return e.$$set=v=>{"snippets"in v&&n(13,s=v.snippets),"tabindex"in v&&n(1,o=v.tabindex),"selectMode"in v&&n(2,l=v.selectMode),"autofocus"in v&&n(3,u=v.autofocus),"ref"in v&&n(0,a=v.ref)},e.$$.update=()=>{e.$$.dirty&8192&&n(7,i=d(s))},[a,o,l,u,f,m,h,i,p,b,I,B,E,s,L,k,x]}class yl extends Y{constructor(t){super(),J(this,t,El,wl,Z,{snippets:13,tabindex:1,selectMode:2,autofocus:3,ref:0})}}function Sl(e){let t,n;const i=e[2].default,r=ht(i,e,e[1],null);return{c(){t=C("div"),r&&r.c(),c(t,"class","toolbar svelte-i867mn"),X(t,"bottom",e[0])},m(s,o){g(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&2)&&mt(r,i,s,s[1],n?pt(i,s[1],o,null):dt(s[1]),null),(!n||o&1)&&X(t,"bottom",s[0])},i(s){n||(w(r,s),n=!0)},o(s){S(r,s),n=!1},d(s){s&&_(t),r&&r.d(s)}}}function kl(e,t,n){let{$$slots:i={},$$scope:r}=t,{bottom:s=!1}=t;return e.$$set=o=>{"bottom"in o&&n(0,s=o.bottom),"$$scope"in o&&n(1,r=o.$$scope)},[s,r,i]}class Rt extends Y{constructor(t){super(),J(this,t,kl,Sl,Z,{bottom:0})}}function Al(e){let t;return{c(){t=C("div"),c(t,"class","toolbar-spacer svelte-1a67v9")},m(n,i){g(n,t,i)},p:G,i:G,o:G,d(n){n&&_(t)}}}class An extends Y{constructor(t){super(),J(this,t,null,Al,Z,{})}}function Bl(e){let t,n,i=e[6]("no_snippets_found.title")+"",r,s,o,l=e[6]("no_snippets_found.description")+"",u;return{c(){t=C("div"),n=C("p"),r=$(i),s=R(),o=C("p"),u=$(l),c(n,"class","no-snippets-found svelte-y4605t"),c(o,"class","no-snippets-found description dimmed svelte-y4605t"),c(t,"class","centered")},m(a,f){g(a,t,f),A(t,n),A(n,r),A(t,s),A(t,o),A(o,u)},p(a,f){f&64&&i!==(i=a[6]("no_snippets_found.title")+"")&&z(r,i),f&64&&l!==(l=a[6]("no_snippets_found.description")+"")&&z(u,l)},i:G,o:G,d(a){a&&_(t)}}}function Tl(e){let t,n,i;function r(o){e[22](o)}let s={snippets:e[7],tabindex:2,selectMode:e[0],autofocus:e[8]};return e[4]!==void 0&&(s.ref=e[4]),t=new yl({props:s}),ve.push(()=>$e(t,"ref",r)),t.$on("itemActivated",e[12]),t.$on("itemEdit",e[13]),{c(){U(t.$$.fragment)},m(o,l){O(t,o,l),i=!0},p(o,l){const u={};l&128&&(u.snippets=o[7]),l&1&&(u.selectMode=o[0]),!n&&l&16&&(n=!0,u.ref=o[4],Ge(()=>n=!1)),t.$set(u)},i(o){i||(w(t.$$.fragment,o),i=!0)},o(o){S(t.$$.fragment,o),i=!1},d(o){M(t,o)}}}function ii(e){let t,n;return t=new Rt({props:{bottom:!0,$$slots:{default:[Il]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r&33554496&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Il(e){let t,n,i,r,s,o;return t=new de({props:{iconClass:"dimmed",icon:Ot,size:"2.3x",title:e[6]("add_snippet.title")}}),t.$on("activate",e[10]),i=new An({}),s=new de({props:{iconClass:"dimmed",icon:Ui,size:"2x",title:e[6]("settings.title")}}),s.$on("activate",e[11]),{c(){U(t.$$.fragment),n=R(),U(i.$$.fragment),r=R(),U(s.$$.fragment)},m(l,u){O(t,l,u),g(l,n,u),O(i,l,u),g(l,r,u),O(s,l,u),o=!0},p(l,u){const a={};u&64&&(a.title=l[6]("add_snippet.title")),t.$set(a);const f={};u&64&&(f.title=l[6]("settings.title")),s.$set(f)},i(l){o||(w(t.$$.fragment,l),w(i.$$.fragment,l),w(s.$$.fragment,l),o=!0)},o(l){S(t.$$.fragment,l),S(i.$$.fragment,l),S(s.$$.fragment,l),o=!1},d(l){l&&(_(n),_(r)),M(t,l),M(i,l),M(s,l)}}}function Hl(e){let t,n,i,r,s,o,l,u,a,f,m;function h(y){e[19](y)}function p(y){e[20](y)}function d(y){e[21](y)}let b={search:!0,autofocus:e[1],placeholder:e[6]("search"),searchButtonTitle:e[6]("search"),clearButtonTitle:e[6]("clear"),tabindex:1};e[2]!==void 0&&(b.value=e[2]),e[3]!==void 0&&(b.ref=e[3]),e[5]!==void 0&&(b.focussed=e[5]),n=new kn({props:b}),ve.push(()=>$e(n,"value",h)),ve.push(()=>$e(n,"ref",p)),ve.push(()=>$e(n,"focussed",d)),n.$on("query",e[9]);const I=[Tl,Bl],B=[];function E(y,T){return y[7]?0:1}l=E(e),u=B[l]=I[l](e);let H=!e[0]&&ii(e);return{c(){t=C("div"),U(n.$$.fragment),o=R(),u.c(),a=R(),H&&H.c(),f=ye(),c(t,"class","toolbar top")},m(y,T){g(y,t,T),O(n,t,null),g(y,o,T),B[l].m(y,T),g(y,a,T),H&&H.m(y,T),g(y,f,T),m=!0},p(y,T){const L={};T&2&&(L.autofocus=y[1]),T&64&&(L.placeholder=y[6]("search")),T&64&&(L.searchButtonTitle=y[6]("search")),T&64&&(L.clearButtonTitle=y[6]("clear")),!i&&T&4&&(i=!0,L.value=y[2],Ge(()=>i=!1)),!r&&T&8&&(r=!0,L.ref=y[3],Ge(()=>r=!1)),!s&&T&32&&(s=!0,L.focussed=y[5],Ge(()=>s=!1)),n.$set(L);let k=l;l=E(y),l===k?B[l].p(y,T):(ue(),S(B[k],1,1,()=>{B[k]=null}),fe(),u=B[l],u?u.p(y,T):(u=B[l]=I[l](y),u.c()),w(u,1),u.m(a.parentNode,a)),y[0]?H&&(ue(),S(H,1,1,()=>{H=null}),fe()):H?(H.p(y,T),T&1&&w(H,1)):(H=ii(y),H.c(),w(H,1),H.m(f.parentNode,f))},i(y){m||(w(n.$$.fragment,y),w(u),w(H),m=!0)},o(y){S(n.$$.fragment,y),S(u),S(H),m=!1},d(y){y&&(_(t),_(o),_(a),_(f)),M(n),B[l].d(y),H&&H.d(y)}}}function Cl(e){let t,n;return t=new et({props:{$$slots:{default:[Hl]},$$scope:{ctx:e}}}),t.$on("keyup",e[14]),t.$on("cancel",e[15]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&33554687&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Ll(e,t,n){let i,r,s,o,l;ne(e,Sn,P=>n(17,i=P)),ne(e,we,P=>n(18,r=P)),ne(e,Jt,P=>n(2,s=P)),ne(e,Se,P=>n(6,o=P)),ne(e,Yt,P=>n(7,l=P));let{orderByLastUsed:u=!1}=t,{selectMode:a=!1}=t,{focusSearchBox:f=!0}=t;const m=!f;let h,p,d=f;function b(P){Xi(Jt,s=P.detail,s),Yt.search(s,u)}function I(){je("/snippet/add")}function B(){je("/settings")}function E(P){gr(P.detail.snippet.abbreviation,500)}function H(P){const ie=P.detail.snippet.id;je("/snippet/edit/"+ie)}function y(P,ie,oe,_e){Yt.search(P,ie)}function T(){d?p.focus():h.focus()}function L(P){P.ctrlKey&&P.key==="n"&&(I(),P.preventDefault()),P.ctrlKey&&P.altKey&&P.key==="s"&&(B(),P.preventDefault()),P.ctrlKey&&P.key==="f"&&(T(),P.preventDefault())}function k(){a&&ir()}function x(P){s=P,Jt.set(s)}function v(P){h=P,n(3,h)}function N(P){d=P,n(5,d)}function K(P){p=P,n(4,p)}return e.$$set=P=>{"orderByLastUsed"in P&&n(16,u=P.orderByLastUsed),"selectMode"in P&&n(0,a=P.selectMode),"focusSearchBox"in P&&n(1,f=P.focusSearchBox)},e.$$.update=()=>{e.$$.dirty&458756&&y(s,u)},[a,f,s,h,p,d,o,l,m,b,I,B,E,H,L,k,u,i,r,x,v,N,K]}class Nl extends Y{constructor(t){super(),J(this,t,Ll,Cl,Z,{orderByLastUsed:16,selectMode:0,focusSearchBox:1})}}function ri(e){let t,n,i,r,s,o,l,u;return n=new de({props:{iconClass:"dimmed",icon:Ot,title:e[0]("add_snippet.title"),size:"5x",$$slots:{default:[Pl]},$$scope:{ctx:e}}}),n.$on("activate",e[2]),s=new de({props:{horizontal:!0,iconClass:"dimmed",icon:hn,title:e[0]("import_snippets.title"),size:"1.5x",$$slots:{default:[Ol]},$$scope:{ctx:e}}}),s.$on("activate",e[4]),l=new Rt({props:{bottom:!0,$$slots:{default:[Ml]},$$scope:{ctx:e}}}),{c(){t=C("p"),U(n.$$.fragment),i=R(),r=C("p"),U(s.$$.fragment),o=R(),U(l.$$.fragment),c(t,"class","add-snippet"),c(r,"class","import-snippets")},m(a,f){g(a,t,f),O(n,t,null),g(a,i,f),g(a,r,f),O(s,r,null),g(a,o,f),O(l,a,f),u=!0},p(a,f){const m={};f&1&&(m.title=a[0]("add_snippet.title")),f&33&&(m.$$scope={dirty:f,ctx:a}),n.$set(m);const h={};f&1&&(h.title=a[0]("import_snippets.title")),f&33&&(h.$$scope={dirty:f,ctx:a}),s.$set(h);const p={};f&33&&(p.$$scope={dirty:f,ctx:a}),l.$set(p)},i(a){u||(w(n.$$.fragment,a),w(s.$$.fragment,a),w(l.$$.fragment,a),u=!0)},o(a){S(n.$$.fragment,a),S(s.$$.fragment,a),S(l.$$.fragment,a),u=!1},d(a){a&&(_(t),_(i),_(r),_(o)),M(n),M(s),M(l,a)}}}function Pl(e){let t=e[0]("add_snippet.title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("add_snippet.title")+"")&&z(n,t)},d(i){i&&_(n)}}}function Ol(e){let t=e[0]("import_snippets.title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("import_snippets.title")+"")&&z(n,t)},d(i){i&&_(n)}}}function Ml(e){let t,n,i,r,s,o;return t=new de({props:{iconClass:"dimmed",icon:Ot,size:"2.3x",title:e[0]("add_snippet.title")}}),t.$on("activate",e[2]),i=new An({}),s=new de({props:{iconClass:"dimmed",icon:Ui,size:"2x",title:e[0]("settings.title")}}),s.$on("activate",e[3]),{c(){U(t.$$.fragment),n=R(),U(i.$$.fragment),r=R(),U(s.$$.fragment)},m(l,u){O(t,l,u),g(l,n,u),O(i,l,u),g(l,r,u),O(s,l,u),o=!0},p(l,u){const a={};u&1&&(a.title=l[0]("add_snippet.title")),t.$set(a);const f={};u&1&&(f.title=l[0]("settings.title")),s.$set(f)},i(l){o||(w(t.$$.fragment,l),w(i.$$.fragment,l),w(s.$$.fragment,l),o=!0)},o(l){S(t.$$.fragment,l),S(i.$$.fragment,l),S(s.$$.fragment,l),o=!1},d(l){l&&(_(n),_(r)),M(t,l),M(i,l),M(s,l)}}}function xl(e){let t,n,i,r=e[0]("no_snippets_found.title")+"",s,o,l,u,a=e[1]&&ri(e);return{c(){t=C("h1"),t.textContent="Snippet Expander",n=R(),i=C("p"),s=$(r),o=R(),a&&a.c(),l=ye(),c(i,"class","dimmed")},m(f,m){g(f,t,m),g(f,n,m),g(f,i,m),A(i,s),g(f,o,m),a&&a.m(f,m),g(f,l,m),u=!0},p(f,m){(!u||m&1)&&r!==(r=f[0]("no_snippets_found.title")+"")&&z(s,r),f[1]?a?(a.p(f,m),m&2&&w(a,1)):(a=ri(f),a.c(),w(a,1),a.m(l.parentNode,l)):a&&(ue(),S(a,1,1,()=>{a=null}),fe())},i(f){u||(w(a),u=!0)},o(f){S(a),u=!1},d(f){f&&(_(t),_(n),_(i),_(o),_(l)),a&&a.d(f)}}}function Rl(e){let t,n;return t=new et({props:{centered:!0,$$slots:{default:[xl]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&35&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Ul(e,t,n){let i,r;ne(e,Se,u=>n(0,i=u)),ne(e,we,u=>n(1,r=u));function s(){je("/snippet/add")}function o(){je("/settings")}async function l(){try{const u=await di(!1)}catch(u){await ae(i("import_snippets.error_title"),u)}await Me.fetch()}return[i,r,s,o,l]}class Dl extends Y{constructor(t){super(),J(this,t,Ul,Rl,Z,{})}}function Gl(e){let t,n;return t=new Dl({}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p:G,i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function $l(e){let t,n;return t=new Nl({props:{selectMode:e[2],orderByLastUsed:e[3],focusSearchBox:e[4]}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r&4&&(s.selectMode=i[2]),r&8&&(s.orderByLastUsed=i[3]),r&16&&(s.focusSearchBox=i[4]),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function jl(e){let t;return{c(){t=$("Checking settings ...")},m(n,i){g(n,t,i)},p:G,i:G,o:G,d(n){n&&_(t)}}}function Fl(e){let t,n,i,r;const s=[jl,$l,Gl],o=[];function l(u,a){return u[1]?0:u[0]&&(u[5]&&u[5].length>0||u[2])?1:2}return t=l(e),n=o[t]=s[t](e),{c(){n.c(),i=ye()},m(u,a){o[t].m(u,a),g(u,i,a),r=!0},p(u,[a]){let f=t;t=l(u),t===f?o[t].p(u,a):(ue(),S(o[f],1,1,()=>{o[f]=null}),fe(),n=o[t],n?n.p(u,a):(n=o[t]=s[t](u),n.c()),w(n,1),n.m(i.parentNode,i))},i(u){r||(w(n),r=!0)},o(u){S(n),r=!1},d(u){u&&_(i),o[t].d(u)}}}function zl(e,t,n){let i,r,s,o;ne(e,Se,h=>n(7,i=h)),ne(e,we,h=>n(0,r=h)),ne(e,Sn,h=>n(6,s=h)),ne(e,Me,h=>n(5,o=h));let l=!0,u=!1,a=!1,f=!0;function m(h,p){Me.fetch()}return Je(async()=>{if(n(2,u=await yr()),n(3,a=u),u&&r)try{const h=await pi("FOCUS_SEARCH_BOX");n(4,f=h!=="false")}catch(h){await ae(i("settings.get_error_title"),h)}n(1,l=!1)}),e.$$.update=()=>{e.$$.dirty&65&&m()},[r,l,u,a,f,o,s]}class Vl extends Y{constructor(t){super(),J(this,t,zl,Fl,Z,{})}}function Wl(e){let t=e[4]("button.cancel")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&16&&t!==(t=i[4]("button.cancel")+"")&&z(n,t)},d(i){i&&_(n)}}}function Xl(e){let t=e[4]("button.save")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&16&&t!==(t=i[4]("button.save")+"")&&z(n,t)},d(i){i&&_(n)}}}function ql(e){let t,n=e[4]("add_snippet.title")+"",i,r,s,o,l,u,a=e[4]("body.title")+"",f,m,h,p,d,b,I,B,E,H,y;function T(k){e[8](k)}let L={label:e[4]("abbreviation.title"),errorMessage:e[1],autofocus:!0};return e[0]!==void 0&&(L.value=e[0]),s=new kn({props:L}),ve.push(()=>$e(s,"value",T)),b=new Fe({props:{secondary:!0,$$slots:{default:[Wl]},$$scope:{ctx:e}}}),b.$on("click",e[5]),B=new Fe({props:{primary:!0,disabled:e[3],$$slots:{default:[Xl]},$$scope:{ctx:e}}}),B.$on("click",e[6]),{c(){t=C("h2"),i=$(n),r=R(),U(s.$$.fragment),l=R(),u=C("label"),f=$(a),m=R(),h=C("textarea"),p=R(),d=C("div"),U(b.$$.fragment),I=R(),U(B.$$.fragment),c(t,"class","svelte-126nfs4"),c(u,"for","body"),c(h,"id","body"),c(h,"class","svelte-126nfs4"),c(d,"class","button-row svelte-126nfs4")},m(k,x){g(k,t,x),A(t,i),g(k,r,x),O(s,k,x),g(k,l,x),g(k,u,x),A(u,f),g(k,m,x),g(k,h,x),ze(h,e[2]),g(k,p,x),g(k,d,x),O(b,d,null),A(d,I),O(B,d,null),E=!0,H||(y=re(h,"input",e[9]),H=!0)},p(k,x){(!E||x&16)&&n!==(n=k[4]("add_snippet.title")+"")&&z(i,n);const v={};x&16&&(v.label=k[4]("abbreviation.title")),x&2&&(v.errorMessage=k[1]),!o&&x&1&&(o=!0,v.value=k[0],Ge(()=>o=!1)),s.$set(v),(!E||x&16)&&a!==(a=k[4]("body.title")+"")&&z(f,a),x&4&&ze(h,k[2]);const N={};x&2064&&(N.$$scope={dirty:x,ctx:k}),b.$set(N);const K={};x&8&&(K.disabled=k[3]),x&2064&&(K.$$scope={dirty:x,ctx:k}),B.$set(K)},i(k){E||(w(s.$$.fragment,k),w(b.$$.fragment,k),w(B.$$.fragment,k),E=!0)},o(k){S(s.$$.fragment,k),S(b.$$.fragment,k),S(B.$$.fragment,k),E=!1},d(k){k&&(_(t),_(r),_(l),_(u),_(m),_(h),_(p),_(d)),M(s,k),M(b),M(B),H=!1,y()}}}function Zl(e){let t,n;return t=new et({props:{$$slots:{default:[ql]},$$scope:{ctx:e}}}),t.$on("cancel",e[5]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&2079&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Ql(e,t,n){let i,r,s;ne(e,Se,d=>n(4,r=d)),ne(e,we,d=>n(7,s=d));let o="",l="";async function u(d){if(d.length===0){n(1,a=r("abbreviation.empty"));return}if(!s){n(1,a="");return}try{const b=await mi(d);if(b.hasOwnProperty("abbreviation")&&b.abbreviation.length>0){n(1,a=r("abbreviation.exists"));return}}catch(b){await ae(r("add_snippet.error_title"),b)}n(1,a="")}let a="";function f(){Be()}async function m(){try{const d=await rr(o,l);await Be()}catch(d){await ae(r("add_snippet.error_title"),d)}}function h(d){o=d,n(0,o)}function p(){l=this.value,n(2,l)}return e.$$.update=()=>{e.$$.dirty&1&&u(o),e.$$.dirty&130&&n(3,i=!s||a.length>0)},[o,a,l,i,r,f,m,s,h,p]}class Jl extends Y{constructor(t){super(),J(this,t,Ql,Zl,Z,{})}}function Yl(e){let t=e[5]("button.remove")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&32&&t!==(t=i[5]("button.remove")+"")&&z(n,t)},d(i){i&&_(n)}}}function Kl(e){let t=e[5]("button.cancel")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&32&&t!==(t=i[5]("button.cancel")+"")&&z(n,t)},d(i){i&&_(n)}}}function ea(e){let t=e[5]("button.save")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&32&&t!==(t=i[5]("button.save")+"")&&z(n,t)},d(i){i&&_(n)}}}function ta(e){let t,n=e[5]("edit_snippet.title")+"",i,r,s,o,l,u,a=e[5]("body.title")+"",f,m,h,p,d,b,I,B,E,H,y,T,L;function k(v){e[11](v)}let x={label:e[5]("abbreviation.title"),errorMessage:e[1],autofocus:!0};return e[0]!==void 0&&(x.value=e[0]),s=new kn({props:x}),ve.push(()=>$e(s,"value",k)),b=new Fe({props:{danger:!0,disabled:e[3],$$slots:{default:[Yl]},$$scope:{ctx:e}}}),b.$on("click",e[7]),B=new Fe({props:{secondary:!0,$$slots:{default:[Kl]},$$scope:{ctx:e}}}),B.$on("click",e[6]),H=new Fe({props:{primary:!0,disabled:e[4],$$slots:{default:[ea]},$$scope:{ctx:e}}}),H.$on("click",e[8]),{c(){t=C("h2"),i=$(n),r=R(),U(s.$$.fragment),l=R(),u=C("label"),f=$(a),m=R(),h=C("textarea"),p=R(),d=C("div"),U(b.$$.fragment),I=R(),U(B.$$.fragment),E=R(),U(H.$$.fragment),c(t,"class","svelte-126nfs4"),c(u,"for","body"),c(h,"id","body"),c(h,"class","svelte-126nfs4"),c(d,"class","button-row svelte-126nfs4")},m(v,N){g(v,t,N),A(t,i),g(v,r,N),O(s,v,N),g(v,l,N),g(v,u,N),A(u,f),g(v,m,N),g(v,h,N),ze(h,e[2]),g(v,p,N),g(v,d,N),O(b,d,null),A(d,I),O(B,d,null),A(d,E),O(H,d,null),y=!0,T||(L=re(h,"input",e[12]),T=!0)},p(v,N){(!y||N&32)&&n!==(n=v[5]("edit_snippet.title")+"")&&z(i,n);const K={};N&32&&(K.label=v[5]("abbreviation.title")),N&2&&(K.errorMessage=v[1]),!o&&N&1&&(o=!0,K.value=v[0],Ge(()=>o=!1)),s.$set(K),(!y||N&32)&&a!==(a=v[5]("body.title")+"")&&z(f,a),N&4&&ze(h,v[2]);const P={};N&8&&(P.disabled=v[3]),N&32800&&(P.$$scope={dirty:N,ctx:v}),b.$set(P);const ie={};N&32800&&(ie.$$scope={dirty:N,ctx:v}),B.$set(ie);const oe={};N&16&&(oe.disabled=v[4]),N&32800&&(oe.$$scope={dirty:N,ctx:v}),H.$set(oe)},i(v){y||(w(s.$$.fragment,v),w(b.$$.fragment,v),w(B.$$.fragment,v),w(H.$$.fragment,v),y=!0)},o(v){S(s.$$.fragment,v),S(b.$$.fragment,v),S(B.$$.fragment,v),S(H.$$.fragment,v),y=!1},d(v){v&&(_(t),_(r),_(l),_(u),_(m),_(h),_(p),_(d)),M(s,v),M(b),M(B),M(H),T=!1,L()}}}function na(e){let t,n;return t=new et({props:{$$slots:{default:[ta]},$$scope:{ctx:e}}}),t.$on("cancel",e[6]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&32831&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function ia(e,t,n){let i,r,s,o;ne(e,Se,E=>n(5,s=E)),ne(e,we,E=>n(10,o=E));let{params:l={}}=t,u={},a="",f="";async function m(E){if(n(1,h=""),!!u.hasOwnProperty("id")){if(E.length===0){n(1,h=s("abbreviation.empty"));return}if(o)try{const H=await mi(E);H.hasOwnProperty("abbreviation")&&H.abbreviation.length>0&&H.id!==u.id&&n(1,h=s("abbreviation.exists"))}catch(H){await ae(s("edit_snippet.error_title"),H)}}}let h="";function p(){Be()}async function d(){try{await vr(u.abbreviation),await Be()}catch(E){await ae(s("remove_snippet.error_title"),E)}}async function b(){let E={...u};E.abbreviation=a,E.body=f;try{await Br(u.id,E),await Be()}catch(H){await ae(s("edit_snippet.error_title"),H)}}Je(async()=>{l.hasOwnProperty("id")||(await ae(s("edit_snippet.error_title"),s("edit_snippet.id_not_supplied")),await Be());try{u=await pr(l.id)}catch(H){await ae(s("edit_snippet.error_title"),H),await Be()}let E=!1;try{E=await _r(u.id)}catch(H){await ae(s("edit_snippet.error_title"),H),await Be()}E&&(await ae(s("edit_snippet.error_title"),s("edit_snippet.snippet_not_found")),await Be()),n(0,a=u.abbreviation),n(2,f=u.body)});function I(E){a=E,n(0,a)}function B(){f=this.value,n(2,f)}return e.$$set=E=>{"params"in E&&n(9,l=E.params)},e.$$.update=()=>{e.$$.dirty&1&&m(a),e.$$.dirty&1026&&n(4,i=!o||h.length>0),e.$$.dirty&1024&&n(3,r=!o)},[a,h,f,r,i,s,p,d,b,l,o,I,B]}class ra extends Y{constructor(t){super(),J(this,t,ia,na,Z,{params:9})}}function sa(e){let t,n,i,r,s,o;return t=new de({props:{horizontal:!0,iconClass:"dimmed",icon:Ri,size:"2.5x",title:e[6]("button.back")}}),t.$on("activate",e[8]),i=new An({}),s=new de({props:{horizontal:!0,iconClass:"dimmed",icon:So,size:"2.5x",title:e[6]("button.about")}}),s.$on("activate",e[9]),{c(){U(t.$$.fragment),n=R(),U(i.$$.fragment),r=R(),U(s.$$.fragment)},m(l,u){O(t,l,u),g(l,n,u),O(i,l,u),g(l,r,u),O(s,l,u),o=!0},p(l,u){const a={};u[0]&64&&(a.title=l[6]("button.back")),t.$set(a);const f={};u[0]&64&&(f.title=l[6]("button.about")),s.$set(f)},i(l){o||(w(t.$$.fragment,l),w(i.$$.fragment,l),w(s.$$.fragment,l),o=!0)},o(l){S(t.$$.fragment,l),S(i.$$.fragment,l),S(s.$$.fragment,l),o=!1},d(l){l&&(_(n),_(r)),M(t,l),M(i,l),M(s,l)}}}function oa(e){let t,n=e[6]("settings.custom_shortcuts_disabled")+"",i;return{c(){t=C("p"),i=$(n),c(t,"class","dimmed svelte-1fggvh7")},m(r,s){g(r,t,s),A(t,i)},p(r,s){s[0]&64&&n!==(n=r[6]("settings.custom_shortcuts_disabled")+"")&&z(i,n)},i:G,o:G,d(r){r&&_(t)}}}function la(e){let t,n,i,r;const s=[ua,aa],o=[];function l(u,a){return u[5].length>0?0:1}return t=l(e),n=o[t]=s[t](e),{c(){n.c(),i=ye()},m(u,a){o[t].m(u,a),g(u,i,a),r=!0},p(u,a){let f=t;t=l(u),t===f?o[t].p(u,a):(ue(),S(o[f],1,1,()=>{o[f]=null}),fe(),n=o[t],n?n.p(u,a):(n=o[t]=s[t](u),n.c()),w(n,1),n.m(i.parentNode,i))},i(u){r||(w(n),r=!0)},o(u){S(n),r=!1},d(u){u&&_(i),o[t].d(u)}}}function aa(e){let t,n=e[6]("settings.custom_shortcut")+"",i,r,s,o,l,u;return s=new xt({props:{shortcut:e[6]("settings.custom_shortcut_empty")}}),l=new de({props:{horizontal:!0,iconClass:"dimmed",icon:Ot,size:"2.0x",title:e[6]("settings.add_default_custom_shortcut")}}),l.$on("activate",e[22]),{c(){t=C("p"),i=$(n),r=$(": "),U(s.$$.fragment),o=R(),U(l.$$.fragment),c(t,"class","row svelte-1fggvh7")},m(a,f){g(a,t,f),A(t,i),A(t,r),O(s,t,null),A(t,o),O(l,t,null),u=!0},p(a,f){(!u||f[0]&64)&&n!==(n=a[6]("settings.custom_shortcut")+"")&&z(i,n);const m={};f[0]&64&&(m.shortcut=a[6]("settings.custom_shortcut_empty")),s.$set(m);const h={};f[0]&64&&(h.title=a[6]("settings.add_default_custom_shortcut")),l.$set(h)},i(a){u||(w(s.$$.fragment,a),w(l.$$.fragment,a),u=!0)},o(a){S(s.$$.fragment,a),S(l.$$.fragment,a),u=!1},d(a){a&&_(t),M(s),M(l)}}}function ua(e){let t,n=e[6]("settings.custom_shortcut")+"",i,r,s,o,l,u,a,f=e[6]("settings.change_custom_shortcut_desc")+"",m,h;return s=new xt({props:{shortcut:e[5]}}),l=new de({props:{horizontal:!0,iconClass:"dimmed",icon:Po,size:"1.75x",title:e[6]("settings.remove_custom_shortcut")}}),l.$on("activate",e[21]),{c(){t=C("p"),i=$(n),r=$(": "),U(s.$$.fragment),o=R(),U(l.$$.fragment),u=R(),a=C("p"),m=$(f),c(t,"class","row svelte-1fggvh7"),c(a,"class","dimmed svelte-1fggvh7")},m(p,d){g(p,t,d),A(t,i),A(t,r),O(s,t,null),A(t,o),O(l,t,null),g(p,u,d),g(p,a,d),A(a,m),h=!0},p(p,d){(!h||d[0]&64)&&n!==(n=p[6]("settings.custom_shortcut")+"")&&z(i,n);const b={};d[0]&32&&(b.shortcut=p[5]),s.$set(b);const I={};d[0]&64&&(I.title=p[6]("settings.remove_custom_shortcut")),l.$set(I),(!h||d[0]&64)&&f!==(f=p[6]("settings.change_custom_shortcut_desc")+"")&&z(m,f)},i(p){h||(w(s.$$.fragment,p),w(l.$$.fragment,p),h=!0)},o(p){S(s.$$.fragment,p),S(l.$$.fragment,p),h=!1},d(p){p&&(_(t),_(u),_(a)),M(s),M(l)}}}function fa(e){let t=e[6]("settings.no_connection")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r[0]&64&&t!==(t=i[6]("settings.no_connection")+"")&&z(n,t)},i:G,o:G,d(i){i&&_(n)}}}function ca(e){let t,n=e[6]("settings.import_export_title")+"",i,r,s,o,l,u,a,f,m;o=new de({props:{horizontal:!0,iconClass:"dimmed",icon:hn,size:"1.5x",title:e[6]("import_snippets.new_only_title"),$$slots:{default:[ha]},$$scope:{ctx:e}}}),o.$on("activate",e[25]),u=new de({props:{horizontal:!0,iconClass:"dimmed",icon:hn,size:"1.5x",title:e[6]("import_snippets.update_title"),$$slots:{default:[pa]},$$scope:{ctx:e}}}),u.$on("activate",e[26]);let h=e[7]&&e[7].length>0&&si(e);return{c(){t=C("h3"),i=$(n),r=R(),s=C("p"),U(o.$$.fragment),l=R(),U(u.$$.fragment),a=R(),h&&h.c(),f=ye(),c(t,"class","svelte-1fggvh7"),c(s,"class","import-snippets svelte-1fggvh7")},m(p,d){g(p,t,d),A(t,i),g(p,r,d),g(p,s,d),O(o,s,null),A(s,l),O(u,s,null),g(p,a,d),h&&h.m(p,d),g(p,f,d),m=!0},p(p,d){(!m||d[0]&64)&&n!==(n=p[6]("settings.import_export_title")+"")&&z(i,n);const b={};d[0]&64&&(b.title=p[6]("import_snippets.new_only_title")),d[0]&64|d[1]&4&&(b.$$scope={dirty:d,ctx:p}),o.$set(b);const I={};d[0]&64&&(I.title=p[6]("import_snippets.update_title")),d[0]&64|d[1]&4&&(I.$$scope={dirty:d,ctx:p}),u.$set(I),p[7]&&p[7].length>0?h?(h.p(p,d),d[0]&128&&w(h,1)):(h=si(p),h.c(),w(h,1),h.m(f.parentNode,f)):h&&(ue(),S(h,1,1,()=>{h=null}),fe())},i(p){m||(w(o.$$.fragment,p),w(u.$$.fragment,p),w(h),m=!0)},o(p){S(o.$$.fragment,p),S(u.$$.fragment,p),S(h),m=!1},d(p){p&&(_(t),_(r),_(s),_(a),_(f)),M(o),M(u),h&&h.d(p)}}}function ha(e){let t=e[6]("import_snippets.new_only_title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r[0]&64&&t!==(t=i[6]("import_snippets.new_only_title")+"")&&z(n,t)},d(i){i&&_(n)}}}function pa(e){let t=e[6]("import_snippets.update_title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r[0]&64&&t!==(t=i[6]("import_snippets.update_title")+"")&&z(n,t)},d(i){i&&_(n)}}}function si(e){let t,n,i;return n=new de({props:{horizontal:!0,iconClass:"dimmed",icon:po,size:"1.5x",title:e[6]("export_snippets.title"),$$slots:{default:[ma]},$$scope:{ctx:e}}}),n.$on("activate",e[16]),{c(){t=C("p"),U(n.$$.fragment),c(t,"class","export-snippets svelte-1fggvh7")},m(r,s){g(r,t,s),O(n,t,null),i=!0},p(r,s){const o={};s[0]&64&&(o.title=r[6]("export_snippets.title")),s[0]&64|s[1]&4&&(o.$$scope={dirty:s,ctx:r}),n.$set(o)},i(r){i||(w(n.$$.fragment,r),i=!0)},o(r){S(n.$$.fragment,r),i=!1},d(r){r&&_(t),M(n)}}}function ma(e){let t=e[6]("export_snippets.title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r[0]&64&&t!==(t=i[6]("export_snippets.title")+"")&&z(n,t)},d(i){i&&_(n)}}}function da(e){let t,n,i,r=e[6]("settings.title")+"",s,o,l,u=e[6]("settings.autostart_title")+"",a,f,m,h,p,d,b=e[6]("settings.autostart")+"",I,B,E,H=e[6]("settings.autoexpand_title")+"",y,T,L,k,x,v,N=e[6]("settings.autoexpand")+"",K,P,ie,oe=e[6]("settings.search_and_paste_title")+"",_e,ge,ce,pe,he,j,se,F,ee,Pe=e[6]("settings.focus_search")+"",Ut,Dt,be,ke,tt,Ae,Gt,Bn;t=new Rt({props:{$$slots:{default:[sa]},$$scope:{ctx:e}}});const Tn=[la,oa],Ie=[];function In(D,W){return D[4]?0:1}ce=In(e),pe=Ie[ce]=Tn[ce](e);const Hn=[ca,fa],He=[];function Cn(D,W){return D[0]?0:1}return be=Cn(e),ke=He[be]=Hn[be](e),{c(){U(t.$$.fragment),n=R(),i=C("h2"),s=$(r),o=R(),l=C("h3"),a=$(u),f=R(),m=C("p"),h=C("label"),p=C("input"),d=R(),I=$(b),B=R(),E=C("h3"),y=$(H),T=R(),L=C("p"),k=C("label"),x=C("input"),v=R(),K=$(N),P=R(),ie=C("h3"),_e=$(oe),ge=R(),pe.c(),he=R(),j=C("p"),se=C("label"),F=C("input"),ee=R(),Ut=$(Pe),Dt=R(),ke.c(),tt=ye(),c(i,"class","svelte-1fggvh7"),c(l,"class","svelte-1fggvh7"),c(p,"type","checkbox"),c(m,"class","svelte-1fggvh7"),c(E,"class","svelte-1fggvh7"),c(x,"type","checkbox"),c(L,"class","svelte-1fggvh7"),c(ie,"class","svelte-1fggvh7"),c(F,"type","checkbox"),c(j,"class","svelte-1fggvh7")},m(D,W){O(t,D,W),g(D,n,W),g(D,i,W),A(i,s),g(D,o,W),g(D,l,W),A(l,a),g(D,f,W),g(D,m,W),A(m,h),A(h,p),p.checked=e[1],A(h,d),A(h,I),g(D,B,W),g(D,E,W),A(E,y),g(D,T,W),g(D,L,W),A(L,k),A(k,x),x.checked=e[2],A(k,v),A(k,K),g(D,P,W),g(D,ie,W),A(ie,_e),g(D,ge,W),Ie[ce].m(D,W),g(D,he,W),g(D,j,W),A(j,se),A(se,F),F.checked=e[3],A(se,ee),A(se,Ut),g(D,Dt,W),He[be].m(D,W),g(D,tt,W),Ae=!0,Gt||(Bn=[re(p,"change",e[17]),re(p,"change",e[18]),dn(Di.call(null,p,!0)),re(x,"change",e[19]),re(x,"change",e[20]),re(F,"change",e[23]),re(F,"change",e[24])],Gt=!0)},p(D,W){const Ln={};W[0]&64|W[1]&4&&(Ln.$$scope={dirty:W,ctx:D}),t.$set(Ln),(!Ae||W[0]&64)&&r!==(r=D[6]("settings.title")+"")&&z(s,r),(!Ae||W[0]&64)&&u!==(u=D[6]("settings.autostart_title")+"")&&z(a,u),W[0]&2&&(p.checked=D[1]),(!Ae||W[0]&64)&&b!==(b=D[6]("settings.autostart")+"")&&z(I,b),(!Ae||W[0]&64)&&H!==(H=D[6]("settings.autoexpand_title")+"")&&z(y,H),W[0]&4&&(x.checked=D[2]),(!Ae||W[0]&64)&&N!==(N=D[6]("settings.autoexpand")+"")&&z(K,N),(!Ae||W[0]&64)&&oe!==(oe=D[6]("settings.search_and_paste_title")+"")&&z(_e,oe);let $t=ce;ce=In(D),ce===$t?Ie[ce].p(D,W):(ue(),S(Ie[$t],1,1,()=>{Ie[$t]=null}),fe(),pe=Ie[ce],pe?pe.p(D,W):(pe=Ie[ce]=Tn[ce](D),pe.c()),w(pe,1),pe.m(he.parentNode,he)),W[0]&8&&(F.checked=D[3]),(!Ae||W[0]&64)&&Pe!==(Pe=D[6]("settings.focus_search")+"")&&z(Ut,Pe);let jt=be;be=Cn(D),be===jt?He[be].p(D,W):(ue(),S(He[jt],1,1,()=>{He[jt]=null}),fe(),ke=He[be],ke?ke.p(D,W):(ke=He[be]=Hn[be](D),ke.c()),w(ke,1),ke.m(tt.parentNode,tt))},i(D){Ae||(w(t.$$.fragment,D),w(pe),w(ke),Ae=!0)},o(D){S(t.$$.fragment,D),S(pe),S(ke),Ae=!1},d(D){D&&(_(n),_(i),_(o),_(l),_(f),_(m),_(B),_(E),_(T),_(L),_(P),_(ie),_(ge),_(he),_(j),_(Dt),_(tt)),M(t,D),Ie[ce].d(D),He[be].d(D),Gt=!1,Ee(Bn)}}}function _a(e){let t,n;return t=new et({props:{centered:!0,$$slots:{default:[da]},$$scope:{ctx:e}}}),t.$on("cancel",e[8]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r[0]&255|r[1]&4&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}const ga="Snippet Expander Search & Paste pop-up window",Kt="snippetexpandergui --search-and-paste",oi="<Ctrl>grave";function ba(e,t,n){let i,r,s;ne(e,Se,j=>n(6,i=j)),ne(e,we,j=>n(0,r=j)),ne(e,Me,j=>n(7,s=j));let o=!1,l=!1,u=!0,a=!1,f=oi;function m(){Be()}function h(){je("/about")}async function p(){let j=!1;try{j=await cr()}catch(se){await ae(i("settings.get_error_title"),se);return}return j}async function d(j){try{await Ar(j)}catch(se){await ae(i("settings.save_error_title"),se);return}return j}async function b(){let j=!1;try{j=await fr()}catch(se){await ae(i("settings.get_error_title"),se);return}return j}async function I(j){try{await kr(j)}catch(se){await ae(i("settings.save_error_title"),se);return}return j}async function B(){let j="";try{j=await pi("FOCUS_SEARCH_BOX")}catch(se){await ae(i("settings.get_error_title"),se);return}return j!=="false"}async function E(){let j=!1;try{j=await sr()}catch(se){await ae(i("settings.get_error_title"),se);return}return j}async function H(){try{n(5,f=await hr(Kt))}catch(j){await ae(i("settings.get_error_title"),j);return}}async function y(){try{await wr(ga,oi,Kt,"")}catch(j){await ae(i("settings.save_error_title"),j)}await H()}async function T(){try{await lr(Kt,f)}catch(j){await ae(i("settings.delete_error_title"),j)}await H()}async function L(j){const se=j?"true":"false";try{await Er("FOCUS_SEARCH_BOX",se)}catch(F){await ae(i("settings.save_error_title"),F);return}return j}function k(j){Me.fetch()}async function x(j){try{const se=await di(j)}catch(se){await ae(i("import_snippets.error_title"),se)}await Me.fetch()}async function v(){try{const j=await ar()}catch(j){await ae(i("export_snippets.error_title"),j)}}Je(async()=>{n(1,o=await p()),n(2,l=await b()),n(3,u=await B()),n(4,a=await E()),a&&await H()});function N(){o=this.checked,n(1,o)}const K=()=>d(o);function P(){l=this.checked,n(2,l)}const ie=()=>I(l),oe=()=>T(),_e=()=>y();function ge(){u=this.checked,n(3,u)}const ce=()=>L(u),pe=()=>x(!1),he=()=>x(!0);return e.$$.update=()=>{e.$$.dirty[0]&1&&k()},[r,o,l,u,a,f,i,s,m,h,d,I,y,T,L,x,v,N,K,P,ie,oe,_e,ge,ce,pe,he]}class va extends Y{constructor(t){super(),J(this,t,ba,_a,Z,{},null,[-1,-1])}}const wa="/assets/snippetexpander-icon-128-a0af7490.svg";function Ea(e){let t,n;return t=new de({props:{horizontal:!0,iconClass:"dimmed",icon:Ri,size:"2.5x",title:e[3]("button.back")}}),t.$on("activate",e[4]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r&8&&(s.title=i[3]("button.back")),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function ya(e){let t,n,i,r,s,o,l,u,a,f=e[3]("about.description")+"",m,h,p,d,b,I,B,E,H,y,T=e[3]("about.by")+"",L,k,x,v,N,K,P=e[3]("about.licence_title")+"",ie,oe,_e,ge,ce=e[3]("about.licence")+"",pe,he,j,se;return t=new Rt({props:{$$slots:{default:[Ea]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment),n=R(),i=C("img"),s=R(),o=C("h2"),o.textContent="Snippet Expander",l=R(),u=C("p"),a=C("em"),m=$(f),h=R(),p=C("p"),d=C("a"),b=$(e[2]),I=R(),B=C("p"),E=C("a"),E.textContent="snippetexpander.org",H=R(),y=C("h3"),L=$(T),k=R(),x=C("p"),v=C("a"),v.textContent="ianmjones",N=R(),K=C("h3"),ie=$(P),oe=R(),_e=C("p"),ge=C("a"),pe=$(ce),Vi(i.src,r=wa)||c(i,"src",r),c(i,"alt","Snippet Expander icon"),c(o,"class","svelte-sjm2tb"),c(u,"class","svelte-sjm2tb"),c(d,"href",e[0]),c(p,"class","svelte-sjm2tb"),c(E,"href","https://snippetexpander.org"),c(B,"class","svelte-sjm2tb"),c(y,"class","svelte-sjm2tb"),c(v,"href","https://ianmjones.com"),c(x,"class","svelte-sjm2tb"),c(K,"class","svelte-sjm2tb"),c(ge,"href",e[1]),c(_e,"class","svelte-sjm2tb")},m(F,ee){O(t,F,ee),g(F,n,ee),g(F,i,ee),g(F,s,ee),g(F,o,ee),g(F,l,ee),g(F,u,ee),A(u,a),A(a,m),g(F,h,ee),g(F,p,ee),A(p,d),A(d,b),g(F,I,ee),g(F,B,ee),A(B,E),g(F,H,ee),g(F,y,ee),A(y,L),g(F,k,ee),g(F,x,ee),A(x,v),g(F,N,ee),g(F,K,ee),A(K,ie),g(F,oe,ee),g(F,_e,ee),A(_e,ge),A(ge,pe),he=!0,j||(se=[re(d,"click",vt(e[6])),re(E,"click",vt(e[7])),re(v,"click",vt(e[8])),re(ge,"click",vt(e[9]))],j=!0)},p(F,ee){const Pe={};ee&1032&&(Pe.$$scope={dirty:ee,ctx:F}),t.$set(Pe),(!he||ee&8)&&f!==(f=F[3]("about.description")+"")&&z(m,f),(!he||ee&4)&&z(b,F[2]),(!he||ee&1)&&c(d,"href",F[0]),(!he||ee&8)&&T!==(T=F[3]("about.by")+"")&&z(L,T),(!he||ee&8)&&P!==(P=F[3]("about.licence_title")+"")&&z(ie,P),(!he||ee&8)&&ce!==(ce=F[3]("about.licence")+"")&&z(pe,ce),(!he||ee&2)&&c(ge,"href",F[1])},i(F){he||(w(t.$$.fragment,F),he=!0)},o(F){S(t.$$.fragment,F),he=!1},d(F){F&&(_(n),_(i),_(s),_(o),_(l),_(u),_(h),_(p),_(I),_(B),_(H),_(y),_(k),_(x),_(N),_(K),_(oe),_(_e)),M(t,F),j=!1,Ee(se)}}}function Sa(e){let t,n;return t=new et({props:{centered:!0,$$slots:{default:[ya]},$$scope:{ctx:e}}}),t.$on("cancel",e[4]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&1039&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function ka(e,t,n){let i,r,s,o;ne(e,Se,p=>n(3,o=p));function l(){Be()}let u="";Je(async()=>{n(5,u=await dr())});const a=()=>wt(r),f=()=>wt("https://snippetexpander.org"),m=()=>wt("https://ianmjones.com"),h=()=>wt(s);return e.$$.update=()=>{e.$$.dirty&32&&n(2,i="v"+u),e.$$.dirty&32&&n(0,r="https://git.sr.ht/~ianmjones/snippetexpander/tree/"+u),e.$$.dirty&1&&n(1,s=r+"/item/LICENSE")},[r,s,i,o,l,u,a,f,m,h]}class Aa extends Y{constructor(t){super(),J(this,t,ka,Sa,Z,{})}}function Ba(e){let t,n;return t=new so({props:{routes:e[1]}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p:G,i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Ta(e){let t;return{c(){t=$("Loading...")},m(n,i){g(n,t,i)},p:G,i:G,o:G,d(n){n&&_(t)}}}function Ia(e){let t,n,i,r;const s=[Ta,Ba],o=[];function l(u,a){return u[0]?0:1}return t=l(e),n=o[t]=s[t](e),{c(){n.c(),i=ye()},m(u,a){o[t].m(u,a),g(u,i,a),r=!0},p(u,[a]){let f=t;t=l(u),t===f?o[t].p(u,a):(ue(),S(o[f],1,1,()=>{o[f]=null}),fe(),n=o[t],n?n.p(u,a):(n=o[t]=s[t](u),n.c()),w(n,1),n.m(i.parentNode,i))},i(u){r||(w(n),r=!0)},o(u){S(n),r=!1},d(u){u&&_(i),o[t].d(u)}}}function Ha(e,t,n){let i;ne(e,kt,a=>n(0,i=a));let r;async function s(){try{const a=await br("Pong");a==="Pong"?we.update(f=>!0):(we.update(f=>!1),Vt("Got '"+a+"' back from Ping instead of 'Pong'.")),rt.update(f=>!0),Ht.update(f=>!1)}catch(a){we.update(f=>!1),Vt("Ping returned: "+a),o()}}async function o(){try{await or()?rt.update(f=>!0):rt.update(f=>!1)}catch(a){rt.update(f=>!1),Vt("DaemonInstalled returned: "+a)}}Rs("en-GB",()=>zi(()=>import("./en-GB-0a4787dd.js"),[])),Ds({fallbackLocale:"en-GB",initialLocale:Gs()});const l=nr("SnippetsUpdated",()=>{Sn.update(a=>Date.now())}),u={"/":Vl,"/snippet/add":Jl,"/snippet/edit/:id":ra,"/settings":va,"/about":Aa};return Je(async()=>{await s(),r=setInterval(s,5e3)}),_n(()=>{clearInterval(r),l()}),[i,u]}class Ca extends Y{constructor(t){super(),J(this,t,Ha,Ia,Z,{})}}new Ca({target:document.getElementById("app")});

D cmd/snippetexpandergui/frontend/dist/assets/index-68176ace.js => cmd/snippetexpandergui/frontend/dist/assets/index-68176ace.js +0 -5
@@ 1,5 0,0 @@
var Di=Object.defineProperty;var Gi=(e,t,n)=>t in e?Di(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ft=(e,t,n)=>(Gi(e,typeof t!="symbol"?t+"":t,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();const $i="modulepreload",ji=function(e){return"/"+e},Ln={},Fi=function(t,n,i){if(!n||n.length===0)return t();const r=document.getElementsByTagName("link");return Promise.all(n.map(s=>{if(s=ji(s),s in Ln)return;Ln[s]=!0;const o=s.endsWith(".css"),l=o?'[rel="stylesheet"]':"";if(!!i)for(let f=r.length-1;f>=0;f--){const p=r[f];if(p.href===s&&(!o||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${l}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":$i,o||(u.as="script",u.crossOrigin=""),u.href=s,document.head.appendChild(u),o)return new Promise((f,p)=>{u.addEventListener("load",f),u.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>t()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};function G(){}function pn(e,t){for(const n in t)e[n]=t[n];return e}function oi(e){return e()}function Nn(){return Object.create(null)}function Ee(e){e.forEach(oi)}function Qe(e){return typeof e=="function"}function Z(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let bt;function zi(e,t){return e===t?!0:(bt||(bt=document.createElement("a")),bt.href=t,e===bt.href)}function Vi(e){return Object.keys(e).length===0}function mn(e,...t){if(e==null){for(const i of t)i(void 0);return G}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Pn(e){let t;return mn(e,n=>t=n)(),t}function ne(e,t,n){e.$$.on_destroy.push(mn(t,n))}function ht(e,t,n,i){if(e){const r=li(e,t,n,i);return e[0](r)}}function li(e,t,n,i){return e[1]&&i?pn(n.ctx.slice(),e[1](i(t))):n.ctx}function pt(e,t,n,i){if(e[2]&&i){const r=e[2](i(n));if(t.dirty===void 0)return r;if(typeof r=="object"){const s=[],o=Math.max(t.dirty.length,r.length);for(let l=0;l<o;l+=1)s[l]=t.dirty[l]|r[l];return s}return t.dirty|r}return t.dirty}function mt(e,t,n,i,r,s){if(r){const o=li(t,n,i,s);e.p(o,r)}}function dt(e){if(e.ctx.length>32){const t=[],n=e.ctx.length/32;for(let i=0;i<n;i++)t[i]=-1;return t}return-1}function Wi(e,t,n){return e.set(n),t}function dn(e){return e&&Qe(e.destroy)?e.destroy:G}function A(e,t){e.appendChild(t)}function g(e,t,n){e.insertBefore(t,n||null)}function _(e){e.parentNode&&e.parentNode.removeChild(e)}function Xi(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function L(e){return document.createElement(e)}function V(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function $(e){return document.createTextNode(e)}function R(){return $(" ")}function ye(){return $("")}function te(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function vt(e){return function(t){return t.preventDefault(),e.call(this,t)}}function c(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function qi(e){return Array.from(e.childNodes)}function z(e,t){t=""+t,e.data!==t&&(e.data=t)}function ze(e,t){e.value=t??""}function X(e,t,n){e.classList.toggle(t,!!n)}function Zi(e,t,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:i})}function Ve(e,t){return new e(t)}let at;function st(e){at=e}function Ct(){if(!at)throw new Error("Function called outside component initialization");return at}function Je(e){Ct().$$.on_mount.push(e)}function ai(e){Ct().$$.after_update.push(e)}function _n(e){Ct().$$.on_destroy.push(e)}function _t(){const e=Ct();return(t,n,{cancelable:i=!1}={})=>{const r=e.$$.callbacks[t];if(r){const s=Zi(t,n,{cancelable:i});return r.slice().forEach(o=>{o.call(e,s)}),!s.defaultPrevented}return!0}}function ut(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(i=>i.call(this,t))}const Ue=[],ve=[];let De=[];const en=[],ui=Promise.resolve();let tn=!1;function fi(){tn||(tn=!0,ui.then(ci))}function gn(){return fi(),ui}function nn(e){De.push(e)}function Ge(e){en.push(e)}const zt=new Set;let xe=0;function ci(){if(xe!==0)return;const e=at;do{try{for(;xe<Ue.length;){const t=Ue[xe];xe++,st(t),Qi(t.$$)}}catch(t){throw Ue.length=0,xe=0,t}for(st(null),Ue.length=0,xe=0;ve.length;)ve.pop()();for(let t=0;t<De.length;t+=1){const n=De[t];zt.has(n)||(zt.add(n),n())}De.length=0}while(Ue.length);for(;en.length;)en.pop()();tn=!1,zt.clear(),st(e)}function Qi(e){if(e.fragment!==null){e.update(),Ee(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(nn)}}function Ji(e){const t=[],n=[];De.forEach(i=>e.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),De=t}const yt=new Set;let Oe;function ue(){Oe={r:0,c:[],p:Oe}}function fe(){Oe.r||Ee(Oe.c),Oe=Oe.p}function w(e,t){e&&e.i&&(yt.delete(e),e.i(t))}function S(e,t,n,i){if(e&&e.o){if(yt.has(e))return;yt.add(e),Oe.c.push(()=>{yt.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function On(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function Bt(e,t){const n={},i={},r={$$scope:1};let s=e.length;for(;s--;){const o=e[s],l=t[s];if(l){for(const a in o)a in l||(i[a]=1);for(const a in l)r[a]||(n[a]=l[a],r[a]=1);e[s]=l}else for(const a in o)r[a]=1}for(const o in i)o in n||(n[o]=void 0);return n}function Tt(e){return typeof e=="object"&&e!==null?e:{}}function $e(e,t,n){const i=e.$$.props[t];i!==void 0&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function U(e){e&&e.c()}function O(e,t,n){const{fragment:i,after_update:r}=e.$$;i&&i.m(t,n),nn(()=>{const s=e.$$.on_mount.map(oi).filter(Qe);e.$$.on_destroy?e.$$.on_destroy.push(...s):Ee(s),e.$$.on_mount=[]}),r.forEach(nn)}function M(e,t){const n=e.$$;n.fragment!==null&&(Ji(n.after_update),Ee(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Yi(e,t){e.$$.dirty[0]===-1&&(Ue.push(e),fi(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function J(e,t,n,i,r,s,o,l=[-1]){const a=at;st(e);const u=e.$$={fragment:null,ctx:[],props:s,update:G,not_equal:r,bound:Nn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(a?a.$$.context:[])),callbacks:Nn(),dirty:l,skip_bound:!1,root:t.target||a.$$.root};o&&o(u.root);let f=!1;if(u.ctx=n?n(e,t.props||{},(p,h,...m)=>{const d=m.length?m[0]:h;return u.ctx&&r(u.ctx[p],u.ctx[p]=d)&&(!u.skip_bound&&u.bound[p]&&u.bound[p](d),f&&Yi(e,p)),h}):[],u.update(),f=!0,Ee(u.before_update),u.fragment=i?i(u.ctx):!1,t.target){if(t.hydrate){const p=qi(t.target);u.fragment&&u.fragment.l(p),p.forEach(_)}else u.fragment&&u.fragment.c();t.intro&&w(e.$$.fragment),O(e,t.target,t.anchor),ci()}st(a)}class Y{constructor(){Ft(this,"$$");Ft(this,"$$set")}$destroy(){M(this,1),this.$destroy=G}$on(t,n){if(!Qe(n))return G;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(t){this.$$set&&!Vi(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Ki="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ki);function Vt(e){window.runtime.LogError(e)}function wt(e){window.runtime.BrowserOpenURL(e)}function er(){window.runtime.Quit()}function tr(e,t){return window.go.main.App.AddSnippet(e,t)}function nr(){return window.go.main.App.CustomShortcutsEnabled()}function ir(){return window.go.main.App.DaemonInstalled()}function rr(e,t){return window.go.main.App.DeleteCustomShortcut(e,t)}function sr(){return window.go.main.App.ExportSnippets()}function or(){return window.go.main.App.GetAllSnippets()}function lr(){return window.go.main.App.GetAutoexpandStatus()}function ar(){return window.go.main.App.GetAutostartStatus()}function ur(e){return window.go.main.App.GetCustomShortcutBinding(e)}function hi(e){return window.go.main.App.GetSetting(e)}function pi(e){return window.go.main.App.GetSnippetWithAbbreviation(e)}function fr(e){return window.go.main.App.GetSnippetWithID(e)}function cr(e,t){return window.go.main.App.GetSnippets(e,t)}function hr(){return window.go.main.App.GetVersion()}function mi(e){return window.go.main.App.ImportSnippets(e)}function pr(e){return window.go.main.App.NilUUID(e)}function mr(e,t){return window.go.main.App.PasteSnippetAndQuit(e,t)}function dr(e){return window.go.main.App.Ping(e)}function _r(e){return window.go.main.App.RemoveSnippet(e)}function gr(e,t,n,i){return window.go.main.App.SaveCustomShortcut(e,t,n,i)}function br(e,t){return window.go.main.App.SaveSetting(e,t)}function vr(){return window.go.main.App.SearchAndPasteMode()}function oe(e,t){return window.go.main.App.ShowError(e,t)}function wr(){return window.go.main.App.StartDaemon()}function Er(e){return window.go.main.App.UpdateAutoexpand(e)}function yr(e){return window.go.main.App.UpdateAutostart(e)}function Sr(e,t){return window.go.main.App.UpdateSnippetWithID(e,t)}const Re=[];function di(e,t){return{subscribe:Te(e,t).subscribe}}function Te(e,t=G){let n;const i=new Set;function r(l){if(Z(e,l)&&(e=l,n)){const a=!Re.length;for(const u of i)u[1](),Re.push(u,e);if(a){for(let u=0;u<Re.length;u+=2)Re[u][0](Re[u+1]);Re.length=0}}}function s(l){r(l(e))}function o(l,a=G){const u=[l,a];return i.add(u),i.size===1&&(n=t(r,s)||G),l(e),()=>{i.delete(u),i.size===0&&n&&(n(),n=null)}}return{set:r,update:s,subscribe:o}}function Le(e,t,n){const i=!Array.isArray(e),r=i?[e]:e;if(!r.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=t.length<2;return di(n,(o,l)=>{let a=!1;const u=[];let f=0,p=G;const h=()=>{if(f)return;p();const d=t(i?u[0]:u,o,l);s?o(d):p=Qe(d)?d:G},m=r.map((d,b)=>mn(d,I=>{u[b]=I,f&=~(1<<b),a&&h()},()=>{f|=1<<b}));return a=!0,h(),function(){Ee(m),p(),a=!1}})}function kr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ar=function(t){return Br(t)&&!Tr(t)};function Br(e){return!!e&&typeof e=="object"}function Tr(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Cr(e)}var Ir=typeof Symbol=="function"&&Symbol.for,Hr=Ir?Symbol.for("react.element"):60103;function Cr(e){return e.$$typeof===Hr}function Lr(e){return Array.isArray(e)?[]:{}}function ft(e,t){return t.clone!==!1&&t.isMergeableObject(e)?We(Lr(e),e,t):e}function Nr(e,t,n){return e.concat(t).map(function(i){return ft(i,n)})}function Pr(e,t){if(!t.customMerge)return We;var n=t.customMerge(e);return typeof n=="function"?n:We}function Or(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Mn(e){return Object.keys(e).concat(Or(e))}function _i(e,t){try{return t in e}catch{return!1}}function Mr(e,t){return _i(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function xr(e,t,n){var i={};return n.isMergeableObject(e)&&Mn(e).forEach(function(r){i[r]=ft(e[r],n)}),Mn(t).forEach(function(r){Mr(e,r)||(_i(e,r)&&n.isMergeableObject(t[r])?i[r]=Pr(r,n)(e[r],t[r],n):i[r]=ft(t[r],n))}),i}function We(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||Nr,n.isMergeableObject=n.isMergeableObject||Ar,n.cloneUnlessOtherwiseSpecified=ft;var i=Array.isArray(t),r=Array.isArray(e),s=i===r;return s?i?n.arrayMerge(e,t,n):xr(e,t,n):ft(t,n)}We.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(i,r){return We(i,r,n)},{})};var Rr=We,Ur=Rr;const Dr=kr(Ur);var rn=function(e,t){return rn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},rn(e,t)};function Lt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");rn(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ee=function(){return ee=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ee.apply(this,arguments)};function Wt(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,s;i<r;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))}var q;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(q||(q={}));var se;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(se||(se={}));var Xe;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(Xe||(Xe={}));function xn(e){return e.type===se.literal}function Gr(e){return e.type===se.argument}function gi(e){return e.type===se.number}function bi(e){return e.type===se.date}function vi(e){return e.type===se.time}function wi(e){return e.type===se.select}function Ei(e){return e.type===se.plural}function $r(e){return e.type===se.pound}function yi(e){return e.type===se.tag}function Si(e){return!!(e&&typeof e=="object"&&e.type===Xe.number)}function sn(e){return!!(e&&typeof e=="object"&&e.type===Xe.dateTime)}var ki=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,jr=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function Fr(e){var t={};return e.replace(jr,function(n){var i=n.length;switch(n[0]){case"G":t.era=i===4?"long":i===5?"narrow":"short";break;case"y":t.year=i===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][i-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][i-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=i===4?"short":i===5?"narrow":"short";break;case"e":if(i<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][i-4];break;case"c":if(i<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][i-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][i-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][i-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][i-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][i-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][i-1];break;case"s":t.second=["numeric","2-digit"][i-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=i<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var zr=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function Vr(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(zr).filter(function(h){return h.length>0}),n=[],i=0,r=t;i<r.length;i++){var s=r[i],o=s.split("/");if(o.length===0)throw new Error("Invalid number skeleton");for(var l=o[0],a=o.slice(1),u=0,f=a;u<f.length;u++){var p=f[u];if(p.length===0)throw new Error("Invalid number skeleton")}n.push({stem:l,options:a})}return n}function Wr(e){return e.replace(/^(.*?)-/,"")}var Rn=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Ai=/^(@+)?(\+|#+)?[rs]?$/g,Xr=/(\*)(0+)|(#+)(0+)|(0+)/g,Bi=/^(0+)$/;function Un(e){var t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace(Ai,function(n,i,r){return typeof r!="string"?(t.minimumSignificantDigits=i.length,t.maximumSignificantDigits=i.length):r==="+"?t.minimumSignificantDigits=i.length:i[0]==="#"?t.maximumSignificantDigits=i.length:(t.minimumSignificantDigits=i.length,t.maximumSignificantDigits=i.length+(typeof r=="string"?r.length:0)),""}),t}function Ti(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function qr(e){var t;if(e[0]==="E"&&e[1]==="E"?(t={notation:"engineering"},e=e.slice(2)):e[0]==="E"&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if(n==="+!"?(t.signDisplay="always",e=e.slice(2)):n==="+?"&&(t.signDisplay="exceptZero",e=e.slice(2)),!Bi.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function Dn(e){var t={},n=Ti(e);return n||t}function Zr(e){for(var t={},n=0,i=e;n<i.length;n++){var r=i[n];switch(r.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=r.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=Wr(r.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=ee(ee(ee({},t),{notation:"scientific"}),r.options.reduce(function(a,u){return ee(ee({},a),Dn(u))},{}));continue;case"engineering":t=ee(ee(ee({},t),{notation:"engineering"}),r.options.reduce(function(a,u){return ee(ee({},a),Dn(u))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(r.options[0]);continue;case"integer-width":if(r.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace(Xr,function(a,u,f,p,h,m){if(u)t.minimumIntegerDigits=f.length;else{if(p&&h)throw new Error("We currently do not support maximum integer digits");if(m)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Bi.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(Rn.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(Rn,function(a,u,f,p,h,m){return f==="*"?t.minimumFractionDigits=u.length:p&&p[0]==="#"?t.maximumFractionDigits=p.length:h&&m?(t.minimumFractionDigits=h.length,t.maximumFractionDigits=h.length+m.length):(t.minimumFractionDigits=u.length,t.maximumFractionDigits=u.length),""});var s=r.options[0];s==="w"?t=ee(ee({},t),{trailingZeroDisplay:"stripIfInteger"}):s&&(t=ee(ee({},t),Un(s)));continue}if(Ai.test(r.stem)){t=ee(ee({},t),Un(r.stem));continue}var o=Ti(r.stem);o&&(t=ee(ee({},t),o));var l=qr(r.stem);l&&(t=ee(ee({},t),l))}return t}var Et={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function Qr(e,t){for(var n="",i=0;i<e.length;i++){var r=e.charAt(i);if(r==="j"){for(var s=0;i+1<e.length&&e.charAt(i+1)===r;)s++,i++;var o=1+(s&1),l=s<2?1:3+(s>>1),a="a",u=Jr(t);for((u=="H"||u=="k")&&(l=0);l-- >0;)n+=a;for(;o-- >0;)n=u+n}else r==="J"?n+="H":n+=r}return n}function Jr(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n=e.language,i;n!=="root"&&(i=e.maximize().region);var r=Et[i||""]||Et[n||""]||Et["".concat(n,"-001")]||Et["001"];return r[0]}var Xt,Yr=new RegExp("^".concat(ki.source,"*")),Kr=new RegExp("".concat(ki.source,"*$"));function Q(e,t){return{start:e,end:t}}var es=!!String.prototype.startsWith,ts=!!String.fromCodePoint,ns=!!Object.fromEntries,is=!!String.prototype.codePointAt,rs=!!String.prototype.trimStart,ss=!!String.prototype.trimEnd,os=!!Number.isSafeInteger,ls=os?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},on=!0;try{var as=Hi("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");on=((Xt=as.exec("a"))===null||Xt===void 0?void 0:Xt[0])==="a"}catch{on=!1}var Gn=es?function(t,n,i){return t.startsWith(n,i)}:function(t,n,i){return t.slice(i,i+n.length)===n},ln=ts?String.fromCodePoint:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i="",r=t.length,s=0,o;r>s;){if(o=t[s++],o>1114111)throw RangeError(o+" is not a valid code point");i+=o<65536?String.fromCharCode(o):String.fromCharCode(((o-=65536)>>10)+55296,o%1024+56320)}return i},$n=ns?Object.fromEntries:function(t){for(var n={},i=0,r=t;i<r.length;i++){var s=r[i],o=s[0],l=s[1];n[o]=l}return n},Ii=is?function(t,n){return t.codePointAt(n)}:function(t,n){var i=t.length;if(!(n<0||n>=i)){var r=t.charCodeAt(n),s;return r<55296||r>56319||n+1===i||(s=t.charCodeAt(n+1))<56320||s>57343?r:(r-55296<<10)+(s-56320)+65536}},us=rs?function(t){return t.trimStart()}:function(t){return t.replace(Yr,"")},fs=ss?function(t){return t.trimEnd()}:function(t){return t.replace(Kr,"")};function Hi(e,t){return new RegExp(e,t)}var an;if(on){var jn=Hi("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");an=function(t,n){var i;jn.lastIndex=n;var r=jn.exec(t);return(i=r[1])!==null&&i!==void 0?i:""}}else an=function(t,n){for(var i=[];;){var r=Ii(t,n);if(r===void 0||Ci(r)||ms(r))break;i.push(r),n+=r>=65536?2:1}return ln.apply(void 0,i)};var cs=function(){function e(t,n){n===void 0&&(n={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.locale=n.locale,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,n,i){for(var r=[];!this.isEOF();){var s=this.char();if(s===123){var o=this.parseArgument(t,i);if(o.err)return o;r.push(o.val)}else{if(s===125&&t>0)break;if(s===35&&(n==="plural"||n==="selectordinal")){var l=this.clonePosition();this.bump(),r.push({type:se.pound,location:Q(l,this.clonePosition())})}else if(s===60&&!this.ignoreTag&&this.peek()===47){if(i)break;return this.error(q.UNMATCHED_CLOSING_TAG,Q(this.clonePosition(),this.clonePosition()))}else if(s===60&&!this.ignoreTag&&un(this.peek()||0)){var o=this.parseTag(t,n);if(o.err)return o;r.push(o.val)}else{var o=this.parseLiteral(t,n);if(o.err)return o;r.push(o.val)}}}return{val:r,err:null}},e.prototype.parseTag=function(t,n){var i=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:se.literal,value:"<".concat(r,"/>"),location:Q(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var s=this.parseMessage(t+1,n,!0);if(s.err)return s;var o=s.val,l=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!un(this.char()))return this.error(q.INVALID_TAG,Q(l,this.clonePosition()));var a=this.clonePosition(),u=this.parseTagName();return r!==u?this.error(q.UNMATCHED_CLOSING_TAG,Q(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:se.tag,value:r,children:o,location:Q(i,this.clonePosition())},err:null}:this.error(q.INVALID_TAG,Q(l,this.clonePosition())))}else return this.error(q.UNCLOSED_TAG,Q(i,this.clonePosition()))}else return this.error(q.INVALID_TAG,Q(i,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&ps(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,n){for(var i=this.clonePosition(),r="";;){var s=this.tryParseQuote(n);if(s){r+=s;continue}var o=this.tryParseUnquoted(t,n);if(o){r+=o;continue}var l=this.tryParseLeftAngleBracket();if(l){r+=l;continue}break}var a=Q(i,this.clonePosition());return{val:{type:se.literal,value:r,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!hs(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var n=[this.char()];for(this.bump();!this.isEOF();){var i=this.char();if(i===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(i);this.bump()}return ln.apply(void 0,n)},e.prototype.tryParseUnquoted=function(t,n){if(this.isEOF())return null;var i=this.char();return i===60||i===123||i===35&&(n==="plural"||n==="selectordinal")||i===125&&t>0?null:(this.bump(),ln(i))},e.prototype.parseArgument=function(t,n){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Q(i,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(q.EMPTY_ARGUMENT,Q(i,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(q.MALFORMED_ARGUMENT,Q(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Q(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:se.argument,value:r,location:Q(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Q(i,this.clonePosition())):this.parseArgumentOptions(t,n,r,i);default:return this.error(q.MALFORMED_ARGUMENT,Q(i,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),n=this.offset(),i=an(this.message,n),r=n+i.length;this.bumpTo(r);var s=this.clonePosition(),o=Q(t,s);return{value:i,location:o}},e.prototype.parseArgumentOptions=function(t,n,i,r){var s,o=this.clonePosition(),l=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(l){case"":return this.error(q.EXPECT_ARGUMENT_TYPE,Q(o,a));case"number":case"date":case"time":{this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var f=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var h=fs(p.val);if(h.length===0)return this.error(q.EXPECT_ARGUMENT_STYLE,Q(this.clonePosition(),this.clonePosition()));var m=Q(f,this.clonePosition());u={style:h,styleLocation:m}}var d=this.tryParseArgumentClose(r);if(d.err)return d;var b=Q(r,this.clonePosition());if(u&&Gn(u==null?void 0:u.style,"::",0)){var I=us(u.style.slice(2));if(l==="number"){var p=this.parseNumberSkeletonFromString(I,u.styleLocation);return p.err?p:{val:{type:se.number,value:i,location:b,style:p.val},err:null}}else{if(I.length===0)return this.error(q.EXPECT_DATE_TIME_SKELETON,b);var B=I;this.locale&&(B=Qr(I,this.locale));var h={type:Xe.dateTime,pattern:B,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?Fr(B):{}},E=l==="date"?se.date:se.time;return{val:{type:E,value:i,location:b,style:h},err:null}}}return{val:{type:l==="number"?se.number:l==="date"?se.date:se.time,value:i,location:b,style:(s=u==null?void 0:u.style)!==null&&s!==void 0?s:null},err:null}}case"plural":case"selectordinal":case"select":{var H=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(q.EXPECT_SELECT_ARGUMENT_OPTIONS,Q(H,ee({},H)));this.bumpSpace();var y=this.parseIdentifierIfPossible(),T=0;if(l!=="select"&&y.value==="offset"){if(!this.bumpIf(":"))return this.error(q.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Q(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(q.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,q.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),y=this.parseIdentifierIfPossible(),T=p.val}var N=this.tryParsePluralOrSelectOptions(t,l,n,y);if(N.err)return N;var d=this.tryParseArgumentClose(r);if(d.err)return d;var k=Q(r,this.clonePosition());return l==="select"?{val:{type:se.select,value:i,options:$n(N.val),location:k},err:null}:{val:{type:se.plural,value:i,options:$n(N.val),offset:T,pluralType:l==="plural"?"cardinal":"ordinal",location:k},err:null}}default:return this.error(q.INVALID_ARGUMENT_TYPE,Q(o,a))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Q(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,n=this.clonePosition();!this.isEOF();){var i=this.char();switch(i){case 39:{this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(q.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Q(r,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(n.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(n.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,n){var i=[];try{i=Vr(t)}catch{return this.error(q.INVALID_NUMBER_SKELETON,n)}return{val:{type:Xe.number,tokens:i,location:n,parsedOptions:this.shouldParseSkeletons?Zr(i):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,n,i,r){for(var s,o=!1,l=[],a=new Set,u=r.value,f=r.location;;){if(u.length===0){var p=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var h=this.tryParseDecimalInteger(q.EXPECT_PLURAL_ARGUMENT_SELECTOR,q.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;f=Q(p,this.clonePosition()),u=this.message.slice(p.offset,this.offset())}else break}if(a.has(u))return this.error(n==="select"?q.DUPLICATE_SELECT_ARGUMENT_SELECTOR:q.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,f);u==="other"&&(o=!0),this.bumpSpace();var m=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?q.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:q.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Q(this.clonePosition(),this.clonePosition()));var d=this.parseMessage(t+1,n,i);if(d.err)return d;var b=this.tryParseArgumentClose(m);if(b.err)return b;l.push([u,{value:d.val,location:Q(m,this.clonePosition())}]),a.add(u),this.bumpSpace(),s=this.parseIdentifierIfPossible(),u=s.value,f=s.location}return l.length===0?this.error(n==="select"?q.EXPECT_SELECT_ARGUMENT_SELECTOR:q.EXPECT_PLURAL_ARGUMENT_SELECTOR,Q(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(q.MISSING_OTHER_CLAUSE,Q(this.clonePosition(),this.clonePosition())):{val:l,err:null}},e.prototype.tryParseDecimalInteger=function(t,n){var i=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var s=!1,o=0;!this.isEOF();){var l=this.char();if(l>=48&&l<=57)s=!0,o=o*10+(l-48),this.bump();else break}var a=Q(r,this.clonePosition());return s?(o*=i,ls(o)?{val:o,err:null}:this.error(n,a)):this.error(t,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var n=Ii(this.message,t);if(n===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return n},e.prototype.error=function(t,n){return{val:null,err:{kind:t,message:this.message,location:n}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(Gn(this.message,t,this.offset())){for(var n=0;n<t.length;n++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(t){var n=this.offset(),i=this.message.indexOf(t,n);return i>=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var n=this.offset();if(n===t)break;if(n>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Ci(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),n=this.offset(),i=this.message.charCodeAt(n+(t>=65536?2:1));return i??null},e}();function un(e){return e>=97&&e<=122||e>=65&&e<=90}function hs(e){return un(e)||e===47}function ps(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Ci(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function ms(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function fn(e){e.forEach(function(t){if(delete t.location,wi(t)||Ei(t))for(var n in t.options)delete t.options[n].location,fn(t.options[n].value);else gi(t)&&Si(t.style)||(bi(t)||vi(t))&&sn(t.style)?delete t.style.location:yi(t)&&fn(t.children)})}function ds(e,t){t===void 0&&(t={}),t=ee({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new cs(e,t).parse();if(n.err){var i=SyntaxError(q[n.err.kind]);throw i.location=n.err.location,i.originalMessage=n.err.message,i}return t!=null&&t.captureLocation||fn(n.val),n.val}function qt(e,t){var n=t&&t.cache?t.cache:Es,i=t&&t.serializer?t.serializer:ws,r=t&&t.strategy?t.strategy:gs;return r(e,{cache:n,serializer:i})}function _s(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Li(e,t,n,i){var r=_s(i)?i:n(i),s=t.get(r);return typeof s>"u"&&(s=e.call(this,i),t.set(r,s)),s}function Ni(e,t,n){var i=Array.prototype.slice.call(arguments,3),r=n(i),s=t.get(r);return typeof s>"u"&&(s=e.apply(this,i),t.set(r,s)),s}function bn(e,t,n,i,r){return n.bind(t,e,i,r)}function gs(e,t){var n=e.length===1?Li:Ni;return bn(e,this,n,t.cache.create(),t.serializer)}function bs(e,t){return bn(e,this,Ni,t.cache.create(),t.serializer)}function vs(e,t){return bn(e,this,Li,t.cache.create(),t.serializer)}var ws=function(){return JSON.stringify(arguments)};function vn(){this.cache=Object.create(null)}vn.prototype.get=function(e){return this.cache[e]};vn.prototype.set=function(e,t){this.cache[e]=t};var Es={create:function(){return new vn}},Zt={variadic:bs,monadic:vs},qe;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(qe||(qe={}));var Nt=function(e){Lt(t,e);function t(n,i,r){var s=e.call(this,n)||this;return s.code=i,s.originalMessage=r,s}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),Fn=function(e){Lt(t,e);function t(n,i,r,s){return e.call(this,'Invalid values for "'.concat(n,'": "').concat(i,'". Options are "').concat(Object.keys(r).join('", "'),'"'),qe.INVALID_VALUE,s)||this}return t}(Nt),ys=function(e){Lt(t,e);function t(n,i,r){return e.call(this,'Value for "'.concat(n,'" must be of type ').concat(i),qe.INVALID_VALUE,r)||this}return t}(Nt),Ss=function(e){Lt(t,e);function t(n,i){return e.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(i,'"'),qe.MISSING_VALUE,i)||this}return t}(Nt),me;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(me||(me={}));function ks(e){return e.length<2?e:e.reduce(function(t,n){var i=t[t.length-1];return!i||i.type!==me.literal||n.type!==me.literal?t.push(n):i.value+=n.value,t},[])}function As(e){return typeof e=="function"}function St(e,t,n,i,r,s,o){if(e.length===1&&xn(e[0]))return[{type:me.literal,value:e[0].value}];for(var l=[],a=0,u=e;a<u.length;a++){var f=u[a];if(xn(f)){l.push({type:me.literal,value:f.value});continue}if($r(f)){typeof s=="number"&&l.push({type:me.literal,value:n.getNumberFormat(t).format(s)});continue}var p=f.value;if(!(r&&p in r))throw new Ss(p,o);var h=r[p];if(Gr(f)){(!h||typeof h=="string"||typeof h=="number")&&(h=typeof h=="string"||typeof h=="number"?String(h):""),l.push({type:typeof h=="string"?me.literal:me.object,value:h});continue}if(bi(f)){var m=typeof f.style=="string"?i.date[f.style]:sn(f.style)?f.style.parsedOptions:void 0;l.push({type:me.literal,value:n.getDateTimeFormat(t,m).format(h)});continue}if(vi(f)){var m=typeof f.style=="string"?i.time[f.style]:sn(f.style)?f.style.parsedOptions:i.time.medium;l.push({type:me.literal,value:n.getDateTimeFormat(t,m).format(h)});continue}if(gi(f)){var m=typeof f.style=="string"?i.number[f.style]:Si(f.style)?f.style.parsedOptions:void 0;m&&m.scale&&(h=h*(m.scale||1)),l.push({type:me.literal,value:n.getNumberFormat(t,m).format(h)});continue}if(yi(f)){var d=f.children,b=f.value,I=r[b];if(!As(I))throw new ys(b,"function",o);var B=St(d,t,n,i,r,s),E=I(B.map(function(T){return T.value}));Array.isArray(E)||(E=[E]),l.push.apply(l,E.map(function(T){return{type:typeof T=="string"?me.literal:me.object,value:T}}))}if(wi(f)){var H=f.options[h]||f.options.other;if(!H)throw new Fn(f.value,h,Object.keys(f.options),o);l.push.apply(l,St(H.value,t,n,i,r));continue}if(Ei(f)){var H=f.options["=".concat(h)];if(!H){if(!Intl.PluralRules)throw new Nt(`Intl.PluralRules is not available in this environment.
Try polyfilling it using "@formatjs/intl-pluralrules"
`,qe.MISSING_INTL_API,o);var y=n.getPluralRules(t,{type:f.pluralType}).select(h-(f.offset||0));H=f.options[y]||f.options.other}if(!H)throw new Fn(f.value,h,Object.keys(f.options),o);l.push.apply(l,St(H.value,t,n,i,r,h-(f.offset||0)));continue}}return ks(l)}function Bs(e,t){return t?ee(ee(ee({},e||{}),t||{}),Object.keys(e).reduce(function(n,i){return n[i]=ee(ee({},e[i]),t[i]||{}),n},{})):e}function Ts(e,t){return t?Object.keys(e).reduce(function(n,i){return n[i]=Bs(e[i],t[i]),n},ee({},e)):e}function Qt(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function Is(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:qt(function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return new((t=Intl.NumberFormat).bind.apply(t,Wt([void 0],n,!1)))},{cache:Qt(e.number),strategy:Zt.variadic}),getDateTimeFormat:qt(function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return new((t=Intl.DateTimeFormat).bind.apply(t,Wt([void 0],n,!1)))},{cache:Qt(e.dateTime),strategy:Zt.variadic}),getPluralRules:qt(function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return new((t=Intl.PluralRules).bind.apply(t,Wt([void 0],n,!1)))},{cache:Qt(e.pluralRules),strategy:Zt.variadic})}}var Hs=function(){function e(t,n,i,r){var s=this;if(n===void 0&&(n=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(o){var l=s.formatToParts(o);if(l.length===1)return l[0].value;var a=l.reduce(function(u,f){return!u.length||f.type!==me.literal||typeof u[u.length-1]!="string"?u.push(f.value):u[u.length-1]+=f.value,u},[]);return a.length<=1?a[0]||"":a},this.formatToParts=function(o){return St(s.ast,s.locales,s.formatters,s.formats,o,void 0,s.message)},this.resolvedOptions=function(){return{locale:s.resolvedLocale.toString()}},this.getAst=function(){return s.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=e.__parse(t,{ignoreTag:r==null?void 0:r.ignoreTag,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Ts(e.formats,i),this.formatters=r&&r.formatters||Is(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(t){var n=Intl.NumberFormat.supportedLocalesOf(t);return n.length>0?new Intl.Locale(n[0]):new Intl.Locale(typeof t=="string"?t:t[0])},e.__parse=ds,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();const Ce={},Cs=(e,t,n)=>n&&(t in Ce||(Ce[t]={}),e in Ce[t]||(Ce[t][e]=n),n),Pi=(e,t)=>{if(t==null)return;if(t in Ce&&e in Ce[t])return Ce[t][e];const n=gt(t);for(let i=0;i<n.length;i++){const r=Ls(n[i],e);if(r)return Cs(e,t,r)}};let wn;const Ye=Te({});function En(e){return e in wn}function Ls(e,t){if(!En(e))return null;const n=function(i){return wn[i]||null}(e);return function(i,r){if(r==null)return;if(r in i)return i[r];const s=r.split(".");let o=i;for(let l=0;l<s.length;l++)if(typeof o=="object"){if(l>0){const a=s.slice(l,s.length).join(".");if(a in o){o=o[a];break}}o=o[s[l]]}else o=void 0;return o}(n,t)}function Ns(e,...t){delete Ce[e],Ye.update(n=>(n[e]=Dr.all([n[e]||{},...t]),n))}Le([Ye],([e])=>Object.keys(e));Ye.subscribe(e=>wn=e);const ot={};function lt(e){return ot[e]}function It(e){return e!=null&&gt(e).some(t=>{var n;return(n=lt(t))===null||n===void 0?void 0:n.size})}function Ps(e,t){return Promise.all(t.map(i=>(function(r,s){ot[r].delete(s),ot[r].size===0&&delete ot[r]}(e,i),i().then(r=>r.default||r)))).then(i=>Ns(e,...i))}const nt={};function Oi(e){if(!It(e))return e in nt?nt[e]:Promise.resolve();const t=function(n){return gt(n).map(i=>{const r=lt(i);return[i,r?[...r]:[]]}).filter(([,i])=>i.length>0)}(e);return nt[e]=Promise.all(t.map(([n,i])=>Ps(n,i))).then(()=>{if(It(e))return Oi(e);delete nt[e]}),nt[e]}function Os(e,t){lt(e)||function(i){ot[i]=new Set}(e);const n=lt(e);lt(e).has(t)||(En(e)||Ye.update(i=>(i[e]={},i)),n.add(t))}function Ms({locale:e,id:t}){console.warn(`[svelte-i18n] The message "${t}" was not found in "${gt(e).join('", "')}".${It(Ne())?`

Note: there are at least one loader still registered to this locale that wasn't executed.`:""}`)}const it={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function Ze(){return it}function xs(e){const{formats:t,...n}=e,i=e.initialLocale||e.fallbackLocale;return n.warnOnMissingMessages&&(delete n.warnOnMissingMessages,n.handleMissingMessage==null?n.handleMissingMessage=Ms:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(it,n,{initialLocale:i}),t&&("number"in t&&Object.assign(it.formats.number,t.number),"date"in t&&Object.assign(it.formats.date,t.date),"time"in t&&Object.assign(it.formats.time,t.time)),Ke.set(i)}const kt=Te(!1);let cn;const At=Te(null);function zn(e){return e.split("-").map((t,n,i)=>i.slice(0,n+1).join("-")).reverse()}function gt(e,t=Ze().fallbackLocale){const n=zn(e);return t?[...new Set([...n,...zn(t)])]:n}function Ne(){return cn??void 0}At.subscribe(e=>{cn=e??void 0,typeof window<"u"&&e!=null&&document.documentElement.setAttribute("lang",e)});const Ke={...At,set:e=>{if(e&&function(t){if(t==null)return;const n=gt(t);for(let i=0;i<n.length;i++){const r=n[i];if(En(r))return r}}(e)&&It(e)){const{loadingDelay:t}=Ze();let n;return typeof window<"u"&&Ne()!=null&&t?n=window.setTimeout(()=>kt.set(!0),t):kt.set(!0),Oi(e).then(()=>{At.set(e)}).finally(()=>{clearTimeout(n),kt.set(!1)})}return At.set(e)}},Rs=()=>typeof window>"u"?null:window.navigator.language||window.navigator.languages[0],Pt=e=>{const t=Object.create(null);return n=>{const i=JSON.stringify(n);return i in t?t[i]:t[i]=e(n)}},ct=(e,t)=>{const{formats:n}=Ze();if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},Us=Pt(({locale:e,format:t,...n})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return t&&(n=ct("number",t)),new Intl.NumberFormat(e,n)}),Ds=Pt(({locale:e,format:t,...n})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return t?n=ct("date",t):Object.keys(n).length===0&&(n=ct("date","short")),new Intl.DateTimeFormat(e,n)}),Gs=Pt(({locale:e,format:t,...n})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return t?n=ct("time",t):Object.keys(n).length===0&&(n=ct("time","short")),new Intl.DateTimeFormat(e,n)}),$s=({locale:e=Ne(),...t}={})=>Us({locale:e,...t}),js=({locale:e=Ne(),...t}={})=>Ds({locale:e,...t}),Fs=({locale:e=Ne(),...t}={})=>Gs({locale:e,...t}),zs=Pt((e,t=Ne())=>new Hs(e,t,Ze().formats,{ignoreTag:Ze().ignoreTag})),Vs=(e,t={})=>{var n,i,r,s;let o=t;typeof e=="object"&&(o=e,e=o.id);const{values:l,locale:a=Ne(),default:u}=o;if(a==null)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let f=Pi(e,a);if(f){if(typeof f!="string")return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof f}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),f}else f=(s=(r=(i=(n=Ze()).handleMissingMessage)===null||i===void 0?void 0:i.call(n,{locale:a,id:e,defaultValue:u}))!==null&&r!==void 0?r:u)!==null&&s!==void 0?s:e;if(!l)return f;let p=f;try{p=zs(f,a).format(l)}catch(h){h instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,h.message)}return p},Ws=(e,t)=>Fs(t).format(e),Xs=(e,t)=>js(t).format(e),qs=(e,t)=>$s(t).format(e),Zs=(e,t=Ne())=>Pi(e,t),Se=Le([Ke,Ye],()=>Vs);Le([Ke],()=>Ws);Le([Ke],()=>Xs);Le([Ke],()=>qs);Le([Ke,Ye],()=>Zs);function Qs(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,i,r,s,o=[],l="",a=e.split("/");for(a[0]||a.shift();r=a.shift();)n=r[0],n==="*"?(o.push("wild"),l+="/(.*)"):n===":"?(i=r.indexOf("?",1),s=r.indexOf(".",1),o.push(r.substring(1,~i?i:~s?s:r.length)),l+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(l+=(~i?"?":"")+"\\"+r.substring(s))):l+="/"+r;return{keys:o,pattern:new RegExp("^"+l+(t?"(?=$|/)":"/?$"),"i")}}function Js(e){let t,n,i;const r=[e[2]];var s=e[0];function o(l,a){let u={};if(a!==void 0&&a&4)u=Bt(r,[Tt(l[2])]);else for(let f=0;f<r.length;f+=1)u=pn(u,r[f]);return{props:u}}return s&&(t=Ve(s,o(e)),t.$on("routeEvent",e[7])),{c(){t&&U(t.$$.fragment),n=ye()},m(l,a){t&&O(t,l,a),g(l,n,a),i=!0},p(l,a){if(a&1&&s!==(s=l[0])){if(t){ue();const u=t;S(u.$$.fragment,1,0,()=>{M(u,1)}),fe()}s?(t=Ve(s,o(l,a)),t.$on("routeEvent",l[7]),U(t.$$.fragment),w(t.$$.fragment,1),O(t,n.parentNode,n)):t=null}else if(s){const u=a&4?Bt(r,[Tt(l[2])]):{};t.$set(u)}},i(l){i||(t&&w(t.$$.fragment,l),i=!0)},o(l){t&&S(t.$$.fragment,l),i=!1},d(l){l&&_(n),t&&M(t,l)}}}function Ys(e){let t,n,i;const r=[{params:e[1]},e[2]];var s=e[0];function o(l,a){let u={};if(a!==void 0&&a&6)u=Bt(r,[a&2&&{params:l[1]},a&4&&Tt(l[2])]);else for(let f=0;f<r.length;f+=1)u=pn(u,r[f]);return{props:u}}return s&&(t=Ve(s,o(e)),t.$on("routeEvent",e[6])),{c(){t&&U(t.$$.fragment),n=ye()},m(l,a){t&&O(t,l,a),g(l,n,a),i=!0},p(l,a){if(a&1&&s!==(s=l[0])){if(t){ue();const u=t;S(u.$$.fragment,1,0,()=>{M(u,1)}),fe()}s?(t=Ve(s,o(l,a)),t.$on("routeEvent",l[6]),U(t.$$.fragment),w(t.$$.fragment,1),O(t,n.parentNode,n)):t=null}else if(s){const u=a&6?Bt(r,[a&2&&{params:l[1]},a&4&&Tt(l[2])]):{};t.$set(u)}},i(l){i||(t&&w(t.$$.fragment,l),i=!0)},o(l){t&&S(t.$$.fragment,l),i=!1},d(l){l&&_(n),t&&M(t,l)}}}function Ks(e){let t,n,i,r;const s=[Ys,Js],o=[];function l(a,u){return a[1]?0:1}return t=l(e),n=o[t]=s[t](e),{c(){n.c(),i=ye()},m(a,u){o[t].m(a,u),g(a,i,u),r=!0},p(a,[u]){let f=t;t=l(a),t===f?o[t].p(a,u):(ue(),S(o[f],1,1,()=>{o[f]=null}),fe(),n=o[t],n?n.p(a,u):(n=o[t]=s[t](a),n.c()),w(n,1),n.m(i.parentNode,i))},i(a){r||(w(n),r=!0)},o(a){S(n),r=!1},d(a){a&&_(i),o[t].d(a)}}}function Vn(){const e=window.location.href.indexOf("#/");let t=e>-1?window.location.href.substr(e+1):"/";const n=t.indexOf("?");let i="";return n>-1&&(i=t.substr(n+1),t=t.substr(0,n)),{location:t,querystring:i}}const yn=di(null,function(t){t(Vn());const n=()=>{t(Vn())};return window.addEventListener("hashchange",n,!1),function(){window.removeEventListener("hashchange",n,!1)}});Le(yn,e=>e.location);Le(yn,e=>e.querystring);const Wn=Te(void 0);async function je(e){if(!e||e.length<1||e.charAt(0)!="/"&&e.indexOf("#/")!==0)throw Error("Invalid parameter location");await gn(),history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=(e.charAt(0)=="#"?"":"#")+e}async function Be(){await gn(),window.history.back()}function eo(e){e?window.scrollTo(e.__svelte_spa_router_scrollX,e.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function to(e,t,n){let{routes:i={}}=t,{prefix:r=""}=t,{restoreScrollState:s=!1}=t;class o{constructor(T,N){if(!N||typeof N!="function"&&(typeof N!="object"||N._sveltesparouter!==!0))throw Error("Invalid component object");if(!T||typeof T=="string"&&(T.length<1||T.charAt(0)!="/"&&T.charAt(0)!="*")||typeof T=="object"&&!(T instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:k,keys:x}=Qs(T);this.path=T,typeof N=="object"&&N._sveltesparouter===!0?(this.component=N.component,this.conditions=N.conditions||[],this.userData=N.userData,this.props=N.props||{}):(this.component=()=>Promise.resolve(N),this.conditions=[],this.props={}),this._pattern=k,this._keys=x}match(T){if(r){if(typeof r=="string")if(T.startsWith(r))T=T.substr(r.length)||"/";else return null;else if(r instanceof RegExp){const v=T.match(r);if(v&&v[0])T=T.substr(v[0].length)||"/";else return null}}const N=this._pattern.exec(T);if(N===null)return null;if(this._keys===!1)return N;const k={};let x=0;for(;x<this._keys.length;){try{k[this._keys[x]]=decodeURIComponent(N[x+1]||"")||null}catch{k[this._keys[x]]=null}x++}return k}async checkConditions(T){for(let N=0;N<this.conditions.length;N++)if(!await this.conditions[N](T))return!1;return!0}}const l=[];i instanceof Map?i.forEach((y,T)=>{l.push(new o(T,y))}):Object.keys(i).forEach(y=>{l.push(new o(y,i[y]))});let a=null,u=null,f={};const p=_t();async function h(y,T){await gn(),p(y,T)}let m=null,d=null;s&&(d=y=>{y.state&&(y.state.__svelte_spa_router_scrollY||y.state.__svelte_spa_router_scrollX)?m=y.state:m=null},window.addEventListener("popstate",d),ai(()=>{eo(m)}));let b=null,I=null;const B=yn.subscribe(async y=>{b=y;let T=0;for(;T<l.length;){const N=l[T].match(y.location);if(!N){T++;continue}const k={route:l[T].path,location:y.location,querystring:y.querystring,userData:l[T].userData,params:N&&typeof N=="object"&&Object.keys(N).length?N:null};if(!await l[T].checkConditions(k)){n(0,a=null),I=null,h("conditionsFailed",k);return}h("routeLoading",Object.assign({},k));const x=l[T].component;if(I!=x){x.loading?(n(0,a=x.loading),I=x,n(1,u=x.loadingParams),n(2,f={}),h("routeLoaded",Object.assign({},k,{component:a,name:a.name,params:u}))):(n(0,a=null),I=null);const v=await x();if(y!=b)return;n(0,a=v&&v.default||v),I=x}N&&typeof N=="object"&&Object.keys(N).length?n(1,u=N):n(1,u=null),n(2,f=l[T].props),h("routeLoaded",Object.assign({},k,{component:a,name:a.name,params:u})).then(()=>{Wn.set(u)});return}n(0,a=null),I=null,Wn.set(void 0)});_n(()=>{B(),d&&window.removeEventListener("popstate",d)});function E(y){ut.call(this,e,y)}function H(y){ut.call(this,e,y)}return e.$$set=y=>{"routes"in y&&n(3,i=y.routes),"prefix"in y&&n(4,r=y.prefix),"restoreScrollState"in y&&n(5,s=y.restoreScrollState)},e.$$.update=()=>{e.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,r,s,E,H]}class no extends Y{constructor(t){super(),J(this,t,to,Ks,Z,{routes:3,prefix:4,restoreScrollState:5})}}const we=Te(!1),rt=Te(!1),Ht=Te(!1);function Mi(){const{subscribe:e,set:t,update:n}=Te([]);return{subscribe:e,fetch:async()=>{if(!Pn(we))return;const i=await or();n(r=>i)},search:async(i,r)=>{if(!Pn(we))return;const s=await cr(i,r);n(o=>s)},reset:()=>t([])}}const Me=Mi(),Jt=Te(""),Yt=Mi();function io(e){let t,n,i,r;return{c(){t=V("svg"),n=V("polyline"),i=V("polyline"),c(n,"points","11 17 6 12 11 7"),c(i,"points","18 17 13 12 18 7"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",r="feather feather-chevrons-left "+e[2])},m(s,o){g(s,t,o),A(t,n),A(t,i)},p(s,[o]){o&1&&c(t,"width",s[0]),o&1&&c(t,"height",s[0]),o&2&&c(t,"stroke-width",s[1]),o&4&&r!==(r="feather feather-chevrons-left "+s[2])&&c(t,"class",r)},i:G,o:G,d(s){s&&_(t)}}}function ro(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class xi extends Y{constructor(t){super(),J(this,t,ro,io,Z,{size:0,strokeWidth:1,class:2})}}function so(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("path"),i=V("line"),r=V("line"),c(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),c(i,"x1","18"),c(i,"y1","9"),c(i,"x2","12"),c(i,"y2","15"),c(r,"x1","12"),c(r,"y1","9"),c(r,"x2","18"),c(r,"y2","15"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-delete "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-delete "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function oo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class lo extends Y{constructor(t){super(),J(this,t,oo,so,Z,{size:0,strokeWidth:1,class:2})}}function ao(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("path"),i=V("polyline"),r=V("line"),c(n,"d","M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"),c(i,"points","7 10 12 15 17 10"),c(r,"x1","12"),c(r,"y1","15"),c(r,"x2","12"),c(r,"y2","3"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-download "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-download "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function uo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class fo extends Y{constructor(t){super(),J(this,t,uo,ao,Z,{size:0,strokeWidth:1,class:2})}}function co(e){let t,n,i,r;return{c(){t=V("svg"),n=V("path"),i=V("path"),c(n,"d","M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"),c(i,"d","M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",r="feather feather-edit "+e[2])},m(s,o){g(s,t,o),A(t,n),A(t,i)},p(s,[o]){o&1&&c(t,"width",s[0]),o&1&&c(t,"height",s[0]),o&2&&c(t,"stroke-width",s[1]),o&4&&r!==(r="feather feather-edit "+s[2])&&c(t,"class",r)},i:G,o:G,d(s){s&&_(t)}}}function ho(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class po extends Y{constructor(t){super(),J(this,t,ho,co,Z,{size:0,strokeWidth:1,class:2})}}function mo(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("circle"),i=V("path"),r=V("line"),c(n,"cx","12"),c(n,"cy","12"),c(n,"r","10"),c(i,"d","M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"),c(r,"x1","12"),c(r,"y1","17"),c(r,"x2","12.01"),c(r,"y2","17"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-help-circle "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-help-circle "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function _o(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class go extends Y{constructor(t){super(),J(this,t,_o,mo,Z,{size:0,strokeWidth:1,class:2})}}function bo(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("circle"),i=V("line"),r=V("line"),c(n,"cx","12"),c(n,"cy","12"),c(n,"r","10"),c(i,"x1","12"),c(i,"y1","16"),c(i,"x2","12"),c(i,"y2","12"),c(r,"x1","12"),c(r,"y1","8"),c(r,"x2","12.01"),c(r,"y2","8"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-info "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-info "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function vo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class wo extends Y{constructor(t){super(),J(this,t,vo,bo,Z,{size:0,strokeWidth:1,class:2})}}function Eo(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("rect"),i=V("line"),r=V("line"),c(n,"x","3"),c(n,"y","3"),c(n,"width","18"),c(n,"height","18"),c(n,"rx","2"),c(n,"ry","2"),c(i,"x1","12"),c(i,"y1","8"),c(i,"x2","12"),c(i,"y2","16"),c(r,"x1","8"),c(r,"y1","12"),c(r,"x2","16"),c(r,"y2","12"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-plus-square "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-plus-square "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function yo(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Ot extends Y{constructor(t){super(),J(this,t,yo,Eo,Z,{size:0,strokeWidth:1,class:2})}}function So(e){let t,n,i,r;return{c(){t=V("svg"),n=V("circle"),i=V("line"),c(n,"cx","11"),c(n,"cy","11"),c(n,"r","8"),c(i,"x1","21"),c(i,"y1","21"),c(i,"x2","16.65"),c(i,"y2","16.65"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",r="feather feather-search "+e[2])},m(s,o){g(s,t,o),A(t,n),A(t,i)},p(s,[o]){o&1&&c(t,"width",s[0]),o&1&&c(t,"height",s[0]),o&2&&c(t,"stroke-width",s[1]),o&4&&r!==(r="feather feather-search "+s[2])&&c(t,"class",r)},i:G,o:G,d(s){s&&_(t)}}}function ko(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Ao extends Y{constructor(t){super(),J(this,t,ko,So,Z,{size:0,strokeWidth:1,class:2})}}function Bo(e){let t,n,i,r;return{c(){t=V("svg"),n=V("circle"),i=V("path"),c(n,"cx","12"),c(n,"cy","12"),c(n,"r","3"),c(i,"d","M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",r="feather feather-settings "+e[2])},m(s,o){g(s,t,o),A(t,n),A(t,i)},p(s,[o]){o&1&&c(t,"width",s[0]),o&1&&c(t,"height",s[0]),o&2&&c(t,"stroke-width",s[1]),o&4&&r!==(r="feather feather-settings "+s[2])&&c(t,"class",r)},i:G,o:G,d(s){s&&_(t)}}}function To(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Ri extends Y{constructor(t){super(),J(this,t,To,Bo,Z,{size:0,strokeWidth:1,class:2})}}function Io(e){let t,n,i,r,s,o;return{c(){t=V("svg"),n=V("polyline"),i=V("path"),r=V("line"),s=V("line"),c(n,"points","3 6 5 6 21 6"),c(i,"d","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"),c(r,"x1","10"),c(r,"y1","11"),c(r,"x2","10"),c(r,"y2","17"),c(s,"x1","14"),c(s,"y1","11"),c(s,"x2","14"),c(s,"y2","17"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",o="feather feather-trash-2 "+e[2])},m(l,a){g(l,t,a),A(t,n),A(t,i),A(t,r),A(t,s)},p(l,[a]){a&1&&c(t,"width",l[0]),a&1&&c(t,"height",l[0]),a&2&&c(t,"stroke-width",l[1]),a&4&&o!==(o="feather feather-trash-2 "+l[2])&&c(t,"class",o)},i:G,o:G,d(l){l&&_(t)}}}function Ho(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class Co extends Y{constructor(t){super(),J(this,t,Ho,Io,Z,{size:0,strokeWidth:1,class:2})}}function Lo(e){let t,n,i,r,s;return{c(){t=V("svg"),n=V("path"),i=V("polyline"),r=V("line"),c(n,"d","M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"),c(i,"points","17 8 12 3 7 8"),c(r,"x1","12"),c(r,"y1","3"),c(r,"x2","12"),c(r,"y2","15"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"width",e[0]),c(t,"height",e[0]),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke","currentColor"),c(t,"stroke-width",e[1]),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class",s="feather feather-upload "+e[2])},m(o,l){g(o,t,l),A(t,n),A(t,i),A(t,r)},p(o,[l]){l&1&&c(t,"width",o[0]),l&1&&c(t,"height",o[0]),l&2&&c(t,"stroke-width",o[1]),l&4&&s!==(s="feather feather-upload "+o[2])&&c(t,"class",s)},i:G,o:G,d(o){o&&_(t)}}}function No(e,t,n){let{size:i="24"}=t,{strokeWidth:r=2}=t,{class:s=""}=t;return i!=="100%"&&(i=i.slice(-1)==="x"?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=o=>{"size"in o&&n(0,i=o.size),"strokeWidth"in o&&n(1,r=o.strokeWidth),"class"in o&&n(2,s=o.class)},[i,r,s]}class hn extends Y{constructor(t){super(),J(this,t,No,Lo,Z,{size:0,strokeWidth:1,class:2})}}function Po(e){let t,n;const i=e[5].default,r=ht(i,e,e[4],null);return{c(){t=L("p"),r&&r.c(),c(t,"class","svelte-hclhr3"),X(t,"error",e[3]),X(t,"warning",e[0]),X(t,"success",e[1]),X(t,"info",e[2])},m(s,o){g(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&16)&&mt(r,i,s,s[4],n?pt(i,s[4],o,null):dt(s[4]),null),(!n||o&8)&&X(t,"error",s[3]),(!n||o&1)&&X(t,"warning",s[0]),(!n||o&2)&&X(t,"success",s[1]),(!n||o&4)&&X(t,"info",s[2])},i(s){n||(w(r,s),n=!0)},o(s){S(r,s),n=!1},d(s){s&&_(t),r&&r.d(s)}}}function Oo(e,t,n){let{$$slots:i={},$$scope:r}=t,{error:s=!1}=t,{warning:o=!1}=t,{success:l=!1}=t,{info:a=!1}=t;return o=s&&o?!1:o,l=(s||o)&&l?!1:l,a=!(s||o||l),e.$$set=u=>{"error"in u&&n(3,s=u.error),"warning"in u&&n(0,o=u.warning),"success"in u&&n(1,l=u.success),"info"in u&&n(2,a=u.info),"$$scope"in u&&n(4,r=u.$$scope)},[o,l,a,s,r,i]}class Mt extends Y{constructor(t){super(),J(this,t,Oo,Po,Z,{error:3,warning:0,success:1,info:2})}}function Mo(e){let t=e[0]("no_connection")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("no_connection")+"")&&z(n,t)},d(i){i&&_(n)}}}function xo(e){let t,n;return t=new Mt({props:{error:!0,$$slots:{default:[Mo]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&3&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Ro(e,t,n){let i;return ne(e,Se,r=>n(0,i=r)),[i]}class Uo extends Y{constructor(t){super(),J(this,t,Ro,xo,Z,{})}}function Do(e){let t,n,i,r;const s=e[5].default,o=ht(s,e,e[4],null);return{c(){t=L("button"),o&&o.c(),t.disabled=e[3],c(t,"class","svelte-1jbd97"),X(t,"primary",e[0]),X(t,"danger",e[1]),X(t,"secondary",e[2])},m(l,a){g(l,t,a),o&&o.m(t,null),n=!0,i||(r=te(t,"click",e[6]),i=!0)},p(l,[a]){o&&o.p&&(!n||a&16)&&mt(o,s,l,l[4],n?pt(s,l[4],a,null):dt(l[4]),null),(!n||a&8)&&(t.disabled=l[3]),(!n||a&1)&&X(t,"primary",l[0]),(!n||a&2)&&X(t,"danger",l[1]),(!n||a&4)&&X(t,"secondary",l[2])},i(l){n||(w(o,l),n=!0)},o(l){S(o,l),n=!1},d(l){l&&_(t),o&&o.d(l),i=!1,r()}}}function Go(e,t,n){let{$$slots:i={},$$scope:r}=t,{primary:s=!1}=t,{danger:o=!1}=t,{secondary:l=!1}=t,{disabled:a=!1}=t;s=!s&&!l&&!o?!0:s,o=s&&o?!1:o,l=(s||o)&&l?!1:l;function u(f){ut.call(this,e,f)}return e.$$set=f=>{"primary"in f&&n(0,s=f.primary),"danger"in f&&n(1,o=f.danger),"secondary"in f&&n(2,l=f.secondary),"disabled"in f&&n(3,a=f.disabled),"$$scope"in f&&n(4,r=f.$$scope)},[s,o,l,a,r,i,u]}class Fe extends Y{constructor(t){super(),J(this,t,Go,Do,Z,{primary:0,danger:1,secondary:2,disabled:3})}}function $o(e){let t=e[0]("daemon.start")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("daemon.start")+"")&&z(n,t)},d(i){i&&_(n)}}}function jo(e){let t=e[0]("daemon.installed")+"",n,i,r,s;return r=new Fe({props:{$$slots:{default:[$o]},$$scope:{ctx:e}}}),r.$on("click",e[1]),{c(){n=$(t),i=R(),U(r.$$.fragment)},m(o,l){g(o,n,l),g(o,i,l),O(r,o,l),s=!0},p(o,l){(!s||l&1)&&t!==(t=o[0]("daemon.installed")+"")&&z(n,t);const a={};l&5&&(a.$$scope={dirty:l,ctx:o}),r.$set(a)},i(o){s||(w(r.$$.fragment,o),s=!0)},o(o){S(r.$$.fragment,o),s=!1},d(o){o&&(_(n),_(i)),M(r,o)}}}function Fo(e){let t,n;return t=new Mt({props:{warning:!0,$$slots:{default:[jo]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&5&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function zo(e,t,n){let i;ne(e,Se,s=>n(0,i=s));async function r(){Ht.update(s=>!0);try{const s=await wr()}catch(s){await oe(i("daemon.start_error_title"),s),Ht.update(o=>!1)}await Me.fetch()}return[i,r]}class Vo extends Y{constructor(t){super(),J(this,t,zo,Fo,Z,{})}}function Wo(e){let t=e[0]("daemon.not_installed")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("daemon.not_installed")+"")&&z(n,t)},d(i){i&&_(n)}}}function Xo(e){let t,n;return t=new Mt({props:{error:!0,$$slots:{default:[Wo]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&3&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function qo(e,t,n){let i;return ne(e,Se,r=>n(0,i=r)),[i]}class Zo extends Y{constructor(t){super(),J(this,t,qo,Xo,Z,{})}}function Qo(e){let t=e[0]("daemon.starting")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("daemon.starting")+"")&&z(n,t)},d(i){i&&_(n)}}}function Jo(e){let t,n;return t=new Mt({props:{warning:!0,$$slots:{default:[Qo]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&3&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Yo(e,t,n){let i;return ne(e,Se,r=>n(0,i=r)),[i]}class Ko extends Y{constructor(t){super(),J(this,t,Yo,Jo,Z,{})}}function Xn(e){let t,n,i,r,s,o;t=new Uo({});const l=[nl,tl,el],a=[];function u(f,p){return f[2]&&!f[3]?0:f[2]&&f[3]?1:2}return i=u(e),r=a[i]=l[i](e),{c(){U(t.$$.fragment),n=R(),r.c(),s=ye()},m(f,p){O(t,f,p),g(f,n,p),a[i].m(f,p),g(f,s,p),o=!0},p(f,p){let h=i;i=u(f),i!==h&&(ue(),S(a[h],1,1,()=>{a[h]=null}),fe(),r=a[i],r||(r=a[i]=l[i](f),r.c()),w(r,1),r.m(s.parentNode,s))},i(f){o||(w(t.$$.fragment,f),w(r),o=!0)},o(f){S(t.$$.fragment,f),S(r),o=!1},d(f){f&&(_(n),_(s)),M(t,f),a[i].d(f)}}}function el(e){let t,n;return t=new Zo({}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function tl(e){let t,n;return t=new Ko({}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function nl(e){let t,n;return t=new Vo({}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function il(e){let t,n,i,r,s,o=!e[1]&&Xn(e);const l=e[6].default,a=ht(l,e,e[5],null);return{c(){t=L("div"),o&&o.c(),n=R(),a&&a.c(),c(t,"class","screen svelte-i096ea"),X(t,"centered",e[0])},m(u,f){g(u,t,f),o&&o.m(t,null),A(t,n),a&&a.m(t,null),i=!0,r||(s=[te(t,"keyup",e[4]),te(t,"keyup",e[7])],r=!0)},p(u,[f]){u[1]?o&&(ue(),S(o,1,1,()=>{o=null}),fe()):o?(o.p(u,f),f&2&&w(o,1)):(o=Xn(u),o.c(),w(o,1),o.m(t,n)),a&&a.p&&(!i||f&32)&&mt(a,l,u,u[5],i?pt(l,u[5],f,null):dt(u[5]),null),(!i||f&1)&&X(t,"centered",u[0])},i(u){i||(w(o),w(a,u),i=!0)},o(u){S(o),S(a,u),i=!1},d(u){u&&_(t),o&&o.d(),a&&a.d(u),r=!1,Ee(s)}}}function rl(e,t,n){let i,r,s;ne(e,we,h=>n(1,i=h)),ne(e,rt,h=>n(2,r=h)),ne(e,Ht,h=>n(3,s=h));let{$$slots:o={},$$scope:l}=t,{centered:a=!1}=t;const u=_t();function f(h){h.key==="Escape"&&(h.preventDefault(),u("cancel"))}function p(h){ut.call(this,e,h)}return e.$$set=h=>{"centered"in h&&n(0,a=h.centered),"$$scope"in h&&n(5,l=h.$$scope)},[a,i,r,s,f,l,o,p]}class et extends Y{constructor(t){super(),J(this,t,rl,il,Z,{centered:0})}}function sl(e){let t,n,i,r,s,o,l,a;var u=e[0];function f(m,d){return{props:{size:m[2],strokeWidth:m[3]}}}u&&(i=Ve(u,f(e)));const p=e[10].default,h=ht(p,e,e[9],null);return{c(){t=L("div"),n=L("div"),i&&U(i.$$.fragment),s=R(),h&&h.c(),c(n,"class",r="icon-wrapper "+e[1]+" svelte-bhj2u4"),c(t,"class","content svelte-bhj2u4"),c(t,"tabindex","0"),c(t,"title",e[5]),X(t,"centered",e[6]),X(t,"horizontal",e[4])},m(m,d){g(m,t,d),A(t,n),i&&O(i,n,null),A(t,s),h&&h.m(t,null),o=!0,l||(a=[te(t,"click",e[7]),te(t,"keyup",e[8])],l=!0)},p(m,[d]){if(d&1&&u!==(u=m[0])){if(i){ue();const b=i;S(b.$$.fragment,1,0,()=>{M(b,1)}),fe()}u?(i=Ve(u,f(m)),U(i.$$.fragment),w(i.$$.fragment,1),O(i,n,null)):i=null}else if(u){const b={};d&4&&(b.size=m[2]),d&8&&(b.strokeWidth=m[3]),i.$set(b)}(!o||d&2&&r!==(r="icon-wrapper "+m[1]+" svelte-bhj2u4"))&&c(n,"class",r),h&&h.p&&(!o||d&512)&&mt(h,p,m,m[9],o?pt(p,m[9],d,null):dt(m[9]),null),(!o||d&32)&&c(t,"title",m[5]),(!o||d&16)&&X(t,"horizontal",m[4])},i(m){o||(i&&w(i.$$.fragment,m),w(h,m),o=!0)},o(m){i&&S(i.$$.fragment,m),S(h,m),o=!1},d(m){m&&_(t),i&&M(i),h&&h.d(m),l=!1,Ee(a)}}}function ol(e,t,n){let{$$slots:i={},$$scope:r}=t,{icon:s=go}=t,{iconClass:o}=t,{size:l="24"}=t,{strokeWidth:a="2"}=t,{horizontal:u=!1}=t,{title:f=""}=t;const p=!u,h=_t();function m(){h("activate")}function d(b){(b.key==="Enter"||b.key===" ")&&h("activate")}return e.$$set=b=>{"icon"in b&&n(0,s=b.icon),"iconClass"in b&&n(1,o=b.iconClass),"size"in b&&n(2,l=b.size),"strokeWidth"in b&&n(3,a=b.strokeWidth),"horizontal"in b&&n(4,u=b.horizontal),"title"in b&&n(5,f=b.title),"$$scope"in b&&n(9,r=b.$$scope)},[s,o,l,a,u,f,p,m,d,r,i]}class de extends Y{constructor(t){super(),J(this,t,ol,sl,Z,{icon:0,iconClass:1,size:2,strokeWidth:3,horizontal:4,title:5})}}function ll(e,t){t&&setTimeout(()=>{e.focus(),e.select()},250)}function qn(e){let t,n;return{c(){t=L("label"),n=$(e[4]),c(t,"for",e[3])},m(i,r){g(i,t,r),A(t,n)},p(i,r){r&16&&z(n,i[4]),r&8&&c(t,"for",i[3])},d(i){i&&_(t)}}}function Zn(e){let t,n,i,r,s;return n=new Ao({}),{c(){t=L("button"),U(n.$$.fragment),c(t,"class","search-icon svelte-8p6spj"),c(t,"tabindex",-1),c(t,"title",e[6]),X(t,"focussed",e[2])},m(o,l){g(o,t,l),O(n,t,null),i=!0,r||(s=te(t,"click",e[14]),r=!0)},p(o,l){(!i||l&64)&&c(t,"title",o[6]),(!i||l&4)&&X(t,"focussed",o[2])},i(o){i||(w(n.$$.fragment,o),i=!0)},o(o){S(n.$$.fragment,o),i=!1},d(o){o&&_(t),M(n),r=!1,s()}}}function Qn(e){let t,n,i,r,s;return n=new lo({}),{c(){t=L("button"),U(n.$$.fragment),c(t,"class","clear-icon svelte-8p6spj"),c(t,"tabindex",-1),c(t,"title",e[7]),X(t,"focussed",e[2])},m(o,l){g(o,t,l),O(n,t,null),i=!0,r||(s=te(t,"click",e[15]),r=!0)},p(o,l){(!i||l&128)&&c(t,"title",o[7]),(!i||l&4)&&X(t,"focussed",o[2])},i(o){i||(w(n.$$.fragment,o),i=!0)},o(o){S(n.$$.fragment,o),i=!1},d(o){o&&_(t),M(n),r=!1,s()}}}function Jn(e){let t;return{c(){t=L("div"),c(t,"class","error-message svelte-8p6spj")},m(n,i){g(n,t,i),t.innerHTML=e[11]},p(n,i){i&2048&&(t.innerHTML=n[11])},d(n){n&&_(t)}}}function al(e){let t,n,i,r,s,o,l,a,u,f,p,h,m=e[4]&&qn(e),d=e[9]&&Zn(e),b=e[9]&&e[0]&&Qn(e),I=!e[9]&&Jn(e);return{c(){t=L("div"),m&&m.c(),n=R(),i=L("div"),d&&d.c(),r=R(),s=L("input"),l=R(),b&&b.c(),a=R(),I&&I.c(),u=ye(),c(s,"type","text"),c(s,"id",e[3]),c(s,"name",e[3]),c(s,"placeholder",e[5]),c(s,"tabindex",e[10]),c(s,"class","svelte-8p6spj"),X(s,"search",e[9]),X(s,"focussed",e[2]),X(s,"value",e[0]),c(i,"class","input-control svelte-8p6spj"),c(t,"class","input svelte-8p6spj")},m(B,E){g(B,t,E),m&&m.m(t,null),A(t,n),A(t,i),d&&d.m(i,null),A(i,r),A(i,s),ze(s,e[0]),e[18](s),A(i,l),b&&b.m(i,null),g(B,a,E),I&&I.m(B,E),g(B,u,E),f=!0,p||(h=[te(s,"input",e[17]),te(s,"focusin",e[12]),te(s,"focusout",e[13]),dn(o=ll.call(null,s,e[8]))],p=!0)},p(B,[E]){B[4]?m?m.p(B,E):(m=qn(B),m.c(),m.m(t,n)):m&&(m.d(1),m=null),B[9]?d?(d.p(B,E),E&512&&w(d,1)):(d=Zn(B),d.c(),w(d,1),d.m(i,r)):d&&(ue(),S(d,1,1,()=>{d=null}),fe()),(!f||E&8)&&c(s,"id",B[3]),(!f||E&8)&&c(s,"name",B[3]),(!f||E&32)&&c(s,"placeholder",B[5]),(!f||E&1024)&&c(s,"tabindex",B[10]),E&1&&s.value!==B[0]&&ze(s,B[0]),o&&Qe(o.update)&&E&256&&o.update.call(null,B[8]),(!f||E&512)&&X(s,"search",B[9]),(!f||E&4)&&X(s,"focussed",B[2]),(!f||E&1)&&X(s,"value",B[0]),B[9]&&B[0]?b?(b.p(B,E),E&513&&w(b,1)):(b=Qn(B),b.c(),w(b,1),b.m(i,null)):b&&(ue(),S(b,1,1,()=>{b=null}),fe()),B[9]?I&&(I.d(1),I=null):I?I.p(B,E):(I=Jn(B),I.c(),I.m(u.parentNode,u))},i(B){f||(w(d),w(b),f=!0)},o(B){S(d),S(b),f=!1},d(B){B&&(_(t),_(a),_(u)),m&&m.d(),d&&d.d(),e[18](null),b&&b.d(),I&&I.d(B),p=!1,Ee(h)}}}function ul(e,t,n){let i;const r=_t();let{name:s="input"}=t,{label:o=""}=t,{value:l=""}=t,{errorMessage:a=""}=t,{placeholder:u=""}=t,{searchButtonTitle:f=""}=t,{clearButtonTitle:p=""}=t,{autofocus:h=!1}=t,{search:m=!1}=t,{tabindex:d=0}=t,{ref:b}=t,{focussed:I=h}=t;function B(){n(2,I=!0)}function E(){n(2,I=!1)}function H(){r("query",l),document.getElementById(s).focus()}function y(){n(0,l=""),document.getElementById(s).focus()}function T(){l=this.value,n(0,l)}function N(k){ve[k?"unshift":"push"](()=>{b=k,n(1,b)})}return e.$$set=k=>{"name"in k&&n(3,s=k.name),"label"in k&&n(4,o=k.label),"value"in k&&n(0,l=k.value),"errorMessage"in k&&n(16,a=k.errorMessage),"placeholder"in k&&n(5,u=k.placeholder),"searchButtonTitle"in k&&n(6,f=k.searchButtonTitle),"clearButtonTitle"in k&&n(7,p=k.clearButtonTitle),"autofocus"in k&&n(8,h=k.autofocus),"search"in k&&n(9,m=k.search),"tabindex"in k&&n(10,d=k.tabindex),"ref"in k&&n(1,b=k.ref),"focussed"in k&&n(2,I=k.focussed)},e.$$.update=()=>{e.$$.dirty&65536&&n(11,i=a||"&nbsp;")},[l,b,I,s,o,u,f,p,h,m,d,i,B,E,H,y,a,T,N]}class Sn extends Y{constructor(t){super(),J(this,t,ul,al,Z,{name:3,label:4,value:0,errorMessage:16,placeholder:5,searchButtonTitle:6,clearButtonTitle:7,autofocus:8,search:9,tabindex:10,ref:1,focussed:2})}}function Ui(e,t){t&&e.focus()}function fl(e){let t;return{c(){t=$(e[0])},m(n,i){g(n,t,i)},p(n,i){i&1&&z(t,n[0])},d(n){n&&_(t)}}}function cl(e){let t;return{c(){t=$(" ")},m(n,i){g(n,t,i)},p:G,d(n){n&&_(t)}}}function hl(e){let t;function n(s,o){return s[1]?cl:fl}let r=n(e)(e);return{c(){t=L("span"),r.c(),c(t,"class","shortcut-button svelte-11t060e"),X(t,"hide",e[1])},m(s,o){g(s,t,o),r.m(t,null)},p(s,[o]){r.p(s,o)},i:G,o:G,d(s){s&&_(t),r.d()}}}function pl(e,t,n){let{shortcut:i=""}=t;const r=i.length===0;return e.$$set=s=>{"shortcut"in s&&n(0,i=s.shortcut)},[i,r]}class xt extends Y{constructor(t){super(),J(this,t,pl,hl,Z,{shortcut:0})}}function Yn(e){let t,n;return t=new xt({props:{shortcut:e[6]}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r&64&&(s.shortcut=i[6]),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Kn(e){let t,n,i;return n=new po({props:{size:"1.25x"}}),{c(){t=L("div"),U(n.$$.fragment),c(t,"class","edit-icon-wrapper svelte-1ebkg7o")},m(r,s){g(r,t,s),O(n,t,null),i=!0},i(r){i||(w(n.$$.fragment,r),i=!0)},o(r){S(n.$$.fragment,r),i=!1},d(r){r&&_(t),M(n)}}}function ml(e){let t,n,i,r,s,o=e[0].body+"",l,a,u,f,p,h=e[4]&&Yn(e);i=new xt({props:{shortcut:e[0].abbreviation}});let m=!e[4]&&Kn();return{c(){t=L("li"),h&&h.c(),n=R(),U(i.$$.fragment),r=R(),s=L("span"),l=$(o),a=R(),m&&m.c(),c(s,"class","body svelte-1ebkg7o"),c(t,"tabindex",e[1]),c(t,"title",e[7]),c(t,"class","svelte-1ebkg7o"),X(t,"focussed",e[2]),X(t,"active",e[3])},m(d,b){g(d,t,b),h&&h.m(t,null),A(t,n),O(i,t,null),A(t,r),A(t,s),A(s,l),A(t,a),m&&m.m(t,null),e[13](t),u=!0,f||(p=te(t,"click",e[12]),f=!0)},p(d,[b]){d[4]?h?(h.p(d,b),b&16&&w(h,1)):(h=Yn(d),h.c(),w(h,1),h.m(t,n)):h&&(ue(),S(h,1,1,()=>{h=null}),fe());const I={};b&1&&(I.shortcut=d[0].abbreviation),i.$set(I),(!u||b&1)&&o!==(o=d[0].body+"")&&z(l,o),d[4]?m&&(ue(),S(m,1,1,()=>{m=null}),fe()):m?b&16&&w(m,1):(m=Kn(),m.c(),w(m,1),m.m(t,null)),(!u||b&2)&&c(t,"tabindex",d[1]),(!u||b&4)&&X(t,"focussed",d[2]),(!u||b&8)&&X(t,"active",d[3])},i(d){u||(w(h),w(i.$$.fragment,d),w(m),u=!0)},o(d){S(h),S(i.$$.fragment,d),S(m),u=!1},d(d){d&&_(t),h&&h.d(),M(i),m&&m.d(),e[13](null),f=!1,p()}}}function dl(e,t,n){let i;ne(e,Se,E=>n(14,i=E));let{snippet:r}=t,{index:s=-1}=t,{tabindex:o=-1}=t,{focussed:l=!1}=t,{active:a=!1}=t,{selectMode:u=!1}=t,{observer:f=null}=t,p,h=i(u?"use_snippet.title":"edit_snippet.title"),m=s>=0&&s<10?s+1:"";m===10&&(m=0);function d(){return p.classList.contains("is-visible")}function b(E){p.scrollIntoView({behavior:"smooth",block:E})}Je(()=>{f&&f.observe(p)}),_n(()=>{f&&f.unobserve(p)});function I(E){ut.call(this,e,E)}function B(E){ve[E?"unshift":"push"](()=>{p=E,n(5,p)})}return e.$$set=E=>{"snippet"in E&&n(0,r=E.snippet),"index"in E&&n(8,s=E.index),"tabindex"in E&&n(1,o=E.tabindex),"focussed"in E&&n(2,l=E.focussed),"active"in E&&n(3,a=E.active),"selectMode"in E&&n(4,u=E.selectMode),"observer"in E&&n(9,f=E.observer)},[r,o,l,a,u,p,m,h,s,f,d,b,I,B]}class _l extends Y{constructor(t){super(),J(this,t,dl,ml,Z,{snippet:0,index:8,tabindex:1,focussed:2,active:3,selectMode:4,observer:9,isVisible:10,scrollIntoView:11})}get isVisible(){return this.$$.ctx[10]}get scrollIntoView(){return this.$$.ctx[11]}}function ei(e,t,n){const i=e.slice();return i[22]=t[n],i[23]=t,i[24]=n,i}function ti(e){let t,n=e[24],i;const r=()=>e[14](t,n),s=()=>e[14](null,n);function o(){return e[15](e[24])}let l={snippet:e[22],index:e[24],focussed:e[24]===e[4],active:e[5],observer:e[8],selectMode:e[2]};return t=new _l({props:l}),r(),t.$on("click",o),{c(){U(t.$$.fragment)},m(a,u){O(t,a,u),i=!0},p(a,u){e=a,n!==e[24]&&(s(),n=e[24],r());const f={};u&128&&(f.snippet=e[22]),u&16&&(f.focussed=e[24]===e[4]),u&32&&(f.active=e[5]),u&4&&(f.selectMode=e[2]),t.$set(f)},i(a){i||(w(t.$$.fragment,a),i=!0)},o(a){S(t.$$.fragment,a),i=!1},d(a){s(),M(t,a)}}}function gl(e){let t,n,i,r,s,o=On(e[7]),l=[];for(let u=0;u<o.length;u+=1)l[u]=ti(ei(e,o,u));const a=u=>S(l[u],1,1,()=>{l[u]=null});return{c(){t=L("ul");for(let u=0;u<l.length;u+=1)l[u].c();c(t,"tabindex",e[1]),c(t,"class","svelte-1wnqbvs")},m(u,f){g(u,t,f);for(let p=0;p<l.length;p+=1)l[p]&&l[p].m(t,null);e[16](t),i=!0,r||(s=[te(t,"focus",e[9]),te(t,"blur",e[10]),te(t,"keydown",e[12]),dn(n=Ui.call(null,t,e[3]))],r=!0)},p(u,[f]){if(f&2548){o=On(u[7]);let p;for(p=0;p<o.length;p+=1){const h=ei(u,o,p);l[p]?(l[p].p(h,f),w(l[p],1)):(l[p]=ti(h),l[p].c(),w(l[p],1),l[p].m(t,null))}for(ue(),p=o.length;p<l.length;p+=1)a(p);fe()}(!i||f&2)&&c(t,"tabindex",u[1]),n&&Qe(n.update)&&f&8&&n.update.call(null,u[3])},i(u){if(!i){for(let f=0;f<o.length;f+=1)w(l[f]);i=!0}},o(u){l=l.filter(Boolean);for(let f=0;f<l.length;f+=1)S(l[f]);i=!1},d(u){u&&_(t),Xi(l,u),e[16](null),r=!1,Ee(s)}}}function bl(e,t,n){let i;const r=_t();let{snippets:s=null}=t,{tabindex:o=0}=t,{selectMode:l=!1}=t,{autofocus:a=!1}=t,{ref:u}=t,f=0,p=a,h=[];const m=new IntersectionObserver(function(v){for(let P=0;P<v.length;P++)v[P].isIntersecting?v[P].target.classList.add("is-visible"):v[P].target.classList.remove("is-visible")},{root:u,threshold:[.6]});function d(v){return n(4,f=0),v}function b(){n(5,p=!0)}function I(){n(5,p=!1)}function B(v){l?y(i[v]):T(i[v])}function E(v){!s||s.length===0||H(v)&&v.preventDefault()}function H(v){if(v.key==="Home"||v.key==="g")return n(4,f=0),h[f].scrollIntoView("nearest"),!0;if(v.key==="End"||v.key==="G")return n(4,f=s.length-1),h[f].scrollIntoView("nearest"),!0;if(f<s.length-1&&(v.key==="ArrowDown"||v.key==="j"))return n(4,f++,f),h[f].scrollIntoView("nearest"),!0;if(f>0&&(v.key==="ArrowUp"||v.key==="k"))return n(4,f--,f),h[f].scrollIntoView("nearest"),!0;if(v.key==="PageDown"||v.key==="d"){let P=-1,C=-1;for(let ae=0;ae<h.length;ae++)if(h[ae].isVisible())C=ae,P<0&&(P=ae);else if(C>=0)break;const le=h.length-1,re=C-P;return C+re>le?n(4,f=le):n(4,f=C),h[f].scrollIntoView("start"),!0}if(v.key==="PageUp"||v.key==="u"){let P=-1,C=-1;for(let re=0;re<h.length;re++){const ae=h[re];if(ae.isVisible()&&P<0)P=re,C=re;else if(ae.isVisible())C=re;else if(P>=0)break}const le=C-P;return P-le<=0?n(4,f=0):n(4,f=P),h[f].scrollIntoView("end"),!0}if(l&&f>=0&&f<s.length&&v.key==="Enter")return y(i[f]),!0;if(l&&["1","2","3","4","5","6","7","8","9","0"].includes(v.key)){let P=v.key-1;return P===-1&&(P=9),P+1>i.length?!1:(y(i[P]),!0)}return!l&&f>=0&&f<s.length&&(v.key==="ArrowRight"||v.key==="Enter")?(T(i[f]),!0):!1}function y(v){r("itemActivated",{snippet:v})}function T(v){r("itemEdit",{snippet:v})}ai(()=>{h.length!==i.length&&n(6,h.length=i.length,h)});function N(v,P){ve[v?"unshift":"push"](()=>{h[P]=v,n(6,h)})}const k=v=>B(v);function x(v){ve[v?"unshift":"push"](()=>{u=v,n(0,u)})}return e.$$set=v=>{"snippets"in v&&n(13,s=v.snippets),"tabindex"in v&&n(1,o=v.tabindex),"selectMode"in v&&n(2,l=v.selectMode),"autofocus"in v&&n(3,a=v.autofocus),"ref"in v&&n(0,u=v.ref)},e.$$.update=()=>{e.$$.dirty&8192&&n(7,i=d(s))},[u,o,l,a,f,p,h,i,m,b,I,B,E,s,N,k,x]}class vl extends Y{constructor(t){super(),J(this,t,bl,gl,Z,{snippets:13,tabindex:1,selectMode:2,autofocus:3,ref:0})}}function wl(e){let t,n;const i=e[2].default,r=ht(i,e,e[1],null);return{c(){t=L("div"),r&&r.c(),c(t,"class","toolbar svelte-i867mn"),X(t,"bottom",e[0])},m(s,o){g(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&2)&&mt(r,i,s,s[1],n?pt(i,s[1],o,null):dt(s[1]),null),(!n||o&1)&&X(t,"bottom",s[0])},i(s){n||(w(r,s),n=!0)},o(s){S(r,s),n=!1},d(s){s&&_(t),r&&r.d(s)}}}function El(e,t,n){let{$$slots:i={},$$scope:r}=t,{bottom:s=!1}=t;return e.$$set=o=>{"bottom"in o&&n(0,s=o.bottom),"$$scope"in o&&n(1,r=o.$$scope)},[s,r,i]}class Rt extends Y{constructor(t){super(),J(this,t,El,wl,Z,{bottom:0})}}function yl(e){let t;return{c(){t=L("div"),c(t,"class","toolbar-spacer svelte-1a67v9")},m(n,i){g(n,t,i)},p:G,i:G,o:G,d(n){n&&_(t)}}}class kn extends Y{constructor(t){super(),J(this,t,null,yl,Z,{})}}function Sl(e){let t,n,i=e[6]("no_snippets_found.title")+"",r,s,o,l=e[6]("no_snippets_found.description")+"",a;return{c(){t=L("div"),n=L("p"),r=$(i),s=R(),o=L("p"),a=$(l),c(n,"class","no-snippets-found svelte-y4605t"),c(o,"class","no-snippets-found description dimmed svelte-y4605t"),c(t,"class","centered")},m(u,f){g(u,t,f),A(t,n),A(n,r),A(t,s),A(t,o),A(o,a)},p(u,f){f&64&&i!==(i=u[6]("no_snippets_found.title")+"")&&z(r,i),f&64&&l!==(l=u[6]("no_snippets_found.description")+"")&&z(a,l)},i:G,o:G,d(u){u&&_(t)}}}function kl(e){let t,n,i;function r(o){e[21](o)}let s={snippets:e[7],tabindex:2,selectMode:e[0],autofocus:e[8]};return e[4]!==void 0&&(s.ref=e[4]),t=new vl({props:s}),ve.push(()=>$e(t,"ref",r)),t.$on("itemActivated",e[12]),t.$on("itemEdit",e[13]),{c(){U(t.$$.fragment)},m(o,l){O(t,o,l),i=!0},p(o,l){const a={};l&128&&(a.snippets=o[7]),l&1&&(a.selectMode=o[0]),!n&&l&16&&(n=!0,a.ref=o[4],Ge(()=>n=!1)),t.$set(a)},i(o){i||(w(t.$$.fragment,o),i=!0)},o(o){S(t.$$.fragment,o),i=!1},d(o){M(t,o)}}}function ni(e){let t,n;return t=new Rt({props:{bottom:!0,$$slots:{default:[Al]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r&16777280&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Al(e){let t,n,i,r,s,o;return t=new de({props:{iconClass:"dimmed",icon:Ot,size:"2.3x",title:e[6]("add_snippet.title")}}),t.$on("activate",e[10]),i=new kn({}),s=new de({props:{iconClass:"dimmed",icon:Ri,size:"2x",title:e[6]("settings.title")}}),s.$on("activate",e[11]),{c(){U(t.$$.fragment),n=R(),U(i.$$.fragment),r=R(),U(s.$$.fragment)},m(l,a){O(t,l,a),g(l,n,a),O(i,l,a),g(l,r,a),O(s,l,a),o=!0},p(l,a){const u={};a&64&&(u.title=l[6]("add_snippet.title")),t.$set(u);const f={};a&64&&(f.title=l[6]("settings.title")),s.$set(f)},i(l){o||(w(t.$$.fragment,l),w(i.$$.fragment,l),w(s.$$.fragment,l),o=!0)},o(l){S(t.$$.fragment,l),S(i.$$.fragment,l),S(s.$$.fragment,l),o=!1},d(l){l&&(_(n),_(r)),M(t,l),M(i,l),M(s,l)}}}function Bl(e){let t,n,i,r,s,o,l,a,u,f,p;function h(y){e[18](y)}function m(y){e[19](y)}function d(y){e[20](y)}let b={search:!0,autofocus:e[1],placeholder:e[6]("search"),searchButtonTitle:e[6]("search"),clearButtonTitle:e[6]("clear"),tabindex:1};e[2]!==void 0&&(b.value=e[2]),e[3]!==void 0&&(b.ref=e[3]),e[5]!==void 0&&(b.focussed=e[5]),n=new Sn({props:b}),ve.push(()=>$e(n,"value",h)),ve.push(()=>$e(n,"ref",m)),ve.push(()=>$e(n,"focussed",d)),n.$on("query",e[9]);const I=[kl,Sl],B=[];function E(y,T){return y[7]?0:1}l=E(e),a=B[l]=I[l](e);let H=!e[0]&&ni(e);return{c(){t=L("div"),U(n.$$.fragment),o=R(),a.c(),u=R(),H&&H.c(),f=ye(),c(t,"class","toolbar top")},m(y,T){g(y,t,T),O(n,t,null),g(y,o,T),B[l].m(y,T),g(y,u,T),H&&H.m(y,T),g(y,f,T),p=!0},p(y,T){const N={};T&2&&(N.autofocus=y[1]),T&64&&(N.placeholder=y[6]("search")),T&64&&(N.searchButtonTitle=y[6]("search")),T&64&&(N.clearButtonTitle=y[6]("clear")),!i&&T&4&&(i=!0,N.value=y[2],Ge(()=>i=!1)),!r&&T&8&&(r=!0,N.ref=y[3],Ge(()=>r=!1)),!s&&T&32&&(s=!0,N.focussed=y[5],Ge(()=>s=!1)),n.$set(N);let k=l;l=E(y),l===k?B[l].p(y,T):(ue(),S(B[k],1,1,()=>{B[k]=null}),fe(),a=B[l],a?a.p(y,T):(a=B[l]=I[l](y),a.c()),w(a,1),a.m(u.parentNode,u)),y[0]?H&&(ue(),S(H,1,1,()=>{H=null}),fe()):H?(H.p(y,T),T&1&&w(H,1)):(H=ni(y),H.c(),w(H,1),H.m(f.parentNode,f))},i(y){p||(w(n.$$.fragment,y),w(a),w(H),p=!0)},o(y){S(n.$$.fragment,y),S(a),S(H),p=!1},d(y){y&&(_(t),_(o),_(u),_(f)),M(n),B[l].d(y),H&&H.d(y)}}}function Tl(e){let t,n;return t=new et({props:{$$slots:{default:[Bl]},$$scope:{ctx:e}}}),t.$on("keyup",e[14]),t.$on("cancel",e[15]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&16777471&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Il(e,t,n){let i,r,s,o;ne(e,we,C=>n(17,i=C)),ne(e,Jt,C=>n(2,r=C)),ne(e,Se,C=>n(6,s=C)),ne(e,Yt,C=>n(7,o=C));let{orderByLastUsed:l=!1}=t,{selectMode:a=!1}=t,{focusSearchBox:u=!0}=t;const f=!u;let p,h,m=u;function d(C){Wi(Jt,r=C.detail,r),Yt.search(r,l)}function b(){je("/snippet/add")}function I(){je("/settings")}function B(C){mr(C.detail.snippet.abbreviation,500)}function E(C){const le=C.detail.snippet.id;je("/snippet/edit/"+le)}function H(C,le,re){Yt.search(C,le)}function y(){m?h.focus():p.focus()}function T(C){C.ctrlKey&&C.key==="n"&&(b(),C.preventDefault()),C.ctrlKey&&C.altKey&&C.key==="s"&&(I(),C.preventDefault()),C.ctrlKey&&C.key==="f"&&(y(),C.preventDefault())}function N(){a&&er()}function k(C){r=C,Jt.set(r)}function x(C){p=C,n(3,p)}function v(C){m=C,n(5,m)}function P(C){h=C,n(4,h)}return e.$$set=C=>{"orderByLastUsed"in C&&n(16,l=C.orderByLastUsed),"selectMode"in C&&n(0,a=C.selectMode),"focusSearchBox"in C&&n(1,u=C.focusSearchBox)},e.$$.update=()=>{e.$$.dirty&196612&&H(r,l)},[a,u,r,p,h,m,s,o,f,d,b,I,B,E,T,N,l,i,k,x,v,P]}class Hl extends Y{constructor(t){super(),J(this,t,Il,Tl,Z,{orderByLastUsed:16,selectMode:0,focusSearchBox:1})}}function ii(e){let t,n,i,r,s,o,l,a;return n=new de({props:{iconClass:"dimmed",icon:Ot,title:e[0]("add_snippet.title"),size:"5x",$$slots:{default:[Cl]},$$scope:{ctx:e}}}),n.$on("activate",e[2]),s=new de({props:{horizontal:!0,iconClass:"dimmed",icon:hn,title:e[0]("import_snippets.title"),size:"1.5x",$$slots:{default:[Ll]},$$scope:{ctx:e}}}),s.$on("activate",e[4]),l=new Rt({props:{bottom:!0,$$slots:{default:[Nl]},$$scope:{ctx:e}}}),{c(){t=L("p"),U(n.$$.fragment),i=R(),r=L("p"),U(s.$$.fragment),o=R(),U(l.$$.fragment),c(t,"class","add-snippet"),c(r,"class","import-snippets")},m(u,f){g(u,t,f),O(n,t,null),g(u,i,f),g(u,r,f),O(s,r,null),g(u,o,f),O(l,u,f),a=!0},p(u,f){const p={};f&1&&(p.title=u[0]("add_snippet.title")),f&33&&(p.$$scope={dirty:f,ctx:u}),n.$set(p);const h={};f&1&&(h.title=u[0]("import_snippets.title")),f&33&&(h.$$scope={dirty:f,ctx:u}),s.$set(h);const m={};f&33&&(m.$$scope={dirty:f,ctx:u}),l.$set(m)},i(u){a||(w(n.$$.fragment,u),w(s.$$.fragment,u),w(l.$$.fragment,u),a=!0)},o(u){S(n.$$.fragment,u),S(s.$$.fragment,u),S(l.$$.fragment,u),a=!1},d(u){u&&(_(t),_(i),_(r),_(o)),M(n),M(s),M(l,u)}}}function Cl(e){let t=e[0]("add_snippet.title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("add_snippet.title")+"")&&z(n,t)},d(i){i&&_(n)}}}function Ll(e){let t=e[0]("import_snippets.title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&1&&t!==(t=i[0]("import_snippets.title")+"")&&z(n,t)},d(i){i&&_(n)}}}function Nl(e){let t,n,i,r,s,o;return t=new de({props:{iconClass:"dimmed",icon:Ot,size:"2.3x",title:e[0]("add_snippet.title")}}),t.$on("activate",e[2]),i=new kn({}),s=new de({props:{iconClass:"dimmed",icon:Ri,size:"2x",title:e[0]("settings.title")}}),s.$on("activate",e[3]),{c(){U(t.$$.fragment),n=R(),U(i.$$.fragment),r=R(),U(s.$$.fragment)},m(l,a){O(t,l,a),g(l,n,a),O(i,l,a),g(l,r,a),O(s,l,a),o=!0},p(l,a){const u={};a&1&&(u.title=l[0]("add_snippet.title")),t.$set(u);const f={};a&1&&(f.title=l[0]("settings.title")),s.$set(f)},i(l){o||(w(t.$$.fragment,l),w(i.$$.fragment,l),w(s.$$.fragment,l),o=!0)},o(l){S(t.$$.fragment,l),S(i.$$.fragment,l),S(s.$$.fragment,l),o=!1},d(l){l&&(_(n),_(r)),M(t,l),M(i,l),M(s,l)}}}function Pl(e){let t,n,i,r=e[0]("no_snippets_found.title")+"",s,o,l,a,u=e[1]&&ii(e);return{c(){t=L("h1"),t.textContent="Snippet Expander",n=R(),i=L("p"),s=$(r),o=R(),u&&u.c(),l=ye(),c(i,"class","dimmed")},m(f,p){g(f,t,p),g(f,n,p),g(f,i,p),A(i,s),g(f,o,p),u&&u.m(f,p),g(f,l,p),a=!0},p(f,p){(!a||p&1)&&r!==(r=f[0]("no_snippets_found.title")+"")&&z(s,r),f[1]?u?(u.p(f,p),p&2&&w(u,1)):(u=ii(f),u.c(),w(u,1),u.m(l.parentNode,l)):u&&(ue(),S(u,1,1,()=>{u=null}),fe())},i(f){a||(w(u),a=!0)},o(f){S(u),a=!1},d(f){f&&(_(t),_(n),_(i),_(o),_(l)),u&&u.d(f)}}}function Ol(e){let t,n;return t=new et({props:{centered:!0,$$slots:{default:[Pl]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&35&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Ml(e,t,n){let i,r;ne(e,Se,a=>n(0,i=a)),ne(e,we,a=>n(1,r=a));function s(){je("/snippet/add")}function o(){je("/settings")}async function l(){try{const a=await mi(!1)}catch(a){await oe(i("import_snippets.error_title"),a)}await Me.fetch()}return[i,r,s,o,l]}class xl extends Y{constructor(t){super(),J(this,t,Ml,Ol,Z,{})}}function Rl(e){let t,n;return t=new xl({}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p:G,i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Ul(e){let t,n;return t=new Hl({props:{selectMode:e[2],orderByLastUsed:e[3],focusSearchBox:e[4]}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r&4&&(s.selectMode=i[2]),r&8&&(s.orderByLastUsed=i[3]),r&16&&(s.focusSearchBox=i[4]),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Dl(e){let t;return{c(){t=$("Checking settings ...")},m(n,i){g(n,t,i)},p:G,i:G,o:G,d(n){n&&_(t)}}}function Gl(e){let t,n,i,r;const s=[Dl,Ul,Rl],o=[];function l(a,u){return a[1]?0:a[0]&&(a[5]&&a[5].length>0||a[2])?1:2}return t=l(e),n=o[t]=s[t](e),{c(){n.c(),i=ye()},m(a,u){o[t].m(a,u),g(a,i,u),r=!0},p(a,[u]){let f=t;t=l(a),t===f?o[t].p(a,u):(ue(),S(o[f],1,1,()=>{o[f]=null}),fe(),n=o[t],n?n.p(a,u):(n=o[t]=s[t](a),n.c()),w(n,1),n.m(i.parentNode,i))},i(a){r||(w(n),r=!0)},o(a){S(n),r=!1},d(a){a&&_(i),o[t].d(a)}}}function $l(e,t,n){let i,r,s;ne(e,Se,p=>n(6,i=p)),ne(e,we,p=>n(0,r=p)),ne(e,Me,p=>n(5,s=p));let o=!0,l=!1,a=!1,u=!0;function f(p){Me.fetch()}return Je(async()=>{if(n(2,l=await vr()),n(3,a=l),l&&r)try{const p=await hi("FOCUS_SEARCH_BOX");n(4,u=p!=="false")}catch(p){await oe(i("settings.get_error_title"),p)}n(1,o=!1)}),e.$$.update=()=>{e.$$.dirty&1&&f()},[r,o,l,a,u,s]}class jl extends Y{constructor(t){super(),J(this,t,$l,Gl,Z,{})}}function Fl(e){let t=e[4]("button.cancel")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&16&&t!==(t=i[4]("button.cancel")+"")&&z(n,t)},d(i){i&&_(n)}}}function zl(e){let t=e[4]("button.save")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&16&&t!==(t=i[4]("button.save")+"")&&z(n,t)},d(i){i&&_(n)}}}function Vl(e){let t,n=e[4]("add_snippet.title")+"",i,r,s,o,l,a,u=e[4]("body.title")+"",f,p,h,m,d,b,I,B,E,H,y;function T(k){e[8](k)}let N={label:e[4]("abbreviation.title"),errorMessage:e[1],autofocus:!0};return e[0]!==void 0&&(N.value=e[0]),s=new Sn({props:N}),ve.push(()=>$e(s,"value",T)),b=new Fe({props:{secondary:!0,$$slots:{default:[Fl]},$$scope:{ctx:e}}}),b.$on("click",e[5]),B=new Fe({props:{primary:!0,disabled:e[3],$$slots:{default:[zl]},$$scope:{ctx:e}}}),B.$on("click",e[6]),{c(){t=L("h2"),i=$(n),r=R(),U(s.$$.fragment),l=R(),a=L("label"),f=$(u),p=R(),h=L("textarea"),m=R(),d=L("div"),U(b.$$.fragment),I=R(),U(B.$$.fragment),c(t,"class","svelte-126nfs4"),c(a,"for","body"),c(h,"id","body"),c(h,"class","svelte-126nfs4"),c(d,"class","button-row svelte-126nfs4")},m(k,x){g(k,t,x),A(t,i),g(k,r,x),O(s,k,x),g(k,l,x),g(k,a,x),A(a,f),g(k,p,x),g(k,h,x),ze(h,e[2]),g(k,m,x),g(k,d,x),O(b,d,null),A(d,I),O(B,d,null),E=!0,H||(y=te(h,"input",e[9]),H=!0)},p(k,x){(!E||x&16)&&n!==(n=k[4]("add_snippet.title")+"")&&z(i,n);const v={};x&16&&(v.label=k[4]("abbreviation.title")),x&2&&(v.errorMessage=k[1]),!o&&x&1&&(o=!0,v.value=k[0],Ge(()=>o=!1)),s.$set(v),(!E||x&16)&&u!==(u=k[4]("body.title")+"")&&z(f,u),x&4&&ze(h,k[2]);const P={};x&2064&&(P.$$scope={dirty:x,ctx:k}),b.$set(P);const C={};x&8&&(C.disabled=k[3]),x&2064&&(C.$$scope={dirty:x,ctx:k}),B.$set(C)},i(k){E||(w(s.$$.fragment,k),w(b.$$.fragment,k),w(B.$$.fragment,k),E=!0)},o(k){S(s.$$.fragment,k),S(b.$$.fragment,k),S(B.$$.fragment,k),E=!1},d(k){k&&(_(t),_(r),_(l),_(a),_(p),_(h),_(m),_(d)),M(s,k),M(b),M(B),H=!1,y()}}}function Wl(e){let t,n;return t=new et({props:{$$slots:{default:[Vl]},$$scope:{ctx:e}}}),t.$on("cancel",e[5]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&2079&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Xl(e,t,n){let i,r,s;ne(e,Se,d=>n(4,r=d)),ne(e,we,d=>n(7,s=d));let o="",l="";async function a(d){if(d.length===0){n(1,u=r("abbreviation.empty"));return}if(!s){n(1,u="");return}try{const b=await pi(d);if(b.hasOwnProperty("abbreviation")&&b.abbreviation.length>0){n(1,u=r("abbreviation.exists"));return}}catch(b){await oe(r("add_snippet.error_title"),b)}n(1,u="")}let u="";function f(){Be()}async function p(){try{const d=await tr(o,l);await Be()}catch(d){await oe(r("add_snippet.error_title"),d)}}function h(d){o=d,n(0,o)}function m(){l=this.value,n(2,l)}return e.$$.update=()=>{e.$$.dirty&1&&a(o),e.$$.dirty&130&&n(3,i=!s||u.length>0)},[o,u,l,i,r,f,p,s,h,m]}class ql extends Y{constructor(t){super(),J(this,t,Xl,Wl,Z,{})}}function Zl(e){let t=e[5]("button.remove")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&32&&t!==(t=i[5]("button.remove")+"")&&z(n,t)},d(i){i&&_(n)}}}function Ql(e){let t=e[5]("button.cancel")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&32&&t!==(t=i[5]("button.cancel")+"")&&z(n,t)},d(i){i&&_(n)}}}function Jl(e){let t=e[5]("button.save")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r&32&&t!==(t=i[5]("button.save")+"")&&z(n,t)},d(i){i&&_(n)}}}function Yl(e){let t,n=e[5]("edit_snippet.title")+"",i,r,s,o,l,a,u=e[5]("body.title")+"",f,p,h,m,d,b,I,B,E,H,y,T,N;function k(v){e[11](v)}let x={label:e[5]("abbreviation.title"),errorMessage:e[1],autofocus:!0};return e[0]!==void 0&&(x.value=e[0]),s=new Sn({props:x}),ve.push(()=>$e(s,"value",k)),b=new Fe({props:{danger:!0,disabled:e[3],$$slots:{default:[Zl]},$$scope:{ctx:e}}}),b.$on("click",e[7]),B=new Fe({props:{secondary:!0,$$slots:{default:[Ql]},$$scope:{ctx:e}}}),B.$on("click",e[6]),H=new Fe({props:{primary:!0,disabled:e[4],$$slots:{default:[Jl]},$$scope:{ctx:e}}}),H.$on("click",e[8]),{c(){t=L("h2"),i=$(n),r=R(),U(s.$$.fragment),l=R(),a=L("label"),f=$(u),p=R(),h=L("textarea"),m=R(),d=L("div"),U(b.$$.fragment),I=R(),U(B.$$.fragment),E=R(),U(H.$$.fragment),c(t,"class","svelte-126nfs4"),c(a,"for","body"),c(h,"id","body"),c(h,"class","svelte-126nfs4"),c(d,"class","button-row svelte-126nfs4")},m(v,P){g(v,t,P),A(t,i),g(v,r,P),O(s,v,P),g(v,l,P),g(v,a,P),A(a,f),g(v,p,P),g(v,h,P),ze(h,e[2]),g(v,m,P),g(v,d,P),O(b,d,null),A(d,I),O(B,d,null),A(d,E),O(H,d,null),y=!0,T||(N=te(h,"input",e[12]),T=!0)},p(v,P){(!y||P&32)&&n!==(n=v[5]("edit_snippet.title")+"")&&z(i,n);const C={};P&32&&(C.label=v[5]("abbreviation.title")),P&2&&(C.errorMessage=v[1]),!o&&P&1&&(o=!0,C.value=v[0],Ge(()=>o=!1)),s.$set(C),(!y||P&32)&&u!==(u=v[5]("body.title")+"")&&z(f,u),P&4&&ze(h,v[2]);const le={};P&8&&(le.disabled=v[3]),P&32800&&(le.$$scope={dirty:P,ctx:v}),b.$set(le);const re={};P&32800&&(re.$$scope={dirty:P,ctx:v}),B.$set(re);const ae={};P&16&&(ae.disabled=v[4]),P&32800&&(ae.$$scope={dirty:P,ctx:v}),H.$set(ae)},i(v){y||(w(s.$$.fragment,v),w(b.$$.fragment,v),w(B.$$.fragment,v),w(H.$$.fragment,v),y=!0)},o(v){S(s.$$.fragment,v),S(b.$$.fragment,v),S(B.$$.fragment,v),S(H.$$.fragment,v),y=!1},d(v){v&&(_(t),_(r),_(l),_(a),_(p),_(h),_(m),_(d)),M(s,v),M(b),M(B),M(H),T=!1,N()}}}function Kl(e){let t,n;return t=new et({props:{$$slots:{default:[Yl]},$$scope:{ctx:e}}}),t.$on("cancel",e[6]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&32831&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function ea(e,t,n){let i,r,s,o;ne(e,Se,E=>n(5,s=E)),ne(e,we,E=>n(10,o=E));let{params:l={}}=t,a={},u="",f="";async function p(E){if(n(1,h=""),!!a.hasOwnProperty("id")){if(E.length===0){n(1,h=s("abbreviation.empty"));return}if(o)try{const H=await pi(E);H.hasOwnProperty("abbreviation")&&H.abbreviation.length>0&&H.id!==a.id&&n(1,h=s("abbreviation.exists"))}catch(H){await oe(s("edit_snippet.error_title"),H)}}}let h="";function m(){Be()}async function d(){try{await _r(a.abbreviation),await Be()}catch(E){await oe(s("remove_snippet.error_title"),E)}}async function b(){let E={...a};E.abbreviation=u,E.body=f;try{await Sr(a.id,E),await Be()}catch(H){await oe(s("edit_snippet.error_title"),H)}}Je(async()=>{l.hasOwnProperty("id")||(await oe(s("edit_snippet.error_title"),s("edit_snippet.id_not_supplied")),await Be());try{a=await fr(l.id)}catch(H){await oe(s("edit_snippet.error_title"),H),await Be()}let E=!1;try{E=await pr(a.id)}catch(H){await oe(s("edit_snippet.error_title"),H),await Be()}E&&(await oe(s("edit_snippet.error_title"),s("edit_snippet.snippet_not_found")),await Be()),n(0,u=a.abbreviation),n(2,f=a.body)});function I(E){u=E,n(0,u)}function B(){f=this.value,n(2,f)}return e.$$set=E=>{"params"in E&&n(9,l=E.params)},e.$$.update=()=>{e.$$.dirty&1&&p(u),e.$$.dirty&1026&&n(4,i=!o||h.length>0),e.$$.dirty&1024&&n(3,r=!o)},[u,h,f,r,i,s,m,d,b,l,o,I,B]}class ta extends Y{constructor(t){super(),J(this,t,ea,Kl,Z,{params:9})}}function na(e){let t,n,i,r,s,o;return t=new de({props:{horizontal:!0,iconClass:"dimmed",icon:xi,size:"2.5x",title:e[6]("button.back")}}),t.$on("activate",e[8]),i=new kn({}),s=new de({props:{horizontal:!0,iconClass:"dimmed",icon:wo,size:"2.5x",title:e[6]("button.about")}}),s.$on("activate",e[9]),{c(){U(t.$$.fragment),n=R(),U(i.$$.fragment),r=R(),U(s.$$.fragment)},m(l,a){O(t,l,a),g(l,n,a),O(i,l,a),g(l,r,a),O(s,l,a),o=!0},p(l,a){const u={};a[0]&64&&(u.title=l[6]("button.back")),t.$set(u);const f={};a[0]&64&&(f.title=l[6]("button.about")),s.$set(f)},i(l){o||(w(t.$$.fragment,l),w(i.$$.fragment,l),w(s.$$.fragment,l),o=!0)},o(l){S(t.$$.fragment,l),S(i.$$.fragment,l),S(s.$$.fragment,l),o=!1},d(l){l&&(_(n),_(r)),M(t,l),M(i,l),M(s,l)}}}function ia(e){let t,n=e[6]("settings.custom_shortcuts_disabled")+"",i;return{c(){t=L("p"),i=$(n),c(t,"class","dimmed svelte-1fggvh7")},m(r,s){g(r,t,s),A(t,i)},p(r,s){s[0]&64&&n!==(n=r[6]("settings.custom_shortcuts_disabled")+"")&&z(i,n)},i:G,o:G,d(r){r&&_(t)}}}function ra(e){let t,n,i,r;const s=[oa,sa],o=[];function l(a,u){return a[5].length>0?0:1}return t=l(e),n=o[t]=s[t](e),{c(){n.c(),i=ye()},m(a,u){o[t].m(a,u),g(a,i,u),r=!0},p(a,u){let f=t;t=l(a),t===f?o[t].p(a,u):(ue(),S(o[f],1,1,()=>{o[f]=null}),fe(),n=o[t],n?n.p(a,u):(n=o[t]=s[t](a),n.c()),w(n,1),n.m(i.parentNode,i))},i(a){r||(w(n),r=!0)},o(a){S(n),r=!1},d(a){a&&_(i),o[t].d(a)}}}function sa(e){let t,n=e[6]("settings.custom_shortcut")+"",i,r,s,o,l,a;return s=new xt({props:{shortcut:e[6]("settings.custom_shortcut_empty")}}),l=new de({props:{horizontal:!0,iconClass:"dimmed",icon:Ot,size:"2.0x",title:e[6]("settings.add_default_custom_shortcut")}}),l.$on("activate",e[22]),{c(){t=L("p"),i=$(n),r=$(": "),U(s.$$.fragment),o=R(),U(l.$$.fragment),c(t,"class","row svelte-1fggvh7")},m(u,f){g(u,t,f),A(t,i),A(t,r),O(s,t,null),A(t,o),O(l,t,null),a=!0},p(u,f){(!a||f[0]&64)&&n!==(n=u[6]("settings.custom_shortcut")+"")&&z(i,n);const p={};f[0]&64&&(p.shortcut=u[6]("settings.custom_shortcut_empty")),s.$set(p);const h={};f[0]&64&&(h.title=u[6]("settings.add_default_custom_shortcut")),l.$set(h)},i(u){a||(w(s.$$.fragment,u),w(l.$$.fragment,u),a=!0)},o(u){S(s.$$.fragment,u),S(l.$$.fragment,u),a=!1},d(u){u&&_(t),M(s),M(l)}}}function oa(e){let t,n=e[6]("settings.custom_shortcut")+"",i,r,s,o,l,a,u,f=e[6]("settings.change_custom_shortcut_desc")+"",p,h;return s=new xt({props:{shortcut:e[5]}}),l=new de({props:{horizontal:!0,iconClass:"dimmed",icon:Co,size:"1.75x",title:e[6]("settings.remove_custom_shortcut")}}),l.$on("activate",e[21]),{c(){t=L("p"),i=$(n),r=$(": "),U(s.$$.fragment),o=R(),U(l.$$.fragment),a=R(),u=L("p"),p=$(f),c(t,"class","row svelte-1fggvh7"),c(u,"class","dimmed svelte-1fggvh7")},m(m,d){g(m,t,d),A(t,i),A(t,r),O(s,t,null),A(t,o),O(l,t,null),g(m,a,d),g(m,u,d),A(u,p),h=!0},p(m,d){(!h||d[0]&64)&&n!==(n=m[6]("settings.custom_shortcut")+"")&&z(i,n);const b={};d[0]&32&&(b.shortcut=m[5]),s.$set(b);const I={};d[0]&64&&(I.title=m[6]("settings.remove_custom_shortcut")),l.$set(I),(!h||d[0]&64)&&f!==(f=m[6]("settings.change_custom_shortcut_desc")+"")&&z(p,f)},i(m){h||(w(s.$$.fragment,m),w(l.$$.fragment,m),h=!0)},o(m){S(s.$$.fragment,m),S(l.$$.fragment,m),h=!1},d(m){m&&(_(t),_(a),_(u)),M(s),M(l)}}}function la(e){let t=e[6]("settings.no_connection")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r[0]&64&&t!==(t=i[6]("settings.no_connection")+"")&&z(n,t)},i:G,o:G,d(i){i&&_(n)}}}function aa(e){let t,n=e[6]("settings.import_export_title")+"",i,r,s,o,l,a,u,f,p;o=new de({props:{horizontal:!0,iconClass:"dimmed",icon:hn,size:"1.5x",title:e[6]("import_snippets.new_only_title"),$$slots:{default:[ua]},$$scope:{ctx:e}}}),o.$on("activate",e[25]),a=new de({props:{horizontal:!0,iconClass:"dimmed",icon:hn,size:"1.5x",title:e[6]("import_snippets.update_title"),$$slots:{default:[fa]},$$scope:{ctx:e}}}),a.$on("activate",e[26]);let h=e[7]&&e[7].length>0&&ri(e);return{c(){t=L("h3"),i=$(n),r=R(),s=L("p"),U(o.$$.fragment),l=R(),U(a.$$.fragment),u=R(),h&&h.c(),f=ye(),c(t,"class","svelte-1fggvh7"),c(s,"class","import-snippets svelte-1fggvh7")},m(m,d){g(m,t,d),A(t,i),g(m,r,d),g(m,s,d),O(o,s,null),A(s,l),O(a,s,null),g(m,u,d),h&&h.m(m,d),g(m,f,d),p=!0},p(m,d){(!p||d[0]&64)&&n!==(n=m[6]("settings.import_export_title")+"")&&z(i,n);const b={};d[0]&64&&(b.title=m[6]("import_snippets.new_only_title")),d[0]&64|d[1]&4&&(b.$$scope={dirty:d,ctx:m}),o.$set(b);const I={};d[0]&64&&(I.title=m[6]("import_snippets.update_title")),d[0]&64|d[1]&4&&(I.$$scope={dirty:d,ctx:m}),a.$set(I),m[7]&&m[7].length>0?h?(h.p(m,d),d[0]&128&&w(h,1)):(h=ri(m),h.c(),w(h,1),h.m(f.parentNode,f)):h&&(ue(),S(h,1,1,()=>{h=null}),fe())},i(m){p||(w(o.$$.fragment,m),w(a.$$.fragment,m),w(h),p=!0)},o(m){S(o.$$.fragment,m),S(a.$$.fragment,m),S(h),p=!1},d(m){m&&(_(t),_(r),_(s),_(u),_(f)),M(o),M(a),h&&h.d(m)}}}function ua(e){let t=e[6]("import_snippets.new_only_title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r[0]&64&&t!==(t=i[6]("import_snippets.new_only_title")+"")&&z(n,t)},d(i){i&&_(n)}}}function fa(e){let t=e[6]("import_snippets.update_title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r[0]&64&&t!==(t=i[6]("import_snippets.update_title")+"")&&z(n,t)},d(i){i&&_(n)}}}function ri(e){let t,n,i;return n=new de({props:{horizontal:!0,iconClass:"dimmed",icon:fo,size:"1.5x",title:e[6]("export_snippets.title"),$$slots:{default:[ca]},$$scope:{ctx:e}}}),n.$on("activate",e[16]),{c(){t=L("p"),U(n.$$.fragment),c(t,"class","export-snippets svelte-1fggvh7")},m(r,s){g(r,t,s),O(n,t,null),i=!0},p(r,s){const o={};s[0]&64&&(o.title=r[6]("export_snippets.title")),s[0]&64|s[1]&4&&(o.$$scope={dirty:s,ctx:r}),n.$set(o)},i(r){i||(w(n.$$.fragment,r),i=!0)},o(r){S(n.$$.fragment,r),i=!1},d(r){r&&_(t),M(n)}}}function ca(e){let t=e[6]("export_snippets.title")+"",n;return{c(){n=$(t)},m(i,r){g(i,n,r)},p(i,r){r[0]&64&&t!==(t=i[6]("export_snippets.title")+"")&&z(n,t)},d(i){i&&_(n)}}}function ha(e){let t,n,i,r=e[6]("settings.title")+"",s,o,l,a=e[6]("settings.autostart_title")+"",u,f,p,h,m,d,b=e[6]("settings.autostart")+"",I,B,E,H=e[6]("settings.autoexpand_title")+"",y,T,N,k,x,v,P=e[6]("settings.autoexpand")+"",C,le,re,ae=e[6]("settings.search_and_paste_title")+"",_e,ge,ce,pe,he,j,ie,F,K,Pe=e[6]("settings.focus_search")+"",Ut,Dt,be,ke,tt,Ae,Gt,An;t=new Rt({props:{$$slots:{default:[na]},$$scope:{ctx:e}}});const Bn=[ra,ia],Ie=[];function Tn(D,W){return D[4]?0:1}ce=Tn(e),pe=Ie[ce]=Bn[ce](e);const In=[aa,la],He=[];function Hn(D,W){return D[0]?0:1}return be=Hn(e),ke=He[be]=In[be](e),{c(){U(t.$$.fragment),n=R(),i=L("h2"),s=$(r),o=R(),l=L("h3"),u=$(a),f=R(),p=L("p"),h=L("label"),m=L("input"),d=R(),I=$(b),B=R(),E=L("h3"),y=$(H),T=R(),N=L("p"),k=L("label"),x=L("input"),v=R(),C=$(P),le=R(),re=L("h3"),_e=$(ae),ge=R(),pe.c(),he=R(),j=L("p"),ie=L("label"),F=L("input"),K=R(),Ut=$(Pe),Dt=R(),ke.c(),tt=ye(),c(i,"class","svelte-1fggvh7"),c(l,"class","svelte-1fggvh7"),c(m,"type","checkbox"),c(p,"class","svelte-1fggvh7"),c(E,"class","svelte-1fggvh7"),c(x,"type","checkbox"),c(N,"class","svelte-1fggvh7"),c(re,"class","svelte-1fggvh7"),c(F,"type","checkbox"),c(j,"class","svelte-1fggvh7")},m(D,W){O(t,D,W),g(D,n,W),g(D,i,W),A(i,s),g(D,o,W),g(D,l,W),A(l,u),g(D,f,W),g(D,p,W),A(p,h),A(h,m),m.checked=e[1],A(h,d),A(h,I),g(D,B,W),g(D,E,W),A(E,y),g(D,T,W),g(D,N,W),A(N,k),A(k,x),x.checked=e[2],A(k,v),A(k,C),g(D,le,W),g(D,re,W),A(re,_e),g(D,ge,W),Ie[ce].m(D,W),g(D,he,W),g(D,j,W),A(j,ie),A(ie,F),F.checked=e[3],A(ie,K),A(ie,Ut),g(D,Dt,W),He[be].m(D,W),g(D,tt,W),Ae=!0,Gt||(An=[te(m,"change",e[17]),te(m,"change",e[18]),dn(Ui.call(null,m,!0)),te(x,"change",e[19]),te(x,"change",e[20]),te(F,"change",e[23]),te(F,"change",e[24])],Gt=!0)},p(D,W){const Cn={};W[0]&64|W[1]&4&&(Cn.$$scope={dirty:W,ctx:D}),t.$set(Cn),(!Ae||W[0]&64)&&r!==(r=D[6]("settings.title")+"")&&z(s,r),(!Ae||W[0]&64)&&a!==(a=D[6]("settings.autostart_title")+"")&&z(u,a),W[0]&2&&(m.checked=D[1]),(!Ae||W[0]&64)&&b!==(b=D[6]("settings.autostart")+"")&&z(I,b),(!Ae||W[0]&64)&&H!==(H=D[6]("settings.autoexpand_title")+"")&&z(y,H),W[0]&4&&(x.checked=D[2]),(!Ae||W[0]&64)&&P!==(P=D[6]("settings.autoexpand")+"")&&z(C,P),(!Ae||W[0]&64)&&ae!==(ae=D[6]("settings.search_and_paste_title")+"")&&z(_e,ae);let $t=ce;ce=Tn(D),ce===$t?Ie[ce].p(D,W):(ue(),S(Ie[$t],1,1,()=>{Ie[$t]=null}),fe(),pe=Ie[ce],pe?pe.p(D,W):(pe=Ie[ce]=Bn[ce](D),pe.c()),w(pe,1),pe.m(he.parentNode,he)),W[0]&8&&(F.checked=D[3]),(!Ae||W[0]&64)&&Pe!==(Pe=D[6]("settings.focus_search")+"")&&z(Ut,Pe);let jt=be;be=Hn(D),be===jt?He[be].p(D,W):(ue(),S(He[jt],1,1,()=>{He[jt]=null}),fe(),ke=He[be],ke?ke.p(D,W):(ke=He[be]=In[be](D),ke.c()),w(ke,1),ke.m(tt.parentNode,tt))},i(D){Ae||(w(t.$$.fragment,D),w(pe),w(ke),Ae=!0)},o(D){S(t.$$.fragment,D),S(pe),S(ke),Ae=!1},d(D){D&&(_(n),_(i),_(o),_(l),_(f),_(p),_(B),_(E),_(T),_(N),_(le),_(re),_(ge),_(he),_(j),_(Dt),_(tt)),M(t,D),Ie[ce].d(D),He[be].d(D),Gt=!1,Ee(An)}}}function pa(e){let t,n;return t=new et({props:{centered:!0,$$slots:{default:[ha]},$$scope:{ctx:e}}}),t.$on("cancel",e[8]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r[0]&255|r[1]&4&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}const ma="Snippet Expander Search & Paste pop-up window",Kt="snippetexpandergui --search-and-paste",si="<Ctrl>grave";function da(e,t,n){let i,r,s;ne(e,Se,j=>n(6,i=j)),ne(e,we,j=>n(0,r=j)),ne(e,Me,j=>n(7,s=j));let o=!1,l=!1,a=!0,u=!1,f=si;function p(){Be()}function h(){je("/about")}async function m(){let j=!1;try{j=await ar()}catch(ie){await oe(i("settings.get_error_title"),ie);return}return j}async function d(j){try{await yr(j)}catch(ie){await oe(i("settings.save_error_title"),ie);return}return j}async function b(){let j=!1;try{j=await lr()}catch(ie){await oe(i("settings.get_error_title"),ie);return}return j}async function I(j){try{await Er(j)}catch(ie){await oe(i("settings.save_error_title"),ie);return}return j}async function B(){let j="";try{j=await hi("FOCUS_SEARCH_BOX")}catch(ie){await oe(i("settings.get_error_title"),ie);return}return j!=="false"}async function E(){let j=!1;try{j=await nr()}catch(ie){await oe(i("settings.get_error_title"),ie);return}return j}async function H(){try{n(5,f=await ur(Kt))}catch(j){await oe(i("settings.get_error_title"),j);return}}async function y(){try{await gr(ma,si,Kt,"")}catch(j){await oe(i("settings.save_error_title"),j)}await H()}async function T(){try{await rr(Kt,f)}catch(j){await oe(i("settings.delete_error_title"),j)}await H()}async function N(j){const ie=j?"true":"false";try{await br("FOCUS_SEARCH_BOX",ie)}catch(F){await oe(i("settings.save_error_title"),F);return}return j}function k(j){Me.fetch()}async function x(j){try{const ie=await mi(j)}catch(ie){await oe(i("import_snippets.error_title"),ie)}await Me.fetch()}async function v(){try{const j=await sr()}catch(j){await oe(i("export_snippets.error_title"),j)}}Je(async()=>{n(1,o=await m()),n(2,l=await b()),n(3,a=await B()),n(4,u=await E()),u&&await H()});function P(){o=this.checked,n(1,o)}const C=()=>d(o);function le(){l=this.checked,n(2,l)}const re=()=>I(l),ae=()=>T(),_e=()=>y();function ge(){a=this.checked,n(3,a)}const ce=()=>N(a),pe=()=>x(!1),he=()=>x(!0);return e.$$.update=()=>{e.$$.dirty[0]&1&&k()},[r,o,l,a,u,f,i,s,p,h,d,I,y,T,N,x,v,P,C,le,re,ae,_e,ge,ce,pe,he]}class _a extends Y{constructor(t){super(),J(this,t,da,pa,Z,{},null,[-1,-1])}}const ga="/assets/snippetexpander-icon-128-a0af7490.svg";function ba(e){let t,n;return t=new de({props:{horizontal:!0,iconClass:"dimmed",icon:xi,size:"2.5x",title:e[3]("button.back")}}),t.$on("activate",e[4]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,r){const s={};r&8&&(s.title=i[3]("button.back")),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function va(e){let t,n,i,r,s,o,l,a,u,f=e[3]("about.description")+"",p,h,m,d,b,I,B,E,H,y,T=e[3]("about.by")+"",N,k,x,v,P,C,le=e[3]("about.licence_title")+"",re,ae,_e,ge,ce=e[3]("about.licence")+"",pe,he,j,ie;return t=new Rt({props:{$$slots:{default:[ba]},$$scope:{ctx:e}}}),{c(){U(t.$$.fragment),n=R(),i=L("img"),s=R(),o=L("h2"),o.textContent="Snippet Expander",l=R(),a=L("p"),u=L("em"),p=$(f),h=R(),m=L("p"),d=L("a"),b=$(e[2]),I=R(),B=L("p"),E=L("a"),E.textContent="snippetexpander.org",H=R(),y=L("h3"),N=$(T),k=R(),x=L("p"),v=L("a"),v.textContent="ianmjones",P=R(),C=L("h3"),re=$(le),ae=R(),_e=L("p"),ge=L("a"),pe=$(ce),zi(i.src,r=ga)||c(i,"src",r),c(i,"alt","Snippet Expander icon"),c(o,"class","svelte-sjm2tb"),c(a,"class","svelte-sjm2tb"),c(d,"href",e[0]),c(m,"class","svelte-sjm2tb"),c(E,"href","https://snippetexpander.org"),c(B,"class","svelte-sjm2tb"),c(y,"class","svelte-sjm2tb"),c(v,"href","https://ianmjones.com"),c(x,"class","svelte-sjm2tb"),c(C,"class","svelte-sjm2tb"),c(ge,"href",e[1]),c(_e,"class","svelte-sjm2tb")},m(F,K){O(t,F,K),g(F,n,K),g(F,i,K),g(F,s,K),g(F,o,K),g(F,l,K),g(F,a,K),A(a,u),A(u,p),g(F,h,K),g(F,m,K),A(m,d),A(d,b),g(F,I,K),g(F,B,K),A(B,E),g(F,H,K),g(F,y,K),A(y,N),g(F,k,K),g(F,x,K),A(x,v),g(F,P,K),g(F,C,K),A(C,re),g(F,ae,K),g(F,_e,K),A(_e,ge),A(ge,pe),he=!0,j||(ie=[te(d,"click",vt(e[6])),te(E,"click",vt(e[7])),te(v,"click",vt(e[8])),te(ge,"click",vt(e[9]))],j=!0)},p(F,K){const Pe={};K&1032&&(Pe.$$scope={dirty:K,ctx:F}),t.$set(Pe),(!he||K&8)&&f!==(f=F[3]("about.description")+"")&&z(p,f),(!he||K&4)&&z(b,F[2]),(!he||K&1)&&c(d,"href",F[0]),(!he||K&8)&&T!==(T=F[3]("about.by")+"")&&z(N,T),(!he||K&8)&&le!==(le=F[3]("about.licence_title")+"")&&z(re,le),(!he||K&8)&&ce!==(ce=F[3]("about.licence")+"")&&z(pe,ce),(!he||K&2)&&c(ge,"href",F[1])},i(F){he||(w(t.$$.fragment,F),he=!0)},o(F){S(t.$$.fragment,F),he=!1},d(F){F&&(_(n),_(i),_(s),_(o),_(l),_(a),_(h),_(m),_(I),_(B),_(H),_(y),_(k),_(x),_(P),_(C),_(ae),_(_e)),M(t,F),j=!1,Ee(ie)}}}function wa(e){let t,n;return t=new et({props:{centered:!0,$$slots:{default:[va]},$$scope:{ctx:e}}}),t.$on("cancel",e[4]),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p(i,[r]){const s={};r&1039&&(s.$$scope={dirty:r,ctx:i}),t.$set(s)},i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function Ea(e,t,n){let i,r,s,o;ne(e,Se,m=>n(3,o=m));function l(){Be()}let a="";Je(async()=>{n(5,a=await hr())});const u=()=>wt(r),f=()=>wt("https://snippetexpander.org"),p=()=>wt("https://ianmjones.com"),h=()=>wt(s);return e.$$.update=()=>{e.$$.dirty&32&&n(2,i="v"+a),e.$$.dirty&32&&n(0,r="https://git.sr.ht/~ianmjones/snippetexpander/tree/"+a),e.$$.dirty&1&&n(1,s=r+"/item/LICENSE")},[r,s,i,o,l,a,u,f,p,h]}class ya extends Y{constructor(t){super(),J(this,t,Ea,wa,Z,{})}}function Sa(e){let t,n;return t=new no({props:{routes:e[1]}}),{c(){U(t.$$.fragment)},m(i,r){O(t,i,r),n=!0},p:G,i(i){n||(w(t.$$.fragment,i),n=!0)},o(i){S(t.$$.fragment,i),n=!1},d(i){M(t,i)}}}function ka(e){let t;return{c(){t=$("Loading...")},m(n,i){g(n,t,i)},p:G,i:G,o:G,d(n){n&&_(t)}}}function Aa(e){let t,n,i,r;const s=[ka,Sa],o=[];function l(a,u){return a[0]?0:1}return t=l(e),n=o[t]=s[t](e),{c(){n.c(),i=ye()},m(a,u){o[t].m(a,u),g(a,i,u),r=!0},p(a,[u]){let f=t;t=l(a),t===f?o[t].p(a,u):(ue(),S(o[f],1,1,()=>{o[f]=null}),fe(),n=o[t],n?n.p(a,u):(n=o[t]=s[t](a),n.c()),w(n,1),n.m(i.parentNode,i))},i(a){r||(w(n),r=!0)},o(a){S(n),r=!1},d(a){a&&_(i),o[t].d(a)}}}function Ba(e,t,n){let i;ne(e,kt,a=>n(0,i=a));let r;async function s(){try{const a=await dr("Pong");a==="Pong"?we.update(u=>!0):(we.update(u=>!1),Vt("Got '"+a+"' back from Ping instead of 'Pong'.")),rt.update(u=>!0),Ht.update(u=>!1)}catch(a){we.update(u=>!1),Vt("Ping returned: "+a),o()}}async function o(){try{await ir()?rt.update(u=>!0):rt.update(u=>!1)}catch(a){rt.update(u=>!1),Vt("DaemonInstalled returned: "+a)}}Os("en-GB",()=>Fi(()=>import("./en-GB-0a4787dd.js"),[])),xs({fallbackLocale:"en-GB",initialLocale:Rs()});const l={"/":jl,"/snippet/add":ql,"/snippet/edit/:id":ta,"/settings":_a,"/about":ya};return Je(async()=>{await s(),r=setInterval(s,5e3)}),_n(()=>{clearInterval(r)}),[i,l]}class Ta extends Y{constructor(t){super(),J(this,t,Ba,Aa,Z,{})}}new Ta({target:document.getElementById("app")});

M cmd/snippetexpandergui/frontend/dist/index.html => cmd/snippetexpandergui/frontend/dist/index.html +1 -1
@@ 5,7 5,7 @@
	<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
	
	<title>Snippet Expander</title>
  <script type="module" crossorigin src="/assets/index-68176ace.js"></script>
  <script type="module" crossorigin src="/assets/index-5bae17e4.js"></script>
  <link rel="stylesheet" href="/assets/index-e2d949f4.css">
</head>
<body>

M cmd/snippetexpandergui/frontend/src/App.svelte => cmd/snippetexpandergui/frontend/src/App.svelte +27 -18
@@ 1,18 1,19 @@
<script>
	import {onDestroy, onMount} from "svelte";
	import {LogError} from "../wailsjs/runtime/runtime.js";
	import {Ping, DaemonInstalled} from "../wailsjs/go/main/App.js";
	import { onDestroy, onMount } from "svelte";
	import { EventsOn, LogError, LogInfo } from "../wailsjs/runtime/runtime.js";
	import { Ping, DaemonInstalled } from "../wailsjs/go/main/App.js";
	import {
		getLocaleFromNavigator,
		init,
		isLoading,
		register
	} from 'svelte-i18n';
		register,
	} from "svelte-i18n";
	import Router from "svelte-spa-router";
	import {
		connectionOK,
		daemonInstalled,
		startingDaemon
		snippetsLastUpdated,
		startingDaemon,
	} from "./js/stores.js";
	import MainScreen from "./components/MainScreen.svelte";
	import AddSnippetScreen from "./components/AddSnippetScreen.svelte";


@@ 27,17 28,19 @@
		try {
			const result = await Ping("Pong");
			if (result === "Pong") {
				connectionOK.update(_connectionOK => true);
				connectionOK.update((_connectionOK) => true);
			} else {
				connectionOK.update(_connectionOK => false);
				LogError("Got '" + result + "' back from Ping instead of 'Pong'.");
				connectionOK.update((_connectionOK) => false);
				LogError(
					"Got '" + result + "' back from Ping instead of 'Pong'."
				);
			}

			// We got something, so assume daemon installed and started.
			daemonInstalled.update(_daemonInstalled => true);
			startingDaemon.update(_startingDaemon => false);
			daemonInstalled.update((_daemonInstalled) => true);
			startingDaemon.update((_startingDaemon) => false);
		} catch (err) {
			connectionOK.update(_connectionOK => false);
			connectionOK.update((_connectionOK) => false);
			LogError("Ping returned: " + err);

			// If there was an error, maybe daemon not installed?


@@ 50,24 53,29 @@
		try {
			const result = await DaemonInstalled();
			if (result) {
				daemonInstalled.update(_daemonInstalled => true);
				daemonInstalled.update((_daemonInstalled) => true);
			} else {
				daemonInstalled.update(_daemonInstalled => false);
				daemonInstalled.update((_daemonInstalled) => false);
			}
		} catch (err) {
			daemonInstalled.update(_daemonInstalled => false);
			daemonInstalled.update((_daemonInstalled) => false);
			LogError("DaemonInstalled returned: " + err);
		}
	}

	// Set up i18n.
	register('en-GB', () => import('../../i18n/en-GB.json'));
	register("en-GB", () => import("../../i18n/en-GB.json"));

	init({
		fallbackLocale: 'en-GB',
		fallbackLocale: "en-GB",
		initialLocale: getLocaleFromNavigator(),
	});

	// Set up event listeners.
	const cancelSnippetsUpdatedListener = EventsOn("SnippetsUpdated", () => {
		snippetsLastUpdated.update((_timestamp) => Date.now());
	});

	// Set up Router.
	const routes = {
		"/": MainScreen,


@@ 75,7 83,7 @@
		"/snippet/edit/:id": EditSnippetScreen,
		"/settings": SettingsScreen,
		"/about": AboutScreen,
	}
	};

	onMount(async () => {
		await checkConn();


@@ 84,6 92,7 @@

	onDestroy(() => {
		clearInterval(checkConnInterval);
		cancelSnippetsUpdatedListener();
	});
</script>


M cmd/snippetexpandergui/frontend/src/components/ListSnippetsScreen.svelte => cmd/snippetexpandergui/frontend/src/components/ListSnippetsScreen.svelte +51 -36
@@ 1,10 1,15 @@
<script>
	import {_} from "svelte-i18n";
	import {push} from "svelte-spa-router";
	import {PlusSquareIcon, SettingsIcon} from "svelte-feather-icons";
	import {Quit} from "../../wailsjs/runtime/runtime.js";
	import {PasteSnippetAndQuit} from "../../wailsjs/go/main/App.js";
	import {connectionOK, search, searchResults} from "../js/stores.js";
	import { _ } from "svelte-i18n";
	import { push } from "svelte-spa-router";
	import { PlusSquareIcon, SettingsIcon } from "svelte-feather-icons";
	import { Quit } from "../../wailsjs/runtime/runtime.js";
	import { PasteSnippetAndQuit } from "../../wailsjs/go/main/App.js";
	import {
		connectionOK,
		search,
		searchResults,
		snippetsLastUpdated,
	} from "../js/stores.js";
	import Screen from "./Screen.svelte";
	import IconButton from "./IconButton.svelte";
	import Input from "./Input.svelte";


@@ 36,7 41,7 @@
	}

	function handleItemActivated(event) {
		PasteSnippetAndQuit(event.detail.snippet.abbreviation, 500)
		PasteSnippetAndQuit(event.detail.snippet.abbreviation, 500);
	}

	function handleEditSnippet(event) {


@@ 44,11 49,21 @@
		push("/snippet/edit/" + id);
	}

	function updateSearchResults(search, orderByLastUsed, _) {
	function updateSearchResults(
		search,
		orderByLastUsed,
		_connectionOK,
		_snippetsLastUpdated
	) {
		searchResults.search(search, orderByLastUsed);
	}

	$: updateSearchResults($search, orderByLastUsed, $connectionOK);
	$: updateSearchResults(
		$search,
		orderByLastUsed,
		$connectionOK,
		$snippetsLastUpdated
	);

	function toggleBetweenSearchAndList() {
		if (searchFocussed) {


@@ 85,27 100,27 @@
<Screen on:keyup={onKeyup} on:cancel={handleCancel}>
	<div class="toolbar top">
		<Input
				search
				autofocus={focusSearchBox}
				placeholder={$_("search")}
				searchButtonTitle={$_("search")}
				clearButtonTitle={$_("clear")}
				bind:value={$search}
				on:query={handleQuery}
				tabindex={1}
				bind:ref={searchBox}
				bind:focussed={searchFocussed}
			search
			autofocus={focusSearchBox}
			placeholder={$_("search")}
			searchButtonTitle={$_("search")}
			clearButtonTitle={$_("clear")}
			bind:value={$search}
			on:query={handleQuery}
			tabindex={1}
			bind:ref={searchBox}
			bind:focussed={searchFocussed}
		/>
	</div>
	{#if $searchResults}
		<SnippetsList
				snippets={$searchResults}
				tabindex={2}
				{selectMode}
				on:itemActivated={handleItemActivated}
				on:itemEdit={handleEditSnippet}
				autofocus={focusSnippetsList}
				bind:ref={snippetsList}
			snippets={$searchResults}
			tabindex={2}
			{selectMode}
			on:itemActivated={handleItemActivated}
			on:itemEdit={handleEditSnippet}
			autofocus={focusSnippetsList}
			bind:ref={snippetsList}
		/>
	{:else}
		<div class="centered">


@@ 120,19 135,19 @@
	{#if !selectMode}
		<Toolbar bottom>
			<IconButton
					iconClass="dimmed"
					icon={PlusSquareIcon}
					on:activate={handleAddSnippet}
					size="2.3x"
					title={$_( "add_snippet.title" )}
				iconClass="dimmed"
				icon={PlusSquareIcon}
				on:activate={handleAddSnippet}
				size="2.3x"
				title={$_("add_snippet.title")}
			/>
			<ToolbarSpacer />
			<IconButton
					iconClass="dimmed"
					icon={SettingsIcon}
					on:activate={handleSettings}
					size="2x"
					title={$_( "settings.title" )}
				iconClass="dimmed"
				icon={SettingsIcon}
				on:activate={handleSettings}
				size="2x"
				title={$_("settings.title")}
			/>
		</Toolbar>
	{/if}

M cmd/snippetexpandergui/frontend/src/components/MainScreen.svelte => cmd/snippetexpandergui/frontend/src/components/MainScreen.svelte +13 -7
@@ 1,12 1,16 @@
<script>
	import {onMount} from "svelte";
	import {_} from "svelte-i18n";
	import { onMount } from "svelte";
	import { _ } from "svelte-i18n";
	import {
		GetSetting,
		SearchAndPasteMode,
		ShowError
		ShowError,
	} from "../../wailsjs/go/main/App.js";
	import {connectionOK, snippets} from "../js/stores.js";
	import {
		connectionOK,
		snippets,
		snippetsLastUpdated,
	} from "../js/stores.js";
	import ListSnippetsScreen from "./ListSnippetsScreen.svelte";
	import WelcomeScreen from "./WelcomeScreen.svelte";



@@ 15,11 19,11 @@
	let orderByLastUsed = false;
	let focusSearchBox = true;

	function updateSnippets(_connectionOK) {
	function updateSnippets(_connectionOK, _snippetsLastUpdated) {
		snippets.fetch();
	}

	$: updateSnippets($connectionOK);
	$: updateSnippets($connectionOK, $snippetsLastUpdated);

	onMount(async () => {
		selectMode = await SearchAndPasteMode();


@@ 27,7 31,9 @@

		if (selectMode && $connectionOK) {
			try {
				const focusSearchBoxString = await GetSetting("FOCUS_SEARCH_BOX");
				const focusSearchBoxString = await GetSetting(
					"FOCUS_SEARCH_BOX"
				);
				// Default is true.
				focusSearchBox = focusSearchBoxString !== "false";
			} catch (err) {

M cmd/snippetexpandergui/frontend/src/js/stores.js => cmd/snippetexpandergui/frontend/src/js/stores.js +1 -0
@@ 31,6 31,7 @@ function createSnippets() {
}

export const snippets = createSnippets();
export const snippetsLastUpdated = writable(0);

export const search = writable("");
export const searchResults = createSnippets();

M cmd/snippetexpandergui/go.mod => cmd/snippetexpandergui/go.mod +2 -1
@@ 19,7 19,7 @@ require (
	github.com/gofrs/uuid v4.4.0+incompatible
	github.com/matryer/is v1.4.1
	github.com/spf13/pflag v1.0.5
	github.com/wailsapp/wails/v2 v2.5.1
	github.com/wailsapp/wails/v2 v2.6.0
)

require (


@@ 41,6 41,7 @@ require (
	github.com/tkrajina/go-reflector v0.5.6 // indirect
	github.com/valyala/bytebufferpool v1.0.0 // indirect
	github.com/valyala/fasttemplate v1.2.2 // indirect
	github.com/wailsapp/go-webview2 v1.0.1 // indirect
	github.com/wailsapp/mimetype v1.4.1 // indirect
	golang.org/x/crypto v0.11.0 // indirect
	golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b // indirect

M cmd/snippetexpandergui/go.sum => cmd/snippetexpandergui/go.sum +4 -2
@@ 59,10 59,12 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/wailsapp/go-webview2 v1.0.1 h1:dEJIeEApW/MhO2tTMISZBFZPuW7kwrFA1NtgFB1z1II=
github.com/wailsapp/go-webview2 v1.0.1/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs=
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
github.com/wailsapp/wails/v2 v2.5.1 h1:mfG+2kWqQXYOwdgI43HEILjOZDXbk5woPYI3jP2b+js=
github.com/wailsapp/wails/v2 v2.5.1/go.mod h1:jbOZbcr/zm79PxXxAjP8UoVlDd9wLW3uDs+isIthDfs=
github.com/wailsapp/wails/v2 v2.6.0 h1:EyH0zR/EO6dDiqNy8qU5spaXDfkluiq77xrkabPYD4c=
github.com/wailsapp/wails/v2 v2.6.0/go.mod h1:WBG9KKWuw0FKfoepBrr/vRlyTmHaMibWesK3yz6nNiM=
golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA=
golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b h1:r+vk0EmXNmekl0S0BascoeeoHk/L7wmaW2QF90K+kYI=