@epigraph/epigraph-std-lib 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Epigraph/epigraph.cjs +1 -1
- package/dist/Epigraph/epigraph.d.ts +8 -0
- package/dist/Epigraph/epigraph.js +32 -16
- package/dist/Epigraph/epigraphBaseSolutions.cjs +1 -1
- package/dist/Epigraph/epigraphBaseSolutions.js +1 -1
- package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.d.ts +34 -5
- package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.js +229 -64
- package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.cjs +4 -26
- package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.d.ts +2 -2
- package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.js +25 -356
- package/dist/lit-element-C3moVMGu.js +524 -0
- package/dist/lit-element-CYaaFRfk.cjs +19 -0
- package/package.json +1 -1
|
@@ -1,29 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const R=globalThis,w=R.trustedTypes,k=w?w.createPolicy("lit-html",{createHTML:i=>i}):void 0,P="$lit$",u=`lit$${Math.random().toFixed(9).slice(2)}$`,W="?"+u,F=`<${W}>`,g=document,M=()=>g.createComment(""),C=i=>i===null||typeof i!="object"&&typeof i!="function",L=Array.isArray,J=i=>L(i)||typeof i?.[Symbol.iterator]=="function",E=`[
|
|
6
|
-
\f\r]`,m=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,O=/-->/g,B=/>/g,p=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^
|
|
7
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),q=/'/g,D=/"/g,z=/^(?:script|style|textarea|title)$/i,H=Symbol.for("lit-noChange"),a=Symbol.for("lit-nothing"),j=new WeakMap,f=g.createTreeWalker(g,129);function V(i,t){if(!L(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return k!==void 0?k.createHTML(t):t}const K=(i,t)=>{const e=i.length-1,s=[];let n,o=t===2?"<svg>":t===3?"<math>":"",r=m;for(let d=0;d<e;d++){const h=i[d];let c,$,l=-1,A=0;for(;A<h.length&&(r.lastIndex=A,$=r.exec(h),$!==null);)A=r.lastIndex,r===m?$[1]==="!--"?r=O:$[1]!==void 0?r=B:$[2]!==void 0?(z.test($[2])&&(n=RegExp("</"+$[2],"g")),r=p):$[3]!==void 0&&(r=p):r===p?$[0]===">"?(r=n??m,l=-1):$[1]===void 0?l=-2:(l=r.lastIndex-$[2].length,c=$[1],r=$[3]===void 0?p:$[3]==='"'?D:q):r===D||r===q?r=p:r===O||r===B?r=m:(r=p,n=void 0);const _=r===p&&i[d+1].startsWith("/>")?" ":"";o+=r===m?h+F:l>=0?(s.push(c),h.slice(0,l)+P+h.slice(l)+u+_):h+u+(l===-2?d:_)}return[V(i,o+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class b{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let o=0,r=0;const d=t.length-1,h=this.parts,[c,$]=K(t,e);if(this.el=b.createElement(c,s),f.currentNode=this.el.content,e===2||e===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(n=f.nextNode())!==null&&h.length<d;){if(n.nodeType===1){if(n.hasAttributes())for(const l of n.getAttributeNames())if(l.endsWith(P)){const A=$[r++],_=n.getAttribute(l).split(u),x=/([.?@])?(.*)/.exec(A);h.push({type:1,index:o,name:x[2],strings:_,ctor:x[1]==="."?Y:x[1]==="?"?tt:x[1]==="@"?et:S}),n.removeAttribute(l)}else l.startsWith(u)&&(h.push({type:6,index:o}),n.removeAttribute(l));if(z.test(n.tagName)){const l=n.textContent.split(u),A=l.length-1;if(A>0){n.textContent=w?w.emptyScript:"";for(let _=0;_<A;_++)n.append(l[_],M()),f.nextNode(),h.push({type:2,index:++o});n.append(l[A],M())}}}else if(n.nodeType===8)if(n.data===W)h.push({type:2,index:o});else{let l=-1;for(;(l=n.data.indexOf(u,l+1))!==-1;)h.push({type:7,index:o}),l+=u.length-1}o++}}static createElement(t,e){const s=g.createElement("template");return s.innerHTML=t,s}}function v(i,t,e=i,s){if(t===H)return t;let n=s!==void 0?e._$Co?.[s]:e._$Cl;const o=C(t)?void 0:t._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),o===void 0?n=void 0:(n=new o(i),n._$AT(i,e,s)),s!==void 0?(e._$Co??=[])[s]=n:e._$Cl=n),n!==void 0&&(t=v(i,n._$AS(i,t.values),n,s)),t}class X{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,n=(t?.creationScope??g).importNode(e,!0);f.currentNode=n;let o=f.nextNode(),r=0,d=0,h=s[0];for(;h!==void 0;){if(r===h.index){let c;h.type===2?c=new G(o,o.nextSibling,this,t):h.type===1?c=new h.ctor(o,h.name,h.strings,this,t):h.type===6&&(c=new st(o,this,t)),this._$AV.push(c),h=s[++d]}r!==h?.index&&(o=f.nextNode(),r++)}return f.currentNode=g,n}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class G{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=a,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=v(this,t,e),C(t)?t===a||t==null||t===""?(this._$AH!==a&&this._$AR(),this._$AH=a):t!==this._$AH&&t!==H&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):J(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==a&&C(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=b.createElement(V(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(e);else{const o=new X(n,this),r=o.u(this.options);o.p(e),this.T(r),this._$AH=o}}_$AC(t){let e=j.get(t.strings);return e===void 0&&j.set(t.strings,e=new b(t)),e}k(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const o of t)n===e.length?e.push(s=new G(this.O(M()),this.O(M()),this,this.options)):s=e[n],s._$AI(o),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class S{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,o){this.type=1,this._$AH=a,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=a}_$AI(t,e=this,s,n){const o=this.strings;let r=!1;if(o===void 0)t=v(this,t,e,0),r=!C(t)||t!==this._$AH&&t!==H,r&&(this._$AH=t);else{const d=t;let h,c;for(t=o[0],h=0;h<o.length-1;h++)c=v(this,d[s+h],e,h),c===H&&(c=this._$AH[h]),r||=!C(c)||c!==this._$AH[h],c===a?t=a:t!==a&&(t+=(c??"")+o[h+1]),this._$AH[h]=c}r&&!n&&this.j(t)}j(t){t===a?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Y extends S{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===a?void 0:t}}class tt extends S{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==a)}}class et extends S{constructor(t,e,s,n,o){super(t,e,s,n,o),this.type=5}_$AI(t,e=this){if((t=v(this,t,e,0)??a)===H)return;const s=this._$AH,n=t===a&&s!==a||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==a&&(s===a||n);n&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class st{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){v(this,t)}}const it=R.litHtmlPolyfillSupport;it?.(b,G),(R.litHtmlVersions??=[]).push("3.3.0");/**
|
|
8
|
-
* @license
|
|
9
|
-
* Copyright 2020 Google LLC
|
|
10
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/const nt=i=>i.strings===void 0;/**
|
|
12
|
-
* @license
|
|
13
|
-
* Copyright 2017 Google LLC
|
|
14
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
15
|
-
*/const ot={CHILD:2},rt=i=>(...t)=>({_$litDirective$:i,values:t});class ht{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
|
|
16
|
-
* @license
|
|
17
|
-
* Copyright 2017 Google LLC
|
|
18
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/const y=(i,t)=>{const e=i._$AN;if(e===void 0)return!1;for(const s of e)s._$AO?.(t,!1),y(s,t);return!0},T=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while(e?.size===0)},Q=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),ct(t)}};function lt(i){this._$AN!==void 0?(T(this),this._$AM=i,Q(this)):this._$AM=i}function at(i,t=!1,e=0){const s=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(s))for(let o=e;o<s.length;o++)y(s[o],!1),T(s[o]);else s!=null&&(y(s,!1),T(s));else y(this,i)}const ct=i=>{i.type==ot.CHILD&&(i._$AP??=at,i._$AQ??=lt)};class $t extends ht{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),Q(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(y(this,t),T(this))}setValue(t){if(nt(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}/**
|
|
20
|
-
* @license
|
|
21
|
-
* Copyright 2020 Google LLC
|
|
22
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const dt=()=>new At;class At{}const I=new WeakMap,_t=rt(class extends $t{render(i){return a}update(i,[t]){const e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=i.options?.host,this.rt(this.ct=i.element)),a}rt(i){if(this.isConnected||(i=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let e=I.get(t);e===void 0&&(e=new WeakMap,I.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,i),i!==void 0&&this.G.call(this.ht,i)}else this.G.value=i}get lt(){return typeof this.G=="function"?I.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});class N extends U.LitElement{constructor(){super(...arguments),this._qrCodeGenCanvasRef=dt()}static{this.webComponentName="epigraph-qr-code-generator"}static{this.styles=U.css`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../../lit-element-CYaaFRfk.cjs"),l=require("lit/decorators.js"),c=require("qr-creator");var C=Object.defineProperty,p=(i,t,e,o)=>{for(var r=void 0,n=i.length-1,s;n>=0;n--)(s=i[n])&&(r=s(t,e,r)||r);return r&&C(t,e,r),r};class a extends d.i{static{this.webComponentName="epigraph-qr-code-generator"}static{this.styles=d.i$1`
|
|
24
2
|
:host {
|
|
25
3
|
display: none;
|
|
26
4
|
}
|
|
27
|
-
`}dataUritoBlob(t){const e=t.split(",");if(e.length!==2)throw new Error("Invalid data URI format");const
|
|
28
|
-
<canvas id="
|
|
29
|
-
`}}window.customElements.get(
|
|
5
|
+
`}get qrCodeGenCanvasRef(){return this._qrCodeGenCanvasRef}dataUritoBlob(t){const e=t.split(",");if(e.length!==2)throw new Error("Invalid data URI format");const o=e[0].split(":")[1].split(";")[0],r=atob(e[1]),n=new Uint8Array(Array.from(r,s=>s.charCodeAt(0)));return new Blob([n],{type:o})}generateQrCode(t={text:"www.epigraph.us",radius:.5,ecLevel:"H",fill:"black",background:null,size:256}){if(!this._qrCodeGenCanvasRef)return"";c.render(t,this._qrCodeGenCanvasRef);const e=this._qrCodeGenCanvasRef.toDataURL(),o=this.dataUritoBlob(e);return URL.createObjectURL(o)}render(){return d.x`
|
|
6
|
+
<canvas id="qrCodeCanvas"></canvas>
|
|
7
|
+
`}}p([l.query("#qrCodeCanvas")],a.prototype,"_qrCodeGenCanvasRef");window.customElements.get(a.webComponentName)===void 0&&window.customElements.define(a.webComponentName,a);exports.EpigraphQrCodeGenerator=a;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import { Ref } from 'lit/directives/ref.js';
|
|
3
2
|
import { default as QrCreator } from 'qr-creator';
|
|
4
3
|
export declare class EpigraphQrCodeGenerator extends LitElement {
|
|
5
4
|
static webComponentName: string;
|
|
6
|
-
_qrCodeGenCanvasRef:
|
|
5
|
+
_qrCodeGenCanvasRef: HTMLCanvasElement;
|
|
7
6
|
static styles: import('lit').CSSResult;
|
|
7
|
+
get qrCodeGenCanvasRef(): HTMLCanvasElement;
|
|
8
8
|
/**
|
|
9
9
|
* Converts any given data uri to a blob.
|
|
10
10
|
*
|
|
@@ -1,359 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const S = globalThis, N = S.trustedTypes, L = N ? N.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, j = "$lit$", u = `lit$${Math.random().toFixed(9).slice(2)}$`, q = "?" + u, K = `<${q}>`, g = document, w = () => g.createComment(""), C = (i) => i === null || typeof i != "object" && typeof i != "function", R = Array.isArray, X = (i) => R(i) || typeof i?.[Symbol.iterator] == "function", G = `[
|
|
9
|
-
\f\r]`, m = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, k = /-->/g, B = />/g, p = RegExp(`>|${G}(?:([^\\s"'>=/]+)(${G}*=${G}*(?:[^
|
|
10
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), O = /'/g, D = /"/g, P = /^(?:script|style|textarea|title)$/i, H = Symbol.for("lit-noChange"), a = Symbol.for("lit-nothing"), W = /* @__PURE__ */ new WeakMap(), f = g.createTreeWalker(g, 129);
|
|
11
|
-
function z(i, t) {
|
|
12
|
-
if (!R(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
13
|
-
return L !== void 0 ? L.createHTML(t) : t;
|
|
14
|
-
}
|
|
15
|
-
const Y = (i, t) => {
|
|
16
|
-
const e = i.length - 1, s = [];
|
|
17
|
-
let n, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", r = m;
|
|
18
|
-
for (let d = 0; d < e; d++) {
|
|
19
|
-
const h = i[d];
|
|
20
|
-
let c, $, l = -1, A = 0;
|
|
21
|
-
for (; A < h.length && (r.lastIndex = A, $ = r.exec(h), $ !== null); ) A = r.lastIndex, r === m ? $[1] === "!--" ? r = k : $[1] !== void 0 ? r = B : $[2] !== void 0 ? (P.test($[2]) && (n = RegExp("</" + $[2], "g")), r = p) : $[3] !== void 0 && (r = p) : r === p ? $[0] === ">" ? (r = n ?? m, l = -1) : $[1] === void 0 ? l = -2 : (l = r.lastIndex - $[2].length, c = $[1], r = $[3] === void 0 ? p : $[3] === '"' ? D : O) : r === D || r === O ? r = p : r === k || r === B ? r = m : (r = p, n = void 0);
|
|
22
|
-
const _ = r === p && i[d + 1].startsWith("/>") ? " " : "";
|
|
23
|
-
o += r === m ? h + K : l >= 0 ? (s.push(c), h.slice(0, l) + j + h.slice(l) + u + _) : h + u + (l === -2 ? d : _);
|
|
24
|
-
}
|
|
25
|
-
return [z(i, o + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
1
|
+
import { i as d, a as l, x as C } from "../../lit-element-C3moVMGu.js";
|
|
2
|
+
import { query as p } from "lit/decorators.js";
|
|
3
|
+
import m from "qr-creator";
|
|
4
|
+
var f = Object.defineProperty, c = (i, t, e, n) => {
|
|
5
|
+
for (var r = void 0, a = i.length - 1, o; a >= 0; a--)
|
|
6
|
+
(o = i[a]) && (r = o(t, e, r) || r);
|
|
7
|
+
return r && f(t, e, r), r;
|
|
26
8
|
};
|
|
27
|
-
class
|
|
28
|
-
constructor({ strings: t, _$litType$: e }, s) {
|
|
29
|
-
let n;
|
|
30
|
-
this.parts = [];
|
|
31
|
-
let o = 0, r = 0;
|
|
32
|
-
const d = t.length - 1, h = this.parts, [c, $] = Y(t, e);
|
|
33
|
-
if (this.el = x.createElement(c, s), f.currentNode = this.el.content, e === 2 || e === 3) {
|
|
34
|
-
const l = this.el.content.firstChild;
|
|
35
|
-
l.replaceWith(...l.childNodes);
|
|
36
|
-
}
|
|
37
|
-
for (; (n = f.nextNode()) !== null && h.length < d; ) {
|
|
38
|
-
if (n.nodeType === 1) {
|
|
39
|
-
if (n.hasAttributes()) for (const l of n.getAttributeNames()) if (l.endsWith(j)) {
|
|
40
|
-
const A = $[r++], _ = n.getAttribute(l).split(u), b = /([.?@])?(.*)/.exec(A);
|
|
41
|
-
h.push({ type: 1, index: o, name: b[2], strings: _, ctor: b[1] === "." ? et : b[1] === "?" ? st : b[1] === "@" ? it : U }), n.removeAttribute(l);
|
|
42
|
-
} else l.startsWith(u) && (h.push({ type: 6, index: o }), n.removeAttribute(l));
|
|
43
|
-
if (P.test(n.tagName)) {
|
|
44
|
-
const l = n.textContent.split(u), A = l.length - 1;
|
|
45
|
-
if (A > 0) {
|
|
46
|
-
n.textContent = N ? N.emptyScript : "";
|
|
47
|
-
for (let _ = 0; _ < A; _++) n.append(l[_], w()), f.nextNode(), h.push({ type: 2, index: ++o });
|
|
48
|
-
n.append(l[A], w());
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
} else if (n.nodeType === 8) if (n.data === q) h.push({ type: 2, index: o });
|
|
52
|
-
else {
|
|
53
|
-
let l = -1;
|
|
54
|
-
for (; (l = n.data.indexOf(u, l + 1)) !== -1; ) h.push({ type: 7, index: o }), l += u.length - 1;
|
|
55
|
-
}
|
|
56
|
-
o++;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
static createElement(t, e) {
|
|
60
|
-
const s = g.createElement("template");
|
|
61
|
-
return s.innerHTML = t, s;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
function v(i, t, e = i, s) {
|
|
65
|
-
if (t === H) return t;
|
|
66
|
-
let n = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
67
|
-
const o = C(t) ? void 0 : t._$litDirective$;
|
|
68
|
-
return n?.constructor !== o && (n?._$AO?.(!1), o === void 0 ? n = void 0 : (n = new o(i), n._$AT(i, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = n : e._$Cl = n), n !== void 0 && (t = v(i, n._$AS(i, t.values), n, s)), t;
|
|
69
|
-
}
|
|
70
|
-
class tt {
|
|
71
|
-
constructor(t, e) {
|
|
72
|
-
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
73
|
-
}
|
|
74
|
-
get parentNode() {
|
|
75
|
-
return this._$AM.parentNode;
|
|
76
|
-
}
|
|
77
|
-
get _$AU() {
|
|
78
|
-
return this._$AM._$AU;
|
|
79
|
-
}
|
|
80
|
-
u(t) {
|
|
81
|
-
const { el: { content: e }, parts: s } = this._$AD, n = (t?.creationScope ?? g).importNode(e, !0);
|
|
82
|
-
f.currentNode = n;
|
|
83
|
-
let o = f.nextNode(), r = 0, d = 0, h = s[0];
|
|
84
|
-
for (; h !== void 0; ) {
|
|
85
|
-
if (r === h.index) {
|
|
86
|
-
let c;
|
|
87
|
-
h.type === 2 ? c = new T(o, o.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(o, h.name, h.strings, this, t) : h.type === 6 && (c = new nt(o, this, t)), this._$AV.push(c), h = s[++d];
|
|
88
|
-
}
|
|
89
|
-
r !== h?.index && (o = f.nextNode(), r++);
|
|
90
|
-
}
|
|
91
|
-
return f.currentNode = g, n;
|
|
92
|
-
}
|
|
93
|
-
p(t) {
|
|
94
|
-
let e = 0;
|
|
95
|
-
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
class T {
|
|
99
|
-
get _$AU() {
|
|
100
|
-
return this._$AM?._$AU ?? this._$Cv;
|
|
101
|
-
}
|
|
102
|
-
constructor(t, e, s, n) {
|
|
103
|
-
this.type = 2, this._$AH = a, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = n, this._$Cv = n?.isConnected ?? !0;
|
|
104
|
-
}
|
|
105
|
-
get parentNode() {
|
|
106
|
-
let t = this._$AA.parentNode;
|
|
107
|
-
const e = this._$AM;
|
|
108
|
-
return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
|
|
109
|
-
}
|
|
110
|
-
get startNode() {
|
|
111
|
-
return this._$AA;
|
|
112
|
-
}
|
|
113
|
-
get endNode() {
|
|
114
|
-
return this._$AB;
|
|
115
|
-
}
|
|
116
|
-
_$AI(t, e = this) {
|
|
117
|
-
t = v(this, t, e), C(t) ? t === a || t == null || t === "" ? (this._$AH !== a && this._$AR(), this._$AH = a) : t !== this._$AH && t !== H && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : X(t) ? this.k(t) : this._(t);
|
|
118
|
-
}
|
|
119
|
-
O(t) {
|
|
120
|
-
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
121
|
-
}
|
|
122
|
-
T(t) {
|
|
123
|
-
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
124
|
-
}
|
|
125
|
-
_(t) {
|
|
126
|
-
this._$AH !== a && C(this._$AH) ? this._$AA.nextSibling.data = t : this.T(g.createTextNode(t)), this._$AH = t;
|
|
127
|
-
}
|
|
128
|
-
$(t) {
|
|
129
|
-
const { values: e, _$litType$: s } = t, n = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = x.createElement(z(s.h, s.h[0]), this.options)), s);
|
|
130
|
-
if (this._$AH?._$AD === n) this._$AH.p(e);
|
|
131
|
-
else {
|
|
132
|
-
const o = new tt(n, this), r = o.u(this.options);
|
|
133
|
-
o.p(e), this.T(r), this._$AH = o;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
_$AC(t) {
|
|
137
|
-
let e = W.get(t.strings);
|
|
138
|
-
return e === void 0 && W.set(t.strings, e = new x(t)), e;
|
|
139
|
-
}
|
|
140
|
-
k(t) {
|
|
141
|
-
R(this._$AH) || (this._$AH = [], this._$AR());
|
|
142
|
-
const e = this._$AH;
|
|
143
|
-
let s, n = 0;
|
|
144
|
-
for (const o of t) n === e.length ? e.push(s = new T(this.O(w()), this.O(w()), this, this.options)) : s = e[n], s._$AI(o), n++;
|
|
145
|
-
n < e.length && (this._$AR(s && s._$AB.nextSibling, n), e.length = n);
|
|
146
|
-
}
|
|
147
|
-
_$AR(t = this._$AA.nextSibling, e) {
|
|
148
|
-
for (this._$AP?.(!1, !0, e); t && t !== this._$AB; ) {
|
|
149
|
-
const s = t.nextSibling;
|
|
150
|
-
t.remove(), t = s;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
setConnected(t) {
|
|
154
|
-
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
class U {
|
|
158
|
-
get tagName() {
|
|
159
|
-
return this.element.tagName;
|
|
160
|
-
}
|
|
161
|
-
get _$AU() {
|
|
162
|
-
return this._$AM._$AU;
|
|
163
|
-
}
|
|
164
|
-
constructor(t, e, s, n, o) {
|
|
165
|
-
this.type = 1, this._$AH = a, this._$AN = void 0, this.element = t, this.name = e, this._$AM = n, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = a;
|
|
166
|
-
}
|
|
167
|
-
_$AI(t, e = this, s, n) {
|
|
168
|
-
const o = this.strings;
|
|
169
|
-
let r = !1;
|
|
170
|
-
if (o === void 0) t = v(this, t, e, 0), r = !C(t) || t !== this._$AH && t !== H, r && (this._$AH = t);
|
|
171
|
-
else {
|
|
172
|
-
const d = t;
|
|
173
|
-
let h, c;
|
|
174
|
-
for (t = o[0], h = 0; h < o.length - 1; h++) c = v(this, d[s + h], e, h), c === H && (c = this._$AH[h]), r ||= !C(c) || c !== this._$AH[h], c === a ? t = a : t !== a && (t += (c ?? "") + o[h + 1]), this._$AH[h] = c;
|
|
175
|
-
}
|
|
176
|
-
r && !n && this.j(t);
|
|
177
|
-
}
|
|
178
|
-
j(t) {
|
|
179
|
-
t === a ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
class et extends U {
|
|
183
|
-
constructor() {
|
|
184
|
-
super(...arguments), this.type = 3;
|
|
185
|
-
}
|
|
186
|
-
j(t) {
|
|
187
|
-
this.element[this.name] = t === a ? void 0 : t;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
class st extends U {
|
|
191
|
-
constructor() {
|
|
192
|
-
super(...arguments), this.type = 4;
|
|
193
|
-
}
|
|
194
|
-
j(t) {
|
|
195
|
-
this.element.toggleAttribute(this.name, !!t && t !== a);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
class it extends U {
|
|
199
|
-
constructor(t, e, s, n, o) {
|
|
200
|
-
super(t, e, s, n, o), this.type = 5;
|
|
201
|
-
}
|
|
202
|
-
_$AI(t, e = this) {
|
|
203
|
-
if ((t = v(this, t, e, 0) ?? a) === H) return;
|
|
204
|
-
const s = this._$AH, n = t === a && s !== a || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== a && (s === a || n);
|
|
205
|
-
n && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
206
|
-
}
|
|
207
|
-
handleEvent(t) {
|
|
208
|
-
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
class nt {
|
|
212
|
-
constructor(t, e, s) {
|
|
213
|
-
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
214
|
-
}
|
|
215
|
-
get _$AU() {
|
|
216
|
-
return this._$AM._$AU;
|
|
217
|
-
}
|
|
218
|
-
_$AI(t) {
|
|
219
|
-
v(this, t);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
const ot = S.litHtmlPolyfillSupport;
|
|
223
|
-
ot?.(x, T), (S.litHtmlVersions ??= []).push("3.3.0");
|
|
224
|
-
/**
|
|
225
|
-
* @license
|
|
226
|
-
* Copyright 2020 Google LLC
|
|
227
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
228
|
-
*/
|
|
229
|
-
const rt = (i) => i.strings === void 0;
|
|
230
|
-
/**
|
|
231
|
-
* @license
|
|
232
|
-
* Copyright 2017 Google LLC
|
|
233
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
234
|
-
*/
|
|
235
|
-
const ht = { CHILD: 2 }, lt = (i) => (...t) => ({ _$litDirective$: i, values: t });
|
|
236
|
-
class at {
|
|
237
|
-
constructor(t) {
|
|
238
|
-
}
|
|
239
|
-
get _$AU() {
|
|
240
|
-
return this._$AM._$AU;
|
|
241
|
-
}
|
|
242
|
-
_$AT(t, e, s) {
|
|
243
|
-
this._$Ct = t, this._$AM = e, this._$Ci = s;
|
|
244
|
-
}
|
|
245
|
-
_$AS(t, e) {
|
|
246
|
-
return this.update(t, e);
|
|
247
|
-
}
|
|
248
|
-
update(t, e) {
|
|
249
|
-
return this.render(...e);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* @license
|
|
254
|
-
* Copyright 2017 Google LLC
|
|
255
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
256
|
-
*/
|
|
257
|
-
const y = (i, t) => {
|
|
258
|
-
const e = i._$AN;
|
|
259
|
-
if (e === void 0) return !1;
|
|
260
|
-
for (const s of e) s._$AO?.(t, !1), y(s, t);
|
|
261
|
-
return !0;
|
|
262
|
-
}, M = (i) => {
|
|
263
|
-
let t, e;
|
|
264
|
-
do {
|
|
265
|
-
if ((t = i._$AM) === void 0) break;
|
|
266
|
-
e = t._$AN, e.delete(i), i = t;
|
|
267
|
-
} while (e?.size === 0);
|
|
268
|
-
}, V = (i) => {
|
|
269
|
-
for (let t; t = i._$AM; i = t) {
|
|
270
|
-
let e = t._$AN;
|
|
271
|
-
if (e === void 0) t._$AN = e = /* @__PURE__ */ new Set();
|
|
272
|
-
else if (e.has(i)) break;
|
|
273
|
-
e.add(i), dt(t);
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
function ct(i) {
|
|
277
|
-
this._$AN !== void 0 ? (M(this), this._$AM = i, V(this)) : this._$AM = i;
|
|
278
|
-
}
|
|
279
|
-
function $t(i, t = !1, e = 0) {
|
|
280
|
-
const s = this._$AH, n = this._$AN;
|
|
281
|
-
if (n !== void 0 && n.size !== 0) if (t) if (Array.isArray(s)) for (let o = e; o < s.length; o++) y(s[o], !1), M(s[o]);
|
|
282
|
-
else s != null && (y(s, !1), M(s));
|
|
283
|
-
else y(this, i);
|
|
284
|
-
}
|
|
285
|
-
const dt = (i) => {
|
|
286
|
-
i.type == ht.CHILD && (i._$AP ??= $t, i._$AQ ??= ct);
|
|
287
|
-
};
|
|
288
|
-
class At extends at {
|
|
289
|
-
constructor() {
|
|
290
|
-
super(...arguments), this._$AN = void 0;
|
|
291
|
-
}
|
|
292
|
-
_$AT(t, e, s) {
|
|
293
|
-
super._$AT(t, e, s), V(this), this.isConnected = t._$AU;
|
|
294
|
-
}
|
|
295
|
-
_$AO(t, e = !0) {
|
|
296
|
-
t !== this.isConnected && (this.isConnected = t, t ? this.reconnected?.() : this.disconnected?.()), e && (y(this, t), M(this));
|
|
297
|
-
}
|
|
298
|
-
setValue(t) {
|
|
299
|
-
if (rt(this._$Ct)) this._$Ct._$AI(t, this);
|
|
300
|
-
else {
|
|
301
|
-
const e = [...this._$Ct._$AH];
|
|
302
|
-
e[this._$Ci] = t, this._$Ct._$AI(e, this, 0);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
disconnected() {
|
|
306
|
-
}
|
|
307
|
-
reconnected() {
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* @license
|
|
312
|
-
* Copyright 2020 Google LLC
|
|
313
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
314
|
-
*/
|
|
315
|
-
const _t = () => new ut();
|
|
316
|
-
class ut {
|
|
317
|
-
}
|
|
318
|
-
const E = /* @__PURE__ */ new WeakMap(), pt = lt(class extends At {
|
|
319
|
-
render(i) {
|
|
320
|
-
return a;
|
|
321
|
-
}
|
|
322
|
-
update(i, [t]) {
|
|
323
|
-
const e = t !== this.G;
|
|
324
|
-
return e && this.G !== void 0 && this.rt(void 0), (e || this.lt !== this.ct) && (this.G = t, this.ht = i.options?.host, this.rt(this.ct = i.element)), a;
|
|
325
|
-
}
|
|
326
|
-
rt(i) {
|
|
327
|
-
if (this.isConnected || (i = void 0), typeof this.G == "function") {
|
|
328
|
-
const t = this.ht ?? globalThis;
|
|
329
|
-
let e = E.get(t);
|
|
330
|
-
e === void 0 && (e = /* @__PURE__ */ new WeakMap(), E.set(t, e)), e.get(this.G) !== void 0 && this.G.call(this.ht, void 0), e.set(this.G, i), i !== void 0 && this.G.call(this.ht, i);
|
|
331
|
-
} else this.G.value = i;
|
|
332
|
-
}
|
|
333
|
-
get lt() {
|
|
334
|
-
return typeof this.G == "function" ? E.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
|
|
335
|
-
}
|
|
336
|
-
disconnected() {
|
|
337
|
-
this.lt === this.ct && this.rt(void 0);
|
|
338
|
-
}
|
|
339
|
-
reconnected() {
|
|
340
|
-
this.rt(this.ct);
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
class I extends Q {
|
|
344
|
-
constructor() {
|
|
345
|
-
super(...arguments), this._qrCodeGenCanvasRef = _t();
|
|
346
|
-
}
|
|
9
|
+
class s extends d {
|
|
347
10
|
static {
|
|
348
11
|
this.webComponentName = "epigraph-qr-code-generator";
|
|
349
12
|
}
|
|
350
13
|
static {
|
|
351
|
-
this.styles =
|
|
14
|
+
this.styles = l`
|
|
352
15
|
:host {
|
|
353
16
|
display: none;
|
|
354
17
|
}
|
|
355
18
|
`;
|
|
356
19
|
}
|
|
20
|
+
get qrCodeGenCanvasRef() {
|
|
21
|
+
return this._qrCodeGenCanvasRef;
|
|
22
|
+
}
|
|
357
23
|
/**
|
|
358
24
|
* Converts any given data uri to a blob.
|
|
359
25
|
*
|
|
@@ -364,8 +30,8 @@ class I extends Q {
|
|
|
364
30
|
const e = t.split(",");
|
|
365
31
|
if (e.length !== 2)
|
|
366
32
|
throw new Error("Invalid data URI format");
|
|
367
|
-
const
|
|
368
|
-
return new Blob([
|
|
33
|
+
const n = e[0].split(":")[1].split(";")[0], r = atob(e[1]), a = new Uint8Array(Array.from(r, (o) => o.charCodeAt(0)));
|
|
34
|
+
return new Blob([a], { type: n });
|
|
369
35
|
}
|
|
370
36
|
/**
|
|
371
37
|
* Generates a QR code as image data url for the qrCodeContent provided.
|
|
@@ -386,11 +52,11 @@ class I extends Q {
|
|
|
386
52
|
size: 256
|
|
387
53
|
// in pixels
|
|
388
54
|
}) {
|
|
389
|
-
if (!this._qrCodeGenCanvasRef
|
|
55
|
+
if (!this._qrCodeGenCanvasRef)
|
|
390
56
|
return "";
|
|
391
|
-
|
|
392
|
-
const e = this._qrCodeGenCanvasRef.
|
|
393
|
-
return URL.createObjectURL(
|
|
57
|
+
m.render(t, this._qrCodeGenCanvasRef);
|
|
58
|
+
const e = this._qrCodeGenCanvasRef.toDataURL(), n = this.dataUritoBlob(e);
|
|
59
|
+
return URL.createObjectURL(n);
|
|
394
60
|
}
|
|
395
61
|
/**
|
|
396
62
|
* Override for the LitElement's render method.
|
|
@@ -398,12 +64,15 @@ class I extends Q {
|
|
|
398
64
|
* @returns {html} HTML to be rendered by this component.
|
|
399
65
|
*/
|
|
400
66
|
render() {
|
|
401
|
-
return
|
|
402
|
-
<canvas id="
|
|
67
|
+
return C`
|
|
68
|
+
<canvas id="qrCodeCanvas"></canvas>
|
|
403
69
|
`;
|
|
404
70
|
}
|
|
405
71
|
}
|
|
406
|
-
|
|
72
|
+
c([
|
|
73
|
+
p("#qrCodeCanvas")
|
|
74
|
+
], s.prototype, "_qrCodeGenCanvasRef");
|
|
75
|
+
window.customElements.get(s.webComponentName) === void 0 && window.customElements.define(s.webComponentName, s);
|
|
407
76
|
export {
|
|
408
|
-
|
|
77
|
+
s as EpigraphQrCodeGenerator
|
|
409
78
|
};
|