@ezeep/ezeep-js 1.0.139 → 1.0.140
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/ezeep.cjs.js +1 -1
- package/dist/cjs/ezp-auth_12.cjs.entry.js +108 -39
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +108 -37
- package/dist/collection/components/ezp-printing/ezp-printing.js +18 -1
- package/dist/collection/services/print.js +17 -1
- package/dist/custom-elements/index.js +110 -41
- package/dist/directives/proxies.ts +4 -4
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/ezp-auth_12.entry.js +108 -39
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_12.entry.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/p-0711b970.entry.js +1 -0
- package/dist/ezeep/p-c488ee3f.system.js +1 -1
- package/dist/ezeep/{p-1922e5fe.system.entry.js → p-e8c8adc1.system.entry.js} +1 -1
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +3 -1
- package/dist/types/components/ezp-printing/ezp-printing.d.ts +1 -0
- package/dist/types/components.d.ts +4 -0
- package/dist/types/services/print.d.ts +8 -1
- package/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/p-0711b970.entry.js +1 -0
- package/www/build/p-c488ee3f.system.js +1 -1
- package/www/build/{p-1922e5fe.system.entry.js → p-e8c8adc1.system.entry.js} +1 -1
- package/dist/ezeep/p-649f6d96.entry.js +0 -1
- package/www/build/p-649f6d96.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,r,o){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o["throw"](e))}catch(e){n(e)}}function l(e){e.done?r(e.value):i(e.value).then(a,s)}l((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,i,n,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return l([e,t])}}function l(a){if(o)throw new TypeError("Generator is already executing.");while(r)try{if(o=1,i&&(n=a[0]&2?i["return"]:a[0]?i["throw"]||((n=i["return"])&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;if(i=0,n)a=[a[0]&2,n.value];switch(a[0]){case 0:case 1:n=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;i=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(n=r.trys,n=n.length>0&&n[n.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!n||a[1]>n[0]&&a[1]<n[3])){r.label=a[1];break}if(a[0]===6&&r.label<n[1]){r.label=n[1];n=a;break}if(n&&r.label<n[2]){r.label=n[2];r.ops.push(a);break}if(n[2])r.ops.pop();r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e];i=0}finally{o=n=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{g as getRenderingRef,f as forceUpdate,r as registerInstance,c as createEvent,h,H as Host,a as getElement,d as getAssetPath}from"./index-9ecf6ae0.js";var appendToMap=function(e,t,r){var o=e.get(t);if(!o){e.set(t,[r])}else if(!o.includes(r)){o.push(r)}};var debounce=function(e,t){var r;return function(){var o=[];for(var i=0;i<arguments.length;i++){o[i]=arguments[i]}if(r){clearTimeout(r)}r=setTimeout((function(){r=0;e.apply(void 0,o)}),t)}};var isConnected=function(e){return!("isConnected"in e)||e.isConnected};var cleanupElements=debounce((function(e){for(var t=0,r=e.keys();t<r.length;t++){var o=r[t];e.set(o,e.get(o).filter(isConnected))}}),2e3);var stencilSubscription=function(e){var t=e.on;var r=new Map;if(typeof getRenderingRef==="function"){t("dispose",(function(){r.clear()}));t("get",(function(e){var t=getRenderingRef();if(t){appendToMap(r,e,t)}}));t("set",(function(e){var t=r.get(e);if(t){r.set(e,t.filter(forceUpdate))}cleanupElements(r)}));t("reset",(function(){r.forEach((function(e){return e.forEach(forceUpdate)}));cleanupElements(r)}))}};var createObservableMap=function(e,t){if(t===void 0){t=function(e,t){return e!==t}}var r=new Map(Object.entries(e!==null&&e!==void 0?e:{}));var o={dispose:[],get:[],set:[],reset:[]};var i=function(){r=new Map(Object.entries(e!==null&&e!==void 0?e:{}));o.reset.forEach((function(e){return e()}))};var n=function(){o.dispose.forEach((function(e){return e()}));i()};var a=function(e){o.get.forEach((function(t){return t(e)}));return r.get(e)};var s=function(e,i){var n=r.get(e);if(t(i,n,e)){r.set(e,i);o.set.forEach((function(t){return t(e,i,n)}))}};var l=typeof Proxy==="undefined"?{}:new Proxy(e,{get:function(e,t){return a(t)},ownKeys:function(e){return Array.from(r.keys())},getOwnPropertyDescriptor:function(){return{enumerable:true,configurable:true}},has:function(e,t){return r.has(t)},set:function(e,t,r){s(t,r);return true}});var c=function(e,t){o[e].push(t);return function(){removeFromArray(o[e],t)}};var u=function(t,r){var o=c("set",(function(e,o){if(e===t){r(o)}}));var i=c("reset",(function(){return r(e[t])}));return function(){o();i()}};var p=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return e.forEach((function(e){if(e.set){c("set",e.set)}if(e.get){c("get",e.get)}if(e.reset){c("reset",e.reset)}}))};var d=function(e){var t=r.get(e);o.set.forEach((function(r){return r(e,t,t)}))};return{state:l,get:a,set:s,on:c,onChange:u,use:p,dispose:n,reset:i,forceUpdate:d}};var removeFromArray=function(e,t){var r=e.indexOf(t);if(r>=0){e[r]=e[e.length-1];e.length--}};var createStore=function(e,t){var r=createObservableMap(e,t);stencilSubscription(r);return r};function _typeof$1(e){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof$1=function e(t){return typeof t}}else{_typeof$1=function e(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}}return _typeof$1(e)}function _defineProperty(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?Object(arguments[t]):{};var o=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))}o.forEach((function(t){_defineProperty(e,t,r[t])}))}return e}function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||false;o.configurable=true;if("value"in o)o.writable=true;Object.defineProperty(e,o.key,o)}}function _createClass(e,t,r){if(t)_defineProperties(e.prototype,t);if(r)_defineProperties(e,r);return e}function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function createCommonjsModule(e,t,r){return r={path:t,exports:{},require:function(e,t){return commonjsRequire()}},e(r,r.exports),r.exports}function getAugmentedNamespace(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:true});Object.keys(e).forEach((function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:true,get:function(){return e[r]}})}));return t}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var _typeof_1=createCommonjsModule((function(e){function t(r){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){e.exports=t=function e(t){return typeof t};e.exports["default"]=e.exports,e.exports.__esModule=true}else{e.exports=t=function e(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.exports["default"]=e.exports,e.exports.__esModule=true}return t(r)}e.exports=t;e.exports["default"]=e.exports,e.exports.__esModule=true}));var _typeof=getDefaultExportFromCjs(_typeof_1);function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _possibleConstructorReturn(e,t){if(t&&(_typeof(t)==="object"||typeof t==="function")){return t}return _assertThisInitialized(e)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function e(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(e)}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function e(t,r){t.__proto__=r;return t};return _setPrototypeOf(e,t)}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)_setPrototypeOf(e,t)}var consoleLogger={type:"logger",log:function e(t){this.output("log",t)},warn:function e(t){this.output("warn",t)},error:function e(t){this.output("error",t)},output:function e(t,r){if(console&&console[t])console[t].apply(console,r)}};var Logger=function(){function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,e);this.init(t,r)}_createClass(e,[{key:"init",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.prefix=r.prefix||"i18next:";this.logger=t||consoleLogger;this.options=r;this.debug=r.debug}},{key:"setDebug",value:function e(t){this.debug=t}},{key:"log",value:function e(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++){r[o]=arguments[o]}return this.forward(r,"log","",true)}},{key:"warn",value:function e(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++){r[o]=arguments[o]}return this.forward(r,"warn","",true)}},{key:"error",value:function e(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++){r[o]=arguments[o]}return this.forward(r,"error","")}},{key:"deprecate",value:function e(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++){r[o]=arguments[o]}return this.forward(r,"warn","WARNING DEPRECATED: ",true)}},{key:"forward",value:function e(t,r,o,i){if(i&&!this.debug)return null;if(typeof t[0]==="string")t[0]="".concat(o).concat(this.prefix," ").concat(t[0]);return this.logger[r](t)}},{key:"create",value:function t(r){return new e(this.logger,_objectSpread({},{prefix:"".concat(this.prefix,":").concat(r,":")},this.options))}}]);return e}();var baseLogger=new Logger;var EventEmitter=function(){function e(){_classCallCheck(this,e);this.observers={}}_createClass(e,[{key:"on",value:function e(t,r){var o=this;t.split(" ").forEach((function(e){o.observers[e]=o.observers[e]||[];o.observers[e].push(r)}));return this}},{key:"off",value:function e(t,r){if(!this.observers[t])return;if(!r){delete this.observers[t];return}this.observers[t]=this.observers[t].filter((function(e){return e!==r}))}},{key:"emit",value:function e(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++){o[i-1]=arguments[i]}if(this.observers[t]){var n=[].concat(this.observers[t]);n.forEach((function(e){e.apply(void 0,o)}))}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach((function(e){e.apply(e,[t].concat(o))}))}}}]);return e}();function defer(){var e;var t;var r=new Promise((function(r,o){e=r;t=o}));r.resolve=e;r.reject=t;return r}function makeString(e){if(e==null)return"";return""+e}function copy(e,t,r){e.forEach((function(e){if(t[e])r[e]=t[e]}))}function getLastOfPath(e,t,r){function o(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||typeof e==="string"}var n=typeof t!=="string"?[].concat(t):t.split(".");while(n.length>1){if(i())return{};var a=o(n.shift());if(!e[a]&&r)e[a]=new r;if(Object.prototype.hasOwnProperty.call(e,a)){e=e[a]}else{e={}}}if(i())return{};return{obj:e,k:o(n.shift())}}function setPath(e,t,r){var o=getLastOfPath(e,t,Object),i=o.obj,n=o.k;i[n]=r}function pushPath(e,t,r,o){var i=getLastOfPath(e,t,Object),n=i.obj,a=i.k;n[a]=n[a]||[];if(o)n[a]=n[a].concat(r);if(!o)n[a].push(r)}function getPath(e,t){var r=getLastOfPath(e,t),o=r.obj,i=r.k;if(!o)return undefined;return o[i]}function getPathWithDefaults(e,t,r){var o=getPath(e,r);if(o!==undefined){return o}return getPath(t,r)}function deepExtend(e,t,r){for(var o in t){if(o!=="__proto__"&&o!=="constructor"){if(o in e){if(typeof e[o]==="string"||e[o]instanceof String||typeof t[o]==="string"||t[o]instanceof String){if(r)e[o]=t[o]}else{deepExtend(e[o],t[o],r)}}else{e[o]=t[o]}}}return e}function regexEscape(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function escape(e){if(typeof e==="string"){return e.replace(/[&<>"'\/]/g,(function(e){return _entityMap[e]}))}return e}var isIE10=typeof window!=="undefined"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1;var chars=[" ",",","?","!",";"];function looksLikeObjectPath(e,t,r){t=t||"";r=r||"";var o=chars.filter((function(e){return t.indexOf(e)<0&&r.indexOf(e)<0}));if(o.length===0)return true;var i=new RegExp("(".concat(o.map((function(e){return e==="?"?"\\?":e})).join("|"),")"));var n=!i.test(e);if(!n){var a=e.indexOf(r);if(a>0&&!i.test(e.substring(0,a))){n=true}}return n}function deepFind(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:".";if(!e)return undefined;if(e[t])return e[t];var o=t.split(r);var i=e;for(var n=0;n<o.length;++n){if(!i)return undefined;if(typeof i[o[n]]==="string"&&n+1<o.length){return undefined}if(i[o[n]]===undefined){var a=2;var s=o.slice(n,n+a).join(r);var l=i[s];while(l===undefined&&o.length>n+a){a++;s=o.slice(n,n+a).join(r);l=i[s]}if(l===undefined)return undefined;if(typeof l==="string")return l;if(s&&typeof l[s]==="string")return l[s];var c=o.slice(n+a).join(r);if(c)return deepFind(l,c,r);return undefined}i=i[o[n]]}return i}var ResourceStore=function(e){_inherits(t,e);function t(e){var r;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{ns:["translation"],defaultNS:"translation"};_classCallCheck(this,t);r=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this));if(isIE10){EventEmitter.call(_assertThisInitialized(r))}r.data=e||{};r.options=o;if(r.options.keySeparator===undefined){r.options.keySeparator="."}if(r.options.ignoreJSONStructure===undefined){r.options.ignoreJSONStructure=true}return r}_createClass(t,[{key:"addNamespaces",value:function e(t){if(this.options.ns.indexOf(t)<0){this.options.ns.push(t)}}},{key:"removeNamespaces",value:function e(t){var r=this.options.ns.indexOf(t);if(r>-1){this.options.ns.splice(r,1)}}},{key:"getResource",value:function e(t,r,o){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var n=i.keySeparator!==undefined?i.keySeparator:this.options.keySeparator;var a=i.ignoreJSONStructure!==undefined?i.ignoreJSONStructure:this.options.ignoreJSONStructure;var s=[t,r];if(o&&typeof o!=="string")s=s.concat(o);if(o&&typeof o==="string")s=s.concat(n?o.split(n):o);if(t.indexOf(".")>-1){s=t.split(".")}var l=getPath(this.data,s);if(l||!a||typeof o!=="string")return l;return deepFind(this.data&&this.data[t]&&this.data[t][r],o,n)}},{key:"addResource",value:function e(t,r,o,i){var n=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{silent:false};var a=this.options.keySeparator;if(a===undefined)a=".";var s=[t,r];if(o)s=s.concat(a?o.split(a):o);if(t.indexOf(".")>-1){s=t.split(".");i=r;r=s[1]}this.addNamespaces(r);setPath(this.data,s,i);if(!n.silent)this.emit("added",t,r,o,i)}},{key:"addResources",value:function e(t,r,o){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{silent:false};for(var n in o){if(typeof o[n]==="string"||Object.prototype.toString.apply(o[n])==="[object Array]")this.addResource(t,r,n,o[n],{silent:true})}if(!i.silent)this.emit("added",t,r,o)}},{key:"addResourceBundle",value:function e(t,r,o,i,n){var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{silent:false};var s=[t,r];if(t.indexOf(".")>-1){s=t.split(".");i=o;o=r;r=s[1]}this.addNamespaces(r);var l=getPath(this.data,s)||{};if(i){deepExtend(l,o,n)}else{l=_objectSpread({},l,o)}setPath(this.data,s,l);if(!a.silent)this.emit("added",t,r,o)}},{key:"removeResourceBundle",value:function e(t,r){if(this.hasResourceBundle(t,r)){delete this.data[t][r]}this.removeNamespaces(r);this.emit("removed",t,r)}},{key:"hasResourceBundle",value:function e(t,r){return this.getResource(t,r)!==undefined}},{key:"getResourceBundle",value:function e(t,r){if(!r)r=this.options.defaultNS;if(this.options.compatibilityAPI==="v1")return _objectSpread({},{},this.getResource(t,r));return this.getResource(t,r)}},{key:"getDataByLanguage",value:function e(t){return this.data[t]}},{key:"hasLanguageSomeTranslations",value:function e(t){var r=this.getDataByLanguage(t);var o=r&&Object.keys(r)||[];return!!o.find((function(e){return r[e]&&Object.keys(r[e]).length>0}))}},{key:"toJSON",value:function e(){return this.data}}]);return t}(EventEmitter);var postProcessor={processors:{},addPostProcessor:function e(t){this.processors[t.name]=t},handle:function e(t,r,o,i,n){var a=this;t.forEach((function(e){if(a.processors[e])r=a.processors[e].process(r,o,i,n)}));return r}};var checkedLoadedFor={};var Translator=function(e){_inherits(t,e);function t(e){var r;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,t);r=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this));if(isIE10){EventEmitter.call(_assertThisInitialized(r))}copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,_assertThisInitialized(r));r.options=o;if(r.options.keySeparator===undefined){r.options.keySeparator="."}r.logger=baseLogger.create("translator");return r}_createClass(t,[{key:"changeLanguage",value:function e(t){if(t)this.language=t}},{key:"exists",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{interpolation:{}};if(t===undefined||t===null){return false}var o=this.resolve(t,r);return o&&o.res!==undefined}},{key:"extractFromKey",value:function e(t,r){var o=r.nsSeparator!==undefined?r.nsSeparator:this.options.nsSeparator;if(o===undefined)o=":";var i=r.keySeparator!==undefined?r.keySeparator:this.options.keySeparator;var n=r.ns||this.options.defaultNS;var a=o&&t.indexOf(o)>-1;var s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!looksLikeObjectPath(t,o,i);if(a&&!s){var l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0){return{key:t,namespaces:n}}var c=t.split(o);if(o!==i||o===i&&this.options.ns.indexOf(c[0])>-1)n=c.shift();t=c.join(i)}if(typeof n==="string")n=[n];return{key:t,namespaces:n}}},{key:"translate",value:function e(r,o,i){var n=this;if(_typeof$1(o)!=="object"&&this.options.overloadTranslationOptionHandler){o=this.options.overloadTranslationOptionHandler(arguments)}if(!o)o={};if(r===undefined||r===null)return"";if(!Array.isArray(r))r=[String(r)];var a=o.keySeparator!==undefined?o.keySeparator:this.options.keySeparator;var s=this.extractFromKey(r[r.length-1],o),l=s.key,c=s.namespaces;var u=c[c.length-1];var p=o.lng||this.language;var d=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&p.toLowerCase()==="cimode"){if(d){var h=o.nsSeparator||this.options.nsSeparator;return u+h+l}return l}var f=this.resolve(r,o);var g=f&&f.res;var v=f&&f.usedKey||l;var m=f&&f.exactUsedKey||l;var y=Object.prototype.toString.apply(g);var b=["[object Number]","[object Function]","[object RegExp]"];var k=o.joinArrays!==undefined?o.joinArrays:this.options.joinArrays;var w=!this.i18nFormat||this.i18nFormat.handleAsObject;var x=typeof g!=="string"&&typeof g!=="boolean"&&typeof g!=="number";if(w&&g&&x&&b.indexOf(y)<0&&!(typeof k==="string"&&y==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){if(!this.options.returnedObjectHandler){this.logger.warn("accessing an object - but returnObjects options is not enabled!")}return this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,g,_objectSpread({},o,{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.")}if(a){var S=y==="[object Array]";var _=S?[]:{};var z=S?m:v;for(var P in g){if(Object.prototype.hasOwnProperty.call(g,P)){var E="".concat(z).concat(a).concat(P);_[P]=this.translate(E,_objectSpread({},o,{joinArrays:false,ns:c}));if(_[P]===E)_[P]=g[P]}}g=_}}else if(w&&typeof k==="string"&&y==="[object Array]"){g=g.join(k);if(g)g=this.extendTranslation(g,r,o,i)}else{var O=false;var C=false;var L=o.count!==undefined&&typeof o.count!=="string";var j=t.hasDefaultValue(o);var R=L?this.pluralResolver.getSuffix(p,o.count,o):"";var A=o["defaultValue".concat(R)]||o.defaultValue;if(!this.isValidLookup(g)&&j){O=true;g=A}if(!this.isValidLookup(g)){C=true;g=l}var T=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey;var I=T&&C?undefined:g;var U=j&&A!==g&&this.options.updateMissing;if(C||O||U){this.logger.log(U?"updateKey":"missingKey",p,u,l,U?A:g);if(a){var H=this.resolve(l,_objectSpread({},o,{keySeparator:false}));if(H&&H.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.")}var N=[];var D=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&D&&D[0]){for(var F=0;F<D.length;F++){N.push(D[F])}}else if(this.options.saveMissingTo==="all"){N=this.languageUtils.toResolveHierarchy(o.lng||this.language)}else{N.push(o.lng||this.language)}var B=function e(t,r,i){if(n.options.missingKeyHandler){n.options.missingKeyHandler(t,u,r,U?i:I,U,o)}else if(n.backendConnector&&n.backendConnector.saveMissing){n.backendConnector.saveMissing(t,u,r,U?i:I,U,o)}n.emit("missingKey",t,u,r,g)};if(this.options.saveMissing){if(this.options.saveMissingPlurals&&L){N.forEach((function(e){n.pluralResolver.getSuffixes(e).forEach((function(t){B([e],l+t,o["defaultValue".concat(t)]||A)}))}))}else{B(N,l,A)}}}g=this.extendTranslation(g,r,o,f,i);if(C&&g===l&&this.options.appendNamespaceToMissingKey)g="".concat(u,":").concat(l);if((C||O)&&this.options.parseMissingKeyHandler)g=this.options.parseMissingKeyHandler(g)}return g}},{key:"extendTranslation",value:function e(t,r,o,i,n){var a=this;if(this.i18nFormat&&this.i18nFormat.parse){t=this.i18nFormat.parse(t,o,i.usedLng,i.usedNS,i.usedKey,{resolved:i})}else if(!o.skipInterpolation){if(o.interpolation)this.interpolator.init(_objectSpread({},o,{interpolation:_objectSpread({},this.options.interpolation,o.interpolation)}));var s=o.interpolation&&o.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;var l;if(s){var c=t.match(this.interpolator.nestingRegexp);l=c&&c.length}var u=o.replace&&typeof o.replace!=="string"?o.replace:o;if(this.options.interpolation.defaultVariables)u=_objectSpread({},this.options.interpolation.defaultVariables,u);t=this.interpolator.interpolate(t,u,o.lng||this.language,o);if(s){var p=t.match(this.interpolator.nestingRegexp);var d=p&&p.length;if(l<d)o.nest=false}if(o.nest!==false)t=this.interpolator.nest(t,(function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++){t[i]=arguments[i]}if(n&&n[0]===t[0]&&!o.context){a.logger.warn("It seems you are nesting recursively key: ".concat(t[0]," in key: ").concat(r[0]));return null}return a.translate.apply(a,t.concat([r]))}),o);if(o.interpolation)this.interpolator.reset()}var h=o.postProcess||this.options.postProcess;var f=typeof h==="string"?[h]:h;if(t!==undefined&&t!==null&&f&&f.length&&o.applyPostProcessor!==false){t=postProcessor.handle(f,t,r,this.options&&this.options.postProcessPassResolved?_objectSpread({i18nResolved:i},o):o,this)}return t}},{key:"resolve",value:function e(t){var r=this;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i;var n;var a;var s;var l;if(typeof t==="string")t=[t];t.forEach((function(e){if(r.isValidLookup(i))return;var t=r.extractFromKey(e,o);var c=t.key;n=c;var u=t.namespaces;if(r.options.fallbackNS)u=u.concat(r.options.fallbackNS);var p=o.count!==undefined&&typeof o.count!=="string";var d=o.context!==undefined&&(typeof o.context==="string"||typeof o.context==="number")&&o.context!=="";var h=o.lngs?o.lngs:r.languageUtils.toResolveHierarchy(o.lng||r.language,o.fallbackLng);u.forEach((function(e){if(r.isValidLookup(i))return;l=e;if(!checkedLoadedFor["".concat(h[0],"-").concat(e)]&&r.utils&&r.utils.hasLoadedNamespace&&!r.utils.hasLoadedNamespace(l)){checkedLoadedFor["".concat(h[0],"-").concat(e)]=true;r.logger.warn('key "'.concat(n,'" for languages "').concat(h.join(", "),'" won\'t get resolved as namespace "').concat(l,'" 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!!!")}h.forEach((function(t){if(r.isValidLookup(i))return;s=t;var n=c;var l=[n];if(r.i18nFormat&&r.i18nFormat.addLookupKeys){r.i18nFormat.addLookupKeys(l,c,t,e,o)}else{var u;if(p)u=r.pluralResolver.getSuffix(t,o.count,o);if(p&&d)l.push(n+u);if(d)l.push(n+="".concat(r.options.contextSeparator).concat(o.context));if(p)l.push(n+=u)}var h;while(h=l.pop()){if(!r.isValidLookup(i)){a=h;i=r.getResource(t,e,h,o)}}}))}))}));return{res:i,usedKey:n,exactUsedKey:a,usedLng:s,usedNS:l}}},{key:"isValidLookup",value:function e(t){return t!==undefined&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}},{key:"getResource",value:function e(t,r,o){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};if(this.i18nFormat&&this.i18nFormat.getResource)return this.i18nFormat.getResource(t,r,o,i);return this.resourceStore.getResource(t,r,o,i)}}],[{key:"hasDefaultValue",value:function e(t){var r="defaultValue";for(var o in t){if(Object.prototype.hasOwnProperty.call(t,o)&&r===o.substring(0,r.length)&&undefined!==t[o]){return true}}return false}}]);return t}(EventEmitter);function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}var LanguageUtil=function(){function e(t){_classCallCheck(this,e);this.options=t;this.supportedLngs=this.options.supportedLngs||false;this.logger=baseLogger.create("languageUtils")}_createClass(e,[{key:"getScriptPartFromCode",value:function e(t){if(!t||t.indexOf("-")<0)return null;var r=t.split("-");if(r.length===2)return null;r.pop();if(r[r.length-1].toLowerCase()==="x")return null;return this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function e(t){if(!t||t.indexOf("-")<0)return t;var r=t.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function e(t){if(typeof t==="string"&&t.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"];var o=t.split("-");if(this.options.lowerCaseLng){o=o.map((function(e){return e.toLowerCase()}))}else if(o.length===2){o[0]=o[0].toLowerCase();o[1]=o[1].toUpperCase();if(r.indexOf(o[1].toLowerCase())>-1)o[1]=capitalize(o[1].toLowerCase())}else if(o.length===3){o[0]=o[0].toLowerCase();if(o[1].length===2)o[1]=o[1].toUpperCase();if(o[0]!=="sgn"&&o[2].length===2)o[2]=o[2].toUpperCase();if(r.indexOf(o[1].toLowerCase())>-1)o[1]=capitalize(o[1].toLowerCase());if(r.indexOf(o[2].toLowerCase())>-1)o[2]=capitalize(o[2].toLowerCase())}return o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function e(t){if(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs){t=this.getLanguagePartFromCode(t)}return!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function e(t){var r=this;if(!t)return null;var o;t.forEach((function(e){if(o)return;var t=r.formatLanguageCode(e);if(!r.options.supportedLngs||r.isSupportedCode(t))o=t}));if(!o&&this.options.supportedLngs){t.forEach((function(e){if(o)return;var t=r.getLanguagePartFromCode(e);if(r.isSupportedCode(t))return o=t;o=r.options.supportedLngs.find((function(e){if(e.indexOf(t)===0)return e}))}))}if(!o)o=this.getFallbackCodes(this.options.fallbackLng)[0];return o}},{key:"getFallbackCodes",value:function e(t,r){if(!t)return[];if(typeof t==="function")t=t(r);if(typeof t==="string")t=[t];if(Object.prototype.toString.apply(t)==="[object Array]")return t;if(!r)return t["default"]||[];var o=t[r];if(!o)o=t[this.getScriptPartFromCode(r)];if(!o)o=t[this.formatLanguageCode(r)];if(!o)o=t[this.getLanguagePartFromCode(r)];if(!o)o=t["default"];return o||[]}},{key:"toResolveHierarchy",value:function e(t,r){var o=this;var i=this.getFallbackCodes(r||this.options.fallbackLng||[],t);var n=[];var a=function e(t){if(!t)return;if(o.isSupportedCode(t)){n.push(t)}else{o.logger.warn("rejecting language code not found in supportedLngs: ".concat(t))}};if(typeof t==="string"&&t.indexOf("-")>-1){if(this.options.load!=="languageOnly")a(this.formatLanguageCode(t));if(this.options.load!=="languageOnly"&&this.options.load!=="currentOnly")a(this.getScriptPartFromCode(t));if(this.options.load!=="currentOnly")a(this.getLanguagePartFromCode(t))}else if(typeof t==="string"){a(this.formatLanguageCode(t))}i.forEach((function(e){if(n.indexOf(e)<0)a(o.formatLanguageCode(e))}));return n}}]);return e}();var sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}];var _rulesPluralsTypes={1:function e(t){return Number(t>1)},2:function e(t){return Number(t!=1)},3:function e(t){return 0},4:function e(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function e(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function e(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function e(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function e(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function e(t){return Number(t>=2)},10:function e(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function e(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function e(t){return Number(t%10!=1||t%100==11)},13:function e(t){return Number(t!==0)},14:function e(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function e(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function e(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function e(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function e(t){return Number(t==0?0:t==1?1:2)},19:function e(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function e(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function e(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function e(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}};var deprecatedJsonVersions=["v1","v2","v3"];var suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5};function createRules(){var e={};sets.forEach((function(t){t.lngs.forEach((function(r){e[r]={numbers:t.nr,plurals:_rulesPluralsTypes[t.fc]}}))}));return e}var PluralResolver=function(){function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,e);this.languageUtils=t;this.options=r;this.logger=baseLogger.create("pluralResolver");if((!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl==="undefined"||!Intl.PluralRules)){this.options.compatibilityJSON="v3";this.logger.error("Your environment seems not to be Inlt API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")}this.rules=createRules()}_createClass(e,[{key:"addRule",value:function e(t,r){this.rules[t]=r}},{key:"getRule",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this.shouldUseIntlApi()){try{return new Intl.PluralRules(t,{type:r.ordinal?"ordinal":"cardinal"})}catch(e){return}}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var o=this.getRule(t,r);if(this.shouldUseIntlApi()){return o&&o.resolvedOptions().pluralCategories.length>1}return o&&o.numbers.length>1}},{key:"getPluralFormsOfKey",value:function e(t,r){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return this.getSuffixes(t,o).map((function(e){return"".concat(r).concat(e)}))}},{key:"getSuffixes",value:function e(t){var r=this;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=this.getRule(t,o);if(!i){return[]}if(this.shouldUseIntlApi()){return i.resolvedOptions().pluralCategories.sort((function(e,t){return suffixesOrder[e]-suffixesOrder[t]})).map((function(e){return"".concat(r.options.prepend).concat(e)}))}return i.numbers.map((function(e){return r.getSuffix(t,e,o)}))}},{key:"getSuffix",value:function e(t,r){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var i=this.getRule(t,o);if(i){if(this.shouldUseIntlApi()){return"".concat(this.options.prepend).concat(i.select(r))}return this.getSuffixRetroCompatible(i,r)}this.logger.warn("no plural rule found for: ".concat(t));return""}},{key:"getSuffixRetroCompatible",value:function e(t,r){var o=this;var i=t.noAbs?t.plurals(r):t.plurals(Math.abs(r));var n=t.numbers[i];if(this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1){if(n===2){n="plural"}else if(n===1){n=""}}var a=function e(){return o.options.prepend&&n.toString()?o.options.prepend+n.toString():n.toString()};if(this.options.compatibilityJSON==="v1"){if(n===1)return"";if(typeof n==="number")return"_plural_".concat(n.toString());return a()}else if(this.options.compatibilityJSON==="v2"){return a()}else if(this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1){return a()}return this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}},{key:"shouldUseIntlApi",value:function e(){return!deprecatedJsonVersions.includes(this.options.compatibilityJSON)}}]);return e}();var Interpolator=function(){function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,e);this.logger=baseLogger.create("interpolator");this.options=t;this.format=t.interpolation&&t.interpolation.format||function(e){return e};this.init(t)}_createClass(e,[{key:"init",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(!t.interpolation)t.interpolation={escapeValue:true};var r=t.interpolation;this.escape=r.escape!==undefined?r.escape:escape;this.escapeValue=r.escapeValue!==undefined?r.escapeValue:true;this.useRawValueToEscape=r.useRawValueToEscape!==undefined?r.useRawValueToEscape:false;this.prefix=r.prefix?regexEscape(r.prefix):r.prefixEscaped||"{{";this.suffix=r.suffix?regexEscape(r.suffix):r.suffixEscaped||"}}";this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",";this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-";this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"";this.nestingPrefix=r.nestingPrefix?regexEscape(r.nestingPrefix):r.nestingPrefixEscaped||regexEscape("$t(");this.nestingSuffix=r.nestingSuffix?regexEscape(r.nestingSuffix):r.nestingSuffixEscaped||regexEscape(")");this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",";this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3;this.alwaysFormat=r.alwaysFormat!==undefined?r.alwaysFormat:false;this.resetRegExp()}},{key:"reset",value:function e(){if(this.options)this.init(this.options)}},{key:"resetRegExp",value:function e(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var o="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(o,"g")}},{key:"interpolate",value:function e(t,r,o,i){var n=this;var a;var s;var l;var c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var p=function e(t){if(t.indexOf(n.formatSeparator)<0){var a=getPathWithDefaults(r,c,t);return n.alwaysFormat?n.format(a,undefined,o,_objectSpread({},i,r,{interpolationkey:t})):a}var s=t.split(n.formatSeparator);var l=s.shift().trim();var u=s.join(n.formatSeparator).trim();return n.format(getPathWithDefaults(r,c,l),u,o,_objectSpread({},i,r,{interpolationkey:l}))};this.resetRegExp();var d=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler;var h=i&&i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;var f=[{regex:this.regexpUnescape,safeValue:function e(t){return u(t)}},{regex:this.regexp,safeValue:function e(t){return n.escapeValue?u(n.escape(t)):u(t)}}];f.forEach((function(e){l=0;while(a=e.regex.exec(t)){s=p(a[1].trim());if(s===undefined){if(typeof d==="function"){var r=d(t,a,i);s=typeof r==="string"?r:""}else if(h){s=a[0];continue}else{n.logger.warn("missed to pass in variable ".concat(a[1]," for interpolating ").concat(t));s=""}}else if(typeof s!=="string"&&!n.useRawValueToEscape){s=makeString(s)}var o=e.safeValue(s);t=t.replace(a[0],o);if(h){e.regex.lastIndex+=o.length;e.regex.lastIndex-=a[0].length}else{e.regex.lastIndex=0}l++;if(l>=n.maxReplaces){break}}}));return t}},{key:"nest",value:function e(t,r){var o=this;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n;var a;var s=_objectSpread({},i);s.applyPostProcessor=false;delete s.defaultValue;function l(e,t){var r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;var o=e.split(new RegExp("".concat(r,"[ ]*{")));var i="{".concat(o[1]);e=o[0];i=this.interpolate(i,s);i=i.replace(/'/g,'"');try{s=JSON.parse(i);if(t)s=_objectSpread({},t,s)}catch(t){this.logger.warn("failed parsing options string in nesting for key ".concat(e),t);return"".concat(e).concat(r).concat(i)}delete s.defaultValue;return e}while(n=this.nestingRegexp.exec(t)){var c=[];var u=false;if(n[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(n[1])){var p=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=p.shift();c=p;u=true}a=r(l.call(this,n[1].trim(),s),s);if(a&&n[0]===t&&typeof a!=="string")return a;if(typeof a!=="string")a=makeString(a);if(!a){this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(t));a=""}if(u){a=c.reduce((function(e,t){return o.format(e,t,i.lng,_objectSpread({},i,{interpolationkey:n[1].trim()}))}),a.trim())}t=t.replace(n[0],a);this.regexp.lastIndex=0}return t}}]);return e}();function remove(e,t){var r=e.indexOf(t);while(r!==-1){e.splice(r,1);r=e.indexOf(t)}}var Connector=function(e){_inherits(t,e);function t(e,r,o){var i;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};_classCallCheck(this,t);i=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this));if(isIE10){EventEmitter.call(_assertThisInitialized(i))}i.backend=e;i.store=r;i.services=o;i.languageUtils=o.languageUtils;i.options=n;i.logger=baseLogger.create("backendConnector");i.state={};i.queue=[];if(i.backend&&i.backend.init){i.backend.init(o,n.backend,n)}return i}_createClass(t,[{key:"queueLoad",value:function e(t,r,o,i){var n=this;var a=[];var s=[];var l=[];var c=[];t.forEach((function(e){var t=true;r.forEach((function(r){var i="".concat(e,"|").concat(r);if(!o.reload&&n.store.hasResourceBundle(e,r)){n.state[i]=2}else if(n.state[i]<0);else if(n.state[i]===1){if(s.indexOf(i)<0)s.push(i)}else{n.state[i]=1;t=false;if(s.indexOf(i)<0)s.push(i);if(a.indexOf(i)<0)a.push(i);if(c.indexOf(r)<0)c.push(r)}}));if(!t)l.push(e)}));if(a.length||s.length){this.queue.push({pending:s,loaded:{},errors:[],callback:i})}return{toLoad:a,pending:s,toLoadLanguages:l,toLoadNamespaces:c}}},{key:"loaded",value:function e(t,r,o){var i=t.split("|");var n=i[0];var a=i[1];if(r)this.emit("failedLoading",n,a,r);if(o){this.store.addResourceBundle(n,a,o)}this.state[t]=r?-1:2;var e={};this.queue.forEach((function(o){pushPath(o.loaded,[n],a);remove(o.pending,t);if(r)o.errors.push(r);if(o.pending.length===0&&!o.done){Object.keys(o.loaded).forEach((function(t){if(!e[t])e[t]=[];if(o.loaded[t].length){o.loaded[t].forEach((function(r){if(e[t].indexOf(r)<0)e[t].push(r)}))}}));o.done=true;if(o.errors.length){o.callback(o.errors)}else{o.callback()}}}));this.emit("loaded",e);this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function e(t,r,o){var i=this;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:350;var s=arguments.length>5?arguments[5]:undefined;if(!t.length)return s(null,{});return this.backend[o](t,r,(function(e,l){if(e&&l&&n<5){setTimeout((function(){i.read.call(i,t,r,o,n+1,a*2,s)}),a);return}s(e,l)}))}},{key:"prepareLoading",value:function e(t,r){var o=this;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n=arguments.length>3?arguments[3]:undefined;if(!this.backend){this.logger.warn("No backend was added via i18next.use. Will not load resources.");return n&&n()}if(typeof t==="string")t=this.languageUtils.toResolveHierarchy(t);if(typeof r==="string")r=[r];var a=this.queueLoad(t,r,i,n);if(!a.toLoad.length){if(!a.pending.length)n();return null}a.toLoad.forEach((function(e){o.loadOne(e)}))}},{key:"load",value:function e(t,r,o){this.prepareLoading(t,r,{},o)}},{key:"reload",value:function e(t,r,o){this.prepareLoading(t,r,{reload:true},o)}},{key:"loadOne",value:function e(t){var r=this;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";var i=t.split("|");var n=i[0];var a=i[1];this.read(n,a,"read",undefined,undefined,(function(e,i){if(e)r.logger.warn("".concat(o,"loading namespace ").concat(a," for language ").concat(n," failed"),e);if(!e&&i)r.logger.log("".concat(o,"loaded namespace ").concat(a," for language ").concat(n),i);r.loaded(t,e,i)}))}},{key:"saveMissing",value:function e(t,r,o,i,n){var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn('did not save key "'.concat(o,'" as the namespace "').concat(r,'" 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!!!");return}if(o===undefined||o===null||o==="")return;if(this.backend&&this.backend.create){this.backend.create(t,r,o,i,null,_objectSpread({},a,{isUpdate:n}))}if(!t||!t[0])return;this.store.addResource(t[0],r,o,i)}}]);return t}(EventEmitter);function get(){return{debug:false,initImmediate:true,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:false,supportedLngs:false,nonExplicitSupportedLngs:false,load:"all",preload:false,simplifyPluralSuffix:true,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:false,saveMissing:false,updateMissing:false,saveMissingTo:"fallback",saveMissingPlurals:true,missingKeyHandler:false,missingInterpolationHandler:false,postProcess:false,postProcessPassResolved:false,returnNull:true,returnEmptyString:true,returnObjects:false,joinArrays:false,returnedObjectHandler:false,parseMissingKeyHandler:false,appendNamespaceToMissingKey:false,appendNamespaceToCIMode:false,overloadTranslationOptionHandler:function e(t){var r={};if(_typeof$1(t[1])==="object")r=t[1];if(typeof t[1]==="string")r.defaultValue=t[1];if(typeof t[2]==="string")r.tDescription=t[2];if(_typeof$1(t[2])==="object"||_typeof$1(t[3])==="object"){var o=t[3]||t[2];Object.keys(o).forEach((function(e){r[e]=o[e]}))}return r},interpolation:{escapeValue:true,format:function e(t,r,o,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:true}}}function transformOptions(e){if(typeof e.ns==="string")e.ns=[e.ns];if(typeof e.fallbackLng==="string")e.fallbackLng=[e.fallbackLng];if(typeof e.fallbackNS==="string")e.fallbackNS=[e.fallbackNS];if(e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0){e.supportedLngs=e.supportedLngs.concat(["cimode"])}return e}function noop(){}var I18n=function(e){_inherits(t,e);function t(){var e;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var o=arguments.length>1?arguments[1]:undefined;_classCallCheck(this,t);e=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this));if(isIE10){EventEmitter.call(_assertThisInitialized(e))}e.options=transformOptions(r);e.services={};e.logger=baseLogger;e.modules={external:[]};if(o&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate){e.init(r,o);return _possibleConstructorReturn(e,_assertThisInitialized(e))}setTimeout((function(){e.init(r,o)}),0)}return e}_createClass(t,[{key:"init",value:function e(){var t=this;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var o=arguments.length>1?arguments[1]:undefined;if(typeof r==="function"){o=r;r={}}if(!r.defaultNS&&r.ns){if(typeof r.ns==="string"){r.defaultNS=r.ns}else if(r.ns.indexOf("translation")<0){r.defaultNS=r.ns[0]}}this.options=_objectSpread({},get(),this.options,transformOptions(r));if(r.keySeparator!==undefined){this.options.userDefinedKeySeparator=r.keySeparator}this.format=this.options.interpolation.format;if(!o)o=noop;function i(e){if(!e)return null;if(typeof e==="function")return new e;return e}if(!this.options.isClone){if(this.modules.logger){baseLogger.init(i(this.modules.logger),this.options)}else{baseLogger.init(null,this.options)}var n=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);var a=this.services;a.logger=baseLogger;a.resourceStore=this.store;a.languageUtils=n;a.pluralResolver=new PluralResolver(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix});a.interpolator=new Interpolator(this.options);a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)};a.backendConnector=new Connector(i(this.modules.backend),a.resourceStore,a,this.options);a.backendConnector.on("*",(function(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++){o[i-1]=arguments[i]}t.emit.apply(t,[e].concat(o))}));if(this.modules.languageDetector){a.languageDetector=i(this.modules.languageDetector);a.languageDetector.init(a,this.options.detection,this.options)}if(this.modules.i18nFormat){a.i18nFormat=i(this.modules.i18nFormat);if(a.i18nFormat.init)a.i18nFormat.init(this)}this.translator=new Translator(this.services,this.options);this.translator.on("*",(function(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++){o[i-1]=arguments[i]}t.emit.apply(t,[e].concat(o))}));this.modules.external.forEach((function(e){if(e.init)e.init(t)}))}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);if(s.length>0&&s[0]!=="dev")this.options.lng=s[0]}if(!this.services.languageDetector&&!this.options.lng){this.logger.warn("init: no languageDetector is used and no lng is defined")}var l=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];l.forEach((function(e){t[e]=function(){var r;return(r=t.store)[e].apply(r,arguments)}}));var c=["addResource","addResources","addResourceBundle","removeResourceBundle"];c.forEach((function(e){t[e]=function(){var r;(r=t.store)[e].apply(r,arguments);return t}}));var u=defer();var p=function e(){var r=function e(r,i){if(t.isInitialized&&!t.initializedStoreOnce)t.logger.warn("init: i18next is already initialized. You should call init just once!");t.isInitialized=true;if(!t.options.isClone)t.logger.log("initialized",t.options);t.emit("initialized",t.options);u.resolve(i);o(r,i)};if(t.languages&&t.options.compatibilityAPI!=="v1"&&!t.isInitialized)return r(null,t.t.bind(t));t.changeLanguage(t.options.lng,r)};if(this.options.resources||!this.options.initImmediate){p()}else{setTimeout(p,0)}return u}},{key:"loadResources",value:function e(t){var r=this;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:noop;var i=o;var n=typeof t==="string"?t:this.language;if(typeof t==="function")i=t;if(!this.options.resources||this.options.partialBundledLanguages){if(n&&n.toLowerCase()==="cimode")return i();var a=[];var s=function e(t){if(!t)return;var o=r.services.languageUtils.toResolveHierarchy(t);o.forEach((function(e){if(a.indexOf(e)<0)a.push(e)}))};if(!n){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.forEach((function(e){return s(e)}))}else{s(n)}if(this.options.preload){this.options.preload.forEach((function(e){return s(e)}))}this.services.backendConnector.load(a,this.options.ns,i)}else{i(null)}}},{key:"reloadResources",value:function e(t,r,o){var i=defer();if(!t)t=this.languages;if(!r)r=this.options.ns;if(!o)o=noop;this.services.backendConnector.reload(t,r,(function(e){i.resolve();o(e)}));return i}},{key:"use",value:function e(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()");if(t.type==="backend"){this.modules.backend=t}if(t.type==="logger"||t.log&&t.warn&&t.error){this.modules.logger=t}if(t.type==="languageDetector"){this.modules.languageDetector=t}if(t.type==="i18nFormat"){this.modules.i18nFormat=t}if(t.type==="postProcessor"){postProcessor.addPostProcessor(t)}if(t.type==="3rdParty"){this.modules.external.push(t)}return this}},{key:"changeLanguage",value:function e(t,r){var o=this;this.isLanguageChangingTo=t;var i=defer();this.emit("languageChanging",t);var n=function e(t){o.language=t;o.languages=o.services.languageUtils.toResolveHierarchy(t);o.resolvedLanguage=undefined;if(["cimode","dev"].indexOf(t)>-1)return;for(var r=0;r<o.languages.length;r++){var i=o.languages[r];if(["cimode","dev"].indexOf(i)>-1)continue;if(o.store.hasLanguageSomeTranslations(i)){o.resolvedLanguage=i;break}}};var a=function e(t,a){if(a){n(a);o.translator.changeLanguage(a);o.isLanguageChangingTo=undefined;o.emit("languageChanged",a);o.logger.log("languageChanged",a)}else{o.isLanguageChangingTo=undefined}i.resolve((function(){return o.t.apply(o,arguments)}));if(r)r(t,(function(){return o.t.apply(o,arguments)}))};var s=function e(r){if(!t&&!r&&o.services.languageDetector)r=[];var i=typeof r==="string"?r:o.services.languageUtils.getBestMatchFromCodes(r);if(i){if(!o.language){n(i)}if(!o.translator.language)o.translator.changeLanguage(i);if(o.services.languageDetector)o.services.languageDetector.cacheUserLanguage(i)}o.loadResources(i,(function(e){a(e,i)}))};if(!t&&this.services.languageDetector&&!this.services.languageDetector.async){s(this.services.languageDetector.detect())}else if(!t&&this.services.languageDetector&&this.services.languageDetector.async){this.services.languageDetector.detect(s)}else{s(t)}return i}},{key:"getFixedT",value:function e(t,r,o){var i=this;var n=function e(t,r){var n;if(_typeof$1(r)!=="object"){for(var a=arguments.length,s=new Array(a>2?a-2:0),l=2;l<a;l++){s[l-2]=arguments[l]}n=i.options.overloadTranslationOptionHandler([t,r].concat(s))}else{n=_objectSpread({},r)}n.lng=n.lng||e.lng;n.lngs=n.lngs||e.lngs;n.ns=n.ns||e.ns;var c=i.options.keySeparator||".";var u=o?"".concat(o).concat(c).concat(t):t;return i.t(u,n)};if(typeof t==="string"){n.lng=t}else{n.lngs=t}n.ns=r;n.keyPrefix=o;return n}},{key:"t",value:function e(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)}},{key:"exists",value:function e(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)}},{key:"setDefaultNamespace",value:function e(t){this.options.defaultNS=t}},{key:"hasLoadedNamespace",value:function e(t){var r=this;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!this.isInitialized){this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages);return false}if(!this.languages||!this.languages.length){this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages);return false}var i=this.resolvedLanguage||this.languages[0];var n=this.options?this.options.fallbackLng:false;var a=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return true;var s=function e(t,o){var i=r.services.backendConnector.state["".concat(t,"|").concat(o)];return i===-1||i===2};if(o.precheck){var l=o.precheck(this,s);if(l!==undefined)return l}if(this.hasResourceBundle(i,t))return true;if(!this.services.backendConnector.backend)return true;if(s(i,t)&&(!n||s(a,t)))return true;return false}},{key:"loadNamespaces",value:function e(t,r){var o=this;var i=defer();if(!this.options.ns){r&&r();return Promise.resolve()}if(typeof t==="string")t=[t];t.forEach((function(e){if(o.options.ns.indexOf(e)<0)o.options.ns.push(e)}));this.loadResources((function(e){i.resolve();if(r)r(e)}));return i}},{key:"loadLanguages",value:function e(t,r){var o=defer();if(typeof t==="string")t=[t];var i=this.options.preload||[];var n=t.filter((function(e){return i.indexOf(e)<0}));if(!n.length){if(r)r();return Promise.resolve()}this.options.preload=i.concat(n);this.loadResources((function(e){o.resolve();if(r)r(e)}));return o}},{key:"dir",value:function e(t){if(!t)t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language);if(!t)return"rtl";var r=["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"];return r.indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr"}},{key:"createInstance",value:function e(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var o=arguments.length>1?arguments[1]:undefined;return new t(r,o)}},{key:"cloneInstance",value:function e(){var r=this;var o=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:noop;var n=_objectSpread({},this.options,o,{isClone:true});var a=new t(n);var s=["store","services","language"];s.forEach((function(e){a[e]=r[e]}));a.services=_objectSpread({},this.services);a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)};a.translator=new Translator(a.services,a.options);a.translator.on("*",(function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++){r[o-1]=arguments[o]}a.emit.apply(a,[e].concat(r))}));a.init(n,i);a.translator.options=a.options;a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)};return a}},{key:"toJSON",value:function e(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]);return t}(EventEmitter);var i18next=new I18n;var login_page$1={get_started:"Drucken mit ezeep Blue",login:"Anmelden",description:"Melde dich mit deinem ezeep Blue-Konto an, um zu drucken."};var printer_selection$1={loading:"Lade Drucker…",print:"Drucken",printer:"Drucker",print_in_progress:"Drucke…",color:"Farbe",orientation:"Ausrichtung",size:"Papierformat",duplex:"Duplex",quality:"Qualität",select_printer:"Wähle einen Drucker",select_color:"Wähle eine Farbe",select_size:"Wähle ein Papierformat",select_orientation:"Wähle eine Ausrichtung",color_color:"Farbe",color_grayscale:"Graustufen",orientation_portrait:"Hochformat",orientation_landscape:"Querformat",unknown_location:"Unbekannter Standort"};var button_actions$1={login:"Anmelden",print:"Drucken",cancel:"Abbrechen"};var translationsDE={login_page:login_page$1,printer_selection:printer_selection$1,button_actions:button_actions$1};var login_page={get_started:"Print with ezeep Blue",login:"Sign in",description:"Sign in with your ezeep Blue account to print."};var printer_selection={loading:"Loading printers…",print_in_progress:"Printing…",print:"Print",printer:"Printer",color:"Color",orientation:"Orientation",size:"Paper format",duplex:"Duplex",quality:"Quality",select_printer:"Select a printer",select_color:"Select a color",select_orientation:"Select an orientation",select_size:"Select a paper size",color_color:"Color",color_grayscale:"Grayscale",orientation_portrait:"Portrait",orientation_landscape:"Landscape",unknown_location:"Unknown location"};var button_actions={login:"Sign In",print:"Print",cancel:"Cancel"};var translationsEN={login_page:login_page,printer_selection:printer_selection,button_actions:button_actions};function encodeFormData(e){return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}function initi18n(){var e={en:{translation:translationsEN},de:{translation:translationsDE}};i18next.init({resources:e,lng:navigator.language,nsSeparator:false,fallbackLng:"en"})}var poll=function(e){var t=e.fn,r=e.validate,o=e.interval,i=e.maxAttempts;return __awaiter(void 0,void 0,void 0,(function(){var e,n;return __generator(this,(function(a){e=0;n=function(a,s){return __awaiter(void 0,void 0,void 0,(function(){var l;return __generator(this,(function(c){switch(c.label){case 0:return[4,t()];case 1:l=c.sent();e++;if(r(l)){return[2,a(l)]}else if(i&&e===i){return[2,s(new Error("Exceeded max attempts."))]}else{setTimeout(n,o,a,s)}return[2]}}))}))};return[2,new Promise(n)]}))}))};var removeEmptyStrings=function(e){var t={};Object.keys(e).forEach((function(r){if(e[r]!==""){t[r]=e[r]}}));return t};var EzpAuthorizationService=function(){function e(e,t){this.urlParams=new URLSearchParams;this.isAuthorized=false;this.redirectURI=e;this.clientID=t;this.oauthUrl=authStore.state.authApiHostUrl;this.authURI=new URL("https://"+this.oauthUrl+"/oauth/authorize/");this.accessTokenURL="https://"+this.oauthUrl+"/oauth/access_token/"}e.prototype.generateCodeVerifier=function(){if(authStore.state.codeVerifier!==""){this.codeVerifier=authStore.state.codeVerifier}else{var e=new Uint8Array(128);var t=crypto.getRandomValues(e);var r=btoa(t.toString()).substr(0,128);this.codeVerifier=r;authStore.state.codeVerifier=this.codeVerifier}};e.prototype.generateCodeChallenge=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,o,i;return __generator(this,(function(n){switch(n.label){case 0:t=new TextEncoder;r=t.encode(e);return[4,crypto.subtle.digest("SHA-256",r)];case 1:o=n.sent();i=btoa(String.fromCharCode.apply(null,new Uint8Array(o)));this.codeChallenge=i.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return[2]}}))}))};e.prototype.buildAuthURI=function(){this.urlParams.append("response_type","code");this.urlParams.append("client_id",this.clientID);this.urlParams.append("redirect_uri",this.redirectURI);this.urlParams.append("code_challenge",this.codeChallenge);this.urlParams.append("code_challenge_method","S256");this.authURI.search=this.urlParams.toString()};e.prototype.getAccessToken=function(){var e=this;return fetch(this.accessTokenURL,{headers:{Authorization:"Basic "+btoa(this.clientID+":"),"Content-Type":"application/x-www-form-urlencoded"},method:"POST",body:encodeFormData({grant_type:"authorization_code",scope:"printing",code:this.code,redirect_uri:this.redirectURI,code_verifier:this.codeVerifier})}).then((function(e){return e.json()})).then((function(t){if(t.access_token){authStore.state.isAuthorized=true;e.isAuthorized=authStore.state.isAuthorized;localStorage.setItem("isAuthorized",e.isAuthorized.toString());e.accessToken=t.access_token;localStorage.setItem("access_token",e.accessToken);authStore.state.accessToken=e.accessToken;e.refreshToken=t.refresh_token;localStorage.setItem("refreshToken",e.refreshToken);authStore.state.refreshToken=e.refreshToken}}))};e.prototype.refreshTokens=function(){var e=this;fetch(this.accessTokenURL,{headers:{Authorization:"Basic "+btoa(this.clientID+":"),"Content-Type":"application/x-www-form-urlencoded"},method:"POST",body:encodeFormData({grant_type:"refresh_token",scope:"printing",refresh_token:authStore.state.refreshToken})}).then((function(e){return e.json()})).then((function(t){if(t.access_token){e.accessToken=t.access_token;localStorage.setItem("access_token",e.accessToken);authStore.state.accessToken=e.accessToken;e.refreshToken=t.refresh_token;localStorage.setItem("refreshToken",e.refreshToken);authStore.state.refreshToken=e.refreshToken;authStore.state.isAuthorized=true}}))};return e}();var authStore=createStore({codeVerifier:"",accessToken:"",refreshToken:"",isAuthorized:false,devApi:false,authApiHostUrl:"",redirectUri:""});function sendCodeToParentWindow(){var e=new URLSearchParams(window.location.search);var t=e.get("code");if(window.opener){window.opener.postMessage(t,authStore.state.redirectUri);window.close()}}var ezpAuthCss=":host{--color-theme-solid:var(--color-theme-cyan-solid);-ms-flex-line-pack:center;align-content:center;background:var(--color-overlay);display:grid;grid-template:auto/280px;height:100%;-ms-flex-pack:center;justify-content:center;left:0;position:fixed;top:0;width:100%}@media (prefers-color-scheme: dark){:host{--dialog-separator-position:inset 0 0 0 var(--hairline-width-positive)}}#dialog{background:var(--color-surface-tertiary);border-radius:6px;-webkit-box-shadow:var(--dialog-separator-position, 0 0 0 var(--hairline-width-positive)) var(--hairline-color), 0 var(--spacing-1) var(--spacing-2) 0 var(--color-shadow), 0 var(--spacing-2) var(--spacing-3) 0 var(--color-shadow), 0 var(--spacing-3) var(--spacing-4) 0 var(--color-shadow), 0 var(--spacing-4) var(--spacing-5) 0 var(--color-shadow), 0 var(--spacing-5) var(--spacing-6) 0 var(--color-shadow);box-shadow:var(--dialog-separator-position, 0 0 0 var(--hairline-width-positive)) var(--hairline-color), 0 var(--spacing-1) var(--spacing-2) 0 var(--color-shadow), 0 var(--spacing-2) var(--spacing-3) 0 var(--color-shadow), 0 var(--spacing-3) var(--spacing-4) 0 var(--color-shadow), 0 var(--spacing-4) var(--spacing-5) 0 var(--color-shadow), 0 var(--spacing-5) var(--spacing-6) 0 var(--color-shadow)}#header{display:grid;grid-template-columns:auto;-ms-flex-pack:end;justify-content:end;padding:var(--spacing-2)}#content{color:var(--color-foreground-primary);display:grid;grid-row-gap:var(--spacing-4);grid-template-rows:repeat(4, auto);-ms-flex-pack:center;justify-content:center;justify-items:center;padding:0 var(--spacing-4) var(--spacing-4);text-align:center}#icon{color:var(--color-theme-solid)}#button{min-width:144px}#logo{fill:var(--color-theme-solid)}";var EzpAuth=function(){function e(e){var t=this;registerInstance(this,e);this.authCancel=createEvent(this,"authCancel",7);this.printShow=createEvent(this,"printShow",7);this.windowObjectReference=null;this.previousUrl=null;this.handleCancel=function(){t.authCancel.emit()}}e.prototype.openSignInWindow=function(e,t){var r=this;window.removeEventListener("message",this.receiveMessage);var o="toolbar=no, menubar=no, width=600, height=7000, top=100, left=100";if(this.windowObjectReference===null||this.windowObjectReference.closed){this.windowObjectReference=window.open(e,t,o)}else if(this.previousUrl!==this.auth.authURI.toString()){this.windowObjectReference=window.open(e,t,o);this.windowObjectReference.focus()}else{this.windowObjectReference.focus()}if(this.hidelogin){var i=setInterval((function(){if(r.windowObjectReference.closed){r.handleCancel();clearInterval(i)}}),500)}window.addEventListener("message",(function(e){return r.receiveMessage(e)}),false);this.previousUrl=this.auth.authURI};e.prototype.receiveMessage=function(e){var t=this;this.auth.code=e.data;this.auth.getAccessToken().finally((function(){t.authCancel.emit();t.printShow.emit()}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:initi18n();this.auth=new EzpAuthorizationService(this.redirectURI,this.clientID);if(!(authStore.state.isAuthorized===false))return[3,2];this.auth.generateCodeVerifier();return[4,this.auth.generateCodeChallenge(authStore.state.codeVerifier)];case 1:e.sent();this.auth.buildAuthURI();e.label=2;case 2:if(this.hidelogin){this.openSignInWindow(this.auth.authURI.toString(),"ezeep Login")}return[2]}}))}))};e.prototype.render=function(){var e=this;return this.hidelogin?h("ezp-progress",{status:i18next.t("login_page.login")}):h(Host,null,h("div",{id:"dialog"},h("div",{id:"header"},h("ezp-icon-button",{onClick:this.handleCancel,icon:"close",level:"tertiary"})),h("div",{id:"content"},h("svg",{id:"logo",width:"90",height:"90",viewBox:"0 0 90 90",xmlns:"http://www.w3.org/2000/svg"},h("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M25.9211 72.1296L39.0613 43.8488L2.96326 7.63391L63.3276 47.3892L32.2619 24.5431L27.6516 11.4525L45.7004 29.5597L52.34 15.2706L89.3723 20.998L63.0241 20.7521L59.0129 29.385L52.4587 15.6081L63.7497 47.6674L25.7826 72.4275L20.8033 83.1445L16.7582 63.3739L30.0161 58.9423L25.9211 72.1296Z"})),h("ezp-label",{level:"primary",weight:"heavy",text:i18next.t("login_page.get_started")}),h("ezp-label",{text:i18next.t("login_page.description")}),h("ezp-text-button",{label:i18next.t("login_page.login"),id:"button",onClick:function(){e.openSignInWindow(e.auth.authURI.toString(),"ezeep Login")}}))))};return e}();EzpAuth.style=ezpAuthCss;var ezpBackdropCss=":host{-webkit-animation:var(--host-animation-name, host-in) var(--duration-3) forwards var(--easing-out-quart);animation:var(--host-animation-name, host-in) var(--duration-3) forwards var(--easing-out-quart);background:var(--color-overlay);border-radius:6px;display:block;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:4}:host(.hide){--host-animation-name:host-out}@-webkit-keyframes host-in{0%{opacity:0}100%{opacity:1}}@keyframes host-in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes host-out{0%{opacity:1}100%{opacity:0}}@keyframes host-out{0%{opacity:1}100%{opacity:0}}";var EzpBackdrop=function(){function e(e){registerInstance(this,e);this.backdropHideStart=createEvent(this,"backdropHideStart",7);this.backdropHideEnd=createEvent(this,"backdropHideEnd",7);this.visible=true}e.prototype.handleClick=function(){this.visible=false;this.backdropHideStart.emit()};e.prototype.listenAnimationEnd=function(){if(!this.visible){this.backdropHideEnd.emit()}};e.prototype.render=function(){var e=this;return h(Host,{class:{hide:!this.visible},onClick:function(){return e.handleClick()}})};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();EzpBackdrop.style=ezpBackdropCss;var ezpIconCss=":host{-ms-flex-line-pack:center;align-content:center;display:block;display:grid;grid-template:var(--host-gridTemplate)/var(--host-gridTemplate);height:var(--icon-height, var(--host-size));-ms-flex-pack:center;justify-content:center;width:var(--icon-width, var(--host-size))}:host(.normal){--host-size:18px;--host-gridTemplate:22px}:host(.large){--host-size:36px;--host-gridTemplate:44px}svg{display:block;fill:currentColor;height:100%;width:100%}";var EzpIcon=function(){function e(e){registerInstance(this,e);this.size="normal"}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){switch(t.label){case 0:return[4,fetch(getAssetPath("./assets/glyph-"+this.name+".svg")).then((function(e){return e.text()})).then((function(t){e.glyph=t})).catch((function(e){return console.log(e)}))];case 1:t.sent();return[2]}}))}))};e.prototype.render=function(){return h(Host,{class:this.size},h("div",{id:"glyph",innerHTML:this.glyph}))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}();EzpIcon.style=ezpIconCss;var ezpIconButtonCss=":host{display:block}:host(.primary){--button-background-disabled:var(--color-shade-primary);--button-background-init:var(--color-theme-solid);--button-color-disabled:var(--color-foreground-tertiary);--button-color-init:var(--color-on-theme);--button-opacity-active:0.74;--button-opacity-hover:0.84}:host(.secondary){--button-background-active:var(--color-shade-tertiary);--button-background-disabled:var(--color-shade-primary);--button-background-hover:var(--color-shade-secondary);--button-background-init:var(--color-shade-primary);--button-color-disabled:var(--color-foreground-tertiary);--button-color-init:var(--color-theme-solid)}:host(.tertiary){--button-background-active:var(--color-shade-secondary);--button-background-hover:var(--color-shade-primary);--button-background-init:transparent;--button-color-disabled:var(--color-foreground-tertiary);--button-color-init:var(--color-theme-solid)}:host(.quaternary){--button-background-init:transparent;--button-color-disabled:var(--color-foreground-tertiary);--button-color-init:var(--color-theme-solid);--button-opacity-active:0.58;--button-opacity-hover:0.74}#button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--button-background, var(--button-background-init));border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:var(--button-color, var(--button-color-init));cursor:var(--button-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--button-opacity, 1);outline:none;padding:var(--spacing-2)}@media (hover: hover){#button:not(:disabled):hover{--button-background:var(--button-background-hover, var(--button-background-init));--button-opacity:var(--button-opacity-hover, 1)}#button:not(:disabled):active{--button-background:var(--button-background-active, var(--button-background-init));--button-opacity:var(--button-opacity-active, 1)}}#button:disabled{--button-background:var(--button-background-disabled, var(--button-background-init));--button-color:var(--button-color-disabled);--button-cursor:not-allowed}";var EzpIconButton=function(){function e(e){registerInstance(this,e);this.blank=false;this.disabled=false;this.level="primary"}e.prototype.render=function(){var e=this.type!==undefined?"button":"a";var t=this.type!==undefined?{type:this.type,disabled:this.disabled}:{href:this.href,target:this.blank?"_blank":"_self"};return h(Host,{class:""+this.level},h(e,Object.assign({id:"button"},t),h("ezp-icon",{name:this.icon})))};return e}();EzpIconButton.style=ezpIconButtonCss;var ezpLabelCss=':host{display:block;min-width:var(--minWidth, auto);padding-bottom:1px;padding-top:1px}:host::before,:host::after{content:"";display:block;height:0}:host::before{margin-top:calc((var(--offset) + 1px) * -1)}:host::after{margin-bottom:calc((var(--offset) + 1px) * -1)}:host(.no-wrap){--whiteSpace:nowrap}:host(.ellipsis){--minWidth:0;--overflow:hidden;--textOverflow:ellipsis;--whiteSpace:nowrap;--width:100%}:host(.primary){--fontSize:17px;--lineHeight:24px;--letterSpacing:-0.0127756105em;--offset:6px}:host(.secondary){--fontSize:14px;--lineHeight:20px;--letterSpacing:-0.0062235443em;--offset:5px}:host(.tertiary){--fontSize:12px;--lineHeight:18px;--letterSpacing:0.0004907745em;--offset:5px}:host(.soft){--fontWeight:400}:host(.strong){--fontWeight:500}:host(.heavy){--fontWeight:600}#text{font-size:var(--fontSize);font-weight:var(--fontWeight);letter-spacing:var(--letterSpacing);line-height:var(--lineHeight);overflow:var(--overflow, visible);text-overflow:var(--textOverflow, clip);white-space:var(--whiteSpace, normal);width:var(--width, auto)}';var EzpLabel=function(){function e(e){registerInstance(this,e);this.ellipsis=false;this.level="secondary";this.noWrap=false;this.text="Label";this.weight="soft"}e.prototype.render=function(){return h(Host,{class:this.level+" "+this.weight+" "+(this.ellipsis?"ellipsis":"")+" "+(this.noWrap?"no-wrap":"")},h("div",{id:"text"},this.text))};return e}();EzpLabel.style=ezpLabelCss;var global=typeof globalThis!=="undefined"&&globalThis||typeof self!=="undefined"&&self||typeof global!=="undefined"&&global;var support={searchParams:"URLSearchParams"in global,iterable:"Symbol"in global&&"iterator"in Symbol,blob:"FileReader"in global&&"Blob"in global&&function(){try{new Blob;return true}catch(e){return false}}(),formData:"FormData"in global,arrayBuffer:"ArrayBuffer"in global};function isDataView(e){return e&&DataView.prototype.isPrototypeOf(e)}if(support.arrayBuffer){var viewClasses=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"];var isArrayBufferView=ArrayBuffer.isView||function(e){return e&&viewClasses.indexOf(Object.prototype.toString.call(e))>-1}}function normalizeName(e){if(typeof e!=="string"){e=String(e)}if(/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e===""){throw new TypeError('Invalid character in header field name: "'+e+'"')}return e.toLowerCase()}function normalizeValue(e){if(typeof e!=="string"){e=String(e)}return e}function iteratorFor(e){var t={next:function(){var t=e.shift();return{done:t===undefined,value:t}}};if(support.iterable){t[Symbol.iterator]=function(){return t}}return t}function Headers(e){this.map={};if(e instanceof Headers){e.forEach((function(e,t){this.append(t,e)}),this)}else if(Array.isArray(e)){e.forEach((function(e){this.append(e[0],e[1])}),this)}else if(e){Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}}Headers.prototype.append=function(e,t){e=normalizeName(e);t=normalizeValue(t);var r=this.map[e];this.map[e]=r?r+", "+t:t};Headers.prototype["delete"]=function(e){delete this.map[normalizeName(e)]};Headers.prototype.get=function(e){e=normalizeName(e);return this.has(e)?this.map[e]:null};Headers.prototype.has=function(e){return this.map.hasOwnProperty(normalizeName(e))};Headers.prototype.set=function(e,t){this.map[normalizeName(e)]=normalizeValue(t)};Headers.prototype.forEach=function(e,t){for(var r in this.map){if(this.map.hasOwnProperty(r)){e.call(t,this.map[r],r,this)}}};Headers.prototype.keys=function(){var e=[];this.forEach((function(t,r){e.push(r)}));return iteratorFor(e)};Headers.prototype.values=function(){var e=[];this.forEach((function(t){e.push(t)}));return iteratorFor(e)};Headers.prototype.entries=function(){var e=[];this.forEach((function(t,r){e.push([r,t])}));return iteratorFor(e)};if(support.iterable){Headers.prototype[Symbol.iterator]=Headers.prototype.entries}function consumed(e){if(e.bodyUsed){return Promise.reject(new TypeError("Already read"))}e.bodyUsed=true}function fileReaderReady(e){return new Promise((function(t,r){e.onload=function(){t(e.result)};e.onerror=function(){r(e.error)}}))}function readBlobAsArrayBuffer(e){var t=new FileReader;var r=fileReaderReady(t);t.readAsArrayBuffer(e);return r}function readBlobAsText(e){var t=new FileReader;var r=fileReaderReady(t);t.readAsText(e);return r}function readArrayBufferAsText(e){var t=new Uint8Array(e);var r=new Array(t.length);for(var o=0;o<t.length;o++){r[o]=String.fromCharCode(t[o])}return r.join("")}function bufferClone(e){if(e.slice){return e.slice(0)}else{var t=new Uint8Array(e.byteLength);t.set(new Uint8Array(e));return t.buffer}}function Body(){this.bodyUsed=false;this._initBody=function(e){this.bodyUsed=this.bodyUsed;this._bodyInit=e;if(!e){this._bodyText=""}else if(typeof e==="string"){this._bodyText=e}else if(support.blob&&Blob.prototype.isPrototypeOf(e)){this._bodyBlob=e}else if(support.formData&&FormData.prototype.isPrototypeOf(e)){this._bodyFormData=e}else if(support.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)){this._bodyText=e.toString()}else if(support.arrayBuffer&&support.blob&&isDataView(e)){this._bodyArrayBuffer=bufferClone(e.buffer);this._bodyInit=new Blob([this._bodyArrayBuffer])}else if(support.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||isArrayBufferView(e))){this._bodyArrayBuffer=bufferClone(e)}else{this._bodyText=e=Object.prototype.toString.call(e)}if(!this.headers.get("content-type")){if(typeof e==="string"){this.headers.set("content-type","text/plain;charset=UTF-8")}else if(this._bodyBlob&&this._bodyBlob.type){this.headers.set("content-type",this._bodyBlob.type)}else if(support.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)){this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8")}}};if(support.blob){this.blob=function(){var e=consumed(this);if(e){return e}if(this._bodyBlob){return Promise.resolve(this._bodyBlob)}else if(this._bodyArrayBuffer){return Promise.resolve(new Blob([this._bodyArrayBuffer]))}else if(this._bodyFormData){throw new Error("could not read FormData body as blob")}else{return Promise.resolve(new Blob([this._bodyText]))}};this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=consumed(this);if(e){return e}if(ArrayBuffer.isView(this._bodyArrayBuffer)){return Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength))}else{return Promise.resolve(this._bodyArrayBuffer)}}else{return this.blob().then(readBlobAsArrayBuffer)}}}this.text=function(){var e=consumed(this);if(e){return e}if(this._bodyBlob){return readBlobAsText(this._bodyBlob)}else if(this._bodyArrayBuffer){return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))}else if(this._bodyFormData){throw new Error("could not read FormData body as text")}else{return Promise.resolve(this._bodyText)}};if(support.formData){this.formData=function(){return this.text().then(decode)}}this.json=function(){return this.text().then(JSON.parse)};return this}var methods=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function normalizeMethod(e){var t=e.toUpperCase();return methods.indexOf(t)>-1?t:e}function Request$1(e,t){if(!(this instanceof Request$1)){throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')}t=t||{};var r=t.body;if(e instanceof Request$1){if(e.bodyUsed){throw new TypeError("Already read")}this.url=e.url;this.credentials=e.credentials;if(!t.headers){this.headers=new Headers(e.headers)}this.method=e.method;this.mode=e.mode;this.signal=e.signal;if(!r&&e._bodyInit!=null){r=e._bodyInit;e.bodyUsed=true}}else{this.url=String(e)}this.credentials=t.credentials||this.credentials||"same-origin";if(t.headers||!this.headers){this.headers=new Headers(t.headers)}this.method=normalizeMethod(t.method||this.method||"GET");this.mode=t.mode||this.mode||null;this.signal=t.signal||this.signal;this.referrer=null;if((this.method==="GET"||this.method==="HEAD")&&r){throw new TypeError("Body not allowed for GET or HEAD requests")}this._initBody(r);if(this.method==="GET"||this.method==="HEAD"){if(t.cache==="no-store"||t.cache==="no-cache"){var o=/([?&])_=[^&]*/;if(o.test(this.url)){this.url=this.url.replace(o,"$1_="+(new Date).getTime())}else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}}Request$1.prototype.clone=function(){return new Request$1(this,{body:this._bodyInit})};function decode(e){var t=new FormData;e.trim().split("&").forEach((function(e){if(e){var r=e.split("=");var o=r.shift().replace(/\+/g," ");var i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(o),decodeURIComponent(i))}}));return t}function parseHeaders(e){var t=new Headers;var r=e.replace(/\r?\n[\t ]+/g," ");r.split("\r").map((function(e){return e.indexOf("\n")===0?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":");var o=r.shift().trim();if(o){var i=r.join(":").trim();t.append(o,i)}}));return t}Body.call(Request$1.prototype);function Response(e,t){if(!(this instanceof Response)){throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')}if(!t){t={}}this.type="default";this.status=t.status===undefined?200:t.status;this.ok=this.status>=200&&this.status<300;this.statusText=t.statusText===undefined?"":""+t.statusText;this.headers=new Headers(t.headers);this.url=t.url||"";this._initBody(e)}Body.call(Response.prototype);Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers(this.headers),url:this.url})};Response.error=function(){var e=new Response(null,{status:0,statusText:""});e.type="error";return e};var redirectStatuses=[301,302,303,307,308];Response.redirect=function(e,t){if(redirectStatuses.indexOf(t)===-1){throw new RangeError("Invalid status code")}return new Response(null,{status:t,headers:{location:e}})};var DOMException=global.DOMException;try{new DOMException}catch(e){DOMException=function(e,t){this.message=e;this.name=t;var r=Error(e);this.stack=r.stack};DOMException.prototype=Object.create(Error.prototype);DOMException.prototype.constructor=DOMException}function fetch$1(e,t){return new Promise((function(r,o){var i=new Request$1(e,t);if(i.signal&&i.signal.aborted){return o(new DOMException("Aborted","AbortError"))}var n=new XMLHttpRequest;function a(){n.abort()}n.onload=function(){var e={status:n.status,statusText:n.statusText,headers:parseHeaders(n.getAllResponseHeaders()||"")};e.url="responseURL"in n?n.responseURL:e.headers.get("X-Request-URL");var t="response"in n?n.response:n.responseText;setTimeout((function(){r(new Response(t,e))}),0)};n.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)};n.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)};n.onabort=function(){setTimeout((function(){o(new DOMException("Aborted","AbortError"))}),0)};function s(e){try{return e===""&&global.location.href?global.location.href:e}catch(t){return e}}n.open(i.method,s(i.url),true);if(i.credentials==="include"){n.withCredentials=true}else if(i.credentials==="omit"){n.withCredentials=false}if("responseType"in n){if(support.blob){n.responseType="blob"}else if(support.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1){n.responseType="arraybuffer"}}if(t&&typeof t.headers==="object"&&!(t.headers instanceof Headers)){Object.getOwnPropertyNames(t.headers).forEach((function(e){n.setRequestHeader(e,normalizeValue(t.headers[e]))}))}else{i.headers.forEach((function(e,t){n.setRequestHeader(t,e)}))}if(i.signal){i.signal.addEventListener("abort",a);n.onreadystatechange=function(){if(n.readyState===4){i.signal.removeEventListener("abort",a)}}}n.send(typeof i._bodyInit==="undefined"?null:i._bodyInit)}))}fetch$1.polyfill=true;if(!global.fetch){global.fetch=fetch$1;global.Headers=Headers;global.Request=Request$1;global.Response=Response}var fetch$2=Object.freeze({__proto__:null,Headers:Headers,Request:Request$1,Response:Response,get DOMException(){return DOMException},fetch:fetch$1});var require$$0=getAugmentedNamespace(fetch$2);var browser=function(e){var t={};function r(o){if(t[o])return t[o].exports;var i=t[o]={exports:{},id:o,loaded:false};e[o].call(i.exports,i,i.exports,r);i.loaded=true;return i.exports}r.m=e;r.c=t;r.p="";return r(0)}([function(e,t,r){var o=r(1);var i=typeof importScripts==="function";e.exports=o(i?self:window)},function(e,t,r){function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return Array.from(e)}}var i=[];function n(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}var a=i.reduce((function(e,t){return[t].concat(e)}),[]);var s=Promise.resolve(r);a.forEach((function(e){var t=e.request,r=e.requestError;if(t||r){s=s.then((function(e){return t.apply(undefined,o(e))}),r)}}));s=s.then((function(t){var r=new(Function.prototype.bind.apply(Request,[null].concat(o(t))));return e(r).then((function(e){e.request=r;return e})).catch((function(e){e.request=r;return Promise.reject(e)}))}));a.forEach((function(e){var t=e.response,r=e.responseError;if(t||r){s=s.then(t,r)}}));return s}e.exports=function e(t){if(!t.fetch){try{r(2)}catch(e){throw Error("No fetch available. Unable to register fetch-intercept")}}t.fetch=function(e){return function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++){r[o]=arguments[o]}return n.apply(undefined,[e].concat(r))}}(t.fetch);return{register:function e(t){i.push(t);return function(){var e=i.indexOf(t);if(e>=0){i.splice(e,1)}}},clear:function e(){i=[]}}}},function(e,t){e.exports=require$$0}]);var EzpPrintService=function(){function e(e,t){var r=this;this.getPrintStatus=function(){return fetch("https://"+r.printingApi+"/sfapi/Status/?id="+encodeURIComponent(printStore.state.jobID),{headers:{Authorization:"Bearer "+authStore.state.accessToken}}).then((function(e){return e.json()}))};this.redirectURI=e;this.clientID=t;this.printingApi=printStore.state.printApiHostUrl;this.checkStoredRefreshToken();this.registerFetchInterceptor()}e.prototype.checkStoredRefreshToken=function(){if(authStore.state.refreshToken!==""){return}if(localStorage.getItem("refreshToken")===null){authStore.state.refreshToken=""}else{authStore.state.refreshToken=localStorage.getItem("refreshToken")}};e.prototype.registerFetchInterceptor=function(){var e=this;browser.register({request:function(e,t){return[e,t]},requestError:function(e){return Promise.reject(e)},response:function(t){if(t.status===401){if(authStore.state.refreshToken===""){return t}var r=new EzpAuthorizationService(e.redirectURI,e.clientID);r.refreshTokens()}return t},responseError:function(e){return Promise.reject(e)}})};e.prototype.getPrinterList=function(e){return fetch("https://"+this.printingApi+"/sfapi/GetPrinter/",{method:"GET",headers:{Authorization:"Bearer "+e}}).then((function(e){return e.json()}))};e.prototype.getConfig=function(e){return fetch("https://"+this.printingApi+"/sfapi/GetConfiguration/",{method:"GET",headers:{Authorization:"Bearer "+e}}).then((function(e){if(e.ok){authStore.state.isAuthorized=true}if(!e.ok){throw new Error("http status "+e.status)}return e.json()}))};e.prototype.getPrinterProperties=function(e,t){return fetch("https://"+this.printingApi+"/sfapi/GetPrinterProperties/?id="+t,{method:"GET",headers:{Authorization:"Bearer "+e}}).then((function(e){return e.json()}))};e.prototype.getAllPrinterProperties=function(e){return fetch("https://"+this.printingApi+"/sfapi/GetPrinterProperties/",{method:"GET",headers:{Authorization:"Bearer "+e}}).then((function(e){return e.json()}))};e.prototype.printFileByUrl=function(e,t,r,o,i,n,a){return fetch("https://"+this.printingApi+"/sfapi/Print/",{method:"POST",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"},body:JSON.stringify(Object.assign(Object.assign(Object.assign({fileurl:t,type:r,printerid:o},n&&{alias:n}),a&&{printanddelete:a}),{properties:i}))}).then((function(e){return e.json()}))};return e}();var printStore=createStore({printers:[],jobID:"",printFinished:false,printApiHostUrl:""});var EzpUserService=function(){function e(){}e.prototype.getUserInfo=function(){return fetch("https://"+authStore.state.authApiHostUrl+"/v1/users/me",{headers:{Authorization:"Bearer "+authStore.state.accessToken,"Content-Type":"application/json"},method:"GET"}).then((function(e){return e.json()}))};return e}();var userStore=createStore({user:null,theme:"",appearance:""});var colors=[{id:1,name:"Grayscale"},{id:2,name:"Color"}];var orientations=[{id:1,name:"Portrait"},{id:2,name:"Landscape"}];var sizes=[{id:1,name:"Auto",description:"Document size"},{id:2,name:"Letter",description:"8.5 x 11 in"},{id:3,name:"Ledger",description:"11 x 17 in"},{id:4,name:"Legal",description:"8.5 x 14 in"},{id:5,name:"Executive",description:"7.25 x 10.5 in"},{id:6,name:"A3",description:"11.7 x 16.5 in"},{id:7,name:"A4",description:"8.3 x 11.7 in"},{id:8,name:"A5",description:"5.8 x 8.3 in"},{id:9,name:"Folio",description:"8.5 x 13 in"},{id:10,name:"Com-10",description:"4.125 x 9.5 in"}];var options={colors:colors,orientations:orientations,sizes:sizes};var ezpPrinterSelectionCss=":host{-ms-flex-line-pack:center;align-content:center;background:var(--color-overlay);display:grid;grid-template:auto/320px;height:100vh;-ms-flex-pack:center;justify-content:center;left:0;position:fixed;top:0;width:100vw}@media (prefers-color-scheme: dark){:host{--content-boxShadow:inset var(--hairline-width-positive) 0 0 0 var(--hairline-color),\n inset var(--hairline-width-negative) 0 0 0 var(--hairline-color);--container-separator-position:inset 0 0 0 var(--hairline-width-positive);--footer-separator-position:inset 0 var(--hairline-width-positive) 0 0;--header-separator-position:inset 0 var(--hairline-width-negative) 0 0}}#container{background:var(--color-surface-tertiary);border-radius:6px;position:relative}#header{-webkit-box-shadow:inset 0 var(--hairline-width-negative) 0 0 var(--hairline-color);box-shadow:inset 0 var(--hairline-width-negative) 0 0 var(--hairline-color);color:var(--color-foreground-primary);display:grid;grid-column-gap:var(--spacing-1);grid-template-columns:auto 1fr auto;padding:var(--spacing-4) var(--spacing-3) var(--spacing-4) var(--spacing-4);position:relative;z-index:3}#toggle-menu{margin:calc(var(--spacing-3) * -1) 0;position:relative;z-index:2}#content{background:var(--color-surface-secondary);-webkit-box-shadow:var(--content-boxShadow, none);box-shadow:var(--content-boxShadow, none);display:grid;grid-row-gap:var(--spacing-2);grid-template-rows:repeat(2, auto);padding:var(--spacing-2)}#footer{-webkit-box-shadow:inset 0 var(--hairline-width-positive) 0 0 var(--hairline-color);box-shadow:inset 0 var(--hairline-width-positive) 0 0 var(--hairline-color);display:grid;grid-column-gap:var(--spacing-2);grid-template-columns:repeat(2, 1fr);padding:var(--spacing-2);position:relative;z-index:3}";var EzpPrinterSelection=function(){function e(e){var t=this;registerInstance(this,e);this.printCancel=createEvent(this,"printCancel",7);this.printSubmit=createEvent(this,"printSubmit",7);this.duplexOptions=[{id:1,title:"None"},{id:2,title:"Long edge binding"},{id:3,title:"Short edge binding"}];this.loading=true;this.options=options;this.printInProgress=false;this.userMenuOpen=false;this.selectedPrinter={id:"",location:"",name:""};this.selectedProperties={paper:"",paperid:"",color:"",duplex:false,duplexmode:"",orientation:"",copies:"",resolution:""};this.previouslySelectedProperties={paper:"",paperid:"",color:"",duplex:false,duplexmode:"",orientation:"",copies:"",resolution:""};this.handleCancel=function(){t.printCancel.emit()};this.handlePrint=function(){t.printInProgress=true;t.printService.printFileByUrl(authStore.state.accessToken,t.fileurl,t.filetype,t.selectedPrinter.id,removeEmptyStrings(t.selectedProperties),t.filename).then((function(e){if(e.jobid){printStore.state.jobID=e.jobid;var r=2e3;var o=function(e){if(e.jobstatus===0){t.printInProgress=false;return true}return false};poll({fn:t.printService.getPrintStatus,validate:o,interval:r,maxAttempts:10}).then(e).catch((function(e){console.warn(e);t.printInProgress=false}))}else{t.printInProgress=false}}));localStorage.setItem("properties",JSON.stringify(t.selectedProperties));localStorage.setItem("printer",JSON.stringify(t.selectedPrinter));localStorage.setItem("previouslySelectedProperties",JSON.stringify(t.previouslySelectedProperties))};this.handleUserMenu=function(){t.userMenuOpen=true}}e.prototype.listenSelectSelection=function(e){this.setSelectedProperties(e.detail)};e.prototype.listenStepperChanged=function(e){this.selectedProperties.copies=e.detail};e.prototype.listenUserMenuClosure=function(){this.userMenuOpen=false};e.prototype.listenLogout=function(){this.printCancel.emit()};e.prototype.getPropertiesFromLocalStorage=function(){if(localStorage.getItem("properties")){this.selectedProperties=JSON.parse(localStorage.getItem("properties"))}if(localStorage.getItem("printer")){this.selectedPrinter=JSON.parse(localStorage.getItem("printer"))}else{this.selectedPrinter={id:"",location:"",name:""}}if(localStorage.getItem("previouslySelectedProperties")){this.previouslySelectedProperties=JSON.parse(localStorage.getItem("previouslySelectedProperties"))}};e.prototype.getUserInfo=function(){var e=this;var t=new EzpUserService;return t.getUserInfo().then((function(t){userStore.state.user=t;e.userName=userStore.state.user.display_name}))};e.prototype.setSelectedProperties=function(e){switch(e.type){case"printer":this.selectedPrinter.id=e.id;this.selectedPrinter.name=e.title;break;case"color":this.selectedProperties.color=!!e.id;this.previouslySelectedProperties.color=e.title;break;case"orientation":this.selectedProperties.orientation=e.id;this.previouslySelectedProperties.orientation=e.title;break;case"format":this.selectedProperties.paper=e.title;this.selectedProperties.paperid=e.id;this.previouslySelectedProperties.paper=e.title;this.previouslySelectedProperties.paperid=e.id;break;case"quality":this.selectedProperties.resolution=e.title;this.previouslySelectedProperties.resolution=e.title;break;case"duplex":if(e.title==="None"){this.selectedProperties.duplex=false}else{this.selectedProperties.duplex=true}this.selectedProperties.duplexmode=e.id;this.previouslySelectedProperties.duplexmode=e.id;break}};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){switch(t.label){case 0:initi18n();this.loading=true;this.getPropertiesFromLocalStorage();this.getUserInfo();this.printService=new EzpPrintService(this.redirectURI,this.clientID);return[4,this.printService.getPrinterList(authStore.state.accessToken).then((function(t){e.printers=t}))];case 1:t.sent();return[4,this.printService.getAllPrinterProperties(authStore.state.accessToken).then((function(t){e.printerConfig=t[0]}))];case 2:t.sent();this.loading=false;return[2]}}))}))};e.prototype.render=function(){return this.loading?h("ezp-progress",{status:i18next.t("printer_selection.loading")}):h(Host,{exportparts:"test: hello"},this.printInProgress?h("ezp-progress",{status:i18next.t("printer_selection.print_in_progress")}):null,h("div",{id:"container","data-backdrop-surface":true},h("div",{id:"header"},h("ezp-label",{weight:"heavy",text:i18next.t("printer_selection.print")+":"}),h("ezp-label",{text:this.filename}),h("ezp-icon-button",{level:"tertiary",icon:"menu",id:"toggle-menu",type:"button",onClick:this.handleUserMenu})),h("div",{id:"content"},h("div",{id:"printer"},h("ezp-select",{label:i18next.t("printer_selection.printer"),icon:"printer",placeholder:i18next.t("printer_selection.select_printer"),toggleFlow:"vertical",optionFlow:"vertical",options:this.printers.map((function(e){return{id:e.id,title:e.name,meta:e.location!==""?e.location:i18next.t("printer_selection.unknown_location"),type:"printer"}})),preSelected:this.selectedPrinter.name})),h("div",{id:"options"},h("ezp-select",{label:i18next.t("printer_selection.color"),icon:"color",placeholder:i18next.t("printer_selection.select_color"),toggleFlow:"horizontal",options:this.printerConfig.Color?[{id:1,title:i18next.t("printer_selection.color_color"),meta:"",type:"color"},{id:0,title:i18next.t("printer_selection.color_grayscale"),meta:"",type:"color"}]:[{id:0,title:i18next.t("printer_selection.color_grayscale"),meta:"",type:"color"}],preSelected:this.previouslySelectedProperties.color}),h("ezp-select",{label:i18next.t("printer_selection.orientation"),icon:"orientation",placeholder:i18next.t("printer_selection.select_orientation"),toggleFlow:"horizontal",options:this.printerConfig.OrientationsSupported.map((function(e,t){return{id:t,title:i18next.t("printer_selection.orientation_"+e),meta:"",type:"orientation"}})),preSelected:this.previouslySelectedProperties.orientation}),h("ezp-select",{label:i18next.t("printer_selection.size"),icon:"size",placeholder:i18next.t("printer_selection.select_size"),toggleFlow:"horizontal",optionFlow:"horizontal",options:this.printerConfig.PaperFormats.map((function(e){return{id:e.Id,title:e.Name,meta:e.XRes+" x "+e.YRes,type:"format"}})),preSelected:this.previouslySelectedProperties.paper}),h("ezp-select",{label:i18next.t("printer_selection.quality"),icon:"quality",toggleFlow:"horizontal",options:this.printerConfig.Resolutions.map((function(e,t){return{id:t,title:e,meta:"",type:"quality"}})),preSelected:!this.previouslySelectedProperties.resolution?this.printerConfig.Resolutions[0]:this.previouslySelectedProperties.resolution}),this.printerConfig.DuplexSupported?h("ezp-select",{label:i18next.t("printer_selection.duplex"),icon:"duplex",toggleFlow:"horizontal",options:this.duplexOptions.map((function(e){return{id:e.id,title:e.title,meta:"",type:"duplex"}})),preSelected:!this.previouslySelectedProperties.duplex?"None":this.previouslySelectedProperties.duplexmode}):null),h("ezp-stepper",{label:"Copies",max:10,icon:"copies"})),h("div",{id:"footer"},h("ezp-text-button",{type:"button",level:"secondary",onClick:this.handleCancel,label:i18next.t("button_actions.cancel")}),h("ezp-text-button",{type:"button",onClick:this.handlePrint,label:i18next.t("button_actions.print")})),h("ezp-user-menu",{open:this.userMenuOpen,name:this.userName})))};return e}();EzpPrinterSelection.style=ezpPrinterSelectionCss;var authApiHostUrl="account.ezeep.com";var printingApiHostUrl="printapi.ezeep.com";var config={authApiHostUrl:authApiHostUrl,printingApiHostUrl:printingApiHostUrl};var ezpPrintingCss=':host{-ms-flex-line-pack:center;align-content:center;background:var(--color-surface-primary);color:var(--color-foreground-primary);display:grid;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;grid-template:auto/auto;-ms-flex-pack:center;justify-content:center;margin:0;min-height:100vh;-webkit-tap-highlight-color:transparent;text-rendering:optimizeLegibility;-webkit-text-size-adjust:none;--duration-1:0.1s;--duration-2:0.16s;--duration-3:0.26s;--duration-4:0.42s;--duration-5:0.68s;--duration-6:1s;--spacing-1:4px;--spacing-2:6px;--spacing-3:10px;--spacing-4:16px;--spacing-5:26px;--spacing-6:42px;--spacing-7:68px;--spacing-8:110px;--easing-in-quart:cubic-bezier(0.11, 0, 0.5, 0);--easing-in-out-quart:cubic-bezier(0.76, 0, 0.24, 1);--easing-in-out-cubic:cubic-bezier(0.65, 0, 0.35, 1);--easing-in-expo:cubic-bezier(0.7, 0, 0.84, 0);--easing-out-quart:cubic-bezier(0.25, 1, 0.5, 1);--easing-out-expo:cubic-bezier(0.16, 1, 0.3, 1);--hairline-color:var(--color-outline-primary);--color-theme-pink-solid-light:#f23267;--color-theme-red-solid-light:#f23b22;--color-theme-orange-solid-light:#fe7200;--color-theme-green-solid-light:#5d9200;--color-theme-cyan-solid-light:#0091b4;--color-theme-blue-solid-light:#4e81f3;--color-theme-violet-solid-light:#ae5ef3;--color-theme-pink-translucent-light:rgba(242, 50, 103, 0.16);--color-theme-red-translucent-light:rgba(242, 59, 34, 0.16);--color-theme-orange-translucent-light:rgba(254, 114, 0, 0.16);--color-theme-green-translucent-light:rgba(93, 146, 0, 0.16);--color-theme-cyan-translucent-light:rgba(0, 145, 180, 0.16);--color-theme-blue-translucent-light:rgba(78, 129, 243, 0.16);--color-theme-violet-translucent-light:rgba(174, 94, 243, 0.16);--color-on-theme-light:white;--color-surface-primary-light:white;--color-surface-secondary-light:#f3f3f3;--color-surface-tertiary-light:white;--color-shade-primary-light:rgba(119, 119, 119, 0.1);--color-shade-secondary-light:rgba(119, 119, 119, 0.16);--color-shade-tertiary-light:rgba(119, 119, 119, 0.22);--color-foreground-primary-light:rgba(0, 0, 0, 0.94);--color-foreground-secondary-light:rgba(99, 99, 99, 0.9);--color-foreground-tertiary-light:rgba(99, 99, 99, 0.58);--color-outline-primary-light:#e2e2e2;--color-outline-secondary-light:#d1d1d1;--color-overlay-light:rgba(0, 0, 0, 0.26);--color-shadow-light:rgba(0, 0, 0, 0.06);--color-theme-pink-solid-dark:#ff4171;--color-theme-red-solid-dark:#ff482c;--color-theme-orange-solid-dark:#ff811c;--color-theme-green-solid-dark:#679c15;--color-theme-cyan-solid-dark:#209bbf;--color-theme-blue-solid-dark:#5b8bff;--color-theme-violet-solid-dark:#ba69ff;--color-theme-pink-translucent-dark:rgba(255, 65, 113, 0.26);--color-theme-red-translucent-dark:rgba(255, 72, 44, 0.26);--color-theme-orange-translucent-dark:rgba(255, 129, 28, 0.26);--color-theme-green-translucent-dark:rgba(103, 156, 21, 0.26);--color-theme-cyan-translucent-dark:rgba(32, 155, 191, 0.26);--color-theme-blue-translucent-dark:rgba(91, 139, 255, 0.26);--color-theme-violet-translucent-dark:rgba(186, 105, 255, 0.26);--color-on-theme-dark:black;--color-surface-primary-dark:black;--color-surface-secondary-dark:#1b1b1b;--color-surface-tertiary-dark:#282828;--color-shade-primary-dark:rgba(119, 119, 119, 0.28);--color-shade-secondary-dark:rgba(119, 119, 119, 0.34);--color-shade-tertiary-dark:rgba(119, 119, 119, 0.4);--color-foreground-primary-dark:rgba(255, 255, 255, 0.94);--color-foreground-secondary-dark:rgba(139, 139, 139, 0.9);--color-foreground-tertiary-dark:rgba(139, 139, 139, 0.58);--color-outline-primary-dark:#3e3e3e;--color-outline-secondary-dark:#4b4b4b;--color-overlay-dark:rgba(0, 0, 0, 0.68);--color-shadow-dark:rgba(0, 0, 0, 0.1)}@media (-webkit-min-device-pixel-ratio: 1), (min-device-pixel-ratio: 1){:host{--hairline-width-positive:calc(1px / 1);--hairline-width-negative:calc(-1px / 1)}}@media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2){:host{--hairline-width-positive:calc(1px / 2);--hairline-width-negative:calc(-1px / 2)}}@media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3){:host{--hairline-width-positive:calc(1px / 3);--hairline-width-negative:calc(-1px / 3)}}@media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2){:host{--hairline-color:var(--color-outline-secondary)}}@supports (color: color(display-p3 1 1 1)){:host{--color-theme-pink-solid-light:color(display-p3 0.9490196078 0.1960784314 0.4039215686/100%);--color-theme-red-solid-light:color(display-p3 0.9490196078 0.231372549 0.1333333333/100%);--color-theme-orange-solid-light:color(display-p3 0.9960784314 0.4470588235 0/100%);--color-theme-green-solid-light:color(display-p3 0.3647058824 0.5725490196 0/100%);--color-theme-cyan-solid-light:color(display-p3 0 0.568627451 0.7058823529/100%);--color-theme-blue-solid-light:color(display-p3 0.3058823529 0.5058823529 0.9529411765/100%);--color-theme-violet-solid-light:color(display-p3 0.6823529412 0.368627451 0.9529411765/100%);--color-theme-pink-translucent-light:color(display-p3 0.9490196078 0.1960784314 0.4039215686/16%);--color-theme-red-translucent-light:color(display-p3 0.9490196078 0.231372549 0.1333333333/16%);--color-theme-orange-translucent-light:color(display-p3 0.9960784314 0.4470588235 0/16%);--color-theme-green-translucent-light:color(display-p3 0.3647058824 0.5725490196 0/16%);--color-theme-cyan-translucent-light:color(display-p3 0 0.568627451 0.7058823529/16%);--color-theme-blue-translucent-light:color(display-p3 0.3058823529 0.5058823529 0.9529411765/16%);--color-theme-violet-translucent-light:color(display-p3 0.6823529412 0.368627451 0.9529411765/16%);--color-on-theme-light:color(display-p3 1 1 1/100%);--color-surface-primary-light:color(display-p3 1 1 1/100%);--color-surface-secondary-light:color(display-p3 0.9529411765 0.9529411765 0.9529411765/100%);--color-surface-tertiary-light:color(display-p3 1 1 1/100%);--color-shade-primary-light:color(display-p3 0.4666666667 0.4666666667 0.4666666667/10%);--color-shade-secondary-light:color(display-p3 0.4666666667 0.4666666667 0.4666666667/16%);--color-shade-tertiary-light:color(display-p3 0.4666666667 0.4666666667 0.4666666667/22%);--color-foreground-primary-light:color(display-p3 0 0 0/94%);--color-foreground-secondary-light:color(display-p3 0.3882352941 0.3882352941 0.3882352941/90%);--color-foreground-tertiary-light:color(display-p3 0.3882352941 0.3882352941 0.3882352941/58%);--color-outline-primary-light:color(display-p3 0.8862745098 0.8862745098 0.8862745098/100%);--color-outline-secondary-light:color(display-p3 0.8196078431 0.8196078431 0.8196078431/100%);--color-overlay-light:color(display-p3 0 0 0/26%);--color-shadow-light:color(display-p3 0 0 0/6%)}}@supports (color: color(display-p3 1 1 1)){:host{--color-theme-pink-solid-dark:color(display-p3 1 0.2549019608 0.4431372549/100%);--color-theme-red-solid-dark:color(display-p3 1 0.2823529412 0.1725490196/100%);--color-theme-orange-solid-dark:color(display-p3 1 0.5058823529 0.1098039216/100%);--color-theme-green-solid-dark:color(display-p3 0.4039215686 0.6117647059 0.0823529412/100%);--color-theme-cyan-solid-dark:color(display-p3 0.1254901961 0.6078431373 0.7490196078/100%);--color-theme-blue-solid-dark:color(display-p3 0.3568627451 0.5450980392 1/100%);--color-theme-violet-solid-dark:color(display-p3 0.7294117647 0.4117647059 1/100%);--color-theme-pink-translucent-dark:color(display-p3 1 0.2549019608 0.4431372549/26%);--color-theme-red-translucent-dark:color(display-p3 1 0.2823529412 0.1725490196/26%);--color-theme-orange-translucent-dark:color(display-p3 1 0.5058823529 0.1098039216/26%);--color-theme-green-translucent-dark:color(display-p3 0.4039215686 0.6117647059 0.0823529412/26%);--color-theme-cyan-translucent-dark:color(display-p3 0.1254901961 0.6078431373 0.7490196078/26%);--color-theme-blue-translucent-dark:color(display-p3 0.3568627451 0.5450980392 1/26%);--color-theme-violet-translucent-dark:color(display-p3 0.7294117647 0.4117647059 1/26%);--color-on-theme-dark:color(display-p3 0 0 0/100%);--color-surface-primary-dark:color(display-p3 0 0 0/100%);--color-surface-secondary-dark:color(display-p3 0.1058823529 0.1058823529 0.1058823529/100%);--color-surface-tertiary-dark:color(display-p3 0.1568627451 0.1568627451 0.1568627451/100%);--color-shade-primary-dark:color(display-p3 0.4666666667 0.4666666667 0.4666666667/28%);--color-shade-secondary-dark:color(display-p3 0.4666666667 0.4666666667 0.4666666667/34%);--color-shade-tertiary-dark:color(display-p3 0.4666666667 0.4666666667 0.4666666667/40%);--color-foreground-primary-dark:color(display-p3 1 1 1/94%);--color-foreground-secondary-dark:color(display-p3 0.5450980392 0.5450980392 0.5450980392/90%);--color-foreground-tertiary-dark:color(display-p3 0.5450980392 0.5450980392 0.5450980392/58%);--color-outline-primary-dark:color(display-p3 0.2431372549 0.2431372549 0.2431372549/100%);--color-outline-secondary-dark:color(display-p3 0.2941176471 0.2941176471 0.2941176471/100%);--color-overlay-dark:color(display-p3 0 0 0/68%);--color-shadow-dark:color(display-p3 0 0 0/10%)}}:host,:host(.light){--color-theme-pink-solid:var(--color-theme-pink-solid-light);--color-theme-red-solid:var(--color-theme-red-solid-light);--color-theme-orange-solid:var(--color-theme-orange-solid-light);--color-theme-green-solid:var(--color-theme-green-solid-light);--color-theme-cyan-solid:var(--color-theme-cyan-solid-light);--color-theme-blue-solid:var(--color-theme-blue-solid-light);--color-theme-violet-solid:var(--color-theme-violet-solid-light);--color-theme-pink-translucent:var(--color-theme-pink-translucent-light);--color-theme-red-translucent:var(--color-theme-red-translucent-light);--color-theme-orange-translucent:var(--color-theme-orange-translucent-light);--color-theme-green-translucent:var(--color-theme-green-translucent-light);--color-theme-cyan-translucent:var(--color-theme-cyan-translucent-light);--color-theme-blue-translucent:var(--color-theme-blue-translucent-light);--color-theme-violet-translucent:var(--color-theme-violet-translucent-light);--color-on-theme:var(--color-on-theme-light);--color-surface-primary:var(--color-surface-primary-light);--color-surface-secondary:var(--color-surface-secondary-light);--color-surface-tertiary:var(--color-surface-tertiary-light);--color-shade-primary:var(--color-shade-primary-light);--color-shade-secondary:var(--color-shade-secondary-light);--color-shade-tertiary:var(--color-shade-tertiary-light);--color-foreground-primary:var(--color-foreground-primary-light);--color-foreground-secondary:var(--color-foreground-secondary-light);--color-foreground-tertiary:var(--color-foreground-tertiary-light);--color-outline-primary:var(--color-outline-primary-light);--color-outline-secondary:var(--color-outline-secondary-light);--color-overlay:var(--color-overlay-light);--color-shadow:var(--color-shadow-light)}:host(.dark){--color-theme-pink-solid:var(--color-theme-pink-solid-dark);--color-theme-red-solid:var(--color-theme-red-solid-dark);--color-theme-orange-solid:var(--color-theme-orange-solid-dark);--color-theme-green-solid:var(--color-theme-green-solid-dark);--color-theme-cyan-solid:var(--color-theme-cyan-solid-dark);--color-theme-blue-solid:var(--color-theme-blue-solid-dark);--color-theme-violet-solid:var(--color-theme-violet-solid-dark);--color-theme-pink-translucent:var(--color-theme-pink-translucent-dark);--color-theme-red-translucent:var(--color-theme-red-translucent-dark);--color-theme-orange-translucent:var(--color-theme-orange-translucent-dark);--color-theme-green-translucent:var(--color-theme-green-translucent-dark);--color-theme-cyan-translucent:var(--color-theme-cyan-translucent-dark);--color-theme-blue-translucent:var(--color-theme-blue-translucent-dark);--color-theme-violet-translucent:var(--color-theme-violet-translucent-dark);--color-on-theme:var(--color-on-theme-dark);--color-surface-primary:var(--color-surface-primary-dark);--color-surface-secondary:var(--color-surface-secondary-dark);--color-surface-tertiary:var(--color-surface-tertiary-dark);--color-shade-primary:var(--color-shade-primary-dark);--color-shade-secondary:var(--color-shade-secondary-dark);--color-shade-tertiary:var(--color-shade-tertiary-dark);--color-foreground-primary:var(--color-foreground-primary-dark);--color-foreground-secondary:var(--color-foreground-secondary-dark);--color-foreground-tertiary:var(--color-foreground-tertiary-dark);--color-outline-primary:var(--color-outline-primary-dark);--color-outline-secondary:var(--color-outline-secondary-dark);--color-overlay:var(--color-overlay-dark);--color-shadow:var(--color-shadow-dark)}@media (prefers-color-scheme: dark){:host{--color-theme-pink-solid:var(--color-theme-pink-solid-dark);--color-theme-red-solid:var(--color-theme-red-solid-dark);--color-theme-orange-solid:var(--color-theme-orange-solid-dark);--color-theme-green-solid:var(--color-theme-green-solid-dark);--color-theme-cyan-solid:var(--color-theme-cyan-solid-dark);--color-theme-blue-solid:var(--color-theme-blue-solid-dark);--color-theme-violet-solid:var(--color-theme-violet-solid-dark);--color-theme-pink-translucent:var(--color-theme-pink-translucent-dark);--color-theme-red-translucent:var(--color-theme-red-translucent-dark);--color-theme-orange-translucent:var(--color-theme-orange-translucent-dark);--color-theme-green-translucent:var(--color-theme-green-translucent-dark);--color-theme-cyan-translucent:var(--color-theme-cyan-translucent-dark);--color-theme-blue-translucent:var(--color-theme-blue-translucent-dark);--color-theme-violet-translucent:var(--color-theme-violet-translucent-dark);--color-on-theme:var(--color-on-theme-dark);--color-surface-primary:var(--color-surface-primary-dark);--color-surface-secondary:var(--color-surface-secondary-dark);--color-surface-tertiary:var(--color-surface-tertiary-dark);--color-shade-primary:var(--color-shade-primary-dark);--color-shade-secondary:var(--color-shade-secondary-dark);--color-shade-tertiary:var(--color-shade-tertiary-dark);--color-foreground-primary:var(--color-foreground-primary-dark);--color-foreground-secondary:var(--color-foreground-secondary-dark);--color-foreground-tertiary:var(--color-foreground-tertiary-dark);--color-outline-primary:var(--color-outline-primary-dark);--color-outline-secondary:var(--color-outline-secondary-dark);--color-overlay:var(--color-overlay-dark);--color-shadow:var(--color-shadow-dark)}}:host(.blue){--color-theme-solid:var(--color-theme-blue-solid);--color-theme-translucent:var(--color-theme-blue-translucent)}:host(.cyan){--color-theme-solid:var(--color-theme-cyan-solid);--color-theme-translucent:var(--color-theme-cyan-translucent)}:host(.green){--color-theme-solid:var(--color-theme-green-solid);--color-theme-translucent:var(--color-theme-green-translucent)}:host(.orange){--color-theme-solid:var(--color-theme-orange-solid);--color-theme-translucent:var(--color-theme-orange-translucent)}:host(.pink){--color-theme-solid:var(--color-theme-pink-solid);--color-theme-translucent:var(--color-theme-pink-translucent)}:host(.red){--color-theme-solid:var(--color-theme-red-solid);--color-theme-translucent:var(--color-theme-red-translucent)}:host(.violet){--color-theme-solid:var(--color-theme-violet-solid);--color-theme-translucent:var(--color-theme-violet-translucent)}';var EzpPrinting=function(){function e(e){registerInstance(this,e);this.theme="cyan";this.appearance="system";this.printOpen=false;this.authOpen=false}e.prototype.listenPrintCancel=function(){this.printOpen=false};e.prototype.listenPrintSubmit=function(){this.printOpen=false};e.prototype.listenAuthCancel=function(){this.authOpen=false};e.prototype.listenAuthShow=function(){this.authOpen=true};e.prototype.listenPrintShow=function(){this.printOpen=true};e.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(authStore.state.isAuthorized){this.printOpen=true}else{this.authOpen=true}return[2]}))}))};e.prototype.checkAuth=function(){var e=new EzpPrintService(this.redirecturi,this.clientid);var t=authStore.state.accessToken;if(t===""){t=localStorage.getItem("access_token");authStore.state.accessToken=t}if(localStorage.getItem("isAuthorized")){authStore.state.isAuthorized=!!localStorage.getItem("isAuthorized");this.authOpen=!authStore.state.isAuthorized}e.getConfig(authStore.state.accessToken).catch((function(){authStore.state.isAuthorized=false}))};e.prototype.componentWillLoad=function(){authStore.state.redirectUri=this.redirecturi;userStore.state.theme=this.theme;userStore.state.appearance=this.appearance;if(this.authapihosturl){authStore.state.authApiHostUrl=this.authapihosturl}else{authStore.state.authApiHostUrl=config.authApiHostUrl}if(this.printapihosturl){printStore.state.printApiHostUrl=this.printapihosturl}else{printStore.state.printApiHostUrl=config.printingApiHostUrl}sendCodeToParentWindow();this.checkAuth()};e.prototype.render=function(){var e=this;return h(Host,{class:userStore.state.theme+" "+userStore.state.appearance},this.authOpen?h("ezp-auth",{clientID:this.clientid,redirectURI:this.redirecturi,hidelogin:this.hidelogin}):this.printOpen?h("ezp-printer-selection",{clientID:this.clientid,redirectURI:this.redirecturi,filename:this.filename,fileurl:this.fileurl,filetype:this.filetype}):this.custom?h("slot",null):h("ezp-icon-button",{id:"print-trigger",icon:"printer",slot:"trigger",type:"button",onClick:function(){return e.open()}}))};return e}();EzpPrinting.style=ezpPrintingCss;var ezpProgressCss=":host{--stroke-width:4;-ms-flex-line-pack:center;align-content:center;-ms-flex-align:center;align-items:center;background:var(--color-overlay);border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;display:grid;grid-template:auto/auto;height:100%;-ms-flex-pack:center;justify-content:center;justify-items:center;left:0;padding:var(--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{background:var(--color-surface-tertiary);border-radius:3px;-webkit-box-shadow:var(--box-separator-position, 0 0 0 var(--hairline-width-positive)) var(--hairline-color);box-shadow:var(--box-separator-position, 0 0 0 var(--hairline-width-positive)) var(--hairline-color);display:grid;grid-row-gap:var(--spacing-2);grid-template-columns:1fr;grid-template-rows:repeat(2, auto);justify-items:center;padding:var(--spacing-4)}#indicator{-webkit-animation:rotate var(--duration-6) linear infinite;animation:rotate var(--duration-6) linear infinite;display:block;height:44px;-webkit-transform:rotate(0);transform:rotate(0);width:44px}#track{fill:none;stroke:var(--color-outline-primary);stroke-width:var(--stroke-width)}#value{-webkit-animation:offset var(--duration-6) linear alternate infinite;animation:offset var(--duration-6) linear alternate infinite;fill:none;stroke:var(--color-theme-solid);stroke-dasharray:100;stroke-dashoffset:100;stroke-linecap:round;stroke-width:var(--stroke-width)}#status{color:var(--color-foreground-primary)}@-webkit-keyframes offset{100%{stroke-dashoffset:50}}@keyframes offset{100%{stroke-dashoffset:50}}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}";var EzpProgress=function(){function e(e){registerInstance(this,e);this.status="Status..."}e.prototype.render=function(){return h(Host,null,h("div",{id:"box"},h("svg",{id:"indicator",viewBox:"0 0 44 44",xmlns:"http://www.w3.org/2000/svg"},h("circle",{id:"track",cx:"22",cy:"22",r:"16"}),h("circle",{id:"value",cx:"22",cy:"22",r:"16"})),h("ezp-label",{id:"status",level:"tertiary",weight:"strong",text:this.status})))};return e}();EzpProgress.style=ezpProgressCss;var ezpSelectCss=':host{--accessory-color:var(--color-foreground-secondary);--details-columns:1fr;--details-rows:auto;--host-height:var(--toggle-height);--duration:var(--duration-3);--host-transition:z-index 0s var(--duration);--host-z-index:3;--indicator-opacity:0;--indicator-transform:translateX(var(--spacing-3));--indicator-transition:opacity var(--duration) var(--easing-out-quart),\n transform var(--duration) var(--easing-out-quart), visibility 0s var(--duration);--indicator-visibility:hidden;--label-align:auto;--label-color:var(--color-foreground-secondary);--list-height:0;--list-separator-position:inset 0 var(--hairline-width-positive);--option-height:auto;--toggle-areas:none;--toggle-columns:none;--toggle-height:auto;--toggle-rows:auto;--value-align:auto;--wrap-radius:0;--wrap-separator-color:var(--hairline-color);--wrap-separator-position-bottom:0 var(--hairline-width-positive) 0 0;--wrap-separator-position-left:var(--hairline-width-negative) 0 0 0;--wrap-separator-position-right:var(--hairline-width-positive) 0 0 0;--wrap-separator-position-top:0 var(--hairline-width-negative) 0 0;--wrap-translate-y:0;display:block;height:var(--host-height);position:relative;-webkit-transition:var(--host-transition);transition:var(--host-transition);z-index:var(--host-z-index)}:host(:first-child){--wrap-radius:3px 3px 0 0}:host(:last-child){--wrap-radius:0 0 3px 3px}:host(:first-child:last-child){--wrap-radius:3px}:host(:not(:last-child):not(.is-expanded)){--wrap-separator-position-bottom:0 0 0 0}:host(.toggle-horizontal){--label-align:start;--toggle-areas:"label value accessory";--toggle-columns:1fr repeat(2, auto);--toggle-height:30px;--toggle-rows:auto;--value-align:end}:host(.toggle-horizontal.has-icon){--toggle-areas:"icon label value accessory";--toggle-columns:auto 1fr repeat(2, auto)}:host(.toggle-vertical){--label-align:center;--toggle-areas:"label accessory" "value accessory";--toggle-columns:1fr auto;--toggle-height:48px;--toggle-rows:repeat(2, auto);--value-align:center}:host(.toggle-vertical.has-icon){--toggle-areas:"icon label accessory" "icon value accessory";--toggle-columns:auto 1fr auto}:host(.option-horizontal){--details-columns:repeat(2, 1fr);--details-rows:auto;--option-height:30px}:host(.option-vertical){--details-columns:1fr;--details-rows:repeat(2, auto);--option-height:48px}:host(.is-expanded){--accessory-color:var(--color-theme-solid);--host-transition:z-index 0s 0s;--host-z-index:9999;--icon-color:var(--color-theme-solid);--label-color:var(--color-theme-solid);--wrap-radius:3px}@media (prefers-color-scheme: dark){:host{--list-separator-position:0 var(--hairline-width-negative) 0 0;--wrap-separator-position-bottom:inset 0 var(--hairline-width-negative) 0 0;--wrap-separator-position-left:inset var(--hairline-width-positive) 0 0 0;--wrap-separator-position-right:inset var(--hairline-width-negative) 0 0 0;--wrap-separator-position-top:inset 0 var(--hairline-width-positive) 0 0}}#wrap{background:var(--color-surface-tertiary);border-radius:var(--wrap-radius);-webkit-box-shadow:var(--wrap-separator-position-top) var(--wrap-separator-color), var(--wrap-separator-position-right) var(--wrap-separator-color), var(--wrap-separator-position-bottom) var(--wrap-separator-color), var(--wrap-separator-position-left) var(--wrap-separator-color);box-shadow:var(--wrap-separator-position-top) var(--wrap-separator-color), var(--wrap-separator-position-right) var(--wrap-separator-color), var(--wrap-separator-position-bottom) var(--wrap-separator-color), var(--wrap-separator-position-left) var(--wrap-separator-color);-webkit-transform:translateY(var(--wrap-translate-y));transform:translateY(var(--wrap-translate-y));-webkit-transition:border-radius var(--duration) var(--easing-out-quart), -webkit-transform var(--duration) var(--easing-out-quart), -webkit-box-shadow var(--duration) var(--easing-out-quart);transition:border-radius var(--duration) var(--easing-out-quart), -webkit-transform var(--duration) var(--easing-out-quart), -webkit-box-shadow var(--duration) var(--easing-out-quart);transition:transform var(--duration) var(--easing-out-quart), border-radius var(--duration) var(--easing-out-quart), box-shadow var(--duration) var(--easing-out-quart);transition:transform var(--duration) var(--easing-out-quart), border-radius var(--duration) var(--easing-out-quart), box-shadow var(--duration) var(--easing-out-quart), -webkit-transform var(--duration) var(--easing-out-quart), -webkit-box-shadow var(--duration) var(--easing-out-quart)}#toggle{-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:grid;gap:var(--spacing-2) var(--spacing-3);grid-template-areas:var(--toggle-areas);grid-template-columns:var(--toggle-columns);grid-template-rows:var(--toggle-rows);height:var(--toggle-height);padding:var(--spacing-3)}#toggle:hover{background:var(--color-shade-primary)}#icon{align-self:center;color:var(--icon-color, var(--color-foreground-secondary));grid-area:icon;margin:calc(var(--spacing-2) * -1) 0}#label{align-self:var(--label-align);color:var(--label-color);grid-area:label}#value{align-self:var(--value-align);color:var(--color-foreground-primary);grid-area:value}#accessory{align-self:center;color:var(--accessory-color);grid-area:accessory;margin:calc(var(--spacing-2) * -1) 0}#list{-webkit-box-shadow:var(--list-separator-position) var(--hairline-color);box-shadow:var(--list-separator-position) var(--hairline-color);height:var(--list-height);overflow:auto;-webkit-transition:height var(--duration) var(--easing-out-quart);transition:height var(--duration) var(--easing-out-quart)}.option{background:var(--option-background);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:grid;gap:var(--spacing-3);grid-template:auto/auto 1fr;height:var(--option-height);padding:0 0 0 var(--spacing-3)}.option:not(:first-child){--details-separator:0 var(--hairline-width-negative) 0 0 var(--hairline-color)}.option:hover{--option-background:var(--color-shade-primary)}.option:hover,.option:hover+.option{--details-separator:none}.option:active{--option-background:var(--color-shade-secondary)}.option.is-selected{--indicator-opacity:1;--indicator-transform:translateX(0);--indicator-transition:opacity var(--duration) var(--easing-out-quart),\n transform var(--duration) var(--easing-out-quart), visibility 0s 0s;--indicator-visibility:visible}.indicator{-ms-flex-item-align:center;align-self:center;color:var(--color-theme-solid);margin:calc(var(--spacing-2) * -1) 0;opacity:var(--indicator-opacity);-webkit-transform:var(--indicator-transform);transform:var(--indicator-transform);-webkit-transition:var(--indicator-transition);transition:var(--indicator-transition);visibility:var(--indicator-visibility)}.details{-webkit-box-shadow:var(--details-separator);box-shadow:var(--details-separator);display:grid;gap:var(--spacing-2);grid-template-columns:var(--details-columns);grid-template-rows:var(--details-rows);padding:var(--spacing-3) var(--spacing-3) var(--spacing-3) 0}.title{-ms-flex-item-align:start;align-self:start;color:var(--color-foreground-primary)}.meta{-ms-flex-item-align:end;align-self:end;color:var(--color-foreground-secondary)}';var EzpSelect=function(){function e(e){var t=this;registerInstance(this,e);this.selectToggle=createEvent(this,"selectToggle",7);this.selectSelection=createEvent(this,"selectSelection",7);this.backdrop=document.createElement("ezp-backdrop");this.containerHeight=0;this.expandCover=false;this.expandRise=false;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.expanded=false;this.selected={id:0,title:"",meta:""};this.toggle=function(){t.expanded=!t.expanded;t.selectToggle.emit(t.expanded)};this.select=function(e){var r=t.selected.id===e?0:t.duration*1e3;t.selected=t.options.find((function(t){return t.id===e}));t.selectSelection.emit(t.selected);window.setTimeout((function(){t.toggle()}),r)}}e.prototype.watchExpanded=function(){if(this.expandCover){this.component.style.setProperty("--list-height",this.expanded?this.containerHeight-this.toggleHeight+"px":"0px");this.component.style.setProperty("--wrap-translate-y",this.expanded?this.wrapTop*-1+this.spacing+"px":"0px")}else if(this.expandRise){this.component.style.setProperty("--list-height",this.expanded?this.listHeight+"px":"0px");this.component.style.setProperty("--wrap-translate-y",this.expanded?this.wrapDiff+this.spacing+"px":"0px")}else{this.component.style.setProperty("--list-height",this.expanded?this.listHeight+"px":"0px")}if(this.expanded){this.backdrop.visible=true;this.container.appendChild(this.backdrop)}else{this.backdrop.visible=false}};e.prototype.componentWillLoad=function(){var e=this;this.container=this.component.closest("[data-backdrop-surface]");this.backdrop.addEventListener("backdropHideStart",(function(){e.expanded=false}));this.backdrop.addEventListener("backdropHideEnd",(function(){e.container.removeChild(e.backdrop)}));if(this.preSelected){this.selected=this.options.find((function(t){return typeof e.preSelected==="number"?t.id===e.preSelected:t.title===e.preSelected}))}};e.prototype.componentDidLoad=function(){var e=getComputedStyle(this.component);this.toggleHeight=parseInt(e.getPropertyValue("--toggle-height"));this.duration=parseFloat(e.getPropertyValue("--duration"));this.containerHeight=this.container.clientHeight-this.spacing*2;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};e.prototype.render=function(){var e=this;var t=[this.expanded?"is-expanded":"",this.icon?"has-icon":"","toggle-"+this.toggleFlow,this.optionFlow?"option-"+this.optionFlow:""];var r=this.toggleFlow==="horizontal"?"secondary":"tertiary";return h(Host,{class:t.join(" ")},h("div",{id:"wrap"},h("div",{id:"toggle",onClick:function(){return e.toggle()}},this.icon?h("ezp-icon",{id:"icon",name:this.icon}):null,h("ezp-label",{id:"label",noWrap:true,level:r,text:this.label}),h("ezp-label",{id:"value",ellipsis:true,text:this.selected.title!==""?this.selected.title:this.placeholder}),h("ezp-icon",{id:"accessory",name:"expand"})),h("div",{id:"list",ref:function(t){return e.list=t}},this.options.map((function(t){if(t.title!==""){return h("div",{class:"option "+(t.id===e.selected.id?"is-selected":"")+" "+(t.meta!==""?"has-meta":"")+" ",onClick:function(){return e.select(t.id)}},h("ezp-icon",{name:"checkmark",class:"indicator"}),h("div",{class:"details"},h("ezp-label",{class:"title",ellipsis:true,text:t.title}),t.meta!==""?h("ezp-label",{level:"tertiary",class:"meta",text:t.meta,ellipsis:true}):null))}})))))};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{expanded:["watchExpanded"]}},enumerable:false,configurable:true});return e}();EzpSelect.style=ezpSelectCss;var ezpStepperCss=':host{-ms-flex-align:center;align-items:center;background:var(--color-surface-tertiary);border-radius:3px;-webkit-box-shadow:0 0 0 var(--hairline-width-positive) var(--hairline-color);box-shadow:0 0 0 var(--hairline-width-positive) var(--hairline-color);display:grid;gap:var(--spacing-3);grid-template:var(--host-gridTemplate, auto/auto 1fr auto);padding:0 var(--spacing-2) 0 var(--spacing-3);position:relative;z-index:0}:host(.focused){--icon-color:var(--color-theme-solid);--label-color:var(--color-theme-solid)}:host(.has-icon){--host-gridTemplate:auto / repeat(2, auto) 1fr auto}#toggle{background:var(--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{--toggle-background:var(--color-shade-primary)}}#icon{color:var(--icon-color, var(--color-foreground-secondary));pointer-events:none}#label{color:var(--label-color, var(--color-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(--color-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(--button-background, transparent);border:0;border-radius:50%;-webkit-box-shadow:none;box-shadow:none;color:var(--button-color, var(--color-theme-solid));cursor:var(--button-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;outline:none;padding:var(--spacing-1)}@media (hover: hover){.button:not(:disabled):hover{--button-background:var(--color-shade-primary)}.button:not(:disabled):active{--button-background:var(--color-shade-secondary)}}.button:disabled{--button-color:var(--color-foreground-tertiary);--button-cursor:not-allowed}';var EzpStepper=function(){function e(e){var t=this;registerInstance(this,e);this.stepperChanged=createEvent(this,"stepperChanged",7);this.label="Label";this.min=1;this.canDecrease=true;this.canIncrease=true;this.focused=false;this.value=1;this.handleDecrease=function(){t.value--};this.handleIncrease=function(){t.value++};this.handleInput=function(){t.value=t.input.value!==""?parseInt(t.input.value):t.min};this.setFocus=function(){t.input.focus()};this.handleBlur=function(){t.focused=false};this.handleFocus=function(){t.focused=true}}e.prototype.watchValue=function(){this.canIncrease=this.max!==undefined?this.value<this.max:true;this.canDecrease=this.min!==undefined?this.value>this.min:true;this.stepperChanged.emit(this.value)};e.prototype.componentWillLoad=function(){this.watchValue()};e.prototype.render=function(){var e=this;return h(Host,{class:(this.focused?"focused":"")+" "+(this.icon?"has-icon":"")},h("div",{id:"toggle",onClick:this.setFocus}),this.icon?h("ezp-icon",{id:"icon",name:this.icon}):null,h("ezp-label",{id:"label",noWrap:true,text:this.label}),h("input",{id:"input",type:"number",ref:function(t){return e.input=t},min:this.min.toString(),max:this.max.toString(),value:this.value.toString(),onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur}),h("div",{class:"buttons"},h("button",{class:"button",disabled:!this.canDecrease,onClick:this.handleDecrease},h("ezp-icon",{name:"minus"})),h("button",{class:"button",disabled:!this.canIncrease,onClick:this.handleIncrease},h("ezp-icon",{name:"plus"}))))};Object.defineProperty(e,"watchers",{get:function(){return{value:["watchValue"]}},enumerable:false,configurable:true});return e}();EzpStepper.style=ezpStepperCss;var ezpTextButtonCss=":host{display:-ms-flexbox;display:flex}:host(.primary){--button-background-disabled:var(--color-shade-primary);--button-background-init:var(--color-theme-solid);--button-color-disabled:var(--color-foreground-tertiary);--button-color-init:var(--color-on-theme);--button-opacity-active:0.74;--button-opacity-hover:0.84}:host(.secondary){--button-background-active:var(--color-shade-tertiary);--button-background-disabled:var(--color-shade-primary);--button-background-hover:var(--color-shade-secondary);--button-background-init:var(--color-shade-primary);--button-color-disabled:var(--color-foreground-tertiary);--button-color-init:var(--color-theme-solid)}:host(.tertiary){--button-background-active:var(--color-shade-secondary);--button-background-disabled:transparent;--button-background-hover:var(--color-shade-primary);--button-background-init:transparent;--button-color-disabled:var(--color-foreground-tertiary);--button-color-init:var(--color-theme-solid)}.button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--button-background, var(--button-background-init));border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:var(--button-color, var(--button-color-init));cursor:var(--button-cursor, pointer);display:-ms-flexbox;display:flex;font-family:inherit;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--button-opacity, 1);outline:none;padding:var(--spacing-3);white-space:nowrap;width:100%}@media (hover: hover){.button:not(:disabled):hover{--button-background:var(--button-background-hover, var(--button-background-init));--button-opacity:var(--button-opacity-hover, 1)}.button:not(:disabled):active{--button-background:var(--button-background-active, var(--button-background-init));--button-opacity:var(--button-opacity-active, 1)}}.button:disabled{--button-background:var(--button-background-disabled);--button-color:var(--button-color-disabled);--button-cursor:not-allowed}";var EzpTextButton=function(){function e(e){registerInstance(this,e);this.blank=false;this.disabled=false;this.level="primary"}e.prototype.render=function(){var e=this.type!==undefined?"button":"a";var t=this.type!==undefined?{type:this.type,disabled:this.disabled}:{href:this.href,target:this.blank?"_blank":"_self"};return h(Host,{class:""+this.level},h(e,Object.assign({class:"button"},t),h("ezp-label",{weight:"heavy",text:this.label})))};return e}();EzpTextButton.style=ezpTextButtonCss;var ezpUserMenuCss=":host{background:var(--color-surface-tertiary);border-radius:6px;-webkit-box-shadow:var(--host-separator-position, 0 0 0 var(--hairline-width-positive)) var(--hairline-color);box-shadow:var(--host-separator-position, 0 0 0 var(--hairline-width-positive)) var(--hairline-color);display:block;opacity:var(--host-opacity, 0);position:absolute;right:0;top:0;-webkit-transform:scale(var(--host-scale, 0.94, 0.94));transform:scale(var(--host-scale, 0.94, 0.94));-webkit-transform-origin:right top;transform-origin:right top;-webkit-transition:var(--host-transition, opacity var(--duration-3) var(--easing-out-quart), transform var(--duration-3) var(--easing-out-quart), visibility 0s var(--duration-3));transition:var(--host-transition, opacity var(--duration-3) var(--easing-out-quart), transform var(--duration-3) var(--easing-out-quart), visibility 0s var(--duration-3));visibility:var(--host-visibility, hidden);z-index:5}:host(.is-open){--host-opacity:1;--host-scale:1, 1;--host-transition:opacity var(--duration-3) var(--easing-out-quart),\n transform var(--duration-3) var(--easing-out-quart), visibility 0s 0s;--host-visibility:visible}@media (prefers-color-scheme: dark){:host{--host-separator-position:inset 0 0 0 var(--hairline-width-positive)}}#header{-ms-flex-align:center;align-items:center;-webkit-box-shadow:0 var(--hairline-width-positive) 0 0 var(--hairline-color);box-shadow:0 var(--hairline-width-positive) 0 0 var(--hairline-color);-webkit-box-shadow:0;box-shadow:0;display:grid;grid-template:auto/1fr auto;padding:var(--spacing-4) var(--spacing-3) var(--spacing-4) var(--spacing-4)}#name{color:var(--color-foreground-primary)}#close{margin:calc(var(--spacing-3) * -1) 0}#links{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:var(--spacing-2)}.link{-ms-flex-align:center;align-items:center;background:var(--link-background, transparent);border-radius:3px;color:var(--color-foreground-primary);cursor:pointer;display:grid;gap:var(--spacing-3);grid-template:auto/auto 1fr;padding:var(--spacing-3);text-decoration:none}.link:hover{--link-background:var(--color-shade-primary)}.link__icon{color:var(--color-theme-solid);margin:calc(var(--spacing-2) * -1) 0}#theme{-webkit-box-shadow:inset 0 var(--hairline-width-positive) 0 0 var(--hairline-color);box-shadow:inset 0 var(--hairline-width-positive) 0 0 var(--hairline-color);display:grid;gap:var(--spacing-3);grid-template:repeat(2, auto)/1fr;padding:var(--spacing-4) var(--spacing-4) var(--spacing-3)}#swatches{display:-ms-flexbox;display:flex;margin:0 calc(var(--spacing-2) * -1)}.swatch{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--swatch-background, transparent);border:0;border-radius:50%;color:var(--swatch-color);cursor:var(--swatch-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--swatch-opacity, 1);outline:none;padding:var(--spacing-2)}@media (hover: hover){.swatch:not(.selected):hover{--swatch-background:var(--swatch-theme-translucent)}.swatch:not(.selected):active{--swatch-opacity:0.74}}.swatch.selected{--dot-boxShadowSize:10px;--swatch-background:var(--swatch-theme-translucent);--swatch-cursor:normal}.swatch.selected>.dot{-webkit-animation:dot-bounce var(--duration-2) ease-in-out;animation:dot-bounce var(--duration-2) ease-in-out}.swatch--blue{--swatch-theme-solid:var(--color-theme-blue-solid);--swatch-theme-translucent:var(--color-theme-blue-translucent)}.swatch--cyan{--swatch-theme-solid:var(--color-theme-cyan-solid);--swatch-theme-translucent:var(--color-theme-cyan-translucent)}.swatch--green{--swatch-theme-solid:var(--color-theme-green-solid);--swatch-theme-translucent:var(--color-theme-green-translucent)}.swatch--orange{--swatch-theme-solid:var(--color-theme-orange-solid);--swatch-theme-translucent:var(--color-theme-orange-translucent)}.swatch--pink{--swatch-theme-solid:var(--color-theme-pink-solid);--swatch-theme-translucent:var(--color-theme-pink-translucent)}.swatch--red{--swatch-theme-solid:var(--color-theme-red-solid);--swatch-theme-translucent:var(--color-theme-red-translucent)}.swatch--violet{--swatch-theme-solid:var(--color-theme-violet-solid);--swatch-theme-translucent:var(--color-theme-violet-translucent)}.dot{background:var(--dot-background, transparent);border-radius:50%;-webkit-box-shadow:inset 0 0 0 var(--dot-boxShadowSize, 4px) var(--swatch-theme-solid);box-shadow:inset 0 0 0 var(--dot-boxShadowSize, 4px) var(--swatch-theme-solid);height:18px;-webkit-transition:-webkit-box-shadow var(--duration-2);transition:-webkit-box-shadow var(--duration-2);transition:box-shadow var(--duration-2);transition:box-shadow var(--duration-2), -webkit-box-shadow var(--duration-2);width:18px}#appearance{-webkit-box-shadow:inset 0 var(--hairline-width-positive) 0 0 var(--hairline-color);box-shadow:inset 0 var(--hairline-width-positive) 0 0 var(--hairline-color);display:grid;gap:var(--spacing-3);grid-template:repeat(2, auto)/1fr;padding:var(--spacing-4) var(--spacing-4) var(--spacing-3)}#tabs{display:grid;grid-template:auto/repeat(3, 1fr);margin:0 calc(var(--spacing-2) * -1)}.tab{--icon-height:8px;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--tab-background, transparent);border:0;border-radius:14px;color:var(--tab-color, var(--color-foreground-secondary));cursor:var(--tab-cursor, pointer);display:-ms-flexbox;display:flex;gap:var(--spacing-2);-ms-flex-pack:center;justify-content:center;margin:0;outline:none;padding:var(--spacing-3) var(--spacing-3) var(--spacing-3) var(--spacing-2)}@media (hover: hover){.tab:not(.selected):hover{--tab-background:var(--color-shade-primary)}.tab:not(.selected):active{--tab-background:var(--color-shade-secondary)}}.tab.selected{--tab-background:var(--color-theme-translucent);--tab-color:var(--color-theme-solid);--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)}}";var EzpUserMenu=function(){function e(e){var t=this;registerInstance(this,e);this.userMenuClosure=createEvent(this,"userMenuClosure",7);this.logoutEmitter=createEvent(this,"logoutEmitter",7);this.backdrop=document.createElement("ezp-backdrop");this.links=[{title:"Manage Account",icon:"account",href:"https://app.ezeep.com"},{title:"Help & Support",icon:"help",href:"https://support.ezeep.com"}];this.themes=["pink","red","orange","green","cyan","blue","violet"];this.appearances=[{title:"System",name:"system"},{title:"Light",name:"light"},{title:"Dark",name:"dark"}];this.name="John Doe";this.open=false;this.handleClose=function(){t.userMenuClosure.emit()};this.logOut=function(){localStorage.clear();authStore.state.isAuthorized=false;t.logoutEmitter.emit()};this.handleTheme=function(e){userStore.state.theme=e};this.handleAppearance=function(e){userStore.state.appearance=e}}e.prototype.watchOpen=function(){if(this.open){this.backdrop.visible=true;this.container.appendChild(this.backdrop)}else{this.backdrop.visible=false;this.userMenuClosure.emit()}};e.prototype.componentWillLoad=function(){var e=this;this.container=this.component.closest("[data-backdrop-surface]");this.backdrop.addEventListener("backdropHideStart",(function(){e.open=false}));this.backdrop.addEventListener("backdropHideEnd",(function(){e.container.removeChild(e.backdrop)}))};e.prototype.render=function(){var e=this;return h(Host,{class:this.open?"is-open":""},h("div",{id:"header"},h("ezp-label",{ellipsis:true,id:"name",weight:"strong",text:this.name}),h("ezp-icon-button",{id:"close",level:"tertiary",icon:"close",onClick:this.handleClose})),h("div",{id:"links"},this.links.map((function(e){return h("a",{class:"link",href:e.href,target:"_blank",rel:"noopener noreferrer"},h("ezp-icon",{class:"link__icon",name:e.icon}),h("ezp-label",{text:e.title}))})),h("a",{class:"link",onClick:this.logOut},h("ezp-icon",{class:"link__icon",name:"logout"}),h("ezp-label",{text:"Logout"}))),h("div",{id:"theme"},h("ezp-label",{text:"Color Theme:",weight:"strong"}),h("div",{id:"swatches"},this.themes.map((function(t){return h("button",{class:"swatch swatch--"+t+" "+(t===userStore.state.theme?"selected":""),onClick:function(){return e.handleTheme(t)}},h("span",{class:"dot"}))})))),h("div",{id:"appearance"},h("ezp-label",{text:"Appearance:",weight:"strong"}),h("div",{id:"tabs"},this.appearances.map((function(t){return h("button",{class:"tab "+(t.name===userStore.state.appearance?"selected":""),onClick:function(){return e.handleAppearance(t.name)}},h("ezp-icon",{name:t.name}),h("ezp-label",{text:t.title,level:"tertiary",weight:"strong"}))})))))};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{open:["watchOpen"]}},enumerable:false,configurable:true});return e}();EzpUserMenu.style=ezpUserMenuCss;export{EzpAuth as ezp_auth,EzpBackdrop as ezp_backdrop,EzpIcon as ezp_icon,EzpIconButton as ezp_icon_button,EzpLabel as ezp_label,EzpPrinterSelection as ezp_printer_selection,EzpPrinting as ezp_printing,EzpProgress as ezp_progress,EzpSelect as ezp_select,EzpStepper as ezp_stepper,EzpTextButton as ezp_text_button,EzpUserMenu as ezp_user_menu};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,r,o){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o["throw"](e))}catch(e){n(e)}}function l(e){e.done?r(e.value):i(e.value).then(a,s)}l((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,i,n,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return l([e,t])}}function l(a){if(o)throw new TypeError("Generator is already executing.");while(r)try{if(o=1,i&&(n=a[0]&2?i["return"]:a[0]?i["throw"]||((n=i["return"])&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;if(i=0,n)a=[a[0]&2,n.value];switch(a[0]){case 0:case 1:n=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;i=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(n=r.trys,n=n.length>0&&n[n.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!n||a[1]>n[0]&&a[1]<n[3])){r.label=a[1];break}if(a[0]===6&&r.label<n[1]){r.label=n[1];n=a;break}if(n&&r.label<n[2]){r.label=n[2];r.ops.push(a);break}if(n[2])r.ops.pop();r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e];i=0}finally{o=n=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{g as getRenderingRef,f as forceUpdate,r as registerInstance,c as createEvent,h,H as Host,a as getElement,d as getAssetPath}from"./index-9ecf6ae0.js";var appendToMap=function(e,t,r){var o=e.get(t);if(!o){e.set(t,[r])}else if(!o.includes(r)){o.push(r)}};var debounce=function(e,t){var r;return function(){var o=[];for(var i=0;i<arguments.length;i++){o[i]=arguments[i]}if(r){clearTimeout(r)}r=setTimeout((function(){r=0;e.apply(void 0,o)}),t)}};var isConnected=function(e){return!("isConnected"in e)||e.isConnected};var cleanupElements=debounce((function(e){for(var t=0,r=e.keys();t<r.length;t++){var o=r[t];e.set(o,e.get(o).filter(isConnected))}}),2e3);var stencilSubscription=function(e){var t=e.on;var r=new Map;if(typeof getRenderingRef==="function"){t("dispose",(function(){r.clear()}));t("get",(function(e){var t=getRenderingRef();if(t){appendToMap(r,e,t)}}));t("set",(function(e){var t=r.get(e);if(t){r.set(e,t.filter(forceUpdate))}cleanupElements(r)}));t("reset",(function(){r.forEach((function(e){return e.forEach(forceUpdate)}));cleanupElements(r)}))}};var createObservableMap=function(e,t){if(t===void 0){t=function(e,t){return e!==t}}var r=new Map(Object.entries(e!==null&&e!==void 0?e:{}));var o={dispose:[],get:[],set:[],reset:[]};var i=function(){r=new Map(Object.entries(e!==null&&e!==void 0?e:{}));o.reset.forEach((function(e){return e()}))};var n=function(){o.dispose.forEach((function(e){return e()}));i()};var a=function(e){o.get.forEach((function(t){return t(e)}));return r.get(e)};var s=function(e,i){var n=r.get(e);if(t(i,n,e)){r.set(e,i);o.set.forEach((function(t){return t(e,i,n)}))}};var l=typeof Proxy==="undefined"?{}:new Proxy(e,{get:function(e,t){return a(t)},ownKeys:function(e){return Array.from(r.keys())},getOwnPropertyDescriptor:function(){return{enumerable:true,configurable:true}},has:function(e,t){return r.has(t)},set:function(e,t,r){s(t,r);return true}});var c=function(e,t){o[e].push(t);return function(){removeFromArray(o[e],t)}};var u=function(t,r){var o=c("set",(function(e,o){if(e===t){r(o)}}));var i=c("reset",(function(){return r(e[t])}));return function(){o();i()}};var p=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return e.forEach((function(e){if(e.set){c("set",e.set)}if(e.get){c("get",e.get)}if(e.reset){c("reset",e.reset)}}))};var d=function(e){var t=r.get(e);o.set.forEach((function(r){return r(e,t,t)}))};return{state:l,get:a,set:s,on:c,onChange:u,use:p,dispose:n,reset:i,forceUpdate:d}};var removeFromArray=function(e,t){var r=e.indexOf(t);if(r>=0){e[r]=e[e.length-1];e.length--}};var createStore=function(e,t){var r=createObservableMap(e,t);stencilSubscription(r);return r};function _typeof$1(e){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof$1=function e(t){return typeof t}}else{_typeof$1=function e(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}}return _typeof$1(e)}function _defineProperty(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?Object(arguments[t]):{};var o=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))}o.forEach((function(t){_defineProperty(e,t,r[t])}))}return e}function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||false;o.configurable=true;if("value"in o)o.writable=true;Object.defineProperty(e,o.key,o)}}function _createClass(e,t,r){if(t)_defineProperties(e.prototype,t);if(r)_defineProperties(e,r);return e}function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function createCommonjsModule(e,t,r){return r={path:t,exports:{},require:function(e,t){return commonjsRequire()}},e(r,r.exports),r.exports}function getAugmentedNamespace(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:true});Object.keys(e).forEach((function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:true,get:function(){return e[r]}})}));return t}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var _typeof_1=createCommonjsModule((function(e){function t(r){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){e.exports=t=function e(t){return typeof t};e.exports["default"]=e.exports,e.exports.__esModule=true}else{e.exports=t=function e(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.exports["default"]=e.exports,e.exports.__esModule=true}return t(r)}e.exports=t;e.exports["default"]=e.exports,e.exports.__esModule=true}));var _typeof=getDefaultExportFromCjs(_typeof_1);function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _possibleConstructorReturn(e,t){if(t&&(_typeof(t)==="object"||typeof t==="function")){return t}return _assertThisInitialized(e)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function e(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(e)}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function e(t,r){t.__proto__=r;return t};return _setPrototypeOf(e,t)}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)_setPrototypeOf(e,t)}var consoleLogger={type:"logger",log:function e(t){this.output("log",t)},warn:function e(t){this.output("warn",t)},error:function e(t){this.output("error",t)},output:function e(t,r){if(console&&console[t])console[t].apply(console,r)}};var Logger=function(){function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,e);this.init(t,r)}_createClass(e,[{key:"init",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.prefix=r.prefix||"i18next:";this.logger=t||consoleLogger;this.options=r;this.debug=r.debug}},{key:"setDebug",value:function e(t){this.debug=t}},{key:"log",value:function e(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++){r[o]=arguments[o]}return this.forward(r,"log","",true)}},{key:"warn",value:function e(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++){r[o]=arguments[o]}return this.forward(r,"warn","",true)}},{key:"error",value:function e(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++){r[o]=arguments[o]}return this.forward(r,"error","")}},{key:"deprecate",value:function e(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++){r[o]=arguments[o]}return this.forward(r,"warn","WARNING DEPRECATED: ",true)}},{key:"forward",value:function e(t,r,o,i){if(i&&!this.debug)return null;if(typeof t[0]==="string")t[0]="".concat(o).concat(this.prefix," ").concat(t[0]);return this.logger[r](t)}},{key:"create",value:function t(r){return new e(this.logger,_objectSpread({},{prefix:"".concat(this.prefix,":").concat(r,":")},this.options))}}]);return e}();var baseLogger=new Logger;var EventEmitter=function(){function e(){_classCallCheck(this,e);this.observers={}}_createClass(e,[{key:"on",value:function e(t,r){var o=this;t.split(" ").forEach((function(e){o.observers[e]=o.observers[e]||[];o.observers[e].push(r)}));return this}},{key:"off",value:function e(t,r){if(!this.observers[t])return;if(!r){delete this.observers[t];return}this.observers[t]=this.observers[t].filter((function(e){return e!==r}))}},{key:"emit",value:function e(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++){o[i-1]=arguments[i]}if(this.observers[t]){var n=[].concat(this.observers[t]);n.forEach((function(e){e.apply(void 0,o)}))}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach((function(e){e.apply(e,[t].concat(o))}))}}}]);return e}();function defer(){var e;var t;var r=new Promise((function(r,o){e=r;t=o}));r.resolve=e;r.reject=t;return r}function makeString(e){if(e==null)return"";return""+e}function copy(e,t,r){e.forEach((function(e){if(t[e])r[e]=t[e]}))}function getLastOfPath(e,t,r){function o(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||typeof e==="string"}var n=typeof t!=="string"?[].concat(t):t.split(".");while(n.length>1){if(i())return{};var a=o(n.shift());if(!e[a]&&r)e[a]=new r;if(Object.prototype.hasOwnProperty.call(e,a)){e=e[a]}else{e={}}}if(i())return{};return{obj:e,k:o(n.shift())}}function setPath(e,t,r){var o=getLastOfPath(e,t,Object),i=o.obj,n=o.k;i[n]=r}function pushPath(e,t,r,o){var i=getLastOfPath(e,t,Object),n=i.obj,a=i.k;n[a]=n[a]||[];if(o)n[a]=n[a].concat(r);if(!o)n[a].push(r)}function getPath(e,t){var r=getLastOfPath(e,t),o=r.obj,i=r.k;if(!o)return undefined;return o[i]}function getPathWithDefaults(e,t,r){var o=getPath(e,r);if(o!==undefined){return o}return getPath(t,r)}function deepExtend(e,t,r){for(var o in t){if(o!=="__proto__"&&o!=="constructor"){if(o in e){if(typeof e[o]==="string"||e[o]instanceof String||typeof t[o]==="string"||t[o]instanceof String){if(r)e[o]=t[o]}else{deepExtend(e[o],t[o],r)}}else{e[o]=t[o]}}}return e}function regexEscape(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function escape(e){if(typeof e==="string"){return e.replace(/[&<>"'\/]/g,(function(e){return _entityMap[e]}))}return e}var isIE10=typeof window!=="undefined"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1;var chars=[" ",",","?","!",";"];function looksLikeObjectPath(e,t,r){t=t||"";r=r||"";var o=chars.filter((function(e){return t.indexOf(e)<0&&r.indexOf(e)<0}));if(o.length===0)return true;var i=new RegExp("(".concat(o.map((function(e){return e==="?"?"\\?":e})).join("|"),")"));var n=!i.test(e);if(!n){var a=e.indexOf(r);if(a>0&&!i.test(e.substring(0,a))){n=true}}return n}function deepFind(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:".";if(!e)return undefined;if(e[t])return e[t];var o=t.split(r);var i=e;for(var n=0;n<o.length;++n){if(!i)return undefined;if(typeof i[o[n]]==="string"&&n+1<o.length){return undefined}if(i[o[n]]===undefined){var a=2;var s=o.slice(n,n+a).join(r);var l=i[s];while(l===undefined&&o.length>n+a){a++;s=o.slice(n,n+a).join(r);l=i[s]}if(l===undefined)return undefined;if(typeof l==="string")return l;if(s&&typeof l[s]==="string")return l[s];var c=o.slice(n+a).join(r);if(c)return deepFind(l,c,r);return undefined}i=i[o[n]]}return i}var ResourceStore=function(e){_inherits(t,e);function t(e){var r;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{ns:["translation"],defaultNS:"translation"};_classCallCheck(this,t);r=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this));if(isIE10){EventEmitter.call(_assertThisInitialized(r))}r.data=e||{};r.options=o;if(r.options.keySeparator===undefined){r.options.keySeparator="."}if(r.options.ignoreJSONStructure===undefined){r.options.ignoreJSONStructure=true}return r}_createClass(t,[{key:"addNamespaces",value:function e(t){if(this.options.ns.indexOf(t)<0){this.options.ns.push(t)}}},{key:"removeNamespaces",value:function e(t){var r=this.options.ns.indexOf(t);if(r>-1){this.options.ns.splice(r,1)}}},{key:"getResource",value:function e(t,r,o){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var n=i.keySeparator!==undefined?i.keySeparator:this.options.keySeparator;var a=i.ignoreJSONStructure!==undefined?i.ignoreJSONStructure:this.options.ignoreJSONStructure;var s=[t,r];if(o&&typeof o!=="string")s=s.concat(o);if(o&&typeof o==="string")s=s.concat(n?o.split(n):o);if(t.indexOf(".")>-1){s=t.split(".")}var l=getPath(this.data,s);if(l||!a||typeof o!=="string")return l;return deepFind(this.data&&this.data[t]&&this.data[t][r],o,n)}},{key:"addResource",value:function e(t,r,o,i){var n=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{silent:false};var a=this.options.keySeparator;if(a===undefined)a=".";var s=[t,r];if(o)s=s.concat(a?o.split(a):o);if(t.indexOf(".")>-1){s=t.split(".");i=r;r=s[1]}this.addNamespaces(r);setPath(this.data,s,i);if(!n.silent)this.emit("added",t,r,o,i)}},{key:"addResources",value:function e(t,r,o){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{silent:false};for(var n in o){if(typeof o[n]==="string"||Object.prototype.toString.apply(o[n])==="[object Array]")this.addResource(t,r,n,o[n],{silent:true})}if(!i.silent)this.emit("added",t,r,o)}},{key:"addResourceBundle",value:function e(t,r,o,i,n){var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{silent:false};var s=[t,r];if(t.indexOf(".")>-1){s=t.split(".");i=o;o=r;r=s[1]}this.addNamespaces(r);var l=getPath(this.data,s)||{};if(i){deepExtend(l,o,n)}else{l=_objectSpread({},l,o)}setPath(this.data,s,l);if(!a.silent)this.emit("added",t,r,o)}},{key:"removeResourceBundle",value:function e(t,r){if(this.hasResourceBundle(t,r)){delete this.data[t][r]}this.removeNamespaces(r);this.emit("removed",t,r)}},{key:"hasResourceBundle",value:function e(t,r){return this.getResource(t,r)!==undefined}},{key:"getResourceBundle",value:function e(t,r){if(!r)r=this.options.defaultNS;if(this.options.compatibilityAPI==="v1")return _objectSpread({},{},this.getResource(t,r));return this.getResource(t,r)}},{key:"getDataByLanguage",value:function e(t){return this.data[t]}},{key:"hasLanguageSomeTranslations",value:function e(t){var r=this.getDataByLanguage(t);var o=r&&Object.keys(r)||[];return!!o.find((function(e){return r[e]&&Object.keys(r[e]).length>0}))}},{key:"toJSON",value:function e(){return this.data}}]);return t}(EventEmitter);var postProcessor={processors:{},addPostProcessor:function e(t){this.processors[t.name]=t},handle:function e(t,r,o,i,n){var a=this;t.forEach((function(e){if(a.processors[e])r=a.processors[e].process(r,o,i,n)}));return r}};var checkedLoadedFor={};var Translator=function(e){_inherits(t,e);function t(e){var r;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,t);r=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this));if(isIE10){EventEmitter.call(_assertThisInitialized(r))}copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,_assertThisInitialized(r));r.options=o;if(r.options.keySeparator===undefined){r.options.keySeparator="."}r.logger=baseLogger.create("translator");return r}_createClass(t,[{key:"changeLanguage",value:function e(t){if(t)this.language=t}},{key:"exists",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{interpolation:{}};if(t===undefined||t===null){return false}var o=this.resolve(t,r);return o&&o.res!==undefined}},{key:"extractFromKey",value:function e(t,r){var o=r.nsSeparator!==undefined?r.nsSeparator:this.options.nsSeparator;if(o===undefined)o=":";var i=r.keySeparator!==undefined?r.keySeparator:this.options.keySeparator;var n=r.ns||this.options.defaultNS;var a=o&&t.indexOf(o)>-1;var s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!looksLikeObjectPath(t,o,i);if(a&&!s){var l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0){return{key:t,namespaces:n}}var c=t.split(o);if(o!==i||o===i&&this.options.ns.indexOf(c[0])>-1)n=c.shift();t=c.join(i)}if(typeof n==="string")n=[n];return{key:t,namespaces:n}}},{key:"translate",value:function e(r,o,i){var n=this;if(_typeof$1(o)!=="object"&&this.options.overloadTranslationOptionHandler){o=this.options.overloadTranslationOptionHandler(arguments)}if(!o)o={};if(r===undefined||r===null)return"";if(!Array.isArray(r))r=[String(r)];var a=o.keySeparator!==undefined?o.keySeparator:this.options.keySeparator;var s=this.extractFromKey(r[r.length-1],o),l=s.key,c=s.namespaces;var u=c[c.length-1];var p=o.lng||this.language;var d=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&p.toLowerCase()==="cimode"){if(d){var h=o.nsSeparator||this.options.nsSeparator;return u+h+l}return l}var f=this.resolve(r,o);var g=f&&f.res;var v=f&&f.usedKey||l;var m=f&&f.exactUsedKey||l;var y=Object.prototype.toString.apply(g);var b=["[object Number]","[object Function]","[object RegExp]"];var k=o.joinArrays!==undefined?o.joinArrays:this.options.joinArrays;var w=!this.i18nFormat||this.i18nFormat.handleAsObject;var x=typeof g!=="string"&&typeof g!=="boolean"&&typeof g!=="number";if(w&&g&&x&&b.indexOf(y)<0&&!(typeof k==="string"&&y==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){if(!this.options.returnedObjectHandler){this.logger.warn("accessing an object - but returnObjects options is not enabled!")}return this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,g,_objectSpread({},o,{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.")}if(a){var S=y==="[object Array]";var _=S?[]:{};var P=S?m:v;for(var z in g){if(Object.prototype.hasOwnProperty.call(g,z)){var O="".concat(P).concat(a).concat(z);_[z]=this.translate(O,_objectSpread({},o,{joinArrays:false,ns:c}));if(_[z]===O)_[z]=g[z]}}g=_}}else if(w&&typeof k==="string"&&y==="[object Array]"){g=g.join(k);if(g)g=this.extendTranslation(g,r,o,i)}else{var E=false;var C=false;var L=o.count!==undefined&&typeof o.count!=="string";var j=t.hasDefaultValue(o);var A=L?this.pluralResolver.getSuffix(p,o.count,o):"";var R=o["defaultValue".concat(A)]||o.defaultValue;if(!this.isValidLookup(g)&&j){E=true;g=R}if(!this.isValidLookup(g)){C=true;g=l}var T=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey;var I=T&&C?undefined:g;var U=j&&R!==g&&this.options.updateMissing;if(C||E||U){this.logger.log(U?"updateKey":"missingKey",p,u,l,U?R:g);if(a){var H=this.resolve(l,_objectSpread({},o,{keySeparator:false}));if(H&&H.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.")}var N=[];var D=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&D&&D[0]){for(var F=0;F<D.length;F++){N.push(D[F])}}else if(this.options.saveMissingTo==="all"){N=this.languageUtils.toResolveHierarchy(o.lng||this.language)}else{N.push(o.lng||this.language)}var B=function e(t,r,i){if(n.options.missingKeyHandler){n.options.missingKeyHandler(t,u,r,U?i:I,U,o)}else if(n.backendConnector&&n.backendConnector.saveMissing){n.backendConnector.saveMissing(t,u,r,U?i:I,U,o)}n.emit("missingKey",t,u,r,g)};if(this.options.saveMissing){if(this.options.saveMissingPlurals&&L){N.forEach((function(e){n.pluralResolver.getSuffixes(e).forEach((function(t){B([e],l+t,o["defaultValue".concat(t)]||R)}))}))}else{B(N,l,R)}}}g=this.extendTranslation(g,r,o,f,i);if(C&&g===l&&this.options.appendNamespaceToMissingKey)g="".concat(u,":").concat(l);if((C||E)&&this.options.parseMissingKeyHandler)g=this.options.parseMissingKeyHandler(g)}return g}},{key:"extendTranslation",value:function e(t,r,o,i,n){var a=this;if(this.i18nFormat&&this.i18nFormat.parse){t=this.i18nFormat.parse(t,o,i.usedLng,i.usedNS,i.usedKey,{resolved:i})}else if(!o.skipInterpolation){if(o.interpolation)this.interpolator.init(_objectSpread({},o,{interpolation:_objectSpread({},this.options.interpolation,o.interpolation)}));var s=o.interpolation&&o.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;var l;if(s){var c=t.match(this.interpolator.nestingRegexp);l=c&&c.length}var u=o.replace&&typeof o.replace!=="string"?o.replace:o;if(this.options.interpolation.defaultVariables)u=_objectSpread({},this.options.interpolation.defaultVariables,u);t=this.interpolator.interpolate(t,u,o.lng||this.language,o);if(s){var p=t.match(this.interpolator.nestingRegexp);var d=p&&p.length;if(l<d)o.nest=false}if(o.nest!==false)t=this.interpolator.nest(t,(function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++){t[i]=arguments[i]}if(n&&n[0]===t[0]&&!o.context){a.logger.warn("It seems you are nesting recursively key: ".concat(t[0]," in key: ").concat(r[0]));return null}return a.translate.apply(a,t.concat([r]))}),o);if(o.interpolation)this.interpolator.reset()}var h=o.postProcess||this.options.postProcess;var f=typeof h==="string"?[h]:h;if(t!==undefined&&t!==null&&f&&f.length&&o.applyPostProcessor!==false){t=postProcessor.handle(f,t,r,this.options&&this.options.postProcessPassResolved?_objectSpread({i18nResolved:i},o):o,this)}return t}},{key:"resolve",value:function e(t){var r=this;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i;var n;var a;var s;var l;if(typeof t==="string")t=[t];t.forEach((function(e){if(r.isValidLookup(i))return;var t=r.extractFromKey(e,o);var c=t.key;n=c;var u=t.namespaces;if(r.options.fallbackNS)u=u.concat(r.options.fallbackNS);var p=o.count!==undefined&&typeof o.count!=="string";var d=o.context!==undefined&&(typeof o.context==="string"||typeof o.context==="number")&&o.context!=="";var h=o.lngs?o.lngs:r.languageUtils.toResolveHierarchy(o.lng||r.language,o.fallbackLng);u.forEach((function(e){if(r.isValidLookup(i))return;l=e;if(!checkedLoadedFor["".concat(h[0],"-").concat(e)]&&r.utils&&r.utils.hasLoadedNamespace&&!r.utils.hasLoadedNamespace(l)){checkedLoadedFor["".concat(h[0],"-").concat(e)]=true;r.logger.warn('key "'.concat(n,'" for languages "').concat(h.join(", "),'" won\'t get resolved as namespace "').concat(l,'" 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!!!")}h.forEach((function(t){if(r.isValidLookup(i))return;s=t;var n=c;var l=[n];if(r.i18nFormat&&r.i18nFormat.addLookupKeys){r.i18nFormat.addLookupKeys(l,c,t,e,o)}else{var u;if(p)u=r.pluralResolver.getSuffix(t,o.count,o);if(p&&d)l.push(n+u);if(d)l.push(n+="".concat(r.options.contextSeparator).concat(o.context));if(p)l.push(n+=u)}var h;while(h=l.pop()){if(!r.isValidLookup(i)){a=h;i=r.getResource(t,e,h,o)}}}))}))}));return{res:i,usedKey:n,exactUsedKey:a,usedLng:s,usedNS:l}}},{key:"isValidLookup",value:function e(t){return t!==undefined&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}},{key:"getResource",value:function e(t,r,o){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};if(this.i18nFormat&&this.i18nFormat.getResource)return this.i18nFormat.getResource(t,r,o,i);return this.resourceStore.getResource(t,r,o,i)}}],[{key:"hasDefaultValue",value:function e(t){var r="defaultValue";for(var o in t){if(Object.prototype.hasOwnProperty.call(t,o)&&r===o.substring(0,r.length)&&undefined!==t[o]){return true}}return false}}]);return t}(EventEmitter);function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}var LanguageUtil=function(){function e(t){_classCallCheck(this,e);this.options=t;this.supportedLngs=this.options.supportedLngs||false;this.logger=baseLogger.create("languageUtils")}_createClass(e,[{key:"getScriptPartFromCode",value:function e(t){if(!t||t.indexOf("-")<0)return null;var r=t.split("-");if(r.length===2)return null;r.pop();if(r[r.length-1].toLowerCase()==="x")return null;return this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function e(t){if(!t||t.indexOf("-")<0)return t;var r=t.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function e(t){if(typeof t==="string"&&t.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"];var o=t.split("-");if(this.options.lowerCaseLng){o=o.map((function(e){return e.toLowerCase()}))}else if(o.length===2){o[0]=o[0].toLowerCase();o[1]=o[1].toUpperCase();if(r.indexOf(o[1].toLowerCase())>-1)o[1]=capitalize(o[1].toLowerCase())}else if(o.length===3){o[0]=o[0].toLowerCase();if(o[1].length===2)o[1]=o[1].toUpperCase();if(o[0]!=="sgn"&&o[2].length===2)o[2]=o[2].toUpperCase();if(r.indexOf(o[1].toLowerCase())>-1)o[1]=capitalize(o[1].toLowerCase());if(r.indexOf(o[2].toLowerCase())>-1)o[2]=capitalize(o[2].toLowerCase())}return o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function e(t){if(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs){t=this.getLanguagePartFromCode(t)}return!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function e(t){var r=this;if(!t)return null;var o;t.forEach((function(e){if(o)return;var t=r.formatLanguageCode(e);if(!r.options.supportedLngs||r.isSupportedCode(t))o=t}));if(!o&&this.options.supportedLngs){t.forEach((function(e){if(o)return;var t=r.getLanguagePartFromCode(e);if(r.isSupportedCode(t))return o=t;o=r.options.supportedLngs.find((function(e){if(e.indexOf(t)===0)return e}))}))}if(!o)o=this.getFallbackCodes(this.options.fallbackLng)[0];return o}},{key:"getFallbackCodes",value:function e(t,r){if(!t)return[];if(typeof t==="function")t=t(r);if(typeof t==="string")t=[t];if(Object.prototype.toString.apply(t)==="[object Array]")return t;if(!r)return t["default"]||[];var o=t[r];if(!o)o=t[this.getScriptPartFromCode(r)];if(!o)o=t[this.formatLanguageCode(r)];if(!o)o=t[this.getLanguagePartFromCode(r)];if(!o)o=t["default"];return o||[]}},{key:"toResolveHierarchy",value:function e(t,r){var o=this;var i=this.getFallbackCodes(r||this.options.fallbackLng||[],t);var n=[];var a=function e(t){if(!t)return;if(o.isSupportedCode(t)){n.push(t)}else{o.logger.warn("rejecting language code not found in supportedLngs: ".concat(t))}};if(typeof t==="string"&&t.indexOf("-")>-1){if(this.options.load!=="languageOnly")a(this.formatLanguageCode(t));if(this.options.load!=="languageOnly"&&this.options.load!=="currentOnly")a(this.getScriptPartFromCode(t));if(this.options.load!=="currentOnly")a(this.getLanguagePartFromCode(t))}else if(typeof t==="string"){a(this.formatLanguageCode(t))}i.forEach((function(e){if(n.indexOf(e)<0)a(o.formatLanguageCode(e))}));return n}}]);return e}();var sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}];var _rulesPluralsTypes={1:function e(t){return Number(t>1)},2:function e(t){return Number(t!=1)},3:function e(t){return 0},4:function e(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function e(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function e(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function e(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function e(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function e(t){return Number(t>=2)},10:function e(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function e(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function e(t){return Number(t%10!=1||t%100==11)},13:function e(t){return Number(t!==0)},14:function e(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function e(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function e(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function e(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function e(t){return Number(t==0?0:t==1?1:2)},19:function e(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function e(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function e(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function e(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}};var deprecatedJsonVersions=["v1","v2","v3"];var suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5};function createRules(){var e={};sets.forEach((function(t){t.lngs.forEach((function(r){e[r]={numbers:t.nr,plurals:_rulesPluralsTypes[t.fc]}}))}));return e}var PluralResolver=function(){function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,e);this.languageUtils=t;this.options=r;this.logger=baseLogger.create("pluralResolver");if((!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl==="undefined"||!Intl.PluralRules)){this.options.compatibilityJSON="v3";this.logger.error("Your environment seems not to be Inlt API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")}this.rules=createRules()}_createClass(e,[{key:"addRule",value:function e(t,r){this.rules[t]=r}},{key:"getRule",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this.shouldUseIntlApi()){try{return new Intl.PluralRules(t,{type:r.ordinal?"ordinal":"cardinal"})}catch(e){return}}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var o=this.getRule(t,r);if(this.shouldUseIntlApi()){return o&&o.resolvedOptions().pluralCategories.length>1}return o&&o.numbers.length>1}},{key:"getPluralFormsOfKey",value:function e(t,r){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return this.getSuffixes(t,o).map((function(e){return"".concat(r).concat(e)}))}},{key:"getSuffixes",value:function e(t){var r=this;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=this.getRule(t,o);if(!i){return[]}if(this.shouldUseIntlApi()){return i.resolvedOptions().pluralCategories.sort((function(e,t){return suffixesOrder[e]-suffixesOrder[t]})).map((function(e){return"".concat(r.options.prepend).concat(e)}))}return i.numbers.map((function(e){return r.getSuffix(t,e,o)}))}},{key:"getSuffix",value:function e(t,r){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var i=this.getRule(t,o);if(i){if(this.shouldUseIntlApi()){return"".concat(this.options.prepend).concat(i.select(r))}return this.getSuffixRetroCompatible(i,r)}this.logger.warn("no plural rule found for: ".concat(t));return""}},{key:"getSuffixRetroCompatible",value:function e(t,r){var o=this;var i=t.noAbs?t.plurals(r):t.plurals(Math.abs(r));var n=t.numbers[i];if(this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1){if(n===2){n="plural"}else if(n===1){n=""}}var a=function e(){return o.options.prepend&&n.toString()?o.options.prepend+n.toString():n.toString()};if(this.options.compatibilityJSON==="v1"){if(n===1)return"";if(typeof n==="number")return"_plural_".concat(n.toString());return a()}else if(this.options.compatibilityJSON==="v2"){return a()}else if(this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1){return a()}return this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}},{key:"shouldUseIntlApi",value:function e(){return!deprecatedJsonVersions.includes(this.options.compatibilityJSON)}}]);return e}();var Interpolator=function(){function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,e);this.logger=baseLogger.create("interpolator");this.options=t;this.format=t.interpolation&&t.interpolation.format||function(e){return e};this.init(t)}_createClass(e,[{key:"init",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(!t.interpolation)t.interpolation={escapeValue:true};var r=t.interpolation;this.escape=r.escape!==undefined?r.escape:escape;this.escapeValue=r.escapeValue!==undefined?r.escapeValue:true;this.useRawValueToEscape=r.useRawValueToEscape!==undefined?r.useRawValueToEscape:false;this.prefix=r.prefix?regexEscape(r.prefix):r.prefixEscaped||"{{";this.suffix=r.suffix?regexEscape(r.suffix):r.suffixEscaped||"}}";this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",";this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-";this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"";this.nestingPrefix=r.nestingPrefix?regexEscape(r.nestingPrefix):r.nestingPrefixEscaped||regexEscape("$t(");this.nestingSuffix=r.nestingSuffix?regexEscape(r.nestingSuffix):r.nestingSuffixEscaped||regexEscape(")");this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",";this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3;this.alwaysFormat=r.alwaysFormat!==undefined?r.alwaysFormat:false;this.resetRegExp()}},{key:"reset",value:function e(){if(this.options)this.init(this.options)}},{key:"resetRegExp",value:function e(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var o="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(o,"g")}},{key:"interpolate",value:function e(t,r,o,i){var n=this;var a;var s;var l;var c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var p=function e(t){if(t.indexOf(n.formatSeparator)<0){var a=getPathWithDefaults(r,c,t);return n.alwaysFormat?n.format(a,undefined,o,_objectSpread({},i,r,{interpolationkey:t})):a}var s=t.split(n.formatSeparator);var l=s.shift().trim();var u=s.join(n.formatSeparator).trim();return n.format(getPathWithDefaults(r,c,l),u,o,_objectSpread({},i,r,{interpolationkey:l}))};this.resetRegExp();var d=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler;var h=i&&i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;var f=[{regex:this.regexpUnescape,safeValue:function e(t){return u(t)}},{regex:this.regexp,safeValue:function e(t){return n.escapeValue?u(n.escape(t)):u(t)}}];f.forEach((function(e){l=0;while(a=e.regex.exec(t)){s=p(a[1].trim());if(s===undefined){if(typeof d==="function"){var r=d(t,a,i);s=typeof r==="string"?r:""}else if(h){s=a[0];continue}else{n.logger.warn("missed to pass in variable ".concat(a[1]," for interpolating ").concat(t));s=""}}else if(typeof s!=="string"&&!n.useRawValueToEscape){s=makeString(s)}var o=e.safeValue(s);t=t.replace(a[0],o);if(h){e.regex.lastIndex+=o.length;e.regex.lastIndex-=a[0].length}else{e.regex.lastIndex=0}l++;if(l>=n.maxReplaces){break}}}));return t}},{key:"nest",value:function e(t,r){var o=this;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n;var a;var s=_objectSpread({},i);s.applyPostProcessor=false;delete s.defaultValue;function l(e,t){var r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;var o=e.split(new RegExp("".concat(r,"[ ]*{")));var i="{".concat(o[1]);e=o[0];i=this.interpolate(i,s);i=i.replace(/'/g,'"');try{s=JSON.parse(i);if(t)s=_objectSpread({},t,s)}catch(t){this.logger.warn("failed parsing options string in nesting for key ".concat(e),t);return"".concat(e).concat(r).concat(i)}delete s.defaultValue;return e}while(n=this.nestingRegexp.exec(t)){var c=[];var u=false;if(n[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(n[1])){var p=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=p.shift();c=p;u=true}a=r(l.call(this,n[1].trim(),s),s);if(a&&n[0]===t&&typeof a!=="string")return a;if(typeof a!=="string")a=makeString(a);if(!a){this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(t));a=""}if(u){a=c.reduce((function(e,t){return o.format(e,t,i.lng,_objectSpread({},i,{interpolationkey:n[1].trim()}))}),a.trim())}t=t.replace(n[0],a);this.regexp.lastIndex=0}return t}}]);return e}();function remove(e,t){var r=e.indexOf(t);while(r!==-1){e.splice(r,1);r=e.indexOf(t)}}var Connector=function(e){_inherits(t,e);function t(e,r,o){var i;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};_classCallCheck(this,t);i=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this));if(isIE10){EventEmitter.call(_assertThisInitialized(i))}i.backend=e;i.store=r;i.services=o;i.languageUtils=o.languageUtils;i.options=n;i.logger=baseLogger.create("backendConnector");i.state={};i.queue=[];if(i.backend&&i.backend.init){i.backend.init(o,n.backend,n)}return i}_createClass(t,[{key:"queueLoad",value:function e(t,r,o,i){var n=this;var a=[];var s=[];var l=[];var c=[];t.forEach((function(e){var t=true;r.forEach((function(r){var i="".concat(e,"|").concat(r);if(!o.reload&&n.store.hasResourceBundle(e,r)){n.state[i]=2}else if(n.state[i]<0);else if(n.state[i]===1){if(s.indexOf(i)<0)s.push(i)}else{n.state[i]=1;t=false;if(s.indexOf(i)<0)s.push(i);if(a.indexOf(i)<0)a.push(i);if(c.indexOf(r)<0)c.push(r)}}));if(!t)l.push(e)}));if(a.length||s.length){this.queue.push({pending:s,loaded:{},errors:[],callback:i})}return{toLoad:a,pending:s,toLoadLanguages:l,toLoadNamespaces:c}}},{key:"loaded",value:function e(t,r,o){var i=t.split("|");var n=i[0];var a=i[1];if(r)this.emit("failedLoading",n,a,r);if(o){this.store.addResourceBundle(n,a,o)}this.state[t]=r?-1:2;var e={};this.queue.forEach((function(o){pushPath(o.loaded,[n],a);remove(o.pending,t);if(r)o.errors.push(r);if(o.pending.length===0&&!o.done){Object.keys(o.loaded).forEach((function(t){if(!e[t])e[t]=[];if(o.loaded[t].length){o.loaded[t].forEach((function(r){if(e[t].indexOf(r)<0)e[t].push(r)}))}}));o.done=true;if(o.errors.length){o.callback(o.errors)}else{o.callback()}}}));this.emit("loaded",e);this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function e(t,r,o){var i=this;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:350;var s=arguments.length>5?arguments[5]:undefined;if(!t.length)return s(null,{});return this.backend[o](t,r,(function(e,l){if(e&&l&&n<5){setTimeout((function(){i.read.call(i,t,r,o,n+1,a*2,s)}),a);return}s(e,l)}))}},{key:"prepareLoading",value:function e(t,r){var o=this;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n=arguments.length>3?arguments[3]:undefined;if(!this.backend){this.logger.warn("No backend was added via i18next.use. Will not load resources.");return n&&n()}if(typeof t==="string")t=this.languageUtils.toResolveHierarchy(t);if(typeof r==="string")r=[r];var a=this.queueLoad(t,r,i,n);if(!a.toLoad.length){if(!a.pending.length)n();return null}a.toLoad.forEach((function(e){o.loadOne(e)}))}},{key:"load",value:function e(t,r,o){this.prepareLoading(t,r,{},o)}},{key:"reload",value:function e(t,r,o){this.prepareLoading(t,r,{reload:true},o)}},{key:"loadOne",value:function e(t){var r=this;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";var i=t.split("|");var n=i[0];var a=i[1];this.read(n,a,"read",undefined,undefined,(function(e,i){if(e)r.logger.warn("".concat(o,"loading namespace ").concat(a," for language ").concat(n," failed"),e);if(!e&&i)r.logger.log("".concat(o,"loaded namespace ").concat(a," for language ").concat(n),i);r.loaded(t,e,i)}))}},{key:"saveMissing",value:function e(t,r,o,i,n){var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn('did not save key "'.concat(o,'" as the namespace "').concat(r,'" 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!!!");return}if(o===undefined||o===null||o==="")return;if(this.backend&&this.backend.create){this.backend.create(t,r,o,i,null,_objectSpread({},a,{isUpdate:n}))}if(!t||!t[0])return;this.store.addResource(t[0],r,o,i)}}]);return t}(EventEmitter);function get(){return{debug:false,initImmediate:true,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:false,supportedLngs:false,nonExplicitSupportedLngs:false,load:"all",preload:false,simplifyPluralSuffix:true,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:false,saveMissing:false,updateMissing:false,saveMissingTo:"fallback",saveMissingPlurals:true,missingKeyHandler:false,missingInterpolationHandler:false,postProcess:false,postProcessPassResolved:false,returnNull:true,returnEmptyString:true,returnObjects:false,joinArrays:false,returnedObjectHandler:false,parseMissingKeyHandler:false,appendNamespaceToMissingKey:false,appendNamespaceToCIMode:false,overloadTranslationOptionHandler:function e(t){var r={};if(_typeof$1(t[1])==="object")r=t[1];if(typeof t[1]==="string")r.defaultValue=t[1];if(typeof t[2]==="string")r.tDescription=t[2];if(_typeof$1(t[2])==="object"||_typeof$1(t[3])==="object"){var o=t[3]||t[2];Object.keys(o).forEach((function(e){r[e]=o[e]}))}return r},interpolation:{escapeValue:true,format:function e(t,r,o,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:true}}}function transformOptions(e){if(typeof e.ns==="string")e.ns=[e.ns];if(typeof e.fallbackLng==="string")e.fallbackLng=[e.fallbackLng];if(typeof e.fallbackNS==="string")e.fallbackNS=[e.fallbackNS];if(e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0){e.supportedLngs=e.supportedLngs.concat(["cimode"])}return e}function noop(){}var I18n=function(e){_inherits(t,e);function t(){var e;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var o=arguments.length>1?arguments[1]:undefined;_classCallCheck(this,t);e=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this));if(isIE10){EventEmitter.call(_assertThisInitialized(e))}e.options=transformOptions(r);e.services={};e.logger=baseLogger;e.modules={external:[]};if(o&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate){e.init(r,o);return _possibleConstructorReturn(e,_assertThisInitialized(e))}setTimeout((function(){e.init(r,o)}),0)}return e}_createClass(t,[{key:"init",value:function e(){var t=this;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var o=arguments.length>1?arguments[1]:undefined;if(typeof r==="function"){o=r;r={}}if(!r.defaultNS&&r.ns){if(typeof r.ns==="string"){r.defaultNS=r.ns}else if(r.ns.indexOf("translation")<0){r.defaultNS=r.ns[0]}}this.options=_objectSpread({},get(),this.options,transformOptions(r));if(r.keySeparator!==undefined){this.options.userDefinedKeySeparator=r.keySeparator}this.format=this.options.interpolation.format;if(!o)o=noop;function i(e){if(!e)return null;if(typeof e==="function")return new e;return e}if(!this.options.isClone){if(this.modules.logger){baseLogger.init(i(this.modules.logger),this.options)}else{baseLogger.init(null,this.options)}var n=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);var a=this.services;a.logger=baseLogger;a.resourceStore=this.store;a.languageUtils=n;a.pluralResolver=new PluralResolver(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix});a.interpolator=new Interpolator(this.options);a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)};a.backendConnector=new Connector(i(this.modules.backend),a.resourceStore,a,this.options);a.backendConnector.on("*",(function(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++){o[i-1]=arguments[i]}t.emit.apply(t,[e].concat(o))}));if(this.modules.languageDetector){a.languageDetector=i(this.modules.languageDetector);a.languageDetector.init(a,this.options.detection,this.options)}if(this.modules.i18nFormat){a.i18nFormat=i(this.modules.i18nFormat);if(a.i18nFormat.init)a.i18nFormat.init(this)}this.translator=new Translator(this.services,this.options);this.translator.on("*",(function(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++){o[i-1]=arguments[i]}t.emit.apply(t,[e].concat(o))}));this.modules.external.forEach((function(e){if(e.init)e.init(t)}))}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);if(s.length>0&&s[0]!=="dev")this.options.lng=s[0]}if(!this.services.languageDetector&&!this.options.lng){this.logger.warn("init: no languageDetector is used and no lng is defined")}var l=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];l.forEach((function(e){t[e]=function(){var r;return(r=t.store)[e].apply(r,arguments)}}));var c=["addResource","addResources","addResourceBundle","removeResourceBundle"];c.forEach((function(e){t[e]=function(){var r;(r=t.store)[e].apply(r,arguments);return t}}));var u=defer();var p=function e(){var r=function e(r,i){if(t.isInitialized&&!t.initializedStoreOnce)t.logger.warn("init: i18next is already initialized. You should call init just once!");t.isInitialized=true;if(!t.options.isClone)t.logger.log("initialized",t.options);t.emit("initialized",t.options);u.resolve(i);o(r,i)};if(t.languages&&t.options.compatibilityAPI!=="v1"&&!t.isInitialized)return r(null,t.t.bind(t));t.changeLanguage(t.options.lng,r)};if(this.options.resources||!this.options.initImmediate){p()}else{setTimeout(p,0)}return u}},{key:"loadResources",value:function e(t){var r=this;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:noop;var i=o;var n=typeof t==="string"?t:this.language;if(typeof t==="function")i=t;if(!this.options.resources||this.options.partialBundledLanguages){if(n&&n.toLowerCase()==="cimode")return i();var a=[];var s=function e(t){if(!t)return;var o=r.services.languageUtils.toResolveHierarchy(t);o.forEach((function(e){if(a.indexOf(e)<0)a.push(e)}))};if(!n){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.forEach((function(e){return s(e)}))}else{s(n)}if(this.options.preload){this.options.preload.forEach((function(e){return s(e)}))}this.services.backendConnector.load(a,this.options.ns,i)}else{i(null)}}},{key:"reloadResources",value:function e(t,r,o){var i=defer();if(!t)t=this.languages;if(!r)r=this.options.ns;if(!o)o=noop;this.services.backendConnector.reload(t,r,(function(e){i.resolve();o(e)}));return i}},{key:"use",value:function e(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()");if(t.type==="backend"){this.modules.backend=t}if(t.type==="logger"||t.log&&t.warn&&t.error){this.modules.logger=t}if(t.type==="languageDetector"){this.modules.languageDetector=t}if(t.type==="i18nFormat"){this.modules.i18nFormat=t}if(t.type==="postProcessor"){postProcessor.addPostProcessor(t)}if(t.type==="3rdParty"){this.modules.external.push(t)}return this}},{key:"changeLanguage",value:function e(t,r){var o=this;this.isLanguageChangingTo=t;var i=defer();this.emit("languageChanging",t);var n=function e(t){o.language=t;o.languages=o.services.languageUtils.toResolveHierarchy(t);o.resolvedLanguage=undefined;if(["cimode","dev"].indexOf(t)>-1)return;for(var r=0;r<o.languages.length;r++){var i=o.languages[r];if(["cimode","dev"].indexOf(i)>-1)continue;if(o.store.hasLanguageSomeTranslations(i)){o.resolvedLanguage=i;break}}};var a=function e(t,a){if(a){n(a);o.translator.changeLanguage(a);o.isLanguageChangingTo=undefined;o.emit("languageChanged",a);o.logger.log("languageChanged",a)}else{o.isLanguageChangingTo=undefined}i.resolve((function(){return o.t.apply(o,arguments)}));if(r)r(t,(function(){return o.t.apply(o,arguments)}))};var s=function e(r){if(!t&&!r&&o.services.languageDetector)r=[];var i=typeof r==="string"?r:o.services.languageUtils.getBestMatchFromCodes(r);if(i){if(!o.language){n(i)}if(!o.translator.language)o.translator.changeLanguage(i);if(o.services.languageDetector)o.services.languageDetector.cacheUserLanguage(i)}o.loadResources(i,(function(e){a(e,i)}))};if(!t&&this.services.languageDetector&&!this.services.languageDetector.async){s(this.services.languageDetector.detect())}else if(!t&&this.services.languageDetector&&this.services.languageDetector.async){this.services.languageDetector.detect(s)}else{s(t)}return i}},{key:"getFixedT",value:function e(t,r,o){var i=this;var n=function e(t,r){var n;if(_typeof$1(r)!=="object"){for(var a=arguments.length,s=new Array(a>2?a-2:0),l=2;l<a;l++){s[l-2]=arguments[l]}n=i.options.overloadTranslationOptionHandler([t,r].concat(s))}else{n=_objectSpread({},r)}n.lng=n.lng||e.lng;n.lngs=n.lngs||e.lngs;n.ns=n.ns||e.ns;var c=i.options.keySeparator||".";var u=o?"".concat(o).concat(c).concat(t):t;return i.t(u,n)};if(typeof t==="string"){n.lng=t}else{n.lngs=t}n.ns=r;n.keyPrefix=o;return n}},{key:"t",value:function e(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)}},{key:"exists",value:function e(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)}},{key:"setDefaultNamespace",value:function e(t){this.options.defaultNS=t}},{key:"hasLoadedNamespace",value:function e(t){var r=this;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!this.isInitialized){this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages);return false}if(!this.languages||!this.languages.length){this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages);return false}var i=this.resolvedLanguage||this.languages[0];var n=this.options?this.options.fallbackLng:false;var a=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return true;var s=function e(t,o){var i=r.services.backendConnector.state["".concat(t,"|").concat(o)];return i===-1||i===2};if(o.precheck){var l=o.precheck(this,s);if(l!==undefined)return l}if(this.hasResourceBundle(i,t))return true;if(!this.services.backendConnector.backend)return true;if(s(i,t)&&(!n||s(a,t)))return true;return false}},{key:"loadNamespaces",value:function e(t,r){var o=this;var i=defer();if(!this.options.ns){r&&r();return Promise.resolve()}if(typeof t==="string")t=[t];t.forEach((function(e){if(o.options.ns.indexOf(e)<0)o.options.ns.push(e)}));this.loadResources((function(e){i.resolve();if(r)r(e)}));return i}},{key:"loadLanguages",value:function e(t,r){var o=defer();if(typeof t==="string")t=[t];var i=this.options.preload||[];var n=t.filter((function(e){return i.indexOf(e)<0}));if(!n.length){if(r)r();return Promise.resolve()}this.options.preload=i.concat(n);this.loadResources((function(e){o.resolve();if(r)r(e)}));return o}},{key:"dir",value:function e(t){if(!t)t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language);if(!t)return"rtl";var r=["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"];return r.indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr"}},{key:"createInstance",value:function e(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var o=arguments.length>1?arguments[1]:undefined;return new t(r,o)}},{key:"cloneInstance",value:function e(){var r=this;var o=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:noop;var n=_objectSpread({},this.options,o,{isClone:true});var a=new t(n);var s=["store","services","language"];s.forEach((function(e){a[e]=r[e]}));a.services=_objectSpread({},this.services);a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)};a.translator=new Translator(a.services,a.options);a.translator.on("*",(function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++){r[o-1]=arguments[o]}a.emit.apply(a,[e].concat(r))}));a.init(n,i);a.translator.options=a.options;a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)};return a}},{key:"toJSON",value:function e(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]);return t}(EventEmitter);var i18next=new I18n;var login_page$1={get_started:"Drucken mit ezeep Blue",login:"Anmelden",description:"Melde dich mit deinem ezeep Blue-Konto an, um zu drucken."};var printer_selection$1={loading:"Lade Drucker…",print:"Drucken",printer:"Drucker",print_in_progress:"Drucke…",color:"Farbe",orientation:"Ausrichtung",size:"Papierformat",duplex:"Duplex",quality:"Qualität",select_printer:"Wähle einen Drucker",select_color:"Wähle eine Farbe",select_size:"Wähle ein Papierformat",select_orientation:"Wähle eine Ausrichtung",color_color:"Farbe",color_grayscale:"Graustufen",orientation_portrait:"Hochformat",orientation_landscape:"Querformat",unknown_location:"Unbekannter Standort"};var button_actions$1={login:"Anmelden",print:"Drucken",cancel:"Abbrechen"};var translationsDE={login_page:login_page$1,printer_selection:printer_selection$1,button_actions:button_actions$1};var login_page={get_started:"Print with ezeep Blue",login:"Sign in",description:"Sign in with your ezeep Blue account to print."};var printer_selection={loading:"Loading printers…",print_in_progress:"Printing…",print:"Print",printer:"Printer",color:"Color",orientation:"Orientation",size:"Paper format",duplex:"Duplex",quality:"Quality",select_printer:"Select a printer",select_color:"Select a color",select_orientation:"Select an orientation",select_size:"Select a paper size",color_color:"Color",color_grayscale:"Grayscale",orientation_portrait:"Portrait",orientation_landscape:"Landscape",unknown_location:"Unknown location"};var button_actions={login:"Sign In",print:"Print",cancel:"Cancel"};var translationsEN={login_page:login_page,printer_selection:printer_selection,button_actions:button_actions};function encodeFormData(e){return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}function initi18n(){var e={en:{translation:translationsEN},de:{translation:translationsDE}};i18next.init({resources:e,lng:navigator.language,nsSeparator:false,fallbackLng:"en"})}var poll=function(e){var t=e.fn,r=e.validate,o=e.interval,i=e.maxAttempts;return __awaiter(void 0,void 0,void 0,(function(){var e,n;return __generator(this,(function(a){e=0;n=function(a,s){return __awaiter(void 0,void 0,void 0,(function(){var l;return __generator(this,(function(c){switch(c.label){case 0:return[4,t()];case 1:l=c.sent();e++;if(r(l)){return[2,a(l)]}else if(i&&e===i){return[2,s(new Error("Exceeded max attempts."))]}else{setTimeout(n,o,a,s)}return[2]}}))}))};return[2,new Promise(n)]}))}))};var removeEmptyStrings=function(e){var t={};Object.keys(e).forEach((function(r){if(e[r]!==""){t[r]=e[r]}}));return t};var EzpAuthorizationService=function(){function e(e,t){this.urlParams=new URLSearchParams;this.isAuthorized=false;this.redirectURI=e;this.clientID=t;this.oauthUrl=authStore.state.authApiHostUrl;this.authURI=new URL("https://"+this.oauthUrl+"/oauth/authorize/");this.accessTokenURL="https://"+this.oauthUrl+"/oauth/access_token/"}e.prototype.generateCodeVerifier=function(){if(authStore.state.codeVerifier!==""){this.codeVerifier=authStore.state.codeVerifier}else{var e=new Uint8Array(128);var t=crypto.getRandomValues(e);var r=btoa(t.toString()).substr(0,128);this.codeVerifier=r;authStore.state.codeVerifier=this.codeVerifier}};e.prototype.generateCodeChallenge=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,o,i;return __generator(this,(function(n){switch(n.label){case 0:t=new TextEncoder;r=t.encode(e);return[4,crypto.subtle.digest("SHA-256",r)];case 1:o=n.sent();i=btoa(String.fromCharCode.apply(null,new Uint8Array(o)));this.codeChallenge=i.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return[2]}}))}))};e.prototype.buildAuthURI=function(){this.urlParams.append("response_type","code");this.urlParams.append("client_id",this.clientID);this.urlParams.append("redirect_uri",this.redirectURI);this.urlParams.append("code_challenge",this.codeChallenge);this.urlParams.append("code_challenge_method","S256");this.authURI.search=this.urlParams.toString()};e.prototype.getAccessToken=function(){var e=this;return fetch(this.accessTokenURL,{headers:{Authorization:"Basic "+btoa(this.clientID+":"),"Content-Type":"application/x-www-form-urlencoded"},method:"POST",body:encodeFormData({grant_type:"authorization_code",scope:"printing",code:this.code,redirect_uri:this.redirectURI,code_verifier:this.codeVerifier})}).then((function(e){return e.json()})).then((function(t){if(t.access_token){authStore.state.isAuthorized=true;e.isAuthorized=authStore.state.isAuthorized;localStorage.setItem("isAuthorized",e.isAuthorized.toString());e.accessToken=t.access_token;localStorage.setItem("access_token",e.accessToken);authStore.state.accessToken=e.accessToken;e.refreshToken=t.refresh_token;localStorage.setItem("refreshToken",e.refreshToken);authStore.state.refreshToken=e.refreshToken}}))};e.prototype.refreshTokens=function(){var e=this;fetch(this.accessTokenURL,{headers:{Authorization:"Basic "+btoa(this.clientID+":"),"Content-Type":"application/x-www-form-urlencoded"},method:"POST",body:encodeFormData({grant_type:"refresh_token",scope:"printing",refresh_token:authStore.state.refreshToken})}).then((function(e){return e.json()})).then((function(t){if(t.access_token){e.accessToken=t.access_token;localStorage.setItem("access_token",e.accessToken);authStore.state.accessToken=e.accessToken;e.refreshToken=t.refresh_token;localStorage.setItem("refreshToken",e.refreshToken);authStore.state.refreshToken=e.refreshToken;authStore.state.isAuthorized=true}}))};return e}();var authStore=createStore({codeVerifier:"",accessToken:"",refreshToken:"",isAuthorized:false,devApi:false,authApiHostUrl:"",redirectUri:""});function sendCodeToParentWindow(){var e=new URLSearchParams(window.location.search);var t=e.get("code");if(window.opener){window.opener.postMessage(t,authStore.state.redirectUri);window.close()}}var ezpAuthCss=":host{--color-theme-solid:var(--color-theme-cyan-solid);-ms-flex-line-pack:center;align-content:center;background:var(--color-overlay);display:grid;grid-template:auto/280px;height:100%;-ms-flex-pack:center;justify-content:center;left:0;position:fixed;top:0;width:100%}@media (prefers-color-scheme: dark){:host{--dialog-separator-position:inset 0 0 0 var(--hairline-width-positive)}}#dialog{background:var(--color-surface-tertiary);border-radius:6px;-webkit-box-shadow:var(--dialog-separator-position, 0 0 0 var(--hairline-width-positive)) var(--hairline-color), 0 var(--spacing-1) var(--spacing-2) 0 var(--color-shadow), 0 var(--spacing-2) var(--spacing-3) 0 var(--color-shadow), 0 var(--spacing-3) var(--spacing-4) 0 var(--color-shadow), 0 var(--spacing-4) var(--spacing-5) 0 var(--color-shadow), 0 var(--spacing-5) var(--spacing-6) 0 var(--color-shadow);box-shadow:var(--dialog-separator-position, 0 0 0 var(--hairline-width-positive)) var(--hairline-color), 0 var(--spacing-1) var(--spacing-2) 0 var(--color-shadow), 0 var(--spacing-2) var(--spacing-3) 0 var(--color-shadow), 0 var(--spacing-3) var(--spacing-4) 0 var(--color-shadow), 0 var(--spacing-4) var(--spacing-5) 0 var(--color-shadow), 0 var(--spacing-5) var(--spacing-6) 0 var(--color-shadow)}#header{display:grid;grid-template-columns:auto;-ms-flex-pack:end;justify-content:end;padding:var(--spacing-2)}#content{color:var(--color-foreground-primary);display:grid;grid-row-gap:var(--spacing-4);grid-template-rows:repeat(4, auto);-ms-flex-pack:center;justify-content:center;justify-items:center;padding:0 var(--spacing-4) var(--spacing-4);text-align:center}#icon{color:var(--color-theme-solid)}#button{min-width:144px}#logo{fill:var(--color-theme-solid)}";var EzpAuth=function(){function e(e){var t=this;registerInstance(this,e);this.authCancel=createEvent(this,"authCancel",7);this.printShow=createEvent(this,"printShow",7);this.windowObjectReference=null;this.previousUrl=null;this.handleCancel=function(){t.authCancel.emit()}}e.prototype.openSignInWindow=function(e,t){var r=this;window.removeEventListener("message",this.receiveMessage);var o="toolbar=no, menubar=no, width=600, height=7000, top=100, left=100";if(this.windowObjectReference===null||this.windowObjectReference.closed){this.windowObjectReference=window.open(e,t,o)}else if(this.previousUrl!==this.auth.authURI.toString()){this.windowObjectReference=window.open(e,t,o);this.windowObjectReference.focus()}else{this.windowObjectReference.focus()}if(this.hidelogin){var i=setInterval((function(){if(r.windowObjectReference.closed){r.handleCancel();clearInterval(i)}}),500)}window.addEventListener("message",(function(e){return r.receiveMessage(e)}),false);this.previousUrl=this.auth.authURI};e.prototype.receiveMessage=function(e){var t=this;this.auth.code=e.data;this.auth.getAccessToken().finally((function(){t.authCancel.emit();t.printShow.emit()}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:initi18n();this.auth=new EzpAuthorizationService(this.redirectURI,this.clientID);if(!(authStore.state.isAuthorized===false))return[3,2];this.auth.generateCodeVerifier();return[4,this.auth.generateCodeChallenge(authStore.state.codeVerifier)];case 1:e.sent();this.auth.buildAuthURI();e.label=2;case 2:if(this.hidelogin){this.openSignInWindow(this.auth.authURI.toString(),"ezeep Login")}return[2]}}))}))};e.prototype.render=function(){var e=this;return this.hidelogin?h("ezp-progress",{status:i18next.t("login_page.login")}):h(Host,null,h("div",{id:"dialog"},h("div",{id:"header"},h("ezp-icon-button",{onClick:this.handleCancel,icon:"close",level:"tertiary"})),h("div",{id:"content"},h("svg",{id:"logo",width:"90",height:"90",viewBox:"0 0 90 90",xmlns:"http://www.w3.org/2000/svg"},h("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M25.9211 72.1296L39.0613 43.8488L2.96326 7.63391L63.3276 47.3892L32.2619 24.5431L27.6516 11.4525L45.7004 29.5597L52.34 15.2706L89.3723 20.998L63.0241 20.7521L59.0129 29.385L52.4587 15.6081L63.7497 47.6674L25.7826 72.4275L20.8033 83.1445L16.7582 63.3739L30.0161 58.9423L25.9211 72.1296Z"})),h("ezp-label",{level:"primary",weight:"heavy",text:i18next.t("login_page.get_started")}),h("ezp-label",{text:i18next.t("login_page.description")}),h("ezp-text-button",{label:i18next.t("login_page.login"),id:"button",onClick:function(){e.openSignInWindow(e.auth.authURI.toString(),"ezeep Login")}}))))};return e}();EzpAuth.style=ezpAuthCss;var ezpBackdropCss=":host{-webkit-animation:var(--host-animation-name, host-in) var(--duration-3) forwards var(--easing-out-quart);animation:var(--host-animation-name, host-in) var(--duration-3) forwards var(--easing-out-quart);background:var(--color-overlay);border-radius:6px;display:block;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:4}:host(.hide){--host-animation-name:host-out}@-webkit-keyframes host-in{0%{opacity:0}100%{opacity:1}}@keyframes host-in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes host-out{0%{opacity:1}100%{opacity:0}}@keyframes host-out{0%{opacity:1}100%{opacity:0}}";var EzpBackdrop=function(){function e(e){registerInstance(this,e);this.backdropHideStart=createEvent(this,"backdropHideStart",7);this.backdropHideEnd=createEvent(this,"backdropHideEnd",7);this.visible=true}e.prototype.handleClick=function(){this.visible=false;this.backdropHideStart.emit()};e.prototype.listenAnimationEnd=function(){if(!this.visible){this.backdropHideEnd.emit()}};e.prototype.render=function(){var e=this;return h(Host,{class:{hide:!this.visible},onClick:function(){return e.handleClick()}})};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();EzpBackdrop.style=ezpBackdropCss;var ezpIconCss=":host{-ms-flex-line-pack:center;align-content:center;display:block;display:grid;grid-template:var(--host-gridTemplate)/var(--host-gridTemplate);height:var(--icon-height, var(--host-size));-ms-flex-pack:center;justify-content:center;width:var(--icon-width, var(--host-size))}:host(.normal){--host-size:18px;--host-gridTemplate:22px}:host(.large){--host-size:36px;--host-gridTemplate:44px}svg{display:block;fill:currentColor;height:100%;width:100%}";var EzpIcon=function(){function e(e){registerInstance(this,e);this.size="normal"}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){switch(t.label){case 0:return[4,fetch(getAssetPath("./assets/glyph-"+this.name+".svg")).then((function(e){return e.text()})).then((function(t){e.glyph=t})).catch((function(e){return console.log(e)}))];case 1:t.sent();return[2]}}))}))};e.prototype.render=function(){return h(Host,{class:this.size},h("div",{id:"glyph",innerHTML:this.glyph}))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}();EzpIcon.style=ezpIconCss;var ezpIconButtonCss=":host{display:block}:host(.primary){--button-background-disabled:var(--color-shade-primary);--button-background-init:var(--color-theme-solid);--button-color-disabled:var(--color-foreground-tertiary);--button-color-init:var(--color-on-theme);--button-opacity-active:0.74;--button-opacity-hover:0.84}:host(.secondary){--button-background-active:var(--color-shade-tertiary);--button-background-disabled:var(--color-shade-primary);--button-background-hover:var(--color-shade-secondary);--button-background-init:var(--color-shade-primary);--button-color-disabled:var(--color-foreground-tertiary);--button-color-init:var(--color-theme-solid)}:host(.tertiary){--button-background-active:var(--color-shade-secondary);--button-background-hover:var(--color-shade-primary);--button-background-init:transparent;--button-color-disabled:var(--color-foreground-tertiary);--button-color-init:var(--color-theme-solid)}:host(.quaternary){--button-background-init:transparent;--button-color-disabled:var(--color-foreground-tertiary);--button-color-init:var(--color-theme-solid);--button-opacity-active:0.58;--button-opacity-hover:0.74}#button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--button-background, var(--button-background-init));border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:var(--button-color, var(--button-color-init));cursor:var(--button-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--button-opacity, 1);outline:none;padding:var(--spacing-2)}@media (hover: hover){#button:not(:disabled):hover{--button-background:var(--button-background-hover, var(--button-background-init));--button-opacity:var(--button-opacity-hover, 1)}#button:not(:disabled):active{--button-background:var(--button-background-active, var(--button-background-init));--button-opacity:var(--button-opacity-active, 1)}}#button:disabled{--button-background:var(--button-background-disabled, var(--button-background-init));--button-color:var(--button-color-disabled);--button-cursor:not-allowed}";var EzpIconButton=function(){function e(e){registerInstance(this,e);this.blank=false;this.disabled=false;this.level="primary"}e.prototype.render=function(){var e=this.type!==undefined?"button":"a";var t=this.type!==undefined?{type:this.type,disabled:this.disabled}:{href:this.href,target:this.blank?"_blank":"_self"};return h(Host,{class:""+this.level},h(e,Object.assign({id:"button"},t),h("ezp-icon",{name:this.icon})))};return e}();EzpIconButton.style=ezpIconButtonCss;var ezpLabelCss=':host{display:block;min-width:var(--minWidth, auto);padding-bottom:1px;padding-top:1px}:host::before,:host::after{content:"";display:block;height:0}:host::before{margin-top:calc((var(--offset) + 1px) * -1)}:host::after{margin-bottom:calc((var(--offset) + 1px) * -1)}:host(.no-wrap){--whiteSpace:nowrap}:host(.ellipsis){--minWidth:0;--overflow:hidden;--textOverflow:ellipsis;--whiteSpace:nowrap;--width:100%}:host(.primary){--fontSize:17px;--lineHeight:24px;--letterSpacing:-0.0127756105em;--offset:6px}:host(.secondary){--fontSize:14px;--lineHeight:20px;--letterSpacing:-0.0062235443em;--offset:5px}:host(.tertiary){--fontSize:12px;--lineHeight:18px;--letterSpacing:0.0004907745em;--offset:5px}:host(.soft){--fontWeight:400}:host(.strong){--fontWeight:500}:host(.heavy){--fontWeight:600}#text{font-size:var(--fontSize);font-weight:var(--fontWeight);letter-spacing:var(--letterSpacing);line-height:var(--lineHeight);overflow:var(--overflow, visible);text-overflow:var(--textOverflow, clip);white-space:var(--whiteSpace, normal);width:var(--width, auto)}';var EzpLabel=function(){function e(e){registerInstance(this,e);this.ellipsis=false;this.level="secondary";this.noWrap=false;this.text="Label";this.weight="soft"}e.prototype.render=function(){return h(Host,{class:this.level+" "+this.weight+" "+(this.ellipsis?"ellipsis":"")+" "+(this.noWrap?"no-wrap":"")},h("div",{id:"text"},this.text))};return e}();EzpLabel.style=ezpLabelCss;var global=typeof globalThis!=="undefined"&&globalThis||typeof self!=="undefined"&&self||typeof global!=="undefined"&&global;var support={searchParams:"URLSearchParams"in global,iterable:"Symbol"in global&&"iterator"in Symbol,blob:"FileReader"in global&&"Blob"in global&&function(){try{new Blob;return true}catch(e){return false}}(),formData:"FormData"in global,arrayBuffer:"ArrayBuffer"in global};function isDataView(e){return e&&DataView.prototype.isPrototypeOf(e)}if(support.arrayBuffer){var viewClasses=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"];var isArrayBufferView=ArrayBuffer.isView||function(e){return e&&viewClasses.indexOf(Object.prototype.toString.call(e))>-1}}function normalizeName(e){if(typeof e!=="string"){e=String(e)}if(/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e===""){throw new TypeError('Invalid character in header field name: "'+e+'"')}return e.toLowerCase()}function normalizeValue(e){if(typeof e!=="string"){e=String(e)}return e}function iteratorFor(e){var t={next:function(){var t=e.shift();return{done:t===undefined,value:t}}};if(support.iterable){t[Symbol.iterator]=function(){return t}}return t}function Headers(e){this.map={};if(e instanceof Headers){e.forEach((function(e,t){this.append(t,e)}),this)}else if(Array.isArray(e)){e.forEach((function(e){this.append(e[0],e[1])}),this)}else if(e){Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}}Headers.prototype.append=function(e,t){e=normalizeName(e);t=normalizeValue(t);var r=this.map[e];this.map[e]=r?r+", "+t:t};Headers.prototype["delete"]=function(e){delete this.map[normalizeName(e)]};Headers.prototype.get=function(e){e=normalizeName(e);return this.has(e)?this.map[e]:null};Headers.prototype.has=function(e){return this.map.hasOwnProperty(normalizeName(e))};Headers.prototype.set=function(e,t){this.map[normalizeName(e)]=normalizeValue(t)};Headers.prototype.forEach=function(e,t){for(var r in this.map){if(this.map.hasOwnProperty(r)){e.call(t,this.map[r],r,this)}}};Headers.prototype.keys=function(){var e=[];this.forEach((function(t,r){e.push(r)}));return iteratorFor(e)};Headers.prototype.values=function(){var e=[];this.forEach((function(t){e.push(t)}));return iteratorFor(e)};Headers.prototype.entries=function(){var e=[];this.forEach((function(t,r){e.push([r,t])}));return iteratorFor(e)};if(support.iterable){Headers.prototype[Symbol.iterator]=Headers.prototype.entries}function consumed(e){if(e.bodyUsed){return Promise.reject(new TypeError("Already read"))}e.bodyUsed=true}function fileReaderReady(e){return new Promise((function(t,r){e.onload=function(){t(e.result)};e.onerror=function(){r(e.error)}}))}function readBlobAsArrayBuffer(e){var t=new FileReader;var r=fileReaderReady(t);t.readAsArrayBuffer(e);return r}function readBlobAsText(e){var t=new FileReader;var r=fileReaderReady(t);t.readAsText(e);return r}function readArrayBufferAsText(e){var t=new Uint8Array(e);var r=new Array(t.length);for(var o=0;o<t.length;o++){r[o]=String.fromCharCode(t[o])}return r.join("")}function bufferClone(e){if(e.slice){return e.slice(0)}else{var t=new Uint8Array(e.byteLength);t.set(new Uint8Array(e));return t.buffer}}function Body(){this.bodyUsed=false;this._initBody=function(e){this.bodyUsed=this.bodyUsed;this._bodyInit=e;if(!e){this._bodyText=""}else if(typeof e==="string"){this._bodyText=e}else if(support.blob&&Blob.prototype.isPrototypeOf(e)){this._bodyBlob=e}else if(support.formData&&FormData.prototype.isPrototypeOf(e)){this._bodyFormData=e}else if(support.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)){this._bodyText=e.toString()}else if(support.arrayBuffer&&support.blob&&isDataView(e)){this._bodyArrayBuffer=bufferClone(e.buffer);this._bodyInit=new Blob([this._bodyArrayBuffer])}else if(support.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||isArrayBufferView(e))){this._bodyArrayBuffer=bufferClone(e)}else{this._bodyText=e=Object.prototype.toString.call(e)}if(!this.headers.get("content-type")){if(typeof e==="string"){this.headers.set("content-type","text/plain;charset=UTF-8")}else if(this._bodyBlob&&this._bodyBlob.type){this.headers.set("content-type",this._bodyBlob.type)}else if(support.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)){this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8")}}};if(support.blob){this.blob=function(){var e=consumed(this);if(e){return e}if(this._bodyBlob){return Promise.resolve(this._bodyBlob)}else if(this._bodyArrayBuffer){return Promise.resolve(new Blob([this._bodyArrayBuffer]))}else if(this._bodyFormData){throw new Error("could not read FormData body as blob")}else{return Promise.resolve(new Blob([this._bodyText]))}};this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=consumed(this);if(e){return e}if(ArrayBuffer.isView(this._bodyArrayBuffer)){return Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength))}else{return Promise.resolve(this._bodyArrayBuffer)}}else{return this.blob().then(readBlobAsArrayBuffer)}}}this.text=function(){var e=consumed(this);if(e){return e}if(this._bodyBlob){return readBlobAsText(this._bodyBlob)}else if(this._bodyArrayBuffer){return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))}else if(this._bodyFormData){throw new Error("could not read FormData body as text")}else{return Promise.resolve(this._bodyText)}};if(support.formData){this.formData=function(){return this.text().then(decode)}}this.json=function(){return this.text().then(JSON.parse)};return this}var methods=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function normalizeMethod(e){var t=e.toUpperCase();return methods.indexOf(t)>-1?t:e}function Request$1(e,t){if(!(this instanceof Request$1)){throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')}t=t||{};var r=t.body;if(e instanceof Request$1){if(e.bodyUsed){throw new TypeError("Already read")}this.url=e.url;this.credentials=e.credentials;if(!t.headers){this.headers=new Headers(e.headers)}this.method=e.method;this.mode=e.mode;this.signal=e.signal;if(!r&&e._bodyInit!=null){r=e._bodyInit;e.bodyUsed=true}}else{this.url=String(e)}this.credentials=t.credentials||this.credentials||"same-origin";if(t.headers||!this.headers){this.headers=new Headers(t.headers)}this.method=normalizeMethod(t.method||this.method||"GET");this.mode=t.mode||this.mode||null;this.signal=t.signal||this.signal;this.referrer=null;if((this.method==="GET"||this.method==="HEAD")&&r){throw new TypeError("Body not allowed for GET or HEAD requests")}this._initBody(r);if(this.method==="GET"||this.method==="HEAD"){if(t.cache==="no-store"||t.cache==="no-cache"){var o=/([?&])_=[^&]*/;if(o.test(this.url)){this.url=this.url.replace(o,"$1_="+(new Date).getTime())}else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}}Request$1.prototype.clone=function(){return new Request$1(this,{body:this._bodyInit})};function decode(e){var t=new FormData;e.trim().split("&").forEach((function(e){if(e){var r=e.split("=");var o=r.shift().replace(/\+/g," ");var i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(o),decodeURIComponent(i))}}));return t}function parseHeaders(e){var t=new Headers;var r=e.replace(/\r?\n[\t ]+/g," ");r.split("\r").map((function(e){return e.indexOf("\n")===0?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":");var o=r.shift().trim();if(o){var i=r.join(":").trim();t.append(o,i)}}));return t}Body.call(Request$1.prototype);function Response(e,t){if(!(this instanceof Response)){throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')}if(!t){t={}}this.type="default";this.status=t.status===undefined?200:t.status;this.ok=this.status>=200&&this.status<300;this.statusText=t.statusText===undefined?"":""+t.statusText;this.headers=new Headers(t.headers);this.url=t.url||"";this._initBody(e)}Body.call(Response.prototype);Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers(this.headers),url:this.url})};Response.error=function(){var e=new Response(null,{status:0,statusText:""});e.type="error";return e};var redirectStatuses=[301,302,303,307,308];Response.redirect=function(e,t){if(redirectStatuses.indexOf(t)===-1){throw new RangeError("Invalid status code")}return new Response(null,{status:t,headers:{location:e}})};var DOMException=global.DOMException;try{new DOMException}catch(e){DOMException=function(e,t){this.message=e;this.name=t;var r=Error(e);this.stack=r.stack};DOMException.prototype=Object.create(Error.prototype);DOMException.prototype.constructor=DOMException}function fetch$1(e,t){return new Promise((function(r,o){var i=new Request$1(e,t);if(i.signal&&i.signal.aborted){return o(new DOMException("Aborted","AbortError"))}var n=new XMLHttpRequest;function a(){n.abort()}n.onload=function(){var e={status:n.status,statusText:n.statusText,headers:parseHeaders(n.getAllResponseHeaders()||"")};e.url="responseURL"in n?n.responseURL:e.headers.get("X-Request-URL");var t="response"in n?n.response:n.responseText;setTimeout((function(){r(new Response(t,e))}),0)};n.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)};n.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)};n.onabort=function(){setTimeout((function(){o(new DOMException("Aborted","AbortError"))}),0)};function s(e){try{return e===""&&global.location.href?global.location.href:e}catch(t){return e}}n.open(i.method,s(i.url),true);if(i.credentials==="include"){n.withCredentials=true}else if(i.credentials==="omit"){n.withCredentials=false}if("responseType"in n){if(support.blob){n.responseType="blob"}else if(support.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1){n.responseType="arraybuffer"}}if(t&&typeof t.headers==="object"&&!(t.headers instanceof Headers)){Object.getOwnPropertyNames(t.headers).forEach((function(e){n.setRequestHeader(e,normalizeValue(t.headers[e]))}))}else{i.headers.forEach((function(e,t){n.setRequestHeader(t,e)}))}if(i.signal){i.signal.addEventListener("abort",a);n.onreadystatechange=function(){if(n.readyState===4){i.signal.removeEventListener("abort",a)}}}n.send(typeof i._bodyInit==="undefined"?null:i._bodyInit)}))}fetch$1.polyfill=true;if(!global.fetch){global.fetch=fetch$1;global.Headers=Headers;global.Request=Request$1;global.Response=Response}var fetch$2=Object.freeze({__proto__:null,Headers:Headers,Request:Request$1,Response:Response,get DOMException(){return DOMException},fetch:fetch$1});var require$$0=getAugmentedNamespace(fetch$2);var browser=function(e){var t={};function r(o){if(t[o])return t[o].exports;var i=t[o]={exports:{},id:o,loaded:false};e[o].call(i.exports,i,i.exports,r);i.loaded=true;return i.exports}r.m=e;r.c=t;r.p="";return r(0)}([function(e,t,r){var o=r(1);var i=typeof importScripts==="function";e.exports=o(i?self:window)},function(e,t,r){function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return Array.from(e)}}var i=[];function n(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}var a=i.reduce((function(e,t){return[t].concat(e)}),[]);var s=Promise.resolve(r);a.forEach((function(e){var t=e.request,r=e.requestError;if(t||r){s=s.then((function(e){return t.apply(undefined,o(e))}),r)}}));s=s.then((function(t){var r=new(Function.prototype.bind.apply(Request,[null].concat(o(t))));return e(r).then((function(e){e.request=r;return e})).catch((function(e){e.request=r;return Promise.reject(e)}))}));a.forEach((function(e){var t=e.response,r=e.responseError;if(t||r){s=s.then(t,r)}}));return s}e.exports=function e(t){if(!t.fetch){try{r(2)}catch(e){throw Error("No fetch available. Unable to register fetch-intercept")}}t.fetch=function(e){return function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++){r[o]=arguments[o]}return n.apply(undefined,[e].concat(r))}}(t.fetch);return{register:function e(t){i.push(t);return function(){var e=i.indexOf(t);if(e>=0){i.splice(e,1)}}},clear:function e(){i=[]}}}},function(e,t){e.exports=require$$0}]);var EzpPrintService=function(){function e(e,t){var r=this;this.getPrintStatus=function(){return fetch("https://"+r.printingApi+"/sfapi/Status/?id="+encodeURIComponent(printStore.state.jobID),{headers:{Authorization:"Bearer "+authStore.state.accessToken}}).then((function(e){return e.json()}))};this.redirectURI=e;this.clientID=t;this.printingApi=printStore.state.printApiHostUrl;this.checkStoredRefreshToken();this.registerFetchInterceptor()}e.prototype.checkStoredRefreshToken=function(){if(authStore.state.refreshToken!==""){return}if(localStorage.getItem("refreshToken")===null){authStore.state.refreshToken=""}else{authStore.state.refreshToken=localStorage.getItem("refreshToken")}};e.prototype.registerFetchInterceptor=function(){var e=this;browser.register({request:function(e,t){return[e,t]},requestError:function(e){return Promise.reject(e)},response:function(t){if(t.status===401){if(authStore.state.refreshToken===""){return t}var r=new EzpAuthorizationService(e.redirectURI,e.clientID);r.refreshTokens()}return t},responseError:function(e){return Promise.reject(e)}})};e.prototype.getPrinterList=function(e){return fetch("https://"+this.printingApi+"/sfapi/GetPrinter/",{method:"GET",headers:{Authorization:"Bearer "+e}}).then((function(e){return e.json()}))};e.prototype.getConfig=function(e){return fetch("https://"+this.printingApi+"/sfapi/GetConfiguration/",{method:"GET",headers:{Authorization:"Bearer "+e}}).then((function(e){if(e.ok){authStore.state.isAuthorized=true}if(!e.ok){throw new Error("http status "+e.status)}return e.json()}))};e.prototype.getPrinterProperties=function(e,t){return fetch("https://"+this.printingApi+"/sfapi/GetPrinterProperties/?id="+t,{method:"GET",headers:{Authorization:"Bearer "+e}}).then((function(e){return e.json()}))};e.prototype.getAllPrinterProperties=function(e){return fetch("https://"+this.printingApi+"/sfapi/GetPrinterProperties/",{method:"GET",headers:{Authorization:"Bearer "+e}}).then((function(e){return e.json()}))};e.prototype.printFileByUrl=function(e,t,r,o,i,n,a){return fetch("https://"+this.printingApi+"/sfapi/Print/",{method:"POST",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"},body:JSON.stringify(Object.assign(Object.assign(Object.assign({fileurl:t,type:r,printerid:o},n&&{alias:n}),a&&{printanddelete:a}),{properties:i}))})};e.prototype.printByFileID=function(e,t,r,o,i,n,a){return fetch("https://"+this.printingApi+"/sfapi/Print/",{method:"POST",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"},body:JSON.stringify(Object.assign(Object.assign(Object.assign({fileid:t,type:r,printerid:o},n&&{alias:n}),a&&{printanddelete:a}),{properties:i}))})};return e}();var printStore=createStore({printers:[],jobID:"",printFinished:false,printApiHostUrl:"",printerProperties:{},fileID:"",fileUrl:"",fileType:"",printerID:"",fileName:""});var EzpUserService=function(){function e(){}e.prototype.getUserInfo=function(){return fetch("https://"+authStore.state.authApiHostUrl+"/v1/users/me",{headers:{Authorization:"Bearer "+authStore.state.accessToken,"Content-Type":"application/json"},method:"GET"}).then((function(e){return e.json()}))};return e}();var userStore=createStore({user:null,theme:"",appearance:""});var colors=[{id:1,name:"Grayscale"},{id:2,name:"Color"}];var orientations=[{id:1,name:"Portrait"},{id:2,name:"Landscape"}];var sizes=[{id:1,name:"Auto",description:"Document size"},{id:2,name:"Letter",description:"8.5 x 11 in"},{id:3,name:"Ledger",description:"11 x 17 in"},{id:4,name:"Legal",description:"8.5 x 14 in"},{id:5,name:"Executive",description:"7.25 x 10.5 in"},{id:6,name:"A3",description:"11.7 x 16.5 in"},{id:7,name:"A4",description:"8.3 x 11.7 in"},{id:8,name:"A5",description:"5.8 x 8.3 in"},{id:9,name:"Folio",description:"8.5 x 13 in"},{id:10,name:"Com-10",description:"4.125 x 9.5 in"}];var options={colors:colors,orientations:orientations,sizes:sizes};var ezpPrinterSelectionCss=":host{-ms-flex-line-pack:center;align-content:center;background:var(--color-overlay);display:grid;grid-template:auto/320px;height:100vh;-ms-flex-pack:center;justify-content:center;left:0;position:fixed;top:0;width:100vw}@media (prefers-color-scheme: dark){:host{--content-boxShadow:inset var(--hairline-width-positive) 0 0 0 var(--hairline-color),\n inset var(--hairline-width-negative) 0 0 0 var(--hairline-color);--container-separator-position:inset 0 0 0 var(--hairline-width-positive);--footer-separator-position:inset 0 var(--hairline-width-positive) 0 0;--header-separator-position:inset 0 var(--hairline-width-negative) 0 0}}#container{background:var(--color-surface-tertiary);border-radius:6px;position:relative}#header{-webkit-box-shadow:inset 0 var(--hairline-width-negative) 0 0 var(--hairline-color);box-shadow:inset 0 var(--hairline-width-negative) 0 0 var(--hairline-color);color:var(--color-foreground-primary);display:grid;grid-column-gap:var(--spacing-1);grid-template-columns:auto 1fr auto;padding:var(--spacing-4) var(--spacing-3) var(--spacing-4) var(--spacing-4);position:relative;z-index:3}#toggle-menu{margin:calc(var(--spacing-3) * -1) 0;position:relative;z-index:2}#content{background:var(--color-surface-secondary);-webkit-box-shadow:var(--content-boxShadow, none);box-shadow:var(--content-boxShadow, none);display:grid;grid-row-gap:var(--spacing-2);grid-template-rows:repeat(2, auto);padding:var(--spacing-2)}#footer{-webkit-box-shadow:inset 0 var(--hairline-width-positive) 0 0 var(--hairline-color);box-shadow:inset 0 var(--hairline-width-positive) 0 0 var(--hairline-color);display:grid;grid-column-gap:var(--spacing-2);grid-template-columns:repeat(2, 1fr);padding:var(--spacing-2);position:relative;z-index:3}";var EzpPrinterSelection=function(){function e(e){var t=this;registerInstance(this,e);this.printCancel=createEvent(this,"printCancel",7);this.printSubmit=createEvent(this,"printSubmit",7);this.duplexOptions=[{id:1,title:"None"},{id:2,title:"Long edge binding"},{id:3,title:"Short edge binding"}];this.loading=true;this.options=options;this.printInProgress=false;this.userMenuOpen=false;this.selectedPrinter={id:"",location:"",name:""};this.selectedProperties={paper:"",paperid:"",color:false,duplex:false,duplexmode:"",orientation:"",copies:"",resolution:""};this.previouslySelectedProperties={paper:"",paperid:"",color:false,duplex:false,duplexmode:"",orientation:"",copies:"",resolution:""};this.handleCancel=function(){t.printCancel.emit()};this.handlePrint=function(){var e=function(e){if(e.jobstatus===0){t.printInProgress=false;return true}return false};var r=2e3;t.printInProgress=true;removeEmptyStrings(t.selectedProperties);printStore.state.fileUrl=t.fileurl;printStore.state.fileID=t.fileid;printStore.state.fileType=t.filetype;printStore.state.printerID=t.selectedPrinter.id;printStore.state.printerProperties=t.selectedProperties;printStore.state.fileName=t.filename;if(t.fileurl){t.printService.printFileByUrl(authStore.state.accessToken,t.fileurl,t.filetype,t.selectedPrinter.id,t.selectedProperties,t.filename).then((function(e){if(e.status===412){e.json().then((function(e){return t.fileid=e.fileid}));t.printService.printByFileID(authStore.state.accessToken,t.fileid,t.filetype,t.selectedPrinter.id,t.selectedProperties,t.filename).finally((function(){return t.printInProgress=false}))}else{return e.json()}})).then((function(o){if(o.jobid){printStore.state.jobID=o.jobid;poll({fn:t.printService.getPrintStatus,validate:e,interval:r,maxAttempts:10}).then(o).catch((function(e){console.warn(e);t.printInProgress=false}))}else{t.printInProgress=false}})).catch((function(e){console.log(e);t.printInProgress=false}))}else if(t.fileid){t.printService.printByFileID(authStore.state.accessToken,t.fileid,t.filetype,t.selectedPrinter.id,t.selectedProperties,t.filename).then((function(e){return e.json()})).then((function(o){if(o.jobid){printStore.state.jobID=o.jobid;poll({fn:t.printService.getPrintStatus,validate:e,interval:r,maxAttempts:10}).then(o).catch((function(e){console.warn(e);t.printInProgress=false}))}else{t.printInProgress=false}})).catch((function(e){console.log(e);t.printInProgress=false}))}localStorage.setItem("properties",JSON.stringify(t.selectedProperties));localStorage.setItem("printer",JSON.stringify(t.selectedPrinter));localStorage.setItem("previouslySelectedProperties",JSON.stringify(t.previouslySelectedProperties))};this.handleUserMenu=function(){t.userMenuOpen=true}}e.prototype.listenSelectSelection=function(e){this.setSelectedProperties(e.detail)};e.prototype.listenStepperChanged=function(e){this.selectedProperties.copies=e.detail};e.prototype.listenUserMenuClosure=function(){this.userMenuOpen=false};e.prototype.listenLogout=function(){this.printCancel.emit()};e.prototype.getPropertiesFromLocalStorage=function(){if(localStorage.getItem("properties")){this.selectedProperties=JSON.parse(localStorage.getItem("properties"))}if(localStorage.getItem("printer")){this.selectedPrinter=JSON.parse(localStorage.getItem("printer"))}else{this.selectedPrinter={id:"",location:"",name:""}}if(localStorage.getItem("previouslySelectedProperties")){this.previouslySelectedProperties=JSON.parse(localStorage.getItem("previouslySelectedProperties"))}};e.prototype.getUserInfo=function(){var e=this;var t=new EzpUserService;return t.getUserInfo().then((function(t){userStore.state.user=t;e.userName=userStore.state.user.display_name}))};e.prototype.setSelectedProperties=function(e){return __awaiter(this,void 0,void 0,(function(){var t;var r=this;return __generator(this,(function(o){switch(o.label){case 0:t=e.type;switch(t){case"printer":return[3,1];case"color":return[3,3];case"orientation":return[3,4];case"format":return[3,5];case"quality":return[3,6];case"duplex":return[3,7]}return[3,8];case 1:this.selectedPrinter.id=e.id;this.selectedPrinter.name=e.title;return[4,this.printService.getPrinterProperties(authStore.state.accessToken,this.selectedPrinter.id).then((function(e){return r.selectedPrinterConfig=e[0]}))];case 2:o.sent();console.log("selected printer config:");console.log(this.selectedPrinterConfig);return[3,8];case 3:this.selectedProperties.color=!!e.id;this.previouslySelectedProperties.color=e.title;return[3,8];case 4:this.selectedProperties.orientation=e.id;this.previouslySelectedProperties.orientation=e.title;return[3,8];case 5:this.selectedProperties.paper=e.title;this.selectedProperties.paperid=e.id;this.previouslySelectedProperties.paper=e.title;this.previouslySelectedProperties.paperid=e.id;return[3,8];case 6:this.selectedProperties.resolution=e.title;this.previouslySelectedProperties.resolution=e.title;return[3,8];case 7:if(e.title==="None"){this.selectedProperties.duplex=false}else{this.selectedProperties.duplex=true}this.selectedProperties.duplexmode=e.id;this.previouslySelectedProperties.duplexmode=e.id;return[3,8];case 8:return[2]}}))}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){switch(t.label){case 0:initi18n();this.loading=true;this.getPropertiesFromLocalStorage();this.getUserInfo();this.printService=new EzpPrintService(this.redirectURI,this.clientID);return[4,this.printService.getPrinterList(authStore.state.accessToken).then((function(t){e.printers=t}))];case 1:t.sent();return[4,this.printService.getAllPrinterProperties(authStore.state.accessToken).then((function(t){e.printerConfig=t;console.log(e.printerConfig)}))];case 2:t.sent();this.loading=false;return[2]}}))}))};e.prototype.render=function(){return this.loading?h("ezp-progress",{status:i18next.t("printer_selection.loading")}):h(Host,{exportparts:"test: hello"},this.printInProgress?h("ezp-progress",{status:i18next.t("printer_selection.print_in_progress")}):null,h("div",{id:"container","data-backdrop-surface":true},h("div",{id:"header"},h("ezp-label",{weight:"heavy",text:i18next.t("printer_selection.print")+":"}),h("ezp-label",{text:this.filename}),h("ezp-icon-button",{level:"tertiary",icon:"menu",id:"toggle-menu",type:"button",onClick:this.handleUserMenu})),h("div",{id:"content"},h("div",{id:"printer"},h("ezp-select",{label:i18next.t("printer_selection.printer"),icon:"printer",placeholder:i18next.t("printer_selection.select_printer"),toggleFlow:"vertical",optionFlow:"vertical",options:this.printers.map((function(e){return{id:e.id,title:e.name,meta:e.location!==""?e.location:i18next.t("printer_selection.unknown_location"),type:"printer"}})),preSelected:this.selectedPrinter.name})),h("div",{id:"options"},h("ezp-select",{label:i18next.t("printer_selection.color"),icon:"color",placeholder:i18next.t("printer_selection.select_color"),toggleFlow:"horizontal",options:this.selectedPrinterConfig.Color?[{id:1,title:i18next.t("printer_selection.color_color"),meta:"",type:"color"},{id:0,title:i18next.t("printer_selection.color_grayscale"),meta:"",type:"color"}]:[{id:0,title:i18next.t("printer_selection.color_grayscale"),meta:"",type:"color"}],preSelected:this.previouslySelectedProperties.color}),h("ezp-select",{label:i18next.t("printer_selection.orientation"),icon:"orientation",placeholder:i18next.t("printer_selection.select_orientation"),toggleFlow:"horizontal",options:this.selectedPrinterConfig.OrientationsSupported.map((function(e,t){return{id:t,title:i18next.t("printer_selection.orientation_"+e),meta:"",type:"orientation"}})),preSelected:this.previouslySelectedProperties.orientation}),h("ezp-select",{label:i18next.t("printer_selection.size"),icon:"size",placeholder:i18next.t("printer_selection.select_size"),toggleFlow:"horizontal",optionFlow:"horizontal",options:this.selectedPrinterConfig.PaperFormats.map((function(e){return{id:e.Id,title:e.Name,meta:e.XRes+" x "+e.YRes,type:"format"}})),preSelected:this.previouslySelectedProperties.paper}),h("ezp-select",{label:i18next.t("printer_selection.quality"),icon:"quality",toggleFlow:"horizontal",options:this.selectedPrinterConfig.Resolutions.map((function(e,t){return{id:t,title:e,meta:"",type:"quality"}})),preSelected:!this.previouslySelectedProperties.resolution?this.selectedPrinterConfig.Resolutions[0]:this.previouslySelectedProperties.resolution}),this.selectedPrinterConfig.DuplexSupported?h("ezp-select",{label:i18next.t("printer_selection.duplex"),icon:"duplex",toggleFlow:"horizontal",options:this.duplexOptions.map((function(e){return{id:e.id,title:e.title,meta:"",type:"duplex"}})),preSelected:!this.previouslySelectedProperties.duplex?"None":this.previouslySelectedProperties.duplexmode}):null),h("ezp-stepper",{label:"Copies",max:10,icon:"copies"})),h("div",{id:"footer"},h("ezp-text-button",{type:"button",level:"secondary",onClick:this.handleCancel,label:i18next.t("button_actions.cancel")}),h("ezp-text-button",{type:"button",onClick:this.handlePrint,label:i18next.t("button_actions.print")})),h("ezp-user-menu",{open:this.userMenuOpen,name:this.userName})))};return e}();EzpPrinterSelection.style=ezpPrinterSelectionCss;var authApiHostUrl="account.ezeep.com";var printingApiHostUrl="printapi.ezeep.com";var config={authApiHostUrl:authApiHostUrl,printingApiHostUrl:printingApiHostUrl};var ezpPrintingCss=':host{-ms-flex-line-pack:center;align-content:center;background:var(--color-surface-primary);color:var(--color-foreground-primary);display:grid;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;grid-template:auto/auto;-ms-flex-pack:center;justify-content:center;margin:0;min-height:100vh;-webkit-tap-highlight-color:transparent;text-rendering:optimizeLegibility;-webkit-text-size-adjust:none;--duration-1:0.1s;--duration-2:0.16s;--duration-3:0.26s;--duration-4:0.42s;--duration-5:0.68s;--duration-6:1s;--spacing-1:4px;--spacing-2:6px;--spacing-3:10px;--spacing-4:16px;--spacing-5:26px;--spacing-6:42px;--spacing-7:68px;--spacing-8:110px;--easing-in-quart:cubic-bezier(0.11, 0, 0.5, 0);--easing-in-out-quart:cubic-bezier(0.76, 0, 0.24, 1);--easing-in-out-cubic:cubic-bezier(0.65, 0, 0.35, 1);--easing-in-expo:cubic-bezier(0.7, 0, 0.84, 0);--easing-out-quart:cubic-bezier(0.25, 1, 0.5, 1);--easing-out-expo:cubic-bezier(0.16, 1, 0.3, 1);--hairline-color:var(--color-outline-primary);--color-theme-pink-solid-light:#f23267;--color-theme-red-solid-light:#f23b22;--color-theme-orange-solid-light:#fe7200;--color-theme-green-solid-light:#5d9200;--color-theme-cyan-solid-light:#0091b4;--color-theme-blue-solid-light:#4e81f3;--color-theme-violet-solid-light:#ae5ef3;--color-theme-pink-translucent-light:rgba(242, 50, 103, 0.16);--color-theme-red-translucent-light:rgba(242, 59, 34, 0.16);--color-theme-orange-translucent-light:rgba(254, 114, 0, 0.16);--color-theme-green-translucent-light:rgba(93, 146, 0, 0.16);--color-theme-cyan-translucent-light:rgba(0, 145, 180, 0.16);--color-theme-blue-translucent-light:rgba(78, 129, 243, 0.16);--color-theme-violet-translucent-light:rgba(174, 94, 243, 0.16);--color-on-theme-light:white;--color-surface-primary-light:white;--color-surface-secondary-light:#f3f3f3;--color-surface-tertiary-light:white;--color-shade-primary-light:rgba(119, 119, 119, 0.1);--color-shade-secondary-light:rgba(119, 119, 119, 0.16);--color-shade-tertiary-light:rgba(119, 119, 119, 0.22);--color-foreground-primary-light:rgba(0, 0, 0, 0.94);--color-foreground-secondary-light:rgba(99, 99, 99, 0.9);--color-foreground-tertiary-light:rgba(99, 99, 99, 0.58);--color-outline-primary-light:#e2e2e2;--color-outline-secondary-light:#d1d1d1;--color-overlay-light:rgba(0, 0, 0, 0.26);--color-shadow-light:rgba(0, 0, 0, 0.06);--color-theme-pink-solid-dark:#ff4171;--color-theme-red-solid-dark:#ff482c;--color-theme-orange-solid-dark:#ff811c;--color-theme-green-solid-dark:#679c15;--color-theme-cyan-solid-dark:#209bbf;--color-theme-blue-solid-dark:#5b8bff;--color-theme-violet-solid-dark:#ba69ff;--color-theme-pink-translucent-dark:rgba(255, 65, 113, 0.26);--color-theme-red-translucent-dark:rgba(255, 72, 44, 0.26);--color-theme-orange-translucent-dark:rgba(255, 129, 28, 0.26);--color-theme-green-translucent-dark:rgba(103, 156, 21, 0.26);--color-theme-cyan-translucent-dark:rgba(32, 155, 191, 0.26);--color-theme-blue-translucent-dark:rgba(91, 139, 255, 0.26);--color-theme-violet-translucent-dark:rgba(186, 105, 255, 0.26);--color-on-theme-dark:black;--color-surface-primary-dark:black;--color-surface-secondary-dark:#1b1b1b;--color-surface-tertiary-dark:#282828;--color-shade-primary-dark:rgba(119, 119, 119, 0.28);--color-shade-secondary-dark:rgba(119, 119, 119, 0.34);--color-shade-tertiary-dark:rgba(119, 119, 119, 0.4);--color-foreground-primary-dark:rgba(255, 255, 255, 0.94);--color-foreground-secondary-dark:rgba(139, 139, 139, 0.9);--color-foreground-tertiary-dark:rgba(139, 139, 139, 0.58);--color-outline-primary-dark:#3e3e3e;--color-outline-secondary-dark:#4b4b4b;--color-overlay-dark:rgba(0, 0, 0, 0.68);--color-shadow-dark:rgba(0, 0, 0, 0.1)}@media (-webkit-min-device-pixel-ratio: 1), (min-device-pixel-ratio: 1){:host{--hairline-width-positive:calc(1px / 1);--hairline-width-negative:calc(-1px / 1)}}@media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2){:host{--hairline-width-positive:calc(1px / 2);--hairline-width-negative:calc(-1px / 2)}}@media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3){:host{--hairline-width-positive:calc(1px / 3);--hairline-width-negative:calc(-1px / 3)}}@media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2){:host{--hairline-color:var(--color-outline-secondary)}}@supports (color: color(display-p3 1 1 1)){:host{--color-theme-pink-solid-light:color(display-p3 0.9490196078 0.1960784314 0.4039215686/100%);--color-theme-red-solid-light:color(display-p3 0.9490196078 0.231372549 0.1333333333/100%);--color-theme-orange-solid-light:color(display-p3 0.9960784314 0.4470588235 0/100%);--color-theme-green-solid-light:color(display-p3 0.3647058824 0.5725490196 0/100%);--color-theme-cyan-solid-light:color(display-p3 0 0.568627451 0.7058823529/100%);--color-theme-blue-solid-light:color(display-p3 0.3058823529 0.5058823529 0.9529411765/100%);--color-theme-violet-solid-light:color(display-p3 0.6823529412 0.368627451 0.9529411765/100%);--color-theme-pink-translucent-light:color(display-p3 0.9490196078 0.1960784314 0.4039215686/16%);--color-theme-red-translucent-light:color(display-p3 0.9490196078 0.231372549 0.1333333333/16%);--color-theme-orange-translucent-light:color(display-p3 0.9960784314 0.4470588235 0/16%);--color-theme-green-translucent-light:color(display-p3 0.3647058824 0.5725490196 0/16%);--color-theme-cyan-translucent-light:color(display-p3 0 0.568627451 0.7058823529/16%);--color-theme-blue-translucent-light:color(display-p3 0.3058823529 0.5058823529 0.9529411765/16%);--color-theme-violet-translucent-light:color(display-p3 0.6823529412 0.368627451 0.9529411765/16%);--color-on-theme-light:color(display-p3 1 1 1/100%);--color-surface-primary-light:color(display-p3 1 1 1/100%);--color-surface-secondary-light:color(display-p3 0.9529411765 0.9529411765 0.9529411765/100%);--color-surface-tertiary-light:color(display-p3 1 1 1/100%);--color-shade-primary-light:color(display-p3 0.4666666667 0.4666666667 0.4666666667/10%);--color-shade-secondary-light:color(display-p3 0.4666666667 0.4666666667 0.4666666667/16%);--color-shade-tertiary-light:color(display-p3 0.4666666667 0.4666666667 0.4666666667/22%);--color-foreground-primary-light:color(display-p3 0 0 0/94%);--color-foreground-secondary-light:color(display-p3 0.3882352941 0.3882352941 0.3882352941/90%);--color-foreground-tertiary-light:color(display-p3 0.3882352941 0.3882352941 0.3882352941/58%);--color-outline-primary-light:color(display-p3 0.8862745098 0.8862745098 0.8862745098/100%);--color-outline-secondary-light:color(display-p3 0.8196078431 0.8196078431 0.8196078431/100%);--color-overlay-light:color(display-p3 0 0 0/26%);--color-shadow-light:color(display-p3 0 0 0/6%)}}@supports (color: color(display-p3 1 1 1)){:host{--color-theme-pink-solid-dark:color(display-p3 1 0.2549019608 0.4431372549/100%);--color-theme-red-solid-dark:color(display-p3 1 0.2823529412 0.1725490196/100%);--color-theme-orange-solid-dark:color(display-p3 1 0.5058823529 0.1098039216/100%);--color-theme-green-solid-dark:color(display-p3 0.4039215686 0.6117647059 0.0823529412/100%);--color-theme-cyan-solid-dark:color(display-p3 0.1254901961 0.6078431373 0.7490196078/100%);--color-theme-blue-solid-dark:color(display-p3 0.3568627451 0.5450980392 1/100%);--color-theme-violet-solid-dark:color(display-p3 0.7294117647 0.4117647059 1/100%);--color-theme-pink-translucent-dark:color(display-p3 1 0.2549019608 0.4431372549/26%);--color-theme-red-translucent-dark:color(display-p3 1 0.2823529412 0.1725490196/26%);--color-theme-orange-translucent-dark:color(display-p3 1 0.5058823529 0.1098039216/26%);--color-theme-green-translucent-dark:color(display-p3 0.4039215686 0.6117647059 0.0823529412/26%);--color-theme-cyan-translucent-dark:color(display-p3 0.1254901961 0.6078431373 0.7490196078/26%);--color-theme-blue-translucent-dark:color(display-p3 0.3568627451 0.5450980392 1/26%);--color-theme-violet-translucent-dark:color(display-p3 0.7294117647 0.4117647059 1/26%);--color-on-theme-dark:color(display-p3 0 0 0/100%);--color-surface-primary-dark:color(display-p3 0 0 0/100%);--color-surface-secondary-dark:color(display-p3 0.1058823529 0.1058823529 0.1058823529/100%);--color-surface-tertiary-dark:color(display-p3 0.1568627451 0.1568627451 0.1568627451/100%);--color-shade-primary-dark:color(display-p3 0.4666666667 0.4666666667 0.4666666667/28%);--color-shade-secondary-dark:color(display-p3 0.4666666667 0.4666666667 0.4666666667/34%);--color-shade-tertiary-dark:color(display-p3 0.4666666667 0.4666666667 0.4666666667/40%);--color-foreground-primary-dark:color(display-p3 1 1 1/94%);--color-foreground-secondary-dark:color(display-p3 0.5450980392 0.5450980392 0.5450980392/90%);--color-foreground-tertiary-dark:color(display-p3 0.5450980392 0.5450980392 0.5450980392/58%);--color-outline-primary-dark:color(display-p3 0.2431372549 0.2431372549 0.2431372549/100%);--color-outline-secondary-dark:color(display-p3 0.2941176471 0.2941176471 0.2941176471/100%);--color-overlay-dark:color(display-p3 0 0 0/68%);--color-shadow-dark:color(display-p3 0 0 0/10%)}}:host,:host(.light){--color-theme-pink-solid:var(--color-theme-pink-solid-light);--color-theme-red-solid:var(--color-theme-red-solid-light);--color-theme-orange-solid:var(--color-theme-orange-solid-light);--color-theme-green-solid:var(--color-theme-green-solid-light);--color-theme-cyan-solid:var(--color-theme-cyan-solid-light);--color-theme-blue-solid:var(--color-theme-blue-solid-light);--color-theme-violet-solid:var(--color-theme-violet-solid-light);--color-theme-pink-translucent:var(--color-theme-pink-translucent-light);--color-theme-red-translucent:var(--color-theme-red-translucent-light);--color-theme-orange-translucent:var(--color-theme-orange-translucent-light);--color-theme-green-translucent:var(--color-theme-green-translucent-light);--color-theme-cyan-translucent:var(--color-theme-cyan-translucent-light);--color-theme-blue-translucent:var(--color-theme-blue-translucent-light);--color-theme-violet-translucent:var(--color-theme-violet-translucent-light);--color-on-theme:var(--color-on-theme-light);--color-surface-primary:var(--color-surface-primary-light);--color-surface-secondary:var(--color-surface-secondary-light);--color-surface-tertiary:var(--color-surface-tertiary-light);--color-shade-primary:var(--color-shade-primary-light);--color-shade-secondary:var(--color-shade-secondary-light);--color-shade-tertiary:var(--color-shade-tertiary-light);--color-foreground-primary:var(--color-foreground-primary-light);--color-foreground-secondary:var(--color-foreground-secondary-light);--color-foreground-tertiary:var(--color-foreground-tertiary-light);--color-outline-primary:var(--color-outline-primary-light);--color-outline-secondary:var(--color-outline-secondary-light);--color-overlay:var(--color-overlay-light);--color-shadow:var(--color-shadow-light)}:host(.dark){--color-theme-pink-solid:var(--color-theme-pink-solid-dark);--color-theme-red-solid:var(--color-theme-red-solid-dark);--color-theme-orange-solid:var(--color-theme-orange-solid-dark);--color-theme-green-solid:var(--color-theme-green-solid-dark);--color-theme-cyan-solid:var(--color-theme-cyan-solid-dark);--color-theme-blue-solid:var(--color-theme-blue-solid-dark);--color-theme-violet-solid:var(--color-theme-violet-solid-dark);--color-theme-pink-translucent:var(--color-theme-pink-translucent-dark);--color-theme-red-translucent:var(--color-theme-red-translucent-dark);--color-theme-orange-translucent:var(--color-theme-orange-translucent-dark);--color-theme-green-translucent:var(--color-theme-green-translucent-dark);--color-theme-cyan-translucent:var(--color-theme-cyan-translucent-dark);--color-theme-blue-translucent:var(--color-theme-blue-translucent-dark);--color-theme-violet-translucent:var(--color-theme-violet-translucent-dark);--color-on-theme:var(--color-on-theme-dark);--color-surface-primary:var(--color-surface-primary-dark);--color-surface-secondary:var(--color-surface-secondary-dark);--color-surface-tertiary:var(--color-surface-tertiary-dark);--color-shade-primary:var(--color-shade-primary-dark);--color-shade-secondary:var(--color-shade-secondary-dark);--color-shade-tertiary:var(--color-shade-tertiary-dark);--color-foreground-primary:var(--color-foreground-primary-dark);--color-foreground-secondary:var(--color-foreground-secondary-dark);--color-foreground-tertiary:var(--color-foreground-tertiary-dark);--color-outline-primary:var(--color-outline-primary-dark);--color-outline-secondary:var(--color-outline-secondary-dark);--color-overlay:var(--color-overlay-dark);--color-shadow:var(--color-shadow-dark)}@media (prefers-color-scheme: dark){:host{--color-theme-pink-solid:var(--color-theme-pink-solid-dark);--color-theme-red-solid:var(--color-theme-red-solid-dark);--color-theme-orange-solid:var(--color-theme-orange-solid-dark);--color-theme-green-solid:var(--color-theme-green-solid-dark);--color-theme-cyan-solid:var(--color-theme-cyan-solid-dark);--color-theme-blue-solid:var(--color-theme-blue-solid-dark);--color-theme-violet-solid:var(--color-theme-violet-solid-dark);--color-theme-pink-translucent:var(--color-theme-pink-translucent-dark);--color-theme-red-translucent:var(--color-theme-red-translucent-dark);--color-theme-orange-translucent:var(--color-theme-orange-translucent-dark);--color-theme-green-translucent:var(--color-theme-green-translucent-dark);--color-theme-cyan-translucent:var(--color-theme-cyan-translucent-dark);--color-theme-blue-translucent:var(--color-theme-blue-translucent-dark);--color-theme-violet-translucent:var(--color-theme-violet-translucent-dark);--color-on-theme:var(--color-on-theme-dark);--color-surface-primary:var(--color-surface-primary-dark);--color-surface-secondary:var(--color-surface-secondary-dark);--color-surface-tertiary:var(--color-surface-tertiary-dark);--color-shade-primary:var(--color-shade-primary-dark);--color-shade-secondary:var(--color-shade-secondary-dark);--color-shade-tertiary:var(--color-shade-tertiary-dark);--color-foreground-primary:var(--color-foreground-primary-dark);--color-foreground-secondary:var(--color-foreground-secondary-dark);--color-foreground-tertiary:var(--color-foreground-tertiary-dark);--color-outline-primary:var(--color-outline-primary-dark);--color-outline-secondary:var(--color-outline-secondary-dark);--color-overlay:var(--color-overlay-dark);--color-shadow:var(--color-shadow-dark)}}:host(.blue){--color-theme-solid:var(--color-theme-blue-solid);--color-theme-translucent:var(--color-theme-blue-translucent)}:host(.cyan){--color-theme-solid:var(--color-theme-cyan-solid);--color-theme-translucent:var(--color-theme-cyan-translucent)}:host(.green){--color-theme-solid:var(--color-theme-green-solid);--color-theme-translucent:var(--color-theme-green-translucent)}:host(.orange){--color-theme-solid:var(--color-theme-orange-solid);--color-theme-translucent:var(--color-theme-orange-translucent)}:host(.pink){--color-theme-solid:var(--color-theme-pink-solid);--color-theme-translucent:var(--color-theme-pink-translucent)}:host(.red){--color-theme-solid:var(--color-theme-red-solid);--color-theme-translucent:var(--color-theme-red-translucent)}:host(.violet){--color-theme-solid:var(--color-theme-violet-solid);--color-theme-translucent:var(--color-theme-violet-translucent)}';var EzpPrinting=function(){function e(e){registerInstance(this,e);this.theme="cyan";this.appearance="system";this.printOpen=false;this.authOpen=false}e.prototype.listenPrintCancel=function(){this.printOpen=false};e.prototype.listenPrintSubmit=function(){this.printOpen=false};e.prototype.listenAuthCancel=function(){this.authOpen=false};e.prototype.listenAuthShow=function(){this.authOpen=true};e.prototype.listenPrintShow=function(){this.printOpen=true};e.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(authStore.state.isAuthorized){this.printOpen=true}else{this.authOpen=true}return[2]}))}))};e.prototype.checkAuth=function(){var e=new EzpPrintService(this.redirecturi,this.clientid);var t=authStore.state.accessToken;if(t===""){t=localStorage.getItem("access_token");authStore.state.accessToken=t}if(localStorage.getItem("isAuthorized")){authStore.state.isAuthorized=!!localStorage.getItem("isAuthorized");this.authOpen=!authStore.state.isAuthorized}e.getConfig(authStore.state.accessToken).catch((function(){authStore.state.isAuthorized=false}))};e.prototype.componentWillLoad=function(){authStore.state.redirectUri=this.redirecturi;userStore.state.theme=this.theme;userStore.state.appearance=this.appearance;if(this.authapihosturl){authStore.state.authApiHostUrl=this.authapihosturl}else{authStore.state.authApiHostUrl=config.authApiHostUrl}if(this.printapihosturl){printStore.state.printApiHostUrl=this.printapihosturl}else{printStore.state.printApiHostUrl=config.printingApiHostUrl}sendCodeToParentWindow();this.checkAuth()};e.prototype.render=function(){var e=this;return h(Host,{class:userStore.state.theme+" "+userStore.state.appearance},this.authOpen?h("ezp-auth",{clientID:this.clientid,redirectURI:this.redirecturi,hidelogin:this.hidelogin}):this.printOpen?h("ezp-printer-selection",{clientID:this.clientid,redirectURI:this.redirecturi,filename:this.filename,fileurl:this.fileurl,filetype:this.filetype,fileid:this.fileid}):this.custom?h("slot",null):h("ezp-icon-button",{id:"print-trigger",icon:"printer",slot:"trigger",type:"button",onClick:function(){return e.open()}}))};return e}();EzpPrinting.style=ezpPrintingCss;var ezpProgressCss=":host{--stroke-width:4;-ms-flex-line-pack:center;align-content:center;-ms-flex-align:center;align-items:center;background:var(--color-overlay);border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;display:grid;grid-template:auto/auto;height:100%;-ms-flex-pack:center;justify-content:center;justify-items:center;left:0;padding:var(--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{background:var(--color-surface-tertiary);border-radius:3px;-webkit-box-shadow:var(--box-separator-position, 0 0 0 var(--hairline-width-positive)) var(--hairline-color);box-shadow:var(--box-separator-position, 0 0 0 var(--hairline-width-positive)) var(--hairline-color);display:grid;grid-row-gap:var(--spacing-2);grid-template-columns:1fr;grid-template-rows:repeat(2, auto);justify-items:center;padding:var(--spacing-4)}#indicator{-webkit-animation:rotate var(--duration-6) linear infinite;animation:rotate var(--duration-6) linear infinite;display:block;height:44px;-webkit-transform:rotate(0);transform:rotate(0);width:44px}#track{fill:none;stroke:var(--color-outline-primary);stroke-width:var(--stroke-width)}#value{-webkit-animation:offset var(--duration-6) linear alternate infinite;animation:offset var(--duration-6) linear alternate infinite;fill:none;stroke:var(--color-theme-solid);stroke-dasharray:100;stroke-dashoffset:100;stroke-linecap:round;stroke-width:var(--stroke-width)}#status{color:var(--color-foreground-primary)}@-webkit-keyframes offset{100%{stroke-dashoffset:50}}@keyframes offset{100%{stroke-dashoffset:50}}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}";var EzpProgress=function(){function e(e){registerInstance(this,e);this.status="Status..."}e.prototype.render=function(){return h(Host,null,h("div",{id:"box"},h("svg",{id:"indicator",viewBox:"0 0 44 44",xmlns:"http://www.w3.org/2000/svg"},h("circle",{id:"track",cx:"22",cy:"22",r:"16"}),h("circle",{id:"value",cx:"22",cy:"22",r:"16"})),h("ezp-label",{id:"status",level:"tertiary",weight:"strong",text:this.status})))};return e}();EzpProgress.style=ezpProgressCss;var ezpSelectCss=':host{--accessory-color:var(--color-foreground-secondary);--details-columns:1fr;--details-rows:auto;--host-height:var(--toggle-height);--duration:var(--duration-3);--host-transition:z-index 0s var(--duration);--host-z-index:3;--indicator-opacity:0;--indicator-transform:translateX(var(--spacing-3));--indicator-transition:opacity var(--duration) var(--easing-out-quart),\n transform var(--duration) var(--easing-out-quart), visibility 0s var(--duration);--indicator-visibility:hidden;--label-align:auto;--label-color:var(--color-foreground-secondary);--list-height:0;--list-separator-position:inset 0 var(--hairline-width-positive);--option-height:auto;--toggle-areas:none;--toggle-columns:none;--toggle-height:auto;--toggle-rows:auto;--value-align:auto;--wrap-radius:0;--wrap-separator-color:var(--hairline-color);--wrap-separator-position-bottom:0 var(--hairline-width-positive) 0 0;--wrap-separator-position-left:var(--hairline-width-negative) 0 0 0;--wrap-separator-position-right:var(--hairline-width-positive) 0 0 0;--wrap-separator-position-top:0 var(--hairline-width-negative) 0 0;--wrap-translate-y:0;display:block;height:var(--host-height);position:relative;-webkit-transition:var(--host-transition);transition:var(--host-transition);z-index:var(--host-z-index)}:host(:first-child){--wrap-radius:3px 3px 0 0}:host(:last-child){--wrap-radius:0 0 3px 3px}:host(:first-child:last-child){--wrap-radius:3px}:host(:not(:last-child):not(.is-expanded)){--wrap-separator-position-bottom:0 0 0 0}:host(.toggle-horizontal){--label-align:start;--toggle-areas:"label value accessory";--toggle-columns:1fr repeat(2, auto);--toggle-height:30px;--toggle-rows:auto;--value-align:end}:host(.toggle-horizontal.has-icon){--toggle-areas:"icon label value accessory";--toggle-columns:auto 1fr repeat(2, auto)}:host(.toggle-vertical){--label-align:center;--toggle-areas:"label accessory" "value accessory";--toggle-columns:1fr auto;--toggle-height:48px;--toggle-rows:repeat(2, auto);--value-align:center}:host(.toggle-vertical.has-icon){--toggle-areas:"icon label accessory" "icon value accessory";--toggle-columns:auto 1fr auto}:host(.option-horizontal){--details-columns:repeat(2, 1fr);--details-rows:auto;--option-height:30px}:host(.option-vertical){--details-columns:1fr;--details-rows:repeat(2, auto);--option-height:48px}:host(.is-expanded){--accessory-color:var(--color-theme-solid);--host-transition:z-index 0s 0s;--host-z-index:9999;--icon-color:var(--color-theme-solid);--label-color:var(--color-theme-solid);--wrap-radius:3px}@media (prefers-color-scheme: dark){:host{--list-separator-position:0 var(--hairline-width-negative) 0 0;--wrap-separator-position-bottom:inset 0 var(--hairline-width-negative) 0 0;--wrap-separator-position-left:inset var(--hairline-width-positive) 0 0 0;--wrap-separator-position-right:inset var(--hairline-width-negative) 0 0 0;--wrap-separator-position-top:inset 0 var(--hairline-width-positive) 0 0}}#wrap{background:var(--color-surface-tertiary);border-radius:var(--wrap-radius);-webkit-box-shadow:var(--wrap-separator-position-top) var(--wrap-separator-color), var(--wrap-separator-position-right) var(--wrap-separator-color), var(--wrap-separator-position-bottom) var(--wrap-separator-color), var(--wrap-separator-position-left) var(--wrap-separator-color);box-shadow:var(--wrap-separator-position-top) var(--wrap-separator-color), var(--wrap-separator-position-right) var(--wrap-separator-color), var(--wrap-separator-position-bottom) var(--wrap-separator-color), var(--wrap-separator-position-left) var(--wrap-separator-color);-webkit-transform:translateY(var(--wrap-translate-y));transform:translateY(var(--wrap-translate-y));-webkit-transition:border-radius var(--duration) var(--easing-out-quart), -webkit-transform var(--duration) var(--easing-out-quart), -webkit-box-shadow var(--duration) var(--easing-out-quart);transition:border-radius var(--duration) var(--easing-out-quart), -webkit-transform var(--duration) var(--easing-out-quart), -webkit-box-shadow var(--duration) var(--easing-out-quart);transition:transform var(--duration) var(--easing-out-quart), border-radius var(--duration) var(--easing-out-quart), box-shadow var(--duration) var(--easing-out-quart);transition:transform var(--duration) var(--easing-out-quart), border-radius var(--duration) var(--easing-out-quart), box-shadow var(--duration) var(--easing-out-quart), -webkit-transform var(--duration) var(--easing-out-quart), -webkit-box-shadow var(--duration) var(--easing-out-quart)}#toggle{-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:grid;gap:var(--spacing-2) var(--spacing-3);grid-template-areas:var(--toggle-areas);grid-template-columns:var(--toggle-columns);grid-template-rows:var(--toggle-rows);height:var(--toggle-height);padding:var(--spacing-3)}#toggle:hover{background:var(--color-shade-primary)}#icon{align-self:center;color:var(--icon-color, var(--color-foreground-secondary));grid-area:icon;margin:calc(var(--spacing-2) * -1) 0}#label{align-self:var(--label-align);color:var(--label-color);grid-area:label}#value{align-self:var(--value-align);color:var(--color-foreground-primary);grid-area:value}#accessory{align-self:center;color:var(--accessory-color);grid-area:accessory;margin:calc(var(--spacing-2) * -1) 0}#list{-webkit-box-shadow:var(--list-separator-position) var(--hairline-color);box-shadow:var(--list-separator-position) var(--hairline-color);height:var(--list-height);overflow:auto;-webkit-transition:height var(--duration) var(--easing-out-quart);transition:height var(--duration) var(--easing-out-quart)}.option{background:var(--option-background);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:grid;gap:var(--spacing-3);grid-template:auto/auto 1fr;height:var(--option-height);padding:0 0 0 var(--spacing-3)}.option:not(:first-child){--details-separator:0 var(--hairline-width-negative) 0 0 var(--hairline-color)}.option:hover{--option-background:var(--color-shade-primary)}.option:hover,.option:hover+.option{--details-separator:none}.option:active{--option-background:var(--color-shade-secondary)}.option.is-selected{--indicator-opacity:1;--indicator-transform:translateX(0);--indicator-transition:opacity var(--duration) var(--easing-out-quart),\n transform var(--duration) var(--easing-out-quart), visibility 0s 0s;--indicator-visibility:visible}.indicator{-ms-flex-item-align:center;align-self:center;color:var(--color-theme-solid);margin:calc(var(--spacing-2) * -1) 0;opacity:var(--indicator-opacity);-webkit-transform:var(--indicator-transform);transform:var(--indicator-transform);-webkit-transition:var(--indicator-transition);transition:var(--indicator-transition);visibility:var(--indicator-visibility)}.details{-webkit-box-shadow:var(--details-separator);box-shadow:var(--details-separator);display:grid;gap:var(--spacing-2);grid-template-columns:var(--details-columns);grid-template-rows:var(--details-rows);padding:var(--spacing-3) var(--spacing-3) var(--spacing-3) 0}.title{-ms-flex-item-align:start;align-self:start;color:var(--color-foreground-primary)}.meta{-ms-flex-item-align:end;align-self:end;color:var(--color-foreground-secondary)}';var EzpSelect=function(){function e(e){var t=this;registerInstance(this,e);this.selectToggle=createEvent(this,"selectToggle",7);this.selectSelection=createEvent(this,"selectSelection",7);this.backdrop=document.createElement("ezp-backdrop");this.containerHeight=0;this.expandCover=false;this.expandRise=false;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.expanded=false;this.selected={id:0,title:"",meta:""};this.toggle=function(){t.expanded=!t.expanded;t.selectToggle.emit(t.expanded)};this.select=function(e){var r=t.selected.id===e?0:t.duration*1e3;t.selected=t.options.find((function(t){return t.id===e}));t.selectSelection.emit(t.selected);window.setTimeout((function(){t.toggle()}),r)}}e.prototype.watchExpanded=function(){if(this.expandCover){this.component.style.setProperty("--list-height",this.expanded?this.containerHeight-this.toggleHeight+"px":"0px");this.component.style.setProperty("--wrap-translate-y",this.expanded?this.wrapTop*-1+this.spacing+"px":"0px")}else if(this.expandRise){this.component.style.setProperty("--list-height",this.expanded?this.listHeight+"px":"0px");this.component.style.setProperty("--wrap-translate-y",this.expanded?this.wrapDiff+this.spacing+"px":"0px")}else{this.component.style.setProperty("--list-height",this.expanded?this.listHeight+"px":"0px")}if(this.expanded){this.backdrop.visible=true;this.container.appendChild(this.backdrop)}else{this.backdrop.visible=false}};e.prototype.componentWillLoad=function(){var e=this;this.container=this.component.closest("[data-backdrop-surface]");this.backdrop.addEventListener("backdropHideStart",(function(){e.expanded=false}));this.backdrop.addEventListener("backdropHideEnd",(function(){e.container.removeChild(e.backdrop)}));if(this.preSelected){this.selected=this.options.find((function(t){return typeof e.preSelected==="number"?t.id===e.preSelected:t.title===e.preSelected}))}};e.prototype.componentDidLoad=function(){var e=getComputedStyle(this.component);this.toggleHeight=parseInt(e.getPropertyValue("--toggle-height"));this.duration=parseFloat(e.getPropertyValue("--duration"));this.containerHeight=this.container.clientHeight-this.spacing*2;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};e.prototype.render=function(){var e=this;var t=[this.expanded?"is-expanded":"",this.icon?"has-icon":"","toggle-"+this.toggleFlow,this.optionFlow?"option-"+this.optionFlow:""];var r=this.toggleFlow==="horizontal"?"secondary":"tertiary";return h(Host,{class:t.join(" ")},h("div",{id:"wrap"},h("div",{id:"toggle",onClick:function(){return e.toggle()}},this.icon?h("ezp-icon",{id:"icon",name:this.icon}):null,h("ezp-label",{id:"label",noWrap:true,level:r,text:this.label}),h("ezp-label",{id:"value",ellipsis:true,text:this.selected.title!==""?this.selected.title:this.placeholder}),h("ezp-icon",{id:"accessory",name:"expand"})),h("div",{id:"list",ref:function(t){return e.list=t}},this.options.map((function(t){if(t.title!==""){return h("div",{class:"option "+(t.id===e.selected.id?"is-selected":"")+" "+(t.meta!==""?"has-meta":"")+" ",onClick:function(){return e.select(t.id)}},h("ezp-icon",{name:"checkmark",class:"indicator"}),h("div",{class:"details"},h("ezp-label",{class:"title",ellipsis:true,text:t.title}),t.meta!==""?h("ezp-label",{level:"tertiary",class:"meta",text:t.meta,ellipsis:true}):null))}})))))};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{expanded:["watchExpanded"]}},enumerable:false,configurable:true});return e}();EzpSelect.style=ezpSelectCss;var ezpStepperCss=':host{-ms-flex-align:center;align-items:center;background:var(--color-surface-tertiary);border-radius:3px;-webkit-box-shadow:0 0 0 var(--hairline-width-positive) var(--hairline-color);box-shadow:0 0 0 var(--hairline-width-positive) var(--hairline-color);display:grid;gap:var(--spacing-3);grid-template:var(--host-gridTemplate, auto/auto 1fr auto);padding:0 var(--spacing-2) 0 var(--spacing-3);position:relative;z-index:0}:host(.focused){--icon-color:var(--color-theme-solid);--label-color:var(--color-theme-solid)}:host(.has-icon){--host-gridTemplate:auto / repeat(2, auto) 1fr auto}#toggle{background:var(--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{--toggle-background:var(--color-shade-primary)}}#icon{color:var(--icon-color, var(--color-foreground-secondary));pointer-events:none}#label{color:var(--label-color, var(--color-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(--color-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(--button-background, transparent);border:0;border-radius:50%;-webkit-box-shadow:none;box-shadow:none;color:var(--button-color, var(--color-theme-solid));cursor:var(--button-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;outline:none;padding:var(--spacing-1)}@media (hover: hover){.button:not(:disabled):hover{--button-background:var(--color-shade-primary)}.button:not(:disabled):active{--button-background:var(--color-shade-secondary)}}.button:disabled{--button-color:var(--color-foreground-tertiary);--button-cursor:not-allowed}';var EzpStepper=function(){function e(e){var t=this;registerInstance(this,e);this.stepperChanged=createEvent(this,"stepperChanged",7);this.label="Label";this.min=1;this.canDecrease=true;this.canIncrease=true;this.focused=false;this.value=1;this.handleDecrease=function(){t.value--};this.handleIncrease=function(){t.value++};this.handleInput=function(){t.value=t.input.value!==""?parseInt(t.input.value):t.min};this.setFocus=function(){t.input.focus()};this.handleBlur=function(){t.focused=false};this.handleFocus=function(){t.focused=true}}e.prototype.watchValue=function(){this.canIncrease=this.max!==undefined?this.value<this.max:true;this.canDecrease=this.min!==undefined?this.value>this.min:true;this.stepperChanged.emit(this.value)};e.prototype.componentWillLoad=function(){this.watchValue()};e.prototype.render=function(){var e=this;return h(Host,{class:(this.focused?"focused":"")+" "+(this.icon?"has-icon":"")},h("div",{id:"toggle",onClick:this.setFocus}),this.icon?h("ezp-icon",{id:"icon",name:this.icon}):null,h("ezp-label",{id:"label",noWrap:true,text:this.label}),h("input",{id:"input",type:"number",ref:function(t){return e.input=t},min:this.min.toString(),max:this.max.toString(),value:this.value.toString(),onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur}),h("div",{class:"buttons"},h("button",{class:"button",disabled:!this.canDecrease,onClick:this.handleDecrease},h("ezp-icon",{name:"minus"})),h("button",{class:"button",disabled:!this.canIncrease,onClick:this.handleIncrease},h("ezp-icon",{name:"plus"}))))};Object.defineProperty(e,"watchers",{get:function(){return{value:["watchValue"]}},enumerable:false,configurable:true});return e}();EzpStepper.style=ezpStepperCss;var ezpTextButtonCss=":host{display:-ms-flexbox;display:flex}:host(.primary){--button-background-disabled:var(--color-shade-primary);--button-background-init:var(--color-theme-solid);--button-color-disabled:var(--color-foreground-tertiary);--button-color-init:var(--color-on-theme);--button-opacity-active:0.74;--button-opacity-hover:0.84}:host(.secondary){--button-background-active:var(--color-shade-tertiary);--button-background-disabled:var(--color-shade-primary);--button-background-hover:var(--color-shade-secondary);--button-background-init:var(--color-shade-primary);--button-color-disabled:var(--color-foreground-tertiary);--button-color-init:var(--color-theme-solid)}:host(.tertiary){--button-background-active:var(--color-shade-secondary);--button-background-disabled:transparent;--button-background-hover:var(--color-shade-primary);--button-background-init:transparent;--button-color-disabled:var(--color-foreground-tertiary);--button-color-init:var(--color-theme-solid)}.button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--button-background, var(--button-background-init));border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:var(--button-color, var(--button-color-init));cursor:var(--button-cursor, pointer);display:-ms-flexbox;display:flex;font-family:inherit;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--button-opacity, 1);outline:none;padding:var(--spacing-3);white-space:nowrap;width:100%}@media (hover: hover){.button:not(:disabled):hover{--button-background:var(--button-background-hover, var(--button-background-init));--button-opacity:var(--button-opacity-hover, 1)}.button:not(:disabled):active{--button-background:var(--button-background-active, var(--button-background-init));--button-opacity:var(--button-opacity-active, 1)}}.button:disabled{--button-background:var(--button-background-disabled);--button-color:var(--button-color-disabled);--button-cursor:not-allowed}";var EzpTextButton=function(){function e(e){registerInstance(this,e);this.blank=false;this.disabled=false;this.level="primary"}e.prototype.render=function(){var e=this.type!==undefined?"button":"a";var t=this.type!==undefined?{type:this.type,disabled:this.disabled}:{href:this.href,target:this.blank?"_blank":"_self"};return h(Host,{class:""+this.level},h(e,Object.assign({class:"button"},t),h("ezp-label",{weight:"heavy",text:this.label})))};return e}();EzpTextButton.style=ezpTextButtonCss;var ezpUserMenuCss=":host{background:var(--color-surface-tertiary);border-radius:6px;-webkit-box-shadow:var(--host-separator-position, 0 0 0 var(--hairline-width-positive)) var(--hairline-color);box-shadow:var(--host-separator-position, 0 0 0 var(--hairline-width-positive)) var(--hairline-color);display:block;opacity:var(--host-opacity, 0);position:absolute;right:0;top:0;-webkit-transform:scale(var(--host-scale, 0.94, 0.94));transform:scale(var(--host-scale, 0.94, 0.94));-webkit-transform-origin:right top;transform-origin:right top;-webkit-transition:var(--host-transition, opacity var(--duration-3) var(--easing-out-quart), transform var(--duration-3) var(--easing-out-quart), visibility 0s var(--duration-3));transition:var(--host-transition, opacity var(--duration-3) var(--easing-out-quart), transform var(--duration-3) var(--easing-out-quart), visibility 0s var(--duration-3));visibility:var(--host-visibility, hidden);z-index:5}:host(.is-open){--host-opacity:1;--host-scale:1, 1;--host-transition:opacity var(--duration-3) var(--easing-out-quart),\n transform var(--duration-3) var(--easing-out-quart), visibility 0s 0s;--host-visibility:visible}@media (prefers-color-scheme: dark){:host{--host-separator-position:inset 0 0 0 var(--hairline-width-positive)}}#header{-ms-flex-align:center;align-items:center;-webkit-box-shadow:0 var(--hairline-width-positive) 0 0 var(--hairline-color);box-shadow:0 var(--hairline-width-positive) 0 0 var(--hairline-color);-webkit-box-shadow:0;box-shadow:0;display:grid;grid-template:auto/1fr auto;padding:var(--spacing-4) var(--spacing-3) var(--spacing-4) var(--spacing-4)}#name{color:var(--color-foreground-primary)}#close{margin:calc(var(--spacing-3) * -1) 0}#links{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:var(--spacing-2)}.link{-ms-flex-align:center;align-items:center;background:var(--link-background, transparent);border-radius:3px;color:var(--color-foreground-primary);cursor:pointer;display:grid;gap:var(--spacing-3);grid-template:auto/auto 1fr;padding:var(--spacing-3);text-decoration:none}.link:hover{--link-background:var(--color-shade-primary)}.link__icon{color:var(--color-theme-solid);margin:calc(var(--spacing-2) * -1) 0}#theme{-webkit-box-shadow:inset 0 var(--hairline-width-positive) 0 0 var(--hairline-color);box-shadow:inset 0 var(--hairline-width-positive) 0 0 var(--hairline-color);display:grid;gap:var(--spacing-3);grid-template:repeat(2, auto)/1fr;padding:var(--spacing-4) var(--spacing-4) var(--spacing-3)}#swatches{display:-ms-flexbox;display:flex;margin:0 calc(var(--spacing-2) * -1)}.swatch{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--swatch-background, transparent);border:0;border-radius:50%;color:var(--swatch-color);cursor:var(--swatch-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--swatch-opacity, 1);outline:none;padding:var(--spacing-2)}@media (hover: hover){.swatch:not(.selected):hover{--swatch-background:var(--swatch-theme-translucent)}.swatch:not(.selected):active{--swatch-opacity:0.74}}.swatch.selected{--dot-boxShadowSize:10px;--swatch-background:var(--swatch-theme-translucent);--swatch-cursor:normal}.swatch.selected>.dot{-webkit-animation:dot-bounce var(--duration-2) ease-in-out;animation:dot-bounce var(--duration-2) ease-in-out}.swatch--blue{--swatch-theme-solid:var(--color-theme-blue-solid);--swatch-theme-translucent:var(--color-theme-blue-translucent)}.swatch--cyan{--swatch-theme-solid:var(--color-theme-cyan-solid);--swatch-theme-translucent:var(--color-theme-cyan-translucent)}.swatch--green{--swatch-theme-solid:var(--color-theme-green-solid);--swatch-theme-translucent:var(--color-theme-green-translucent)}.swatch--orange{--swatch-theme-solid:var(--color-theme-orange-solid);--swatch-theme-translucent:var(--color-theme-orange-translucent)}.swatch--pink{--swatch-theme-solid:var(--color-theme-pink-solid);--swatch-theme-translucent:var(--color-theme-pink-translucent)}.swatch--red{--swatch-theme-solid:var(--color-theme-red-solid);--swatch-theme-translucent:var(--color-theme-red-translucent)}.swatch--violet{--swatch-theme-solid:var(--color-theme-violet-solid);--swatch-theme-translucent:var(--color-theme-violet-translucent)}.dot{background:var(--dot-background, transparent);border-radius:50%;-webkit-box-shadow:inset 0 0 0 var(--dot-boxShadowSize, 4px) var(--swatch-theme-solid);box-shadow:inset 0 0 0 var(--dot-boxShadowSize, 4px) var(--swatch-theme-solid);height:18px;-webkit-transition:-webkit-box-shadow var(--duration-2);transition:-webkit-box-shadow var(--duration-2);transition:box-shadow var(--duration-2);transition:box-shadow var(--duration-2), -webkit-box-shadow var(--duration-2);width:18px}#appearance{-webkit-box-shadow:inset 0 var(--hairline-width-positive) 0 0 var(--hairline-color);box-shadow:inset 0 var(--hairline-width-positive) 0 0 var(--hairline-color);display:grid;gap:var(--spacing-3);grid-template:repeat(2, auto)/1fr;padding:var(--spacing-4) var(--spacing-4) var(--spacing-3)}#tabs{display:grid;grid-template:auto/repeat(3, 1fr);margin:0 calc(var(--spacing-2) * -1)}.tab{--icon-height:8px;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--tab-background, transparent);border:0;border-radius:14px;color:var(--tab-color, var(--color-foreground-secondary));cursor:var(--tab-cursor, pointer);display:-ms-flexbox;display:flex;gap:var(--spacing-2);-ms-flex-pack:center;justify-content:center;margin:0;outline:none;padding:var(--spacing-3) var(--spacing-3) var(--spacing-3) var(--spacing-2)}@media (hover: hover){.tab:not(.selected):hover{--tab-background:var(--color-shade-primary)}.tab:not(.selected):active{--tab-background:var(--color-shade-secondary)}}.tab.selected{--tab-background:var(--color-theme-translucent);--tab-color:var(--color-theme-solid);--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)}}";var EzpUserMenu=function(){function e(e){var t=this;registerInstance(this,e);this.userMenuClosure=createEvent(this,"userMenuClosure",7);this.logoutEmitter=createEvent(this,"logoutEmitter",7);this.backdrop=document.createElement("ezp-backdrop");this.links=[{title:"Manage Account",icon:"account",href:"https://app.ezeep.com"},{title:"Help & Support",icon:"help",href:"https://support.ezeep.com"}];this.themes=["pink","red","orange","green","cyan","blue","violet"];this.appearances=[{title:"System",name:"system"},{title:"Light",name:"light"},{title:"Dark",name:"dark"}];this.name="John Doe";this.open=false;this.handleClose=function(){t.userMenuClosure.emit()};this.logOut=function(){localStorage.clear();authStore.state.isAuthorized=false;t.logoutEmitter.emit()};this.handleTheme=function(e){userStore.state.theme=e};this.handleAppearance=function(e){userStore.state.appearance=e}}e.prototype.watchOpen=function(){if(this.open){this.backdrop.visible=true;this.container.appendChild(this.backdrop)}else{this.backdrop.visible=false;this.userMenuClosure.emit()}};e.prototype.componentWillLoad=function(){var e=this;this.container=this.component.closest("[data-backdrop-surface]");this.backdrop.addEventListener("backdropHideStart",(function(){e.open=false}));this.backdrop.addEventListener("backdropHideEnd",(function(){e.container.removeChild(e.backdrop)}))};e.prototype.render=function(){var e=this;return h(Host,{class:this.open?"is-open":""},h("div",{id:"header"},h("ezp-label",{ellipsis:true,id:"name",weight:"strong",text:this.name}),h("ezp-icon-button",{id:"close",level:"tertiary",icon:"close",onClick:this.handleClose})),h("div",{id:"links"},this.links.map((function(e){return h("a",{class:"link",href:e.href,target:"_blank",rel:"noopener noreferrer"},h("ezp-icon",{class:"link__icon",name:e.icon}),h("ezp-label",{text:e.title}))})),h("a",{class:"link",onClick:this.logOut},h("ezp-icon",{class:"link__icon",name:"logout"}),h("ezp-label",{text:"Logout"}))),h("div",{id:"theme"},h("ezp-label",{text:"Color Theme:",weight:"strong"}),h("div",{id:"swatches"},this.themes.map((function(t){return h("button",{class:"swatch swatch--"+t+" "+(t===userStore.state.theme?"selected":""),onClick:function(){return e.handleTheme(t)}},h("span",{class:"dot"}))})))),h("div",{id:"appearance"},h("ezp-label",{text:"Appearance:",weight:"strong"}),h("div",{id:"tabs"},this.appearances.map((function(t){return h("button",{class:"tab "+(t.name===userStore.state.appearance?"selected":""),onClick:function(){return e.handleAppearance(t.name)}},h("ezp-icon",{name:t.name}),h("ezp-label",{text:t.title,level:"tertiary",weight:"strong"}))})))))};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{open:["watchOpen"]}},enumerable:false,configurable:true});return e}();EzpUserMenu.style=ezpUserMenuCss;export{EzpAuth as ezp_auth,EzpBackdrop as ezp_backdrop,EzpIcon as ezp_icon,EzpIconButton as ezp_icon_button,EzpLabel as ezp_label,EzpPrinterSelection as ezp_printer_selection,EzpPrinting as ezp_printing,EzpProgress as ezp_progress,EzpSelect as ezp_select,EzpStepper as ezp_stepper,EzpTextButton as ezp_text_button,EzpUserMenu as ezp_user_menu};
|