"format register";System.register("angular2/src/upgrade/metadata",["angular2/core"],!0,function(t,e,r){function n(t){var e=c.resolve(t),r=e.selector;if(!r.match(p))throw new Error("Only selectors matching element names are supported, got: "+r);var r=r.replace(u,function(t,e){return e.toUpperCase()});return{type:t,selector:r,inputs:o(e.inputs),outputs:o(e.outputs)}}function o(t){var e=[];if(t)for(var r=0;rr;r++)e.insertBefore(t[r],this.contentInsertionPoint)},t.prototype.setupOutputs=function(){for(var t=this,e=this.attrs,r=this.info.outputs,n=0;n1)throw new Error("Only support single directive definition for: "+this.name);var r=e[0];r.replace&&this.notSupported("replace"),r.terminal&&this.notSupported("terminal");var n=r.link;return"object"==typeof n&&n.post&&this.notSupported("link.post"),r},t.prototype.notSupported=function(t){throw new Error("Upgraded directive '"+this.name+"' does not support '"+t+"'.")},t.prototype.extractBindings=function(){var t="object"==typeof this.directive.bindToController;if(t&&Object.keys(this.directive.scope).length)throw new Error("Binding definitions on scope and controller at the same time are not supported.");var e=t?this.directive.bindToController:this.directive.scope;if("object"==typeof e)for(var r in e)if(e.hasOwnProperty(r)){var n=e[r],o=n.charAt(0);n=n.substr(1)||r;var i="output_"+r,a=i+": "+r,s=i+": "+r+"Change",p="input_"+r,u=p+": "+r;switch(o){case"=":this.propertyOutputs.push(i),this.checkProperties.push(n),this.outputs.push(i),this.outputsRename.push(s),this.propertyMap[i]=n;case"@":this.inputs.push(p),this.inputsRename.push(u),this.propertyMap[p]=n;break;case"&":this.outputs.push(i),this.outputsRename.push(a),this.propertyMap[i]=n;break;default:var c=JSON.stringify(e);throw new Error("Unexpected mapping '"+o+"' in '"+c+"' in '"+this.name+"' directive.")}}},t.prototype.compileTemplate=function(t,e,r){function n(e){var r=document.createElement("div");return r.innerHTML=e,t(r.childNodes)}var o=this;if(void 0!==this.directive.template)this.linkFn=n(this.directive.template);else{if(!this.directive.templateUrl)throw new Error("Directive '"+this.name+"' is not a component, it is missing template.");var i=this.directive.templateUrl,a=e.get(i);if(void 0===a)return new Promise(function(t,a){r("GET",i,null,function(r,s){200==r?t(o.linkFn=n(e.put(i,s))):a("GET "+i+" returned "+r+": "+s)})});this.linkFn=n(a)}return null},t.resolve=function(t,e){var r=[],n=e.get(a.NG1_COMPILE),o=e.get(a.NG1_TEMPLATE_CACHE),i=e.get(a.NG1_HTTP_BACKEND),s=e.get(a.NG1_CONTROLLER);for(var p in t)if(t.hasOwnProperty(p)){var u=t[p];u.directive=u.extractDirective(e),u.$controller=s,u.extractBindings();var c=u.compileTemplate(n,o,i);c&&r.push(c)}return Promise.all(r)},t}();e.UpgradeNg1ComponentAdapterBuilder=h;var g=function(){function t(t,e,r,n,o,a,u,h,g,d){this.directive=r,this.inputs=a,this.outputs=u,this.propOuts=h,this.checkProperties=g,this.propertyMap=d,this.destinationObj=null,this.checkLastValues=[];for(var f,v=n.nativeElement,m=[];f=v.firstChild;)v.removeChild(f),m.push(f);var y=e.$new(!!r.scope),_=p.element(v),C=r.controller,w=null;if(C){var E={$scope:y,$element:_};w=o(C,E,null,r.controllerAs),_.data(s.controllerKey(r.name),w)}var N=r.link;if("object"==typeof N&&(N=N.pre),N){var O=l,b=l,P=this.resolveRequired(_,r.require);r.link(y,_,O,P,b)}this.destinationObj=r.bindToController&&w?w:y,t(y,function(t,e){for(var r=0,n=t.length;n>r;r++)v.appendChild(t[r])},{parentBoundTranscludeFn:function(t,e){e(m)}});for(var A=0;A