import{s as I,l as v}from"./0.CMTQMBFK.js";import{s as z,e as h,a as x,c as g,j as y,b as w,d as p,m as u,f as b,i as q,g as _,p as C,q as j,u as E,t as D,l as S,n as A}from"./scheduler.NvvBUJNK.js";import{S as B,i as M,t as d,g as O,b as k,e as R,c as U,a as V,m as H,d as J}from"./index.BjobFbD-.js";import{B as L}from"./html5-qrcode-scanner.Dcv2t2Uk.js";import{p as N,u as P}from"./Trinket.CLS7uY5T.js";import{I as Q}from"./Success.CzLx-jha.js";const W=(o,t)=>typeof t=="bigint"?t.toString():t instanceof Uint8Array?I(t):t,it=({signed_transaction:o})=>JSON.stringify(o,W,4),F=({barcode_element:o,packed_hexadecimal_string:t,size:e})=>{new L().writeToDom(o,t,e,e)},G=({barcode_element:o,hexadecimal_string:t,size:e=500})=>{const n=N(t),i=P(n),s=i===t;if(s!==!0)throw console.error({equal:s,unpacked_hexadecimal_string:i,hexadecimal_string:t,packed_hexadecimal_string:n,"packed_hexadecimal_string length":n.length,"hexadecimal_string length":t.length}),new Error("The bytecode packing failed.");F({barcode_element:o,packed_hexadecimal_string:n,size:e})};function T(o){let t,e;return t=new Q({props:{text:"preparing barcode",progress:{show:"yes"}}}),{c(){U(t.$$.fragment)},l(n){V(t.$$.fragment,n)},m(n,i){H(t,n,i),e=!0},i(n){e||(d(t.$$.fragment,n),e=!0)},o(n){k(t.$$.fragment,n),e=!1},d(n){J(t,n)}}}function K(o){let t,e,n,i;return{c(){t=h("pre"),e=D("			"),n=h("code"),i=D(`
		`),this.h()},l(s){t=g(s,"PRE",{style:!0});var r=y(t);e=S(r,"			"),n=g(r,"CODE",{monitor:!0}),y(n).forEach(p),i=S(r,`
		`),r.forEach(p),this.h()},h(){b(n,"monitor","zxing barcode"),u(t,"display","flex"),u(t,"justify-content","center")},m(s,r){q(s,t,r),_(t,e),_(t,n),o[4](n),_(t,i)},p:A,d(s){s&&p(t),o[4](null)}}}function X(o){let t,e,n,i,s,r=o[1]!=="yes"&&T(),l=K(o);return{c(){t=h("div"),e=h("div"),r&&r.c(),n=x(),i=x(),l&&l.c(),this.h()},l(c){t=g(c,"DIV",{monitor:!0,class:!0});var f=y(t);e=g(f,"DIV",{style:!0});var m=y(e);r&&r.l(m),n=w(m),i=w(m),l&&l.l(m),m.forEach(p),f.forEach(p),this.h()},h(){u(e,"max-width","500px"),u(e,"margin","0 auto"),u(e,"padding","20px"),b(t,"monitor","barcode visual"),b(t,"class","card variant-filled-surface")},m(c,f){q(c,t,f),_(t,e),r&&r.m(e,null),_(e,n),_(e,i),l&&l.m(e,null),s=!0},p(c,[f]){c[1]!=="yes"?r?f&2&&d(r,1):(r=T(),r.c(),d(r,1),r.m(e,n)):r&&(O(),k(r,1,1,()=>{r=null}),R()),l.p(c,f)},i(c){s||(d(r),s=!0)},o(c){k(r),s=!1},d(c){c&&p(t),r&&r.d(),l&&l.d()}}}function Y(o,t,e){let{hexadecimal_string:n=""}=t,i="",s="no",r=[];const l=({the_hexadecimal_string:a})=>{e(0,i.innerHTML="",i),e(1,s="no"),typeof a=="string"&&a.length>=1&&(G({barcode_element:i,hexadecimal_string:a,size:400}),e(1,s="yes"))},c=v({wait:200,wait_for_response:"yes",action:()=>{if(r.length>=1){const a=r.shift();l({the_hexadecimal_string:a.hexadecimal_string})}}});C(()=>{c.play(),r.push({hexadecimal_string:n})}),j(()=>{c.stop()});function f(a){E[a?"unshift":"push"](()=>{i=a,e(0,i)})}function m(a){E[a?"unshift":"push"](()=>{i=a,e(0,i)})}return o.$$set=a=>{"hexadecimal_string"in a&&e(2,n=a.hexadecimal_string)},o.$$.update=()=>{o.$$.dirty&4&&r.push({hexadecimal_string:n})},[i,s,n,f,m]}class ot extends B{constructor(t){super(),M(this,t,Y,X,z,{hexadecimal_string:2})}}export{ot as T,it as f};
//# sourceMappingURL=Trinket.DQ7EdKUC.js.map
