@epigraph/epigraph-std-lib 5.0.0-alpha.11 → 5.0.0-alpha.13

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.
Files changed (36) hide show
  1. package/dist/Epigraph/epigraph.cjs +1 -1
  2. package/dist/Epigraph/epigraph.js +94 -126
  3. package/dist/Epigraph/epigraphBaseSolutions.cjs +1 -1
  4. package/dist/Epigraph/epigraphBaseSolutions.js +60 -68
  5. package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.cjs +1 -16
  6. package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js +2 -946
  7. package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.cjs +1 -1
  8. package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.js +74 -198
  9. package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.cjs +1 -1
  10. package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.js +197 -425
  11. package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.cjs +1 -7
  12. package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.js +2 -78
  13. package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.cjs +1 -1
  14. package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.js +24 -26
  15. package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.cjs +1 -1
  16. package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.js +2 -88
  17. package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs +1 -1
  18. package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js +44 -75
  19. package/dist/enums-BSSe4NAs.js +8 -0
  20. package/dist/enums-PfFMiIoe.cjs +1 -0
  21. package/dist/epigraph-std-lib.cjs +1 -1
  22. package/dist/epigraph-std-lib.d.ts +1 -0
  23. package/dist/epigraph-std-lib.js +11 -72
  24. package/dist/epigraphAnalytics-CF9Czp8C.js +722 -0
  25. package/dist/epigraphAnalytics-H3EZRDUh.cjs +1 -0
  26. package/dist/epigraphQrCodeGenerator-BXUNL2XK.js +54 -0
  27. package/dist/epigraphQrCodeGenerator-F2eLrPC_.cjs +7 -0
  28. package/dist/epigraphUnitsConverter-CwpmWl7p.cjs +1 -0
  29. package/dist/epigraphUnitsConverter-DsX4Rmsp.js +66 -0
  30. package/dist/lit--5TUYSGn.js +508 -0
  31. package/dist/lit-DZtv4Pds.cjs +2 -0
  32. package/package.json +6 -7
  33. package/dist/enums-1vqWxJ0i.cjs +0 -1
  34. package/dist/enums-CvOTKyNu.js +0 -5
  35. package/dist/lit-element-C3moVMGu.js +0 -524
  36. package/dist/lit-element-CYaaFRfk.cjs +0 -19
@@ -0,0 +1 @@
1
+ const e=require("./enums-PfFMiIoe.cjs");var t=function(e){return e.UNAVAILABLE=`unavailable`,e.AVAILABLE=`available`,e.RESTRICTED=`restricted`,e}({}),n=Symbol(`data`),r=Symbol(`next`),i=class e{constructor(e){this[n]=e,this[r]=null}get data(){return this[n]}set next(t){if(!(t instanceof e)&&t!==null)throw Error(`This node is not an instance of the custom class 'Node'.`);this[r]=t}get next(){return this[r]}},a=Symbol(`head`),o=class{constructor(){this[a]=null}set head(e){this[a]=e}get head(){return this[a]}addToTail(e){let t=this.head;if(t){for(;t.next!==null;)t=t?.next;return t.next=new i(e)}return this.head=new i(e)}removeHead(){let e=this.head;if(e)return this.head=e.next,e.data}},s=Symbol(`queue`),c=Symbol(`size`),l=class{constructor(){this[s]=new o,this[c]=0}get queue(){return this[s]}get size(){return this[c]}enqueue(e){this.queue.addToTail(e),this[c]++}dequeue(){let e=this.queue.removeHead();return this[c]--,e}},u=class{static{this.NOTIFICATION_NAME=`epg-notification`}static{this.ACTION_SEND_EVENT=`send-event`}static{this.ACTION_INITIALIZED=`initialized`}static{this.ACTION_FAILED_INITIALIZATION=`initialization-failed`}constructor(e,t,n,r,i,a){this._pluginName=e,this._trackingId=t,this._experienceId=n,this._solution=r,this._initializer=i,this._status=a}updateStatus(e){this._status=e}updateInitializer(e){this._initializer=e}notify(e,t){let n={pluginName:this._pluginName,trackingId:this._trackingId,experienceId:this._experienceId,solution:this._solution,initializer:this._initializer,status:this._status,action:e,eventDetails:t};window.dispatchEvent(new CustomEvent(`epg-notification`,{detail:n}))}},d=class{constructor({trackingID:e,experienceID:n,solution:r,verboseLogging:i=!1}){this.__status=t.UNAVAILABLE,this.__sentEventCount=0,this.__initializationAttempts=0,this.__lastInitializationAttempt=performance.now(),this.__maxInitializationAttempts=10,this.__initializationRetryDelay=2e3,this.__isInitialized=!1,this.__initializationMethod=`NONE`,this.__nexusFailureReported=!1,this.name=this.pluginName=`GA4-PLUGIN`,this.trackingID=e,this.experienceID=n,this.solution=r,this.verboseLogging=i,this.__queue=new l,this.__epigraphNotifier=new u(this.pluginName,this.pluginName,this.experienceID,this.solution,this.__initializationMethod,this.__status),this.initializePlugin()}getStatus(){return this.__status}setStatus(e){this.__status=e,this.__epigraphNotifier.updateStatus(e)}getPendingEventCount(){return this.__queue.size}getSentEventCount(){return this.__sentEventCount}getTotalEventCount(){return this.getPendingEventCount()+this.getSentEventCount()}getUniquePluginIdentifier(){return`${this.name}-${this.trackingID}`}setupPlugin(){this.__isInitialized&&this.dataLayer!==void 0&&this.dequeueAndSendEvents()}async sendEvent(e,n){if(this.__queue.enqueue(e),!n){this.__status=t.RESTRICTED;return}if(!this.__isInitialized){this.logger(`Cannot send analytics event: dataLayer not defined or plugin not initialized.`);return}try{await this.dequeueAndSendEvents()}catch(e){this.logger(e),await this.reportFailureToNexus(`EVENT_SEND_ERROR`,e?.toString()||`Unknown error`)}}initializePlugin(){if(this.__isInitialized)return;if(this.__initializationAttempts>=this.__maxInitializationAttempts){this.__nexusFailureReported||(this.reportFailureToNexus(`MAX_INITIALIZATION_ATTEMPTS`,`Maximum initialization attempts reached`),this.__nexusFailureReported=!0,this.__epigraphNotifier.notify(u.ACTION_FAILED_INITIALIZATION,{}));return}let e=performance.now();if(this.__initializationAttempts>0&&e-this.__lastInitializationAttempt<this.__initializationRetryDelay)return;this.__lastInitializationAttempt=e,this.__initializationAttempts++;let n=this.detectAndSetupAnalytics();n.success?(this.__isInitialized=!0,this.__status=t.AVAILABLE,this.__initializationMethod=n.method,this.dataLayerName=n.dataLayerName,this.dataLayer=window[this.dataLayerName],this.logger(`Successfully initialized ${n.method} with dataLayer: ${this.dataLayerName}`),this.__epigraphNotifier.notify(u.ACTION_INITIALIZED,{}),this.__queue.size>0&&this.dequeueAndSendEvents()):(this.logger(`Initialization attempt ${this.__initializationAttempts} failed: ${n.error}`),this.__initializationAttempts<this.__maxInitializationAttempts&&setTimeout(()=>{this.initializePlugin()},this.__initializationRetryDelay))}detectAndSetupAnalytics(){let e=this.detectGTM();if(e)return this.logger(`GTM detected with container ID: ${e.containerId}`),this.__epigraphNotifier.updateInitializer(`GTM`),{success:!0,method:`GTM`,dataLayerName:e.dataLayerName};let t=this.findGA4Info(this.trackingID);if(t){let e=t.l||`dataLayer`;return this.logger(`GA4 script found, setting up with dataLayer: ${e}`),this.__epigraphNotifier.updateInitializer(`GA4`),{success:!0,method:`GA4`,dataLayerName:e}}return{success:!1,method:`NONE`,dataLayerName:`dataLayer`,error:`No analytics setup found and unable to create one`}}detectGTM(){let e=document.querySelectorAll(`script[src*="googletagmanager.com/gtm"]`);for(let t of Array.from(e)){let e=t.getAttribute(`src`);if(e){let t=e.match(/gtm\.js\?id=([^&]+)/);if(t&&t.length>0){let n=e.match(/&l=([^&]+)/),r=n?n[1]:`dataLayer`;return{containerId:t[1],dataLayerName:r}}}}return null}async dequeueAndSendEvents(){if(!this.__isInitialized||!this.dataLayer)return;let e=this.__queue.size;for(let t=0;t<e;t++){let e=this.__queue.dequeue();try{this.__initializationMethod===`GTM`?(this.sendGTMEvent(e),this.__sentEventCount++,this.logger(`Analytics event successfully sent via ${this.__initializationMethod}: ${e.eventName}`)):this.__initializationMethod===`GA4`?(this.sendGA4Event(e),this.__sentEventCount++,this.logger(`Analytics event successfully sent via ${this.__initializationMethod}: ${e.eventName}`)):this.__queue.enqueue(e)}catch(t){this.logger(`Error sending event ${e.eventName}: ${t}`),this.__queue.enqueue(e)}}}async sendGTMEvent(e){let t=e.getGTMParameters(this.solution,this.experienceID,this.trackingID),n=t;this.isValidPayload(t)||(t=await this.convertGTMParametersToEpgEventTag(e.eventName,t)),this.dataLayer&&(this.dataLayer.push(t),this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT,n))}async sendGA4Event(e){let t=e.getGa4Parameters(this.solution,this.experienceID,this.trackingID),n=t;this.isValidPayload(t)||(t=await this.convertGA4ParametersToEpgEventTag(t)),window.gtag(`event`,e.eventName,t),this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT,n)}isValidPayload(e){if(Object.keys(e).length>=25)return!1;for(let[t,n]of Object.entries(e))if(t!==`items`&&(t.length>40||String(n).length>100))return!1;return!0}async convertGTMParametersToEpgEventTag(e,t){try{return{event:e,epg_event_tag:await this.sendGA4LongParameters(t),send_to:this.trackingID}}catch{return t}}async convertGA4ParametersToEpgEventTag(e){try{return{epg_event_tag:await this.sendGA4LongParameters(e),send_to:this.trackingID}}catch{return e}}logger(e){this.verboseLogging&&console.warn(e)}async sendGA4LongParameters(e){let t={parameters:e};try{let e=await fetch(`https://api.myepigraph.com/api/analytics/ga4/custom`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(t)});return e.ok?(await e.json())?.id??``:``}catch{return``}}async reportFailureToNexus(e,t){try{let n={plugin:`GA4`,trackingId:this.trackingID,solution:this.solution,experienceId:this.experienceID,failureType:e,errorMessage:t,timestamp:new Date().toISOString(),url:window.location.href,userAgent:navigator.userAgent};this.logger(`Failure reported to Nexus: ${JSON.stringify(n)}`)}catch(e){this.logger(`Error reporting failure to Nexus: ${e}`)}}findGA4Info(e){if(window.google_tag_manager&&window.google_tag_manager[e]){let t=window.google_tag_manager[e];if(t&&t.dataLayerName)return{fullSrc:``,id:e,l:t.dataLayerName}}let t=document.querySelectorAll(`script[src]`);for(let n of t){let t=n.getAttribute(`src`);if(t&&t.includes(e)){let e=new URL(t,location.href),n=Object.fromEntries(e.searchParams.entries());return{fullSrc:e.href,id:n.id||void 0,l:n.l||void 0}}}return null}},f=class{constructor({trackingID:n,experienceID:r,solution:i,sessionId:a,xPath:o,verboseLogging:s=!1,baseUrl:c=e.n.PRODUCTION}){this.__status=t.UNAVAILABLE,this.__sentEventCount=0,this.sessionId=a,this.xPath=o,this.name=this.pluginName=`NEXUS-PLUGIN`,this.trackingID=n,this.experienceID=r,this.solution=i,this.verboseLogging=s,this.__queue=new l,this.url=`${c}analytics/event`,this.__status=t.AVAILABLE,this.__epigraphNotifier=new u(this.pluginName,this.trackingID,this.experienceID,this.solution,`NEXUS`,this.__status),this.__epigraphNotifier.notify(u.ACTION_INITIALIZED,{})}getStatus(){return this.__status}setStatus(e){this.__status=e,this.__epigraphNotifier.updateStatus(e)}getPendingEventCount(){return this.__queue.size}getSentEventCount(){return this.__sentEventCount}getTotalEventCount(){return this.getPendingEventCount()+this.getSentEventCount()}getUniquePluginIdentifier(){return this.name+`-`+this.trackingID}setupPlugin(){}async sendEvent(e,n){if(this.__queue.enqueue(e),!n){this.__status=t.RESTRICTED,this.__epigraphNotifier.updateStatus(this.__status);return}await this.dequeueAndSendEvents()}async dequeueAndSendEvents(){for(let e=0;e<this.__queue.size;e++){let e=this.__queue.dequeue(),t={send_to:this.trackingID,experience_id:this.experienceID,solution:this.solution,event:e.eventName,parameters:e.getNexusParameters()};try{return(await fetch(this.url,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`,"EPG-SESSION-ID":this.sessionId,"EPG-XPATH":this.xPath,Origin:typeof window<`u`?window.location.origin:``},body:JSON.stringify(t)})).ok&&this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT,t),``}catch{return``}this.__sentEventCount++}return``}},p=class{constructor(e){this.consentSet=!1,this.consent=!1,this.pluginName=`OneTrustConsentPlugin`,this.consentIdentifier=e,this.consent=!1,this.addConsentChangedListener()}hasConsent(){if(this.consentSet)return this.consent;if(window.OnetrustActiveGroups!==void 0){let e=window.OnetrustActiveGroups;e!==void 0&&e.split(`,`).forEach(e=>{e===this.consentIdentifier&&(this.consent=!0,this.consentSet=!0)})}return this.consent}addConsentChangedListener(){window.addEventListener(`load`,()=>{this.hasConsent(),window.OneTrust!==void 0&&typeof window.OneTrust==`object`&&window.OneTrust.OnConsentChanged(()=>{this.consentSet=!1,this.hasConsent()})})}},m=function(e){return e.OneTrust=`onetrust`,e}({}),h=class{constructor({eventName:e,interactiveEvent:t,customParameters:n}){this.eventName=e,this.interactiveEvent=t,this.customParameters=n}getGa4Parameters(e,t,n){let r={solution:e,experience_id:t,interactive_event:this.interactiveEvent,send_to:n};return r=Object.assign(r,JSON.parse(JSON.stringify(this.customParameters))),r}getGTMParameters(e,t,n){let r={solution:e,experience_id:t,event:this.eventName,interactive_event:this.interactiveEvent,send_to:n};return r=Object.assign(r,JSON.parse(JSON.stringify(this.customParameters))),r}getNexusParameters(){let e={interactive_event:this.interactiveEvent};return e=Object.assign(e,JSON.parse(JSON.stringify(this.customParameters))),e}},g=function(e){return e.VARIANT=`variant`,e.CATEGORY_VARIANT=`category_variant`,e.GEOMETRY=`geometry`,e.CATEGORY_GEOMETRY=`category_geometry`,e.GLOBAL=`global`,e}({}),_=function(e){return e.AR=`ar`,e.QR=`qr`,e.INFO=`info`,e.INSTRUCTIONS=`instructions`,e.DOWNLOAD=`download`,e.PREVIEW_CART=`preview_cart`,e.HOTSPOT_PANEL=`hotspot_panel`,e.SHARE_MODAL=`share_modal`,e.RESTART_MODAL=`restart_modal`,e.REMOVE_MODAL=`remove_modal`,e.LOAD_PRECONFIG_MODAL=`load_preconfig_modal`,e.MOVE_MODAL=`move_modal`,e.OUT_OF_STOCK_MODAL=`out_of_stock_modal`,e}({}),v=function(e){return e.NETWORK=`network`,e.EXPERIENCE_CONFIG_ERROR=`experience-config-error`,e.SCENE_LOAD_ERROR=`scene-load-error`,e.INITIAL_SCENE_LOAD_ERROR=`initial-scene-load-error`,e.AUTHENTICATION_FAILED=`authentication-failed`,e}({}),y=function(e){return e.AUTO=`auto`,e.BUTTON=`button`,e.HOTSPOT=`hotspot`,e.GESTURE=`gesture`,e}({}),b=function(e){return e.USD=`USD`,e.EUR=`EUR`,e.GBP=`GBP`,e.CAD=`CAD`,e}({}),x=function(e){return e.AR=`ar`,e.QR=`qr`,e.AR_WEBGL2=`ar-webgl2`,e.QR_WEBGL2=`qr-webgl2`,e}({}),S=function(e){return e.AR_VIEW=`ar_view`,e.DIMENSION_TOGGLE=`dimension_toggle`,e.HOTSPOTS_TOGGLE=`hotspots_toggle`,e.HELP_TOGGLE=`help_toggle`,e.UTILITY_MENU_TOGGLE=`utility_menu_toggle`,e.HOTSPOT_ENTER=`hotspot_enter`,e.HOTSPOT_EXIT=`hotspot_exit`,e.SHARE=`share`,e.PDF_DOWNLOAD=`pdf_download`,e.COPY=`copy`,e.RESTART=`restart`,e.INSTRUCTIONS_SHOW=`show_instructions`,e.REVIEW_CART=`review_cart`,e.SHOP_NOW=`shop_now`,e.SUB_CATEGORY=`sub_category`,e.NEXT_STEP=`next_step`,e.PREVIOUS_STEP=`previous_step`,e}({}),C=function(e){return e.ZOOM=`zoom`,e.ROTATE=`rotate`,e.PAN=`pan`,e}({}),w=function(e){return e.CONFIGURATION=`configuration`,e.SCENE=`scene`,e.PRODUCT=`product`,e}({}),T=function(e){return e.FACEBOOK=`facebook`,e.TWITTER=`twitter`,e.EMAIL=`email`,e.COPY_LINK=`copy_link`,e.WHATSAPP=`whatsapp`,e.LINKEDIN=`linkedin`,e}({}),E=class extends h{constructor(e){super({eventName:`epigraph_ar_requested`,interactiveEvent:!0,customParameters:{items:e}})}},D=class extends h{constructor(e){super({eventName:`epigraph_module_loading`,interactiveEvent:!1,customParameters:{is_pre_config:e}})}},O=class extends h{constructor(e,t){super({eventName:`epigraph_module_ready`,interactiveEvent:!1,customParameters:{is_pre_config:e,load_time_ms:t}})}},k=class extends h{static{this.MODULE_FAILED_ERRORS=v}constructor(e,t,n){super({eventName:`epigraph_module_failed`,interactiveEvent:!1,customParameters:{is_pre_config:e,load_time_ms:t,error_type:n}})}},A=class extends h{constructor(e){super({eventName:`epigraph_module_closed`,interactiveEvent:!0,customParameters:{items:e}})}},j=class extends h{static{this.SUPPORT_TYPE=x}constructor(e){super({eventName:`epigraph_support_detected`,interactiveEvent:!1,customParameters:{support_type:e}})}},M=class extends h{static{this.BUTTON_TYPE=S}constructor(e,t){super({eventName:`epigraph_button_click`,interactiveEvent:!0,customParameters:{button_type:e,button_name:t}})}},N=class extends h{static{this.PANEL_TYPE=_}static{this.TRIGGER_SOURCE=y}constructor(e,t,n,r){super({eventName:`epigraph_panel_opened`,interactiveEvent:e,customParameters:{items:r,panel_type:t,trigger_source:n}})}},P=class extends h{static{this.PANEL_TYPE=_}static{this.TRIGGER_SOURCE=y}constructor(e,t,n,r){super({eventName:`epigraph_panel_closed`,interactiveEvent:e,customParameters:{items:r,panel_type:t,trigger_source:n}})}},F=class extends h{constructor(e){super({eventName:`epigraph_add_to_favourites`,interactiveEvent:!0,customParameters:{items:e}})}},I=class extends h{static{this.ACTION_PERFORMED=C}constructor(e){super({eventName:`epigraph_keyboard_interaction`,interactiveEvent:!0,customParameters:{action_performed:e}})}},L=class extends h{static{this.INTERACTION_TYPE=C}constructor(e){super({eventName:`epigraph_touch_interaction`,interactiveEvent:!0,customParameters:{interaction_type:e}})}},R=class extends h{static{this.CURRENCY=b}constructor(e,t,n,r,i){super({eventName:`epigraph_item_added`,interactiveEvent:e,customParameters:{items:i,value:t,currency:n,quantity:r}})}},z=class extends h{constructor(e){super({eventName:`epigraph_item_moved`,interactiveEvent:!0,customParameters:{items:e}})}},B=class extends h{static{this.CURRENCY=b}constructor(e,t,n,r){super({eventName:`epigraph_item_removed`,interactiveEvent:!0,customParameters:{items:r,value:e,currency:t,quantity:n}})}},V=class extends h{static{this.VARIANT_CHANGE_TYPES=g}constructor(e,t){super({eventName:`epigraph_variant_changed`,interactiveEvent:!0,customParameters:{items:t,change_type:e}})}},H=class extends h{static{this.CONTENT_TYPES=w}static{this.SHARE_DESTINATIONS=T}constructor(e,t,n){super({eventName:`epigraph_content_shared`,interactiveEvent:!0,customParameters:{items:n,content_type:e,share_destination:t}})}},U=class extends h{static{this.CURRENCY=b}constructor(e,t,n){super({eventName:`epigraph_checkout`,interactiveEvent:!0,customParameters:{items:n,value:e,currency:t}})}},W=class extends h{static{this.CURRENCY=b}constructor(e,t,n){super({eventName:`epigraph_conversion`,interactiveEvent:!0,customParameters:{items:n,value:e,currency:t}})}},G=class extends h{constructor(e){super({eventName:`epigraph_changeRate`,interactiveEvent:!1,customParameters:{value:e}})}},K=class extends h{constructor(e){super({eventName:`epigraph_completionRate`,interactiveEvent:!1,customParameters:{value:e}})}},q=class extends h{constructor(e){super({eventName:`epigraph_engagementRate`,interactiveEvent:!1,customParameters:{value:e}})}},J=class extends h{constructor(e,t,n){super({eventName:e,interactiveEvent:t,customParameters:n})}},Y=Symbol(`analyticsPluginsMap`),X=class{constructor(e,t){this[Y]=new Map,this.__consentPlugin=null,e&&t&&(this.__consentPlugin=this.buildConsentPlugin(e,t)),window.addEventListener(`epigraphAnalyticsConsentChange`,this.__onConsentChangeFromEvent)}__onConsentChangeFromEvent(e){let n=e;this.__overrideConsent=n.detail.hasConsent;for(let e of this[Y].values())this.__hasConsent()||e.setStatus(t.RESTRICTED)}addEventPlugin(e){this[Y].has(e.getUniquePluginIdentifier())||(this[Y].set(e.getUniquePluginIdentifier(),e),e.setupPlugin())}__hasConsent(){let e=!0;return this.__overrideConsent===void 0?(this.__consentPlugin&&(e=this.__consentPlugin.hasConsent()),e):(e=this.__overrideConsent,e)}sendEvent(e){this[Y].forEach(t=>{t.sendEvent(e,this.__hasConsent())})}buildConsentPlugin(e,t){return e.toLowerCase()===m.OneTrust.toLowerCase()?new p(t):null}};Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return I}});
@@ -0,0 +1,54 @@
1
+ import { n as e, r as t, t as n } from "./lit--5TUYSGn.js";
2
+ import { query as r } from "lit/decorators.js";
3
+ import i from "qr-creator";
4
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
5
+ function a(e, t, n, r) {
6
+ var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
7
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
8
+ else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
9
+ return i > 3 && a && Object.defineProperty(t, n, a), a;
10
+ }
11
+ //#endregion
12
+ //#region lib/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.ts
13
+ var o = class extends n {
14
+ static {
15
+ this.webComponentName = "epigraph-qr-code-generator";
16
+ }
17
+ static {
18
+ this.styles = t`
19
+ :host {
20
+ display: none;
21
+ }
22
+ `;
23
+ }
24
+ get qrCodeGenCanvasRef() {
25
+ return this._qrCodeGenCanvasRef;
26
+ }
27
+ dataUritoBlob(e) {
28
+ let t = e.split(",");
29
+ if (t.length !== 2) throw Error("Invalid data URI format");
30
+ let n = t[0].split(":")[1].split(";")[0], r = atob(t[1]), i = new Uint8Array(Array.from(r, (e) => e.charCodeAt(0)));
31
+ return new Blob([i], { type: n });
32
+ }
33
+ generateQrCode(e = {
34
+ text: "www.epigraph.us",
35
+ radius: .5,
36
+ ecLevel: "H",
37
+ fill: "black",
38
+ background: null,
39
+ size: 256
40
+ }) {
41
+ if (!this._qrCodeGenCanvasRef) return "";
42
+ i.render(e, this._qrCodeGenCanvasRef);
43
+ let t = this._qrCodeGenCanvasRef.toDataURL(), n = this.dataUritoBlob(t);
44
+ return URL.createObjectURL(n);
45
+ }
46
+ render() {
47
+ return e`
48
+ <canvas id="qrCodeCanvas"></canvas>
49
+ `;
50
+ }
51
+ };
52
+ a([r("#qrCodeCanvas")], o.prototype, "_qrCodeGenCanvasRef", void 0), window.customElements.get(o.webComponentName) === void 0 && window.customElements.define(o.webComponentName, o);
53
+ //#endregion
54
+ export { o as t };
@@ -0,0 +1,7 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require("./lit-DZtv4Pds.cjs");let l=require("lit/decorators.js"),u=require("qr-creator");u=s(u,1);function d(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var f=class extends c.t{static{this.webComponentName=`epigraph-qr-code-generator`}static{this.styles=c.r`
2
+ :host {
3
+ display: none;
4
+ }
5
+ `}get qrCodeGenCanvasRef(){return this._qrCodeGenCanvasRef}dataUritoBlob(e){let t=e.split(`,`);if(t.length!==2)throw Error(`Invalid data URI format`);let n=t[0].split(`:`)[1].split(`;`)[0],r=atob(t[1]),i=new Uint8Array(Array.from(r,e=>e.charCodeAt(0)));return new Blob([i],{type:n})}generateQrCode(e={text:`www.epigraph.us`,radius:.5,ecLevel:`H`,fill:`black`,background:null,size:256}){if(!this._qrCodeGenCanvasRef)return``;u.default.render(e,this._qrCodeGenCanvasRef);let t=this._qrCodeGenCanvasRef.toDataURL(),n=this.dataUritoBlob(t);return URL.createObjectURL(n)}render(){return c.n`
6
+ <canvas id="qrCodeCanvas"></canvas>
7
+ `}};d([(0,l.query)(`#qrCodeCanvas`)],f.prototype,`_qrCodeGenCanvasRef`,void 0),window.customElements.get(f.webComponentName)===void 0&&window.customElements.define(f.webComponentName,f),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
@@ -0,0 +1 @@
1
+ var e=function(e){return e.RAW=`raw`,e.DISTANCE=`distance`,e.WEIGHT=`weight`,e}({}),t=function(e){return e.millimeter=`mm`,e.centimeter=`cm`,e.decimeter=`dm`,e.meter=`m`,e.decameter=`dam`,e.hectometer=`hm`,e.kilometer=`km`,e.inch=`in`,e.foot=`ft`,e.yard=`yd`,e.mile=`mi`,e}({}),n={};n[`${t.millimeter}-${t.meter}`]=.001,n[`${t.meter}-${t.millimeter}`]=1e3,n[`${t.centimeter}-${t.meter}`]=.01,n[`${t.meter}-${t.centimeter}`]=100,n[`${t.decimeter}-${t.meter}`]=.1,n[`${t.meter}-${t.decimeter}`]=10,n[`${t.meter}-${t.meter}`]=1,n[`${t.decameter}-${t.meter}`]=10,n[`${t.meter}-${t.decameter}`]=.1,n[`${t.hectometer}-${t.meter}`]=100,n[`${t.meter}-${t.hectometer}`]=.01,n[`${t.kilometer}-${t.meter}`]=1e3,n[`${t.meter}-${t.kilometer}`]=.001,n[`${t.inch}-${t.meter}`]=.0254,n[`${t.meter}-${t.inch}`]=39.3701,n[`${t.foot}-${t.meter}`]=.3048,n[`${t.meter}-${t.foot}`]=3.28084,n[`${t.yard}-${t.meter}`]=.9144,n[`${t.meter}-${t.yard}`]=1.09361,n[`${t.mile}-${t.meter}`]=1609.34,n[`${t.meter}-${t.mile}`]=621371e-9;var r=class r{constructor(n,i){if(this._type=e.DISTANCE,this._rawValue=n,this._rawValueUnit=i,i!==t.meter){let e=r.convert(this._rawValue,i,t.meter);this._rawValue=e.value,this._rawValueUnit=e.valueUnit}}get type(){return this._type}static buildConvertedUnitResult(e,t){return{value:e,valueUnit:t,valueWithUnit:`${e.toFixed(2)}${t}`}}static convert(e,t,i){let a=e,o=i;return t===i||(a=e*n[`${t}-${i}`]),r.buildConvertedUnitResult(a,o)}get inMillimeters(){return r.convert(this._rawValue,this._rawValueUnit,t.millimeter)}get inCentimeters(){return r.convert(this._rawValue,this._rawValueUnit,t.centimeter)}get inDecimeters(){return r.convert(this._rawValue,this._rawValueUnit,t.decimeter)}get inMeters(){return r.convert(this._rawValue,this._rawValueUnit,t.meter)}get inDecameters(){return r.convert(this._rawValue,this._rawValueUnit,t.decameter)}get inHectometers(){return r.convert(this._rawValue,this._rawValueUnit,t.hectometer)}get inKilometers(){return r.convert(this._rawValue,this._rawValueUnit,t.kilometer)}get inInches(){return r.convert(this._rawValue,this._rawValueUnit,t.inch)}get inFeet(){return r.convert(this._rawValue,this._rawValueUnit,t.foot)}get inYard(){return r.convert(this._rawValue,this._rawValueUnit,t.yard)}get inMiles(){return r.convert(this._rawValue,this._rawValueUnit,t.mile)}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
@@ -0,0 +1,66 @@
1
+ //#region lib/EpigraphLibs/EpigraphUnitsConverter/enums.ts
2
+ var e = /* @__PURE__ */ function(e) {
3
+ return e.RAW = "raw", e.DISTANCE = "distance", e.WEIGHT = "weight", e;
4
+ }({}), t = /* @__PURE__ */ function(e) {
5
+ return e.millimeter = "mm", e.centimeter = "cm", e.decimeter = "dm", e.meter = "m", e.decameter = "dam", e.hectometer = "hm", e.kilometer = "km", e.inch = "in", e.foot = "ft", e.yard = "yd", e.mile = "mi", e;
6
+ }({}), n = {};
7
+ n[`${t.millimeter}-${t.meter}`] = .001, n[`${t.meter}-${t.millimeter}`] = 1e3, n[`${t.centimeter}-${t.meter}`] = .01, n[`${t.meter}-${t.centimeter}`] = 100, n[`${t.decimeter}-${t.meter}`] = .1, n[`${t.meter}-${t.decimeter}`] = 10, n[`${t.meter}-${t.meter}`] = 1, n[`${t.decameter}-${t.meter}`] = 10, n[`${t.meter}-${t.decameter}`] = .1, n[`${t.hectometer}-${t.meter}`] = 100, n[`${t.meter}-${t.hectometer}`] = .01, n[`${t.kilometer}-${t.meter}`] = 1e3, n[`${t.meter}-${t.kilometer}`] = .001, n[`${t.inch}-${t.meter}`] = .0254, n[`${t.meter}-${t.inch}`] = 39.3701, n[`${t.foot}-${t.meter}`] = .3048, n[`${t.meter}-${t.foot}`] = 3.28084, n[`${t.yard}-${t.meter}`] = .9144, n[`${t.meter}-${t.yard}`] = 1.09361, n[`${t.mile}-${t.meter}`] = 1609.34, n[`${t.meter}-${t.mile}`] = 621371e-9;
8
+ //#endregion
9
+ //#region lib/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.ts
10
+ var r = class r {
11
+ constructor(n, i) {
12
+ if (this._type = e.DISTANCE, this._rawValue = n, this._rawValueUnit = i, i !== t.meter) {
13
+ let e = r.convert(this._rawValue, i, t.meter);
14
+ this._rawValue = e.value, this._rawValueUnit = e.valueUnit;
15
+ }
16
+ }
17
+ get type() {
18
+ return this._type;
19
+ }
20
+ static buildConvertedUnitResult(e, t) {
21
+ return {
22
+ value: e,
23
+ valueUnit: t,
24
+ valueWithUnit: `${e.toFixed(2)}${t}`
25
+ };
26
+ }
27
+ static convert(e, t, i) {
28
+ let a = e, o = i;
29
+ return t === i || (a = e * n[`${t}-${i}`]), r.buildConvertedUnitResult(a, o);
30
+ }
31
+ get inMillimeters() {
32
+ return r.convert(this._rawValue, this._rawValueUnit, t.millimeter);
33
+ }
34
+ get inCentimeters() {
35
+ return r.convert(this._rawValue, this._rawValueUnit, t.centimeter);
36
+ }
37
+ get inDecimeters() {
38
+ return r.convert(this._rawValue, this._rawValueUnit, t.decimeter);
39
+ }
40
+ get inMeters() {
41
+ return r.convert(this._rawValue, this._rawValueUnit, t.meter);
42
+ }
43
+ get inDecameters() {
44
+ return r.convert(this._rawValue, this._rawValueUnit, t.decameter);
45
+ }
46
+ get inHectometers() {
47
+ return r.convert(this._rawValue, this._rawValueUnit, t.hectometer);
48
+ }
49
+ get inKilometers() {
50
+ return r.convert(this._rawValue, this._rawValueUnit, t.kilometer);
51
+ }
52
+ get inInches() {
53
+ return r.convert(this._rawValue, this._rawValueUnit, t.inch);
54
+ }
55
+ get inFeet() {
56
+ return r.convert(this._rawValue, this._rawValueUnit, t.foot);
57
+ }
58
+ get inYard() {
59
+ return r.convert(this._rawValue, this._rawValueUnit, t.yard);
60
+ }
61
+ get inMiles() {
62
+ return r.convert(this._rawValue, this._rawValueUnit, t.mile);
63
+ }
64
+ };
65
+ //#endregion
66
+ export { t as n, e as r, r as t };