@htmlbricks/hb-messages-send 0.16.69 → 0.16.70

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@htmlbricks/hb-messages-send",
3
3
  "displayName": "Svelte-Bootstrap messages-send",
4
4
  "description": "Svelte-Bootstrap messages-send",
5
- "version": "0.16.69",
5
+ "version": "0.16.70",
6
6
  "main": "release/release.js",
7
7
  "publishConfig": {
8
8
  "access": "public"
@@ -30,7 +30,7 @@
30
30
  "prepublish": "npm run build:release"
31
31
  },
32
32
  "devDependencies": {
33
- "@htmlbricks/hb-jsutils": "^0.16.69",
33
+ "@htmlbricks/hb-jsutils": "^0.16.70",
34
34
  "@htmlbricks/manifester": "^0.0.22",
35
35
  "@rollup/plugin-alias": "^3.1.2",
36
36
  "@rollup/plugin-commonjs": "^18.0.0",
@@ -75,7 +75,7 @@
75
75
  "webcomponents"
76
76
  ],
77
77
  "contributors": [],
78
- "gitHead": "e7a0b28d3f2f7b6d5aae39bdc36ab8ec761d293f",
78
+ "gitHead": "e0eb03a98016acdba468ed5b14340e1b3d1f43fd",
79
79
  "dependencies": {
80
80
  "style-to-object": "^0.3.0"
81
81
  }
@@ -145,5 +145,5 @@
145
145
  "size": {},
146
146
  "iifePath": "release/release.js",
147
147
  "repoName": "@htmlbricks/hb-messages-send",
148
- "version": "0.16.69"
148
+ "version": "0.16.70"
149
149
  }
@@ -1,2 +1,2 @@
1
- var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function s(t,e){t.appendChild(e)}function a(t,e,n){t.insertBefore(e,n||null)}function l(t){t.parentNode.removeChild(t)}function c(t){return document.createElement(t)}function u(){return t=" ",document.createTextNode(t);var t}function d(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function f(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function p(t,e){t.value=null==e?"":e}function h(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function g(t){const e={};for(const n of t)e[n.name]=n.value;return e}let m;function v(t){m=t}function y(){if(!m)throw new Error("Function called outside component initialization");return m}function b(){const t=y();return(e,n,{cancelable:o=!1}={})=>{const r=t.$$.callbacks[e];if(r){const i=function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(e,n,{cancelable:o});return r.slice().forEach((e=>{e.call(t,i)})),!i.defaultPrevented}return!0}}const $=[],x=[],w=[],E=[],_=Promise.resolve();let k=!1;function C(t){w.push(t)}const L=new Set;let j=0;function A(){const t=m;do{for(;j<$.length;){const t=$[j];j++,v(t),D(t.$$)}for(v(null),$.length=0,j=0;x.length;)x.pop()();for(let t=0;t<w.length;t+=1){const e=w[t];L.has(e)||(L.add(e),e())}w.length=0}while($.length);for(;E.length;)E.pop()();k=!1,L.clear(),v(t)}function D(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(C)}}const T=new Set;function P(t,e){-1===t.$$.dirty[0]&&($.push(t),k||(k=!0,_.then(A)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function M(i,s,a,c,u,d,f,p=[-1]){const h=m;v(i);const g=i.$$={fragment:null,ctx:null,props:d,update:t,not_equal:u,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(h?h.$$.context:[])),callbacks:n(),dirty:p,skip_bound:!1,root:s.target||h.$$.root};f&&f(g.root);let y=!1;if(g.ctx=a?a(i,s.props||{},((t,e,...n)=>{const o=n.length?n[0]:e;return g.ctx&&u(g.ctx[t],g.ctx[t]=o)&&(!g.skip_bound&&g.bound[t]&&g.bound[t](o),y&&P(i,t)),e})):[],g.update(),y=!0,o(g.before_update),g.fragment=!!c&&c(g.ctx),s.target){if(s.hydrate){const t=function(t){return Array.from(t.childNodes)}(s.target);g.fragment&&g.fragment.l(t),t.forEach(l)}else g.fragment&&g.fragment.c();s.intro&&((b=i.$$.fragment)&&b.i&&(T.delete(b),b.i($))),function(t,n,i,s){const{fragment:a,on_mount:l,on_destroy:c,after_update:u}=t.$$;a&&a.m(n,i),s||C((()=>{const n=l.map(e).filter(r);c?c.push(...n):o(n),t.$$.on_mount=[]})),u.forEach(C)}(i,s.target,s.anchor,s.customElement),A()}var b,$;v(h)}let N;"function"==typeof HTMLElement&&(N=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var O=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,z=/\n/g,R=/^\s*/,S=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,F=/^:\s*/,H=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,I=/^[;\s]*/,W=/^\s+|\s+$/g,B="";function q(t){return t?t.replace(W,B):B}var K,V=function(t,e){var n,o=null;if(!t||"string"!=typeof t)return o;for(var r,i,s=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,o=1;function r(t){var e=t.match(z);e&&(n+=e.length);var r=t.lastIndexOf("\n");o=~r?t.length-r:o+t.length}function i(){var t={line:n,column:o};return function(e){return e.position=new s(t),c(),e}}function s(t){this.start=t,this.end={line:n,column:o},this.source=e.source}function a(r){var i=new Error(e.source+":"+n+":"+o+": "+r);if(i.reason=r,i.filename=e.source,i.line=n,i.column=o,i.source=t,!e.silent)throw i}function l(e){var n=e.exec(t);if(n){var o=n[0];return r(o),t=t.slice(o.length),n}}function c(){l(R)}function u(t){var e;for(t=t||[];e=d();)!1!==e&&t.push(e);return t}function d(){var e=i();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var n=2;B!=t.charAt(n)&&("*"!=t.charAt(n)||"/"!=t.charAt(n+1));)++n;if(n+=2,B===t.charAt(n-1))return a("End of comment missing");var s=t.slice(2,n-2);return o+=2,r(s),t=t.slice(n),o+=2,e({type:"comment",comment:s})}}function f(){var t=i(),e=l(S);if(e){if(d(),!l(F))return a("property missing ':'");var n=l(H),o=t({type:"declaration",property:q(e[0].replace(O,B)),value:n?q(n[0].replace(O,B)):B});return l(I),o}}return s.prototype.content=t,c(),function(){var t,e=[];for(u(e);t=f();)!1!==t&&(e.push(t),u(e));return e}()}(t),a="function"==typeof e,l=0,c=s.length;l<c;l++)r=(n=s[l]).property,i=n.value,a?e(r,i,n):i&&(o||(o={}),o[r]=i);return o};function G(t){let e;return{c(){e=c("i"),f(e,"class","bi bi-file-earmark-check-fill")},m(t,n){a(t,e,n)},d(t){t&&l(e)}}}function J(t){let e;return{c(){e=c("i"),f(e,"class","bi bi-paperclip")},m(t,n){a(t,e,n)},d(t){t&&l(e)}}}function Q(e){let n,r,i,g,m,v,y,b,$,x,w,E,_,k,C,L,j,A,D;function T(t,e){return t[1]?G:J}let P=T(e),M=P(e);return{c(){n=c("link"),r=u(),i=c("div"),g=u(),m=c("div"),v=c("textarea"),y=u(),b=c("div"),$=c("div"),x=c("label"),w=c("input"),_=u(),M.c(),k=u(),C=c("button"),L=c("i"),this.c=t,f(n,"rel","stylesheet"),f(n,"href","https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css"),f(i,"class","column left"),f(v,"class","send-message-text"),f(m,"class","column middle"),f(w,"type","file"),w.disabled=E=!!e[1],f(x,"class","upload-file"),h(x,"opacity",e[1]?"0.5":"0.25"),f(L,"class","bi bi-send-fill"),f(C,"type","button"),f(C,"class","send-message-button btn-info"),C.disabled=j=!e[0]?.length&&!e[1],h(C,"opacity",e[0]?.length||e[1]?"1":"0.25"),f($,"class","message-buttons"),f(b,"class","column right")},m(t,o){s(document.head,n),a(t,r,o),a(t,i,o),a(t,g,o),a(t,m,o),s(m,v),p(v,e[0]),a(t,y,o),a(t,b,o),s(b,$),s($,x),s(x,w),s(x,_),M.m(x,null),s($,k),s($,C),s(C,L),A||(D=[d(v,"input",e[5]),d(w,"change",e[6]),d(C,"click",e[7])],A=!0)},p(t,[e]){1&e&&p(v,t[0]),2&e&&E!==(E=!!t[1])&&(w.disabled=E),P!==(P=T(t))&&(M.d(1),M=P(t),M&&(M.c(),M.m(x,null))),2&e&&h(x,"opacity",t[1]?"0.5":"0.25"),3&e&&j!==(j=!t[0]?.length&&!t[1])&&(C.disabled=j),3&e&&h(C,"opacity",t[0]?.length||t[1]?"1":"0.25")},i:t,o:t,d(t){l(n),t&&l(r),t&&l(i),t&&l(g),t&&l(m),t&&l(y),t&&l(b),M.d(),A=!1,o(D)}}}function U(t,e,n){const o=y(),r=b();let i,{id:s}=e,{style:a}=e,{text:l}=e;function c(){if(!(null==l?void 0:l.length)&&!i)return console.warn("no message to send");var t,e;console.log("send message "+l),r(t="sendMessage",e={text:l,id:s,file:i}),o.dispatchEvent&&o.dispatchEvent(new CustomEvent(t,{detail:e}))}return t.$$set=t=>{"id"in t&&n(3,s=t.id),"style"in t&&n(4,a=t.style),"text"in t&&n(0,l=t.text)},t.$$.update=()=>{25&t.$$.dirty&&(s||n(3,s=""),a&&V(a),l||n(0,l=""))},[l,i,c,s,a,function(){l=this.value,n(0,l),n(3,s),n(4,a)},function(){i=this.value,n(1,i)},()=>c()]}(function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var n,o,r="";if(t&&(null==e?void 0:e.length)&&(null===(n=Object.keys(t))||void 0===n?void 0:n.length)&&(null===(o=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===o?void 0:o.length))for(var i=function(n){(null==e?void 0:e.filter((function(e){return e.name===n&&e.defaultValue!==t[n]})))&&(r+="".concat(n,":").concat(t[n],";"))},s=0,a=Object.keys(t);s<a.length;s++)i(a[s]);return r},e.addComponent=function(t){var e,n=(null===(e=null==t?void 0:t.repoName.split("/"))||void 0===e?void 0:e[1])||(null==t?void 0:t.repoName);if(!n)throw new Error("wrong componentPath "+(null==t?void 0:t.repoName));if(!(null==t?void 0:t.version))throw new Error("wrong version "+(null==t?void 0:t.version));var o=(null==t?void 0:t.iifePath)||"release/release.js";if(!document.getElementById(n+"-script"))try{var r=document.createElement("script");r.id=n+"-script",r.src="https://cdn.jsdelivr.net/npm/".concat(t.repoName,"@").concat(t.version,"/").concat(o),(null==t?void 0:t.local)&&location.href.includes("localhost")&&(r.src="".concat(t.local)),document.head.appendChild(r)}catch(t){console.warn(t)}};var n=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,n){return t.getDictionaryWord(e,this.dictionary,n||this.lang)},t.prototype.translateDate=function(e,n,o){return t.formatDate(e,n,o||this.lang)},t.getDefaultLang=function(){var t,e,n,o,r,i="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(n=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===n?void 0:n.length)&&(i=null===(r=null===(o=navigator.languages[0])||void 0===o?void 0:o.split("-")[0])||void 0===r?void 0:r.toLowerCase()),i},t.getDictionaryWord=function(e,n,o){var r;if(!e)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(o&&(null===(r=n[o])||void 0===r?void 0:r[e]))return n[o][e];var i="",s=t.getDefaultLang();if(!o||s!==o){var a=null==n?void 0:n[s];(null==a?void 0:a[e])&&(i=a[e])}return i},t.formatDate=function(e,n,o){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(o||t.getDefaultLang(),n).format(e)},t}();e.LanguageTranslator=n})(K={exports:{}},K.exports);class X extends N{constructor(t){super(),this.shadowRoot.innerHTML='<style>@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css");:host{font-family:"Roboto", sans-serif;display:block;height:100px}.column{float:left;height:100%}.left{width:140px}.right{width:180px;height:100%;display:flex;justify-content:center;align-items:center}.middle{width:calc(100% - 320px)}.message-buttons{width:100%}.upload-file{height:30px;font-size:20px;margin-left:40px}label.upload-file input[type=file]{position:fixed;top:-10000000px}.send-message-button{width:35px;height:35px;margin-left:40px;border:1px solid rgba(0, 0, 0, 0.05);outline:none;font-weight:600;border-radius:50%;padding:0;opacity:0.5;background-color:inherit}.send-message-button>i{font-size:16px;margin:0 0 0 -2px}textarea{width:100%;height:100%;border-radius:5px;font-size:13px;resize:vertical;outline:none;border:0px;font-family:"Roboto", sans-serif;max-height:100%;overflow-y:auto}</style>',M(this,{target:this.shadowRoot,props:g(this.attributes),customElement:!0},U,Q,i,{id:3,style:4,text:0},null),t&&(t.target&&a(t.target,this,t.anchor),t.props&&(this.$set(t.props),A()))}static get observedAttributes(){return["id","style","text"]}get id(){return this.$$.ctx[3]}set id(t){this.$$set({id:t}),A()}get style(){return this.$$.ctx[4]}set style(t){this.$$set({style:t}),A()}get text(){return this.$$.ctx[0]}set text(t){this.$$set({text:t}),A()}}return customElements.define("hb-messages-send",X),X}();
1
+ var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function s(t,e){t.appendChild(e)}function a(t,e,n){t.insertBefore(e,n||null)}function l(t){t.parentNode.removeChild(t)}function c(t){return document.createElement(t)}function u(){return t=" ",document.createTextNode(t);var t}function d(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function f(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function p(t,e){t.value=null==e?"":e}function h(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function g(t){const e={};for(const n of t)e[n.name]=n.value;return e}let m;function v(t){m=t}function y(){if(!m)throw new Error("Function called outside component initialization");return m}function b(){const t=y();return(e,n,{cancelable:o=!1}={})=>{const r=t.$$.callbacks[e];if(r){const i=function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(e,n,{cancelable:o});return r.slice().forEach((e=>{e.call(t,i)})),!i.defaultPrevented}return!0}}const $=[],x=[],w=[],E=[],_=Promise.resolve();let k=!1;function C(t){w.push(t)}const L=new Set;let j=0;function A(){const t=m;do{for(;j<$.length;){const t=$[j];j++,v(t),D(t.$$)}for(v(null),$.length=0,j=0;x.length;)x.pop()();for(let t=0;t<w.length;t+=1){const e=w[t];L.has(e)||(L.add(e),e())}w.length=0}while($.length);for(;E.length;)E.pop()();k=!1,L.clear(),v(t)}function D(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(C)}}const T=new Set;function P(t,e){-1===t.$$.dirty[0]&&($.push(t),k||(k=!0,_.then(A)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function M(i,s,a,c,u,d,f,p=[-1]){const h=m;v(i);const g=i.$$={fragment:null,ctx:null,props:d,update:t,not_equal:u,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(h?h.$$.context:[])),callbacks:n(),dirty:p,skip_bound:!1,root:s.target||h.$$.root};f&&f(g.root);let y=!1;if(g.ctx=a?a(i,s.props||{},((t,e,...n)=>{const o=n.length?n[0]:e;return g.ctx&&u(g.ctx[t],g.ctx[t]=o)&&(!g.skip_bound&&g.bound[t]&&g.bound[t](o),y&&P(i,t)),e})):[],g.update(),y=!0,o(g.before_update),g.fragment=!!c&&c(g.ctx),s.target){if(s.hydrate){const t=function(t){return Array.from(t.childNodes)}(s.target);g.fragment&&g.fragment.l(t),t.forEach(l)}else g.fragment&&g.fragment.c();s.intro&&((b=i.$$.fragment)&&b.i&&(T.delete(b),b.i($))),function(t,n,i,s){const{fragment:a,on_mount:l,on_destroy:c,after_update:u}=t.$$;a&&a.m(n,i),s||C((()=>{const n=l.map(e).filter(r);c?c.push(...n):o(n),t.$$.on_mount=[]})),u.forEach(C)}(i,s.target,s.anchor,s.customElement),A()}var b,$;v(h)}let N;"function"==typeof HTMLElement&&(N=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var O=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,z=/\n/g,R=/^\s*/,S=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,F=/^:\s*/,H=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,I=/^[;\s]*/,W=/^\s+|\s+$/g,B="";function q(t){return t?t.replace(W,B):B}var K,V=function(t,e){var n,o=null;if(!t||"string"!=typeof t)return o;for(var r,i,s=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,o=1;function r(t){var e=t.match(z);e&&(n+=e.length);var r=t.lastIndexOf("\n");o=~r?t.length-r:o+t.length}function i(){var t={line:n,column:o};return function(e){return e.position=new s(t),c(),e}}function s(t){this.start=t,this.end={line:n,column:o},this.source=e.source}function a(r){var i=new Error(e.source+":"+n+":"+o+": "+r);if(i.reason=r,i.filename=e.source,i.line=n,i.column=o,i.source=t,!e.silent)throw i}function l(e){var n=e.exec(t);if(n){var o=n[0];return r(o),t=t.slice(o.length),n}}function c(){l(R)}function u(t){var e;for(t=t||[];e=d();)!1!==e&&t.push(e);return t}function d(){var e=i();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var n=2;B!=t.charAt(n)&&("*"!=t.charAt(n)||"/"!=t.charAt(n+1));)++n;if(n+=2,B===t.charAt(n-1))return a("End of comment missing");var s=t.slice(2,n-2);return o+=2,r(s),t=t.slice(n),o+=2,e({type:"comment",comment:s})}}function f(){var t=i(),e=l(S);if(e){if(d(),!l(F))return a("property missing ':'");var n=l(H),o=t({type:"declaration",property:q(e[0].replace(O,B)),value:n?q(n[0].replace(O,B)):B});return l(I),o}}return s.prototype.content=t,c(),function(){var t,e=[];for(u(e);t=f();)!1!==t&&(e.push(t),u(e));return e}()}(t),a="function"==typeof e,l=0,c=s.length;l<c;l++)r=(n=s[l]).property,i=n.value,a?e(r,i,n):i&&(o||(o={}),o[r]=i);return o};function G(t){let e;return{c(){e=c("i"),f(e,"class","bi bi-file-earmark-check-fill")},m(t,n){a(t,e,n)},d(t){t&&l(e)}}}function J(t){let e;return{c(){e=c("i"),f(e,"class","bi bi-paperclip")},m(t,n){a(t,e,n)},d(t){t&&l(e)}}}function Q(e){let n,r,i,g,m,v,y,b,$,x,w,E,_,k,C,L,j,A,D;function T(t,e){return t[1]?G:J}let P=T(e),M=P(e);return{c(){n=c("link"),r=u(),i=c("div"),g=u(),m=c("div"),v=c("textarea"),y=u(),b=c("div"),$=c("div"),x=c("label"),w=c("input"),_=u(),M.c(),k=u(),C=c("button"),L=c("i"),this.c=t,f(n,"rel","stylesheet"),f(n,"href","https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css"),f(i,"class","column left"),f(v,"class","send-message-text"),f(m,"class","column middle"),f(w,"type","file"),w.disabled=E=!!e[1],f(x,"class","upload-file"),h(x,"opacity",e[1]?"0.5":"0.25"),f(L,"class","bi bi-send-fill"),f(C,"type","button"),f(C,"class","send-message-button btn-info"),C.disabled=j=!e[0]?.length&&!e[1],h(C,"opacity",e[0]?.length||e[1]?"1":"0.25"),f($,"class","message-buttons"),f(b,"class","column right")},m(t,o){s(document.head,n),a(t,r,o),a(t,i,o),a(t,g,o),a(t,m,o),s(m,v),p(v,e[0]),a(t,y,o),a(t,b,o),s(b,$),s($,x),s(x,w),s(x,_),M.m(x,null),s($,k),s($,C),s(C,L),A||(D=[d(v,"input",e[5]),d(w,"change",e[6]),d(C,"click",e[7])],A=!0)},p(t,[e]){1&e&&p(v,t[0]),2&e&&E!==(E=!!t[1])&&(w.disabled=E),P!==(P=T(t))&&(M.d(1),M=P(t),M&&(M.c(),M.m(x,null))),2&e&&h(x,"opacity",t[1]?"0.5":"0.25"),3&e&&j!==(j=!t[0]?.length&&!t[1])&&(C.disabled=j),3&e&&h(C,"opacity",t[0]?.length||t[1]?"1":"0.25")},i:t,o:t,d(t){l(n),t&&l(r),t&&l(i),t&&l(g),t&&l(m),t&&l(y),t&&l(b),M.d(),A=!1,o(D)}}}function U(t,e,n){const o=y(),r=b();let i,{id:s}=e,{style:a}=e,{text:l}=e;function c(){if(!(null==l?void 0:l.length)&&!i)return console.warn("no message to send");var t,e;console.log("send message "+l),r(t="sendMessage",e={text:l,id:s,file:i}),o.dispatchEvent&&o.dispatchEvent(new CustomEvent(t,{detail:e}))}return t.$$set=t=>{"id"in t&&n(3,s=t.id),"style"in t&&n(4,a=t.style),"text"in t&&n(0,l=t.text)},t.$$.update=()=>{25&t.$$.dirty&&(s||n(3,s=""),a&&V(a),l||n(0,l=""))},[l,i,c,s,a,function(){l=this.value,n(0,l),n(3,s),n(4,a)},function(){i=this.value,n(1,i)},()=>c()]}(function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var n,o,r="";if(t&&(null==e?void 0:e.length)&&(null===(n=Object.keys(t))||void 0===n?void 0:n.length)&&(null===(o=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===o?void 0:o.length))for(var i=function(n){(null==e?void 0:e.filter((function(e){return e.name===n&&e.defaultValue!==t[n]})))&&(r+="".concat(n,":").concat(t[n],";"))},s=0,a=Object.keys(t);s<a.length;s++)i(a[s]);return r},e.addComponent=function(t){var e,n=(null===(e=null==t?void 0:t.repoName.split("/"))||void 0===e?void 0:e[1])||(null==t?void 0:t.repoName);if(!n)throw new Error("wrong componentPath "+(null==t?void 0:t.repoName));if(!(null==t?void 0:t.version))throw new Error("wrong version "+(null==t?void 0:t.version));var o=(null==t?void 0:t.iifePath)||"release/release.js";if(!document.getElementById(n+"-script"))try{var r=document.createElement("script");r.id=n+"-script",r.src="https://cdn.jsdelivr.net/npm/".concat(t.repoName,"@").concat(t.version,"/").concat(o),(null==t?void 0:t.local)&&location.href.includes("localhost")&&(r.src="".concat(t.local)),document.head.appendChild(r)}catch(t){console.warn(t)}};var n=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,n){return t.getDictionaryWord(e,this.dictionary,n||this.lang)},t.prototype.translateDate=function(e,n,o){return t.formatDate(e,n,o||this.lang)},t.getDefaultLang=function(){var t,e,n,o,r,i="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(n=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===n?void 0:n.length)&&(i=null===(r=null===(o=navigator.languages[0])||void 0===o?void 0:o.split("-")[0])||void 0===r?void 0:r.toLowerCase()),i},t.getDictionaryWord=function(e,n,o){var r;if(!e)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(o&&(null===(r=n[o])||void 0===r?void 0:r[e]))return n[o][e];var i="",s=t.getDefaultLang();if(!o||s!==o){var a=null==n?void 0:n[s];(null==a?void 0:a[e])&&(i=a[e])}return i},t.formatDate=function(e,n,o){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(o||t.getDefaultLang(),n).format(e)},t}();e.LanguageTranslator=n})(K={exports:{}},K.exports);class X extends N{constructor(t){super(),this.shadowRoot.innerHTML='<style>@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css");:host{font-family:"Roboto", sans-serif;display:block;height:100px;background-color:#eee}.column{float:left;height:100%}.left{width:140px}.right{width:180px;height:100%;display:flex;justify-content:center;align-items:center}.middle{width:calc(100% - 320px)}.message-buttons{width:100%}.upload-file{height:30px;font-size:20px;margin-left:40px}label.upload-file input[type=file]{position:fixed;top:-10000000px}.send-message-button{width:35px;height:35px;margin-left:40px;border:1px solid rgba(0, 0, 0, 0.05);outline:none;font-weight:600;border-radius:50%;padding:0;opacity:0.5;background-color:inherit}.send-message-button>i{font-size:16px;margin:0 0 0 -2px}textarea{width:100%;height:100%;background-color:white;border-radius:5px;font-size:13px;resize:vertical;outline:none;border:0px;font-family:"Roboto", sans-serif;max-height:100%;overflow-y:auto}</style>',M(this,{target:this.shadowRoot,props:g(this.attributes),customElement:!0},U,Q,i,{id:3,style:4,text:0},null),t&&(t.target&&a(t.target,this,t.anchor),t.props&&(this.$set(t.props),A()))}static get observedAttributes(){return["id","style","text"]}get id(){return this.$$.ctx[3]}set id(t){this.$$set({id:t}),A()}get style(){return this.$$.ctx[4]}set style(t){this.$$set({style:t}),A()}get text(){return this.$$.ctx[0]}set text(t){this.$$set({text:t}),A()}}return customElements.define("hb-messages-send",X),X}();
2
2
  //# sourceMappingURL=release.js.map