@ezeep/ezeep-js 1.0.272 → 1.0.277
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/cjs/{app-globals-D7ISNeUi.js → app-globals-L_3XPZxT.js} +7 -1
- package/dist/cjs/ezeep.cjs.js +4 -4
- package/dist/cjs/ezp-auth_15.cjs.entry.js +7240 -3678
- package/dist/cjs/{index-dv_gozsq.js → index-DM5v_sge.js} +3 -2
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ezp-auth/ezp-auth.css +1 -1
- package/dist/collection/components/ezp-auth/ezp-auth.js +56 -15
- package/dist/collection/components/ezp-backdrop/ezp-backdrop.js +5 -5
- package/dist/collection/components/ezp-dialog/ezp-dialog.js +85 -13
- package/dist/collection/components/ezp-icon/ezp-icon.js +7 -2
- package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +4 -1
- package/dist/collection/components/ezp-input/ezp-input.css +9 -12
- package/dist/collection/components/ezp-input/ezp-input.js +15 -13
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +207 -323
- package/dist/collection/components/ezp-printing/ezp-printing.css +9 -9
- package/dist/collection/components/ezp-printing/ezp-printing.js +107 -35
- package/dist/collection/components/ezp-select/ezp-select.css +2 -2
- package/dist/collection/components/ezp-select/ezp-select.js +92 -13
- package/dist/collection/components/ezp-status/ezp-status.js +23 -13
- package/dist/collection/components/ezp-stepper/ezp-stepper.js +13 -6
- package/dist/collection/components/ezp-text-button/ezp-text-button.js +1 -1
- package/dist/collection/components/ezp-upload/ezp-upload.css +9 -9
- package/dist/collection/components/ezp-upload/ezp-upload.js +26 -8
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.css +2 -1
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +15 -15
- package/dist/collection/services/auth.js +37 -36
- package/dist/collection/services/http.js +11 -0
- package/dist/collection/services/print-job.js +72 -0
- package/dist/collection/services/print.js +21 -69
- package/dist/collection/services/user.js +2 -9
- package/dist/collection/shared/constants.js +55 -0
- package/dist/collection/shared/global.js +7 -1
- package/dist/collection/shared/storage.js +71 -0
- package/dist/collection/types/shared/types.d.ts +40 -9
- package/dist/collection/utils/printer.js +68 -0
- package/dist/collection/utils/utils.js +24 -9
- package/dist/components/auth.js +1 -1
- package/dist/components/ezp-auth2.js +1 -1
- package/dist/components/ezp-backdrop2.js +1 -1
- package/dist/components/ezp-dialog2.js +1 -1
- package/dist/components/ezp-icon-button2.js +1 -1
- package/dist/components/ezp-icon2.js +1 -1
- package/dist/components/ezp-input2.js +1 -1
- package/dist/components/ezp-printer-selection2.js +1 -1
- package/dist/components/ezp-printing.js +1 -1
- package/dist/components/ezp-select2.js +1 -1
- package/dist/components/ezp-status2.js +1 -1
- package/dist/components/ezp-stepper2.js +1 -1
- package/dist/components/ezp-text-button2.js +1 -1
- package/dist/components/ezp-upload2.js +1 -1
- package/dist/components/ezp-user-menu.js +1 -1
- package/dist/components/ezp-user-menu2.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/utils.js +1 -0
- package/dist/directives/proxies.ts +65 -42
- package/dist/esm/{app-globals-CpP67t2l.js → app-globals-C0WTlb31.js} +7 -1
- package/dist/esm/ezeep.js +5 -5
- package/dist/esm/ezp-auth_15.entry.js +7240 -3678
- package/dist/esm/{index-BTfWEHH9.js → index-BButrLnB.js} +3 -3
- package/dist/esm/loader.js +4 -4
- package/dist/esm-es5/{app-globals-CpP67t2l.js → app-globals-C0WTlb31.js} +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_15.entry.js +2 -2
- package/dist/esm-es5/{index-BTfWEHH9.js → index-BButrLnB.js} +3 -3
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/ezeep.js +1 -1
- package/dist/ezeep/p-644e48a0.system.entry.js +7 -0
- package/dist/ezeep/{p-BTfWEHH9.js → p-BButrLnB.js} +2 -2
- package/dist/ezeep/{p-CpP67t2l.js → p-C0WTlb31.js} +1 -1
- package/{www/build/p-DhXN1yGM.system.js → dist/ezeep/p-CYpousxy.system.js} +2 -2
- package/dist/ezeep/{p-5ok9OZMg.system.js → p-D4aCr1OK.system.js} +1 -1
- package/dist/ezeep/{p-CfQRcOh8.system.js → p-DCznw2Ee.system.js} +1 -1
- package/dist/ezeep/p-ebd2beda.entry.js +1 -0
- package/dist/ezeep/types/shared/types.d.ts +40 -9
- package/dist/types/components/ezp-auth/ezp-auth.d.ts +8 -5
- package/dist/types/components/ezp-backdrop/ezp-backdrop.d.ts +2 -2
- package/dist/types/components/ezp-dialog/ezp-dialog.d.ts +14 -3
- package/dist/types/components/ezp-input/ezp-input.d.ts +17 -14
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +23 -7
- package/dist/types/components/ezp-printing/ezp-printing.d.ts +25 -2
- package/dist/types/components/ezp-select/ezp-select.d.ts +10 -4
- package/dist/types/components/ezp-status/ezp-status.d.ts +6 -4
- package/dist/types/components/ezp-stepper/ezp-stepper.d.ts +1 -1
- package/dist/types/components/ezp-upload/ezp-upload.d.ts +4 -1
- package/dist/types/components/ezp-user-menu/ezp-user-menu.d.ts +5 -2
- package/dist/types/components.d.ts +38 -38
- package/dist/types/services/auth.d.ts +10 -0
- package/dist/types/services/http.d.ts +4 -0
- package/dist/types/services/print-job.d.ts +48 -0
- package/dist/types/services/print.d.ts +10 -9
- package/dist/types/services/user.d.ts +13 -2
- package/dist/types/shared/constants.d.ts +51 -0
- package/dist/types/shared/storage.d.ts +24 -0
- package/dist/types/shared/types.d.ts +40 -9
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/dist/types/utils/printer.d.ts +22 -0
- package/dist/types/utils/utils.d.ts +22 -10
- package/package.json +30 -18
- package/readme.md +1 -0
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/ezeep.js +1 -1
- package/www/build/p-644e48a0.system.entry.js +7 -0
- package/www/build/{p-BTfWEHH9.js → p-BButrLnB.js} +2 -2
- package/www/build/{p-CpP67t2l.js → p-C0WTlb31.js} +1 -1
- package/{dist/ezeep/p-DhXN1yGM.system.js → www/build/p-CYpousxy.system.js} +2 -2
- package/www/build/{p-5ok9OZMg.system.js → p-D4aCr1OK.system.js} +1 -1
- package/www/build/{p-CfQRcOh8.system.js → p-DCznw2Ee.system.js} +1 -1
- package/www/build/p-c7252f1c.js +1 -0
- package/www/build/p-ebd2beda.entry.js +1 -0
- package/www/data/locales/de.json +1 -0
- package/www/data/locales/en.json +1 -0
- package/www/index.html +2 -5
- package/dist/components/i18next.js +0 -1
- package/dist/ezeep/p-2177b8f4.system.entry.js +0 -7
- package/dist/ezeep/p-de8f6583.entry.js +0 -1
- package/www/build/p-2177b8f4.system.entry.js +0 -7
- package/www/build/p-256870db.js +0 -1
- package/www/build/p-de8f6583.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,createEvent as a,h as o,Host as c,transformTag as r}from"@stencil/core/internal/client";import{a as p,E as s,s as i,i as l}from"./auth.js";import{a as n,p as d,d as z}from"./ezp-printer-selection2.js";import{u,d as g}from"./ezp-user-menu2.js";import{i as h}from"./i18next.js";import{d as b}from"./ezp-auth2.js";import{d as y}from"./ezp-backdrop2.js";import{d as m}from"./ezp-dialog2.js";import{d as f}from"./ezp-icon2.js";import{d as k}from"./ezp-icon-button2.js";import{d as w}from"./ezp-input2.js";import{d as x}from"./ezp-label2.js";import{d as v}from"./ezp-select2.js";import{d as S}from"./ezp-status2.js";import{d as E}from"./ezp-stepper2.js";import{d as A}from"./ezp-text-button2.js";import{d as U}from"./ezp-upload2.js";const j=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.printFinished=a(this,"printFinished",7),this.filename="",this.hidemenu=!1,this.hideheader=!1,this.theme="cyan",this.appearance="system",this.language="",this.seamless=!1,this.printOpen=!1,this.authOpen=!1,this.onlyGetSasUri=!1,this.noDocumentOpen=!1,this.files=[]}watchFileData(e,t){if(console.log(e),e!==t&&e.length>0){let t=new Uint8Array(e.length);for(let a=0;a<e.length;a++)t[a]=e.charCodeAt(a);this.files=[new File([t],this.filename)]}}watchFilename(e,t){e!==t&&e.length>0&&(this.filename=e)}watchFileUrl(e,t){e!==t&&e.length>0&&(this.fileurl=e)}watchLanguage(e,t){e!==t&&e.length>0&&(this.language=e)}listenPrintCancel(){this.printOpen=!1,this.files=[],this.filename="";const e=new CustomEvent("printCancel",{bubbles:!0,detail:{}});document.dispatchEvent(e),this.printFinished.emit()}listenPrintSubmit(){this.printOpen=!1,this.printFinished.emit(),this.checkAuth()}listenAuthCancel(){this.authOpen=!1,this.checkAuth()}listenUserCancel(){this.authOpen=!1,this.files=[],this.filename="";const e=new CustomEvent("printCancel",{bubbles:!0,detail:{}});document.dispatchEvent(e),this.checkAuth()}listenAuthSuccess(){this.onlyGetSasUri?(this.printOpen=!1,this.onlyGetSasUri=!1):""!=this.filename?this.printOpen=!0:this.noDocumentOpen=!0}listenUploadFile(e){this.files=e.detail,this.filename=this.files.length>0?this.files[0].name:"",this.open()}listenDialogClose(e){"no-document-selected"===e.detail&&(this.noDocumentOpen=!1)}listenDialogAction(e){"no-document-selected"===e.detail&&(this.noDocumentOpen=!1)}listenLogout(){this.logOut()}async open(){this.authOpen=!0}async logOut(){this.auth.revokeRefreshToken(),localStorage.removeItem("properties"),localStorage.removeItem("refreshToken"),localStorage.removeItem("access_token"),localStorage.removeItem("printer"),localStorage.removeItem("isAuthorized"),this.printOpen=!1}async getSasUri(){this.onlyGetSasUri=!0;const e=new n(this.redirecturi,this.clientid);let t=await e.prepareFileUpload(p.state.accessToken).catch((()=>(this.open(),null)));if(t)return t.sasUri}async getAuthUri(){return this.auth.generateCodeVerifier(),await this.auth.generateCodeChallenge(p.state.codeVerifier),this.auth.buildAuthURI(),p.state.authUri}async setAuthRefreshToken(e){p.state.refreshToken=e,localStorage.setItem("refreshToken",e),await this.auth.refreshTokens()}async checkAuth(){const e=new n(this.redirecturi,this.clientid);let t=p.state.accessToken;return""===t&&(t=localStorage.getItem("access_token"),p.state.accessToken=t),localStorage.getItem("isAuthorized")&&(p.state.isAuthorized="true"===localStorage.getItem("isAuthorized")),await e.getConfig(p.state.accessToken).then((e=>{if(e.ok&&(p.state.isAuthorized=!0),!e.ok)throw p.state.isAuthorized=!1,Error("http status "+e.status)})).catch((()=>{p.state.isAuthorized=!1})),localStorage.setItem("isAuthorized",""+p.state.isAuthorized),p.state.isAuthorized}normalizeHostUrl(e){if(!e)return e;try{if(e.startsWith("http://")||e.startsWith("https://"))return new URL(e).host}catch(t){console.warn("Failed to parse URL:",e,t)}return e}refreshTokensPeriodically(e){const t=new s(this.redirecturi,this.clientid);setInterval((()=>{t.refreshTokens()}),1e3*e)}async componentWillLoad(){const e=window.matchMedia("(prefers-color-scheme: dark)");this.systemAppearance=e.matches?"dark":"light",e.addEventListener("change",(e=>{this.systemAppearance=e.matches?"dark":"light"})),p.state.redirectUri=this.redirecturi,u.state.theme=this.theme,u.state.appearance=this.appearance,p.state.authApiHostUrl=this.authapihosturl?this.normalizeHostUrl(this.authapihosturl):"account.ezeep.com",d.state.printApiHostUrl=this.printapihosturl?this.normalizeHostUrl(this.printapihosturl):"printapi.ezeep.com",this.auth=new s(this.redirecturi,this.clientid),i(),l(this.language),this.checkAuth()}componentDidLoad(){this.refreshTokensPeriodically(1800)}render(){return o(c,{key:"d18dece1239b7557c5f80198637a828cbb4e820d",class:`${u.state.theme} ${"system"===u.state.appearance?this.systemAppearance:u.state.appearance} ${this.seamless?"seamless":""}`},"custom"===this.trigger?o("slot",null):"file"===this.trigger?o("ezp-upload",null):"button"===this.trigger&&o("ezp-icon-button",{id:"print-trigger",icon:"printer",slot:"trigger",type:"button",onClick:()=>this.open()}),this.authOpen?o("ezp-auth",{clientID:this.clientid,redirectURI:this.redirecturi,hidelogin:this.hidelogin,trigger:this.trigger,code:this.code}):this.printOpen?o("ezp-printer-selection",{clientID:this.clientid,redirectURI:this.redirecturi,filename:this.filename,fileurl:this.fileurl,filetype:this.filetype,fileid:this.fileid,files:this.files,hidemenu:this.hidemenu,hideheader:this.hideheader,seamless:this.seamless}):this.noDocumentOpen?o("ezp-dialog",{heading:h.t("no_document_dialog.heading"),description:h.t("no_document_dialog.description"),action:h.t("no_document_dialog.action"),iconName:"question-mark",instance:"no-document-selected"}):null)}static get watchers(){return{filedata:[{watchFileData:0}],filename:[{watchFilename:0}],fileurl:[{watchFileUrl:0}],language:[{watchLanguage:0}]}}static get style(){return':host{--ezp-black-5:rgba(0, 0, 0, 0.05);--ezp-black-10:rgba(0, 0, 0, 0.1);--ezp-black-20:rgba(0, 0, 0, 0.2);--ezp-black-30:rgba(0, 0, 0, 0.3);--ezp-black-40:rgba(0, 0, 0, 0.4);--ezp-black-50:rgba(0, 0, 0, 0.5);--ezp-black-60:rgba(0, 0, 0, 0.6);--ezp-black-70:rgba(0, 0, 0, 0.7);--ezp-black-80:rgba(0, 0, 0, 0.8);--ezp-black-90:rgba(0, 0, 0, 0.9);--ezp-black-95:rgba(0, 0, 0, 0.95);--ezp-black-100:rgb(0, 0, 0)}:host{--ezp-white-5:rgba(255, 255, 255, 0.05);--ezp-white-10:rgba(255, 255, 255, 0.1);--ezp-white-20:rgba(255, 255, 255, 0.2);--ezp-white-30:rgba(255, 255, 255, 0.3);--ezp-white-40:rgba(255, 255, 255, 0.4);--ezp-white-50:rgba(255, 255, 255, 0.5);--ezp-white-60:rgba(255, 255, 255, 0.6);--ezp-white-70:rgba(255, 255, 255, 0.7);--ezp-white-80:rgba(255, 255, 255, 0.8);--ezp-white-90:rgba(255, 255, 255, 0.9);--ezp-white-95:rgba(255, 255, 255, 0.95);--ezp-white-100:rgb(255, 255, 255)}:host{font-family:"Inter", sans-serif;-webkit-font-feature-settings:"calt", "liga", "ss03", "zero", "cv05", "cv10";font-feature-settings:"calt", "liga", "ss03", "zero", "cv05", "cv10";-webkit-font-kerning:normal;font-kerning:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;-webkit-tap-highlight-color:transparent;text-rendering:optimizeLegibility;-webkit-text-size-adjust:none;-webkit-box-sizing:border-box;box-sizing:border-box;--ezp-duration-1:0.1s;--ezp-duration-2:0.16s;--ezp-duration-3:0.26s;--ezp-duration-4:0.42s;--ezp-duration-5:0.68s;--ezp-duration-6:1s;--ezp-spacing-1:4px;--ezp-spacing-2:6px;--ezp-spacing-3:10px;--ezp-spacing-4:16px;--ezp-spacing-5:26px;--ezp-spacing-6:42px;--ezp-spacing-7:68px;--ezp-spacing-8:110px;--ezp-easing-in-quart:cubic-bezier(0.11, 0, 0.5, 0);--ezp-easing-in-out-quart:cubic-bezier(0.76, 0, 0.24, 1);--ezp-easing-in-out-cubic:cubic-bezier(0.65, 0, 0.35, 1);--ezp-easing-in-expo:cubic-bezier(0.7, 0, 0.84, 0);--ezp-easing-out-quart:cubic-bezier(0.25, 1, 0.5, 1);--ezp-easing-out-expo:cubic-bezier(0.16, 1, 0.3, 1)}:host([fit-parent]){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;min-height:0}:host([fit-parent]) ezp-upload{-ms-flex:1 1 auto;flex:1 1 auto;min-height:0}:host([fit-parent]) ezp-auth{-ms-flex-negative:0;flex-shrink:0}:host(.light){--ezp-accent-pink-solid:rgb(242, 50, 103);--ezp-accent-pink-solid-alt:rgb(223, 21, 89);--ezp-accent-pink-translucent:rgba(242, 50, 103, 0.16);--ezp-accent-pink-faded:rgba(242, 50, 103, 0.1);--ezp-accent-red-solid:rgb(242, 59, 34);--ezp-accent-red-solid-alt:rgb(222, 35, 19);--ezp-accent-red-translucent:rgba(242, 59, 34, 0.16);--ezp-accent-red-faded:rgba(242, 59, 34, 0.1);--ezp-accent-orange-solid:rgb(254, 114, 0);--ezp-accent-orange-solid-alt:rgb(245, 98, 0);--ezp-accent-orange-translucent:rgba(254, 114, 0, 0.16);--ezp-accent-orange-faded:rgba(254, 114, 0, 0.1);--ezp-accent-yellow-solid:rgb(255, 162, 0);--ezp-accent-yellow-solid-alt:rgb(254, 144, 0);--ezp-accent-yellow-translucent:rgba(255, 162, 0, 0.16);--ezp-accent-yellow-faded:rgba(255, 162, 0, 0.1);--ezp-accent-green-solid:rgb(93, 146, 0);--ezp-accent-green-solid-alt:rgb(81, 129, 0);--ezp-accent-green-translucent:rgba(93, 146, 0, 0.16);--ezp-accent-green-faded:rgba(93, 146, 0, 0.1);--ezp-accent-teal-solid:rgb(0, 150, 124);--ezp-accent-teal-solid-alt:rgb(0, 132, 110);--ezp-accent-teal-translucent:rgba(0, 150, 124, 0.16);--ezp-accent-teal-faded:rgba(0, 150, 124, 0.1);--ezp-accent-cyan-solid:rgb(0, 145, 180);--ezp-accent-cyan-solid-alt:rgb(0, 128, 160);--ezp-accent-cyan-translucent:rgba(0, 145, 180, 0.16);--ezp-accent-cyan-faded:rgba(0, 145, 180, 0.1);--ezp-accent-blue-solid:rgb(80, 129, 241);--ezp-accent-blue-solid-alt:rgb(59, 114, 223);--ezp-accent-blue-translucent:rgba(80, 129, 241, 0.16);--ezp-accent-blue-faded:rgba(80, 129, 241, 0.1);--ezp-accent-dark-blue-solid:rgb(0, 47, 109);--ezp-accent-dark-blue-solid-alt:rgb(0, 35, 84);--ezp-accent-dark-blue-translucent:rgba(0, 47, 109, 0.16);--ezp-accent-dark-blue-faded:rgba(0, 47, 109, 0.1);--ezp-accent-violet-solid:rgb(174, 94, 243);--ezp-accent-violet-solid-alt:rgb(157, 78, 226);--ezp-accent-violet-translucent:rgba(174, 94, 243, 0.16);--ezp-accent-violet-faded:rgba(174, 94, 243, 0.1)}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.light){--ezp-accent-pink-solid:color(display-p3 0.949 0.196 0.404 / 100%);--ezp-accent-pink-solid-alt:color(display-p3 0.875 0.082 0.349 / 100%);--ezp-accent-pink-translucent:color(display-p3 0.949 0.196 0.404 / 16%);--ezp-accent-pink-faded:color(display-p3 0.949 0.196 0.404 / 10%);--ezp-accent-red-solid:color(display-p3 0.949 0.231 0.133 / 100%);--ezp-accent-red-solid-alt:color(display-p3 0.871 0.137 0.075 / 100%);--ezp-accent-red-translucent:color(display-p3 0.949 0.231 0.133 / 16%);--ezp-accent-red-faded:color(display-p3 0.949 0.231 0.133 / 10%);--ezp-accent-orange-solid:color(display-p3 0.996 0.447 0 / 100%);--ezp-accent-orange-solid-alt:color(display-p3 0.961 0.384 0 / 100%);--ezp-accent-orange-translucent:color(display-p3 0.996 0.447 0 / 16%);--ezp-accent-orange-faded:color(display-p3 0.996 0.447 0 / 10%);--ezp-accent-yellow-solid:color(display-p3 1 0.635 0 / 100%);--ezp-accent-yellow-solid-alt:color(display-p3 0.996 0.565 0 / 100%);--ezp-accent-yellow-translucent:color(display-p3 1 0.635 0 / 16%);--ezp-accent-yellow-faded:color(display-p3 1 0.635 0 / 10%);--ezp-accent-green-solid:color(display-p3 0.365 0.573 0 / 100%);--ezp-accent-green-solid-alt:color(display-p3 0.318 0.506 0 / 100%);--ezp-accent-green-translucent:color(display-p3 0.365 0.573 0 / 16%);--ezp-accent-green-faded:color(display-p3 0.365 0.573 0 / 10%);--ezp-accent-teal-solid:color(display-p3 0 0.588 0.486 / 100%);--ezp-accent-teal-solid-alt:color(display-p3 0 0.518 0.431 / 100%);--ezp-accent-teal-translucent:color(display-p3 0 0.588 0.486 / 16%);--ezp-accent-teal-faded:color(display-p3 0 0.588 0.486 / 10%);--ezp-accent-cyan-solid:color(display-p3 0 0.569 0.706 / 100%);--ezp-accent-cyan-solid-alt:color(display-p3 0 0.502 0.627 / 100%);--ezp-accent-cyan-translucent:color(display-p3 0 0.569 0.706 / 16%);--ezp-accent-cyan-faded:color(display-p3 0 0.569 0.706 / 10%);--ezp-accent-blue-solid:color(display-p3 0.314 0.506 0.945 / 100%);--ezp-accent-blue-solid-alt:color(display-p3 0.231 0.447 0.875 / 100%);--ezp-accent-blue-translucent:color(display-p3 0.314 0.506 0.945 / 16%);--ezp-accent-blue-faded:color(display-p3 0.314 0.506 0.945 / 10%);--ezp-accent-dark-blue-solid:color(display-p3 0 0.184 0.427 / 100%);--ezp-accent-dark-blue-solid-alt:color(display-p3 0 0.137 0.329 / 100%);--ezp-accent-dark-blue-translucent:color(display-p3 0 0.184 0.427 / 16%);--ezp-accent-dark-blue-faded:color(display-p3 0 0.184 0.427 / 10%);--ezp-accent-violet-solid:color(display-p3 0.682 0.369 0.953 / 100%);--ezp-accent-violet-solid-alt:color(display-p3 0.616 0.306 0.886 / 100%);--ezp-accent-violet-translucent:color(display-p3 0.682 0.369 0.953 / 16%);--ezp-accent-violet-faded:color(display-p3 0.682 0.369 0.953 / 10%)}}}:host(.light){--ezp-core-surface-primary:rgb(255, 255, 255);--ezp-core-surface-secondary:rgb(243, 243, 243);--ezp-core-surface-secondary-alt:rgb(249, 249, 249);--ezp-core-surface-tertiary:rgb(255, 255, 255);--ezp-core-foreground-primary:rgba(0, 0, 0, 0.94);--ezp-core-foreground-secondary:rgba(62, 62, 62, 0.68);--ezp-core-foreground-tertiary:rgba(62, 62, 62, 0.42);--ezp-core-shade-primary:rgba(139, 139, 139, 0.1);--ezp-core-shade-secondary:rgba(139, 139, 139, 0.16);--ezp-core-shade-tertiary:rgba(139, 139, 139, 0.22);--ezp-core-outline:rgba(99, 99, 99, 0.16);--ezp-core-edge:rgba(0, 0, 0, 0.1);--ezp-core-backdrop:rgba(0, 0, 0, 0.26)}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.light){--ezp-core-surface-primary:color(display-p3 1 1 1 / 100%);--ezp-core-surface-secondary:color(display-p3 0.953 0.953 0.953 / 100%);--ezp-core-surface-secondary-alt:color(display-p3 0.976 0.976 0.976 / 100%);--ezp-core-surface-tertiary:color(display-p3 1 1 1 / 100%);--ezp-core-foreground-primary:color(display-p3 0 0 0 / 94%);--ezp-core-foreground-secondary:color(display-p3 0.243 0.243 0.243 / 68%);--ezp-core-foreground-tertiary:color(display-p3 0.243 0.243 0.243 / 42%);--ezp-core-shade-primary:color(display-p3 0.545 0.545 0.545 / 10%);--ezp-core-shade-secondary:color(display-p3 0.545 0.545 0.545 / 16%);--ezp-core-shade-tertiary:color(display-p3 0.545 0.545 0.545 / 22%);--ezp-core-outline:color(display-p3 0.388 0.388 0.388 / 16%);--ezp-core-edge:color(display-p3 0 0 0 / 10%);--ezp-core-backdrop:color(display-p3 0 0 0 / 26%)}}}:host(.dark){--ezp-dialog-box-boxShadow:inset 0 0 0 1px var(--ezp-core-outline), 0 0 0 1px var(--ezp-black-60);--ezp-printerSelection-body-boxShadow:inset 1px 0 0 0 var(--ezp-core-outline), inset -1px 0 0 0 var(--ezp-core-outline);--ezp-printerSelection-box-boxShadow:0 0 0 1px var(--ezp-black-60);--ezp-printerSelection-footer-boxShadowPosition:inset 0 0 0 1px;--ezp-printerSelection-header-boxShadowPosition:inset 0 0 0 1px;--ezp-select-wrap-boxShadowPositionBottom:inset 0 -1px 0 0;--ezp-select-wrap-boxShadowPositionLeft:inset 1px 0 0 0;--ezp-select-wrap-boxShadowPositionRight:inset -1px 0 0 0;--ezp-select-wrap-boxShadowPositionTop:inset 0 1px 0 0;--ezp-status-box-boxShadow:inset 0 0 0 1px var(--ezp-core-outline), 0 0 0 1px var(--ezp-black-60);--ezp-stepper-boxShadowPosition:inset 0 0 0 1px;--ezp-userMenu-boxShadow:inset 0 0 0 1px var(--ezp-core-outline), 0 0 0 1px var(--ezp-black-60);--ezp-userMenu-header-boxShadowPosition:inset 0 -1px 0 0;--ezp-userMenu-links-boxShadowPosition:inset 0 -1px 0 0;--ezp-userMenu-theme-boxShadowPosition:inset 0 -1px 0 0;--ezp-input-box-shadow-position-top:inset 0 1px 0 0;--ezp-input-box-shadow-position-right:inset -1px 0 0 0;--ezp-input-box-shadow-position-bottom:inset 0 -1px 0 0;--ezp-input-box-shadow-position-left:inset 1px 0 0 0;--ezp-accent-pink-solid:rgb(255, 65, 113);--ezp-accent-pink-translucent:rgba(255, 65, 113, 0.26);--ezp-accent-pink-faded:rgba(255, 65, 113, 0.16);--ezp-accent-red-solid:rgb(255, 72, 44);--ezp-accent-red-translucent:rgba(255, 72, 44, 0.26);--ezp-accent-red-faded:rgba(255, 72, 44, 0.16);--ezp-accent-orange-solid:rgb(255, 129, 28);--ezp-accent-orange-translucent:rgba(255, 129, 28, 0.26);--ezp-accent-orange-faded:rgba(255, 129, 28, 0.16);--ezp-accent-yellow-solid:rgb(255, 175, 58);--ezp-accent-yellow-translucent:rgba(255, 175, 58, 0.26);--ezp-accent-yellow-faded:rgba(255, 175, 58, 0.16);--ezp-accent-green-solid:rgb(103, 156, 21);--ezp-accent-green-translucent:rgba(103, 156, 21, 0.26);--ezp-accent-green-faded:rgba(103, 156, 21, 0.16);--ezp-accent-teal-solid:rgb(29, 160, 134);--ezp-accent-teal-translucent:rgba(29, 160, 134, 0.26);--ezp-accent-teal-faded:rgba(29, 160, 134, 0.16);--ezp-accent-cyan-solid:rgb(32, 155, 191);--ezp-accent-cyan-translucent:rgba(32, 155, 191, 0.26);--ezp-accent-cyan-faded:rgba(32, 155, 191, 0.16);--ezp-accent-blue-solid:rgb(93, 139, 253);--ezp-accent-blue-translucent:rgba(93, 139, 253, 0.26);--ezp-accent-blue-faded:rgba(93, 139, 253, 0.16);--ezp-accent-dark-blue-solid:rgb(20, 56, 119);--ezp-accent-dark-blue-translucent:rgba(20, 56, 119, 0.26);--ezp-accent-dark-blue-faded:rgba(20, 56, 119, 0.16);--ezp-accent-violet-solid:rgb(186, 105, 255);--ezp-accent-violet-translucent:rgba(186, 105, 255, 0.26);--ezp-accent-violet-faded:rgba(186, 105, 255, 0.16)}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.dark){--ezp-accent-pink-solid:color(display-p3 1 0.255 0.443 / 100%);--ezp-accent-pink-translucent:color(display-p3 1 0.255 0.443 / 26%);--ezp-accent-pink-faded:color(display-p3 1 0.255 0.443 / 16%);--ezp-accent-red-solid:color(display-p3 1 0.282 0.173 / 100%);--ezp-accent-red-translucent:color(display-p3 1 0.282 0.173 / 26%);--ezp-accent-red-faded:color(display-p3 1 0.282 0.173 / 16%);--ezp-accent-orange-solid:color(display-p3 1 0.506 0.11 / 100%);--ezp-accent-orange-translucent:color(display-p3 1 0.506 0.11 / 26%);--ezp-accent-orange-faded:color(display-p3 1 0.506 0.11 / 16%);--ezp-accent-yellow-solid:color(display-p3 1 0.686 0.227 / 100%);--ezp-accent-yellow-translucent:color(display-p3 1 0.686 0.227 / 26%);--ezp-accent-yellow-faded:color(display-p3 1 0.686 0.227 / 16%);--ezp-accent-green-solid:color(display-p3 0.404 0.612 0.082 / 100%);--ezp-accent-green-translucent:color(display-p3 0.404 0.612 0.082 / 26%);--ezp-accent-green-faded:color(display-p3 0.404 0.612 0.082 / 16%);--ezp-accent-teal-solid:color(display-p3 0.114 0.627 0.525 / 100%);--ezp-accent-teal-translucent:color(display-p3 0.114 0.627 0.525 / 26%);--ezp-accent-teal-faded:color(display-p3 0.114 0.627 0.525 / 16%);--ezp-accent-cyan-solid:color(display-p3 0.125 0.608 0.749 / 100%);--ezp-accent-cyan-translucent:color(display-p3 0.125 0.608 0.749 / 26%);--ezp-accent-cyan-faded:color(display-p3 0.125 0.608 0.749 / 16%);--ezp-accent-blue-solid:color(display-p3 0.365 0.545 0.992 / 100%);--ezp-accent-blue-translucent:color(display-p3 0.365 0.545 0.992 / 26%);--ezp-accent-blue-faded:color(display-p3 0.365 0.545 0.992 / 16%);--ezp-accent-dark-blue-solid:color(display-p3 0.078 0.22 0.467 / 100%);--ezp-accent-dark-blue-translucent:color(display-p3 0.078 0.22 0.467 / 26%);--ezp-accent-dark-blue-faded:color(display-p3 0.078 0.22 0.467 / 16%);--ezp-accent-violet-solid:color(display-p3 0.729 0.412 1 / 100%);--ezp-accent-violet-translucent:color(display-p3 0.729 0.412 1 / 26%);--ezp-accent-violet-faded:color(display-p3 0.729 0.412 1 / 16%)}}}:host(.dark){--ezp-core-surface-primary:rgb(0, 0, 0);--ezp-core-surface-secondary:rgb(27, 27, 27);--ezp-core-surface-secondary-alt:rgb(19, 19, 19);--ezp-core-surface-tertiary:rgb(40, 40, 40);--ezp-core-foreground-primary:rgba(255, 255, 255, 0.94);--ezp-core-foreground-secondary:rgba(182, 182, 182, 0.68);--ezp-core-foreground-tertiary:rgba(182, 182, 182, 0.42);--ezp-core-shade-primary:rgba(99, 99, 99, 0.26);--ezp-core-shade-secondary:rgba(99, 99, 99, 0.32);--ezp-core-shade-tertiary:rgba(99, 99, 99, 0.38);--ezp-core-outline:rgba(139, 139, 139, 0.26);--ezp-core-edge:rgba(255, 255, 255, 0.16);--ezp-core-backdrop:rgba(0, 0, 0, 0.68)}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.dark){--ezp-core-surface-primary:color(display-p3 0 0 0 / 100%);--ezp-core-surface-secondary:color(display-p3 0.106 0.106 0.106 / 100%);--ezp-core-surface-secondary-alt:color(display-p3 0.075 0.075 0.075 / 100%);--ezp-core-surface-tertiary:color(display-p3 0.157 0.157 0.157 / 100%);--ezp-core-foreground-primary:color(display-p3 1 1 1 / 94%);--ezp-core-foreground-secondary:color(display-p3 0.714 0.714 0.714 / 68%);--ezp-core-foreground-tertiary:color(display-p3 0.714 0.714 0.714 / 42%);--ezp-core-shade-primary:color(display-p3 0.388 0.388 0.388 / 26%);--ezp-core-shade-secondary:color(display-p3 0.388 0.388 0.388 / 32%);--ezp-core-shade-tertiary:color(display-p3 0.388 0.388 0.388 / 38%);--ezp-core-outline:color(display-p3 0.545 0.545 0.545 / 26%);--ezp-core-edge:color(display-p3 1 1 1 / 16%);--ezp-core-backdrop:color(display-p3 0 0 0 / 68%)}}}:host(.seamless){--ezp-status-border-radius:0;--ezp-backdrop-border-radius:0}:host(.blue){--ezp-theme-solid:var(--ezp-accent-blue-solid);--ezp-theme-translucent:var(--ezp-accent-blue-translucent)}:host(.cyan){--ezp-theme-solid:var(--ezp-accent-cyan-solid);--ezp-theme-translucent:var(--ezp-accent-cyan-translucent)}:host(.green){--ezp-theme-solid:var(--ezp-accent-green-solid);--ezp-theme-translucent:var(--ezp-accent-green-translucent)}:host(.teal){--ezp-theme-solid:var(--ezp-accent-teal-solid);--ezp-theme-translucent:var(--ezp-accent-teal-translucent)}:host(.orange){--ezp-theme-solid:var(--ezp-accent-orange-solid);--ezp-theme-translucent:var(--ezp-accent-orange-translucent)}:host(.pink){--ezp-theme-solid:var(--ezp-accent-pink-solid);--ezp-theme-translucent:var(--ezp-accent-pink-translucent)}:host(.red){--ezp-theme-solid:var(--ezp-accent-red-solid);--ezp-theme-translucent:var(--ezp-accent-red-translucent)}:host(.violet){--ezp-theme-solid:var(--ezp-accent-violet-solid);--ezp-theme-translucent:var(--ezp-accent-violet-translucent)}'}},[257,"ezp-printing",{clientid:[1],redirecturi:[1],filename:[1025],fileurl:[1],filetype:[1],custom:[4],hidelogin:[4],hidemenu:[4],hideheader:[4],authapihosturl:[1],printapihosturl:[1],theme:[1],fileid:[1],appearance:[1],trigger:[1],language:[1],code:[1],filedata:[1],seamless:[4],printOpen:[32],authOpen:[32],onlyGetSasUri:[32],noDocumentOpen:[32],systemAppearance:[32],files:[32],open:[64],logOut:[64],getSasUri:[64],getAuthUri:[64],setAuthRefreshToken:[64],checkAuth:[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"userCancel","listenUserCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]],{filedata:[{watchFileData:0}],filename:[{watchFilename:0}],fileurl:[{watchFileUrl:0}],language:[{watchLanguage:0}]}]),C=j,F=function(){"undefined"!=typeof customElements&&["ezp-printing","ezp-auth","ezp-backdrop","ezp-dialog","ezp-icon","ezp-icon-button","ezp-input","ezp-label","ezp-printer-selection","ezp-select","ezp-status","ezp-stepper","ezp-text-button","ezp-upload","ezp-user-menu"].forEach((e=>{switch(e){case"ezp-printing":customElements.get(r(e))||customElements.define(r(e),j);break;case"ezp-auth":customElements.get(r(e))||b();break;case"ezp-backdrop":customElements.get(r(e))||y();break;case"ezp-dialog":customElements.get(r(e))||m();break;case"ezp-icon":customElements.get(r(e))||f();break;case"ezp-icon-button":customElements.get(r(e))||k();break;case"ezp-input":customElements.get(r(e))||w();break;case"ezp-label":customElements.get(r(e))||x();break;case"ezp-printer-selection":customElements.get(r(e))||z();break;case"ezp-select":customElements.get(r(e))||v();break;case"ezp-status":customElements.get(r(e))||S();break;case"ezp-stepper":customElements.get(r(e))||E();break;case"ezp-text-button":customElements.get(r(e))||A();break;case"ezp-upload":customElements.get(r(e))||U();break;case"ezp-user-menu":customElements.get(r(e))||g()}}))};export{C as EzpPrinting,F as defineCustomElement}
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,createEvent as a,h as c,Host as o,transformTag as r}from"@stencil/core/internal/client";import{s,a as i,E as p,b as n}from"./auth.js";import{a as l,p as d,d as z}from"./ezp-printer-selection2.js";import{u,E as h,d as g}from"./ezp-user-menu2.js";import{i as b,s as y,a as m,T as f}from"./utils.js";import{d as k}from"./ezp-auth2.js";import{d as w}from"./ezp-backdrop2.js";import{d as x}from"./ezp-dialog2.js";import{d as v}from"./ezp-icon2.js";import{d as S}from"./ezp-icon-button2.js";import{d as E}from"./ezp-input2.js";import{d as C}from"./ezp-label2.js";import{d as j}from"./ezp-select2.js";import{d as P}from"./ezp-status2.js";import{d as U}from"./ezp-stepper2.js";import{d as A}from"./ezp-text-button2.js";import{d as F}from"./ezp-upload2.js";const D=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.printFinished=a(this,"printFinished",7),this.filename="",this.hidemenu=!1,this.hideheader=!1,this.theme="cyan",this.appearance="system",this.language="",this.seamless=!1,this.printOpen=!1,this.authOpen=!1,this.onlyGetSasUri=!1,this.noDocumentOpen=!1,this.files=[]}watchFileData(e,t){if(e!==t&&e.length>0){const t=new Uint8Array(e.length);for(let a=0;a<e.length;a++)t[a]=e.charCodeAt(a);this.files=[new File([t],this.filename)]}}watchFilename(e,t){e!==t&&e.length>0&&(this.filename=e)}watchFileUrl(e,t){e!==t&&e.length>0&&(this.fileurl=e)}watchLanguage(e,t){e!==t&&e.length>0&&(this.language=e,b.changeLanguage(e))}listenPrintCancel(){this.printOpen=!1,this.files=[],this.filename="";const e=new CustomEvent("printCancel",{bubbles:!0,detail:{}});document.dispatchEvent(e),this.printFinished.emit()}listenPrintSubmit(){this.printOpen=!1,this.printFinished.emit(),this.checkAuth()}listenAuthCancel(){this.authOpen=!1,this.checkAuth()}listenUserCancel(){this.authOpen=!1,this.files=[],this.filename="";const e=new CustomEvent("printCancel",{bubbles:!0,detail:{}});document.dispatchEvent(e),this.checkAuth()}async listenAuthSuccess(){await this.syncPreferredLanguage(),this.onlyGetSasUri?(this.printOpen=!1,this.onlyGetSasUri=!1):""!=this.filename?this.printOpen=!0:this.noDocumentOpen=!0}listenUploadFile(e){this.files=e.detail,this.filename=this.files.length>0?this.files[0].name:"",this.open()}listenDialogClose(e){"no-document-selected"===e.detail&&(this.noDocumentOpen=!1)}listenDialogAction(e){"no-document-selected"===e.detail&&(this.noDocumentOpen=!1)}listenLogout(){this.logOut()}async open(){this.authOpen=!0}async logOut(){this.auth.revokeRefreshToken(),s.clearSession(),this.printOpen=!1}ensureAccessToken(){return""===i.state.accessToken&&""!==i.state.refreshToken&&this.auth?(this.refreshInFlight||(this.refreshInFlight=this.auth.refreshTokens().catch((()=>{})).finally((()=>{this.refreshInFlight=void 0}))),this.refreshInFlight):Promise.resolve()}async getSasUri(){this.onlyGetSasUri=!0,await this.ensureAccessToken();const e=new l(this.redirecturi,this.clientid),t=await e.prepareFileUpload(i.state.accessToken).catch((()=>(this.open(),null)));return t?t.sasUri:void 0}async getAuthUri(){return this.auth.generateCodeVerifier(),await this.auth.generateCodeChallenge(i.state.codeVerifier),this.auth.buildAuthURI(),i.state.authUri}async setAuthRefreshToken(e){i.state.refreshToken=e,s.setRefreshToken(e),await this.auth.refreshTokens()}async checkAuth(){const e=new l(this.redirecturi,this.clientid);return await this.ensureAccessToken(),s.hasIsAuthorized()&&(i.state.isAuthorized=s.getIsAuthorized()),await e.getConfig(i.state.accessToken).then((e=>{if(e.ok&&(i.state.isAuthorized=!0),!e.ok)throw i.state.isAuthorized=!1,Error("http status "+e.status)})).catch((()=>{i.state.isAuthorized=!1})),s.setIsAuthorized(i.state.isAuthorized),i.state.isAuthorized}normalizeHostUrl(e){if(!e)return e;try{if(e.startsWith("http://")||e.startsWith("https://"))return new URL(e).host}catch(e){}return e}refreshTokensPeriodically(e){const t=new p(this.redirecturi,this.clientid);this.tokenRefreshInterval=setInterval((()=>{t.refreshTokens()}),1e3*e)}connectedCallback(){this.unsubscribeLanguage=y(this)}async componentWillLoad(){const e=window.matchMedia("(prefers-color-scheme: dark)");this.systemAppearance=e.matches?"dark":"light",this.systemAppearanceQuery=e,this.systemAppearanceListener=e=>{this.systemAppearance=e.matches?"dark":"light"},e.addEventListener("change",this.systemAppearanceListener),i.state.redirectUri=this.redirecturi,u.state.theme=this.theme,u.state.appearance=this.appearance,i.state.authApiHostUrl=this.authapihosturl?this.normalizeHostUrl(this.authapihosturl):"account.ezeep.com",d.state.printApiHostUrl=this.printapihosturl?this.normalizeHostUrl(this.printapihosturl):"printapi.ezeep.com",this.auth=new p(this.redirecturi,this.clientid),n(),m(this.language),this.checkAuth().then((()=>this.syncPreferredLanguage()))}async syncPreferredLanguage(){if(!this.language&&i.state.accessToken)try{const e=await(new h).getUserInfo(),t=null==e?void 0:e.preferred_language;t&&t!==b.language&&await b.changeLanguage(t)}catch(e){}}componentDidLoad(){this.refreshTokensPeriodically(f)}disconnectedCallback(){var e;this.tokenRefreshInterval&&clearInterval(this.tokenRefreshInterval),this.systemAppearanceQuery&&this.systemAppearanceListener&&this.systemAppearanceQuery.removeEventListener("change",this.systemAppearanceListener),null===(e=this.unsubscribeLanguage)||void 0===e||e.call(this)}render(){return c(o,{key:"be2b1eab0c9aeb2b026f94c66c760d4c1e3d946a",class:`${u.state.theme} ${"system"===u.state.appearance?this.systemAppearance:u.state.appearance} ${this.seamless?"seamless":""}`},"custom"===this.trigger?c("slot",null):"file"===this.trigger?c("ezp-upload",null):"button"===this.trigger&&c("ezp-icon-button",{id:"print-trigger",icon:"printer",slot:"trigger",type:"button",onClick:()=>this.open()}),this.authOpen?c("ezp-auth",{clientID:this.clientid,redirectURI:this.redirecturi,hidelogin:this.hidelogin,trigger:this.trigger,code:this.code}):this.printOpen?c("ezp-printer-selection",{clientID:this.clientid,redirectURI:this.redirecturi,filename:this.filename,fileurl:this.fileurl,filetype:this.filetype,fileid:this.fileid,files:this.files,hidemenu:this.hidemenu,hideheader:this.hideheader,seamless:this.seamless}):this.noDocumentOpen?c("ezp-dialog",{heading:b.t("no_document_dialog.heading"),description:b.t("no_document_dialog.description"),action:b.t("no_document_dialog.action"),iconName:"question-mark",instance:"no-document-selected"}):null)}static get watchers(){return{filedata:[{watchFileData:0}],filename:[{watchFilename:0}],fileurl:[{watchFileUrl:0}],language:[{watchLanguage:0}]}}static get style(){return':host{--ezp-black-5:rgba(0, 0, 0, 0.05);--ezp-black-10:rgba(0, 0, 0, 0.1);--ezp-black-20:rgba(0, 0, 0, 0.2);--ezp-black-30:rgba(0, 0, 0, 0.3);--ezp-black-40:rgba(0, 0, 0, 0.4);--ezp-black-50:rgba(0, 0, 0, 0.5);--ezp-black-60:rgba(0, 0, 0, 0.6);--ezp-black-70:rgba(0, 0, 0, 0.7);--ezp-black-80:rgba(0, 0, 0, 0.8);--ezp-black-90:rgba(0, 0, 0, 0.9);--ezp-black-95:rgba(0, 0, 0, 0.95);--ezp-black-100:rgb(0, 0, 0)}:host{--ezp-white-5:rgba(255, 255, 255, 0.05);--ezp-white-10:rgba(255, 255, 255, 0.1);--ezp-white-20:rgba(255, 255, 255, 0.2);--ezp-white-30:rgba(255, 255, 255, 0.3);--ezp-white-40:rgba(255, 255, 255, 0.4);--ezp-white-50:rgba(255, 255, 255, 0.5);--ezp-white-60:rgba(255, 255, 255, 0.6);--ezp-white-70:rgba(255, 255, 255, 0.7);--ezp-white-80:rgba(255, 255, 255, 0.8);--ezp-white-90:rgba(255, 255, 255, 0.9);--ezp-white-95:rgba(255, 255, 255, 0.95);--ezp-white-100:rgb(255, 255, 255)}:host{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", sans-serif;-webkit-font-feature-settings:"calt", "liga", "ss03", "zero", "cv05", "cv10";font-feature-settings:"calt", "liga", "ss03", "zero", "cv05", "cv10";-webkit-font-kerning:normal;font-kerning:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;-webkit-tap-highlight-color:transparent;text-rendering:optimizeLegibility;-webkit-text-size-adjust:none;--ezp-duration-1:0.1s;--ezp-duration-2:0.16s;--ezp-duration-3:0.26s;--ezp-duration-4:0.42s;--ezp-duration-5:0.68s;--ezp-duration-6:1s;--ezp-spacing-1:4px;--ezp-spacing-2:6px;--ezp-spacing-3:10px;--ezp-spacing-4:16px;--ezp-spacing-5:26px;--ezp-spacing-6:42px;--ezp-spacing-7:68px;--ezp-spacing-8:110px;--ezp-easing-in-quart:cubic-bezier(0.11, 0, 0.5, 0);--ezp-easing-in-out-quart:cubic-bezier(0.76, 0, 0.24, 1);--ezp-easing-in-out-cubic:cubic-bezier(0.65, 0, 0.35, 1);--ezp-easing-in-expo:cubic-bezier(0.7, 0, 0.84, 0);--ezp-easing-out-quart:cubic-bezier(0.25, 1, 0.5, 1);--ezp-easing-out-expo:cubic-bezier(0.16, 1, 0.3, 1)}:host([fit-parent]){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;min-height:0}:host([fit-parent]) ezp-upload{-ms-flex:1 1 auto;flex:1 1 auto;min-height:0}:host([fit-parent]) ezp-auth{-ms-flex-negative:0;flex-shrink:0}:host(.light){--ezp-accent-pink-solid:rgb(242, 50, 103);--ezp-accent-pink-solid-alt:rgb(223, 21, 89);--ezp-accent-pink-translucent:rgba(242, 50, 103, 0.16);--ezp-accent-pink-faded:rgba(242, 50, 103, 0.1);--ezp-accent-red-solid:rgb(242, 59, 34);--ezp-accent-red-solid-alt:rgb(222, 35, 19);--ezp-accent-red-translucent:rgba(242, 59, 34, 0.16);--ezp-accent-red-faded:rgba(242, 59, 34, 0.1);--ezp-accent-orange-solid:rgb(254, 114, 0);--ezp-accent-orange-solid-alt:rgb(245, 98, 0);--ezp-accent-orange-translucent:rgba(254, 114, 0, 0.16);--ezp-accent-orange-faded:rgba(254, 114, 0, 0.1);--ezp-accent-yellow-solid:rgb(255, 162, 0);--ezp-accent-yellow-solid-alt:rgb(254, 144, 0);--ezp-accent-yellow-translucent:rgba(255, 162, 0, 0.16);--ezp-accent-yellow-faded:rgba(255, 162, 0, 0.1);--ezp-accent-green-solid:rgb(93, 146, 0);--ezp-accent-green-solid-alt:rgb(81, 129, 0);--ezp-accent-green-translucent:rgba(93, 146, 0, 0.16);--ezp-accent-green-faded:rgba(93, 146, 0, 0.1);--ezp-accent-teal-solid:rgb(0, 150, 124);--ezp-accent-teal-solid-alt:rgb(0, 132, 110);--ezp-accent-teal-translucent:rgba(0, 150, 124, 0.16);--ezp-accent-teal-faded:rgba(0, 150, 124, 0.1);--ezp-accent-cyan-solid:rgb(0, 145, 180);--ezp-accent-cyan-solid-alt:rgb(0, 128, 160);--ezp-accent-cyan-translucent:rgba(0, 145, 180, 0.16);--ezp-accent-cyan-faded:rgba(0, 145, 180, 0.1);--ezp-accent-blue-solid:rgb(80, 129, 241);--ezp-accent-blue-solid-alt:rgb(59, 114, 223);--ezp-accent-blue-translucent:rgba(80, 129, 241, 0.16);--ezp-accent-blue-faded:rgba(80, 129, 241, 0.1);--ezp-accent-dark-blue-solid:rgb(0, 47, 109);--ezp-accent-dark-blue-solid-alt:rgb(0, 35, 84);--ezp-accent-dark-blue-translucent:rgba(0, 47, 109, 0.16);--ezp-accent-dark-blue-faded:rgba(0, 47, 109, 0.1);--ezp-accent-violet-solid:rgb(174, 94, 243);--ezp-accent-violet-solid-alt:rgb(157, 78, 226);--ezp-accent-violet-translucent:rgba(174, 94, 243, 0.16);--ezp-accent-violet-faded:rgba(174, 94, 243, 0.1)}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.light){--ezp-accent-pink-solid:color(display-p3 0.949 0.196 0.404 / 100%);--ezp-accent-pink-solid-alt:color(display-p3 0.875 0.082 0.349 / 100%);--ezp-accent-pink-translucent:color(display-p3 0.949 0.196 0.404 / 16%);--ezp-accent-pink-faded:color(display-p3 0.949 0.196 0.404 / 10%);--ezp-accent-red-solid:color(display-p3 0.949 0.231 0.133 / 100%);--ezp-accent-red-solid-alt:color(display-p3 0.871 0.137 0.075 / 100%);--ezp-accent-red-translucent:color(display-p3 0.949 0.231 0.133 / 16%);--ezp-accent-red-faded:color(display-p3 0.949 0.231 0.133 / 10%);--ezp-accent-orange-solid:color(display-p3 0.996 0.447 0 / 100%);--ezp-accent-orange-solid-alt:color(display-p3 0.961 0.384 0 / 100%);--ezp-accent-orange-translucent:color(display-p3 0.996 0.447 0 / 16%);--ezp-accent-orange-faded:color(display-p3 0.996 0.447 0 / 10%);--ezp-accent-yellow-solid:color(display-p3 1 0.635 0 / 100%);--ezp-accent-yellow-solid-alt:color(display-p3 0.996 0.565 0 / 100%);--ezp-accent-yellow-translucent:color(display-p3 1 0.635 0 / 16%);--ezp-accent-yellow-faded:color(display-p3 1 0.635 0 / 10%);--ezp-accent-green-solid:color(display-p3 0.365 0.573 0 / 100%);--ezp-accent-green-solid-alt:color(display-p3 0.318 0.506 0 / 100%);--ezp-accent-green-translucent:color(display-p3 0.365 0.573 0 / 16%);--ezp-accent-green-faded:color(display-p3 0.365 0.573 0 / 10%);--ezp-accent-teal-solid:color(display-p3 0 0.588 0.486 / 100%);--ezp-accent-teal-solid-alt:color(display-p3 0 0.518 0.431 / 100%);--ezp-accent-teal-translucent:color(display-p3 0 0.588 0.486 / 16%);--ezp-accent-teal-faded:color(display-p3 0 0.588 0.486 / 10%);--ezp-accent-cyan-solid:color(display-p3 0 0.569 0.706 / 100%);--ezp-accent-cyan-solid-alt:color(display-p3 0 0.502 0.627 / 100%);--ezp-accent-cyan-translucent:color(display-p3 0 0.569 0.706 / 16%);--ezp-accent-cyan-faded:color(display-p3 0 0.569 0.706 / 10%);--ezp-accent-blue-solid:color(display-p3 0.314 0.506 0.945 / 100%);--ezp-accent-blue-solid-alt:color(display-p3 0.231 0.447 0.875 / 100%);--ezp-accent-blue-translucent:color(display-p3 0.314 0.506 0.945 / 16%);--ezp-accent-blue-faded:color(display-p3 0.314 0.506 0.945 / 10%);--ezp-accent-dark-blue-solid:color(display-p3 0 0.184 0.427 / 100%);--ezp-accent-dark-blue-solid-alt:color(display-p3 0 0.137 0.329 / 100%);--ezp-accent-dark-blue-translucent:color(display-p3 0 0.184 0.427 / 16%);--ezp-accent-dark-blue-faded:color(display-p3 0 0.184 0.427 / 10%);--ezp-accent-violet-solid:color(display-p3 0.682 0.369 0.953 / 100%);--ezp-accent-violet-solid-alt:color(display-p3 0.616 0.306 0.886 / 100%);--ezp-accent-violet-translucent:color(display-p3 0.682 0.369 0.953 / 16%);--ezp-accent-violet-faded:color(display-p3 0.682 0.369 0.953 / 10%)}}}:host(.light){--ezp-core-surface-primary:rgb(255, 255, 255);--ezp-core-surface-secondary:rgb(243, 243, 243);--ezp-core-surface-secondary-alt:rgb(249, 249, 249);--ezp-core-surface-tertiary:rgb(255, 255, 255);--ezp-core-foreground-primary:rgba(0, 0, 0, 0.94);--ezp-core-foreground-secondary:rgba(62, 62, 62, 0.68);--ezp-core-foreground-tertiary:rgba(62, 62, 62, 0.42);--ezp-core-shade-primary:rgba(139, 139, 139, 0.1);--ezp-core-shade-secondary:rgba(139, 139, 139, 0.16);--ezp-core-shade-tertiary:rgba(139, 139, 139, 0.22);--ezp-core-outline:rgba(99, 99, 99, 0.16);--ezp-core-edge:rgba(0, 0, 0, 0.1);--ezp-core-backdrop:rgba(0, 0, 0, 0.26)}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.light){--ezp-core-surface-primary:color(display-p3 1 1 1 / 100%);--ezp-core-surface-secondary:color(display-p3 0.953 0.953 0.953 / 100%);--ezp-core-surface-secondary-alt:color(display-p3 0.976 0.976 0.976 / 100%);--ezp-core-surface-tertiary:color(display-p3 1 1 1 / 100%);--ezp-core-foreground-primary:color(display-p3 0 0 0 / 94%);--ezp-core-foreground-secondary:color(display-p3 0.243 0.243 0.243 / 68%);--ezp-core-foreground-tertiary:color(display-p3 0.243 0.243 0.243 / 42%);--ezp-core-shade-primary:color(display-p3 0.545 0.545 0.545 / 10%);--ezp-core-shade-secondary:color(display-p3 0.545 0.545 0.545 / 16%);--ezp-core-shade-tertiary:color(display-p3 0.545 0.545 0.545 / 22%);--ezp-core-outline:color(display-p3 0.388 0.388 0.388 / 16%);--ezp-core-edge:color(display-p3 0 0 0 / 10%);--ezp-core-backdrop:color(display-p3 0 0 0 / 26%)}}}:host(.dark){--ezp-dialog-box-boxShadow:inset 0 0 0 1px var(--ezp-core-outline), 0 0 0 1px var(--ezp-black-60);--ezp-printerSelection-body-boxShadow:inset 1px 0 0 0 var(--ezp-core-outline), inset -1px 0 0 0 var(--ezp-core-outline);--ezp-printerSelection-box-boxShadow:0 0 0 1px var(--ezp-black-60);--ezp-printerSelection-footer-boxShadowPosition:inset 0 0 0 1px;--ezp-printerSelection-header-boxShadowPosition:inset 0 0 0 1px;--ezp-select-wrap-boxShadowPositionBottom:inset 0 -1px 0 0;--ezp-select-wrap-boxShadowPositionLeft:inset 1px 0 0 0;--ezp-select-wrap-boxShadowPositionRight:inset -1px 0 0 0;--ezp-select-wrap-boxShadowPositionTop:inset 0 1px 0 0;--ezp-status-box-boxShadow:inset 0 0 0 1px var(--ezp-core-outline), 0 0 0 1px var(--ezp-black-60);--ezp-stepper-boxShadowPosition:inset 0 0 0 1px;--ezp-userMenu-boxShadow:inset 0 0 0 1px var(--ezp-core-outline), 0 0 0 1px var(--ezp-black-60);--ezp-userMenu-header-boxShadowPosition:inset 0 -1px 0 0;--ezp-userMenu-links-boxShadowPosition:inset 0 -1px 0 0;--ezp-userMenu-theme-boxShadowPosition:inset 0 -1px 0 0;--ezp-input-box-shadow-position-top:inset 0 1px 0 0;--ezp-input-box-shadow-position-right:inset -1px 0 0 0;--ezp-input-box-shadow-position-bottom:inset 0 -1px 0 0;--ezp-input-box-shadow-position-left:inset 1px 0 0 0;--ezp-accent-pink-solid:rgb(255, 65, 113);--ezp-accent-pink-translucent:rgba(255, 65, 113, 0.26);--ezp-accent-pink-faded:rgba(255, 65, 113, 0.16);--ezp-accent-red-solid:rgb(255, 72, 44);--ezp-accent-red-translucent:rgba(255, 72, 44, 0.26);--ezp-accent-red-faded:rgba(255, 72, 44, 0.16);--ezp-accent-orange-solid:rgb(255, 129, 28);--ezp-accent-orange-translucent:rgba(255, 129, 28, 0.26);--ezp-accent-orange-faded:rgba(255, 129, 28, 0.16);--ezp-accent-yellow-solid:rgb(255, 175, 58);--ezp-accent-yellow-translucent:rgba(255, 175, 58, 0.26);--ezp-accent-yellow-faded:rgba(255, 175, 58, 0.16);--ezp-accent-green-solid:rgb(103, 156, 21);--ezp-accent-green-translucent:rgba(103, 156, 21, 0.26);--ezp-accent-green-faded:rgba(103, 156, 21, 0.16);--ezp-accent-teal-solid:rgb(29, 160, 134);--ezp-accent-teal-translucent:rgba(29, 160, 134, 0.26);--ezp-accent-teal-faded:rgba(29, 160, 134, 0.16);--ezp-accent-cyan-solid:rgb(32, 155, 191);--ezp-accent-cyan-translucent:rgba(32, 155, 191, 0.26);--ezp-accent-cyan-faded:rgba(32, 155, 191, 0.16);--ezp-accent-blue-solid:rgb(93, 139, 253);--ezp-accent-blue-translucent:rgba(93, 139, 253, 0.26);--ezp-accent-blue-faded:rgba(93, 139, 253, 0.16);--ezp-accent-dark-blue-solid:rgb(20, 56, 119);--ezp-accent-dark-blue-translucent:rgba(20, 56, 119, 0.26);--ezp-accent-dark-blue-faded:rgba(20, 56, 119, 0.16);--ezp-accent-violet-solid:rgb(186, 105, 255);--ezp-accent-violet-translucent:rgba(186, 105, 255, 0.26);--ezp-accent-violet-faded:rgba(186, 105, 255, 0.16)}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.dark){--ezp-accent-pink-solid:color(display-p3 1 0.255 0.443 / 100%);--ezp-accent-pink-translucent:color(display-p3 1 0.255 0.443 / 26%);--ezp-accent-pink-faded:color(display-p3 1 0.255 0.443 / 16%);--ezp-accent-red-solid:color(display-p3 1 0.282 0.173 / 100%);--ezp-accent-red-translucent:color(display-p3 1 0.282 0.173 / 26%);--ezp-accent-red-faded:color(display-p3 1 0.282 0.173 / 16%);--ezp-accent-orange-solid:color(display-p3 1 0.506 0.11 / 100%);--ezp-accent-orange-translucent:color(display-p3 1 0.506 0.11 / 26%);--ezp-accent-orange-faded:color(display-p3 1 0.506 0.11 / 16%);--ezp-accent-yellow-solid:color(display-p3 1 0.686 0.227 / 100%);--ezp-accent-yellow-translucent:color(display-p3 1 0.686 0.227 / 26%);--ezp-accent-yellow-faded:color(display-p3 1 0.686 0.227 / 16%);--ezp-accent-green-solid:color(display-p3 0.404 0.612 0.082 / 100%);--ezp-accent-green-translucent:color(display-p3 0.404 0.612 0.082 / 26%);--ezp-accent-green-faded:color(display-p3 0.404 0.612 0.082 / 16%);--ezp-accent-teal-solid:color(display-p3 0.114 0.627 0.525 / 100%);--ezp-accent-teal-translucent:color(display-p3 0.114 0.627 0.525 / 26%);--ezp-accent-teal-faded:color(display-p3 0.114 0.627 0.525 / 16%);--ezp-accent-cyan-solid:color(display-p3 0.125 0.608 0.749 / 100%);--ezp-accent-cyan-translucent:color(display-p3 0.125 0.608 0.749 / 26%);--ezp-accent-cyan-faded:color(display-p3 0.125 0.608 0.749 / 16%);--ezp-accent-blue-solid:color(display-p3 0.365 0.545 0.992 / 100%);--ezp-accent-blue-translucent:color(display-p3 0.365 0.545 0.992 / 26%);--ezp-accent-blue-faded:color(display-p3 0.365 0.545 0.992 / 16%);--ezp-accent-dark-blue-solid:color(display-p3 0.078 0.22 0.467 / 100%);--ezp-accent-dark-blue-translucent:color(display-p3 0.078 0.22 0.467 / 26%);--ezp-accent-dark-blue-faded:color(display-p3 0.078 0.22 0.467 / 16%);--ezp-accent-violet-solid:color(display-p3 0.729 0.412 1 / 100%);--ezp-accent-violet-translucent:color(display-p3 0.729 0.412 1 / 26%);--ezp-accent-violet-faded:color(display-p3 0.729 0.412 1 / 16%)}}}:host(.dark){--ezp-core-surface-primary:rgb(0, 0, 0);--ezp-core-surface-secondary:rgb(27, 27, 27);--ezp-core-surface-secondary-alt:rgb(19, 19, 19);--ezp-core-surface-tertiary:rgb(40, 40, 40);--ezp-core-foreground-primary:rgba(255, 255, 255, 0.94);--ezp-core-foreground-secondary:rgba(182, 182, 182, 0.68);--ezp-core-foreground-tertiary:rgba(182, 182, 182, 0.42);--ezp-core-shade-primary:rgba(99, 99, 99, 0.26);--ezp-core-shade-secondary:rgba(99, 99, 99, 0.32);--ezp-core-shade-tertiary:rgba(99, 99, 99, 0.38);--ezp-core-outline:rgba(139, 139, 139, 0.26);--ezp-core-edge:rgba(255, 255, 255, 0.16);--ezp-core-backdrop:rgba(0, 0, 0, 0.68)}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.dark){--ezp-core-surface-primary:color(display-p3 0 0 0 / 100%);--ezp-core-surface-secondary:color(display-p3 0.106 0.106 0.106 / 100%);--ezp-core-surface-secondary-alt:color(display-p3 0.075 0.075 0.075 / 100%);--ezp-core-surface-tertiary:color(display-p3 0.157 0.157 0.157 / 100%);--ezp-core-foreground-primary:color(display-p3 1 1 1 / 94%);--ezp-core-foreground-secondary:color(display-p3 0.714 0.714 0.714 / 68%);--ezp-core-foreground-tertiary:color(display-p3 0.714 0.714 0.714 / 42%);--ezp-core-shade-primary:color(display-p3 0.388 0.388 0.388 / 26%);--ezp-core-shade-secondary:color(display-p3 0.388 0.388 0.388 / 32%);--ezp-core-shade-tertiary:color(display-p3 0.388 0.388 0.388 / 38%);--ezp-core-outline:color(display-p3 0.545 0.545 0.545 / 26%);--ezp-core-edge:color(display-p3 1 1 1 / 16%);--ezp-core-backdrop:color(display-p3 0 0 0 / 68%)}}}:host(.seamless){--ezp-status-border-radius:0;--ezp-backdrop-border-radius:0}:host(.blue){--ezp-theme-solid:var(--ezp-accent-blue-solid);--ezp-theme-translucent:var(--ezp-accent-blue-translucent)}:host(.cyan){--ezp-theme-solid:var(--ezp-accent-cyan-solid);--ezp-theme-translucent:var(--ezp-accent-cyan-translucent)}:host(.green){--ezp-theme-solid:var(--ezp-accent-green-solid);--ezp-theme-translucent:var(--ezp-accent-green-translucent)}:host(.teal){--ezp-theme-solid:var(--ezp-accent-teal-solid);--ezp-theme-translucent:var(--ezp-accent-teal-translucent)}:host(.orange){--ezp-theme-solid:var(--ezp-accent-orange-solid);--ezp-theme-translucent:var(--ezp-accent-orange-translucent)}:host(.pink){--ezp-theme-solid:var(--ezp-accent-pink-solid);--ezp-theme-translucent:var(--ezp-accent-pink-translucent)}:host(.red){--ezp-theme-solid:var(--ezp-accent-red-solid);--ezp-theme-translucent:var(--ezp-accent-red-translucent)}:host(.violet){--ezp-theme-solid:var(--ezp-accent-violet-solid);--ezp-theme-translucent:var(--ezp-accent-violet-translucent)}'}},[257,"ezp-printing",{clientid:[1],redirecturi:[1],filename:[1025],fileurl:[1],filetype:[1],custom:[4],hidelogin:[4],hidemenu:[4],hideheader:[4],authapihosturl:[1],printapihosturl:[1],theme:[1],fileid:[1],appearance:[1],trigger:[1],language:[1],code:[1],filedata:[1],seamless:[4],printOpen:[32],authOpen:[32],onlyGetSasUri:[32],noDocumentOpen:[32],systemAppearance:[32],files:[32],open:[64],logOut:[64],getSasUri:[64],getAuthUri:[64],setAuthRefreshToken:[64],checkAuth:[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"userCancel","listenUserCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]],{filedata:[{watchFileData:0}],filename:[{watchFilename:0}],fileurl:[{watchFileUrl:0}],language:[{watchLanguage:0}]}]),L=D,I=function(){"undefined"!=typeof customElements&&["ezp-printing","ezp-auth","ezp-backdrop","ezp-dialog","ezp-icon","ezp-icon-button","ezp-input","ezp-label","ezp-printer-selection","ezp-select","ezp-status","ezp-stepper","ezp-text-button","ezp-upload","ezp-user-menu"].forEach((e=>{switch(e){case"ezp-printing":customElements.get(r(e))||customElements.define(r(e),D);break;case"ezp-auth":customElements.get(r(e))||k();break;case"ezp-backdrop":customElements.get(r(e))||w();break;case"ezp-dialog":customElements.get(r(e))||x();break;case"ezp-icon":customElements.get(r(e))||v();break;case"ezp-icon-button":customElements.get(r(e))||S();break;case"ezp-input":customElements.get(r(e))||E();break;case"ezp-label":customElements.get(r(e))||C();break;case"ezp-printer-selection":customElements.get(r(e))||z();break;case"ezp-select":customElements.get(r(e))||j();break;case"ezp-status":customElements.get(r(e))||P();break;case"ezp-stepper":customElements.get(r(e))||U();break;case"ezp-text-button":customElements.get(r(e))||A();break;case"ezp-upload":customElements.get(r(e))||F();break;case"ezp-user-menu":customElements.get(r(e))||g()}}))};export{L as EzpPrinting,I as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,createEvent as a,h as i,Host as s,transformTag as r}from"@stencil/core/internal/client";import{d as o}from"./ezp-backdrop2.js";import{d as l}from"./ezp-icon2.js";import{d as p}from"./ezp-label2.js";const c=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.selectToggle=a(this,"selectToggle",7),this.selectSelection=a(this,"selectSelection",7),this.backdrop=document.createElement("ezp-backdrop"),this.containerHeight=0,this.expandCover=!1,this.expandRise=!1,this.listHeight=0,this.spacing=6,this.toggleHeight=0,this.wrapDiff=0,this.wrapHeight=0,this.wrapTop=0,this.duration=0,this.label="Label",this.placeholder="Placeholder",this.toggleFlow="horizontal",this.disabled=!1,this.expanded=!1,this.selected={id:!1,title:"",meta:""},this.toggle=()=>{this.containerHeight=this.container.clientHeight-2*this.spacing,this.listHeight=this.list.scrollHeight,this.wrapTop=this.component.offsetTop,this.wrapHeight=this.toggleHeight+this.listHeight,this.expandCover=this.wrapHeight>this.containerHeight,this.expandRise=this.wrapHeight>this.containerHeight-this.wrapTop,this.wrapDiff=this.containerHeight-this.wrapHeight-this.wrapTop,this.expanded=!this.expanded,this.selectToggle.emit(this.expanded)},this.select=e=>{var t;const a=(null===(t=this.selected)||void 0===t?void 0:t.id)===e?0:1e3*this.duration;this.selected=this.options.find((t=>t.id===e)),this.selectSelection.emit(this.selected),window.setTimeout((()=>{this.toggle()}),a)},this.preSelect=()=>{var e;this.selected=null===(e=this.options)||void 0===e?void 0:e.find((e=>"number"==typeof this.preSelected?e.id===this.preSelected:"string"==typeof this.preSelected?e.title===this.preSelected:null))}}watchExpanded(){this.expandCover?(this.component.style.setProperty("--ezp-select-list-height",this.expanded?this.containerHeight-this.toggleHeight+"px":"0px"),this.component.style.setProperty("--ezp-select-wrap-translateY",this.expanded?`${-1*this.wrapTop+this.spacing}px`:"0px")):this.expandRise?(this.component.style.setProperty("--ezp-select-list-height",this.expanded?`${this.listHeight}px`:"0px"),this.component.style.setProperty("--ezp-select-wrap-translateY",this.expanded?`${this.wrapDiff+this.spacing}px`:"0px")):this.component.style.setProperty("--ezp-select-list-height",this.expanded?`${this.listHeight}px`:"0px"),this.expanded?(this.backdrop.visible=!0,this.container.appendChild(this.backdrop)):this.backdrop.visible=!1}preSelectedChanged(){this.preSelect()}componentWillLoad(){this.container=this.component.closest("[data-backdrop-surface]"),this.backdrop.addEventListener("backdropHideStart",(()=>{this.expanded=!1})),this.backdrop.addEventListener("backdropHideEnd",(()=>{this.container.removeChild(this.backdrop)})),void 0!==this.preSelected&&""!==this.preSelected&&null!==this.preSelected&&this.preSelect()}componentDidLoad(){const e=getComputedStyle(this.component);this.toggleHeight=parseInt(e.getPropertyValue("--ezp-select-toggle-height")),this.duration=parseFloat(e.getPropertyValue("--ezp-select-duration"))}componentWillUpdate(){var e;!1===(null===(e=this.selected)||void 0===e?void 0:e.id)&&void 0!==this.preSelected&&""!==this.preSelected&&null!==this.preSelected&&this.preSelect()}render(){var e,t,a;const r="horizontal"===this.toggleFlow?"secondary":"tertiary";return i(s,{key:"83c7b61b1b9362a970ba6813a1bb5e906ee56141",class:[this.expanded?"is-expanded":"",this.icon?"has-icon":"",`toggle-${this.toggleFlow}`,this.optionFlow?`option-${this.optionFlow}`:"",this.disabled?"disabled":""].join(" ")},i("div",{key:"df54f1cd115d4d7ca46c6d4719909747769a0b33",id:"wrap"},i("div",{key:"a5beb6bdb7918ee120f7e09b70a9e0cbcd15b309",id:"toggle",onClick:()=>!this.disabled&&this.toggle()},this.icon?i("ezp-icon",{id:"icon",name:this.icon}):null,i("ezp-label",{key:"25e7315afd533ae3aeb6455aa95cfe9acb4f8448",id:"label",noWrap:!0,level:r,text:this.label}),i("ezp-label",{key:"ed4c2a0eb21930de52b1a1b5462d2e6fb78f4c0a",id:"value",ellipsis:!0,text:""!==(null===(e=this.selected)||void 0===e?void 0:e.title)?null===(t=this.selected)||void 0===t?void 0:t.title:this.placeholder}),i("ezp-icon",{key:"46dacc59d23f3f8fb52181e6d23ac75ba4fd0ada",id:"accessory",name:"expand"})),i("div",{key:"0ca5ee65dc954ee6893e8f55b3529001654bb467",id:"list",ref:e=>this.list=e},null===(a=this.options)||void 0===a?void 0:a.map((e=>{var t;if(""!==e.title)return i("div",{class:`option ${e.id===(null===(t=this.selected)||void 0===t?void 0:t.id)?"is-selected":""} ${""!==e.meta?"has-meta":""} `,onClick:()=>this.select(e.id)},i("ezp-icon",{name:"checkmark",class:"indicator"}),i("div",{class:"details"},i("ezp-label",{class:"title",ellipsis:!0,text:e.title}),""!==e.meta?i("ezp-label",{level:"tertiary",class:"meta",text:e.meta,ellipsis:!0}):null))})))))}get component(){return this}static get watchers(){return{expanded:[{watchExpanded:0}],preSelected:[{preSelectedChanged:0}]}}static get style(){return":host{--ezp-select-duration:var(--ezp-duration-3);display:block;height:var(--ezp-select-toggle-height);position:relative;-webkit-transition:var(--ezp-select-transition, z-index 0s var(--ezp-select-duration));transition:var(--ezp-select-transition, z-index 0s var(--ezp-select-duration));z-index:var(--ezp-select-zIndex, 3)}:host(:first-child){--ezp-select-wrap-borderRadius:3px 3px 0 0}:host(:last-child){--ezp-select-wrap-borderRadius:0 0 3px 3px}:host(:first-child:last-child){--ezp-select-wrap-borderRadius:3px}:host(:not(:last-child):not(.is-expanded)){--ezp-select-wrap-boxShadowPositionBottom:0 0 0 0}:host(.toggle-horizontal){--ezp-select-label-alignSelf:start;--ezp-select-toggle-gridTemplateAreas:'label value accessory';--ezp-select-toggle-gridTemplateColumns:1fr repeat(2, auto);--ezp-select-toggle-height:30px;--ezp-select-toggle-gridTemplateRows:auto;--ezp-select-value-alignSelf:end}:host(.toggle-horizontal.has-icon){--ezp-select-toggle-gridTemplateAreas:'icon label value accessory';--ezp-select-toggle-gridTemplateColumns:auto 1fr repeat(2, auto)}:host(.toggle-vertical){--ezp-select-label-alignSelf:center;--ezp-select-toggle-gridTemplateAreas:'label accessory' 'value accessory';--ezp-select-toggle-gridTemplateColumns:1fr auto;--ezp-select-toggle-height:48px;--ezp-select-toggle-gridTemplateRows:repeat(2, auto);--ezp-select-value-alignSelf:center}:host(.toggle-vertical.has-icon){--ezp-select-toggle-gridTemplateAreas:'icon label accessory' 'icon value accessory';--ezp-select-toggle-gridTemplateColumns:auto 1fr auto}:host(.option-horizontal){--ezp-select-details-gridTemplateColumns:repeat(2, 1fr);--ezp-select-details-gridTemplateRows:auto;--ezp-select-option-height:30px}:host(.option-vertical){--ezp-select-details-gridTemplateColumns:1fr;--ezp-select-details-gridTemplateRows:repeat(2, auto);--ezp-select-option-height:48px}:host(.is-expanded){--ezp-select-accessory-color:var(--ezp-theme-solid);--ezp-select-transition:z-index 0s 0s;--ezp-select-zIndex:9999;--ezp-select-icon-color:var(--ezp-theme-solid);--ezp-select-label-color:var(--ezp-theme-solid);--ezp-select-wrap-borderRadius:3px}:host(.disabled){--ezp-select-accessory-color:var(--ezp-core-foreground-tertiary);--ezp-select-icon-color:var(--ezp-core-foreground-tertiary);--ezp-select-label-color:var(--ezp-core-foreground-tertiary);--ezp-select-toggle-background-hover:transparent;--ezp-select-toggle-cursor:default;--value-color:var(--ezp-core-foreground-tertiary)}#wrap{background:var(--ezp-core-surface-tertiary);border-radius:var(--ezp-select-wrap-borderRadius, 0);-webkit-box-shadow:var(--ezp-select-wrap-boxShadowPositionTop, 0 -1px 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionRight, 1px 0 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionBottom, 0 1px 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionLeft, -1px 0 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-select-wrap-boxShadowPositionTop, 0 -1px 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionRight, 1px 0 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionBottom, 0 1px 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionLeft, -1px 0 0 0) var(--ezp-core-outline);-webkit-transform:translateY(var(--ezp-select-wrap-translateY, 0));transform:translateY(var(--ezp-select-wrap-translateY, 0));-webkit-transition:border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-transform var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-transform var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:transform var(--ezp-select-duration) var(--ezp-easing-out-quart), border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:transform var(--ezp-select-duration) var(--ezp-easing-out-quart), border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-transform var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart)}#toggle{background:var(--ezp-select-toggle-background, transparent);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:var(--ezp-select-toggle-cursor, pointer);display:grid;gap:var(--ezp-spacing-2) var(--ezp-spacing-3);grid-template-areas:var(--ezp-select-toggle-gridTemplateAreas, none);grid-template-columns:var(--ezp-select-toggle-gridTemplateColumns, none);grid-template-rows:var(--ezp-select-toggle-gridTemplateRows, auto);height:var(--ezp-select-toggle-height, auto);padding:var(--ezp-spacing-3)}#toggle:hover{--ezp-select-toggle-background:var( --ezp-select-toggle-background-hover, var(--ezp-core-shade-primary) )}#icon{align-self:center;color:var(--ezp-select-icon-color, var(--ezp-core-foreground-secondary));grid-area:icon;margin:calc(var(--ezp-spacing-2) * -1) 0}#label{align-self:var(--ezp-select-label-alignSelf, auto);color:var(--ezp-select-label-color, var(--ezp-core-foreground-secondary));grid-area:label}#value{align-self:var(--ezp-select-value-alignSelf, auto);color:var(--value-color, var(--ezp-core-foreground-primary));grid-area:value}#accessory{align-self:center;color:var(--ezp-select-accessory-color, var(--ezp-core-foreground-secondary));grid-area:accessory;margin:calc(var(--ezp-spacing-2) * -1) 0}#list{-webkit-box-shadow:inset 0 1px 0 0 var(--ezp-core-outline);box-shadow:inset 0 1px 0 0 var(--ezp-core-outline);height:var(--ezp-select-list-height, 0);overflow:auto;-webkit-transition:height var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:height var(--ezp-select-duration) var(--ezp-easing-out-quart)}.option{background:var(--ezp-select-option-background);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:grid;gap:var(--ezp-spacing-3);grid-template:auto/auto 1fr;height:var(--ezp-select-option-height, auto);padding:0 0 0 var(--ezp-spacing-3)}.option:not(:last-child){--ezp-select-details-boxShadow:inset 0 -1px 0 0 var(--ezp-core-outline)}.option:hover{--ezp-select-option-background:var(--ezp-core-shade-primary)}.option:active{--ezp-select-option-background:var(--ezp-core-shade-secondary)}.option.is-selected{--ezp-select-indicator-opacity:1;--ezp-select-indicator-transform:translateX(0);--ezp-select-indicator-transition:opacity var(--ezp-select-duration) var(--ezp-easing-out-quart), transform var(--ezp-select-duration) var(--ezp-easing-out-quart), visibility 0s 0s;--ezp-select-indicator-visibility:visible}.indicator{-ms-flex-item-align:center;align-self:center;color:var(--ezp-theme-solid);margin:calc(var(--ezp-spacing-2) * -1) 0;opacity:var(--ezp-select-indicator-opacity, 0);-webkit-transform:var(--ezp-select-indicator-transform, translateX(var(--ezp-spacing-3)));transform:var(--ezp-select-indicator-transform, translateX(var(--ezp-spacing-3)));-webkit-transition:var(--ezp-select-indicator-transition, opacity var(--ezp-select-duration) var(--ezp-easing-out-quart), transform var(--ezp-select-duration) var(--ezp-easing-out-quart), visibility 0s var(--ezp-select-duration));transition:var(--ezp-select-indicator-transition, opacity var(--ezp-select-duration) var(--ezp-easing-out-quart), transform var(--ezp-select-duration) var(--ezp-easing-out-quart), visibility 0s var(--ezp-select-duration));visibility:var(--ezp-select-indicator-visibility, hidden)}.details{-webkit-box-shadow:var(--ezp-select-details-boxShadow);box-shadow:var(--ezp-select-details-boxShadow);display:grid;gap:var(--ezp-spacing-2);grid-template-columns:var(--ezp-select-details-gridTemplateColumns, 1fr);grid-template-rows:var(--ezp-select-details-gridTemplateRows, auto);padding:var(--ezp-spacing-3) var(--ezp-spacing-3) var(--ezp-spacing-3) 0}.title{-ms-flex-item-align:start;align-self:start;color:var(--ezp-core-foreground-primary)}.meta{-ms-flex-item-align:end;align-self:end;color:var(--ezp-core-foreground-secondary)}"}},[1,"ezp-select",{icon:[1],label:[1],optionFlow:[1,"option-flow"],options:[16],placeholder:[1],preSelected:[8,"pre-selected"],toggleFlow:[1,"toggle-flow"],disabled:[4],expanded:[32],selected:[32]},void 0,{expanded:[{watchExpanded:0}],preSelected:[{preSelectedChanged:0}]}]);function n(){"undefined"!=typeof customElements&&["ezp-select","ezp-backdrop","ezp-icon","ezp-label"].forEach((e=>{switch(e){case"ezp-select":customElements.get(r(e))||customElements.define(r(e),c);break;case"ezp-backdrop":customElements.get(r(e))||o();break;case"ezp-icon":customElements.get(r(e))||l();break;case"ezp-label":customElements.get(r(e))||p()}}))}export{c as E,n as d}
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,createEvent as a,h as i,Host as s,transformTag as r}from"@stencil/core/internal/client";import{d as o}from"./ezp-backdrop2.js";import{d as l}from"./ezp-icon2.js";import{d as p}from"./ezp-label2.js";const n={id:!1,title:"",meta:""},c=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.selectToggle=a(this,"selectToggle",7),this.selectSelection=a(this,"selectSelection",7),this.backdrop=document.createElement("ezp-backdrop"),this.containerHeight=0,this.expandCover=!1,this.expandRise=!1,this.listHeight=0,this.spacing=6,this.toggleHeight=0,this.wrapDiff=0,this.wrapHeight=0,this.wrapTop=0,this.duration=0,this.label="Label",this.placeholder="Placeholder",this.toggleFlow="horizontal",this.disabled=!1,this.expanded=!1,this.selected=n,this.toggle=()=>{this.containerHeight=this.container.clientHeight-2*this.spacing,this.listHeight=this.list.scrollHeight,this.wrapTop=this.component.offsetTop,this.wrapHeight=this.toggleHeight+this.listHeight,this.expandCover=this.wrapHeight>this.containerHeight,this.expandRise=this.wrapHeight>this.containerHeight-this.wrapTop,this.wrapDiff=this.containerHeight-this.wrapHeight-this.wrapTop,this.expanded=!this.expanded,this.selectToggle.emit(this.expanded)},this.select=e=>{var t;const a=(null===(t=this.selected)||void 0===t?void 0:t.id)===e?0:1e3*this.duration;this.selected=this.options.find((t=>t.id===e)),this.selectSelection.emit(this.selected),window.setTimeout((()=>{this.toggle()}),a)},this.preSelect=()=>{var e;const t=null===(e=this.options)||void 0===e?void 0:e.find((e=>"number"==typeof this.preSelected?e.id===this.preSelected:"string"==typeof this.preSelected?e.title===this.preSelected:null));this.selected=null!=t?t:n},this.handleToggleKeydown=e=>{this.disabled||("Enter"===e.key||" "===e.key||"ArrowDown"===e.key?(e.preventDefault(),this.expanded||(this.toggle(),window.setTimeout((()=>this.focusOption(0)),0))):"Escape"===e.key&&this.expanded&&this.toggle())},this.handleOptionKeydown=(e,t)=>{var a;const i=this.getOptionElements(),s=i.indexOf(e.currentTarget);switch(e.key){case"Enter":case" ":e.preventDefault(),this.select(t);break;case"ArrowDown":e.preventDefault(),this.focusOption(s+1);break;case"ArrowUp":e.preventDefault(),this.focusOption(s-1);break;case"Home":e.preventDefault(),this.focusOption(0);break;case"End":e.preventDefault(),this.focusOption(i.length-1);break;case"Escape":this.expanded&&(this.toggle(),null===(a=this.toggleEl)||void 0===a||a.focus())}}}watchExpanded(){this.expandCover?(this.component.style.setProperty("--ezp-select-list-height",this.expanded?this.containerHeight-this.toggleHeight+"px":"0px"),this.component.style.setProperty("--ezp-select-wrap-translateY",this.expanded?`${-1*this.wrapTop+this.spacing}px`:"0px")):this.expandRise?(this.component.style.setProperty("--ezp-select-list-height",this.expanded?`${this.listHeight}px`:"0px"),this.component.style.setProperty("--ezp-select-wrap-translateY",this.expanded?`${this.wrapDiff+this.spacing}px`:"0px")):this.component.style.setProperty("--ezp-select-list-height",this.expanded?`${this.listHeight}px`:"0px"),this.expanded?(this.backdrop.visible=!0,this.container.appendChild(this.backdrop)):this.backdrop.visible=!1}preSelectedChanged(){this.preSelect()}getOptionElements(){return this.list?Array.from(this.list.querySelectorAll('[role="option"]')):[]}focusOption(e){const t=this.getOptionElements(),a=t[Math.max(0,Math.min(e,t.length-1))];null==a||a.focus()}componentWillLoad(){this.container=this.component.closest("[data-backdrop-surface]"),this.backdrop.addEventListener("backdropHideStart",(()=>{this.expanded=!1})),this.backdrop.addEventListener("backdropHideEnd",(()=>{this.container.removeChild(this.backdrop)})),void 0!==this.preSelected&&""!==this.preSelected&&null!==this.preSelected&&this.preSelect()}componentDidLoad(){const e=getComputedStyle(this.component);this.toggleHeight=parseInt(e.getPropertyValue("--ezp-select-toggle-height")),this.duration=parseFloat(e.getPropertyValue("--ezp-select-duration"))}componentWillUpdate(){var e;!1===(null===(e=this.selected)||void 0===e?void 0:e.id)&&void 0!==this.preSelected&&""!==this.preSelected&&null!==this.preSelected&&this.preSelect()}render(){var e,t,a;const r="horizontal"===this.toggleFlow?"secondary":"tertiary";return i(s,{key:"feebc96701d65827e984b1d75d9ef96974ae6df3",class:[this.expanded?"is-expanded":"",this.icon?"has-icon":"",`toggle-${this.toggleFlow}`,this.optionFlow?`option-${this.optionFlow}`:"",this.disabled?"disabled":""].join(" ")},i("div",{key:"ef9d6ac76f626f74d0dfc0cff7e1747afae0df1b",id:"wrap"},i("div",{key:"3a18e8c059d93be76f72b0244133b7dbddba5d0d",id:"toggle",role:"combobox","aria-haspopup":"listbox","aria-controls":"list","aria-expanded":this.expanded?"true":"false","aria-label":this.label,"aria-disabled":this.disabled?"true":"false",tabindex:this.disabled?-1:0,ref:e=>this.toggleEl=e,onClick:()=>!this.disabled&&this.toggle(),onKeyDown:this.handleToggleKeydown},this.icon?i("ezp-icon",{id:"icon",name:this.icon}):null,i("ezp-label",{key:"fda5f7c7f33343634df401890b1c580369273568",id:"label",noWrap:!0,level:r,text:this.label}),i("ezp-label",{key:"2cad104bb14338efaf165c7edff5a7226b9f8a8c",id:"value",ellipsis:!0,text:""!==(null===(e=this.selected)||void 0===e?void 0:e.title)?null===(t=this.selected)||void 0===t?void 0:t.title:this.placeholder}),i("ezp-icon",{key:"e4e3a59e2ee36ee9d07232ca03e540b4e7dad6ba",id:"accessory",name:"expand"})),i("div",{key:"3f3c5bc0202985d4f64ba9df828c877df1240f6f",id:"list",role:"listbox","aria-label":this.label,ref:e=>this.list=e},null===(a=this.options)||void 0===a?void 0:a.map((e=>{var t,a;if(""!==e.title)return i("div",{class:`option ${e.id===(null===(t=this.selected)||void 0===t?void 0:t.id)?"is-selected":""} ${""!==e.meta?"has-meta":""} `,role:"option","aria-selected":e.id===(null===(a=this.selected)||void 0===a?void 0:a.id)?"true":"false",tabindex:this.expanded?0:-1,onClick:()=>this.select(e.id),onKeyDown:t=>this.handleOptionKeydown(t,e.id)},i("ezp-icon",{name:"checkmark",class:"indicator"}),i("div",{class:"details"},i("ezp-label",{class:"title",ellipsis:!0,text:e.title}),""!==e.meta?i("ezp-label",{level:"tertiary",class:"meta",text:e.meta,ellipsis:!0}):null))})))))}get component(){return this}static get watchers(){return{expanded:[{watchExpanded:0}],preSelected:[{preSelectedChanged:0}]}}static get style(){return":host{--ezp-select-duration:var(--ezp-duration-3);display:block;height:var(--ezp-select-toggle-height);position:relative;-webkit-transition:var(--ezp-select-transition, z-index 0s var(--ezp-select-duration));transition:var(--ezp-select-transition, z-index 0s var(--ezp-select-duration));z-index:var(--ezp-select-zIndex, 3)}:host(:first-child){--ezp-select-wrap-borderRadius:3px 3px 0 0}:host(:last-child){--ezp-select-wrap-borderRadius:0 0 3px 3px}:host(:first-child:last-child){--ezp-select-wrap-borderRadius:3px}:host(:not(:last-child):not(.is-expanded)){--ezp-select-wrap-boxShadowPositionBottom:0 0 0 0}:host(.toggle-horizontal){--ezp-select-label-alignSelf:start;--ezp-select-toggle-gridTemplateAreas:'label value accessory';--ezp-select-toggle-gridTemplateColumns:1fr repeat(2, auto);--ezp-select-toggle-height:30px;--ezp-select-toggle-gridTemplateRows:auto;--ezp-select-value-alignSelf:end}:host(.toggle-horizontal.has-icon){--ezp-select-toggle-gridTemplateAreas:'icon label value accessory';--ezp-select-toggle-gridTemplateColumns:auto 1fr repeat(2, auto)}:host(.toggle-vertical){--ezp-select-label-alignSelf:center;--ezp-select-toggle-gridTemplateAreas:'label accessory' 'value accessory';--ezp-select-toggle-gridTemplateColumns:1fr auto;--ezp-select-toggle-height:48px;--ezp-select-toggle-gridTemplateRows:repeat(2, auto);--ezp-select-value-alignSelf:center}:host(.toggle-vertical.has-icon){--ezp-select-toggle-gridTemplateAreas:'icon label accessory' 'icon value accessory';--ezp-select-toggle-gridTemplateColumns:auto 1fr auto}:host(.option-horizontal){--ezp-select-details-gridTemplateColumns:repeat(2, 1fr);--ezp-select-details-gridTemplateRows:auto;--ezp-select-option-height:30px}:host(.option-vertical){--ezp-select-details-gridTemplateColumns:1fr;--ezp-select-details-gridTemplateRows:repeat(2, auto);--ezp-select-option-height:48px}:host(.is-expanded){--ezp-select-accessory-color:var(--ezp-theme-solid);--ezp-select-transition:z-index 0s 0s;--ezp-select-zIndex:9999;--ezp-select-icon-color:var(--ezp-theme-solid);--ezp-select-label-color:var(--ezp-theme-solid);--ezp-select-wrap-borderRadius:3px}:host(.disabled){--ezp-select-accessory-color:var(--ezp-core-foreground-tertiary);--ezp-select-icon-color:var(--ezp-core-foreground-tertiary);--ezp-select-label-color:var(--ezp-core-foreground-tertiary);--ezp-select-toggle-background-hover:transparent;--ezp-select-toggle-cursor:default;--value-color:var(--ezp-core-foreground-tertiary)}#wrap{background:var(--ezp-core-surface-tertiary);border-radius:var(--ezp-select-wrap-borderRadius, 0);-webkit-box-shadow:var(--ezp-select-wrap-boxShadowPositionTop, 0 -1px 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionRight, 1px 0 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionBottom, 0 1px 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionLeft, -1px 0 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-select-wrap-boxShadowPositionTop, 0 -1px 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionRight, 1px 0 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionBottom, 0 1px 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionLeft, -1px 0 0 0) var(--ezp-core-outline);-webkit-transform:translateY(var(--ezp-select-wrap-translateY, 0));transform:translateY(var(--ezp-select-wrap-translateY, 0));-webkit-transition:border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-transform var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-transform var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:transform var(--ezp-select-duration) var(--ezp-easing-out-quart), border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:transform var(--ezp-select-duration) var(--ezp-easing-out-quart), border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-transform var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart)}#toggle{background:var(--ezp-select-toggle-background, transparent);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:var(--ezp-select-toggle-cursor, pointer);display:grid;gap:var(--ezp-spacing-2) var(--ezp-spacing-3);grid-template-areas:var(--ezp-select-toggle-gridTemplateAreas, none);grid-template-columns:var(--ezp-select-toggle-gridTemplateColumns, none);grid-template-rows:var(--ezp-select-toggle-gridTemplateRows, auto);height:var(--ezp-select-toggle-height, auto);padding:var(--ezp-spacing-3)}#toggle:hover{--ezp-select-toggle-background:var( --ezp-select-toggle-background-hover, var(--ezp-core-shade-primary) )}#icon{align-self:center;color:var(--ezp-select-icon-color, var(--ezp-core-foreground-secondary));grid-area:icon;margin:calc(var(--ezp-spacing-2) * -1) 0}#label{align-self:var(--ezp-select-label-alignSelf, auto);color:var(--ezp-select-label-color, var(--ezp-core-foreground-secondary));grid-area:label}#value{align-self:var(--ezp-select-value-alignSelf, auto);color:var(--value-color, var(--ezp-core-foreground-primary));grid-area:value}#accessory{align-self:center;color:var(--ezp-select-accessory-color, var(--ezp-core-foreground-secondary));grid-area:accessory;margin:calc(var(--ezp-spacing-2) * -1) 0}#list{-webkit-box-shadow:inset 0 1px 0 0 var(--ezp-core-outline);box-shadow:inset 0 1px 0 0 var(--ezp-core-outline);height:var(--ezp-select-list-height, 0);overflow:auto;-webkit-transition:height var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:height var(--ezp-select-duration) var(--ezp-easing-out-quart)}.option{background:var(--ezp-select-option-background);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:grid;gap:var(--ezp-spacing-3);grid-template:auto/auto 1fr;height:var(--ezp-select-option-height, auto);padding:0 0 0 var(--ezp-spacing-3)}.option:not(:last-child){--ezp-select-details-boxShadow:inset 0 -1px 0 0 var(--ezp-core-outline)}.option:hover{--ezp-select-option-background:var(--ezp-core-shade-primary)}.option:active{--ezp-select-option-background:var(--ezp-core-shade-secondary)}.option.is-selected{--ezp-select-indicator-opacity:1;--ezp-select-indicator-transform:translateX(0);--ezp-select-indicator-transition:opacity var(--ezp-select-duration) var(--ezp-easing-out-quart), transform var(--ezp-select-duration) var(--ezp-easing-out-quart), visibility 0s 0s;--ezp-select-indicator-visibility:visible}.indicator{-ms-flex-item-align:center;align-self:center;color:var(--ezp-theme-solid);margin:calc(var(--ezp-spacing-2) * -1) 0;opacity:var(--ezp-select-indicator-opacity, 0);-webkit-transform:var(--ezp-select-indicator-transform, translateX(var(--ezp-spacing-3)));transform:var(--ezp-select-indicator-transform, translateX(var(--ezp-spacing-3)));-webkit-transition:var(--ezp-select-indicator-transition, opacity var(--ezp-select-duration) var(--ezp-easing-out-quart), transform var(--ezp-select-duration) var(--ezp-easing-out-quart), visibility 0s var(--ezp-select-duration));transition:var(--ezp-select-indicator-transition, opacity var(--ezp-select-duration) var(--ezp-easing-out-quart), transform var(--ezp-select-duration) var(--ezp-easing-out-quart), visibility 0s var(--ezp-select-duration));visibility:var(--ezp-select-indicator-visibility, hidden)}.details{-webkit-box-shadow:var(--ezp-select-details-boxShadow);box-shadow:var(--ezp-select-details-boxShadow);display:grid;gap:var(--ezp-spacing-2);grid-template-columns:var(--ezp-select-details-gridTemplateColumns, 1fr);grid-template-rows:var(--ezp-select-details-gridTemplateRows, auto);padding:var(--ezp-spacing-3) var(--ezp-spacing-3) var(--ezp-spacing-3) 0}.title{-ms-flex-item-align:start;align-self:start;color:var(--ezp-core-foreground-primary)}.meta{-ms-flex-item-align:end;align-self:end;color:var(--ezp-core-foreground-secondary)}"}},[1,"ezp-select",{icon:[1],label:[1],optionFlow:[1,"option-flow"],options:[16],placeholder:[1],preSelected:[8,"pre-selected"],toggleFlow:[1,"toggle-flow"],disabled:[4],expanded:[32],selected:[32]},void 0,{expanded:[{watchExpanded:0}],preSelected:[{preSelectedChanged:0}]}]);function d(){"undefined"!=typeof customElements&&["ezp-select","ezp-backdrop","ezp-icon","ezp-label"].forEach((e=>{switch(e){case"ezp-select":customElements.get(r(e))||customElements.define(r(e),c);break;case"ezp-backdrop":customElements.get(r(e))||o();break;case"ezp-icon":customElements.get(r(e))||l();break;case"ezp-label":customElements.get(r(e))||p()}}))}export{c as E,d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as s,Host as a,transformTag as r}from"@stencil/core/internal/client";import{i as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as s,Host as a,transformTag as r}from"@stencil/core/internal/client";import{s as o,i as n}from"./utils.js";import{d as c}from"./ezp-icon2.js";import{d as l}from"./ezp-label2.js";import{d}from"./ezp-text-button2.js";const p=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.statusCancel=i(this,"statusCancel",7),this.statusClose=i(this,"statusClose",7),this.statusRetry=i(this,"statusRetry",7),this.description="Description",this.processing=!1,this.handleCancel=()=>{this.statusCancel.emit(this.instance)},this.handleClose=()=>{this.statusClose.emit(this.instance)},this.handleRetry=()=>{this.statusRetry.emit(this.instance)}}connectedCallback(){this.unsubscribeLanguage=o(this)}disconnectedCallback(){var e;null===(e=this.unsubscribeLanguage)||void 0===e||e.call(this)}render(){return s(a,{key:"b5c9846f02fb4d1ecfb4e858979771707f43da7b",role:"status","aria-live":"polite"},s("div",{key:"565dc8d7c33de18e84b9e2fc08509fa930f25b6b",id:"box"},this.processing?s("svg",{id:"indicator",viewBox:"0 0 42 42",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},s("circle",{id:"track",cx:"21",cy:"21",r:"18"}),s("circle",{id:"value",cx:"21",cy:"21",r:"18"})):this.icon?s("ezp-icon",{name:this.icon,framed:!0}):null,s("ezp-label",{key:"2e0a465a7ab43caf42ddbe0bcf8939411334fe75",id:"description",level:"tertiary",weight:"strong",text:this.description}),(this.cancel||this.close||this.retry)&&s("div",{key:"47c159c24325fc2b8617dfeb70a322e3fb21d1c2",id:"footer"},this.cancel&&s("ezp-text-button",{key:"50cadac96eede3676ff7b223e2974f4f621246a3",level:"secondary",small:!0,onClick:this.handleCancel,label:"string"==typeof this.cancel?this.cancel:n.t("button_actions.cancel")}),this.close&&s("ezp-text-button",{key:"36efc776e9c90117fd3c99544cdd3fc2e170466c",level:this.retry?"secondary":"primary",small:!0,onClick:this.handleClose,label:"string"==typeof this.close?this.close:n.t("button_actions.close")}),this.retry&&s("ezp-text-button",{key:"04c60353ca77b16772edb67a38ef5cdf06e4f407",level:"primary",small:!0,onClick:this.handleRetry,label:"string"==typeof this.retry?this.retry:n.t("button_actions.retry")}))))}static get style(){return":host{-ms-flex-align:center;align-items:center;background:var(--ezp-core-backdrop);border-radius:var(--ezp-status-border-radius, 6px);-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;height:100%;-ms-flex-pack:center;justify-content:center;left:0;padding:var(--ezp-spacing-6);position:absolute;top:0;width:100%;z-index:9999}@media (prefers-color-scheme: dark){:host{--box-separator-position:inset 0 0 0 var(--hairline-width-positive)}}#box{--ezp-icon-fill:var(--ezp-theme-solid);-ms-flex-align:center;align-items:center;background:var(--ezp-core-surface-tertiary);border-radius:3px;-webkit-box-shadow:var(--ezp-status-box-boxShadow, 0 0 0 1px var(--ezp-black-10));box-shadow:var(--ezp-status-box-boxShadow, 0 0 0 1px var(--ezp-black-10));display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-4);padding:var(--ezp-spacing-4) var(--ezp-spacing-5)}#indicator{-webkit-animation:rotate var(--ezp-duration-6) linear infinite;animation:rotate var(--ezp-duration-6) linear infinite;display:block;height:42px;-webkit-transform:rotate(0);transform:rotate(0);width:42px}#track{fill:none;stroke:var(--ezp-core-outline);stroke-width:4px}#value{-webkit-animation:offset var(--ezp-duration-6) linear alternate infinite;animation:offset var(--ezp-duration-6) linear alternate infinite;fill:none;stroke:var(--ezp-theme-solid);stroke-dasharray:110;stroke-dashoffset:110;stroke-linecap:round;stroke-width:4px}#description{color:var(--ezp-core-foreground-primary)}#footer{display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-2)}@-webkit-keyframes offset{100%{stroke-dashoffset:55}}@keyframes offset{100%{stroke-dashoffset:55}}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}"}},[1,"ezp-status",{description:[1],processing:[4],instance:[1],icon:[1],cancel:[8],close:[8],retry:[8]}]);function f(){"undefined"!=typeof customElements&&["ezp-status","ezp-icon","ezp-label","ezp-text-button"].forEach((e=>{switch(e){case"ezp-status":customElements.get(r(e))||customElements.define(r(e),p);break;case"ezp-icon":customElements.get(r(e))||c();break;case"ezp-label":customElements.get(r(e))||l();break;case"ezp-text-button":customElements.get(r(e))||d()}}))}export{p as E,f as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,createEvent as o,h as i,Host as r,transformTag as s}from"@stencil/core/internal/client";import{d as a}from"./ezp-icon2.js";import{d as n}from"./ezp-label2.js";const p=e(class e extends t{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.stepperChanged=o(this,"stepperChanged",7),this.label="Label",this.min=1,this.canDecrease=!0,this.canIncrease=!0,this.focused=!1,this.value=1,this.handleDecrease=()=>{const e=this.value-1;e>=Number.MIN_SAFE_INTEGER&&(void 0===this.min||e>=this.min)&&(this.value=e)},this.handleIncrease=()=>{const e=this.value+1,t=void 0!==this.max?Math.min(this.max,Number.MAX_SAFE_INTEGER):Number.MAX_SAFE_INTEGER;e<=Number.MAX_SAFE_INTEGER&&e<=t&&(this.value=e)},this.handleInput=()=>{if(!this.input)return;
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,createEvent as o,h as i,Host as r,transformTag as s}from"@stencil/core/internal/client";import{d as a}from"./ezp-icon2.js";import{d as n}from"./ezp-label2.js";const p=e(class e extends t{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.stepperChanged=o(this,"stepperChanged",7),this.label="Label",this.min=1,this.canDecrease=!0,this.canIncrease=!0,this.focused=!1,this.value=1,this.handleDecrease=()=>{const e=this.value-1;e>=Number.MIN_SAFE_INTEGER&&(void 0===this.min||e>=this.min)&&(this.value=e)},this.handleIncrease=()=>{const e=this.value+1,t=void 0!==this.max?Math.min(this.max,Number.MAX_SAFE_INTEGER):Number.MAX_SAFE_INTEGER;e<=Number.MAX_SAFE_INTEGER&&e<=t&&(this.value=e)},this.handleInput=()=>{if(!this.input)return;const e=this.input.value.trim();if(""===e)return this.value=this.min,void(this.input.value=this.value.toString());const t=e.replace(/\D/g,"");if(""===t)return void(this.input.value=this.value.toString());const o=Number.MAX_SAFE_INTEGER.toString().length,i=t.slice(0,o);let r=Number(i);r>Number.MAX_SAFE_INTEGER&&(r=Number.MAX_SAFE_INTEGER),void 0!==this.min&&r<this.min&&(r=this.min);const s=void 0!==this.max?Math.min(this.max,Number.MAX_SAFE_INTEGER):Number.MAX_SAFE_INTEGER;r>s&&(r=s),this.value=r,this.input.value=r.toString()},this.setFocus=()=>{var e;null===(e=this.input)||void 0===e||e.focus()},this.handleBlur=()=>{this.focused=!1},this.handleFocus=()=>{this.focused=!0},this.handleKeyDown=t=>{e.ALLOWED_KEYS.includes(t.key)||(t.ctrlKey||t.metaKey)&&e.CTRL_CMD_KEYS.includes(t.key.toLowerCase())||/^\d$/.test(t.key)||t.preventDefault()}}watchValue(){const e=void 0!==this.max?Math.min(this.max,Number.MAX_SAFE_INTEGER):Number.MAX_SAFE_INTEGER;this.canIncrease=this.value<e,this.canDecrease=void 0===this.min||this.value>this.min,this.stepperChanged.emit(this.value)}componentWillLoad(){void 0!==this.min&&this.value<this.min&&(this.value=this.min),this.watchValue()}render(){return i(r,{key:"cdb3aa8969719def6546f35fac5aa35b47c1f94b",class:`${this.focused?"focused":""} ${this.icon?"has-icon":""}`},i("div",{key:"4b0edee6d156edc6e8f79eb0639be4203b12fc5b",id:"toggle",onClick:this.setFocus}),this.icon?i("ezp-icon",{id:"icon",name:this.icon}):null,i("ezp-label",{key:"4fb1d96f12933ee37c05afafee8f313d77a06e9e",id:"label",noWrap:!0,text:this.label}),i("input",{key:"75a462106e4fc3f7b303178a52dd41d6b9145e1c",id:"input",type:"number",ref:e=>this.input=e,min:this.min.toString(),max:void 0!==this.max?this.max.toString():void 0,value:this.value.toString(),"aria-label":this.label,onInput:this.handleInput,onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur}),i("div",{key:"a42c04e3098ec7a96d871c1e7eb12d59189ce540",class:"buttons"},i("button",{key:"05b28026fc46ed0b14f6617880a252bf83137fa5",class:"button",type:"button","aria-label":`Decrease ${this.label}`,disabled:!this.canDecrease,onClick:this.handleDecrease},i("ezp-icon",{key:"66b31a81d7e7836442d342991c6a4ec3749db8ce",name:"minus"})),i("button",{key:"9380b02ebd91ea0cdd26dce6f85ccb7c825d0fe2",class:"button",type:"button","aria-label":`Increase ${this.label}`,disabled:!this.canIncrease,onClick:this.handleIncrease},i("ezp-icon",{key:"b85c276634c61557a475f2951531d9ff0ff78435",name:"plus"}))))}static get watchers(){return{value:[{watchValue:0}]}}static get style(){return':host{-ms-flex-align:center;align-items:center;background:var(--ezp-core-surface-tertiary);border-radius:3px;-webkit-box-shadow:var(--ezp-stepper-boxShadowPosition, 0 0 0 1px) var(--ezp-core-outline);box-shadow:var(--ezp-stepper-boxShadowPosition, 0 0 0 1px) var(--ezp-core-outline);display:grid;gap:var(--ezp-spacing-3);grid-template:var(--ezp-stepper-gridTemplate, auto/auto 1fr auto);padding:0 var(--ezp-spacing-2) 0 var(--ezp-spacing-3);position:relative;z-index:0}:host(.focused){--ezp-stepper-icon-color:var(--ezp-theme-solid);--ezp-stepper-label-color:var(--ezp-theme-solid)}:host(.has-icon){--ezp-stepper-gridTemplate:auto / repeat(2, auto) 1fr auto}#toggle{background:var(--ezp-stepper-toggle-background, transparent);border-radius:3px;cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%;z-index:-1}@media (hover: hover){#toggle:hover{--ezp-stepper-toggle-background:var(--ezp-core-shade-primary)}}#icon{color:var(--ezp-stepper-icon-color, var(--ezp-core-foreground-secondary));pointer-events:none}#label{color:var(--ezp-stepper-label-color, var(--ezp-core-foreground-secondary));pointer-events:none}#input{-moz-appearance:textfield;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--ezp-core-foreground-primary);cursor:inherit;font-family:inherit;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum";font-size:14px;-webkit-font-smoothing:antialiased;height:30px;letter-spacing:-0.0062235443em;margin:0;outline:none;padding:0;pointer-events:none;text-align:right;width:100%}#input::-webkit-outer-spin-button,#input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.buttons{display:-ms-flexbox;display:flex}.button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-stepper-button-background, transparent);border:0;border-radius:50%;-webkit-box-shadow:none;box-shadow:none;color:var(--ezp-stepper-button-color, var(--ezp-theme-solid));cursor:var(--ezp-stepper-button-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;outline:none;padding:var(--ezp-spacing-1)}@media (hover: hover){.button:not(:disabled):hover{--ezp-stepper-button-background:var(--ezp-core-shade-primary)}.button:not(:disabled):active{--ezp-stepper-button-background:var(--ezp-core-shade-secondary)}}.button:disabled{--ezp-stepper-button-color:var(--ezp-core-foreground-tertiary);--ezp-stepper-button-cursor:default}'}},[1,"ezp-stepper",{icon:[1],label:[1],max:[2],min:[2],canDecrease:[32],canIncrease:[32],focused:[32],value:[32]},void 0,{value:[{watchValue:0}]}]);function c(){"undefined"!=typeof customElements&&["ezp-stepper","ezp-icon","ezp-label"].forEach((e=>{switch(e){case"ezp-stepper":customElements.get(s(e))||customElements.define(s(e),p);break;case"ezp-icon":customElements.get(s(e))||a();break;case"ezp-label":customElements.get(s(e))||n()}}))}p.ALLOWED_KEYS=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowUp","ArrowRight","ArrowDown"],p.CTRL_CMD_KEYS=["a","c","v","x"];export{p as E,c as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as e,h as o,Host as a,transformTag as r}from"@stencil/core/internal/client";import{d as n}from"./ezp-label2.js";const i=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.blank=!1,this.disabled=!1,this.level="primary",this.small=!1}render(){return o(a,{key:"24c7d7fe23395513fccfc8fc94fbc552a1763148",class:`${this.level}`},o(void 0!==this.type?"button":"a",Object.assign({key:"
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,h as o,Host as a,transformTag as r}from"@stencil/core/internal/client";import{d as n}from"./ezp-label2.js";const i=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.blank=!1,this.disabled=!1,this.level="primary",this.small=!1}render(){return o(a,{key:"24c7d7fe23395513fccfc8fc94fbc552a1763148",class:`${this.level}`},o(void 0!==this.type?"button":"a",Object.assign({key:"eded3e128d17f4b5bf5a29b01e51f4a2ba1d6d74",id:"button","aria-label":this.label},void 0!==this.type?{type:this.type,disabled:this.disabled}:{href:this.href,target:this.blank?"_blank":"_self"}),o("ezp-label",{key:"4974381f385143ac4828f74c580ef280357e85ac",id:"label",weight:"heavy",text:this.label,level:this.small?"tertiary":"secondary"})))}static get style(){return":host{display:-ms-flexbox;display:flex}:host(.primary){--ezp-textButton-background-disabled:var(--ezp-core-shade-primary);--ezp-textButton-background-init:var(--ezp-theme-solid);--ezp-textButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-white-100);--ezp-textButton-opacity-active:0.74;--ezp-textButton-opacity-hover:0.84}:host(.secondary){--ezp-textButton-background-active:var(--ezp-core-shade-tertiary);--ezp-textButton-background-disabled:var(--ezp-core-shade-primary);--ezp-textButton-background-hover:var(--ezp-core-shade-secondary);--ezp-textButton-background-init:var(--ezp-core-shade-primary);--ezp-textButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-theme-solid)}:host(.tertiary){--ezp-textButton-background-active:var(--ezp-core-shade-secondary);--ezp-textButton-background-disabled:transparent;--ezp-textButton-background-hover:var(--ezp-core-shade-primary);--ezp-textButton-background-init:transparent;--ezp-textButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-theme-solid)}#button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-textButton-background, var(--ezp-textButton-background-init));border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:var(--ezp-textButton-color, var(--ezp-textButton-color-init));cursor:var(--ezp-textButton-cursor, pointer);display:-ms-flexbox;display:flex;font-family:inherit;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--ezp-textButton-opacity, 1);outline:none;padding:var(--ezp-spacing-3);white-space:nowrap;width:100%}@media (hover: hover){#button:not(:disabled):hover{--ezp-textButton-background:var( --ezp-textButton-background-hover, var(--ezp-textButton-background-init) );--ezp-textButton-opacity:var(--ezp-textButton-opacity-hover, 1)}#button:not(:disabled):active{--ezp-textButton-background:var( --ezp-textButton-background-active, var(--ezp-textButton-background-init) );--ezp-textButton-opacity:var(--ezp-textButton-opacity-active, 1)}}#button:disabled{--ezp-textButton-background:var(--ezp-textButton-background-disabled);--ezp-textButton-color:var(--ezp-textButton-color-disabled);--ezp-textButton-cursor:default}#label{pointer-events:none}"}},[1,"ezp-text-button",{blank:[4],disabled:[4],href:[1],level:[1],label:[1],type:[1],small:[4]}]);function p(){"undefined"!=typeof customElements&&["ezp-text-button","ezp-label"].forEach((t=>{switch(t){case"ezp-text-button":customElements.get(r(t))||customElements.define(r(t),i);break;case"ezp-label":customElements.get(r(t))||n()}}))}export{i as E,p as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as a,createEvent as t,h as r,Host as i,Fragment as o,transformTag as l}from"@stencil/core/internal/client";import{i as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as a,createEvent as t,h as r,Host as i,Fragment as o,transformTag as l}from"@stencil/core/internal/client";import{s as n,i as d}from"./utils.js";import{d as s}from"./ezp-icon2.js";import{d as p}from"./ezp-icon-button2.js";import{d as c}from"./ezp-label2.js";const u=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.uploadFile=t(this,"uploadFile",7),this.selectedFiles=[],this.dragging=!1,this.handleInput=()=>{var e,a;const t=Array.from(null!==(a=null===(e=this.input)||void 0===e?void 0:e.files)&&void 0!==a?a:[]);this.selectedFiles=[...this.selectedFiles,...t],this.uploadFile.emit(this.selectedFiles),this.input&&(this.input.value="")},this.removeFile=(e,a)=>{e.preventDefault(),e.stopPropagation(),this.selectedFiles=this.selectedFiles.filter(((e,t)=>t!==a)),this.uploadFile.emit(this.selectedFiles),this.input&&(this.input.value="")}}connectedCallback(){this.unsubscribeLanguage=n(this)}disconnectedCallback(){var e;null===(e=this.unsubscribeLanguage)||void 0===e||e.call(this)}handleDragEnter(){this.dragging=!0}handleDragOver(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")}handleDragLeave(){this.dragging=!1}handleDrop(e){var a,t;e.stopPropagation(),e.preventDefault(),this.dragging=!1;const r=Array.from(null!==(t=null===(a=e.dataTransfer)||void 0===a?void 0:a.files)&&void 0!==t?t:[]);this.selectedFiles=[...this.selectedFiles,...r],this.uploadFile.emit(this.selectedFiles)}listenPrintCancel(){var e;null===(e=this.form)||void 0===e||e.reset(),this.selectedFiles=[]}render(){return r(i,{key:"3ed4218a2085c92c782e460894149608b8bc4136",class:{dragging:this.dragging}},r("form",{key:"de62cb59d82367edc013683d54d55f1807a1d6c7",id:"form",ref:e=>this.form=e},r("div",{key:"a6de2ece802087868d0b0a7bf28f60a058737c6c",id:"header"},r("ezp-icon",{key:"6c0f86cbc078a47b0c8383d9e7a68ae4a3e19c47",name:"drag-drop",size:"huge",framed:!0}),r("ezp-label",{key:"8ad91024fcdecb6dfe3821ac9d04b31c47b76496",weight:"strong",text:d.t("upload.description")}),r("div",{key:"233ba9e003abc33cc7f95f3faba507a33fcc09f1",id:"meta"},r("ezp-label",{key:"e257eb18a98d5578f6476b81ffaef5813dcd2eda",level:"tertiary",text:d.t("upload.meta_leading")}),r("label",{key:"a7127233e97c89af6ab3d562dd909ff79b8122d5",htmlFor:"input",id:"select"},r("ezp-label",{key:"5d4fa0a05a2e56377a6e6130cbfab206fff4dd29",level:"tertiary",weight:"strong",text:d.t("upload.meta_select")})),r("input",{key:"7f3e8e45b58629176d4f41392d20dc30fd27b420",type:"file",name:"input",id:"input",multiple:!0,"aria-label":d.t("upload.description"),ref:e=>this.input=e,onInput:this.handleInput}),r("ezp-label",{key:"2ab851d12e712f3fdbbee0cea2f248ad8e7de807",level:"tertiary",text:d.t("upload.meta_trailing")})),this.selectedFiles.length>0&&r(o,null,r("ezp-label",{key:"12050e4b680fe14796af60bf526468dda308f439",level:"secondary",text:d.t("upload.selected_files")}),r("div",{key:"fbfcb67db6d426fe45a431dcaa15db43040f9c97",id:"file-list"},this.selectedFiles.map(((e,a)=>r("div",{key:a,class:"file-item"},r("div",{class:"file-name"},r("ezp-label",{level:"tertiary",text:e.name})),r("div",{class:"file-remove"},r("ezp-icon-button",{icon:"close",type:"button",level:"tertiary",onClick:e=>this.removeFile(e,a)}))))))))))}static get style(){return'@charset "UTF-8";:host{-ms-flex-line-pack:center;align-content:center;background:var(--ezp-upload-background, transparent);border:1px dashed var(--ezp-upload-border-color, var(--ezp-core-foreground-tertiary));border-radius:3px;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--ezp-core-foreground-primary);display:grid;grid-template:auto/minmax(auto, 280px);height:var(--ezp-upload-height, auto);-ms-flex-pack:center;justify-content:center;padding:var(--ezp-spacing-3);position:relative;-webkit-transition:background-color var(--ezp-duration-3) var(--ezp-easing-out-quart), border-color var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:background-color var(--ezp-duration-3) var(--ezp-easing-out-quart), border-color var(--ezp-duration-3) var(--ezp-easing-out-quart);width:var(--ezp-upload-width, auto)}:host(.dragging){--ezp-upload-background:var(--ezp-theme-translucent);--ezp-upload-border-color:var(--ezp-theme-translucent);--ezp-upload-header-blur:16px;--ezp-upload-header-opacity:0.42}#header{--ezp-icon-fill:var(--ezp-theme-solid);-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-webkit-filter:blur(var(--ezp-upload-header-blur, 0));filter:blur(var(--ezp-upload-header-blur, 0));-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-5);opacity:var(--ezp-upload-header-opacity, 1);text-align:center;-webkit-transition:opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), -webkit-filter var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), -webkit-filter var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:filter var(--ezp-duration-3) var(--ezp-easing-out-quart), opacity var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:filter var(--ezp-duration-3) var(--ezp-easing-out-quart), opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), -webkit-filter var(--ezp-duration-3) var(--ezp-easing-out-quart);}#header:has(#file-list){gap:var(--ezp-spacing-3)}#header:has(#file-list)>ezp-icon{display:none}#header:has(#file-list)>ezp-label:first-of-type{display:none}#meta{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--ezp-spacing-3) 3px;-ms-flex-pack:center;justify-content:center}#select{color:var(--ezp-theme-solid);cursor:pointer;opacity:var(--ezp-upload-select-opacity, 1);text-decoration:underline;white-space:nowrap}@media (hover: hover){#select:hover{--ezp-upload-select-opacity:0.58}}#input{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:0;opacity:0;pointer-events:none;position:absolute;width:0}#file-list{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-3);max-height:var(--ezp-upload-fileList-maxHeight, 35vh);overflow-y:auto;scrollbar-color:var(--ezp-core-foreground-tertiary) transparent;scrollbar-width:thin;width:100%;}#file-list::-webkit-scrollbar{height:8px;width:8px}#file-list::-webkit-scrollbar-thumb{background:var(--ezp-core-foreground-tertiary);border-radius:4px}#file-list::-webkit-scrollbar-track{background:transparent}.file-item{-ms-flex-align:center;align-items:center;background:var(--ezp-core-background-secondary);border-radius:3px;display:grid;gap:var(--ezp-spacing-3);grid-template-columns:1fr auto;min-height:32px;padding:var(--ezp-spacing-2) var(--ezp-spacing-3)}.file-name{grid-column:1;min-width:0}.file-name ezp-label{--ezp-label-minWidth:0}.file-remove{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;grid-column:2}'}},[1,"ezp-upload",{selectedFiles:[32],dragging:[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]]);function f(){"undefined"!=typeof customElements&&["ezp-upload","ezp-icon","ezp-icon-button","ezp-label"].forEach((e=>{switch(e){case"ezp-upload":customElements.get(l(e))||customElements.define(l(e),u);break;case"ezp-icon":customElements.get(l(e))||s();break;case"ezp-icon-button":customElements.get(l(e))||p();break;case"ezp-label":customElements.get(l(e))||c()}}))}export{u as E,f as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{c as s,d as e}from"./ezp-user-menu2.js";const o=s,r=e;export{o as EzpUserMenu,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as a,createEvent as t,h as r,Host as s,transformTag as n}from"@stencil/core/internal/client";import{c as o,a as i}from"./auth.js";import{i as c}from"./i18next.js";import{d as p}from"./ezp-backdrop2.js";import{d as u}from"./ezp-icon2.js";import{d}from"./ezp-icon-button2.js";import{d as l}from"./ezp-label2.js";class h{getUserInfo(){return fetch(`https://${i.state.authApiHostUrl}/v1/users/me`,{headers:{Authorization:"Bearer "+i.state.accessToken,"Content-Type":"application/json"},method:"GET"}).then((e=>e.json()))}}const z=o({user:null,theme:"",appearance:""}),b=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.userMenuClosure=t(this,"userMenuClosure",7),this.logoutEmitter=t(this,"logoutEmitter",7),this.backdrop=document.createElement("ezp-backdrop"),this.links=[{title:c.t("user_menu.account"),icon:"account",href:"https://app.ezeep.com"},{title:c.t("user_menu.help"),icon:"help",href:"https://support.ezeep.com"}],this.themes=["pink","red","orange","green","teal","cyan","blue","violet"],this.appearances=[{title:c.t("user_menu.system"),name:"system"},{title:c.t("user_menu.light"),name:"light"},{title:c.t("user_menu.dark"),name:"dark"}],this.name="John Doe",this.open=!1,this.handleClose=()=>{this.userMenuClosure.emit()},this.logOut=()=>{localStorage.removeItem("properties"),localStorage.removeItem("refreshToken"),localStorage.removeItem("access_token"),localStorage.removeItem("printer"),localStorage.removeItem("isAuthorized"),i.state.isAuthorized=!1,this.logoutEmitter.emit()},this.handleTheme=e=>{z.state.theme=e},this.handleAppearance=e=>{z.state.appearance=e}}watchOpen(){this.open?(this.backdrop.visible=!0,this.container.appendChild(this.backdrop)):(this.backdrop.visible=!1,this.userMenuClosure.emit())}componentWillLoad(){this.container=this.component.closest("[data-backdrop-surface]"),this.backdrop.addEventListener("backdropHideStart",(()=>{this.open=!1})),this.backdrop.addEventListener("backdropHideEnd",(()=>{this.container.removeChild(this.backdrop)}))}render(){return r(s,{key:"0be3d9326b2fd15cbb61e5b9eae17e0e8c64fefd",class:this.open?"is-open":""},r("div",{key:"a9c3690514cf71adb590395dc4bc71c5a5f35fce",id:"header"},r("ezp-label",{key:"cac928c398257f57ace98662049caee2ed992aa6",ellipsis:!0,id:"name",weight:"heavy",text:this.name}),r("ezp-icon-button",{key:"5d237bee7dc3d48120a3b042a25bf392965b56a3",id:"close",level:"tertiary",icon:"close",onClick:this.handleClose})),r("div",{key:"2edf3724b7590665fbd4baf27c14fdfe5e623537",id:"links"},this.links.map((e=>r("a",{class:"link",href:e.href,target:"_blank",rel:"noopener noreferrer"},r("ezp-icon",{class:"link__icon",name:e.icon}),r("ezp-label",{text:e.title})))),r("a",{key:"363e6574e75c9cc2aeaa4707f3798e8c2c0f5fd4",class:"link",onClick:this.logOut},r("ezp-icon",{key:"b444802cd837572f61dabb28416931498db83f0e",class:"link__icon",name:"logout"}),r("ezp-label",{key:"02958987257786688345e0da79e10f0535b41dc0",text:c.t("user_menu.logout")}))),r("div",{key:"e404081c99dd59cbd3d86a502fa24a76e459718d",id:"theme"},r("ezp-label",{key:"3a8719b3ca0d6e078fb4add24efea9b28c8e8882",class:"caption",text:`${c.t("user_menu.theme")}:`,weight:"heavy"}),r("div",{key:"01c030aa8e66ba2fdfe968588e7c7dd3a6a7fe09",id:"swatches"},this.themes.map((e=>r("button",{class:`swatch swatch--${e} ${e===z.state.theme?"selected":""}`,onClick:()=>this.handleTheme(e)},r("span",{class:"dot"})))))),r("div",{key:"4a04a1ed776aed50e94394ca91aa91c85002d90f",id:"appearance"},r("ezp-label",{key:"36427d1dea114b47dc6d6b86da80c68388c3b4c2",class:"caption",text:`${c.t("user_menu.appearance")}:`,weight:"heavy"}),r("div",{key:"5729ca40b8228644637106f728d90b53da6c09dc",id:"tabs"},this.appearances.map((e=>r("button",{class:"tab "+(e.name===z.state.appearance?"selected":""),onClick:()=>this.handleAppearance(e.name)},r("ezp-icon",{name:e.name}),r("ezp-label",{text:e.title,level:"tertiary",weight:"strong"})))))))}get component(){return this}static get watchers(){return{open:[{watchOpen:0}]}}static get style(){return":host{background:var(--ezp-core-surface-tertiary);border-radius:6px;-webkit-box-shadow:var(--ezp-userMenu-boxShadow, 0 0 0 1px var(--ezp-black-10));box-shadow:var(--ezp-userMenu-boxShadow, 0 0 0 1px var(--ezp-black-10));display:block;opacity:var(--ezp-userMenu-opacity, 0);position:absolute;right:0;top:0;-webkit-transform:scale(var(--ezp-userMenu-scale, 0.94, 0.94));transform:scale(var(--ezp-userMenu-scale, 0.94, 0.94));-webkit-transform-origin:right top;transform-origin:right top;-webkit-transition:var(--ezp-userMenu-transition, opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), transform var(--ezp-duration-3) var(--ezp-easing-out-quart), visibility 0s var(--ezp-duration-3));transition:var(--ezp-userMenu-transition, opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), transform var(--ezp-duration-3) var(--ezp-easing-out-quart), visibility 0s var(--ezp-duration-3));visibility:var(--ezp-userMenu-visibility, hidden);z-index:5}:host(.is-open){--ezp-userMenu-opacity:1;--ezp-userMenu-scale:1, 1;--ezp-userMenu-transition:opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), transform var(--ezp-duration-3) var(--ezp-easing-out-quart), visibility 0s 0s;--ezp-userMenu-visibility:visible}@media (prefers-color-scheme: dark){:host{--ezp-userMenu-separator-position:inset 0 0 0 var(--hairline-width-positive)}}#header{-ms-flex-align:center;align-items:center;-webkit-box-shadow:var(--ezp-userMenu-header-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-userMenu-header-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);-webkit-box-shadow:0;box-shadow:0;display:grid;grid-template:auto/1fr auto;padding:var(--ezp-spacing-4) var(--ezp-spacing-3) var(--ezp-spacing-4) var(--ezp-spacing-4)}#name{color:var(--ezp-core-foreground-primary)}#close{margin:calc(var(--ezp-spacing-3) * -1) 0}#links{-webkit-box-shadow:var(--ezp-userMenu-links-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-userMenu-links-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:var(--ezp-spacing-2)}.link{-ms-flex-align:center;align-items:center;background:var(--ezp-userMenu-link-background, transparent);border-radius:3px;color:var(--ezp-core-foreground-primary);cursor:pointer;display:grid;gap:var(--ezp-spacing-3);grid-template:auto/auto 1fr;padding:var(--ezp-spacing-3);text-decoration:none}.link:hover{--ezp-userMenu-link-background:var(--ezp-core-shade-primary)}.link__icon{color:var(--ezp-theme-solid);margin:calc(var(--ezp-spacing-2) * -1) 0}.caption{color:var(--ezp-core-foreground-primary)}#theme{-webkit-box-shadow:var(--ezp-userMenu-theme-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-userMenu-theme-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);display:grid;gap:var(--ezp-spacing-3);grid-template:repeat(2, auto)/1fr;padding:var(--ezp-spacing-4) var(--ezp-spacing-4) var(--ezp-spacing-3)}#swatches{display:-ms-flexbox;display:flex;margin:0 calc(var(--ezp-spacing-2) * -1)}.swatch{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-userMenu-swatch-background, transparent);border:0;border-radius:50%;color:var(--ezp-userMenu-swatch-color);cursor:var(--ezp-userMenu-swatch-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--ezp-userMenu-swatch-opacity, 1);outline:none;padding:var(--ezp-spacing-2)}@media (hover: hover){.swatch:not(.selected):hover{--ezp-userMenu-swatch-background:var(--ezp-userMenu-swatch-theme-translucent)}.swatch:not(.selected):active{--ezp-userMenu-swatch-opacity:0.74}}.swatch.selected{--ezp-userMenu-dot-boxShadowSize:10px;--ezp-userMenu-swatch-background:var(--ezp-userMenu-swatch-theme-translucent);--ezp-userMenu-swatch-cursor:normal}.swatch.selected>.dot{-webkit-animation:dot-bounce var(--ezp-duration-2) ease-in-out;animation:dot-bounce var(--ezp-duration-2) ease-in-out}.swatch--blue{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-blue-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-blue-translucent)}.swatch--cyan{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-cyan-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-cyan-translucent)}.swatch--green{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-green-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-green-translucent)}.swatch--teal{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-teal-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-teal-translucent)}.swatch--orange{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-orange-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-orange-translucent)}.swatch--pink{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-pink-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-pink-translucent)}.swatch--red{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-red-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-red-translucent)}.swatch--violet{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-violet-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-violet-translucent)}.dot{background:var(--ezp-userMenu-dot-background, transparent);border-radius:50%;-webkit-box-shadow:inset 0 0 0 var(--ezp-userMenu-dot-boxShadowSize, 4px) var(--ezp-userMenu-swatch-theme-solid);box-shadow:inset 0 0 0 var(--ezp-userMenu-dot-boxShadowSize, 4px) var(--ezp-userMenu-swatch-theme-solid);height:18px;-webkit-transition:-webkit-box-shadow var(--ezp-duration-2);transition:-webkit-box-shadow var(--ezp-duration-2);transition:box-shadow var(--ezp-duration-2);transition:box-shadow var(--ezp-duration-2), -webkit-box-shadow var(--ezp-duration-2);width:18px}#appearance{display:grid;gap:var(--ezp-spacing-3);grid-template:repeat(2, auto)/1fr;padding:var(--ezp-spacing-4) var(--ezp-spacing-4) var(--ezp-spacing-3)}#tabs{display:grid;grid-template:auto/repeat(3, 1fr);margin:0 calc(var(--ezp-spacing-2) * -1)}.tab{--ezp-icon-height:8px;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-userMenu-tab-background, transparent);border:0;border-radius:14px;color:var(--ezp-userMenu-tab-color, var(--ezp-core-foreground-secondary));cursor:var(--ezp-userMenu-tab-cursor, pointer);display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-2);-ms-flex-pack:center;justify-content:center;margin:0;outline:none;padding:var(--ezp-spacing-3) var(--ezp-spacing-3) var(--ezp-spacing-3) var(--ezp-spacing-2)}@media (hover: hover){.tab:not(.selected):hover{--ezp-userMenu-tab-background:var(--ezp-core-shade-primary)}.tab:not(.selected):active{--ezp-userMenu-tab-background:var(--ezp-core-shade-secondary)}}.tab.selected{--ezp-userMenu-tab-background:var(--ezp-theme-translucent);--ezp-userMenu-tab-color:var(--ezp-theme-solid);--ezp-userMenu-tab-cursor:normal}@-webkit-keyframes dot-bounce{0%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}50%{-webkit-transform:scale(0.84, 0.84);transform:scale(0.84, 0.84)}100%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}}@keyframes dot-bounce{0%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}50%{-webkit-transform:scale(0.84, 0.84);transform:scale(0.84, 0.84)}100%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}}"}},[1,"ezp-user-menu",{name:[1],open:[1028]},void 0,{open:[{watchOpen:0}]}]);function m(){"undefined"!=typeof customElements&&["ezp-user-menu","ezp-backdrop","ezp-icon","ezp-icon-button","ezp-label"].forEach((e=>{switch(e){case"ezp-user-menu":customElements.get(n(e))||customElements.define(n(e),b);break;case"ezp-backdrop":customElements.get(n(e))||p();break;case"ezp-icon":customElements.get(n(e))||u();break;case"ezp-icon-button":customElements.get(n(e))||d();break;case"ezp-label":customElements.get(n(e))||l()}}))}export{h as E,b as a,m as d,z as u}
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as a,createEvent as t,h as r,Host as s,transformTag as n}from"@stencil/core/internal/client";import{c as o,a as i,s as c}from"./auth.js";import{i as p,s as u}from"./utils.js";import{d as l}from"./ezp-backdrop2.js";import{d}from"./ezp-icon2.js";import{d as h}from"./ezp-icon-button2.js";import{d as z}from"./ezp-label2.js";function b(e){return{Authorization:"Bearer "+e}}function m(e,a){return fetch(e,{method:"GET",headers:b(a)}).then((e=>e.json()))}class v{getUserInfo(){return m(`https://${i.state.authApiHostUrl}/v1/users/me`,i.state.accessToken)}}const g=o({user:null,theme:"",appearance:""}),w=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.userMenuClosure=t(this,"userMenuClosure",7),this.logoutEmitter=t(this,"logoutEmitter",7),this.backdrop=document.createElement("ezp-backdrop"),this.links=[{title:p.t("user_menu.account"),icon:"account",href:"https://app.ezeep.com"},{title:p.t("user_menu.help"),icon:"help",href:"https://support.ezeep.com"}],this.themes=["pink","red","orange","green","teal","cyan","blue","violet"],this.appearances=[{title:p.t("user_menu.system"),name:"system"},{title:p.t("user_menu.light"),name:"light"},{title:p.t("user_menu.dark"),name:"dark"}],this.name="John Doe",this.open=!1,this.handleClose=()=>{this.userMenuClosure.emit()},this.logOut=()=>{c.clearSession(),i.state.isAuthorized=!1,this.logoutEmitter.emit()},this.handleTheme=e=>{g.state.theme=e},this.handleAppearance=e=>{g.state.appearance=e}}watchOpen(){this.open?(this.backdrop.visible=!0,this.container.appendChild(this.backdrop)):(this.backdrop.visible=!1,this.userMenuClosure.emit())}connectedCallback(){this.unsubscribeLanguage=u(this)}componentWillLoad(){this.container=this.component.closest("[data-backdrop-surface]"),this.backdrop.addEventListener("backdropHideStart",(()=>{this.open=!1})),this.backdrop.addEventListener("backdropHideEnd",(()=>{this.container.removeChild(this.backdrop)}))}disconnectedCallback(){var e;null===(e=this.unsubscribeLanguage)||void 0===e||e.call(this)}render(){return r(s,{key:"76b6f86b18d8aab59578ab6a3ea25e4177ff6e54",class:this.open?"is-open":""},r("div",{key:"4179c44a0477b59606ecb769453ccdfcda0c017b",id:"header"},r("ezp-label",{key:"ecb776a4c4c04eadae8599fa9d077238468fc809",ellipsis:!0,id:"name",weight:"heavy",text:this.name}),r("ezp-icon-button",{key:"fba99c75cee975801bdaeb861f41c8693a149843",id:"close",level:"tertiary",icon:"close",onClick:this.handleClose})),r("div",{key:"16028fe80eb8851891ec618900ce488718d0ad3b",id:"links"},this.links.map((e=>r("a",{class:"link",href:e.href,target:"_blank",rel:"noopener noreferrer"},r("ezp-icon",{class:"link__icon",name:e.icon}),r("ezp-label",{text:e.title})))),r("a",{key:"7741d760a000a78eb96709a6ad87fa962efdc375",class:"link",onClick:this.logOut},r("ezp-icon",{key:"33b280fcea4e039c5f0dd53f348ebf0400b97b64",class:"link__icon",name:"logout"}),r("ezp-label",{key:"ccc22c5fbd9baaf5352a61ce845b3c98e8f83e7d",text:p.t("user_menu.logout")}))),r("div",{key:"a7dce7b1073af19ff90bdf1fabe214ac08c55003",id:"theme"},r("ezp-label",{key:"66ba8c16a9c6183a577edc403074f9e3fcf55345",class:"caption",text:`${p.t("user_menu.theme")}:`,weight:"heavy"}),r("div",{key:"1c6f931a3040d392720d0c7c1f7a9eee4114b935",id:"swatches"},this.themes.map((e=>r("button",{class:`swatch swatch--${e} ${e===g.state.theme?"selected":""}`,onClick:()=>this.handleTheme(e)},r("span",{class:"dot"})))))),r("div",{key:"1b771bbce7b7ea213ecd489e6a3e917aed8a845b",id:"appearance"},r("ezp-label",{key:"8f1a96513260500a6ce3319f72b6ea2ca6a0794a",class:"caption",text:`${p.t("user_menu.appearance")}:`,weight:"heavy"}),r("div",{key:"177a61b8f7210f6a90a36fc5bb9d4b23c64f2a10",id:"tabs"},this.appearances.map((e=>r("button",{class:"tab "+(e.name===g.state.appearance?"selected":""),onClick:()=>this.handleAppearance(e.name)},r("ezp-icon",{name:e.name}),r("ezp-label",{text:e.title,level:"tertiary",weight:"strong"})))))))}get component(){return this}static get watchers(){return{open:[{watchOpen:0}]}}static get style(){return":host{background:var(--ezp-core-surface-tertiary);border-radius:6px;-webkit-box-shadow:var(--ezp-userMenu-boxShadow, 0 0 0 1px var(--ezp-black-10));box-shadow:var(--ezp-userMenu-boxShadow, 0 0 0 1px var(--ezp-black-10));display:block;opacity:var(--ezp-userMenu-opacity, 0);position:absolute;right:0;top:0;-webkit-transform:scale(var(--ezp-userMenu-scale, 0.94, 0.94));transform:scale(var(--ezp-userMenu-scale, 0.94, 0.94));-webkit-transform-origin:right top;transform-origin:right top;-webkit-transition:var(--ezp-userMenu-transition, opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), transform var(--ezp-duration-3) var(--ezp-easing-out-quart), visibility 0s var(--ezp-duration-3));transition:var(--ezp-userMenu-transition, opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), transform var(--ezp-duration-3) var(--ezp-easing-out-quart), visibility 0s var(--ezp-duration-3));visibility:var(--ezp-userMenu-visibility, hidden);z-index:5}:host(.is-open){--ezp-userMenu-opacity:1;--ezp-userMenu-scale:1, 1;--ezp-userMenu-transition:opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), transform var(--ezp-duration-3) var(--ezp-easing-out-quart), visibility 0s 0s;--ezp-userMenu-visibility:visible}@media (prefers-color-scheme: dark){:host{--ezp-userMenu-separator-position:inset 0 0 0 var(--hairline-width-positive)}}#header{-ms-flex-align:center;align-items:center;-webkit-box-shadow:var(--ezp-userMenu-header-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-userMenu-header-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);-webkit-box-shadow:0;box-shadow:0;display:grid;grid-template:auto/1fr auto;padding:var(--ezp-spacing-4) var(--ezp-spacing-3) var(--ezp-spacing-4) var(--ezp-spacing-4)}#name{color:var(--ezp-core-foreground-primary)}#close{margin:calc(var(--ezp-spacing-3) * -1) 0}#links{-webkit-box-shadow:var(--ezp-userMenu-links-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-userMenu-links-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:var(--ezp-spacing-2)}.link{-ms-flex-align:center;align-items:center;background:var(--ezp-userMenu-link-background, transparent);border-radius:3px;color:var(--ezp-core-foreground-primary);cursor:pointer;display:grid;gap:var(--ezp-spacing-3);grid-template:auto/auto 1fr;padding:var(--ezp-spacing-3);text-decoration:none}.link:hover{--ezp-userMenu-link-background:var(--ezp-core-shade-primary)}.link__icon{color:var(--ezp-theme-solid);margin:calc(var(--ezp-spacing-2) * -1) 0}.caption{color:var(--ezp-core-foreground-primary)}#theme{-webkit-box-shadow:var(--ezp-userMenu-theme-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-userMenu-theme-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);display:grid;gap:var(--ezp-spacing-3);grid-template:repeat(2, auto)/1fr;padding:var(--ezp-spacing-4) var(--ezp-spacing-4) var(--ezp-spacing-3)}#swatches{display:-ms-flexbox;display:flex;margin:0 calc(var(--ezp-spacing-2) * -1)}.swatch{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-userMenu-swatch-background, transparent);border:0;border-radius:50%;color:var(--ezp-userMenu-swatch-color);cursor:var(--ezp-userMenu-swatch-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--ezp-userMenu-swatch-opacity, 1);outline:none;padding:var(--ezp-spacing-2)}@media (hover: hover){.swatch:not(.selected):hover{--ezp-userMenu-swatch-background:var(--ezp-userMenu-swatch-theme-translucent)}.swatch:not(.selected):active{--ezp-userMenu-swatch-opacity:0.74}}.swatch.selected{--ezp-userMenu-dot-boxShadowSize:10px;--ezp-userMenu-swatch-background:var(--ezp-userMenu-swatch-theme-translucent);--ezp-userMenu-swatch-cursor:normal}.swatch.selected>.dot{-webkit-animation:dot-bounce var(--ezp-duration-2) ease-in-out;animation:dot-bounce var(--ezp-duration-2) ease-in-out}.swatch--blue{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-blue-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-blue-translucent)}.swatch--cyan{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-cyan-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-cyan-translucent)}.swatch--green{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-green-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-green-translucent)}.swatch--teal{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-teal-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-teal-translucent)}.swatch--orange{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-orange-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-orange-translucent)}.swatch--pink{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-pink-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-pink-translucent)}.swatch--red{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-red-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-red-translucent)}.swatch--violet{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-violet-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-violet-translucent)}.dot{background:var(--ezp-userMenu-dot-background, transparent);border-radius:50%;-webkit-box-shadow:inset 0 0 0 var(--ezp-userMenu-dot-boxShadowSize, 4px) var(--ezp-userMenu-swatch-theme-solid);box-shadow:inset 0 0 0 var(--ezp-userMenu-dot-boxShadowSize, 4px) var(--ezp-userMenu-swatch-theme-solid);height:18px;-webkit-transition:-webkit-box-shadow var(--ezp-duration-2);transition:-webkit-box-shadow var(--ezp-duration-2);transition:box-shadow var(--ezp-duration-2);transition:box-shadow var(--ezp-duration-2), -webkit-box-shadow var(--ezp-duration-2);width:18px}#appearance{display:grid;gap:var(--ezp-spacing-3);grid-template:repeat(2, auto)/1fr;padding:var(--ezp-spacing-4) var(--ezp-spacing-4) var(--ezp-spacing-3)}#tabs{display:grid;grid-template:auto/repeat(3, 1fr);margin:0 calc(var(--ezp-spacing-2) * -1)}.tab{--ezp-icon-height:8px;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-userMenu-tab-background, transparent);border:0;border-radius:14px;color:var(--ezp-userMenu-tab-color, var(--ezp-core-foreground-secondary));cursor:var(--ezp-userMenu-tab-cursor, pointer);display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-2);-ms-flex-pack:center;justify-content:center;margin:0;outline:none;padding:var(--ezp-spacing-3) var(--ezp-spacing-3) var(--ezp-spacing-3) var(--ezp-spacing-2)}@media (hover: hover){.tab:not(.selected):hover{--ezp-userMenu-tab-background:var(--ezp-core-shade-primary)}.tab:not(.selected):active{--ezp-userMenu-tab-background:var(--ezp-core-shade-secondary)}}.tab.selected{--ezp-userMenu-tab-background:var(--ezp-theme-translucent);--ezp-userMenu-tab-color:var(--ezp-theme-solid);--ezp-userMenu-tab-cursor:normal}@-webkit-keyframes dot-bounce{0%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}50%{-webkit-transform:scale(0.84, 0.84);transform:scale(0.84, 0.84)}100%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}}@keyframes dot-bounce{0%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}50%{-webkit-transform:scale(0.84, 0.84);transform:scale(0.84, 0.84)}100%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}}"}},[1,"ezp-user-menu",{name:[1],open:[1028]},void 0,{open:[{watchOpen:0}]}]);function f(){"undefined"!=typeof customElements&&["ezp-user-menu","ezp-backdrop","ezp-icon","ezp-icon-button","ezp-label"].forEach((e=>{switch(e){case"ezp-user-menu":customElements.get(n(e))||customElements.define(n(e),w);break;case"ezp-backdrop":customElements.get(n(e))||l();break;case"ezp-icon":customElements.get(n(e))||d();break;case"ezp-icon-button":customElements.get(n(e))||h();break;case"ezp-label":customElements.get(n(e))||z()}}))}export{v as E,m as a,b,w as c,f as d,g as u}
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{getAssetPath,render,setAssetPath,setNonce,setPlatformOptions}from"@stencil/core/internal/client";((async()=>{const t=new FontFace("Inter","url(https://rsms.me/inter/font-files/Inter-roman.var.woff2)",{style:"normal",weight:"400 600"});t.load().then((()=>{document.fonts.add(t)}))})||(()=>{}))();
|
|
1
|
+
export{getAssetPath,render,setAssetPath,setNonce,setPlatformOptions}from"@stencil/core/internal/client";((async()=>{const t=new FontFace("Inter","url(https://rsms.me/inter/font-files/Inter-roman.var.woff2)",{style:"normal",weight:"400 600"});t.load().then((()=>{document.fonts.add(t)})).catch((()=>{}))})||(()=>{}))();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{forceUpdate as t}from"@stencil/core/internal/client";const e=t=>"string"==typeof t,s=()=>{let t,e;const s=new Promise(((s,i)=>{t=s,e=i}));return s.resolve=t,s.reject=e,s},i=t=>null==t?"":String(t),n=/###/g,r=t=>t&&t.includes("###")?t.replace(n,"."):t,o=t=>!t||e(t),a=(t,s,i)=>{const n=e(s)?s.split("."):s;let a=0;for(;a<n.length-1;){if(o(t))return{};const e=r(n[a]);!t[e]&&i&&(t[e]=new i),t=Object.prototype.hasOwnProperty.call(t,e)?t[e]:{},++a}return o(t)?{}:{obj:t,k:r(n[a])}},h=(t,e,s)=>{const{obj:i,k:n}=a(t,e,Object);if(void 0!==i||1===e.length)return void(i[n]=s);let r=e[e.length-1],o=e.slice(0,e.length-1),h=a(t,o,Object);for(;void 0===h.obj&&o.length;)r=`${o[o.length-1]}.${r}`,o=o.slice(0,o.length-1),h=a(t,o,Object),h?.obj&&void 0!==h.obj[`${h.k}.${r}`]&&(h.obj=void 0);h.obj[`${h.k}.${r}`]=s},l=(t,e)=>{const{obj:s,k:i}=a(t,e);if(s&&Object.prototype.hasOwnProperty.call(s,i))return s[i]},c=(t,s,i)=>{for(const n in s)"__proto__"!==n&&"constructor"!==n&&(Object.prototype.hasOwnProperty.call(t,n)?e(t[n])||t[n]instanceof String||e(s[n])||s[n]instanceof String?i&&(t[n]=s[n]):c(t[n],s[n],i):t[n]=s[n]);return t},u=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),d={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},p=t=>e(t)?t.replace(/[&<>"'\/]/g,(t=>d[t])):t,f=[" ",",","?","!",";"],g=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const e=this.regExpMap.get(t);if(void 0!==e)return e;const s=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,s),this.regExpQueue.push(t),s}}(20),y=(t,e,s=".")=>{if(!t)return;if(t[e]){if(!Object.prototype.hasOwnProperty.call(t,e))return;return t[e]}const i=e.split(s);let n=t;for(let t=0;t<i.length;){if(!n||"object"!=typeof n)return;let e,r="";for(let o=t;o<i.length;++o)if(o!==t&&(r+=s),r+=i[o],e=n[r],void 0!==e){if(["string","number","boolean"].includes(typeof e)&&o<i.length-1)continue;t+=o-t+1;break}n=e}return n},m=t=>t?.replace(/_/g,"-"),b={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class ${constructor(t,e={}){this.init(t,e)}init(t,e={}){this.prefix=e.prefix||"i18next:",this.logger=t||b,this.options=e,this.debug=e.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,s,i,n){return n&&!this.debug?null:(t=t.map((t=>e(t)?t.replace(/[\r\n\x00-\x1F\x7F]/g," "):t)),e(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[s](t))}create(t){return new $(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new $(this.logger,t)}}var v=new $;class _{constructor(){this.observers={}}on(t,e){return t.split(" ").forEach((t=>{this.observers[t]||(this.observers[t]=new Map);const s=this.observers[t].get(e)||0;this.observers[t].set(e,s+1)})),this}off(t,e){this.observers[t]&&(e?this.observers[t].delete(e):delete this.observers[t])}once(t,e){const s=(...i)=>{e(...i),this.off(t,s)};return this.on(t,s),this}emit(t,...e){this.observers[t]&&Array.from(this.observers[t].entries()).forEach((([t,s])=>{for(let i=0;i<s;i++)t(...e)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((([s,i])=>{for(let n=0;n<i;n++)s(t,...e)}))}}class w extends _{constructor(t,e={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.includes(t)||this.options.ns.push(t)}removeNamespaces(t){const e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}getResource(t,s,i,n={}){const r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.includes(".")?a=t.split("."):(a=[t,s],i&&(Array.isArray(i)?a.push(...i):e(i)&&r?a.push(...i.split(r)):a.push(i)));const h=l(this.data,a);return h||s||i||!t.includes(".")||(t=a[0],s=a[1],i=a.slice(2).join(".")),!h&&o&&e(i)?y(this.data?.[t]?.[s],i,r):h}addResource(t,e,s,i,n={silent:!1}){const r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator;let o=[t,e];s&&(o=o.concat(r?s.split(r):s)),t.includes(".")&&(o=t.split("."),i=e,e=o[1]),this.addNamespaces(e),h(this.data,o,i),n.silent||this.emit("added",t,e,s,i)}addResources(t,s,i,n={silent:!1}){for(const n in i)(e(i[n])||Array.isArray(i[n]))&&this.addResource(t,s,n,i[n],{silent:!0});n.silent||this.emit("added",t,s,i)}addResourceBundle(t,e,s,i,n,r={silent:!1,skipCopy:!1}){let o=[t,e];t.includes(".")&&(o=t.split("."),i=s,s=e,e=o[1]),this.addNamespaces(e);let a=l(this.data,o)||{};r.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?c(a,s,n):a={...a,...s},h(this.data,o,a),r.silent||this.emit("added",t,e,s)}removeResourceBundle(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}hasResourceBundle(t,e){return void 0!==this.getResource(t,e)}getResourceBundle(t,e){return e||(e=this.options.defaultNS),this.getResource(t,e)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const e=this.getDataByLanguage(t);return!!(e&&Object.keys(e)||[]).find((t=>e[t]&&Object.keys(e[t]).length>0))}toJSON(){return this.data}}var x={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,s,i,n){return t.forEach((t=>{e=this.processors[t]?.process(e,s,i,n)??e})),e}};const k=Symbol("i18next/PATH_KEY");function S(t,e){const{[k]:s}=t(function(){const t=[],e=Object.create(null);let s;return e.get=(i,n)=>(s?.revoke?.(),n===k?t:(t.push(n),s=Proxy.revocable(i,e),s.proxy)),Proxy.revocable(Object.create(null),e).proxy}()),i=e?.keySeparator??".",n=e?.nsSeparator??":",r="strict"===e?.enableSelector;if(s.length>1&&n){const t=e?.ns,o=r?Array.isArray(t)?t:t?[t]:null:Array.isArray(t)?t:null;if(o&&(r?o:o.length>1?o.slice(1):[]).includes(s[0]))return`${s[0]}${n}${s.slice(1).join(i)}`}return s.join(i)}const j=t=>!e(t)&&"boolean"!=typeof t&&"number"!=typeof t;class O extends _{constructor(t,e={}){var s,i;super(),s=t,i=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((t=>{s[t]&&(i[t]=s[t])})),this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=v.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,e={interpolation:{}}){const s={...e};if(null==t)return!1;const i=this.resolve(t,s);if(void 0===i?.res)return!1;const n=j(i.res);return!1!==s.returnObjects||!n}extractFromKey(t,s){let i=void 0!==s.nsSeparator?s.nsSeparator:this.options.nsSeparator;void 0===i&&(i=":");const n=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator;let r=s.ns||this.options.defaultNS||[];const o=i&&t.includes(i),a=!(this.options.userDefinedKeySeparator||s.keySeparator||this.options.userDefinedNsSeparator||s.nsSeparator||((t,e,s)=>{e=e||"",s=s||"";const i=f.filter((t=>!e.includes(t)&&!s.includes(t)));if(0===i.length)return!0;const n=g.getRegExp(`(${i.map((t=>"?"===t?"\\?":t)).join("|")})`);let r=!n.test(t);if(!r){const e=t.indexOf(s);e>0&&!n.test(t.substring(0,e))&&(r=!0)}return r})(t,i,n));if(o&&!a){const s=t.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:t,namespaces:e(r)?[r]:r};const o=t.split(i);(i!==n||i===n&&this.options.ns.includes(o[0]))&&(r=o.shift()),t=o.join(n)}return{key:t,namespaces:e(r)?[r]:r}}translate(t,s,i){let n="object"==typeof s?{...s}:s;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==t)return"";"function"==typeof t&&(t=S(t,{...this.options,...n})),Array.isArray(t)||(t=[String(t)]),t=t.map((t=>"function"==typeof t?S(t,{...this.options,...n}):String(t)));const r=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:a,namespaces:h}=this.extractFromKey(t[t.length-1],n),l=h[h.length-1];let c=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===u?.toLowerCase())return d?r?{res:`${l}${c}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${c}${a}`:r?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:a;const p=this.resolve(t,n);let f=p?.res;const g=p?.usedKey||a,y=p?.exactUsedKey||a,m=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,$=void 0!==n.count&&!e(n.count),v=O.hasDefaultValue(n),_=$?this.pluralResolver.getSuffix(u,n.count,n):"",w=n.ordinal&&$?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",x=$&&!n.ordinal&&0===n.count,k=x&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${_}`]||n[`defaultValue${w}`]||n.defaultValue;let P=f;b&&!f&&v&&(P=k);const N=j(P),R=Object.prototype.toString.apply(P);if(!(b&&P&&N)||["[object Number]","[object Function]","[object RegExp]"].includes(R)||e(m)&&Array.isArray(P))if(b&&e(m)&&Array.isArray(f))f=f.join(m),f&&(f=this.extendTranslation(f,t,n,i));else{let e=!1,s=!1;!this.isValidLookup(f)&&v&&(e=!0,f=k),this.isValidLookup(f)||(s=!0,f=a);const r=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:f,h=v&&k!==f&&this.options.updateMissing;if(s||e||h){if(this.logger.log(h?"updateKey":"missingKey",u,l,$&&!h?`${a}${this.pluralResolver.getSuffix(u,n.count,n)}`:a,h?k:f),o){const t=this.resolve(a,{...n,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[];const e=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&e&&e[0])for(let s=0;s<e.length;s++)t.push(e[s]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(n.lng||this.language):t.push(n.lng||this.language);const s=(t,e,s)=>{const i=v&&s!==f?s:r;this.options.missingKeyHandler?this.options.missingKeyHandler(t,l,e,i,h,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(t,l,e,i,h,n),this.emit("missingKey",t,l,e,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&$?t.forEach((t=>{const e=this.pluralResolver.getSuffixes(t,n);x&&n[`defaultValue${this.options.pluralSeparator}zero`]&&!e.includes(`${this.options.pluralSeparator}zero`)&&e.push(`${this.options.pluralSeparator}zero`),e.forEach((e=>{s([t],a+e,n[`defaultValue${e}`]||k)}))})):s(t,a,k))}f=this.extendTranslation(f,t,n,p,i),s&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${l}${c}${a}`),(s||e)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${a}`:a,e?f:void 0,n))}else{if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,P,{...n,ns:h}):`key '${a} (${this.language})' returned an object instead of string.`;return r?(p.res=t,p.usedParams=this.getUsedParamsDetails(n),p):t}if(o){const t=Array.isArray(P),e=t?[]:{},s=t?y:g;for(const t in P)if(Object.prototype.hasOwnProperty.call(P,t)){const i=`${s}${o}${t}`;e[t]=this.translate(i,v&&!f?{...n,defaultValue:j(k)?k[t]:void 0,joinArrays:!1,ns:h}:{...n,joinArrays:!1,ns:h}),e[t]===i&&(e[t]=P[t])}f=e}}return r?(p.res=f,p.usedParams=this.getUsedParamsDetails(n),p):f}extendTranslation(t,s,i,n,r){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const o=e(t)&&(void 0!==i?.interpolation?.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(o){const e=t.match(this.interpolator.nestingRegexp);a=e&&e.length}let h=i.replace&&!e(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,i.lng||this.language||n.usedLng,i),o){const e=t.match(this.interpolator.nestingRegexp);a<(e&&e.length)&&(i.nest=!1)}!i.lng&&n&&n.res&&(i.lng=this.language||n.usedLng),!1!==i.nest&&(t=this.interpolator.nest(t,((...t)=>r?.[0]!==t[0]||i.context?this.translate(...t,s):(this.logger.warn(`It seems you are nesting recursively key: ${t[0]} in key: ${s[0]}`),null)),i)),i.interpolation&&this.interpolator.reset()}const o=i.postProcess||this.options.postProcess,a=e(o)?[o]:o;return null!=t&&a?.length&&!1!==i.applyPostProcessor&&(t=x.handle(a,t,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,s={}){let i,n,r,o,a;return e(t)&&(t=[t]),Array.isArray(t)&&(t=t.map((t=>"function"==typeof t?S(t,{...this.options,...s}):t))),t.forEach((t=>{if(this.isValidLookup(i))return;const h=this.extractFromKey(t,s),l=h.key;n=l;let c=h.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==s.count&&!e(s.count),d=u&&!s.ordinal&&0===s.count,p=void 0!==s.context&&(e(s.context)||"number"==typeof s.context)&&""!==s.context,f=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);c.forEach((t=>{this.isValidLookup(i)||(a=t,this.checkedLoadedFor[`${f[0]}-${t}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(a)||(this.checkedLoadedFor[`${f[0]}-${t}`]=!0,this.logger.warn(`key "${n}" for languages "${f.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((e=>{if(this.isValidLookup(i))return;o=e;const n=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(n,l,e,t,s);else{let t;u&&(t=this.pluralResolver.getSuffix(e,s.count,s));const i=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(s.ordinal&&t.startsWith(r)&&n.push(l+t.replace(r,this.options.pluralSeparator)),n.push(l+t),d&&n.push(l+i)),p){const e=`${l}${this.options.contextSeparator||"_"}${s.context}`;n.push(e),u&&(s.ordinal&&t.startsWith(r)&&n.push(e+t.replace(r,this.options.pluralSeparator)),n.push(e+t),d&&n.push(e+i))}}let a;for(;a=n.pop();)this.isValidLookup(i)||(r=a,i=this.getResource(e,t,a,s))})))}))})),{res:i,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:a}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,e,s,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,e,s,i):this.resourceStore.getResource(t,e,s,i)}getUsedParamsDetails(t={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!e(t.replace);let n=i?t.replace:t;if(i&&void 0!==t.count&&(n.count=t.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!i){n={...n};for(const t of s)delete n[t]}return n}static hasDefaultValue(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&e.startsWith("defaultValue")&&void 0!==t[e])return!0;return!1}}class P{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=v.create("languageUtils")}getScriptPartFromCode(t){if(!(t=m(t))||!t.includes("-"))return null;const e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}getLanguagePartFromCode(t){if(!(t=m(t))||!t.includes("-"))return t;const e=t.split("-");return this.formatLanguageCode(e[0])}formatLanguageCode(t){if(e(t)&&t.includes("-")){let e;try{e=Intl.getCanonicalLocales(t)[0]}catch(t){}return e&&this.options.lowerCaseLng&&(e=e.toLowerCase()),e||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let e;return t.forEach((t=>{if(e)return;const s=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(s)||(e=s)})),!e&&this.options.supportedLngs&&t.forEach((t=>{if(e)return;const s=this.getScriptPartFromCode(t);if(this.isSupportedCode(s))return e=s;const i=this.getLanguagePartFromCode(t);if(this.isSupportedCode(i))return e=i;e=this.options.supportedLngs.find((t=>!(t!==i&&(!t.includes("-")&&!i.includes("-")||(!t.includes("-")||i.includes("-")||t.slice(0,t.indexOf("-"))!==i)&&!(t.startsWith(i)&&i.length>1)))))})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e}getFallbackCodes(t,s){if(!t)return[];if("function"==typeof t&&(t=t(s)),e(t)&&(t=[t]),Array.isArray(t))return t;if(!s)return t.default||[];let i=t[s];return i||(i=t[this.getScriptPartFromCode(s)]),i||(i=t[this.formatLanguageCode(s)]),i||(i=t[this.getLanguagePartFromCode(s)]),i||(i=t.default),i||[]}toResolveHierarchy(t,s){const i=this.getFallbackCodes((!1===s?[]:s)||this.options.fallbackLng||[],t),n=[],r=t=>{t&&(this.isSupportedCode(t)?n.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return e(t)&&(t.includes("-")||t.includes("_"))?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(t))):e(t)&&r(this.formatLanguageCode(t)),i.forEach((t=>{n.includes(t)||r(this.formatLanguageCode(t))})),n}}const N={zero:0,one:1,two:2,few:3,many:4,other:5},R={select:t=>1===t?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class L{constructor(t,e={}){this.languageUtils=t,this.options=e,this.logger=v.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,e={}){const s=m("dev"===t?"en":t),i=e.ordinal?"ordinal":"cardinal",n=JSON.stringify({cleanedCode:s,type:i});if(n in this.pluralRulesCache)return this.pluralRulesCache[n];let r;try{r=new Intl.PluralRules(s,{type:i})}catch(s){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),R;if(!t.match(/-|_/))return R;const i=this.languageUtils.getLanguagePartFromCode(t);r=this.getRule(i,e)}return this.pluralRulesCache[n]=r,r}needsPlural(t,e={}){let s=this.getRule(t,e);return s||(s=this.getRule("dev",e)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,e,s={}){return this.getSuffixes(t,s).map((t=>`${e}${t}`))}getSuffixes(t,e={}){let s=this.getRule(t,e);return s||(s=this.getRule("dev",e)),s?s.resolvedOptions().pluralCategories.sort(((t,e)=>N[t]-N[e])).map((t=>`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${t}`)):[]}getSuffix(t,e,s={}){const i=this.getRule(t,s);return i?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(e)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",e,s))}}const D=(t,s,i,n=".",r=!0)=>{let o=((t,e,s)=>{const i=l(t,s);return void 0!==i?i:l(e,s)})(t,s,i);return!o&&r&&e(i)&&(o=y(t,i,n),void 0===o&&(o=y(s,i,n))),o},A=t=>t.replace(/\$/g,"$$$$");class z{constructor(t={}){this.logger=v.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(t=>t),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:e,escapeValue:s,useRawValueToEscape:i,prefix:n,prefixEscaped:r,suffix:o,suffixEscaped:a,formatSeparator:h,unescapeSuffix:l,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:g,nestingSuffixEscaped:y,nestingOptionsSeparator:m,maxReplaces:b,alwaysFormat:$}=t.interpolation;this.escape=void 0!==e?e:p,this.escapeValue=void 0===s||s,this.useRawValueToEscape=void 0!==i&&i,this.prefix=n?u(n):r||"{{",this.suffix=o?u(o):a||"}}",this.formatSeparator=h||",",this.unescapePrefix=l?"":c?u(c):"-",this.unescapeSuffix=this.unescapePrefix?"":l?u(l):"",this.nestingPrefix=d?u(d):f||u("$t("),this.nestingSuffix=g?u(g):y||u(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=b||1e3,this.alwaysFormat=void 0!==$&&$,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(t,e)=>t?.source===e?(t.lastIndex=0,t):new RegExp(e,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,s,n,r){let o,a,h;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=t=>{if(!t.includes(this.formatSeparator)){const e=D(s,l,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(e,void 0,n,{...r,...s,interpolationkey:t}):e}const e=t.split(this.formatSeparator),i=e.shift().trim(),o=e.join(this.formatSeparator).trim();return this.format(D(s,l,i,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...s,interpolationkey:i})};this.resetRegExp(),!this.escapeValue&&"string"==typeof t&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const u=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=void 0!==r?.interpolation?.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>A(t)},{regex:this.regexp,safeValue:t=>A(this.escapeValue?this.escape(t):t)}].forEach((s=>{for(h=0;o=s.regex.exec(t);){const n=o[1].trim();if(a=c(n),void 0===a)if("function"==typeof u){const s=u(t,o,r);a=e(s)?s:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a="";else{if(d){a=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${t}`),a=""}else e(a)||this.useRawValueToEscape||(a=i(a));const l=s.safeValue(a);if(t=t.replace(o[0],l),d?(s.regex.lastIndex+=a.length,s.regex.lastIndex-=o[0].length):s.regex.lastIndex=0,h++,h>=this.maxReplaces)break}})),t}nest(t,s,n={}){let r,o,a;const h=(t,e)=>{const s=this.nestingOptionsSeparator;if(!t.includes(s))return t;const i=t.split(new RegExp(`${u(s)}[ ]*{`));let n=`{${i[1]}`;t=i[0],n=this.interpolate(n,a);const r=n.match(/'/g),o=n.match(/"/g);((r?.length??0)%2==0&&!o||(o?.length??0)%2!=0)&&(n=n.replace(/'/g,'"'));try{a=JSON.parse(n),e&&(a={...e,...a})}catch(e){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,e),`${t}${s}${n}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,t};for(;r=this.nestingRegexp.exec(t);){let l=[];a={...n},a=a.replace&&!e(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const c=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==c&&(l=r[1].slice(c).split(this.formatSeparator).map((t=>t.trim())).filter(Boolean),r[1]=r[1].slice(0,c)),o=s(h.call(this,r[1].trim(),a),a),o&&r[0]===t&&!e(o))return o;e(o)||(o=i(o)),o||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${t}`),o=""),l.length&&(o=l.reduce(((t,e)=>this.format(t,e,n.lng,{...n,interpolationkey:r[1].trim()})),o.trim())),t=t.replace(r[0],o),this.regexp.lastIndex=0}return t}}const C=t=>{const e={};return(s,i,n)=>{let r=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(r={...r,[n.interpolationkey]:void 0});const o=i+JSON.stringify(r);let a=e[o];return a||(a=t(m(i),n),e[o]=a),a(s)}},I=t=>(e,s,i)=>t(m(s),i)(e);class B{constructor(t={}){this.logger=v.create("formatter"),this.options=t,this.init(t)}init(t,e={interpolation:{}}){this.formatSeparator=e.interpolation.formatSeparator||",";const s=e.cacheInBuiltFormats?C:I;this.formats={number:s(((t,e)=>{const s=new Intl.NumberFormat(t,{...e});return t=>s.format(t)})),currency:s(((t,e)=>{const s=new Intl.NumberFormat(t,{...e,style:"currency"});return t=>s.format(t)})),datetime:s(((t,e)=>{const s=new Intl.DateTimeFormat(t,{...e});return t=>s.format(t)})),relativetime:s(((t,e)=>{const s=new Intl.RelativeTimeFormat(t,{...e});return t=>s.format(t,e.range||"day")})),list:s(((t,e)=>{const s=new Intl.ListFormat(t,{...e});return t=>s.format(t)}))}}add(t,e){this.formats[t.toLowerCase().trim()]=e}addCached(t,e){this.formats[t.toLowerCase().trim()]=C(e)}format(t,e,s,i={}){if(!e)return t;if(null==t)return t;const n=e.split(this.formatSeparator),r=[];for(let t=0;t<n.length;t++){let e=n[t];for(;e.indexOf("(")>-1&&!e.includes(")")&&t+1<n.length;)e=`${e}${this.formatSeparator}${n[++t]}`;r.push(e)}return r.reduce(((t,e)=>{const{formatName:n,formatOptions:r}=(t=>{let e=t.toLowerCase().trim();const s={};if(t.includes("(")){const i=t.split("(");e=i[0].toLowerCase().trim();const n=i[1].slice(0,-1);"currency"!==e||n.includes(":")?"relativetime"!==e||n.includes(":")?n.split(";").forEach((t=>{if(t){const[e,...i]=t.split(":"),n=i.join(":").trim().replace(/^'+|'+$/g,""),r=e.trim();s[r]||(s[r]=n),"false"===n&&(s[r]=!1),"true"===n&&(s[r]=!0),isNaN(n)||(s[r]=parseInt(n,10))}})):s.range||(s.range=n.trim()):s.currency||(s.currency=n.trim())}return{formatName:e,formatOptions:s}})(e);if(this.formats[n]){let e=t;try{const o=i?.formatParams?.[i.interpolationkey]||{};e=this.formats[n](t,o.locale||o.lng||i.locale||i.lng||s,{...r,...i,...o})}catch(t){this.logger.warn(t)}return e}return this.logger.warn(`there was no format function for ${n}`),t}),t)}}class E extends _{constructor(t,e,s,i={}){super(),this.backend=t,this.store=e,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=v.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(s,i.backend,i)}queueLoad(t,e,s,i){const n={},r={},o={},a={};return t.forEach((t=>{let i=!0;e.forEach((e=>{const o=`${t}|${e}`;!s.reload&&this.store.hasResourceBundle(t,e)?this.state[o]=2:this.state[o]<0||(1===this.state[o]?void 0===r[o]&&(r[o]=!0):(this.state[o]=1,i=!1,void 0===r[o]&&(r[o]=!0),void 0===n[o]&&(n[o]=!0),void 0===a[e]&&(a[e]=!0)))})),i||(o[t]=!0)})),(Object.keys(n).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(n),pending:Object.keys(r),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(a)}}loaded(t,e,s){const i=t.split("|"),n=i[0],r=i[1];e&&this.emit("failedLoading",n,r,e),!e&&s&&this.store.addResourceBundle(n,r,s,void 0,void 0,{skipCopy:!0}),this.state[t]=e?-1:2,e&&s&&(this.state[t]=0);const o={};this.queue.forEach((s=>{((t,e,s)=>{const{obj:i,k:n}=a(t,e,Object);i[n]=i[n]||[],i[n].push(s)})(s.loaded,[n],r),((t,e)=>{void 0!==t.pending[e]&&(delete t.pending[e],t.pendingCount--)})(s,t),e&&s.errors.push(e),0!==s.pendingCount||s.done||(Object.keys(s.loaded).forEach((t=>{o[t]||(o[t]={});const e=s.loaded[t];e.length&&e.forEach((e=>{void 0===o[t][e]&&(o[t][e]=!0)}))})),s.done=!0,s.errors.length?s.callback(s.errors):s.callback())})),this.emit("loaded",o),this.queue=this.queue.filter((t=>!t.done))}read(t,e,s,i=0,n=this.retryTimeout,r){if(!t.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:e,fcName:s,tried:i,wait:n,callback:r});this.readingCalls++;const o=(o,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}o&&a&&i<this.maxRetries?setTimeout((()=>{this.read(t,e,s,i+1,2*n,r)}),n):r(o,a)},a=this.backend[s].bind(this.backend);if(2!==a.length)return a(t,e,o);try{const s=a(t,e);s&&"function"==typeof s.then?s.then((t=>o(null,t))).catch(o):o(null,s)}catch(t){o(t)}}prepareLoading(t,s,i={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();e(t)&&(t=this.languageUtils.toResolveHierarchy(t)),e(s)&&(s=[s]);const r=this.queueLoad(t,s,i,n);if(!r.toLoad.length)return r.pending.length||n(),null;r.toLoad.forEach((t=>{this.loadOne(t)}))}load(t,e,s){this.prepareLoading(t,e,{},s)}reload(t,e,s){this.prepareLoading(t,e,{reload:!0},s)}loadOne(t,e=""){const s=t.split("|"),i=s[0],n=s[1];this.read(i,n,"read",void 0,void 0,((s,r)=>{s&&this.logger.warn(`${e}loading namespace ${n} for language ${i} failed`,s),!s&&r&&this.logger.log(`${e}loaded namespace ${n} for language ${i}`,r),this.loaded(t,s,r)}))}saveMissing(t,e,s,i,n,r={},o=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(e)){if(null!=s&&""!==s){if(this.backend?.create){const a={...r,isUpdate:n},h=this.backend.create.bind(this.backend);if(h.length<6)try{let n;n=5===h.length?h(t,e,s,i,a):h(t,e,s,i),n&&"function"==typeof n.then?n.then((t=>o(null,t))).catch(o):o(null,n)}catch(t){o(t)}else h(t,e,s,i,o,a)}t&&t[0]&&this.store.addResource(t[0],e,s,i)}}else this.logger.warn(`did not save key "${s}" as the namespace "${e}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const K=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let s={};if("object"==typeof t[1]&&(s=t[1]),e(t[1])&&(s.defaultValue=t[1]),e(t[2])&&(s.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const e=t[3]||t[2];Object.keys(e).forEach((t=>{s[t]=e[t]}))}return s},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),F=t=>(e(t.ns)&&(t.ns=[t.ns]),e(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),e(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),T=()=>{};class V extends _{constructor(t={},e){var s;if(super(),this.options=F(t),this.services={},this.logger=v,this.modules={external:[]},s=this,Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach((t=>{"function"==typeof s[t]&&(s[t]=s[t].bind(s))})),e&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,e),this;setTimeout((()=>{this.init(t,e)}),0)}}init(t={},i){this.isInitializing=!0,"function"==typeof t&&(i=t,t={}),null==t.defaultNS&&t.ns&&(e(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const n=K();this.options={...n,...this.options,...F(t)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);const r=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let t;v.init(this.modules.logger?r(this.modules.logger):null,this.options),t=this.modules.formatter?this.modules.formatter:B;const e=new P(this.options);this.store=new w(this.options.resources,this.options);const s=this.services;s.logger=v,s.resourceStore=this.store,s.languageUtils=e,s.pluralResolver=new L(e,{prepend:this.options.pluralSeparator}),t&&(s.formatter=r(t),s.formatter.init&&s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new z(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new E(r(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",((t,...e)=>{this.emit(t,...e)})),this.modules.languageDetector&&(s.languageDetector=r(this.modules.languageDetector),s.languageDetector.init&&s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=r(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new O(this.services,this.options),this.translator.on("*",((t,...e)=>{this.emit(t,...e)})),this.modules.external.forEach((t=>{t.init&&t.init(this)}))}if(this.format=this.options.interpolation.format,i||(i=T),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=(...e)=>this.store[t](...e)})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=(...e)=>(this.store[t](...e),this)}));const o=s(),a=()=>{const t=(t,e)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(e),i(t,e)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),o}loadResources(t,s=T){let i=s;const n=e(t)?t:this.language;if("function"==typeof t&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===n?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return i();const t=[],e=e=>{e&&"cimode"!==e&&this.services.languageUtils.toResolveHierarchy(e).forEach((e=>{"cimode"!==e&&(t.includes(e)||t.push(e))}))};n?e(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((t=>e(t))),this.options.preload?.forEach?.((t=>e(t))),this.services.backendConnector.load(t,this.options.ns,(t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),i(t)}))}else i(null)}reloadResources(t,e,i){const n=s();return"function"==typeof t&&(i=t,t=void 0),"function"==typeof e&&(i=e,e=void 0),t||(t=this.languages),e||(e=this.options.ns),i||(i=T),this.services.backendConnector.reload(t,e,(t=>{n.resolve(),i(t)})),n}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&x.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!["cimode","dev"].includes(t)){for(let t=0;t<this.languages.length;t++){const e=this.languages[t];if(!["cimode","dev"].includes(e)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}this.resolvedLanguage||this.languages.includes(t)||!this.store.hasLanguageSomeTranslations(t)||(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,i){this.isLanguageChangingTo=t;const n=s();this.emit("languageChanging",t);const r=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},o=(e,s)=>{s?this.isLanguageChangingTo===t&&(r(s),this.translator.changeLanguage(s),this.isLanguageChangingTo=void 0,this.emit("languageChanged",s),this.logger.log("languageChanged",s)):this.isLanguageChangingTo=void 0,n.resolve(((...t)=>this.t(...t))),i&&i(e,((...t)=>this.t(...t)))},a=s=>{t||s||!this.services.languageDetector||(s=[]);const i=e(s)?s:s&&s[0],n=this.store.hasLanguageSomeTranslations(i)?i:this.services.languageUtils.getBestMatchFromCodes(e(s)?[s]:s);n&&(this.language||r(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector?.cacheUserLanguage?.(n)),this.loadResources(n,(t=>{o(t,n)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t):a(this.services.languageDetector.detect()),n}getFixedT(t,s,i,n){const r=n?.scopeNs,o=(t,e,...s)=>{let n;n="object"!=typeof e?this.options.overloadTranslationOptionHandler([t,e].concat(s)):{...e},n.lng=n.lng||o.lng,n.lngs=n.lngs||o.lngs;const a=null!=n.ns;n.ns=n.ns||o.ns,""!==n.keyPrefix&&(n.keyPrefix=n.keyPrefix||i||o.keyPrefix);const h={...this.options,...n};Array.isArray(r)&&!a&&(h.ns=r),"function"==typeof n.keyPrefix&&(n.keyPrefix=S(n.keyPrefix,h));const l=this.options.keySeparator||".";let c;return n.keyPrefix&&Array.isArray(t)?c=t.map((t=>("function"==typeof t&&(t=S(t,h)),`${n.keyPrefix}${l}${t}`))):("function"==typeof t&&(t=S(t,h)),c=n.keyPrefix?`${n.keyPrefix}${l}${t}`:t),this.t(c,n)};return e(t)?o.lng=t:o.lngs=t,o.ns=s,o.keyPrefix=i,o}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,e={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=e.lng||this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,n=this.languages[this.languages.length-1];if("cimode"===s.toLowerCase())return!0;const r=(t,e)=>{const s=this.services.backendConnector.state[`${t}|${e}`];return-1===s||0===s||2===s};if(e.precheck){const t=e.precheck(this,r);if(void 0!==t)return t}return!(!this.hasResourceBundle(s,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!r(s,t)||i&&!r(n,t)))}loadNamespaces(t,i){const n=s();return this.options.ns?(e(t)&&(t=[t]),t.forEach((t=>{this.options.ns.includes(t)||this.options.ns.push(t)})),this.loadResources((t=>{n.resolve(),i&&i(t)})),n):(i&&i(),Promise.resolve())}loadLanguages(t,i){const n=s();e(t)&&(t=[t]);const r=this.options.preload||[],o=t.filter((t=>!r.includes(t)&&this.services.languageUtils.isSupportedCode(t)));return o.length?(this.options.preload=r.concat(o),this.loadResources((t=>{n.resolve(),i&&i(t)})),n):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const e=new Intl.Locale(t);if(e&&e.getTextInfo){const t=e.getTextInfo();if(t&&t.direction)return t.direction}}catch(t){}const e=this.services?.languageUtils||new P(K());return t.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].includes(e.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},e){const s=new V(t,e);return s.createInstance=V.createInstance,s}cloneInstance(t={},e=T){const s=t.forkResourceStore;s&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},n=new V(i);if(void 0===t.debug&&void 0===t.prefix||(n.logger=n.logger.clone(t)),["store","services","language"].forEach((t=>{n[t]=this[t]})),n.services={...this.services},n.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},s){const t=Object.keys(this.store.data).reduce(((t,e)=>(t[e]={...this.store.data[e]},t[e]=Object.keys(t[e]).reduce(((s,i)=>(s[i]={...t[e][i]},s)),t[e]),t)),{});n.store=new w(t,i),n.services.resourceStore=n.store}if(t.interpolation){const e={...K().interpolation,...this.options.interpolation,...t.interpolation},s={...i,interpolation:e};n.services.interpolator=new z(s)}return n.translator=new O(n.services,i),n.translator.on("*",((t,...e)=>{n.emit(t,...e)})),n.init(i,e),n.translator.options=i,n.translator.backendConnector.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},n}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const W=V.createInstance();var M,H={login_dialog:{heading:"Drucke mit ezeep Blue",description:"Melde dich mit deinem ezeep Blue-Konto an, um zu drucken.",action:"Anmelden"},no_document_dialog:{heading:"Keine Datei ausgewählt",description:"Wähle zunächst eine Datei zum Drucken aus.",action:"OK"},printer_selection:{loading:"Lade meine Drucker…",print:"Drucken",printer:"Drucker",print_processing:"Drucken…",print_success:"Erfolgreich gedruckt.",print_failed:"Druck fehlgeschlagen",print_timeout:"Das dauert länger als erwartet. Der Auftrag wird möglicherweise noch auf dem Drucker fertiggestellt.",not_supported:"Der ausgewählte Dateityp wird nicht unterstützt.",color:"Farbe",orientation:"Ausrichtung",size:"Papierformat",duplex:"Beidseitig",quality:"Druckqualität",select_printer:"Wähle einen Drucker",select_color:"Wähle Farbe/Graustufen",select_size:"Wähle Papierformat",select_orientation:"Wähle Ausrichtung",select_quality:"Wähle Druckqualität",select_duplex:"Wähle Beidseitig",color_color:"Farbe",color_grayscale:"Graustufen",orientation_portrait:"Hochformat",orientation_landscape:"Querformat",unknown_location:"Unbekannter Standort",no_printers:"Keine Drucker gefunden.",prepare_upload:"Vorbereiten…",uploading:"Hochladen…",duplex_none:"Keine",copies:"Kopien",duplex_long:"auf der langen Seite umdrehen",duplex_short:"auf der kurzen Seite umdrehen",pull_print_success:"Bereit zum Auslösen.",width:"Breite",length:"Länge",trays:"Papierfach",select_trays:"Wähle Papierfach",page_ranges:"Druckbereich",paper_ranges:"Papier-Ranges",files_selected:"{{count}} Dateien ausgewählt",files:"Dateien"},button_actions:{login:"Anmelden",print:"Drucken",cancel:"Abbrechen",close:"Schließen",retry:"Wiederholen",select_printer:"Wähle Drucker"},upload:{description:"Ziehe Dateien hier in den Browser ",meta_leading:"oder",meta_select:"wähle Dateien aus",meta_trailing:"um mit ezeep Blue zu drucken.",selected_files:"Ausgewählte Dateien:"},user_menu:{theme:"Farbschema",appearance:"Darstellung",system:"System",light:"Hell",dark:"Dunkel",account:"Konto verwalten",help:"Hilfe & Unterstützung",logout:"Ausloggen"}},U={login_dialog:{heading:"Print with ezeep Blue",description:"Sign in with your ezeep Blue account to print.",action:"Sign in"},no_document_dialog:{heading:"No file selected",description:"Select a file first to print.",action:"OK"},printer_selection:{loading:"Loading My Printers…",print_processing:"Printing…",print_success:"Successfully printed.",pull_print_success:"Ready to be released.",print_failed:"Print failed",print_timeout:"This is taking longer than expected. The job may still finish on the printer.",not_supported:"The selected file type is not supported.",prepare_upload:"Preparing…",uploading:"Uploading…",print:"Print",printer:"Printer",color:"Color",orientation:"Orientation",size:"Paper Size",duplex:"Double-sided",duplex_none:"None",duplex_long:"flip on long side",duplex_short:"flip on short side",quality:"Print Quality",select_printer:"Select a printer",select_color:"Select Color/Grayscale",select_orientation:"Select Orientation",select_size:"Select Paper Size",select_quality:"Select Print Quality",select_duplex:"Select Double-sided",color_color:"Color",color_grayscale:"Grayscale",orientation_portrait:"Portrait",orientation_landscape:"Landscape",unknown_location:"Unknown location",no_printers:"No printers found.",copies:"Copies",width:"Width",length:"Length",trays:"Tray",select_trays:"Select Tray",page_ranges:"Page Ranges",paper_ranges:"Paper Ranges",files_selected:"{{count}} files selected",files:"files"},button_actions:{login:"Sign In",print:"Print",cancel:"Cancel",close:"Close",retry:"Retry",select_printer:"Select Printer"},upload:{description:"Drop files here into the browser ",meta_leading:"or",meta_select:"select files",meta_trailing:"to print with ezeep Blue.",selected_files:"Selected Files:"},user_menu:{theme:"Color theme",appearance:"Appearance",system:"System",light:"Light",dark:"Dark",account:"Manage Account",help:"Help & Support",logout:"Logout"}};!function(t){t[t.Success=0]="Success",t[t.Processing=1246]="Processing",t[t.Rendering=129]="Rendering",t[t.Failed=3011]="Failed",t[t.Error=2]="Error"}(M||(M={}));const q=[M.Processing,M.Rendering],J=[M.Failed,M.Error],G=[412,500,503,1048579],Y=412,Q=804,Z=201,X=256,tt=2e3,et=Math.ceil(300),st=3e4,it=1800;function nt(e){const s=()=>t(e);return W.on("languageChanged",s),()=>W.off("languageChanged",s)}function rt(t){return Object.keys(t).map((e=>encodeURIComponent(e)+"="+encodeURIComponent(t[e]))).join("&")}function ot(t){const e={en:{translation:U},de:{translation:H}};W.init(""!=t?{resources:e,lng:t,nsSeparator:!1,fallbackLng:"en"}:{resources:e,lng:navigator.language,nsSeparator:!1,fallbackLng:"en"})}const at=async({fn:t,validate:e,interval:s,maxAttempts:i})=>{let n=0;const r=async(o,a)=>{const h=await t();return n++,e(h)?o(h):i&&n===i?a(new Error("Exceeded max attempts.")):void setTimeout(r,s,o,a)};return new Promise(r)},ht=t=>{const e={};return Object.keys(t).forEach((s=>{""!==t[s]&&(e[s]=t[s])})),e},lt=t=>(256!=t.paperid&&(delete t.paperlength,delete t.paperwidth),t.paperlength&&t.paperwidth&&(t.paperlength=10*+t.paperlength,t.paperwidth=10*+t.paperwidth),t),ct=t=>t.replace(/,/g,";"),ut=t=>{if(!t)return!0;if(!/^(\d+(-\d+)?(,\d+(-\d+)?)*|(\d+,\d+(-\d+)?(,\d+(-\d+)?)*)+)$/.test(t))return!1;const e=t.split(",");for(let t=0;t<e.length;t++){const s=e[t].trim();if(s.includes("-")){const[t,e]=s.split("-"),i=parseInt(t),n=parseInt(e);if(isNaN(i)||isNaN(n)||i>n||i<=0)return!1}else{const t=parseInt(s);if(isNaN(t)||t<=0)return!1}}return!0};export{Z as B,J as F,G as H,M as J,et as M,q as P,it as T,ot as a,Q as b,tt as c,st as d,Y as e,ct as f,X as g,rt as h,W as i,lt as m,at as p,ht as r,nt as s,ut as v}
|