umwd-components 0.1.300 → 0.1.301
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.
- package/dist/node_modules/call-bind/index.js +1 -1
- package/dist/node_modules/tslib/tslib.es6.js +1 -1
- package/dist/src/components/e-commerce/invoice/InvoicePDF.js +1 -1
- package/package.json +3 -3
- package/dist/_virtual/YGEnums.js +0 -6
- package/dist/_virtual/_commonjs-dynamic-modules.js +0 -6
- package/dist/_virtual/browser-ponyfill.js +0 -6
- package/dist/_virtual/clone.js +0 -6
- package/dist/_virtual/common.js +0 -6
- package/dist/_virtual/context.js +0 -6
- package/dist/_virtual/core.js +0 -6
- package/dist/_virtual/decode.js +0 -6
- package/dist/_virtual/deflate.js +0 -6
- package/dist/_virtual/dictionary-browser.js +0 -6
- package/dist/_virtual/dictionary.js +0 -6
- package/dist/_virtual/en-us.js +0 -6
- package/dist/_virtual/events.js +0 -6
- package/dist/_virtual/huffman.js +0 -6
- package/dist/_virtual/hyphen.js +0 -6
- package/dist/_virtual/index2.js +0 -6
- package/dist/_virtual/index3.js +0 -6
- package/dist/_virtual/index4.js +0 -6
- package/dist/_virtual/index5.js +0 -6
- package/dist/_virtual/index6.js +0 -6
- package/dist/_virtual/inflate.js +0 -6
- package/dist/_virtual/md5.js +0 -6
- package/dist/_virtual/prefix.js +0 -6
- package/dist/_virtual/scheduler.development.js +0 -6
- package/dist/_virtual/scheduler.production.min.js +0 -6
- package/dist/_virtual/streams.js +0 -6
- package/dist/_virtual/transform.js +0 -6
- package/dist/_virtual/trees.js +0 -6
- package/dist/_virtual/wrapAssembly.js +0 -6
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +0 -6
- package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +0 -6
- package/dist/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js +0 -6
- package/dist/node_modules/@babel/runtime/helpers/esm/createClass.js +0 -6
- package/dist/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelperLoose.js +0 -6
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +0 -6
- package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +0 -6
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -6
- package/dist/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js +0 -8
- package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +0 -6
- package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +0 -6
- package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +0 -6
- package/dist/node_modules/@babel/runtime/helpers/esm/typeof.js +0 -6
- package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +0 -6
- package/dist/node_modules/@react-pdf/fns/lib/index.js +0 -6
- package/dist/node_modules/@react-pdf/font/lib/index.browser.js +0 -6
- package/dist/node_modules/@react-pdf/image/lib/index.browser.js +0 -6
- package/dist/node_modules/@react-pdf/layout/lib/index.js +0 -6
- package/dist/node_modules/@react-pdf/layout/node_modules/emoji-regex/index.js +0 -6
- package/dist/node_modules/@react-pdf/pdfkit/lib/pdfkit.browser.js +0 -6
- package/dist/node_modules/@react-pdf/pdfkit/node_modules/pako/lib/utils/common.js +0 -6
- package/dist/node_modules/@react-pdf/pdfkit/node_modules/pako/lib/zlib/adler32.js +0 -6
- package/dist/node_modules/@react-pdf/pdfkit/node_modules/pako/lib/zlib/constants.js +0 -6
- package/dist/node_modules/@react-pdf/pdfkit/node_modules/pako/lib/zlib/crc32.js +0 -6
- package/dist/node_modules/@react-pdf/pdfkit/node_modules/pako/lib/zlib/deflate.js +0 -6
- package/dist/node_modules/@react-pdf/pdfkit/node_modules/pako/lib/zlib/inffast.js +0 -6
- package/dist/node_modules/@react-pdf/pdfkit/node_modules/pako/lib/zlib/inflate.js +0 -6
- package/dist/node_modules/@react-pdf/pdfkit/node_modules/pako/lib/zlib/inftrees.js +0 -6
- package/dist/node_modules/@react-pdf/pdfkit/node_modules/pako/lib/zlib/messages.js +0 -6
- package/dist/node_modules/@react-pdf/pdfkit/node_modules/pako/lib/zlib/trees.js +0 -6
- package/dist/node_modules/@react-pdf/pdfkit/node_modules/pako/lib/zlib/zstream.js +0 -6
- package/dist/node_modules/@react-pdf/png-js/lib/png-js.browser.js +0 -6
- package/dist/node_modules/@react-pdf/primitives/src/index.js +0 -6
- package/dist/node_modules/@react-pdf/render/lib/index.js +0 -6
- package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.browser.js +0 -15
- package/dist/node_modules/@react-pdf/renderer/node_modules/scheduler/cjs/scheduler.development.js +0 -14
- package/dist/node_modules/@react-pdf/renderer/node_modules/scheduler/cjs/scheduler.production.min.js +0 -14
- package/dist/node_modules/@react-pdf/renderer/node_modules/scheduler/index.js +0 -6
- package/dist/node_modules/@react-pdf/stylesheet/lib/index.js +0 -6
- package/dist/node_modules/@react-pdf/textkit/lib/textkit.js +0 -17
- package/dist/node_modules/abs-svg-path/index.js +0 -6
- package/dist/node_modules/base64-js/index.js +0 -6
- package/dist/node_modules/bidi-js/dist/bidi.js +0 -6
- package/dist/node_modules/brotli/dec/bit_reader.js +0 -6
- package/dist/node_modules/brotli/dec/context.js +0 -6
- package/dist/node_modules/brotli/dec/decode.js +0 -6
- package/dist/node_modules/brotli/dec/dictionary-browser.js +0 -6
- package/dist/node_modules/brotli/dec/dictionary.bin.js +0 -6
- package/dist/node_modules/brotli/dec/dictionary.js +0 -6
- package/dist/node_modules/brotli/dec/huffman.js +0 -6
- package/dist/node_modules/brotli/dec/prefix.js +0 -6
- package/dist/node_modules/brotli/dec/streams.js +0 -6
- package/dist/node_modules/brotli/dec/transform.js +0 -6
- package/dist/node_modules/brotli/decompress.js +0 -6
- package/dist/node_modules/color-name/index.js +0 -6
- package/dist/node_modules/color-string/index.js +0 -6
- package/dist/node_modules/cross-fetch/dist/browser-ponyfill.js +0 -6
- package/dist/node_modules/crypto-js/core.js +0 -6
- package/dist/node_modules/crypto-js/md5.js +0 -6
- package/dist/node_modules/dfa/index.js +0 -6
- package/dist/node_modules/events/events.js +0 -6
- package/dist/node_modules/fast-deep-equal/index.js +0 -6
- package/dist/node_modules/fontkit/dist/browser-module.js +0 -6
- package/dist/node_modules/fontkit/node_modules/@swc/helpers/esm/_define_property.js +0 -6
- package/dist/node_modules/fontkit/node_modules/clone/clone.js +0 -6
- package/dist/node_modules/hsl-to-hex/index.js +0 -6
- package/dist/node_modules/hsl-to-rgb-for-reals/converter.js +0 -6
- package/dist/node_modules/hyphen/hyphen.js +0 -6
- package/dist/node_modules/hyphen/patterns/en-us.js +0 -6
- package/dist/node_modules/jay-peg/src/index.js +0 -6
- package/dist/node_modules/jay-peg/src/markers/dac.js +0 -6
- package/dist/node_modules/jay-peg/src/markers/dht.js +0 -6
- package/dist/node_modules/jay-peg/src/markers/dqt.js +0 -6
- package/dist/node_modules/jay-peg/src/markers/dri.js +0 -6
- package/dist/node_modules/jay-peg/src/markers/eoi.js +0 -6
- package/dist/node_modules/jay-peg/src/markers/exif.js +0 -6
- package/dist/node_modules/jay-peg/src/markers/jfif.js +0 -6
- package/dist/node_modules/jay-peg/src/markers/sof.js +0 -6
- package/dist/node_modules/jay-peg/src/markers/soi.js +0 -6
- package/dist/node_modules/jay-peg/src/markers/sos.js +0 -6
- package/dist/node_modules/jay-peg/src/markers/utils.js +0 -6
- package/dist/node_modules/media-engine/src/index.js +0 -6
- package/dist/node_modules/media-engine/src/operators.js +0 -6
- package/dist/node_modules/media-engine/src/parser.js +0 -6
- package/dist/node_modules/media-engine/src/queries.js +0 -6
- package/dist/node_modules/normalize-svg-path/index.js +0 -6
- package/dist/node_modules/object-assign/index.js +0 -11
- package/dist/node_modules/parse-svg-path/index.js +0 -6
- package/dist/node_modules/postcss-value-parser/lib/parse.js +0 -6
- package/dist/node_modules/postcss-value-parser/lib/unit.js +0 -6
- package/dist/node_modules/queue/index.js +0 -6
- package/dist/node_modules/restructure/src/Array.js +0 -6
- package/dist/node_modules/restructure/src/Base.js +0 -6
- package/dist/node_modules/restructure/src/Bitfield.js +0 -6
- package/dist/node_modules/restructure/src/Buffer.js +0 -6
- package/dist/node_modules/restructure/src/DecodeStream.js +0 -6
- package/dist/node_modules/restructure/src/EncodeStream.js +0 -6
- package/dist/node_modules/restructure/src/LazyArray.js +0 -6
- package/dist/node_modules/restructure/src/Number.js +0 -6
- package/dist/node_modules/restructure/src/Optional.js +0 -6
- package/dist/node_modules/restructure/src/Pointer.js +0 -6
- package/dist/node_modules/restructure/src/Reserved.js +0 -6
- package/dist/node_modules/restructure/src/String.js +0 -6
- package/dist/node_modules/restructure/src/Struct.js +0 -6
- package/dist/node_modules/restructure/src/VersionedStruct.js +0 -6
- package/dist/node_modules/restructure/src/utils.js +0 -6
- package/dist/node_modules/simple-swizzle/index.js +0 -6
- package/dist/node_modules/simple-swizzle/node_modules/is-arrayish/index.js +0 -6
- package/dist/node_modules/svg-arc-to-cubic-bezier/modules/index.js +0 -6
- package/dist/node_modules/tiny-inflate/index.js +0 -6
- package/dist/node_modules/unicode-properties/dist/module.js +0 -6
- package/dist/node_modules/unicode-trie/index.js +0 -6
- package/dist/node_modules/unicode-trie/swap.js +0 -6
- package/dist/node_modules/yoga-layout/src/entrypoint/asmjs-async-web.js +0 -6
- package/dist/node_modules/yoga-layout/src/generated/YGEnums.js +0 -6
- package/dist/node_modules/yoga-layout/src/wrapAssembly.js +0 -6
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{__module as t}from"../../_virtual/
|
|
6
|
+
import{__module as t}from"../../_virtual/index.js";import{f as r}from"../function-bind/index.js";import{g as e}from"../get-intrinsic/index.js";import{s as o}from"../set-function-length/index.js";import{t as n}from"../es-errors/type.js";import{__require as i}from"../es-define-property/index.js";!function(t){var p=r,s=e,a=o,f=n,u=s("%Function.prototype.apply%"),l=s("%Function.prototype.call%"),c=s("%Reflect.apply%",!0)||p.call(l,u),m=i(),x=s("%Math.max%");t.exports=function(t){if("function"!=typeof t)throw new f("a function is required");var r=c(p,l,arguments);return a(r,1+x(0,t.length-(arguments.length-1)),!0)};var d=function(){return c(p,u,arguments)};m?m(t.exports,"apply",{value:d}):t.exports.apply=d}(t);var p=t.exports;export{p as c};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
var
|
|
6
|
+
var r=function(){return r=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},r.apply(this,arguments)};function t(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(e[n[o]]=r[n[o]])}return e}function e(r,t,e,n){return new(e||(e=Promise))((function(o,l){function a(r){try{c(n.next(r))}catch(r){l(r)}}function i(r){try{c(n.throw(r))}catch(r){l(r)}}function c(r){var t;r.done?o(r.value):(t=r.value,t instanceof e?t:new e((function(r){r(t)}))).then(a,i)}c((n=n.apply(r,t||[])).next())}))}function n(r,t){var e,n,o,l,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function i(i){return function(c){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;l&&(l=0,i[0]&&(a=0)),a;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(r,a)}catch(r){i=[6,r],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}function o(r){var t="function"==typeof Symbol&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&"number"==typeof r.length)return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function l(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,l=e.call(r),a=[];try{for(;(void 0===t||t-- >0)&&!(n=l.next()).done;)a.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(e=l.return)&&e.call(l)}finally{if(o)throw o.error}}return a}function a(r,t,e){if(e||2===arguments.length)for(var n,o=0,l=t.length;o<l;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return r.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;export{r as __assign,e as __awaiter,n as __generator,l as __read,t as __rest,a as __spreadArray,o as __values};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__assign as e,__read as t}from"../../../../node_modules/tslib/tslib.es6.js";import n from"next/dynamic";import{StyleSheet as l}from"
|
|
7
|
+
import{__assign as e,__read as t}from"../../../../node_modules/tslib/tslib.es6.js";import n from"next/dynamic";import{StyleSheet as l}from"@react-pdf/renderer";import r,{Fragment as o,useState as c}from"react";import i from"@mui/material/IconButton";import a from"@mui/material/Dialog";import m from"@mui/material/DialogContent";import u from"@mui/material/DialogActions";import d from"@mui/material/Button";import s from"@mui/icons-material/PictureAsPdf";function E(t){var c,i,a=t.props,m=function(){return r.createElement("p",null,"Loading...")},u=n((function(){return import("@react-pdf/renderer").then((function(e){return e.Page}))}),{ssr:!1,loading:m}),d=n((function(){return import("@react-pdf/renderer").then((function(e){return e.Text}))}),{ssr:!1,loading:m});n((function(){return import("@react-pdf/renderer").then((function(e){return e.Image}))}),{ssr:!1,loading:m}),n((function(){return import("@react-pdf/renderer").then((function(e){return e.Svg}))}),{ssr:!1,loading:m});var s=n((function(){return import("@react-pdf/renderer").then((function(e){return e.View}))}),{ssr:!1,loading:m}),E=n((function(){return import("@react-pdf/renderer").then((function(e){return e.Document}))}),{ssr:!1,loading:m}),y=l.create({page:{flexDirection:"column",backgroundColor:"#E4E4E4"},header:{padding:10,flexDirection:"row",alignItems:"center"},logo:{width:24,height:24,marginRight:10},section:{margin:10,padding:10,fontSize:12},row:{flexDirection:"row"},rowSection:{flex:1},productRowSection:{flex:1,width:1/6},h1:{fontSize:28},h2:{fontSize:24,fontStyle:"bold"},h3:{fontSize:16,fontStyle:"bold"}}),p=a.invoice,f=p.seller_business_credentials,v=p.seller_company_address,S=p.buyer_company_address,_=p.buyer_business_credentials;return r.createElement(E,null,r.createElement(u,{size:"A4",style:y.page},r.createElement(s,{style:y.header},r.createElement(d,{style:y.h1},null==f?void 0:f.company_name)),r.createElement(s,{style:y.section},r.createElement(d,{style:y.h2},"INVOICE")),r.createElement(s,{style:y.section},r.createElement(s,{style:y.row},r.createElement(s,{style:y.rowSection},r.createElement(d,{style:y.h3},"BILLING DETAILS"),r.createElement(d,null,null==_?void 0:_.company_name),r.createElement(d,null,null==p?void 0:p.buyer_first_name," ",null==p?void 0:p.buyer_last_name),r.createElement(d,null,null==S?void 0:S.street," ",null==S?void 0:S.street_number," ",null==S?void 0:S.street_number_addition),r.createElement(d,null,null==S?void 0:S.postal_code," ",null==S?void 0:S.city)),r.createElement(s,{style:y.rowSection},r.createElement(d,{style:y.h3},"FROM"),r.createElement(d,null,null==f?void 0:f.company_name),r.createElement(d,null,null==v?void 0:v.street," ",null==v?void 0:v.street_number," ",null==v?void 0:v.street_number_addition),r.createElement(d,null,null==v?void 0:v.postal_code," ",null==v?void 0:v.city),r.createElement(d,{style:{fontStyle:"bold",marginTop:10}},"CoC Number"),r.createElement(d,null,null==f?void 0:f.coc_number),r.createElement(d,{style:{fontStyle:"bold",marginTop:10}},"VAT Number"),r.createElement(d,null,null==f?void 0:f.vat_number)))),r.createElement(s,{style:y.section},r.createElement(s,{style:y.row},r.createElement(s,{style:y.rowSection},r.createElement(d,{style:{fontStyle:"bold"}},"Invoice number"),r.createElement(d,null,null==p?void 0:p.invoice_number)),r.createElement(s,{style:y.rowSection},r.createElement(d,{style:{fontStyle:"bold"}},"Invoice date"),r.createElement(d,null,null==p?void 0:p.invoice_date)))),r.createElement(s,{style:y.section},r.createElement(d,{style:y.h3},"SUMMARY"),r.createElement(s,{style:y.row},r.createElement(s,{style:y.productRowSection},r.createElement(d,{style:{fontStyle:"bold"}},"Title")),r.createElement(s,{style:y.productRowSection},r.createElement(d,{style:{fontStyle:"bold"}},"Amount")),r.createElement(s,{style:y.productRowSection},r.createElement(d,{style:{fontStyle:"bold"}},"VAT rate")),r.createElement(s,{style:y.productRowSection},r.createElement(d,{style:{fontStyle:"bold"}},"VAT")),r.createElement(s,{style:y.productRowSection},r.createElement(d,{style:{fontStyle:"bold"}},"Excl. VAT")),r.createElement(s,{style:y.productRowSection},r.createElement(d,{style:{fontStyle:"bold"}},"Incl. VAT"))),null===(c=null==p?void 0:p.items)||void 0===c?void 0:c.map((function(e,t){return r.createElement(o,{key:t},r.createElement(s,{style:y.row},r.createElement(s,{style:y.productRowSection},r.createElement(d,null,e.product_title)),r.createElement(s,{style:y.productRowSection},r.createElement(d,null,e.quantity)),r.createElement(s,{style:y.productRowSection},r.createElement(d,null,e.vat_rate," %")),r.createElement(s,{style:y.productRowSection},r.createElement(d,null,"€ ",(e.price_incl_vat-e.price_excl_vat).toFixed(2))),r.createElement(s,{style:y.productRowSection},r.createElement(d,null,"€ ",e.price_excl_vat)),r.createElement(s,{style:y.productRowSection},r.createElement(d,null,"€ ",e.price_incl_vat))))}))),r.createElement(s,{style:y.section},r.createElement(d,{style:y.h3},"TOTALS"),r.createElement(s,{style:y.row},r.createElement(s,{style:y.productRowSection}),r.createElement(s,{style:y.productRowSection}),r.createElement(s,{style:y.productRowSection}),r.createElement(s,{style:y.productRowSection},r.createElement(d,{style:{fontStyle:"bold"}},"VAT")),r.createElement(s,{style:y.productRowSection},r.createElement(d,{style:{fontStyle:"bold"}},"Excl. VAT")),r.createElement(s,{style:y.productRowSection},r.createElement(d,{style:{fontStyle:"bold"}},"Incl. VAT"))),r.createElement(s,{style:y.row},r.createElement(s,{style:y.productRowSection}),r.createElement(s,{style:y.productRowSection}),r.createElement(s,{style:y.productRowSection}),r.createElement(s,{style:y.productRowSection},r.createElement(d,null,"€ ",null===(i=null==p?void 0:p.VAT_total)||void 0===i?void 0:i.toFixed(2))),r.createElement(s,{style:y.productRowSection},r.createElement(d,null,"€ ",null==p?void 0:p.total_excl_vat)),r.createElement(s,{style:y.productRowSection},r.createElement(d,null,"€ ",null==p?void 0:p.total_incl_vat)))),r.createElement(s,{style:y.section},r.createElement(d,{style:e(e({},y.h3),{border:"2px solid black",padding:10})},"Total Due: € ",null==p?void 0:p.total_incl_vat))))}function y(e){var t=e.invoice,l=n((function(){return import("@react-pdf/renderer").then((function(e){return e.PDFDownloadLink}))}),{ssr:!1,loading:function(){return r.createElement("p",null,"Loading...")}});return r.createElement(l,{document:r.createElement(E,{props:{invoice:t}}),fileName:"invoice_".concat(null==t?void 0:t.invoice_number)},r.createElement(i,null,r.createElement(s,null)))}function p(e){var l=e.invoice,o=n((function(){return import("@react-pdf/renderer").then((function(e){return e.PDFViewer}))}),{ssr:!1,loading:function(){return r.createElement("p",null,"Loading...")}}),y=t(c(!1),2),p=y[0],f=y[1];return r.createElement(r.Fragment,null,r.createElement(i,{onClick:function(){return f(!0)}},r.createElement(s,null)),r.createElement(a,{open:p,fullWidth:!0,maxWidth:"lg"},r.createElement(m,null,r.createElement(o,{style:{width:"100%",minHeight:"70vh"}},r.createElement(E,{props:{invoice:l}}))),r.createElement(u,null,r.createElement(d,{variant:"contained",onClick:function(){return f(!1)}},"Close"))))}export{y as InvoiceDownloadLink,p as InvoicePDFViewer,E as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "umwd-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.301",
|
|
4
4
|
"description": "UMWD Component library",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"module": "dist/src/index.js",
|
|
@@ -87,11 +87,11 @@
|
|
|
87
87
|
"react": "^18.2.0",
|
|
88
88
|
"react-dom": "^18.2.0",
|
|
89
89
|
"validator": "^13.11.0",
|
|
90
|
-
"zod": "^3.23.0"
|
|
90
|
+
"zod": "^3.23.0",
|
|
91
|
+
"@react-pdf/renderer": "^3.4.4"
|
|
91
92
|
},
|
|
92
93
|
"dependencies": {
|
|
93
94
|
"@mollie/api-client": "^3.7.0",
|
|
94
|
-
"@react-pdf/renderer": "^3.4.4",
|
|
95
95
|
"@strapi/blocks-react-renderer": "^1.0.1",
|
|
96
96
|
"next-router-mock": "^0.9.12",
|
|
97
97
|
"qs": "^6.12.0",
|
package/dist/_virtual/YGEnums.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* UMWD-Components
|
|
3
|
-
* @copyright Jelle Paulus
|
|
4
|
-
* @license MIT
|
|
5
|
-
*/
|
|
6
|
-
function r(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}export{r as commonjsRequire};
|
package/dist/_virtual/clone.js
DELETED
package/dist/_virtual/common.js
DELETED
package/dist/_virtual/context.js
DELETED
package/dist/_virtual/core.js
DELETED
package/dist/_virtual/decode.js
DELETED
package/dist/_virtual/deflate.js
DELETED
package/dist/_virtual/en-us.js
DELETED
package/dist/_virtual/events.js
DELETED
package/dist/_virtual/huffman.js
DELETED
package/dist/_virtual/hyphen.js
DELETED
package/dist/_virtual/index2.js
DELETED
package/dist/_virtual/index3.js
DELETED
package/dist/_virtual/index4.js
DELETED
package/dist/_virtual/index5.js
DELETED
package/dist/_virtual/index6.js
DELETED
package/dist/_virtual/inflate.js
DELETED
package/dist/_virtual/md5.js
DELETED
package/dist/_virtual/prefix.js
DELETED
package/dist/_virtual/streams.js
DELETED
package/dist/_virtual/trees.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* UMWD-Components
|
|
3
|
-
* @copyright Jelle Paulus
|
|
4
|
-
* @license MIT
|
|
5
|
-
*/
|
|
6
|
-
function n(n,t,r,e,o,i,u){try{var a=n[i](u),c=a.value}catch(n){return void r(n)}a.done?t(c):Promise.resolve(c).then(e,o)}function t(t){return function(){var r=this,e=arguments;return new Promise((function(o,i){var u=t.apply(r,e);function a(t){n(u,o,i,a,c,"next",t)}function c(t){n(u,o,i,a,c,"throw",t)}a(void 0)}))}}export{t as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* UMWD-Components
|
|
3
|
-
* @copyright Jelle Paulus
|
|
4
|
-
* @license MIT
|
|
5
|
-
*/
|
|
6
|
-
import e from"./toPropertyKey.js";function r(r,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,e(n.key),n)}}function t(e,t,o){return t&&r(e.prototype,t),o&&r(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}export{t as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* UMWD-Components
|
|
3
|
-
* @copyright Jelle Paulus
|
|
4
|
-
* @license MIT
|
|
5
|
-
*/
|
|
6
|
-
import e from"./unsupportedIterableToArray.js";function r(r,t){var n="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(n)return(n=n.call(r)).next.bind(n);if(Array.isArray(r)||(n=e(r))||t&&r&&"number"==typeof r.length){n&&(r=n);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}export{r as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* UMWD-Components
|
|
3
|
-
* @copyright Jelle Paulus
|
|
4
|
-
* @license MIT
|
|
5
|
-
*/
|
|
6
|
-
function t(){return t=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},t.apply(this,arguments)}export{t as default};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* UMWD-Components
|
|
3
|
-
* @copyright Jelle Paulus
|
|
4
|
-
* @license MIT
|
|
5
|
-
*/
|
|
6
|
-
import t from"./typeof.js";function r(){
|
|
7
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
8
|
-
r=function(){return n};var e,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",h=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(e){l=function(t,r,e){return t[r]=e}}function s(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,i=Object.create(o.prototype),c=new T(n||[]);return a(i,"_invoke",{value:G(t,e,c)}),i}function p(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}n.wrap=s;var y="suspendedStart",v="suspendedYield",d="executing",g="completed",m={};function w(){}function L(){}function b(){}var x={};l(x,u,(function(){return this}));var E=Object.getPrototypeOf,_=E&&E(E(F([])));_&&_!==o&&i.call(_,u)&&(x=_);var j=b.prototype=w.prototype=Object.create(x);function O(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function k(r,e){function n(o,a,c,u){var h=p(r[o],r,a);if("throw"!==h.type){var f=h.arg,l=f.value;return l&&"object"==t(l)&&i.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):e.resolve(l).then((function(t){f.value=t,c(f)}),(function(t){return n("throw",t,c,u)}))}u(h.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}})}function G(t,r,n){var o=y;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=N(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var h=p(t,r,n);if("normal"===h.type){if(o=n.done?g:v,h.arg===m)continue;return{value:h.arg,done:n.done}}"throw"===h.type&&(o=g,n.method="throw",n.arg=h.arg)}}}function N(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,N(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function S(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function F(r){if(r||""===r){var n=r[u];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function t(){for(;++o<r.length;)if(i.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(t(r)+" is not iterable")}return L.prototype=b,a(j,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:L,configurable:!0}),L.displayName=l(b,f,"GeneratorFunction"),n.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===L||"GeneratorFunction"===(r.displayName||r.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,f,"GeneratorFunction")),t.prototype=Object.create(j),t},n.awrap=function(t){return{__await:t}},O(k.prototype),l(k.prototype,h,(function(){return this})),n.AsyncIterator=k,n.async=function(t,r,e,o,i){void 0===i&&(i=Promise);var a=new k(s(t,r,e,o),i);return n.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(j),l(j,f,"Generator"),l(j,u,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=F,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),h=i.call(a,"finallyLoc");if(u&&h){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!h)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),S(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;S(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:F(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},n}export{r as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* UMWD-Components
|
|
3
|
-
* @copyright Jelle Paulus
|
|
4
|
-
* @license MIT
|
|
5
|
-
*/
|
|
6
|
-
import r from"./typeof.js";function t(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var o=i.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}export{t as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* UMWD-Components
|
|
3
|
-
* @copyright Jelle Paulus
|
|
4
|
-
* @license MIT
|
|
5
|
-
*/
|
|
6
|
-
function o(t){"@babel/helpers - typeof";return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},o(t)}export{o as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* UMWD-Components
|
|
3
|
-
* @copyright Jelle Paulus
|
|
4
|
-
* @license MIT
|
|
5
|
-
*/
|
|
6
|
-
import r from"./arrayLikeToArray.js";function t(t,e){if(t){if("string"==typeof t)return r(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(t,e):void 0}}export{t as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* UMWD-Components
|
|
3
|
-
* @copyright Jelle Paulus
|
|
4
|
-
* @license MIT
|
|
5
|
-
*/
|
|
6
|
-
import r from"../../../@babel/runtime/helpers/esm/regeneratorRuntime.js";import n from"../../../@babel/runtime/helpers/esm/asyncToGenerator.js";var e=function(r,n,e){var t;if(r>=0&&r>=e.length)return e;if(r<0&&Math.abs(r)>e.length)return e;var u=r<0?e.length+r:r;return Object.assign([],e,((t={})[u]=n(e[u]),t))},t=function(r){return Array.prototype.slice.call(r,0).reverse()},u=function(){for(var e=arguments.length,u=new Array(e),a=0;a<e;a++)u[a]=arguments[a];return function(){var e=n(r().mark((function n(e){var a,o,c,i,f,s,l,p=arguments;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:for(a=e,o=t(u),c=p.length,i=new Array(c>1?c-1:0),f=1;f<c;f++)i[f-1]=p[f];s=0;case 4:if(!(s<o.length)){r.next=12;break}return l=o[s],r.next=8,l.apply(void 0,[a].concat(i));case 8:a=r.sent;case 9:s+=1,r.next=4;break;case 12:return r.abrupt("return",a);case 13:case"end":return r.stop()}}),n)})));return function(r){return e.apply(this,arguments)}}()},a=function(r){return r?r.replace(/(^|\s)\S/g,(function(r){return r.toUpperCase()})):r},o=function(r){return Array.isArray(r)?r:[r]},c=function(){for(var r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];return function(r){for(var e=r,u=t(n),a=arguments.length,o=new Array(a>1?a-1:0),c=1;c<a;c++)o[c-1]=arguments[c];for(var i=0;i<u.length;i+=1){e=u[i].apply(void 0,[e].concat(o))}return e}},i=function(r){return r.slice(0,r.length-1)},f=function r(n,e){for(var t=e instanceof Array?[]:{},u=Object.keys(e),a=0;a<u.length;a+=1){var o=u[a],c=n[o],i=typeof c;t[o]="function"===i?c(e[o]):c&&"object"===i?r(c,e[o]):e[o]}return t},s=function(r){return null==r},l=function(r,n,e){if(s(r))return e;for(var t=o(n),u=r,a=0;a<t.length;a+=1){if(s(u))return;u=u[t[a]]}return s(u)?e:u},p=function(r){return""===r?"":r[r.length-1]},v=function(r,n){return Object.entries(r).reduce((function(r,e,t){var u=e[0],a=e[1];return r[u]=n(a,u,t),r}),{})},h=function(r){var n=function(r){return/((-)?\d+\.?\d*)%/g.exec(""+r)}(r);if(n){var e=parseFloat(n[1]);return{percent:e/100,value:e}}return null},g=function(r,n){var e=o(r),t=Object.assign({},n);return e.forEach((function(r){delete t[r]})),t},y=function(r,n){for(var e={},t=0;t<r.length;t+=1){var u=r[t];u in n&&(e[u]=n[u])}return e},b=function(r,n){void 0===n&&(n=0);for(var e=new Array(n),t=0;t<n;t+=1)e[t]=r;return e},m=function(r){return r?r.charAt(0).toUpperCase()+r.slice(1):r};export{e as adjust,u as asyncCompose,a as capitalize,o as castArray,c as compose,i as dropLast,f as evolve,l as get,s as isNil,p as last,v as mapValues,h as matchPercent,g as omit,y as pick,b as repeat,t as reverse,m as upperFirst};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* UMWD-Components
|
|
3
|
-
* @copyright Jelle Paulus
|
|
4
|
-
* @license MIT
|
|
5
|
-
*/
|
|
6
|
-
import t from"../../../@babel/runtime/helpers/esm/regeneratorRuntime.js";import e from"../../../@babel/runtime/helpers/esm/asyncToGenerator.js";import r from"../../../@babel/runtime/helpers/esm/extends.js";import n from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js";import i from"../../../cross-fetch/dist/browser-ponyfill.js";import{create as o}from"../../../fontkit/dist/browser-module.js";var s=["src","fontWeight","fontStyle"],a={thin:100,hairline:100,ultralight:200,extralight:200,light:300,normal:400,medium:500,semibold:600,demibold:600,bold:700,ultrabold:800,extrabold:800,heavy:900,black:900},u=function(){var r=e(t().mark((function e(r,n){var o,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i(r,n);case 2:return o=t.sent,t.next=5,o.arrayBuffer();case 5:return s=t.sent,t.abrupt("return",new Uint8Array(s));case 7:case"end":return t.stop()}}),e)})));return function(t,e){return r.apply(this,arguments)}}(),l=function(t,e){return t.fontWeight-e.fontWeight},f=function(){function r(t,e,r,n,i){this.src=t,this.fontFamily=e,this.fontStyle=r||"normal",this.fontWeight=n||400,this.data=null,this.options=i,this.loadResultPromise=null}var n=r.prototype;return n._load=function(){var r=e(t().mark((function e(){var r,n,i,s,a,l,f,c,h;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.options.postscriptName,e=this.src,m=void 0,d=void 0,p=void 0,m=e.split(",")[0],d="data:"===m.substring(0,5),p="base64"===m.split(";")[1],!d||!p){t.next=7;break}n=this.src.split(",")[1],i=new Uint8Array(atob(n).split("").map((function(t){return t.charCodeAt(0)}))),this.data=o(i,r),t.next=19;break;case 7:return s=this.options,a=s.headers,l=s.body,f=s.method,c=void 0===f?"GET":f,t.next=11,u(this.src,{method:c,body:l,headers:a});case 11:h=t.sent,this.data=o(h,r),t.next=19;break;case 15:t.next=19;break;case 18:this.data=t.sent;case 19:case"end":return t.stop()}var e,m,d,p}),e,this)})));return function(){return r.apply(this,arguments)}}(),n.load=function(){var r=e(t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return null===this.loadResultPromise&&(this.loadResultPromise=this._load()),t.abrupt("return",this.loadResultPromise);case 2:case"end":return t.stop()}}),e,this)})));return function(){return r.apply(this,arguments)}}(),r}(),c=function(){function t(t){this.family=t,this.sources=[]}t.create=function(e){return new t(e)};var e=t.prototype;return e.register=function(t){var e,r=t.src,i=t.fontWeight,o=t.fontStyle,u=n(t,s),l="string"==typeof(e=i)?a[e]:e;this.sources.push(new f(r,this.family,o,l,u))},e.resolve=function(t){var e,r=t.fontWeight,n=void 0===r?400:r,i=t.fontStyle,o=void 0===i?"normal":i,s=this.sources.filter((function(t){return t.fontStyle===o})),a=s.find((function(t){return t.fontWeight===n}));if(a)return a;if(n>=400&&n<=500){var u=s.filter((function(t){return t.fontWeight<=n})),f=s.filter((function(t){return t.fontWeight>500}));e=s.filter((function(t){return t.fontWeight>=n&&t.fontWeight<500}))[0]||u[u.length-1]||f[0]}var c=s.filter((function(t){return t.fontWeight<n})).sort(l),h=s.filter((function(t){return t.fontWeight>n})).sort(l);if(n<400&&(e=c[c.length-1]||h[0]),n>500&&(e=h[0]||c[c.length-1]),!e)throw new Error("Could not resolve font for "+this.family+", fontWeight "+n);return e},t}(),h=["Courier","Courier-Bold","Courier-Oblique","Courier-BoldOblique","Helvetica","Helvetica-Bold","Helvetica-Oblique","Helvetica-BoldOblique","Times-Roman","Times-Bold","Times-Italic","Times-BoldItalic"];function m(){var n=this,i={},o=null,s=null;this.register=function(t){var e=t.family;if(i[e]||(i[e]=c.create(e)),t.fonts)for(var n=0;n<t.fonts.length;n+=1)i[e].register(r({family:e},t.fonts[n]));else i[e].register(t)},this.registerEmojiSource=function(t){var e=t.url,r=t.format,n=void 0===r?"png":r,i=t.builder,s=t.withVariationSelectors;o={url:e,format:n,builder:i,withVariationSelectors:void 0!==s&&s}},this.registerHyphenationCallback=function(t){s=t},this.getFont=function(t){var e=t.fontFamily;if(h.includes(e))return null;if(!i[e])throw new Error("Font family not registered: "+e+". Please register it calling Font.register() method.");return i[e].resolve(t)},this.load=function(){var i=e(t().mark((function e(i){var o,s,a,u,l,f,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=i.fontFamily,s="string"==typeof o?[o]:[].concat(o||[]),a=[],u=s.length,l=0;case 4:if(!(l<u)){t.next=14;break}if(f=s[l],!h.includes(f)){t.next=9;break}return t.abrupt("return");case 9:c=n.getFont(r({},i,{fontFamily:f})),a.push(c.load());case 11:l+=1,t.next=4;break;case 14:return t.next=16,Promise.all(a);case 16:case"end":return t.stop()}}),e)})));return function(t){return i.apply(this,arguments)}}(),this.reset=function(){for(var t=Object.keys(i),e=0;e<t.length;e+=1){var r=t[e];i[r].data=null}},this.clear=function(){i={}},this.getRegisteredFonts=function(){return i},this.getEmojiSource=function(){return o},this.getHyphenationCallback=function(){return s},this.getRegisteredFontFamilies=function(){return Object.keys(i)}}export{m as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* UMWD-Components
|
|
3
|
-
* @copyright Jelle Paulus
|
|
4
|
-
* @license MIT
|
|
5
|
-
*/
|
|
6
|
-
import t from"../../../@babel/runtime/helpers/esm/regeneratorRuntime.js";import r from"../../../@babel/runtime/helpers/esm/asyncToGenerator.js";import e from"../../../cross-fetch/dist/browser-ponyfill.js";import n from"../../png-js/lib/png-js.browser.js";import i from"../../../jay-peg/src/index.js";var o="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},u=[],f=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a=!1;function h(){a=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0;r<64;++r)u[r]=t[r],f[t.charCodeAt(r)]=r;f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63}function c(t,r,e){for(var n,i,o=[],f=r;f<e;f+=3)n=(t[f]<<16)+(t[f+1]<<8)+t[f+2],o.push(u[(i=n)>>18&63]+u[i>>12&63]+u[i>>6&63]+u[63&i]);return o.join("")}function l(t){var r;a||h();for(var e=t.length,n=e%3,i="",o=[],f=16383,s=0,l=e-n;s<l;s+=f)o.push(c(t,s,s+f>l?l:s+f));return 1===n?(r=t[e-1],i+=u[r>>2],i+=u[r<<4&63],i+="=="):2===n&&(r=(t[e-2]<<8)+t[e-1],i+=u[r>>10],i+=u[r>>4&63],i+=u[r<<2&63],i+="="),o.push(i),o.join("")}function p(t,r,e,n,i){var o,u,f=8*i-n-1,s=(1<<f)-1,a=s>>1,h=-7,c=e?i-1:0,l=e?-1:1,p=t[r+c];for(c+=l,o=p&(1<<-h)-1,p>>=-h,h+=f;h>0;o=256*o+t[r+c],c+=l,h-=8);for(u=o&(1<<-h)-1,o>>=-h,h+=n;h>0;u=256*u+t[r+c],c+=l,h-=8);if(0===o)o=1-a;else{if(o===s)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),o-=a}return(p?-1:1)*u*Math.pow(2,o-n)}function g(t,r,e,n,i,o){var u,f,s,a=8*o-i-1,h=(1<<a)-1,c=h>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(f=isNaN(r)?1:0,u=h):(u=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-u))<1&&(u--,s*=2),(r+=u+c>=1?l/s:l*Math.pow(2,1-c))*s>=2&&(u++,s/=2),u+c>=h?(f=0,u=h):u+c>=1?(f=(r*s-1)*Math.pow(2,i),u+=c):(f=r*Math.pow(2,c-1)*Math.pow(2,i),u=0));i>=8;t[e+p]=255&f,p+=g,f/=256,i-=8);for(u=u<<i|f,a+=i;a>0;t[e+p]=255&u,p+=g,u/=256,a-=8);t[e+p-g]|=128*y}var y={}.toString,w=Array.isArray||function(t){return"[object Array]"==y.call(t)};function d(){return m.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function v(t,r){if(d()<r)throw new RangeError("Invalid typed array length");return m.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=m.prototype:(null===t&&(t=new m(r)),t.length=r),t}function m(t,r,e){if(!(m.TYPED_ARRAY_SUPPORT||this instanceof m))return new m(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return A(this,t)}return b(this,t,r,e)}function b(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);m.TYPED_ARRAY_SUPPORT?(t=r).__proto__=m.prototype:t=R(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!m.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|T(r,e);t=v(t,n);var i=t.write(r,e);i!==n&&(t=t.slice(0,i));return t}(t,r,e):function(t,r){if(P(r)){var e=0|_(r.length);return 0===(t=v(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?v(t,0):R(t,r);if("Buffer"===r.type&&w(r.data))return R(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function E(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function A(t,r){if(E(r),t=v(t,r<0?0:0|_(r)),!m.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function R(t,r){var e=r.length<0?0:0|_(r.length);t=v(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function _(t){if(t>=d())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d().toString(16)+" bytes");return 0|t}function P(t){return!(null==t||!t._isBuffer)}function T(t,r){if(P(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return tt(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}function B(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return F(this,r,e);case"utf8":case"utf-8":return k(this,r,e);case"ascii":return N(this,r,e);case"latin1":case"binary":return z(this,r,e);case"base64":return D(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function U(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function S(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=m.from(r,n)),P(r))return 0===r.length?-1:I(t,r,e,n,i);if("number"==typeof r)return r&=255,m.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):I(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function I(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function a(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var h=-1;for(o=e;o<f;o++)if(a(t,o)===a(r,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===s)return h*u}else-1!==h&&(o-=o-h),h=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(a(t,o+l)!==a(r,l)){c=!1;break}if(c)return o}return-1}function Y(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function x(t,r,e,n){return rt($(r,t.length-e),t,e,n)}function C(t,r,e,n){return rt(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function O(t,r,e,n){return C(t,r,e,n)}function L(t,r,e,n){return rt(tt(r),t,e,n)}function M(t,r,e,n){return rt(function(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}(r,t.length-e),t,e,n)}function D(t,r,e){return 0===r&&e===t.length?l(t):l(t.slice(r,e))}function k(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,a=t[i],h=null,c=a>239?4:a>223?3:a>191?2:1;if(i+c<=e)switch(c){case 1:a<128&&(h=a);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&a)<<6|63&o)>127&&(h=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&a)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(h=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&a)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(h=s)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var r=t.length;if(r<=j)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=j));return e}(n)}m.TYPED_ARRAY_SUPPORT=void 0===o.TYPED_ARRAY_SUPPORT||o.TYPED_ARRAY_SUPPORT,d(),m.poolSize=8192,m._augment=function(t){return t.__proto__=m.prototype,t},m.from=function(t,r,e){return b(null,t,r,e)},m.TYPED_ARRAY_SUPPORT&&(m.prototype.__proto__=Uint8Array.prototype,m.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&m[Symbol.species]),m.alloc=function(t,r,e){return function(t,r,e,n){return E(r),r<=0?v(t,r):void 0!==e?"string"==typeof n?v(t,r).fill(e,n):v(t,r).fill(e):v(t,r)}(null,t,r,e)},m.allocUnsafe=function(t){return A(null,t)},m.allocUnsafeSlow=function(t){return A(null,t)},m.isBuffer=function(t){return null!=t&&(!!t._isBuffer||et(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&et(t.slice(0,0))}(t))},m.compare=function(t,r){if(!P(t)||!P(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},m.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},m.concat=function(t,r){if(!w(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return m.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=m.allocUnsafe(r),i=0;for(e=0;e<t.length;++e){var o=t[e];if(!P(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},m.byteLength=T,m.prototype._isBuffer=!0,m.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)U(this,r,r+1);return this},m.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)U(this,r,r+3),U(this,r+1,r+2);return this},m.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)U(this,r,r+7),U(this,r+1,r+6),U(this,r+2,r+5),U(this,r+3,r+4);return this},m.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?k(this,0,t):B.apply(this,arguments)},m.prototype.equals=function(t){if(!P(t))throw new TypeError("Argument must be a Buffer");return this===t||0===m.compare(this,t)},m.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},m.prototype.compare=function(t,r,e,n,i){if(!P(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),f=Math.min(o,u),s=this.slice(n,i),a=t.slice(r,e),h=0;h<f;++h)if(s[h]!==a[h]){o=s[h],u=a[h];break}return o<u?-1:u<o?1:0},m.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},m.prototype.indexOf=function(t,r,e){return S(this,t,r,e,!0)},m.prototype.lastIndexOf=function(t,r,e){return S(this,t,r,e,!1)},m.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return Y(this,t,r,e);case"utf8":case"utf-8":return x(this,t,r,e);case"ascii":return C(this,t,r,e);case"latin1":case"binary":return O(this,t,r,e);case"base64":return L(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var j=4096;function N(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function z(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function F(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Q(t[o]);return i}function V(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function G(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function J(t,r,e,n,i,o){if(!P(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function Z(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function q(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function W(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function X(t,r,e,n,i){return i||W(t,0,e,4),g(t,r,e,n,23,4),e+4}function H(t,r,e,n,i){return i||W(t,0,e,8),g(t,r,e,n,52,8),e+8}m.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),m.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=m.prototype;else{var i=r-t;e=new m(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},m.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||G(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},m.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||G(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},m.prototype.readUInt8=function(t,r){return r||G(t,1,this.length),this[t]},m.prototype.readUInt16LE=function(t,r){return r||G(t,2,this.length),this[t]|this[t+1]<<8},m.prototype.readUInt16BE=function(t,r){return r||G(t,2,this.length),this[t]<<8|this[t+1]},m.prototype.readUInt32LE=function(t,r){return r||G(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},m.prototype.readUInt32BE=function(t,r){return r||G(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},m.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||G(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},m.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||G(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},m.prototype.readInt8=function(t,r){return r||G(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},m.prototype.readInt16LE=function(t,r){r||G(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},m.prototype.readInt16BE=function(t,r){r||G(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},m.prototype.readInt32LE=function(t,r){return r||G(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},m.prototype.readInt32BE=function(t,r){return r||G(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},m.prototype.readFloatLE=function(t,r){return r||G(t,4,this.length),p(this,t,!0,23,4)},m.prototype.readFloatBE=function(t,r){return r||G(t,4,this.length),p(this,t,!1,23,4)},m.prototype.readDoubleLE=function(t,r){return r||G(t,8,this.length),p(this,t,!0,52,8)},m.prototype.readDoubleBE=function(t,r){return r||G(t,8,this.length),p(this,t,!1,52,8)},m.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||J(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},m.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||J(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},m.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||J(this,t,r,1,255,0),m.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},m.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||J(this,t,r,2,65535,0),m.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):Z(this,t,r,!0),r+2},m.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||J(this,t,r,2,65535,0),m.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):Z(this,t,r,!1),r+2},m.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||J(this,t,r,4,4294967295,0),m.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):q(this,t,r,!0),r+4},m.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||J(this,t,r,4,4294967295,0),m.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):q(this,t,r,!1),r+4},m.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);J(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},m.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);J(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},m.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||J(this,t,r,1,127,-128),m.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},m.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||J(this,t,r,2,32767,-32768),m.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):Z(this,t,r,!0),r+2},m.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||J(this,t,r,2,32767,-32768),m.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):Z(this,t,r,!1),r+2},m.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||J(this,t,r,4,2147483647,-2147483648),m.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):q(this,t,r,!0),r+4},m.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||J(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),m.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):q(this,t,r,!1),r+4},m.prototype.writeFloatLE=function(t,r,e){return X(this,t,r,!0,e)},m.prototype.writeFloatBE=function(t,r,e){return X(this,t,r,!1,e)},m.prototype.writeDoubleLE=function(t,r,e){return H(this,t,r,!0,e)},m.prototype.writeDoubleBE=function(t,r,e){return H(this,t,r,!1,e)},m.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!m.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},m.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!m.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=P(t)?t:$(new m(t,n).toString()),f=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%f]}return this};var K=/[^+\/0-9A-Za-z-_]/g;function Q(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function tt(t){return function(t){var r,e,n,i,o,u;a||h();var c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[c-2]?2:"="===t[c-1]?1:0,u=new s(3*c/4-o),n=o>0?c-4:c;var l=0;for(r=0,e=0;r<n;r+=4,e+=3)i=f[t.charCodeAt(r)]<<18|f[t.charCodeAt(r+1)]<<12|f[t.charCodeAt(r+2)]<<6|f[t.charCodeAt(r+3)],u[l++]=i>>16&255,u[l++]=i>>8&255,u[l++]=255&i;return 2===o?(i=f[t.charCodeAt(r)]<<2|f[t.charCodeAt(r+1)]>>4,u[l++]=255&i):1===o&&(i=f[t.charCodeAt(r)]<<10|f[t.charCodeAt(r+1)]<<4|f[t.charCodeAt(r+2)]>>2,u[l++]=i>>8&255,u[l++]=255&i),u}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function rt(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function et(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}n.isValid=function(t){try{return!!new n(t)}catch(t){return!1}};var nt=function(t){if(this.data=null,this.width=null,this.height=null,this.data=t,65496!==t.readUInt16BE(0))throw new Error("SOI not found in JPEG");for(var r=i.decode(this.data),e=0;e<r.length;e+=1){var n=r[e];"EXIF"===n.name&&n.entries.orientation&&(this.orientation=n.entries.orientation),"SOF"===n.name&&(this.width||(this.width=n.width),this.height||(this.height=n.height))}if(this.orientation>4){var o=[this.height,this.width];this.width=o[0],this.height=o[1]}};nt.isValid=function(t){return t&&m.isBuffer(t)&&65496===t.readUInt16BE(0)};var it,ot,ut,ft,st,at=(ot=(void 0===(it={limit:30})?{}:it).limit,ut=void 0===ot?100:ot,ft={},st=[],{get:function(t){return ft[t]},set:function(t,r){st.push(t),st.length>ut&&delete ft[st.shift()],ft[t]=r},reset:function(){ft={},st=[]},length:function(){return st.length}}),ht=function(){var n=r(t().mark((function r(n,i){var o,u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e(n,i);case 2:return o=t.sent,t.next=5,o.buffer?o.buffer():o.arrayBuffer();case 5:return u=t.sent,t.abrupt("return","Buffer"===u.constructor.name?u:m.from(u));case 7:case"end":return t.stop()}}),r)})));return function(t,r){return n.apply(this,arguments)}}(),ct=function(t){var r=t.toLowerCase();return"jpg"===r||"jpeg"===r||"png"===r};function lt(t,r){switch(r.toLowerCase()){case"jpg":case"jpeg":return new nt(t);case"png":return new n(t);default:return null}}var pt=function(t){var r=function(t){var r;return nt.isValid(t)?r="jpg":n.isValid(t)&&(r="png"),r}(t);return r?new Promise((function(e){return e(lt(t,r))})):Promise.resolve()},gt=function(){var e=r(t().mark((function r(e){var n,i,o,u,f;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=e.type)&&"application/octet-stream"!==n){t.next=7;break}return t.next=4,e.arrayBuffer();case 4:return i=t.sent,o=m.from(i),t.abrupt("return",pt(o));case 7:if(n.startsWith("image/")){t.next=9;break}throw new Error("Invalid blob type: "+n);case 9:if(u=n.replace("image/",""),ct(u)){t.next=12;break}throw new Error("Invalid blob type: "+n);case 12:return t.next=14,e.arrayBuffer();case 14:return f=t.sent,t.abrupt("return",lt(m.from(f),u));case 16:case"end":return t.stop()}}),r)})));return function(t){return e.apply(this,arguments)}}(),yt=function(t){var r=137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]&&13===t[4]&&10===t[5]&&26===t[6]&&10===t[7],e=255===t[0]&&216===t[1]&&255===t[2],n="";if(r)n="png";else{if(!e)throw new Error("Not valid image extension");n="jpg"}return n},wt=function(){var e=r(t().mark((function r(e){var n,i,o,u,f,s,a,h;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.uri,i=e.body,o=e.headers,u=e.method,f=void 0===u?"GET":u,s=e.credentials,t.next=7;break;case 4:t.t0=t.sent,t.next=10;break;case 7:return t.next=9,ht(n,{body:i,headers:o,method:f,credentials:s});case 9:t.t0=t.sent;case 10:return a=t.t0,h=yt(a),t.abrupt("return",lt(a,h));case 13:case"end":return t.stop()}}),r)})));return function(t){return e.apply(this,arguments)}}(),dt=function(t,r){var e,n,i=(void 0===r?{}:r).cache,o=void 0===i||i,u=t.data?t.data.toString():t.uri;if("undefined"!=typeof Blob&&t instanceof Blob)e=gt(t);else if(m.isBuffer(t))e=pt(t);else{if(o&&at.get(u))return at.get(u);n=t.uri,e=/^data:image\/[a-zA-Z]*;base64,[^"]*/g.test(n)?function(t){var r=t.uri,e=/^data:image\/([a-zA-Z]*);base64,([^"]*)/g.exec(r),n=e[1],i=e[2];if(!ct(n))throw new Error("Base64 image invalid format: "+n);return new Promise((function(t){return t(lt(m.from(i,"base64"),n))}))}(t):"object"==typeof t&&t.data?function(t){if(t.data&&t.format)return new Promise((function(r){return r(lt(t.data,t.format))}));throw new Error("Invalid data given for local file: "+JSON.stringify(t))}(t):wt(t)}if(!e)throw new Error("Cannot resolve image");return o&&at.set(u,e),e};export{dt as default};
|