!function(e){var t={};function i(s){if(t[s])return t[s].exports;var n=t[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=t,i.d=function(e,t,s){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(s,n,function(t){return e[t]}.bind(null,n));return s},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){e.exports=i(1)},function(e,t,i){"use strict";i.r(t);const s="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,n=(e,t,i=null)=>{for(;t!==i;){const i=t.nextSibling;e.removeChild(t),t=i}},o=`{{lit-${String(Math.random()).slice(2)}}}`,r=`\x3c!--${o}--\x3e`,a=new RegExp(`${o}|${r}`);class c{constructor(e,t){this.parts=[],this.element=t;const i=[],s=[],n=document.createTreeWalker(t.content,133,null,!1);let r=0,c=-1,d=0;const{strings:p,values:{length:m}}=e;for(;d0;){const t=p[d],i=h.exec(t)[2],s=i.toLowerCase()+"$lit$",n=e.getAttribute(s);e.removeAttribute(s);const o=n.split(a);this.parts.push({type:"attribute",index:c,name:i,strings:o}),d+=o.length-1}}"TEMPLATE"===e.tagName&&(s.push(e),n.currentNode=e.content)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(o)>=0){const s=e.parentNode,n=t.split(a),o=n.length-1;for(let t=0;t{const i=e.length-t.length;return i>=0&&e.slice(i)===t},d=e=>-1!==e.index,u=()=>document.createComment(""),h=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function p(e,t){const{element:{content:i},parts:s}=e,n=document.createTreeWalker(i,133,null,!1);let o=x(s),r=s[o],a=-1,c=0;const l=[];let d=null;for(;n.nextNode();){a++;const e=n.currentNode;for(e.previousSibling===d&&(d=null),t.has(e)&&(l.push(e),null===d&&(d=e)),null!==d&&c++;void 0!==r&&r.index===a;)r.index=null!==d?-1:r.index-c,o=x(s,o),r=s[o]}l.forEach(e=>e.parentNode.removeChild(e))}const m=e=>{let t=11===e.nodeType?0:1;const i=document.createTreeWalker(e,133,null,!1);for(;i.nextNode();)t++;return t},x=(e,t=-1)=>{for(let i=t+1;i"function"==typeof e&&_.has(e),f={},b={};class v{constructor(e,t,i){this.__parts=[],this.template=e,this.processor=t,this.options=i}update(e){let t=0;for(const i of this.__parts)void 0!==i&&i.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const e=s?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],i=this.template.parts,n=document.createTreeWalker(e,133,null,!1);let o,r=0,a=0,c=n.nextNode();for(;re}),y=` ${o} `;class S{constructor(e,t,i,s){this.strings=e,this.values=t,this.type=i,this.processor=s}getHTML(){const e=this.strings.length-1;let t="",i=!1;for(let s=0;s-1||i)&&-1===e.indexOf("--\x3e",n+1);const a=h.exec(e);t+=null===a?e+(i?y:r):e.substr(0,a.index)+a[1]+a[2]+"$lit$"+a[3]+o}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");let t=this.getHTML();return void 0!==w&&(t=w.createHTML(t)),e.innerHTML=t,e}}const k=e=>null===e||!("object"==typeof e||"function"==typeof e),A=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class E{constructor(e,t,i){this.dirty=!0,this.element=e,this.name=t,this.strings=i,this.parts=[];for(let e=0;e{try{const e={get capture(){return $=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class R{constructor(e,t,i){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=i,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;g(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=f,e(this)}if(this.__pendingValue===f)return;const e=this.__pendingValue,t=this.value,i=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),s=null!=e&&(null==t||i);i&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),s&&(this.__options=V(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=f}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const V=e=>e&&($?{capture:e.capture,passive:e.passive,once:e.once}:e.capture);function z(e){let t=L.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},L.set(e.type,t));let i=t.stringsArray.get(e.strings);if(void 0!==i)return i;const s=e.strings.join(o);return i=t.keyString.get(s),void 0===i&&(i=new c(e,e.getTemplateElement()),t.keyString.set(s,i)),t.stringsArray.set(e.strings,i),i}const L=new Map,O=new WeakMap;const M=new class{handleAttributeExpressions(e,t,i,s){const n=t[0];if("."===n){return new T(e,t.slice(1),i).parts}if("@"===n)return[new R(e,t.slice(1),s.eventContext)];if("?"===n)return[new P(e,t.slice(1),i)];return new E(e,t,i).parts}handleTextExpression(e){return new N(e)}};"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");const H=(e,...t)=>new S(e,t,"html",M),U=(e,t)=>`${e}--${t}`;let F=!0;void 0===window.ShadyCSS?F=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),F=!1);const j=e=>t=>{const i=U(t.type,e);let s=L.get(i);void 0===s&&(s={stringsArray:new WeakMap,keyString:new Map},L.set(i,s));let n=s.stringsArray.get(t.strings);if(void 0!==n)return n;const r=t.strings.join(o);if(n=s.keyString.get(r),void 0===n){const i=t.getTemplateElement();F&&window.ShadyCSS.prepareTemplateDom(i,e),n=new c(t,i),s.keyString.set(r,n)}return s.stringsArray.set(t.strings,n),n},D=["html","svg"],q=new Set,J=(e,t,i)=>{q.add(e);const s=i?i.element:document.createElement("template"),n=t.querySelectorAll("style"),{length:o}=n;if(0===o)return void window.ShadyCSS.prepareTemplateStyles(s,e);const r=document.createElement("style");for(let e=0;e{D.forEach(t=>{const i=L.get(U(t,e));void 0!==i&&i.keyString.forEach(e=>{const{element:{content:t}}=e,i=new Set;Array.from(t.querySelectorAll("style")).forEach(e=>{i.add(e)}),p(e,i)})})})(e);const a=s.content;i?function(e,t,i=null){const{element:{content:s},parts:n}=e;if(null==i)return void s.appendChild(t);const o=document.createTreeWalker(s,133,null,!1);let r=x(n),a=0,c=-1;for(;o.nextNode();){c++;for(o.currentNode===i&&(a=m(t),i.parentNode.insertBefore(t,i));-1!==r&&n[r].index===c;){if(a>0){for(;-1!==r;)n[r].index+=a,r=x(n,r);return}r=x(n,r)}}}(i,r,a.firstChild):a.insertBefore(r,a.firstChild),window.ShadyCSS.prepareTemplateStyles(s,e);const c=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==c)t.insertBefore(c.cloneNode(!0),t.firstChild);else if(i){a.insertBefore(r,a.firstChild);const e=new Set;e.add(r),p(i,e)}};window.JSCompiler_renameProperty=(e,t)=>e;const B={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},W=(e,t)=>t!==e&&(t==t||e==e),K={attribute:!0,type:String,converter:B,reflect:!1,hasChanged:W};class X extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach((t,i)=>{const s=this._attributeNameForProperty(i,t);void 0!==s&&(this._attributeToPropertyMap.set(s,i),e.push(s))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach((e,t)=>this._classProperties.set(t,e))}}static createProperty(e,t=K){if(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const i="symbol"==typeof e?Symbol():"__"+e,s=this.getPropertyDescriptor(e,i,t);void 0!==s&&Object.defineProperty(this.prototype,e,s)}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(s){const n=this[e];this[t]=s,this.requestUpdateInternal(e,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||K}static finalize(){const e=Object.getPrototypeOf(this);if(e.hasOwnProperty("finalized")||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const i of t)this.createProperty(i,e[i])}}static _attributeNameForProperty(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,i=W){return i(e,t)}static _propertyValueFromAttribute(e,t){const i=t.type,s=t.converter||B,n="function"==typeof s?s:s.fromAttribute;return n?n(e,i):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const i=t.type,s=t.converter;return(s&&s.toAttribute||B.toAttribute)(e,i)}initialize(){this._updateState=0,this._updatePromise=new Promise(e=>this._enableUpdatingResolver=e),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,i){t!==i&&this._attributeToProperty(e,i)}_propertyToAttribute(e,t,i=K){const s=this.constructor,n=s._attributeNameForProperty(e,i);if(void 0!==n){const e=s._propertyValueToAttribute(t,i);if(void 0===e)return;this._updateState=8|this._updateState,null==e?this.removeAttribute(n):this.setAttribute(n,e),this._updateState=-9&this._updateState}}_attributeToProperty(e,t){if(8&this._updateState)return;const i=this.constructor,s=i._attributeToPropertyMap.get(e);if(void 0!==s){const e=i.getPropertyOptions(s);this._updateState=16|this._updateState,this[s]=i._propertyValueFromAttribute(t,e),this._updateState=-17&this._updateState}}requestUpdateInternal(e,t,i){let s=!0;if(void 0!==e){const n=this.constructor;i=i||n.getPropertyOptions(e),n._valueHasChanged(this[e],t,i.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==i.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,i))):s=!1}!this._hasRequestedUpdate&&s&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,t){return this.requestUpdateInternal(e,t),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(e){}const e=this.performUpdate();return null!=e&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{e=this.shouldUpdate(t),e?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e)),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}}X.finalized=!0;const Z=Element.prototype;Z.msMatchesSelector||Z.webkitMatchesSelector;const G=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Q=Symbol();class Y{constructor(e,t){if(t!==Q)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(G?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const ee=(e,...t)=>{const i=t.reduce((t,i,s)=>t+(e=>{if(e instanceof Y)return e.cssText;if("number"==typeof e)return e;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(i)+e[s+1],e[0]);return new Y(i,Q)};(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const te={};class ie extends X{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const t=(e,i)=>e.reduceRight((e,i)=>Array.isArray(i)?t(i,e):(e.add(i),e),i),i=t(e,new Set),s=[];i.forEach(e=>s.unshift(e)),this._styles=s}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map(e=>{if(e instanceof CSSStyleSheet&&!G){const t=Array.prototype.slice.call(e.cssRules).reduce((e,t)=>e+t.cssText,"");return new Y(String(t),Q)}return e})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?G?this.renderRoot.adoptedStyleSheets=e.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==te&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){return te}}ie.finalized=!0,ie.render=(e,t,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const s=i.scopeName,o=O.has(t),r=F&&11===t.nodeType&&!!t.host,a=r&&!q.has(s),c=a?document.createDocumentFragment():t;if(((e,t,i)=>{let s=O.get(t);void 0===s&&(n(t,t.firstChild),O.set(t,s=new N(Object.assign({templateFactory:z},i))),s.appendInto(t)),s.setValue(e),s.commit()})(e,c,Object.assign({templateFactory:j(s)},i)),a){const e=O.get(c);O.delete(c);const i=e.value instanceof v?e.value.template:void 0;J(s,c,i),n(t,t.firstChild),t.appendChild(c),O.set(t,e)}!o&&r&&window.ShadyCSS.styleElement(t.host)};H``;const se=H``,ne=H``,oe=(H``,H``),re=H``;customElements.define("retux-inbox",class extends ie{static get styles(){return ee` @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } .hidden-content { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); -webkit-clip-path: polygon(0 0, 0 0, 0 0, 0 0); clip-path: polygon(0 0, 0 0, 0 0, 0 0); background-color: #fff; color: #000; } .ue-c-retux-inbox { width: 100%; z-index: 999999999999999; position: fixed; top: 0; left: 0; background: #ffffff; display: block; height: 100vh; animation: fadeIn 0.2s ease; } .ue-c-retux-inbox__container { width: 100%; display: flex; align-items: center; } @media (min-width: 46.25em) { .ue-c-retux-inbox__container { max-width: 50.5rem; margin: 0 auto; } } .ue-c-retux-inbox__header { padding: 1rem; border-bottom: 1px solid #d7d7d7; box-sizing: border-box; background: #ffffff; } @media (min-width: 46.25em) { .ue-c-retux-inbox__header { border-bottom: 0; background: #216087; } } .ue-c-retux-inbox__header-title { font-family: 'Roboto', Arial, Helvetica, sans-serif; font-size: 0.9375rem; color: #000; text-transform: uppercase; flex: 1; } @media (min-width: 46.25em) { .ue-c-retux-inbox__header-title { color: #fff; flex: 0 1 auto; margin-right: 4.6875rem; } } .ue-c-retux-inbox__switch { margin-right: 24px; } @media (min-width: 46.25em) { .ue-c-retux-inbox__switch { flex: 1; margin-right: 0; } } .ue-c-retux-inbox__switch input:checked+label { background-color: #68b9c9; } .ue-c-retux-inbox__switch input:checked+label:before { transform: translate(18px, -50%); background-color: #216087; } @media (min-width: 46.25em) { .ue-c-retux-inbox__switch input:checked+label:before { background-color: #e0e9f2; } } .ue-c-retux-inbox__switch input:focus+label:before { background-color: #68b9c9; box-shadow: 0 0 0.25rem 0 rgba(64, 64, 64, 0.5); } .ue-c-retux-inbox__switch label { background-color: #bdc1c6; width: 32px; height: 12px; border-radius: 0.375rem; display: inline-block; position: relative; cursor: pointer; } .ue-c-retux-inbox__switch label:before { content: ''; transition: .2s; display: block; position: absolute; width: 16px; height: 16px; background-color: #ffffff; border-radius: 50%; box-shadow: 0 0 0.25rem 0 rgba(64, 64, 64, 0.5); top: 50%; transform: translate(-2px, -50%); } .ue-c-retux-inbox__close { border: 0; margin: 0; padding: 0; background: transparent; cursor: pointer; } .ue-c-retux-inbox__close svg g { stroke: #333; } @media (min-width: 46.25em) { .ue-c-retux-inbox__close svg g { stroke: #fff; } } .ue-c-retux-inbox__counter { border-bottom: 1px solid #d7d7d7; margin: 0; padding: 8px 16px; font-family: Arial; font-size: 0.9375rem; color: #000; } .ue-c-retux-inbox__counter p { margin: 0; font-family: 'Roboto', Arial, Helvetica, sans-serif; font-size: 0.9375rem; } .ue-c-retux-inbox__counter strong { font-family: 'Roboto', Arial, Helvetica, sans-serif; font-weight: bold; } .ue-c-retux-inbox__status { padding: 24px 16px; } .ue-c-retux-inbox__status .ue-c-retux-inbox__container { flex-direction: column; align-items: flex-start; } .ue-c-retux-inbox__status-title { font-family: 'Roboto', Arial, Helvetica, sans-serif; font-weight: bold; font-size: 1.125rem; line-height: 1.25rem; color: #000000; display: block; margin: 0 0 1.25rem; } .ue-c-retux-inbox__status-msg { font-family: 'Roboto', Arial, Helvetica, sans-serif; font-size: 1rem; line-height: 1.375rem; color: #000000; margin: 0; } .ue-c-retux-inbox__articles { background: #e2e2e2; height: calc(100vh - 90px); overflow-y: auto; } .ue-c-retux-inbox__articles-list { margin: 0; padding: 0; background: #ffffff; width: 100%; } @media (min-width: 46.25em) { .ue-c-retux-inbox__articles-list { box-shadow: 0 2px 4px 0 rgba(108, 108, 108, 0.5); padding: 1.25rem; } } .ue-c-retux-inbox__item { position: relative; display: flex; background-color: #e1eaf2; padding: 1rem; border-bottom: 1px solid #fff; box-sizing: border-box; } @media (min-width: 46.25em) { .ue-c-retux-inbox__item { min-height: 90px; } } .ue-c-retux-inbox__item:before { content: ''; width: auto; height: 100%; border-left: 3px solid #7692a8; position: absolute; top: 0; left: 0; } .ue-c-retux-inbox__item-container { display: flex; width: 100%; } .ue-c-retux-inbox__item-media { margin-right: 1rem; display: flex; align-items: center; } .ue-c-retux-inbox__item-media-img { width: 3.125rem; height: 3.125rem; justify-content: center; overflow: hidden; background-position: center; background-size: cover; } .ue-c-retux-inbox__item-content { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-right: 1.125rem; } .ue-c-retux-inbox__item-kicker { font-family: 'Roboto_condensed', Tahoma, Geneva, sans-serif; font-weight: bold; font-size: 0.8125rem; line-height: 0.8125rem; text-transform: uppercase; color: #666666; margin: 0 0 0.5rem; } .ue-c-retux-inbox__item-link { text-decoration: none; color: #000; } .ue-c-retux-inbox__item-link:after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 2; } .ue-c-retux-inbox__item-headline { font-family: 'Roboto', Arial, Helvetica, sans-serif; font-weight: bold; font-size: 0.875rem; line-height: 1rem; color: #000000; margin: 0 0 0.3125rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .ue-c-retux-inbox__item-icon { margin-right: 0.313rem; position: relative; top: -1px; } .ue-c-retux-inbox__item-byline { display: flex; align-items: center; flex-wrap: wrap; } .ue-c-retux-inbox__item-byline-list { margin: 0; padding: 0; list-style: none; display: flex; display: contents; align-items: center; flex-wrap: wrap; } .ue-c-retux-inbox__item-byline-item { display: flex; align-items: center; margin-top: 0; } .ue-c-retux-inbox__item-byline-item { margin-right: 0.3125rem; } .ue-c-retux-inbox__item-byline-item:after { content: ''; width: 1px; height: 8px; background: #000000; margin-left: 0.375rem; position: relative; top: -1px; } .ue-c-retux-inbox__item-byline-name { font-family: 'Roboto', Arial, Helvetica, sans-serif; font-size: 0.625rem; line-height: 0.625rem; letter-spacing: 0.6px; text-transform: uppercase; color: #000000; } .ue-c-retux-inbox__item-timeago { font-family: 'Roboto', Arial, Helvetica, sans-serif; font-size: 0.625rem; line-height: 0.625rem; color: #000000; display: flex; } .ue-c-retux-inbox__item-delete { border: 0; margin: 0 -0.625rem 0 0; padding: 0.625rem; background: transparent; cursor: pointer; position: relative; z-index: 1000; display: flex; align-items: center; } .ue-c-retux-inbox__item--isOpinion .ue-c-retux-inbox__item-headline { font-style: italic; } @media (max-width: 46.24em) { .ue-c-retux-inbox__item--isSpecial { padding-top: 1rem; } } .ue-c-retux-inbox__item--isSpecial .ue-c-retux-inbox__item-container { flex-wrap: wrap; } @media (max-width: 46.24em) { .ue-c-retux-inbox__item--isSpecial .ue-c-retux-inbox__item-media { margin-right: 0; margin-bottom: 0.625rem; } } .ue-c-retux-inbox__item--isSpecial .ue-c-retux-inbox__item-media img { width: 100%; height: auto; } @media (min-width: 46.25em) { .ue-c-retux-inbox__item--isSpecial .ue-c-retux-inbox__item-media img { max-width: 200px; } } .ue-c-retux-inbox__item--isSpecial .ue-c-retux-inbox__item-content { justify-content: flex-start; } .ue-c-retux-inbox__item--isRead { background-color: #ffffff; border-bottom: 1px solid #f1f1f1; } @media (min-width: 46.25em) { .ue-c-retux-inbox__item--isRead { border: 1px solid #f1f1f1; } } .ue-c-retux-inbox__item--isRead:before { content: none; } .ue-c-retux-inbox__item--isRead .ue-c-retux-inbox__item-headline { font-weight: normal; } /* ICON RETUX INBOX */ .ue-c-main-header__retux-inbox { background: transparent; padding: 7px 6px; border: none; margin: 0; cursor: pointer; margin-right: 10px; position: relative; } .ue-c-main-header__retux-inbox svg path { fill: #216088; } .ue-c-main-header__retux-inbox--rounded { background: white; border-radius: 100%; } .ue-c-main-header__retux-inbox--inverted svg path { fill: white; } .ue-c-main-header__retux-inbox--inverted.ue-c-main-header__retux-inbox--rounded { background: #216088; } .ue-c-main-header__retux-inbox--inverted.ue-c-main-header__retux-inbox--new:after { border: none; top: 5px; right: 6px; } .ue-c-main-header__retux-inbox--new:after { content: ""; position: absolute; background: #d63b27; border-radius: 100%; width: 6px; height: 6px; top: 4px; right: 5px; border: 1px solid white; pointer-events: none; } .ue-c-main-header__retux-inbox+.ue-c-main-header__nav { width: px-rem(45px); } `}static get properties(){return{storageChecked:{type:Object},inactive:{type:Boolean},articles:{type:Array},unreadArticles:{type:Number},event:{type:String},connectEvent:{type:String},disconnectEvent:{type:String},hasNewsEvent:{type:String},noNewsEvent:{type:String},toogleInboxEvent:{type:String},isVisible:{type:Boolean},articlesLimit:{type:Number},timeLimit:{type:Number}}}constructor(){super(),this.storageChecked={},this.isStorageAvailable("localStorage")?this.inactive=this.parseJson(localStorage.getItem("retux_inbox_inactive"))||!1:this.inactive=!1,this.isStorageAvailable("sessionStorage")?this.articles=this.parseJson(sessionStorage.getItem("retux_inbox_articles"))||[]:this.articles=[],this.unreadArticles=this.articles.filter(e=>!e.isRead).length,this.event="em-retux-inbox-msg-event",this.connectEvent="em-retux-inbox-connected-event",this.disconnectEvent="em-retux-inbox-disconnected-event",this.hasNewsEvent="inbox-has-news-event",this.noNewsEvent="inbox-has-zero-news-event",this.toogleInboxEvent="toogle-inbox-event",this.isVisible=!1,this.articlesLimit=50,this.timeLimit=12,this.nodesToFocus=[],this.focusIndex=0,this.keyListener=e=>{"Escape"===e.code&&(this.closeInbox(),e.preventDefault()),"Space"===e.code&&(this.nodesToFocus[this.focusIndex].classList.contains("ue-c-retux-inbox__item-link")&&(this.markAsRead(this.nodesToFocus[this.focusIndex].id),window.location.href=this.nodesToFocus[this.focusIndex].href,e.preventDefault()),this.nodesToFocus[this.focusIndex].classList.contains("ue-c-retux-inbox__item-delete")&&(this.removeArticle(null,this.nodesToFocus[this.focusIndex].id),e.preventDefault()),"ue-c-retux-inbox__switch-input"===this.nodesToFocus[this.focusIndex].name&&this.startAccessibilityLogic()),"Tab"!==e.code||e.shiftKey?"Tab"===e.code&&e.shiftKey&&(this.focusIndex>0?this.focusIndex-=1:this.focusIndex=this.nodesToFocus.length-1,this.nodesToFocus[this.focusIndex]&&this.nodesToFocus[this.focusIndex].focus(),e.preventDefault()):(this.focusIndex0){let e=new CustomEvent(this.hasNewsEvent);window.document.dispatchEvent(e)}let i=window.document.URL.split(".");if("html"===i[i.length-1]){let e=i[i.length-2].split("/"),t=e[e.length-1],s=this.articles.find(e=>e.id===t);t&&s&&(s.isRead=!0,this.articles=[...this.articles],this.isStorageAvailable("sessionStorage")&&sessionStorage.setItem("retux_inbox_articles",JSON.stringify(this.articles)))}}updated(e){if(e.has("isVisible")&&!1===e.get("isVisible")?(this.articles=this.articles.filter(e=>{const t=new Date-new Date(e.timestamp);if(Math.floor(t/1e3/60/60)<=this.timeLimit)return e}),this.articles=[...this.articles],this.isStorageAvailable("sessionStorage")&&sessionStorage.setItem("retux_inbox_articles",JSON.stringify(this.articles)),this.startAccessibilityLogic(),this.sendAnalyticsString("retux: Abrir buzón de entrada"),document.body.classList.add("no-scroll")):e.has("isVisible")&&!0===e.get("isVisible")&&document.body.classList.remove("no-scroll"),e.has("articles")&&void 0!==e.get("articles")){if(this.unreadArticles=this.articles.filter(e=>!e.isRead).length,this.unreadArticles>0){let e=new CustomEvent(this.hasNewsEvent);window.document.dispatchEvent(e)}else{let e=new CustomEvent(this.noNewsEvent);window.document.dispatchEvent(e)}this.startAccessibilityLogic()}}connectedCallback(){super.connectedCallback(),window.document.addEventListener(this.event,this.receiveNews.bind(this)),window.document.addEventListener(this.toogleInboxEvent,this.toogleInbox.bind(this))}disconnectedCallback(){super.disconnectedCallback(),window.document.removeEventListener(this.event,this.receiveNews.bind(this)),window.document.removeEventListener(this.toogleInboxEvent,this.toogleInbox.bind(this));const e=new CustomEvent(this.disconnectEvent);window.document.dispatchEvent(e)}render(){return this.isVisible?H` `:""}getInputNode(){return this.inactive?H``:H``}closeInbox(){const e=new CustomEvent("close-inbox-event");window.document.dispatchEvent(e),this.isVisible=!1,document.getElementById("inbox-button").focus(),document.removeEventListener("keydown",this.keyListener,!0),this.focusIndex=0,this.nodesToFocus=[],this.sendAnalyticsString("retux: Cerrar buzón de entrada")}toogleInbox(){this.isVisible=!this.isVisible}generateListItems(){return this.articles.map(e=>e.isSpecial?H`
  • ${e.multimedia&&e.multimedia.length>0&&e.multimedia[0].url&&e.multimedia[0].url.length>0?H`
    `:""}
    ${e.seccion} ${e.cintillo}${e.cintillo.length>0?". ":""}${e.titulo}
  • `:H`
  • ${e.multimedia&&e.multimedia.length>0&&e.multimedia[0].url&&e.multimedia[0].url.length>0?H`
    `:""}
    ${e.seccion} ${e.cintillo}${e.cintillo.length>0?". ":""}${e.titulo}
  • `)}handleSwitch(e){if(this.inactive=e.path?!e.path[0].checked:!e.target.checked,this.isStorageAvailable("localStorage")&&localStorage.setItem("retux_inbox_inactive",this.inactive),this.inactive){this.articles.length=0,this.articles=[...this.articles],this.isStorageAvailable("sessionStorage")&&sessionStorage.setItem("retux_inbox_articles",JSON.stringify([]));const e=new CustomEvent(this.disconnectEvent);window.document.dispatchEvent(e);const t=new CustomEvent(this.noNews);window.document.dispatchEvent(t),this.sendAnalyticsString("retux: Desactivar notificaciones")}else{const e=new CustomEvent(this.connectEvent);window.document.dispatchEvent(e),this.sendAnalyticsString("retux: Activar notificaciones")}}generateSignatures(e){return e.firmas.map(e=>e.name?H` `:"")}markAsRead(e){this.articles.find(t=>t.id===e).isRead||(this.articles.find(t=>t.id===e).isRead=!0,this.isStorageAvailable("sessionStorage")&&sessionStorage.setItem("retux_inbox_articles",JSON.stringify(this.articles)),this.articles=[...this.articles]),this.sendAnalyticsString("retux: Buzón Abrir noticia")}removeArticle(e,t){e&&e.stopPropagation();const i=this.articles.length;if(this.articles.splice(this.articles.indexOf(this.articles.find(e=>e.id===t)),1),this.isStorageAvailable("sessionStorage")&&sessionStorage.setItem("retux_inbox_articles",JSON.stringify(this.articles)),this.articles=[...this.articles],i>0&&0===this.articles.length){const e=new CustomEvent(this.noNews);window.document.dispatchEvent(e)}}receiveNews(e){e&&e.detail&&!this.inactive&&(e.detail.forEach(e=>{let t;e.multimedia&&e.multimedia.length>1&&(e.multimedia=e.multimedia.sort((e,t)=>e.width>t.width?1:t.width>e.width?-1:0)),t=this.isStorageAvailable("sessionStorage")?this.parseJson(sessionStorage.getItem("retux_inbox_articles"))||[]:this.articles;let i=!1,s=this.unreadArticles;if(t.forEach(t=>{t.id===e.id&&(i=!0)}),i||(t.length===this.articlesLimit&&t.pop(),e.timestamp=new Date,t.unshift(e),t=[...t],this.isStorageAvailable("sessionStorage")&&sessionStorage.setItem("retux_inbox_articles",JSON.stringify(t)),this.articles=[...t]),0===s&&this.unreadArticles>0){let e=new CustomEvent(this.hasNewsEvent);window.document.dispatchEvent(e)}}),this.startAccessibilityLogic())}getTimeString(e){let t="";const i=parseInt((new Date-new Date(e.timestamp))/6e4);return t=0===i?H`Justo ahora`:1===i?H`Hace ${i} minuto`:i<60?H`Hace ${i} minutos`:Math.floor(i/60)<=1?i%60!=0?H`Hace ${Math.floor(i/60)} hora y ${i%60} minutos`:H`Hace ${Math.floor(i/60)} hora`:i%60!=0?H`Hace ${Math.floor(i/60)} horas y ${i%60} minutos`:H`Hace ${Math.floor(i/60)} horas`,t}getIsPremiumIcon(e){let t="";return"signwall"===e.tipoAcceso&&(t=H`${re}`),e.isPremium&&(t=H`${oe}`),t}isStorageAvailable(e){try{if(this.storageChecked.hasOwnProperty(e))return this.storageChecked[e];let t="o.O",i=window[e];return i.setItem(t,t),i.removeItem(t),this.storageChecked[e]=!0,!0}catch(t){return this.storageChecked[e]=!1,!1}}parseJson(e){let t=null;try{t=JSON.parse(e)}catch(e){e instanceof SyntaxError?console.log(`${e.name}: ${e.message}`):console.log(e)}return t}sendAnalyticsString(e){"function"==typeof envioSC&&envioSC(e)}startAccessibilityLogic(){this.focusIndex=0,this.nodesToFocus=[];const e=this.shadowRoot.querySelectorAll("\n #ue-c-retux-inbox__switch-input,\n .ue-c-retux-inbox__close"),t=this.shadowRoot.querySelectorAll(".ue-c-retux-inbox__item-container > *:not(.ue-c-retux-inbox__item-media)");for(let t of e)this.nodesToFocus.push(t);for(let e of t)e.classList.contains("ue-c-retux-inbox__item-content")?this.nodesToFocus.push(e.querySelector(".ue-c-retux-inbox__item-link")):this.nodesToFocus.push(e);this.nodesToFocus[this.focusIndex]&&this.nodesToFocus[this.focusIndex].focus(),document.addEventListener("keydown",this.keyListener,!0)}})}]);