1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-22 09:21:34 +02:00
invoiceninja/public/js/clients/shared/pdf.js

2 lines
9.2 KiB
JavaScript
Raw Normal View History

/*! For license information please see pdf.js.LICENSE.txt */
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s=8)}({"7+HS":function(t,e,r){"use strict";r.r(e);var n=r("o0o1"),o=r.n(n);function i(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}new(function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.url=e,this.canvas=r,this.context=r.getContext("2d"),this.currentPage=1,this.maxPages=1}var e,r,n,c,u;return e=t,(r=[{key:"handlePreviousPage",value:function(){1!=this.currentPage&&(this.currentPage-=1,this.handle())}},{key:"handleNextPage",value:function(){this.currentPage!=this.maxPages&&(this.currentPage+=1,this.handle())}},{key:"prepare",value:function(){var t=this,e=document.getElementById("previous-page-button"),r=document.getElementById("next-page-button");return e.addEventListener("click",(function(){return t.handlePreviousPage()})),r.addEventListener("click",(function(){return t.handleNextPage()})),this}},{key:"handle",value:(c=o.a.mark((function t(){var e,r,n;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,pdfjsLib.getDocument(this.url).promise;case 2:return e=t.sent,t.next=5,e.getPage(this.currentPage);case 5:return r=t.sent,this.maxPages=e.numPages,t.next=9,r.getViewport({scale:1});case 9:n=t.sent,this.canvas.height=n.height,this.canvas.width=n.width,r.render({canvasContext:this.context,viewport:n});case 13:case"end":return t.stop()}}),t,this)})),u=function(){var t=this,e=arguments;return new Promise((function(r,n){var o=c.apply(t,e);function a(t){i(o,r,n,a,u,"next",t)}function u(t){i(o,r,n,a,u,"throw",t)}a(void 0)}))},function(){return u.apply(this,arguments)})}])&&a(e.prototype,r),n&&a(e,n),t}())(document.querySelector("meta[name='pdf-url'").content,document.getElementById("pdf-placeholder")).prepare().handle()},8:function(t,e,r){t.exports=r("7+HS")},ls82:function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r,n){var o=e&&e.prototype instanceof l?e:l,i=Object.create(o.prototype),a=new L(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=w(a,r);if(c){if(c===s)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var s={};function l(){