| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -16,7 +16,6 @@ export default function visitEachBlock ( generator, block, state, node ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						const { snippet } = block.contextualise( node.expression );
 | 
					 | 
					 | 
					 | 
						const { snippet } = block.contextualise( node.expression );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						block.builders.create.addLine( `var ${each_block_value} = ${snippet};` );
 | 
					 | 
					 | 
					 | 
						block.builders.create.addLine( `var ${each_block_value} = ${snippet};` );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						block.builders.create.addLine( `var ${iterations} = [];` );
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if ( node.key ) {
 | 
					 | 
					 | 
					 | 
						if ( node.key ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							keyed( generator, block, state, node, snippet, vars );
 | 
					 | 
					 | 
					 | 
							keyed( generator, block, state, node, snippet, vars );
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -26,23 +25,12 @@ export default function visitEachBlock ( generator, block, state, node ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						const isToplevel = !state.parentNode;
 | 
					 | 
					 | 
					 | 
						const isToplevel = !state.parentNode;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if ( isToplevel ) {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							block.builders.mount.addBlock( deindent`
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								for ( var ${i} = 0; ${i} < ${iterations}.length; ${i} += 1 ) {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									${iterations}[${i}].${mountOrIntro}( ${block.target}, null );
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								}
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							` );
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						}
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if ( node.needsAnchor ) {
 | 
					 | 
					 | 
					 | 
						if ( node.needsAnchor ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							block.addElement( anchor, `${generator.helper( 'createComment' )}()`, state.parentNode, true );
 | 
					 | 
					 | 
					 | 
							block.addElement( anchor, `${generator.helper( 'createComment' )}()`, state.parentNode, true );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} else if ( node.next ) {
 | 
					 | 
					 | 
					 | 
						} else if ( node.next ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							node.next.usedAsAnchor = true;
 | 
					 | 
					 | 
					 | 
							node.next.usedAsAnchor = true;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						}
 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						block.builders.destroy.addBlock(
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							`${generator.helper( 'destroyEach' )}( ${iterations}, ${isToplevel ? 'detach' : 'false'}, 0 );` );
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if ( node.else ) {
 | 
					 | 
					 | 
					 | 
						if ( node.else ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							const each_block_else = generator.getUniqueName( `${each_block}_else` );
 | 
					 | 
					 | 
					 | 
							const each_block_else = generator.getUniqueName( `${each_block}_else` );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -109,104 +97,205 @@ export default function visitEachBlock ( generator, block, state, node ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						}
 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					function keyed ( generator, block, state, node, snippet, { each_block, create_each_block, each_block_value, iterations, i, params, anchor, mountOrIntro } ) {
 | 
					 | 
					 | 
					 | 
					function keyed ( generator, block, state, node, snippet, { each_block, create_each_block, each_block_value, i, params, anchor, mountOrIntro } ) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						const fragment = block.getUniqueName( 'fragment' );
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						const value = block.getUniqueName( 'value' );
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						const key = block.getUniqueName( 'key' );
 | 
					 | 
					 | 
					 | 
						const key = block.getUniqueName( 'key' );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						const lookup = block.getUniqueName( `${each_block}_lookup` );
 | 
					 | 
					 | 
					 | 
						const lookup = block.getUniqueName( `${each_block}_lookup` );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						const keys = block.getUniqueName( `${each_block}_keys` );
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						const iteration = block.getUniqueName( `${each_block}_iteration` );
 | 
					 | 
					 | 
					 | 
						const iteration = block.getUniqueName( `${each_block}_iteration` );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						const _iterations = block.getUniqueName( `_${each_block}_iterations` );
 | 
					 | 
					 | 
					 | 
						const head = block.getUniqueName( `${each_block}_head` );
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						const last = block.getUniqueName( `${each_block}_last` );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						const expected = block.getUniqueName( `${each_block}_expected` );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						if ( node.children[0] && node.children[0].type === 'Element' ) { // TODO or text/tag/raw
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							node._block.first = node.children[0]._state.parentNode; // TODO this is highly confusing
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						} else {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							node._block.first = node._block.getUniqueName( 'first' );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							node._block.addElement( node._block.first, `${generator.helper( 'createComment' )}()`, null, true );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						block.builders.create.addBlock( deindent`
 | 
					 | 
					 | 
					 | 
						block.builders.create.addBlock( deindent`
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							var ${lookup} = Object.create( null );
 | 
					 | 
					 | 
					 | 
							var ${lookup} = Object.create( null );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							var ${head};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							var ${last};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							for ( var ${i} = 0; ${i} < ${each_block_value}.length; ${i} += 1 ) {
 | 
					 | 
					 | 
					 | 
							for ( var ${i} = 0; ${i} < ${each_block_value}.length; ${i} += 1 ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								var ${key} = ${each_block_value}[${i}].${node.key};
 | 
					 | 
					 | 
					 | 
								var ${key} = ${each_block_value}[${i}].${node.key};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								${iterations}[${i}] = ${lookup}[ ${key} ] = ${create_each_block}( ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i}, ${block.component}, ${key} );
 | 
					 | 
					 | 
					 | 
								var ${iteration} = ${lookup}[${key}] = ${create_each_block}( ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i}, ${block.component}, ${key} );
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								${state.parentNode && `${iterations}[${i}].${mountOrIntro}( ${state.parentNode}, null );`}
 | 
					 | 
					 | 
					 | 
								${state.parentNode && `${iteration}.${mountOrIntro}( ${state.parentNode}, null );`}
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								if ( ${last} ) ${last}.next = ${iteration};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								${iteration}.last = ${last};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								${last} = ${iteration};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								if ( ${i} === 0 ) ${head} = ${iteration};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						` );
 | 
					 | 
					 | 
					 | 
						` );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						const consequent = node._block.hasUpdateMethod ?
 | 
					 | 
					 | 
					 | 
						if ( !state.parentNode ) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							deindent`
 | 
					 | 
					 | 
					 | 
							block.builders.mount.addBlock( deindent`
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								${_iterations}[${i}] = ${lookup}[ ${key} ] = ${lookup}[ ${key} ];
 | 
					 | 
					 | 
					 | 
								var ${iteration} = ${head};
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								${lookup}[ ${key} ].update( changed, ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i} );
 | 
					 | 
					 | 
					 | 
								while ( ${iteration} ) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							` :
 | 
					 | 
					 | 
					 | 
									${iteration}.${mountOrIntro}( ${block.target}, null );
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							`${_iterations}[${i}] = ${lookup}[ ${key} ] = ${lookup}[ ${key} ];`;
 | 
					 | 
					 | 
					 | 
									${iteration} = ${iteration}.next;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							` );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						const dynamic = node._block.hasUpdateMethod;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						const parentNode = state.parentNode || `${anchor}.parentNode`;
 | 
					 | 
					 | 
					 | 
						const parentNode = state.parentNode || `${anchor}.parentNode`;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						const hasIntros = node._block.hasIntroMethod;
 | 
					 | 
					 | 
					 | 
						let destroy;
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
						if ( node._block.hasOutroMethod ) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						const destroy = node._block.hasOutroMethod ?
 | 
					 | 
					 | 
					 | 
							const fn = block.getUniqueName( `${each_block}_outro` );
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							deindent`
 | 
					 | 
					 | 
					 | 
							block.builders.create.addBlock( deindent`
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								function outro ( key ) {
 | 
					 | 
					 | 
					 | 
								function ${fn} ( iteration ) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									${lookup}[ key ].outro( function () {
 | 
					 | 
					 | 
					 | 
									iteration.outro( function () {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										${lookup}[ key ].destroy( true );
 | 
					 | 
					 | 
					 | 
										iteration.destroy( true );
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										${lookup}[ key ] = null;
 | 
					 | 
					 | 
					 | 
										if ( iteration.next ) iteration.next.last = iteration.last;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										if ( iteration.last ) iteration.last.next = iteration.next;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										${lookup}[iteration.key] = null;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									});
 | 
					 | 
					 | 
					 | 
									});
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								}
 | 
					 | 
					 | 
					 | 
								}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							` );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								for ( var ${i} = 0; ${i} < ${iterations}.length; ${i} += 1 ) {
 | 
					 | 
					 | 
					 | 
							destroy = deindent`
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									${key} = ${iterations}[${i}].key;
 | 
					 | 
					 | 
					 | 
								while ( ${expected} ) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									if ( !${keys}[ ${key} ] ) outro( ${key} );
 | 
					 | 
					 | 
					 | 
									${fn}( ${expected} );
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									${expected} = ${expected}.next;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								}
 | 
					 | 
					 | 
					 | 
								}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							` :
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							deindent`
 | 
					 | 
					 | 
					 | 
								for ( ${i} = 0; ${i} < discard_pile.length; ${i} += 1 ) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								for ( var ${i} = 0; ${i} < ${iterations}.length; ${i} += 1 ) {
 | 
					 | 
					 | 
					 | 
									if ( discard_pile[${i}].discard ) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									var ${iteration} = ${iterations}[${i}];
 | 
					 | 
					 | 
					 | 
										${fn}( discard_pile[${i}] );
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									if ( !${keys}[ ${iteration}.key ] ) ${iteration}.destroy( true );
 | 
					 | 
					 | 
					 | 
									}
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							`;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						} else {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							const fn = block.getUniqueName( `${each_block}_destroy` );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							block.builders.create.addBlock( deindent`
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								function ${fn} ( iteration ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									iteration.destroy( true );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									if ( iteration.next && iteration.next.last === iteration ) iteration.next.last = iteration.last;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									if ( iteration.last && iteration.last.next === iteration ) iteration.last.next = iteration.next;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									${lookup}[iteration.key] = null;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							` );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							destroy = deindent`
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								while ( ${expected} ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									${fn}( ${expected} );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									${expected} = ${expected}.next;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								for ( ${i} = 0; ${i} < discard_pile.length; ${i} += 1 ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									var ${iteration} = discard_pile[${i}];
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									if ( ${iteration}.discard ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										${fn}( ${iteration} );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								}
 | 
					 | 
					 | 
					 | 
								}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							`;
 | 
					 | 
					 | 
					 | 
							`;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						block.builders.update.addBlock( deindent`
 | 
					 | 
					 | 
					 | 
						block.builders.update.addBlock( deindent`
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							var ${each_block_value} = ${snippet};
 | 
					 | 
					 | 
					 | 
							var ${each_block_value} = ${snippet};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							var ${_iterations} = [];
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							var ${keys} = Object.create( null );
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							var ${fragment} = document.createDocumentFragment();
 | 
					 | 
					 | 
					 | 
							var ${expected} = ${head};
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							var ${last};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							// create new iterations as necessary
 | 
					 | 
					 | 
					 | 
							var discard_pile = [];
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							for ( var ${i} = 0; ${i} < ${each_block_value}.length; ${i} += 1 ) {
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								var ${value} = ${each_block_value}[${i}];
 | 
					 | 
					 | 
					 | 
							for ( ${i} = 0; ${i} < ${each_block_value}.length; ${i} += 1 ) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								var ${key} = ${value}.${node.key};
 | 
					 | 
					 | 
					 | 
								var ${key} = ${each_block_value}[${i}].${node.key};
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								${keys}[ ${key} ] = true;
 | 
					 | 
					 | 
					 | 
								var ${iteration} = ${lookup}[${key}];
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								${dynamic && `if ( ${iteration} ) ${iteration}.update( changed, ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i} );`}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if ( ${lookup}[ ${key} ] ) {
 | 
					 | 
					 | 
					 | 
								if ( ${expected} ) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									${consequent}
 | 
					 | 
					 | 
					 | 
									if ( ${key} === ${expected}.key ) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									${hasIntros && `${_iterations}[${i}].mount( ${fragment}, null );`}
 | 
					 | 
					 | 
					 | 
										${expected} = ${expected}.next;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									} else {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										if ( ${iteration} ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											// probably a deletion
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											do {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
												${expected}.discard = true;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
												discard_pile.push( ${expected} );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
												${expected} = ${expected}.next;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											} while ( ${expected} && ${expected}.key !== ${key} );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											${expected} = ${expected} && ${expected}.next;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											${iteration}.discard = false;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											${iteration}.last = ${last};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											${iteration}.next = ${expected};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											${iteration}.mount( ${parentNode}, ${expected} ? ${expected}.first : ${anchor} );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										} else {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											// key is being inserted
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											${iteration} = ${lookup}[${key}] = ${create_each_block}( ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i}, ${block.component}, ${key} );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											${iteration}.${mountOrIntro}( ${parentNode}, ${expected}.first );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											if ( ${expected} ) ${expected}.last = ${iteration};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											${iteration}.next = ${expected};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								} else {
 | 
					 | 
					 | 
					 | 
								} else {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									${_iterations}[${i}] = ${lookup}[ ${key} ] = ${create_each_block}( ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i}, ${block.component}, ${key} );
 | 
					 | 
					 | 
					 | 
									// we're appending from this point forward
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									${hasIntros && `${_iterations}[${i}].intro( ${fragment}, null );`}
 | 
					 | 
					 | 
					 | 
									if ( ${iteration} ) {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										${iteration}.discard = false;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										${iteration}.next = null;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										${iteration}.mount( ${parentNode}, ${anchor} );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									} else {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										${iteration} = ${lookup}[${key}] = ${create_each_block}( ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i}, ${block.component}, ${key} );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										${iteration}.${mountOrIntro}( ${parentNode}, ${anchor} );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								}
 | 
					 | 
					 | 
					 | 
								}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								${!hasIntros && `${_iterations}[${i}].mount( ${fragment}, null );`}
 | 
					 | 
					 | 
					 | 
								if ( ${last} ) ${last}.next = ${iteration};
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								${iteration}.last = ${last};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								${node._block.hasIntroMethod && `${iteration}.intro( ${parentNode}, ${anchor} );`}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								${last} = ${iteration};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							// remove old iterations
 | 
					 | 
					 | 
					 | 
							if ( ${last} ) ${last}.next = null;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							${destroy}
 | 
					 | 
					 | 
					 | 
							${destroy}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							${parentNode}.insertBefore( ${fragment}, ${anchor} );
 | 
					 | 
					 | 
					 | 
							${head} = ${lookup}[${each_block_value}[0] && ${each_block_value}[0].${node.key}];
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						` );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							${iterations} = ${_iterations};
 | 
					 | 
					 | 
					 | 
						block.builders.destroy.addBlock( deindent`
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							var ${iteration} = ${head};
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							while ( ${iteration} ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								${iteration}.destroy( ${state.parentNode ? 'false' : 'detach'} );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								${iteration} = ${iteration}.next;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						` );
 | 
					 | 
					 | 
					 | 
						` );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					function unkeyed ( generator, block, state, node, snippet, { create_each_block, each_block_value, iterations, i, params, anchor, mountOrIntro } ) {
 | 
					 | 
					 | 
					 | 
					function unkeyed ( generator, block, state, node, snippet, { create_each_block, each_block_value, iterations, i, params, anchor, mountOrIntro } ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						block.builders.create.addBlock( deindent`
 | 
					 | 
					 | 
					 | 
						block.builders.create.addBlock( deindent`
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							var ${iterations} = [];
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							for ( var ${i} = 0; ${i} < ${each_block_value}.length; ${i} += 1 ) {
 | 
					 | 
					 | 
					 | 
							for ( var ${i} = 0; ${i} < ${each_block_value}.length; ${i} += 1 ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								${iterations}[${i}] = ${create_each_block}( ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i}, ${block.component} );
 | 
					 | 
					 | 
					 | 
								${iterations}[${i}] = ${create_each_block}( ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i}, ${block.component} );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								${state.parentNode && `${iterations}[${i}].${mountOrIntro}( ${state.parentNode}, null );`}
 | 
					 | 
					 | 
					 | 
								${state.parentNode && `${iterations}[${i}].${mountOrIntro}( ${state.parentNode}, null );`}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						` );
 | 
					 | 
					 | 
					 | 
						` );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						if ( !state.parentNode ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							block.builders.mount.addBlock( deindent`
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								for ( var ${i} = 0; ${i} < ${iterations}.length; ${i} += 1 ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									${iterations}[${i}].${mountOrIntro}( ${block.target}, null );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							` );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						const dependencies = block.findDependencies( node.expression );
 | 
					 | 
					 | 
					 | 
						const dependencies = block.findDependencies( node.expression );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						const allDependencies = new Set( node._block.dependencies );
 | 
					 | 
					 | 
					 | 
						const allDependencies = new Set( node._block.dependencies );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						dependencies.forEach( dependency => {
 | 
					 | 
					 | 
					 | 
						dependencies.forEach( dependency => {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							allDependencies.add( dependency );
 | 
					 | 
					 | 
					 | 
							allDependencies.add( dependency );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						});
 | 
					 | 
					 | 
					 | 
						});
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						// TODO do this for keyed blocks as well
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						const condition = Array.from( allDependencies )
 | 
					 | 
					 | 
					 | 
						const condition = Array.from( allDependencies )
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							.map( dependency => `'${dependency}' in changed` )
 | 
					 | 
					 | 
					 | 
							.map( dependency => `'${dependency}' in changed` )
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							.join( ' || ' );
 | 
					 | 
					 | 
					 | 
							.join( ' || ' );
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -215,14 +304,23 @@ function unkeyed ( generator, block, state, node, snippet, { create_each_block,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if ( condition !== '' ) {
 | 
					 | 
					 | 
					 | 
						if ( condition !== '' ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							const forLoopBody = node._block.hasUpdateMethod ?
 | 
					 | 
					 | 
					 | 
							const forLoopBody = node._block.hasUpdateMethod ?
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								deindent`
 | 
					 | 
					 | 
					 | 
								node._block.hasIntroMethod ?
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									if ( ${iterations}[${i}] ) {
 | 
					 | 
					 | 
					 | 
									deindent`
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										${iterations}[${i}].update( changed, ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i} );
 | 
					 | 
					 | 
					 | 
										if ( ${iterations}[${i}] ) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									} else {
 | 
					 | 
					 | 
					 | 
											${iterations}[${i}].update( changed, ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i} );
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										${iterations}[${i}] = ${create_each_block}( ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i}, ${block.component} );
 | 
					 | 
					 | 
					 | 
										} else {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										${iterations}[${i}].${mountOrIntro}( ${parentNode}, ${anchor} );
 | 
					 | 
					 | 
					 | 
											${iterations}[${i}] = ${create_each_block}( ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i}, ${block.component} );
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									}
 | 
					 | 
					 | 
					 | 
										}
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								` :
 | 
					 | 
					 | 
					 | 
										${iterations}[${i}].intro( ${parentNode}, ${anchor} );
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									` :
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									deindent`
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										if ( ${iterations}[${i}] ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											${iterations}[${i}].update( changed, ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i} );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										} else {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											${iterations}[${i}] = ${create_each_block}( ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i}, ${block.component} );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
											${iterations}[${i}].mount( ${parentNode}, ${anchor} );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
										}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									` :
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								deindent`
 | 
					 | 
					 | 
					 | 
								deindent`
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									${iterations}[${i}] = ${create_each_block}( ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i}, ${block.component} );
 | 
					 | 
					 | 
					 | 
									${iterations}[${i}] = ${create_each_block}( ${params}, ${each_block_value}, ${each_block_value}[${i}], ${i}, ${block.component} );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									${iterations}[${i}].${mountOrIntro}( ${parentNode}, ${anchor} );
 | 
					 | 
					 | 
					 | 
									${iterations}[${i}].${mountOrIntro}( ${parentNode}, ${anchor} );
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -230,9 +328,10 @@ function unkeyed ( generator, block, state, node, snippet, { create_each_block,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							const start = node._block.hasUpdateMethod ? '0' : `${iterations}.length`;
 | 
					 | 
					 | 
					 | 
							const start = node._block.hasUpdateMethod ? '0' : `${iterations}.length`;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							const outro = block.getUniqueName( 'outro' );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							const destroy = node._block.hasOutroMethod ?
 | 
					 | 
					 | 
					 | 
							const destroy = node._block.hasOutroMethod ?
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								deindent`
 | 
					 | 
					 | 
					 | 
								deindent`
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									function outro ( i ) {
 | 
					 | 
					 | 
					 | 
									function ${outro} ( i ) {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										if ( ${iterations}[i] ) {
 | 
					 | 
					 | 
					 | 
										if ( ${iterations}[i] ) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
											${iterations}[i].outro( function () {
 | 
					 | 
					 | 
					 | 
											${iterations}[i].outro( function () {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
												${iterations}[i].destroy( true );
 | 
					 | 
					 | 
					 | 
												${iterations}[i].destroy( true );
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -241,7 +340,7 @@ function unkeyed ( generator, block, state, node, snippet, { create_each_block,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										}
 | 
					 | 
					 | 
					 | 
										}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									}
 | 
					 | 
					 | 
					 | 
									}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									for ( ; ${i} < ${iterations}.length; ${i} += 1 ) outro( ${i} );
 | 
					 | 
					 | 
					 | 
									for ( ; ${i} < ${iterations}.length; ${i} += 1 ) ${outro}( ${i} );
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								` :
 | 
					 | 
					 | 
					 | 
								` :
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								deindent`
 | 
					 | 
					 | 
					 | 
								deindent`
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									${generator.helper( 'destroyEach' )}( ${iterations}, true, ${each_block_value}.length );
 | 
					 | 
					 | 
					 | 
									${generator.helper( 'destroyEach' )}( ${iterations}, true, ${each_block_value}.length );
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -260,4 +359,8 @@ function unkeyed ( generator, block, state, node, snippet, { create_each_block,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								}
 | 
					 | 
					 | 
					 | 
								}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							` );
 | 
					 | 
					 | 
					 | 
							` );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						}
 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						block.builders.destroy.addBlock(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							`${generator.helper( 'destroyEach' )}( ${iterations}, ${state.parentNode ? 'false' : 'detach'}, 0 );`
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 |