2019-09-29 07:40:06 +02:00
function noop ( ) { }
function assign ( tar , src ) {
// @ts-ignore
for ( const k in src )
tar [ k ] = src [ k ] ;
return tar ;
}
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 create _slot ( definition , ctx , fn ) {
if ( definition ) {
const slot _ctx = get _slot _context ( definition , ctx , fn ) ;
return definition [ 0 ] ( slot _ctx ) ;
}
}
function get _slot _context ( definition , ctx , fn ) {
return definition [ 1 ]
? assign ( { } , assign ( ctx . $$scope . ctx , definition [ 1 ] ( fn ? fn ( ctx ) : { } ) ) )
: ctx . $$scope . ctx ;
}
function get _slot _changes ( definition , ctx , changed , fn ) {
return definition [ 1 ]
? assign ( { } , assign ( ctx . $$scope . changed || { } , definition [ 1 ] ( fn ? fn ( changed ) : { } ) ) )
: ctx . $$scope . changed || { } ;
}
function null _to _empty ( value ) {
return value == null ? '' : value ;
}
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 svg _element ( name ) {
return document . createElementNS ( 'http://www.w3.org/2000/svg' , name ) ;
}
function text ( data ) {
return document . createTextNode ( data ) ;
}
function space ( ) {
return text ( ' ' ) ;
}
function empty ( ) {
return text ( '' ) ;
}
function listen ( node , event , handler , options ) {
node . addEventListener ( event , handler , options ) ;
return ( ) => node . removeEventListener ( event , handler , options ) ;
}
function attr ( node , attribute , value ) {
if ( value == null )
node . removeAttribute ( attribute ) ;
else
node . setAttribute ( attribute , value ) ;
}
function children ( element ) {
return Array . from ( element . childNodes ) ;
}
function claim _element ( nodes , name , attributes , svg ) {
for ( let i = 0 ; i < nodes . length ; i += 1 ) {
const node = nodes [ i ] ;
if ( node . nodeName === name ) {
for ( let j = 0 ; j < node . attributes . length ; j += 1 ) {
const attribute = node . attributes [ j ] ;
if ( ! attributes [ attribute . name ] )
node . removeAttribute ( attribute . name ) ;
}
return nodes . splice ( i , 1 ) [ 0 ] ; // TODO strip unwanted attributes
}
}
return svg ? svg _element ( name ) : element ( name ) ;
}
function claim _text ( nodes , data ) {
for ( let i = 0 ; i < nodes . length ; i += 1 ) {
const node = nodes [ i ] ;
if ( node . nodeType === 3 ) {
node . data = '' + data ;
return nodes . splice ( i , 1 ) [ 0 ] ;
}
}
return text ( data ) ;
}
function claim _space ( nodes ) {
return claim _text ( nodes , ' ' ) ;
}
function set _data ( text , data ) {
data = '' + data ;
if ( text . data !== data )
text . data = data ;
}
function set _input _value ( input , value ) {
if ( value != null || input . value ) {
input . value = value ;
}
}
function set _style ( node , key , value , important ) {
node . style . setProperty ( key , value , important ? 'important' : '' ) ;
}
2019-09-30 06:21:08 +02:00
function toggle _class ( element , name , toggle ) {
element . classList [ toggle ? 'add' : 'remove' ] ( name ) ;
}
2019-09-29 07:40:06 +02:00
let current _component ;
function set _current _component ( component ) {
current _component = component ;
}
// TODO figure out if we still want to support
// shorthand events, or if we want to implement
// a real bubbling mechanism
function bubble ( component , event ) {
const callbacks = component . $$ . callbacks [ event . type ] ;
if ( callbacks ) {
callbacks . slice ( ) . forEach ( fn => fn ( event ) ) ;
}
}
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 ) ;
}
function flush ( ) {
const seen _callbacks = new Set ( ) ;
do {
// first, call beforeUpdate functions
// and update components
while ( dirty _components . length ) {
const component = dirty _components . shift ( ) ;
set _current _component ( component ) ;
update ( component . $$ ) ;
}
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 ) ) {
callback ( ) ;
// ...so guard against infinite loops
seen _callbacks . add ( callback ) ;
}
}
render _callbacks . length = 0 ;
} while ( dirty _components . length ) ;
while ( flush _callbacks . length ) {
flush _callbacks . pop ( ) ( ) ;
}
update _scheduled = false ;
}
function update ( $$ ) {
if ( $$ . fragment ) {
$$ . update ( $$ . dirty ) ;
run _all ( $$ . before _update ) ;
$$ . fragment . p ( $$ . dirty , $$ . ctx ) ;
$$ . dirty = null ;
$$ . 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 ) ;
}
}
2019-10-03 07:12:13 +02:00
const globals = ( typeof window !== 'undefined' ? window : global ) ;
2019-09-29 07:40:06 +02:00
function mount _component ( component , target , anchor ) {
const { fragment , on _mount , on _destroy , after _update } = component . $$ ;
fragment . m ( target , anchor ) ;
// 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 ) {
if ( component . $$ . fragment ) {
run _all ( component . $$ . on _destroy ) ;
component . $$ . fragment . d ( detaching ) ;
// TODO null out other refs, including component.$$ (but need to
// preserve final state?)
component . $$ . on _destroy = component . $$ . fragment = null ;
component . $$ . ctx = { } ;
}
}
function make _dirty ( component , key ) {
if ( ! component . $$ . dirty ) {
dirty _components . push ( component ) ;
schedule _update ( ) ;
component . $$ . dirty = blank _object ( ) ;
}
component . $$ . dirty [ key ] = true ;
}
function init ( component , options , instance , create _fragment , not _equal , prop _names ) {
const parent _component = current _component ;
set _current _component ( component ) ;
const props = options . props || { } ;
const $$ = component . $$ = {
fragment : null ,
ctx : null ,
// state
props : prop _names ,
update : noop ,
not _equal ,
bound : blank _object ( ) ,
// lifecycle
on _mount : [ ] ,
on _destroy : [ ] ,
before _update : [ ] ,
after _update : [ ] ,
context : new Map ( parent _component ? parent _component . $$ . context : [ ] ) ,
// everything else
callbacks : blank _object ( ) ,
dirty : null
} ;
let ready = false ;
$$ . ctx = instance
? instance ( component , props , ( key , ret , value = ret ) => {
if ( $$ . ctx && not _equal ( $$ . ctx [ key ] , $$ . ctx [ key ] = value ) ) {
if ( $$ . bound [ key ] )
$$ . bound [ key ] ( value ) ;
if ( ready )
make _dirty ( component , key ) ;
}
return ret ;
} )
: props ;
$$ . update ( ) ;
ready = true ;
run _all ( $$ . before _update ) ;
$$ . fragment = create _fragment ( $$ . ctx ) ;
if ( options . target ) {
if ( options . hydrate ) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$ . fragment . l ( children ( options . target ) ) ;
}
else {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$ . fragment . c ( ) ;
}
if ( options . intro )
transition _in ( component . $$ . fragment ) ;
mount _component ( component , options . target , options . anchor ) ;
flush ( ) ;
}
set _current _component ( parent _component ) ;
}
let SvelteElement ;
if ( typeof HTMLElement !== 'undefined' ) {
SvelteElement = class extends HTMLElement {
constructor ( ) {
super ( ) ;
this . attachShadow ( { mode : 'open' } ) ;
}
connectedCallback ( ) {
// @ts-ignore todo: improve typings
for ( const key in this . $$ . slotted ) {
// @ts-ignore todo: improve typings
this . appendChild ( this . $$ . slotted [ key ] ) ;
}
}
attributeChangedCallback ( attr , _oldValue , newValue ) {
this [ attr ] = newValue ;
}
$destroy ( ) {
destroy _component ( this , 1 ) ;
this . $destroy = noop ;
}
$on ( type , callback ) {
// TODO should this delegate to addEventListener?
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 ( ) {
// overridden by instance, if it has props
}
} ;
}
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 ( ) {
// overridden by instance, if it has props
}
}
/* src\Button.svelte generated by Svelte v3.12.1 */
function add _css ( ) {
var style = element ( "style" ) ;
style . id = 'svelte-1q8lga0-style' ;
style . textContent = ".default.svelte-1q8lga0{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;color:#333;background-color:#f4f4f4;outline:none}.default.svelte-1q8lga0:active{background-color:#ddd}.default.svelte-1q8lga0:focus{border-color:#666}" ;
append ( document . head , style ) ;
}
// (30:4) {:else}
function create _else _block ( ctx ) {
var current ;
const default _slot _template = ctx . $$slots . default ;
const default _slot = create _slot ( default _slot _template , ctx , null ) ;
return {
c ( ) {
if ( default _slot ) default _slot . c ( ) ;
} ,
l ( nodes ) {
if ( default _slot ) default _slot . l ( nodes ) ;
} ,
m ( target , anchor ) {
if ( default _slot ) {
default _slot . m ( target , anchor ) ;
}
current = true ;
} ,
p ( changed , ctx ) {
if ( default _slot && default _slot . p && changed . $$scope ) {
default _slot . p (
get _slot _changes ( default _slot _template , ctx , changed , null ) ,
get _slot _context ( default _slot _template , ctx , null )
) ;
}
} ,
i ( local ) {
if ( current ) return ;
transition _in ( default _slot , local ) ;
current = true ;
} ,
o ( local ) {
transition _out ( default _slot , local ) ;
current = false ;
} ,
d ( detaching ) {
if ( default _slot ) default _slot . d ( detaching ) ;
}
} ;
}
// (28:26)
function create _if _block _1 ( ctx ) {
var t ;
return {
c ( ) {
t = text ( ctx . contentText ) ;
} ,
l ( nodes ) {
t = claim _text ( nodes , ctx . contentText ) ;
} ,
m ( target , anchor ) {
insert ( target , t , anchor ) ;
} ,
p ( changed , ctx ) {
if ( changed . contentText ) {
set _data ( t , ctx . contentText ) ;
}
} ,
i : noop ,
o : noop ,
d ( detaching ) {
if ( detaching ) {
detach ( t ) ;
}
}
} ;
}
// (25:4) {#if contentComponent && contentComponent._component}
function create _if _block ( ctx ) {
var div ;
return {
c ( ) {
div = element ( "div" ) ;
} ,
l ( nodes ) {
div = claim _element ( nodes , "DIV" , { } , false ) ;
var div _nodes = children ( div ) ;
div _nodes . forEach ( detach ) ;
} ,
m ( target , anchor ) {
insert ( target , div , anchor ) ;
ctx . div _binding ( div ) ;
} ,
p : noop ,
i : noop ,
o : noop ,
d ( detaching ) {
if ( detaching ) {
detach ( div ) ;
}
ctx . div _binding ( null ) ;
}
} ;
}
function create _fragment ( ctx ) {
var button , current _block _type _index , if _block , button _class _value , current , dispose ;
var if _block _creators = [
create _if _block ,
create _if _block _1 ,
create _else _block
] ;
var if _blocks = [ ] ;
function select _block _type ( changed , ctx ) {
if ( ctx . contentComponent && ctx . contentComponent . _component ) return 0 ;
if ( ctx . contentText ) return 1 ;
return 2 ;
}
current _block _type _index = select _block _type ( null , ctx ) ;
if _block = if _blocks [ current _block _type _index ] = if _block _creators [ current _block _type _index ] ( ctx ) ;
return {
c ( ) {
button = element ( "button" ) ;
if _block . c ( ) ;
this . h ( ) ;
} ,
l ( nodes ) {
button = claim _element ( nodes , "BUTTON" , { class : true , disabled : true } , false ) ;
var button _nodes = children ( button ) ;
if _block . l ( button _nodes ) ;
button _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
attr ( button , "class" , button _class _value = "" + null _to _empty ( ctx . className ) + " svelte-1q8lga0" ) ;
button . disabled = ctx . disabled ;
dispose = listen ( button , "click" , ctx . clickHandler ) ;
} ,
m ( target , anchor ) {
insert ( target , button , anchor ) ;
if _blocks [ current _block _type _index ] . m ( button , null ) ;
current = true ;
} ,
p ( changed , ctx ) {
var previous _block _index = current _block _type _index ;
current _block _type _index = select _block _type ( changed , ctx ) ;
if ( current _block _type _index === previous _block _index ) {
if _blocks [ current _block _type _index ] . p ( changed , ctx ) ;
} else {
group _outros ( ) ;
transition _out ( if _blocks [ previous _block _index ] , 1 , 1 , ( ) => {
if _blocks [ previous _block _index ] = null ;
} ) ;
check _outros ( ) ;
if _block = if _blocks [ current _block _type _index ] ;
if ( ! if _block ) {
if _block = if _blocks [ current _block _type _index ] = if _block _creators [ current _block _type _index ] ( ctx ) ;
if _block . c ( ) ;
}
transition _in ( if _block , 1 ) ;
if _block . m ( button , null ) ;
}
if ( ( ! current || changed . className ) && button _class _value !== ( button _class _value = "" + null _to _empty ( ctx . className ) + " svelte-1q8lga0" ) ) {
attr ( button , "class" , button _class _value ) ;
}
if ( ! current || changed . disabled ) {
button . disabled = ctx . disabled ;
}
} ,
i ( local ) {
if ( current ) return ;
transition _in ( if _block ) ;
current = true ;
} ,
o ( local ) {
transition _out ( if _block ) ;
current = false ;
} ,
d ( detaching ) {
if ( detaching ) {
detach ( button ) ;
}
if _blocks [ current _block _type _index ] . d ( ) ;
dispose ( ) ;
}
} ;
}
function instance ( $$self , $$props , $$invalidate ) {
let { className = "default" , disabled = false , contentText , contentComponent , onClick = ( ) => { } } = $$props ;
let { _bb } = $$props ;
let contentComponentContainer ;
const clickHandler = ( ) => {
if ( onClick ) onClick ( ) ;
} ;
let { $$slots = { } , $$scope } = $$props ;
function div _binding ( $$value ) {
binding _callbacks [ $$value ? 'unshift' : 'push' ] ( ( ) => {
$$invalidate ( 'contentComponentContainer' , contentComponentContainer = $$value ) ;
} ) ;
}
$$self . $set = $$props => {
if ( 'className' in $$props ) $$invalidate ( 'className' , className = $$props . className ) ;
if ( 'disabled' in $$props ) $$invalidate ( 'disabled' , disabled = $$props . disabled ) ;
if ( 'contentText' in $$props ) $$invalidate ( 'contentText' , contentText = $$props . contentText ) ;
if ( 'contentComponent' in $$props ) $$invalidate ( 'contentComponent' , contentComponent = $$props . contentComponent ) ;
if ( 'onClick' in $$props ) $$invalidate ( 'onClick' , onClick = $$props . onClick ) ;
if ( '_bb' in $$props ) $$invalidate ( '_bb' , _bb = $$props . _bb ) ;
if ( '$$scope' in $$props ) $$invalidate ( '$$scope' , $$scope = $$props . $$scope ) ;
} ;
$$self . $$ . update = ( $$dirty = { _bb : 1 , contentComponentContainer : 1 , contentComponent : 1 } ) => {
if ( $$dirty . _bb || $$dirty . contentComponentContainer || $$dirty . contentComponent ) { {
if ( _bb && contentComponentContainer && contentComponent . _component )
_bb . initialiseComponent ( contentComponent , contentComponentContainer ) ;
} }
} ;
return {
className ,
disabled ,
contentText ,
contentComponent ,
onClick ,
_bb ,
contentComponentContainer ,
clickHandler ,
div _binding ,
$$slots ,
$$scope
} ;
}
class Button extends SvelteComponent {
constructor ( options ) {
super ( ) ;
if ( ! document . getElementById ( "svelte-1q8lga0-style" ) ) add _css ( ) ;
init ( this , options , instance , create _fragment , safe _not _equal , [ "className" , "disabled" , "contentText" , "contentComponent" , "onClick" , "_bb" ] ) ;
}
}
/* src\Textbox.svelte generated by Svelte v3.12.1 */
function add _css$1 ( ) {
var style = element ( "style" ) ;
style . id = 'svelte-1ec4wqj-style' ;
style . textContent = ".default.svelte-1ec4wqj{width:100%;font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;width:100%}.default.svelte-1ec4wqj:disabled{color:#ccc}" ;
append ( document . head , style ) ;
}
// (32:0) {:else}
function create _else _block$1 ( ctx ) {
var input , input _class _value ;
return {
c ( ) {
input = element ( "input" ) ;
this . h ( ) ;
} ,
l ( nodes ) {
input = claim _element ( nodes , "INPUT" , { class : true , type : true , value : true } , false ) ;
var input _nodes = children ( input ) ;
input _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
attr ( input , "class" , input _class _value = "" + null _to _empty ( ctx . className ) + " svelte-1ec4wqj" ) ;
attr ( input , "type" , "text" ) ;
input . value = ctx . actualValue ;
} ,
m ( target , anchor ) {
insert ( target , input , anchor ) ;
} ,
p ( changed , ctx ) {
if ( ( changed . className ) && input _class _value !== ( input _class _value = "" + null _to _empty ( ctx . className ) + " svelte-1ec4wqj" ) ) {
attr ( input , "class" , input _class _value ) ;
}
if ( changed . actualValue ) {
input . value = ctx . actualValue ;
}
} ,
d ( detaching ) {
if ( detaching ) {
detach ( input ) ;
}
}
} ;
}
// (28:0) {#if hideValue}
function create _if _block$1 ( ctx ) {
var input , input _class _value , dispose ;
return {
c ( ) {
input = element ( "input" ) ;
this . h ( ) ;
} ,
l ( nodes ) {
input = claim _element ( nodes , "INPUT" , { class : true , type : true , value : true } , false ) ;
var input _nodes = children ( input ) ;
input _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
attr ( input , "class" , input _class _value = "" + null _to _empty ( ctx . className ) + " svelte-1ec4wqj" ) ;
attr ( input , "type" , "password" ) ;
input . value = ctx . actualValue ;
dispose = listen ( input , "change" , ctx . change _handler ) ;
} ,
m ( target , anchor ) {
insert ( target , input , anchor ) ;
} ,
p ( changed , ctx ) {
if ( ( changed . className ) && input _class _value !== ( input _class _value = "" + null _to _empty ( ctx . className ) + " svelte-1ec4wqj" ) ) {
attr ( input , "class" , input _class _value ) ;
}
if ( changed . actualValue ) {
input . value = ctx . actualValue ;
}
} ,
d ( detaching ) {
if ( detaching ) {
detach ( input ) ;
}
dispose ( ) ;
}
} ;
}
function create _fragment$1 ( ctx ) {
var if _block _anchor ;
function select _block _type ( changed , ctx ) {
if ( ctx . hideValue ) return create _if _block$1 ;
return create _else _block$1 ;
}
var current _block _type = select _block _type ( null , ctx ) ;
var if _block = current _block _type ( ctx ) ;
return {
c ( ) {
if _block . c ( ) ;
if _block _anchor = empty ( ) ;
} ,
l ( nodes ) {
if _block . l ( nodes ) ;
if _block _anchor = empty ( ) ;
} ,
m ( target , anchor ) {
if _block . m ( target , anchor ) ;
insert ( target , if _block _anchor , anchor ) ;
} ,
p ( changed , ctx ) {
if ( current _block _type === ( current _block _type = select _block _type ( changed , ctx ) ) && if _block ) {
if _block . p ( changed , ctx ) ;
} else {
if _block . d ( 1 ) ;
if _block = current _block _type ( ctx ) ;
if ( if _block ) {
if _block . c ( ) ;
if _block . m ( if _block _anchor . parentNode , if _block _anchor ) ;
}
}
} ,
i : noop ,
o : noop ,
d ( detaching ) {
if _block . d ( detaching ) ;
if ( detaching ) {
detach ( if _block _anchor ) ;
}
}
} ;
}
function instance$1 ( $$self , $$props , $$invalidate ) {
let { value = "" , hideValue = false , className = "default" , _bb } = $$props ;
let actualValue = "" ;
function change _handler ( event ) {
bubble ( $$self , event ) ;
}
$$self . $set = $$props => {
if ( 'value' in $$props ) $$invalidate ( 'value' , value = $$props . value ) ;
if ( 'hideValue' in $$props ) $$invalidate ( 'hideValue' , hideValue = $$props . hideValue ) ;
if ( 'className' in $$props ) $$invalidate ( 'className' , className = $$props . className ) ;
if ( '_bb' in $$props ) $$invalidate ( '_bb' , _bb = $$props . _bb ) ;
} ;
$$self . $$ . update = ( $$dirty = { _bb : 1 , value : 1 } ) => {
if ( $$dirty . _bb || $$dirty . value ) { {
if ( _bb && value . _isstate ) {
_bb . store . subscribe ( s => {
$$invalidate ( 'actualValue' , actualValue = _bb . store . getValue ( s , value ) ) ;
} ) ;
}
} }
} ;
return {
value ,
hideValue ,
className ,
_bb ,
actualValue ,
change _handler
} ;
}
class Textbox extends SvelteComponent {
constructor ( options ) {
super ( ) ;
if ( ! document . getElementById ( "svelte-1ec4wqj-style" ) ) add _css$1 ( ) ;
init ( this , options , instance$1 , create _fragment$1 , safe _not _equal , [ "value" , "hideValue" , "className" , "_bb" ] ) ;
}
}
/* src\Form.svelte generated by Svelte v3.12.1 */
function add _css$2 ( ) {
var style = element ( "style" ) ;
style . id = 'svelte-m9d6ue-style' ;
style . textContent = ".form-root.svelte-m9d6ue{display:grid;grid-template-columns:[label] auto [control] 1fr}.label.svelte-m9d6ue{grid-column-start:label;padding:5px 10px;vertical-align:middle}.control.svelte-m9d6ue{grid-column-start:control;padding:5px 10px}.overflow.svelte-m9d6ue{grid-column-start:overflow}.full-width.svelte-m9d6ue{width:100%}" ;
append ( document . head , style ) ;
}
function get _each _context ( ctx , list , i ) {
const child _ctx = Object . create ( ctx ) ;
child _ctx . child = list [ i ] ;
child _ctx . index = i ;
return child _ctx ;
}
// (30:4) {#each formControls as child, index}
function create _each _block ( ctx ) {
var div0 , t0 _value = ctx . labels [ ctx . index ] + "" , t0 , t1 , div1 , index = ctx . index ;
const assign _div1 = ( ) => ctx . div1 _binding ( div1 , index ) ;
const unassign _div1 = ( ) => ctx . div1 _binding ( null , index ) ;
return {
c ( ) {
div0 = element ( "div" ) ;
t0 = text ( t0 _value ) ;
t1 = space ( ) ;
div1 = element ( "div" ) ;
this . h ( ) ;
} ,
l ( nodes ) {
div0 = claim _element ( nodes , "DIV" , { class : true } , false ) ;
var div0 _nodes = children ( div0 ) ;
t0 = claim _text ( div0 _nodes , t0 _value ) ;
div0 _nodes . forEach ( detach ) ;
t1 = claim _space ( nodes ) ;
div1 = claim _element ( nodes , "DIV" , { class : true } , false ) ;
var div1 _nodes = children ( div1 ) ;
div1 _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
attr ( div0 , "class" , "label svelte-m9d6ue" ) ;
attr ( div1 , "class" , "control svelte-m9d6ue" ) ;
} ,
m ( target , anchor ) {
insert ( target , div0 , anchor ) ;
append ( div0 , t0 ) ;
insert ( target , t1 , anchor ) ;
insert ( target , div1 , anchor ) ;
assign _div1 ( ) ;
} ,
p ( changed , new _ctx ) {
ctx = new _ctx ;
if ( ( changed . labels ) && t0 _value !== ( t0 _value = ctx . labels [ ctx . index ] + "" ) ) {
set _data ( t0 , t0 _value ) ;
}
if ( index !== ctx . index ) {
unassign _div1 ( ) ;
index = ctx . index ;
assign _div1 ( ) ;
}
} ,
d ( detaching ) {
if ( detaching ) {
detach ( div0 ) ;
detach ( t1 ) ;
detach ( div1 ) ;
}
unassign _div1 ( ) ;
}
} ;
}
function create _fragment$2 ( ctx ) {
var div , div _class _value ;
let each _value = ctx . formControls ;
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 ) ) ;
}
return {
c ( ) {
div = element ( "div" ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . c ( ) ;
}
this . h ( ) ;
} ,
l ( nodes ) {
div = claim _element ( nodes , "DIV" , { class : true } , false ) ;
var div _nodes = children ( div ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . l ( div _nodes ) ;
}
div _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
attr ( div , "class" , div _class _value = "form-root " + ctx . containerClass + " svelte-m9d6ue" ) ;
} ,
m ( target , anchor ) {
insert ( target , div , anchor ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . m ( div , null ) ;
}
} ,
p ( changed , ctx ) {
if ( changed . htmlElements || changed . labels || changed . formControls ) {
each _value = ctx . formControls ;
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 ( changed , child _ctx ) ;
} else {
each _blocks [ i ] = create _each _block ( child _ctx ) ;
each _blocks [ i ] . c ( ) ;
each _blocks [ i ] . m ( div , null ) ;
}
}
for ( ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . d ( 1 ) ;
}
each _blocks . length = each _value . length ;
}
if ( ( changed . containerClass ) && div _class _value !== ( div _class _value = "form-root " + ctx . containerClass + " svelte-m9d6ue" ) ) {
attr ( div , "class" , div _class _value ) ;
}
} ,
i : noop ,
o : noop ,
d ( detaching ) {
if ( detaching ) {
detach ( div ) ;
}
destroy _each ( each _blocks , detaching ) ;
}
} ;
}
function instance$2 ( $$self , $$props , $$invalidate ) {
let { containerClass = "" , formControls = [ ] , _bb } = $$props ;
let htmlElements = { } ;
let labels = { } ;
function div1 _binding ( $$value , index ) {
if ( htmlElements [ index ] === $$value ) return ;
binding _callbacks [ $$value ? 'unshift' : 'push' ] ( ( ) => {
htmlElements [ index ] = $$value ;
$$invalidate ( 'htmlElements' , htmlElements ) ;
} ) ;
}
$$self . $set = $$props => {
if ( 'containerClass' in $$props ) $$invalidate ( 'containerClass' , containerClass = $$props . containerClass ) ;
if ( 'formControls' in $$props ) $$invalidate ( 'formControls' , formControls = $$props . formControls ) ;
if ( '_bb' in $$props ) $$invalidate ( '_bb' , _bb = $$props . _bb ) ;
} ;
$$self . $$ . update = ( $$dirty = { formControls : 1 , _bb : 1 , htmlElements : 1 } ) => {
if ( $$dirty . formControls || $$dirty . _bb || $$dirty . htmlElements ) { {
let cIndex = 0 ;
for ( let c of formControls ) {
$$invalidate ( 'labels' , labels [ cIndex ] = c . label , labels ) ;
cIndex ++ ;
}
if ( _bb && htmlElements ) {
for ( let el in htmlElements ) {
_bb . initialiseComponent (
formControls [ el ] . control ,
htmlElements [ el ]
) ;
}
}
} }
} ;
return {
containerClass ,
formControls ,
_bb ,
htmlElements ,
labels ,
div1 _binding
} ;
}
class Form extends SvelteComponent {
constructor ( options ) {
super ( ) ;
if ( ! document . getElementById ( "svelte-m9d6ue-style" ) ) add _css$2 ( ) ;
init ( this , options , instance$2 , create _fragment$2 , safe _not _equal , [ "containerClass" , "formControls" , "_bb" ] ) ;
}
}
/* src\Login.svelte generated by Svelte v3.12.1 */
function add _css$3 ( ) {
var style = element ( "style" ) ;
style . id = 'svelte-crnq0a-style' ;
style . textContent = ".root.svelte-crnq0a{height:100%;display:grid;grid-template-columns:[left] 1fr [middle] auto [right] 1fr;grid-template-rows:[top] 1fr [center] auto [bottom] 1fr}.content.svelte-crnq0a{grid-column-start:middle;grid-row-start:center;width:400px}.logo-container.svelte-crnq0a{margin-bottom:20px\n}.logo-container.svelte-crnq0a>img.svelte-crnq0a{max-width:100%}.login-button-container.svelte-crnq0a{text-align:right;margin-top:20px}.incorrect-details-panel.svelte-crnq0a{margin-top:30px;padding:10px;border-style:solid;border-width:1px;border-color:maroon;border-radius:1px;text-align:center;color:maroon;background-color:mistyrose}.form-root.svelte-crnq0a{display:grid;grid-template-columns:[label] auto [control] 1fr}.label.svelte-crnq0a{grid-column-start:label;padding:5px 10px;vertical-align:middle}.control.svelte-crnq0a{grid-column-start:control;padding:5px 10px}.default-input.svelte-crnq0a{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;width:100%}.default-button.svelte-crnq0a{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;color:#333;background-color:#f4f4f4;outline:none}.default-button.svelte-crnq0a:active{background-color:#ddd}.default-button.svelte-crnq0a:focus{border-color:#666}" ;
append ( document . head , style ) ;
}
// (57:8) {#if _logo}
function create _if _block _1$1 ( ctx ) {
var div , img ;
return {
c ( ) {
div = element ( "div" ) ;
img = element ( "img" ) ;
this . h ( ) ;
} ,
l ( nodes ) {
div = claim _element ( nodes , "DIV" , { class : true } , false ) ;
var div _nodes = children ( div ) ;
img = claim _element ( div _nodes , "IMG" , { src : true , alt : true , class : true } , false ) ;
var img _nodes = children ( img ) ;
img _nodes . forEach ( detach ) ;
div _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
attr ( img , "src" , ctx . _logo ) ;
attr ( img , "alt" , "logo" ) ;
attr ( img , "class" , "svelte-crnq0a" ) ;
attr ( div , "class" , "logo-container svelte-crnq0a" ) ;
} ,
m ( target , anchor ) {
insert ( target , div , anchor ) ;
append ( div , img ) ;
} ,
p ( changed , ctx ) {
if ( changed . _logo ) {
attr ( img , "src" , ctx . _logo ) ;
}
} ,
d ( detaching ) {
if ( detaching ) {
detach ( div ) ;
}
}
} ;
}
// (86:8) {#if incorrect}
function create _if _block$2 ( ctx ) {
var div , t ;
return {
c ( ) {
div = element ( "div" ) ;
t = text ( "Incorrect username or password" ) ;
this . h ( ) ;
} ,
l ( nodes ) {
div = claim _element ( nodes , "DIV" , { class : true } , false ) ;
var div _nodes = children ( div ) ;
t = claim _text ( div _nodes , "Incorrect username or password" ) ;
div _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
attr ( div , "class" , "incorrect-details-panel svelte-crnq0a" ) ;
} ,
m ( target , anchor ) {
insert ( target , div , anchor ) ;
append ( div , t ) ;
} ,
d ( detaching ) {
if ( detaching ) {
detach ( div ) ;
}
}
} ;
}
function create _fragment$3 ( ctx ) {
var div7 , div6 , t0 , div4 , div0 , t1 , t2 , div1 , input0 , input0 _class _value , t3 , div2 , t4 , t5 , div3 , input1 , input1 _class _value , t6 , div5 , button , t7 , button _class _value , t8 , dispose ;
var if _block0 = ( ctx . _logo ) && create _if _block _1$1 ( ctx ) ;
var if _block1 = ( ctx . incorrect ) && create _if _block$2 ( ) ;
return {
c ( ) {
div7 = element ( "div" ) ;
div6 = element ( "div" ) ;
if ( if _block0 ) if _block0 . c ( ) ;
t0 = space ( ) ;
div4 = element ( "div" ) ;
div0 = element ( "div" ) ;
t1 = text ( ctx . usernameLabel ) ;
t2 = space ( ) ;
div1 = element ( "div" ) ;
input0 = element ( "input" ) ;
t3 = space ( ) ;
div2 = element ( "div" ) ;
t4 = text ( ctx . passwordLabel ) ;
t5 = space ( ) ;
div3 = element ( "div" ) ;
input1 = element ( "input" ) ;
t6 = space ( ) ;
div5 = element ( "div" ) ;
button = element ( "button" ) ;
t7 = text ( ctx . loginButtonLabel ) ;
t8 = space ( ) ;
if ( if _block1 ) if _block1 . c ( ) ;
this . h ( ) ;
} ,
l ( nodes ) {
div7 = claim _element ( nodes , "DIV" , { class : true } , false ) ;
var div7 _nodes = children ( div7 ) ;
div6 = claim _element ( div7 _nodes , "DIV" , { class : true } , false ) ;
var div6 _nodes = children ( div6 ) ;
if ( if _block0 ) if _block0 . l ( div6 _nodes ) ;
t0 = claim _space ( div6 _nodes ) ;
div4 = claim _element ( div6 _nodes , "DIV" , { class : true } , false ) ;
var div4 _nodes = children ( div4 ) ;
div0 = claim _element ( div4 _nodes , "DIV" , { class : true } , false ) ;
var div0 _nodes = children ( div0 ) ;
t1 = claim _text ( div0 _nodes , ctx . usernameLabel ) ;
div0 _nodes . forEach ( detach ) ;
t2 = claim _space ( div4 _nodes ) ;
div1 = claim _element ( div4 _nodes , "DIV" , { class : true } , false ) ;
var div1 _nodes = children ( div1 ) ;
input0 = claim _element ( div1 _nodes , "INPUT" , { type : true , class : true } , false ) ;
var input0 _nodes = children ( input0 ) ;
input0 _nodes . forEach ( detach ) ;
div1 _nodes . forEach ( detach ) ;
t3 = claim _space ( div4 _nodes ) ;
div2 = claim _element ( div4 _nodes , "DIV" , { class : true } , false ) ;
var div2 _nodes = children ( div2 ) ;
t4 = claim _text ( div2 _nodes , ctx . passwordLabel ) ;
div2 _nodes . forEach ( detach ) ;
t5 = claim _space ( div4 _nodes ) ;
div3 = claim _element ( div4 _nodes , "DIV" , { class : true } , false ) ;
var div3 _nodes = children ( div3 ) ;
input1 = claim _element ( div3 _nodes , "INPUT" , { type : true , class : true } , false ) ;
var input1 _nodes = children ( input1 ) ;
input1 _nodes . forEach ( detach ) ;
div3 _nodes . forEach ( detach ) ;
div4 _nodes . forEach ( detach ) ;
t6 = claim _space ( div6 _nodes ) ;
div5 = claim _element ( div6 _nodes , "DIV" , { class : true } , false ) ;
var div5 _nodes = children ( div5 ) ;
button = claim _element ( div5 _nodes , "BUTTON" , { disabled : true , class : true } , false ) ;
var button _nodes = children ( button ) ;
t7 = claim _text ( button _nodes , ctx . loginButtonLabel ) ;
button _nodes . forEach ( detach ) ;
div5 _nodes . forEach ( detach ) ;
t8 = claim _space ( div6 _nodes ) ;
if ( if _block1 ) if _block1 . l ( div6 _nodes ) ;
div6 _nodes . forEach ( detach ) ;
div7 _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
attr ( div0 , "class" , "label svelte-crnq0a" ) ;
attr ( input0 , "type" , "text" ) ;
attr ( input0 , "class" , input0 _class _value = "" + null _to _empty ( ctx . _inputClass ) + " svelte-crnq0a" ) ;
attr ( div1 , "class" , "control svelte-crnq0a" ) ;
attr ( div2 , "class" , "label svelte-crnq0a" ) ;
attr ( input1 , "type" , "password" ) ;
attr ( input1 , "class" , input1 _class _value = "" + null _to _empty ( ctx . _inputClass ) + " svelte-crnq0a" ) ;
attr ( div3 , "class" , "control svelte-crnq0a" ) ;
attr ( div4 , "class" , "form-root svelte-crnq0a" ) ;
button . disabled = ctx . busy ;
attr ( button , "class" , button _class _value = "" + null _to _empty ( ctx . _buttonClass ) + " svelte-crnq0a" ) ;
attr ( div5 , "class" , "login-button-container svelte-crnq0a" ) ;
attr ( div6 , "class" , "content svelte-crnq0a" ) ;
attr ( div7 , "class" , "root svelte-crnq0a" ) ;
dispose = [
listen ( input0 , "input" , ctx . input0 _input _handler ) ,
listen ( input1 , "input" , ctx . input1 _input _handler ) ,
listen ( button , "click" , ctx . login )
] ;
} ,
m ( target , anchor ) {
insert ( target , div7 , anchor ) ;
append ( div7 , div6 ) ;
if ( if _block0 ) if _block0 . m ( div6 , null ) ;
append ( div6 , t0 ) ;
append ( div6 , div4 ) ;
append ( div4 , div0 ) ;
append ( div0 , t1 ) ;
append ( div4 , t2 ) ;
append ( div4 , div1 ) ;
append ( div1 , input0 ) ;
set _input _value ( input0 , ctx . username ) ;
append ( div4 , t3 ) ;
append ( div4 , div2 ) ;
append ( div2 , t4 ) ;
append ( div4 , t5 ) ;
append ( div4 , div3 ) ;
append ( div3 , input1 ) ;
set _input _value ( input1 , ctx . password ) ;
append ( div6 , t6 ) ;
append ( div6 , div5 ) ;
append ( div5 , button ) ;
append ( button , t7 ) ;
append ( div6 , t8 ) ;
if ( if _block1 ) if _block1 . m ( div6 , null ) ;
} ,
p ( changed , ctx ) {
if ( ctx . _logo ) {
if ( if _block0 ) {
if _block0 . p ( changed , ctx ) ;
} else {
if _block0 = create _if _block _1$1 ( ctx ) ;
if _block0 . c ( ) ;
if _block0 . m ( div6 , t0 ) ;
}
} else if ( if _block0 ) {
if _block0 . d ( 1 ) ;
if _block0 = null ;
}
if ( changed . usernameLabel ) {
set _data ( t1 , ctx . usernameLabel ) ;
}
if ( changed . username && ( input0 . value !== ctx . username ) ) set _input _value ( input0 , ctx . username ) ;
if ( ( changed . _inputClass ) && input0 _class _value !== ( input0 _class _value = "" + null _to _empty ( ctx . _inputClass ) + " svelte-crnq0a" ) ) {
attr ( input0 , "class" , input0 _class _value ) ;
}
if ( changed . passwordLabel ) {
set _data ( t4 , ctx . passwordLabel ) ;
}
if ( changed . password && ( input1 . value !== ctx . password ) ) set _input _value ( input1 , ctx . password ) ;
if ( ( changed . _inputClass ) && input1 _class _value !== ( input1 _class _value = "" + null _to _empty ( ctx . _inputClass ) + " svelte-crnq0a" ) ) {
attr ( input1 , "class" , input1 _class _value ) ;
}
if ( changed . loginButtonLabel ) {
set _data ( t7 , ctx . loginButtonLabel ) ;
}
if ( changed . busy ) {
button . disabled = ctx . busy ;
}
if ( ( changed . _buttonClass ) && button _class _value !== ( button _class _value = "" + null _to _empty ( ctx . _buttonClass ) + " svelte-crnq0a" ) ) {
attr ( button , "class" , button _class _value ) ;
}
if ( ctx . incorrect ) {
if ( ! if _block1 ) {
if _block1 = create _if _block$2 ( ) ;
if _block1 . c ( ) ;
if _block1 . m ( div6 , null ) ;
}
} else if ( if _block1 ) {
if _block1 . d ( 1 ) ;
if _block1 = null ;
}
} ,
i : noop ,
o : noop ,
d ( detaching ) {
if ( detaching ) {
detach ( div7 ) ;
}
if ( if _block0 ) if _block0 . d ( ) ;
if ( if _block1 ) if _block1 . d ( ) ;
run _all ( dispose ) ;
}
} ;
}
function instance$3 ( $$self , $$props , $$invalidate ) {
let { usernameLabel = "Username" , passwordLabel = "Password" , loginButtonLabel = "Login" , loginRedirect = "" , logo = "" , buttonClass = "" , inputClass = "" , _bb } = $$props ;
let username = "" ;
let password = "" ;
let busy = false ;
let incorrect = false ;
let _logo = "" ;
let _buttonClass = "" ;
let _inputClass = "" ;
const login = ( ) => {
$$invalidate ( 'busy' , busy = true ) ;
_bb . api . post ( "/api/authenticate" , { username , password } )
. then ( r => {
$$invalidate ( 'busy' , busy = false ) ;
if ( r . status === 200 ) {
return r . json ( ) ;
} else {
$$invalidate ( 'incorrect' , incorrect = true ) ;
return ;
}
} )
. then ( user => {
if ( user ) {
localStorage . setItem ( "budibase:user" , user ) ;
location . reload ( ) ;
}
} ) ;
} ;
function input0 _input _handler ( ) {
username = this . value ;
$$invalidate ( 'username' , username ) ;
}
function input1 _input _handler ( ) {
password = this . value ;
$$invalidate ( 'password' , password ) ;
}
$$self . $set = $$props => {
if ( 'usernameLabel' in $$props ) $$invalidate ( 'usernameLabel' , usernameLabel = $$props . usernameLabel ) ;
if ( 'passwordLabel' in $$props ) $$invalidate ( 'passwordLabel' , passwordLabel = $$props . passwordLabel ) ;
if ( 'loginButtonLabel' in $$props ) $$invalidate ( 'loginButtonLabel' , loginButtonLabel = $$props . loginButtonLabel ) ;
if ( 'loginRedirect' in $$props ) $$invalidate ( 'loginRedirect' , loginRedirect = $$props . loginRedirect ) ;
if ( 'logo' in $$props ) $$invalidate ( 'logo' , logo = $$props . logo ) ;
if ( 'buttonClass' in $$props ) $$invalidate ( 'buttonClass' , buttonClass = $$props . buttonClass ) ;
if ( 'inputClass' in $$props ) $$invalidate ( 'inputClass' , inputClass = $$props . inputClass ) ;
if ( '_bb' in $$props ) $$invalidate ( '_bb' , _bb = $$props . _bb ) ;
} ;
$$self . $$ . update = ( $$dirty = { _bb : 1 , logo : 1 , buttonClass : 1 , inputClass : 1 } ) => {
if ( $$dirty . _bb || $$dirty . logo || $$dirty . buttonClass || $$dirty . inputClass ) { {
$$invalidate ( '_logo' , _logo = _bb . relativeUrl ( logo ) ) ;
$$invalidate ( '_buttonClass' , _buttonClass = buttonClass || "default-button" ) ;
$$invalidate ( '_inputClass' , _inputClass = inputClass || "default-input" ) ;
} }
} ;
return {
usernameLabel ,
passwordLabel ,
loginButtonLabel ,
loginRedirect ,
logo ,
buttonClass ,
inputClass ,
_bb ,
username ,
password ,
busy ,
incorrect ,
_logo ,
_buttonClass ,
_inputClass ,
login ,
input0 _input _handler ,
input1 _input _handler
} ;
}
class Login extends SvelteComponent {
constructor ( options ) {
super ( ) ;
if ( ! document . getElementById ( "svelte-crnq0a-style" ) ) add _css$3 ( ) ;
init ( this , options , instance$3 , create _fragment$3 , safe _not _equal , [ "usernameLabel" , "passwordLabel" , "loginButtonLabel" , "loginRedirect" , "logo" , "buttonClass" , "inputClass" , "_bb" ] ) ;
}
}
const buildStyle = ( styles ) => {
let str = "" ;
for ( let s in styles ) {
if ( styles [ s ] ) {
str += ` ${ s } : ${ styles [ s ] } ; ` ;
}
}
return str ;
} ;
/* src\Grid.svelte generated by Svelte v3.12.1 */
function add _css$4 ( ) {
var style = element ( "style" ) ;
style . id = 'svelte-10kw8to-style' ;
style . textContent = ".root.svelte-10kw8to{display:grid}" ;
append ( document . head , style ) ;
}
function get _each _context$1 ( ctx , list , i ) {
const child _ctx = Object . create ( ctx ) ;
child _ctx . child = list [ i ] ;
child _ctx . index = i ;
return child _ctx ;
}
// (49:4) {#each children as child, index}
function create _each _block$1 ( ctx ) {
var div , index = ctx . index , div _class _value , div _style _value ;
const assign _div = ( ) => ctx . div _binding ( div , index ) ;
const unassign _div = ( ) => ctx . div _binding ( null , index ) ;
return {
c ( ) {
div = element ( "div" ) ;
this . h ( ) ;
} ,
l ( nodes ) {
div = claim _element ( nodes , "DIV" , { class : true , style : true } , false ) ;
var div _nodes = children ( div ) ;
div _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
attr ( div , "class" , div _class _value = "" + null _to _empty ( ctx . itemContainerClass ) + " svelte-10kw8to" ) ;
attr ( div , "style" , div _style _value = ctx . childStyle ( ctx . child ) ) ;
} ,
m ( target , anchor ) {
insert ( target , div , anchor ) ;
assign _div ( ) ;
} ,
p ( changed , new _ctx ) {
ctx = new _ctx ;
if ( index !== ctx . index ) {
unassign _div ( ) ;
index = ctx . index ;
assign _div ( ) ;
}
if ( ( changed . itemContainerClass ) && div _class _value !== ( div _class _value = "" + null _to _empty ( ctx . itemContainerClass ) + " svelte-10kw8to" ) ) {
attr ( div , "class" , div _class _value ) ;
}
if ( ( changed . children ) && div _style _value !== ( div _style _value = ctx . childStyle ( ctx . child ) ) ) {
attr ( div , "style" , div _style _value ) ;
}
} ,
d ( detaching ) {
if ( detaching ) {
detach ( div ) ;
}
unassign _div ( ) ;
}
} ;
}
function create _fragment$4 ( ctx ) {
var div , div _class _value ;
let each _value = ctx . children ;
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 ) ) ;
}
return {
c ( ) {
div = element ( "div" ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . c ( ) ;
}
this . h ( ) ;
} ,
l ( nodes ) {
div = claim _element ( nodes , "DIV" , { class : true , style : true } , false ) ;
var div _nodes = children ( div ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . l ( div _nodes ) ;
}
div _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
attr ( div , "class" , div _class _value = "root " + ctx . containerClass + " svelte-10kw8to" ) ;
set _style ( div , "width" , ctx . width ) ;
set _style ( div , "height" , ctx . height ) ;
set _style ( div , "grid-template-columns" , ctx . gridTemplateColumns ) ;
set _style ( div , "grid-template-rows" , ctx . gridTemplateRows ) ;
} ,
m ( target , anchor ) {
insert ( target , div , anchor ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . m ( div , null ) ;
}
} ,
p ( changed , ctx ) {
if ( changed . itemContainerClass || changed . childStyle || changed . children || changed . htmlElements ) {
each _value = ctx . children ;
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 ( changed , child _ctx ) ;
} else {
each _blocks [ i ] = create _each _block$1 ( child _ctx ) ;
each _blocks [ i ] . c ( ) ;
each _blocks [ i ] . m ( div , null ) ;
}
}
for ( ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . d ( 1 ) ;
}
each _blocks . length = each _value . length ;
}
if ( ( changed . containerClass ) && div _class _value !== ( div _class _value = "root " + ctx . containerClass + " svelte-10kw8to" ) ) {
attr ( div , "class" , div _class _value ) ;
}
if ( changed . width ) {
set _style ( div , "width" , ctx . width ) ;
}
if ( changed . height ) {
set _style ( div , "height" , ctx . height ) ;
}
if ( changed . gridTemplateColumns ) {
set _style ( div , "grid-template-columns" , ctx . gridTemplateColumns ) ;
}
if ( changed . gridTemplateRows ) {
set _style ( div , "grid-template-rows" , ctx . gridTemplateRows ) ;
}
} ,
i : noop ,
o : noop ,
d ( detaching ) {
if ( detaching ) {
detach ( div ) ;
}
destroy _each ( each _blocks , detaching ) ;
}
} ;
}
function instance$4 ( $$self , $$props , $$invalidate ) {
let { gridTemplateRows = "" , gridTemplateColumns = "" , children = [ ] , width = "auto" , height = "auto" , containerClass = "" , itemContainerClass = "" , _bb } = $$props ;
let htmlElements = { } ;
const childStyle = child =>
buildStyle ( {
"grid-column-start" : child . gridColumnStart ,
"grid-column-end" : child . gridColumnEnd ,
"grid-column" : child . gridColumn ,
"grid-row-start" : child . gridRowStart ,
"grid-row-end" : child . gridRowStart ,
"grid-row" : child . gridRow ,
} ) ;
function div _binding ( $$value , index ) {
if ( htmlElements [ index ] === $$value ) return ;
binding _callbacks [ $$value ? 'unshift' : 'push' ] ( ( ) => {
htmlElements [ index ] = $$value ;
$$invalidate ( 'htmlElements' , htmlElements ) ;
} ) ;
}
$$self . $set = $$props => {
if ( 'gridTemplateRows' in $$props ) $$invalidate ( 'gridTemplateRows' , gridTemplateRows = $$props . gridTemplateRows ) ;
if ( 'gridTemplateColumns' in $$props ) $$invalidate ( 'gridTemplateColumns' , gridTemplateColumns = $$props . gridTemplateColumns ) ;
if ( 'children' in $$props ) $$invalidate ( 'children' , children = $$props . children ) ;
if ( 'width' in $$props ) $$invalidate ( 'width' , width = $$props . width ) ;
if ( 'height' in $$props ) $$invalidate ( 'height' , height = $$props . height ) ;
if ( 'containerClass' in $$props ) $$invalidate ( 'containerClass' , containerClass = $$props . containerClass ) ;
if ( 'itemContainerClass' in $$props ) $$invalidate ( 'itemContainerClass' , itemContainerClass = $$props . itemContainerClass ) ;
if ( '_bb' in $$props ) $$invalidate ( '_bb' , _bb = $$props . _bb ) ;
} ;
$$self . $$ . update = ( $$dirty = { _bb : 1 , htmlElements : 1 , children : 1 } ) => {
if ( $$dirty . _bb || $$dirty . htmlElements || $$dirty . children ) { {
if ( _bb && htmlElements ) {
for ( let el in htmlElements ) {
_bb . initialiseComponent (
children [ el ] . control ,
htmlElements [ el ]
) ;
}
}
} }
} ;
return {
gridTemplateRows ,
gridTemplateColumns ,
children ,
width ,
height ,
containerClass ,
itemContainerClass ,
_bb ,
htmlElements ,
childStyle ,
div _binding
} ;
}
class Grid extends SvelteComponent {
constructor ( options ) {
super ( ) ;
if ( ! document . getElementById ( "svelte-10kw8to-style" ) ) add _css$4 ( ) ;
init ( this , options , instance$4 , create _fragment$4 , safe _not _equal , [ "gridTemplateRows" , "gridTemplateColumns" , "children" , "width" , "height" , "containerClass" , "itemContainerClass" , "_bb" ] ) ;
}
}
/* src\StackPanel.svelte generated by Svelte v3.12.1 */
2019-10-03 07:12:13 +02:00
const { Object : Object _1 } = globals ;
2019-09-29 07:40:06 +02:00
function add _css$5 ( ) {
var style = element ( "style" ) ;
style . id = 'svelte-osi0db-style' ;
style . textContent = ".horizontal.svelte-osi0db{display:inline-block}.vertical.svelte-osi0db{display:block}" ;
append ( document . head , style ) ;
}
function get _each _context$2 ( ctx , list , i ) {
2019-10-03 07:12:13 +02:00
const child _ctx = Object _1 . create ( ctx ) ;
2019-09-29 07:40:06 +02:00
child _ctx . child = list [ i ] ;
child _ctx . index = i ;
return child _ctx ;
}
2019-10-03 07:12:13 +02:00
function get _each _context _1 ( ctx , list , i ) {
const child _ctx = Object _1 . create ( ctx ) ;
child _ctx . child = list [ i ] ;
child _ctx . index = i ;
return child _ctx ;
}
// (76:4) {#each children as child, index}
function create _each _block _1 ( ctx ) {
var div1 , div0 , index = ctx . index , div0 _class _value , div1 _class _value ;
2019-09-29 07:40:06 +02:00
const assign _div0 = ( ) => ctx . div0 _binding ( div0 , index ) ;
const unassign _div0 = ( ) => ctx . div0 _binding ( null , index ) ;
2019-10-03 07:12:13 +02:00
return {
c ( ) {
div1 = element ( "div" ) ;
div0 = element ( "div" ) ;
this . h ( ) ;
} ,
l ( nodes ) {
div1 = claim _element ( nodes , "DIV" , { class : true } , false ) ;
var div1 _nodes = children ( div1 ) ;
div0 = claim _element ( div1 _nodes , "DIV" , { class : true } , false ) ;
var div0 _nodes = children ( div0 ) ;
div0 _nodes . forEach ( detach ) ;
div1 _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
attr ( div0 , "class" , div0 _class _value = "" + null _to _empty ( ctx . itemContainerClass ) + " svelte-osi0db" ) ;
attr ( div1 , "class" , div1 _class _value = "" + null _to _empty ( ctx . direction ) + " svelte-osi0db" ) ;
} ,
m ( target , anchor ) {
insert ( target , div1 , anchor ) ;
append ( div1 , div0 ) ;
assign _div0 ( ) ;
} ,
p ( changed , new _ctx ) {
ctx = new _ctx ;
if ( index !== ctx . index ) {
unassign _div0 ( ) ;
index = ctx . index ;
assign _div0 ( ) ;
}
if ( ( changed . itemContainerClass ) && div0 _class _value !== ( div0 _class _value = "" + null _to _empty ( ctx . itemContainerClass ) + " svelte-osi0db" ) ) {
attr ( div0 , "class" , div0 _class _value ) ;
}
if ( ( changed . direction ) && div1 _class _value !== ( div1 _class _value = "" + null _to _empty ( ctx . direction ) + " svelte-osi0db" ) ) {
attr ( div1 , "class" , div1 _class _value ) ;
}
} ,
d ( detaching ) {
if ( detaching ) {
detach ( div1 ) ;
}
unassign _div0 ( ) ;
}
} ;
}
// (83:4) {#each data as child, index}
function create _each _block$2 ( ctx ) {
var div1 , div0 , index = ctx . index , div0 _class _value , t , div1 _class _value ;
const assign _div0 = ( ) => ctx . div0 _binding _1 ( div0 , index ) ;
const unassign _div0 = ( ) => ctx . div0 _binding _1 ( null , index ) ;
2019-09-29 07:40:06 +02:00
return {
c ( ) {
div1 = element ( "div" ) ;
div0 = element ( "div" ) ;
t = space ( ) ;
this . h ( ) ;
} ,
l ( nodes ) {
div1 = claim _element ( nodes , "DIV" , { class : true } , false ) ;
var div1 _nodes = children ( div1 ) ;
div0 = claim _element ( div1 _nodes , "DIV" , { class : true } , false ) ;
var div0 _nodes = children ( div0 ) ;
div0 _nodes . forEach ( detach ) ;
t = claim _space ( div1 _nodes ) ;
div1 _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
attr ( div0 , "class" , div0 _class _value = "" + null _to _empty ( ctx . itemContainerClass ) + " svelte-osi0db" ) ;
attr ( div1 , "class" , div1 _class _value = "" + null _to _empty ( ctx . direction ) + " svelte-osi0db" ) ;
} ,
m ( target , anchor ) {
insert ( target , div1 , anchor ) ;
append ( div1 , div0 ) ;
assign _div0 ( ) ;
append ( div1 , t ) ;
} ,
p ( changed , new _ctx ) {
ctx = new _ctx ;
if ( index !== ctx . index ) {
unassign _div0 ( ) ;
index = ctx . index ;
assign _div0 ( ) ;
}
if ( ( changed . itemContainerClass ) && div0 _class _value !== ( div0 _class _value = "" + null _to _empty ( ctx . itemContainerClass ) + " svelte-osi0db" ) ) {
attr ( div0 , "class" , div0 _class _value ) ;
}
if ( ( changed . direction ) && div1 _class _value !== ( div1 _class _value = "" + null _to _empty ( ctx . direction ) + " svelte-osi0db" ) ) {
attr ( div1 , "class" , div1 _class _value ) ;
}
} ,
d ( detaching ) {
if ( detaching ) {
detach ( div1 ) ;
}
unassign _div0 ( ) ;
}
} ;
}
function create _fragment$5 ( ctx ) {
2019-10-03 07:12:13 +02:00
var div , t , div _class _value ;
2019-09-29 07:40:06 +02:00
2019-10-03 07:12:13 +02:00
let each _value _1 = ctx . children ;
let each _blocks _1 = [ ] ;
for ( let i = 0 ; i < each _value _1 . length ; i += 1 ) {
each _blocks _1 [ i ] = create _each _block _1 ( get _each _context _1 ( ctx , each _value _1 , i ) ) ;
}
let each _value = ctx . data ;
2019-09-29 07:40:06 +02:00
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 ) ) ;
}
return {
c ( ) {
div = element ( "div" ) ;
2019-10-03 07:12:13 +02:00
for ( let i = 0 ; i < each _blocks _1 . length ; i += 1 ) {
each _blocks _1 [ i ] . c ( ) ;
}
t = space ( ) ;
2019-09-29 07:40:06 +02:00
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . c ( ) ;
}
this . h ( ) ;
} ,
l ( nodes ) {
div = claim _element ( nodes , "DIV" , { class : true , style : true } , false ) ;
var div _nodes = children ( div ) ;
2019-10-03 07:12:13 +02:00
for ( let i = 0 ; i < each _blocks _1 . length ; i += 1 ) {
each _blocks _1 [ i ] . l ( div _nodes ) ;
}
t = claim _space ( div _nodes ) ;
2019-09-29 07:40:06 +02:00
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . l ( div _nodes ) ;
}
div _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
attr ( div , "class" , div _class _value = "root " + ctx . containerClass + " svelte-osi0db" ) ;
set _style ( div , "width" , ctx . width ) ;
set _style ( div , "height" , ctx . height ) ;
} ,
m ( target , anchor ) {
insert ( target , div , anchor ) ;
2019-10-03 07:12:13 +02:00
for ( let i = 0 ; i < each _blocks _1 . length ; i += 1 ) {
each _blocks _1 [ i ] . m ( div , null ) ;
}
append ( div , t ) ;
2019-09-29 07:40:06 +02:00
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . m ( div , null ) ;
}
} ,
p ( changed , ctx ) {
2019-10-03 07:12:13 +02:00
if ( changed . direction || changed . itemContainerClass || changed . staticHtmlElements || changed . children ) {
each _value _1 = ctx . children ;
let i ;
for ( i = 0 ; i < each _value _1 . length ; i += 1 ) {
const child _ctx = get _each _context _1 ( ctx , each _value _1 , i ) ;
if ( each _blocks _1 [ i ] ) {
each _blocks _1 [ i ] . p ( changed , child _ctx ) ;
} else {
each _blocks _1 [ i ] = create _each _block _1 ( child _ctx ) ;
each _blocks _1 [ i ] . c ( ) ;
each _blocks _1 [ i ] . m ( div , t ) ;
}
}
for ( ; i < each _blocks _1 . length ; i += 1 ) {
each _blocks _1 [ i ] . d ( 1 ) ;
}
each _blocks _1 . length = each _value _1 . length ;
}
if ( changed . direction || changed . itemContainerClass || changed . dataBoundElements || changed . data ) {
each _value = ctx . data ;
2019-09-29 07:40:06 +02:00
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 ( changed , child _ctx ) ;
} else {
each _blocks [ i ] = create _each _block$2 ( child _ctx ) ;
each _blocks [ i ] . c ( ) ;
each _blocks [ i ] . m ( div , null ) ;
}
}
for ( ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . d ( 1 ) ;
}
each _blocks . length = each _value . length ;
}
if ( ( changed . containerClass ) && div _class _value !== ( div _class _value = "root " + ctx . containerClass + " svelte-osi0db" ) ) {
attr ( div , "class" , div _class _value ) ;
}
if ( changed . width ) {
set _style ( div , "width" , ctx . width ) ;
}
if ( changed . height ) {
set _style ( div , "height" , ctx . height ) ;
}
} ,
i : noop ,
o : noop ,
d ( detaching ) {
if ( detaching ) {
detach ( div ) ;
}
2019-10-03 07:12:13 +02:00
destroy _each ( each _blocks _1 , detaching ) ;
2019-09-29 07:40:06 +02:00
destroy _each ( each _blocks , detaching ) ;
}
} ;
}
function instance$5 ( $$self , $$props , $$invalidate ) {
2019-10-03 07:12:13 +02:00
2019-09-29 07:40:06 +02:00
2019-10-03 07:12:13 +02:00
let { direction = "horizontal" , children = [ ] , width = "auto" , height = "auto" , containerClass = "" , itemContainerClass = "" , onLoad , data = [ ] , dataItemComponent , _bb } = $$props ;
2019-09-29 07:40:06 +02:00
2019-10-03 07:12:13 +02:00
let staticHtmlElements = { } ;
let staticComponents = { } ;
let dataBoundElements = { } ;
let dataBoundComponents = { } ;
const hasDataBoundComponents = ( ) =>
Object . getOwnPropertyNames ( dataBoundComponents ) . length === 0 ;
const hasData = ( ) =>
Array . isArray ( data ) && data . length > 0 ;
const hasStaticComponents = ( ) => {
return Object . getOwnPropertyNames ( staticComponents ) . length === 0 ;
} ;
2019-09-29 07:40:06 +02:00
function div0 _binding ( $$value , index ) {
2019-10-03 07:12:13 +02:00
if ( staticHtmlElements [ index ] === $$value ) return ;
2019-09-29 07:40:06 +02:00
binding _callbacks [ $$value ? 'unshift' : 'push' ] ( ( ) => {
2019-10-03 07:12:13 +02:00
staticHtmlElements [ index ] = $$value ;
$$invalidate ( 'staticHtmlElements' , staticHtmlElements ) ;
} ) ;
}
function div0 _binding _1 ( $$value , index ) {
if ( dataBoundElements [ index ] === $$value ) return ;
binding _callbacks [ $$value ? 'unshift' : 'push' ] ( ( ) => {
dataBoundElements [ index ] = $$value ;
$$invalidate ( 'dataBoundElements' , dataBoundElements ) ;
2019-09-29 07:40:06 +02:00
} ) ;
}
$$self . $set = $$props => {
if ( 'direction' in $$props ) $$invalidate ( 'direction' , direction = $$props . direction ) ;
if ( 'children' in $$props ) $$invalidate ( 'children' , children = $$props . children ) ;
if ( 'width' in $$props ) $$invalidate ( 'width' , width = $$props . width ) ;
if ( 'height' in $$props ) $$invalidate ( 'height' , height = $$props . height ) ;
if ( 'containerClass' in $$props ) $$invalidate ( 'containerClass' , containerClass = $$props . containerClass ) ;
if ( 'itemContainerClass' in $$props ) $$invalidate ( 'itemContainerClass' , itemContainerClass = $$props . itemContainerClass ) ;
2019-10-03 07:12:13 +02:00
if ( 'onLoad' in $$props ) $$invalidate ( 'onLoad' , onLoad = $$props . onLoad ) ;
if ( 'data' in $$props ) $$invalidate ( 'data' , data = $$props . data ) ;
if ( 'dataItemComponent' in $$props ) $$invalidate ( 'dataItemComponent' , dataItemComponent = $$props . dataItemComponent ) ;
2019-09-29 07:40:06 +02:00
if ( '_bb' in $$props ) $$invalidate ( '_bb' , _bb = $$props . _bb ) ;
} ;
2019-10-03 07:12:13 +02:00
$$self . $$ . update = ( $$dirty = { staticHtmlElements : 1 , staticComponents : 1 , _bb : 1 , children : 1 , dataBoundComponents : 1 , dataBoundElements : 1 , dataItemComponent : 1 , data : 1 } ) => {
if ( $$dirty . staticHtmlElements || $$dirty . staticComponents || $$dirty . _bb || $$dirty . children || $$dirty . dataBoundComponents || $$dirty . dataBoundElements || $$dirty . dataItemComponent || $$dirty . data ) { {
if ( staticHtmlElements ) {
if ( hasStaticComponents ( ) ) {
for ( let c in staticComponents ) {
staticComponents [ c ] . $destroy ( ) ;
}
$$invalidate ( 'staticComponents' , staticComponents = { } ) ;
}
for ( let el in staticHtmlElements ) {
$$invalidate ( 'staticComponents' , staticComponents [ el ] = _bb . initialiseComponent (
children [ el ] . control ,
staticHtmlElements [ el ]
) , staticComponents ) ;
}
}
if ( hasDataBoundComponents ( ) ) {
for ( let c in dataBoundComponents ) {
dataBoundComponents [ c ] . $destroy ( ) ;
}
$$invalidate ( 'dataBoundComponents' , dataBoundComponents = { } ) ;
}
if ( hasData ( ) ) {
for ( let d in dataBoundElements ) {
_bb . initialiseComponent (
dataItemComponent ,
dataBoundElements [ d ] ,
data [ parseInt ( d ) ]
) ;
}
}
} }
} ;
2019-09-29 07:40:06 +02:00
return {
direction ,
children ,
width ,
height ,
containerClass ,
itemContainerClass ,
2019-10-03 07:12:13 +02:00
onLoad ,
data ,
dataItemComponent ,
2019-09-29 07:40:06 +02:00
_bb ,
2019-10-03 07:12:13 +02:00
staticHtmlElements ,
dataBoundElements ,
div0 _binding ,
div0 _binding _1
2019-09-29 07:40:06 +02:00
} ;
}
class StackPanel extends SvelteComponent {
constructor ( options ) {
super ( ) ;
if ( ! document . getElementById ( "svelte-osi0db-style" ) ) add _css$5 ( ) ;
2019-10-03 07:12:13 +02:00
init ( this , options , instance$5 , create _fragment$5 , safe _not _equal , [ "direction" , "children" , "width" , "height" , "containerClass" , "itemContainerClass" , "onLoad" , "data" , "dataItemComponent" , "_bb" ] ) ;
2019-09-29 07:40:06 +02:00
}
}
2019-09-30 06:21:08 +02:00
// https://github.com/kaisermann/svelte-css-vars
var cssVars = ( node , props ) => {
Object . entries ( props ) . forEach ( ( [ key , value ] ) => {
node . style . setProperty ( ` -- ${ key } ` , value ) ;
} ) ;
return {
update ( new _props ) {
Object . entries ( new _props ) . forEach ( ( [ key , value ] ) => {
node . style . setProperty ( ` -- ${ key } ` , value ) ;
delete props [ key ] ;
} ) ;
Object . keys ( props ) . forEach ( name =>
node . style . removeProperty ( ` -- ${ name } ` ) ,
) ;
props = new _props ;
} ,
} ;
} ;
/* src\Nav.svelte generated by Svelte v3.12.1 */
function add _css$6 ( ) {
var style = element ( "style" ) ;
style . id = 'svelte-aihwli-style' ;
style . textContent = ".root.svelte-aihwli{height:100%;width:100%;grid-template-columns:[navbar] auto [content] 1fr;display:grid}.navbar.svelte-aihwli{grid-column:navbar;background:var(--navBarBackground);border:var(--navBarBorder);color:var(--navBarColor)}.navitem.svelte-aihwli{padding:10px 17px;cursor:pointer}.navitem.svelte-aihwli:hover{background:var(--itemHoverBackground);color:var(--itemHoverColor)}.navitem.selected.svelte-aihwli{background:var(--selectedItemBackground);border:var(--selectedItemBorder);color:var(--selectedItemColor)}.content.svelte-aihwli{grid-column:content}" ;
append ( document . head , style ) ;
}
function get _each _context$3 ( ctx , list , i ) {
const child _ctx = Object . create ( ctx ) ;
child _ctx . navItem = list [ i ] ;
child _ctx . index = i ;
return child _ctx ;
}
// (36:8) {#each items as navItem, index}
function create _each _block$3 ( ctx ) {
var div , t0 _value = ctx . navItem . title + "" , t0 , t1 , dispose ;
return {
c ( ) {
div = element ( "div" ) ;
t0 = text ( t0 _value ) ;
t1 = space ( ) ;
this . h ( ) ;
} ,
l ( nodes ) {
div = claim _element ( nodes , "DIV" , { class : true } , false ) ;
var div _nodes = children ( div ) ;
t0 = claim _text ( div _nodes , t0 _value ) ;
t1 = claim _space ( div _nodes ) ;
div _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
attr ( div , "class" , "navitem svelte-aihwli" ) ;
toggle _class ( div , "selected" , ctx . selectedIndex === ctx . index ) ;
dispose = listen ( div , "click" , ctx . onSelectItem ( ctx . index ) ) ;
} ,
m ( target , anchor ) {
insert ( target , div , anchor ) ;
append ( div , t0 ) ;
append ( div , t1 ) ;
} ,
p ( changed , new _ctx ) {
ctx = new _ctx ;
if ( ( changed . items ) && t0 _value !== ( t0 _value = ctx . navItem . title + "" ) ) {
set _data ( t0 , t0 _value ) ;
}
if ( changed . selectedIndex ) {
toggle _class ( div , "selected" , ctx . selectedIndex === ctx . index ) ;
}
} ,
d ( detaching ) {
if ( detaching ) {
detach ( div ) ;
}
dispose ( ) ;
}
} ;
}
function create _fragment$6 ( ctx ) {
var div2 , div0 , t , div1 , cssVars _action ;
let each _value = ctx . items ;
let each _blocks = [ ] ;
for ( let i = 0 ; i < each _value . length ; i += 1 ) {
each _blocks [ i ] = create _each _block$3 ( get _each _context$3 ( ctx , each _value , i ) ) ;
}
return {
c ( ) {
div2 = element ( "div" ) ;
div0 = element ( "div" ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . c ( ) ;
}
t = space ( ) ;
div1 = element ( "div" ) ;
this . h ( ) ;
} ,
l ( nodes ) {
div2 = claim _element ( nodes , "DIV" , { class : true } , false ) ;
var div2 _nodes = children ( div2 ) ;
div0 = claim _element ( div2 _nodes , "DIV" , { class : true } , false ) ;
var div0 _nodes = children ( div0 ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . l ( div0 _nodes ) ;
}
div0 _nodes . forEach ( detach ) ;
t = claim _space ( div2 _nodes ) ;
div1 = claim _element ( div2 _nodes , "DIV" , { class : true } , false ) ;
var div1 _nodes = children ( div1 ) ;
div1 _nodes . forEach ( detach ) ;
div2 _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
attr ( div0 , "class" , "navbar svelte-aihwli" ) ;
attr ( div1 , "class" , "content svelte-aihwli" ) ;
attr ( div2 , "class" , "root svelte-aihwli" ) ;
} ,
m ( target , anchor ) {
insert ( target , div2 , anchor ) ;
append ( div2 , div0 ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . m ( div0 , null ) ;
}
append ( div2 , t ) ;
append ( div2 , div1 ) ;
ctx . div1 _binding ( div1 ) ;
cssVars _action = cssVars . call ( null , div2 , ctx . styleVars ) || { } ;
} ,
p ( changed , ctx ) {
if ( changed . selectedIndex || changed . items ) {
each _value = ctx . items ;
let i ;
for ( i = 0 ; i < each _value . length ; i += 1 ) {
const child _ctx = get _each _context$3 ( ctx , each _value , i ) ;
if ( each _blocks [ i ] ) {
each _blocks [ i ] . p ( changed , child _ctx ) ;
} else {
each _blocks [ i ] = create _each _block$3 ( child _ctx ) ;
each _blocks [ i ] . c ( ) ;
each _blocks [ i ] . m ( div0 , null ) ;
}
}
for ( ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . d ( 1 ) ;
}
each _blocks . length = each _value . length ;
}
if ( typeof cssVars _action . update === 'function' && changed . styleVars ) {
cssVars _action . update . call ( null , ctx . styleVars ) ;
}
} ,
i : noop ,
o : noop ,
d ( detaching ) {
if ( detaching ) {
detach ( div2 ) ;
}
destroy _each ( each _blocks , detaching ) ;
ctx . div1 _binding ( null ) ;
if ( cssVars _action && typeof cssVars _action . destroy === 'function' ) cssVars _action . destroy ( ) ;
}
} ;
}
function instance$6 ( $$self , $$props , $$invalidate ) {
let { navBarBackground = "" , navBarBorder = "" , navBarColor = "" , selectedItemBackground = "" , selectedItemColor = "" , selectedItemBorder = "" , itemHoverBackground = "" , itemHoverColor = "" , items = [ ] , _bb } = $$props ;
let selectedIndex ;
let contentElement ;
const onSelectItem = ( index ) => ( ) => {
$$invalidate ( 'selectedIndex' , selectedIndex = index ) ;
_bb . initialiseComponent ( items [ index ] . component , contentElement ) ;
} ;
function div1 _binding ( $$value ) {
binding _callbacks [ $$value ? 'unshift' : 'push' ] ( ( ) => {
$$invalidate ( 'contentElement' , contentElement = $$value ) ;
} ) ;
}
$$self . $set = $$props => {
if ( 'navBarBackground' in $$props ) $$invalidate ( 'navBarBackground' , navBarBackground = $$props . navBarBackground ) ;
if ( 'navBarBorder' in $$props ) $$invalidate ( 'navBarBorder' , navBarBorder = $$props . navBarBorder ) ;
if ( 'navBarColor' in $$props ) $$invalidate ( 'navBarColor' , navBarColor = $$props . navBarColor ) ;
if ( 'selectedItemBackground' in $$props ) $$invalidate ( 'selectedItemBackground' , selectedItemBackground = $$props . selectedItemBackground ) ;
if ( 'selectedItemColor' in $$props ) $$invalidate ( 'selectedItemColor' , selectedItemColor = $$props . selectedItemColor ) ;
if ( 'selectedItemBorder' in $$props ) $$invalidate ( 'selectedItemBorder' , selectedItemBorder = $$props . selectedItemBorder ) ;
if ( 'itemHoverBackground' in $$props ) $$invalidate ( 'itemHoverBackground' , itemHoverBackground = $$props . itemHoverBackground ) ;
if ( 'itemHoverColor' in $$props ) $$invalidate ( 'itemHoverColor' , itemHoverColor = $$props . itemHoverColor ) ;
if ( 'items' in $$props ) $$invalidate ( 'items' , items = $$props . items ) ;
if ( '_bb' in $$props ) $$invalidate ( '_bb' , _bb = $$props . _bb ) ;
} ;
let styleVars ;
$$self . $$ . update = ( $$dirty = { navBarBackground : 1 , navBarBorder : 1 , navBarColor : 1 , selectedItemBackground : 1 , selectedItemColor : 1 , selectedItemBorder : 1 , itemHoverBackground : 1 , itemHoverColor : 1 } ) => {
if ( $$dirty . navBarBackground || $$dirty . navBarBorder || $$dirty . navBarColor || $$dirty . selectedItemBackground || $$dirty . selectedItemColor || $$dirty . selectedItemBorder || $$dirty . itemHoverBackground || $$dirty . itemHoverColor ) { $$invalidate ( 'styleVars' , styleVars = {
navBarBackground , navBarBorder ,
navBarColor , selectedItemBackground ,
selectedItemColor , selectedItemBorder ,
itemHoverBackground , itemHoverColor
} ) ; }
} ;
return {
navBarBackground ,
navBarBorder ,
navBarColor ,
selectedItemBackground ,
selectedItemColor ,
selectedItemBorder ,
itemHoverBackground ,
itemHoverColor ,
items ,
_bb ,
selectedIndex ,
contentElement ,
onSelectItem ,
styleVars ,
div1 _binding
} ;
}
class Nav extends SvelteComponent {
constructor ( options ) {
super ( ) ;
if ( ! document . getElementById ( "svelte-aihwli-style" ) ) add _css$6 ( ) ;
init ( this , options , instance$6 , create _fragment$6 , safe _not _equal , [ "navBarBackground" , "navBarBorder" , "navBarColor" , "selectedItemBackground" , "selectedItemColor" , "selectedItemBorder" , "itemHoverBackground" , "itemHoverColor" , "items" , "_bb" ] ) ;
}
}
/* src\Panel.svelte generated by Svelte v3.12.1 */
2019-10-03 07:12:13 +02:00
function add _css$7 ( ) {
var style = element ( "style" ) ;
style . id = 'svelte-b2rjlq-style' ;
style . textContent = ".panel.svelte-b2rjlq:hover{background:var(--hoverBackground);color:var(--hoverColor)}" ;
append ( document . head , style ) ;
}
2019-09-30 06:21:08 +02:00
function create _fragment$7 ( ctx ) {
2019-10-03 07:12:13 +02:00
var div , t _value = ctx . component ? "" : ctx . text + "" , t , div _class _value , cssVars _action , dispose ;
2019-09-30 06:21:08 +02:00
return {
c ( ) {
div = element ( "div" ) ;
2019-10-03 07:12:13 +02:00
t = text ( t _value ) ;
2019-09-30 06:21:08 +02:00
this . h ( ) ;
} ,
l ( nodes ) {
div = claim _element ( nodes , "DIV" , { class : true , style : true , "this:bind" : true } , false ) ;
var div _nodes = children ( div ) ;
2019-10-03 07:12:13 +02:00
t = claim _text ( div _nodes , t _value ) ;
2019-09-30 06:21:08 +02:00
div _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
2019-10-03 07:12:13 +02:00
attr ( div , "class" , div _class _value = "" + ctx . containerClass + " panel" + " svelte-b2rjlq" ) ;
2019-09-30 06:21:08 +02:00
attr ( div , "style" , ctx . style ) ;
attr ( div , "this:bind" , ctx . componentElement ) ;
2019-10-03 07:12:13 +02:00
dispose = listen ( div , "click" , ctx . click _handler ) ;
2019-09-30 06:21:08 +02:00
} ,
m ( target , anchor ) {
insert ( target , div , anchor ) ;
append ( div , t ) ;
2019-10-03 07:12:13 +02:00
cssVars _action = cssVars . call ( null , div , ctx . styleVars ) || { } ;
2019-09-30 06:21:08 +02:00
} ,
p ( changed , ctx ) {
2019-10-03 07:12:13 +02:00
if ( ( changed . component || changed . text ) && t _value !== ( t _value = ctx . component ? "" : ctx . text + "" ) ) {
set _data ( t , t _value ) ;
2019-09-30 06:21:08 +02:00
}
2019-10-03 07:12:13 +02:00
if ( ( changed . containerClass ) && div _class _value !== ( div _class _value = "" + ctx . containerClass + " panel" + " svelte-b2rjlq" ) ) {
attr ( div , "class" , div _class _value ) ;
2019-09-30 06:21:08 +02:00
}
if ( changed . style ) {
attr ( div , "style" , ctx . style ) ;
}
2019-10-03 07:12:13 +02:00
if ( typeof cssVars _action . update === 'function' && changed . styleVars ) {
cssVars _action . update . call ( null , ctx . styleVars ) ;
}
2019-09-30 06:21:08 +02:00
} ,
i : noop ,
o : noop ,
d ( detaching ) {
if ( detaching ) {
detach ( div ) ;
}
2019-10-03 07:12:13 +02:00
if ( cssVars _action && typeof cssVars _action . destroy === 'function' ) cssVars _action . destroy ( ) ;
dispose ( ) ;
2019-09-30 06:21:08 +02:00
}
} ;
}
function instance$7 ( $$self , $$props , $$invalidate ) {
2019-10-03 07:12:13 +02:00
2019-09-30 06:21:08 +02:00
2019-10-03 07:12:13 +02:00
let { component = "" , text = "" , containerClass = "" , background = "" , border = "" , borderRadius = "" , font = "" , display = "" , textAlign = "" , color = "" , padding = "" , margin = "" , hoverBackground = "" , hoverColor = "" , onClick , height , width , _bb } = $$props ;
let styleVars ;
2019-09-30 06:21:08 +02:00
let style = "" ;
let componentElement ;
2019-10-03 07:12:13 +02:00
const click _handler = ( ) => onClick ? onClick ( ) : undefined ;
2019-09-30 06:21:08 +02:00
$$self . $set = $$props => {
if ( 'component' in $$props ) $$invalidate ( 'component' , component = $$props . component ) ;
if ( 'text' in $$props ) $$invalidate ( 'text' , text = $$props . text ) ;
if ( 'containerClass' in $$props ) $$invalidate ( 'containerClass' , containerClass = $$props . containerClass ) ;
if ( 'background' in $$props ) $$invalidate ( 'background' , background = $$props . background ) ;
if ( 'border' in $$props ) $$invalidate ( 'border' , border = $$props . border ) ;
if ( 'borderRadius' in $$props ) $$invalidate ( 'borderRadius' , borderRadius = $$props . borderRadius ) ;
if ( 'font' in $$props ) $$invalidate ( 'font' , font = $$props . font ) ;
if ( 'display' in $$props ) $$invalidate ( 'display' , display = $$props . display ) ;
if ( 'textAlign' in $$props ) $$invalidate ( 'textAlign' , textAlign = $$props . textAlign ) ;
if ( 'color' in $$props ) $$invalidate ( 'color' , color = $$props . color ) ;
if ( 'padding' in $$props ) $$invalidate ( 'padding' , padding = $$props . padding ) ;
2019-10-03 07:12:13 +02:00
if ( 'margin' in $$props ) $$invalidate ( 'margin' , margin = $$props . margin ) ;
if ( 'hoverBackground' in $$props ) $$invalidate ( 'hoverBackground' , hoverBackground = $$props . hoverBackground ) ;
if ( 'hoverColor' in $$props ) $$invalidate ( 'hoverColor' , hoverColor = $$props . hoverColor ) ;
if ( 'onClick' in $$props ) $$invalidate ( 'onClick' , onClick = $$props . onClick ) ;
if ( 'height' in $$props ) $$invalidate ( 'height' , height = $$props . height ) ;
if ( 'width' in $$props ) $$invalidate ( 'width' , width = $$props . width ) ;
2019-09-30 06:21:08 +02:00
if ( '_bb' in $$props ) $$invalidate ( '_bb' , _bb = $$props . _bb ) ;
} ;
2019-10-03 07:12:13 +02:00
$$self . $$ . update = ( $$dirty = { border : 1 , background : 1 , font : 1 , margin : 1 , padding : 1 , display : 1 , color : 1 , height : 1 , width : 1 , textAlign : 1 , borderRadius : 1 , _bb : 1 , component : 1 , componentElement : 1 , hoverBackground : 1 , hoverColor : 1 , onClick : 1 } ) => {
if ( $$dirty . border || $$dirty . background || $$dirty . font || $$dirty . margin || $$dirty . padding || $$dirty . display || $$dirty . color || $$dirty . height || $$dirty . width || $$dirty . textAlign || $$dirty . borderRadius || $$dirty . _bb || $$dirty . component || $$dirty . componentElement || $$dirty . hoverBackground || $$dirty . hoverColor || $$dirty . onClick ) { {
2019-09-30 06:21:08 +02:00
$$invalidate ( 'style' , style = buildStyle ( {
2019-10-03 07:12:13 +02:00
border , background , font , margin ,
padding , display , color , height , width ,
2019-09-30 06:21:08 +02:00
"text-align" : textAlign ,
"border-radius" : borderRadius
} ) ) ;
if ( _bb && component ) {
_bb . initialiseComponent ( component , componentElement ) ;
}
2019-10-03 07:12:13 +02:00
$$invalidate ( 'styleVars' , styleVars = {
hoverBackground : hoverBackground || background ,
hoverColor : hoverColor || color ,
pointer : onClick ? "cursor" : "none"
} ) ;
2019-09-30 06:21:08 +02:00
} }
} ;
return {
component ,
text ,
containerClass ,
background ,
border ,
borderRadius ,
font ,
display ,
textAlign ,
color ,
padding ,
2019-10-03 07:12:13 +02:00
margin ,
hoverBackground ,
hoverColor ,
onClick ,
height ,
width ,
2019-09-30 06:21:08 +02:00
_bb ,
2019-10-03 07:12:13 +02:00
styleVars ,
2019-09-30 06:21:08 +02:00
style ,
2019-10-03 07:12:13 +02:00
componentElement ,
click _handler
2019-09-30 06:21:08 +02:00
} ;
}
class Panel extends SvelteComponent {
constructor ( options ) {
super ( ) ;
2019-10-03 07:12:13 +02:00
if ( ! document . getElementById ( "svelte-b2rjlq-style" ) ) add _css$7 ( ) ;
init ( this , options , instance$7 , create _fragment$7 , safe _not _equal , [ "component" , "text" , "containerClass" , "background" , "border" , "borderRadius" , "font" , "display" , "textAlign" , "color" , "padding" , "margin" , "hoverBackground" , "hoverColor" , "onClick" , "height" , "width" , "_bb" ] ) ;
2019-09-30 06:21:08 +02:00
}
}
/* src\Text.svelte generated by Svelte v3.12.1 */
function create _fragment$8 ( ctx ) {
var div , t ;
return {
c ( ) {
div = element ( "div" ) ;
t = text ( ctx . value ) ;
this . h ( ) ;
} ,
l ( nodes ) {
div = claim _element ( nodes , "DIV" , { class : true , style : true } , false ) ;
var div _nodes = children ( div ) ;
t = claim _text ( div _nodes , ctx . value ) ;
div _nodes . forEach ( detach ) ;
this . h ( ) ;
} ,
h ( ) {
attr ( div , "class" , ctx . containerClass ) ;
attr ( div , "style" , ctx . style ) ;
} ,
m ( target , anchor ) {
insert ( target , div , anchor ) ;
append ( div , t ) ;
} ,
p ( changed , ctx ) {
if ( changed . value ) {
set _data ( t , ctx . value ) ;
}
if ( changed . containerClass ) {
attr ( div , "class" , ctx . containerClass ) ;
}
if ( changed . style ) {
attr ( div , "style" , ctx . style ) ;
}
} ,
i : noop ,
o : noop ,
d ( detaching ) {
if ( detaching ) {
detach ( div ) ;
}
}
} ;
}
function instance$8 ( $$self , $$props , $$invalidate ) {
let { value = "" , containerClass = "" , font = "" , textAlign = "" , verticalAlign = "" , color = "" , display = "" , _bb } = $$props ;
let style = "" ;
$$self . $set = $$props => {
if ( 'value' in $$props ) $$invalidate ( 'value' , value = $$props . value ) ;
if ( 'containerClass' in $$props ) $$invalidate ( 'containerClass' , containerClass = $$props . containerClass ) ;
if ( 'font' in $$props ) $$invalidate ( 'font' , font = $$props . font ) ;
if ( 'textAlign' in $$props ) $$invalidate ( 'textAlign' , textAlign = $$props . textAlign ) ;
if ( 'verticalAlign' in $$props ) $$invalidate ( 'verticalAlign' , verticalAlign = $$props . verticalAlign ) ;
if ( 'color' in $$props ) $$invalidate ( 'color' , color = $$props . color ) ;
if ( 'display' in $$props ) $$invalidate ( 'display' , display = $$props . display ) ;
if ( '_bb' in $$props ) $$invalidate ( '_bb' , _bb = $$props . _bb ) ;
} ;
$$self . $$ . update = ( $$dirty = { font : 1 , verticalAlign : 1 , color : 1 , textAlign : 1 } ) => {
if ( $$dirty . font || $$dirty . verticalAlign || $$dirty . color || $$dirty . textAlign ) { {
$$invalidate ( 'style' , style = buildStyle ( {
font , verticalAlign , color ,
"text-align" : textAlign ,
"vertical-align" : verticalAlign
} ) ) ;
} }
} ;
return {
value ,
containerClass ,
font ,
textAlign ,
verticalAlign ,
color ,
display ,
_bb ,
style
} ;
}
class Text extends SvelteComponent {
constructor ( options ) {
super ( ) ;
init ( this , options , instance$8 , create _fragment$8 , safe _not _equal , [ "value" , "containerClass" , "font" , "textAlign" , "verticalAlign" , "color" , "display" , "_bb" ] ) ;
}
}
export { Button as button , Form as form , Grid as grid , Login as login , Nav as nav , Panel as panel , StackPanel as stackpanel , Text as text , Textbox as textbox } ;
2019-10-03 07:12:13 +02:00
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbIi4uL25vZGVfbW9kdWxlcy9zdmVsdGUvaW50ZXJuYWwvaW5kZXgubWpzIiwiLi4vc3JjL0J1dHRvbi5zdmVsdGUiLCIuLi9zcmMvVGV4dGJveC5zdmVsdGUiLCIuLi9zcmMvRm9ybS5zdmVsdGUiLCIuLi9zcmMvTG9naW4uc3ZlbHRlIiwiLi4vc3JjL2J1aWxkU3R5bGUuanMiLCIuLi9zcmMvR3JpZC5zdmVsdGUiLCIuLi9zcmMvU3RhY2tQYW5lbC5zdmVsdGUiLCIuLi9zcmMvY3NzVmFycy5qcyIsIi4uL3NyYy9OYXYuc3ZlbHRlIiwiLi4vc3JjL1BhbmVsLnN2ZWx0ZSIsIi4uL3NyYy9UZXh0LnN2ZWx0ZSJdLCJzb3VyY2VzQ29udGVudCI6WyJmdW5jdGlvbiBub29wKCkgeyB9XG5jb25zdCBpZGVudGl0eSA9IHggPT4geDtcbmZ1bmN0aW9uIGFzc2lnbih0YXIsIHNyYykge1xuICAgIC8vIEB0cy1pZ25vcmVcbiAgICBmb3IgKGNvbnN0IGsgaW4gc3JjKVxuICAgICAgICB0YXJba10gPSBzcmNba107XG4gICAgcmV0dXJuIHRhcjtcbn1cbmZ1bmN0aW9uIGlzX3Byb21pc2UodmFsdWUpIHtcbiAgICByZXR1cm4gdmFsdWUgJiYgdHlwZW9mIHZhbHVlID09PSAnb2JqZWN0JyAmJiB0eXBlb2YgdmFsdWUudGhlbiA9PT0gJ2Z1bmN0aW9uJztcbn1cbmZ1bmN0aW9uIGFkZF9sb2NhdGlvbihlbGVtZW50LCBmaWxlLCBsaW5lLCBjb2x1bW4sIGNoYXIpIHtcbiAgICBlbGVtZW50Ll9fc3ZlbHRlX21ldGEgPSB7XG4gICAgICAgIGxvYzogeyBmaWxlLCBsaW5lLCBjb2x1bW4sIGNoYXIgfVxuICAgIH07XG59XG5mdW5jdGlvbiBydW4oZm4pIHtcbiAgICByZXR1cm4gZm4oKTtcbn1cbmZ1bmN0aW9uIGJsYW5rX29iamVjdCgpIHtcbiAgICByZXR1cm4gT2JqZWN0LmNyZWF0ZShudWxsKTtcbn1cbmZ1bmN0aW9uIHJ1bl9hbGwoZm5zKSB7XG4gICAgZm5zLmZvckVhY2gocnVuKTtcbn1cbmZ1bmN0aW9uIGlzX2Z1bmN0aW9uKHRoaW5nKSB7XG4gICAgcmV0dXJuIHR5cGVvZiB0aGluZyA9PT0gJ2Z1bmN0aW9uJztcbn1cbmZ1bmN0aW9uIHNhZmVfbm90X2VxdWFsKGEsIGIpIHtcbiAgICByZXR1cm4gYSAhPSBhID8gYiA9PSBiIDogYSAhPT0gYiB8fCAoKGEgJiYgdHlwZW9mIGEgPT09ICdvYmplY3QnKSB8fCB0eXBlb2YgYSA9PT0gJ2Z1bmN0aW9uJyk7XG59XG5mdW5jdGlvbiBub3RfZXF1YWwoYSwgYikge1xuICAgIHJldHVybiBhICE9IGEgPyBiID09IGIgOiBhICE9PSBiO1xufVxuZnVuY3Rpb24gdmFsaWRhdGVfc3RvcmUoc3RvcmUsIG5hbWUpIHtcbiAgICBpZiAoIXN0b3JlIHx8IHR5cGVvZiBzdG9yZS5zdWJzY3JpYmUgIT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKGAnJHtuYW1lfScgaXMgbm90IGEgc3RvcmUgd2l0aCBhICdzdWJzY3JpYmUnIG1ldGhvZGApO1xuICAgIH1cbn1cbmZ1bmN0aW9uIHN1YnNjcmliZShzdG9yZSwgY2FsbGJhY2spIHtcbiAgICBjb25zdCB1bnN1YiA9IHN0b3JlLnN1YnNjcmliZShjYWxsYmFjayk7XG4gICAgcmV0dXJuIHVuc3ViLnVuc3Vic2NyaWJlID8gKCkgPT4gdW5zdWIudW5zdWJzY3JpYmUoKSA6IHVuc3ViO1xufVxuZnVuY3Rpb24gZ2V0X3N0b3JlX3ZhbHVlKHN0b3JlKSB7XG4gICAgbGV0IHZhbHVlO1xuICAgIHN1YnNjcmliZShzdG9yZSwgXyA9PiB2YWx1ZSA9IF8pKCk7XG4gICAgcmV0dXJuIHZhbHVlO1xufVxuZnVuY3Rpb24gY29tcG9uZW50X3N1YnNjcmliZShjb21wb25lbnQsIHN0b3JlLCBjYWxsYmFjaykge1xuICAgIGNvbXBvbmVudC4kJC5vbl9kZXN0cm95LnB1c2goc3Vic2NyaWJlKHN0b3JlLCBjYWxsYmFjaykpO1xufVxuZnVuY3Rpb24gY3JlYXRlX3Nsb3QoZGVmaW5pdGlvbiwgY3R4LCBmbikge1xuICAgIGlmIChkZWZpbml0aW9uKSB7XG4gICAgICAgIGNvbnN0IHNsb3RfY3R4ID0gZ2V0X3Nsb3RfY29udGV4dChkZWZpbml0aW9uLCBjdHgsIGZuKTtcbiAgICAgICAgcmV0dXJuIGRlZmluaXRpb25bMF0oc2xvdF9jdHgpO1xuICAgIH1cbn1cbmZ1bmN0aW9uIGdldF9zbG90X2NvbnRleHQoZGVmaW5pdGlvbiwgY3R4LCBmbikge1xuICAgIHJldHVybiBkZWZpbml0aW9uWzFdXG4gICAgICAgID8gYXNzaWduKHt9LCBhc3NpZ24oY3R4LiQkc2NvcGUuY3R4LCBkZWZpbml0aW9uWzFdKGZuID8gZm4oY3R4KSA6IHt9KSkpXG4gICAgICAgIDogY3R4LiQkc2NvcGUuY3R4O1xufVxuZnVuY3Rpb24gZ2V0X3Nsb3RfY2hhbmdlcyhkZWZpbml0aW9uLCBjdHgsIGNoYW5nZWQsIGZuKSB7XG4gICAgcmV0dXJuIGRlZmluaXRpb25bMV1cbiAgICAgICAgPyBhc3NpZ24oe30sIGFzc2lnbihjdHguJCRzY29wZS5jaGFuZ2VkIHx8IHt9LCBkZWZpbml0aW9uWzFdKGZuID8gZm4oY2hhbmdlZCkgOiB7fSkpKVxuICAgICAgICA6IGN0eC4kJHNjb3BlLmNoYW5nZWQgfHwge307XG59XG5mdW5jdGlvbiBleGNsdWRlX2ludGVybmFsX3Byb3BzKHByb3BzKSB7XG4gICAgY29uc3QgcmVzdWx0ID0ge307XG4gICAgZm9yIChjb25zdCBrIGluIHByb3BzKVxuICAgICAgICBpZiAoa1swXSAhPT0gJyQnKVxuICAgICAgICAgICAgcmVzdWx0W2tdID0gcHJvcHNba107XG4gICAgcmV0dXJuIHJlc3VsdDtcbn1cbmZ1bmN0aW9uIG9uY2UoZm4pIHtcbiAgICBsZXQgcmFuID0gZmFsc2U7XG4gICAgcmV0dXJuIGZ1bmN0aW9uICguLi5hcmdzKSB7XG4gICAgICAgIGlmIChyYW4pXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIHJhbiA9IHRydWU7XG4gICAgICAgIGZuLmNhbGwodGhpcywgLi4uYXJncyk7XG4gICAgfTtcbn1cbmZ1bmN0aW9uIG51bGxfdG9fZW1wdHkodmFsdWUpIHtcbiAgICByZXR1cm4gdmFsdWUgPT0gbnVsbCA/ICcnIDogdmFsdWU7XG59XG5mdW5jdGlvbiBzZXRfc3RvcmVfdmFsdWUoc3RvcmUsIHJldCwgdmFsdWUgPSByZXQpIHtcbiAgICBzdG9yZS5zZXQodmFsdWUpO1xuICAgIHJldHVybiByZXQ7XG59XG5cbmNvbnN0IGlzX2NsaWVudCA9IHR5cGVvZiB3aW5kb3cgIT09ICd1bmRlZmluZWQnO1xubGV0IG5vdyA9IGlzX2NsaWVudFxuICAgID8gKCkgPT4gd2luZG93LnBlcmZvcm1