jQuery.template("Tmpl-user-resources-datasets",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="list">  '),typeof(resources.length>0)!="undefined"&&resources.length>0!=null&&(typeof(resources.length>0)=="function"?(resources.length>0).call($item):resources.length>0)?(__.push("   "),typeof filteredResources!="undefined"&&filteredResources!=null&&$.each(typeof filteredResources=="function"?filteredResources.call($item):filteredResources,function(n,resource){with(this)__.push('    <a class="list-item" href="'),typeof resource.editUrl!="undefined"&&resource.editUrl!=null&&__.push($.encode(typeof resource.editUrl=="function"?resource.editUrl.call($item):resource.editUrl)),__.push('" target="_blank" data-resource-id="'),typeof resource.id!="undefined"&&resource.id!=null&&__.push($.encode(typeof resource.id=="function"?resource.id.call($item):resource.id)),__.push('">     <h5>'),typeof resource.title!="undefined"&&resource.title!=null&&__.push($.encode(typeof resource.title=="function"?resource.title.call($item):resource.title)),__.push("<\/h5>     "),typeof(resource.publicationDate||resource.source&&resource.source.name||resource.nextReleaseDate)!="undefined"&&(resource.publicationDate||resource.source&&resource.source.name||resource.nextReleaseDate)!=null&&(typeof(resource.publicationDate||resource.source&&resource.source.name||resource.nextReleaseDate)=="function"?(resource.publicationDate||resource.source&&resource.source.name||resource.nextReleaseDate).call($item):resource.publicationDate||resource.source&&resource.source.name||resource.nextReleaseDate)&&(__.push('      <div class="dataset-metadata">       '),typeof resource.publicationDate!="undefined"&&resource.publicationDate!=null&&(typeof resource.publicationDate=="function"?resource.publicationDate.call($item):resource.publicationDate)&&(__.push("        <div>"),typeof Knoema.Utils.toMonthAndYearString!="undefined"&&Knoema.Utils.toMonthAndYearString!=null&&__.push($.encode(Knoema.Utils.toMonthAndYearString(new Knoema.Utils.UTCDate(resource.publicationDate)))),__.push("<\/div>       ")),__.push("       "),typeof(resource.source&&resource.source.name)!="undefined"&&(resource.source&&resource.source.name)!=null&&(typeof(resource.source&&resource.source.name)=="function"?(resource.source&&resource.source.name).call($item):resource.source&&resource.source.name)&&(__.push('        <div><span class="dataset-label">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/datasets.htm","Source:"))),__.push('<\/span><span class="link source" data-href="'),typeof resource.source.url!="undefined"&&resource.source.url!=null&&__.push($.encode(typeof resource.source.url=="function"?resource.source.url.call($item):resource.source.url)),__.push('">'),typeof resource.source.name!="undefined"&&resource.source.name!=null&&__.push($.encode(typeof resource.source.name=="function"?resource.source.name.call($item):resource.source.name)),__.push("<\/span><\/div>       ")),__.push("       "),typeof resource.nextReleaseDate!="undefined"&&resource.nextReleaseDate!=null&&(typeof resource.nextReleaseDate=="function"?resource.nextReleaseDate.call($item):resource.nextReleaseDate)&&(__.push('        <div><span class="dataset-label">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/datasets.htm","Next update expected:"))),__.push("<\/span>"),typeof resource.nextReleaseDate.substr!="undefined"&&resource.nextReleaseDate.substr!=null&&__.push($.encode(resource.nextReleaseDate.substr(0,10))),__.push("<\/div>       ")),__.push("       "),typeof resource.dateRange!="undefined"&&resource.dateRange!=null&&(typeof resource.dateRange=="function"?resource.dateRange.call($item):resource.dateRange)&&(__.push('        <div><span class="dataset-label">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/datasets.htm","Date range:"))),__.push("<\/span>"),typeof resource.dateRange!="undefined"&&resource.dateRange!=null&&__.push($.encode(typeof resource.dateRange=="function"?resource.dateRange.call($item):resource.dateRange)),__.push("<\/div>       ")),__.push("      <\/div>     ")),__.push("     "),typeof resource.rawDescription!="undefined"&&resource.rawDescription!=null&&(typeof resource.rawDescription=="function"?resource.rawDescription.call($item):resource.rawDescription)&&(__.push('      <div class="description">'),typeof resource.rawDescription!="undefined"&&resource.rawDescription!=null&&__.push($.encode(typeof resource.rawDescription=="function"?resource.rawDescription.call($item):resource.rawDescription)),__.push("<\/div>     ")),__.push("    <\/a>   ")}),__.push("  ")):!0&&(__.push('   <div class="no-items-message">'),typeof noItemsMessage!="undefined"&&noItemsMessage!=null&&__.push($.encode(typeof noItemsMessage=="function"?noItemsMessage.call($item):noItemsMessage)),__.push("<\/div>  ")),__.push(" <\/div>");return __});jQuery.template("Tmpl-user-resources-visualizations",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="list">  '),typeof(resources.length>0)!="undefined"&&resources.length>0!=null&&(typeof(resources.length>0)=="function"?(resources.length>0).call($item):resources.length>0)?(__.push("   "),typeof filteredResources!="undefined"&&filteredResources!=null&&$.each(typeof filteredResources=="function"?filteredResources.call($item):filteredResources,function(n,resource){with(this)__.push('    <a class="list-item" href="'),typeof resource.editUrl!="undefined"&&resource.editUrl!=null&&__.push($.encode(typeof resource.editUrl=="function"?resource.editUrl.call($item):resource.editUrl)),__.push('" target="_blank" data-resource-id="'),typeof resource.id!="undefined"&&resource.id!=null&&__.push($.encode(typeof resource.id=="function"?resource.id.call($item):resource.id)),__.push('">     '),typeof isDeleteAvailable!="undefined"&&isDeleteAvailable!=null&&(typeof isDeleteAvailable=="function"?isDeleteAvailable.call($item):isDeleteAvailable)&&__.push('      <div class="delete-icon"><\/div>     '),__.push("     <h5>"),typeof resource.title!="undefined"&&resource.title!=null&&__.push($.encode(typeof resource.title=="function"?resource.title.call($item):resource.title)),__.push('<\/h5>     <div class="empty-thumbnail">      <div class="thumbnail" style="background-image: url(\''),typeof resource.bigThumbnailUrl!="undefined"&&resource.bigThumbnailUrl!=null&&__.push($.encode(typeof resource.bigThumbnailUrl=="function"?resource.bigThumbnailUrl.call($item):resource.bigThumbnailUrl)),__.push("');\"><\/div>     <\/div>     "),typeof resource.rawDescription!="undefined"&&resource.rawDescription!=null&&(typeof resource.rawDescription=="function"?resource.rawDescription.call($item):resource.rawDescription)&&(__.push('      <div class="description">'),typeof resource.rawDescription!="undefined"&&resource.rawDescription!=null&&__.push($.encode(typeof resource.rawDescription=="function"?resource.rawDescription.call($item):resource.rawDescription)),__.push("<\/div>     ")),__.push("    <\/a>   ")}),__.push("  ")):!0&&(__.push('   <div class="no-items-message">'),typeof noItemsMessage!="undefined"&&noItemsMessage!=null&&__.push($.encode(typeof noItemsMessage=="function"?noItemsMessage.call($item):noItemsMessage)),__.push("<\/div>  ")),__.push(" <\/div>");return __});jQuery.template("Tmpl-user-resources-documents",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="list">  '),typeof(resources.length>0)!="undefined"&&resources.length>0!=null&&(typeof(resources.length>0)=="function"?(resources.length>0).call($item):resources.length>0)?(__.push("   "),typeof filteredResources!="undefined"&&filteredResources!=null&&$.each(typeof filteredResources=="function"?filteredResources.call($item):filteredResources,function(n,resource){with(this)__.push('    <a class="list-item" href="'),typeof resource.editUrl!="undefined"&&resource.editUrl!=null&&__.push($.encode(typeof resource.editUrl=="function"?resource.editUrl.call($item):resource.editUrl)),__.push('" data-resource-id="'),typeof resource.id!="undefined"&&resource.id!=null&&__.push($.encode(typeof resource.id=="function"?resource.id.call($item):resource.id)),__.push('">     '),typeof isDeleteAvailable!="undefined"&&isDeleteAvailable!=null&&(typeof isDeleteAvailable=="function"?isDeleteAvailable.call($item):isDeleteAvailable)&&__.push('      <div class="delete-icon"><\/div>     '),__.push("     <h5>"),typeof resource.title!="undefined"&&resource.title!=null&&__.push($.encode(typeof resource.title=="function"?resource.title.call($item):resource.title)),__.push('<\/h5>     <div class="empty-thumbnail thumb-document">      <div class="thumbnail" style="background-image: url(\''),typeof resource.thumbnailUrl!="undefined"&&resource.thumbnailUrl!=null&&__.push($.encode(typeof resource.thumbnailUrl=="function"?resource.thumbnailUrl.call($item):resource.thumbnailUrl)),__.push("');\"><\/div>     <\/div>     "),typeof resource.rawDescription!="undefined"&&resource.rawDescription!=null&&(typeof resource.rawDescription=="function"?resource.rawDescription.call($item):resource.rawDescription)&&(__.push('      <div class="description">'),typeof resource.rawDescription!="undefined"&&resource.rawDescription!=null&&__.push($.encode(typeof resource.rawDescription=="function"?resource.rawDescription.call($item):resource.rawDescription)),__.push("<\/div>     ")),__.push("    <\/a>   ")}),__.push("  ")):!0&&(__.push('   <div class="no-items-message">'),typeof noItemsMessage!="undefined"&&noItemsMessage!=null&&__.push($.encode(typeof noItemsMessage=="function"?noItemsMessage.call($item):noItemsMessage)),__.push("<\/div>  ")),__.push(" <\/div>");return __});jQuery.template("Tmpl-user-resources-downloads",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="list">  '),typeof(resources.length>0)!="undefined"&&resources.length>0!=null&&(typeof(resources.length>0)=="function"?(resources.length>0).call($item):resources.length>0)?(__.push('   <table class="knoema-table">    <thead>     <tr>      <th style="background-position: 15% 50%;">       '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/downloads.htm","Dataset"))),__.push('      <\/th>      <th style="width: 10%; background-position: 80% 50%;">       '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/downloads.htm","Format"))),__.push('      <\/th>      <th style="width: 25%; background-position: 55% 50%;">       '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/downloads.htm","Download date"))),__.push('      <\/th>      <th style="width: 15%; background-position: 50% 50%;">       '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/downloads.htm","Status"))),__.push("      <\/th>     <\/tr>    <\/thead>    <tbody>     "),typeof resources!="undefined"&&resources!=null&&$.each(typeof resources=="function"?resources.call($item):resources,function(n,resource){with(this)__.push("      <tr>       <td>        "),typeof resource.datasetName!="undefined"&&resource.datasetName!=null&&__.push($.encode(typeof resource.datasetName=="function"?resource.datasetName.call($item):resource.datasetName)),__.push("       <\/td>       <td>        "),typeof resource.format!="undefined"&&resource.format!=null&&__.push($.encode(typeof resource.format=="function"?resource.format.call($item):resource.format)),__.push("       <\/td>       <td>        "),typeof(resource.changedAt+"Z")!="undefined"&&resource.changedAt+"Z"!=null&&__.push($.encode(typeof(resource.changedAt+"Z")=="function"?(resource.changedAt+"Z").call($item):resource.changedAt+"Z")),__.push("       <\/td>       <td>        "),typeof resource.status!="undefined"&&resource.status!=null&&__.push($.encode(typeof resource.status=="function"?resource.status.call($item):resource.status)),__.push("       <\/td>      <\/tr>     ")}),__.push("    <\/tbody>   <\/table>  ")):!0&&(__.push('   <div class="no-items-message">'),typeof noItemsMessage!="undefined"&&noItemsMessage!=null&&__.push($.encode(typeof noItemsMessage=="function"?noItemsMessage.call($item):noItemsMessage)),__.push("<\/div>  ")),__.push(" <\/div>");return __});jQuery.template("Tmpl-user-resources-updates",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="updates-content">  '),typeof(resources.skipped&&resources.skipped.length>0||resources.failed&&resources.failed.length>0)!="undefined"&&(resources.skipped&&resources.skipped.length>0||resources.failed&&resources.failed.length>0)!=null&&(typeof(resources.skipped&&resources.skipped.length>0||resources.failed&&resources.failed.length>0)=="function"?(resources.skipped&&resources.skipped.length>0||resources.failed&&resources.failed.length>0).call($item):resources.skipped&&resources.skipped.length>0||resources.failed&&resources.failed.length>0)?(__.push("   "),typeof(resources.skipped&&resources.skipped.length>0)!="undefined"&&(resources.skipped&&resources.skipped.length>0)!=null&&(typeof(resources.skipped&&resources.skipped.length>0)=="function"?(resources.skipped&&resources.skipped.length>0).call($item):resources.skipped&&resources.skipped.length>0)&&(__.push("    "),typeof isFirstPage!="undefined"&&isFirstPage!=null&&(typeof isFirstPage=="function"?isFirstPage.call($item):isFirstPage)&&(__.push("     <h4>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/updates.htm","These pages can be updated automatically."))),__.push("<\/h4>    ")),__.push("    "),!0&&(__=__.concat($item.nest("Tmpl-user-resources-visualizations",{resources:resources.skipped,filteredResources:filteredResources.skipped,noItemsMessage:noItemsMessage}))),__.push("   ")),__.push("   "),typeof(resources.failed&&resources.failed.length>0)!="undefined"&&(resources.failed&&resources.failed.length>0)!=null&&(typeof(resources.failed&&resources.failed.length>0)=="function"?(resources.failed&&resources.failed.length>0).call($item):resources.failed&&resources.failed.length>0)&&(__.push("    "),typeof isFirstPage!="undefined"&&isFirstPage!=null&&(typeof isFirstPage=="function"?isFirstPage.call($item):isFirstPage)&&(__.push("     <h4>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/updates.htm","These pages cannot be updated automatically and require manual review."))),__.push("<\/h4>    ")),__.push("    "),!0&&(__=__.concat($item.nest("Tmpl-user-resources-visualizations",{resources:resources.failed,filteredResources:filteredResources.failed,noItemsMessage:noItemsMessage}))),__.push("   ")),__.push("  ")):!0&&(__.push('   <div class="no-items-message">'),typeof noItemsMessage!="undefined"&&noItemsMessage!=null&&__.push($.encode(typeof noItemsMessage=="function"?noItemsMessage.call($item):noItemsMessage)),__.push("<\/div>  ")),__.push(" <\/div>");return __});jQuery.template("Tmpl-user-resources-apps",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="apps-content">  <div class="apps-content-header">   <div class="app-tab-description">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/apps.htm","Create an app to execute requests through API from your account. API requests will have the same access permissions as your account. Do not share the Client Id or Client Secret with anyone."))),__.push('<\/div>   <a class="ui-button create-app" href="/app?layout=UserProfile">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/apps.htm","Create new"))),__.push('<\/a>  <\/div>  <div class="list">   '),typeof(resources.length>0)!="undefined"&&resources.length>0!=null&&(typeof(resources.length>0)=="function"?(resources.length>0).call($item):resources.length>0)?(__.push('    <table class="knoema-table">     <thead>      <tr>       <th style="width: 35%;">        '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/apps.htm","Title"))),__.push("       <\/th>       <th>        "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/apps.htm","Description"))),__.push("       <\/th>      <\/tr>     <\/thead>     <tbody>      "),typeof resources!="undefined"&&resources!=null&&$.each(typeof resources=="function"?resources.call($item):resources,function(n,resource){with(this)__.push('      <tr>       <td>        <a href="'),typeof resource.editUrl!="undefined"&&resource.editUrl!=null&&__.push($.encode(typeof resource.editUrl=="function"?resource.editUrl.call($item):resource.editUrl)),__.push('">'),typeof resource.title!="undefined"&&resource.title!=null&&__.push($.encode(typeof resource.title=="function"?resource.title.call($item):resource.title)),__.push("<\/a>       <\/td>       <td>        "),typeof resource.description!="undefined"&&resource.description!=null&&__.push($.encode(typeof resource.description=="function"?resource.description.call($item):resource.description)),__.push("       <\/td>      <\/tr>      ")}),__.push("     <\/tbody>    <\/table>   ")):!0&&(__.push('    <div class="no-items-message">'),typeof noItemsMessage!="undefined"&&noItemsMessage!=null&&__.push($.encode(typeof noItemsMessage=="function"?noItemsMessage.call($item):noItemsMessage)),__.push("<\/div>   ")),__.push("  <\/div> <\/div>");return __});jQuery.template("Tmpl-user-resources-api-usage",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="api-usage-content">  <div class="credits-state">   <span>    '),typeof Knoema.Utils.formatNumber!="undefined"&&Knoema.Utils.formatNumber!=null&&__.push($.encode(Knoema.Utils.formatNumber(credits,0))),__.push(" "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/api-usage.htm","credits"))),__.push("    "),typeof expirationDate!="undefined"&&expirationDate!=null&&(typeof expirationDate=="function"?expirationDate.call($item):expirationDate)&&(__.push('    <span class="abstract">('),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/api-usage.htm","expiring on {date}",{date:expirationDate}))),__.push(")<\/span>    ")),__.push('   <\/span>  <\/div>  <div class="list">   '),typeof(records.length>0)!="undefined"&&records.length>0!=null&&(typeof(records.length>0)=="function"?(records.length>0).call($item):records.length>0)?(__.push('    <table class="knoema-table">     <thead>      <tr>       <th id="date">        '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/api-usage.htm","Date"))),__.push("       <\/th>       <th>        "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/api-usage.htm","App"))),__.push('       <\/th>       <th id="endpoint">        '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/api-usage.htm","API"))),__.push("       <\/th>       <th>        "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/api-usage.htm","Resource"))),__.push('       <\/th>       <th id="credits">        '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/user/resources/api-usage.htm","Credits Used"))),__.push("       <\/th>      <\/tr>     <\/thead>     <tbody>      "),typeof records!="undefined"&&records!=null&&$.each(typeof records=="function"?records.call($item):records,function(n,record){with(this)__.push("      <tr>       <td>        "),typeof record.date!="undefined"&&record.date!=null&&__.push($.encode(typeof record.date=="function"?record.date.call($item):record.date)),__.push("        <span>"),typeof record.time!="undefined"&&record.time!=null&&__.push($.encode(typeof record.time=="function"?record.time.call($item):record.time)),__.push("<\/span>       <\/td>       <td>        "),typeof record.app!="undefined"&&record.app!=null&&(typeof record.app=="function"?record.app.call($item):record.app)&&(__.push("         "),typeof record.app.title!="undefined"&&record.app.title!=null&&__.push($.encode(typeof record.app.title=="function"?record.app.title.call($item):record.app.title)),__.push("        ")),__.push("       <\/td>       <td>        "),typeof record.endPoint!="undefined"&&record.endPoint!=null&&__.push($.encode(typeof record.endPoint=="function"?record.endPoint.call($item):record.endPoint)),__.push("       <\/td>       <td>        "),typeof record.resource!="undefined"&&record.resource!=null&&(typeof record.resource=="function"?record.resource.call($item):record.resource)&&(__.push('         <a href="'),typeof record.resource.resourceUrl!="undefined"&&record.resource.resourceUrl!=null&&__.push($.encode(typeof record.resource.resourceUrl=="function"?record.resource.resourceUrl.call($item):record.resource.resourceUrl)),__.push('" title="'),typeof record.resource.title!="undefined"&&record.resource.title!=null&&__.push($.encode(typeof record.resource.title=="function"?record.resource.title.call($item):record.resource.title)),__.push('" target="_blank">'),typeof record.resource.title!="undefined"&&record.resource.title!=null&&__.push($.encode(typeof record.resource.title=="function"?record.resource.title.call($item):record.resource.title)),__.push("<\/a>        ")),__.push("       <\/td>       <td>        "),typeof Knoema.Utils.formatNumber!="undefined"&&Knoema.Utils.formatNumber!=null&&__.push($.encode(Knoema.Utils.formatNumber(record.count))),__.push("       <\/td>      <\/tr>      ")}),__.push("     <\/tbody>    <\/table>   ")):!0&&(__.push('    <div class="no-items-message">'),typeof noItemsMessage!="undefined"&&noItemsMessage!=null&&__.push($.encode(typeof noItemsMessage=="function"?noItemsMessage.call($item):noItemsMessage)),__.push("<\/div>   ")),__.push("  <\/div> <\/div>");return __})