@sv-print/plugin-api-image 0.1.2 → 0.1.4

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/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # @sv-print/plugin-api-image
2
+
3
+ 给 sv-print 提供导出图片的 API 插件。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ npm install @sv-print/plugin-api-image
9
+ ```
10
+
11
+ ## 使用
12
+
13
+ sv-print 插件引入的两种方式见:[sv-print 插件引入的两种方式:https://www.ibujian.cn/svp/plugin/a02.html](https://www.ibujian.cn/svp/plugin/a02.html)
14
+
15
+ ```js
16
+ import pluginEleBwip from "@sv-print/plugin-ele-bwip-js";
17
+ const plugins = [pluginEleBwip({})];
18
+ ```
19
+
20
+ ## License
21
+
22
+ LGPL
23
+
24
+ ### 开源使用须知
25
+
26
+ 1.请自觉遵守 LGPL 协议,其他用途可联系作者;
27
+
28
+ 2.允许用于个人学习、毕业设计、教学案例、公益事业、商业使用;
29
+
30
+ 3.如果商用必须保留版权信息,请自觉遵守;
31
+
32
+ 4.禁止将本开源的代码和资源进行任何形式任何名义的出售,否则产生的一切任何后果责任由侵权者自负;
33
+
34
+ 5.商用请仔细审查代码和漏洞,不得用于任一国家许可范围之外的商业应用,产生的一切任何后果责任自负;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var H=(r,x,e)=>new Promise((a,f)=>{var h=i=>{try{I(e.next(i))}catch(d){f(d)}},u=i=>{try{I(e.throw(i))}catch(d){f(d)}},I=i=>i.done?a(i.value):Promise.resolve(i.value).then(h,u);I((e=e.apply(r,x)).next())});const V=require("html-to-image");function X(r){if(r&&r.__esModule)return r;const x=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(x,e,a.get?a:{enumerable:!0,get:()=>r[e]})}}return x.default=r,Object.freeze(x)}const $=X(V);function C(r,x){const e=R();return C=function(a,f){return a=a-474,e[a]},C(r,x)}(function(r,x){const e=C,a=r();for(;[];)try{if(parseInt(e(503))/1*(parseInt(e(504))/2)+parseInt(e(555))/3*(-parseInt(e(487))/4)+parseInt(e(535))/5+parseInt(e(526))/6*(-parseInt(e(521))/7)+-parseInt(e(475))/8*(parseInt(e(505))/9)+-parseInt(e(490))/10+-parseInt(e(493))/11*(-parseInt(e(559))/12)===x)break;a.push(a.shift())}catch(f){a.push(a.shift())}})(R,816052);function R(){const r=["position:fixed","then","hinnn","toLowerCase","click","loadAllImages","indexOf","appendChild","jpeg","removeTempContainer","run","html","3441704qtnwHN",".jpg","limit","pop","length","6XyoQTM","includes","end","start","queue","baseURI","http","replace","style","1106880KqPUKf","drawImage","width","onProgress","jpg","height","toImage percent: ","toType","IMG","floor","toDataURL","image/jpeg","clear","download","error","quality","getTempContainer","printPanels","gif","css","361308RsofXq","getHtml","Deferred","ceil","39956604WryTHN","add","log","setAttribute","isDownload","blob","toImage \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ","2342960qOtRWn","base64","src","display","bmp","forEach","name","tagName","createElement","getContext","extend","svg","40ZTyEhO","clearRect","resolve","5600870NYRqPE","none","push","11IUEizV","devicePixelRatio","url","onload","total","canvas","remove","find","svg2canvas","download.jpg","38PHPcee","5622CHoDSb","18PuPaoM",".hiprint-printPanel .hiprint-printPaper","split","imageSmoothingEnabled"];return R=function(){return r},R()}const B=function(r,x){return H(this,null,function*(){const e=C;let a=this,f=globalThis.$[e(557)](),h=!![],u=10,I=(i,d)=>{const b=e,y=Math[b(544)](i/d*100);console.log("cur",i,b(497),d),console[b(561)](b(541),y+"%")};if(this[e(552)][e(525)]){let i=globalThis.$[e(485)]({filter:t=>{const n=e;return t[n(482)]!=n(543)||t.tagName==n(543)&&([n(539),n(517),"png",n(553),n(479),"webp",n(486)][n(527)](t[n(477)][n(507)](".").pop()[n(512)]())||t[n(477)]!=t[n(531)]||t.src.indexOf(n(532))>-1&&t[n(477)]!=t[n(531)]||t[n(477)][n(515)](n(476))>-1)},backgroundColor:"#fff"},x||{}),d=yield this[e(556)](r,x);x&&x[e(563)]!=null&&(h=x.isDownload),x&&x[e(538)]!=null&&(I=x[e(538)]),x&&x[e(523)]!=null&&(u=x.limit),globalThis.$(d).css(e(537),"")[e(554)](e(540),""),this.createTempContainer();let b=this[e(551)]();this[e(501)](d,i),b[e(520)](d[0]);let y=b[e(500)](e(506)).length;globalThis.$(d)[e(554)](e(509)),this[e(514)](d,function(){const t=e;try{let n=[],A=Math[t(558)](y/u),L=y%u;const p=document.createElement(t(498)),k=p.getContext("2d"),E=b[t(537)]()*(i.pixelRatio||globalThis[t(494)]);for(let v=0;v<A;v++){k[t(488)](0,0,p[t(537)],p.height);const j=v==A-1;let S=0,N=j?L:u;for(let g=0;g<N;g++){k.clearRect(0,0,p.width,p[t(540)]);const c=v*u+g,w=b[t(500)](t(506))[c];globalThis.hinnn.queue[t(560)](function(q){const T=t;$.toCanvas(w,i)[T(510)](function(_){const s=T;let m=_[s(484)]("2d");m[s(508)]=![];let P=_[s(545)](s(546),i[s(550)]||.92),o=new Image;o[s(477)]=P,o[s(496)]=function(){const l=s;g===0&&(p[l(537)]=E,p[l(540)]=o[l(540)]*N),S+=o[l(540)],k[l(536)](o,0,S-o[l(540)],E,o[l(540)]),I(c+1,y),q()}})})}globalThis[t(511)][t(530)][t(560)](function(g){const c=t;let w=i.type||c(546),q=i[c(542)]||"url",T=i.quality||.8;if(h){let _=p.toDataURL(w,T),s=new Image;s[c(477)]=_,s[c(496)]=function(){const m=c;n[m(492)]({url:_,start:v*u+1,end:v*u+N}),j&&(globalThis[m(511)].queue.clear(),a[m(518)](),n[m(480)](P=>{const o=m;let l=document[o(483)]("a"),O=x[o(481)]||o(502);O.indexOf(".")==-1&&(O+=o(522));let U=O[o(507)](".")[o(524)](),z=O[o(533)]("."+U,"")+"_"+P[o(529)]+"-"+P[o(528)]+"."+U;l[o(534)][o(478)]=o(491),l.setAttribute(o(548),z),l[o(562)]("href",P[o(495)]),document.body[o(516)](l),l[o(513)](),l[o(499)]()})),g()};return}if(q==c(495)){n.push(p.toDataURL(w,T)),j&&(globalThis[c(511)][c(530)][c(547)](),a[c(518)](),f[c(489)](n)),g();return}q==c(564)&&p.toBlob(function(_){const s=c;n[s(492)](_),j&&(globalThis[s(511)].queue[s(547)](),a[s(518)](),f[s(489)](n)),g()},w,T)})}globalThis.hinnn[t(530)][t(519)]()}catch(n){console[t(549)](t(474)),console[t(561)](n)}})}return f.promise()})};(function(r,x){for(var e=M,a=r();[];)try{var f=-parseInt(e(334))/1+-parseInt(e(331))/2*(-parseInt(e(344))/3)+-parseInt(e(338))/4*(parseInt(e(341))/5)+-parseInt(e(332))/6*(-parseInt(e(337))/7)+-parseInt(e(339))/8+-parseInt(e(335))/9+parseInt(e(330))/10*(parseInt(e(336))/11);if(f===x)break;a.push(a.shift())}catch(h){a.push(a.shift())}})(D,181429);function D(){var r=["1295808WtNBbn","add toImage Api","123315SiaLiG","newPrintTemplate","add toImage Api to PrintTemplate","9YVzMTT","10MvYIXj","220664DaJysg","376422ksOobN","0.3.0","53520SAQUct","1388907VBMmzC","3903009xpjZvF","7ssnXvg","32FfDhfS"];return D=function(){return r},D()}function M(r,x){var e=D();return M=function(a,f){a=a-330;var h=e[a];return h},M(r,x)}function W(r){var x=M;return{name:x(340),description:"add toImage Api",hooks:[{hook:x(342),name:x(343),description:x(343),priority:1,run:({template:e,options:a})=>{Object.defineProperty(e,"toImage",{value:B,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:x(333)}}module.exports=W;
1
+ "use strict";var W=(r,t,e)=>new Promise((a,l)=>{var h=c=>{try{I(e.next(c))}catch(b){l(b)}},u=c=>{try{I(e.throw(c))}catch(b){l(b)}},I=c=>c.done?a(c.value):Promise.resolve(c.value).then(h,u);I((e=e.apply(r,t)).next())});const E=require("html-to-image");function F(r){if(r&&r.__esModule)return r;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,a.get?a:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const L=F(E);(function(r,t){const e=j,a=r();for(;[];)try{if(parseInt(e(289))/1+-parseInt(e(367))/2+parseInt(e(324))/3*(parseInt(e(316))/4)+-parseInt(e(306))/5+parseInt(e(325))/6*(parseInt(e(336))/7)+parseInt(e(344))/8*(parseInt(e(334))/9)+-parseInt(e(308))/10*(-parseInt(e(286))/11)===t)break;a.push(a.shift())}catch(l){a.push(a.shift())}})(M,710956);function M(){const r=["toDataURL","height","baseURI","find","position:fixed","display","download.jpg","loadAllImages","indexOf","length","jpg","remove",".jpg","start","removeTempContainer","log","pixelRatio","add","698464IYwzVZ","resolve","devicePixelRatio","queue","quality","push","imageSmoothingEnabled","run","tagName","image/jpeg","onProgress","toImage percent: ","getHtml","1738qOahFf","toType","floor","451297HqroPf","forEach","includes","svg","getContext","clear","png","getTempContainer","name","jpeg","css","src","IMG","end",".hiprint-printPanel .hiprint-printPaper","style","width","5644560azgNiN","createElement","5920pDYpGT","toImage \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ","body","appendChild","then","drawImage","onload","hinnn","1052056OdLMHP","url","replace","cur","limit","#fff","isDownload","download","6hwSYbH","6XXeNZP","clearRect","gif","canvas","printPanels","base64","split","promise","none","9xKBDjH","extend","3945767IekuVg","ceil","click","http","toLowerCase","pop","toCanvas","blob","4436464MMWMcf","href","setAttribute","total","bmp"];return M=function(){return r},M()}function j(r,t){const e=M();return j=function(a,l){return a=a-277,e[a]},j(r,t)}const U=function(r,t){return W(this,null,function*(){const e=j;let a=this,l=globalThis.$.Deferred(),h=!![],u=10,I=(c,b)=>{const p=j,T=Math[p(288)](c/b*100);console[p(364)](p(319),c,p(347),b),console[p(364)](p(284),T+"%")};if(this[e(329)].length){let c=globalThis.$[e(335)]({filter:x=>{const n=e;return x.tagName!=n(301)||x[n(281)]==n(301)&&([n(359),n(298),n(295),n(327),n(348),"webp",n(292)][n(291)](x[n(300)].split(".")[n(341)]()[n(340)]())||x[n(300)]!=x.baseURI||x.src[n(357)](n(339))>-1&&x[n(300)]!=x[n(351)]||x[n(300)][n(357)](n(330))>-1)},backgroundColor:e(321)},t||{}),b=yield this[e(285)](r,t);t&&t[e(322)]!=null&&(h=t.isDownload),t&&t[e(283)]!=null&&(I=t.onProgress),t&&t[e(320)]!=null&&(u=t.limit),globalThis.$(b)[e(299)]("width","")[e(299)](e(350),""),this.createTempContainer();let p=this[e(296)]();this.svg2canvas(b,c),p.html(b[0]);let T=p[e(352)](e(303))[e(358)];globalThis.$(b)[e(299)](e(353)),this[e(356)](b,function(){const x=e;try{let n=[],R=Math[x(337)](T/u),X=T%u||1;const f=document[x(307)](x(328)),C=f[x(293)]("2d"),H=p.width()*(c[x(365)]||globalThis[x(369)]);for(let v=0;v<R;v++){C[x(326)](0,0,f[x(305)],f[x(350)]);const O=v==R-1;let G=0,D=O?X:u;for(let g=0;g<D;g++){C[x(326)](0,0,f[x(305)],f.height);const i=v*u+g,y=p[x(352)](x(303))[i];globalThis[x(315)][x(370)].add(function(k){const _=x;L[_(342)](y,c)[_(312)](function(m){const s=_;let w=m[s(293)]("2d");w[s(279)]=![];let P=m.toDataURL(s(282),c[s(277)]||.92),o=new Image;o[s(300)]=P,o[s(314)]=function(){const d=s;g===0&&(f[d(305)]=H,f.height=o[d(350)]*D),G+=o[d(350)],C[d(313)](o,0,G-o[d(350)],H,o[d(350)]),I(i+1,T),k()}})})}globalThis[x(315)].queue[x(366)](function(g){const i=x;let y=c.type||i(282),k=c[i(287)]||"url",_=c.quality||.8;if(h){let m=f[i(349)](y,_),s=new Image;s[i(300)]=m,s[i(314)]=function(){const w=i;n.push({url:m,start:v*u+1,end:v*u+D}),O&&(globalThis.hinnn[w(370)].clear(),a[w(363)](),n[w(290)](P=>{const o=w;let d=document.createElement("a"),q=t[o(297)]||o(355);q.indexOf(".")==-1&&(q+=o(361));let S=q[o(331)](".")[o(341)](),Y=q[o(318)]("."+S,"")+"_"+P[o(362)]+"-"+P[o(302)]+"."+S;d[o(304)][o(354)]=o(333),d.setAttribute(o(323),Y),d[o(346)](o(345),P[o(317)]),document[o(310)][o(311)](d),d[o(338)](),d[o(360)]()})),g()};return}if(k==i(317)){n.push(f[i(349)](y,_)),O&&(globalThis[i(315)][i(370)][i(294)](),a[i(363)](),l[i(368)](n)),g();return}k==i(343)&&f.toBlob(function(m){const s=i;n[s(278)](m),O&&(globalThis[s(315)][s(370)].clear(),a[s(363)](),l[s(368)](n)),g()},y,_)})}globalThis[x(315)].queue[x(280)]()}catch(n){console.error(x(309)),console[x(364)](n)}})}return l[e(332)]()})};function N(r,t){var e=A();return N=function(a,l){a=a-132;var h=e[a];return h},N(r,t)}(function(r,t){for(var e=N,a=r();[];)try{var l=parseInt(e(141))/1+-parseInt(e(142))/2*(parseInt(e(144))/3)+-parseInt(e(143))/4*(-parseInt(e(139))/5)+-parseInt(e(138))/6+-parseInt(e(136))/7+-parseInt(e(134))/8*(-parseInt(e(132))/9)+parseInt(e(137))/10;if(l===t)break;a.push(a.shift())}catch(h){a.push(a.shift())}})(A,429921);function Z(r){var t=N;return{name:"add toImage Api",description:"add toImage Api",hooks:[{hook:t(140),name:t(135),description:t(135),priority:1,run:({template:e,options:a})=>{var l=t;Object.defineProperty(e,l(133),{value:U,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:"0.3.0"}}function A(){var r=["add toImage Api to PrintTemplate","53613RFXdgt","2654180GiWpZa","899760buZBGF","42740jYPwWY","newPrintTemplate","243290IFIGAk","765172hmfXSH","196NPJNIG","6qNKtTX","72dAWOWk","toImage","425152nOqmtJ"];return A=function(){return r},A()}module.exports=Z;
package/dist/index.mjs CHANGED
@@ -1,152 +1,153 @@
1
- var L = (s, n, x) => new Promise((o, f) => {
1
+ var X = (c, n, x) => new Promise((o, l) => {
2
2
  var h = (r) => {
3
3
  try {
4
4
  I(x.next(r));
5
- } catch (d) {
6
- f(d);
5
+ } catch (p) {
6
+ l(p);
7
7
  }
8
8
  }, u = (r) => {
9
9
  try {
10
10
  I(x.throw(r));
11
- } catch (d) {
12
- f(d);
11
+ } catch (p) {
12
+ l(p);
13
13
  }
14
14
  }, I = (r) => r.done ? o(r.value) : Promise.resolve(r.value).then(h, u);
15
- I((x = x.apply(s, n)).next());
15
+ I((x = x.apply(c, n)).next());
16
16
  });
17
- import * as X from "html-to-image";
18
- function D(s, n) {
19
- const x = j();
20
- return D = function(o, f) {
21
- return o = o - 474, x[o];
22
- }, D(s, n);
23
- }
24
- (function(s, n) {
25
- const x = D, o = s();
17
+ import * as F from "html-to-image";
18
+ (function(c, n) {
19
+ const x = k, o = c();
26
20
  for (; []; )
27
21
  try {
28
- if (parseInt(x(503)) / 1 * (parseInt(x(504)) / 2) + parseInt(x(555)) / 3 * (-parseInt(x(487)) / 4) + parseInt(x(535)) / 5 + parseInt(x(526)) / 6 * (-parseInt(x(521)) / 7) + -parseInt(x(475)) / 8 * (parseInt(x(505)) / 9) + -parseInt(x(490)) / 10 + -parseInt(x(493)) / 11 * (-parseInt(x(559)) / 12) === n)
22
+ if (parseInt(x(289)) / 1 + -parseInt(x(367)) / 2 + parseInt(x(324)) / 3 * (parseInt(x(316)) / 4) + -parseInt(x(306)) / 5 + parseInt(x(325)) / 6 * (parseInt(x(336)) / 7) + parseInt(x(344)) / 8 * (parseInt(x(334)) / 9) + -parseInt(x(308)) / 10 * (-parseInt(x(286)) / 11) === n)
29
23
  break;
30
24
  o.push(o.shift());
31
- } catch (f) {
25
+ } catch (l) {
32
26
  o.push(o.shift());
33
27
  }
34
- })(j, 816052);
35
- function j() {
36
- const s = ["position:fixed", "then", "hinnn", "toLowerCase", "click", "loadAllImages", "indexOf", "appendChild", "jpeg", "removeTempContainer", "run", "html", "3441704qtnwHN", ".jpg", "limit", "pop", "length", "6XyoQTM", "includes", "end", "start", "queue", "baseURI", "http", "replace", "style", "1106880KqPUKf", "drawImage", "width", "onProgress", "jpg", "height", "toImage percent: ", "toType", "IMG", "floor", "toDataURL", "image/jpeg", "clear", "download", "error", "quality", "getTempContainer", "printPanels", "gif", "css", "361308RsofXq", "getHtml", "Deferred", "ceil", "39956604WryTHN", "add", "log", "setAttribute", "isDownload", "blob", "toImage \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ", "2342960qOtRWn", "base64", "src", "display", "bmp", "forEach", "name", "tagName", "createElement", "getContext", "extend", "svg", "40ZTyEhO", "clearRect", "resolve", "5600870NYRqPE", "none", "push", "11IUEizV", "devicePixelRatio", "url", "onload", "total", "canvas", "remove", "find", "svg2canvas", "download.jpg", "38PHPcee", "5622CHoDSb", "18PuPaoM", ".hiprint-printPanel .hiprint-printPaper", "split", "imageSmoothingEnabled"];
37
- return j = function() {
38
- return s;
39
- }, j();
28
+ })(C, 710956);
29
+ function C() {
30
+ const c = ["toDataURL", "height", "baseURI", "find", "position:fixed", "display", "download.jpg", "loadAllImages", "indexOf", "length", "jpg", "remove", ".jpg", "start", "removeTempContainer", "log", "pixelRatio", "add", "698464IYwzVZ", "resolve", "devicePixelRatio", "queue", "quality", "push", "imageSmoothingEnabled", "run", "tagName", "image/jpeg", "onProgress", "toImage percent: ", "getHtml", "1738qOahFf", "toType", "floor", "451297HqroPf", "forEach", "includes", "svg", "getContext", "clear", "png", "getTempContainer", "name", "jpeg", "css", "src", "IMG", "end", ".hiprint-printPanel .hiprint-printPaper", "style", "width", "5644560azgNiN", "createElement", "5920pDYpGT", "toImage \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ", "body", "appendChild", "then", "drawImage", "onload", "hinnn", "1052056OdLMHP", "url", "replace", "cur", "limit", "#fff", "isDownload", "download", "6hwSYbH", "6XXeNZP", "clearRect", "gif", "canvas", "printPanels", "base64", "split", "promise", "none", "9xKBDjH", "extend", "3945767IekuVg", "ceil", "click", "http", "toLowerCase", "pop", "toCanvas", "blob", "4436464MMWMcf", "href", "setAttribute", "total", "bmp"];
31
+ return C = function() {
32
+ return c;
33
+ }, C();
34
+ }
35
+ function k(c, n) {
36
+ const x = C();
37
+ return k = function(o, l) {
38
+ return o = o - 277, x[o];
39
+ }, k(c, n);
40
40
  }
41
- const $ = function(s, n) {
42
- return L(this, null, function* () {
43
- const x = D;
44
- let o = this, f = globalThis.$[x(557)](), h = !![], u = 10, I = (r, d) => {
45
- const b = x, w = Math[b(544)](r / d * 100);
46
- console.log("cur", r, b(497), d), console[b(561)](b(541), w + "%");
41
+ const L = function(c, n) {
42
+ return X(this, null, function* () {
43
+ const x = k;
44
+ let o = this, l = globalThis.$.Deferred(), h = !![], u = 10, I = (r, p) => {
45
+ const b = k, T = Math[b(288)](r / p * 100);
46
+ console[b(364)](b(319), r, b(347), p), console[b(364)](b(284), T + "%");
47
47
  };
48
- if (this[x(552)][x(525)]) {
49
- let r = globalThis.$[x(485)]({ filter: (e) => {
48
+ if (this[x(329)].length) {
49
+ let r = globalThis.$[x(335)]({ filter: (e) => {
50
50
  const t = x;
51
- return e[t(482)] != t(543) || e.tagName == t(543) && ([t(539), t(517), "png", t(553), t(479), "webp", t(486)][t(527)](e[t(477)][t(507)](".").pop()[t(512)]()) || e[t(477)] != e[t(531)] || e.src.indexOf(t(532)) > -1 && e[t(477)] != e[t(531)] || e[t(477)][t(515)](t(476)) > -1);
52
- }, backgroundColor: "#fff" }, n || {}), d = yield this[x(556)](s, n);
53
- n && n[x(563)] != null && (h = n.isDownload), n && n[x(538)] != null && (I = n[x(538)]), n && n[x(523)] != null && (u = n.limit), globalThis.$(d).css(x(537), "")[x(554)](x(540), ""), this.createTempContainer();
54
- let b = this[x(551)]();
55
- this[x(501)](d, r), b[x(520)](d[0]);
56
- let w = b[x(500)](x(506)).length;
57
- globalThis.$(d)[x(554)](x(509)), this[x(514)](d, function() {
51
+ return e.tagName != t(301) || e[t(281)] == t(301) && ([t(359), t(298), t(295), t(327), t(348), "webp", t(292)][t(291)](e[t(300)].split(".")[t(341)]()[t(340)]()) || e[t(300)] != e.baseURI || e.src[t(357)](t(339)) > -1 && e[t(300)] != e[t(351)] || e[t(300)][t(357)](t(330)) > -1);
52
+ }, backgroundColor: x(321) }, n || {}), p = yield this[x(285)](c, n);
53
+ n && n[x(322)] != null && (h = n.isDownload), n && n[x(283)] != null && (I = n.onProgress), n && n[x(320)] != null && (u = n.limit), globalThis.$(p)[x(299)]("width", "")[x(299)](x(350), ""), this.createTempContainer();
54
+ let b = this[x(296)]();
55
+ this.svg2canvas(p, r), b.html(p[0]);
56
+ let T = b[x(352)](x(303))[x(358)];
57
+ globalThis.$(p)[x(299)](x(353)), this[x(356)](p, function() {
58
58
  const e = x;
59
59
  try {
60
- let t = [], N = Math[e(558)](w / u), S = w % u;
61
- const p = document.createElement(e(498)), A = p.getContext("2d"), O = b[e(537)]() * (r.pixelRatio || globalThis[e(494)]);
62
- for (let v = 0; v < N; v++) {
63
- A[e(488)](0, 0, p[e(537)], p.height);
64
- const q = v == N - 1;
65
- let U = 0, E = q ? S : u;
66
- for (let g = 0; g < E; g++) {
67
- A.clearRect(0, 0, p.width, p[e(540)]);
68
- const c = v * u + g, y = b[e(500)](e(506))[c];
69
- globalThis.hinnn.queue[e(560)](function(C) {
70
- const T = e;
71
- X.toCanvas(y, r)[T(510)](function(_) {
72
- const i = T;
73
- let m = _[i(484)]("2d");
74
- m[i(508)] = ![];
75
- let P = _[i(545)](i(546), r[i(550)] || 0.92), a = new Image();
76
- a[i(477)] = P, a[i(496)] = function() {
77
- const l = i;
78
- g === 0 && (p[l(537)] = O, p[l(540)] = a[l(540)] * E), U += a[l(540)], A[l(536)](a, 0, U - a[l(540)], O, a[l(540)]), I(c + 1, w), C();
60
+ let t = [], M = Math[e(337)](T / u), Y = T % u || 1;
61
+ const f = document[e(307)](e(328)), D = f[e(293)]("2d"), O = b.width() * (r[e(365)] || globalThis[e(369)]);
62
+ for (let v = 0; v < M; v++) {
63
+ D[e(326)](0, 0, f[e(305)], f[e(350)]);
64
+ const q = v == M - 1;
65
+ let G = 0, H = q ? Y : u;
66
+ for (let g = 0; g < H; g++) {
67
+ D[e(326)](0, 0, f[e(305)], f.height);
68
+ const i = v * u + g, P = b[e(352)](e(303))[i];
69
+ globalThis[e(315)][e(370)].add(function(j) {
70
+ const _ = e;
71
+ F[_(342)](P, r)[_(312)](function(m) {
72
+ const s = _;
73
+ let w = m[s(293)]("2d");
74
+ w[s(279)] = ![];
75
+ let y = m.toDataURL(s(282), r[s(277)] || 0.92), a = new Image();
76
+ a[s(300)] = y, a[s(314)] = function() {
77
+ const d = s;
78
+ g === 0 && (f[d(305)] = O, f.height = a[d(350)] * H), G += a[d(350)], D[d(313)](a, 0, G - a[d(350)], O, a[d(350)]), I(i + 1, T), j();
79
79
  };
80
80
  });
81
81
  });
82
82
  }
83
- globalThis[e(511)][e(530)][e(560)](function(g) {
84
- const c = e;
85
- let y = r.type || c(546), C = r[c(542)] || "url", T = r.quality || 0.8;
83
+ globalThis[e(315)].queue[e(366)](function(g) {
84
+ const i = e;
85
+ let P = r.type || i(282), j = r[i(287)] || "url", _ = r.quality || 0.8;
86
86
  if (h) {
87
- let _ = p.toDataURL(y, T), i = new Image();
88
- i[c(477)] = _, i[c(496)] = function() {
89
- const m = c;
90
- t[m(492)]({ url: _, start: v * u + 1, end: v * u + E }), q && (globalThis[m(511)].queue.clear(), o[m(518)](), t[m(480)]((P) => {
91
- const a = m;
92
- let l = document[a(483)]("a"), R = n[a(481)] || a(502);
93
- R.indexOf(".") == -1 && (R += a(522));
94
- let H = R[a(507)](".")[a(524)](), V = R[a(533)]("." + H, "") + "_" + P[a(529)] + "-" + P[a(528)] + "." + H;
95
- l[a(534)][a(478)] = a(491), l.setAttribute(a(548), V), l[a(562)]("href", P[a(495)]), document.body[a(516)](l), l[a(513)](), l[a(499)]();
87
+ let m = f[i(349)](P, _), s = new Image();
88
+ s[i(300)] = m, s[i(314)] = function() {
89
+ const w = i;
90
+ t.push({ url: m, start: v * u + 1, end: v * u + H }), q && (globalThis.hinnn[w(370)].clear(), o[w(363)](), t[w(290)]((y) => {
91
+ const a = w;
92
+ let d = document.createElement("a"), A = n[a(297)] || a(355);
93
+ A.indexOf(".") == -1 && (A += a(361));
94
+ let W = A[a(331)](".")[a(341)](), E = A[a(318)]("." + W, "") + "_" + y[a(362)] + "-" + y[a(302)] + "." + W;
95
+ d[a(304)][a(354)] = a(333), d.setAttribute(a(323), E), d[a(346)](a(345), y[a(317)]), document[a(310)][a(311)](d), d[a(338)](), d[a(360)]();
96
96
  })), g();
97
97
  };
98
98
  return;
99
99
  }
100
- if (C == c(495)) {
101
- t.push(p.toDataURL(y, T)), q && (globalThis[c(511)][c(530)][c(547)](), o[c(518)](), f[c(489)](t)), g();
100
+ if (j == i(317)) {
101
+ t.push(f[i(349)](P, _)), q && (globalThis[i(315)][i(370)][i(294)](), o[i(363)](), l[i(368)](t)), g();
102
102
  return;
103
103
  }
104
- C == c(564) && p.toBlob(function(_) {
105
- const i = c;
106
- t[i(492)](_), q && (globalThis[i(511)].queue[i(547)](), o[i(518)](), f[i(489)](t)), g();
107
- }, y, T);
104
+ j == i(343) && f.toBlob(function(m) {
105
+ const s = i;
106
+ t[s(278)](m), q && (globalThis[s(315)][s(370)].clear(), o[s(363)](), l[s(368)](t)), g();
107
+ }, P, _);
108
108
  });
109
109
  }
110
- globalThis.hinnn[e(530)][e(519)]();
110
+ globalThis[e(315)].queue[e(280)]();
111
111
  } catch (t) {
112
- console[e(549)](e(474)), console[e(561)](t);
112
+ console.error(e(309)), console[e(364)](t);
113
113
  }
114
114
  });
115
115
  }
116
- return f.promise();
116
+ return l[x(332)]();
117
117
  });
118
118
  };
119
- (function(s, n) {
120
- for (var x = k, o = s(); []; )
119
+ function N(c, n) {
120
+ var x = R();
121
+ return N = function(o, l) {
122
+ o = o - 132;
123
+ var h = x[o];
124
+ return h;
125
+ }, N(c, n);
126
+ }
127
+ (function(c, n) {
128
+ for (var x = N, o = c(); []; )
121
129
  try {
122
- var f = -parseInt(x(334)) / 1 + -parseInt(x(331)) / 2 * (-parseInt(x(344)) / 3) + -parseInt(x(338)) / 4 * (parseInt(x(341)) / 5) + -parseInt(x(332)) / 6 * (-parseInt(x(337)) / 7) + -parseInt(x(339)) / 8 + -parseInt(x(335)) / 9 + parseInt(x(330)) / 10 * (parseInt(x(336)) / 11);
123
- if (f === n)
130
+ var l = parseInt(x(141)) / 1 + -parseInt(x(142)) / 2 * (parseInt(x(144)) / 3) + -parseInt(x(143)) / 4 * (-parseInt(x(139)) / 5) + -parseInt(x(138)) / 6 + -parseInt(x(136)) / 7 + -parseInt(x(134)) / 8 * (-parseInt(x(132)) / 9) + parseInt(x(137)) / 10;
131
+ if (l === n)
124
132
  break;
125
133
  o.push(o.shift());
126
134
  } catch (h) {
127
135
  o.push(o.shift());
128
136
  }
129
- })(M, 181429);
130
- function M() {
131
- var s = ["1295808WtNBbn", "add toImage Api", "123315SiaLiG", "newPrintTemplate", "add toImage Api to PrintTemplate", "9YVzMTT", "10MvYIXj", "220664DaJysg", "376422ksOobN", "0.3.0", "53520SAQUct", "1388907VBMmzC", "3903009xpjZvF", "7ssnXvg", "32FfDhfS"];
132
- return M = function() {
133
- return s;
134
- }, M();
135
- }
136
- function k(s, n) {
137
- var x = M();
138
- return k = function(o, f) {
139
- o = o - 330;
140
- var h = x[o];
141
- return h;
142
- }, k(s, n);
137
+ })(R, 429921);
138
+ function Z(c) {
139
+ var n = N;
140
+ return { name: "add toImage Api", description: "add toImage Api", hooks: [{ hook: n(140), name: n(135), description: n(135), priority: 1, run: ({ template: x, options: o }) => {
141
+ var l = n;
142
+ Object.defineProperty(x, l(133), { value: L, enumerable: ![], writable: !![], configurable: !![] });
143
+ } }], leastHiprintVersion: "0.3.0" };
143
144
  }
144
- function B(s) {
145
- var n = k;
146
- return { name: n(340), description: "add toImage Api", hooks: [{ hook: n(342), name: n(343), description: n(343), priority: 1, run: ({ template: x, options: o }) => {
147
- Object.defineProperty(x, "toImage", { value: $, enumerable: ![], writable: !![], configurable: !![] });
148
- } }], leastHiprintVersion: n(333) };
145
+ function R() {
146
+ var c = ["add toImage Api to PrintTemplate", "53613RFXdgt", "2654180GiWpZa", "899760buZBGF", "42740jYPwWY", "newPrintTemplate", "243290IFIGAk", "765172hmfXSH", "196NPJNIG", "6qNKtTX", "72dAWOWk", "toImage", "425152nOqmtJ"];
147
+ return R = function() {
148
+ return c;
149
+ }, R();
149
150
  }
150
151
  export {
151
- B as default
152
+ Z as default
152
153
  };
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(b,_){typeof exports=="object"&&typeof module!="undefined"?module.exports=_(require("html-to-image")):typeof define=="function"&&define.amd?define(["html-to-image"],_):(b=typeof globalThis!="undefined"?globalThis:b||self,b.pluginApiImage=_(b.htmlToImage))})(this,function(b){"use strict";var $=(b,_,w)=>new Promise((P,I)=>{var E=d=>{try{h(w.next(d))}catch(a){I(a)}},j=d=>{try{h(w.throw(d))}catch(a){I(a)}},h=d=>d.done?P(d.value):Promise.resolve(d.value).then(E,j);h((w=w.apply(b,_)).next())});function _(a){if(a&&a.__esModule)return a;const x=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(x,e,i.get?i:{enumerable:!0,get:()=>a[e]})}}return x.default=a,Object.freeze(x)}const w=_(b);function P(a,x){const e=I();return P=function(i,p){return i=i-474,e[i]},P(a,x)}(function(a,x){const e=P,i=a();for(;[];)try{if(parseInt(e(503))/1*(parseInt(e(504))/2)+parseInt(e(555))/3*(-parseInt(e(487))/4)+parseInt(e(535))/5+parseInt(e(526))/6*(-parseInt(e(521))/7)+-parseInt(e(475))/8*(parseInt(e(505))/9)+-parseInt(e(490))/10+-parseInt(e(493))/11*(-parseInt(e(559))/12)===x)break;i.push(i.shift())}catch(p){i.push(i.shift())}})(I,816052);function I(){const a=["position:fixed","then","hinnn","toLowerCase","click","loadAllImages","indexOf","appendChild","jpeg","removeTempContainer","run","html","3441704qtnwHN",".jpg","limit","pop","length","6XyoQTM","includes","end","start","queue","baseURI","http","replace","style","1106880KqPUKf","drawImage","width","onProgress","jpg","height","toImage percent: ","toType","IMG","floor","toDataURL","image/jpeg","clear","download","error","quality","getTempContainer","printPanels","gif","css","361308RsofXq","getHtml","Deferred","ceil","39956604WryTHN","add","log","setAttribute","isDownload","blob","toImage \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ","2342960qOtRWn","base64","src","display","bmp","forEach","name","tagName","createElement","getContext","extend","svg","40ZTyEhO","clearRect","resolve","5600870NYRqPE","none","push","11IUEizV","devicePixelRatio","url","onload","total","canvas","remove","find","svg2canvas","download.jpg","38PHPcee","5622CHoDSb","18PuPaoM",".hiprint-printPanel .hiprint-printPaper","split","imageSmoothingEnabled"];return I=function(){return a},I()}const E=function(a,x){return $(this,null,function*(){const e=P;let i=this,p=globalThis.$[e(557)](),q=!![],T=10,H=(f,g)=>{const u=e,R=Math[u(544)](f/g*100);console.log("cur",f,u(497),g),console[u(561)](u(541),R+"%")};if(this[e(552)][e(525)]){let f=globalThis.$[e(485)]({filter:t=>{const n=e;return t[n(482)]!=n(543)||t.tagName==n(543)&&([n(539),n(517),"png",n(553),n(479),"webp",n(486)][n(527)](t[n(477)][n(507)](".").pop()[n(512)]())||t[n(477)]!=t[n(531)]||t.src.indexOf(n(532))>-1&&t[n(477)]!=t[n(531)]||t[n(477)][n(515)](n(476))>-1)},backgroundColor:"#fff"},x||{}),g=yield this[e(556)](a,x);x&&x[e(563)]!=null&&(q=x.isDownload),x&&x[e(538)]!=null&&(H=x[e(538)]),x&&x[e(523)]!=null&&(T=x.limit),globalThis.$(g).css(e(537),"")[e(554)](e(540),""),this.createTempContainer();let u=this[e(551)]();this[e(501)](g,f),u[e(520)](g[0]);let R=u[e(500)](e(506)).length;globalThis.$(g)[e(554)](e(509)),this[e(514)](g,function(){const t=e;try{let n=[],L=Math[t(558)](R/T),B=R%T;const l=document.createElement(t(498)),S=l.getContext("2d"),z=u[t(537)]()*(f.pixelRatio||globalThis[t(494)]);for(let O=0;O<L;O++){S[t(488)](0,0,l[t(537)],l.height);const k=O==L-1;let V=0,U=k?B:T;for(let m=0;m<U;m++){S.clearRect(0,0,l.width,l[t(540)]);const s=O*T+m,D=u[t(500)](t(506))[s];globalThis.hinnn.queue[t(560)](function(A){const C=t;w.toCanvas(D,f)[C(510)](function(v){const r=C;let y=v[r(484)]("2d");y[r(508)]=![];let M=v[r(545)](r(546),f[r(550)]||.92),o=new Image;o[r(477)]=M,o[r(496)]=function(){const c=r;m===0&&(l[c(537)]=z,l[c(540)]=o[c(540)]*U),V+=o[c(540)],S[c(536)](o,0,V-o[c(540)],z,o[c(540)]),H(s+1,R),A()}})})}globalThis[t(511)][t(530)][t(560)](function(m){const s=t;let D=f.type||s(546),A=f[s(542)]||"url",C=f.quality||.8;if(q){let v=l.toDataURL(D,C),r=new Image;r[s(477)]=v,r[s(496)]=function(){const y=s;n[y(492)]({url:v,start:O*T+1,end:O*T+U}),k&&(globalThis[y(511)].queue.clear(),i[y(518)](),n[y(480)](M=>{const o=y;let c=document[o(483)]("a"),N=x[o(481)]||o(502);N.indexOf(".")==-1&&(N+=o(522));let X=N[o(507)](".")[o(524)](),W=N[o(533)]("."+X,"")+"_"+M[o(529)]+"-"+M[o(528)]+"."+X;c[o(534)][o(478)]=o(491),c.setAttribute(o(548),W),c[o(562)]("href",M[o(495)]),document.body[o(516)](c),c[o(513)](),c[o(499)]()})),m()};return}if(A==s(495)){n.push(l.toDataURL(D,C)),k&&(globalThis[s(511)][s(530)][s(547)](),i[s(518)](),p[s(489)](n)),m();return}A==s(564)&&l.toBlob(function(v){const r=s;n[r(492)](v),k&&(globalThis[r(511)].queue[r(547)](),i[r(518)](),p[r(489)](n)),m()},D,C)})}globalThis.hinnn[t(530)][t(519)]()}catch(n){console[t(549)](t(474)),console[t(561)](n)}})}return p.promise()})};(function(a,x){for(var e=h,i=a();[];)try{var p=-parseInt(e(334))/1+-parseInt(e(331))/2*(-parseInt(e(344))/3)+-parseInt(e(338))/4*(parseInt(e(341))/5)+-parseInt(e(332))/6*(-parseInt(e(337))/7)+-parseInt(e(339))/8+-parseInt(e(335))/9+parseInt(e(330))/10*(parseInt(e(336))/11);if(p===x)break;i.push(i.shift())}catch(q){i.push(i.shift())}})(j,181429);function j(){var a=["1295808WtNBbn","add toImage Api","123315SiaLiG","newPrintTemplate","add toImage Api to PrintTemplate","9YVzMTT","10MvYIXj","220664DaJysg","376422ksOobN","0.3.0","53520SAQUct","1388907VBMmzC","3903009xpjZvF","7ssnXvg","32FfDhfS"];return j=function(){return a},j()}function h(a,x){var e=j();return h=function(i,p){i=i-330;var q=e[i];return q},h(a,x)}function d(a){var x=h;return{name:x(340),description:"add toImage Api",hooks:[{hook:x(342),name:x(343),description:x(343),priority:1,run:({template:e,options:i})=>{Object.defineProperty(e,"toImage",{value:E,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:x(333)}}return d});
1
+ (function(b,_){typeof exports=="object"&&typeof module!="undefined"?module.exports=_(require("html-to-image")):typeof define=="function"&&define.amd?define(["html-to-image"],_):(b=typeof globalThis!="undefined"?globalThis:b||self,b.pluginApiImage=_(b.htmlToImage))})(this,function(b){"use strict";var L=(b,_,w)=>new Promise((y,h)=>{var H=l=>{try{q(w.next(l))}catch(a){h(a)}},P=l=>{try{q(w.throw(l))}catch(a){h(a)}},q=l=>l.done?y(l.value):Promise.resolve(l.value).then(H,P);q((w=w.apply(b,_)).next())});function _(a){if(a&&a.__esModule)return a;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:()=>a[e]})}}return n.default=a,Object.freeze(n)}const w=_(b);(function(a,n){const e=h,i=a();for(;[];)try{if(parseInt(e(289))/1+-parseInt(e(367))/2+parseInt(e(324))/3*(parseInt(e(316))/4)+-parseInt(e(306))/5+parseInt(e(325))/6*(parseInt(e(336))/7)+parseInt(e(344))/8*(parseInt(e(334))/9)+-parseInt(e(308))/10*(-parseInt(e(286))/11)===n)break;i.push(i.shift())}catch(d){i.push(i.shift())}})(y,710956);function y(){const a=["toDataURL","height","baseURI","find","position:fixed","display","download.jpg","loadAllImages","indexOf","length","jpg","remove",".jpg","start","removeTempContainer","log","pixelRatio","add","698464IYwzVZ","resolve","devicePixelRatio","queue","quality","push","imageSmoothingEnabled","run","tagName","image/jpeg","onProgress","toImage percent: ","getHtml","1738qOahFf","toType","floor","451297HqroPf","forEach","includes","svg","getContext","clear","png","getTempContainer","name","jpeg","css","src","IMG","end",".hiprint-printPanel .hiprint-printPaper","style","width","5644560azgNiN","createElement","5920pDYpGT","toImage \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ","body","appendChild","then","drawImage","onload","hinnn","1052056OdLMHP","url","replace","cur","limit","#fff","isDownload","download","6hwSYbH","6XXeNZP","clearRect","gif","canvas","printPanels","base64","split","promise","none","9xKBDjH","extend","3945767IekuVg","ceil","click","http","toLowerCase","pop","toCanvas","blob","4436464MMWMcf","href","setAttribute","total","bmp"];return y=function(){return a},y()}function h(a,n){const e=y();return h=function(i,d){return i=i-277,e[i]},h(a,n)}const H=function(a,n){return L(this,null,function*(){const e=h;let i=this,d=globalThis.$.Deferred(),j=!![],I=10,W=(p,g)=>{const f=h,A=Math[f(288)](p/g*100);console[f(364)](f(319),p,f(347),g),console[f(364)](f(284),A+"%")};if(this[e(329)].length){let p=globalThis.$[e(335)]({filter:x=>{const t=e;return x.tagName!=t(301)||x[t(281)]==t(301)&&([t(359),t(298),t(295),t(327),t(348),"webp",t(292)][t(291)](x[t(300)].split(".")[t(341)]()[t(340)]())||x[t(300)]!=x.baseURI||x.src[t(357)](t(339))>-1&&x[t(300)]!=x[t(351)]||x[t(300)][t(357)](t(330))>-1)},backgroundColor:e(321)},n||{}),g=yield this[e(285)](a,n);n&&n[e(322)]!=null&&(j=n.isDownload),n&&n[e(283)]!=null&&(W=n.onProgress),n&&n[e(320)]!=null&&(I=n.limit),globalThis.$(g)[e(299)]("width","")[e(299)](e(350),""),this.createTempContainer();let f=this[e(296)]();this.svg2canvas(g,p),f.html(g[0]);let A=f[e(352)](e(303))[e(358)];globalThis.$(g)[e(299)](e(353)),this[e(356)](g,function(){const x=e;try{let t=[],X=Math[x(337)](A/I),U=A%I||1;const u=document[x(307)](x(328)),G=u[x(293)]("2d"),Y=f.width()*(p[x(365)]||globalThis[x(369)]);for(let O=0;O<X;O++){G[x(326)](0,0,u[x(305)],u[x(350)]);const C=O==X-1;let E=0,S=C?U:I;for(let m=0;m<S;m++){G[x(326)](0,0,u[x(305)],u.height);const r=O*I+m,M=f[x(352)](x(303))[r];globalThis[x(315)][x(370)].add(function(D){const T=x;w[T(342)](M,p)[T(312)](function(v){const c=T;let k=v[c(293)]("2d");k[c(279)]=![];let N=v.toDataURL(c(282),p[c(277)]||.92),o=new Image;o[c(300)]=N,o[c(314)]=function(){const s=c;m===0&&(u[s(305)]=Y,u.height=o[s(350)]*S),E+=o[s(350)],G[s(313)](o,0,E-o[s(350)],Y,o[s(350)]),W(r+1,A),D()}})})}globalThis[x(315)].queue[x(366)](function(m){const r=x;let M=p.type||r(282),D=p[r(287)]||"url",T=p.quality||.8;if(j){let v=u[r(349)](M,T),c=new Image;c[r(300)]=v,c[r(314)]=function(){const k=r;t.push({url:v,start:O*I+1,end:O*I+S}),C&&(globalThis.hinnn[k(370)].clear(),i[k(363)](),t[k(290)](N=>{const o=k;let s=document.createElement("a"),R=n[o(297)]||o(355);R.indexOf(".")==-1&&(R+=o(361));let F=R[o(331)](".")[o(341)](),Z=R[o(318)]("."+F,"")+"_"+N[o(362)]+"-"+N[o(302)]+"."+F;s[o(304)][o(354)]=o(333),s.setAttribute(o(323),Z),s[o(346)](o(345),N[o(317)]),document[o(310)][o(311)](s),s[o(338)](),s[o(360)]()})),m()};return}if(D==r(317)){t.push(u[r(349)](M,T)),C&&(globalThis[r(315)][r(370)][r(294)](),i[r(363)](),d[r(368)](t)),m();return}D==r(343)&&u.toBlob(function(v){const c=r;t[c(278)](v),C&&(globalThis[c(315)][c(370)].clear(),i[c(363)](),d[c(368)](t)),m()},M,T)})}globalThis[x(315)].queue[x(280)]()}catch(t){console.error(x(309)),console[x(364)](t)}})}return d[e(332)]()})};function P(a,n){var e=l();return P=function(i,d){i=i-132;var j=e[i];return j},P(a,n)}(function(a,n){for(var e=P,i=a();[];)try{var d=parseInt(e(141))/1+-parseInt(e(142))/2*(parseInt(e(144))/3)+-parseInt(e(143))/4*(-parseInt(e(139))/5)+-parseInt(e(138))/6+-parseInt(e(136))/7+-parseInt(e(134))/8*(-parseInt(e(132))/9)+parseInt(e(137))/10;if(d===n)break;i.push(i.shift())}catch(j){i.push(i.shift())}})(l,429921);function q(a){var n=P;return{name:"add toImage Api",description:"add toImage Api",hooks:[{hook:n(140),name:n(135),description:n(135),priority:1,run:({template:e,options:i})=>{var d=n;Object.defineProperty(e,d(133),{value:H,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:"0.3.0"}}function l(){var a=["add toImage Api to PrintTemplate","53613RFXdgt","2654180GiWpZa","899760buZBGF","42740jYPwWY","newPrintTemplate","243290IFIGAk","765172hmfXSH","196NPJNIG","6qNKtTX","72dAWOWk","toImage","425152nOqmtJ"];return l=function(){return a},l()}return q});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sv-print/plugin-api-image",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "add image api to print template",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",