2021-04-08 18:50:55 +03:00
( function ( l , r ) {
if ( l . getElementById ( "livereloadscript" ) ) return ;
r = l . createElement ( "script" ) ;
r . async = 1 ;
r . src =
"//" +
( window . location . host || "localhost" ) . split ( ":" ) [ 0 ] +
":35729/livereload.js?snipver=1" ;
r . id = "livereloadscript" ;
l . getElementsByTagName ( "head" ) [ 0 ] . appendChild ( r ) ;
} ) ( window . document ) ;
var app = ( function ( ) {
"use strict" ;
function noop ( ) { }
function add _location ( element , file , line , column , char ) {
element . _ _svelte _meta = {
loc : { file , line , column , char } ,
} ;
}
function run ( fn ) {
return fn ( ) ;
}
function blank _object ( ) {
return Object . create ( null ) ;
}
function run _all ( fns ) {
fns . forEach ( run ) ;
}
function is _function ( thing ) {
return typeof thing === "function" ;
}
function safe _not _equal ( a , b ) {
return a != a
? b == b
: a !== b || ( a && typeof a === "object" ) || typeof a === "function" ;
}
function is _empty ( obj ) {
return Object . keys ( obj ) . length === 0 ;
}
function validate _store ( store , name ) {
if ( store != null && typeof store . subscribe !== "function" ) {
throw new Error ( ` ' ${ name } ' is not a store with a 'subscribe' method ` ) ;
}
}
function subscribe ( store , ... callbacks ) {
if ( store == null ) {
return noop ;
}
const unsub = store . subscribe ( ... callbacks ) ;
return unsub . unsubscribe ? ( ) => unsub . unsubscribe ( ) : unsub ;
}
function component _subscribe ( component , store , callback ) {
component . $$ . on _destroy . push ( subscribe ( store , callback ) ) ;
}
function append ( target , node ) {
target . appendChild ( node ) ;
}
function insert ( target , node , anchor ) {
target . insertBefore ( node , anchor || null ) ;
}
function detach ( node ) {
node . parentNode . removeChild ( node ) ;
}
function destroy _each ( iterations , detaching ) {
for ( let i = 0 ; i < iterations . length ; i += 1 ) {
if ( iterations [ i ] ) iterations [ i ] . d ( detaching ) ;
}
}
function element ( name ) {
return document . createElement ( name ) ;
}
function text ( data ) {
return document . createTextNode ( data ) ;
}
function space ( ) {
return text ( " " ) ;
}
function listen ( node , event , handler , options ) {
node . addEventListener ( event , handler , options ) ;
return ( ) => node . removeEventListener ( event , handler , options ) ;
}
function prevent _default ( fn ) {
return function ( event ) {
event . preventDefault ( ) ;
// @ts-ignore
return fn . call ( this , event ) ;
} ;
}
function attr ( node , attribute , value ) {
if ( value == null ) node . removeAttribute ( attribute ) ;
else if ( node . getAttribute ( attribute ) !== value )
node . setAttribute ( attribute , value ) ;
}
function to _number ( value ) {
return value === "" ? null : + value ;
}
function children ( element ) {
return Array . from ( element . childNodes ) ;
}
function set _input _value ( input , value ) {
input . value = value == null ? "" : value ;
}
function set _style ( node , key , value , important ) {
node . style . setProperty ( key , value , important ? "important" : "" ) ;
}
function select _option ( select , value ) {
for ( let i = 0 ; i < select . options . length ; i += 1 ) {
const option = select . options [ i ] ;
if ( option . _ _value === value ) {
option . selected = true ;
return ;
}
}
}
function select _value ( select ) {
const selected _option =
select . querySelector ( ":checked" ) || select . options [ 0 ] ;
return selected _option && selected _option . _ _value ;
}
function custom _event ( type , detail ) {
const e = document . createEvent ( "CustomEvent" ) ;
e . initCustomEvent ( type , false , false , detail ) ;
return e ;
}
let current _component ;
function set _current _component ( component ) {
current _component = component ;
}
function get _current _component ( ) {
if ( ! current _component )
throw new Error ( "Function called outside component initialization" ) ;
return current _component ;
}
function onMount ( fn ) {
get _current _component ( ) . $$ . on _mount . push ( fn ) ;
}
function onDestroy ( fn ) {
get _current _component ( ) . $$ . on _destroy . push ( fn ) ;
}
const dirty _components = [ ] ;
const binding _callbacks = [ ] ;
const render _callbacks = [ ] ;
const flush _callbacks = [ ] ;
const resolved _promise = Promise . resolve ( ) ;
let update _scheduled = false ;
function schedule _update ( ) {
if ( ! update _scheduled ) {
update _scheduled = true ;
resolved _promise . then ( flush ) ;
}
}
function add _render _callback ( fn ) {
render _callbacks . push ( fn ) ;
}
let flushing = false ;
const seen _callbacks = new Set ( ) ;
function flush ( ) {
if ( flushing ) return ;
flushing = true ;
do {
// first, call beforeUpdate functions
// and update components
for ( let i = 0 ; i < dirty _components . length ; i += 1 ) {
const component = dirty _components [ i ] ;
set _current _component ( component ) ;
update ( component . $$ ) ;
}
set _current _component ( null ) ;
dirty _components . length = 0 ;
while ( binding _callbacks . length ) binding _callbacks . pop ( ) ( ) ;
// then, once components are updated, call
// afterUpdate functions. This may cause
// subsequent updates...
for ( let i = 0 ; i < render _callbacks . length ; i += 1 ) {
const callback = render _callbacks [ i ] ;
if ( ! seen _callbacks . has ( callback ) ) {
// ...so guard against infinite loops
seen _callbacks . add ( callback ) ;
callback ( ) ;
}
}
render _callbacks . length = 0 ;
} while ( dirty _components . length ) ;
while ( flush _callbacks . length ) {
flush _callbacks . pop ( ) ( ) ;
}
update _scheduled = false ;
flushing = false ;
seen _callbacks . clear ( ) ;
}
function update ( $$ ) {
if ( $$ . fragment !== null ) {
$$ . update ( ) ;
run _all ( $$ . before _update ) ;
const dirty = $$ . dirty ;
$$ . dirty = [ - 1 ] ;
$$ . fragment && $$ . fragment . p ( $$ . ctx , dirty ) ;
$$ . after _update . forEach ( add _render _callback ) ;
}
}
const outroing = new Set ( ) ;
let outros ;
function group _outros ( ) {
outros = {
r : 0 ,
c : [ ] ,
p : outros , // parent group
} ;
}
function check _outros ( ) {
if ( ! outros . r ) {
run _all ( outros . c ) ;
}
outros = outros . p ;
}
function transition _in ( block , local ) {
if ( block && block . i ) {
outroing . delete ( block ) ;
block . i ( local ) ;
}
}
function transition _out ( block , local , detach , callback ) {
if ( block && block . o ) {
if ( outroing . has ( block ) ) return ;
outroing . add ( block ) ;
outros . c . push ( ( ) => {
outroing . delete ( block ) ;
if ( callback ) {
if ( detach ) block . d ( 1 ) ;
callback ( ) ;
}
} ) ;
block . o ( local ) ;
}
}
const globals =
typeof window !== "undefined"
? window
: typeof globalThis !== "undefined"
? globalThis
: global ;
function create _component ( block ) {
block && block . c ( ) ;
}
function mount _component ( component , target , anchor , customElement ) {
const { fragment , on _mount , on _destroy , after _update } = component . $$ ;
fragment && fragment . m ( target , anchor ) ;
if ( ! customElement ) {
// onMount happens before the initial afterUpdate
add _render _callback ( ( ) => {
const new _on _destroy = on _mount . map ( run ) . filter ( is _function ) ;
if ( on _destroy ) {
on _destroy . push ( ... new _on _destroy ) ;
} else {
// Edge case - component was destroyed immediately,
// most likely as a result of a binding initialising
run _all ( new _on _destroy ) ;
}
component . $$ . on _mount = [ ] ;
} ) ;
}
after _update . forEach ( add _render _callback ) ;
}
function destroy _component ( component , detaching ) {
const $$ = component . $$ ;
if ( $$ . fragment !== null ) {
run _all ( $$ . on _destroy ) ;
$$ . fragment && $$ . fragment . d ( detaching ) ;
// TODO null out other refs, including component.$$ (but need to
// preserve final state?)
$$ . on _destroy = $$ . fragment = null ;
$$ . ctx = [ ] ;
}
}
function make _dirty ( component , i ) {
if ( component . $$ . dirty [ 0 ] === - 1 ) {
dirty _components . push ( component ) ;
schedule _update ( ) ;
component . $$ . dirty . fill ( 0 ) ;
}
component . $$ . dirty [ ( i / 31 ) | 0 ] |= 1 << i % 31 ;
}
function init (
component ,
options ,
instance ,
create _fragment ,
not _equal ,
props ,
dirty = [ - 1 ]
) {
const parent _component = current _component ;
set _current _component ( component ) ;
const $$ = ( component . $$ = {
fragment : null ,
ctx : null ,
// state
props ,
update : noop ,
not _equal ,
bound : blank _object ( ) ,
// lifecycle
on _mount : [ ] ,
on _destroy : [ ] ,
on _disconnect : [ ] ,
before _update : [ ] ,
after _update : [ ] ,
context : new Map ( parent _component ? parent _component . $$ . context : [ ] ) ,
// everything else
callbacks : blank _object ( ) ,
dirty ,
skip _bound : false ,
} ) ;
let ready = false ;
$$ . ctx = instance
? instance ( component , options . props || { } , ( i , ret , ... rest ) => {
const value = rest . length ? rest [ 0 ] : ret ;
if ( $$ . ctx && not _equal ( $$ . ctx [ i ] , ( $$ . ctx [ i ] = value ) ) ) {
if ( ! $$ . skip _bound && $$ . bound [ i ] ) $$ . bound [ i ] ( value ) ;
if ( ready ) make _dirty ( component , i ) ;
}
return ret ;
} )
: [ ] ;
$$ . update ( ) ;
ready = true ;
run _all ( $$ . before _update ) ;
// `false` as a special case of no DOM component
$$ . fragment = create _fragment ? create _fragment ( $$ . ctx ) : false ;
if ( options . target ) {
if ( options . hydrate ) {
const nodes = children ( options . target ) ;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$ . fragment && $$ . fragment . l ( nodes ) ;
nodes . forEach ( detach ) ;
} else {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$ . fragment && $$ . fragment . c ( ) ;
}
if ( options . intro ) transition _in ( component . $$ . fragment ) ;
mount _component (
component ,
options . target ,
options . anchor ,
options . customElement
) ;
flush ( ) ;
}
set _current _component ( parent _component ) ;
}
/ * *
* Base class for Svelte components . Used when dev = false .
* /
class SvelteComponent {
$destroy ( ) {
destroy _component ( this , 1 ) ;
this . $destroy = noop ;
}
$on ( type , callback ) {
const callbacks =
this . $$ . callbacks [ type ] || ( this . $$ . callbacks [ type ] = [ ] ) ;
callbacks . push ( callback ) ;
return ( ) => {
const index = callbacks . indexOf ( callback ) ;
if ( index !== - 1 ) callbacks . splice ( index , 1 ) ;
} ;
}
$set ( $$props ) {
if ( this . $$set && ! is _empty ( $$props ) ) {
this . $$ . skip _bound = true ;
this . $$set ( $$props ) ;
this . $$ . skip _bound = false ;
}
}
}
function dispatch _dev ( type , detail ) {
document . dispatchEvent (
custom _event ( type , Object . assign ( { version : "3.35.0" } , detail ) )
) ;
}
function append _dev ( target , node ) {
dispatch _dev ( "SvelteDOMInsert" , { target , node } ) ;
append ( target , node ) ;
}
function insert _dev ( target , node , anchor ) {
dispatch _dev ( "SvelteDOMInsert" , { target , node , anchor } ) ;
insert ( target , node , anchor ) ;
}
function detach _dev ( node ) {
dispatch _dev ( "SvelteDOMRemove" , { node } ) ;
detach ( node ) ;
}
function listen _dev (
node ,
event ,
handler ,
options ,
has _prevent _default ,
has _stop _propagation
) {
const modifiers =
options === true
? [ "capture" ]
: options
? Array . from ( Object . keys ( options ) )
: [ ] ;
if ( has _prevent _default ) modifiers . push ( "preventDefault" ) ;
if ( has _stop _propagation ) modifiers . push ( "stopPropagation" ) ;
dispatch _dev ( "SvelteDOMAddEventListener" , {
node ,
event ,
handler ,
modifiers ,
} ) ;
const dispose = listen ( node , event , handler , options ) ;
return ( ) => {
dispatch _dev ( "SvelteDOMRemoveEventListener" , {
node ,
event ,
handler ,
modifiers ,
} ) ;
dispose ( ) ;
} ;
}
function attr _dev ( node , attribute , value ) {
attr ( node , attribute , value ) ;
if ( value == null )
dispatch _dev ( "SvelteDOMRemoveAttribute" , { node , attribute } ) ;
else dispatch _dev ( "SvelteDOMSetAttribute" , { node , attribute , value } ) ;
}
function set _data _dev ( text , data ) {
data = "" + data ;
if ( text . wholeText === data ) return ;
dispatch _dev ( "SvelteDOMSetData" , { node : text , data } ) ;
text . data = data ;
}
function validate _each _argument ( arg ) {
if (
typeof arg !== "string" &&
! ( arg && typeof arg === "object" && "length" in arg )
) {
let msg = "{#each} only iterates over array-like objects." ;
if ( typeof Symbol === "function" && arg && Symbol . iterator in arg ) {
msg += " You can use a spread to convert this iterable into an array." ;
}
throw new Error ( msg ) ;
}
}
function validate _slots ( name , slot , keys ) {
for ( const slot _key of Object . keys ( slot ) ) {
if ( ! ~ keys . indexOf ( slot _key ) ) {
console . warn ( ` < ${ name } > received an unexpected slot " ${ slot _key } ". ` ) ;
}
}
}
/ * *
* Base class for Svelte components with some minor dev - enhancements . Used when dev = true .
* /
class SvelteComponentDev extends SvelteComponent {
constructor ( options ) {
if ( ! options || ( ! options . target && ! options . $$inline ) ) {
throw new Error ( "'target' is a required option" ) ;
}
super ( ) ;
}
$destroy ( ) {
super . $destroy ( ) ;
this . $destroy = ( ) => {
console . warn ( "Component was already destroyed" ) ; // eslint-disable-line no-console
} ;
}
$capture _state ( ) { }
$inject _state ( ) { }
}
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2021-03-13 04:10:19 +03:00
Copyright ( c ) Microsoft Corporation .
Permission to use , copy , modify , and / or distribute this software for any
purpose with or without fee is hereby granted .
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS . IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL , DIRECT ,
INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE , DATA OR PROFITS , WHETHER IN AN ACTION OF CONTRACT , NEGLIGENCE OR
OTHER TORTIOUS ACTION , ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE .
2021-04-08 18:50:55 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
var t = function ( n , e ) {
return ( t =
Object . setPrototypeOf ||
( { _ _proto _ _ : [ ] } instanceof Array &&
function ( t , n ) {
t . _ _proto _ _ = n ;
} ) ||
function ( t , n ) {
for ( var e in n )
Object . prototype . hasOwnProperty . call ( n , e ) && ( t [ e ] = n [ e ] ) ;
} ) ( n , e ) ;
} ;
function n$5 ( n , e ) {
if ( "function" != typeof e && null !== e )
throw new TypeError (
"Class extends value " + String ( e ) + " is not a constructor or null"
) ;
function r ( ) {
this . constructor = n ;
}
t ( n , e ) ,
( n . prototype =
null === e ? Object . create ( e ) : ( ( r . prototype = e . prototype ) , new r ( ) ) ) ;
}
var e$2 = function ( ) {
return ( e$2 =
Object . assign ||
function ( t ) {
for ( var n , e = 1 , r = arguments . length ; e < r ; e ++ )
for ( var o in ( n = arguments [ e ] ) )
Object . prototype . hasOwnProperty . call ( n , o ) && ( t [ o ] = n [ o ] ) ;
return t ;
} ) . apply ( this , arguments ) ;
} ;
function r$3 ( t , n , e , r ) {
return new ( e || ( e = Promise ) ) ( function ( o , a ) {
function i ( t ) {
try {
u ( r . next ( t ) ) ;
} catch ( t ) {
a ( t ) ;
}
}
function c ( t ) {
try {
u ( r . throw ( t ) ) ;
} catch ( t ) {
a ( t ) ;
}
}
function u ( t ) {
var n ;
t . done
? o ( t . value )
: ( ( n = t . value ) ,
n instanceof e
? n
: new e ( function ( t ) {
t ( n ) ;
} ) ) . then ( i , c ) ;
}
u ( ( r = r . apply ( t , n || [ ] ) ) . next ( ) ) ;
} ) ;
}
function o$6 ( t , n ) {
var e ,
r ,
o ,
a ,
i = {
label : 0 ,
sent : function ( ) {
if ( 1 & o [ 0 ] ) throw o [ 1 ] ;
return o [ 1 ] ;
} ,
trys : [ ] ,
ops : [ ] ,
} ;
return (
( a = { next : c ( 0 ) , throw : c ( 1 ) , return : c ( 2 ) } ) ,
"function" == typeof Symbol &&
( a [ Symbol . iterator ] = function ( ) {
return this ;
} ) ,
a
) ;
function c ( a ) {
return function ( c ) {
return ( function ( a ) {
if ( e ) throw new TypeError ( "Generator is already executing." ) ;
for ( ; i ; )
try {
if (
( ( e = 1 ) ,
r &&
( o =
2 & a [ 0 ]
? r . return
: a [ 0 ]
? r . throw || ( ( o = r . return ) && o . call ( r ) , 0 )
: r . next ) &&
! ( o = o . call ( r , a [ 1 ] ) ) . done )
)
return o ;
switch ( ( ( r = 0 ) , o && ( a = [ 2 & a [ 0 ] , o . value ] ) , a [ 0 ] ) ) {
case 0 :
case 1 :
o = a ;
break ;
case 4 :
return i . label ++ , { value : a [ 1 ] , done : ! 1 } ;
case 5 :
i . label ++ , ( r = a [ 1 ] ) , ( a = [ 0 ] ) ;
continue ;
case 7 :
( a = i . ops . pop ( ) ) , i . trys . pop ( ) ;
continue ;
default :
if (
! ( ( o = i . trys ) ,
( o = o . length > 0 && o [ o . length - 1 ] ) ||
( 6 !== a [ 0 ] && 2 !== a [ 0 ] ) )
) {
i = 0 ;
continue ;
}
if ( 3 === a [ 0 ] && ( ! o || ( a [ 1 ] > o [ 0 ] && a [ 1 ] < o [ 3 ] ) ) ) {
i . label = a [ 1 ] ;
break ;
}
if ( 6 === a [ 0 ] && i . label < o [ 1 ] ) {
( i . label = o [ 1 ] ) , ( o = a ) ;
break ;
}
if ( o && i . label < o [ 2 ] ) {
( i . label = o [ 2 ] ) , i . ops . push ( a ) ;
break ;
}
o [ 2 ] && i . ops . pop ( ) , i . trys . pop ( ) ;
continue ;
}
a = n . call ( t , i ) ;
} catch ( t ) {
( a = [ 6 , t ] ) , ( r = 0 ) ;
} finally {
e = o = 0 ;
}
if ( 5 & a [ 0 ] ) throw a [ 1 ] ;
return { value : a [ 0 ] ? a [ 1 ] : void 0 , done : ! 0 } ;
} ) ( [ a , c ] ) ;
} ;
}
}
function a$5 ( t , n ) {
void 0 === n && ( n = ! 1 ) ;
var e = ( function ( ) {
var t = new Int8Array ( 1 ) ;
window . crypto . getRandomValues ( t ) ;
var n = new Uint8Array ( Math . max ( 16 , Math . abs ( t [ 0 ] ) ) ) ;
return window . crypto . getRandomValues ( n ) , n . join ( "" ) ;
} ) ( ) ;
return (
Object . defineProperty ( window , e , {
value : function ( r ) {
return (
n && Reflect . deleteProperty ( window , e ) , null == t ? void 0 : t ( r )
) ;
} ,
writable : ! 1 ,
configurable : ! 0 ,
} ) ,
e
) ;
}
function i$3 ( t , n ) {
return (
void 0 === n && ( n = { } ) ,
r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( r ) {
return [
2 ,
new Promise ( function ( r , o ) {
var i = a$5 ( function ( t ) {
r ( t ) , Reflect . deleteProperty ( window , c ) ;
} , ! 0 ) ,
c = a$5 ( function ( t ) {
o ( t ) , Reflect . deleteProperty ( window , i ) ;
} , ! 0 ) ;
window . rpc . notify ( t , e$2 ( { callback : i , error : c } , n ) ) ;
} ) ,
] ;
} ) ;
} )
) ;
}
Object . freeze ( { _ _proto _ _ : null , transformCallback : a$5 , invoke : i$3 } ) ;
function n$4 ( n ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( i ) {
return [ 2 , i$3 ( "tauri" , n ) ] ;
} ) ;
} ) ;
}
function o$5 ( n , o , s , u ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return (
"object" == typeof u && Object . freeze ( u ) ,
[
2 ,
n$4 ( {
_ _tauriModule : "Shell" ,
message : {
cmd : "execute" ,
program : n ,
sidecar : o ,
onEventFn : a$5 ( s ) ,
args : "string" == typeof u ? [ u ] : u ,
} ,
} ) ,
]
) ;
} ) ;
} ) ;
}
var s$4 = ( function ( ) {
function t ( ) {
this . eventListeners = Object . create ( null ) ;
}
return (
( t . prototype . addEventListener = function ( t , e ) {
t in this . eventListeners
? this . eventListeners [ t ] . push ( e )
: ( this . eventListeners [ t ] = [ e ] ) ;
} ) ,
( t . prototype . _emit = function ( t , e ) {
if ( t in this . eventListeners )
for ( var n = 0 , r = this . eventListeners [ t ] ; n < r . length ; n ++ ) {
( 0 , r [ n ] ) ( e ) ;
}
} ) ,
( t . prototype . on = function ( t , e ) {
return this . addEventListener ( t , e ) , this ;
} ) ,
t
) ;
} ) ( ) ,
u$6 = ( function ( ) {
function n ( t ) {
this . pid = t ;
}
return (
( n . prototype . write = function ( n ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Shell" ,
message : { cmd : "stdinWrite" , pid : this . pid , buffer : n } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( n . prototype . kill = function ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Shell" ,
message : { cmd : "killChild" , pid : this . pid } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
n
) ;
} ) ( ) ,
a$4 = ( function ( r ) {
function i ( t , e ) {
void 0 === e && ( e = [ ] ) ;
var n = r . call ( this ) || this ;
return (
( n . sidecar = ! 1 ) ,
( n . stdout = new s$4 ( ) ) ,
( n . stderr = new s$4 ( ) ) ,
( n . pid = null ) ,
( n . program = t ) ,
( n . args = "string" == typeof e ? [ e ] : e ) ,
n
) ;
}
return (
n$5 ( i , r ) ,
( i . sidecar = function ( t , e ) {
void 0 === e && ( e = [ ] ) ;
var n = new i ( t , e ) ;
return ( n . sidecar = ! 0 ) , n ;
} ) ,
( i . prototype . spawn = function ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
var t = this ;
return o$6 ( this , function ( e ) {
return [
2 ,
o$5 (
this . program ,
this . sidecar ,
function ( e ) {
switch ( e . event ) {
case "Error" :
t . _emit ( "error" , e . payload ) ;
break ;
case "Terminated" :
t . _emit ( "close" , e . payload ) ;
break ;
case "Stdout" :
t . stdout . _emit ( "data" , e . payload ) ;
break ;
case "Stderr" :
t . stderr . _emit ( "data" , e . payload ) ;
}
} ,
this . args
) . then ( function ( t ) {
return new u$6 ( t ) ;
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . execute = function ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
var t = this ;
return o$6 ( this , function ( e ) {
return [
2 ,
new Promise ( function ( e , n ) {
t . on ( "error" , n ) ;
var r = [ ] ,
i = [ ] ;
t . stdout . on ( "data" , function ( t ) {
r . push ( t ) ;
} ) ,
t . stderr . on ( "data" , function ( t ) {
i . push ( t ) ;
} ) ,
t . on ( "close" , function ( t ) {
e ( {
code : t . code ,
signal : t . signal ,
stdout : r . join ( "\n" ) ,
stderr : i . join ( "\n" ) ,
} ) ;
} ) ,
t . spawn ( ) . catch ( n ) ;
} ) ,
] ;
} ) ;
} ) ;
} ) ,
i
) ;
} ) ( s$4 ) ;
function d$3 ( n , r ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Shell" ,
message : { cmd : "open" , path : n , with : r } ,
} ) ,
] ;
} ) ;
} ) ;
}
Object . freeze ( { _ _proto _ _ : null , Command : a$4 , Child : u$6 , open : d$3 } ) ;
function r$2 ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "App" ,
mainThread : ! 0 ,
message : { cmd : "getAppVersion" } ,
} ) ,
] ;
} ) ;
} ) ;
}
function n$3 ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "App" ,
mainThread : ! 0 ,
message : { cmd : "getAppName" } ,
} ) ,
] ;
} ) ;
} ) ;
}
function u$5 ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "App" ,
mainThread : ! 0 ,
message : { cmd : "getTauriVersion" } ,
} ) ,
] ;
} ) ;
} ) ;
}
function o$4 ( r ) {
return (
void 0 === r && ( r = 0 ) ,
r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "App" ,
mainThread : ! 0 ,
message : { cmd : "exit" , exitCode : r } ,
} ) ,
] ;
} ) ;
} )
) ;
}
function a$3 ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "App" ,
mainThread : ! 0 ,
message : { cmd : "relaunch" } ,
} ) ,
] ;
} ) ;
} ) ;
}
Object . freeze ( {
_ _proto _ _ : null ,
getName : n$3 ,
getVersion : r$2 ,
getTauriVersion : u$5 ,
relaunch : a$3 ,
exit : o$4 ,
} ) ;
/* src/components/Welcome.svelte generated by Svelte v3.35.0 */
const file$b = "src/components/Welcome.svelte" ;
function create _fragment$b ( ctx ) {
let h1 ;
let t1 ;
let p0 ;
let t3 ;
let p1 ;
let t4 ;
let t5 ;
let t6 ;
let p2 ;
let t7 ;
let t8 ;
let t9 ;
let p3 ;
let t10 ;
let t11 ;
let t12 ;
let button0 ;
let t14 ;
let button1 ;
let mounted ;
let dispose ;
const block = {
c : function create ( ) {
h1 = element ( "h1" ) ;
h1 . textContent = "Welcome" ;
t1 = space ( ) ;
p0 = element ( "p" ) ;
p0 . textContent =
"Tauri's API capabilities using the ` @tauri-apps/api ` package. It's used as\n the main validation app, serving as the testbed of our development process. In\n the future, this app will be used on Tauri's integration tests." ;
t3 = space ( ) ;
p1 = element ( "p" ) ;
t4 = text ( "Current App version: " ) ;
t5 = text ( /*version*/ ctx [ 0 ] ) ;
t6 = space ( ) ;
p2 = element ( "p" ) ;
t7 = text ( "Current Tauri version: " ) ;
t8 = text ( /*tauriVersion*/ ctx [ 1 ] ) ;
t9 = space ( ) ;
p3 = element ( "p" ) ;
t10 = text ( "Current App name: " ) ;
t11 = text ( /*appName*/ ctx [ 2 ] ) ;
t12 = space ( ) ;
button0 = element ( "button" ) ;
button0 . textContent = "Close application" ;
t14 = space ( ) ;
button1 = element ( "button" ) ;
button1 . textContent = "Relaunch application" ;
add _location ( h1 , file$b , 18 , 0 , 431 ) ;
add _location ( p0 , file$b , 19 , 0 , 448 ) ;
add _location ( p1 , file$b , 25 , 0 , 684 ) ;
add _location ( p2 , file$b , 26 , 0 , 722 ) ;
add _location ( p3 , file$b , 27 , 0 , 767 ) ;
attr _dev ( button0 , "class" , "button" ) ;
add _location ( button0 , file$b , 29 , 0 , 803 ) ;
attr _dev ( button1 , "class" , "button" ) ;
add _location ( button1 , file$b , 30 , 0 , 873 ) ;
} ,
l : function claim ( nodes ) {
throw new Error (
"options.hydrate only works if the component was compiled with the `hydratable: true` option"
) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , h1 , anchor ) ;
insert _dev ( target , t1 , anchor ) ;
insert _dev ( target , p0 , anchor ) ;
insert _dev ( target , t3 , anchor ) ;
insert _dev ( target , p1 , anchor ) ;
append _dev ( p1 , t4 ) ;
append _dev ( p1 , t5 ) ;
insert _dev ( target , t6 , anchor ) ;
insert _dev ( target , p2 , anchor ) ;
append _dev ( p2 , t7 ) ;
append _dev ( p2 , t8 ) ;
insert _dev ( target , t9 , anchor ) ;
insert _dev ( target , p3 , anchor ) ;
append _dev ( p3 , t10 ) ;
append _dev ( p3 , t11 ) ;
insert _dev ( target , t12 , anchor ) ;
insert _dev ( target , button0 , anchor ) ;
insert _dev ( target , t14 , anchor ) ;
insert _dev ( target , button1 , anchor ) ;
if ( ! mounted ) {
dispose = [
listen _dev (
button0 ,
"click" ,
/*closeApp*/ ctx [ 3 ] ,
false ,
false ,
false
) ,
listen _dev (
button1 ,
"click" ,
/*relaunchApp*/ ctx [ 4 ] ,
false ,
false ,
false
) ,
] ;
mounted = true ;
}
} ,
p : function update ( ctx , [ dirty ] ) {
if ( dirty & /*version*/ 1 ) set _data _dev ( t5 , /*version*/ ctx [ 0 ] ) ;
if ( dirty & /*tauriVersion*/ 2 )
set _data _dev ( t8 , /*tauriVersion*/ ctx [ 1 ] ) ;
if ( dirty & /*appName*/ 4 ) set _data _dev ( t11 , /*appName*/ ctx [ 2 ] ) ;
} ,
i : noop ,
o : noop ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( h1 ) ;
if ( detaching ) detach _dev ( t1 ) ;
if ( detaching ) detach _dev ( p0 ) ;
if ( detaching ) detach _dev ( t3 ) ;
if ( detaching ) detach _dev ( p1 ) ;
if ( detaching ) detach _dev ( t6 ) ;
if ( detaching ) detach _dev ( p2 ) ;
if ( detaching ) detach _dev ( t9 ) ;
if ( detaching ) detach _dev ( p3 ) ;
if ( detaching ) detach _dev ( t12 ) ;
if ( detaching ) detach _dev ( button0 ) ;
if ( detaching ) detach _dev ( t14 ) ;
if ( detaching ) detach _dev ( button1 ) ;
mounted = false ;
run _all ( dispose ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _fragment$b . name ,
type : "component" ,
source : "" ,
ctx ,
} ) ;
return block ;
}
function instance$b ( $$self , $$props , $$invalidate ) {
let { $$slots : slots = { } , $$scope } = $$props ;
validate _slots ( "Welcome" , slots , [ ] ) ;
let version = 0 ;
let tauriVersion = 0 ;
let appName = "Unknown" ;
n$3 ( ) . then ( ( n ) => {
$$invalidate ( 2 , ( appName = n ) ) ;
} ) ;
r$2 ( ) . then ( ( v ) => {
$$invalidate ( 0 , ( version = v ) ) ;
} ) ;
u$5 ( ) . then ( ( v ) => {
$$invalidate ( 1 , ( tauriVersion = v ) ) ;
} ) ;
async function closeApp ( ) {
await o$4 ( ) ;
}
async function relaunchApp ( ) {
await a$3 ( ) ;
}
const writable _props = [ ] ;
Object . keys ( $$props ) . forEach ( ( key ) => {
if ( ! ~ writable _props . indexOf ( key ) && key . slice ( 0 , 2 ) !== "$$" )
console . warn ( ` <Welcome> was created with unknown prop ' ${ key } ' ` ) ;
} ) ;
$$self . $capture _state = ( ) => ( {
getName : n$3 ,
getVersion : r$2 ,
getTauriVersion : u$5 ,
relaunch : a$3 ,
exit : o$4 ,
version ,
tauriVersion ,
appName ,
closeApp ,
relaunchApp ,
} ) ;
$$self . $inject _state = ( $$props ) => {
if ( "version" in $$props ) $$invalidate ( 0 , ( version = $$props . version ) ) ;
if ( "tauriVersion" in $$props )
$$invalidate ( 1 , ( tauriVersion = $$props . tauriVersion ) ) ;
if ( "appName" in $$props ) $$invalidate ( 2 , ( appName = $$props . appName ) ) ;
} ;
if ( $$props && "$$inject" in $$props ) {
$$self . $inject _state ( $$props . $$inject ) ;
}
return [ version , tauriVersion , appName , closeApp , relaunchApp ] ;
}
class Welcome extends SvelteComponentDev {
constructor ( options ) {
super ( options ) ;
init ( this , options , instance$b , create _fragment$b , safe _not _equal , { } ) ;
dispatch _dev ( "SvelteRegisterComponent" , {
component : this ,
tagName : "Welcome" ,
options ,
id : create _fragment$b . name ,
} ) ;
}
}
function e$1 ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( { _ _tauriModule : "Cli" , message : { cmd : "cliMatches" } } ) ,
] ;
} ) ;
} ) ;
}
Object . freeze ( { _ _proto _ _ : null , getMatches : e$1 } ) ;
/* src/components/Cli.svelte generated by Svelte v3.35.0 */
const file$a = "src/components/Cli.svelte" ;
function create _fragment$a ( ctx ) {
let div ;
let button ;
let mounted ;
let dispose ;
const block = {
c : function create ( ) {
div = element ( "div" ) ;
button = element ( "button" ) ;
button . textContent = "Get matches" ;
attr _dev ( button , "class" , "button" ) ;
attr _dev ( button , "id" , "cli-matches" ) ;
add _location ( button , file$a , 11 , 2 , 187 ) ;
add _location ( div , file$a , 10 , 0 , 179 ) ;
} ,
l : function claim ( nodes ) {
throw new Error (
"options.hydrate only works if the component was compiled with the `hydratable: true` option"
) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , div , anchor ) ;
append _dev ( div , button ) ;
if ( ! mounted ) {
dispose = listen _dev (
button ,
"click" ,
/*cliMatches*/ ctx [ 0 ] ,
false ,
false ,
false
) ;
mounted = true ;
}
} ,
p : noop ,
i : noop ,
o : noop ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( div ) ;
mounted = false ;
dispose ( ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _fragment$a . name ,
type : "component" ,
source : "" ,
ctx ,
} ) ;
return block ;
}
function instance$a ( $$self , $$props , $$invalidate ) {
let { $$slots : slots = { } , $$scope } = $$props ;
validate _slots ( "Cli" , slots , [ ] ) ;
let { onMessage } = $$props ;
function cliMatches ( ) {
e$1 ( ) . then ( onMessage ) . catch ( onMessage ) ;
}
const writable _props = [ "onMessage" ] ;
Object . keys ( $$props ) . forEach ( ( key ) => {
if ( ! ~ writable _props . indexOf ( key ) && key . slice ( 0 , 2 ) !== "$$" )
console . warn ( ` <Cli> was created with unknown prop ' ${ key } ' ` ) ;
} ) ;
$$self . $$set = ( $$props ) => {
if ( "onMessage" in $$props )
$$invalidate ( 1 , ( onMessage = $$props . onMessage ) ) ;
} ;
$$self . $capture _state = ( ) => ( { getMatches : e$1 , onMessage , cliMatches } ) ;
$$self . $inject _state = ( $$props ) => {
if ( "onMessage" in $$props )
$$invalidate ( 1 , ( onMessage = $$props . onMessage ) ) ;
} ;
if ( $$props && "$$inject" in $$props ) {
$$self . $inject _state ( $$props . $$inject ) ;
}
return [ cliMatches , onMessage ] ;
}
class Cli extends SvelteComponentDev {
constructor ( options ) {
super ( options ) ;
init ( this , options , instance$a , create _fragment$a , safe _not _equal , {
onMessage : 1 ,
} ) ;
dispatch _dev ( "SvelteRegisterComponent" , {
component : this ,
tagName : "Cli" ,
options ,
id : create _fragment$a . name ,
} ) ;
const { ctx } = this . $$ ;
const props = options . props || { } ;
if ( /*onMessage*/ ctx [ 1 ] === undefined && ! ( "onMessage" in props ) ) {
console . warn ( "<Cli> was created without expected prop 'onMessage'" ) ;
}
}
get onMessage ( ) {
throw new Error (
"<Cli>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
set onMessage ( value ) {
throw new Error (
"<Cli>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
}
function e ( e , o ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
var s = this ;
return o$6 ( this , function ( c ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Event" ,
message : { cmd : "listen" , event : e , handler : a$5 ( o ) } ,
} ) . then ( function ( i ) {
return function ( ) {
return r$3 ( s , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( n ) {
return [ 2 , u$4 ( i ) ] ;
} ) ;
} ) ;
} ;
} ) ,
] ;
} ) ;
} ) ;
}
function u$4 ( i ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( n ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Event" ,
message : { cmd : "unlisten" , eventId : i } ,
} ) ,
] ;
} ) ;
} ) ;
}
function o$3 ( i , r ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( n ) {
return [ 2 , e ( i , r ) ] ;
} ) ;
} ) ;
}
function s$3 ( i , r ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( n ) {
return [
2 ,
e ( i , function ( n ) {
r ( n ) , u$4 ( n . id ) . catch ( function ( ) { } ) ;
} ) ,
] ;
} ) ;
} ) ;
}
function c$3 ( i , e , u ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( n ) {
switch ( n . label ) {
case 0 :
return [
4 ,
n$4 ( {
_ _tauriModule : "Event" ,
message : { cmd : "emit" , event : i , windowLabel : e , payload : u } ,
} ) ,
] ;
case 1 :
return n . sent ( ) , [ 2 ] ;
}
} ) ;
} ) ;
}
function n$2 ( r , i ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [ 2 , c$3 ( r , void 0 , i ) ] ;
} ) ;
} ) ;
}
Object . freeze ( { _ _proto _ _ : null , emit : n$2 , listen : o$3 , once : s$3 } ) ;
/* src/components/Communication.svelte generated by Svelte v3.35.0 */
const file$9 = "src/components/Communication.svelte" ;
function create _fragment$9 ( ctx ) {
let div ;
let button0 ;
let t1 ;
let button1 ;
let t3 ;
let button2 ;
let mounted ;
let dispose ;
const block = {
c : function create ( ) {
div = element ( "div" ) ;
button0 = element ( "button" ) ;
button0 . textContent = "Call Log API" ;
t1 = space ( ) ;
button1 = element ( "button" ) ;
button1 . textContent = "Call Request (async) API" ;
t3 = space ( ) ;
button2 = element ( "button" ) ;
button2 . textContent = "Send event to Rust" ;
attr _dev ( button0 , "class" , "button" ) ;
attr _dev ( button0 , "id" , "log" ) ;
add _location ( button0 , file$9 , 42 , 2 , 839 ) ;
attr _dev ( button1 , "class" , "button" ) ;
attr _dev ( button1 , "id" , "request" ) ;
add _location ( button1 , file$9 , 43 , 2 , 910 ) ;
attr _dev ( button2 , "class" , "button" ) ;
attr _dev ( button2 , "id" , "event" ) ;
add _location ( button2 , file$9 , 46 , 2 , 1016 ) ;
add _location ( div , file$9 , 41 , 0 , 831 ) ;
} ,
l : function claim ( nodes ) {
throw new Error (
"options.hydrate only works if the component was compiled with the `hydratable: true` option"
) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , div , anchor ) ;
append _dev ( div , button0 ) ;
append _dev ( div , t1 ) ;
append _dev ( div , button1 ) ;
append _dev ( div , t3 ) ;
append _dev ( div , button2 ) ;
if ( ! mounted ) {
dispose = [
listen _dev ( button0 , "click" , /*log*/ ctx [ 0 ] , false , false , false ) ,
listen _dev (
button1 ,
"click" ,
/*performRequest*/ ctx [ 1 ] ,
false ,
false ,
false
) ,
listen _dev (
button2 ,
"click" ,
/*emitEvent*/ ctx [ 2 ] ,
false ,
false ,
false
) ,
] ;
mounted = true ;
}
} ,
p : noop ,
i : noop ,
o : noop ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( div ) ;
mounted = false ;
run _all ( dispose ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _fragment$9 . name ,
type : "component" ,
source : "" ,
ctx ,
} ) ;
return block ;
}
function instance$9 ( $$self , $$props , $$invalidate ) {
let { $$slots : slots = { } , $$scope } = $$props ;
validate _slots ( "Communication" , slots , [ ] ) ;
let { onMessage } = $$props ;
let unlisten ;
onMount ( async ( ) => {
unlisten = await o$3 ( "rust-event" , onMessage ) ;
} ) ;
onDestroy ( ( ) => {
if ( unlisten ) {
unlisten ( ) ;
}
} ) ;
function log ( ) {
i$3 ( "log_operation" , {
event : "tauri-click" ,
payload : "this payload is optional because we used Option in Rust" ,
} ) ;
}
function performRequest ( ) {
i$3 ( "perform_request" , {
endpoint : "dummy endpoint arg" ,
body : { id : 5 , name : "test" } ,
} )
. then ( onMessage )
. catch ( onMessage ) ;
}
function emitEvent ( ) {
n$2 ( "js-event" , "this is the payload string" ) ;
}
const writable _props = [ "onMessage" ] ;
Object . keys ( $$props ) . forEach ( ( key ) => {
if ( ! ~ writable _props . indexOf ( key ) && key . slice ( 0 , 2 ) !== "$$" )
console . warn ( ` <Communication> was created with unknown prop ' ${ key } ' ` ) ;
} ) ;
$$self . $$set = ( $$props ) => {
if ( "onMessage" in $$props )
$$invalidate ( 3 , ( onMessage = $$props . onMessage ) ) ;
} ;
$$self . $capture _state = ( ) => ( {
listen : o$3 ,
emit : n$2 ,
invoke : i$3 ,
onMount ,
onDestroy ,
onMessage ,
unlisten ,
log ,
performRequest ,
emitEvent ,
} ) ;
$$self . $inject _state = ( $$props ) => {
if ( "onMessage" in $$props )
$$invalidate ( 3 , ( onMessage = $$props . onMessage ) ) ;
if ( "unlisten" in $$props ) unlisten = $$props . unlisten ;
} ;
if ( $$props && "$$inject" in $$props ) {
$$self . $inject _state ( $$props . $$inject ) ;
}
return [ log , performRequest , emitEvent , onMessage ] ;
}
class Communication extends SvelteComponentDev {
constructor ( options ) {
super ( options ) ;
init ( this , options , instance$9 , create _fragment$9 , safe _not _equal , {
onMessage : 3 ,
} ) ;
dispatch _dev ( "SvelteRegisterComponent" , {
component : this ,
tagName : "Communication" ,
options ,
id : create _fragment$9 . name ,
} ) ;
const { ctx } = this . $$ ;
const props = options . props || { } ;
if ( /*onMessage*/ ctx [ 3 ] === undefined && ! ( "onMessage" in props ) ) {
console . warn (
"<Communication> was created without expected prop 'onMessage'"
) ;
}
}
get onMessage ( ) {
throw new Error (
"<Communication>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
set onMessage ( value ) {
throw new Error (
"<Communication>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
}
function i$2 ( i ) {
return (
void 0 === i && ( i = { } ) ,
r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( o ) {
return (
"object" == typeof i && Object . freeze ( i ) ,
[
2 ,
n$4 ( {
_ _tauriModule : "Dialog" ,
mainThread : ! 0 ,
message : { cmd : "openDialog" , options : i } ,
} ) ,
]
) ;
} ) ;
} )
) ;
}
function r$1 ( i ) {
return (
void 0 === i && ( i = { } ) ,
r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( o ) {
return (
"object" == typeof i && Object . freeze ( i ) ,
[
2 ,
n$4 ( {
_ _tauriModule : "Dialog" ,
mainThread : ! 0 ,
message : { cmd : "saveDialog" , options : i } ,
} ) ,
]
) ;
} ) ;
} )
) ;
}
Object . freeze ( { _ _proto _ _ : null , open : i$2 , save : r$1 } ) ;
var r ;
function o$2 ( r , o ) {
return (
void 0 === o && ( o = { } ) ,
r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Fs" ,
message : { cmd : "readTextFile" , path : r , options : o } ,
} ) ,
] ;
} ) ;
} )
) ;
}
function n$1 ( r , o ) {
return (
void 0 === o && ( o = { } ) ,
r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Fs" ,
message : { cmd : "readBinaryFile" , path : r , options : o } ,
} ) ,
] ;
} ) ;
} )
) ;
}
function u$3 ( r , o ) {
return (
void 0 === o && ( o = { } ) ,
r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return (
"object" == typeof o && Object . freeze ( o ) ,
"object" == typeof r && Object . freeze ( r ) ,
[
2 ,
n$4 ( {
_ _tauriModule : "Fs" ,
message : {
cmd : "writeFile" ,
path : r . path ,
contents : r . contents ,
options : o ,
} ,
} ) ,
]
) ;
} ) ;
} )
) ;
}
! ( function ( t ) {
( t [ ( t . Audio = 1 ) ] = "Audio" ) ,
( t [ ( t . Cache = 2 ) ] = "Cache" ) ,
( t [ ( t . Config = 3 ) ] = "Config" ) ,
( t [ ( t . Data = 4 ) ] = "Data" ) ,
( t [ ( t . LocalData = 5 ) ] = "LocalData" ) ,
( t [ ( t . Desktop = 6 ) ] = "Desktop" ) ,
( t [ ( t . Document = 7 ) ] = "Document" ) ,
( t [ ( t . Download = 8 ) ] = "Download" ) ,
( t [ ( t . Executable = 9 ) ] = "Executable" ) ,
( t [ ( t . Font = 10 ) ] = "Font" ) ,
( t [ ( t . Home = 11 ) ] = "Home" ) ,
( t [ ( t . Picture = 12 ) ] = "Picture" ) ,
( t [ ( t . Public = 13 ) ] = "Public" ) ,
( t [ ( t . Runtime = 14 ) ] = "Runtime" ) ,
( t [ ( t . Template = 15 ) ] = "Template" ) ,
( t [ ( t . Video = 16 ) ] = "Video" ) ,
( t [ ( t . Resource = 17 ) ] = "Resource" ) ,
( t [ ( t . App = 18 ) ] = "App" ) ,
( t [ ( t . Current = 19 ) ] = "Current" ) ;
} ) ( r || ( r = { } ) ) ;
function a$2 ( t ) {
var e = ( function ( t ) {
if ( t . length < 65536 )
return String . fromCharCode . apply ( null , Array . from ( t ) ) ;
for ( var e = "" , i = t . length , r = 0 ; r < i ; r ++ ) {
var o = t . subarray ( 65536 * r , 65536 * ( r + 1 ) ) ;
e += String . fromCharCode . apply ( null , Array . from ( o ) ) ;
}
return e ;
} ) ( new Uint8Array ( t ) ) ;
return btoa ( e ) ;
}
function s$2 ( r , o ) {
return (
void 0 === o && ( o = { } ) ,
r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return (
"object" == typeof o && Object . freeze ( o ) ,
"object" == typeof r && Object . freeze ( r ) ,
[
2 ,
n$4 ( {
_ _tauriModule : "Fs" ,
message : {
cmd : "writeBinaryFile" ,
path : r . path ,
contents : a$2 ( r . contents ) ,
options : o ,
} ,
} ) ,
]
) ;
} ) ;
} )
) ;
}
function c$2 ( r , o ) {
return (
void 0 === o && ( o = { } ) ,
r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Fs" ,
message : { cmd : "readDir" , path : r , options : o } ,
} ) ,
] ;
} ) ;
} )
) ;
}
function d$2 ( r , o ) {
return (
void 0 === o && ( o = { } ) ,
r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Fs" ,
message : { cmd : "createDir" , path : r , options : o } ,
} ) ,
] ;
} ) ;
} )
) ;
}
function f$1 ( r , o ) {
return (
void 0 === o && ( o = { } ) ,
r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Fs" ,
message : { cmd : "removeDir" , path : r , options : o } ,
} ) ,
] ;
} ) ;
} )
) ;
}
function l$1 ( r , o , n ) {
return (
void 0 === n && ( n = { } ) ,
r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Fs" ,
message : {
cmd : "copyFile" ,
source : r ,
destination : o ,
options : n ,
} ,
} ) ,
] ;
} ) ;
} )
) ;
}
function m ( r , o ) {
return (
void 0 === o && ( o = { } ) ,
r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Fs" ,
message : { cmd : "removeFile" , path : r , options : o } ,
} ) ,
] ;
} ) ;
} )
) ;
}
function p ( r , o , n ) {
return (
void 0 === n && ( n = { } ) ,
r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Fs" ,
message : {
cmd : "renameFile" ,
oldPath : r ,
newPath : o ,
options : n ,
} ,
} ) ,
] ;
} ) ;
} )
) ;
}
Object . freeze ( {
_ _proto _ _ : null ,
get BaseDirectory ( ) {
return r ;
} ,
get Dir ( ) {
return r ;
} ,
readTextFile : o$2 ,
readBinaryFile : n$1 ,
writeFile : u$3 ,
writeBinaryFile : s$2 ,
readDir : c$2 ,
createDir : d$2 ,
removeDir : f$1 ,
copyFile : l$1 ,
removeFile : m ,
renameFile : p ,
} ) ;
/* src/components/Dialog.svelte generated by Svelte v3.35.0 */
const file$8 = "src/components/Dialog.svelte" ;
function add _css$1 ( ) {
var style = element ( "style" ) ;
style . id = "svelte-1eg58yg-style" ;
style . textContent =
" # dialog - filter . svelte - 1 eg58yg { width : 260 px } \ n / * # sourceMappingURL = data : application / json ; charset = utf - 8 ; base64 , eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRGlhbG9nLnN2ZWx0ZSIsInNvdXJjZXMiOlsiRGlhbG9nLnN2ZWx0ZSJdLCJzb3VyY2VzQ29udGVudCI6WyI8c2NyaXB0PlxuICBpbXBvcnQgeyBvcGVuLCBzYXZlIH0gZnJvbSBcIkB0YXVyaS1hcHBzL2FwaS9kaWFsb2dcIjtcbiAgaW1wb3J0IHsgcmVhZEJpbmFyeUZpbGUgfSBmcm9tIFwiQHRhdXJpLWFwcHMvYXBpL2ZzXCI7XG5cbiAgZXhwb3J0IGxldCBvbk1lc3NhZ2U7XG4gIGxldCBkZWZhdWx0UGF0aCA9IG51bGw7XG4gIGxldCBmaWx0ZXIgPSBudWxsO1xuICBsZXQgbXVsdGlwbGUgPSBmYWxzZTtcbiAgbGV0IGRpcmVjdG9yeSA9IGZhbHNlO1xuXG4gIGZ1bmN0aW9uIGFycmF5QnVmZmVyVG9CYXNlNjQoYnVmZmVyLCBjYWxsYmFjaykge1xuICAgIHZhciBibG9iID0gbmV3IEJsb2IoW2J1ZmZlcl0sIHtcbiAgICAgIHR5cGU6IFwiYXBwbGljYXRpb24vb2N0ZXQtYmluYXJ5XCIsXG4gICAgfSk7XG4gICAgdmFyIHJlYWRlciA9IG5ldyBGaWxlUmVhZGVyKCk7XG4gICAgcmVhZGVyLm9ubG9hZCA9IGZ1bmN0aW9uIChldnQpIHtcbiAgICAgIHZhciBkYXRhdXJsID0gZXZ0LnRhcmdldC5yZXN1bHQ7XG4gICAgICBjYWxsYmFjayhkYXRhdXJsLnN1YnN0cihkYXRhdXJsLmluZGV4T2YoXCIsXCIpICsgMSkpO1xuICAgIH07XG4gICAgcmVhZGVyLnJlYWRBc0RhdGFVUkwoYmxvYik7XG4gIH1cblxuICBmdW5jdGlvbiBvcGVuRGlhbG9nKCkge1xuICAgIG9wZW4oe1xuICAgICAgZGVmYXVsdFBhdGgsXG4gICAgICBmaWx0ZXJzOiBmaWx0ZXJcbiAgICAgICAgPyBbXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIG5hbWU6IFwiVGF1cmkgRXhhbXBsZVwiLFxuICAgICAgICAgICAgICBleHRlbnNpb25zOiBmaWx0ZXIuc3BsaXQoXCIsXCIpLm1hcCgoZikgPT4gZi50cmltKCkpLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICBdXG4gICAgICAgIDogW10sXG4gICAgICBtdWx0aXBsZSxcbiAgICAgIGRpcmVjdG9yeSxcbiAgICB9KVxuICAgICAgLnRoZW4oZnVuY3Rpb24gKHJlcykge1xuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShyZXMpKSB7XG4gICAgICAgICAgb25NZXNzYWdlKHJlcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdmFyIHBhdGhUb1JlYWQgPSByZXM7XG4gICAgICAgICAgdmFyIGlzRmlsZSA9IHBhdGhUb1JlYWQubWF0Y2goL1xcUytcXC5cXFMrJC9nKTtcbiAgICAgICAgICByZWFkQmluYXJ5RmlsZShwYXRoVG9SZWFkKVxuICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24gKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgIGlmIChpc0ZpbGUpIHtcbiAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICBwYXRoVG9SZWFkLmluY2x1ZGVzKFwiLnBuZ1wiKSB8fFxuICAgICAgICAgICAgICAgICAgcGF0aFRvUmVhZC5pbmNsdWRlcyhcIi5qcGdcIilcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgIGFycmF5QnVmZmVyVG9CYXNlNjQoXG4gICAgICAgICAgICAgICAgICAgIG5ldyBVaW50OEFycmF5KHJlc3BvbnNlKSxcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKGJhc2U2NCkge1xuICAgICAgICAgICAgICAgICAgICAgIHZhciBzcmMgPSBcImRhdGE6aW1hZ2UvcG5nO2Jhc2U2NCxcIiArIGJhc2U2NDtcbiAgICAgICAgICAgICAgICAgICAgICBvbk1lc3NhZ2UoJzxpbWcgc3JjPVwiJyArIHNyYyArICdcIj48L2ltZz4nKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgb25NZXNzYWdlKHJlcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG9uTWVzc2FnZShyZXMpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLmNhdGNoKG9uTWVzc2FnZShyZXMpKTtcbiAgICAgICAgfVxuICAgICAgfSlcbiAgICAgIC5jYXRjaChvbk1lc3NhZ2UpO1xuICB9XG5cbiAgZnVuY3Rpb24gc2F2ZURpYWxvZygpIHtcbiAgICBzYXZlKHtcbiAgICAgIGRlZmF1bHRQYXRoLFxuICAgICAgZmlsdGVyczogZmlsdGVyXG4gICAgICAgID8gW1xuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBuYW1lOiBcIlRhdXJpIEV4YW1wbGVcIixcbiAgICAgICAgICAgICAgZXh0ZW5zaW9uczogZmlsdGVyLnNwbGl0KFwiLFwiKS5tYXAoKGYpID0 + IGYudHJpbSgpKSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgXVxuICAgICAgICA6IFtdLFxuICAgIH0pXG4gICAgICAudGhlbihvbk1lc3NhZ2UpXG4gICAgICAuY2F0Y2gob25NZXNzYWdlKTtcbiAgfVxuPC9zY3JpcHQ + XG5cbjxkaXY + XG4gIDxpbnB1dFxuICAgIGlkPVwiZGlhbG9nLWRlZmF1bHQtcGF0aFwiXG4gICAgcGxhY2Vob2xkZXI9XCJEZWZhdWx0IHBhdGhcIlxuICAgIGJpbmQ6dmFsdWU9e2RlZmF1bHRQYXRofVxuICAvPlxuICA8aW5wdXRcbiAgICBpZD1cImRpYWxvZy1maWx0ZXJcIlxuICAgIHBsYWNlaG9sZGVyPVwiRXh0ZW5zaW9ucyBmaWx0ZXIsIGNvbW1hLXNlcGFyYXRlZFwiXG4gICAgYmluZDp2YWx1ZT17ZmlsdGVyfVxuICAvPlxuICA8ZGl2PlxuICAgIDxpbnB1dCB0eXBlPVwiY2hlY2tib3hcIiBpZD1cImRpYWxvZy1tdWx0aXBsZVwiIGJpbmQ6Y2hlY2tlZD17bXVsdGlwbGV9IC8 + XG4gICAgPGxhYmVsIGZvcj1cImRpYWxvZy1tdWx0aXBsZVwiPk11bHRpcGxlPC9sYWJlbD5cbiAgPC9kaXY + XG4gIDxkaXY + XG4gICAgPGlucHV0IHR5cGU9XCJjaGVja2JveFwiIGlkPVwiZGlhbG9nLWRpcmVjdG9yeVwiIGJpbmQ6Y2hlY2tlZD17ZGlyZWN0b3J5fSAvPlxuICAgIDxsYWJlbCBmb3I9XCJkaWFsb2ctZGlyZWN0b3J5XCI + RGlyZWN0b3J5PC9sYWJlbD5cbiAgPC9kaXY + XG5cbiAgPGJ1dHRvbiBjbGFzcz1cImJ1dHRvblwiIGlkPVwib3Blbi1kaWFsb2dcIiBvbjpjbGljaz17b3Bl
append _dev ( document . head , style ) ;
}
function create _fragment$8 ( ctx ) {
let div2 ;
let input0 ;
let t0 ;
let input1 ;
let t1 ;
let div0 ;
let input2 ;
let t2 ;
let label0 ;
let t4 ;
let div1 ;
let input3 ;
let t5 ;
let label1 ;
let t7 ;
let button0 ;
let t9 ;
let button1 ;
let mounted ;
let dispose ;
const block = {
c : function create ( ) {
div2 = element ( "div" ) ;
input0 = element ( "input" ) ;
t0 = space ( ) ;
input1 = element ( "input" ) ;
t1 = space ( ) ;
div0 = element ( "div" ) ;
input2 = element ( "input" ) ;
t2 = space ( ) ;
label0 = element ( "label" ) ;
label0 . textContent = "Multiple" ;
t4 = space ( ) ;
div1 = element ( "div" ) ;
input3 = element ( "input" ) ;
t5 = space ( ) ;
label1 = element ( "label" ) ;
label1 . textContent = "Directory" ;
t7 = space ( ) ;
button0 = element ( "button" ) ;
button0 . textContent = "Open dialog" ;
t9 = space ( ) ;
button1 = element ( "button" ) ;
button1 . textContent = "Open save dialog" ;
attr _dev ( input0 , "id" , "dialog-default-path" ) ;
attr _dev ( input0 , "placeholder" , "Default path" ) ;
add _location ( input0 , file$8 , 87 , 2 , 2186 ) ;
attr _dev ( input1 , "id" , "dialog-filter" ) ;
attr _dev ( input1 , "placeholder" , "Extensions filter, comma-separated" ) ;
attr _dev ( input1 , "class" , "svelte-1eg58yg" ) ;
add _location ( input1 , file$8 , 92 , 2 , 2289 ) ;
attr _dev ( input2 , "type" , "checkbox" ) ;
attr _dev ( input2 , "id" , "dialog-multiple" ) ;
add _location ( input2 , file$8 , 98 , 4 , 2413 ) ;
attr _dev ( label0 , "for" , "dialog-multiple" ) ;
add _location ( label0 , file$8 , 99 , 4 , 2488 ) ;
add _location ( div0 , file$8 , 97 , 2 , 2403 ) ;
attr _dev ( input3 , "type" , "checkbox" ) ;
attr _dev ( input3 , "id" , "dialog-directory" ) ;
add _location ( input3 , file$8 , 102 , 4 , 2555 ) ;
attr _dev ( label1 , "for" , "dialog-directory" ) ;
add _location ( label1 , file$8 , 103 , 4 , 2632 ) ;
add _location ( div1 , file$8 , 101 , 2 , 2545 ) ;
attr _dev ( button0 , "class" , "button" ) ;
attr _dev ( button0 , "id" , "open-dialog" ) ;
add _location ( button0 , file$8 , 106 , 2 , 2692 ) ;
attr _dev ( button1 , "class" , "button" ) ;
attr _dev ( button1 , "id" , "save-dialog" ) ;
add _location ( button1 , file$8 , 109 , 2 , 2785 ) ;
add _location ( div2 , file$8 , 86 , 0 , 2178 ) ;
} ,
l : function claim ( nodes ) {
throw new Error (
"options.hydrate only works if the component was compiled with the `hydratable: true` option"
) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , div2 , anchor ) ;
append _dev ( div2 , input0 ) ;
set _input _value ( input0 , /*defaultPath*/ ctx [ 0 ] ) ;
append _dev ( div2 , t0 ) ;
append _dev ( div2 , input1 ) ;
set _input _value ( input1 , /*filter*/ ctx [ 1 ] ) ;
append _dev ( div2 , t1 ) ;
append _dev ( div2 , div0 ) ;
append _dev ( div0 , input2 ) ;
input2 . checked = /*multiple*/ ctx [ 2 ] ;
append _dev ( div0 , t2 ) ;
append _dev ( div0 , label0 ) ;
append _dev ( div2 , t4 ) ;
append _dev ( div2 , div1 ) ;
append _dev ( div1 , input3 ) ;
input3 . checked = /*directory*/ ctx [ 3 ] ;
append _dev ( div1 , t5 ) ;
append _dev ( div1 , label1 ) ;
append _dev ( div2 , t7 ) ;
append _dev ( div2 , button0 ) ;
append _dev ( div2 , t9 ) ;
append _dev ( div2 , button1 ) ;
if ( ! mounted ) {
dispose = [
listen _dev ( input0 , "input" , /*input0_input_handler*/ ctx [ 7 ] ) ,
listen _dev ( input1 , "input" , /*input1_input_handler*/ ctx [ 8 ] ) ,
listen _dev ( input2 , "change" , /*input2_change_handler*/ ctx [ 9 ] ) ,
listen _dev ( input3 , "change" , /*input3_change_handler*/ ctx [ 10 ] ) ,
listen _dev (
button0 ,
"click" ,
/*openDialog*/ ctx [ 4 ] ,
false ,
false ,
false
) ,
listen _dev (
button1 ,
"click" ,
/*saveDialog*/ ctx [ 5 ] ,
false ,
false ,
false
) ,
] ;
mounted = true ;
}
} ,
p : function update ( ctx , [ dirty ] ) {
if (
dirty & /*defaultPath*/ 1 &&
input0 . value !== /*defaultPath*/ ctx [ 0 ]
) {
set _input _value ( input0 , /*defaultPath*/ ctx [ 0 ] ) ;
}
if ( dirty & /*filter*/ 2 && input1 . value !== /*filter*/ ctx [ 1 ] ) {
set _input _value ( input1 , /*filter*/ ctx [ 1 ] ) ;
}
if ( dirty & /*multiple*/ 4 ) {
input2 . checked = /*multiple*/ ctx [ 2 ] ;
}
if ( dirty & /*directory*/ 8 ) {
input3 . checked = /*directory*/ ctx [ 3 ] ;
}
} ,
i : noop ,
o : noop ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( div2 ) ;
mounted = false ;
run _all ( dispose ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _fragment$8 . name ,
type : "component" ,
source : "" ,
ctx ,
} ) ;
return block ;
}
function arrayBufferToBase64$1 ( buffer , callback ) {
var blob = new Blob ( [ buffer ] , { type : "application/octet-binary" } ) ;
var reader = new FileReader ( ) ;
reader . onload = function ( evt ) {
var dataurl = evt . target . result ;
callback ( dataurl . substr ( dataurl . indexOf ( "," ) + 1 ) ) ;
} ;
reader . readAsDataURL ( blob ) ;
}
function instance$8 ( $$self , $$props , $$invalidate ) {
let { $$slots : slots = { } , $$scope } = $$props ;
validate _slots ( "Dialog" , slots , [ ] ) ;
let { onMessage } = $$props ;
let defaultPath = null ;
let filter = null ;
let multiple = false ;
let directory = false ;
function openDialog ( ) {
i$2 ( {
defaultPath ,
filters : filter
? [
{
name : "Tauri Example" ,
extensions : filter . split ( "," ) . map ( ( f ) => f . trim ( ) ) ,
} ,
]
: [ ] ,
multiple ,
directory ,
} )
. then ( function ( res ) {
if ( Array . isArray ( res ) ) {
onMessage ( res ) ;
} else {
var pathToRead = res ;
var isFile = pathToRead . match ( /\S+\.\S+$/g ) ;
n$1 ( pathToRead )
. then ( function ( response ) {
if ( isFile ) {
if (
pathToRead . includes ( ".png" ) ||
pathToRead . includes ( ".jpg" )
) {
arrayBufferToBase64$1 (
new Uint8Array ( response ) ,
function ( base64 ) {
var src = "data:image/png;base64," + base64 ;
onMessage ( '<img src="' + src + '"></img>' ) ;
}
) ;
} else {
onMessage ( res ) ;
}
} else {
onMessage ( res ) ;
}
} )
. catch ( onMessage ( res ) ) ;
}
} )
. catch ( onMessage ) ;
}
function saveDialog ( ) {
r$1 ( {
defaultPath ,
filters : filter
? [
{
name : "Tauri Example" ,
extensions : filter . split ( "," ) . map ( ( f ) => f . trim ( ) ) ,
} ,
]
: [ ] ,
} )
. then ( onMessage )
. catch ( onMessage ) ;
}
const writable _props = [ "onMessage" ] ;
Object . keys ( $$props ) . forEach ( ( key ) => {
if ( ! ~ writable _props . indexOf ( key ) && key . slice ( 0 , 2 ) !== "$$" )
console . warn ( ` <Dialog> was created with unknown prop ' ${ key } ' ` ) ;
} ) ;
function input0 _input _handler ( ) {
defaultPath = this . value ;
$$invalidate ( 0 , defaultPath ) ;
}
function input1 _input _handler ( ) {
filter = this . value ;
$$invalidate ( 1 , filter ) ;
}
function input2 _change _handler ( ) {
multiple = this . checked ;
$$invalidate ( 2 , multiple ) ;
}
function input3 _change _handler ( ) {
directory = this . checked ;
$$invalidate ( 3 , directory ) ;
}
$$self . $$set = ( $$props ) => {
if ( "onMessage" in $$props )
$$invalidate ( 6 , ( onMessage = $$props . onMessage ) ) ;
} ;
$$self . $capture _state = ( ) => ( {
open : i$2 ,
save : r$1 ,
readBinaryFile : n$1 ,
onMessage ,
defaultPath ,
filter ,
multiple ,
directory ,
arrayBufferToBase64 : arrayBufferToBase64$1 ,
openDialog ,
saveDialog ,
} ) ;
$$self . $inject _state = ( $$props ) => {
if ( "onMessage" in $$props )
$$invalidate ( 6 , ( onMessage = $$props . onMessage ) ) ;
if ( "defaultPath" in $$props )
$$invalidate ( 0 , ( defaultPath = $$props . defaultPath ) ) ;
if ( "filter" in $$props ) $$invalidate ( 1 , ( filter = $$props . filter ) ) ;
if ( "multiple" in $$props ) $$invalidate ( 2 , ( multiple = $$props . multiple ) ) ;
if ( "directory" in $$props )
$$invalidate ( 3 , ( directory = $$props . directory ) ) ;
} ;
if ( $$props && "$$inject" in $$props ) {
$$self . $inject _state ( $$props . $$inject ) ;
}
return [
defaultPath ,
filter ,
multiple ,
directory ,
openDialog ,
saveDialog ,
onMessage ,
input0 _input _handler ,
input1 _input _handler ,
input2 _change _handler ,
input3 _change _handler ,
] ;
}
class Dialog extends SvelteComponentDev {
constructor ( options ) {
super ( options ) ;
if ( ! document . getElementById ( "svelte-1eg58yg-style" ) ) add _css$1 ( ) ;
init ( this , options , instance$8 , create _fragment$8 , safe _not _equal , {
onMessage : 6 ,
} ) ;
dispatch _dev ( "SvelteRegisterComponent" , {
component : this ,
tagName : "Dialog" ,
options ,
id : create _fragment$8 . name ,
} ) ;
const { ctx } = this . $$ ;
const props = options . props || { } ;
if ( /*onMessage*/ ctx [ 6 ] === undefined && ! ( "onMessage" in props ) ) {
console . warn ( "<Dialog> was created without expected prop 'onMessage'" ) ;
}
}
get onMessage ( ) {
throw new Error (
"<Dialog>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
set onMessage ( value ) {
throw new Error (
"<Dialog>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
}
/* src/components/FileSystem.svelte generated by Svelte v3.35.0 */
const { Object : Object _1 } = globals ;
const file$7 = "src/components/FileSystem.svelte" ;
function get _each _context$2 ( ctx , list , i ) {
const child _ctx = ctx . slice ( ) ;
child _ctx [ 5 ] = list [ i ] ;
return child _ctx ;
}
// (79:4) {#each DirOptions as dir}
function create _each _block$2 ( ctx ) {
let option ;
let t _value = /*dir*/ ctx [ 5 ] [ 0 ] + "" ;
let t ;
const block = {
c : function create ( ) {
option = element ( "option" ) ;
t = text ( t _value ) ;
option . _ _value = /*dir*/ ctx [ 5 ] [ 1 ] ;
option . value = option . _ _value ;
add _location ( option , file$7 , 79 , 6 , 2408 ) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , option , anchor ) ;
append _dev ( option , t ) ;
} ,
p : noop ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( option ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _each _block$2 . name ,
type : "each" ,
source : "(79:4) {#each DirOptions as dir}" ,
ctx ,
} ) ;
return block ;
}
function create _fragment$7 ( ctx ) {
let form ;
let select ;
let option ;
let t1 ;
let input ;
let t2 ;
let button ;
let mounted ;
let dispose ;
let each _value = /*DirOptions*/ ctx [ 1 ] ;
validate _each _argument ( each _value ) ;
let each _blocks = [ ] ;
for ( let i = 0 ; i < each _value . length ; i += 1 ) {
each _blocks [ i ] = create _each _block$2 (
get _each _context$2 ( ctx , each _value , i )
) ;
}
const block = {
c : function create ( ) {
form = element ( "form" ) ;
select = element ( "select" ) ;
option = element ( "option" ) ;
option . textContent = "None" ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . c ( ) ;
}
t1 = space ( ) ;
input = element ( "input" ) ;
t2 = space ( ) ;
button = element ( "button" ) ;
button . textContent = "Read" ;
option . _ _value = "" ;
option . value = option . _ _value ;
add _location ( option , file$7 , 77 , 4 , 2341 ) ;
attr _dev ( select , "class" , "button" ) ;
attr _dev ( select , "id" , "dir" ) ;
add _location ( select , file$7 , 76 , 2 , 2304 ) ;
attr _dev ( input , "id" , "path-to-read" ) ;
attr _dev ( input , "placeholder" , "Type the path to read..." ) ;
add _location ( input , file$7 , 82 , 2 , 2475 ) ;
attr _dev ( button , "class" , "button" ) ;
attr _dev ( button , "id" , "read" ) ;
add _location ( button , file$7 , 87 , 2 , 2582 ) ;
add _location ( form , file$7 , 75 , 0 , 2263 ) ;
} ,
l : function claim ( nodes ) {
throw new Error (
"options.hydrate only works if the component was compiled with the `hydratable: true` option"
) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , form , anchor ) ;
append _dev ( form , select ) ;
append _dev ( select , option ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . m ( select , null ) ;
}
append _dev ( form , t1 ) ;
append _dev ( form , input ) ;
set _input _value ( input , /*pathToRead*/ ctx [ 0 ] ) ;
append _dev ( form , t2 ) ;
append _dev ( form , button ) ;
if ( ! mounted ) {
dispose = [
listen _dev ( input , "input" , /*input_input_handler*/ ctx [ 4 ] ) ,
listen _dev (
form ,
"submit" ,
prevent _default ( /*read*/ ctx [ 2 ] ) ,
false ,
true ,
false
) ,
] ;
mounted = true ;
}
} ,
p : function update ( ctx , [ dirty ] ) {
if ( dirty & /*DirOptions*/ 2 ) {
each _value = /*DirOptions*/ ctx [ 1 ] ;
validate _each _argument ( each _value ) ;
let i ;
for ( i = 0 ; i < each _value . length ; i += 1 ) {
const child _ctx = get _each _context$2 ( ctx , each _value , i ) ;
if ( each _blocks [ i ] ) {
each _blocks [ i ] . p ( child _ctx , dirty ) ;
} else {
each _blocks [ i ] = create _each _block$2 ( child _ctx ) ;
each _blocks [ i ] . c ( ) ;
each _blocks [ i ] . m ( select , null ) ;
}
}
for ( ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . d ( 1 ) ;
}
each _blocks . length = each _value . length ;
}
if ( dirty & /*pathToRead*/ 1 && input . value !== /*pathToRead*/ ctx [ 0 ] ) {
set _input _value ( input , /*pathToRead*/ ctx [ 0 ] ) ;
}
} ,
i : noop ,
o : noop ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( form ) ;
destroy _each ( each _blocks , detaching ) ;
mounted = false ;
run _all ( dispose ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _fragment$7 . name ,
type : "component" ,
source : "" ,
ctx ,
} ) ;
return block ;
}
function getDir ( ) {
const dirSelect = document . getElementById ( "dir" ) ;
return dirSelect . value ? parseInt ( dir . value ) : null ;
}
function arrayBufferToBase64 ( buffer , callback ) {
const blob = new Blob ( [ buffer ] , { type : "application/octet-binary" } ) ;
const reader = new FileReader ( ) ;
reader . onload = function ( evt ) {
const dataurl = evt . target . result ;
callback ( dataurl . substr ( dataurl . indexOf ( "," ) + 1 ) ) ;
} ;
reader . readAsDataURL ( blob ) ;
}
function instance$7 ( $$self , $$props , $$invalidate ) {
let { $$slots : slots = { } , $$scope } = $$props ;
validate _slots ( "FileSystem" , slots , [ ] ) ;
let { onMessage } = $$props ;
let pathToRead = "" ;
const DirOptions = Object . keys ( r )
. filter ( ( key ) => isNaN ( parseInt ( key ) ) )
. map ( ( dir ) => [ dir , r [ dir ] ] ) ;
function read ( ) {
const isFile = pathToRead . match ( /\S+\.\S+$/g ) ;
const opts = { dir : getDir ( ) } ;
const promise = isFile ? n$1 ( pathToRead , opts ) : c$2 ( pathToRead , opts ) ;
promise
. then ( function ( response ) {
if ( isFile ) {
if ( pathToRead . includes ( ".png" ) || pathToRead . includes ( ".jpg" ) ) {
arrayBufferToBase64 ( new Uint8Array ( response ) , function ( base64 ) {
const src = "data:image/png;base64," + base64 ;
onMessage ( '<img src="' + src + '"></img>' ) ;
} ) ;
} else {
const value = String . fromCharCode . apply ( null , response ) ;
onMessage (
'<textarea id="file-response" style="height: 400px"></textarea><button id="file-save">Save</button>'
) ;
setTimeout ( ( ) => {
const fileInput = document . getElementById ( "file-response" ) ;
fileInput . value = value ;
document
. getElementById ( "file-save" )
. addEventListener ( "click" , function ( ) {
writeFile (
{
file : pathToRead ,
contents : fileInput . value ,
} ,
{ dir : getDir ( ) }
) . catch ( onMessage ) ;
} ) ;
} ) ;
}
} else {
onMessage ( response ) ;
}
} )
. catch ( onMessage ) ;
}
const writable _props = [ "onMessage" ] ;
Object _1 . keys ( $$props ) . forEach ( ( key ) => {
if ( ! ~ writable _props . indexOf ( key ) && key . slice ( 0 , 2 ) !== "$$" )
console . warn ( ` <FileSystem> was created with unknown prop ' ${ key } ' ` ) ;
} ) ;
function input _input _handler ( ) {
pathToRead = this . value ;
$$invalidate ( 0 , pathToRead ) ;
}
$$self . $$set = ( $$props ) => {
if ( "onMessage" in $$props )
$$invalidate ( 3 , ( onMessage = $$props . onMessage ) ) ;
} ;
$$self . $capture _state = ( ) => ( {
readBinaryFile : n$1 ,
readDir : c$2 ,
Dir : r ,
onMessage ,
pathToRead ,
getDir ,
arrayBufferToBase64 ,
DirOptions ,
read ,
} ) ;
$$self . $inject _state = ( $$props ) => {
if ( "onMessage" in $$props )
$$invalidate ( 3 , ( onMessage = $$props . onMessage ) ) ;
if ( "pathToRead" in $$props )
$$invalidate ( 0 , ( pathToRead = $$props . pathToRead ) ) ;
} ;
if ( $$props && "$$inject" in $$props ) {
$$self . $inject _state ( $$props . $$inject ) ;
}
return [ pathToRead , DirOptions , read , onMessage , input _input _handler ] ;
}
class FileSystem extends SvelteComponentDev {
constructor ( options ) {
super ( options ) ;
init ( this , options , instance$7 , create _fragment$7 , safe _not _equal , {
onMessage : 3 ,
} ) ;
dispatch _dev ( "SvelteRegisterComponent" , {
component : this ,
tagName : "FileSystem" ,
options ,
id : create _fragment$7 . name ,
} ) ;
const { ctx } = this . $$ ;
const props = options . props || { } ;
if ( /*onMessage*/ ctx [ 3 ] === undefined && ! ( "onMessage" in props ) ) {
console . warn (
"<FileSystem> was created without expected prop 'onMessage'"
) ;
}
}
get onMessage ( ) {
throw new Error (
"<FileSystem>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
set onMessage ( value ) {
throw new Error (
"<FileSystem>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
}
var i$1 ;
! ( function ( t ) {
( t [ ( t . JSON = 1 ) ] = "JSON" ) ,
( t [ ( t . Text = 2 ) ] = "Text" ) ,
( t [ ( t . Binary = 3 ) ] = "Binary" ) ;
} ) ( i$1 || ( i$1 = { } ) ) ;
var o$1 = ( function ( ) {
function t ( t , n ) {
( this . type = t ) , ( this . payload = n ) ;
}
return (
( t . form = function ( n ) {
return new t ( "Form" , n ) ;
} ) ,
( t . json = function ( n ) {
return new t ( "Json" , n ) ;
} ) ,
( t . text = function ( n ) {
return new t ( "Text" , n ) ;
} ) ,
( t . bytes = function ( n ) {
return new t ( "Bytes" , n ) ;
} ) ,
t
) ;
} ) ( ) ,
u$2 = ( function ( ) {
function i ( t ) {
this . id = t ;
}
return (
( i . prototype . drop = function ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Http" ,
message : { cmd : "dropClient" , client : this . id } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . request = function ( e ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Http" ,
message : { cmd : "httpRequest" , client : this . id , options : e } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . get = function ( r , i ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [ 2 , this . request ( e$2 ( { method : "GET" , url : r } , i ) ) ] ;
} ) ;
} ) ;
} ) ,
( i . prototype . post = function ( r , i , o ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
this . request ( e$2 ( { method : "POST" , url : r , body : i } , o ) ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . put = function ( r , i , o ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
this . request ( e$2 ( { method : "PUT" , url : r , body : i } , o ) ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . patch = function ( r , i ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [ 2 , this . request ( e$2 ( { method : "PATCH" , url : r } , i ) ) ] ;
} ) ;
} ) ;
} ) ,
( i . prototype . delete = function ( r , i ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [ 2 , this . request ( e$2 ( { method : "DELETE" , url : r } , i ) ) ] ;
} ) ;
} ) ;
} ) ,
i
) ;
} ) ( ) ;
function s$1 ( e ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Http" ,
message : { cmd : "createClient" , options : e } ,
} ) . then ( function ( t ) {
return new u$2 ( t ) ;
} ) ,
] ;
} ) ;
} ) ;
}
var c$1 = null ;
function d$1 ( r , i ) {
var o ;
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
switch ( t . label ) {
case 0 :
return null !== c$1 ? [ 3 , 2 ] : [ 4 , s$1 ( ) ] ;
case 1 :
( c$1 = t . sent ( ) ) , ( t . label = 2 ) ;
case 2 :
return [
2 ,
c$1 . request (
e$2 (
{
url : r ,
method :
null !== ( o = null == i ? void 0 : i . method ) &&
void 0 !== o
? o
: "GET" ,
} ,
i
)
) ,
] ;
}
} ) ;
} ) ;
}
Object . freeze ( {
_ _proto _ _ : null ,
get ResponseType ( ) {
return i$1 ;
} ,
Body : o$1 ,
Client : u$2 ,
getClient : s$1 ,
fetch : d$1 ,
} ) ;
/* src/components/Http.svelte generated by Svelte v3.35.0 */
const file$6 = "src/components/Http.svelte" ;
function create _fragment$6 ( ctx ) {
let form ;
let select ;
let option0 ;
let option1 ;
let option2 ;
let option3 ;
let option4 ;
let t5 ;
let input ;
let t6 ;
let br ;
let t7 ;
let textarea ;
let t8 ;
let button ;
let mounted ;
let dispose ;
const block = {
c : function create ( ) {
form = element ( "form" ) ;
select = element ( "select" ) ;
option0 = element ( "option" ) ;
option0 . textContent = "GET" ;
option1 = element ( "option" ) ;
option1 . textContent = "POST" ;
option2 = element ( "option" ) ;
option2 . textContent = "PUT" ;
option3 = element ( "option" ) ;
option3 . textContent = "PATCH" ;
option4 = element ( "option" ) ;
option4 . textContent = "DELETE" ;
t5 = space ( ) ;
input = element ( "input" ) ;
t6 = space ( ) ;
br = element ( "br" ) ;
t7 = space ( ) ;
textarea = element ( "textarea" ) ;
t8 = space ( ) ;
button = element ( "button" ) ;
button . textContent = "Make request" ;
option0 . _ _value = "GET" ;
option0 . value = option0 . _ _value ;
add _location ( option0 , file$6 , 33 , 4 , 862 ) ;
option1 . _ _value = "POST" ;
option1 . value = option1 . _ _value ;
add _location ( option1 , file$6 , 34 , 4 , 899 ) ;
option2 . _ _value = "PUT" ;
option2 . value = option2 . _ _value ;
add _location ( option2 , file$6 , 35 , 4 , 938 ) ;
option3 . _ _value = "PATCH" ;
option3 . value = option3 . _ _value ;
add _location ( option3 , file$6 , 36 , 4 , 975 ) ;
option4 . _ _value = "DELETE" ;
option4 . value = option4 . _ _value ;
add _location ( option4 , file$6 , 37 , 4 , 1016 ) ;
attr _dev ( select , "class" , "button" ) ;
attr _dev ( select , "id" , "request-method" ) ;
if ( /*httpMethod*/ ctx [ 0 ] === void 0 )
add _render _callback ( ( ) =>
/*select_change_handler*/ ctx [ 5 ] . call ( select )
) ;
add _location ( select , file$6 , 32 , 2 , 790 ) ;
attr _dev ( input , "id" , "request-url" ) ;
attr _dev ( input , "placeholder" , "Type the request URL..." ) ;
add _location ( input , file$6 , 39 , 2 , 1069 ) ;
add _location ( br , file$6 , 44 , 2 , 1171 ) ;
attr _dev ( textarea , "id" , "request-body" ) ;
attr _dev ( textarea , "placeholder" , "Request body" ) ;
attr _dev ( textarea , "rows" , "5" ) ;
set _style ( textarea , "width" , "100%" ) ;
set _style ( textarea , "margin-right" , "10px" ) ;
set _style ( textarea , "font-size" , "12px" ) ;
add _location ( textarea , file$6 , 45 , 2 , 1180 ) ;
attr _dev ( button , "class" , "button" ) ;
attr _dev ( button , "id" , "make-request" ) ;
add _location ( button , file$6 , 52 , 2 , 1345 ) ;
add _location ( form , file$6 , 31 , 0 , 738 ) ;
} ,
l : function claim ( nodes ) {
throw new Error (
"options.hydrate only works if the component was compiled with the `hydratable: true` option"
) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , form , anchor ) ;
append _dev ( form , select ) ;
append _dev ( select , option0 ) ;
append _dev ( select , option1 ) ;
append _dev ( select , option2 ) ;
append _dev ( select , option3 ) ;
append _dev ( select , option4 ) ;
select _option ( select , /*httpMethod*/ ctx [ 0 ] ) ;
append _dev ( form , t5 ) ;
append _dev ( form , input ) ;
set _input _value ( input , /*httpUrl*/ ctx [ 1 ] ) ;
append _dev ( form , t6 ) ;
append _dev ( form , br ) ;
append _dev ( form , t7 ) ;
append _dev ( form , textarea ) ;
set _input _value ( textarea , /*httpBody*/ ctx [ 2 ] ) ;
append _dev ( form , t8 ) ;
append _dev ( form , button ) ;
if ( ! mounted ) {
dispose = [
listen _dev ( select , "change" , /*select_change_handler*/ ctx [ 5 ] ) ,
listen _dev ( input , "input" , /*input_input_handler*/ ctx [ 6 ] ) ,
listen _dev ( textarea , "input" , /*textarea_input_handler*/ ctx [ 7 ] ) ,
listen _dev (
form ,
"submit" ,
prevent _default ( /*makeHttpRequest*/ ctx [ 3 ] ) ,
false ,
true ,
false
) ,
] ;
mounted = true ;
}
} ,
p : function update ( ctx , [ dirty ] ) {
if ( dirty & /*httpMethod*/ 1 ) {
select _option ( select , /*httpMethod*/ ctx [ 0 ] ) ;
}
if ( dirty & /*httpUrl*/ 2 && input . value !== /*httpUrl*/ ctx [ 1 ] ) {
set _input _value ( input , /*httpUrl*/ ctx [ 1 ] ) ;
}
if ( dirty & /*httpBody*/ 4 ) {
set _input _value ( textarea , /*httpBody*/ ctx [ 2 ] ) ;
}
} ,
i : noop ,
o : noop ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( form ) ;
mounted = false ;
run _all ( dispose ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _fragment$6 . name ,
type : "component" ,
source : "" ,
ctx ,
} ) ;
return block ;
}
function instance$6 ( $$self , $$props , $$invalidate ) {
let { $$slots : slots = { } , $$scope } = $$props ;
validate _slots ( "Http" , slots , [ ] ) ;
let httpMethod = "GET" ;
let httpUrl = "" ;
let httpBody = "" ;
let { onMessage } = $$props ;
async function makeHttpRequest ( ) {
const client = await s$1 ( ) ;
let method = httpMethod || "GET" ;
let url = httpUrl || "" ;
const options = { url : url || "" , method : method || "GET" } ;
if (
( httpBody . startsWith ( "{" ) && httpBody . endsWith ( "}" ) ) ||
( httpBody . startsWith ( "[" ) && httpBody . endsWith ( "]" ) )
) {
options . body = o$1 . json ( JSON . parse ( httpBody ) ) ;
} else if ( httpBody !== "" ) {
options . body = o$1 . text ( httpBody ) ;
}
client . request ( options ) . then ( onMessage ) . catch ( onMessage ) ;
}
const writable _props = [ "onMessage" ] ;
Object . keys ( $$props ) . forEach ( ( key ) => {
if ( ! ~ writable _props . indexOf ( key ) && key . slice ( 0 , 2 ) !== "$$" )
console . warn ( ` <Http> was created with unknown prop ' ${ key } ' ` ) ;
} ) ;
function select _change _handler ( ) {
httpMethod = select _value ( this ) ;
$$invalidate ( 0 , httpMethod ) ;
}
function input _input _handler ( ) {
httpUrl = this . value ;
$$invalidate ( 1 , httpUrl ) ;
}
function textarea _input _handler ( ) {
httpBody = this . value ;
$$invalidate ( 2 , httpBody ) ;
}
$$self . $$set = ( $$props ) => {
if ( "onMessage" in $$props )
$$invalidate ( 4 , ( onMessage = $$props . onMessage ) ) ;
} ;
$$self . $capture _state = ( ) => ( {
getClient : s$1 ,
Body : o$1 ,
httpMethod ,
httpUrl ,
httpBody ,
onMessage ,
makeHttpRequest ,
} ) ;
$$self . $inject _state = ( $$props ) => {
if ( "httpMethod" in $$props )
$$invalidate ( 0 , ( httpMethod = $$props . httpMethod ) ) ;
if ( "httpUrl" in $$props ) $$invalidate ( 1 , ( httpUrl = $$props . httpUrl ) ) ;
if ( "httpBody" in $$props ) $$invalidate ( 2 , ( httpBody = $$props . httpBody ) ) ;
if ( "onMessage" in $$props )
$$invalidate ( 4 , ( onMessage = $$props . onMessage ) ) ;
} ;
if ( $$props && "$$inject" in $$props ) {
$$self . $inject _state ( $$props . $$inject ) ;
}
return [
httpMethod ,
httpUrl ,
httpBody ,
makeHttpRequest ,
onMessage ,
select _change _handler ,
input _input _handler ,
textarea _input _handler ,
] ;
}
class Http extends SvelteComponentDev {
constructor ( options ) {
super ( options ) ;
init ( this , options , instance$6 , create _fragment$6 , safe _not _equal , {
onMessage : 4 ,
} ) ;
dispatch _dev ( "SvelteRegisterComponent" , {
component : this ,
tagName : "Http" ,
options ,
id : create _fragment$6 . name ,
} ) ;
const { ctx } = this . $$ ;
const props = options . props || { } ;
if ( /*onMessage*/ ctx [ 4 ] === undefined && ! ( "onMessage" in props ) ) {
console . warn ( "<Http> was created without expected prop 'onMessage'" ) ;
}
}
get onMessage ( ) {
throw new Error (
"<Http>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
set onMessage ( value ) {
throw new Error (
"<Http>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
}
/* src/components/Notifications.svelte generated by Svelte v3.35.0 */
const file$5 = "src/components/Notifications.svelte" ;
function create _fragment$5 ( ctx ) {
let button ;
let mounted ;
let dispose ;
const block = {
c : function create ( ) {
button = element ( "button" ) ;
button . textContent = "Send test notification" ;
attr _dev ( button , "class" , "button" ) ;
attr _dev ( button , "id" , "notification" ) ;
add _location ( button , file$5 , 28 , 0 , 678 ) ;
} ,
l : function claim ( nodes ) {
throw new Error (
"options.hydrate only works if the component was compiled with the `hydratable: true` option"
) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , button , anchor ) ;
if ( ! mounted ) {
dispose = listen _dev (
button ,
"click" ,
/*sendNotification*/ ctx [ 0 ] ,
false ,
false ,
false
) ;
mounted = true ;
}
} ,
p : noop ,
i : noop ,
o : noop ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( button ) ;
mounted = false ;
dispose ( ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _fragment$5 . name ,
type : "component" ,
source : "" ,
ctx ,
} ) ;
return block ;
}
function _sendNotification ( ) {
new Notification ( "Notification title" , {
body : "This is the notification body" ,
} ) ;
}
function instance$5 ( $$self , $$props , $$invalidate ) {
let { $$slots : slots = { } , $$scope } = $$props ;
validate _slots ( "Notifications" , slots , [ ] ) ;
let { onMessage } = $$props ;
function sendNotification ( ) {
if ( Notification . permission === "default" ) {
Notification . requestPermission ( )
. then ( function ( response ) {
if ( response === "granted" ) {
_sendNotification ( ) ;
} else {
onMessage ( "Permission is " + response ) ;
}
} )
. catch ( onMessage ) ;
} else if ( Notification . permission === "granted" ) {
_sendNotification ( ) ;
} else {
onMessage ( "Permission is denied" ) ;
}
}
const writable _props = [ "onMessage" ] ;
Object . keys ( $$props ) . forEach ( ( key ) => {
if ( ! ~ writable _props . indexOf ( key ) && key . slice ( 0 , 2 ) !== "$$" )
console . warn ( ` <Notifications> was created with unknown prop ' ${ key } ' ` ) ;
} ) ;
$$self . $$set = ( $$props ) => {
if ( "onMessage" in $$props )
$$invalidate ( 1 , ( onMessage = $$props . onMessage ) ) ;
} ;
$$self . $capture _state = ( ) => ( {
onMessage ,
_sendNotification ,
sendNotification ,
} ) ;
$$self . $inject _state = ( $$props ) => {
if ( "onMessage" in $$props )
$$invalidate ( 1 , ( onMessage = $$props . onMessage ) ) ;
} ;
if ( $$props && "$$inject" in $$props ) {
$$self . $inject _state ( $$props . $$inject ) ;
}
return [ sendNotification , onMessage ] ;
}
class Notifications extends SvelteComponentDev {
constructor ( options ) {
super ( options ) ;
init ( this , options , instance$5 , create _fragment$5 , safe _not _equal , {
onMessage : 1 ,
} ) ;
dispatch _dev ( "SvelteRegisterComponent" , {
component : this ,
tagName : "Notifications" ,
options ,
id : create _fragment$5 . name ,
} ) ;
const { ctx } = this . $$ ;
const props = options . props || { } ;
if ( /*onMessage*/ ctx [ 1 ] === undefined && ! ( "onMessage" in props ) ) {
console . warn (
"<Notifications> was created without expected prop 'onMessage'"
) ;
}
}
get onMessage ( ) {
throw new Error (
"<Notifications>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
set onMessage ( value ) {
throw new Error (
"<Notifications>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
}
function d ( ) {
return new f ( window . _ _TAURI _ _ . _ _currentWindow . label ) ;
}
function c ( ) {
return window . _ _TAURI _ _ . _ _windows ;
}
var a$1 = [ "tauri://created" , "tauri://error" ] ,
f = ( function ( ) {
function i ( t ) {
( this . label = t ) , ( this . listeners = Object . create ( null ) ) ;
}
return (
( i . prototype . listen = function ( i , e ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
var t = this ;
return o$6 ( this , function ( n ) {
return this . _handleTauriEvent ( i , e )
? [
2 ,
Promise . resolve ( function ( ) {
var n = t . listeners [ i ] ;
n . splice ( n . indexOf ( e ) , 1 ) ;
} ) ,
]
: [ 2 , o$3 ( i , e ) ] ;
} ) ;
} ) ;
} ) ,
( i . prototype . once = function ( i , e ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
var t = this ;
return o$6 ( this , function ( n ) {
return this . _handleTauriEvent ( i , e )
? [
2 ,
Promise . resolve ( function ( ) {
var n = t . listeners [ i ] ;
n . splice ( n . indexOf ( e ) , 1 ) ;
} ) ,
]
: [ 2 , s$3 ( i , e ) ] ;
} ) ;
} ) ;
} ) ,
( i . prototype . emit = function ( i , e ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
var t , o ;
return o$6 ( this , function ( n ) {
if ( a$1 . includes ( i ) ) {
for ( t = 0 , o = this . listeners [ i ] || [ ] ; t < o . length ; t ++ )
( 0 , o [ t ] ) ( { event : i , id : - 1 , payload : e } ) ;
return [ 2 , Promise . resolve ( ) ] ;
}
return [ 2 , c$3 ( i , this . label , e ) ] ;
} ) ;
} ) ;
} ) ,
( i . prototype . _handleTauriEvent = function ( t , n ) {
return (
! ! a$1 . includes ( t ) &&
( t in this . listeners
? this . listeners [ t ] . push ( n )
: ( this . listeners [ t ] = [ n ] ) ,
! 0 )
) ;
} ) ,
i
) ;
} ) ( ) ,
h = ( function ( r ) {
function u ( i , u ) {
void 0 === u && ( u = { } ) ;
var s = r . call ( this , i ) || this ;
return (
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "createWebview" , options : e$2 ( { label : i } , u ) } ,
} )
. then ( function ( ) {
return r$3 ( s , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [ 2 , this . emit ( "tauri://created" ) ] ;
} ) ;
} ) ;
} )
. catch ( function ( i ) {
return r$3 ( s , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [ 2 , this . emit ( "tauri://error" , i ) ] ;
} ) ;
} ) ;
} ) ,
s
) ;
}
return (
n$5 ( u , r ) ,
( u . getByLabel = function ( t ) {
return c ( ) . some ( function ( n ) {
return n . label === t ;
} )
? new f ( t )
: null ;
} ) ,
u
) ;
} ) ( f ) ,
l = new ( ( function ( ) {
function i ( ) { }
return (
( i . prototype . setResizable = function ( i ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "setResizable" , resizable : i } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . setTitle = function ( i ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "setTitle" , title : i } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . maximize = function ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( { _ _tauriModule : "Window" , message : { cmd : "maximize" } } ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . unmaximize = function ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "unmaximize" } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . minimize = function ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( { _ _tauriModule : "Window" , message : { cmd : "minimize" } } ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . unminimize = function ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "unminimize" } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . show = function ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( { _ _tauriModule : "Window" , message : { cmd : "show" } } ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . hide = function ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( { _ _tauriModule : "Window" , message : { cmd : "hide" } } ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . close = function ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( { _ _tauriModule : "Window" , message : { cmd : "close" } } ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . setDecorations = function ( i ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "setDecorations" , decorations : i } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . setAlwaysOnTop = function ( i ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "setAlwaysOnTop" , alwaysOnTop : i } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . setWidth = function ( i ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "setWidth" , width : i } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . setHeight = function ( i ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "setHeight" , height : i } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . resize = function ( i , e ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "resize" , width : i , height : e } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . setMinSize = function ( i , e ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "setMinSize" , minWidth : i , minHeight : e } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . setMaxSize = function ( i , e ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "setMaxSize" , maxWidth : i , maxHeight : e } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . setX = function ( i ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "setX" , x : i } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . setY = function ( i ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "setY" , y : i } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . setPosition = function ( i , e ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "setPosition" , x : i , y : e } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . setFullscreen = function ( i ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "setFullscreen" , fullscreen : i } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
( i . prototype . setIcon = function ( i ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "Window" ,
message : { cmd : "setIcon" , icon : i } ,
} ) ,
] ;
} ) ;
} ) ;
} ) ,
i
) ;
} ) ( ) ) ( ) ;
Object . freeze ( {
_ _proto _ _ : null ,
WebviewWindow : h ,
getCurrent : d ,
getAll : c ,
appWindow : l ,
} ) ;
/* src/components/Window.svelte generated by Svelte v3.35.0 */
const file$4 = "src/components/Window.svelte" ;
function add _css ( ) {
var style = element ( "style" ) ;
style . id = "svelte-b76pvm-style" ;
style . textContent =
" . flex - row . svelte - b76pvm . svelte - b76pvm { flex - direction : row } . grow . svelte - b76pvm . svelte - b76pvm { flex - grow : 1 } . window - controls . svelte - b76pvm input . svelte - b76pvm { width : 50 px } \ n / * # sourceMappingURL = data : application / json ; charset = utf - 8 ; base64 , eyJ2ZXJzaW9uIjozLCJmaWxlIjoiV2luZG93LnN2ZWx0ZSIsInNvdXJjZXMiOlsiV2luZG93LnN2ZWx0ZSJdLCJzb3VyY2VzQ29udGVudCI6WyI8c2NyaXB0PlxuICBpbXBvcnQgeyBhcHBXaW5kb3cgfSBmcm9tIFwiQHRhdXJpLWFwcHMvYXBpL3dpbmRvd1wiO1xuICBpbXBvcnQgeyBvcGVuIGFzIG9wZW5EaWFsb2cgfSBmcm9tIFwiQHRhdXJpLWFwcHMvYXBpL2RpYWxvZ1wiO1xuICBpbXBvcnQgeyBvcGVuIH0gZnJvbSBcIkB0YXVyaS1hcHBzL2FwaS9zaGVsbFwiO1xuXG4gIGNvbnN0IHtcbiAgICBzZXRSZXNpemFibGUsXG4gICAgc2V0VGl0bGUsXG4gICAgbWF4aW1pemUsXG4gICAgdW5tYXhpbWl6ZSxcbiAgICBtaW5pbWl6ZSxcbiAgICB1bm1pbmltaXplLFxuICAgIHNob3csXG4gICAgaGlkZSxcbiAgICBzZXRUcmFuc3BhcmVudCxcbiAgICBzZXREZWNvcmF0aW9ucyxcbiAgICBzZXRBbHdheXNPblRvcCxcbiAgICBzZXRXaWR0aCxcbiAgICBzZXRIZWlnaHQsXG4gICAgLy8gcmVzaXplLFxuICAgIHNldE1pblNpemUsXG4gICAgc2V0TWF4U2l6ZSxcbiAgICBzZXRYLFxuICAgIHNldFksXG4gICAgLy8gc2V0UG9zaXRpb24sXG4gICAgc2V0RnVsbHNjcmVlbixcbiAgICBzZXRJY29uLFxuICB9ID0gYXBwV2luZG93O1xuXG4gIGxldCB1cmxWYWx1ZSA9IFwiaHR0cHM6Ly90YXVyaS5zdHVkaW9cIjtcbiAgbGV0IHJlc2l6YWJsZSA9IHRydWU7XG4gIGxldCBtYXhpbWl6ZWQgPSBmYWxzZTtcbiAgbGV0IHRyYW5zcGFyZW50ID0gZmFsc2U7XG4gIGxldCBkZWNvcmF0aW9ucyA9IHRydWU7XG4gIGxldCBhbHdheXNPblRvcCA9IGZhbHNlO1xuICBsZXQgZnVsbHNjcmVlbiA9IGZhbHNlO1xuICBsZXQgd2lkdGggPSA5MDA7XG4gIGxldCBoZWlnaHQgPSA3MDA7XG4gIGxldCBtaW5XaWR0aCA9IDYwMDtcbiAgbGV0IG1pbkhlaWdodCA9IDYwMDtcbiAgbGV0IG1heFdpZHRoID0gbnVsbDtcbiAgbGV0IG1heEhlaWdodCA9IG51bGw7XG4gIGxldCB4ID0gMTAwO1xuICBsZXQgeSA9IDEwMDtcblxuICBsZXQgd2luZG93VGl0bGUgPSBcIkF3ZXNvbWUgVGF1cmkgRXhhbXBsZSFcIjtcblxuICBmdW5jdGlvbiBvcGVuVXJsKCkge1xuICAgIG9wZW4odXJsVmFsdWUpO1xuICB9XG5cbiAgZnVuY3Rpb24gc2V0VGl0bGVfKCkge1xuICAgIHNldFRpdGxlKHdpbmRvd1RpdGxlKTtcbiAgfVxuXG4gIGZ1bmN0aW9uIGhpZGVfKCkge1xuICAgIGhpZGUoKTtcbiAgICBzZXRUaW1lb3V0KHNob3csIDIwMDApO1xuICB9XG5cbiAgZnVuY3Rpb24gbWluaW1pemVfKCkge1xuICAgIG1pbmltaXplKCk7XG4gICAgc2V0VGltZW91dCh1bm1pbmltaXplLCAyMDAwKTtcbiAgfVxuXG4gIGZ1bmN0aW9uIGdldEljb24oKSB7XG4gICAgb3BlbkRpYWxvZyh7XG4gICAgICBtdWx0aXBsZTogZmFsc2UsXG4gICAgfSkudGhlbihzZXRJY29uKTtcbiAgfVxuXG4gICQ6IHNldFJlc2l6YWJsZShyZXNpemFibGUpO1xuICAkOiBtYXhpbWl6ZWQgPyBtYXhpbWl6ZSgpIDogdW5tYXhpbWl6ZSgpO1xuICAvLyQ6IHNldFRyYW5zcGFyZW50KHRyYW5zcGFyZW50KVxuICAkOiBzZXREZWNvcmF0aW9ucyhkZWNvcmF0aW9ucyk7XG4gICQ6IHNldEFsd2F5c09uVG9wKGFsd2F5c09uVG9wKTtcbiAgJDogc2V0RnVsbHNjcmVlbihmdWxsc2NyZWVuKTtcblxuICAkOiBzZXRXaWR0aCh3aWR0aCk7XG4gICQ6IHNldEhlaWdodChoZWlnaHQpO1xuICAkOiBtaW5XaWR0aCAmJiBtaW5IZWlnaHQgJiYgc2V0TWluU2l6ZShtaW5XaWR0aCwgbWluSGVpZ2h0KTtcbiAgJDogbWF4V2lkdGggJiYgbWF4SGVpZ2h0ICYmIHNldE1heFNpemUobWF4V2lkdGgsIG1heEhlaWdodCk7XG4gICQ6IHNldFgoeCk7XG4gICQ6IHNldFkoeSk7XG48L3NjcmlwdD5cblxuPGRpdiBjbGFzcz1cImZsZXggY29sXCI + XG4gIDxkaXY + XG4gICAgPGxhYmVsPlxuICAgICAgPGlucHV0IHR5cGU9XCJjaGVja2JveFwiIGJpbmQ6Y2hlY2tlZD17cmVzaXphYmxlfSAvPlxuICAgICAgUmVzaXphYmxlXG4gICAgPC9sYWJlbD5cbiAgICA8bGFiZWw + XG4gICAgICA8aW5wdXQgdHlwZT1cImNoZWNrYm94XCIgYmluZDpjaGVja2VkPXttYXhpbWl6ZWR9IC8 + XG4gICAgICBNYXhpbWl6ZVxuICAgIDwvbGFiZWw + XG4gICAgPGJ1dHRvbiB0aXRsZT1cIlVubWluaW1pemVzIGFmdGVyIDIgc2Vjb25kc1wiIG9uOmNsaWNrPXttaW5pbWl6ZV99PlxuICAgICAgTWluaW1pemVcbiAgICA8L2J1dHRvbj5cbiAgICA8YnV0dG9uIHRpdGxlPVwiVmlzaWJsZSBhZ2FpbiBhZnRlciAyIHNlY29uZHNcIiBvbjpjbGljaz17aGlkZV99PlxuICAgICAgSGlkZVxuICAgIDwvYnV0dG9uPlxuICAgIDxsYWJlbD5cbiAgICAgIDxpbnB1dCB0eXBlPVwiY2hlY2tib3hcIiBiaW5kOmNoZWNrZWQ9e3RyYW5zcGFyZW50fSAvPlxuICAgICAgVHJhbnNwYXJlbnRcbiAgICA8L2xhYmVsPlxuICAgIDxsYWJlbD5cbiAgICAgIDxpbnB1dCB0eXBlPVwiY2hlY2tib3hcIiBiaW5kOmNoZWNrZWQ9e2RlY29yYXRpb25zfSAvPlxuICAgICAgSGFzIGRlY29yYXRpb25zXG4gICAgPC9sYWJlbD5cbiAgICA8bGFiZWw + XG4gICAgICA8aW5wdXQgdHlwZT1cImNoZWNrYm94XCIgYmluZDpjaGVja2VkPXthbHdheXNPblRvcH0gLz5cbiAgICAgIEFsd2F5cyBvbiB0b3BcbiAgICA8L2xhYmVsPlxuICAgIDxsYWJlbD5cbiAgICAgIDxpbnB1dCB0eXBlPVwiY2hlY2tib3hcIiBiaW5kOmNoZWNrZWQ9e2Z1bGxzY3JlZW59IC8 + XG4gICAgICBGdWxsc2NyZWVuXG4gICAgPC9sYWJlbD5cbiAgICA8YnV0dG9uIG9uOmNsaWNrPXtnZXRJY29ufT4gQ2hhbmdlIGljb24gPC9idXR0b24 + XG4gIDwvZGl2PlxuICA8ZGl2PlxuICAgIDxkaXYgY2xhc3M9XCJ3aW5kb3ctY29udHJvbHMgZmxleCBmbGV4LXJvd1wiPlxuICAgICAgPGRpdiBjbGFzcz1cI
append _dev ( document . head , style ) ;
}
function create _fragment$4 ( ctx ) {
let div15 ;
let div0 ;
let label0 ;
let input0 ;
let t0 ;
let t1 ;
let label1 ;
let input1 ;
let t2 ;
let t3 ;
let button0 ;
let t5 ;
let button1 ;
let t7 ;
let label2 ;
let input2 ;
let t8 ;
let t9 ;
let label3 ;
let input3 ;
let t10 ;
let t11 ;
let label4 ;
let input4 ;
let t12 ;
let t13 ;
let label5 ;
let input5 ;
let t14 ;
let t15 ;
let button2 ;
let t17 ;
let div14 ;
let div13 ;
let div3 ;
let div1 ;
let t18 ;
let input6 ;
let t19 ;
let div2 ;
let t20 ;
let input7 ;
let t21 ;
let div6 ;
let div4 ;
let t22 ;
let input8 ;
let t23 ;
let div5 ;
let t24 ;
let input9 ;
let t25 ;
let div9 ;
let div7 ;
let t26 ;
let input10 ;
let t27 ;
let div8 ;
let t28 ;
let input11 ;
let t29 ;
let div12 ;
let div10 ;
let t30 ;
let input12 ;
let t31 ;
let div11 ;
let t32 ;
let input13 ;
let t33 ;
let form0 ;
let input14 ;
let t34 ;
let button3 ;
let t36 ;
let form1 ;
let input15 ;
let t37 ;
let button4 ;
let mounted ;
let dispose ;
const block = {
c : function create ( ) {
div15 = element ( "div" ) ;
div0 = element ( "div" ) ;
label0 = element ( "label" ) ;
input0 = element ( "input" ) ;
t0 = text ( "\n Resizable" ) ;
t1 = space ( ) ;
label1 = element ( "label" ) ;
input1 = element ( "input" ) ;
t2 = text ( "\n Maximize" ) ;
t3 = space ( ) ;
button0 = element ( "button" ) ;
button0 . textContent = "Minimize" ;
t5 = space ( ) ;
button1 = element ( "button" ) ;
button1 . textContent = "Hide" ;
t7 = space ( ) ;
label2 = element ( "label" ) ;
input2 = element ( "input" ) ;
t8 = text ( "\n Transparent" ) ;
t9 = space ( ) ;
label3 = element ( "label" ) ;
input3 = element ( "input" ) ;
t10 = text ( "\n Has decorations" ) ;
t11 = space ( ) ;
label4 = element ( "label" ) ;
input4 = element ( "input" ) ;
t12 = text ( "\n Always on top" ) ;
t13 = space ( ) ;
label5 = element ( "label" ) ;
input5 = element ( "input" ) ;
t14 = text ( "\n Fullscreen" ) ;
t15 = space ( ) ;
button2 = element ( "button" ) ;
button2 . textContent = "Change icon" ;
t17 = space ( ) ;
div14 = element ( "div" ) ;
div13 = element ( "div" ) ;
div3 = element ( "div" ) ;
div1 = element ( "div" ) ;
t18 = text ( "X\n " ) ;
input6 = element ( "input" ) ;
t19 = space ( ) ;
div2 = element ( "div" ) ;
t20 = text ( "Y\n " ) ;
input7 = element ( "input" ) ;
t21 = space ( ) ;
div6 = element ( "div" ) ;
div4 = element ( "div" ) ;
t22 = text ( "Width\n " ) ;
input8 = element ( "input" ) ;
t23 = space ( ) ;
div5 = element ( "div" ) ;
t24 = text ( "Height\n " ) ;
input9 = element ( "input" ) ;
t25 = space ( ) ;
div9 = element ( "div" ) ;
div7 = element ( "div" ) ;
t26 = text ( "Min width\n " ) ;
input10 = element ( "input" ) ;
t27 = space ( ) ;
div8 = element ( "div" ) ;
t28 = text ( "Min height\n " ) ;
input11 = element ( "input" ) ;
t29 = space ( ) ;
div12 = element ( "div" ) ;
div10 = element ( "div" ) ;
t30 = text ( "Max width\n " ) ;
input12 = element ( "input" ) ;
t31 = space ( ) ;
div11 = element ( "div" ) ;
t32 = text ( "Max height\n " ) ;
input13 = element ( "input" ) ;
t33 = space ( ) ;
form0 = element ( "form" ) ;
input14 = element ( "input" ) ;
t34 = space ( ) ;
button3 = element ( "button" ) ;
button3 . textContent = "Set title" ;
t36 = space ( ) ;
form1 = element ( "form" ) ;
input15 = element ( "input" ) ;
t37 = space ( ) ;
button4 = element ( "button" ) ;
button4 . textContent = "Open URL" ;
attr _dev ( input0 , "type" , "checkbox" ) ;
add _location ( input0 , file$4 , 89 , 6 , 1739 ) ;
add _location ( label0 , file$4 , 88 , 4 , 1725 ) ;
attr _dev ( input1 , "type" , "checkbox" ) ;
add _location ( input1 , file$4 , 93 , 6 , 1837 ) ;
add _location ( label1 , file$4 , 92 , 4 , 1823 ) ;
attr _dev ( button0 , "title" , "Unminimizes after 2 seconds" ) ;
add _location ( button0 , file$4 , 96 , 4 , 1920 ) ;
attr _dev ( button1 , "title" , "Visible again after 2 seconds" ) ;
add _location ( button1 , file$4 , 99 , 4 , 2019 ) ;
attr _dev ( input2 , "type" , "checkbox" ) ;
add _location ( input2 , file$4 , 103 , 6 , 2126 ) ;
add _location ( label2 , file$4 , 102 , 4 , 2112 ) ;
attr _dev ( input3 , "type" , "checkbox" ) ;
add _location ( input3 , file$4 , 107 , 6 , 2228 ) ;
add _location ( label3 , file$4 , 106 , 4 , 2214 ) ;
attr _dev ( input4 , "type" , "checkbox" ) ;
add _location ( input4 , file$4 , 111 , 6 , 2334 ) ;
add _location ( label4 , file$4 , 110 , 4 , 2320 ) ;
attr _dev ( input5 , "type" , "checkbox" ) ;
add _location ( input5 , file$4 , 115 , 6 , 2438 ) ;
add _location ( label5 , file$4 , 114 , 4 , 2424 ) ;
add _location ( button2 , file$4 , 118 , 4 , 2524 ) ;
add _location ( div0 , file$4 , 87 , 2 , 1715 ) ;
attr _dev ( input6 , "type" , "number" ) ;
attr _dev ( input6 , "min" , "0" ) ;
attr _dev ( input6 , "class" , "svelte-b76pvm" ) ;
add _location ( input6 , file$4 , 125 , 10 , 2709 ) ;
add _location ( div1 , file$4 , 123 , 8 , 2681 ) ;
attr _dev ( input7 , "type" , "number" ) ;
attr _dev ( input7 , "min" , "0" ) ;
attr _dev ( input7 , "class" , "svelte-b76pvm" ) ;
add _location ( input7 , file$4 , 129 , 10 , 2807 ) ;
add _location ( div2 , file$4 , 127 , 8 , 2779 ) ;
attr _dev ( div3 , "class" , "flex col grow svelte-b76pvm" ) ;
add _location ( div3 , file$4 , 122 , 6 , 2645 ) ;
attr _dev ( input8 , "type" , "number" ) ;
attr _dev ( input8 , "min" , "400" ) ;
attr _dev ( input8 , "class" , "svelte-b76pvm" ) ;
add _location ( input8 , file$4 , 136 , 10 , 2957 ) ;
add _location ( div4 , file$4 , 134 , 8 , 2925 ) ;
attr _dev ( input9 , "type" , "number" ) ;
attr _dev ( input9 , "min" , "400" ) ;
attr _dev ( input9 , "class" , "svelte-b76pvm" ) ;
add _location ( input9 , file$4 , 140 , 10 , 3066 ) ;
add _location ( div5 , file$4 , 138 , 8 , 3033 ) ;
attr _dev ( div6 , "class" , "flex col grow svelte-b76pvm" ) ;
add _location ( div6 , file$4 , 133 , 6 , 2889 ) ;
attr _dev ( input10 , "type" , "number" ) ;
attr _dev ( input10 , "class" , "svelte-b76pvm" ) ;
add _location ( input10 , file$4 , 147 , 10 , 3227 ) ;
add _location ( div7 , file$4 , 145 , 8 , 3191 ) ;
attr _dev ( input11 , "type" , "number" ) ;
attr _dev ( input11 , "class" , "svelte-b76pvm" ) ;
add _location ( input11 , file$4 , 151 , 10 , 3333 ) ;
add _location ( div8 , file$4 , 149 , 8 , 3296 ) ;
attr _dev ( div9 , "class" , "flex col grow svelte-b76pvm" ) ;
add _location ( div9 , file$4 , 144 , 6 , 3155 ) ;
attr _dev ( input12 , "type" , "number" ) ;
attr _dev ( input12 , "min" , "400" ) ;
attr _dev ( input12 , "class" , "svelte-b76pvm" ) ;
add _location ( input12 , file$4 , 158 , 10 , 3487 ) ;
add _location ( div10 , file$4 , 156 , 8 , 3451 ) ;
attr _dev ( input13 , "type" , "number" ) ;
attr _dev ( input13 , "min" , "400" ) ;
attr _dev ( input13 , "class" , "svelte-b76pvm" ) ;
add _location ( input13 , file$4 , 162 , 10 , 3603 ) ;
add _location ( div11 , file$4 , 160 , 8 , 3566 ) ;
attr _dev ( div12 , "class" , "flex col grow svelte-b76pvm" ) ;
add _location ( div12 , file$4 , 155 , 6 , 3415 ) ;
attr _dev ( div13 , "class" , "window-controls flex flex-row svelte-b76pvm" ) ;
add _location ( div13 , file$4 , 121 , 4 , 2595 ) ;
add _location ( div14 , file$4 , 120 , 2 , 2585 ) ;
attr _dev ( div15 , "class" , "flex col" ) ;
add _location ( div15 , file$4 , 86 , 0 , 1690 ) ;
attr _dev ( input14 , "id" , "title" ) ;
add _location ( input14 , file$4 , 169 , 2 , 3786 ) ;
attr _dev ( button3 , "class" , "button" ) ;
attr _dev ( button3 , "type" , "submit" ) ;
add _location ( button3 , file$4 , 170 , 2 , 3834 ) ;
set _style ( form0 , "margin-top" , "24px" ) ;
add _location ( form0 , file$4 , 168 , 0 , 3715 ) ;
attr _dev ( input15 , "id" , "url" ) ;
add _location ( input15 , file$4 , 173 , 2 , 3967 ) ;
attr _dev ( button4 , "class" , "button" ) ;
attr _dev ( button4 , "id" , "open-url" ) ;
add _location ( button4 , file$4 , 174 , 2 , 4010 ) ;
set _style ( form1 , "margin-top" , "24px" ) ;
add _location ( form1 , file$4 , 172 , 0 , 3898 ) ;
} ,
l : function claim ( nodes ) {
throw new Error (
"options.hydrate only works if the component was compiled with the `hydratable: true` option"
) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , div15 , anchor ) ;
append _dev ( div15 , div0 ) ;
append _dev ( div0 , label0 ) ;
append _dev ( label0 , input0 ) ;
input0 . checked = /*resizable*/ ctx [ 0 ] ;
append _dev ( label0 , t0 ) ;
append _dev ( div0 , t1 ) ;
append _dev ( div0 , label1 ) ;
append _dev ( label1 , input1 ) ;
input1 . checked = /*maximized*/ ctx [ 1 ] ;
append _dev ( label1 , t2 ) ;
append _dev ( div0 , t3 ) ;
append _dev ( div0 , button0 ) ;
append _dev ( div0 , t5 ) ;
append _dev ( div0 , button1 ) ;
append _dev ( div0 , t7 ) ;
append _dev ( div0 , label2 ) ;
append _dev ( label2 , input2 ) ;
input2 . checked = /*transparent*/ ctx [ 14 ] ;
append _dev ( label2 , t8 ) ;
append _dev ( div0 , t9 ) ;
append _dev ( div0 , label3 ) ;
append _dev ( label3 , input3 ) ;
input3 . checked = /*decorations*/ ctx [ 2 ] ;
append _dev ( label3 , t10 ) ;
append _dev ( div0 , t11 ) ;
append _dev ( div0 , label4 ) ;
append _dev ( label4 , input4 ) ;
input4 . checked = /*alwaysOnTop*/ ctx [ 3 ] ;
append _dev ( label4 , t12 ) ;
append _dev ( div0 , t13 ) ;
append _dev ( div0 , label5 ) ;
append _dev ( label5 , input5 ) ;
input5 . checked = /*fullscreen*/ ctx [ 4 ] ;
append _dev ( label5 , t14 ) ;
append _dev ( div0 , t15 ) ;
append _dev ( div0 , button2 ) ;
append _dev ( div15 , t17 ) ;
append _dev ( div15 , div14 ) ;
append _dev ( div14 , div13 ) ;
append _dev ( div13 , div3 ) ;
append _dev ( div3 , div1 ) ;
append _dev ( div1 , t18 ) ;
append _dev ( div1 , input6 ) ;
set _input _value ( input6 , /*x*/ ctx [ 11 ] ) ;
append _dev ( div3 , t19 ) ;
append _dev ( div3 , div2 ) ;
append _dev ( div2 , t20 ) ;
append _dev ( div2 , input7 ) ;
set _input _value ( input7 , /*y*/ ctx [ 12 ] ) ;
append _dev ( div13 , t21 ) ;
append _dev ( div13 , div6 ) ;
append _dev ( div6 , div4 ) ;
append _dev ( div4 , t22 ) ;
append _dev ( div4 , input8 ) ;
set _input _value ( input8 , /*width*/ ctx [ 5 ] ) ;
append _dev ( div6 , t23 ) ;
append _dev ( div6 , div5 ) ;
append _dev ( div5 , t24 ) ;
append _dev ( div5 , input9 ) ;
set _input _value ( input9 , /*height*/ ctx [ 6 ] ) ;
append _dev ( div13 , t25 ) ;
append _dev ( div13 , div9 ) ;
append _dev ( div9 , div7 ) ;
append _dev ( div7 , t26 ) ;
append _dev ( div7 , input10 ) ;
set _input _value ( input10 , /*minWidth*/ ctx [ 7 ] ) ;
append _dev ( div9 , t27 ) ;
append _dev ( div9 , div8 ) ;
append _dev ( div8 , t28 ) ;
append _dev ( div8 , input11 ) ;
set _input _value ( input11 , /*minHeight*/ ctx [ 8 ] ) ;
append _dev ( div13 , t29 ) ;
append _dev ( div13 , div12 ) ;
append _dev ( div12 , div10 ) ;
append _dev ( div10 , t30 ) ;
append _dev ( div10 , input12 ) ;
set _input _value ( input12 , /*maxWidth*/ ctx [ 9 ] ) ;
append _dev ( div12 , t31 ) ;
append _dev ( div12 , div11 ) ;
append _dev ( div11 , t32 ) ;
append _dev ( div11 , input13 ) ;
set _input _value ( input13 , /*maxHeight*/ ctx [ 10 ] ) ;
insert _dev ( target , t33 , anchor ) ;
insert _dev ( target , form0 , anchor ) ;
append _dev ( form0 , input14 ) ;
set _input _value ( input14 , /*windowTitle*/ ctx [ 15 ] ) ;
append _dev ( form0 , t34 ) ;
append _dev ( form0 , button3 ) ;
insert _dev ( target , t36 , anchor ) ;
insert _dev ( target , form1 , anchor ) ;
append _dev ( form1 , input15 ) ;
set _input _value ( input15 , /*urlValue*/ ctx [ 13 ] ) ;
append _dev ( form1 , t37 ) ;
append _dev ( form1 , button4 ) ;
if ( ! mounted ) {
dispose = [
listen _dev ( input0 , "change" , /*input0_change_handler*/ ctx [ 21 ] ) ,
listen _dev ( input1 , "change" , /*input1_change_handler*/ ctx [ 22 ] ) ,
listen _dev (
button0 ,
"click" ,
/*minimize_*/ ctx [ 19 ] ,
false ,
false ,
false
) ,
listen _dev (
button1 ,
"click" ,
/*hide_*/ ctx [ 18 ] ,
false ,
false ,
false
) ,
listen _dev ( input2 , "change" , /*input2_change_handler*/ ctx [ 23 ] ) ,
listen _dev ( input3 , "change" , /*input3_change_handler*/ ctx [ 24 ] ) ,
listen _dev ( input4 , "change" , /*input4_change_handler*/ ctx [ 25 ] ) ,
listen _dev ( input5 , "change" , /*input5_change_handler*/ ctx [ 26 ] ) ,
listen _dev (
button2 ,
"click" ,
/*getIcon*/ ctx [ 20 ] ,
false ,
false ,
false
) ,
listen _dev ( input6 , "input" , /*input6_input_handler*/ ctx [ 27 ] ) ,
listen _dev ( input7 , "input" , /*input7_input_handler*/ ctx [ 28 ] ) ,
listen _dev ( input8 , "input" , /*input8_input_handler*/ ctx [ 29 ] ) ,
listen _dev ( input9 , "input" , /*input9_input_handler*/ ctx [ 30 ] ) ,
listen _dev ( input10 , "input" , /*input10_input_handler*/ ctx [ 31 ] ) ,
listen _dev ( input11 , "input" , /*input11_input_handler*/ ctx [ 32 ] ) ,
listen _dev ( input12 , "input" , /*input12_input_handler*/ ctx [ 33 ] ) ,
listen _dev ( input13 , "input" , /*input13_input_handler*/ ctx [ 34 ] ) ,
listen _dev ( input14 , "input" , /*input14_input_handler*/ ctx [ 35 ] ) ,
listen _dev (
form0 ,
"submit" ,
prevent _default ( /*setTitle_*/ ctx [ 17 ] ) ,
false ,
true ,
false
) ,
listen _dev ( input15 , "input" , /*input15_input_handler*/ ctx [ 36 ] ) ,
listen _dev (
form1 ,
"submit" ,
prevent _default ( /*openUrl*/ ctx [ 16 ] ) ,
false ,
true ,
false
) ,
] ;
mounted = true ;
}
} ,
p : function update ( ctx , dirty ) {
if ( dirty [ 0 ] & /*resizable*/ 1 ) {
input0 . checked = /*resizable*/ ctx [ 0 ] ;
}
if ( dirty [ 0 ] & /*maximized*/ 2 ) {
input1 . checked = /*maximized*/ ctx [ 1 ] ;
}
if ( dirty [ 0 ] & /*transparent*/ 16384 ) {
input2 . checked = /*transparent*/ ctx [ 14 ] ;
}
if ( dirty [ 0 ] & /*decorations*/ 4 ) {
input3 . checked = /*decorations*/ ctx [ 2 ] ;
}
if ( dirty [ 0 ] & /*alwaysOnTop*/ 8 ) {
input4 . checked = /*alwaysOnTop*/ ctx [ 3 ] ;
}
if ( dirty [ 0 ] & /*fullscreen*/ 16 ) {
input5 . checked = /*fullscreen*/ ctx [ 4 ] ;
}
if (
dirty [ 0 ] & /*x*/ 2048 &&
to _number ( input6 . value ) !== /*x*/ ctx [ 11 ]
) {
set _input _value ( input6 , /*x*/ ctx [ 11 ] ) ;
}
if (
dirty [ 0 ] & /*y*/ 4096 &&
to _number ( input7 . value ) !== /*y*/ ctx [ 12 ]
) {
set _input _value ( input7 , /*y*/ ctx [ 12 ] ) ;
}
if (
dirty [ 0 ] & /*width*/ 32 &&
to _number ( input8 . value ) !== /*width*/ ctx [ 5 ]
) {
set _input _value ( input8 , /*width*/ ctx [ 5 ] ) ;
}
if (
dirty [ 0 ] & /*height*/ 64 &&
to _number ( input9 . value ) !== /*height*/ ctx [ 6 ]
) {
set _input _value ( input9 , /*height*/ ctx [ 6 ] ) ;
}
if (
dirty [ 0 ] & /*minWidth*/ 128 &&
to _number ( input10 . value ) !== /*minWidth*/ ctx [ 7 ]
) {
set _input _value ( input10 , /*minWidth*/ ctx [ 7 ] ) ;
}
if (
dirty [ 0 ] & /*minHeight*/ 256 &&
to _number ( input11 . value ) !== /*minHeight*/ ctx [ 8 ]
) {
set _input _value ( input11 , /*minHeight*/ ctx [ 8 ] ) ;
}
if (
dirty [ 0 ] & /*maxWidth*/ 512 &&
to _number ( input12 . value ) !== /*maxWidth*/ ctx [ 9 ]
) {
set _input _value ( input12 , /*maxWidth*/ ctx [ 9 ] ) ;
}
if (
dirty [ 0 ] & /*maxHeight*/ 1024 &&
to _number ( input13 . value ) !== /*maxHeight*/ ctx [ 10 ]
) {
set _input _value ( input13 , /*maxHeight*/ ctx [ 10 ] ) ;
}
if (
dirty [ 0 ] & /*windowTitle*/ 32768 &&
input14 . value !== /*windowTitle*/ ctx [ 15 ]
) {
set _input _value ( input14 , /*windowTitle*/ ctx [ 15 ] ) ;
}
if (
dirty [ 0 ] & /*urlValue*/ 8192 &&
input15 . value !== /*urlValue*/ ctx [ 13 ]
) {
set _input _value ( input15 , /*urlValue*/ ctx [ 13 ] ) ;
}
} ,
i : noop ,
o : noop ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( div15 ) ;
if ( detaching ) detach _dev ( t33 ) ;
if ( detaching ) detach _dev ( form0 ) ;
if ( detaching ) detach _dev ( t36 ) ;
if ( detaching ) detach _dev ( form1 ) ;
mounted = false ;
run _all ( dispose ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _fragment$4 . name ,
type : "component" ,
source : "" ,
ctx ,
} ) ;
return block ;
}
function instance$4 ( $$self , $$props , $$invalidate ) {
let { $$slots : slots = { } , $$scope } = $$props ;
validate _slots ( "Window" , slots , [ ] ) ;
const {
setResizable ,
setTitle ,
maximize ,
unmaximize ,
minimize ,
unminimize ,
show ,
hide ,
setTransparent ,
setDecorations ,
setAlwaysOnTop ,
setWidth ,
setHeight , // resize,
setMinSize ,
setMaxSize ,
setX ,
setY , // setPosition,
setFullscreen ,
setIcon ,
} = l ;
let urlValue = "https://tauri.studio" ;
let resizable = true ;
let maximized = false ;
let transparent = false ;
let decorations = true ;
let alwaysOnTop = false ;
let fullscreen = false ;
let width = 900 ;
let height = 700 ;
let minWidth = 600 ;
let minHeight = 600 ;
let maxWidth = null ;
let maxHeight = null ;
let x = 100 ;
let y = 100 ;
let windowTitle = "Awesome Tauri Example!" ;
function openUrl ( ) {
d$3 ( urlValue ) ;
}
function setTitle _ ( ) {
setTitle ( windowTitle ) ;
}
function hide _ ( ) {
hide ( ) ;
setTimeout ( show , 2000 ) ;
}
function minimize _ ( ) {
minimize ( ) ;
setTimeout ( unminimize , 2000 ) ;
}
function getIcon ( ) {
i$2 ( { multiple : false } ) . then ( setIcon ) ;
}
const writable _props = [ ] ;
Object . keys ( $$props ) . forEach ( ( key ) => {
if ( ! ~ writable _props . indexOf ( key ) && key . slice ( 0 , 2 ) !== "$$" )
console . warn ( ` <Window> was created with unknown prop ' ${ key } ' ` ) ;
} ) ;
function input0 _change _handler ( ) {
resizable = this . checked ;
$$invalidate ( 0 , resizable ) ;
}
function input1 _change _handler ( ) {
maximized = this . checked ;
$$invalidate ( 1 , maximized ) ;
}
function input2 _change _handler ( ) {
transparent = this . checked ;
$$invalidate ( 14 , transparent ) ;
}
function input3 _change _handler ( ) {
decorations = this . checked ;
$$invalidate ( 2 , decorations ) ;
}
function input4 _change _handler ( ) {
alwaysOnTop = this . checked ;
$$invalidate ( 3 , alwaysOnTop ) ;
}
function input5 _change _handler ( ) {
fullscreen = this . checked ;
$$invalidate ( 4 , fullscreen ) ;
}
function input6 _input _handler ( ) {
x = to _number ( this . value ) ;
$$invalidate ( 11 , x ) ;
}
function input7 _input _handler ( ) {
y = to _number ( this . value ) ;
$$invalidate ( 12 , y ) ;
}
function input8 _input _handler ( ) {
width = to _number ( this . value ) ;
$$invalidate ( 5 , width ) ;
}
function input9 _input _handler ( ) {
height = to _number ( this . value ) ;
$$invalidate ( 6 , height ) ;
}
function input10 _input _handler ( ) {
minWidth = to _number ( this . value ) ;
$$invalidate ( 7 , minWidth ) ;
}
function input11 _input _handler ( ) {
minHeight = to _number ( this . value ) ;
$$invalidate ( 8 , minHeight ) ;
}
function input12 _input _handler ( ) {
maxWidth = to _number ( this . value ) ;
$$invalidate ( 9 , maxWidth ) ;
}
function input13 _input _handler ( ) {
maxHeight = to _number ( this . value ) ;
$$invalidate ( 10 , maxHeight ) ;
}
function input14 _input _handler ( ) {
windowTitle = this . value ;
$$invalidate ( 15 , windowTitle ) ;
}
function input15 _input _handler ( ) {
urlValue = this . value ;
$$invalidate ( 13 , urlValue ) ;
}
$$self . $capture _state = ( ) => ( {
appWindow : l ,
openDialog : i$2 ,
open : d$3 ,
setResizable ,
setTitle ,
maximize ,
unmaximize ,
minimize ,
unminimize ,
show ,
hide ,
setTransparent ,
setDecorations ,
setAlwaysOnTop ,
setWidth ,
setHeight ,
setMinSize ,
setMaxSize ,
setX ,
setY ,
setFullscreen ,
setIcon ,
urlValue ,
resizable ,
maximized ,
transparent ,
decorations ,
alwaysOnTop ,
fullscreen ,
width ,
height ,
minWidth ,
minHeight ,
maxWidth ,
maxHeight ,
x ,
y ,
windowTitle ,
openUrl ,
setTitle _ ,
hide _ ,
minimize _ ,
getIcon ,
} ) ;
$$self . $inject _state = ( $$props ) => {
if ( "urlValue" in $$props )
$$invalidate ( 13 , ( urlValue = $$props . urlValue ) ) ;
if ( "resizable" in $$props )
$$invalidate ( 0 , ( resizable = $$props . resizable ) ) ;
if ( "maximized" in $$props )
$$invalidate ( 1 , ( maximized = $$props . maximized ) ) ;
if ( "transparent" in $$props )
$$invalidate ( 14 , ( transparent = $$props . transparent ) ) ;
if ( "decorations" in $$props )
$$invalidate ( 2 , ( decorations = $$props . decorations ) ) ;
if ( "alwaysOnTop" in $$props )
$$invalidate ( 3 , ( alwaysOnTop = $$props . alwaysOnTop ) ) ;
if ( "fullscreen" in $$props )
$$invalidate ( 4 , ( fullscreen = $$props . fullscreen ) ) ;
if ( "width" in $$props ) $$invalidate ( 5 , ( width = $$props . width ) ) ;
if ( "height" in $$props ) $$invalidate ( 6 , ( height = $$props . height ) ) ;
if ( "minWidth" in $$props ) $$invalidate ( 7 , ( minWidth = $$props . minWidth ) ) ;
if ( "minHeight" in $$props )
$$invalidate ( 8 , ( minHeight = $$props . minHeight ) ) ;
if ( "maxWidth" in $$props ) $$invalidate ( 9 , ( maxWidth = $$props . maxWidth ) ) ;
if ( "maxHeight" in $$props )
$$invalidate ( 10 , ( maxHeight = $$props . maxHeight ) ) ;
if ( "x" in $$props ) $$invalidate ( 11 , ( x = $$props . x ) ) ;
if ( "y" in $$props ) $$invalidate ( 12 , ( y = $$props . y ) ) ;
if ( "windowTitle" in $$props )
$$invalidate ( 15 , ( windowTitle = $$props . windowTitle ) ) ;
} ;
if ( $$props && "$$inject" in $$props ) {
$$self . $inject _state ( $$props . $$inject ) ;
}
$$self . $$ . update = ( ) => {
if ( $$self . $$ . dirty [ 0 ] & /*resizable*/ 1 ) {
setResizable ( resizable ) ;
}
if ( $$self . $$ . dirty [ 0 ] & /*maximized*/ 2 ) {
maximized ? maximize ( ) : unmaximize ( ) ;
}
if ( $$self . $$ . dirty [ 0 ] & /*decorations*/ 4 ) {
//$: setTransparent(transparent)
setDecorations ( decorations ) ;
}
if ( $$self . $$ . dirty [ 0 ] & /*alwaysOnTop*/ 8 ) {
setAlwaysOnTop ( alwaysOnTop ) ;
}
if ( $$self . $$ . dirty [ 0 ] & /*fullscreen*/ 16 ) {
setFullscreen ( fullscreen ) ;
}
if ( $$self . $$ . dirty [ 0 ] & /*width*/ 32 ) {
setWidth ( width ) ;
}
if ( $$self . $$ . dirty [ 0 ] & /*height*/ 64 ) {
setHeight ( height ) ;
}
if ( $$self . $$ . dirty [ 0 ] & /*minWidth, minHeight*/ 384 ) {
minWidth && minHeight && setMinSize ( minWidth , minHeight ) ;
}
if ( $$self . $$ . dirty [ 0 ] & /*maxWidth, maxHeight*/ 1536 ) {
maxWidth && maxHeight && setMaxSize ( maxWidth , maxHeight ) ;
}
if ( $$self . $$ . dirty [ 0 ] & /*x*/ 2048 ) {
setX ( x ) ;
}
if ( $$self . $$ . dirty [ 0 ] & /*y*/ 4096 ) {
setY ( y ) ;
}
} ;
return [
resizable ,
maximized ,
decorations ,
alwaysOnTop ,
fullscreen ,
width ,
height ,
minWidth ,
minHeight ,
maxWidth ,
maxHeight ,
x ,
y ,
urlValue ,
transparent ,
windowTitle ,
openUrl ,
setTitle _ ,
hide _ ,
minimize _ ,
getIcon ,
input0 _change _handler ,
input1 _change _handler ,
input2 _change _handler ,
input3 _change _handler ,
input4 _change _handler ,
input5 _change _handler ,
input6 _input _handler ,
input7 _input _handler ,
input8 _input _handler ,
input9 _input _handler ,
input10 _input _handler ,
input11 _input _handler ,
input12 _input _handler ,
input13 _input _handler ,
input14 _input _handler ,
input15 _input _handler ,
] ;
}
class Window extends SvelteComponentDev {
constructor ( options ) {
super ( options ) ;
if ( ! document . getElementById ( "svelte-b76pvm-style" ) ) add _css ( ) ;
init ( this , options , instance$4 , create _fragment$4 , safe _not _equal , { } , [
- 1 ,
- 1 ,
] ) ;
dispatch _dev ( "SvelteRegisterComponent" , {
component : this ,
tagName : "Window" ,
options ,
id : create _fragment$4 . name ,
} ) ;
}
}
const subscriber _queue = [ ] ;
/ * *
* Create a ` Writable ` store that allows both updating and reading by subscription .
* @ param { *= } value initial value
* @ param { StartStopNotifier = } start start and stop notifications for subscriptions
* /
function writable ( value , start = noop ) {
let stop ;
const subscribers = [ ] ;
function set ( new _value ) {
if ( safe _not _equal ( value , new _value ) ) {
value = new _value ;
if ( stop ) {
// store is ready
const run _queue = ! subscriber _queue . length ;
for ( let i = 0 ; i < subscribers . length ; i += 1 ) {
const s = subscribers [ i ] ;
s [ 1 ] ( ) ;
subscriber _queue . push ( s , value ) ;
}
if ( run _queue ) {
for ( let i = 0 ; i < subscriber _queue . length ; i += 2 ) {
subscriber _queue [ i ] [ 0 ] ( subscriber _queue [ i + 1 ] ) ;
}
subscriber _queue . length = 0 ;
}
}
}
}
function update ( fn ) {
set ( fn ( value ) ) ;
}
function subscribe ( run , invalidate = noop ) {
const subscriber = [ run , invalidate ] ;
subscribers . push ( subscriber ) ;
if ( subscribers . length === 1 ) {
stop = start ( set ) || noop ;
}
run ( value ) ;
return ( ) => {
const index = subscribers . indexOf ( subscriber ) ;
if ( index !== - 1 ) {
subscribers . splice ( index , 1 ) ;
}
if ( subscribers . length === 0 ) {
stop ( ) ;
stop = null ;
}
} ;
}
return { set , update , subscribe } ;
}
function u$1 ( u , n ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "GlobalShortcut" ,
message : { cmd : "register" , shortcut : u , handler : a$5 ( n ) } ,
} ) ,
] ;
} ) ;
} ) ;
}
function n ( u , n ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "GlobalShortcut" ,
message : { cmd : "registerAll" , shortcuts : u , handler : a$5 ( n ) } ,
} ) ,
] ;
} ) ;
} ) ;
}
function o ( e ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "GlobalShortcut" ,
message : { cmd : "isRegistered" , shortcut : e } ,
} ) ,
] ;
} ) ;
} ) ;
}
function s ( e ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "GlobalShortcut" ,
message : { cmd : "unregister" , shortcut : e } ,
} ) ,
] ;
} ) ;
} ) ;
}
function a ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
return o$6 ( this , function ( t ) {
return [
2 ,
n$4 ( {
_ _tauriModule : "GlobalShortcut" ,
message : { cmd : "unregisterAll" } ,
} ) ,
] ;
} ) ;
} ) ;
}
Object . freeze ( {
_ _proto _ _ : null ,
register : u$1 ,
registerAll : n ,
isRegistered : o ,
unregister : s ,
unregisterAll : a ,
} ) ;
/* src/components/Shortcuts.svelte generated by Svelte v3.35.0 */
const file$3 = "src/components/Shortcuts.svelte" ;
function get _each _context$1 ( ctx , list , i ) {
const child _ctx = ctx . slice ( ) ;
child _ctx [ 9 ] = list [ i ] ;
return child _ctx ;
}
// (56:4) {#each $shortcuts as savedShortcut}
function create _each _block$1 ( ctx ) {
let div ;
let t0 _value = /*savedShortcut*/ ctx [ 9 ] + "" ;
let t0 ;
let t1 ;
let button ;
let mounted ;
let dispose ;
function click _handler ( ) {
return /*click_handler*/ ctx [ 8 ] ( /*savedShortcut*/ ctx [ 9 ] ) ;
}
const block = {
c : function create ( ) {
div = element ( "div" ) ;
t0 = text ( t0 _value ) ;
t1 = space ( ) ;
button = element ( "button" ) ;
button . textContent = "Unregister" ;
attr _dev ( button , "type" , "button" ) ;
add _location ( button , file$3 , 58 , 8 , 1488 ) ;
add _location ( div , file$3 , 56 , 6 , 1450 ) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , div , anchor ) ;
append _dev ( div , t0 ) ;
append _dev ( div , t1 ) ;
append _dev ( div , button ) ;
if ( ! mounted ) {
dispose = listen _dev (
button ,
"click" ,
click _handler ,
false ,
false ,
false
) ;
mounted = true ;
}
} ,
p : function update ( new _ctx , dirty ) {
ctx = new _ctx ;
if (
dirty & /*$shortcuts*/ 2 &&
t0 _value !== ( t0 _value = /*savedShortcut*/ ctx [ 9 ] + "" )
)
set _data _dev ( t0 , t0 _value ) ;
} ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( div ) ;
mounted = false ;
dispose ( ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _each _block$1 . name ,
type : "each" ,
source : "(56:4) {#each $shortcuts as savedShortcut}" ,
ctx ,
} ) ;
return block ;
}
// (64:4) {#if $shortcuts.length}
function create _if _block$1 ( ctx ) {
let button ;
let mounted ;
let dispose ;
const block = {
c : function create ( ) {
button = element ( "button" ) ;
button . textContent = "Unregister all" ;
attr _dev ( button , "type" , "button" ) ;
add _location ( button , file$3 , 64 , 6 , 1652 ) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , button , anchor ) ;
if ( ! mounted ) {
dispose = listen _dev (
button ,
"click" ,
/*unregisterAll*/ ctx [ 5 ] ,
false ,
false ,
false
) ;
mounted = true ;
}
} ,
p : noop ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( button ) ;
mounted = false ;
dispose ( ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _if _block$1 . name ,
type : "if" ,
source : "(64:4) {#if $shortcuts.length}" ,
ctx ,
} ) ;
return block ;
}
function create _fragment$3 ( ctx ) {
let div2 ;
let div0 ;
let input ;
let t0 ;
let button ;
let t2 ;
let div1 ;
let t3 ;
let mounted ;
let dispose ;
let each _value = /*$shortcuts*/ ctx [ 1 ] ;
validate _each _argument ( each _value ) ;
let each _blocks = [ ] ;
for ( let i = 0 ; i < each _value . length ; i += 1 ) {
each _blocks [ i ] = create _each _block$1 (
get _each _context$1 ( ctx , each _value , i )
) ;
}
let if _block = /*$shortcuts*/ ctx [ 1 ] . length && create _if _block$1 ( ctx ) ;
const block = {
c : function create ( ) {
div2 = element ( "div" ) ;
div0 = element ( "div" ) ;
input = element ( "input" ) ;
t0 = space ( ) ;
button = element ( "button" ) ;
button . textContent = "Register" ;
t2 = space ( ) ;
div1 = element ( "div" ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . c ( ) ;
}
t3 = space ( ) ;
if ( if _block ) if _block . c ( ) ;
attr _dev (
input ,
"placeholder" ,
"Type a shortcut with '+' as separator..."
) ;
add _location ( input , file$3 , 48 , 4 , 1220 ) ;
attr _dev ( button , "type" , "button" ) ;
add _location ( button , file$3 , 52 , 4 , 1327 ) ;
add _location ( div0 , file$3 , 47 , 2 , 1210 ) ;
add _location ( div1 , file$3 , 54 , 2 , 1398 ) ;
add _location ( div2 , file$3 , 46 , 0 , 1202 ) ;
} ,
l : function claim ( nodes ) {
throw new Error (
"options.hydrate only works if the component was compiled with the `hydratable: true` option"
) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , div2 , anchor ) ;
append _dev ( div2 , div0 ) ;
append _dev ( div0 , input ) ;
set _input _value ( input , /*shortcut*/ ctx [ 0 ] ) ;
append _dev ( div0 , t0 ) ;
append _dev ( div0 , button ) ;
append _dev ( div2 , t2 ) ;
append _dev ( div2 , div1 ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . m ( div1 , null ) ;
}
append _dev ( div1 , t3 ) ;
if ( if _block ) if _block . m ( div1 , null ) ;
if ( ! mounted ) {
dispose = [
listen _dev ( input , "input" , /*input_input_handler*/ ctx [ 7 ] ) ,
listen _dev (
button ,
"click" ,
/*register*/ ctx [ 3 ] ,
false ,
false ,
false
) ,
] ;
mounted = true ;
}
} ,
p : function update ( ctx , [ dirty ] ) {
if ( dirty & /*shortcut*/ 1 && input . value !== /*shortcut*/ ctx [ 0 ] ) {
set _input _value ( input , /*shortcut*/ ctx [ 0 ] ) ;
}
if ( dirty & /*unregister, $shortcuts*/ 18 ) {
each _value = /*$shortcuts*/ ctx [ 1 ] ;
validate _each _argument ( each _value ) ;
let i ;
for ( i = 0 ; i < each _value . length ; i += 1 ) {
const child _ctx = get _each _context$1 ( ctx , each _value , i ) ;
if ( each _blocks [ i ] ) {
each _blocks [ i ] . p ( child _ctx , dirty ) ;
} else {
each _blocks [ i ] = create _each _block$1 ( child _ctx ) ;
each _blocks [ i ] . c ( ) ;
each _blocks [ i ] . m ( div1 , t3 ) ;
}
}
for ( ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . d ( 1 ) ;
}
each _blocks . length = each _value . length ;
}
if ( /*$shortcuts*/ ctx [ 1 ] . length ) {
if ( if _block ) {
if _block . p ( ctx , dirty ) ;
} else {
if _block = create _if _block$1 ( ctx ) ;
if _block . c ( ) ;
if _block . m ( div1 , null ) ;
}
} else if ( if _block ) {
if _block . d ( 1 ) ;
if _block = null ;
}
} ,
i : noop ,
o : noop ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( div2 ) ;
destroy _each ( each _blocks , detaching ) ;
if ( if _block ) if _block . d ( ) ;
mounted = false ;
run _all ( dispose ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _fragment$3 . name ,
type : "component" ,
source : "" ,
ctx ,
} ) ;
return block ;
}
function instance$3 ( $$self , $$props , $$invalidate ) {
let $shortcuts ;
let { $$slots : slots = { } , $$scope } = $$props ;
validate _slots ( "Shortcuts" , slots , [ ] ) ;
let { onMessage } = $$props ;
const shortcuts = writable ( [ ] ) ;
validate _store ( shortcuts , "shortcuts" ) ;
component _subscribe ( $$self , shortcuts , ( value ) =>
$$invalidate ( 1 , ( $shortcuts = value ) )
) ;
let shortcut = "CmdOrControl+X" ;
function register ( ) {
const shortcut _ = shortcut ;
u$1 ( shortcut _ , ( ) => {
onMessage ( ` Shortcut ${ shortcut _ } triggered ` ) ;
} )
. then ( ( ) => {
shortcuts . update ( ( shortcuts _ ) => [ ... shortcuts _ , shortcut _ ] ) ;
onMessage ( ` Shortcut ${ shortcut _ } registered successfully ` ) ;
} )
. catch ( onMessage ) ;
}
function unregister ( shortcut ) {
const shortcut _ = shortcut ;
s ( shortcut _ )
. then ( ( ) => {
shortcuts . update ( ( shortcuts _ ) =>
shortcuts _ . filter ( ( s ) => s !== shortcut _ )
) ;
onMessage ( ` Shortcut ${ shortcut _ } unregistered ` ) ;
} )
. catch ( onMessage ) ;
}
function unregisterAll ( ) {
a ( )
. then ( ( ) => {
shortcuts . update ( ( ) => [ ] ) ;
onMessage ( ` Unregistered all shortcuts ` ) ;
} )
. catch ( onMessage ) ;
}
const writable _props = [ "onMessage" ] ;
Object . keys ( $$props ) . forEach ( ( key ) => {
if ( ! ~ writable _props . indexOf ( key ) && key . slice ( 0 , 2 ) !== "$$" )
console . warn ( ` <Shortcuts> was created with unknown prop ' ${ key } ' ` ) ;
} ) ;
function input _input _handler ( ) {
shortcut = this . value ;
$$invalidate ( 0 , shortcut ) ;
}
const click _handler = ( savedShortcut ) => unregister ( savedShortcut ) ;
$$self . $$set = ( $$props ) => {
if ( "onMessage" in $$props )
$$invalidate ( 6 , ( onMessage = $$props . onMessage ) ) ;
} ;
$$self . $capture _state = ( ) => ( {
writable ,
registerShortcut : u$1 ,
unregisterShortcut : s ,
unregisterAllShortcuts : a ,
onMessage ,
shortcuts ,
shortcut ,
register ,
unregister ,
unregisterAll ,
$shortcuts ,
} ) ;
$$self . $inject _state = ( $$props ) => {
if ( "onMessage" in $$props )
$$invalidate ( 6 , ( onMessage = $$props . onMessage ) ) ;
if ( "shortcut" in $$props ) $$invalidate ( 0 , ( shortcut = $$props . shortcut ) ) ;
} ;
if ( $$props && "$$inject" in $$props ) {
$$self . $inject _state ( $$props . $$inject ) ;
}
return [
shortcut ,
$shortcuts ,
shortcuts ,
register ,
unregister ,
unregisterAll ,
onMessage ,
input _input _handler ,
click _handler ,
] ;
}
class Shortcuts extends SvelteComponentDev {
constructor ( options ) {
super ( options ) ;
init ( this , options , instance$3 , create _fragment$3 , safe _not _equal , {
onMessage : 6 ,
} ) ;
dispatch _dev ( "SvelteRegisterComponent" , {
component : this ,
tagName : "Shortcuts" ,
options ,
id : create _fragment$3 . name ,
} ) ;
const { ctx } = this . $$ ;
const props = options . props || { } ;
if ( /*onMessage*/ ctx [ 6 ] === undefined && ! ( "onMessage" in props ) ) {
console . warn (
"<Shortcuts> was created without expected prop 'onMessage'"
) ;
}
}
get onMessage ( ) {
throw new Error (
"<Shortcuts>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
set onMessage ( value ) {
throw new Error (
"<Shortcuts>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
}
/* src/components/Shell.svelte generated by Svelte v3.35.0 */
const file$2 = "src/components/Shell.svelte" ;
// (47:4) {#if child}
function create _if _block ( ctx ) {
let input ;
let t0 ;
let button ;
let mounted ;
let dispose ;
const block = {
c : function create ( ) {
input = element ( "input" ) ;
t0 = space ( ) ;
button = element ( "button" ) ;
button . textContent = "Write" ;
attr _dev ( input , "placeholder" , "write to stdin" ) ;
add _location ( input , file$2 , 47 , 6 , 1223 ) ;
attr _dev ( button , "class" , "button" ) ;
add _location ( button , file$2 , 48 , 6 , 1285 ) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , input , anchor ) ;
set _input _value ( input , /*stdin*/ ctx [ 1 ] ) ;
insert _dev ( target , t0 , anchor ) ;
insert _dev ( target , button , anchor ) ;
if ( ! mounted ) {
dispose = [
listen _dev ( input , "input" , /*input_input_handler_1*/ ctx [ 8 ] ) ,
listen _dev (
button ,
"click" ,
/*writeToStdin*/ ctx [ 5 ] ,
false ,
false ,
false
) ,
] ;
mounted = true ;
}
} ,
p : function update ( ctx , dirty ) {
if ( dirty & /*stdin*/ 2 && input . value !== /*stdin*/ ctx [ 1 ] ) {
set _input _value ( input , /*stdin*/ ctx [ 1 ] ) ;
}
} ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( input ) ;
if ( detaching ) detach _dev ( t0 ) ;
if ( detaching ) detach _dev ( button ) ;
mounted = false ;
run _all ( dispose ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _if _block . name ,
type : "if" ,
source : "(47:4) {#if child}" ,
ctx ,
} ) ;
return block ;
}
function create _fragment$2 ( ctx ) {
let div1 ;
let div0 ;
let input ;
let t0 ;
let button0 ;
let t2 ;
let button1 ;
let t4 ;
let mounted ;
let dispose ;
let if _block = /*child*/ ctx [ 2 ] && create _if _block ( ctx ) ;
const block = {
c : function create ( ) {
div1 = element ( "div" ) ;
div0 = element ( "div" ) ;
input = element ( "input" ) ;
t0 = space ( ) ;
button0 = element ( "button" ) ;
button0 . textContent = "Run" ;
t2 = space ( ) ;
button1 = element ( "button" ) ;
button1 . textContent = "Kill" ;
t4 = space ( ) ;
if ( if _block ) if _block . c ( ) ;
add _location ( input , file$2 , 43 , 4 , 1059 ) ;
attr _dev ( button0 , "class" , "button" ) ;
add _location ( button0 , file$2 , 44 , 4 , 1091 ) ;
attr _dev ( button1 , "class" , "button" ) ;
add _location ( button1 , file$2 , 45 , 4 , 1148 ) ;
add _location ( div0 , file$2 , 42 , 2 , 1049 ) ;
add _location ( div1 , file$2 , 41 , 0 , 1041 ) ;
} ,
l : function claim ( nodes ) {
throw new Error (
"options.hydrate only works if the component was compiled with the `hydratable: true` option"
) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , div1 , anchor ) ;
append _dev ( div1 , div0 ) ;
append _dev ( div0 , input ) ;
set _input _value ( input , /*script*/ ctx [ 0 ] ) ;
append _dev ( div0 , t0 ) ;
append _dev ( div0 , button0 ) ;
append _dev ( div0 , t2 ) ;
append _dev ( div0 , button1 ) ;
append _dev ( div0 , t4 ) ;
if ( if _block ) if _block . m ( div0 , null ) ;
if ( ! mounted ) {
dispose = [
listen _dev ( input , "input" , /*input_input_handler*/ ctx [ 7 ] ) ,
listen _dev ( button0 , "click" , /*spawn*/ ctx [ 3 ] , false , false , false ) ,
listen _dev ( button1 , "click" , /*kill*/ ctx [ 4 ] , false , false , false ) ,
] ;
mounted = true ;
}
} ,
p : function update ( ctx , [ dirty ] ) {
if ( dirty & /*script*/ 1 && input . value !== /*script*/ ctx [ 0 ] ) {
set _input _value ( input , /*script*/ ctx [ 0 ] ) ;
}
if ( /*child*/ ctx [ 2 ] ) {
if ( if _block ) {
if _block . p ( ctx , dirty ) ;
} else {
if _block = create _if _block ( ctx ) ;
if _block . c ( ) ;
if _block . m ( div0 , null ) ;
}
} else if ( if _block ) {
if _block . d ( 1 ) ;
if _block = null ;
}
} ,
i : noop ,
o : noop ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( div1 ) ;
if ( if _block ) if _block . d ( ) ;
mounted = false ;
run _all ( dispose ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _fragment$2 . name ,
type : "component" ,
source : "" ,
ctx ,
} ) ;
return block ;
}
function instance$2 ( $$self , $$props , $$invalidate ) {
let { $$slots : slots = { } , $$scope } = $$props ;
validate _slots ( "Shell" , slots , [ ] ) ;
const windows = navigator . userAgent . includes ( "Windows" ) ;
let cmd = windows ? "cmd" : "sh" ;
let args = windows ? [ "/C" ] : [ "-c" ] ;
let { onMessage } = $$props ;
let script = 'echo "hello world"' ;
let stdin = "" ;
let child ;
function spawn ( ) {
$$invalidate ( 2 , ( child = null ) ) ;
const command = new a$4 ( cmd , [ ... args , script ] ) ;
command . on ( "close" , ( data ) => {
onMessage (
` command finished with code ${ data . code } and signal ${ data . signal } `
) ;
$$invalidate ( 2 , ( child = null ) ) ;
} ) ;
command . on ( "error" , ( error ) => onMessage ( ` command error: " ${ error } " ` ) ) ;
command . stdout . on ( "data" , ( line ) =>
onMessage ( ` command stdout: " ${ line } " ` )
) ;
command . stderr . on ( "data" , ( line ) =>
onMessage ( ` command stderr: " ${ line } " ` )
) ;
command
. spawn ( )
. then ( ( c ) => {
$$invalidate ( 2 , ( child = c ) ) ;
} )
. catch ( onMessage ) ;
}
function kill ( ) {
child
. kill ( )
. then ( ( ) => onMessage ( "killed child process" ) )
. error ( onMessage ) ;
}
function writeToStdin ( ) {
child . write ( stdin ) . catch ( onMessage ) ;
}
const writable _props = [ "onMessage" ] ;
Object . keys ( $$props ) . forEach ( ( key ) => {
if ( ! ~ writable _props . indexOf ( key ) && key . slice ( 0 , 2 ) !== "$$" )
console . warn ( ` <Shell> was created with unknown prop ' ${ key } ' ` ) ;
} ) ;
function input _input _handler ( ) {
script = this . value ;
$$invalidate ( 0 , script ) ;
}
function input _input _handler _1 ( ) {
stdin = this . value ;
$$invalidate ( 1 , stdin ) ;
}
$$self . $$set = ( $$props ) => {
if ( "onMessage" in $$props )
$$invalidate ( 6 , ( onMessage = $$props . onMessage ) ) ;
} ;
$$self . $capture _state = ( ) => ( {
Command : a$4 ,
windows ,
cmd ,
args ,
onMessage ,
script ,
stdin ,
child ,
spawn ,
kill ,
writeToStdin ,
} ) ;
$$self . $inject _state = ( $$props ) => {
if ( "cmd" in $$props ) cmd = $$props . cmd ;
if ( "args" in $$props ) args = $$props . args ;
if ( "onMessage" in $$props )
$$invalidate ( 6 , ( onMessage = $$props . onMessage ) ) ;
if ( "script" in $$props ) $$invalidate ( 0 , ( script = $$props . script ) ) ;
if ( "stdin" in $$props ) $$invalidate ( 1 , ( stdin = $$props . stdin ) ) ;
if ( "child" in $$props ) $$invalidate ( 2 , ( child = $$props . child ) ) ;
} ;
if ( $$props && "$$inject" in $$props ) {
$$self . $inject _state ( $$props . $$inject ) ;
}
return [
script ,
stdin ,
child ,
spawn ,
kill ,
writeToStdin ,
onMessage ,
input _input _handler ,
input _input _handler _1 ,
] ;
}
class Shell extends SvelteComponentDev {
constructor ( options ) {
super ( options ) ;
init ( this , options , instance$2 , create _fragment$2 , safe _not _equal , {
onMessage : 6 ,
} ) ;
dispatch _dev ( "SvelteRegisterComponent" , {
component : this ,
tagName : "Shell" ,
options ,
id : create _fragment$2 . name ,
} ) ;
const { ctx } = this . $$ ;
const props = options . props || { } ;
if ( /*onMessage*/ ctx [ 6 ] === undefined && ! ( "onMessage" in props ) ) {
console . warn ( "<Shell> was created without expected prop 'onMessage'" ) ;
}
}
get onMessage ( ) {
throw new Error (
"<Shell>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
set onMessage ( value ) {
throw new Error (
"<Shell>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
}
function i ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
function t ( ) {
r && r ( ) , ( r = void 0 ) ;
}
var r ;
return o$6 ( this , function ( n ) {
return [
2 ,
new Promise ( function ( n , i ) {
o$3 ( "tauri://update-status" , function ( o ) {
var a ;
( a = null == o ? void 0 : o . payload ) . error
? ( t ( ) , i ( a . error ) )
: "DONE" === a . status && ( t ( ) , n ( ) ) ;
} )
. then ( function ( t ) {
r = t ;
} )
. catch ( function ( n ) {
throw ( t ( ) , n ) ;
} ) ,
console . log ( "EMIT EVENT" ) ,
c$3 ( "tauri://update-install" ) . catch ( function ( n ) {
throw ( t ( ) , n ) ;
} ) ;
} ) ,
] ;
} ) ;
} ) ;
}
function u ( ) {
return r$3 ( this , void 0 , void 0 , function ( ) {
function t ( ) {
i && i ( ) , ( i = void 0 ) ;
}
var i ;
return o$6 ( this , function ( n ) {
return [
2 ,
new Promise ( function ( n , u ) {
s$3 ( "tauri://update-available" , function ( o ) {
var a ;
( a = null == o ? void 0 : o . payload ) ,
t ( ) ,
n ( { manifest : a , shouldUpdate : ! 0 } ) ;
} ) . catch ( function ( n ) {
throw ( t ( ) , n ) ;
} ) ,
o$3 ( "tauri://update-status" , function ( o ) {
var a ;
( a = null == o ? void 0 : o . payload ) . error
? ( t ( ) , u ( a . error ) )
: "UPTODATE" === a . status && ( t ( ) , n ( { shouldUpdate : ! 1 } ) ) ;
} )
. then ( function ( t ) {
i = t ;
} )
. catch ( function ( n ) {
throw ( t ( ) , n ) ;
} ) ,
c$3 ( "tauri://update" ) . catch ( function ( n ) {
throw ( t ( ) , n ) ;
} ) ;
} ) ,
] ;
} ) ;
} ) ;
}
Object . freeze ( { _ _proto _ _ : null , installUpdate : i , checkUpdate : u } ) ;
/* src/components/Updater.svelte generated by Svelte v3.35.0 */
const file$1 = "src/components/Updater.svelte" ;
function create _fragment$1 ( ctx ) {
let div ;
let button0 ;
let t1 ;
let button1 ;
let mounted ;
let dispose ;
const block = {
c : function create ( ) {
div = element ( "div" ) ;
button0 = element ( "button" ) ;
button0 . textContent = "Check update" ;
t1 = space ( ) ;
button1 = element ( "button" ) ;
button1 . textContent = "Install update" ;
attr _dev ( button0 , "class" , "button" ) ;
attr _dev ( button0 , "id" , "check_update" ) ;
add _location ( button0 , file$1 , 56 , 2 , 1362 ) ;
attr _dev ( button1 , "class" , "button hidden" ) ;
attr _dev ( button1 , "id" , "start_update" ) ;
add _location ( button1 , file$1 , 57 , 2 , 1444 ) ;
add _location ( div , file$1 , 55 , 0 , 1354 ) ;
} ,
l : function claim ( nodes ) {
throw new Error (
"options.hydrate only works if the component was compiled with the `hydratable: true` option"
) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , div , anchor ) ;
append _dev ( div , button0 ) ;
append _dev ( div , t1 ) ;
append _dev ( div , button1 ) ;
if ( ! mounted ) {
dispose = [
listen _dev ( button0 , "click" , /*check*/ ctx [ 0 ] , false , false , false ) ,
listen _dev (
button1 ,
"click" ,
/*install*/ ctx [ 1 ] ,
false ,
false ,
false
) ,
] ;
mounted = true ;
}
} ,
p : noop ,
i : noop ,
o : noop ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( div ) ;
mounted = false ;
run _all ( dispose ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _fragment$1 . name ,
type : "component" ,
source : "" ,
ctx ,
} ) ;
return block ;
}
function instance$1 ( $$self , $$props , $$invalidate ) {
let { $$slots : slots = { } , $$scope } = $$props ;
validate _slots ( "Updater" , slots , [ ] ) ;
let { onMessage } = $$props ;
let unlisten ;
onMount ( async ( ) => {
unlisten = await o$3 ( "tauri://update-status" , onMessage ) ;
} ) ;
onDestroy ( ( ) => {
if ( unlisten ) {
unlisten ( ) ;
}
} ) ;
async function check ( ) {
try {
document . getElementById ( "check_update" ) . classList . add ( "hidden" ) ;
const { shouldUpdate , manifest } = await u ( ) ;
onMessage ( ` Should update: ${ shouldUpdate } ` ) ;
onMessage ( manifest ) ;
if ( shouldUpdate ) {
document . getElementById ( "start_update" ) . classList . remove ( "hidden" ) ;
}
} catch ( e ) {
onMessage ( e ) ;
}
}
async function install ( ) {
try {
document . getElementById ( "start_update" ) . classList . add ( "hidden" ) ;
await i ( ) ;
onMessage ( "Installation complete, restart required." ) ;
await a$3 ( ) ;
} catch ( e ) {
onMessage ( e ) ;
}
}
const writable _props = [ "onMessage" ] ;
Object . keys ( $$props ) . forEach ( ( key ) => {
if ( ! ~ writable _props . indexOf ( key ) && key . slice ( 0 , 2 ) !== "$$" )
console . warn ( ` <Updater> was created with unknown prop ' ${ key } ' ` ) ;
} ) ;
$$self . $$set = ( $$props ) => {
if ( "onMessage" in $$props )
$$invalidate ( 2 , ( onMessage = $$props . onMessage ) ) ;
} ;
$$self . $capture _state = ( ) => ( {
onMount ,
onDestroy ,
checkUpdate : u ,
installUpdate : i ,
listen : o$3 ,
relaunch : a$3 ,
onMessage ,
unlisten ,
check ,
install ,
} ) ;
$$self . $inject _state = ( $$props ) => {
if ( "onMessage" in $$props )
$$invalidate ( 2 , ( onMessage = $$props . onMessage ) ) ;
if ( "unlisten" in $$props ) unlisten = $$props . unlisten ;
} ;
if ( $$props && "$$inject" in $$props ) {
$$self . $inject _state ( $$props . $$inject ) ;
}
return [ check , install , onMessage ] ;
}
class Updater extends SvelteComponentDev {
constructor ( options ) {
super ( options ) ;
init ( this , options , instance$1 , create _fragment$1 , safe _not _equal , {
onMessage : 2 ,
} ) ;
dispatch _dev ( "SvelteRegisterComponent" , {
component : this ,
tagName : "Updater" ,
options ,
id : create _fragment$1 . name ,
} ) ;
const { ctx } = this . $$ ;
const props = options . props || { } ;
if ( /*onMessage*/ ctx [ 2 ] === undefined && ! ( "onMessage" in props ) ) {
console . warn ( "<Updater> was created without expected prop 'onMessage'" ) ;
}
}
get onMessage ( ) {
throw new Error (
"<Updater>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
set onMessage ( value ) {
throw new Error (
"<Updater>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
) ;
}
}
/* src/App.svelte generated by Svelte v3.35.0 */
const file = "src/App.svelte" ;
function get _each _context ( ctx , list , i ) {
const child _ctx = ctx . slice ( ) ;
child _ctx [ 8 ] = list [ i ] ;
return child _ctx ;
}
// (99:6) {#each views as view}
function create _each _block ( ctx ) {
let p ;
let t0 _value = /*view*/ ctx [ 8 ] . label + "" ;
let t0 ;
let t1 ;
let p _class _value ;
let mounted ;
let dispose ;
function click _handler ( ) {
return /*click_handler*/ ctx [ 6 ] ( /*view*/ ctx [ 8 ] ) ;
}
const block = {
c : function create ( ) {
p = element ( "p" ) ;
t0 = text ( t0 _value ) ;
t1 = space ( ) ;
attr _dev (
p ,
"class" ,
( p _class _value =
"nv noselect " +
/*selected*/ ( ctx [ 0 ] === /*view*/ ctx [ 8 ] ? "nv_selected" : "" ) )
) ;
add _location ( p , file , 99 , 6 , 2408 ) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , p , anchor ) ;
append _dev ( p , t0 ) ;
append _dev ( p , t1 ) ;
if ( ! mounted ) {
dispose = listen _dev ( p , "click" , click _handler , false , false , false ) ;
mounted = true ;
}
} ,
p : function update ( new _ctx , dirty ) {
ctx = new _ctx ;
if (
dirty & /*selected*/ 1 &&
p _class _value !==
( p _class _value =
"nv noselect " +
/*selected*/ ( ctx [ 0 ] === /*view*/ ctx [ 8 ] ? "nv_selected" : "" ) )
) {
attr _dev ( p , "class" , p _class _value ) ;
}
} ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( p ) ;
mounted = false ;
dispose ( ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _each _block . name ,
type : "each" ,
source : "(99:6) {#each views as view}" ,
ctx ,
} ) ;
return block ;
}
function create _fragment ( ctx ) {
let main ;
let div1 ;
let img ;
let img _src _value ;
let t0 ;
let div0 ;
let a0 ;
let t2 ;
let a1 ;
let t4 ;
let a2 ;
let t6 ;
let div4 ;
let div2 ;
let t7 ;
let div3 ;
let switch _instance ;
let t8 ;
let div5 ;
let p ;
let strong ;
let t10 ;
let a3 ;
let t12 ;
let t13 ;
let current ;
let mounted ;
let dispose ;
let each _value = /*views*/ ctx [ 2 ] ;
validate _each _argument ( each _value ) ;
let each _blocks = [ ] ;
for ( let i = 0 ; i < each _value . length ; i += 1 ) {
each _blocks [ i ] = create _each _block ( get _each _context ( ctx , each _value , i ) ) ;
}
var switch _value = /*selected*/ ctx [ 0 ] . component ;
function switch _props ( ctx ) {
return {
props : { onMessage : /*onMessage*/ ctx [ 4 ] } ,
$$inline : true ,
} ;
}
if ( switch _value ) {
switch _instance = new switch _value ( switch _props ( ctx ) ) ;
}
const block = {
c : function create ( ) {
main = element ( "main" ) ;
div1 = element ( "div" ) ;
img = element ( "img" ) ;
t0 = space ( ) ;
div0 = element ( "div" ) ;
a0 = element ( "a" ) ;
a0 . textContent = "Documentation" ;
t2 = space ( ) ;
a1 = element ( "a" ) ;
a1 . textContent = "Github" ;
t4 = space ( ) ;
a2 = element ( "a" ) ;
a2 . textContent = "Source" ;
t6 = space ( ) ;
div4 = element ( "div" ) ;
div2 = element ( "div" ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . c ( ) ;
}
t7 = space ( ) ;
div3 = element ( "div" ) ;
if ( switch _instance ) create _component ( switch _instance . $$ . fragment ) ;
t8 = space ( ) ;
div5 = element ( "div" ) ;
p = element ( "p" ) ;
strong = element ( "strong" ) ;
strong . textContent = "Tauri Console" ;
t10 = space ( ) ;
a3 = element ( "a" ) ;
a3 . textContent = "clear" ;
t12 = space ( ) ;
t13 = text ( /*responses*/ ctx [ 1 ] ) ;
if ( img . src !== ( img _src _value = "tauri.png" ) )
attr _dev ( img , "src" , img _src _value ) ;
attr _dev ( img , "height" , "60" ) ;
attr _dev ( img , "alt" , "logo" ) ;
add _location ( img , file , 83 , 4 , 1812 ) ;
attr _dev ( a0 , "class" , "dark-link" ) ;
attr _dev ( a0 , "target" , "_blank" ) ;
attr _dev (
a0 ,
"href" ,
"https://tauri.studio/en/docs/getting-started/intro"
) ;
add _location ( a0 , file , 85 , 6 , 1898 ) ;
attr _dev ( a1 , "class" , "dark-link" ) ;
attr _dev ( a1 , "target" , "_blank" ) ;
attr _dev ( a1 , "href" , "https://github.com/tauri-apps/tauri" ) ;
add _location ( a1 , file , 88 , 6 , 2033 ) ;
attr _dev ( a2 , "class" , "dark-link" ) ;
attr _dev ( a2 , "target" , "_blank" ) ;
attr _dev (
a2 ,
"href" ,
"https://github.com/tauri-apps/tauri/tree/dev/tauri/examples/api"
) ;
add _location ( a2 , file , 91 , 6 , 2146 ) ;
add _location ( div0 , file , 84 , 4 , 1886 ) ;
attr _dev ( div1 , "class" , "flex row noselect just-around" ) ;
attr _dev ( div1 , "style" , "margin=1em;" ) ;
add _location ( div1 , file , 82 , 2 , 1744 ) ;
set _style ( div2 , "width" , "15em" ) ;
set _style ( div2 , "margin-left" , "0.5em" ) ;
add _location ( div2 , file , 97 , 4 , 2330 ) ;
attr _dev ( div3 , "class" , "content" ) ;
add _location ( div3 , file , 105 , 4 , 2572 ) ;
attr _dev ( div4 , "class" , "flex row" ) ;
add _location ( div4 , file , 96 , 2 , 2303 ) ;
add _location ( strong , file , 111 , 6 , 2774 ) ;
attr _dev ( a3 , "class" , "nv" ) ;
add _location ( a3 , file , 112 , 6 , 2811 ) ;
attr _dev ( p , "class" , "flex row just-around" ) ;
add _location ( p , file , 110 , 4 , 2735 ) ;
attr _dev ( div5 , "id" , "response" ) ;
set _style ( div5 , "white-space" , "pre-line" ) ;
add _location ( div5 , file , 109 , 2 , 2681 ) ;
add _location ( main , file , 81 , 0 , 1735 ) ;
} ,
l : function claim ( nodes ) {
throw new Error (
"options.hydrate only works if the component was compiled with the `hydratable: true` option"
) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , main , anchor ) ;
append _dev ( main , div1 ) ;
append _dev ( div1 , img ) ;
append _dev ( div1 , t0 ) ;
append _dev ( div1 , div0 ) ;
append _dev ( div0 , a0 ) ;
append _dev ( div0 , t2 ) ;
append _dev ( div0 , a1 ) ;
append _dev ( div0 , t4 ) ;
append _dev ( div0 , a2 ) ;
append _dev ( main , t6 ) ;
append _dev ( main , div4 ) ;
append _dev ( div4 , div2 ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . m ( div2 , null ) ;
}
append _dev ( div4 , t7 ) ;
append _dev ( div4 , div3 ) ;
if ( switch _instance ) {
mount _component ( switch _instance , div3 , null ) ;
}
append _dev ( main , t8 ) ;
append _dev ( main , div5 ) ;
append _dev ( div5 , p ) ;
append _dev ( p , strong ) ;
append _dev ( p , t10 ) ;
append _dev ( p , a3 ) ;
append _dev ( div5 , t12 ) ;
append _dev ( div5 , t13 ) ;
current = true ;
if ( ! mounted ) {
dispose = [
listen _dev (
img ,
"click" ,
/*onLogoClick*/ ctx [ 5 ] ,
false ,
false ,
false
) ,
listen _dev (
a3 ,
"click" ,
/*click_handler_1*/ ctx [ 7 ] ,
false ,
false ,
false
) ,
] ;
mounted = true ;
}
} ,
p : function update ( ctx , [ dirty ] ) {
if ( dirty & /*selected, views, select*/ 13 ) {
each _value = /*views*/ ctx [ 2 ] ;
validate _each _argument ( each _value ) ;
let i ;
for ( i = 0 ; i < each _value . length ; i += 1 ) {
const child _ctx = get _each _context ( ctx , each _value , i ) ;
if ( each _blocks [ i ] ) {
each _blocks [ i ] . p ( child _ctx , dirty ) ;
} else {
each _blocks [ i ] = create _each _block ( child _ctx ) ;
each _blocks [ i ] . c ( ) ;
each _blocks [ i ] . m ( div2 , null ) ;
}
}
for ( ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . d ( 1 ) ;
}
each _blocks . length = each _value . length ;
}
if ( switch _value !== ( switch _value = /*selected*/ ctx [ 0 ] . component ) ) {
if ( switch _instance ) {
group _outros ( ) ;
const old _component = switch _instance ;
transition _out ( old _component . $$ . fragment , 1 , 0 , ( ) => {
destroy _component ( old _component , 1 ) ;
} ) ;
check _outros ( ) ;
}
if ( switch _value ) {
switch _instance = new switch _value ( switch _props ( ctx ) ) ;
create _component ( switch _instance . $$ . fragment ) ;
transition _in ( switch _instance . $$ . fragment , 1 ) ;
mount _component ( switch _instance , div3 , null ) ;
} else {
switch _instance = null ;
}
}
if ( ! current || dirty & /*responses*/ 2 )
set _data _dev ( t13 , /*responses*/ ctx [ 1 ] ) ;
} ,
i : function intro ( local ) {
if ( current ) return ;
if ( switch _instance ) transition _in ( switch _instance . $$ . fragment , local ) ;
current = true ;
} ,
o : function outro ( local ) {
if ( switch _instance ) transition _out ( switch _instance . $$ . fragment , local ) ;
current = false ;
} ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( main ) ;
destroy _each ( each _blocks , detaching ) ;
if ( switch _instance ) destroy _component ( switch _instance ) ;
mounted = false ;
run _all ( dispose ) ;
} ,
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _fragment . name ,
type : "component" ,
source : "" ,
ctx ,
} ) ;
return block ;
}
function instance ( $$self , $$props , $$invalidate ) {
let { $$slots : slots = { } , $$scope } = $$props ;
validate _slots ( "App" , slots , [ ] ) ;
const views = [
{ label : "Welcome" , component : Welcome } ,
{
label : "Messages" ,
component : Communication ,
} ,
{ label : "CLI" , component : Cli } ,
{ label : "Dialog" , component : Dialog } ,
{
label : "File system" ,
component : FileSystem ,
} ,
{ label : "HTTP" , component : Http } ,
{
label : "Notifications" ,
component : Notifications ,
} ,
{ label : "Window" , component : Window } ,
{ label : "Shortcuts" , component : Shortcuts } ,
{ label : "Shell" , component : Shell } ,
{ label : "Updater" , component : Updater } ,
] ;
let selected = views [ 0 ] ;
let responses = [ "" ] ;
function select ( view ) {
$$invalidate ( 0 , ( selected = view ) ) ;
}
function onMessage ( value ) {
$$invalidate (
1 ,
( responses += typeof value === "string" ? value : JSON . stringify ( value ) )
) ;
$$invalidate ( 1 , ( responses += "\n" ) ) ;
}
function onLogoClick ( ) {
d$3 ( "https://tauri.studio/" ) ;
}
const writable _props = [ ] ;
Object . keys ( $$props ) . forEach ( ( key ) => {
if ( ! ~ writable _props . indexOf ( key ) && key . slice ( 0 , 2 ) !== "$$" )
console . warn ( ` <App> was created with unknown prop ' ${ key } ' ` ) ;
} ) ;
const click _handler = ( view ) => select ( view ) ;
const click _handler _1 = ( ) => {
$$invalidate ( 1 , ( responses = [ "" ] ) ) ;
} ;
$$self . $capture _state = ( ) => ( {
onMount ,
open : d$3 ,
Welcome ,
Cli ,
Communication ,
Dialog ,
FileSystem ,
Http ,
Notifications ,
Window ,
Shortcuts ,
Shell ,
Updater ,
views ,
selected ,
responses ,
select ,
onMessage ,
onLogoClick ,
} ) ;
$$self . $inject _state = ( $$props ) => {
if ( "selected" in $$props ) $$invalidate ( 0 , ( selected = $$props . selected ) ) ;
if ( "responses" in $$props )
$$invalidate ( 1 , ( responses = $$props . responses ) ) ;
} ;
if ( $$props && "$$inject" in $$props ) {
$$self . $inject _state ( $$props . $$inject ) ;
}
return [
selected ,
responses ,
views ,
select ,
onMessage ,
onLogoClick ,
click _handler ,
click _handler _1 ,
] ;
}
class App extends SvelteComponentDev {
constructor ( options ) {
super ( options ) ;
init ( this , options , instance , create _fragment , safe _not _equal , { } ) ;
dispatch _dev ( "SvelteRegisterComponent" , {
component : this ,
tagName : "App" ,
options ,
id : create _fragment . name ,
} ) ;
}
}
const app = new App ( {
target : document . body ,
} ) ;
return app ;
} ) ( ) ;
2021-03-13 04:10:19 +03:00
//# sourceMappingURL=bundle.js.map