Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@speechly/browser-ui

Package Overview
Dependencies
Maintainers
6
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@speechly/browser-ui - npm Package Compare versions

Comparing version 5.1.0-beta.1 to 5.1.0-beta.2

2

core/intro-popup.js

@@ -1,2 +0,2 @@

!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}const e=t=>t;function n(t){return t()}function o(){return Object.create(null)}function i(t){t.forEach(n)}function r(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e}function l(t){return 0===Object.keys(t).length}const a="undefined"!=typeof window;let d=a?()=>window.performance.now():()=>Date.now(),u=a?t=>requestAnimationFrame(t):t;const p=new Set;function h(t){p.forEach((e=>{e.c(t)||(p.delete(e),e.f())})),0!==p.size&&u(h)}function f(t,e){t.appendChild(e)}function m(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function g(t,e){f(t.head||t,e)}function w(t,e,n){t.insertBefore(e,n||null)}function y(t){t.parentNode.removeChild(t)}function b(t){return document.createElement(t)}function $(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function v(t){return document.createTextNode(t)}function x(){return v(" ")}function _(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function C(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function k(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function z(t){const e={};for(const n of t)e[n.name]=n.value;return e}const E=new Set;let S,M=0;function N(t,e,n,o,i,r,s,c=0){const l=16.666/o;let a="{\n";for(let t=0;t<=1;t+=l){const o=e+(n-e)*r(t);a+=100*t+`%{${s(o,1-o)}}\n`}const d=a+`100% {${s(n,1-n)}}\n}`,u=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(d)}_${c}`,p=m(t);E.add(p);const h=p.__svelte_stylesheet||(p.__svelte_stylesheet=function(t){const e=b("style");return g(m(t),e),e}(t).sheet),f=p.__svelte_rules||(p.__svelte_rules={});f[u]||(f[u]=!0,h.insertRule(`@keyframes ${u} ${d}`,h.cssRules.length));const w=t.style.animation||"";return t.style.animation=`${w?`${w}, `:""}${u} ${o}ms linear ${i}ms 1 both`,M+=1,u}function L(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),i=n.length-o.length;i&&(t.style.animation=o.join(", "),M-=i,M||u((()=>{M||(E.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),E.clear())})))}function T(t){S=t}function A(){if(!S)throw new Error("Function called outside component initialization");return S}const P=[],D=[],R=[],j=[],B=Promise.resolve();let H=!1;function F(t){R.push(t)}let O=!1;const V=new Set;function I(){if(!O){O=!0;do{for(let t=0;t<P.length;t+=1){const e=P[t];T(e),q(e.$$)}for(T(null),P.length=0;D.length;)D.pop()();for(let t=0;t<R.length;t+=1){const e=R[t];V.has(e)||(V.add(e),e())}R.length=0}while(P.length);for(;j.length;)j.pop()();H=!1,O=!1,V.clear()}}function q(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(F)}}let G;function W(t,e,n){t.dispatchEvent(function(t,e,n=!1){const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,n,!1,e),o}(`${e?"intro":"outro"}${n}`))}const U=new Set;let J;function K(){J={r:0,c:[],p:J}}function Q(){J.r||i(J.c),J=J.p}function X(t,e){t&&t.i&&(U.delete(t),t.i(e))}function Y(t,e,n,o){if(t&&t.o){if(U.has(t))return;U.add(t),J.c.push((()=>{U.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}const Z={duration:0};function tt(n,o,s,c){let l=o(n,s),a=c?0:1,f=null,m=null,g=null;function w(){g&&L(n,g)}function y(t,e){const n=t.b-a;return e*=Math.abs(n),{a:a,b:t.b,d:n,duration:e,start:t.start,end:t.start+e,group:t.group}}function b(o){const{delay:r=0,duration:s=300,easing:c=e,tick:b=t,css:$}=l||Z,v={start:d()+r,b:o};o||(v.group=J,J.r+=1),f||m?m=v:($&&(w(),g=N(n,a,o,s,r,c,$)),o&&b(0,1),f=y(v,s),F((()=>W(n,o,"start"))),function(t){let e;0===p.size&&u(h),new Promise((n=>{p.add(e={c:t,f:n})}))}((t=>{if(m&&t>m.start&&(f=y(m,s),m=null,W(n,f.b,"start"),$&&(w(),g=N(n,a,f.b,f.duration,0,c,l.css))),f)if(t>=f.end)b(a=f.b,1-a),W(n,f.b,"end"),m||(f.b?w():--f.group.r||i(f.group.c)),f=null;else if(t>=f.start){const e=t-f.start;a=f.a+f.d*c(e/f.duration),b(a,1-a)}return!(!f&&!m)})))}return{run(t){r(l)?(G||(G=Promise.resolve(),G.then((()=>{G=null}))),G).then((()=>{l=l(),b(t)})):b(t)},end(){w(),f=m=null}}}const et="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function nt(t){t&&t.c()}function ot(t,e,o,s){const{fragment:c,on_mount:l,on_destroy:a,after_update:d}=t.$$;c&&c.m(e,o),s||F((()=>{const e=l.map(n).filter(r);a?a.push(...e):i(e),t.$$.on_mount=[]})),d.forEach(F)}function it(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function rt(t,e){-1===t.$$.dirty[0]&&(P.push(t),H||(H=!0,B.then(I)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function st(e,n,r,s,c,l,a,d=[-1]){const u=S;T(e);const p=e.$$={fragment:null,ctx:null,props:l,update:t,not_equal:c,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(u?u.$$.context:[])),callbacks:o(),dirty:d,skip_bound:!1,root:n.target||u.$$.root};a&&a(p.root);let h=!1;if(p.ctx=r?r(e,n.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return p.ctx&&c(p.ctx[t],p.ctx[t]=i)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](i),h&&rt(e,t)),n})):[],p.update(),h=!0,i(p.before_update),p.fragment=!!s&&s(p.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);p.fragment&&p.fragment.l(t),t.forEach(y)}else p.fragment&&p.fragment.c();n.intro&&X(e.$$.fragment),ot(e,n.target,n.anchor,n.customElement),I()}T(u)}let ct;"function"==typeof HTMLElement&&(ct=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){it(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){this.$$set&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});function lt(t,{delay:n=0,duration:o=400,easing:i=e}={}){const r=+getComputedStyle(t).opacity;return{delay:n,duration:o,easing:i,css:t=>"opacity: "+t*r}}var at,dt,ut,pt,ht,ft;function mt(t){!function(t,e,n){const o=m(t);if(!o.getElementById(e)){const t=b("style");t.id=e,t.textContent=n,g(o,t)}}(t,"svelte-1djrpwt",".Icon.svelte-1djrpwt{position:absolute;width:var(--icon-size);height:var(--icon-size);top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none;transition:0.25s;opacity:var(--icon-opacity)}")}function gt(t){let e,n,o,i;return{c(){e=$("svg"),n=$("g"),o=$("path"),i=$("rect"),C(o,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),C(i,"x","20"),C(i,"y","1"),C(i,"width","16"),C(i,"height","37"),C(i,"rx","8"),C(n,"fill","var(--icon-color)"),C(n,"fill-rule","evenodd"),C(e,"class","Icon svelte-1djrpwt"),C(e,"viewBox","0 0 56 56"),C(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){w(t,e,r),f(e,n),f(n,o),f(n,i)},d(t){t&&y(e)}}}function wt(t){let e,n,o,i;return{c(){e=$("svg"),n=$("g"),o=$("path"),i=$("path"),C(o,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),C(o,"fill-rule","nonzero"),C(i,"d","M37 13.081V31a8 8 0 11-16 0v-1.919l16-16zM26 1a8 8 0 018 8v1.319L18 26.318V9a8 8 0 018-8zM37.969 7.932l3.74-7.35 3.018 2.625zM39.654 10.608l7.531-3.359.695 3.94z"),C(n,"fill","var(--icon-color)"),C(n,"fill-rule","evenodd"),C(e,"class","Icon svelte-1djrpwt"),C(e,"viewBox","0 0 56 56"),C(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){w(t,e,r),f(e,n),f(n,o),f(n,i)},d(t){t&&y(e)}}}function yt(t){let e,n,o,i;return{c(){e=$("svg"),n=$("g"),o=$("path"),i=$("path"),C(o,"d","M36 14.828V30a8 8 0 01-15.961.79l15.96-15.962zM28 1a8 8 0 018 8v.172L20 25.173V9a8 8 0 018-8z"),C(i,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),C(n,"fill","var(--icon-color)"),C(n,"fill-rule","nonzero"),C(e,"class","Icon svelte-1djrpwt"),C(e,"viewBox","0 0 56 56"),C(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){w(t,e,r),f(e,n),f(n,o),f(n,i)},d(t){t&&y(e)}}}function bt(e){let n,o,i,r=e[0]===pt.Mic&&gt(),s=e[0]===pt.Error&&wt(),c=e[0]===pt.Denied&&yt();return{c(){r&&r.c(),n=x(),s&&s.c(),o=x(),c&&c.c(),i=v("")},m(t,e){r&&r.m(t,e),w(t,n,e),s&&s.m(t,e),w(t,o,e),c&&c.m(t,e),w(t,i,e)},p(t,[e]){t[0]===pt.Mic?r||(r=gt(),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null),t[0]===pt.Error?s||(s=wt(),s.c(),s.m(o.parentNode,o)):s&&(s.d(1),s=null),t[0]===pt.Denied?c||(c=yt(),c.c(),c.m(i.parentNode,i)):c&&(c.d(1),c=null)},i:t,o:t,d(t){r&&r.d(t),t&&y(n),s&&s.d(t),t&&y(o),c&&c.d(t),t&&y(i)}}}function $t(t,e,n){let{icon:o=pt.Mic}=e;return t.$$set=t=>{"icon"in t&&n(0,o=t.icon)},[o]}!function(t){t[t.Failed=0]="Failed",t[t.NoBrowserSupport=1]="NoBrowserSupport",t[t.NoAudioConsent=2]="NoAudioConsent",t[t.Disconnected=3]="Disconnected",t[t.Disconnecting=4]="Disconnecting",t[t.Connecting=5]="Connecting",t[t.Connected=6]="Connected",t[t.Starting=7]="Starting",t[t.Stopping=8]="Stopping",t[t.Recording=9]="Recording"}(at||(at={})),function(t){t.SpeechlyFirstConnect="SpeechlyFirstConnect"}(dt||(dt={})),function(t){t.speechlypoweron="speechlypoweron",t.holdstart="holdstart",t.holdend="holdend",t.speechlystarting="speechlystarting",t.speechstate="speechstate",t.initialized="initialized",t.speechsegment="speechsegment",t.speechhandled="speechhandled",t.showhint="showhint",t.transcriptdrawerhint="hint",t.speechlyintroready="speechlyintroready",t.speechlyintroclosed="speechlyintroclosed"}(ut||(ut={})),function(t){t.Mic="mic",t.Error="error",t.Denied="denied"}(pt||(pt={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(ht||(ht={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(ft||(ft={})),at.Disconnected,at.Disconnecting,at.Connecting,at.Connected,at.Starting,at.Recording,at.Stopping,at.Failed,at.NoBrowserSupport,at.NoAudioConsent;class vt extends class{$destroy(){it(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){this.$$set&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}{constructor(t){super(),st(this,t,$t,bt,s,{icon:0},mt)}}const{window:xt}=et;function _t(t){let e,n,o,i,r,s,c,l,a,d,u,p,h;const m=[Mt,St,Et,zt,kt,Ct],g=[];function $(t,e){return t[2]===Lt?0:t[2]===Tt?1:t[2]===At?2:t[2]===at.NoAudioConsent?3:t[2]===at.NoBrowserSupport?4:5}return s=$(t),c=g[s]=m[s](t),{c(){e=b("modalbg"),o=x(),i=b("modalcontent"),r=b("main"),c.c(),l=x(),a=b("footer"),a.innerHTML='Voice input is automatically transcribed by <a target="_new" href="https://speechly.com/">Speechly</a> and can be used to improve the quality of service under <a target="_new" href="https://www.speechly.com/privacy/terms-and-conditions">terms of use</a>.',C(i,"class",t[1])},m(n,c){w(n,e,c),w(n,o,c),w(n,i,c),f(i,r),g[s].m(r,null),f(i,l),f(i,a),u=!0,p||(h=_(e,"click",t[6]),p=!0)},p(t,e){let n=s;s=$(t),s===n?g[s].p(t,e):(K(),Y(g[n],1,1,(()=>{g[n]=null})),Q(),c=g[s],c?c.p(t,e):(c=g[s]=m[s](t),c.c()),X(c,1),c.m(r,null)),(!u||2&e)&&C(i,"class",t[1])},i(o){u||(F((()=>{n||(n=tt(e,t[5],{},!0)),n.run(1)})),X(c),F((()=>{d||(d=tt(i,t[5],{},!0)),d.run(1)})),u=!0)},o(o){n||(n=tt(e,t[5],{},!1)),n.run(0),Y(c),d||(d=tt(i,t[5],{},!1)),d.run(0),u=!1},d(t){t&&y(e),t&&n&&n.end(),t&&y(o),t&&y(i),g[s].d(),t&&d&&d.end(),p=!1,h()}}}function Ct(e){let n,o,i,r,s,c,l,a,d,u,p;return{c(){n=b("h2"),n.textContent="Failed to connect Speechly",o=x(),i=b("p"),r=v("Please check that Speechly application id '"),s=v(e[3]),c=v("' has been successfully deployed."),l=x(),a=b("options"),d=b("button"),d.textContent="Aww, bummer",C(d,"class","wide")},m(t,h){w(t,n,h),w(t,o,h),w(t,i,h),f(i,r),f(i,s),f(i,c),w(t,l,h),w(t,a,h),f(a,d),u||(p=_(d,"click",e[6]),u=!0)},p(t,e){8&e&&function(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}(s,t[3])},i:t,o:t,d(t){t&&y(n),t&&y(o),t&&y(i),t&&y(l),t&&y(a),u=!1,p()}}}function kt(e){let n,o,i,r,s,c,l,a;return{c(){n=b("h2"),n.textContent="Unsupported Browser",o=x(),i=b("p"),i.textContent="To use the voice interface, please visit this site using a supported\n browser.",r=x(),s=b("options"),c=b("button"),c.textContent="Got it",C(c,"class","wide")},m(t,d){w(t,n,d),w(t,o,d),w(t,i,d),w(t,r,d),w(t,s,d),f(s,c),l||(a=_(c,"click",e[6]),l=!0)},p:t,i:t,o:t,d(t){t&&y(n),t&&y(o),t&&y(i),t&&y(r),t&&y(s),l=!1,a()}}}function zt(e){let n,o,r,s,c,l,a,d,u,p,h,m;return{c(){n=b("h2"),n.textContent="Voice unavailable",o=x(),r=b("p"),r.textContent="Please reload the page to try again.",s=x(),c=b("p"),c.textContent="If that doesn't work, check your browser preferences to re-allow microphone use.",l=x(),a=b("options"),d=b("button"),d.textContent="Later",u=x(),p=b("button"),p.textContent="Reload",C(d,"class","wide"),C(p,"class","wide primary")},m(t,i){w(t,n,i),w(t,o,i),w(t,r,i),w(t,s,i),w(t,c,i),w(t,l,i),w(t,a,i),f(a,d),f(a,u),f(a,p),h||(m=[_(d,"click",e[6]),_(p,"click",e[13])],h=!0)},p:t,i:t,o:t,d(t){t&&y(n),t&&y(o),t&&y(r),t&&y(s),t&&y(c),t&&y(l),t&&y(a),h=!1,i(m)}}}function Et(e){let n,o,r,s,c,l,a,d,u,p;return{c(){n=b("h2"),n.textContent="HTTPS Required",o=x(),r=b("p"),r.textContent="To use the voice interface, please visit this site using the secure\n https:// protocol.",s=x(),c=b("options"),l=b("button"),l.textContent="Try with HTTPS",a=x(),d=b("button"),d.textContent="Later",C(l,"class","wide"),C(d,"class","wide")},m(t,i){w(t,n,i),w(t,o,i),w(t,r,i),w(t,s,i),w(t,c,i),f(c,l),f(c,a),f(c,d),u||(p=[_(l,"click",e[12]),_(d,"click",e[6])],u=!0)},p:t,i:t,o:t,d(t){t&&y(n),t&&y(o),t&&y(r),t&&y(s),t&&y(c),u=!1,i(p)}}}function St(e){let n,o,i,r,s,c,l,a,d,u,p,h,m,g,$,z;return d=new vt({}),{c(){n=b("h2"),n.innerHTML='↖ <slot name="prompt-title">Allow microphone</slot>',o=x(),i=b("p"),r=b("slot"),s=v("Please click "),c=b("b"),c.textContent="Allow",l=v(" to use the microphone.\n We'll only listen to you when you press the "),a=b("span"),nt(d.$$.fragment),u=v(" button."),p=x(),h=b("options"),m=b("button"),m.textContent="Got it",k(a,"display","inline-block"),k(a,"position","relative"),k(a,"color","white"),k(a,"width","20px"),k(a,"height","10px"),k(a,"--icon-color","white"),k(a,"--icon-size","20px"),C(r,"name","prompt-body"),C(m,"class","wide")},m(t,y){w(t,n,y),w(t,o,y),w(t,i,y),f(i,r),f(r,s),f(r,c),f(r,l),f(r,a),ot(d,a,null),f(r,u),w(t,p,y),w(t,h,y),f(h,m),g=!0,$||(z=_(m,"click",e[6]),$=!0)},p:t,i(t){g||(X(d.$$.fragment,t),g=!0)},o(t){Y(d.$$.fragment,t),g=!1},d(t){t&&y(n),t&&y(o),t&&y(i),it(d),t&&y(p),t&&y(h),$=!1,z()}}}function Mt(e){let n,o,r,s,c,l,a,d,u,p,h,m,g,$,z,E,S,M;return u=new vt({}),{c(){n=b("h2"),n.innerHTML='<slot name="prompt-title">Allow microphone</slot>',o=x(),r=b("p"),s=b("slot"),c=v("Please click "),l=b("b"),l.textContent="Allow",a=v(" to use the microphone.\n We'll only listen to you when you press the "),d=b("span"),nt(u.$$.fragment),p=v(" button."),h=x(),m=b("options"),g=b("button"),g.textContent="Later",$=x(),z=b("button"),z.textContent="Allow",k(d,"display","inline-block"),k(d,"position","relative"),k(d,"color","white"),k(d,"width","20px"),k(d,"height","10px"),k(d,"--icon-color","white"),k(d,"--icon-size","20px"),C(s,"name","welcome-body"),C(g,"class","wide"),C(z,"class","wide primary")},m(t,i){w(t,n,i),w(t,o,i),w(t,r,i),f(r,s),f(s,c),f(s,l),f(s,a),f(s,d),ot(u,d,null),f(s,p),w(t,h,i),w(t,m,i),f(m,g),f(m,$),f(m,z),E=!0,S||(M=[_(g,"click",e[6]),_(z,"click",e[7])],S=!0)},p:t,i(t){E||(X(u.$$.fragment,t),E=!0)},o(t){Y(u.$$.fragment,t),E=!1},d(t){t&&y(n),t&&y(o),t&&y(r),it(u),t&&y(h),t&&y(m),S=!1,i(M)}}}function Nt(e){let n,o,r,s,c,l,a=e[4]&&_t(e);return{c(){n=b("link"),o=x(),r=b("modal"),a&&a.c(),this.c=t,C(n,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),C(n,"rel","stylesheet"),k(r,"--remsize",e[0])},m(t,i){f(document.head,n),w(t,o,i),w(t,r,i),a&&a.m(r,null),s=!0,c||(l=[_(xt,"keydown",e[8]),_(xt,"message",e[9])],c=!0)},p(t,[e]){t[4]?a?(a.p(t,e),16&e&&X(a,1)):(a=_t(t),a.c(),X(a,1),a.m(r,null)):a&&(K(),Y(a,1,1,(()=>{a=null})),Q()),(!s||1&e)&&k(r,"--remsize",t[0])},i(t){s||(X(a),s=!0)},o(t){Y(a),s=!1},d(t){y(n),t&&y(o),t&&y(r),a&&a.d(),c=!1,i(l)}}}const Lt="PagePriming",Tt="PagePrompt",At="HttpsRequired";function Pt(t,e,n){let o,{hide:i}=e,{remsize:r="1.0rem"}=e,{position:s="fixed"}=e;const c=(()=>{const t=A();return(e,n)=>{t.dispatchEvent(new CustomEvent(e,{detail:n,composed:!0}))}})(),l=(a=lt,function(t,e){if(!t.hasOwnProperty("ownerDocument")){Object.defineProperty(t,"ownerDocument",{get:function(){return t.parentElement}});let e=t;for(;e.parentElement;)e=e.parentElement;t.parentElement.head=e}return a(t,e)});var a;let d,u=!1,p=Lt,h=null;var f;f=()=>{n(11,u=!0),window.postMessage({type:ut.speechlyintroready},"*")},A().$$.on_mount.push(f);const m=(t={})=>{n(4,o=!1),c("speechlyintroclosed",t),window.postMessage(Object.assign({type:ut.speechlyintroclosed},t),"*")},g=t=>{var e,i;(n(4,o=!0),"https:"===(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.protocol)||("localhost"===(i=window.location.hostname)||"[::1]"===i||null!==i.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)))?n(2,p=t):n(2,p=At)};return t.$$set=t=>{"hide"in t&&n(10,i=t.hide),"remsize"in t&&n(0,r=t.remsize),"position"in t&&n(1,s=t.position)},t.$$.update=()=>{3072&t.$$.dirty&&n(4,o=u&&"false"===i)},[r,s,p,d,o,l,m,()=>{window.postMessage({type:ut.speechlystarting},"*"),window.SpeechlyClient.initialize()},t=>{u&&"Escape"===t.key&&(t.preventDefault(),m())},t=>{switch(t.data.type){case ut.speechlypoweron:n(4,o=!0);break;case ut.speechlystarting:n(2,p=Tt),h=window.setTimeout((()=>{h=null,n(4,o=!0)}),500);break;case ut.holdstart:switch(t.data.state){case at.Failed:case at.NoAudioConsent:case at.NoBrowserSupport:g(t.data.state)}break;case ut.initialized:n(3,d=t.data.appId),t.data.success?h?(window.clearTimeout(h),h=null,m()):m({firstrun:!0}):g(t.data.state)}},i,u,()=>{window.location.href.replace(/^http(?!s)/,"https")},()=>{window.location.reload()}]}class Dt extends ct{constructor(t){super(),this.shadowRoot.innerHTML="<style>modal{font-size:var(--remsize);pointer-events:none;height:100%}modalbg{position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden;z-index:2000;pointer-events:auto;background-color:#000000c0;backdrop-filter:blur(3px)}modalcontent{z-index:2001;pointer-events:auto;box-sizing:border-box;width:100%;min-height:100%;padding:1.5rem 2rem;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff}modalcontent.fixed{position:fixed;top:0;left:0;right:0;bottom:0;overflow-x:hidden;overflow-y:auto}modalcontent.absolute{position:absolute;top:0;left:0;right:0;height:100vh}main{position:relative;box-sizing:border-box;width:100%;max-width:400px;margin:auto 0;padding:2rem 0}b{color:#80bbff}footer{box-sizing:border-box;font-size:85%;color:#aaa;margin:0}h2{font-family:'Saira Condensed', sans-serif;padding:0;margin:0;text-transform:uppercase;color:#fff;font-size:135%;line-height:120%}p{line-height:150%;color:#fff;font-size:1rem}options{display:block;margin-top:2.5rem}options>*{margin-left:4px}options>*:first-child{margin-left:0px}button.wide{box-sizing:border-box;min-width:9rem;max-width:100%;padding:0.60rem;border-radius:10rem;font-size:100%;border:1px solid #aaa;background-color:#fff0;transition:0.3s;color:#aaa;line-height:120%}button.wide:hover{transition:0.3s;border-color:#fff;color:#fff}button.primary{background-color:#aaa;border:0;color:#000}button.primary:hover{border:0;background-color:#ffff;transition:0.3s;color:#000}a,a:visited{color:#aaa;transition:0.3s}a:hover{color:#fff;transition:0.3s}.sidePanelLogo{width:85%;padding:0.75rem 0 0.75rem 0}@media(max-width: 480px){}@media(min-width: 480px) and (max-width: 688px){main{width:600px}}@media(min-width: 688px){main{width:600px}}</style>",st(this,{target:this.shadowRoot,props:z(this.attributes),customElement:!0},Pt,Nt,c,{hide:10,remsize:0,position:1},null),t&&(t.target&&w(t.target,this,t.anchor),t.props&&(this.$set(t.props),I()))}static get observedAttributes(){return["hide","remsize","position"]}get hide(){return this.$$.ctx[10]}set hide(t){this.$$set({hide:t}),I()}get remsize(){return this.$$.ctx[0]}set remsize(t){this.$$set({remsize:t}),I()}get position(){return this.$$.ctx[1]}set position(t){this.$$set({position:t}),I()}}customElements.get("intro-popup")?console.warn("Skipping re-defining customElement intro-popup"):customElements.define("intro-popup",Dt)}));
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}const e=t=>t;function n(t){return t()}function o(){return Object.create(null)}function i(t){t.forEach(n)}function r(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e}function l(t){return 0===Object.keys(t).length}const a="undefined"!=typeof window;let u=a?()=>window.performance.now():()=>Date.now(),d=a?t=>requestAnimationFrame(t):t;const p=new Set;function h(t){p.forEach((e=>{e.c(t)||(p.delete(e),e.f())})),0!==p.size&&d(h)}function f(t,e){t.appendChild(e)}function m(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function g(t,e){f(t.head||t,e)}function w(t,e,n){t.insertBefore(e,n||null)}function y(t){t.parentNode.removeChild(t)}function $(t){return document.createElement(t)}function b(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function v(t){return document.createTextNode(t)}function x(){return v(" ")}function _(){return v("")}function k(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function C(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function z(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function E(t,e,n){t.classList[n?"add":"remove"](e)}function S(t){const e={};for(const n of t)e[n.name]=n.value;return e}const M=new Set;let T,N=0;function L(t,e,n,o,i,r,s,c=0){const l=16.666/o;let a="{\n";for(let t=0;t<=1;t+=l){const o=e+(n-e)*r(t);a+=100*t+`%{${s(o,1-o)}}\n`}const u=a+`100% {${s(n,1-n)}}\n}`,d=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(u)}_${c}`,p=m(t);M.add(p);const h=p.__svelte_stylesheet||(p.__svelte_stylesheet=function(t){const e=$("style");return g(m(t),e),e}(t).sheet),f=p.__svelte_rules||(p.__svelte_rules={});f[d]||(f[d]=!0,h.insertRule(`@keyframes ${d} ${u}`,h.cssRules.length));const w=t.style.animation||"";return t.style.animation=`${w?`${w}, `:""}${d} ${o}ms linear ${i}ms 1 both`,N+=1,d}function A(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),i=n.length-o.length;i&&(t.style.animation=o.join(", "),N-=i,N||d((()=>{N||(M.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),M.clear())})))}function P(t){T=t}function D(){if(!T)throw new Error("Function called outside component initialization");return T}const R=[],j=[],B=[],H=[],F=Promise.resolve();let O=!1;function V(t){B.push(t)}let I=!1;const q=new Set;function G(){if(!I){I=!0;do{for(let t=0;t<R.length;t+=1){const e=R[t];P(e),W(e.$$)}for(P(null),R.length=0;j.length;)j.pop()();for(let t=0;t<B.length;t+=1){const e=B[t];q.has(e)||(q.add(e),e())}B.length=0}while(R.length);for(;H.length;)H.pop()();O=!1,I=!1,q.clear()}}function W(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(V)}}let U;function J(t,e,n){t.dispatchEvent(function(t,e,n=!1){const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,n,!1,e),o}(`${e?"intro":"outro"}${n}`))}const K=new Set;let Q;function X(){Q={r:0,c:[],p:Q}}function Y(){Q.r||i(Q.c),Q=Q.p}function Z(t,e){t&&t.i&&(K.delete(t),t.i(e))}function tt(t,e,n,o){if(t&&t.o){if(K.has(t))return;K.add(t),Q.c.push((()=>{K.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}const et={duration:0};function nt(n,o,s,c){let l=o(n,s),a=c?0:1,f=null,m=null,g=null;function w(){g&&A(n,g)}function y(t,e){const n=t.b-a;return e*=Math.abs(n),{a:a,b:t.b,d:n,duration:e,start:t.start,end:t.start+e,group:t.group}}function $(o){const{delay:r=0,duration:s=300,easing:c=e,tick:$=t,css:b}=l||et,v={start:u()+r,b:o};o||(v.group=Q,Q.r+=1),f||m?m=v:(b&&(w(),g=L(n,a,o,s,r,c,b)),o&&$(0,1),f=y(v,s),V((()=>J(n,o,"start"))),function(t){let e;0===p.size&&d(h),new Promise((n=>{p.add(e={c:t,f:n})}))}((t=>{if(m&&t>m.start&&(f=y(m,s),m=null,J(n,f.b,"start"),b&&(w(),g=L(n,a,f.b,f.duration,0,c,l.css))),f)if(t>=f.end)$(a=f.b,1-a),J(n,f.b,"end"),m||(f.b?w():--f.group.r||i(f.group.c)),f=null;else if(t>=f.start){const e=t-f.start;a=f.a+f.d*c(e/f.duration),$(a,1-a)}return!(!f&&!m)})))}return{run(t){r(l)?(U||(U=Promise.resolve(),U.then((()=>{U=null}))),U).then((()=>{l=l(),$(t)})):$(t)},end(){w(),f=m=null}}}const ot="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function it(t){t&&t.c()}function rt(t,e,o,s){const{fragment:c,on_mount:l,on_destroy:a,after_update:u}=t.$$;c&&c.m(e,o),s||V((()=>{const e=l.map(n).filter(r);a?a.push(...e):i(e),t.$$.on_mount=[]})),u.forEach(V)}function st(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ct(t,e){-1===t.$$.dirty[0]&&(R.push(t),O||(O=!0,F.then(G)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function lt(e,n,r,s,c,l,a,u=[-1]){const d=T;P(e);const p=e.$$={fragment:null,ctx:null,props:l,update:t,not_equal:c,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(d?d.$$.context:[])),callbacks:o(),dirty:u,skip_bound:!1,root:n.target||d.$$.root};a&&a(p.root);let h=!1;if(p.ctx=r?r(e,n.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return p.ctx&&c(p.ctx[t],p.ctx[t]=i)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](i),h&&ct(e,t)),n})):[],p.update(),h=!0,i(p.before_update),p.fragment=!!s&&s(p.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);p.fragment&&p.fragment.l(t),t.forEach(y)}else p.fragment&&p.fragment.c();n.intro&&Z(e.$$.fragment),rt(e,n.target,n.anchor,n.customElement),G()}P(d)}let at;"function"==typeof HTMLElement&&(at=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){st(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){this.$$set&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});function ut(t,{delay:n=0,duration:o=400,easing:i=e}={}){const r=+getComputedStyle(t).opacity;return{delay:n,duration:o,easing:i,css:t=>"opacity: "+t*r}}var dt,pt,ht,ft,mt,gt;function wt(t){!function(t,e,n){const o=m(t);if(!o.getElementById(e)){const t=$("style");t.id=e,t.textContent=n,g(o,t)}}(t,"svelte-1djrpwt",".Icon.svelte-1djrpwt{position:absolute;width:var(--icon-size);height:var(--icon-size);top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none;transition:0.25s;opacity:var(--icon-opacity)}")}function yt(t){let e,n,o,i;return{c(){e=b("svg"),n=b("g"),o=b("path"),i=b("rect"),C(o,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),C(i,"x","20"),C(i,"y","1"),C(i,"width","16"),C(i,"height","37"),C(i,"rx","8"),C(n,"fill","var(--icon-color)"),C(n,"fill-rule","evenodd"),C(e,"class","Icon svelte-1djrpwt"),C(e,"viewBox","0 0 56 56"),C(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){w(t,e,r),f(e,n),f(n,o),f(n,i)},d(t){t&&y(e)}}}function $t(t){let e,n,o,i;return{c(){e=b("svg"),n=b("g"),o=b("path"),i=b("path"),C(o,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),C(o,"fill-rule","nonzero"),C(i,"d","M37 13.081V31a8 8 0 11-16 0v-1.919l16-16zM26 1a8 8 0 018 8v1.319L18 26.318V9a8 8 0 018-8zM37.969 7.932l3.74-7.35 3.018 2.625zM39.654 10.608l7.531-3.359.695 3.94z"),C(n,"fill","var(--icon-color)"),C(n,"fill-rule","evenodd"),C(e,"class","Icon svelte-1djrpwt"),C(e,"viewBox","0 0 56 56"),C(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){w(t,e,r),f(e,n),f(n,o),f(n,i)},d(t){t&&y(e)}}}function bt(t){let e,n,o,i;return{c(){e=b("svg"),n=b("g"),o=b("path"),i=b("path"),C(o,"d","M36 14.828V30a8 8 0 01-15.961.79l15.96-15.962zM28 1a8 8 0 018 8v.172L20 25.173V9a8 8 0 018-8z"),C(i,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),C(n,"fill","var(--icon-color)"),C(n,"fill-rule","nonzero"),C(e,"class","Icon svelte-1djrpwt"),C(e,"viewBox","0 0 56 56"),C(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){w(t,e,r),f(e,n),f(n,o),f(n,i)},d(t){t&&y(e)}}}function vt(e){let n,o,i,r=e[0]===ft.Mic&&yt(),s=e[0]===ft.Error&&$t(),c=e[0]===ft.Denied&&bt();return{c(){r&&r.c(),n=x(),s&&s.c(),o=x(),c&&c.c(),i=_()},m(t,e){r&&r.m(t,e),w(t,n,e),s&&s.m(t,e),w(t,o,e),c&&c.m(t,e),w(t,i,e)},p(t,[e]){t[0]===ft.Mic?r||(r=yt(),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null),t[0]===ft.Error?s||(s=$t(),s.c(),s.m(o.parentNode,o)):s&&(s.d(1),s=null),t[0]===ft.Denied?c||(c=bt(),c.c(),c.m(i.parentNode,i)):c&&(c.d(1),c=null)},i:t,o:t,d(t){r&&r.d(t),t&&y(n),s&&s.d(t),t&&y(o),c&&c.d(t),t&&y(i)}}}function xt(t,e,n){let{icon:o=ft.Mic}=e;return t.$$set=t=>{"icon"in t&&n(0,o=t.icon)},[o]}!function(t){t[t.Failed=0]="Failed",t[t.NoBrowserSupport=1]="NoBrowserSupport",t[t.NoAudioConsent=2]="NoAudioConsent",t[t.Disconnected=3]="Disconnected",t[t.Disconnecting=4]="Disconnecting",t[t.Connecting=5]="Connecting",t[t.Connected=6]="Connected",t[t.Starting=7]="Starting",t[t.Stopping=8]="Stopping",t[t.Recording=9]="Recording"}(dt||(dt={})),function(t){t.SpeechlyFirstConnect="SpeechlyFirstConnect"}(pt||(pt={})),function(t){t.speechlypoweron="speechlypoweron",t.holdstart="holdstart",t.holdend="holdend",t.speechlystarting="speechlystarting",t.speechstate="speechstate",t.initialized="initialized",t.speechsegment="speechsegment",t.speechhandled="speechhandled",t.showhint="showhint",t.transcriptdrawerhint="hint",t.speechlyintroready="speechlyintroready",t.speechlyintroclosed="speechlyintroclosed"}(ht||(ht={})),function(t){t.Mic="mic",t.Error="error",t.Denied="denied"}(ft||(ft={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(mt||(mt={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(gt||(gt={})),dt.Disconnected,dt.Disconnecting,dt.Connecting,dt.Connected,dt.Starting,dt.Recording,dt.Stopping,dt.Failed,dt.NoBrowserSupport,dt.NoAudioConsent;class _t extends class{$destroy(){st(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){this.$$set&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}{constructor(t){super(),lt(this,t,xt,vt,s,{icon:0},wt)}}const{window:kt}=ot;function Ct(t){let e;return{c(){e=$("link"),C(e,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),C(e,"rel","stylesheet")},m(t,n){w(t,e,n)},d(t){t&&y(e)}}}function zt(t){let e;return{c(){e=$("link"),C(e,"href",t[2]),C(e,"rel","stylesheet")},m(t,n){w(t,e,n)},p(t,n){4&n&&C(e,"href",t[2])},d(t){t&&y(e)}}}function Et(t){let e,n,o,i,r,s,c,l,a,u,d,p,h;const m=[At,Lt,Nt,Tt,Mt,St],g=[];function b(t,e){return t[3]===Dt?0:t[3]===Rt?1:t[3]===jt?2:t[3]===dt.NoAudioConsent?3:t[3]===dt.NoBrowserSupport?4:5}return s=b(t),c=g[s]=m[s](t),{c(){e=$("modalbg"),o=x(),i=$("modalcontent"),r=$("main"),c.c(),l=x(),a=$("footer"),a.innerHTML='Voice input is automatically transcribed by <a target="_new" href="https://speechly.com/">Speechly</a> and can be used to improve the quality of service under <a target="_new" href="https://www.speechly.com/privacy/terms-and-conditions">terms of use</a>.',C(i,"class",t[1]),E(i,"defaultTypography",t[6])},m(n,c){w(n,e,c),w(n,o,c),w(n,i,c),f(i,r),g[s].m(r,null),f(i,l),f(i,a),d=!0,p||(h=k(e,"click",t[8]),p=!0)},p(t,e){let n=s;s=b(t),s===n?g[s].p(t,e):(X(),tt(g[n],1,1,(()=>{g[n]=null})),Y(),c=g[s],c?c.p(t,e):(c=g[s]=m[s](t),c.c()),Z(c,1),c.m(r,null)),(!d||2&e)&&C(i,"class",t[1]),66&e&&E(i,"defaultTypography",t[6])},i(o){d||(V((()=>{n||(n=nt(e,t[7],{},!0)),n.run(1)})),Z(c),V((()=>{u||(u=nt(i,t[7],{},!0)),u.run(1)})),d=!0)},o(o){n||(n=nt(e,t[7],{},!1)),n.run(0),tt(c),u||(u=nt(i,t[7],{},!1)),u.run(0),d=!1},d(t){t&&y(e),t&&n&&n.end(),t&&y(o),t&&y(i),g[s].d(),t&&u&&u.end(),p=!1,h()}}}function St(e){let n,o,i,r,s,c,l,a,u,d,p;return{c(){n=$("h2"),n.textContent="Failed to connect Speechly",o=x(),i=$("p"),r=v("Please check that Speechly application id '"),s=v(e[4]),c=v("' has been successfully deployed."),l=x(),a=$("options"),u=$("button"),u.textContent="Aww, bummer",C(u,"class","wide")},m(t,h){w(t,n,h),w(t,o,h),w(t,i,h),f(i,r),f(i,s),f(i,c),w(t,l,h),w(t,a,h),f(a,u),d||(p=k(u,"click",e[8]),d=!0)},p(t,e){16&e&&function(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}(s,t[4])},i:t,o:t,d(t){t&&y(n),t&&y(o),t&&y(i),t&&y(l),t&&y(a),d=!1,p()}}}function Mt(e){let n,o,i,r,s,c,l,a;return{c(){n=$("h2"),n.textContent="Unsupported Browser",o=x(),i=$("p"),i.textContent="To use the voice interface, please visit this site using a supported\n browser.",r=x(),s=$("options"),c=$("button"),c.textContent="Got it",C(c,"class","wide")},m(t,u){w(t,n,u),w(t,o,u),w(t,i,u),w(t,r,u),w(t,s,u),f(s,c),l||(a=k(c,"click",e[8]),l=!0)},p:t,i:t,o:t,d(t){t&&y(n),t&&y(o),t&&y(i),t&&y(r),t&&y(s),l=!1,a()}}}function Tt(e){let n,o,r,s,c,l,a,u,d,p,h,m;return{c(){n=$("h2"),n.textContent="Voice unavailable",o=x(),r=$("p"),r.textContent="Please reload the page to try again.",s=x(),c=$("p"),c.textContent="If that doesn't work, check your browser preferences to re-allow microphone use.",l=x(),a=$("options"),u=$("button"),u.textContent="Later",d=x(),p=$("button"),p.textContent="Reload",C(u,"class","wide"),C(p,"class","wide primary")},m(t,i){w(t,n,i),w(t,o,i),w(t,r,i),w(t,s,i),w(t,c,i),w(t,l,i),w(t,a,i),f(a,u),f(a,d),f(a,p),h||(m=[k(u,"click",e[8]),k(p,"click",e[16])],h=!0)},p:t,i:t,o:t,d(t){t&&y(n),t&&y(o),t&&y(r),t&&y(s),t&&y(c),t&&y(l),t&&y(a),h=!1,i(m)}}}function Nt(e){let n,o,r,s,c,l,a,u,d,p;return{c(){n=$("h2"),n.textContent="HTTPS Required",o=x(),r=$("p"),r.textContent="To use the voice interface, please visit this site using the secure\n https:// protocol.",s=x(),c=$("options"),l=$("button"),l.textContent="Try with HTTPS",a=x(),u=$("button"),u.textContent="Later",C(l,"class","wide"),C(u,"class","wide")},m(t,i){w(t,n,i),w(t,o,i),w(t,r,i),w(t,s,i),w(t,c,i),f(c,l),f(c,a),f(c,u),d||(p=[k(l,"click",e[15]),k(u,"click",e[8])],d=!0)},p:t,i:t,o:t,d(t){t&&y(n),t&&y(o),t&&y(r),t&&y(s),t&&y(c),d=!1,i(p)}}}function Lt(e){let n,o,i,r,s,c,l,a,u,d,p,h,m,g,b,_;return u=new _t({}),{c(){n=$("h2"),n.innerHTML='↖ <slot name="prompt-title">Allow microphone</slot>',o=x(),i=$("p"),r=$("slot"),s=v("Please click "),c=$("b"),c.textContent="Allow",l=v(" to use the microphone.\n We'll only listen to you when you press the "),a=$("span"),it(u.$$.fragment),d=v(" button."),p=x(),h=$("options"),m=$("button"),m.textContent="Got it",z(a,"display","inline-block"),z(a,"position","relative"),z(a,"color","white"),z(a,"width","20px"),z(a,"height","10px"),z(a,"--icon-color","white"),z(a,"--icon-size","20px"),C(r,"name","prompt-body"),C(m,"class","wide")},m(t,y){w(t,n,y),w(t,o,y),w(t,i,y),f(i,r),f(r,s),f(r,c),f(r,l),f(r,a),rt(u,a,null),f(r,d),w(t,p,y),w(t,h,y),f(h,m),g=!0,b||(_=k(m,"click",e[8]),b=!0)},p:t,i(t){g||(Z(u.$$.fragment,t),g=!0)},o(t){tt(u.$$.fragment,t),g=!1},d(t){t&&y(n),t&&y(o),t&&y(i),st(u),t&&y(p),t&&y(h),b=!1,_()}}}function At(e){let n,o,r,s,c,l,a,u,d,p,h,m,g,b,_,E,S,M;return d=new _t({}),{c(){n=$("h2"),n.innerHTML='<slot name="prompt-title">Allow microphone</slot>',o=x(),r=$("p"),s=$("slot"),c=v("Please click "),l=$("b"),l.textContent="Allow",a=v(" to use the microphone.\n We'll only listen to you when you press the "),u=$("span"),it(d.$$.fragment),p=v(" button."),h=x(),m=$("options"),g=$("button"),g.textContent="Later",b=x(),_=$("button"),_.textContent="Allow",z(u,"display","inline-block"),z(u,"position","relative"),z(u,"color","white"),z(u,"width","20px"),z(u,"height","10px"),z(u,"--icon-color","white"),z(u,"--icon-size","20px"),C(s,"name","welcome-body"),C(g,"class","wide"),C(_,"class","wide primary")},m(t,i){w(t,n,i),w(t,o,i),w(t,r,i),f(r,s),f(s,c),f(s,l),f(s,a),f(s,u),rt(d,u,null),f(s,p),w(t,h,i),w(t,m,i),f(m,g),f(m,b),f(m,_),E=!0,S||(M=[k(g,"click",e[8]),k(_,"click",e[9])],S=!0)},p:t,i(t){E||(Z(d.$$.fragment,t),E=!0)},o(t){tt(d.$$.fragment,t),E=!1},d(t){t&&y(n),t&&y(o),t&&y(r),st(d),t&&y(h),t&&y(m),S=!1,i(M)}}}function Pt(e){let n,o,r,s,c,l,a,u=e[6]&&Ct(),d=void 0!==e[2]&&zt(e),p=e[5]&&Et(e);return{c(){u&&u.c(),n=_(),o=x(),d&&d.c(),r=x(),s=$("modal"),p&&p.c(),this.c=t,z(s,"--remsize",e[0])},m(t,i){u&&u.m(document.head,null),f(document.head,n),w(t,o,i),d&&d.m(t,i),w(t,r,i),w(t,s,i),p&&p.m(s,null),c=!0,l||(a=[k(kt,"keydown",e[10]),k(kt,"message",e[11])],l=!0)},p(t,[e]){t[6]?u||(u=Ct(),u.c(),u.m(n.parentNode,n)):u&&(u.d(1),u=null),void 0!==t[2]?d?d.p(t,e):(d=zt(t),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),t[5]?p?(p.p(t,e),32&e&&Z(p,1)):(p=Et(t),p.c(),Z(p,1),p.m(s,null)):p&&(X(),tt(p,1,1,(()=>{p=null})),Y()),(!c||1&e)&&z(s,"--remsize",t[0])},i(t){c||(Z(p),c=!0)},o(t){tt(p),c=!1},d(t){u&&u.d(t),y(n),t&&y(o),d&&d.d(t),t&&y(r),t&&y(s),p&&p.d(),l=!1,i(a)}}}const Dt="PagePriming",Rt="PagePrompt",jt="HttpsRequired";function Bt(t,e,n){let o,i,{hide:r="auto"}=e,{remsize:s="1.0rem"}=e,{position:c="fixed"}=e,{customcssurl:l}=e,{customtypography:a}=e;const u=(()=>{const t=D();return(e,n)=>{t.dispatchEvent(new CustomEvent(e,{detail:n,composed:!0}))}})(),d=(p=ut,function(t,e){if(!t.hasOwnProperty("ownerDocument")){Object.defineProperty(t,"ownerDocument",{get:function(){return t.parentElement}});let e=t;for(;e.parentElement;)e=e.parentElement;t.parentElement.head=e}return p(t,e)});var p;let h,f=!1,m=Dt,g=null;var w;w=()=>{n(14,f=!0),window.postMessage({type:ht.speechlyintroready},"*")},D().$$.on_mount.push(w);const y=(t={})=>{n(5,o=!1),u("speechlyintroclosed",t),window.postMessage(Object.assign({type:ht.speechlyintroclosed},t),"*")},$=t=>{var e,i;("auto"===r&&n(5,o=!0),"https:"===(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.protocol)||("localhost"===(i=window.location.hostname)||"[::1]"===i||null!==i.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)))?n(3,m=t):n(3,m=jt)};return t.$$set=t=>{"hide"in t&&n(12,r=t.hide),"remsize"in t&&n(0,s=t.remsize),"position"in t&&n(1,c=t.position),"customcssurl"in t&&n(2,l=t.customcssurl),"customtypography"in t&&n(13,a=t.customtypography)},t.$$.update=()=>{20480&t.$$.dirty&&n(5,o=f&&"false"===r),8192&t.$$.dirty&&n(6,i=void 0===a||"false"===a)},[s,c,l,m,h,o,i,d,y,()=>{window.postMessage({type:ht.speechlystarting},"*"),window.SpeechlyClient.initialize()},t=>{f&&"Escape"===t.key&&(t.preventDefault(),y())},t=>{switch(t.data.type){case ht.speechlypoweron:"auto"===r&&n(5,o=!0);break;case ht.speechlystarting:n(3,m=Rt),g=window.setTimeout((()=>{g=null,"auto"===r&&n(5,o=!0)}),500);break;case ht.holdstart:switch(t.data.state){case dt.Failed:case dt.NoAudioConsent:case dt.NoBrowserSupport:$(t.data.state)}break;case ht.initialized:n(4,h=t.data.appId),t.data.success?g?(window.clearTimeout(g),g=null,y()):y({firstrun:!0}):$(t.data.state)}},r,a,f,()=>{window.location.href.replace(/^http(?!s)/,"https")},()=>{window.location.reload()}]}class Ht extends at{constructor(t){super(),this.shadowRoot.innerHTML="<style>modal{font-size:var(--remsize);pointer-events:none;height:100%}modalbg{position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden;z-index:2000;pointer-events:auto;background-color:#000000c0;backdrop-filter:blur(3px)}modalcontent{z-index:2001;pointer-events:auto;box-sizing:border-box;width:100%;min-height:100%;padding:1.5rem 2rem;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff}modalcontent.fixed{position:fixed;top:0;left:0;right:0;bottom:0;overflow-x:hidden;overflow-y:auto}modalcontent.absolute{position:absolute;top:0;left:0;right:0;height:100vh}.defaultTypography,.defaultTypography button{font-family:sans-serif;line-height:150%;color:#fff;font-size:1rem}.defaultTypography h2{font-family:'Saira Condensed', sans-serif;padding:0;margin:0;text-transform:uppercase;color:#fff;font-size:135%;line-height:120%}main{position:relative;box-sizing:border-box;width:100%;max-width:400px;margin:auto 0;padding:2rem 0}b{color:#80bbff}footer{box-sizing:border-box;font-size:85%;color:#aaa;margin:0}options{display:block;margin-top:2.5rem}options>*{margin-left:4px}options>*:first-child{margin-left:0px}button.wide{box-sizing:border-box;min-width:9rem;max-width:100%;padding:0.60rem;border-radius:10rem;font-size:100%;border:1px solid #aaa;background-color:#fff0;transition:0.3s;color:#aaa;line-height:120%}button.wide:hover{transition:0.3s;border-color:#fff;color:#fff}button.primary{background-color:#aaa;border:0;color:#000}button.primary:hover{border:0;background-color:#ffff;transition:0.3s;color:#000}a,a:visited{color:#aaa;transition:0.3s}a:hover{color:#fff;transition:0.3s}.sidePanelLogo{width:85%;padding:0.75rem 0 0.75rem 0}@media(max-width: 480px){}@media(min-width: 480px) and (max-width: 688px){main{width:600px}}@media(min-width: 688px){main{width:600px}}</style>",lt(this,{target:this.shadowRoot,props:S(this.attributes),customElement:!0},Bt,Pt,c,{hide:12,remsize:0,position:1,customcssurl:2,customtypography:13},null),t&&(t.target&&w(t.target,this,t.anchor),t.props&&(this.$set(t.props),G()))}static get observedAttributes(){return["hide","remsize","position","customcssurl","customtypography"]}get hide(){return this.$$.ctx[12]}set hide(t){this.$$set({hide:t}),G()}get remsize(){return this.$$.ctx[0]}set remsize(t){this.$$set({remsize:t}),G()}get position(){return this.$$.ctx[1]}set position(t){this.$$set({position:t}),G()}get customcssurl(){return this.$$.ctx[2]}set customcssurl(t){this.$$set({customcssurl:t}),G()}get customtypography(){return this.$$.ctx[13]}set customtypography(t){this.$$set({customtypography:t}),G()}}customElements.get("intro-popup")?console.warn("Skipping re-defining customElement intro-popup"):customElements.define("intro-popup",Ht)}));
//# sourceMappingURL=intro-popup.js.map
{
"name": "@speechly/browser-ui",
"version": "5.1.0-beta.1",
"version": "5.1.0-beta.2",
"scripts": {

@@ -5,0 +5,0 @@ "build": "rimraf core && rollup -c --silent && mv core/types/src/* core && rimraf core/types",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc