(function(e){typeof define==`function`&&define.amd?define([],e):e()})(function(){var e=((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports))(((e,t)=>{t.exports={}}));function t(n,r,i,a){if(!(n instanceof Error))throw n;if(!(typeof window>`u`&&r||a))throw n.message+=` on line `+i,n;var o,s,c,l;try{a||=e().readFileSync(r,{encoding:`utf8`}),o=3,s=a.split(`
`),c=Math.max(i-o,0),l=Math.min(s.length,i+o)}catch(e){n.message+=` - could not read from `+r+` (`+e.message+`)`,t(n,null,i);return}o=s.slice(c,l).map(function(e,t){var n=t+c+1;return(n==i?`  > `:`    `)+n+`| `+e}).join(`
`),n.path=r;try{n.message=(r||`Pug`)+`:`+i+`
`+o+`

`+n.message}catch{}throw n}function n(e){var n=``,r,i;try{i=1,r=`/home/circleci/project/girder/plugins/readme/girder_readme/web_client/templates/readmeWidget.pug`,n+=`<div class="g-widget-readme">`,i=2,r=`/home/circleci/project/girder/plugins/readme/girder_readme/web_client/templates/readmeWidget.pug`,n+=`<div class="g-widget-readme-header">`,i=3,r=`/home/circleci/project/girder/plugins/readme/girder_readme/web_client/templates/readmeWidget.pug`,n+=`<i class="icon-doc-text-inv">`,i=3,r=`/home/circleci/project/girder/plugins/readme/girder_readme/web_client/templates/readmeWidget.pug`,n+=`README</i></div>`,i=4,r=`/home/circleci/project/girder/plugins/readme/girder_readme/web_client/templates/readmeWidget.pug`,n+=`<div class="g-widget-readme-content"></div></div>`}catch(e){t(e,r,i)}return n}var r=girder.$,i=girder.views.widgets.HierarchyWidget,{wrap:a}=girder.utilities.PluginUtils,{restRequest:o}=girder.rest,{renderMarkdown:s}=girder.misc;a(i,`render`,function(e){return e.call(this),this.parentModel.resourceName===`folder`&&o({url:`folder/${this.parentModel.get(`_id`)}/readme`,method:`GET`}).then(e=>(e&&(r(`.g-folder-metadata`).after(n),s(e,r(`.g-widget-readme-content`))),e)),this})});