Files
QR-Invoice/node_modules/swissqrbill/lib/bundle/swissqrbill.js
2026-01-12 13:12:46 +01:00

9 lines
73 KiB
JavaScript

(function(w,A){typeof exports=="object"&&typeof module!="undefined"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(w=typeof globalThis!="undefined"?globalThis:w||self,A(w.SwissQRBill={}))})(this,(function(w){"use strict";var ni=Object.defineProperty,si=Object.defineProperties;var ri=Object.getOwnPropertyDescriptors;var pe=Object.getOwnPropertySymbols;var oi=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable;var Ie=(w,A,P)=>A in w?ni(w,A,{enumerable:!0,configurable:!0,writable:!0,value:P}):w[A]=P,ct=(w,A)=>{for(var P in A||(A={}))oi.call(A,P)&&Ie(w,P,A[P]);if(pe)for(var P of pe(A))ai.call(A,P)&&Ie(w,P,A[P]);return w},ut=(w,A)=>si(w,ri(A));var $;function A(i){const t=e=>Object.fromEntries(Object.entries(e).map(([n,s])=>typeof s=="object"?[n,t(s)]:typeof s=="string"?n==="account"?[n,dt(P(s))]:n==="reference"?[n,dt(P(s))]:n==="country"?[n,dt(P(s).toUpperCase())]:[n,dt(s)]:[n,s]));return t(i)}function P(i){return i.replace(/ /g,"")}function dt(i){return i.replace(/\n/g,"").replace(/\r/g,"")}const C={DE:{acceptancePoint:"Annahmestelle",account:"Konto / Zahlbar an",additionalInformation:"Zusätzliche Informationen",amount:"Betrag",currency:"Währung",inFavourOf:"Zugunsten",payableBy:"Zahlbar durch",payableByName:"Zahlbar durch (Name/Adresse)",paymentPart:"Zahlteil",receipt:"Empfangsschein",reference:"Referenz",separate:"Vor der Einzahlung abzutrennen"},EN:{acceptancePoint:"Acceptance point",account:"Account / Payable to",additionalInformation:"Additional information",amount:"Amount",currency:"Currency",inFavourOf:"In favour of",payableBy:"Payable by",payableByName:"Payable by (name/address)",paymentPart:"Payment part",receipt:"Receipt",reference:"Reference",separate:"Separate before paying in"},FR:{acceptancePoint:"Point de dépôt",account:"Compte / Payable à",additionalInformation:"Informations supplémentaires",amount:"Montant",currency:"Monnaie",inFavourOf:"En faveur de",payableBy:"Payable par",payableByName:"Payable par (nom/adresse)",paymentPart:"Section paiement",receipt:"Récépissé",reference:"Référence",separate:"A détacher avant le versement"},IT:{acceptancePoint:"Punto di accettazione",account:"Conto / Pagabile a",additionalInformation:"Informazioni supplementari",amount:"Importo",currency:"Valuta",inFavourOf:"A favore di",payableBy:"Pagabile da",payableByName:"Pagabile da (nome/indirizzo)",paymentPart:"Sezione pagamento",receipt:"Ricevuta",reference:"Riferimento",separate:"Da staccare prima del versamento"}};class g extends Error{constructor(t,e){const n=e?wt(t,e):t;super(n),this.name="ValidationError",this.code=At(t)}}function At(i){return Object.keys(m).find(n=>m[n]===i)}function wt(i,t){return Object.entries(t).reduce((e,[n,s])=>e.replace(`{${n}}`,s),i)}var m=(i=>(i.ACCOUNT_IS_QR_IBAN_BUT_REFERENCE_IS_MISSING="If there is no reference, a conventional IBAN must be used.",i.ACCOUNT_IS_QR_IBAN_BUT_REFERENCE_IS_REGULAR="QR-IBAN requires the use of a QR-Reference.",i.ACCOUNT_IS_REGULAR_IBAN_BUT_REFERENCE_IS_QR="QR-Reference requires the use of a QR-IBAN.",i.ACCOUNT_LENGTH_IS_INVALID="The provided IBAN number '{iban}' is either too long or too short.",i.ADDITIONAL_INFORMATION_LENGTH_IS_INVALID="Additional information must be a maximum of 140 characters.",i.ADDITIONAL_INFORMATION_TYPE_IS_INVALID="Additional information must be a string.",i.ALTERNATIVE_SCHEME_LENGTH_IS_INVALID="{scheme} must be a maximum of 100 characters.",i.ALTERNATIVE_SCHEME_TYPE_IS_INVALID="{scheme} must be a string.",i.AMOUNT_LENGTH_IS_INVALID="Amount must be a maximum of 12 digits.",i.AMOUNT_TYPE_IS_INVALID="Amount must be a number.",i.CREDITOR_ACCOUNT_COUNTRY_IS_INVALID="Only CH and LI IBAN numbers are allowed.",i.CREDITOR_ACCOUNT_IS_INVALID="The provided IBAN number '{iban}' is not valid.",i.CREDITOR_ACCOUNT_IS_UNDEFINED="Creditor account cannot be undefined.",i.CREDITOR_ADDRESS_IS_UNDEFINED="Creditor address cannot be undefined.",i.CREDITOR_ADDRESS_LENGTH_IS_INVALID="Creditor address must be a maximum of 70 characters.",i.CREDITOR_ADDRESS_TYPE_IS_INVALID="Creditor address TYPE must be a string.",i.CREDITOR_BUILDING_NUMBER_LENGTH_IS_INVALID="Creditor buildingNumber must be a maximum of 16 characters.",i.CREDITOR_BUILDING_NUMBER_TYPE_IS_INVALID="Creditor buildingNumber must be either a string or a number.",i.CREDITOR_CITY_IS_UNDEFINED="Creditor city cannot be undefined.",i.CREDITOR_CITY_LENGTH_IS_INVALID="Creditor city must be a maximum of 35 characters.",i.CREDITOR_CITY_TYPE_IS_INVALID="Creditor city must be a string.",i.CREDITOR_COUNTRY_IS_UNDEFINED="Creditor country cannot be undefined.",i.CREDITOR_COUNTRY_LENGTH_IS_INVALID="Creditor country must be 2 characters.",i.CREDITOR_COUNTRY_TYPE_IS_INVALID="Creditor country must be a string.",i.CREDITOR_IS_UNDEFINED="Creditor cannot be undefined.",i.CREDITOR_NAME_IS_UNDEFINED="Creditor name cannot be undefined.",i.CREDITOR_NAME_LENGTH_IS_INVALID="Creditor name must be a maximum of 70 characters.",i.CREDITOR_NAME_TYPE_IS_INVALID="Creditor name must be a string.",i.CREDITOR_ZIP_IS_UNDEFINED="Creditor zip cannot be undefined.",i.CREDITOR_ZIP_LENGTH_IS_INVALID="Creditor zip must be a maximum of 16 characters.",i.CREDITOR_ZIP_TYPE_IS_INVALID="Creditor zip must be either a string or a number.",i.CURRENCY_IS_UNDEFINED="Currency cannot be undefined.",i.CURRENCY_LENGTH_IS_INVALID="Currency must be a length of 3 characters.",i.CURRENCY_STRING_IS_INVALID="Currency must be either 'CHF' or 'EUR'",i.CURRENCY_TYPE_IS_INVALID="Currency must be a string.",i.DEBTOR_ADDRESS_IS_UNDEFINED="Debtor address cannot be undefined.",i.DEBTOR_ADDRESS_LENGTH_IS_INVALID="Debtor address must be a maximum of 70 characters.",i.DEBTOR_ADDRESS_TYPE_IS_INVALID="Debtor address TYPE must be a string.",i.DEBTOR_BUILDING_NUMBER_LENGTH_IS_INVALID="Debtor buildingNumber must be a maximum of 16 characters.",i.DEBTOR_BUILDING_NUMBER_TYPE_IS_INVALID="Debtor buildingNumber must be either a string or a number.",i.DEBTOR_CITY_IS_UNDEFINED="Debtor city cannot be undefined.",i.DEBTOR_CITY_LENGTH_IS_INVALID="Debtor city must be a maximum of 35 characters.",i.DEBTOR_CITY_TYPE_IS_INVALID="Debtor city must be a string.",i.DEBTOR_COUNTRY_IS_UNDEFINED="Debtor country cannot be undefined.",i.DEBTOR_COUNTRY_LENGTH_IS_INVALID="Debtor country must be 2 characters.",i.DEBTOR_COUNTRY_TYPE_IS_INVALID="Debtor country must be a string.",i.DEBTOR_IS_UNDEFINED="Debtor cannot be undefined.",i.DEBTOR_NAME_IS_UNDEFINED="Debtor name cannot be undefined.",i.DEBTOR_NAME_LENGTH_IS_INVALID="Debtor name must be a maximum of 70 characters.",i.DEBTOR_NAME_TYPE_IS_INVALID="Debtor name must be a string.",i.DEBTOR_ZIP_IS_UNDEFINED="Debtor zip cannot be undefined.",i.DEBTOR_ZIP_LENGTH_IS_INVALID="Debtor zip must be a maximum of 16 characters.",i.DEBTOR_ZIP_TYPE_IS_INVALID="Debtor zip must be either a string or a number.",i.MESSAGE_AND_ADDITIONAL_INFORMATION_LENGTH_IS_INVALID="Message and additionalInformation combined must be a maximum of 140 characters.",i.MESSAGE_LENGTH_IS_INVALID="Message must be a maximum of 140 characters.",i.MESSAGE_TYPE_IS_INVALID="Message must be a string.",i.QR_REFERENCE_IS_INVALID="The provided QR-Reference '{reference}' is not valid.",i.QR_REFERENCE_LENGTH_IS_INVALID="QR-Reference must be a must be exactly 27 characters.",i.REFERENCE_TYPE_IS_INVALID="Reference must be a string.",i.REGULAR_REFERENCE_LENGTH_IS_INVALID="Creditor reference must be a maximum of 25 characters.",i))(m||{});const ye=Object.freeze(Object.defineProperty({__proto__:null,ValidationError:g,ValidationErrors:m,getErrorCodeByMessage:At,resolveMessageParams:wt},Symbol.toStringTag,{value:"Module"}));function vt(i){i=i.replace(/ /g,"");const t=i.substring(4,9);return+t>=3e4&&+t<=31999}function Lt(i){return i=i.replace(/ /g,"").toUpperCase(),i=i.substring(4)+i.substring(0,4),Ot(i)===1}function st(i){var e;const t=i.replace(/ /g,"").match(/.{1,4}/g);return(e=t==null?void 0:t.join(" "))!=null?e:i}function rt(i){return i=i.replace(/ /g,""),!(i.length!==27||!/^\d+$/.test(i))}function xt(i){if(i=i.replace(/ /g,""),!rt(i))return!1;const t=i.substring(0,26),e=i.substring(26,27);return Pt(t)===e}function Bt(i){return i=i.replace(/ /g,"").toUpperCase(),!(!i.startsWith("RF")||i.length<5||i.length>25||!/^[\dA-Z]+$/.test(i))}function _e(i){if(i=i.replace(/ /g,""),!Bt(i))return!1;const t=i.substring(4);if(Number.isNaN(i))return!1;const e=i.substring(2,4);return Number.isNaN(e)?!1:Mt(t)===e}function Mt(i){return i=i.replace(/ /g,""),`${98-Ot(`${i}RF00`)}`.padStart(2,"0")}function Pt(i){return Se(i)}function $t(i){const t=i.replace(/ /g,""),e=t.substring(2).match(/.{1,5}/g);return e?`${t.substring(0,2)} ${e.join(" ")}`:i}function zt(i){var n;const e=i.replace(/ /g,"").match(/.{1,4}/g);return(n=e==null?void 0:e.join(" "))!=null?n:i}function ot(i){const t=ht(i);return t==="QRR"?$t(i):t==="SCOR"?zt(i):i}function at(i){const e=i.toFixed(2).split(".");let n="";for(let s=e[0].length-1,h=1;s>=0;s--,h++)n=e[0][s]+n,h===3&&(n=` ${n}`,h=0);return`${n.trim()}.${e[1]}`}function y(i){return i*2.83465}function B(i){return i/2.83465}function tt(i){return i*960/254}function Ne(i){return i*254/960}function ht(i){return typeof i=="undefined"?"NON":rt(i)?"QRR":"SCOR"}function Ot(i){const e=i.split("");for(let s=0;s<e.length;s++){const h=e[s].charCodeAt(0);h>=65&&(e[s]=`${h-65+10}`)}i=e.join("");let n=0;for(let s=0;s<i.length;s++){const h=+i[s];n=(10*n+h)%97}return n}function Se(i){const t=i.replace(/ /g,""),e=[0,9,4,6,8,2,7,1,3,5];let n=0;for(let s=0;s<t.length;s++)n=e[(n+parseInt(t.substring(s,s+1),10))%10];return((10-n)%10).toString()}const be=Object.freeze(Object.defineProperty({__proto__:null,calculateQRReferenceChecksum:Pt,calculateSCORReferenceChecksum:Mt,formatAmount:at,formatIBAN:st,formatQRReference:$t,formatReference:ot,formatSCORReference:zt,getReferenceType:ht,isIBANValid:Lt,isQRIBAN:vt,isQRReference:rt,isQRReferenceValid:xt,isSCORReference:Bt,isSCORReferenceValid:_e,mm2pt:y,mm2px:tt,pt2mm:B,px2mm:Ne},Symbol.toStringTag,{value:"Module"}));function mt(i){if(i.reference!==void 0&&typeof i.reference!="string")throw new g(m.REFERENCE_TYPE_IS_INVALID);if(i.message!==void 0){if(typeof i.message!="string")throw new g(m.MESSAGE_TYPE_IS_INVALID);if(i.message.length>140)throw new g(m.MESSAGE_LENGTH_IS_INVALID)}if(i.additionalInformation!==void 0){if(typeof i.additionalInformation!="string")throw new g(m.ADDITIONAL_INFORMATION_TYPE_IS_INVALID);if(i.additionalInformation.length>140)throw new g(m.ADDITIONAL_INFORMATION_LENGTH_IS_INVALID)}if(i.message!==void 0&&i.additionalInformation!==void 0&&i.additionalInformation.length+i.message.length>140)throw new g(m.MESSAGE_AND_ADDITIONAL_INFORMATION_LENGTH_IS_INVALID);if(i.av1!==void 0){if(typeof i.av1!="string")throw new g(m.ALTERNATIVE_SCHEME_TYPE_IS_INVALID,{scheme:"AV1"});if(i.av1.length>100)throw new g(m.ALTERNATIVE_SCHEME_LENGTH_IS_INVALID,{scheme:"AV1"})}if(i.av2!==void 0){if(typeof i.av2!="string")throw new g(m.ALTERNATIVE_SCHEME_TYPE_IS_INVALID,{scheme:"AV2"});if(i.av2.length>100)throw new g(m.ALTERNATIVE_SCHEME_LENGTH_IS_INVALID,{scheme:"AV2"})}if(i.creditor===void 0)throw new g(m.CREDITOR_IS_UNDEFINED);if(i.creditor.account===void 0)throw new g(m.CREDITOR_ACCOUNT_IS_UNDEFINED);if(!i.creditor.account.startsWith("CH")&&!i.creditor.account.startsWith("LI"))throw new g(m.CREDITOR_ACCOUNT_COUNTRY_IS_INVALID);if(i.creditor.account.length!==21)throw new g(m.ACCOUNT_LENGTH_IS_INVALID,{iban:i.creditor.account});if(i.creditor.name===void 0)throw new g(m.CREDITOR_NAME_IS_UNDEFINED);if(typeof i.creditor.name!="string")throw new g(m.CREDITOR_NAME_TYPE_IS_INVALID);if(i.creditor.name.length>70)throw new g(m.CREDITOR_NAME_LENGTH_IS_INVALID);if(i.creditor.address===void 0)throw new g(m.CREDITOR_ADDRESS_IS_UNDEFINED);if(typeof i.creditor.address!="string")throw new g(m.CREDITOR_ADDRESS_TYPE_IS_INVALID);if(i.creditor.address.length>70)throw new g(m.CREDITOR_ADDRESS_LENGTH_IS_INVALID);if(i.creditor.buildingNumber!==void 0){if(typeof i.creditor.buildingNumber!="string"&&typeof i.creditor.buildingNumber!="number")throw new g(m.CREDITOR_BUILDING_NUMBER_TYPE_IS_INVALID);if(i.creditor.buildingNumber.toString().length>16)throw new g(m.CREDITOR_BUILDING_NUMBER_LENGTH_IS_INVALID)}if(i.creditor.zip===void 0)throw new g(m.CREDITOR_ZIP_IS_UNDEFINED);if(typeof i.creditor.zip!="string"&&typeof i.creditor.zip!="number")throw new g(m.CREDITOR_ZIP_TYPE_IS_INVALID);if(i.creditor.zip.toString().length>16)throw new g(m.CREDITOR_ZIP_LENGTH_IS_INVALID);if(i.creditor.city===void 0)throw new g(m.CREDITOR_CITY_IS_UNDEFINED);if(typeof i.creditor.city!="string")throw new g(m.CREDITOR_CITY_TYPE_IS_INVALID);if(i.creditor.city.length>35)throw new g(m.CREDITOR_CITY_LENGTH_IS_INVALID);if(i.creditor.country===void 0)throw new g(m.CREDITOR_COUNTRY_IS_UNDEFINED);if(typeof i.creditor.country!="string")throw new g(m.CREDITOR_COUNTRY_TYPE_IS_INVALID);if(i.creditor.country.length!==2)throw new g(m.CREDITOR_COUNTRY_LENGTH_IS_INVALID);if(i.amount!==void 0){if(typeof i.amount!="number")throw new g(m.AMOUNT_TYPE_IS_INVALID);if(i.amount.toFixed(2).toString().length>12)throw new g(m.AMOUNT_LENGTH_IS_INVALID)}if(i.currency===void 0)throw new g(m.CURRENCY_IS_UNDEFINED);if(typeof i.currency!="string")throw new g(m.CURRENCY_TYPE_IS_INVALID);if(i.currency.length!==3)throw new g(m.CURRENCY_LENGTH_IS_INVALID);if(i.currency!=="CHF"&&i.currency!=="EUR")throw new g(m.CURRENCY_STRING_IS_INVALID);if(i.debtor!==void 0){if(i.debtor.name===void 0)throw new g(m.DEBTOR_NAME_IS_UNDEFINED);if(typeof i.debtor.name!="string")throw new g(m.DEBTOR_NAME_TYPE_IS_INVALID);if(i.debtor.name.length>70)throw new g(m.DEBTOR_NAME_LENGTH_IS_INVALID);if(i.debtor.address===void 0)throw new g(m.DEBTOR_ADDRESS_IS_UNDEFINED);if(typeof i.debtor.address!="string")throw new g(m.DEBTOR_ADDRESS_TYPE_IS_INVALID);if(i.debtor.address.length>70)throw new g(m.DEBTOR_ADDRESS_LENGTH_IS_INVALID);if(i.debtor.buildingNumber!==void 0){if(typeof i.debtor.buildingNumber!="string"&&typeof i.debtor.buildingNumber!="number")throw new g(m.DEBTOR_BUILDING_NUMBER_TYPE_IS_INVALID);if(i.debtor.buildingNumber.toString().length>16)throw new g(m.DEBTOR_BUILDING_NUMBER_LENGTH_IS_INVALID)}if(i.debtor.zip===void 0)throw new g(m.DEBTOR_ZIP_IS_UNDEFINED);if(typeof i.debtor.zip!="string"&&typeof i.debtor.zip!="number")throw new g(m.DEBTOR_ZIP_TYPE_IS_INVALID);if(i.debtor.zip.toString().length>16)throw new g(m.DEBTOR_ZIP_LENGTH_IS_INVALID);if(i.debtor.city===void 0)throw new g(m.DEBTOR_CITY_IS_UNDEFINED);if(typeof i.debtor.city!="string")throw new g(m.DEBTOR_CITY_TYPE_IS_INVALID);if(i.debtor.city.length>35)throw new g(m.DEBTOR_CITY_LENGTH_IS_INVALID);if(i.debtor.country===void 0)throw new g(m.DEBTOR_COUNTRY_IS_UNDEFINED);if(typeof i.debtor.country!="string")throw new g(m.DEBTOR_COUNTRY_TYPE_IS_INVALID);if(i.debtor.country.length!==2)throw new g(m.DEBTOR_COUNTRY_LENGTH_IS_INVALID)}if(Lt(i.creditor.account)===!1)throw new g(m.CREDITOR_ACCOUNT_IS_INVALID,{iban:i.creditor.account});if(vt(i.creditor.account)){if(i.reference===void 0)throw new g(m.ACCOUNT_IS_QR_IBAN_BUT_REFERENCE_IS_MISSING);if(i.reference.length!==27)throw new g(m.QR_REFERENCE_LENGTH_IS_INVALID);if(rt(i.reference)){if(!xt(i.reference))throw new g(m.QR_REFERENCE_IS_INVALID,{reference:i.reference})}else throw new g(m.ACCOUNT_IS_QR_IBAN_BUT_REFERENCE_IS_REGULAR)}else if(i.reference!==void 0){if(rt(i.reference))throw new g(m.ACCOUNT_IS_REGULAR_IBAN_BUT_REFERENCE_IS_QR);if(i.reference.length>25)throw new g(m.REGULAR_REFERENCE_LENGTH_IS_INVALID)}}let Ce=($=class{constructor(t,e){this.scissors=!0,this.separate=!1,this.outlines=!0,this.language="DE",this.font="Helvetica",this._x=0,this._y=0,this.data=A(t),mt(this.data),this.language=(e==null?void 0:e.language)!==void 0?e.language:this.language,this.outlines=(e==null?void 0:e.outlines)!==void 0?e.outlines:this.outlines,this.font=(e==null?void 0:e.fontName)!==void 0?e.fontName:this.font,(e==null?void 0:e.scissors)!==void 0&&(this.scissors=e.scissors,this.separate=!e.scissors),(e==null?void 0:e.separate)!==void 0&&(this.separate=e.separate,this.scissors=!e.separate),(e==null?void 0:e.scissors)===!1&&(e==null?void 0:e.separate)===!1&&(this.separate=!1,this.scissors=!1)}attachTo(t,e=0,n=(s=>(s=t.page)==null?void 0:s.height)()?(h=>(h=t.page)==null?void 0:h.height)()-y(105):0){$.isSpaceSufficient(t,e,n)||(t.addPage({margin:0,size:[$.width,$.height]}),e=0,n=0),this._x=e,this._y=n,this.render(t)}static isSpaceSufficient(t,e=0,n=(s=>(s=t.page)==null?void 0:s.height)()?(h=>(h=t.page)==null?void 0:h.height)()-$.height:0){return t.page?Math.round(e+$.width)<=Math.round(t.page.width)&&Math.round(t.y+$.height)<=Math.round(t.page.height)&&Math.round(n+$.height)<=Math.round(t.page.height):!1}x(t=0){return this._x+y(t)}y(t=0){return this._y+y(t)}render(t){if(this.outlines&&(t.page.height>y(105)&&t.moveTo(this.x(),this.y()).lineTo(this.x(210),this.y()).lineWidth(.75).strokeOpacity(1).dash(1,{size:1}).strokeColor("black").stroke(),t.moveTo(this.x(62),this.y()).lineTo(this.x(62),this.y(105)).lineWidth(.75).strokeOpacity(1).dash(1,{size:1}).strokeColor("black").stroke()),this.scissors){const s="4.545 -1.803 m 4.06 -2.388 3.185 -2.368 2.531 -2.116 c -1.575 -0.577 l -2.769 -1.23 -3.949 -1.043 -3.949 -1.361 c -3.949 -1.61 -3.721 -1.555 -3.755 -2.203 c -3.788 -2.825 -4.437 -3.285 -5.05 -3.244 c -5.664 -3.248 -6.3 -2.777 -6.305 -2.129 c -6.351 -1.476 -5.801 -0.869 -5.152 -0.826 c -4.391 -0.713 -3.043 -1.174 -2.411 -0.041 c -2.882 0.828 -3.718 0.831 -4.474 0.787 c -5.101 0.751 -5.855 0.931 -6.154 1.547 c -6.443 2.138 -6.16 2.979 -5.496 3.16 c -4.826 3.406 -3.906 3.095 -3.746 2.325 c -3.623 1.731 -4.044 1.452 -3.882 1.236 c -3.76 1.073 -2.987 1.168 -1.608 0.549 c 2.838 2.117 l 3.4 2.273 4.087 2.268 4.584 1.716 c -0.026 -0.027 l 4.545 -1.803 l h -4.609 -2.753 m -3.962 -2.392 -4.015 -1.411 -4.687 -1.221 c -5.295 -1.009 -6.073 -1.6 -5.879 -2.26 c -5.765 -2.801 -5.052 -3 -4.609 -2.753 c h -4.581 1.256 m -3.906 1.505 -4.02 2.648 -4.707 2.802 c -5.163 2.96 -5.814 2.733 -5.86 2.196 c -5.949 1.543 -5.182 0.954 -4.581 1.256 c h",h=" 1.803 4.545 m 2.388 4.06 2.368 3.185 2.116 2.531 c 0.577 -1.575 l 1.23 -2.769 1.043 -3.949 1.361 -3.949 c 1.61 -3.949 1.555 -3.721 2.203 -3.755 c 2.825 -3.788 3.285 -4.437 3.244 -5.05 c 3.248 -5.664 2.777 -6.3 2.129 -6.305 c 1.476 -6.351 0.869 -5.801 0.826 -5.152 c 0.713 -4.391 1.174 -3.043 0.041 -2.411 c -0.828 -2.882 -0.831 -3.718 -0.787 -4.474 c -0.751 -5.101 -0.931 -5.855 -1.547 -6.154 c -2.138 -6.443 -2.979 -6.16 -3.16 -5.496 c -3.406 -4.826 -3.095 -3.906 -2.325 -3.746 c -1.731 -3.623 -1.452 -4.044 -1.236 -3.882 c -1.073 -3.76 -1.168 -2.987 -0.549 -1.608 c -2.117 2.838 l -2.273 3.4 -2.268 4.087 -1.716 4.584 c 0.027 -0.026 l 1.803 4.545 l h 2.753 -4.609 m 2.392 -3.962 1.411 -4.015 1.221 -4.687 c 1.009 -5.295 1.6 -6.073 2.26 -5.879 c 2.801 -5.765 3 -5.052 2.753 -4.609 c h -1.256 -4.581 m -1.505 -3.906 -2.648 -4.02 -2.802 -4.707 c -2.96 -5.163 -2.733 -5.814 -2.196 -5.86 c -1.543 -5.949 -0.954 -5.182 -1.256 -4.581 c h";t.page.height>y(105)&&(t.save(),t.translate(this.x(105),this.y()),t.addContent(s).fillColor("black").fill(),t.restore()),t.save(),t.translate(this.x(62),this.y()+30),t.addContent(h).fillColor("black").fill(),t.restore()}this.separate&&t.page.height>y(105)&&(t.fontSize(11),t.font(this.font),t.text(C[this.language].separate,0,this.y()-12,{align:"center",width:y(210)})),t.fontSize(11),t.font(`${this.font}-Bold`),t.text(C[this.language].receipt,this.x(5),this.y(5),{align:"left",width:y(52)}),t.fontSize(6),t.font(`${this.font}-Bold`),t.text(C[this.language].account,this.x(5),this.y(12),{lineGap:1,width:y(52)}),t.fontSize(8),t.font(this.font),t.text(`${st(this.data.creditor.account)}
${this.formatAddress(this.data.creditor)}`,{lineGap:-.5,width:y(52)}),t.fontSize(9),t.moveDown(),this.data.reference!==void 0&&(t.fontSize(6),t.font(`${this.font}-Bold`),t.text(C[this.language].reference,{lineGap:1,width:y(52)}),t.fontSize(8),t.font(this.font),t.text(ot(this.data.reference),{lineGap:-.5,width:y(52)}),t.fontSize(9),t.moveDown()),this.data.debtor!==void 0?(t.fontSize(6),t.font(`${this.font}-Bold`),t.text(C[this.language].payableBy,{lineGap:1,width:y(52)}),t.fontSize(8),t.font(this.font),t.text(this.formatAddress(this.data.debtor),{lineGap:-.5,width:y(52)})):(t.fontSize(6),t.font(`${this.font}-Bold`),t.text(C[this.language].payableByName,{lineGap:1,width:y(52)}),this.addRectangle(t,5,B(t.y-this.y()),52,20)),t.fontSize(6),t.font(`${this.font}-Bold`),t.text(C[this.language].currency,this.x(5),this.y(68),{lineGap:1,width:y(15)});const e=this.data.amount===void 0?18:27;if(t.text(C[this.language].amount,this.x(e),this.y(68),{lineGap:1,width:y(52-e)}),t.fontSize(8),t.font(this.font),t.text(this.data.currency,this.x(5),this.y(71),{lineGap:-.5,width:y(15)}),this.data.amount!==void 0?t.text(at(this.data.amount),this.x(e),this.y(71),{lineGap:-.5,width:y(52-e)}):this.addRectangle(t,27,68,30,10),t.fontSize(6),t.font(`${this.font}-Bold`),t.text(C[this.language].acceptancePoint,this.x(5),this.y(82),{align:"right",height:y(18),lineGap:1,width:y(52)}),t.fontSize(11),t.font(`${this.font}-Bold`),t.text(C[this.language].paymentPart,this.x(67),this.y(5),{align:"left",lineGap:1,width:y(51)}),new kt(this.data).attachTo(t,this.x(67),this.y(17)),t.fontSize(8),t.font(`${this.font}-Bold`),t.text(C[this.language].currency,this.x(67),this.y(68),{lineGap:1,width:y(15)}),t.text(C[this.language].amount,this.x(89),this.y(68),{width:y(29)}),t.fontSize(10),t.font(this.font),t.text(this.data.currency,this.x(67),this.y(72),{lineGap:-.5,width:y(15)}),this.data.amount!==void 0?t.text(at(this.data.amount),this.x(89),this.y(72),{lineGap:-.5,width:y(29)}):this.addRectangle(t,78,72,40,15),this.data.av1!==void 0){const[s,h]=this.data.av1.split(/(\/.+)/);t.fontSize(7),t.font(`${this.font}-Bold`),t.text(s,this.x(67),this.y(90),{continued:!0,height:y(3),lineGap:1,width:y(138)}),t.font(this.font),t.text(this.data.av1.length>90?`${h.substring(0,87)}...`:h,{continued:!1})}if(this.data.av2!==void 0){const[s,h]=this.data.av2.split(/(\/.+)/);t.fontSize(7),t.font(`${this.font}-Bold`),t.text(s,this.x(67),this.y(93),{continued:!0,height:y(3),lineGap:1,width:y(138)}),t.font(this.font),t.text(this.data.av2.length>90?`${h.substring(0,87)}...`:h,{lineGap:-.5})}if(t.fontSize(8),t.font(`${this.font}-Bold`),t.text(C[this.language].account,this.x(118),this.y(5),{lineGap:1,width:y(87)}),t.fontSize(10),t.font(this.font),t.text(`${st(this.data.creditor.account)}
${this.formatAddress(this.data.creditor)}`,{lineGap:-.75,width:y(87)}),t.fontSize(9),t.moveDown(),this.data.reference!==void 0&&(t.fontSize(8),t.font(`${this.font}-Bold`),t.text(C[this.language].reference,{lineGap:1,width:y(87)}),t.fontSize(10),t.font(this.font),t.text(ot(this.data.reference),{lineGap:-.75,width:y(87)}),t.fontSize(9),t.moveDown()),this.data.message!==void 0||this.data.additionalInformation!==void 0){t.fontSize(8),t.font(`${this.font}-Bold`),t.text(C[this.language].additionalInformation,{lineGap:1,width:y(87)}),t.fontSize(10),t.font(this.font);const s={lineGap:-.75,width:y(87)},h=t.heightOfString("A",s),l=ht(this.data.reference),u=l==="QRR"||l==="SCOR"?3:4,S=this.data.additionalInformation!==void 0?t.heightOfString(this.data.additionalInformation,s)/h:0;if(this.data.additionalInformation!==void 0){if(l==="QRR"||l==="SCOR")this.data.message!==void 0&&t.text(this.data.message,ut(ct({},s),{ellipsis:!0,height:h,lineBreak:!1}));else if(this.data.message!==void 0){const r=u-S;t.text(this.data.message,ut(ct({},s),{ellipsis:!0,height:h*r,lineBreak:!0}))}t.text(this.data.additionalInformation,s)}else this.data.message!==void 0&&t.text(this.data.message,ut(ct({},s),{ellipsis:!0,height:h*u,lineBreak:!0}));t.fontSize(9),t.moveDown()}this.data.debtor!==void 0?(t.fontSize(8),t.font(`${this.font}-Bold`),t.text(C[this.language].payableBy,{lineGap:1,width:y(87)}),t.fontSize(10),t.font(this.font),t.text(this.formatAddress(this.data.debtor),{lineGap:-.75,width:y(87)})):(t.fontSize(8),t.font(`${this.font}-Bold`),t.text(C[this.language].payableByName,{lineGap:1,width:y(87)}),this.addRectangle(t,118,B(t.y-this.y()),65,25))}formatAddress(t){const e=t.country!=="CH"?`${t.country} - `:"";return t.buildingNumber!==void 0?`${t.name}
${t.address} ${t.buildingNumber}
${e}${t.zip} ${t.city}`:`${t.name}
${t.address}
${e}${t.zip} ${t.city}`}addRectangle(t,e,n,s,h){t.moveTo(this.x(e+3),this.y(n)).lineTo(this.x(e),this.y(n)).lineTo(this.x(e),this.y(n+3)).moveTo(this.x(e),this.y(n+h-3)).lineTo(this.x(e),this.y(n+h)).lineTo(this.x(e+3),this.y(n+h)).moveTo(this.x(e+s-3),this.y(n+h)).lineTo(this.x(e+s),this.y(n+h)).lineTo(this.x(e+s),this.y(n+h-3)).moveTo(this.x(e+s),this.y(n+3)).lineTo(this.x(e+s),this.y(n)).lineTo(this.x(e+s-3),this.y(n)).lineWidth(.75).undash().strokeColor("black").stroke()}},$.width=y(210),$.height=y(105),$);var X;(i=>{const l=class l{constructor(r,o,a,f){if(this.version=r,this.errorCorrectionLevel=o,this.modules=[],this.isFunction=[],r<l.MIN_VERSION||r>l.MAX_VERSION)throw"Version value out of range";if(f<-1||f>7)throw"Mask value out of range";this.size=r*4+17;const c=[];for(let d=0;d<this.size;d++)c.push(!1);for(let d=0;d<this.size;d++)this.modules.push(c.slice()),this.isFunction.push(c.slice());this.drawFunctionPatterns();const p=this.addEccAndInterleave(a);if(this.drawCodewords(p),f==-1){let d=1e9;for(let I=0;I<8;I++){this.applyMask(I),this.drawFormatBits(I);const _=this.getPenaltyScore();_<d&&(f=I,d=_),this.applyMask(I)}}s(0<=f&&f<=7),this.mask=f,this.applyMask(f),this.drawFormatBits(f),this.isFunction=[]}static encodeText(r,o){const a=i.QrSegment.makeSegments(r);return l.encodeSegments(a,o)}static encodeBinary(r,o){const a=i.QrSegment.makeBytes(r);return l.encodeSegments([a],o)}static encodeSegments(r,o,a=1,f=40,c=-1,p=!0){if(!(l.MIN_VERSION<=a&&a<=f&&f<=l.MAX_VERSION)||c<-1||c>7)throw"Invalid value";let d,I;for(d=a;;d++){const N=l.getNumDataCodewords(d,o)*8,v=h.getTotalBits(r,d);if(v<=N){I=v;break}if(d>=f)throw"Data too long"}for(const N of[l.Ecc.MEDIUM,l.Ecc.QUARTILE,l.Ecc.HIGH])p&&I<=l.getNumDataCodewords(d,N)*8&&(o=N);const _=[];for(const N of r){e(N.mode.modeBits,4,_),e(N.numChars,N.mode.numCharCountBits(d),_);for(const v of N.getData())_.push(v)}s(_.length==I);const M=l.getNumDataCodewords(d,o)*8;s(_.length<=M),e(0,Math.min(4,M-_.length),_),e(0,(8-_.length%8)%8,_),s(_.length%8==0);for(let N=236;_.length<M;N^=253)e(N,8,_);const L=[];for(;L.length*8<_.length;)L.push(0);return _.forEach((N,v)=>L[v>>>3]|=N<<7-(v&7)),new l(d,o,L,c)}getModule(r,o){return 0<=r&&r<this.size&&0<=o&&o<this.size&&this.modules[o][r]}drawFunctionPatterns(){for(let a=0;a<this.size;a++)this.setFunctionModule(6,a,a%2==0),this.setFunctionModule(a,6,a%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const r=this.getAlignmentPatternPositions(),o=r.length;for(let a=0;a<o;a++)for(let f=0;f<o;f++)a==0&&f==0||a==0&&f==o-1||a==o-1&&f==0||this.drawAlignmentPattern(r[a],r[f]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(r){const o=this.errorCorrectionLevel.formatBits<<3|r;let a=o;for(let c=0;c<10;c++)a=a<<1^(a>>>9)*1335;const f=(o<<10|a)^21522;s(f>>>15==0);for(let c=0;c<=5;c++)this.setFunctionModule(8,c,n(f,c));this.setFunctionModule(8,7,n(f,6)),this.setFunctionModule(8,8,n(f,7)),this.setFunctionModule(7,8,n(f,8));for(let c=9;c<15;c++)this.setFunctionModule(14-c,8,n(f,c));for(let c=0;c<8;c++)this.setFunctionModule(this.size-1-c,8,n(f,c));for(let c=8;c<15;c++)this.setFunctionModule(8,this.size-15+c,n(f,c));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let r=this.version;for(let a=0;a<12;a++)r=r<<1^(r>>>11)*7973;const o=this.version<<12|r;s(o>>>18==0);for(let a=0;a<18;a++){const f=n(o,a),c=this.size-11+a%3,p=Math.floor(a/3);this.setFunctionModule(c,p,f),this.setFunctionModule(p,c,f)}}drawFinderPattern(r,o){for(let a=-4;a<=4;a++)for(let f=-4;f<=4;f++){const c=Math.max(Math.abs(f),Math.abs(a)),p=r+f,d=o+a;0<=p&&p<this.size&&0<=d&&d<this.size&&this.setFunctionModule(p,d,c!=2&&c!=4)}}drawAlignmentPattern(r,o){for(let a=-2;a<=2;a++)for(let f=-2;f<=2;f++)this.setFunctionModule(r+f,o+a,Math.max(Math.abs(f),Math.abs(a))!=1)}setFunctionModule(r,o,a){this.modules[o][r]=a,this.isFunction[o][r]=!0}addEccAndInterleave(r){const o=this.version,a=this.errorCorrectionLevel;if(r.length!=l.getNumDataCodewords(o,a))throw"Invalid argument";const f=l.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][o],c=l.ECC_CODEWORDS_PER_BLOCK[a.ordinal][o],p=Math.floor(l.getNumRawDataModules(o)/8),d=f-p%f,I=Math.floor(p/f),_=[],M=l.reedSolomonComputeDivisor(c);for(let N=0,v=0;N<f;N++){const z=r.slice(v,v+I-c+(N<d?0:1));v+=z.length;const yt=l.reedSolomonComputeRemainder(z,M);N<d&&z.push(0),_.push(z.concat(yt))}const L=[];for(let N=0;N<_[0].length;N++)_.forEach((v,z)=>{(N!=I-c||z>=d)&&L.push(v[N])});return s(L.length==p),L}drawCodewords(r){if(r.length!=Math.floor(l.getNumRawDataModules(this.version)/8))throw"Invalid argument";let o=0;for(let a=this.size-1;a>=1;a-=2){a==6&&(a=5);for(let f=0;f<this.size;f++)for(let c=0;c<2;c++){const p=a-c,I=(a+1&2)==0?this.size-1-f:f;!this.isFunction[I][p]&&o<r.length*8&&(this.modules[I][p]=n(r[o>>>3],7-(o&7)),o++)}}s(o==r.length*8)}applyMask(r){if(r<0||r>7)throw"Mask value out of range";for(let o=0;o<this.size;o++)for(let a=0;a<this.size;a++){let f;switch(r){case 0:f=(a+o)%2==0;break;case 1:f=o%2==0;break;case 2:f=a%3==0;break;case 3:f=(a+o)%3==0;break;case 4:f=(Math.floor(a/3)+Math.floor(o/2))%2==0;break;case 5:f=a*o%2+a*o%3==0;break;case 6:f=(a*o%2+a*o%3)%2==0;break;case 7:f=((a+o)%2+a*o%3)%2==0;break;default:throw"Unreachable"}!this.isFunction[o][a]&&f&&(this.modules[o][a]=!this.modules[o][a])}}getPenaltyScore(){let r=0;for(let c=0;c<this.size;c++){let p=!1,d=0;const I=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[c][_]==p?(d++,d==5?r+=l.PENALTY_N1:d>5&&r++):(this.finderPenaltyAddHistory(d,I),p||(r+=this.finderPenaltyCountPatterns(I)*l.PENALTY_N3),p=this.modules[c][_],d=1);r+=this.finderPenaltyTerminateAndCount(p,d,I)*l.PENALTY_N3}for(let c=0;c<this.size;c++){let p=!1,d=0;const I=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[_][c]==p?(d++,d==5?r+=l.PENALTY_N1:d>5&&r++):(this.finderPenaltyAddHistory(d,I),p||(r+=this.finderPenaltyCountPatterns(I)*l.PENALTY_N3),p=this.modules[_][c],d=1);r+=this.finderPenaltyTerminateAndCount(p,d,I)*l.PENALTY_N3}for(let c=0;c<this.size-1;c++)for(let p=0;p<this.size-1;p++){const d=this.modules[c][p];d==this.modules[c][p+1]&&d==this.modules[c+1][p]&&d==this.modules[c+1][p+1]&&(r+=l.PENALTY_N2)}let o=0;for(const c of this.modules)o=c.reduce((p,d)=>p+(d?1:0),o);const a=this.size*this.size,f=Math.ceil(Math.abs(o*20-a*10)/a)-1;return s(0<=f&&f<=9),r+=f*l.PENALTY_N4,s(0<=r&&r<=2568888),r}getAlignmentPatternPositions(){if(this.version==1)return[];{const r=Math.floor(this.version/7)+2,o=this.version==32?26:Math.ceil((this.version*4+4)/(r*2-2))*2,a=[6];for(let f=this.size-7;a.length<r;f-=o)a.splice(1,0,f);return a}}static getNumRawDataModules(r){if(r<l.MIN_VERSION||r>l.MAX_VERSION)throw"Version number out of range";let o=(16*r+128)*r+64;if(r>=2){const a=Math.floor(r/7)+2;o-=(25*a-10)*a-55,r>=7&&(o-=36)}return s(208<=o&&o<=29648),o}static getNumDataCodewords(r,o){return Math.floor(l.getNumRawDataModules(r)/8)-l.ECC_CODEWORDS_PER_BLOCK[o.ordinal][r]*l.NUM_ERROR_CORRECTION_BLOCKS[o.ordinal][r]}static reedSolomonComputeDivisor(r){if(r<1||r>255)throw"Degree out of range";const o=[];for(let f=0;f<r-1;f++)o.push(0);o.push(1);let a=1;for(let f=0;f<r;f++){for(let c=0;c<o.length;c++)o[c]=l.reedSolomonMultiply(o[c],a),c+1<o.length&&(o[c]^=o[c+1]);a=l.reedSolomonMultiply(a,2)}return o}static reedSolomonComputeRemainder(r,o){const a=o.map(f=>0);for(const f of r){const c=f^a.shift();a.push(0),o.forEach((p,d)=>a[d]^=l.reedSolomonMultiply(p,c))}return a}static reedSolomonMultiply(r,o){if(r>>>8||o>>>8)throw"Byte out of range";let a=0;for(let f=7;f>=0;f--)a=a<<1^(a>>>7)*285,a^=(o>>>f&1)*r;return s(a>>>8==0),a}finderPenaltyCountPatterns(r){const o=r[1];s(o<=this.size*3);const a=o>0&&r[2]==o&&r[3]==o*3&&r[4]==o&&r[5]==o;return(a&&r[0]>=o*4&&r[6]>=o?1:0)+(a&&r[6]>=o*4&&r[0]>=o?1:0)}finderPenaltyTerminateAndCount(r,o,a){return r&&(this.finderPenaltyAddHistory(o,a),o=0),o+=this.size,this.finderPenaltyAddHistory(o,a),this.finderPenaltyCountPatterns(a)}finderPenaltyAddHistory(r,o){o[0]==0&&(r+=this.size),o.pop(),o.unshift(r)}};l.MIN_VERSION=1,l.MAX_VERSION=40,l.PENALTY_N1=3,l.PENALTY_N2=3,l.PENALTY_N3=40,l.PENALTY_N4=10,l.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],l.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];let t=l;i.QrCode=t;function e(S,r,o){if(r<0||r>31||S>>>r)throw"Value out of range";for(let a=r-1;a>=0;a--)o.push(S>>>a&1)}function n(S,r){return(S>>>r&1)!=0}function s(S){if(!S)throw"Assertion error"}const u=class u{constructor(r,o,a){if(this.mode=r,this.numChars=o,this.bitData=a,o<0)throw"Invalid argument";this.bitData=a.slice()}static makeBytes(r){const o=[];for(const a of r)e(a,8,o);return new u(u.Mode.BYTE,r.length,o)}static makeNumeric(r){if(!u.isNumeric(r))throw"String contains non-numeric characters";const o=[];for(let a=0;a<r.length;){const f=Math.min(r.length-a,3);e(parseInt(r.substr(a,f),10),f*3+1,o),a+=f}return new u(u.Mode.NUMERIC,r.length,o)}static makeAlphanumeric(r){if(!u.isAlphanumeric(r))throw"String contains unencodable characters in alphanumeric mode";const o=[];let a;for(a=0;a+2<=r.length;a+=2){let f=u.ALPHANUMERIC_CHARSET.indexOf(r.charAt(a))*45;f+=u.ALPHANUMERIC_CHARSET.indexOf(r.charAt(a+1)),e(f,11,o)}return a<r.length&&e(u.ALPHANUMERIC_CHARSET.indexOf(r.charAt(a)),6,o),new u(u.Mode.ALPHANUMERIC,r.length,o)}static makeSegments(r){return r==""?[]:u.isNumeric(r)?[u.makeNumeric(r)]:u.isAlphanumeric(r)?[u.makeAlphanumeric(r)]:[u.makeBytes(u.toUtf8ByteArray(r))]}static makeEci(r){const o=[];if(r<0)throw"ECI assignment value out of range";if(r<128)e(r,8,o);else if(r<16384)e(2,2,o),e(r,14,o);else if(r<1e6)e(6,3,o),e(r,21,o);else throw"ECI assignment value out of range";return new u(u.Mode.ECI,0,o)}static isNumeric(r){return u.NUMERIC_REGEX.test(r)}static isAlphanumeric(r){return u.ALPHANUMERIC_REGEX.test(r)}getData(){return this.bitData.slice()}static getTotalBits(r,o){let a=0;for(const f of r){const c=f.mode.numCharCountBits(o);if(f.numChars>=1<<c)return 1/0;a+=4+c+f.bitData.length}return a}static toUtf8ByteArray(r){r=encodeURI(r);const o=[];for(let a=0;a<r.length;a++)r.charAt(a)!="%"?o.push(r.charCodeAt(a)):(o.push(parseInt(r.substr(a+1,2),16)),a+=2);return o}};u.NUMERIC_REGEX=/^[0-9]*$/,u.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,u.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let h=u;i.QrSegment=h})(X||(X={})),(i=>{(t=>{const n=class n{constructor(h,l){this.ordinal=h,this.formatBits=l}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2);let e=n;t.Ecc=e})(i.QrCode||(i.QrCode={}))})(X||(X={})),(i=>{(t=>{const n=class n{constructor(h,l){this.modeBits=h,this.numBitsCharCount=l}numCharCountBits(h){return this.numBitsCharCount[Math.floor((h+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]);let e=n;t.Mode=e})(i.QrSegment||(i.QrSegment={}))})(X||(X={}));function Te(i){var h,l,u,S,r,o;const t=A(i);mt(t);const e=(h=t.amount)==null?void 0:h.toFixed(2),n=ht(t.reference);return["SPC","0200","1",(l=t.creditor.account)!=null?l:"","S",t.creditor.name,t.creditor.address,t.creditor.buildingNumber?`${t.creditor.buildingNumber}`:"",`${t.creditor.zip}`,t.creditor.city,t.creditor.country,"","","","","","","",e!=null?e:"",t.currency,...t.debtor?["S",t.debtor.name,t.debtor.address,t.debtor.buildingNumber?`${t.debtor.buildingNumber}`:"",`${t.debtor.zip}`,t.debtor.city,(u=t.debtor.country)!=null?u:""]:["","","","","","",""],n,(S=t.reference)!=null?S:"",(r=t.message)!=null?r:"","EPD",(o=t.additionalInformation)!=null?o:"",...t.av1?[t.av1]:[],...t.av2?[t.av2]:[]].join(`
`)}function Ft(i,t,e){const n=Te(i),s=X.QrSegment.makeEci(26),h=X.QrSegment.makeSegments(n),l=X.QrCode.encodeSegments([s,...h],X.QrCode.Ecc.MEDIUM,10,25),u=t/l.size;for(let S=0;S<l.size;S++){const r=S*u;for(let o=0;o<l.size;o++){const a=o*u;l.getModule(S,o)&&e(r,a,u)}}}function Gt(i,t){const e=i/y(46),n=y(7)*e,s=y(6)*e,h=y(1.17)*e,l=y(3.89)*e;t(i/2-n/2,i/2-n/2,n,n,"white"),t(i/2-s/2,i/2-s/2,s,s,"black"),t(i/2-l/2,i/2-h/2,l,h,"white"),t(i/2-h/2,i/2-l/2,h,l,"white")}let kt=class{constructor(t,e=46){this.size=y(e),this.data=A(t),mt(this.data)}attachTo(t,e=(s=>(s=t.x)!=null?s:0)(),n=(h=>(h=t.y)!=null?h:0)()){t.save(),t.translate(e,n),Ft(this.data,this.size,(l,u,S)=>{t.rect(l,u,S,S)}),t.fillColor("black"),t.fill(),Gt(this.size,(l,u,S,r,o)=>{t.rect(l,u,S,r).fillColor(o).fill()}),t.restore()}};var Yt=(i=>(i[i.HeightCalculation=0]="HeightCalculation",i[i.PageInjection=1]="PageInjection",i[i.BackgroundColor=2]="BackgroundColor",i[i.Borders=3]="Borders",i[i.Text=4]="Text",i))(Yt||{});class Re{constructor(t){this.data=t}getCurrentPage(t){const e=t.page;for(let n=t.bufferedPageRange().start;n<t.bufferedPageRange().count;n++)if(t.switchToPage(n),t.page===e)return n;return t.bufferedPageRange().count}attachTo(t,e=(s=>(s=t.x)!=null?s:0)(),n=(h=>(h=t.y)!=null?h:0)()){var v,z,yt,ie,ne,se,re,oe,ae,he,le,fe,ce,ue,de,me;if(this.data.rows===void 0)throw new Error("No table rows provided.");t.page||t.addPage({size:"A4"}),t.options.bufferPages=!0;const l=e,u=n,S=this.getCurrentPage(t),r=this.data.width?this.data.width:t.page.width-l-t.page.margins.right,o=this.data.backgroundColor?this.data.backgroundColor:void 0,a=this.data.borderWidth?this.data.borderWidth:void 0,f=this.data.borderColor?this.data.borderColor:"#000000",c=this.data.padding?this.data.padding:0,p=this.data.fontSize?this.data.fontSize:11,d=this.data.textColor?this.data.textColor:"#000000",I=this.data.fontName?this.data.fontName:"Helvetica",_=this.data.align?this.data.align:void 0,M=this.data.verticalAlign?this.data.verticalAlign:"top",L=this.data.rows.findIndex(K=>!!K.header),N=[];for(let K=0;K<Object.values(Yt).length/2;K++){t.switchToPage(S);let E=u;t:for(let x=0;x<this.data.rows.length;x++){const R=this.data.rows[x],G=N[x],bt=R.minHeight,Ct=R.maxHeight,Fe=R.padding?R.padding:c,Ge=R.backgroundColor?R.backgroundColor:o,ke=R.borderWidth?R.borderWidth:a,Ye=R.borderColor?R.borderColor:f,He=R.fontSize?R.fontSize:p,Ue=R.fontName?R.fontName:I,We=R.textColor?R.textColor:d,Ve=R.align?R.align:_,Qe=R.verticalAlign?R.verticalAlign:M;t.moveTo(l,u);let O=l;e:for(let _t=0;_t<R.columns.length;_t++){const D=R.columns[_t],{remainingColumns:je,widthUsed:Ze}=R.columns.reduce((b,Z)=>(Z.width!==void 0&&(b.widthUsed+=Z.width,b.remainingColumns--),b),{remainingColumns:R.columns.length,widthUsed:0}),J=D.width?D.width:(r-Ze)/je,Xe=D.padding?D.padding:Fe,Tt=D.backgroundColor?D.backgroundColor:Ge,ge=D.borderWidth?D.borderWidth:ke,Rt=D.borderColor?D.borderColor:Ye,Ke=D.fontSize?D.fontSize:He,qe=D.fontName?D.fontName:Ue,Je=D.textColor?D.textColor:We,ti=D.align?D.align:Ve,Et=D.verticalAlign?D.verticalAlign:Qe,ei=Tt===void 0?0:1,ii=Rt===void 0?0:1,F=this._positionsToObject(Xe);t.moveTo(O+J,E);const Dt=ut(ct({},(v=D.textOptions)!=null?v:{}),{align:ti,baseline:"middle",height:G!==void 0?G-((z=F.top)!=null?z:0)-((yt=F.bottom)!=null?yt:0):void 0,lineBreak:!0,width:J-((ie=F.left)!=null?ie:0)-((ne=F.right)!=null?ne:0)});t.font(qe),t.fontSize(Ke);const Nt=t.heightOfString(`${D.text}`,Dt),ft=t.heightOfString("A",Dt);if(K===0){if((N[x]===void 0||N[x]<Nt+((se=F.top)!=null?se:0)+((re=F.bottom)!=null?re:0))&&(N[x]=Nt+((oe=F.top)!=null?oe:0)+((ae=F.bottom)!=null?ae:0),bt!==void 0&&N[x]<bt&&(N[x]=bt),Ct!==void 0&&N[x]>Ct&&(N[x]=Ct)),R.height!==void 0&&(N[x]=R.height),_t<R.columns.length-1)continue e;continue t}if(K===1&&E+G>=t.page.height-t.page.margins.bottom){t.addPage(),E=t.y;const b=this.data.rows[L];if(b!==void 0){this.data.rows.splice(x,0,b),N.splice(x,0,N[L]),x--;continue t}}if(K>1&&(R.header&&E!==((he=t.page.margins.top)!=null?he:0)&&x!==L||E+G>=t.page.height-t.page.margins.bottom)&&(t.switchToPage(this.getCurrentPage(t)+1),t.x=l,t.y=(le=t.page.margins.top)!=null?le:0,E=t.y),K===2&&Tt!==void 0&&t.rect(O,E,J,G).fillColor(Tt).fillOpacity(ei).fill(),K===4){let b=E;Et==="top"?b=E+((fe=F.top)!=null?fe:0)+ft/2:Et==="center"?b=E+G/2-Nt/2+ft/2:Et==="bottom"&&(b=E+G-((ce=F.bottom)!=null?ce:0)-Nt+ft/2),b<E+((ue=F.top)!=null?ue:0)+ft/2&&(b=E+((de=F.top)!=null?de:0)+ft/2),t.fillColor(Je).fillOpacity(1),t.text(`${D.text}`,O+((me=F.left)!=null?me:0),b,Dt)}if(K===3&&ge!==void 0&&Rt!==void 0){const b=this._positionsToObject(ge),Z=this._positionsToObject(Rt);if(t.undash().lineJoin("miter").lineCap("butt").strokeOpacity(ii),b.left&&Z.left){const et=b.bottom?b.bottom/2:0,it=b.top?b.top/2:0;t.moveTo(O,E+G+et),t.lineTo(O,E-it).strokeColor(Z.left).lineWidth(b.left).stroke()}if(b.right&&Z.right){const et=b.top?b.top/2:0,it=b.bottom?b.bottom/2:0;t.moveTo(O+J,E-et),t.lineTo(O+J,E+G+it).strokeColor(Z.right).lineWidth(b.right).stroke()}if(b.top&&Z.top){const et=b.left?b.left/2:0,it=b.right?b.right/2:0;t.moveTo(O-et,E),t.lineTo(O+J+it,E).strokeColor(Z.top).lineWidth(b.top).stroke()}if(b.bottom&&Z.bottom){const et=b.right?b.right/2:0,it=b.left?b.left/2:0;t.moveTo(O+J+et,E+G),t.lineTo(O-it,E+G).strokeColor(Z.bottom).lineWidth(b.bottom).stroke()}}O+=J}E+=G,t.x=O,t.y=E}}t.x=l}_positionsToObject(t){return typeof t=="number"||typeof t=="string"?{bottom:t,left:t,right:t,top:t}:{bottom:t[2]!==void 0?t[2]:t[0],left:t[3]!==void 0?t[3]:t[1],right:t[1]!==void 0?t[1]:void 0,top:t[0]}}}const Ee=Object.freeze(Object.defineProperty({__proto__:null,SwissQRBill:Ce,SwissQRCode:kt,Table:Re},Symbol.toStringTag,{value:"Module"}));function De(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Ae(i){const t={};for(const e of Object.keys(i))t[i[e].name]=i[e];return t}class T{constructor(t,e){this.childInstances=[],this.element=De(t),this._parent=e}get parent(){return this._parent}get root(){let t=this._parent;for(;(t==null?void 0:t.parent)!==void 0;)t=t.parent;return t}appendInstance(t){return this.childInstances.push(t),this.element.appendChild(t.element),this}id(t){return typeof t=="string"?(this.element.id=t,this):this.element.id}get innerHTML(){return this.element.innerHTML}get outerHTML(){return this.element.outerHTML}empty(){return this.childInstances=[],this.element.innerHTML="",this}addClass(t){return typeof t=="string"?this.element.classList.add(t):Array.isArray(t)&&this.element.classList.add(...t),this}removeClass(t){return typeof t=="string"?this.element.classList.remove(t):Array.isArray(t)&&this.element.classList.remove(...t),this}hasClass(t){return this.element.classList.contains(t)}attr(t,e){var n;const s=Object.entries(Ae(this.element.attributes)).reduce((h,[l,u])=>Object.assign(Object.assign({},h),{[l]:isNaN(+u.value)?u.value:+u.value}),{});return typeof t=="undefined"?s:typeof t=="object"?Array.isArray(t)?Object.fromEntries(Object.entries(s).filter(([h,l])=>t.includes(h))):(Object.keys(t).forEach(h=>{this.element.setAttribute(h,t[h]+"")}),this):typeof t=="string"?typeof e=="undefined"?(n=s[t])!==null&&n!==void 0?n:null:(this.element.setAttribute(t,e+""),this):null}removeAttr(t){return this.element.removeAttribute(t),this}}function k(i,t){t.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(n=>{Object.defineProperty(i.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n)||Object.create(null))})})}class Y extends T{color(t){if(typeof t=="undefined"){const e=this.attr("color");return typeof e=="string"?e:null}else if(typeof t=="string")return this.attr("color",t),this;return null}}class H extends T{display(t){if(typeof t=="undefined"){const e=this.attr("display");return typeof e=="string"?e:null}else if(typeof t=="string")return this.attr("display",t),this;return null}}class U extends T{fill(t){if(typeof t=="undefined"){const e=this.attr("fill");return typeof e=="string"?e:null}else if(typeof t=="string")return this.attr("fill",t),this;return null}fillOpacity(t){if(typeof t=="undefined"){const e=this.attr("fill-opacity");return typeof e=="number"?e:null}else if(typeof t=="number")return this.attr("fill-opacity",t),this;return null}fillRule(t){if(typeof t=="undefined"){const e=this.attr("fill-rule");return typeof e=="string"?e:null}else if(typeof t=="string")return this.attr("fill-rule",t),this;return null}fillLinearGradient(t,e){var n,s,h;const l=(s=(n=this.root)===null||n===void 0?void 0:n.childInstances.find(r=>r.element.tagName==="defs"))!==null&&s!==void 0?s:(h=this.root)===null||h===void 0?void 0:h.addDefs(),u=l==null?void 0:l.addLinearGradient(),S=l.element.childNodes.length;u.attr("id","gradient-"+S),typeof e=="number"&&u.attr("gradientTransform","rotate("+e+")");for(const r of t)u.addStop(r.position,r.color);return this.attr("fill","url(#gradient-"+S+")"),this}}class W extends T{opacity(t){if(typeof t=="undefined"){const e=this.attr("opacity");return typeof e=="number"?e:null}else if(typeof t=="number")return this.attr("opacity",t),this;return null}}class V extends T{stroke(t=1,e="solid",n="currentColor"){return this.strokeWidth(t),this.strokeColor(n),e==="dashed"&&this.strokeDasharray(3),this}strokeColor(t){if(typeof t=="undefined"){const e=this.attr("stroke");return typeof e=="string"?e:null}else if(typeof t=="string")return this.attr("stroke",t),this;return null}strokeLinearGradient(t,e){var n,s,h;const l=(s=(n=this.root)===null||n===void 0?void 0:n.childInstances.find(r=>r.element.tagName==="defs"))!==null&&s!==void 0?s:(h=this.root)===null||h===void 0?void 0:h.addDefs(),u=l==null?void 0:l.addLinearGradient(),S=l.element.childNodes.length;u.attr("id","gradient-"+S),typeof e=="number"&&u.attr("gradientTransform","rotate("+e+")");for(const r of t)u.addStop(r.position,r.color);return this.attr("stroke","url(#gradient-"+S+")"),this}dash(t=3,e="currentColor"){return this.strokeDasharray(t),this.strokeColor(e),this}strokeDasharray(t,e){if(typeof t=="undefined"){const n=this.attr("stroke-dasharray");if(typeof n=="number")return n;if(typeof n=="string"){const s=n.split(" ");return s.length===1?isNaN(+s[0])?s[0]:+s[0]:s.map(h=>isNaN(+h)?h:+h)}}else{if(typeof t=="string"||typeof t=="number")return this.attr("stroke-dasharray",t),this;if(Array.isArray(t))return this.attr("stroke-dasharray",t.join(" ")),this}return null}strokeDashoffset(t){return typeof t=="string"||typeof t=="number"?(this.attr("stroke-dashoffset",t),this):this.attr("stroke-dashoffset")}strokeLinecap(t){if(typeof t=="undefined"){const e=this.attr("stroke-linecap");return typeof e=="string"?e:null}else if(typeof t=="string")return this.attr("stroke-linecap",t),this;return null}strokeLinejoin(t){if(typeof t=="undefined"){const e=this.attr("stroke-linejoin");return typeof e=="string"?e:null}else if(typeof t=="string")return this.attr("stroke-linejoin",t),this;return null}strokeMiterlimit(t){if(typeof t=="undefined"){const e=this.attr("stroke-miterlimit");return typeof e=="number"?e:null}else if(typeof t=="number")return this.attr("stroke-miterlimit",t),this;return null}strokeOpacity(t){return typeof t=="string"||typeof t=="number"?(this.attr("stroke-opacity",t),this):this.attr("stroke-opacity")}strokeWidth(t){return typeof t=="string"||typeof t=="number"?(this.attr("stroke-width",t),this):this.attr("stroke-width")}}class Q extends T{vectorEffect(t){if(typeof t=="undefined"){const e=this.attr("vector-effect");return typeof e=="string"?e:null}else if(typeof t=="string")return this.attr("vector-effect",t),this;return null}}class j extends T{visibility(t){if(typeof t=="undefined"){const e=this.attr("visibility");return typeof e=="string"?e:null}else if(typeof t=="string")return this.attr("visibility",t),this;return null}}class gt extends T{moveTo(t,e){return this.attr("x",t),this.attr("y",e),this}moveBy(t,e){var n,s;const h=(n=this.attr("x"))!==null&&n!==void 0?n:0+t,l=(s=this.attr("y"))!==null&&s!==void 0?s:0+e;return this.moveTo(h,l)}x(t){return typeof t=="string"||typeof t=="number"?(this.attr("x",t),this):this.attr("x")}y(t){return typeof t=="string"||typeof t=="number"?(this.attr("y",t),this):this.attr("y")}}class pt extends T{width(t){return typeof t=="string"||typeof t=="number"?(this.attr("width",t+""),this):this.attr("width")}height(t){return typeof t=="string"||typeof t=="number"?(this.attr("height",t+""),this):this.attr("height")}}class Ht extends T{constructor(t){super("rect",t)}borderRadius(t){return typeof t=="string"||typeof t=="number"?(this.attr("rx",t),this.attr("ry",t),this):this.attr("rx")}}k(Ht,[Y,H,U,W,V,Q,j,gt,pt]);class we extends T{cx(t){return typeof t=="string"||typeof t=="number"?(this.attr("cx",t),this):this.attr("cx")}cy(t){return typeof t=="string"||typeof t=="number"?(this.attr("cy",t),this):this.attr("cy")}}class Ut extends T{constructor(t){super("circle",t)}radius(t){return typeof t=="string"||typeof t=="number"?(this.attr("r",t),this):this.attr("r")}}k(Ut,[Y,H,U,W,V,Q,j,we]);class Wt extends T{constructor(t){super("line",t)}x1(t){return typeof t=="string"||typeof t=="number"?(this.attr("x1",t),this):this.attr("x1")}y1(t){return typeof t=="string"||typeof t=="number"?(this.attr("y1",t),this):this.attr("y1")}x2(t){return typeof t=="string"||typeof t=="number"?(this.attr("x2",t),this):this.attr("x2")}y2(t){return typeof t=="string"||typeof t=="number"?(this.attr("y2",t),this):this.attr("y2")}}k(Wt,[Y,H,U,W,V,Q,j]);class Vt extends T{constructor(t){super("path",t)}lineTo(t,e,n=!1){var s;let h=(s=this.attr("d"))!==null&&s!==void 0?s:"";return h+=n===!1?" L ":" l ",h+=` ${t}, ${e} `,this.attr("d",h),this}moveTo(t,e,n=!1){var s;let h=(s=this.attr("d"))!==null&&s!==void 0?s:"";return h+=n===!1?" M ":" m ",h+=` ${t}, ${e} `,this.attr("d",h),this}cubicBezierCurveTo(t,e,n,s,h,l,u=!1){var S;let r=(S=this.attr("d"))!==null&&S!==void 0?S:"";return r+=u===!1?" C ":" c ",r+=` ${t} ${e}, ${n} ${s}, ${h} ${l} `,this.attr("d",r),this}smoothBezierCurveTo(t,e,n,s,h=!1){var l;let u=(l=this.attr("d"))!==null&&l!==void 0?l:"";return u+=h===!1?" S ":" s ",u+=` ${t}, ${e} ${n}, ${s} `,this.attr("d",u),this}quadraticBezierCurveTo(t,e,n,s,h=!1){var l;let u=(l=this.attr("d"))!==null&&l!==void 0?l:"";return u+=h===!1?" Q ":" q ",u+=` ${t} ${e}, ${n} ${s} `,this.attr("d",u),this}smoothQuadraticBezierCurveTo(t,e,n=!1){var s;let h=(s=this.attr("d"))!==null&&s!==void 0?s:"";return h+=n===!1?" T ":" t ",h+=` ${t}, ${e} `,this.attr("d",h),this}ellipticalArcCurveTo(t,e,n,s,h,l,u,S=!1){var r;let o=(r=this.attr("d"))!==null&&r!==void 0?r:"";return o+=S===!1?" A ":" a ",o+=` ${t}, ${e} ${n} ${s?1:0} ${h?1:0} ${l} ${u} `,this.attr("d",o),this}curveTo(t,e,n,s,h=!1){var l;let u=(l=this.attr("d"))!==null&&l!==void 0?l:"";return u+=h===!1?" S ":" s ",u+=` ${t}, ${e} ${n}, ${s} `,this.attr("d",u),this}close(){var t;let e=(t=this.attr("d"))!==null&&t!==void 0?t:"";return e+=" Z",this.attr("d",e),this}}k(Vt,[Y,H,U,W,V,Q,j]);class Qt extends T{text(t){return typeof t=="string"?(this.element.innerHTML=t,this):this.element.innerHTML}textAlign(t){var e;return t==="left"?this.textAnchor("start"):t==="center"?this.textAnchor("middle"):t==="right"?this.textAnchor("end"):(e=this.textAnchor())!==null&&e!==void 0?e:"left"}textAnchor(t){if(typeof t=="undefined"){const e=this.attr("text-anchor");return typeof e=="string"?e:null}else if(typeof t=="string")return this.attr("text-anchor",t),this;return null}dx(t){return typeof t=="string"||typeof t=="number"?(this.attr("dx",t),this):this.attr("dx")}dy(t){return typeof t=="string"||typeof t=="number"?(this.attr("dy",t),this):this.attr("dy")}}class jt extends T{fontFamily(t){if(typeof t=="undefined"){const e=this.attr("font-family");return typeof e=="string"?e:null}else if(typeof t=="string")return this.attr("font-family",t),this;return null}fontSize(t){return typeof t=="string"||typeof t=="number"?(this.attr("font-size",t),this):this.attr("font-size")}fontStyle(t){if(typeof t=="undefined"){const e=this.attr("font-style");return typeof e=="string"?e:null}else if(typeof t=="string")return this.attr("font-style",t),this;return null}fontWeight(t){return typeof t=="string"||typeof t=="number"?(this.attr("font-weight",t),this):this.attr("font-weight")}}class It extends T{constructor(t){super("tspan",t)}addTSpan(t,e,n){const s=new It(this);return typeof t=="string"&&typeof e=="undefined"?s.text(t):(typeof t=="string"||typeof t=="number")&&(typeof e=="string"||typeof e=="number")&&(s.attr("x",t),s.attr("y",e),typeof n=="string"&&s.text(n)),this.appendInstance(s),s}}k(It,[Y,H,U,W,V,Q,j,gt,pt,Qt,jt]);class Zt extends T{constructor(t){super("text",t)}addTSpan(t,e,n){const s=new It(this);return typeof t=="string"&&typeof e=="undefined"?s.text(t):(typeof t=="string"||typeof t=="number")&&(typeof e=="string"||typeof e=="number")&&(s.attr("x",t),s.attr("y",e),typeof n=="string"&&s.text(n)),this.appendInstance(s),s}}k(Zt,[Y,H,U,W,V,Q,j,gt,pt,Qt,jt]);class St extends T{addRect(t,e,n,s){const h=new Ht(this);return t!==void 0&&h.attr("x",t+""),e!==void 0&&h.attr("y",e+""),n!==void 0&&h.attr("width",n+""),s!==void 0&&h.attr("height",s+""),this.appendInstance(h),h}addCircle(t,e,n){const s=new Ut(this);return t!==void 0&&s.attr("cx",t+""),e!==void 0&&s.attr("cy",e+""),n!==void 0&&s.attr("r",n+""),this.appendInstance(s),s}addLine(t,e,n,s){const h=new Wt(this);return t!==void 0&&h.attr("x1",t+""),e!==void 0&&h.attr("y1",e+""),n!==void 0&&h.attr("x2",n+""),s!==void 0&&h.attr("y2",s+""),this.appendInstance(h),h}addPath(t){const e=new Vt(this);return t!==void 0&&e.attr("d",t+""),this.appendInstance(e),e}addText(t,e,n){const s=new Zt(this);return typeof t=="string"&&typeof e=="undefined"?s.text(t):(typeof t=="string"||typeof t=="number")&&(typeof e=="string"||typeof e=="number")&&(s.attr("x",t),s.attr("y",e),typeof n=="string"&&s.text(n)),this.appendInstance(s),s}}class lt extends T{constructor(t){super("g",t)}addGroup(){const t=new lt(this);return this.appendInstance(t),t}addSVG(t,e){if(typeof t!="undefined"&&typeof e!="undefined"){const n=new q(t,e);return this.appendInstance(n),n}else{const n=new q;return this.appendInstance(n),n}}}k(lt,[St,Y,H,U,W,V,Q,j]);class Xt extends T{addGroup(){const t=new lt(this);return this.appendInstance(t),t}addSVG(t,e){if(typeof t!="undefined"&&typeof e!="undefined"){const n=new q(t,e);return this.appendInstance(n),n}else{const n=new q;return this.appendInstance(n),n}}}class Kt extends T{constructor(t){super("stop",t)}}k(Kt,[Y,H,U,W,V,Q,j]);class ve extends T{addStop(t,e){const n=new Kt(this);return n.attr("offset",t),n.attr("stop-color",e),this.appendInstance(n),n}}class qt extends T{constructor(t){super("linearGradient",t)}}k(qt,[ve,Y,H,U,W,V,Q,j]);class Le extends T{addLinearGradient(){const t=new qt(this);return this.appendInstance(t),t}}class Jt extends T{constructor(t){super("defs",t)}}k(Jt,[St,Xt,Le,Y,H,U,W,V,Q,j]);class xe extends T{addDefs(){const t=new Jt(this);return this.appendInstance(t),t}}class Be extends T{preserveAspectRatio(t,e){if(typeof t=="undefined"&&typeof e=="undefined"){const n=this.attr("preserveAspectRatio");if(typeof n=="string"){const[s,h]=n.split(" ");return{align:s,meetOrSlice:h}}}else{if(typeof t=="string"&&typeof e=="string")return this.attr("preserveAspectRatio",`${t} ${e}`),this;if(typeof t=="string"&&typeof e=="undefined")return this.attr("preserveAspectRatio",t),this}return null}}class q extends T{constructor(t,e,n){super("svg"),(typeof t=="string"||typeof t=="number")&&this.width(t),(typeof e=="string"||typeof e=="number")&&this.height(e)}addGroup(){const t=new lt(this);return this.appendInstance(t),t}addSVG(t,e){if(typeof t!="undefined"&&typeof e!="undefined"){const n=new q(t,e);return this.appendInstance(n),n}else{const n=new q;return this.appendInstance(n),n}}viewBox(t,e,n,s){if(typeof t=="undefined"){const h=this.attr("viewBox");if(typeof h=="string"){const[l,u,S,r]=h.split(" ");return{x:isNaN(+l)?l:+l,y:isNaN(+u)?u:+u,width:isNaN(+S)?S:+S,height:isNaN(+r)?r:+r}}return null}else if((typeof t=="string"||typeof t=="number")&&(typeof e=="string"||typeof e=="number")&&(typeof n=="string"||typeof n=="number")&&(typeof s=="string"||typeof s=="number"))return this.attr("viewBox",`${t} ${e} ${n} ${s}`),this;return null}}k(q,[St,Xt,xe,Y,H,U,W,V,Q,j,Be,gt,pt]);class te extends q{constructor(){super(),this.attr("xmlns","http://www.w3.org/2000/svg")}}const Me={100:6.11767578125,101:6.11767578125,102:3.05615234375,103:6.11767578125,104:6.11767578125,105:2.44384765625,106:2.44384765625,107:5.5,108:2.44384765625,109:9.1630859375,110:6.11767578125,111:6.11767578125,112:6.11767578125,113:6.11767578125,114:3.6630859375,115:5.5,116:3.05615234375,117:6.11767578125,118:5.5,119:7.94384765625,120:5.5,121:5.5,122:5.5,123:3.673828125,124:2.857421875,125:3.673828125,126:6.423828125,160:3.05615234375,161:3.6630859375,162:6.11767578125,163:6.11767578125,164:6.11767578125,165:6.11767578125,166:2.857421875,167:6.11767578125,168:3.6630859375,169:8.10498046875,170:4.0712890625,171:6.11767578125,172:6.423828125,173:0,174:8.10498046875,175:6.07470703125,176:4.39892578125,177:6.037109375,178:3.6630859375,179:3.6630859375,180:3.6630859375,181:6.337890625,182:5.908203125,183:3.6630859375,184:3.6630859375,185:3.6630859375,186:4.017578125,187:6.11767578125,188:9.173828125,189:9.173828125,190:9.173828125,191:6.71923828125,192:7.3369140625,193:7.3369140625,194:7.3369140625,195:7.3369140625,196:7.3369140625,197:7.3369140625,198:11,199:7.94384765625,200:7.3369140625,201:7.3369140625,202:7.3369140625,203:7.3369140625,204:3.05615234375,205:3.05615234375,206:3.05615234375,207:3.05615234375,208:7.94384765625,209:7.94384765625,210:8.55615234375,211:8.55615234375,212:8.55615234375,213:8.55615234375,214:8.55615234375,215:6.423828125,216:8.55615234375,217:7.94384765625,218:7.94384765625,219:7.94384765625,220:7.94384765625,221:7.3369140625,222:7.3369140625,223:6.71923828125,224:6.11767578125,225:6.11767578125,226:6.11767578125,227:6.11767578125,228:6.11767578125,229:6.11767578125,230:9.78076171875,231:5.5,232:6.11767578125,233:6.11767578125,234:6.11767578125,235:6.11767578125,236:3.05615234375,237:3.05615234375,238:3.05615234375,239:3.05615234375,240:6.11767578125,241:6.11767578125,242:6.11767578125,243:6.11767578125,244:6.11767578125,245:6.11767578125,246:6.11767578125,247:6.037109375,248:6.71923828125,249:6.11767578125,250:6.11767578125,251:6.11767578125,252:6.11767578125,253:5.5,254:6.11767578125,32:3.05615234375,33:3.05615234375,34:3.90478515625,35:6.11767578125,36:6.11767578125,37:9.78076171875,38:7.3369140625,39:2.10009765625,40:3.6630859375,41:3.6630859375,42:4.28076171875,43:6.423828125,44:3.05615234375,45:3.6630859375,46:3.05615234375,47:3.05615234375,48:6.11767578125,49:6.11767578125,50:6.11767578125,51:6.11767578125,52:6.11767578125,53:6.11767578125,54:6.11767578125,55:6.11767578125,56:6.11767578125,57:6.11767578125,58:3.05615234375,59:3.05615234375,60:6.423828125,61:6.423828125,62:6.423828125,63:6.11767578125,64:11.16650390625,65:7.3369140625,66:7.3369140625,67:7.94384765625,68:7.94384765625,69:7.3369140625,70:6.71923828125,71:8.55615234375,72:7.94384765625,73:3.05615234375,74:5.5,75:7.3369140625,76:6.11767578125,77:9.1630859375,78:7.94384765625,79:8.55615234375,80:7.3369140625,81:8.55615234375,82:7.94384765625,83:7.3369140625,84:6.71923828125,85:7.94384765625,86:7.3369140625,87:10.38232421875,88:7.3369140625,89:7.3369140625,90:6.71923828125,91:3.05615234375,92:3.05615234375,93:3.05615234375,94:5.16162109375,95:6.11767578125,96:3.6630859375,97:6.11767578125,98:6.11767578125,99:5.5},Pe={100:7.22998046875,101:7.22998046875,102:3.61181640625,103:7.22998046875,104:7.22998046875,105:2.88818359375,106:2.88818359375,107:6.5,108:2.88818359375,109:10.8291015625,110:7.22998046875,111:7.22998046875,112:7.22998046875,113:7.22998046875,114:4.3291015625,115:6.5,116:3.61181640625,117:7.22998046875,118:6.5,119:9.38818359375,120:6.5,121:6.5,122:6.5,123:4.341796875,124:3.376953125,125:4.341796875,126:7.591796875,160:3.61181640625,161:4.3291015625,162:7.22998046875,163:7.22998046875,164:7.22998046875,165:7.22998046875,166:3.376953125,167:7.22998046875,168:4.3291015625,169:9.57861328125,170:4.8115234375,171:7.22998046875,172:7.591796875,173:0,174:9.57861328125,175:7.17919921875,176:5.19873046875,177:7.134765625,178:4.3291015625,179:4.3291015625,180:4.3291015625,181:7.490234375,182:6.982421875,183:4.3291015625,184:4.3291015625,185:4.3291015625,186:4.748046875,187:7.22998046875,188:10.841796875,189:10.841796875,190:10.841796875,191:7.94091796875,192:8.6708984375,193:8.6708984375,194:8.6708984375,195:8.6708984375,196:8.6708984375,197:8.6708984375,198:13,199:9.38818359375,200:8.6708984375,201:8.6708984375,202:8.6708984375,203:8.6708984375,204:3.61181640625,205:3.61181640625,206:3.61181640625,207:3.61181640625,208:9.38818359375,209:9.38818359375,210:10.11181640625,211:10.11181640625,212:10.11181640625,213:10.11181640625,214:10.11181640625,215:7.591796875,216:10.11181640625,217:9.38818359375,218:9.38818359375,219:9.38818359375,220:9.38818359375,221:8.6708984375,222:8.6708984375,223:7.94091796875,224:7.22998046875,225:7.22998046875,226:7.22998046875,227:7.22998046875,228:7.22998046875,229:7.22998046875,230:11.55908203125,231:6.5,232:7.22998046875,233:7.22998046875,234:7.22998046875,235:7.22998046875,236:3.61181640625,237:3.61181640625,238:3.61181640625,239:3.61181640625,240:7.22998046875,241:7.22998046875,242:7.22998046875,243:7.22998046875,244:7.22998046875,245:7.22998046875,246:7.22998046875,247:7.134765625,248:7.94091796875,249:7.22998046875,250:7.22998046875,251:7.22998046875,252:7.22998046875,253:6.5,254:7.22998046875,32:3.61181640625,33:3.61181640625,34:4.61474609375,35:7.22998046875,36:7.22998046875,37:11.55908203125,38:8.6708984375,39:2.48193359375,40:4.3291015625,41:4.3291015625,42:5.05908203125,43:7.591796875,44:3.61181640625,45:4.3291015625,46:3.61181640625,47:3.61181640625,48:7.22998046875,49:7.22998046875,50:7.22998046875,51:7.22998046875,52:7.22998046875,53:7.22998046875,54:7.22998046875,55:7.22998046875,56:7.22998046875,57:7.22998046875,58:3.61181640625,59:3.61181640625,60:7.591796875,61:7.591796875,62:7.591796875,63:7.22998046875,64:13.19677734375,65:8.6708984375,66:8.6708984375,67:9.38818359375,68:9.38818359375,69:8.6708984375,70:7.94091796875,71:10.11181640625,72:9.38818359375,73:3.61181640625,74:6.5,75:8.6708984375,76:7.22998046875,77:10.8291015625,78:9.38818359375,79:10.11181640625,80:8.6708984375,81:10.11181640625,82:9.38818359375,83:8.6708984375,84:7.94091796875,85:9.38818359375,86:8.6708984375,87:12.27001953125,88:8.6708984375,89:8.6708984375,90:7.94091796875,91:3.61181640625,92:3.61181640625,93:3.61181640625,94:6.10009765625,95:7.22998046875,96:4.3291015625,97:7.22998046875,98:7.22998046875,99:6.5};function nt(i,t){let e=0;if(t==="8pt")for(let n=0;n<i.length;n++)e+=Me[i.charCodeAt(n)];else if(t==="10pt")for(let n=0;n<i.length;n++)e+=Pe[i.charCodeAt(n)];return e}class $e{constructor(t,e){this.scissors=!0,this.outlines=!0,this.language="DE",this.font="Arial",this.data=t,this.data=A(this.data),mt(this.data),this.language=(e==null?void 0:e.language)!==void 0?e.language:this.language,this.outlines=(e==null?void 0:e.outlines)!==void 0?e.outlines:this.outlines,this.font=(e==null?void 0:e.fontName)!==void 0?e.fontName:this.font,this.scissors=(e==null?void 0:e.scissors)!==void 0?e.scissors:this.scissors,this.instance=new te,this.instance.width("210mm"),this.instance.height("105mm"),this._render()}toString(){return this.instance.outerHTML}get element(){return this.instance.element}_render(){const t=this._formatAddress(this.data.creditor);let e=0,n=0;this.instance.addRect(0,0,"100%","100%").fill("#fff"),this.outlines&&this.instance.addLine("62mm","0mm","62mm","105mm").stroke(1,"dashed","black"),this.scissors&&this.instance.addSVG("11px","19px").x(tt(62)-5.25).y("30pt").addPath("M8.55299 18.3969C9.54465 17.5748 9.51074 16.0915 9.08357 14.9829L6.47473 8.02261C7.58167 5.9986 7.26467 3.99833 7.80373 3.99833C8.22582 3.99833 8.13259 4.38482 9.23105 4.32719C10.2854 4.27125 11.0652 3.1711 10.9957 2.13197C11.0025 1.09115 10.2041 0.0130391 9.1056 0.00456339C7.99867 -0.0734135 6.96972 0.858918 6.89683 1.95907C6.70527 3.24907 7.48674 5.53413 5.56613 6.60547C4.09305 5.80705 4.08797 4.38991 4.16255 3.10838C4.22358 2.04552 3.91845 0.76738 2.87424 0.260531C1.87241 -0.229367 0.446794 0.25036 0.139972 1.37594C-0.277034 2.51168 0.250156 4.07122 1.55541 4.34244C2.56233 4.55095 3.03528 3.83729 3.40143 4.1119C3.67774 4.31871 3.5167 5.62906 4.566 7.96667L1.908 15.5033C1.64356 16.456 1.65204 17.6206 2.58776 18.463L5.5424 10.6484L8.55299 18.3969ZM10.1634 2.87953C9.55143 3.97629 7.88849 3.88645 7.56641 2.74731C7.20704 1.71666 8.20887 0.397838 9.32767 0.726697C10.2447 0.919943 10.5821 2.12858 10.1634 2.87953ZM3.36753 2.927C2.94544 4.07122 1.00789 3.87797 0.746835 2.71341C0.479001 1.94042 0.8638 0.836881 1.77409 0.758904C2.88102 0.608036 3.87946 1.90821 3.36753 2.927Z").fill("black");const s=this.instance.addSVG().x("5mm").y("5mm"),h=s.addText();h.addTSpan(C[this.language].receipt).x(0).y(0).dy("11pt").fontFamily(this.font).fontWeight("bold").fontSize("11pt"),h.addTSpan(C[this.language].account).x(0).y("7mm").dy("9pt").fontFamily(this.font).fontWeight("bold").fontSize("6pt"),h.addTSpan(st(this.data.creditor.account)).x(0).dy("9pt").fontFamily(this.font).fontWeight("normal").fontSize("8pt"),e++;let l=[];for(const d of t){const I=this._fitTextToWidth(d,tt(52),2,"8pt");l=[...l,...I]}for(const d of l)e++,h.addTSpan(d).x(0).dy("9pt").fontFamily(this.font).fontWeight("normal").fontSize("8pt");if(this.data.reference!==void 0&&(h.addTSpan(C[this.language].reference).x(0).dy("18pt").fontFamily(this.font).fontWeight("bold").fontSize("6pt"),h.addTSpan(ot(this.data.reference)).x(0).dy("9pt").fontFamily(this.font).fontWeight("normal").fontSize("8pt"),e++),this.data.debtor!==void 0){const d=this._formatAddress(this.data.debtor);h.addTSpan(C[this.language].payableBy).x(0).dy("18pt").fontFamily(this.font).fontWeight("bold").fontSize("6pt");let I=[];for(const _ of d){const M=this._fitTextToWidth(_,tt(52),2,"8pt");I=[...I,...M]}for(const _ of I)h.addTSpan(_).x(0).dy("9pt").fontFamily(this.font).fontWeight("normal").fontSize("8pt")}else{h.addTSpan(C[this.language].payableByName).x(0).dy("18pt").fontFamily(this.font).fontWeight("bold").fontSize("6pt");const d=this.data.reference!==void 0?B(18):0;this._addRectangle(5,12+B(9)+e*B(9)+B(d)+B(18)+1,52,20)}const u=s.addText().y("63mm");u.addTSpan(C[this.language].currency).x(0).dy("6pt").fontFamily(this.font).fontWeight("bold").fontSize("6pt");const S=this.data.amount===void 0?13:22;u.addTSpan(C[this.language].amount).x(`${S}mm`).fontFamily(this.font).fontWeight("bold").fontSize("6pt"),u.addTSpan(this.data.currency).x(0).dy("11pt").fontFamily(this.font).fontWeight("normal").fontSize("8pt"),this.data.amount!==void 0?u.addTSpan(at(this.data.amount)).x(`${S}mm`).fontFamily(this.font).fontWeight("normal").fontSize("8pt"):this._addRectangle(27,68,30,10),u.addTSpan(C[this.language].acceptancePoint).x("52mm").y("82mm").textAlign("right").fontFamily(this.font).fontWeight("bold").fontSize("6pt");const r=this.instance.addSVG().x("67mm").y("5mm");r.addText(C[this.language].paymentPart).x(0).y(0).dy("11pt").fontFamily(this.font).fontWeight("bold").fontSize("11pt"),this._renderQRCode();const o=r.addText().y("63mm");o.addTSpan(C[this.language].currency).x(0).dy("8pt").fontFamily(this.font).fontWeight("bold").fontSize("8pt"),o.addTSpan(C[this.language].amount).x("22mm").fontFamily(this.font).fontWeight("bold").fontSize("8pt"),o.addTSpan(this.data.currency).x(0).dy("13pt").fontFamily(this.font).fontWeight("normal").fontSize("10pt"),this.data.amount!==void 0?o.addTSpan(at(this.data.amount)).x("22mm").fontFamily(this.font).fontWeight("normal").fontSize("10pt"):this._addRectangle(78,68+B(8)+B(5),40,15);const a=r.addText().x(0).y("90mm");if(this.data.av1!==void 0){const[d,I]=this.data.av1.split(/(\/.+)/);a.addTSpan(d).x(0).fontFamily(this.font).fontWeight("bold").fontSize("7pt"),a.addTSpan(this.data.av1.length>90?`${I.substr(0,87)}...`:I).fontFamily(this.font).fontWeight("normal").fontSize("7pt")}if(this.data.av2!==void 0){const[d,I]=this.data.av2.split(/(\/.+)/);a.addTSpan(d).x(0).dy("8pt").fontFamily(this.font).fontWeight("bold").fontSize("7pt"),a.addTSpan(this.data.av2.length>90?`${I.substr(0,87)}...`:I).fontFamily(this.font).fontWeight("normal").fontSize("7pt")}const c=this.instance.addSVG().x("118mm").y("5mm").addText();c.addTSpan(C[this.language].account).x(0).y(0).dy("11pt").fontFamily(this.font).fontWeight("bold").fontSize("8pt"),c.addTSpan(st(this.data.creditor.account)).x(0).dy("11pt").fontFamily(this.font).fontWeight("normal").fontSize("10pt"),n++;let p=[];for(const d of t){const I=this._fitTextToWidth(d,tt(52),2,"8pt");p=[...p,...I]}for(const d of p)c.addTSpan(d).x(0).dy("11pt").fontFamily(this.font).fontWeight("normal").fontSize("10pt"),n++;if(this.data.reference!==void 0&&(c.addTSpan(C[this.language].reference).x(0).dy("22pt").fontFamily(this.font).fontWeight("bold").fontSize("8pt"),c.addTSpan(ot(this.data.reference)).x(0).dy("11pt").fontFamily(this.font).fontWeight("normal").fontSize("10pt"),n++),this.data.message!==void 0||this.data.additionalInformation!==void 0){c.addTSpan(C[this.language].additionalInformation).x(0).dy("22pt").fontFamily(this.font).fontWeight("bold").fontSize("8pt");const d=ht(this.data.reference),I=d==="QRR"||d==="SCOR"?3:4,_=tt(87);this._getLineCountOfText(this.data.message,_,"10pt");const M=this._getLineCountOfText(this.data.additionalInformation,_,"10pt");if(this.data.additionalInformation!==void 0){if(d==="QRR"||d==="SCOR")this.data.message!==void 0&&(c.addTSpan(this._ellipsis(this.data.message,_,"10pt")).x(0).dy("11pt").fontFamily(this.font).fontWeight("normal").fontSize("10pt"),n++);else if(this.data.message!==void 0){const N=I-M,v=this._fitTextToWidth(this.data.message,_,N,"10pt");for(let z=0;z<N;z++)c.addTSpan(v[z]).x(0).dy("11pt").fontFamily(this.font).fontWeight("normal").fontSize("10pt"),n++}const L=this._fitTextToWidth(this.data.additionalInformation,_,M,"10pt");for(let N=0;N<M;N++)c.addTSpan(L[N]).x(0).dy("11pt").fontFamily(this.font).fontWeight("normal").fontSize("10pt"),n++}else if(this.data.message!==void 0){const L=this._fitTextToWidth(this.data.message,_,I,"10pt");for(let N=0;N<I;N++)c.addTSpan(L[N]).x(0).dy("11pt").fontFamily(this.font).fontWeight("normal").fontSize("10pt"),n++}}if(this.data.debtor!==void 0){const d=this._formatAddress(this.data.debtor);c.addTSpan(C[this.language].payableBy).x(0).dy("22pt").fontFamily(this.font).fontWeight("bold").fontSize("8pt");let I=[];for(const _ of d){const M=this._fitTextToWidth(_,tt(52),2,"8pt");I=[...I,...M]}for(const _ of I)c.addTSpan(_).x(0).dy("11pt").fontFamily(this.font).fontWeight("normal").fontSize("10pt")}else{c.addTSpan(C[this.language].payableByName).x(0).dy("22pt").fontFamily(this.font).fontWeight("bold").fontSize("8pt");const d=this.data.reference!==void 0?B(22):0,I=this.data.additionalInformation!==void 0||this.data.message!==void 0?B(22):0;this._addRectangle(118,5+B(11)+n*B(11)+d+I+B(22)+1,65,25)}}_renderQRCode(){const t=new ee(this.data);t.instance.x("67mm").y("17mm"),this.instance.appendInstance(t.instance)}_formatAddress(t){const e=t.country!=="CH"?`${t.country} - `:"";return t.buildingNumber!==void 0?[t.name,`${t.address} ${t.buildingNumber}`,`${e}${t.zip} ${t.city}`]:[t.name,t.address,`${e}${t.zip} ${t.city}`]}_getLineCountOfText(t,e,n){if(t===void 0)return 0;{let s=0,h=nt(t,n);for(;h>1;)s++,h-=e;return s}}_fitTextToWidth(t,e,n,s){var r;const h=t.split(/([ |-])/g);let l=[],u="";const S=o=>{const a=[];let f="";if(nt(o,s)>e){const c=o.split("");let p="";for(;c.length>0;)nt(p,s)<=e?p+=c.shift():(a.push(p),p="");p!==""&&(f=p)}else a.push(o);return{leftover:f,lines:a}};for(;h.length>0;){const o=h.shift(),a=(r=h.shift())!=null?r:"";if(nt(u+o+a,s)<=e)u+=o+a;else if(u!==""){const{leftover:f,lines:c}=S(u);l.push(...c),u=f+o+a}else u=o+a}if(u!==""&&u!==" "){const{leftover:o,lines:a}=S(u);l.push(...a),o!==""&&l.push(o)}return l.length>n&&(l=l.slice(0,n),l[l.length-1]=this._ellipsis(l[l.length-1],e,s)),l}_ellipsis(t,e,n){let s="";if(nt(t,n)>e)for(let h=0;h<t.length&&nt(`${s}${t[h]}...`,n)<=e;h++)s+=t[h];else return t;return s.substr(-1)===" "&&(s=s.slice(0,-1)),`${s}...`}_addRectangle(t,e,n,s){const h=this.instance.addSVG(`${n}mm`,`${s}mm`);h.x(`${t}mm`).y(`${e}mm`);const l=3;return h.addLine("0mm","0mm",`${l}mm`,"0mm").stroke(".75pt","solid","black"),h.addLine(`${n-l}mm`,"0mm",`${n}mm`,"0mm").stroke(".75pt","solid","black"),h.addLine(`${n}mm`,"0mm",`${n}mm`,`${l}mm`).stroke(".75pt","solid","black"),h.addLine(`${n}mm`,`${s-l}mm`,`${n}mm`,`${s}mm`).stroke(".75pt","solid","black"),h.addLine(`${n-l}mm`,`${s}mm`,`${n}mm`,`${s}mm`).stroke(".75pt","solid","black"),h.addLine("0mm",`${s}mm`,`${l}mm`,`${s}mm`).stroke(".75pt","solid","black"),h.addLine("0mm",`${s-l}mm`,"0mm",`${s}mm`).stroke(".75pt","solid","black"),h.addLine("0mm","0mm","0mm",`${l}mm`).stroke(".75pt","solid","black"),h}}class ee{constructor(t,e=46){this.instance=new te,this.instance.width(`${e}mm`),this.instance.height(`${e}mm`),Ft(t,e,(n,s,h)=>{this.instance.addRect(`${n}mm`,`${s}mm`,`${h}mm`,`${h}mm`).fill("black")}),Gt(e,(n,s,h,l,u)=>{this.instance.addRect(`${n}mm`,`${s}mm`,`${h}mm`,`${l}mm`).fill(u)})}toString(){return this.instance.outerHTML}get element(){return this.instance.element}}const ze=Object.freeze(Object.defineProperty({__proto__:null,SwissQRBill:$e,SwissQRCode:ee},Symbol.toStringTag,{value:"Module"})),Oe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));w.errors=ye,w.pdf=Ee,w.svg=ze,w.types=Oe,w.utils=be,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})}));