streamlit-pdf-viewer 0.0.16.dev0__tar.gz → 0.0.16.dev1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/.bumpversion.toml +1 -1
- {streamlit_pdf_viewer-0.0.16.dev0/streamlit_pdf_viewer.egg-info → streamlit_pdf_viewer-0.0.16.dev1}/PKG-INFO +1 -1
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer/__init__.py +12 -12
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer/frontend/dist/index.html +1 -1
- streamlit_pdf_viewer-0.0.16.dev1/streamlit_pdf_viewer/frontend/dist/js/app.7df2ca54.js +2 -0
- streamlit_pdf_viewer-0.0.16.dev1/streamlit_pdf_viewer/frontend/dist/js/app.7df2ca54.js.map +1 -0
- streamlit_pdf_viewer-0.0.16.dev1/streamlit_pdf_viewer/frontend/dist/js/chunk-vendors.18970703.js +48 -0
- streamlit_pdf_viewer-0.0.16.dev0/streamlit_pdf_viewer/frontend/dist/js/chunk-vendors.617c45d4.js.map → streamlit_pdf_viewer-0.0.16.dev1/streamlit_pdf_viewer/frontend/dist/js/chunk-vendors.18970703.js.map +1 -1
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1/streamlit_pdf_viewer.egg-info}/PKG-INFO +1 -1
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer.egg-info/SOURCES.txt +4 -4
- streamlit_pdf_viewer-0.0.16.dev0/streamlit_pdf_viewer/frontend/dist/js/app.228b4e75.js +0 -2
- streamlit_pdf_viewer-0.0.16.dev0/streamlit_pdf_viewer/frontend/dist/js/app.228b4e75.js.map +0 -1
- streamlit_pdf_viewer-0.0.16.dev0/streamlit_pdf_viewer/frontend/dist/js/chunk-vendors.617c45d4.js +0 -48
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/LICENSE +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/MANIFEST.in +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/README.md +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/setup.cfg +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/setup.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer/frontend/dist/css/app.1df382f3.css +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer/frontend/dist/css/chunk-vendors.8f00bdad.css +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer/frontend/dist/img/altText_add.7748ee93.svg +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer/frontend/dist/img/altText_done.1026be11.svg +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer/frontend/dist/img/cursor-editorFreeHighlight.1fed7bb7.svg +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer/frontend/dist/img/cursor-editorFreeText.0b596377.svg +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer/frontend/dist/img/cursor-editorInk.f94c2f42.svg +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer/frontend/dist/img/cursor-editorTextHighlight.5636640c.svg +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer/frontend/dist/img/editor-toolbar-delete.6694a89f.svg +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer/frontend/dist/img/toolbarButton-editorHighlight.c3287eaa.svg +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer/frontend/dist/img/toolbarButton-menuArrow.37a6145d.svg +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer.egg-info/dependency_links.txt +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer.egg-info/requires.txt +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/streamlit_pdf_viewer.egg-info/top_level.txt +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/__init__.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/e2e_utils.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/test_embed_height.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/test_embed_no_args.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/test_embed_width.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/test_embed_width_height.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/test_iframe_height.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/test_iframe_no_args.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/test_iframe_width.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/test_iframe_width_height.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/test_invalid_params.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/test_tabs.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/test_tabs_2.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/test_unwrap_height.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/test_unwrap_no_args.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/test_unwrap_width.py +0 -0
- {streamlit_pdf_viewer-0.0.16.dev0 → streamlit_pdf_viewer-0.0.16.dev1}/tests/test_unwrap_width_height.py +0 -0
|
@@ -111,20 +111,20 @@ if not _RELEASE:
|
|
|
111
111
|
tab1, tab2 = st.tabs(["tab1", "tab2"])
|
|
112
112
|
|
|
113
113
|
with tab1:
|
|
114
|
-
st.markdown("
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
)
|
|
114
|
+
st.markdown("tab 1")
|
|
115
|
+
with st.container(height=300):
|
|
116
|
+
viewer = pdf_viewer(
|
|
117
|
+
binary,
|
|
118
|
+
annotations=annotations,
|
|
119
|
+
render_text=True,
|
|
120
|
+
key="bao"
|
|
121
|
+
)
|
|
123
122
|
with tab2:
|
|
124
|
-
st.markdown("
|
|
123
|
+
st.markdown("tab 2")
|
|
125
124
|
viewer2 = pdf_viewer(
|
|
126
125
|
binary2,
|
|
127
|
-
height=
|
|
128
|
-
|
|
126
|
+
height=500,
|
|
127
|
+
annotations=annotations,
|
|
128
|
+
render_text=True,
|
|
129
129
|
key="miao"
|
|
130
130
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>streamlit_pdf_viewer</title><script defer="defer" src="js/chunk-vendors.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>streamlit_pdf_viewer</title><script defer="defer" src="js/chunk-vendors.18970703.js"></script><script defer="defer" src="js/app.7df2ca54.js"></script><link href="css/chunk-vendors.8f00bdad.css" rel="stylesheet"><link href="css/app.1df382f3.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but streamlit_pdf_viewer doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{"use strict";var e={7528:(e,t,a)=>{var n=a(3751),r=a(641);const i={id:"app"};function o(e,t,a,n,o,s){const l=(0,r.g2)("PdfViewer"),d=(0,r.g2)("WithStreamlitConnection");return(0,r.uX)(),(0,r.CE)("div",i,[(0,r.bF)(d,null,{default:(0,r.k6)((({args:e})=>[(0,r.bF)(l,{args:e},null,8,["args"])])),_:1})])}var s=a(33);const l={key:0},d={key:0,id:"pdfAnnotations"},p=["id"],g={key:1},c=["src","width","height"],u={key:2},h=["src","width","height"],v={key:3};function w(e,t,a,n,i,o){return(0,r.uX)(),(0,r.CE)("div",{id:"pdfContainer",style:(0,s.Tr)(n.pdfContainerStyle)},["unwrap"===a.args.rendering?((0,r.uX)(),(0,r.CE)("div",l,[(0,r.Lk)("div",{id:"pdfViewer",style:(0,s.Tr)(n.pdfViewerStyle)},[a.args.annotations?((0,r.uX)(),(0,r.CE)("div",d,[((0,r.uX)(!0),(0,r.CE)(r.FK,null,(0,r.pI)(n.filteredAnnotations,((e,t)=>((0,r.uX)(),(0,r.CE)("div",{key:t,style:(0,s.Tr)(n.getPageStyle)},[(0,r.Lk)("div",{style:(0,s.Tr)(n.getAnnotationStyle(e)),id:`annotation-${t}`},null,12,p)],4)))),128))])):(0,r.Q3)("",!0)],4)])):"legacy_embed"===a.args.rendering?((0,r.uX)(),(0,r.CE)("div",g,[(0,r.Lk)("embed",{src:`data:application/pdf;base64,${a.args.binary}`,width:`${a.args.width}`,height:`${a.args.height}`,type:"application/pdf"},null,8,c)])):"legacy_iframe"===a.args.rendering?((0,r.uX)(),(0,r.CE)("div",u,[(0,r.Lk)("embed",{src:`data:application/pdf;base64,${a.args.binary}`,width:`${a.args.width}`,height:`${a.args.height}`,type:"application/pdf"},null,8,h)])):((0,r.uX)(),(0,r.CE)("div",v," Error rendering option. "))],4)}a(4114);var f=a(953),m=(a(7566),a(4883)),y=a(7445);const E="pdfjs-dist/cmaps/",_=!0,C=!0,b={props:["args"],setup(e){const t=(0,f.KR)(0),a=(0,f.KR)(0),n=(0,f.KR)([]),i=(0,f.KR)([]),o=0===e.args.pages_to_render.length,s=(0,r.EW)((()=>o?e.args.annotations:e.args.annotations.filter((t=>e.args.pages_to_render.includes(Number(t.page)))))),l=!0===e.args.render_text,d=(0,r.EW)((()=>({width:e.args.width?`${e.args.width}px`:`${a.value}px`,height:e.args.height?`${e.args.height}px`:"auto",overflow:"auto"}))),p={position:"relative"},g={position:"relative"},c=t=>{let a=0;if(o)for(let r=0;r<t-1;r++)a+=i.value[r]*n.value[r]+e.args.pages_vertical_spacing;else for(let r=0;r<i.value.length;r++)e.args.pages_to_render.includes(r+1)&&r<t-1&&(a+=i.value[r]*n.value[r]+e.args.pages_vertical_spacing);return a},u=t=>{const a=n.value[t.page-1];return{position:"absolute",left:t.x*a+"px",top:`${c(t.page)+t.y*a}px`,width:t.width*a+"px",height:t.height*a+"px",outline:e.args.annotation_outline_size*a+"px solid",outlineColor:t.color,cursor:"pointer","z-index":10}},h=e=>{const t=e?.getElementsByTagName("canvas");for(let a=t.length-1;a>=0;a--)e?.removeChild(t.item(a))},v=(t,a,n,r)=>{const i=t.getViewport({scale:a,rotation:n}),o=window.devicePixelRatio||1,s=document.createElement("canvas");return s.id=`canvas_page_${r}`,s.height=i.height*o+e.args.pages_vertical_spacing,s.width=i.width*o,s.style.width=i.width+"px",s.style.height=i.height+"px",s.style.display="block",s.style.marginBottom=`${e.args.pages_vertical_spacing}px`,s.getContext("2d").scale(o,o),s},w=async(e,t,a)=>{const n={canvasContext:t.getContext("2d"),viewport:a},r=e.render(n);if(await r.promise,l){const n=await e.getTextContent(),r=document.createElement("div");r.className="textLayer";const i=new m.D6({textContentSource:n,container:r,viewport:a,textDivs:[]});await i.render();const o=document.createElement("div");o.className="page";const s=document.createElement("div");s.className="canvasWrapper",s.appendChild(t),o.style="position: relative;";const l=document.getElementById("pdfViewer");o.appendChild(s),o.appendChild(r),l.appendChild(o)}else{const e=document.createElement("div");e.className="page";const a=document.createElement("div");a.className="canvasWrapper",a.appendChild(t),e.style="position: relative;",e.appendChild(a),pdfViewer.appendChild(e)}},b=async(r,o,s=null)=>{if(0===s.length){s=[];for(let e=0;e<r.numPages;e++)s.push(e+1)}for(let l=1;l<=r.numPages;l++){const d=await r.getPage(l),p=d.rotate,g=d.getViewport({scale:1,rotation:p});if(e.args.height>0){let t=g.width/g.height;const n=t*e.args.height;(0===a.value||n<a.value)&&(a.value=n)}const c=a.value/g.width;if(n.value.push(c),i.value.push(g.height),s.includes(l)){const e=v(d,c,p,l);o.style.setProperty("--scale-factor",c);const a=d.getViewport({scale:n.value[d._pageIndex],rotation:d.rotate,intent:"print"}),r=window.devicePixelRatio||1;t.value+=e.height/r,await w(d,e,a)}}s.length>0&&(t.value-=e.args.pages_vertical_spacing)},k=e=>{window.alert(e.message),console.error(e)},x=async t=>{try{const a=await(0,m.YE)({url:t,cMapUrl:E,cMapPacked:_,enableXfa:C}),n=document.getElementById("pdfViewer");h(n);const r=await a.promise;await b(r,n,e.args.pages_to_render)}catch(a){k(a)}},$=()=>{y.wk.setFrameHeight(e.args.height||t.value)},R=()=>{null===e.args.width||void 0===e.args.width?a.value=window.innerWidth:Number.isInteger(e.args.width)&&(a.value=e.args.width,window.innerWidth>0&&window.innerWidth<a.value&&(a.value=window.innerWidth))};return(0,r.sV)((()=>{const t=`data:application/pdf;base64,${e.args.binary}`;R(),"unwrap"===e.args.rendering?x(t).then($).then(y.wk.setComponentReady):($(),y.wk.setComponentReady())})),(0,r.$u)((()=>{$()})),{filteredAnnotations:s,getAnnotationStyle:u,pdfContainerStyle:d,pdfViewerStyle:p,getPageStyle:g}}};var k=a(6262);const x=(0,k.A)(b,[["render",w]]),$=x,R=e=>((0,r.Qi)("data-v-bef81972"),e=e(),(0,r.jt)(),e),V={key:0},P=R((()=>(0,r.Lk)("h1",{class:"err__title"},"Component Error",-1))),S={class:"err__msg"};function N(e,t,a,n,i,o){return(0,r.uX)(),(0,r.CE)("div",null,[""!=e.componentError?((0,r.uX)(),(0,r.CE)("div",V,[P,(0,r.Lk)("div",S,"Message: "+(0,s.v_)(e.componentError),1)])):null!=e.renderData?(0,r.RG)(e.$slots,"default",{key:1,args:e.renderData.args,disabled:e.renderData.disabled},void 0,!0):(0,r.Q3)("",!0)])}const X=(0,r.pM)({name:"WithStreamlitConnection",setup(){const e=(0,f.KR)(void 0),t=(0,f.KR)(""),a=a=>{const n=a;e.value=n.detail,t.value=""};return(0,r.sV)((()=>{y.wk.events.addEventListener(y.wk.RENDER_EVENT,a),y.wk.setComponentReady()})),(0,r.$u)((()=>{""!=t.value&&y.wk.setFrameHeight()})),(0,r.hi)((()=>{y.wk.events.removeEventListener(y.wk.RENDER_EVENT,a)})),(0,r.qG)((e=>{t.value=String(e)})),{renderData:e,componentError:t}}}),O=(0,k.A)(X,[["render",N],["__scopeId","data-v-bef81972"]]),W=O,T=(0,r.pM)({name:"App",components:{PdfViewer:$,WithStreamlitConnection:W}}),A=(0,k.A)(T,[["render",o]]),L=A;(0,n.Ef)(L).mount("#app")}},t={};function a(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,a),i.exports}a.m=e,(()=>{var e=[];a.O=(t,n,r,i)=>{if(!n){var o=1/0;for(p=0;p<e.length;p++){for(var[n,r,i]=e[p],s=!0,l=0;l<n.length;l++)(!1&i||o>=i)&&Object.keys(a.O).every((e=>a.O[e](n[l])))?n.splice(l--,1):(s=!1,i<o&&(o=i));if(s){e.splice(p--,1);var d=r();void 0!==d&&(t=d)}}return t}i=i||0;for(var p=e.length;p>0&&e[p-1][2]>i;p--)e[p]=e[p-1];e[p]=[n,r,i]}})(),(()=>{a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{a.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()})(),(()=>{a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{var e={524:0};a.O.j=t=>0===e[t];var t=(t,n)=>{var r,i,[o,s,l]=n,d=0;if(o.some((t=>0!==e[t]))){for(r in s)a.o(s,r)&&(a.m[r]=s[r]);if(l)var p=l(a)}for(t&&t(n);d<o.length;d++)i=o[d],a.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return a.O(p)},n=self["webpackChunkstreamlit_pdf_viewer"]=self["webpackChunkstreamlit_pdf_viewer"]||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.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BwB,EAAEa,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOtC,EAAoBS,EAAEC,EAAO,EAGjCmC,EAAqBC,KAAK,oCAAsCA,KAAK,qCAAuC,GAChHD,EAAmBE,QAAQR,EAAqBS,KAAK,KAAM,IAC3DH,EAAmB3G,KAAOqG,EAAqBS,KAAK,KAAMH,EAAmB3G,KAAK8G,KAAKH,G,KC7CvF,IAAII,EAAsBjD,EAAoBS,OAAElD,EAAW,CAAC,MAAM,IAAOyC,EAAoB,QAC7FiD,EAAsBjD,EAAoBS,EAAEwC,E","sources":["webpack://streamlit_pdf_viewer/./src/App.vue?9ab1","webpack://streamlit_pdf_viewer/./src/App.vue","webpack://streamlit_pdf_viewer/./src/PdfViewer.vue","webpack://streamlit_pdf_viewer/./src/PdfViewer.vue?f557","webpack://streamlit_pdf_viewer/./src/streamlit/WithStreamlitConnection.vue?8d46","webpack://streamlit_pdf_viewer/./src/streamlit/WithStreamlitConnection.vue","webpack://streamlit_pdf_viewer/./src/streamlit/WithStreamlitConnection.vue?1dfc","webpack://streamlit_pdf_viewer/./src/App.vue?7ccd","webpack://streamlit_pdf_viewer/./src/main.ts","webpack://streamlit_pdf_viewer/webpack/bootstrap","webpack://streamlit_pdf_viewer/webpack/runtime/chunk loaded","webpack://streamlit_pdf_viewer/webpack/runtime/define property getters","webpack://streamlit_pdf_viewer/webpack/runtime/global","webpack://streamlit_pdf_viewer/webpack/runtime/hasOwnProperty shorthand","webpack://streamlit_pdf_viewer/webpack/runtime/jsonp chunk loading","webpack://streamlit_pdf_viewer/webpack/startup"],"sourcesContent":["import { resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { id: \"app\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_PdfViewer = _resolveComponent(\"PdfViewer\")!\n const _component_WithStreamlitConnection = _resolveComponent(\"WithStreamlitConnection\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_WithStreamlitConnection, null, {\n default: _withCtx(({ args }) => [\n _createVNode(_component_PdfViewer, { args: args }, null, 8, [\"args\"])\n ]),\n _: 1\n })\n ]))\n}","<!-- \n We bootstrap our Component to Streamlit with our scoped slot in the top-level App.\n This is where scoped slot passes Streamlit `args` data from itself to children MyComponent.\n You should not have to edit this, but are free to do so :)\n-->\n<template>\n <div id=\"app\">\n <WithStreamlitConnection v-slot=\"{ args }\">\n <PdfViewer :args=\"args\" />\n </WithStreamlitConnection>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from \"vue\"\nimport PdfViewer from \"./PdfViewer.vue\"\n\n// \"withStreamlitConnection\" is a scoped slot. It bootstraps the\n// connection between your component and the Streamlit app, and handles\n// passing arguments from Python -> Component.\n//\n// You don't need to edit withStreamlitConnection (but you're welcome to!).\nimport WithStreamlitConnection from \"./streamlit/WithStreamlitConnection.vue\"\n\nexport default defineComponent({\n name: \"App\",\n components: {\n PdfViewer,\n WithStreamlitConnection,\n },\n})\n</script>\n\n<style>\nbody {\n margin: 0;\n}\n#app {\n font-family: Avenir, Helvetica, Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n color: #2c3e50;\n}\n</style>\n","<template>\n <div id=\"pdfContainer\" :style=\"pdfContainerStyle\">\n <div v-if=\"args.rendering==='unwrap'\">\n <div id=\"pdfViewer\" :style=\"pdfViewerStyle\">\n <div id=\"pdfAnnotations\" v-if=\"args.annotations\">\n <div v-for=\"(annotation, index) in filteredAnnotations\" :key=\"index\" :style=\"getPageStyle\">\n <div :style=\"getAnnotationStyle(annotation)\" :id=\"`annotation-${index}`\"></div>\n </div>\n </div>\n </div>\n </div>\n <div v-else-if=\"args.rendering==='legacy_embed'\">\n <embed :src=\"`data:application/pdf;base64,${args.binary}`\" :width=\"`${args.width}`\" :height=\"`${args.height}`\" type=\"application/pdf\"/>\n </div>\n <div v-else-if=\"args.rendering==='legacy_iframe'\">\n <embed :src=\"`data:application/pdf;base64,${args.binary}`\" :width=\"`${args.width}`\" :height=\"`${args.height}`\" type=\"application/pdf\"/>\n </div>\n <div v-else>\n Error rendering option.\n </div>\n </div>\n</template>\n\n<script>\nimport { onMounted, onUpdated, computed, ref} from \"vue\";\nimport \"pdfjs-dist/web/pdf_viewer.css\";\nimport \"pdfjs-dist/build/pdf.worker.mjs\";\nimport {getDocument} from \"pdfjs-dist/build/pdf\";\nimport {Streamlit} from \"streamlit-component-lib\";\nimport * as pdfjsLib from \"pdfjs-dist\";\n\nconst CMAP_URL = \"pdfjs-dist/cmaps/\";\nconst CMAP_PACKED = true;\nconst ENABLE_XFA = true;\n\nexport default {\n props: [\"args\"],\n\n setup(props) {\n const totalHeight = ref(0);\n const maxWidth = ref(0);\n const pageScales = ref([]);\n const pageHeights = ref([]);\n\n const isRenderingAllPages = props.args.pages_to_render.length === 0;\n\n const filteredAnnotations = computed(() => {\n if (isRenderingAllPages) {\n return props.args.annotations;\n }\n return props.args.annotations.filter(anno => {\n return props.args.pages_to_render.includes(Number(anno.page))\n })\n });\n\n const renderText = props.args.render_text === true\n\n const pdfContainerStyle = computed(() => ({\n width: props.args.width ? `${props.args.width}px` : `${maxWidth.value}px`,\n height: props.args.height ? `${props.args.height}px` : 'auto',\n overflow: 'auto',\n }));\n\n const pdfViewerStyle = {position: 'relative'};\n const getPageStyle = {position: 'relative'};\n\n const calculatePdfsHeight = (page) => {\n let height = 0;\n if (isRenderingAllPages) {\n for (let i = 0; i < page - 1; i++) {\n height += pageHeights.value[i] * pageScales.value[i] + props.args.pages_vertical_spacing; // Add margin for each page\n }\n } else {\n for (let i = 0; i < pageHeights.value.length; i++) {\n if (props.args.pages_to_render.includes(i + 1) && i < page - 1) {\n height += pageHeights.value[i] * pageScales.value[i] + props.args.pages_vertical_spacing;\n }\n }\n }\n return height;\n };\n\n const getAnnotationStyle = (annoObj) => {\n const scale = pageScales.value[annoObj.page - 1];\n return {\n position: 'absolute',\n left: `${annoObj.x * scale}px`,\n top: `${calculatePdfsHeight(annoObj.page) + annoObj.y * scale}px`,\n width: `${annoObj.width * scale}px`,\n height: `${annoObj.height * scale}px`,\n outline: `${props.args.annotation_outline_size * scale}px solid`,\n outlineColor: annoObj.color,\n cursor: 'pointer',\n 'z-index': 10\n };\n };\n\n const clearExistingCanvases = (pdfViewer) => {\n const canvases = pdfViewer?.getElementsByTagName(\"canvas\");\n for (let j = canvases.length - 1; j >= 0; j--) {\n pdfViewer?.removeChild(canvases.item(j));\n }\n };\n\n const createCanvasForPage = (page, scale, rotation, pageNumber) => {\n const viewport = page.getViewport({scale, rotation});\n\n const ratio = window.devicePixelRatio || 1\n\n const canvas = document.createElement(\"canvas\");\n canvas.id = `canvas_page_${pageNumber}`;\n canvas.height = viewport.height * ratio + props.args.pages_vertical_spacing;\n canvas.width = viewport.width * ratio;\n canvas.style.width = viewport.width + 'px';\n canvas.style.height = viewport.height + 'px';\n canvas.style.display = \"block\";\n canvas.style.marginBottom = `${props.args.pages_vertical_spacing}px`;\n canvas.getContext(\"2d\").scale(ratio, ratio);\n return canvas;\n };\n\n\n const renderPage = async (page, canvas, viewport) => {\n const renderContext = {\n canvasContext: canvas.getContext(\"2d\"),\n viewport: viewport\n };\n const renderTask = page.render(renderContext);\n await renderTask.promise;\n\n if (renderText) {\n const textContent = await page.getTextContent();\n const textLayerDiv = document.createElement(\"div\");\n textLayerDiv.className = \"textLayer\"\n // textLayerDiv.style.position = \"absolute\";\n // textLayerDiv.style.height = `${viewport.height}px`;\n // textLayerDiv.style.width = `${viewport.width}px`;\n const textLayer = new pdfjsLib.TextLayer({\n textContentSource: textContent,\n container: textLayerDiv,\n viewport: viewport,\n textDivs: []\n })\n await textLayer.render()\n \n const pageDiv = document.createElement('div');\n pageDiv.className = 'page';\n\n const canvasWrapper = document.createElement('div');\n canvasWrapper.className = 'canvasWrapper';\n canvasWrapper.appendChild(canvas);\n\n pageDiv.style = \"position: relative;\";\n\n const pdfViewer = document.getElementById(\"pdfViewer\");\n pageDiv.appendChild(canvasWrapper);\n pageDiv.appendChild(textLayerDiv);\n\n pdfViewer.appendChild(pageDiv);\n } else {\n const pageDiv = document.createElement('div');\n pageDiv.className = 'page';\n\n const canvasWrapper = document.createElement('div');\n canvasWrapper.className = 'canvasWrapper';\n canvasWrapper.appendChild(canvas);\n\n pageDiv.style = \"position: relative;\";\n pageDiv.appendChild(canvasWrapper);\n pdfViewer.appendChild(pageDiv);\n }\n };\n\n const renderPdfPages = async (pdf, pdfViewer, pagesToRender = null) => {\n if (pagesToRender.length === 0) {\n pagesToRender = []\n for (let i = 0; i < pdf.numPages; i++) {\n pagesToRender.push(i + 1);\n }\n }\n\n for (let pageNumber = 1; pageNumber <= pdf.numPages; pageNumber++) {\n const page = await pdf.getPage(pageNumber)\n const rotation = page.rotate\n // Initial viewport\n const unscaledViewport = page.getViewport({\n scale: 1.0,\n rotation: rotation,\n })\n\n // console.log(`unscaledViewport ${pageNumber}`)\n // console.log(unscaledViewport)\n\n // console.log(\"Max width\")\n // console.log(maxWidth.value)\n\n // console.log(\"Height\")\n // console.log(props.args.height)\n\n if (props.args.height > 0) {\n let widthScale = unscaledViewport.width / unscaledViewport.height\n const possibleScaledWidth = widthScale * props.args.height\n if (maxWidth.value === 0) {\n maxWidth.value = possibleScaledWidth\n } else if (possibleScaledWidth < maxWidth.value) {\n maxWidth.value = possibleScaledWidth\n }\n }\n\n const scale = maxWidth.value / unscaledViewport.width\n\n pageScales.value.push(scale)\n pageHeights.value.push(unscaledViewport.height)\n if (pagesToRender.includes(pageNumber)) {\n const canvas = createCanvasForPage(page, scale, rotation, pageNumber)\n\n // console.log(`canvas`)\n // console.log(canvas)\n\n // pdfViewer?.append(canvas)\n pdfViewer.style.setProperty('--scale-factor', scale);\n\n const viewport = page.getViewport({\n scale: pageScales.value[page._pageIndex],\n rotation: page.rotate,\n intent: \"print\",\n });\n\n // console.log(`Scaled viewport`)\n // console.log(viewport)\n\n const ratio = window.devicePixelRatio || 1\n totalHeight.value += canvas.height / ratio\n await renderPage(page, canvas, viewport)\n }\n }\n // Subtract the margin for the last page as it's not needed\n if (pagesToRender.length > 0) {\n totalHeight.value -= props.args.pages_vertical_spacing;\n }\n };\n\n const alertError = (error) => {\n window.alert(error.message);\n console.error(error);\n };\n\n const loadPdfs = async (url) => {\n try {\n const loadingTask = await getDocument({\n \"url\": url,\n \"cMapUrl\": CMAP_URL,\n \"cMapPacked\": CMAP_PACKED,\n \"enableXfa\": ENABLE_XFA,\n });\n const pdfViewer = document.getElementById(\"pdfViewer\");\n clearExistingCanvases(pdfViewer);\n\n const pdf = await loadingTask.promise;\n await renderPdfPages(pdf, pdfViewer, props.args.pages_to_render);\n } catch (error) {\n alertError(error);\n }\n };\n\n\n const setFrameHeight = () => {\n Streamlit.setFrameHeight(props.args.height || totalHeight.value);\n };\n\n const setFrameWidth = () => {\n if (props.args.width === null || props.args.width === undefined) {\n maxWidth.value = window.innerWidth\n } else if (Number.isInteger(props.args.width)) {\n maxWidth.value = props.args.width\n\n // If the desired width is larger than the available inner width,\n // we should not exceed it. To be revised\n if (window.innerWidth > 0) {\n if (window.innerWidth < maxWidth.value) {\n maxWidth.value = window.innerWidth\n }\n }\n }\n }\n\n onMounted(() => {\n const binaryDataUrl = `data:application/pdf;base64,${props.args.binary}`;\n setFrameWidth();\n if (props.args.rendering === \"unwrap\") {\n loadPdfs(binaryDataUrl)\n .then(setFrameHeight)\n .then(Streamlit.setComponentReady);\n } else {\n setFrameHeight();\n Streamlit.setComponentReady();\n }\n });\n\n onUpdated(() => {\n setFrameHeight();\n });\n\n\n return {\n filteredAnnotations,\n getAnnotationStyle,\n pdfContainerStyle,\n pdfViewerStyle,\n getPageStyle\n };\n },\n};\n</script>\n","import { render } from \"./PdfViewer.vue?vue&type=template&id=b0a7c438\"\nimport script from \"./PdfViewer.vue?vue&type=script&lang=js\"\nexport * from \"./PdfViewer.vue?vue&type=script&lang=js\"\n\nimport exportComponent from \"../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = (n: any) => (_pushScopeId(\"data-v-bef81972\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { key: 0 }\nconst _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"h1\", { class: \"err__title\" }, \"Component Error\", -1))\nconst _hoisted_3 = { class: \"err__msg\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n return (_openBlock(), _createElementBlock(\"div\", null, [\n (_ctx.componentError != '')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _hoisted_2,\n _createElementVNode(\"div\", _hoisted_3, \"Message: \" + _toDisplayString(_ctx.componentError), 1)\n ]))\n : (_ctx.renderData != null)\n ? _renderSlot(_ctx.$slots, \"default\", {\n key: 1,\n args: _ctx.renderData.args,\n disabled: _ctx.renderData.disabled\n }, undefined, true)\n : _createCommentVNode(\"\", true)\n ]))\n}","<template>\n <div>\n <!-- Error boundary. If our wrapped component threw an error, display it. -->\n <div v-if=\"componentError != ''\">\n <h1 class=\"err__title\">Component Error</h1>\n <div class=\"err__msg\">Message: {{ componentError }}</div>\n </div>\n <!-- \n Else render the component slot and pass Streamlit event data in `args` props to it.\n Don't render until we've gotten our first RENDER_EVENT from Streamlit.\n All components get disabled while the app is being re-run, and become re-enabled when the re-run has finished.\n -->\n <slot\n v-else-if=\"renderData != null\"\n :args=\"renderData.args\"\n :disabled=\"renderData.disabled\"\n ></slot>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n ref,\n defineComponent,\n onMounted,\n onUpdated,\n onUnmounted,\n onErrorCaptured,\n} from \"vue\"\nimport { Streamlit, RenderData } from \"streamlit-component-lib\"\n\nexport default defineComponent({\n name: \"WithStreamlitConnection\",\n setup() {\n const renderData = ref<RenderData>((undefined as unknown) as RenderData)\n const componentError = ref(\"\")\n\n const onRenderEvent = (event: Event): void => {\n const renderEvent = event as CustomEvent<RenderData>\n renderData.value = renderEvent.detail\n componentError.value = \"\"\n }\n\n // Set up event listeners, and signal to Streamlit that we're ready.\n // We won't render the component until we receive the first RENDER_EVENT.\n onMounted(() => {\n Streamlit.events.addEventListener(Streamlit.RENDER_EVENT, onRenderEvent)\n Streamlit.setComponentReady()\n })\n onUpdated(() => {\n // If our slot threw an error, we display it in render(). In this\n // case, the slot won't be mounted and therefore won't call\n // `setFrameHeight` on its own. We do it here so that the rendered\n // error will be visible.\n if (componentError.value != \"\") {\n Streamlit.setFrameHeight()\n }\n })\n onUnmounted(() => {\n Streamlit.events.removeEventListener(\n Streamlit.RENDER_EVENT,\n onRenderEvent\n )\n })\n onErrorCaptured(err => {\n componentError.value = String(err)\n })\n\n return {\n renderData,\n componentError,\n }\n },\n})\n</script>\n\n<style scoped>\n.err__title,\n.err__msg {\n margin: 0;\n}\n</style>\n","import { render } from \"./WithStreamlitConnection.vue?vue&type=template&id=bef81972&scoped=true&ts=true\"\nimport script from \"./WithStreamlitConnection.vue?vue&type=script&lang=ts\"\nexport * from \"./WithStreamlitConnection.vue?vue&type=script&lang=ts\"\n\nimport \"./WithStreamlitConnection.vue?vue&type=style&index=0&id=bef81972&scoped=true&lang=css\"\n\nimport exportComponent from \"../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-bef81972\"]])\n\nexport default __exports__","import { render } from \"./App.vue?vue&type=template&id=6ea7f320&ts=true\"\nimport script from \"./App.vue?vue&type=script&lang=ts\"\nexport * from \"./App.vue?vue&type=script&lang=ts\"\n\nimport \"./App.vue?vue&type=style&index=0&id=6ea7f320&lang=css\"\n\nimport exportComponent from \"../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { createApp } from 'vue'\nimport App from './App.vue'\n\ncreateApp(App).mount('#app')\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t524: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkstreamlit_pdf_viewer\"] = self[\"webpackChunkstreamlit_pdf_viewer\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [504], () => (__webpack_require__(7528)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["_hoisted_1","id","render","_ctx","_cache","$props","$setup","$data","$options","_component_PdfViewer","_resolveComponent","_component_WithStreamlitConnection","_openBlock","_createElementBlock","_createVNode","default","_withCtx","args","_","key","style","_normalizeStyle","pdfContainerStyle","rendering","_createElementVNode","pdfViewerStyle","annotations","_hoisted_2","_Fragment","_renderList","filteredAnnotations","annotation","index","getPageStyle","getAnnotationStyle","_hoisted_3","_createCommentVNode","_hoisted_4","src","binary","width","height","type","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","CMAP_URL","CMAP_PACKED","ENABLE_XFA","props","setup","totalHeight","ref","maxWidth","pageScales","pageHeights","isRenderingAllPages","pages_to_render","length","computed","filter","anno","includes","Number","page","renderText","render_text","value","overflow","position","calculatePdfsHeight","i","pages_vertical_spacing","annoObj","scale","left","x","top","y","outline","annotation_outline_size","outlineColor","color","cursor","clearExistingCanvases","pdfViewer","canvases","getElementsByTagName","j","removeChild","item","createCanvasForPage","rotation","pageNumber","viewport","getViewport","ratio","window","devicePixelRatio","canvas","document","createElement","display","marginBottom","getContext","renderPage","async","renderContext","canvasContext","renderTask","promise","textContent","getTextContent","textLayerDiv","className","textLayer","pdfjsLib","textContentSource","container","textDivs","pageDiv","canvasWrapper","appendChild","getElementById","renderPdfPages","pdf","pagesToRender","numPages","push","getPage","rotate","unscaledViewport","widthScale","possibleScaledWidth","setProperty","_pageIndex","intent","alertError","error","alert","message","console","loadPdfs","loadingTask","getDocument","url","setFrameHeight","Streamlit","setFrameWidth","undefined","innerWidth","isInteger","onMounted","binaryDataUrl","then","setComponentReady","onUpdated","__exports__","_withScopeId","n","_pushScopeId","_popScopeId","class","componentError","_toDisplayString","renderData","_renderSlot","$slots","disabled","defineComponent","name","onRenderEvent","event","renderEvent","detail","events","addEventListener","RENDER_EVENT","onUnmounted","removeEventListener","onErrorCaptured","err","String","components","PdfViewer","WithStreamlitConnection","createApp","App","mount","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","call","m","deferred","O","result","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","Object","keys","every","splice","r","d","definition","o","defineProperty","enumerable","get","g","globalThis","this","Function","e","obj","prop","prototype","hasOwnProperty","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","chunkLoadingGlobal","self","forEach","bind","__webpack_exports__"],"sourceRoot":""}
|