From abf80082e36004431f998ada488f2e0aca44442d Mon Sep 17 00:00:00 2001 From: Quan HL Date: Sat, 1 Jul 2023 17:49:46 +0700 Subject: [PATCH] remove dist --- .gitignore | 2 +- dist/webrtc-widget.js | 273 ------------------------------------------ 2 files changed, 1 insertion(+), 274 deletions(-) delete mode 100644 dist/webrtc-widget.js diff --git a/.gitignore b/.gitignore index 4d29575..2a5bc17 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ # production /build - +/dist # misc .DS_Store .env.local diff --git a/dist/webrtc-widget.js b/dist/webrtc-widget.js deleted file mode 100644 index 8c7746b..0000000 --- a/dist/webrtc-widget.js +++ /dev/null @@ -1,273 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */ -const t=window,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),s=new WeakMap;class o{constructor(t,e,s){if(this._$cssResult$=!0,s!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const i=this.t;if(e&&void 0===t){const e=void 0!==i&&1===i.length;e&&(t=s.get(i)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&s.set(i,t))}return t}toString(){return this.cssText}}const n=(t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new o(s,t,i)},r=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,i))(e)})(t):t -/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */;var l;const a=window,h=a.trustedTypes,d=h?h.emptyScript:"",c=a.reactiveElementPolyfillSupport,p={toAttribute(t,e){switch(e){case Boolean:t=t?d:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},u=(t,e)=>e!==t&&(e==e||t==t),v={attribute:!0,type:String,converter:p,reflect:!1,hasChanged:u},m="finalized";class $ extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const s=this._$Ep(i,e);void 0!==s&&(this._$Ev.set(s,i),t.push(s))})),t}static createProperty(t,e=v){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const o=this[t];this[e]=s,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||v}static finalize(){if(this.hasOwnProperty(m))return!1;this[m]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var i;const s=null!==(i=this.shadowRoot)&&void 0!==i?i:this.attachShadow(this.constructor.shadowRootOptions);return((i,s)=>{e?i.adoptedStyleSheets=s.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):s.forEach((e=>{const s=document.createElement("style"),o=t.litNonce;void 0!==o&&s.setAttribute("nonce",o),s.textContent=e.cssText,i.appendChild(s)}))})(s,this.constructor.elementStyles),s}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=v){var s;const o=this.constructor._$Ep(t,i);if(void 0!==o&&!0===i.reflect){const n=(void 0!==(null===(s=i.converter)||void 0===s?void 0:s.toAttribute)?i.converter:p).toAttribute(e,i.type);this._$El=t,null==n?this.removeAttribute(o):this.setAttribute(o,n),this._$El=null}}_$AK(t,e){var i;const s=this.constructor,o=s._$Ev.get(t);if(void 0!==o&&this._$El!==o){const t=s.getPropertyOptions(o),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:p;this._$El=o,this[o]=n.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let s=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||u)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}} -/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */ -var f;$[m]=!0,$.elementProperties=new Map,$.elementStyles=[],$.shadowRootOptions={mode:"open"},null==c||c({ReactiveElement:$}),(null!==(l=a.reactiveElementVersions)&&void 0!==l?l:a.reactiveElementVersions=[]).push("1.6.2");const g=window,b=g.trustedTypes,_=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,y="$lit$",A=`lit$${(Math.random()+"").slice(9)}$`,x="?"+A,w=`<${x}>`,E=document,S=()=>E.createComment(""),C=t=>null===t||"object"!=typeof t&&"function"!=typeof t,U=Array.isArray,k="[ \t\n\f\r]",H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,P=/-->/g,N=/>/g,T=RegExp(`>|${k}(?:([^\\s"'>=/]+)(${k}*=${k}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),O=/'/g,R=/"/g,M=/^(?:script|style|textarea|title)$/i,j=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),z=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),L=new WeakMap,B=E.createTreeWalker(E,129,null,!1),I=(t,e)=>{const i=t.length-1,s=[];let o,n=2===e?"":"",r=H;for(let e=0;e"===a[0]?(r=null!=o?o:H,h=-1):void 0===a[1]?h=-2:(h=r.lastIndex-a[2].length,l=a[1],r=void 0===a[3]?T:'"'===a[3]?R:O):r===R||r===O?r=T:r===P||r===N?r=H:(r=T,o=void 0);const c=r===T&&t[e+1].startsWith("/>")?" ":"";n+=r===H?i+w:h>=0?(s.push(l),i.slice(0,h)+y+i.slice(h)+A+c):i+A+(-2===h?(s.push(void 0),e):c)}const l=n+(t[i]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==_?_.createHTML(l):l,s]};class D{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,n=0;const r=t.length-1,l=this.parts,[a,h]=I(t,e);if(this.el=D.createElement(a,i),B.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=B.nextNode())&&l.length0){s.textContent=b?b.emptyScript:"";for(let i=0;iU(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==V&&C(this._$AH)?this._$AA.nextSibling.data=t:this.$(E.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:s}=t,o="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=D.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.v(i);else{const t=new W(o,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=L.get(t.strings);return void 0===e&&L.set(t.strings,e=new D(t)),e}T(t){U(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new q(this.k(S()),this.k(S()),this,this.options)):i=e[s],i._$AI(o),s++;s2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=V}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const o=this.strings;let n=!1;if(void 0===o)t=F(this,t,e,0),n=!C(t)||t!==this._$AH&&t!==z,n&&(this._$AH=t);else{const s=t;let r,l;for(t=o[0],r=0;r{var s,o;const n=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let r=n._$litPart$;if(void 0===r){const t=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:null;n._$litPart$=r=new q(e.insertBefore(S(),t),t,void 0,null!=i?i:{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return z}}it.finalized=!0,it._$litElement$=!0,null===(tt=globalThis.litElementHydrateSupport)||void 0===tt||tt.call(globalThis,{LitElement:it});const st=globalThis.litElementPolyfillSupport; -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */ -var ot;null==st||st({LitElement:it}),(null!==(et=globalThis.litElementVersions)&&void 0!==et?et:globalThis.litElementVersions=[]).push("3.3.2"),null===(ot=window.HTMLSlotElement)||void 0===ot||ot.prototype.assignedElements, -/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */ -console.warn("The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'. See https://lit.dev/msg/deprecated-import-path for more information.");class nt extends it{static styles=n` - .number-display { - margin: auto; - width: 200px; - padding: 20px; - border: solid 1px #333; - border-radius: 5px; - text-align: center; - font-size: 20px; - background-color: #f1f1f1; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); - } - - .number-input-container { - display: flex; - justify-content: space-between; - align-items: center; - margin-top: 10px; - } - - .number-label { - width: 20%; - text-align: right; - padding-right: 10px; - font-weight: bold; - } - - .number-input { - width: 70%; - padding: 5px; - border: none; - border-radius: 3px; - box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2); - } - - .dial-pad { - display: grid; - grid-template-columns: repeat(3, 1fr); - gap: 10px; - max-width: 200px; - margin: auto; - margin-top: 20px; - } - - .num-button, - .call-button { - padding: 10px; - background-color: #fafafa; - border: none; - border-radius: 5px; - text-align: center; - font-size: 20px; - cursor: pointer; - transition: all 0.3s ease; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - } - - .num-button:hover, - .call-button:hover { - background-color: #e1e1e1; - transform: scale(1.05); - } - - .call-button { - margin-top: 20px; - background-color: green; - color: white; - } - `;static get properties(){return{props:{type:Object},toNumber:{type:String}}}constructor(){super(),this.props={},this.toNumber="",this.sipClient=this._createSipClient()}render(){return j` -
-
- - -
-
- - -
-
- -
- ${Array(12).fill(0).map(((t,e)=>{let i;return i=9===e?"*":10===e?0:11===e?"#":e+1,j` - - `}))} -
- - - `}_createSipClient(){}_handleClick(t){this.toNumber+=t}_handleCall(){console.log("Calling..."),this.sipClient.call(this.toNumber,"121241231")}_handleInput(t){this.toNumber=t.target.value}}customElements.define("phone-element",nt);customElements.define("webrtc-widget",class extends it{static get styles(){return n` - .chat-widget-container { - position: fixed; - bottom: 20px; - right: 20px; - z-index: 1000; - display: flex; - flex-direction: column-reverse; - align-items: flex-end; - } - - .chat-icon-button { - background-color: green; - color: white; - border: none; - cursor: pointer; - border-radius: 50%; - width: 50px; - height: 50px; - font-size: 24px; - display: flex; - justify-content: center; - align-items: center; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - transition: all 0.3s ease; - z-index: 1010; /* Make sure the button is above the chat form */ - } - - .chat-icon-button:hover { - background-color: #e1e1e1; - transform: scale(1.05); - } - - .chat-icon-button:before, - .chat-icon-button:after { - content: ""; - display: block; - position: absolute; - width: 1em; - height: 1em; - top: 50%; - left: 50%; - transform-origin: center center; - text-align: center; - line-height: 1; - font-size: 24px; - } - - .chat-icon-button:before { - content: "📞"; - opacity: 1; - } - - .chat-icon-button:after { - content: "×"; - - opacity: 0; - } - - .chat-widget-container.form-visible .chat-icon-button:before { - animation: rotateHide 0.3s forwards; - } - - .chat-widget-container.form-visible .chat-icon-button:after { - animation: rotateShow 0.3s forwards; - } - - .chat-widget-container:not(.form-visible) .chat-icon-button:before { - animation: rotateShow 0.3s forwards; - } - - .chat-widget-container:not(.form-visible) .chat-icon-button:after { - animation: rotateHide 0.3s forwards; - } - - @keyframes rotateHide { - 0% { - opacity: 1; - transform: translate(-50%, -50%) rotate(0deg); - } - 50% { - opacity: 0; - transform: translate(-50%, -50%) rotate(90deg); - } - 100% { - opacity: 0; - transform: translate(-50%, -50%) rotate(180deg); - } - } - - @keyframes rotateShow { - 0% { - opacity: 0; - transform: translate(-50%, -50%) rotate(-180deg); - } - 50% { - opacity: 0; - transform: translate(-50%, -50%) rotate(-90deg); - } - 100% { - opacity: 1; - transform: translate(-50%, -50%) rotate(0deg); - } - } - - .chat-form { - position: absolute; - bottom: 60px; /* Set space between button and form to prevent overlap */ - background-color: #f1f1f1; - border-radius: 5px; - padding: 20px; - width: 250px; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - opacity: 0; - max-height: 0; - overflow: hidden; - - /* Animation styles */ - transition: opacity 0.3s ease-in-out, max-height 0.3s ease-in-out, transform 0.3s ease-in-out, width 0.3s ease-in-out; - transform-origin: bottom right; - transform: scaleX(0) scaleY(0); - background-color: var(--bg-color); - border-radius: 20px; - padding: 8px 15px; - } - - .hidden { - display: none; - } - - .chat-widget-container.form-visible .chat-form { - opacity: 1; - max-height: 500px; /* Adjust based on your desired maximum height */ - - /* Animation styles */ - transform: scaleX(1) scaleY(1); - } - `}static get properties(){return{isFormVisible:{type:Boolean}}}constructor(){super(),this.isFormVisible=!1}toggleFormVisibility(){this.isFormVisible=!this.isFormVisible}render(){return j` -
- -
- -
-
- `}});