var _extends=Object.assign||function(n){for(var i,r,t=1;t<arguments.length;t++){i=arguments[t];for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},ProgressMetadata=React.createClass({displayName:"ProgressMetadata",render:function(){var n=[];return jQuery.each(this.props,function(t,i){n.push(React.createElement("li",{key:t},React.createElement("span",null,i.Field),": ",React.createElement("span",null,i.Value)))}),React.createElement("ul",{className:"progressMetadata",style:{display:"block",margin:"7px 0 0 10px",padding:0,listStyleType:"none",fontSize:"13px"}},n)}}),ProgressStage=React.createClass({displayName:"ProgressStage",render:function(){return React.createElement("tr",{className:"progressStage"},React.createElement("td",null,React.createElement("span",{style:{display:"block"}},this.props.Description),this.props.Metadata?React.createElement(ProgressMetadata,this.props.Metadata):null),React.createElement("td",{style:{width:"125px",verticalAlign:"top"}},this.props.FormattedUpdateDate,this.props.IsAfterMidnight?React.createElement("span",null,React.createElement("br",null),"(After Midnight)"):null))}}),ChamberProgress=React.createClass({displayName:"ChamberProgress",render:function(){var n=[];return jQuery.each(this.props.ProgressStates,function(t,i){n.push(React.createElement(ProgressStage,_extends({key:t},i)))}),React.createElement("table",{className:"chamberProgress",style:{width:"100%",marginBottom:0,borderBottom:"none"}},React.createElement("thead",null,React.createElement("tr",null,React.createElement("th",{colSpan:"2"},this.props.FormattedChamber))),React.createElement("tbody",null,n))}}),BillProgress=React.createClass({displayName:"BillProgress",render:function(){var n=[];return jQuery.each(this.props,function(t,i){n.push(React.createElement(ChamberProgress,_extends({key:t},i)))}),React.createElement("div",{className:"billProgress"},n)}}),BillSummary=React.createClass({displayName:"BillSummary",render:function(){return React.createElement("div",{className:"billSummary bill-metadata-summary",style:{paddingBottom:"20px"}},React.createElement("div",{className:"border-top"}),React.createElement("h3",null,"Summary"),React.createElement("div",{className:"text-small item-summary",dangerouslySetInnerHTML:{__html:this.props.content}}))}}),BillSponsors=React.createClass({displayName:"BillSponsors",render:function(){var n=[];return jQuery.each(this.props.sponsors,function(t,i){n.push(React.createElement("a",{key:t,href:"http://www.aph.gov.au/Senators_and_Members/Parliamentarian?MPID="+i.Id,target:"_blank"},i.Name,"  ",React.createElement("i",{className:"fa fa-external-link"}),React.createElement("br",null)))}),React.createElement("div",{className:"billSponsors"},this.props.label?React.createElement("h4",null,this.props.label):null,React.createElement("p",null,n))}}),BilSpeechTranscripts=React.createClass({displayName:"BilSpeechTranscripts",render:function(){var n=[];return this.props.hasSecondReadingSpeeches&&n.push(React.createElement("li",{key:-1},React.createElement("a",{href:"/bills/secondreadings/"+Core.Globals.RouteDictionary.Id},"All second reading speeches ",React.createElement("i",{className:"fa fa-fw fa-external-link"})))),jQuery.each(this.props.transcripts,function(t,i){n.push(React.createElement("li",{key:t},React.createElement("a",{href:i.Href,target:"_blank"},i.Label," ",React.createElement("i",{className:"fa fa-fw fa-external-link"}))))}),React.createElement("div",{className:"bilSpeechTranscripts"},React.createElement("h4",null,"Transcript of speeches"),React.createElement("ul",{className:"speech-transcripts"},n))}}),BilProposedAmendments=React.createClass({displayName:"BilProposedAmendments",render:function(){var n=[];return jQuery.each(this.props.proposedAmendments,function(t,i){n.push(React.createElement("div",{key:t,className:"documentListItem row"},React.createElement("div",{className:"medium-8 column"},React.createElement("p",null,i.DisplayName," ",i.SheetNumber?React.createElement("span",null,"[",i.SheetNumber,"]"):null),i.Sponsors.length>0?React.createElement(BillSponsors,{sponsors:i.Sponsors}):null),React.createElement(DropDownDocumentLink,{linkItem:i,label:"Download",dropdownId:"dd_"+Core.CreateGuid()})))}),React.createElement("div",{className:"bilProposedAmendments"},React.createElement("h5",null,this.props.label),n)}}),BillNotes=React.createClass({displayName:"BillNotes",render:function(){var n=[];return jQuery.each(this.props,function(t,i){n.push(React.createElement("li",{key:t,className:"notes",dangerouslySetInnerHTML:{__html:i.Content}}))}),React.createElement("div",{className:"billNotes panel margin-top text-small radius"},React.createElement("h5",null,"Notes"),React.createElement("ul",null,n))}}),BillProperty=React.createClass({displayName:"BillProperty",render:function(){return React.createElement("div",{className:"billProperty itemProperty"},React.createElement("h4",null,this.props.label),React.createElement("p",null,this.props.value))}}),PreviousCitations=React.createClass({displayName:"PreviousCitations",render:function(){var n=[];return jQuery.each(this.props,function(t,i){n.push(React.createElement("li",{key:t,className:"citation"},i))}),React.createElement("div",{className:"previousCitations panel"},React.createElement("h5",null,"Previous Citations"),React.createElement("ul",null,n))}}),BillProperties=React.createClass({displayName:"BillProperties",render:function(){var n=this.props.Sponsors.length>0;return React.createElement("div",{className:"billProperties"},React.createElement("div",{className:"row"},React.createElement("div",{className:"columns large-9 medium-9"},React.createElement("h1",{dangerouslySetInnerHTML:{__html:this.props.Title}}),this.props.PreviousCitations.length>0?React.createElement(PreviousCitations,this.props.PreviousCitations):null),React.createElement("div",{className:"columns large-3 medium-3"},React.createElement(ContextButtons,{id:this.props.ObjectId,type:this.props.ObjectType,isBookmarked:this.props.IsBookmarked}))),React.createElement("div",{className:"border-top"}),React.createElement("div",{className:"row text-small bill-metadata"},React.createElement("div",{className:n?"medium-4 large-3 columns":"medium-6 columns"},React.createElement(BillProperty,{label:"Last Updated",value:moment(this.props.LastUpdatedDateTime).format("DD/MM/YYYY")}),React.createElement(BillProperty,{label:"Type",value:this.props.Type}),this.props.Portfolio?React.createElement(BillProperty,{label:"Portfolio",value:this.props.Portfolio}):null),React.createElement("div",{className:n?"medium-4 large-3 columns":"medium-6 columns"},React.createElement(BillProperty,{label:"Originating house",value:this.props.FormattedOriginatingChamber}),React.createElement(BillProperty,{label:"Status",value:this.props.Status}),React.createElement(BillProperty,{label:"Parliament no",value:this.props.ParliamentNumber})),n?React.createElement("div",{className:"medium-4 large-6 columns"},this.props.Sponsors.length>0?React.createElement(ParliamentariansCardList,{parliamentarians:this.props.Sponsors,label:"Introduced By"}):null):null))}}),BillDetails=React.createClass({displayName:"BillDetails",render:function(){var n=null;return this.props.ProposedAmendmentsByHouse.length==0&&this.props.ProposedAmendmentsBySenate.length==0&&(n=React.createElement("p",null,"No proposed amendments have been circulated.")),React.createElement("div",{className:"billDetails"},React.createElement(BillProperties,this.props),this.props.Summary?React.createElement(BillSummary,{content:this.props.Summary}):null,this.props.BillsDigest?React.createElement(BillsDigest,this.props.BillsDigest):null,React.createElement("div",{className:"border-top"}),React.createElement("div",{className:"row bill-details"},React.createElement("div",{className:"medium-6 columns"},React.createElement("h3",null,"Progress of bill"),React.createElement(BillProgress,this.props.GroupedProgressStates)),React.createElement("div",{className:"medium-6 columns"},React.createElement("h3",null,"Documents and transcripts"),React.createElement(DocumentList,{title:"<h4>Text of bill<\/h4>",linkItems:this.props.TextOfBillReadings}),React.createElement("h4",null,"Explanatory memoranda"),this.props.ExplanatoryMemoranda.length>0?React.createElement(DocumentList,{linkItems:this.props.ExplanatoryMemoranda}):React.createElement("p",null,"No documents at present"),this.props.SpeechTranscripts.length>0?React.createElement(BilSpeechTranscripts,{transcripts:this.props.SpeechTranscripts,hasSecondReadingSpeeches:this.props.HasSecondReadingSpeech}):null,React.createElement("h4",null,"Proposed amendments"),this.props.ProposedAmendmentsByHouse.length>0?React.createElement(BilProposedAmendments,{proposedAmendments:this.props.ProposedAmendmentsByHouse,label:"House of representatives"}):null,this.props.ProposedAmendmentsBySenate.length>0?React.createElement(BilProposedAmendments,{proposedAmendments:this.props.ProposedAmendmentsBySenate,label:"Senate"}):null,n,React.createElement("h4",null,"Schedule of amendments"),this.props.ScheduleOfAmendments.length>0?React.createElement(DocumentList,{linkItems:this.props.ScheduleOfAmendments}):React.createElement("p",null,"No documents at present"),this.props.Notes.length>0?React.createElement(BillNotes,this.props.Notes):null)))}}),BillsPage=React.createClass({displayName:"BillsPage",getInitialState:function(){return{bill:null,isLoaded:!1,statusReason:null}},componentDidMount:function(){$.get(this.props.source,function(n){this.isMounted()&&(n.IsSuccess?this.state.bill=n.Bill:this.state.statusReason=n.Reason,this.state.isLoaded=!0,this.setState(this.state))}.bind(this))},componentDidUpdate:function(){$(document).foundation("reflow")},render:function(){return this.state.isLoaded?React.createElement("div",{className:"billsPage itemDetailPage row"},React.createElement("div",{className:"columns medium-12"},this.state.bill?React.createElement(BillDetails,this.state.bill):React.createElement(EmptySearch,{message:this.state.statusReason}))):React.createElement("div",{className:"billsPage itemDetailPage row"},React.createElement("div",{className:"columns medium-12"},React.createElement(LoadingMessage,{message:"Loading bill. Please wait..."})))}});ReactDOM.render(React.createElement(BillsPage,{source:"/api/bills/"+Core.Globals.RouteDictionary.Id}),document.getElementById("contentWrapper"))