@speechly/browser-ui
Advanced tools
Comparing version 5.1.0-beta.4 to 5.1.0-beta.5
@@ -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,e){for(const n in e)t[n]=e[n];return t}function o(t){return t()}function i(){return Object.create(null)}function r(t){t.forEach(o)}function s(t){return"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function l(t,e){return t!=t?e==e:t!==e}function a(t){return 0===Object.keys(t).length}function u(e,n,o){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const o=e.subscribe(...n);return o.unsubscribe?()=>o.unsubscribe():o}(n,o))}const d="undefined"!=typeof window;let f=d?()=>window.performance.now():()=>Date.now(),h=d?t=>requestAnimationFrame(t):t;const g=new Set;function p(t){g.forEach((e=>{e.c(t)||(g.delete(e),e.f())})),0!==g.size&&h(p)}function m(t){let e;return 0===g.size&&h(p),{promise:new Promise((n=>{g.add(e={c:t,f:n})})),abort(){g.delete(e)}}}function $(t,e){t.appendChild(e)}function y(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function b(t,e){$(t.head||t,e)}function w(t,e,n){t.insertBefore(e,n||null)}function v(t){t.parentNode.removeChild(t)}function x(t){return document.createElement(t)}function k(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function _(t){return document.createTextNode(t)}function T(){return _(" ")}function E(){return _("")}function C(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function S(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function P(t,e,n){t.classList[n?"add":"remove"](e)}function z(t){const e={};for(const n of t)e[n.name]=n.value;return e}const D=new Set;let R,F=0;function I(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}`,f=y(t);D.add(f);const h=f.__svelte_stylesheet||(f.__svelte_stylesheet=function(t){const e=x("style");return b(y(t),e),e}(t).sheet),g=f.__svelte_rules||(f.__svelte_rules={});g[d]||(g[d]=!0,h.insertRule(`@keyframes ${d} ${u}`,h.cssRules.length));const p=t.style.animation||"";return t.style.animation=`${p?`${p}, `:""}${d} ${o}ms linear ${i}ms 1 both`,F+=1,d}function N(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(", "),F-=i,F||h((()=>{F||(D.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),D.clear())})))}function A(t){R=t}function B(){if(!R)throw new Error("Function called outside component initialization");return R}const M=[],j=[],O=[],L=[],V=Promise.resolve();let H=!1;function q(t){O.push(t)}let U=!1;const W=new Set;function G(){if(!U){U=!0;do{for(let t=0;t<M.length;t+=1){const e=M[t];A(e),J(e.$$)}for(A(null),M.length=0;j.length;)j.pop()();for(let t=0;t<O.length;t+=1){const e=O[t];W.has(e)||(W.add(e),e())}O.length=0}while(M.length);for(;L.length;)L.pop()();H=!1,U=!1,W.clear()}}function J(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(q)}}let K;function Q(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 X=new Set;function Y(t,e){t&&t.i&&(X.delete(t),t.i(e))}const Z={duration:0};function tt(n,o,i){let r,c,l=o(n,i),a=!1,u=0;function d(){r&&N(n,r)}function h(){const{delay:o=0,duration:i=300,easing:s=e,tick:h=t,css:g}=l||Z;g&&(r=I(n,0,1,i,o,s,g,u++)),h(0,1);const p=f()+o,$=p+i;c&&c.abort(),a=!0,q((()=>Q(n,!0,"start"))),c=m((t=>{if(a){if(t>=$)return h(1,0),Q(n,!0,"end"),d(),a=!1;if(t>=p){const e=s((t-p)/i);h(e,1-e)}}return a}))}let g=!1;return{start(){g||(g=!0,N(n),s(l)?(l=l(),(K||(K=Promise.resolve(),K.then((()=>{K=null}))),K).then(h)):h())},invalidate(){g=!1},end(){a&&(d(),a=!1)}}}const et="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function nt(t,e,n,i){const{fragment:c,on_mount:l,on_destroy:a,after_update:u}=t.$$;c&&c.m(e,n),i||q((()=>{const e=l.map(o).filter(s);a?a.push(...e):r(e),t.$$.on_mount=[]})),u.forEach(q)}function ot(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function it(t,e){-1===t.$$.dirty[0]&&(M.push(t),H||(H=!0,V.then(G)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function rt(e,n,o,s,c,l,a,u=[-1]){const d=R;A(e);const f=e.$$={fragment:null,ctx:null,props:l,update:t,not_equal:c,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(d?d.$$.context:[])),callbacks:i(),dirty:u,skip_bound:!1,root:n.target||d.$$.root};a&&a(f.root);let h=!1;if(f.ctx=o?o(e,n.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return f.ctx&&c(f.ctx[t],f.ctx[t]=i)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](i),h&&it(e,t)),n})):[],f.update(),h=!0,r(f.before_update),f.fragment=!!s&&s(f.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);f.fragment&&f.fragment.l(t),t.forEach(v)}else f.fragment&&f.fragment.c();n.intro&&Y(e.$$.fragment),nt(e,n.target,n.anchor,n.customElement),G()}A(d)}let st;"function"==typeof HTMLElement&&(st=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(o).filter(s);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){r(this.$$.on_disconnect)}$destroy(){ot(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&&!a(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var ct,lt,at,ut,dt,ft;function ht(t){return function(e,n){if(!e.hasOwnProperty("ownerDocument")){Object.defineProperty(e,"ownerDocument",{get:function(){return e.parentElement}});let t=e;for(;t.parentElement;)t=t.parentElement;e.parentElement.head=t}return t(e,n)}}function gt(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function pt(t,{delay:e=0,speed:n,duration:o,easing:i=gt}={}){let r=t.getTotalLength();const s=getComputedStyle(t);return"butt"!==s.strokeLinecap&&(r+=parseInt(s.strokeWidth)),void 0===o?o=void 0===n?800:r/n:"function"==typeof o&&(o=o(r)),{delay:e,duration:o,easing:i,css:(t,e)=>`stroke-dasharray: ${t*r} ${e*r}`}}!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"}(ct||(ct={})),function(t){t.SpeechlyFirstConnect="SpeechlyFirstConnect"}(lt||(lt={})),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"}(at||(at={})),function(t){t.Mic="mic",t.Error="error",t.Denied="denied"}(ut||(ut={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(dt||(dt={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(ft||(ft={})),ct.Disconnected,ct.Disconnecting,ct.Connecting,ct.Connected,ct.Starting,ct.Recording,ct.Stopping,ct.Failed,ct.NoBrowserSupport,ct.NoAudioConsent;const mt=[0,1];function $t(t,e,n,o){if(e<n)return t[0];if(e>o)return t[t.length-1];let i=(o-n)/(t.length-1);if(i<=0)return t[0];let r=(e-n)/i,s=Math.floor(r),c=Math.ceil(r),l=r-s;return(1-l)*t[s]+l*t[c]}function yt(t){!function(t,e,n){const o=y(t);if(!o.getElementById(e)){const t=x("style");t.id=e,t.textContent=n,b(o,t)}}(t,"svelte-1fz8oog","canvas.svelte-1fz8oog{display:block;width:1.35rem;height:1.5rem;margin:0;padding:0 0.8rem 0 0rem;flex-grow:0;flex-shrink:0;flex-basis:1.35rem}")}function bt(e){let n;return{c(){n=x("canvas"),S(n,"color",e[0]),S(n,"display","block"),S(n,"width","1.35rem"),S(n,"height","1.5rem"),S(n,"margin","0"),S(n,"padding","0 0.8rem 0 0rem"),S(n,"flex-grow","0"),S(n,"flex-shrink","0"),S(n,"flex-basis","1.35rem"),C(n,"class","svelte-1fz8oog")},m(t,o){w(t,n,o),e[3](n)},p(t,[e]){1&e&&S(n,"color",t[0])},i:t,o:t,d(t){t&&v(n),e[3](null)}}}function wt(t,e,n){let{color:o="#60e0ff"}=e;const i=(t,e)=>{s=Date.now()>c?t:Math.max(s,t),c=Date.now()+e};let r,s=0,c=0,l=[0,0];const a=(t,e,n,o,i,r)=>{o<2*r&&(r=o/2),i<2*r&&(r=i/2),t.beginPath(),t.moveTo(e+r,n),t.arcTo(e+o,n,e+o,n+i,r),t.arcTo(e+o,n+i,e,n+i,r),t.arcTo(e,n+i,e,n,r),t.arcTo(e,n,e+o,n,r),t.closePath()};var u;return u=()=>{let t;const e=2*(l.length-1)+1,o=3*e+1*(e-1),u=()=>{if(t=requestAnimationFrame(u),!r)return;const e=r.getContext("2d");if(!e)return;let i=(t=>{var e=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/e})(e),d=Number.parseInt(getComputedStyle(r).getPropertyValue("width").slice(0,-2)),f=Number.parseInt(getComputedStyle(r).getPropertyValue("height").slice(0,-2));n(1,r.width=d*i,r),n(1,r.height=f*i,r),Date.now()<c?l[0]=.15*s+.85*l[0]:l[0]=.0625+.75*l[0];let h=1;for(;h<l.length;)l[h]=.25*l[h-1]+.5*l[h]+.0625,h++;e.clearRect(0,0,r.width,r.height);const g=3/o*r.width*.5,p=4/o*r.width;for(e.fillStyle=r.style.color||"#000000",h=0;h<l.length;h++){const t=l[h]*r.height;t*r.height>2*g?a(e,.5*r.width-g+h*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width+h*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill(),h>0&&(t*r.height>2*g?a(e,.5*r.width-g-h*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width-h*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill())}};return u(),i(1,500),()=>{cancelAnimationFrame(t)}},B().$$.on_mount.push(u),t.$$set=t=>{"color"in t&&n(0,o=t.color)},[o,r,i,function(t){j[t?"unshift":"push"]((()=>{r=t,n(1,r)}))}]}class vt extends class{$destroy(){ot(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&&!a(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}{constructor(t){super(),rt(this,t,wt,bt,c,{color:0,updateVU:2},yt)}get updateVU(){return this.$$.ctx[2]}}const xt=[];function kt(t){return"[object Date]"===Object.prototype.toString.call(t)}function _t(t,e){if(t===e||t!=t)return()=>t;const n=typeof t;if(n!==typeof e||Array.isArray(t)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const n=e.map(((e,n)=>_t(t[n],e)));return t=>n.map((e=>e(t)))}if("object"===n){if(!t||!e)throw new Error("Object cannot be null");if(kt(t)&&kt(e)){t=t.getTime();const n=(e=e.getTime())-t;return e=>new Date(t+e*n)}const n=Object.keys(e),o={};return n.forEach((n=>{o[n]=_t(t[n],e[n])})),t=>{const e={};return n.forEach((n=>{e[n]=o[n](t)})),e}}if("number"===n){const n=e-t;return e=>t+e*n}throw new Error(`Cannot interpolate ${n} values`)}function Tt(o,i={}){const r=function(e,n=t){let o;const i=new Set;function r(t){if(c(e,t)&&(e=t,o)){const t=!xt.length;for(const t of i)t[1](),xt.push(t,e);if(t){for(let t=0;t<xt.length;t+=2)xt[t][0](xt[t+1]);xt.length=0}}}return{set:r,update:function(t){r(t(e))},subscribe:function(s,c=t){const l=[s,c];return i.add(l),1===i.size&&(o=n(r)||t),s(e),()=>{i.delete(l),0===i.size&&(o(),o=null)}}}}(o);let s,l=o;function a(t,c){if(null==o)return r.set(o=t),Promise.resolve();l=t;let a=s,u=!1,{delay:d=0,duration:h=400,easing:g=e,interpolate:p=_t}=n(n({},i),c);if(0===h)return a&&(a.abort(),a=null),r.set(o=l),Promise.resolve();const $=f()+d;let y;return s=m((e=>{if(e<$)return!0;u||(y=p(o,t),"function"==typeof h&&(h=h(o,t)),u=!0),a&&(a.abort(),a=null);const n=e-$;return n>h?(r.set(o=t),!1):(r.set(o=y(g(n/h))),!0)})),s.promise}return{set:a,update:(t,e)=>a(t(l,o),e),subscribe:r.subscribe}}const{window:Et}=et;function Ct(t,e,n){const o=t.slice();return o[42]=e[n],o[44]=n,o}function St(t){let e;return{c(){e=x("div"),C(e,"class","TransscriptItemBgDiv")},m(t,n){w(t,e,n)},d(t){t&&v(e)}}}function Pt(e){let n,o;return{c(){n=x("div"),n.textContent="Listening...",C(n,"class","listening")},m(t,e){w(t,n,e)},i(t){o||q((()=>{o=tt(n,e[21],{duration:400}),o.start()}))},o:t,d(t){t&&v(n)}}}function zt(e){let n,o;return{c(){n=x("div"),C(n,"class","TransscriptItemBgDiv")},m(t,e){w(t,n,e)},p(t,n){e=t},i(t){o||q((()=>{o=tt(n,e[21],{duration:e[14]}),o.start()}))},o:t,d(t){t&&v(n)}}}function Dt(t){let e,n;return{c(){e=x("span"),C(e,"style",n=t[44]<t[11].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")},m(t,n){w(t,e,n)},p(t,o){10240&o[0]&&n!==(n=t[44]<t[11].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")&&C(e,"style",n)},d(t){t&&v(e)}}}function Rt(e){let n,o,i,r,s,c,l,a=e[42].word+"",u=e[16]&&zt(e),d=e[44]<e[11].length&&Dt(e);return{c(){n=x("div"),u&&u.c(),o=T(),i=x("div"),r=_(a),s=T(),d&&d.c(),C(i,"class","TransscriptItemContent"),C(n,"class",l="TranscriptItem "+e[23](e[42])),P(n,"Entity",null!==e[42].entityType),P(n,"Final",e[42].isFinal)},m(t,e){w(t,n,e),u&&u.m(n,null),$(n,o),$(n,i),$(i,r),$(i,s),d&&d.m(i,null)},p(t,s){(e=t)[16]?u?65536&s[0]&&Y(u,1):(u=zt(e),u.c(),Y(u,1),u.m(n,o)):u&&(u.d(1),u=null),2048&s[0]&&a!==(a=e[42].word+"")&&function(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}(r,a),e[44]<e[11].length?d?d.p(e,s):(d=Dt(e),d.c(),d.m(i,null)):d&&(d.d(1),d=null),2048&s[0]&&l!==(l="TranscriptItem "+e[23](e[42]))&&C(n,"class",l),2048&s[0]&&P(n,"Entity",null!==e[42].entityType),2048&s[0]&&P(n,"Final",e[42].isFinal)},i(t){Y(u),c||q((()=>{c=tt(i,e[21],{duration:e[14]}),c.start()}))},o:t,d(t){t&&v(n),u&&u.d(),d&&d.d()}}}function Ft(e){let n,o,i,r,s,c,l,a;return{c(){n=x("div"),o=x("div"),i=T(),r=x("div"),s=k("svg"),c=k("path"),C(o,"class","TransscriptItemBgDiv"),S(o,"background-color",e[5]),C(c,"stroke","currentColor"),C(c,"stroke-width","3"),C(c,"d","M7.191 11.444l4.059 6.107 7.376-12.949"),C(c,"fill","none"),C(c,"fill-rule","evenodd"),S(s,"width","2rem"),S(s,"height","2rem"),S(s,"position","absolute"),S(s,"transform","translate(-0.6rem, -0.5rem)"),S(s,"stroke","#eee"),C(s,"viewBox","0 0 24 24"),C(s,"xmlns","http://www.w3.org/2000/svg"),S(r,"width","1.0rem"),S(r,"height","1rem"),S(r,"position","relative"),C(n,"class","TranscriptItem")},m(t,e){w(t,n,e),$(n,o),$(n,i),$(n,r),$(r,s),$(s,c)},p(t,e){32&e[0]&&S(o,"background-color",t[5])},i(t){l||q((()=>{l=tt(c,e[20],{duration:500}),l.start()})),a||q((()=>{a=tt(n,e[21],{duration:200,maxWidth:3}),a.start()}))},o:t,d(t){t&&v(n)}}}function It(t){let e;return{c(){e=x("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&&v(e)}}}function Nt(t){let e;return{c(){e=x("link"),C(e,"href",t[10]),C(e,"rel","stylesheet")},m(t,n){w(t,e,n)},p(t,n){1024&n[0]&&C(e,"href",t[10])},d(t){t&&v(e)}}}function At(e){let n,o,i,r,s,c,l,a,u,d,f,h,g,p,m,y=e[16]&&St(),b={color:e[5]};s=new vt({props:b}),e[34](s);let k=e[17]&&Pt(e),_=e[11],z=[];for(let t=0;t<_.length;t+=1)z[t]=Rt(Ct(e,_,t));let D=e[13]&&Ft(e),R=e[15]&&It(),F=void 0!==e[10]&&Nt(e);return{c(){var g;n=x("main"),o=x("div"),y&&y.c(),i=T(),r=x("div"),(g=s.$$.fragment)&&g.c(),c=T(),k&&k.c(),l=T();for(let t=0;t<z.length;t+=1)z[t].c();a=T(),D&&D.c(),u=T(),R&&R.c(),d=E(),f=T(),F&&F.c(),h=E(),this.c=t,C(r,"class","TransscriptItemContent"),C(o,"class","TranscriptItem"),C(n,"class","BigTranscript"),S(n,"--voffset",e[1]),S(n,"--hoffset",e[2]),S(n,"--fontsize",e[3]),S(n,"--color",e[4]),S(n,"--highlight-color",e[5]),S(n,"--text-bg-color",e[6]),S(n,"--gradient-stop1",e[7]),S(n,"--gradient-stop2",e[8]),S(n,"--marginbottom",e[9]),S(n,"--transition",e[18].transition),S(n,"opacity",e[18].transition),S(n,"max-height",10*$t(mt,e[18].transition,0,.6)+"rem"),S(n,"visibility",0!==e[18].transition?"visible":"hidden"),P(n,"placementTop","top"===e[0]),P(n,"defaultTypography",e[15])},m(t,b){w(t,n,b),$(n,o),y&&y.m(o,null),$(o,i),$(o,r),nt(s,r,null),$(r,c),k&&k.m(r,null),$(n,l);for(let t=0;t<z.length;t+=1)z[t].m(n,null);var v,x,_,T;$(n,a),D&&D.m(n,null),w(t,u,b),R&&R.m(document.head,null),$(document.head,d),w(t,f,b),F&&F.m(t,b),w(t,h,b),g=!0,p||(v=Et,x="message",_=e[22],v.addEventListener(x,_,T),m=()=>v.removeEventListener(x,_,T),p=!0)},p(t,e){t[16]?y||(y=St(),y.c(),y.m(o,i)):y&&(y.d(1),y=null);const c={};if(32&e[0]&&(c.color=t[5]),s.$set(c),t[17]?k?131072&e[0]&&Y(k,1):(k=Pt(t),k.c(),Y(k,1),k.m(r,null)):k&&(k.d(1),k=null),8464384&e[0]){let o;for(_=t[11],o=0;o<_.length;o+=1){const i=Ct(t,_,o);z[o]?(z[o].p(i,e),Y(z[o],1)):(z[o]=Rt(i),z[o].c(),Y(z[o],1),z[o].m(n,a))}for(;o<z.length;o+=1)z[o].d(1);z.length=_.length}t[13]?D?(D.p(t,e),8192&e[0]&&Y(D,1)):(D=Ft(t),D.c(),Y(D,1),D.m(n,null)):D&&(D.d(1),D=null),(!g||2&e[0])&&S(n,"--voffset",t[1]),(!g||4&e[0])&&S(n,"--hoffset",t[2]),(!g||8&e[0])&&S(n,"--fontsize",t[3]),(!g||16&e[0])&&S(n,"--color",t[4]),(!g||32&e[0])&&S(n,"--highlight-color",t[5]),(!g||64&e[0])&&S(n,"--text-bg-color",t[6]),(!g||128&e[0])&&S(n,"--gradient-stop1",t[7]),(!g||256&e[0])&&S(n,"--gradient-stop2",t[8]),(!g||512&e[0])&&S(n,"--marginbottom",t[9]),(!g||262144&e[0])&&S(n,"--transition",t[18].transition),(!g||262144&e[0])&&S(n,"opacity",t[18].transition),(!g||262144&e[0])&&S(n,"max-height",10*$t(mt,t[18].transition,0,.6)+"rem"),(!g||262144&e[0])&&S(n,"visibility",0!==t[18].transition?"visible":"hidden"),1&e[0]&&P(n,"placementTop","top"===t[0]),32768&e[0]&&P(n,"defaultTypography",t[15]),t[15]?R||(R=It(),R.c(),R.m(d.parentNode,d)):R&&(R.d(1),R=null),void 0!==t[10]?F?F.p(t,e):(F=Nt(t),F.c(),F.m(h.parentNode,h)):F&&(F.d(1),F=null)},i(t){if(!g){Y(s.$$.fragment,t),Y(k);for(let t=0;t<_.length;t+=1)Y(z[t]);Y(D),g=!0}},o(t){!function(t,e,n,o){if(t&&t.o){if(X.has(t))return;X.add(t),(void 0).c.push((()=>{X.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}(s.$$.fragment,t),g=!1},d(t){t&&v(n),y&&y.d(),e[34](null),ot(s),k&&k.d(),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(z,t),D&&D.d(),t&&v(u),R&&R.d(t),v(d),t&&v(f),F&&F.d(t),t&&v(h),p=!1,m()}}}function Bt(t,e,n){let o,i,r,s,c,l,a,d,{placement:f}=e,{voffset:h="3rem"}=e,{hoffset:g="2rem"}=e,{fontsize:p="1.5rem"}=e,{color:m="#ffffff"}=e,{highlightcolor:$="#15e8b5"}=e,{backgroundcolor:y="#202020"}=e,{gradientstop1:b="#ffffff88"}=e,{gradientstop2:w="#ffffffcc"}=e,{marginbottom:v="0rem"}=e,{formattext:x}=e,{demomode:k}=e,{customcssurl:_}=e,{customtypography:T}=e,E=[],C=null,S=null,P=ct.Disconnected,z=!1,D=!1,R=!1,F=Tt({transition:0},{duration:200});u(t,F,(t=>n(18,a=t)));const I=B(),N=ht(pt),A=ht(((t,{delay:e=0,duration:n=350,maxWidth:o=10})=>({delay:e,duration:n,css:t=>`\n max-width: ${$t(mt,t,0,1)*o}rem;\n `}))),M=t=>{n(13,R=R||t)},O=t=>{n(30,P=t),P===ct.Recording&&(n(13,R=!1),n(11,E=[]),S=null)},L=t=>{if(void 0===t)return;d&&(s||P===ct.Recording)&&d.updateVU(.5*Math.random()+.5,75*Math.random()+75),t.isFinal?V(E.length>0?s?3500:2e3:0):E.length>0&&(z||n(31,z=!0),V(2e3));const e=`${t.contextId}/${t.id}`;null!==S?S!==e&&(n(13,R=!1),S=e):S=e,n(11,E=[]),t.words.forEach((t=>{n(11,E[t.index]={word:t.value,serialNumber:t.index,entityType:null,isFinal:t.isFinal,hide:!1},E)})),r?t.entities.forEach((t=>{n(11,E[t.startPosition].word=t.value,E),n(11,E[t.startPosition].entityType=t.type,E),n(11,E[t.startPosition].isFinal=t.isFinal,E),n(11,E[t.startPosition].hide=!1,E);for(let e=t.startPosition+1;e<t.endPosition;e++)E[e]&&n(11,E[e].hide=!0,E)})):t.entities.forEach((t=>{for(let e=t.startPosition;e<t.endPosition;e++)E[e]&&(n(11,E[e].entityType=t.type,E),n(11,E[e].isFinal=t.isFinal,E))})),n(11,E=E.filter((t=>!t.hide)))},V=(t=0)=>{H(),C=window.setTimeout((()=>{C=null,z&&n(31,z=!1)}),t)},H=()=>{null!==C&&(window.clearTimeout(C),C=null)};return t.$$set=t=>{"placement"in t&&n(0,f=t.placement),"voffset"in t&&n(1,h=t.voffset),"hoffset"in t&&n(2,g=t.hoffset),"fontsize"in t&&n(3,p=t.fontsize),"color"in t&&n(4,m=t.color),"highlightcolor"in t&&n(5,$=t.highlightcolor),"backgroundcolor"in t&&n(6,y=t.backgroundcolor),"gradientstop1"in t&&n(7,b=t.gradientstop1),"gradientstop2"in t&&n(8,w=t.gradientstop2),"marginbottom"in t&&n(9,v=t.marginbottom),"formattext"in t&&n(24,x=t.formattext),"demomode"in t&&n(25,k=t.demomode),"customcssurl"in t&&n(10,_=t.customcssurl),"customtypography"in t&&n(26,T=t.customtypography)},t.$$.update=()=>{if(2048&t.$$.dirty[0]&&n(17,o=0===E.length),64&t.$$.dirty[0]&&n(16,i="none"!==y),16777216&t.$$.dirty[0]&&(r=void 0===x||"false"!==x),33554432&t.$$.dirty[0]&&n(33,s=void 0!==k&&"false"!==k),67108864&t.$$.dirty[0]&&n(15,c=void 0===T||"false"===T),4&t.$$.dirty[1]&&n(14,l=s?800:350),1073741824&t.$$.dirty[0]|3&t.$$.dirty[1]){const t=P===ct.Recording||z;t!==D&&(e="visibilitychanged",a=t,I.dispatchEvent(new CustomEvent(e,{detail:a,composed:!0}))),n(32,D=t),F.set({transition:D?1:0})}var e,a;4&t.$$.dirty[1]&&(s||V(0))},[f,h,g,p,m,$,y,b,w,v,_,E,d,R,l,c,i,o,a,F,N,A,t=>{switch(t.data.type){case at.speechsegment:L(t.data.segment);break;case at.speechhandled:M(t.data.success);break;case at.speechstate:O(t.data.state)}},t=>t.entityType||"",x,k,T,M,O,L,P,z,D,s,function(t){j[t?"unshift":"push"]((()=>{d=t,n(12,d)}))}]}class Mt extends st{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{position:relative;user-select:none;display:flex;flex-direction:row;justify-content:start;flex-wrap:wrap;margin-bottom:calc(var(--marginbottom) * var(--transition))}.defaultTypography{font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--color);font-size:var(--fontsize);line-height:135%}.TranscriptItem{position:relative;display:flex;flex-direction:row;align-items:center}.Entity{color:var(--highlight-color)}.TransscriptItemContent{z-index:1;display:flex;flex-wrap:nowrap;flex-direction:row;align-items:center;overflow:hidden;white-space:nowrap}.TransscriptItemBgDiv{position:absolute;box-sizing:content-box;width:100%;height:100%;top:-0.2rem;left:-0.8rem;margin:0;padding:0.2rem 0.8rem;background-color:var(--text-bg-color);z-index:-1}.placementTop{position:fixed;top:0;left:0;right:0;bottom:0;margin:var(--voffset) var(--hoffset) 0 var(--hoffset);z-index:50;pointer-events:none}.listening{animation:flow 1s linear infinite;background:linear-gradient(-60deg, var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1));background-size:200%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;-webkit-box-decoration-break:clone}@keyframes flow{0%{background-position:100% 50%}100%{background-position:0% 50%}}</style>",rt(this,{target:this.shadowRoot,props:z(this.attributes),customElement:!0},Bt,At,l,{placement:0,voffset:1,hoffset:2,fontsize:3,color:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,marginbottom:9,formattext:24,demomode:25,customcssurl:10,customtypography:26,speechhandled:27,speechstate:28,speechsegment:29},null,[-1,-1]),t&&(t.target&&w(t.target,this,t.anchor),t.props&&(this.$set(t.props),G()))}static get observedAttributes(){return["placement","voffset","hoffset","fontsize","color","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","marginbottom","formattext","demomode","customcssurl","customtypography","speechhandled","speechstate","speechsegment"]}get placement(){return this.$$.ctx[0]}set placement(t){this.$$set({placement:t}),G()}get voffset(){return this.$$.ctx[1]}set voffset(t){this.$$set({voffset:t}),G()}get hoffset(){return this.$$.ctx[2]}set hoffset(t){this.$$set({hoffset:t}),G()}get fontsize(){return this.$$.ctx[3]}set fontsize(t){this.$$set({fontsize:t}),G()}get color(){return this.$$.ctx[4]}set color(t){this.$$set({color:t}),G()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$$set({highlightcolor:t}),G()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),G()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$$set({gradientstop1:t}),G()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$$set({gradientstop2:t}),G()}get marginbottom(){return this.$$.ctx[9]}set marginbottom(t){this.$$set({marginbottom:t}),G()}get formattext(){return this.$$.ctx[24]}set formattext(t){this.$$set({formattext:t}),G()}get demomode(){return this.$$.ctx[25]}set demomode(t){this.$$set({demomode:t}),G()}get customcssurl(){return this.$$.ctx[10]}set customcssurl(t){this.$$set({customcssurl:t}),G()}get customtypography(){return this.$$.ctx[26]}set customtypography(t){this.$$set({customtypography:t}),G()}get speechhandled(){return this.$$.ctx[27]}get speechstate(){return this.$$.ctx[28]}get speechsegment(){return this.$$.ctx[29]}}customElements.get("big-transcript")?console.warn("Skipping re-defining customElement big-transcript"):customElements.define("big-transcript",Mt)})); | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}const e=t=>t;function n(t,e){for(const n in e)t[n]=e[n];return t}function o(t){return t()}function i(){return Object.create(null)}function r(t){t.forEach(o)}function s(t){return"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function l(t,e){return t!=t?e==e:t!==e}function a(t){return 0===Object.keys(t).length}function u(e,n,o){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const o=e.subscribe(...n);return o.unsubscribe?()=>o.unsubscribe():o}(n,o))}const d="undefined"!=typeof window;let f=d?()=>window.performance.now():()=>Date.now(),h=d?t=>requestAnimationFrame(t):t;const g=new Set;function p(t){g.forEach((e=>{e.c(t)||(g.delete(e),e.f())})),0!==g.size&&h(p)}function m(t){let e;return 0===g.size&&h(p),{promise:new Promise((n=>{g.add(e={c:t,f:n})})),abort(){g.delete(e)}}}function $(t,e){t.appendChild(e)}function y(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function b(t,e){$(t.head||t,e)}function w(t,e,n){t.insertBefore(e,n||null)}function v(t){t.parentNode.removeChild(t)}function x(t){return document.createElement(t)}function k(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function _(t){return document.createTextNode(t)}function T(){return _(" ")}function E(){return _("")}function C(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function S(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function P(t,e,n){t.classList[n?"add":"remove"](e)}function z(t){const e={};for(const n of t)e[n.name]=n.value;return e}const D=new Set;let R,F=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 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}`,f=y(t);D.add(f);const h=f.__svelte_stylesheet||(f.__svelte_stylesheet=function(t){const e=x("style");return b(y(t),e),e}(t).sheet),g=f.__svelte_rules||(f.__svelte_rules={});g[d]||(g[d]=!0,h.insertRule(`@keyframes ${d} ${u}`,h.cssRules.length));const p=t.style.animation||"";return t.style.animation=`${p?`${p}, `:""}${d} ${o}ms linear ${i}ms 1 both`,F+=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(", "),F-=i,F||h((()=>{F||(D.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),D.clear())})))}function I(t){R=t}function B(){if(!R)throw new Error("Function called outside component initialization");return R}const M=[],j=[],O=[],L=[],V=Promise.resolve();let H=!1;function W(t){O.push(t)}let q=!1;const U=new Set;function G(){if(!q){q=!0;do{for(let t=0;t<M.length;t+=1){const e=M[t];I(e),J(e.$$)}for(I(null),M.length=0;j.length;)j.pop()();for(let t=0;t<O.length;t+=1){const e=O[t];U.has(e)||(U.add(e),e())}O.length=0}while(M.length);for(;L.length;)L.pop()();H=!1,q=!1,U.clear()}}function J(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(W)}}let K;function Q(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 X=new Set;function Y(t,e){t&&t.i&&(X.delete(t),t.i(e))}const Z={duration:0};function tt(n,o,i){let r,c,l=o(n,i),a=!1,u=0;function d(){r&&A(n,r)}function h(){const{delay:o=0,duration:i=300,easing:s=e,tick:h=t,css:g}=l||Z;g&&(r=N(n,0,1,i,o,s,g,u++)),h(0,1);const p=f()+o,$=p+i;c&&c.abort(),a=!0,W((()=>Q(n,!0,"start"))),c=m((t=>{if(a){if(t>=$)return h(1,0),Q(n,!0,"end"),d(),a=!1;if(t>=p){const e=s((t-p)/i);h(e,1-e)}}return a}))}let g=!1;return{start(){g||(g=!0,A(n),s(l)?(l=l(),(K||(K=Promise.resolve(),K.then((()=>{K=null}))),K).then(h)):h())},invalidate(){g=!1},end(){a&&(d(),a=!1)}}}const et="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function nt(t,e,n,i){const{fragment:c,on_mount:l,on_destroy:a,after_update:u}=t.$$;c&&c.m(e,n),i||W((()=>{const e=l.map(o).filter(s);a?a.push(...e):r(e),t.$$.on_mount=[]})),u.forEach(W)}function ot(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function it(t,e){-1===t.$$.dirty[0]&&(M.push(t),H||(H=!0,V.then(G)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function rt(e,n,o,s,c,l,a,u=[-1]){const d=R;I(e);const f=e.$$={fragment:null,ctx:null,props:l,update:t,not_equal:c,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(d?d.$$.context:[])),callbacks:i(),dirty:u,skip_bound:!1,root:n.target||d.$$.root};a&&a(f.root);let h=!1;if(f.ctx=o?o(e,n.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return f.ctx&&c(f.ctx[t],f.ctx[t]=i)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](i),h&&it(e,t)),n})):[],f.update(),h=!0,r(f.before_update),f.fragment=!!s&&s(f.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);f.fragment&&f.fragment.l(t),t.forEach(v)}else f.fragment&&f.fragment.c();n.intro&&Y(e.$$.fragment),nt(e,n.target,n.anchor,n.customElement),G()}I(d)}let st;"function"==typeof HTMLElement&&(st=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(o).filter(s);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){r(this.$$.on_disconnect)}$destroy(){ot(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&&!a(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var ct,lt,at,ut,dt,ft,ht;function gt(t){return function(e,n){if(!e.hasOwnProperty("ownerDocument")){Object.defineProperty(e,"ownerDocument",{get:function(){return e.parentElement}});let t=e;for(;t.parentElement;)t=t.parentElement;e.parentElement.head=t}return t(e,n)}}function pt(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function mt(t,{delay:e=0,speed:n,duration:o,easing:i=pt}={}){let r=t.getTotalLength();const s=getComputedStyle(t);return"butt"!==s.strokeLinecap&&(r+=parseInt(s.strokeWidth)),void 0===o?o=void 0===n?800:r/n:"function"==typeof o&&(o=o(r)),{delay:e,duration:o,easing:i,css:(t,e)=>`stroke-dasharray: ${t*r} ${e*r}`}}!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"}(ct||(ct={})),function(t){t.SpeechlyFirstConnect="SpeechlyFirstConnect"}(lt||(lt={})),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"}(at||(at={})),function(t){t.Mic="mic",t.MicActive="micactive",t.Error="error",t.Denied="denied"}(ut||(ut={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(dt||(dt={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(ft||(ft={})),function(t){t.None="none",t.Whirl="whirl"}(ht||(ht={})),ct.Disconnected,ct.Disconnecting,ct.Connecting,ct.Connected,ct.Starting,ct.Recording,ct.Stopping,ct.Failed,ct.NoBrowserSupport,ct.NoAudioConsent;const $t=[0,1];function yt(t,e,n,o){if(e<n)return t[0];if(e>o)return t[t.length-1];let i=(o-n)/(t.length-1);if(i<=0)return t[0];let r=(e-n)/i,s=Math.floor(r),c=Math.ceil(r),l=r-s;return(1-l)*t[s]+l*t[c]}function bt(t){!function(t,e,n){const o=y(t);if(!o.getElementById(e)){const t=x("style");t.id=e,t.textContent=n,b(o,t)}}(t,"svelte-1fz8oog","canvas.svelte-1fz8oog{display:block;width:1.35rem;height:1.5rem;margin:0;padding:0 0.8rem 0 0rem;flex-grow:0;flex-shrink:0;flex-basis:1.35rem}")}function wt(e){let n;return{c(){n=x("canvas"),S(n,"color",e[0]),S(n,"display","block"),S(n,"width","1.35rem"),S(n,"height","1.5rem"),S(n,"margin","0"),S(n,"padding","0 0.8rem 0 0rem"),S(n,"flex-grow","0"),S(n,"flex-shrink","0"),S(n,"flex-basis","1.35rem"),C(n,"class","svelte-1fz8oog")},m(t,o){w(t,n,o),e[3](n)},p(t,[e]){1&e&&S(n,"color",t[0])},i:t,o:t,d(t){t&&v(n),e[3](null)}}}function vt(t,e,n){let{color:o="#60e0ff"}=e;const i=(t,e)=>{s=Date.now()>c?t:Math.max(s,t),c=Date.now()+e};let r,s=0,c=0,l=[0,0];const a=(t,e,n,o,i,r)=>{o<2*r&&(r=o/2),i<2*r&&(r=i/2),t.beginPath(),t.moveTo(e+r,n),t.arcTo(e+o,n,e+o,n+i,r),t.arcTo(e+o,n+i,e,n+i,r),t.arcTo(e,n+i,e,n,r),t.arcTo(e,n,e+o,n,r),t.closePath()};var u;return u=()=>{let t;const e=2*(l.length-1)+1,o=3*e+1*(e-1),u=()=>{if(t=requestAnimationFrame(u),!r)return;const e=r.getContext("2d");if(!e)return;let i=(t=>{var e=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/e})(e),d=Number.parseInt(getComputedStyle(r).getPropertyValue("width").slice(0,-2)),f=Number.parseInt(getComputedStyle(r).getPropertyValue("height").slice(0,-2));n(1,r.width=d*i,r),n(1,r.height=f*i,r),Date.now()<c?l[0]=.15*s+.85*l[0]:l[0]=.0625+.75*l[0];let h=1;for(;h<l.length;)l[h]=.25*l[h-1]+.5*l[h]+.0625,h++;e.clearRect(0,0,r.width,r.height);const g=3/o*r.width*.5,p=4/o*r.width;for(e.fillStyle=r.style.color||"#000000",h=0;h<l.length;h++){const t=l[h]*r.height;t*r.height>2*g?a(e,.5*r.width-g+h*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width+h*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill(),h>0&&(t*r.height>2*g?a(e,.5*r.width-g-h*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width-h*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill())}};return u(),i(1,500),()=>{cancelAnimationFrame(t)}},B().$$.on_mount.push(u),t.$$set=t=>{"color"in t&&n(0,o=t.color)},[o,r,i,function(t){j[t?"unshift":"push"]((()=>{r=t,n(1,r)}))}]}class xt extends class{$destroy(){ot(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&&!a(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}{constructor(t){super(),rt(this,t,vt,wt,c,{color:0,updateVU:2},bt)}get updateVU(){return this.$$.ctx[2]}}const kt=[];function _t(t){return"[object Date]"===Object.prototype.toString.call(t)}function Tt(t,e){if(t===e||t!=t)return()=>t;const n=typeof t;if(n!==typeof e||Array.isArray(t)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const n=e.map(((e,n)=>Tt(t[n],e)));return t=>n.map((e=>e(t)))}if("object"===n){if(!t||!e)throw new Error("Object cannot be null");if(_t(t)&&_t(e)){t=t.getTime();const n=(e=e.getTime())-t;return e=>new Date(t+e*n)}const n=Object.keys(e),o={};return n.forEach((n=>{o[n]=Tt(t[n],e[n])})),t=>{const e={};return n.forEach((n=>{e[n]=o[n](t)})),e}}if("number"===n){const n=e-t;return e=>t+e*n}throw new Error(`Cannot interpolate ${n} values`)}function Et(o,i={}){const r=function(e,n=t){let o;const i=new Set;function r(t){if(c(e,t)&&(e=t,o)){const t=!kt.length;for(const t of i)t[1](),kt.push(t,e);if(t){for(let t=0;t<kt.length;t+=2)kt[t][0](kt[t+1]);kt.length=0}}}return{set:r,update:function(t){r(t(e))},subscribe:function(s,c=t){const l=[s,c];return i.add(l),1===i.size&&(o=n(r)||t),s(e),()=>{i.delete(l),0===i.size&&(o(),o=null)}}}}(o);let s,l=o;function a(t,c){if(null==o)return r.set(o=t),Promise.resolve();l=t;let a=s,u=!1,{delay:d=0,duration:h=400,easing:g=e,interpolate:p=Tt}=n(n({},i),c);if(0===h)return a&&(a.abort(),a=null),r.set(o=l),Promise.resolve();const $=f()+d;let y;return s=m((e=>{if(e<$)return!0;u||(y=p(o,t),"function"==typeof h&&(h=h(o,t)),u=!0),a&&(a.abort(),a=null);const n=e-$;return n>h?(r.set(o=t),!1):(r.set(o=y(g(n/h))),!0)})),s.promise}return{set:a,update:(t,e)=>a(t(l,o),e),subscribe:r.subscribe}}const{window:Ct}=et;function St(t,e,n){const o=t.slice();return o[42]=e[n],o[44]=n,o}function Pt(t){let e;return{c(){e=x("div"),C(e,"class","TransscriptItemBgDiv")},m(t,n){w(t,e,n)},d(t){t&&v(e)}}}function zt(e){let n,o;return{c(){n=x("div"),n.textContent="Listening...",C(n,"class","listening")},m(t,e){w(t,n,e)},i(t){o||W((()=>{o=tt(n,e[21],{duration:400}),o.start()}))},o:t,d(t){t&&v(n)}}}function Dt(e){let n,o;return{c(){n=x("div"),C(n,"class","TransscriptItemBgDiv")},m(t,e){w(t,n,e)},p(t,n){e=t},i(t){o||W((()=>{o=tt(n,e[21],{duration:e[14]}),o.start()}))},o:t,d(t){t&&v(n)}}}function Rt(t){let e,n;return{c(){e=x("span"),C(e,"style",n=t[44]<t[11].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")},m(t,n){w(t,e,n)},p(t,o){10240&o[0]&&n!==(n=t[44]<t[11].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")&&C(e,"style",n)},d(t){t&&v(e)}}}function Ft(e){let n,o,i,r,s,c,l,a=e[42].word+"",u=e[16]&&Dt(e),d=e[44]<e[11].length&&Rt(e);return{c(){n=x("div"),u&&u.c(),o=T(),i=x("div"),r=_(a),s=T(),d&&d.c(),C(i,"class","TransscriptItemContent"),C(n,"class",l="TranscriptItem "+e[23](e[42])),P(n,"Entity",null!==e[42].entityType),P(n,"Final",e[42].isFinal)},m(t,e){w(t,n,e),u&&u.m(n,null),$(n,o),$(n,i),$(i,r),$(i,s),d&&d.m(i,null)},p(t,s){(e=t)[16]?u?65536&s[0]&&Y(u,1):(u=Dt(e),u.c(),Y(u,1),u.m(n,o)):u&&(u.d(1),u=null),2048&s[0]&&a!==(a=e[42].word+"")&&function(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}(r,a),e[44]<e[11].length?d?d.p(e,s):(d=Rt(e),d.c(),d.m(i,null)):d&&(d.d(1),d=null),2048&s[0]&&l!==(l="TranscriptItem "+e[23](e[42]))&&C(n,"class",l),2048&s[0]&&P(n,"Entity",null!==e[42].entityType),2048&s[0]&&P(n,"Final",e[42].isFinal)},i(t){Y(u),c||W((()=>{c=tt(i,e[21],{duration:e[14]}),c.start()}))},o:t,d(t){t&&v(n),u&&u.d(),d&&d.d()}}}function Nt(e){let n,o,i,r,s,c,l,a;return{c(){n=x("div"),o=x("div"),i=T(),r=x("div"),s=k("svg"),c=k("path"),C(o,"class","TransscriptItemBgDiv"),S(o,"background-color",e[5]),C(c,"stroke","currentColor"),C(c,"stroke-width","3"),C(c,"d","M7.191 11.444l4.059 6.107 7.376-12.949"),C(c,"fill","none"),C(c,"fill-rule","evenodd"),S(s,"width","2rem"),S(s,"height","2rem"),S(s,"position","absolute"),S(s,"transform","translate(-0.6rem, -0.5rem)"),S(s,"stroke","#eee"),C(s,"viewBox","0 0 24 24"),C(s,"xmlns","http://www.w3.org/2000/svg"),S(r,"width","1.0rem"),S(r,"height","1rem"),S(r,"position","relative"),C(n,"class","TranscriptItem")},m(t,e){w(t,n,e),$(n,o),$(n,i),$(n,r),$(r,s),$(s,c)},p(t,e){32&e[0]&&S(o,"background-color",t[5])},i(t){l||W((()=>{l=tt(c,e[20],{duration:500}),l.start()})),a||W((()=>{a=tt(n,e[21],{duration:200,maxWidth:3}),a.start()}))},o:t,d(t){t&&v(n)}}}function At(t){let e;return{c(){e=x("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&&v(e)}}}function It(t){let e;return{c(){e=x("link"),C(e,"href",t[10]),C(e,"rel","stylesheet")},m(t,n){w(t,e,n)},p(t,n){1024&n[0]&&C(e,"href",t[10])},d(t){t&&v(e)}}}function Bt(e){let n,o,i,r,s,c,l,a,u,d,f,h,g,p,m,y=e[16]&&Pt(),b={color:e[5]};s=new xt({props:b}),e[34](s);let k=e[17]&&zt(e),_=e[11],z=[];for(let t=0;t<_.length;t+=1)z[t]=Ft(St(e,_,t));let D=e[13]&&Nt(e),R=e[15]&&At(),F=void 0!==e[10]&&It(e);return{c(){var g;n=x("main"),o=x("div"),y&&y.c(),i=T(),r=x("div"),(g=s.$$.fragment)&&g.c(),c=T(),k&&k.c(),l=T();for(let t=0;t<z.length;t+=1)z[t].c();a=T(),D&&D.c(),u=T(),R&&R.c(),d=E(),f=T(),F&&F.c(),h=E(),this.c=t,C(r,"class","TransscriptItemContent"),C(o,"class","TranscriptItem"),C(n,"class","BigTranscript"),S(n,"--voffset",e[1]),S(n,"--hoffset",e[2]),S(n,"--fontsize",e[3]),S(n,"--color",e[4]),S(n,"--highlight-color",e[5]),S(n,"--text-bg-color",e[6]),S(n,"--gradient-stop1",e[7]),S(n,"--gradient-stop2",e[8]),S(n,"--marginbottom",e[9]),S(n,"--transition",e[18].transition),S(n,"opacity",e[18].transition),S(n,"max-height",10*yt($t,e[18].transition,0,.6)+"rem"),S(n,"visibility",0!==e[18].transition?"visible":"hidden"),P(n,"placementTop","top"===e[0]),P(n,"defaultTypography",e[15])},m(t,b){w(t,n,b),$(n,o),y&&y.m(o,null),$(o,i),$(o,r),nt(s,r,null),$(r,c),k&&k.m(r,null),$(n,l);for(let t=0;t<z.length;t+=1)z[t].m(n,null);var v,x,_,T;$(n,a),D&&D.m(n,null),w(t,u,b),R&&R.m(document.head,null),$(document.head,d),w(t,f,b),F&&F.m(t,b),w(t,h,b),g=!0,p||(v=Ct,x="message",_=e[22],v.addEventListener(x,_,T),m=()=>v.removeEventListener(x,_,T),p=!0)},p(t,e){t[16]?y||(y=Pt(),y.c(),y.m(o,i)):y&&(y.d(1),y=null);const c={};if(32&e[0]&&(c.color=t[5]),s.$set(c),t[17]?k?131072&e[0]&&Y(k,1):(k=zt(t),k.c(),Y(k,1),k.m(r,null)):k&&(k.d(1),k=null),8464384&e[0]){let o;for(_=t[11],o=0;o<_.length;o+=1){const i=St(t,_,o);z[o]?(z[o].p(i,e),Y(z[o],1)):(z[o]=Ft(i),z[o].c(),Y(z[o],1),z[o].m(n,a))}for(;o<z.length;o+=1)z[o].d(1);z.length=_.length}t[13]?D?(D.p(t,e),8192&e[0]&&Y(D,1)):(D=Nt(t),D.c(),Y(D,1),D.m(n,null)):D&&(D.d(1),D=null),(!g||2&e[0])&&S(n,"--voffset",t[1]),(!g||4&e[0])&&S(n,"--hoffset",t[2]),(!g||8&e[0])&&S(n,"--fontsize",t[3]),(!g||16&e[0])&&S(n,"--color",t[4]),(!g||32&e[0])&&S(n,"--highlight-color",t[5]),(!g||64&e[0])&&S(n,"--text-bg-color",t[6]),(!g||128&e[0])&&S(n,"--gradient-stop1",t[7]),(!g||256&e[0])&&S(n,"--gradient-stop2",t[8]),(!g||512&e[0])&&S(n,"--marginbottom",t[9]),(!g||262144&e[0])&&S(n,"--transition",t[18].transition),(!g||262144&e[0])&&S(n,"opacity",t[18].transition),(!g||262144&e[0])&&S(n,"max-height",10*yt($t,t[18].transition,0,.6)+"rem"),(!g||262144&e[0])&&S(n,"visibility",0!==t[18].transition?"visible":"hidden"),1&e[0]&&P(n,"placementTop","top"===t[0]),32768&e[0]&&P(n,"defaultTypography",t[15]),t[15]?R||(R=At(),R.c(),R.m(d.parentNode,d)):R&&(R.d(1),R=null),void 0!==t[10]?F?F.p(t,e):(F=It(t),F.c(),F.m(h.parentNode,h)):F&&(F.d(1),F=null)},i(t){if(!g){Y(s.$$.fragment,t),Y(k);for(let t=0;t<_.length;t+=1)Y(z[t]);Y(D),g=!0}},o(t){!function(t,e,n,o){if(t&&t.o){if(X.has(t))return;X.add(t),(void 0).c.push((()=>{X.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}(s.$$.fragment,t),g=!1},d(t){t&&v(n),y&&y.d(),e[34](null),ot(s),k&&k.d(),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(z,t),D&&D.d(),t&&v(u),R&&R.d(t),v(d),t&&v(f),F&&F.d(t),t&&v(h),p=!1,m()}}}function Mt(t,e,n){let o,i,r,s,c,l,a,d,{placement:f}=e,{voffset:h="3rem"}=e,{hoffset:g="2rem"}=e,{fontsize:p="1.5rem"}=e,{color:m="#ffffff"}=e,{highlightcolor:$="#15e8b5"}=e,{backgroundcolor:y="#202020"}=e,{gradientstop1:b="#ffffff88"}=e,{gradientstop2:w="#ffffffcc"}=e,{marginbottom:v="0rem"}=e,{formattext:x}=e,{demomode:k}=e,{customcssurl:_}=e,{customtypography:T}=e,E=[],C=null,S=null,P=ct.Disconnected,z=!1,D=!1,R=!1,F=Et({transition:0},{duration:200});u(t,F,(t=>n(18,a=t)));const N=B(),A=gt(mt),I=gt(((t,{delay:e=0,duration:n=350,maxWidth:o=10})=>({delay:e,duration:n,css:t=>`\n max-width: ${yt($t,t,0,1)*o}rem;\n `}))),M=t=>{n(13,R=R||t)},O=t=>{n(30,P=t),P===ct.Recording&&(n(13,R=!1),n(11,E=[]),S=null)},L=t=>{if(void 0===t)return;d&&(s||P===ct.Recording)&&d.updateVU(.5*Math.random()+.5,75*Math.random()+75),t.isFinal?V(E.length>0?s?3500:2e3:0):E.length>0&&(z||n(31,z=!0),V(2e3));const e=`${t.contextId}/${t.id}`;null!==S?S!==e&&(n(13,R=!1),S=e):S=e,n(11,E=[]),t.words.forEach((t=>{n(11,E[t.index]={word:t.value,serialNumber:t.index,entityType:null,isFinal:t.isFinal,hide:!1},E)})),r?t.entities.forEach((t=>{n(11,E[t.startPosition].word=t.value,E),n(11,E[t.startPosition].entityType=t.type,E),n(11,E[t.startPosition].isFinal=t.isFinal,E),n(11,E[t.startPosition].hide=!1,E);for(let e=t.startPosition+1;e<t.endPosition;e++)E[e]&&n(11,E[e].hide=!0,E)})):t.entities.forEach((t=>{for(let e=t.startPosition;e<t.endPosition;e++)E[e]&&(n(11,E[e].entityType=t.type,E),n(11,E[e].isFinal=t.isFinal,E))})),n(11,E=E.filter((t=>!t.hide)))},V=(t=0)=>{H(),C=window.setTimeout((()=>{C=null,z&&n(31,z=!1)}),t)},H=()=>{null!==C&&(window.clearTimeout(C),C=null)};return t.$$set=t=>{"placement"in t&&n(0,f=t.placement),"voffset"in t&&n(1,h=t.voffset),"hoffset"in t&&n(2,g=t.hoffset),"fontsize"in t&&n(3,p=t.fontsize),"color"in t&&n(4,m=t.color),"highlightcolor"in t&&n(5,$=t.highlightcolor),"backgroundcolor"in t&&n(6,y=t.backgroundcolor),"gradientstop1"in t&&n(7,b=t.gradientstop1),"gradientstop2"in t&&n(8,w=t.gradientstop2),"marginbottom"in t&&n(9,v=t.marginbottom),"formattext"in t&&n(24,x=t.formattext),"demomode"in t&&n(25,k=t.demomode),"customcssurl"in t&&n(10,_=t.customcssurl),"customtypography"in t&&n(26,T=t.customtypography)},t.$$.update=()=>{if(2048&t.$$.dirty[0]&&n(17,o=0===E.length),64&t.$$.dirty[0]&&n(16,i="none"!==y),16777216&t.$$.dirty[0]&&(r=void 0===x||"false"!==x),33554432&t.$$.dirty[0]&&n(33,s=void 0!==k&&"false"!==k),67108864&t.$$.dirty[0]&&n(15,c=void 0===T||"false"===T),4&t.$$.dirty[1]&&n(14,l=s?800:350),1073741824&t.$$.dirty[0]|3&t.$$.dirty[1]){const t=P===ct.Recording||z;t!==D&&(e="visibilitychanged",a=t,N.dispatchEvent(new CustomEvent(e,{detail:a,composed:!0}))),n(32,D=t),F.set({transition:D?1:0})}var e,a;4&t.$$.dirty[1]&&(s||V(0))},[f,h,g,p,m,$,y,b,w,v,_,E,d,R,l,c,i,o,a,F,A,I,t=>{switch(t.data.type){case at.speechsegment:L(t.data.segment);break;case at.speechhandled:M(t.data.success);break;case at.speechstate:O(t.data.state)}},t=>t.entityType||"",x,k,T,M,O,L,P,z,D,s,function(t){j[t?"unshift":"push"]((()=>{d=t,n(12,d)}))}]}class jt extends st{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{position:relative;user-select:none;display:flex;flex-direction:row;justify-content:start;flex-wrap:wrap;margin-bottom:calc(var(--marginbottom) * var(--transition))}.defaultTypography{font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--color);font-size:var(--fontsize);line-height:135%}.TranscriptItem{position:relative;display:flex;flex-direction:row;align-items:center}.Entity{color:var(--highlight-color)}.TransscriptItemContent{z-index:1;display:flex;flex-wrap:nowrap;flex-direction:row;align-items:center;overflow:hidden;white-space:nowrap}.TransscriptItemBgDiv{position:absolute;box-sizing:content-box;width:100%;height:100%;top:-0.2rem;left:-0.8rem;margin:0;padding:0.2rem 0.8rem;background-color:var(--text-bg-color);z-index:-1}.placementTop{position:fixed;top:0;left:0;right:0;bottom:0;margin:var(--voffset) var(--hoffset) 0 var(--hoffset);z-index:50;pointer-events:none}.listening{animation:flow 1s linear infinite;background:linear-gradient(-60deg, var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1));background-size:200%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;-webkit-box-decoration-break:clone}@keyframes flow{0%{background-position:100% 50%}100%{background-position:0% 50%}}</style>",rt(this,{target:this.shadowRoot,props:z(this.attributes),customElement:!0},Mt,Bt,l,{placement:0,voffset:1,hoffset:2,fontsize:3,color:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,marginbottom:9,formattext:24,demomode:25,customcssurl:10,customtypography:26,speechhandled:27,speechstate:28,speechsegment:29},null,[-1,-1]),t&&(t.target&&w(t.target,this,t.anchor),t.props&&(this.$set(t.props),G()))}static get observedAttributes(){return["placement","voffset","hoffset","fontsize","color","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","marginbottom","formattext","demomode","customcssurl","customtypography","speechhandled","speechstate","speechsegment"]}get placement(){return this.$$.ctx[0]}set placement(t){this.$$set({placement:t}),G()}get voffset(){return this.$$.ctx[1]}set voffset(t){this.$$set({voffset:t}),G()}get hoffset(){return this.$$.ctx[2]}set hoffset(t){this.$$set({hoffset:t}),G()}get fontsize(){return this.$$.ctx[3]}set fontsize(t){this.$$set({fontsize:t}),G()}get color(){return this.$$.ctx[4]}set color(t){this.$$set({color:t}),G()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$$set({highlightcolor:t}),G()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),G()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$$set({gradientstop1:t}),G()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$$set({gradientstop2:t}),G()}get marginbottom(){return this.$$.ctx[9]}set marginbottom(t){this.$$set({marginbottom:t}),G()}get formattext(){return this.$$.ctx[24]}set formattext(t){this.$$set({formattext:t}),G()}get demomode(){return this.$$.ctx[25]}set demomode(t){this.$$set({demomode:t}),G()}get customcssurl(){return this.$$.ctx[10]}set customcssurl(t){this.$$set({customcssurl:t}),G()}get customtypography(){return this.$$.ctx[26]}set customtypography(t){this.$$set({customtypography:t}),G()}get speechhandled(){return this.$$.ctx[27]}get speechstate(){return this.$$.ctx[28]}get speechsegment(){return this.$$.ctx[29]}}customElements.get("big-transcript")?console.warn("Skipping re-defining customElement big-transcript"):customElements.define("big-transcript",jt)})); | ||
//# sourceMappingURL=big-transcript.js.map |
@@ -23,2 +23,3 @@ import type { IAppearance } from "./types"; | ||
Mic = "mic", | ||
MicActive = "micactive", | ||
Error = "error", | ||
@@ -37,2 +38,6 @@ Denied = "denied" | ||
} | ||
export declare const enum TriggerFx { | ||
None = "none", | ||
Whirl = "whirl" | ||
} | ||
export declare const clientStateToAppearance: { | ||
@@ -39,0 +44,0 @@ [state: string]: IAppearance; |
@@ -1,2 +0,2 @@ | ||
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(){}function t(e){return e()}function n(){return Object.create(null)}function o(e){e.forEach(t)}function r(e){return"function"==typeof e}function i(e,t){return e!=e?t==t:e!==t}function c(e,t){e.appendChild(t)}function s(e,t,n){e.insertBefore(t,n||null)}function l(e){e.parentNode.removeChild(e)}function a(e){return document.createElement(e)}function d(e){return document.createTextNode(e)}function u(){return d(" ")}function p(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function h(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function f(e,t,n){e.classList[n?"add":"remove"](t)}function m(e){const t={};for(const n of e)t[n.name]=n.value;return t}let g;function b(e){g=e}const w=[],$=[],y=[],x=[],C=Promise.resolve();let v=!1;function k(e){y.push(e)}let S=!1;const _=new Set;function T(){if(!S){S=!0;do{for(let e=0;e<w.length;e+=1){const t=w[e];b(t),N(t.$$)}for(b(null),w.length=0;$.length;)$.pop()();for(let e=0;e<y.length;e+=1){const t=y[e];_.has(t)||(_.add(t),t())}y.length=0}while(w.length);for(;x.length;)x.pop()();v=!1,S=!1,_.clear()}}function N(e){if(null!==e.fragment){e.update(),o(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(k)}}const E=new Set;const R="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function A(e,t){-1===e.$$.dirty[0]&&(w.push(e),v||(v=!0,C.then(T)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function B(i,c,s,a,d,u,p,h=[-1]){const f=g;b(i);const m=i.$$={fragment:null,ctx:null,props:u,update:e,not_equal:d,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(c.context||(f?f.$$.context:[])),callbacks:n(),dirty:h,skip_bound:!1,root:c.target||f.$$.root};p&&p(m.root);let w=!1;if(m.ctx=s?s(i,c.props||{},((e,t,...n)=>{const o=n.length?n[0]:t;return m.ctx&&d(m.ctx[e],m.ctx[e]=o)&&(!m.skip_bound&&m.bound[e]&&m.bound[e](o),w&&A(i,e)),t})):[],m.update(),w=!0,o(m.before_update),m.fragment=!!a&&a(m.ctx),c.target){if(c.hydrate){const e=function(e){return Array.from(e.childNodes)}(c.target);m.fragment&&m.fragment.l(e),e.forEach(l)}else m.fragment&&m.fragment.c();c.intro&&(($=i.$$.fragment)&&$.i&&(E.delete($),$.i(y))),function(e,n,i,c){const{fragment:s,on_mount:l,on_destroy:a,after_update:d}=e.$$;s&&s.m(n,i),c||k((()=>{const n=l.map(t).filter(r);a?a.push(...n):o(n),e.$$.on_mount=[]})),d.forEach(k)}(i,c.target,c.anchor,c.customElement),T()}var $,y;b(f)}let D;var L,z,H,q,F,M;"function"==typeof HTMLElement&&(D=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:e}=this.$$;this.$$.on_disconnect=e.map(t).filter(r);for(const e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(e,t,n){this[e]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){!function(e,t){const n=e.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=e}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}),function(e){e[e.Failed=0]="Failed",e[e.NoBrowserSupport=1]="NoBrowserSupport",e[e.NoAudioConsent=2]="NoAudioConsent",e[e.Disconnected=3]="Disconnected",e[e.Disconnecting=4]="Disconnecting",e[e.Connecting=5]="Connecting",e[e.Connected=6]="Connected",e[e.Starting=7]="Starting",e[e.Stopping=8]="Stopping",e[e.Recording=9]="Recording"}(L||(L={})),function(e){e.SpeechlyFirstConnect="SpeechlyFirstConnect"}(z||(z={})),function(e){e.speechlypoweron="speechlypoweron",e.holdstart="holdstart",e.holdend="holdend",e.speechlystarting="speechlystarting",e.speechstate="speechstate",e.initialized="initialized",e.speechsegment="speechsegment",e.speechhandled="speechhandled",e.showhint="showhint",e.transcriptdrawerhint="hint",e.speechlyintroready="speechlyintroready",e.speechlyintroclosed="speechlyintroclosed"}(H||(H={})),function(e){e.Mic="mic",e.Error="error",e.Denied="denied"}(q||(q={})),function(e){e.Hold="hold",e.Click="click",e.Noninteractive="noninteractive"}(F||(F={})),function(e){e.None="none",e.Connecting="connecting",e.Busy="busy"}(M||(M={})),L.Disconnected,L.Disconnecting,L.Connecting,L.Connected,L.Starting,L.Recording,L.Stopping,L.Failed,L.NoBrowserSupport,L.NoAudioConsent;const{window:I}=R;function P(e){let t,n,o,r,i,d,h,f,m=e[2]===K&&j(e),g=e[2]===L.NoAudioConsent&&O(),b=e[2]===L.NoBrowserSupport&&U(),w=e[2]===Q&&G();return{c(){t=a("errorDiv"),n=a("errorLeft"),n.textContent="×",o=u(),m&&m.c(),r=u(),g&&g.c(),i=u(),b&&b.c(),d=u(),w&&w.c()},m(l,a){s(l,t,a),c(t,n),c(t,o),m&&m.m(t,null),c(t,r),g&&g.m(t,null),c(t,i),b&&b.m(t,null),c(t,d),w&&w.m(t,null),h||(f=p(n,"click",e[4]),h=!0)},p(e,n){e[2]===K?m?m.p(e,n):(m=j(e),m.c(),m.m(t,r)):m&&(m.d(1),m=null),e[2]===L.NoAudioConsent?g?g.p(e,n):(g=O(),g.c(),g.m(t,i)):g&&(g.d(1),g=null),e[2]===L.NoBrowserSupport?b||(b=U(),b.c(),b.m(t,d)):b&&(b.d(1),b=null),e[2]===Q?w?w.p(e,n):(w=G(),w.c(),w.m(t,null)):w&&(w.d(1),w=null)},d(e){e&&l(t),m&&m.d(),g&&g.d(),b&&b.d(),w&&w.d(),h=!1,f()}}}function j(e){let t,n,o,r,i,p,f,m,g,b,w,$,y,x,C=e[1].appId+"";return{c(){t=a("errorRight"),n=a("h1"),n.textContent="Failed to connect Speechly",o=u(),r=a("p"),i=d("Please check that Speechly application id '"),p=d(C),f=d("' has been successfully deployed."),m=u(),g=a("p"),b=a("a"),b.textContent="Troubleshooting",w=d("\n \n "),$=a("a"),y=d("Reload"),h(b,"href","https://docs.speechly.com/faq/#error-invalid-app-id"),h($,"href",x=window.location.href)},m(e,l){s(e,t,l),c(t,n),c(t,o),c(t,r),c(r,i),c(r,p),c(r,f),c(t,m),c(t,g),c(g,b),c(g,w),c(g,$),c($,y)},p(e,t){2&t&&C!==(C=e[1].appId+"")&&function(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}(p,C)},d(e){e&&l(t)}}}function O(t){let n,o,r,i,p,f,m,g,b,w;return{c(){n=a("errorRight"),o=a("h1"),o.textContent="No Mic Permission",r=u(),i=a("p"),i.textContent="To use the voice interface, please allow your web browser access the\n microphone and reload.",p=u(),f=a("p"),m=a("a"),m.textContent="Troubleshooting",g=d("\n \n "),b=a("a"),w=d("Reload"),h(m,"href","https://docs.speechly.com/faq/#error-no-audio-consent"),h(b,"href",window.location.href)},m(e,t){s(e,n,t),c(n,o),c(n,r),c(n,i),c(n,p),c(n,f),c(f,m),c(f,g),c(f,b),c(b,w)},p:e,d(e){e&&l(n)}}}function U(e){let t;return{c(){t=a("errorRight"),t.innerHTML='<h1>Unsupported Browser</h1> \n <p>To use the voice interface, please visit this site using a supported\n browser.</p> \n <p><a href="https://docs.speechly.com/client-libraries/supported-browsers/#error-no-browser-support">Troubleshooting</a></p>'},m(e,n){s(e,t,n)},d(e){e&&l(t)}}}function G(t){let n,o,r,i,p,f,m,g,b,w;return{c(){n=a("errorRight"),o=a("h1"),o.textContent="HTTPS Required",r=u(),i=a("p"),i.textContent="To use the voice interface, please visit this site using the secure\n https:// protocol.",p=u(),f=a("p"),m=a("a"),m.textContent="Troubleshooting",g=d("\n \n "),b=a("a"),w=d("Try with HTTPS"),h(m,"href","https://docs.speechly.com/faq/#error-https-required"),h(b,"href",window.location.href.replace(/^http(?!s)/,"https"))},m(e,t){s(e,n,t),c(n,o),c(n,r),c(n,i),c(n,p),c(n,f),c(f,m),c(f,g),c(f,b),c(b,w)},p:e,d(e){e&&l(n)}}}function J(t){let n,o,r,i,d,m=t[2]&&P(t);return{c(){n=a("link"),o=u(),r=a("main"),m&&m.c(),this.c=e,h(n,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),h(n,"rel","stylesheet"),f(r,"bottom","bottom"===t[0])},m(e,l){c(document.head,n),s(e,o,l),s(e,r,l),m&&m.m(r,null),i||(d=p(I,"message",t[3]),i=!0)},p(e,[t]){e[2]?m?m.p(e,t):(m=P(e),m.c(),m.m(r,null)):m&&(m.d(1),m=null),1&t&&f(r,"bottom","bottom"===e[0])},i:e,o:e,d(e){l(n),e&&l(o),e&&l(r),m&&m.d(),i=!1,d()}}}const K="InvaldAppId",Q="HttpsRequired";function V(e,t,n){let{placement:o=null}=t,r={};let i=null;const c=(e,t)=>{n(1,r={appId:t})},s=e=>{var t,o;switch(e){case L.Failed:n(2,i=K);break;case L.NoAudioConsent:case L.NoBrowserSupport:if("https:"!==(null===(t=null===window||void 0===window?void 0:window.location)||void 0===t?void 0:t.protocol)&&("localhost"!==(o=window.location.hostname)&&"[::1]"!==o&&null===o.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))){n(2,i=Q);break}n(2,i=e)}};return e.$$set=e=>{"placement"in e&&n(0,o=e.placement)},[o,r,i,e=>{switch(e.data.type){case H.holdstart:s(e.data.state);break;case H.initialized:console.log(e.data),c(e.data.state,e.data.appId)}},()=>{n(2,i=null)}]}class W extends D{constructor(e){super(),this.shadowRoot.innerHTML="<style>main.bottom{position:fixed;bottom:0;left:0;right:0;min-height:10em;z-index:51;user-select:none;pointer-events:none}errorDiv{box-sizing:border-box;position:relative;width:100%;min-height:10em;background-color:white;user-select:text;pointer-events:all;color:black;display:flex;box-shadow:0 0 8px #00000040;flex-direction:row}errorLeft{box-sizing:border-box;width:2rem;background-color:red;padding:0.2rem 0.2rem;color:#ffffff;display:flex;flex-direction:column;align-items:center;justify-content:start;font-size:1.5rem;cursor:pointer}errorRight{background-color:white;padding:1rem 3rem 1rem 1rem;overflow:auto;flex-grow:1}h1{font-size:1.5rem;margin:0;padding:0 0 0.5rem 0;font-family:'Saira Condensed', sans-serif;text-transform:uppercase}p{margin:0;padding:0 0 0.5rem 0;color:#999}a{color:#000}</style>",B(this,{target:this.shadowRoot,props:m(this.attributes),customElement:!0},V,J,i,{placement:0},null),e&&(e.target&&s(e.target,this,e.anchor),e.props&&(this.$set(e.props),T()))}static get observedAttributes(){return["placement"]}get placement(){return this.$$.ctx[0]}set placement(e){this.$$set({placement:e}),T()}}customElements.get("error-panel")?console.warn("Skipping re-defining customElement error-panel"):customElements.define("error-panel",W)})); | ||
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(){}function t(e){return e()}function n(){return Object.create(null)}function o(e){e.forEach(t)}function r(e){return"function"==typeof e}function i(e,t){return e!=e?t==t:e!==t}function c(e,t){e.appendChild(t)}function s(e,t,n){e.insertBefore(t,n||null)}function l(e){e.parentNode.removeChild(e)}function a(e){return document.createElement(e)}function d(e){return document.createTextNode(e)}function u(){return d(" ")}function p(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function h(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function f(e,t,n){e.classList[n?"add":"remove"](t)}function m(e){const t={};for(const n of e)t[n.name]=n.value;return t}let g;function w(e){g=e}const b=[],$=[],y=[],x=[],v=Promise.resolve();let C=!1;function k(e){y.push(e)}let S=!1;const _=new Set;function T(){if(!S){S=!0;do{for(let e=0;e<b.length;e+=1){const t=b[e];w(t),N(t.$$)}for(w(null),b.length=0;$.length;)$.pop()();for(let e=0;e<y.length;e+=1){const t=y[e];_.has(t)||(_.add(t),t())}y.length=0}while(b.length);for(;x.length;)x.pop()();C=!1,S=!1,_.clear()}}function N(e){if(null!==e.fragment){e.update(),o(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(k)}}const E=new Set;const R="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function A(e,t){-1===e.$$.dirty[0]&&(b.push(e),C||(C=!0,v.then(T)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function B(i,c,s,a,d,u,p,h=[-1]){const f=g;w(i);const m=i.$$={fragment:null,ctx:null,props:u,update:e,not_equal:d,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(c.context||(f?f.$$.context:[])),callbacks:n(),dirty:h,skip_bound:!1,root:c.target||f.$$.root};p&&p(m.root);let b=!1;if(m.ctx=s?s(i,c.props||{},((e,t,...n)=>{const o=n.length?n[0]:t;return m.ctx&&d(m.ctx[e],m.ctx[e]=o)&&(!m.skip_bound&&m.bound[e]&&m.bound[e](o),b&&A(i,e)),t})):[],m.update(),b=!0,o(m.before_update),m.fragment=!!a&&a(m.ctx),c.target){if(c.hydrate){const e=function(e){return Array.from(e.childNodes)}(c.target);m.fragment&&m.fragment.l(e),e.forEach(l)}else m.fragment&&m.fragment.c();c.intro&&(($=i.$$.fragment)&&$.i&&(E.delete($),$.i(y))),function(e,n,i,c){const{fragment:s,on_mount:l,on_destroy:a,after_update:d}=e.$$;s&&s.m(n,i),c||k((()=>{const n=l.map(t).filter(r);a?a.push(...n):o(n),e.$$.on_mount=[]})),d.forEach(k)}(i,c.target,c.anchor,c.customElement),T()}var $,y;w(f)}let D;var L,z,H,M,q,F,I;"function"==typeof HTMLElement&&(D=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:e}=this.$$;this.$$.on_disconnect=e.map(t).filter(r);for(const e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(e,t,n){this[e]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){!function(e,t){const n=e.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=e}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}),function(e){e[e.Failed=0]="Failed",e[e.NoBrowserSupport=1]="NoBrowserSupport",e[e.NoAudioConsent=2]="NoAudioConsent",e[e.Disconnected=3]="Disconnected",e[e.Disconnecting=4]="Disconnecting",e[e.Connecting=5]="Connecting",e[e.Connected=6]="Connected",e[e.Starting=7]="Starting",e[e.Stopping=8]="Stopping",e[e.Recording=9]="Recording"}(L||(L={})),function(e){e.SpeechlyFirstConnect="SpeechlyFirstConnect"}(z||(z={})),function(e){e.speechlypoweron="speechlypoweron",e.holdstart="holdstart",e.holdend="holdend",e.speechlystarting="speechlystarting",e.speechstate="speechstate",e.initialized="initialized",e.speechsegment="speechsegment",e.speechhandled="speechhandled",e.showhint="showhint",e.transcriptdrawerhint="hint",e.speechlyintroready="speechlyintroready",e.speechlyintroclosed="speechlyintroclosed"}(H||(H={})),function(e){e.Mic="mic",e.MicActive="micactive",e.Error="error",e.Denied="denied"}(M||(M={})),function(e){e.Hold="hold",e.Click="click",e.Noninteractive="noninteractive"}(q||(q={})),function(e){e.None="none",e.Connecting="connecting",e.Busy="busy"}(F||(F={})),function(e){e.None="none",e.Whirl="whirl"}(I||(I={})),L.Disconnected,L.Disconnecting,L.Connecting,L.Connected,L.Starting,L.Recording,L.Stopping,L.Failed,L.NoBrowserSupport,L.NoAudioConsent;const{window:P}=R;function j(e){let t,n,o,r,i,d,h,f,m=e[2]===K&&O(e),g=e[2]===L.NoAudioConsent&&U(),w=e[2]===L.NoBrowserSupport&&W(),b=e[2]===Q&&G();return{c(){t=a("errorDiv"),n=a("errorLeft"),n.textContent="×",o=u(),m&&m.c(),r=u(),g&&g.c(),i=u(),w&&w.c(),d=u(),b&&b.c()},m(l,a){s(l,t,a),c(t,n),c(t,o),m&&m.m(t,null),c(t,r),g&&g.m(t,null),c(t,i),w&&w.m(t,null),c(t,d),b&&b.m(t,null),h||(f=p(n,"click",e[4]),h=!0)},p(e,n){e[2]===K?m?m.p(e,n):(m=O(e),m.c(),m.m(t,r)):m&&(m.d(1),m=null),e[2]===L.NoAudioConsent?g?g.p(e,n):(g=U(),g.c(),g.m(t,i)):g&&(g.d(1),g=null),e[2]===L.NoBrowserSupport?w||(w=W(),w.c(),w.m(t,d)):w&&(w.d(1),w=null),e[2]===Q?b?b.p(e,n):(b=G(),b.c(),b.m(t,null)):b&&(b.d(1),b=null)},d(e){e&&l(t),m&&m.d(),g&&g.d(),w&&w.d(),b&&b.d(),h=!1,f()}}}function O(e){let t,n,o,r,i,p,f,m,g,w,b,$,y,x,v=e[1].appId+"";return{c(){t=a("errorRight"),n=a("h1"),n.textContent="Failed to connect Speechly",o=u(),r=a("p"),i=d("Please check that Speechly application id '"),p=d(v),f=d("' has been successfully deployed."),m=u(),g=a("p"),w=a("a"),w.textContent="Troubleshooting",b=d("\n \n "),$=a("a"),y=d("Reload"),h(w,"href","https://docs.speechly.com/faq/#error-invalid-app-id"),h($,"href",x=window.location.href)},m(e,l){s(e,t,l),c(t,n),c(t,o),c(t,r),c(r,i),c(r,p),c(r,f),c(t,m),c(t,g),c(g,w),c(g,b),c(g,$),c($,y)},p(e,t){2&t&&v!==(v=e[1].appId+"")&&function(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}(p,v)},d(e){e&&l(t)}}}function U(t){let n,o,r,i,p,f,m,g,w,b;return{c(){n=a("errorRight"),o=a("h1"),o.textContent="No Mic Permission",r=u(),i=a("p"),i.textContent="To use the voice interface, please allow your web browser access the\n microphone and reload.",p=u(),f=a("p"),m=a("a"),m.textContent="Troubleshooting",g=d("\n \n "),w=a("a"),b=d("Reload"),h(m,"href","https://docs.speechly.com/faq/#error-no-audio-consent"),h(w,"href",window.location.href)},m(e,t){s(e,n,t),c(n,o),c(n,r),c(n,i),c(n,p),c(n,f),c(f,m),c(f,g),c(f,w),c(w,b)},p:e,d(e){e&&l(n)}}}function W(e){let t;return{c(){t=a("errorRight"),t.innerHTML='<h1>Unsupported Browser</h1> \n <p>To use the voice interface, please visit this site using a supported\n browser.</p> \n <p><a href="https://docs.speechly.com/client-libraries/supported-browsers/#error-no-browser-support">Troubleshooting</a></p>'},m(e,n){s(e,t,n)},d(e){e&&l(t)}}}function G(t){let n,o,r,i,p,f,m,g,w,b;return{c(){n=a("errorRight"),o=a("h1"),o.textContent="HTTPS Required",r=u(),i=a("p"),i.textContent="To use the voice interface, please visit this site using the secure\n https:// protocol.",p=u(),f=a("p"),m=a("a"),m.textContent="Troubleshooting",g=d("\n \n "),w=a("a"),b=d("Try with HTTPS"),h(m,"href","https://docs.speechly.com/faq/#error-https-required"),h(w,"href",window.location.href.replace(/^http(?!s)/,"https"))},m(e,t){s(e,n,t),c(n,o),c(n,r),c(n,i),c(n,p),c(n,f),c(f,m),c(f,g),c(f,w),c(w,b)},p:e,d(e){e&&l(n)}}}function J(t){let n,o,r,i,d,m=t[2]&&j(t);return{c(){n=a("link"),o=u(),r=a("main"),m&&m.c(),this.c=e,h(n,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),h(n,"rel","stylesheet"),f(r,"bottom","bottom"===t[0])},m(e,l){c(document.head,n),s(e,o,l),s(e,r,l),m&&m.m(r,null),i||(d=p(P,"message",t[3]),i=!0)},p(e,[t]){e[2]?m?m.p(e,t):(m=j(e),m.c(),m.m(r,null)):m&&(m.d(1),m=null),1&t&&f(r,"bottom","bottom"===e[0])},i:e,o:e,d(e){l(n),e&&l(o),e&&l(r),m&&m.d(),i=!1,d()}}}const K="InvaldAppId",Q="HttpsRequired";function V(e,t,n){let{placement:o=null}=t,r={};let i=null;const c=(e,t)=>{n(1,r={appId:t})},s=e=>{var t,o;switch(e){case L.Failed:n(2,i=K);break;case L.NoAudioConsent:case L.NoBrowserSupport:if("https:"!==(null===(t=null===window||void 0===window?void 0:window.location)||void 0===t?void 0:t.protocol)&&("localhost"!==(o=window.location.hostname)&&"[::1]"!==o&&null===o.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))){n(2,i=Q);break}n(2,i=e)}};return e.$$set=e=>{"placement"in e&&n(0,o=e.placement)},[o,r,i,e=>{switch(e.data.type){case H.holdstart:s(e.data.state);break;case H.initialized:console.log(e.data),c(e.data.state,e.data.appId)}},()=>{n(2,i=null)}]}class X extends D{constructor(e){super(),this.shadowRoot.innerHTML="<style>main.bottom{position:fixed;bottom:0;left:0;right:0;min-height:10em;z-index:51;user-select:none;pointer-events:none}errorDiv{box-sizing:border-box;position:relative;width:100%;min-height:10em;background-color:white;user-select:text;pointer-events:all;color:black;display:flex;box-shadow:0 0 8px #00000040;flex-direction:row}errorLeft{box-sizing:border-box;width:2rem;background-color:red;padding:0.2rem 0.2rem;color:#ffffff;display:flex;flex-direction:column;align-items:center;justify-content:start;font-size:1.5rem;cursor:pointer}errorRight{background-color:white;padding:1rem 3rem 1rem 1rem;overflow:auto;flex-grow:1}h1{font-size:1.5rem;margin:0;padding:0 0 0.5rem 0;font-family:'Saira Condensed', sans-serif;text-transform:uppercase}p{margin:0;padding:0 0 0.5rem 0;color:#999}a{color:#000}</style>",B(this,{target:this.shadowRoot,props:m(this.attributes),customElement:!0},V,J,i,{placement:0},null),e&&(e.target&&s(e.target,this,e.anchor),e.props&&(this.$set(e.props),T()))}static get observedAttributes(){return["placement"]}get placement(){return this.$$.ctx[0]}set placement(e){this.$$set({placement:e}),T()}}customElements.get("error-panel")?console.warn("Skipping re-defining customElement error-panel"):customElements.define("error-panel",X)})); | ||
//# sourceMappingURL=error-panel.js.map |
@@ -1,2 +0,2 @@ | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function i(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e}function c(t){return 0===Object.keys(t).length}function a(t,e){t.appendChild(e)}function l(t,e,n){const o=function(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;if(e&&e.host)return e;return t.ownerDocument}(t);if(!o.getElementById(e)){const t=f("style");t.id=e,t.textContent=n,function(t,e){a(t.head||t,e)}(o,t)}}function d(t,e,n){t.insertBefore(e,n||null)}function u(t){t.parentNode.removeChild(t)}function f(t){return document.createElement(t)}function h(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function p(t){return document.createTextNode(t)}function g(){return p(" ")}function $(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function m(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function v(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function w(t,e,n){t.classList[n?"add":"remove"](e)}function b(t){const e={};for(const n of t)e[n.name]=n.value;return e}let y;function x(t){y=t}function k(){if(!y)throw new Error("Function called outside component initialization");return y}const z=[],E=[],_=[],C=[],M=Promise.resolve();let D=!1;function N(t){_.push(t)}let S=!1;const B=new Set;function L(){if(!S){S=!0;do{for(let t=0;t<z.length;t+=1){const e=z[t];x(e),R(e.$$)}for(x(null),z.length=0;E.length;)E.pop()();for(let t=0;t<_.length;t+=1){const e=_[t];B.has(e)||(B.add(e),e())}_.length=0}while(z.length);for(;C.length;)C.pop()();D=!1,S=!1,B.clear()}}function R(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(N)}}const F=new Set;function A(t,e){t&&t.i&&(F.delete(t),t.i(e))}function j(t,e,n,o){if(t&&t.o){if(F.has(t))return;F.add(t),undefined.c.push((()=>{F.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}const T="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function I(t){t&&t.c()}function V(t,n,r,s){const{fragment:c,on_mount:a,on_destroy:l,after_update:d}=t.$$;c&&c.m(n,r),s||N((()=>{const n=a.map(e).filter(i);l?l.push(...n):o(n),t.$$.on_mount=[]})),d.forEach(N)}function P(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=[])}function H(t,e){-1===t.$$.dirty[0]&&(z.push(t),D||(D=!0,M.then(L)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function G(e,i,r,s,c,a,l,d=[-1]){const f=y;x(e);const h=e.$$={fragment:null,ctx:null,props:a,update:t,not_equal:c,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(i.context||(f?f.$$.context:[])),callbacks:n(),dirty:d,skip_bound:!1,root:i.target||f.$$.root};l&&l(h.root);let p=!1;if(h.ctx=r?r(e,i.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return h.ctx&&c(h.ctx[t],h.ctx[t]=i)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](i),p&&H(e,t)),n})):[],h.update(),p=!0,o(h.before_update),h.fragment=!!s&&s(h.ctx),i.target){if(i.hydrate){const t=function(t){return Array.from(t.childNodes)}(i.target);h.fragment&&h.fragment.l(t),t.forEach(u)}else h.fragment&&h.fragment.c();i.intro&&A(e.$$.fragment),V(e,i.target,i.anchor,i.customElement),L()}x(f)}let O;"function"==typeof HTMLElement&&(O=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){P(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&&!c(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class q{$destroy(){P(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&&!c(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function U(t){l(t,"svelte-1mwhwtl",".Frame.svelte-1mwhwtl{position:absolute;width:100%;height:100%;top:50%;left:50%;transform-origin:50% 50%;transform:translate(-50%, -50%) rotate(var(--fx-rotation));transition:width 0.1s, height 0.1s;pointer-events:none;user-select:none}")}function J(e){let n,o,i,r,s,c,l;return{c(){n=h("svg"),o=h("defs"),i=h("linearGradient"),r=h("stop"),s=h("stop"),c=h("circle"),l=h("circle"),m(r,"stop-color","var(--gradient-stop1)"),m(r,"offset","0%"),m(s,"stop-color","var(--gradient-stop2)"),m(s,"offset","100%"),m(i,"x1","50%"),m(i,"y1","0%"),m(i,"x2","50%"),m(i,"y2","100%"),m(i,"id","a"),m(c,"cx","46"),m(c,"cy","46"),m(c,"r",e[0]),m(c,"stroke","none"),m(c,"fill","var(--frame-background)"),m(l,"cx","46"),m(l,"cy","46"),m(l,"r",e[0]),m(l,"stroke","url(#a)"),m(l,"stroke-width","var(--frame-stroke-width)"),m(l,"fill","none"),m(n,"class","Frame svelte-1mwhwtl"),m(n,"viewBox","0 0 92 92"),m(n,"xmlns","http://www.w3.org/2000/svg")},m(t,e){d(t,n,e),a(n,o),a(o,i),a(i,r),a(i,s),a(n,c),a(n,l)},p(t,[e]){1&e&&m(c,"r",t[0]),1&e&&m(l,"r",t[0])},i:t,o:t,d(t){t&&u(n)}}}function K(t,e,n){let{frameRadius:o=46}=e;return t.$$set=t=>{"frameRadius"in t&&n(0,o=t.frameRadius)},[o]}class Q extends q{constructor(t){super(),G(this,t,K,J,r,{frameRadius:0},U)}}var W,X,Y,Z,tt,et;!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"}(W||(W={})),function(t){t.SpeechlyFirstConnect="SpeechlyFirstConnect"}(X||(X={})),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"}(Y||(Y={})),function(t){t.Mic="mic",t.Error="error",t.Denied="denied"}(Z||(Z={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(tt||(tt={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(et||(et={}));const nt={[W.Disconnected]:{icon:"mic",behaviour:"click",effect:"none"},[W.Disconnecting]:{icon:"mic",behaviour:"noninteractive",effect:"connecting"},[W.Connecting]:{icon:"mic",behaviour:"noninteractive",effect:"connecting"},[W.Connected]:{icon:"mic",behaviour:"hold",effect:"none"},[W.Starting]:{icon:"mic",behaviour:"hold",effect:"connecting"},[W.Recording]:{icon:"mic",behaviour:"hold",effect:"none"},[W.Stopping]:{icon:"mic",behaviour:"noninteractive",effect:"busy"},[W.Failed]:{icon:"error",behaviour:"click",effect:"none"},[W.NoBrowserSupport]:{icon:"error",behaviour:"click",effect:"none"},[W.NoAudioConsent]:{icon:"denied",behaviour:"click",effect:"none"}};function ot(t){l(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 it(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("rect"),m(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"),m(i,"x","20"),m(i,"y","1"),m(i,"width","16"),m(i,"height","37"),m(i,"rx","8"),m(n,"fill","var(--icon-color)"),m(n,"fill-rule","evenodd"),m(e,"class","Icon svelte-1djrpwt"),m(e,"viewBox","0 0 56 56"),m(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),a(e,n),a(n,o),a(n,i)},d(t){t&&u(e)}}}function rt(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("path"),m(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"),m(o,"fill-rule","nonzero"),m(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"),m(n,"fill","var(--icon-color)"),m(n,"fill-rule","evenodd"),m(e,"class","Icon svelte-1djrpwt"),m(e,"viewBox","0 0 56 56"),m(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),a(e,n),a(n,o),a(n,i)},d(t){t&&u(e)}}}function st(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("path"),m(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"),m(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"),m(n,"fill","var(--icon-color)"),m(n,"fill-rule","nonzero"),m(e,"class","Icon svelte-1djrpwt"),m(e,"viewBox","0 0 56 56"),m(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),a(e,n),a(n,o),a(n,i)},d(t){t&&u(e)}}}function ct(e){let n,o,i,r=e[0]===Z.Mic&&it(),s=e[0]===Z.Error&&rt(),c=e[0]===Z.Denied&&st();return{c(){r&&r.c(),n=g(),s&&s.c(),o=g(),c&&c.c(),i=p("")},m(t,e){r&&r.m(t,e),d(t,n,e),s&&s.m(t,e),d(t,o,e),c&&c.m(t,e),d(t,i,e)},p(t,[e]){t[0]===Z.Mic?r||(r=it(),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null),t[0]===Z.Error?s||(s=rt(),s.c(),s.m(o.parentNode,o)):s&&(s.d(1),s=null),t[0]===Z.Denied?c||(c=st(),c.c(),c.m(i.parentNode,i)):c&&(c.d(1),c=null)},i:t,o:t,d(t){r&&r.d(t),t&&u(n),s&&s.d(t),t&&u(o),c&&c.d(t),t&&u(i)}}}function at(t,e,n){let{icon:o=Z.Mic}=e;return t.$$set=t=>{"icon"in t&&n(0,o=t.icon)},[o]}class lt extends q{constructor(t){super(),G(this,t,at,ct,r,{icon:0},ot)}}function dt(t){l(t,"svelte-1fpkb0k",".Fx.svelte-1fpkb0k{position:absolute;width:var(--fx-size);height:var(--fx-size);top:50%;left:50%;transform-origin:50% 50%;transform:translate(-50%, -50%) rotate(var(--fx-rotation));pointer-events:none;opacity:var(--fx-opacity)}")}function ut(e){let n,o,i,r,s,c,l,f;return{c(){n=h("svg"),o=h("defs"),i=h("linearGradient"),r=h("stop"),s=h("stop"),c=h("filter"),l=h("feGaussianBlur"),f=h("circle"),m(r,"stop-color","var(--gradient-stop1)"),m(r,"offset","0%"),m(s,"stop-color","var(--gradient-stop2)"),m(s,"offset","100%"),m(i,"x1","50%"),m(i,"y1","10%"),m(i,"x2","50%"),m(i,"y2","100%"),m(i,"id","a"),m(l,"stdDeviation","18"),m(l,"in","SourceGraphic"),m(c,"x","-35%"),m(c,"y","-35%"),m(c,"width","170%"),m(c,"height","170%"),m(c,"filterUnits","objectBoundingBox"),m(c,"id","b"),m(f,"filter","url(#b)"),m(f,"cx","124"),m(f,"cy","124"),m(f,"r","79"),m(f,"fill","url(#a)"),m(f,"fillrule","evenodd"),m(n,"class","Fx svelte-1fpkb0k"),m(n,"viewBox","0 0 246 246"),m(n,"xmlns","http://www.w3.org/2000/svg")},m(t,e){d(t,n,e),a(n,o),a(o,i),a(i,r),a(i,s),a(o,c),a(c,l),a(n,f)},p:t,i:t,o:t,d(t){t&&u(n)}}}class ft extends q{constructor(t){super(),G(this,t,null,ut,r,{},dt)}}const{window:ht}=T;function pt(t){let e;return{c(){e=f("link"),m(e,"href",t[7]),m(e,"rel","stylesheet")},m(t,n){d(t,e,n)},p(t,n){128&n[0]&&m(e,"href",t[7])},d(t){t&&u(e)}}}function gt(e){let n,i,r,s,c,l,h,p,b,y,x,k,z=void 0!==e[7]&&pt(e);return r=new ft({}),c=new Q({props:{frameRadius:e[14]}}),h=new lt({props:{icon:e[13].icon}}),{c(){z&&z.c(),n=g(),i=f("main"),I(r.$$.fragment),s=g(),I(c.$$.fragment),l=g(),I(h.$$.fragment),p=g(),b=f("slot"),this.c=t,m(i,"class","HoldableButton"),v(i,"width",e[0]),v(i,"height",e[0]),v(i,"--gradient-stop1",e[5]),v(i,"--gradient-stop2",e[6]),v(i,"--fx-rotation",e[9][1]+"deg"),v(i,"--fx-opacity",e[12][1]),v(i,"--fx-size",e[2]),v(i,"--icon-opacity",e[11][1]),v(i,"--icon-size",e[1]),v(i,"--icon-color",e[4]),v(i,"--frame-stroke-width",e[15]),v(i,"--frame-background",e[3]),v(i,"transform","scale("+e[10][1]+")"),w(i,"pressed",e[8])},m(t,o){z&&z.m(t,o),d(t,n,o),d(t,i,o),V(r,i,null),a(i,s),V(c,i,null),a(i,l),V(h,i,null),a(i,p),a(i,b),y=!0,x||(k=[$(ht,"mouseup",e[17]),$(ht,"keydown",e[18]),$(ht,"keyup",e[19]),$(i,"mousedown",e[16]),$(i,"touchstart",e[16]),$(i,"dragstart",e[16]),$(i,"mouseup",e[17]),$(i,"touchend",e[17],{passive:!0}),$(i,"dragend",e[17])],x=!0)},p(t,e){void 0!==t[7]?z?z.p(t,e):(z=pt(t),z.c(),z.m(n.parentNode,n)):z&&(z.d(1),z=null);const o={};16384&e[0]&&(o.frameRadius=t[14]),c.$set(o);const r={};8192&e[0]&&(r.icon=t[13].icon),h.$set(r),(!y||1&e[0])&&v(i,"width",t[0]),(!y||1&e[0])&&v(i,"height",t[0]),(!y||32&e[0])&&v(i,"--gradient-stop1",t[5]),(!y||64&e[0])&&v(i,"--gradient-stop2",t[6]),(!y||512&e[0])&&v(i,"--fx-rotation",t[9][1]+"deg"),(!y||4096&e[0])&&v(i,"--fx-opacity",t[12][1]),(!y||4&e[0])&&v(i,"--fx-size",t[2]),(!y||2048&e[0])&&v(i,"--icon-opacity",t[11][1]),(!y||2&e[0])&&v(i,"--icon-size",t[1]),(!y||16&e[0])&&v(i,"--icon-color",t[4]),(!y||32768&e[0])&&v(i,"--frame-stroke-width",t[15]),(!y||8&e[0])&&v(i,"--frame-background",t[3]),(!y||1024&e[0])&&v(i,"transform","scale("+t[10][1]+")"),256&e[0]&&w(i,"pressed",t[8])},i(t){y||(A(r.$$.fragment,t),A(c.$$.fragment,t),A(h.$$.fragment,t),y=!0)},o(t){j(r.$$.fragment,t),j(c.$$.fragment,t),j(h.$$.fragment,t),y=!1},d(t){z&&z.d(t),t&&u(n),t&&u(i),P(r),P(c),P(h),x=!1,o(k)}}}function $t(t,e,n){let o,i,r,s,{icon:c=W.Disconnected}=e,{capturekey:a=" "}=e,{hide:l}=e,{size:d="88px"}=e,{holdscale:u="1.35"}=e,{borderscale:f="0.06"}=e,{iconsize:h="60%"}=e,{fxsize:p="250%"}=e,{backgroundcolor:g="#ffffff"}=e,{iconcolor:$="#000000"}=e,{gradientstop1:m="#15e8b5"}=e,{gradientstop2:v="#4fa1f9"}=e,{customcssurl:w}=e;let b=!1,y=0,x=[0,0],z=[0,0],E=[1,1],_=[0,0],C=nt[c],M=null,D=0,N=0;const S=k(),B=(t,e)=>{S.dispatchEvent(new CustomEvent(t,{detail:e,composed:!0}))};var L;L=()=>{n(10,z=[1,0]);let t=null;const e=()=>{D=N,N=(new Date).getTime();const i=N-(D||N);C.effect===et.Connecting&&n(11,E[0]=.25*Math.cos(N/2500*Math.PI*2)+.25,E),C.effect===et.Busy&&n(11,E[0]=.25*Math.cos(N/1e3*Math.PI*2)+.25,E),n(10,z=[z[0],A(z[1],o?z[0]:0,.2,i)]),n(11,E=[E[0],A(E[1],E[0],.08,i)]),n(12,_=[_[0],A(_[1],_[0],.08,i)]),n(9,x=[x[0]+2.5,A(x[1],x[0],.05,i)]),t=requestAnimationFrame(e)};return e(),()=>cancelAnimationFrame(t)},k().$$.on_mount.push(L);const R=t=>{t.preventDefault(),t.stopPropagation(),o&&!b&&(n(8,b=!0),y=Date.now(),j(),C.behaviour===tt.Click&&(n(9,x[0]+=720,x),null===M&&(M=window.setTimeout((()=>{n(12,_[0]=0,_),M=null}),500))),S.onholdstart&&S.onholdstart(),B(Y.holdstart))},F=()=>{if(b){n(8,b=!1);const t={timeMs:Date.now()-y};j(),null!==M&&window.clearTimeout(M),S.onholdend&&S.onholdend(t),B("holdend",t)}},A=(t,e,n,o)=>t*(1-(n=Math.pow(n,1e3/60/o)))+e*n,j=(t=5)=>{void 0!==navigator.vibrate&&navigator.vibrate(t)};return t.$$set=t=>{"icon"in t&&n(20,c=t.icon),"capturekey"in t&&n(21,a=t.capturekey),"hide"in t&&n(22,l=t.hide),"size"in t&&n(0,d=t.size),"holdscale"in t&&n(23,u=t.holdscale),"borderscale"in t&&n(24,f=t.borderscale),"iconsize"in t&&n(1,h=t.iconsize),"fxsize"in t&&n(2,p=t.fxsize),"backgroundcolor"in t&&n(3,g=t.backgroundcolor),"iconcolor"in t&&n(4,$=t.iconcolor),"gradientstop1"in t&&n(5,m=t.gradientstop1),"gradientstop2"in t&&n(6,v=t.gradientstop2),"customcssurl"in t&&n(7,w=t.customcssurl)},t.$$.update=()=>{4194304&t.$$.dirty[0]&&(o=void 0===l||"false"===l),16777216&t.$$.dirty[0]&&n(15,i=""+46*f),16777216&t.$$.dirty[0]&&n(14,r=46-23*f),8388608&t.$$.dirty[0]&&(s=u),1048832&t.$$.dirty[0]&&((t,e)=>{switch(n(13,C=nt[e]),n(10,z[0]=t?s:1,z),n(12,_[0]=t||e==W.Recording?1:0,_),C.icon){case Z.Mic:case Z.Denied:case Z.Error:n(11,E[0]=1,E)}})(b,c)},[d,h,p,g,$,m,v,w,b,x,z,E,_,C,r,i,R,F,t=>{a&&(t.key===a&&(document.hasFocus()&&document.activeElement!==document.body&&document.activeElement!==document.documentElement&&document.activeElement||null||(t.repeat?(t.preventDefault(),t.stopPropagation()):R(t))))},t=>{t.key===a&&F()},c,a,l,u,f,()=>b]}class mt extends O{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{text-align:left;position:relative;pointer-events:auto;cursor:pointer;border-radius:50%;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none !important;-webkit-user-select:none !important}</style>",G(this,{target:this.shadowRoot,props:b(this.attributes),customElement:!0},$t,gt,s,{icon:20,capturekey:21,hide:22,size:0,holdscale:23,borderscale:24,iconsize:1,fxsize:2,backgroundcolor:3,iconcolor:4,gradientstop1:5,gradientstop2:6,customcssurl:7,isbuttonpressed:25},null,[-1,-1]),t&&(t.target&&d(t.target,this,t.anchor),t.props&&(this.$set(t.props),L()))}static get observedAttributes(){return["icon","capturekey","hide","size","holdscale","borderscale","iconsize","fxsize","backgroundcolor","iconcolor","gradientstop1","gradientstop2","customcssurl","isbuttonpressed"]}get icon(){return this.$$.ctx[20]}set icon(t){this.$$set({icon:t}),L()}get capturekey(){return this.$$.ctx[21]}set capturekey(t){this.$$set({capturekey:t}),L()}get hide(){return this.$$.ctx[22]}set hide(t){this.$$set({hide:t}),L()}get size(){return this.$$.ctx[0]}set size(t){this.$$set({size:t}),L()}get holdscale(){return this.$$.ctx[23]}set holdscale(t){this.$$set({holdscale:t}),L()}get borderscale(){return this.$$.ctx[24]}set borderscale(t){this.$$set({borderscale:t}),L()}get iconsize(){return this.$$.ctx[1]}set iconsize(t){this.$$set({iconsize:t}),L()}get fxsize(){return this.$$.ctx[2]}set fxsize(t){this.$$set({fxsize:t}),L()}get backgroundcolor(){return this.$$.ctx[3]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),L()}get iconcolor(){return this.$$.ctx[4]}set iconcolor(t){this.$$set({iconcolor:t}),L()}get gradientstop1(){return this.$$.ctx[5]}set gradientstop1(t){this.$$set({gradientstop1:t}),L()}get gradientstop2(){return this.$$.ctx[6]}set gradientstop2(t){this.$$set({gradientstop2:t}),L()}get customcssurl(){return this.$$.ctx[7]}set customcssurl(t){this.$$set({customcssurl:t}),L()}get isbuttonpressed(){return this.$$.ctx[25]}}customElements.get("holdable-button")?console.warn("Skipping re-defining customElement holdable-button"):customElements.define("holdable-button",mt)})); | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function i(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e}function c(t){return 0===Object.keys(t).length}function a(t,e){t.appendChild(e)}function l(t,e,n){const o=function(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;if(e&&e.host)return e;return t.ownerDocument}(t);if(!o.getElementById(e)){const t=f("style");t.id=e,t.textContent=n,function(t,e){a(t.head||t,e)}(o,t)}}function d(t,e,n){t.insertBefore(e,n||null)}function u(t){t.parentNode.removeChild(t)}function f(t){return document.createElement(t)}function h(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function p(t){return document.createTextNode(t)}function g(){return p(" ")}function $(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function m(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function v(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function x(t,e,n){t.classList[n?"add":"remove"](e)}function w(t){const e={};for(const n of t)e[n.name]=n.value;return e}let b;function y(t){b=t}function k(){if(!b)throw new Error("Function called outside component initialization");return b}const z=[],M=[],E=[],C=[],_=Promise.resolve();let N=!1;function D(t){E.push(t)}let B=!1;const S=new Set;function F(){if(!B){B=!0;do{for(let t=0;t<z.length;t+=1){const e=z[t];y(e),L(e.$$)}for(y(null),z.length=0;M.length;)M.pop()();for(let t=0;t<E.length;t+=1){const e=E[t];S.has(e)||(S.add(e),e())}E.length=0}while(z.length);for(;C.length;)C.pop()();N=!1,B=!1,S.clear()}}function L(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(D)}}const A=new Set;function R(t,e){t&&t.i&&(A.delete(t),t.i(e))}function T(t,e,n,o){if(t&&t.o){if(A.has(t))return;A.add(t),undefined.c.push((()=>{A.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}const I="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function V(t){t&&t.c()}function P(t,n,r,s){const{fragment:c,on_mount:a,on_destroy:l,after_update:d}=t.$$;c&&c.m(n,r),s||D((()=>{const n=a.map(e).filter(i);l?l.push(...n):o(n),t.$$.on_mount=[]})),d.forEach(D)}function G(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=[])}function H(t,e){-1===t.$$.dirty[0]&&(z.push(t),N||(N=!0,_.then(F)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function j(e,i,r,s,c,a,l,d=[-1]){const f=b;y(e);const h=e.$$={fragment:null,ctx:null,props:a,update:t,not_equal:c,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(i.context||(f?f.$$.context:[])),callbacks:n(),dirty:d,skip_bound:!1,root:i.target||f.$$.root};l&&l(h.root);let p=!1;if(h.ctx=r?r(e,i.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return h.ctx&&c(h.ctx[t],h.ctx[t]=i)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](i),p&&H(e,t)),n})):[],h.update(),p=!0,o(h.before_update),h.fragment=!!s&&s(h.ctx),i.target){if(i.hydrate){const t=function(t){return Array.from(t.childNodes)}(i.target);h.fragment&&h.fragment.l(t),t.forEach(u)}else h.fragment&&h.fragment.c();i.intro&&R(e.$$.fragment),P(e,i.target,i.anchor,i.customElement),F()}y(f)}let O;"function"==typeof HTMLElement&&(O=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){G(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&&!c(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class q{$destroy(){G(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&&!c(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function W(t){l(t,"svelte-1mwhwtl",".Frame.svelte-1mwhwtl{position:absolute;width:100%;height:100%;top:50%;left:50%;transform-origin:50% 50%;transform:translate(-50%, -50%) rotate(var(--fx-rotation));transition:width 0.1s, height 0.1s;pointer-events:none;user-select:none}")}function U(e){let n,o,i,r,s,c,l;return{c(){n=h("svg"),o=h("defs"),i=h("linearGradient"),r=h("stop"),s=h("stop"),c=h("circle"),l=h("circle"),m(r,"stop-color","var(--gradient-stop1)"),m(r,"offset","0%"),m(s,"stop-color","var(--gradient-stop2)"),m(s,"offset","100%"),m(i,"x1","50%"),m(i,"y1","0%"),m(i,"x2","50%"),m(i,"y2","100%"),m(i,"id","a"),m(c,"cx","46"),m(c,"cy","46"),m(c,"r",e[0]),m(c,"stroke","none"),m(c,"fill","var(--frame-background)"),m(l,"cx","46"),m(l,"cy","46"),m(l,"r",e[0]),m(l,"stroke","url(#a)"),m(l,"stroke-width","var(--frame-stroke-width)"),m(l,"fill","none"),m(n,"class","Frame svelte-1mwhwtl"),m(n,"viewBox","0 0 92 92"),m(n,"xmlns","http://www.w3.org/2000/svg")},m(t,e){d(t,n,e),a(n,o),a(o,i),a(i,r),a(i,s),a(n,c),a(n,l)},p(t,[e]){1&e&&m(c,"r",t[0]),1&e&&m(l,"r",t[0])},i:t,o:t,d(t){t&&u(n)}}}function J(t,e,n){let{frameRadius:o=46}=e;return t.$$set=t=>{"frameRadius"in t&&n(0,o=t.frameRadius)},[o]}class K extends q{constructor(t){super(),j(this,t,J,U,r,{frameRadius:0},W)}}var Q,X,Y,Z,tt,et,nt;!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"}(Q||(Q={})),function(t){t.SpeechlyFirstConnect="SpeechlyFirstConnect"}(X||(X={})),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"}(Y||(Y={})),function(t){t.Mic="mic",t.MicActive="micactive",t.Error="error",t.Denied="denied"}(Z||(Z={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(tt||(tt={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(et||(et={})),function(t){t.None="none",t.Whirl="whirl"}(nt||(nt={}));const ot={[Q.Disconnected]:{icon:"mic",behaviour:"click",effect:"none",triggerFx:"whirl"},[Q.Disconnecting]:{icon:"mic",behaviour:"noninteractive",effect:"connecting"},[Q.Connecting]:{icon:"mic",behaviour:"noninteractive",effect:"connecting"},[Q.Connected]:{icon:"mic",behaviour:"hold",effect:"none",triggerFx:"whirl"},[Q.Starting]:{icon:"mic",behaviour:"hold",effect:"connecting"},[Q.Recording]:{icon:"micactive",behaviour:"hold",effect:"none"},[Q.Stopping]:{icon:"mic",behaviour:"noninteractive",effect:"busy"},[Q.Failed]:{icon:"error",behaviour:"click",effect:"none"},[Q.NoBrowserSupport]:{icon:"error",behaviour:"click",effect:"none"},[Q.NoAudioConsent]:{icon:"denied",behaviour:"click",effect:"none"}};function it(t){l(t,"svelte-s2u2hd",".Icon.svelte-s2u2hd{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 rt(t){let e,n,o,i,r,s,c,l,f,g,$,v,x;return{c(){e=h("svg"),n=h("linearGradient"),o=h("animate"),i=h("animate"),r=h("stop"),s=h("stop"),c=h("stop"),l=h("stop"),f=h("stop"),g=p(">\n "),$=h("g"),v=h("path"),x=h("rect"),m(o,"attributeName","y1"),m(o,"values","-200%; 0%;"),m(o,"dur","2s"),m(o,"repeatCount","indefinite"),m(i,"attributeName","y2"),m(i,"values","200%; 400%;"),m(i,"dur","2s"),m(i,"repeatCount","indefinite"),m(r,"offset","0%"),m(r,"stop-color","var(--gradient-stop1)"),m(s,"offset","25%"),m(s,"stop-color","var(--gradient-stop2)"),m(c,"offset","50%"),m(c,"stop-color","var(--gradient-stop1)"),m(l,"offset","75%"),m(l,"stop-color","var(--gradient-stop2)"),m(f,"offset","100%"),m(f,"stop-color","var(--gradient-stop1)"),m(n,"id","gradient"),m(n,"x1","50%"),m(n,"y1","-200%"),m(n,"x2","50%"),m(n,"y2","200%"),m(v,"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"),m(x,"x","20"),m(x,"y","1"),m(x,"width","16"),m(x,"height","37"),m(x,"rx","8"),m($,"fill","url(#gradient)"),m($,"fill-rule","evenodd"),m(e,"class","Icon svelte-s2u2hd"),m(e,"viewBox","0 0 56 56"),m(e,"xmlns","http://www.w3.org/2000/svg")},m(t,u){d(t,e,u),a(e,n),a(n,o),a(n,i),a(n,r),a(n,s),a(n,c),a(n,l),a(n,f),a(e,g),a(e,$),a($,v),a($,x)},d(t){t&&u(e)}}}function st(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("rect"),m(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"),m(i,"x","20"),m(i,"y","1"),m(i,"width","16"),m(i,"height","37"),m(i,"rx","8"),m(n,"fill","var(--icon-color)"),m(n,"fill-rule","evenodd"),m(e,"class","Icon svelte-s2u2hd"),m(e,"viewBox","0 0 56 56"),m(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),a(e,n),a(n,o),a(n,i)},d(t){t&&u(e)}}}function ct(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("path"),m(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"),m(o,"fill-rule","nonzero"),m(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"),m(n,"fill","var(--icon-color)"),m(n,"fill-rule","evenodd"),m(e,"class","Icon svelte-s2u2hd"),m(e,"viewBox","0 0 56 56"),m(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),a(e,n),a(n,o),a(n,i)},d(t){t&&u(e)}}}function at(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("path"),m(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"),m(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"),m(n,"fill","var(--icon-color)"),m(n,"fill-rule","nonzero"),m(e,"class","Icon svelte-s2u2hd"),m(e,"viewBox","0 0 56 56"),m(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),a(e,n),a(n,o),a(n,i)},d(t){t&&u(e)}}}function lt(e){let n,o,i,r,s=e[0]===Z.MicActive&&rt(),c=e[0]===Z.Mic&&st(),a=e[0]===Z.Error&&ct(),l=e[0]===Z.Denied&&at();return{c(){s&&s.c(),n=g(),c&&c.c(),o=g(),a&&a.c(),i=g(),l&&l.c(),r=p("")},m(t,e){s&&s.m(t,e),d(t,n,e),c&&c.m(t,e),d(t,o,e),a&&a.m(t,e),d(t,i,e),l&&l.m(t,e),d(t,r,e)},p(t,[e]){t[0]===Z.MicActive?s||(s=rt(),s.c(),s.m(n.parentNode,n)):s&&(s.d(1),s=null),t[0]===Z.Mic?c||(c=st(),c.c(),c.m(o.parentNode,o)):c&&(c.d(1),c=null),t[0]===Z.Error?a||(a=ct(),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null),t[0]===Z.Denied?l||(l=at(),l.c(),l.m(r.parentNode,r)):l&&(l.d(1),l=null)},i:t,o:t,d(t){s&&s.d(t),t&&u(n),c&&c.d(t),t&&u(o),a&&a.d(t),t&&u(i),l&&l.d(t),t&&u(r)}}}function dt(t,e,n){let{icon:o=Z.Mic}=e;return t.$$set=t=>{"icon"in t&&n(0,o=t.icon)},[o]}class ut extends q{constructor(t){super(),j(this,t,dt,lt,r,{icon:0},it)}}function ft(t){l(t,"svelte-1fpkb0k",".Fx.svelte-1fpkb0k{position:absolute;width:var(--fx-size);height:var(--fx-size);top:50%;left:50%;transform-origin:50% 50%;transform:translate(-50%, -50%) rotate(var(--fx-rotation));pointer-events:none;opacity:var(--fx-opacity)}")}function ht(e){let n,o,i,r,s,c,l,f;return{c(){n=h("svg"),o=h("defs"),i=h("linearGradient"),r=h("stop"),s=h("stop"),c=h("filter"),l=h("feGaussianBlur"),f=h("circle"),m(r,"stop-color","var(--fx-gradient-stop1)"),m(r,"offset","0%"),m(s,"stop-color","var(--fx-gradient-stop2)"),m(s,"offset","100%"),m(i,"x1","50%"),m(i,"y1","10%"),m(i,"x2","50%"),m(i,"y2","100%"),m(i,"id","a"),m(l,"stdDeviation","18"),m(l,"in","SourceGraphic"),m(c,"x","-35%"),m(c,"y","-35%"),m(c,"width","170%"),m(c,"height","170%"),m(c,"filterUnits","objectBoundingBox"),m(c,"id","b"),m(f,"filter","url(#b)"),m(f,"cx","124"),m(f,"cy","124"),m(f,"r","79"),m(f,"fill","url(#a)"),m(f,"fillrule","evenodd"),m(n,"class","Fx svelte-1fpkb0k"),m(n,"viewBox","0 0 246 246"),m(n,"xmlns","http://www.w3.org/2000/svg")},m(t,e){d(t,n,e),a(n,o),a(o,i),a(i,r),a(i,s),a(o,c),a(c,l),a(n,f)},p:t,i:t,o:t,d(t){t&&u(n)}}}class pt extends q{constructor(t){super(),j(this,t,null,ht,r,{},ft)}}const{window:gt}=I;function $t(t){let e;return{c(){e=f("link"),m(e,"href",t[9]),m(e,"rel","stylesheet")},m(t,n){d(t,e,n)},p(t,n){512&n[0]&&m(e,"href",t[9])},d(t){t&&u(e)}}}function mt(e){let n,i,r,s,c,l,h,p,w,b,y,k,z=void 0!==e[9]&&$t(e);return r=new pt({}),c=new K({props:{frameRadius:e[16]}}),h=new ut({props:{icon:e[15].icon}}),{c(){z&&z.c(),n=g(),i=f("main"),V(r.$$.fragment),s=g(),V(c.$$.fragment),l=g(),V(h.$$.fragment),p=g(),w=f("slot"),this.c=t,m(i,"class","HoldableButton"),v(i,"width",e[0]),v(i,"height",e[0]),v(i,"--gradient-stop1",e[5]),v(i,"--gradient-stop2",e[6]),v(i,"--fx-gradient-stop1",e[7]||e[5]),v(i,"--fx-gradient-stop2",e[8]||e[6]),v(i,"--fx-rotation",e[11][1]+"deg"),v(i,"--fx-opacity",e[14][1]),v(i,"--fx-size",e[2]),v(i,"--icon-opacity",e[13][1]),v(i,"--icon-size",e[1]),v(i,"--icon-color",e[4]),v(i,"--frame-stroke-width",e[17]),v(i,"--frame-background",e[3]),v(i,"transform","scale("+e[12][1]+")"),x(i,"pressed",e[10])},m(t,o){z&&z.m(t,o),d(t,n,o),d(t,i,o),P(r,i,null),a(i,s),P(c,i,null),a(i,l),P(h,i,null),a(i,p),a(i,w),b=!0,y||(k=[$(gt,"mouseup",e[19]),$(gt,"keydown",e[20]),$(gt,"keyup",e[21]),$(i,"mousedown",e[18]),$(i,"touchstart",e[18]),$(i,"dragstart",e[18]),$(i,"mouseup",e[19]),$(i,"touchend",e[19],{passive:!0}),$(i,"dragend",e[19])],y=!0)},p(t,e){void 0!==t[9]?z?z.p(t,e):(z=$t(t),z.c(),z.m(n.parentNode,n)):z&&(z.d(1),z=null);const o={};65536&e[0]&&(o.frameRadius=t[16]),c.$set(o);const r={};32768&e[0]&&(r.icon=t[15].icon),h.$set(r),(!b||1&e[0])&&v(i,"width",t[0]),(!b||1&e[0])&&v(i,"height",t[0]),(!b||32&e[0])&&v(i,"--gradient-stop1",t[5]),(!b||64&e[0])&&v(i,"--gradient-stop2",t[6]),(!b||160&e[0])&&v(i,"--fx-gradient-stop1",t[7]||t[5]),(!b||320&e[0])&&v(i,"--fx-gradient-stop2",t[8]||t[6]),(!b||2048&e[0])&&v(i,"--fx-rotation",t[11][1]+"deg"),(!b||16384&e[0])&&v(i,"--fx-opacity",t[14][1]),(!b||4&e[0])&&v(i,"--fx-size",t[2]),(!b||8192&e[0])&&v(i,"--icon-opacity",t[13][1]),(!b||2&e[0])&&v(i,"--icon-size",t[1]),(!b||16&e[0])&&v(i,"--icon-color",t[4]),(!b||131072&e[0])&&v(i,"--frame-stroke-width",t[17]),(!b||8&e[0])&&v(i,"--frame-background",t[3]),(!b||4096&e[0])&&v(i,"transform","scale("+t[12][1]+")"),1024&e[0]&&x(i,"pressed",t[10])},i(t){b||(R(r.$$.fragment,t),R(c.$$.fragment,t),R(h.$$.fragment,t),b=!0)},o(t){T(r.$$.fragment,t),T(c.$$.fragment,t),T(h.$$.fragment,t),b=!1},d(t){z&&z.d(t),t&&u(n),t&&u(i),G(r),G(c),G(h),y=!1,o(k)}}}function vt(t,e,n){let o,i,r,s,{icon:c=Q.Disconnected}=e,{capturekey:a=" "}=e,{hide:l}=e,{size:d="88px"}=e,{holdscale:u="1.35"}=e,{borderscale:f="0.06"}=e,{iconsize:h="60%"}=e,{fxsize:p="250%"}=e,{backgroundcolor:g="#ffffff"}=e,{iconcolor:$="#000000"}=e,{gradientstop1:m="#15e8b5"}=e,{gradientstop2:v="#4fa1f9"}=e,{fxgradientstop1:x}=e,{fxgradientstop2:w}=e,{customcssurl:b}=e;let y=!1,z=0,M=[0,0],E=[0,0],C=[1,1],_=[0,0],N=ot[c],D=null,B=0,S=0;const F=k(),L=(t,e)=>{F.dispatchEvent(new CustomEvent(t,{detail:e,composed:!0}))};var A;A=()=>{n(12,E=[1,0]);let t=null;const e=()=>{B=S,S=(new Date).getTime();const i=S-(B||S);N.effect===et.Connecting&&n(13,C[0]=.25*Math.cos(S/2500*Math.PI*2)+.25,C),N.effect===et.Busy&&n(13,C[0]=.25*Math.cos(S/1e3*Math.PI*2)+.25,C),n(12,E=[E[0],I(E[1],o?E[0]:0,.2,i)]),n(13,C=[C[0],I(C[1],C[0],.08,i)]),n(14,_=[_[0],I(_[1],_[0],.08,i)]),n(11,M=[M[0]+2.5,I(M[1],M[0],.05,i)]),t=requestAnimationFrame(e)};return e(),()=>cancelAnimationFrame(t)},k().$$.on_mount.push(A);const R=t=>{t.preventDefault(),t.stopPropagation(),o&&!y&&(n(10,y=!0),z=Date.now(),V(),N.triggerFx===nt.Whirl&&n(11,M[0]+=720,M),N.behaviour===tt.Click&&null===D&&(D=window.setTimeout((()=>{n(14,_[0]=0,_),D=null}),500)),F.onholdstart&&F.onholdstart(),L(Y.holdstart))},T=()=>{if(y){n(10,y=!1);const t={timeMs:Date.now()-z};V(),null!==D&&window.clearTimeout(D),F.onholdend&&F.onholdend(t),L("holdend",t)}},I=(t,e,n,o)=>t*(1-(n=Math.pow(n,1e3/60/o)))+e*n,V=(t=5)=>{void 0!==navigator.vibrate&&navigator.vibrate(t)};return t.$$set=t=>{"icon"in t&&n(22,c=t.icon),"capturekey"in t&&n(23,a=t.capturekey),"hide"in t&&n(24,l=t.hide),"size"in t&&n(0,d=t.size),"holdscale"in t&&n(25,u=t.holdscale),"borderscale"in t&&n(26,f=t.borderscale),"iconsize"in t&&n(1,h=t.iconsize),"fxsize"in t&&n(2,p=t.fxsize),"backgroundcolor"in t&&n(3,g=t.backgroundcolor),"iconcolor"in t&&n(4,$=t.iconcolor),"gradientstop1"in t&&n(5,m=t.gradientstop1),"gradientstop2"in t&&n(6,v=t.gradientstop2),"fxgradientstop1"in t&&n(7,x=t.fxgradientstop1),"fxgradientstop2"in t&&n(8,w=t.fxgradientstop2),"customcssurl"in t&&n(9,b=t.customcssurl)},t.$$.update=()=>{16777216&t.$$.dirty[0]&&(o=void 0===l||"false"===l),67108864&t.$$.dirty[0]&&n(17,i=""+46*f),67108864&t.$$.dirty[0]&&n(16,r=46-23*f),33554432&t.$$.dirty[0]&&(s=u),4195328&t.$$.dirty[0]&&((t,e)=>{switch(n(15,N=ot[e]),n(12,E[0]=t?s:1,E),n(14,_[0]=t||e==Q.Recording?1:0,_),N.icon){case Z.MicActive:case Z.Mic:case Z.Denied:case Z.Error:n(13,C[0]=1,C)}})(y,c)},[d,h,p,g,$,m,v,x,w,b,y,M,E,C,_,N,r,i,R,T,t=>{a&&(t.key===a&&(document.hasFocus()&&document.activeElement!==document.body&&document.activeElement!==document.documentElement&&document.activeElement||null||(t.repeat?(t.preventDefault(),t.stopPropagation()):R(t))))},t=>{t.key===a&&T()},c,a,l,u,f,()=>y]}class xt extends O{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{text-align:left;position:relative;pointer-events:auto;cursor:pointer;border-radius:50%;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none !important;-webkit-user-select:none !important}</style>",j(this,{target:this.shadowRoot,props:w(this.attributes),customElement:!0},vt,mt,s,{icon:22,capturekey:23,hide:24,size:0,holdscale:25,borderscale:26,iconsize:1,fxsize:2,backgroundcolor:3,iconcolor:4,gradientstop1:5,gradientstop2:6,fxgradientstop1:7,fxgradientstop2:8,customcssurl:9,isbuttonpressed:27},null,[-1,-1]),t&&(t.target&&d(t.target,this,t.anchor),t.props&&(this.$set(t.props),F()))}static get observedAttributes(){return["icon","capturekey","hide","size","holdscale","borderscale","iconsize","fxsize","backgroundcolor","iconcolor","gradientstop1","gradientstop2","fxgradientstop1","fxgradientstop2","customcssurl","isbuttonpressed"]}get icon(){return this.$$.ctx[22]}set icon(t){this.$$set({icon:t}),F()}get capturekey(){return this.$$.ctx[23]}set capturekey(t){this.$$set({capturekey:t}),F()}get hide(){return this.$$.ctx[24]}set hide(t){this.$$set({hide:t}),F()}get size(){return this.$$.ctx[0]}set size(t){this.$$set({size:t}),F()}get holdscale(){return this.$$.ctx[25]}set holdscale(t){this.$$set({holdscale:t}),F()}get borderscale(){return this.$$.ctx[26]}set borderscale(t){this.$$set({borderscale:t}),F()}get iconsize(){return this.$$.ctx[1]}set iconsize(t){this.$$set({iconsize:t}),F()}get fxsize(){return this.$$.ctx[2]}set fxsize(t){this.$$set({fxsize:t}),F()}get backgroundcolor(){return this.$$.ctx[3]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),F()}get iconcolor(){return this.$$.ctx[4]}set iconcolor(t){this.$$set({iconcolor:t}),F()}get gradientstop1(){return this.$$.ctx[5]}set gradientstop1(t){this.$$set({gradientstop1:t}),F()}get gradientstop2(){return this.$$.ctx[6]}set gradientstop2(t){this.$$set({gradientstop2:t}),F()}get fxgradientstop1(){return this.$$.ctx[7]}set fxgradientstop1(t){this.$$set({fxgradientstop1:t}),F()}get fxgradientstop2(){return this.$$.ctx[8]}set fxgradientstop2(t){this.$$set({fxgradientstop2:t}),F()}get customcssurl(){return this.$$.ctx[9]}set customcssurl(t){this.$$set({customcssurl:t}),F()}get isbuttonpressed(){return this.$$.ctx[27]}}customElements.get("holdable-button")?console.warn("Skipping re-defining customElement holdable-button"):customElements.define("holdable-button",xt)})); | ||
//# sourceMappingURL=holdable-button.js.map |
@@ -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 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 T=new Set;let M,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);T.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||(T.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),T.clear())})))}function P(t){M=t}function D(){if(!M)throw new Error("Function called outside component initialization");return M}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=M;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,Mt,Tt,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 Tt(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 Mt(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,T;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||(T=[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(T)}}}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),g&&(window.clearTimeout(g),g=null),"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(console.log(t),t.data.type){case ht.speechlypoweron:"auto"===r&&n(5,o=!0);break;case ht.speechlystarting:m===Dt?g=window.setTimeout((()=>{g=null,n(3,m=Rt),"auto"===r&&n(5,o=!0)}),500):n(5,o=!0);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)})); | ||
!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 v(t){return document.createElement(t)}function $(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function b(t){return document.createTextNode(t)}function x(){return b(" ")}function C(){return b("")}function _(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function k(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 N,T=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=v("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`,T+=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(", "),T-=i,T||d((()=>{T||(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){N=t}function D(){if(!N)throw new Error("Function called outside component initialization");return N}const R=[],B=[],H=[],V=[],F=Promise.resolve();let O=!1;function I(t){H.push(t)}let j=!1;const q=new Set;function G(){if(!j){j=!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;B.length;)B.pop()();for(let t=0;t<H.length;t+=1){const e=H[t];q.has(e)||(q.add(e),e())}H.length=0}while(R.length);for(;V.length;)V.pop()();O=!1,j=!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(I)}}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 v(o){const{delay:r=0,duration:s=300,easing:c=e,tick:v=t,css:$}=l||et,b={start:u()+r,b:o};o||(b.group=Q,Q.r+=1),f||m?m=b:($&&(w(),g=L(n,a,o,s,r,c,$)),o&&v(0,1),f=y(b,s),I((()=>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"),$&&(w(),g=L(n,a,f.b,f.duration,0,c,l.css))),f)if(t>=f.end)v(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),v(a,1-a)}return!(!f&&!m)})))}return{run(t){r(l)?(U||(U=Promise.resolve(),U.then((()=>{U=null}))),U).then((()=>{l=l(),v(t)})):v(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||I((()=>{const e=l.map(n).filter(r);a?a.push(...e):i(e),t.$$.on_mount=[]})),u.forEach(I)}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=N;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,wt;function yt(t){!function(t,e,n){const o=m(t);if(!o.getElementById(e)){const t=v("style");t.id=e,t.textContent=n,g(o,t)}}(t,"svelte-s2u2hd",".Icon.svelte-s2u2hd{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 vt(t){let e,n,o,i,r,s,c,l,a,u,d,p,h;return{c(){e=$("svg"),n=$("linearGradient"),o=$("animate"),i=$("animate"),r=$("stop"),s=$("stop"),c=$("stop"),l=$("stop"),a=$("stop"),u=b(">\n "),d=$("g"),p=$("path"),h=$("rect"),k(o,"attributeName","y1"),k(o,"values","-200%; 0%;"),k(o,"dur","2s"),k(o,"repeatCount","indefinite"),k(i,"attributeName","y2"),k(i,"values","200%; 400%;"),k(i,"dur","2s"),k(i,"repeatCount","indefinite"),k(r,"offset","0%"),k(r,"stop-color","var(--gradient-stop1)"),k(s,"offset","25%"),k(s,"stop-color","var(--gradient-stop2)"),k(c,"offset","50%"),k(c,"stop-color","var(--gradient-stop1)"),k(l,"offset","75%"),k(l,"stop-color","var(--gradient-stop2)"),k(a,"offset","100%"),k(a,"stop-color","var(--gradient-stop1)"),k(n,"id","gradient"),k(n,"x1","50%"),k(n,"y1","-200%"),k(n,"x2","50%"),k(n,"y2","200%"),k(p,"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"),k(h,"x","20"),k(h,"y","1"),k(h,"width","16"),k(h,"height","37"),k(h,"rx","8"),k(d,"fill","url(#gradient)"),k(d,"fill-rule","evenodd"),k(e,"class","Icon svelte-s2u2hd"),k(e,"viewBox","0 0 56 56"),k(e,"xmlns","http://www.w3.org/2000/svg")},m(t,m){w(t,e,m),f(e,n),f(n,o),f(n,i),f(n,r),f(n,s),f(n,c),f(n,l),f(n,a),f(e,u),f(e,d),f(d,p),f(d,h)},d(t){t&&y(e)}}}function $t(t){let e,n,o,i;return{c(){e=$("svg"),n=$("g"),o=$("path"),i=$("rect"),k(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"),k(i,"x","20"),k(i,"y","1"),k(i,"width","16"),k(i,"height","37"),k(i,"rx","8"),k(n,"fill","var(--icon-color)"),k(n,"fill-rule","evenodd"),k(e,"class","Icon svelte-s2u2hd"),k(e,"viewBox","0 0 56 56"),k(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=$("svg"),n=$("g"),o=$("path"),i=$("path"),k(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"),k(o,"fill-rule","nonzero"),k(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"),k(n,"fill","var(--icon-color)"),k(n,"fill-rule","evenodd"),k(e,"class","Icon svelte-s2u2hd"),k(e,"viewBox","0 0 56 56"),k(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 xt(t){let e,n,o,i;return{c(){e=$("svg"),n=$("g"),o=$("path"),i=$("path"),k(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"),k(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"),k(n,"fill","var(--icon-color)"),k(n,"fill-rule","nonzero"),k(e,"class","Icon svelte-s2u2hd"),k(e,"viewBox","0 0 56 56"),k(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 Ct(e){let n,o,i,r,s=e[0]===ft.MicActive&&vt(),c=e[0]===ft.Mic&&$t(),l=e[0]===ft.Error&&bt(),a=e[0]===ft.Denied&&xt();return{c(){s&&s.c(),n=x(),c&&c.c(),o=x(),l&&l.c(),i=x(),a&&a.c(),r=C()},m(t,e){s&&s.m(t,e),w(t,n,e),c&&c.m(t,e),w(t,o,e),l&&l.m(t,e),w(t,i,e),a&&a.m(t,e),w(t,r,e)},p(t,[e]){t[0]===ft.MicActive?s||(s=vt(),s.c(),s.m(n.parentNode,n)):s&&(s.d(1),s=null),t[0]===ft.Mic?c||(c=$t(),c.c(),c.m(o.parentNode,o)):c&&(c.d(1),c=null),t[0]===ft.Error?l||(l=bt(),l.c(),l.m(i.parentNode,i)):l&&(l.d(1),l=null),t[0]===ft.Denied?a||(a=xt(),a.c(),a.m(r.parentNode,r)):a&&(a.d(1),a=null)},i:t,o:t,d(t){s&&s.d(t),t&&y(n),c&&c.d(t),t&&y(o),l&&l.d(t),t&&y(i),a&&a.d(t),t&&y(r)}}}function _t(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.MicActive="micactive",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={})),function(t){t.None="none",t.Whirl="whirl"}(wt||(wt={})),dt.Disconnected,dt.Disconnecting,dt.Connecting,dt.Connected,dt.Starting,dt.Recording,dt.Stopping,dt.Failed,dt.NoBrowserSupport,dt.NoAudioConsent;class kt 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,_t,Ct,s,{icon:0},yt)}}const{window:zt}=ot;function Et(t){let e;return{c(){e=v("link"),k(e,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),k(e,"rel","stylesheet")},m(t,n){w(t,e,n)},d(t){t&&y(e)}}}function St(t){let e;return{c(){e=v("link"),k(e,"href",t[2]),k(e,"rel","stylesheet")},m(t,n){w(t,e,n)},p(t,n){4&n&&k(e,"href",t[2])},d(t){t&&y(e)}}}function Mt(t){let e,n,o,i,r,s,c,l,a,u,d,p,h;const m=[Dt,Pt,At,Lt,Tt,Nt],g=[];function $(t,e){return t[3]===Bt?0:t[3]===Ht?1:t[3]===Vt?2:t[3]===dt.NoAudioConsent?3:t[3]===dt.NoBrowserSupport?4:5}return s=$(t),c=g[s]=m[s](t),{c(){e=v("modalbg"),o=x(),i=v("modalcontent"),r=v("main"),c.c(),l=x(),a=v("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>.',k(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=_(e,"click",t[8]),p=!0)},p(t,e){let n=s;s=$(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)&&k(i,"class",t[1]),66&e&&E(i,"defaultTypography",t[6])},i(o){d||(I((()=>{n||(n=nt(e,t[7],{},!0)),n.run(1)})),Z(c),I((()=>{u||(u=nt(i,t[7],{duration:150},!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],{duration:150},!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 Nt(e){let n,o,i,r,s,c,l,a,u,d,p;return{c(){n=v("h2"),n.textContent="Failed to connect Speechly",o=x(),i=v("p"),r=b("Please check that Speechly application id '"),s=b(e[4]),c=b("' has been successfully deployed."),l=x(),a=v("options"),u=v("button"),u.textContent="Aww, bummer",k(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=_(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 Tt(e){let n,o,i,r,s,c,l,a;return{c(){n=v("h2"),n.textContent="Unsupported Browser",o=x(),i=v("p"),i.textContent="To use the voice interface, please visit this site using a supported\n browser.",r=x(),s=v("options"),c=v("button"),c.textContent="Got it",k(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=_(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 Lt(e){let n,o,r,s,c,l,a,u,d,p,h,m;return{c(){n=v("h2"),n.textContent="Voice unavailable",o=x(),r=v("p"),r.textContent="Please reload the page to try again.",s=x(),c=v("p"),c.textContent="If that doesn't work, check your browser preferences to re-allow microphone use.",l=x(),a=v("options"),u=v("button"),u.textContent="Later",d=x(),p=v("button"),p.textContent="Reload",k(u,"class","wide"),k(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=[_(u,"click",e[8]),_(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 At(e){let n,o,r,s,c,l,a,u,d,p;return{c(){n=v("h2"),n.textContent="HTTPS Required",o=x(),r=v("p"),r.textContent="To use the voice interface, please visit this site using the secure\n https:// protocol.",s=x(),c=v("options"),l=v("button"),l.textContent="Try with HTTPS",a=x(),u=v("button"),u.textContent="Later",k(l,"class","wide"),k(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=[_(l,"click",e[15]),_(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 Pt(e){let n,o,i,r,s,c,l,a,u,d,p,h,m,g,$,C;return u=new kt({}),{c(){n=v("h2"),n.innerHTML='↖ <slot name="prompt-title">Allow microphone</slot>',o=x(),i=v("p"),r=v("slot"),s=b("Please click "),c=v("b"),c.textContent="Allow",l=b(" to use the microphone.\n We'll only listen to you when you press the "),a=v("span"),it(u.$$.fragment),d=b(" button."),p=x(),h=v("options"),m=v("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"),k(r,"name","prompt-body"),k(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,$||(C=_(m,"click",e[8]),$=!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),$=!1,C()}}}function Dt(e){let n,o,r,s,c,l,a,u,d,p,h,m,g,$,C,E,S,M;return d=new kt({}),{c(){n=v("h2"),n.innerHTML='<slot name="prompt-title">Allow microphone</slot>',o=x(),r=v("p"),s=v("slot"),c=b("Please click "),l=v("b"),l.textContent="Allow",a=b(" to use the microphone.\n We'll only listen to you when you press the "),u=v("span"),it(d.$$.fragment),p=b(" button."),h=x(),m=v("options"),g=v("button"),g.textContent="Later",$=x(),C=v("button"),C.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"),k(s,"name","welcome-body"),k(g,"class","wide"),k(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,$),f(m,C),E=!0,S||(M=[_(g,"click",e[8]),_(C,"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 Rt(e){let n,o,r,s,c,l,a,u=e[6]&&Et(),d=void 0!==e[2]&&St(e),p=e[5]&&Mt(e);return{c(){u&&u.c(),n=C(),o=x(),d&&d.c(),r=x(),s=v("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=[_(zt,"keydown",e[10]),_(zt,"message",e[11])],l=!0)},p(t,[e]){t[6]?u||(u=Et(),u.c(),u.m(n.parentNode,n)):u&&(u.d(1),u=null),void 0!==t[2]?d?d.p(t,e):(d=St(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=Mt(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 Bt="PagePriming",Ht="PagePrompt",Vt="HttpsRequired";function Ft(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=Bt,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),"*")},v=t=>{var e,i;("auto"===r&&n(5,o=!0),g&&(window.clearTimeout(g),g=null),"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=Vt)};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(console.log(t),t.data.type){case ht.speechlypoweron:"auto"===r&&n(5,o=!0);break;case ht.speechlystarting:m===Bt?g=window.setTimeout((()=>{g=null,n(3,m=Ht),"auto"===r&&n(5,o=!0)}),500):n(5,o=!0);break;case ht.holdstart:switch(t.data.state){case dt.Failed:case dt.NoAudioConsent:case dt.NoBrowserSupport:v(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}):v(t.data.state)}},r,a,f,()=>{window.location.href.replace(/^http(?!s)/,"https")},()=>{window.location.reload()}]}class Ot 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;color:#fff;font-size:1rem;line-height:120%}.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},Ft,Rt,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",Ot)})); | ||
//# sourceMappingURL=intro-popup.js.map |
@@ -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,e){for(const n in e)t[n]=e[n];return t}function o(t){return t()}function i(){return Object.create(null)}function r(t){t.forEach(o)}function s(t){return"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e}function l(t){return 0===Object.keys(t).length}function h(e,n,o){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const o=e.subscribe(...n);return o.unsubscribe?()=>o.unsubscribe():o}(n,o))}const d="undefined"!=typeof window;let u=d?()=>window.performance.now():()=>Date.now(),f=d?t=>requestAnimationFrame(t):t;const g=new Set;function p(t){g.forEach((e=>{e.c(t)||(g.delete(e),e.f())})),0!==g.size&&f(p)}function m(t){let e;return 0===g.size&&f(p),{promise:new Promise((n=>{g.add(e={c:t,f:n})})),abort(){g.delete(e)}}}function $(t,e){t.appendChild(e)}function y(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function b(t,e){$(t.head||t,e)}function x(t,e,n){t.insertBefore(e,n||null)}function w(t){t.parentNode.removeChild(t)}function v(t){return document.createElement(t)}function k(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function z(t){return document.createTextNode(t)}function _(){return z(" ")}function T(){return z("")}function E(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 S(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:C(t,e,n)}function P(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function R(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function D(t,e,n){t.classList[n?"add":"remove"](e)}function F(t){const e={};for(const n of t)e[n.name]=n.value;return e}const N=new Set;let A,I=0;function M(t,e,n,o,i,r,s,c=0){const a=16.666/o;let l="{\n";for(let t=0;t<=1;t+=a){const o=e+(n-e)*r(t);l+=100*t+`%{${s(o,1-o)}}\n`}const h=l+`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}(h)}_${c}`,u=y(t);N.add(u);const f=u.__svelte_stylesheet||(u.__svelte_stylesheet=function(t){const e=v("style");return b(y(t),e),e}(t).sheet),g=u.__svelte_rules||(u.__svelte_rules={});g[d]||(g[d]=!0,f.insertRule(`@keyframes ${d} ${h}`,f.cssRules.length));const p=t.style.animation||"";return t.style.animation=`${p?`${p}, `:""}${d} ${o}ms linear ${i}ms 1 both`,I+=1,d}function B(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(", "),I-=i,I||f((()=>{I||(N.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),N.clear())})))}function j(t){A=t}function O(){if(!A)throw new Error("Function called outside component initialization");return A}const L=[],H=[],V=[],q=[],U=Promise.resolve();let W=!1;function J(t){V.push(t)}let G=!1;const K=new Set;function Q(){if(!G){G=!0;do{for(let t=0;t<L.length;t+=1){const e=L[t];j(e),X(e.$$)}for(j(null),L.length=0;H.length;)H.pop()();for(let t=0;t<V.length;t+=1){const e=V[t];K.has(e)||(K.add(e),e())}V.length=0}while(L.length);for(;q.length;)q.pop()();W=!1,G=!1,K.clear()}}function X(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(J)}}let Y;function Z(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 tt=new Set;function et(t,e){t&&t.i&&(tt.delete(t),t.i(e))}const nt={duration:0};function ot(n,o,i){let r,c,a=o(n,i),l=!1,h=0;function d(){r&&B(n,r)}function f(){const{delay:o=0,duration:i=300,easing:s=e,tick:f=t,css:g}=a||nt;g&&(r=M(n,0,1,i,o,s,g,h++)),f(0,1);const p=u()+o,$=p+i;c&&c.abort(),l=!0,J((()=>Z(n,!0,"start"))),c=m((t=>{if(l){if(t>=$)return f(1,0),Z(n,!0,"end"),d(),l=!1;if(t>=p){const e=s((t-p)/i);f(e,1-e)}}return l}))}let g=!1;return{start(){g||(g=!0,B(n),s(a)?(a=a(),(Y||(Y=Promise.resolve(),Y.then((()=>{Y=null}))),Y).then(f)):f())},invalidate(){g=!1},end(){l&&(d(),l=!1)}}}const it="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function rt(t,e,n,i){const{fragment:c,on_mount:a,on_destroy:l,after_update:h}=t.$$;c&&c.m(e,n),i||J((()=>{const e=a.map(o).filter(s);l?l.push(...e):r(e),t.$$.on_mount=[]})),h.forEach(J)}function st(t,e){const n=t.$$;null!==n.fragment&&(r(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]&&(L.push(t),W||(W=!0,U.then(Q)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function at(e,n,o,s,c,a,l,h=[-1]){const d=A;j(e);const u=e.$$={fragment:null,ctx:null,props:a,update:t,not_equal:c,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(d?d.$$.context:[])),callbacks:i(),dirty:h,skip_bound:!1,root:n.target||d.$$.root};l&&l(u.root);let f=!1;if(u.ctx=o?o(e,n.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return u.ctx&&c(u.ctx[t],u.ctx[t]=i)&&(!u.skip_bound&&u.bound[t]&&u.bound[t](i),f&&ct(e,t)),n})):[],u.update(),f=!0,r(u.before_update),u.fragment=!!s&&s(u.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);u.fragment&&u.fragment.l(t),t.forEach(w)}else u.fragment&&u.fragment.c();n.intro&&et(e.$$.fragment),rt(e,n.target,n.anchor,n.customElement),Q()}j(d)}let lt;"function"==typeof HTMLElement&&(lt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(o).filter(s);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){r(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)}});var ht,dt,ut,ft,gt,pt;function mt(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function $t(t){return t*t*t}function yt(t){const e=t-1;return e*e*e+1}!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"}(ht||(ht={})),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"}(ft||(ft={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(gt||(gt={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(pt||(pt={})),ht.Disconnected,ht.Disconnecting,ht.Connecting,ht.Connected,ht.Starting,ht.Recording,ht.Stopping,ht.Failed,ht.NoBrowserSupport,ht.NoAudioConsent;const bt=[];function xt(t){return"[object Date]"===Object.prototype.toString.call(t)}function wt(t,e){if(t===e||t!=t)return()=>t;const n=typeof t;if(n!==typeof e||Array.isArray(t)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const n=e.map(((e,n)=>wt(t[n],e)));return t=>n.map((e=>e(t)))}if("object"===n){if(!t||!e)throw new Error("Object cannot be null");if(xt(t)&&xt(e)){t=t.getTime();const n=(e=e.getTime())-t;return e=>new Date(t+e*n)}const n=Object.keys(e),o={};return n.forEach((n=>{o[n]=wt(t[n],e[n])})),t=>{const e={};return n.forEach((n=>{e[n]=o[n](t)})),e}}if("number"===n){const n=e-t;return e=>t+e*n}throw new Error(`Cannot interpolate ${n} values`)}function vt(o,i={}){const r=function(e,n=t){let o;const i=new Set;function r(t){if(c(e,t)&&(e=t,o)){const t=!bt.length;for(const t of i)t[1](),bt.push(t,e);if(t){for(let t=0;t<bt.length;t+=2)bt[t][0](bt[t+1]);bt.length=0}}}return{set:r,update:function(t){r(t(e))},subscribe:function(s,c=t){const a=[s,c];return i.add(a),1===i.size&&(o=n(r)||t),s(e),()=>{i.delete(a),0===i.size&&(o(),o=null)}}}}(o);let s,a=o;function l(t,c){if(null==o)return r.set(o=t),Promise.resolve();a=t;let l=s,h=!1,{delay:d=0,duration:f=400,easing:g=e,interpolate:p=wt}=n(n({},i),c);if(0===f)return l&&(l.abort(),l=null),r.set(o=a),Promise.resolve();const $=u()+d;let y;return s=m((e=>{if(e<$)return!0;h||(y=p(o,t),"function"==typeof f&&(f=f(o,t)),h=!0),l&&(l.abort(),l=null);const n=e-$;return n>f?(r.set(o=t),!1):(r.set(o=y(g(n/f))),!0)})),s.promise}return{set:l,update:(t,e)=>l(t(a,o),e),subscribe:r.subscribe}}function kt(t){return function(e,n){if(!e.hasOwnProperty("ownerDocument")){Object.defineProperty(e,"ownerDocument",{get:function(){return e.parentElement}});let t=e;for(;t.parentElement;)t=t.parentElement;e.parentElement.head=t}return t(e,n)}}function zt(t,{delay:e=0,speed:n,duration:o,easing:i=mt}={}){let r=t.getTotalLength();const s=getComputedStyle(t);return"butt"!==s.strokeLinecap&&(r+=parseInt(s.strokeWidth)),void 0===o?o=void 0===n?800:r/n:"function"==typeof o&&(o=o(r)),{delay:e,duration:o,easing:i,css:(t,e)=>`stroke-dasharray: ${t*r} ${e*r}`}}const _t=[0,1];function Tt(t,e,n,o){if(e<n)return t[0];if(e>o)return t[t.length-1];let i=(o-n)/(t.length-1);if(i<=0)return t[0];let r=(e-n)/i,s=Math.floor(r),c=Math.ceil(r),a=r-s;return(1-a)*t[s]+a*t[c]}function Et(t){!function(t,e,n){const o=y(t);if(!o.getElementById(e)){const t=v("style");t.id=e,t.textContent=n,b(o,t)}}(t,"svelte-1fz8oog","canvas.svelte-1fz8oog{display:block;width:1.35rem;height:1.5rem;margin:0;padding:0 0.8rem 0 0rem;flex-grow:0;flex-shrink:0;flex-basis:1.35rem}")}function Ct(e){let n;return{c(){n=v("canvas"),R(n,"color",e[0]),R(n,"display","block"),R(n,"width","1.35rem"),R(n,"height","1.5rem"),R(n,"margin","0"),R(n,"padding","0 0.8rem 0 0rem"),R(n,"flex-grow","0"),R(n,"flex-shrink","0"),R(n,"flex-basis","1.35rem"),C(n,"class","svelte-1fz8oog")},m(t,o){x(t,n,o),e[3](n)},p(t,[e]){1&e&&R(n,"color",t[0])},i:t,o:t,d(t){t&&w(n),e[3](null)}}}function St(t,e,n){let{color:o="#60e0ff"}=e;const i=(t,e)=>{s=Date.now()>c?t:Math.max(s,t),c=Date.now()+e};let r,s=0,c=0,a=[0,0];const l=(t,e,n,o,i,r)=>{o<2*r&&(r=o/2),i<2*r&&(r=i/2),t.beginPath(),t.moveTo(e+r,n),t.arcTo(e+o,n,e+o,n+i,r),t.arcTo(e+o,n+i,e,n+i,r),t.arcTo(e,n+i,e,n,r),t.arcTo(e,n,e+o,n,r),t.closePath()};var h;return h=()=>{let t;const e=2*(a.length-1)+1,o=3*e+1*(e-1),h=()=>{if(t=requestAnimationFrame(h),!r)return;const e=r.getContext("2d");if(!e)return;let i=(t=>{var e=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/e})(e),d=Number.parseInt(getComputedStyle(r).getPropertyValue("width").slice(0,-2)),u=Number.parseInt(getComputedStyle(r).getPropertyValue("height").slice(0,-2));n(1,r.width=d*i,r),n(1,r.height=u*i,r),Date.now()<c?a[0]=.15*s+.85*a[0]:a[0]=.0625+.75*a[0];let f=1;for(;f<a.length;)a[f]=.25*a[f-1]+.5*a[f]+.0625,f++;e.clearRect(0,0,r.width,r.height);const g=3/o*r.width*.5,p=4/o*r.width;for(e.fillStyle=r.style.color||"#000000",f=0;f<a.length;f++){const t=a[f]*r.height;t*r.height>2*g?l(e,.5*r.width-g+f*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width+f*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill(),f>0&&(t*r.height>2*g?l(e,.5*r.width-g-f*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width-f*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill())}};return h(),i(1,500),()=>{cancelAnimationFrame(t)}},O().$$.on_mount.push(h),t.$$set=t=>{"color"in t&&n(0,o=t.color)},[o,r,i,function(t){H[t?"unshift":"push"]((()=>{r=t,n(1,r)}))}]}class Pt 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(),at(this,t,St,Ct,c,{color:0,updateVU:2},Et)}get updateVU(){return this.$$.ctx[2]}}const{window:Rt}=it;function Dt(t,e,n){const o=t.slice();return o[42]=e[n],o[44]=n,o}function Ft(t){let e;return{c(){e=v("div"),C(e,"class","TransscriptItemBgDiv")},m(t,n){x(t,e,n)},d(t){t&&w(e)}}}function Nt(e){let n,o;return{c(){n=v("div"),n.textContent="Listening...",C(n,"class","listening")},m(t,e){x(t,n,e)},i(t){o||J((()=>{o=ot(n,e[21],{duration:400}),o.start()}))},o:t,d(t){t&&w(n)}}}function At(e){let n,o;return{c(){n=v("div"),C(n,"class","TransscriptItemBgDiv")},m(t,e){x(t,n,e)},p(t,n){e=t},i(t){o||J((()=>{o=ot(n,e[21],{duration:e[14]}),o.start()}))},o:t,d(t){t&&w(n)}}}function It(t){let e,n;return{c(){e=v("span"),C(e,"style",n=t[44]<t[11].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")},m(t,n){x(t,e,n)},p(t,o){10240&o[0]&&n!==(n=t[44]<t[11].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")&&C(e,"style",n)},d(t){t&&w(e)}}}function Mt(e){let n,o,i,r,s,c,a,l=e[42].word+"",h=e[16]&&At(e),d=e[44]<e[11].length&&It(e);return{c(){n=v("div"),h&&h.c(),o=_(),i=v("div"),r=z(l),s=_(),d&&d.c(),C(i,"class","TransscriptItemContent"),C(n,"class",a="TranscriptItem "+e[23](e[42])),D(n,"Entity",null!==e[42].entityType),D(n,"Final",e[42].isFinal)},m(t,e){x(t,n,e),h&&h.m(n,null),$(n,o),$(n,i),$(i,r),$(i,s),d&&d.m(i,null)},p(t,s){(e=t)[16]?h?65536&s[0]&&et(h,1):(h=At(e),h.c(),et(h,1),h.m(n,o)):h&&(h.d(1),h=null),2048&s[0]&&l!==(l=e[42].word+"")&&P(r,l),e[44]<e[11].length?d?d.p(e,s):(d=It(e),d.c(),d.m(i,null)):d&&(d.d(1),d=null),2048&s[0]&&a!==(a="TranscriptItem "+e[23](e[42]))&&C(n,"class",a),2048&s[0]&&D(n,"Entity",null!==e[42].entityType),2048&s[0]&&D(n,"Final",e[42].isFinal)},i(t){et(h),c||J((()=>{c=ot(i,e[21],{duration:e[14]}),c.start()}))},o:t,d(t){t&&w(n),h&&h.d(),d&&d.d()}}}function Bt(e){let n,o,i,r,s,c,a,l;return{c(){n=v("div"),o=v("div"),i=_(),r=v("div"),s=k("svg"),c=k("path"),C(o,"class","TransscriptItemBgDiv"),R(o,"background-color",e[5]),C(c,"stroke","currentColor"),C(c,"stroke-width","3"),C(c,"d","M7.191 11.444l4.059 6.107 7.376-12.949"),C(c,"fill","none"),C(c,"fill-rule","evenodd"),R(s,"width","2rem"),R(s,"height","2rem"),R(s,"position","absolute"),R(s,"transform","translate(-0.6rem, -0.5rem)"),R(s,"stroke","#eee"),C(s,"viewBox","0 0 24 24"),C(s,"xmlns","http://www.w3.org/2000/svg"),R(r,"width","1.0rem"),R(r,"height","1rem"),R(r,"position","relative"),C(n,"class","TranscriptItem")},m(t,e){x(t,n,e),$(n,o),$(n,i),$(n,r),$(r,s),$(s,c)},p(t,e){32&e[0]&&R(o,"background-color",t[5])},i(t){a||J((()=>{a=ot(c,e[20],{duration:500}),a.start()})),l||J((()=>{l=ot(n,e[21],{duration:200,maxWidth:3}),l.start()}))},o:t,d(t){t&&w(n)}}}function jt(t){let e;return{c(){e=v("link"),C(e,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),C(e,"rel","stylesheet")},m(t,n){x(t,e,n)},d(t){t&&w(e)}}}function Ot(t){let e;return{c(){e=v("link"),C(e,"href",t[10]),C(e,"rel","stylesheet")},m(t,n){x(t,e,n)},p(t,n){1024&n[0]&&C(e,"href",t[10])},d(t){t&&w(e)}}}function Lt(e){let n,o,i,r,s,c,a,l,h,d,u,f,g,p,m,y=e[16]&&Ft(),b={color:e[5]};s=new Pt({props:b}),e[34](s);let k=e[17]&&Nt(e),z=e[11],S=[];for(let t=0;t<z.length;t+=1)S[t]=Mt(Dt(e,z,t));let P=e[13]&&Bt(e),F=e[15]&&jt(),N=void 0!==e[10]&&Ot(e);return{c(){var g;n=v("main"),o=v("div"),y&&y.c(),i=_(),r=v("div"),(g=s.$$.fragment)&&g.c(),c=_(),k&&k.c(),a=_();for(let t=0;t<S.length;t+=1)S[t].c();l=_(),P&&P.c(),h=_(),F&&F.c(),d=T(),u=_(),N&&N.c(),f=T(),this.c=t,C(r,"class","TransscriptItemContent"),C(o,"class","TranscriptItem"),C(n,"class","BigTranscript"),R(n,"--voffset",e[1]),R(n,"--hoffset",e[2]),R(n,"--fontsize",e[3]),R(n,"--color",e[4]),R(n,"--highlight-color",e[5]),R(n,"--text-bg-color",e[6]),R(n,"--gradient-stop1",e[7]),R(n,"--gradient-stop2",e[8]),R(n,"--marginbottom",e[9]),R(n,"--transition",e[18].transition),R(n,"opacity",e[18].transition),R(n,"max-height",10*Tt(_t,e[18].transition,0,.6)+"rem"),R(n,"visibility",0!==e[18].transition?"visible":"hidden"),D(n,"placementTop","top"===e[0]),D(n,"defaultTypography",e[15])},m(t,b){x(t,n,b),$(n,o),y&&y.m(o,null),$(o,i),$(o,r),rt(s,r,null),$(r,c),k&&k.m(r,null),$(n,a);for(let t=0;t<S.length;t+=1)S[t].m(n,null);$(n,l),P&&P.m(n,null),x(t,h,b),F&&F.m(document.head,null),$(document.head,d),x(t,u,b),N&&N.m(t,b),x(t,f,b),g=!0,p||(m=E(Rt,"message",e[22]),p=!0)},p(t,e){t[16]?y||(y=Ft(),y.c(),y.m(o,i)):y&&(y.d(1),y=null);const c={};if(32&e[0]&&(c.color=t[5]),s.$set(c),t[17]?k?131072&e[0]&&et(k,1):(k=Nt(t),k.c(),et(k,1),k.m(r,null)):k&&(k.d(1),k=null),8464384&e[0]){let o;for(z=t[11],o=0;o<z.length;o+=1){const i=Dt(t,z,o);S[o]?(S[o].p(i,e),et(S[o],1)):(S[o]=Mt(i),S[o].c(),et(S[o],1),S[o].m(n,l))}for(;o<S.length;o+=1)S[o].d(1);S.length=z.length}t[13]?P?(P.p(t,e),8192&e[0]&&et(P,1)):(P=Bt(t),P.c(),et(P,1),P.m(n,null)):P&&(P.d(1),P=null),(!g||2&e[0])&&R(n,"--voffset",t[1]),(!g||4&e[0])&&R(n,"--hoffset",t[2]),(!g||8&e[0])&&R(n,"--fontsize",t[3]),(!g||16&e[0])&&R(n,"--color",t[4]),(!g||32&e[0])&&R(n,"--highlight-color",t[5]),(!g||64&e[0])&&R(n,"--text-bg-color",t[6]),(!g||128&e[0])&&R(n,"--gradient-stop1",t[7]),(!g||256&e[0])&&R(n,"--gradient-stop2",t[8]),(!g||512&e[0])&&R(n,"--marginbottom",t[9]),(!g||262144&e[0])&&R(n,"--transition",t[18].transition),(!g||262144&e[0])&&R(n,"opacity",t[18].transition),(!g||262144&e[0])&&R(n,"max-height",10*Tt(_t,t[18].transition,0,.6)+"rem"),(!g||262144&e[0])&&R(n,"visibility",0!==t[18].transition?"visible":"hidden"),1&e[0]&&D(n,"placementTop","top"===t[0]),32768&e[0]&&D(n,"defaultTypography",t[15]),t[15]?F||(F=jt(),F.c(),F.m(d.parentNode,d)):F&&(F.d(1),F=null),void 0!==t[10]?N?N.p(t,e):(N=Ot(t),N.c(),N.m(f.parentNode,f)):N&&(N.d(1),N=null)},i(t){if(!g){et(s.$$.fragment,t),et(k);for(let t=0;t<z.length;t+=1)et(S[t]);et(P),g=!0}},o(t){!function(t,e,n,o){if(t&&t.o){if(tt.has(t))return;tt.add(t),(void 0).c.push((()=>{tt.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}(s.$$.fragment,t),g=!1},d(t){t&&w(n),y&&y.d(),e[34](null),st(s),k&&k.d(),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(S,t),P&&P.d(),t&&w(h),F&&F.d(t),w(d),t&&w(u),N&&N.d(t),t&&w(f),p=!1,m()}}}function Ht(t,e,n){let o,i,r,s,c,a,l,d,{placement:u}=e,{voffset:f="3rem"}=e,{hoffset:g="2rem"}=e,{fontsize:p="1.5rem"}=e,{color:m="#ffffff"}=e,{highlightcolor:$="#15e8b5"}=e,{backgroundcolor:y="#202020"}=e,{gradientstop1:b="#ffffff88"}=e,{gradientstop2:x="#ffffffcc"}=e,{marginbottom:w="0rem"}=e,{formattext:v}=e,{demomode:k}=e,{customcssurl:z}=e,{customtypography:_}=e,T=[],E=null,C=null,S=ht.Disconnected,P=!1,R=!1,D=!1,F=vt({transition:0},{duration:200});h(t,F,(t=>n(18,l=t)));const N=O(),A=kt(zt),I=kt(((t,{delay:e=0,duration:n=350,maxWidth:o=10})=>({delay:e,duration:n,css:t=>`\n max-width: ${Tt(_t,t,0,1)*o}rem;\n `}))),M=t=>{n(13,D=D||t)},B=t=>{n(30,S=t),S===ht.Recording&&(n(13,D=!1),n(11,T=[]),C=null)},j=t=>{if(void 0===t)return;d&&(s||S===ht.Recording)&&d.updateVU(.5*Math.random()+.5,75*Math.random()+75),t.isFinal?L(T.length>0?s?3500:2e3:0):T.length>0&&(P||n(31,P=!0),L(2e3));const e=`${t.contextId}/${t.id}`;null!==C?C!==e&&(n(13,D=!1),C=e):C=e,n(11,T=[]),t.words.forEach((t=>{n(11,T[t.index]={word:t.value,serialNumber:t.index,entityType:null,isFinal:t.isFinal,hide:!1},T)})),r?t.entities.forEach((t=>{n(11,T[t.startPosition].word=t.value,T),n(11,T[t.startPosition].entityType=t.type,T),n(11,T[t.startPosition].isFinal=t.isFinal,T),n(11,T[t.startPosition].hide=!1,T);for(let e=t.startPosition+1;e<t.endPosition;e++)T[e]&&n(11,T[e].hide=!0,T)})):t.entities.forEach((t=>{for(let e=t.startPosition;e<t.endPosition;e++)T[e]&&(n(11,T[e].entityType=t.type,T),n(11,T[e].isFinal=t.isFinal,T))})),n(11,T=T.filter((t=>!t.hide)))},L=(t=0)=>{V(),E=window.setTimeout((()=>{E=null,P&&n(31,P=!1)}),t)},V=()=>{null!==E&&(window.clearTimeout(E),E=null)};return t.$$set=t=>{"placement"in t&&n(0,u=t.placement),"voffset"in t&&n(1,f=t.voffset),"hoffset"in t&&n(2,g=t.hoffset),"fontsize"in t&&n(3,p=t.fontsize),"color"in t&&n(4,m=t.color),"highlightcolor"in t&&n(5,$=t.highlightcolor),"backgroundcolor"in t&&n(6,y=t.backgroundcolor),"gradientstop1"in t&&n(7,b=t.gradientstop1),"gradientstop2"in t&&n(8,x=t.gradientstop2),"marginbottom"in t&&n(9,w=t.marginbottom),"formattext"in t&&n(24,v=t.formattext),"demomode"in t&&n(25,k=t.demomode),"customcssurl"in t&&n(10,z=t.customcssurl),"customtypography"in t&&n(26,_=t.customtypography)},t.$$.update=()=>{if(2048&t.$$.dirty[0]&&n(17,o=0===T.length),64&t.$$.dirty[0]&&n(16,i="none"!==y),16777216&t.$$.dirty[0]&&(r=void 0===v||"false"!==v),33554432&t.$$.dirty[0]&&n(33,s=void 0!==k&&"false"!==k),67108864&t.$$.dirty[0]&&n(15,c=void 0===_||"false"===_),4&t.$$.dirty[1]&&n(14,a=s?800:350),1073741824&t.$$.dirty[0]|3&t.$$.dirty[1]){const t=S===ht.Recording||P;t!==R&&(e="visibilitychanged",l=t,N.dispatchEvent(new CustomEvent(e,{detail:l,composed:!0}))),n(32,R=t),F.set({transition:R?1:0})}var e,l;4&t.$$.dirty[1]&&(s||L(0))},[u,f,g,p,m,$,y,b,x,w,z,T,d,D,a,c,i,o,l,F,A,I,t=>{switch(t.data.type){case ut.speechsegment:j(t.data.segment);break;case ut.speechhandled:M(t.data.success);break;case ut.speechstate:B(t.data.state)}},t=>t.entityType||"",v,k,_,M,B,j,S,P,R,s,function(t){H[t?"unshift":"push"]((()=>{d=t,n(12,d)}))}]}class Vt extends lt{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{position:relative;user-select:none;display:flex;flex-direction:row;justify-content:start;flex-wrap:wrap;margin-bottom:calc(var(--marginbottom) * var(--transition))}.defaultTypography{font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--color);font-size:var(--fontsize);line-height:135%}.TranscriptItem{position:relative;display:flex;flex-direction:row;align-items:center}.Entity{color:var(--highlight-color)}.TransscriptItemContent{z-index:1;display:flex;flex-wrap:nowrap;flex-direction:row;align-items:center;overflow:hidden;white-space:nowrap}.TransscriptItemBgDiv{position:absolute;box-sizing:content-box;width:100%;height:100%;top:-0.2rem;left:-0.8rem;margin:0;padding:0.2rem 0.8rem;background-color:var(--text-bg-color);z-index:-1}.placementTop{position:fixed;top:0;left:0;right:0;bottom:0;margin:var(--voffset) var(--hoffset) 0 var(--hoffset);z-index:50;pointer-events:none}.listening{animation:flow 1s linear infinite;background:linear-gradient(-60deg, var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1));background-size:200%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;-webkit-box-decoration-break:clone}@keyframes flow{0%{background-position:100% 50%}100%{background-position:0% 50%}}</style>",at(this,{target:this.shadowRoot,props:F(this.attributes),customElement:!0},Ht,Lt,a,{placement:0,voffset:1,hoffset:2,fontsize:3,color:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,marginbottom:9,formattext:24,demomode:25,customcssurl:10,customtypography:26,speechhandled:27,speechstate:28,speechsegment:29},null,[-1,-1]),t&&(t.target&&x(t.target,this,t.anchor),t.props&&(this.$set(t.props),Q()))}static get observedAttributes(){return["placement","voffset","hoffset","fontsize","color","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","marginbottom","formattext","demomode","customcssurl","customtypography","speechhandled","speechstate","speechsegment"]}get placement(){return this.$$.ctx[0]}set placement(t){this.$$set({placement:t}),Q()}get voffset(){return this.$$.ctx[1]}set voffset(t){this.$$set({voffset:t}),Q()}get hoffset(){return this.$$.ctx[2]}set hoffset(t){this.$$set({hoffset:t}),Q()}get fontsize(){return this.$$.ctx[3]}set fontsize(t){this.$$set({fontsize:t}),Q()}get color(){return this.$$.ctx[4]}set color(t){this.$$set({color:t}),Q()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$$set({highlightcolor:t}),Q()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),Q()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$$set({gradientstop1:t}),Q()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$$set({gradientstop2:t}),Q()}get marginbottom(){return this.$$.ctx[9]}set marginbottom(t){this.$$set({marginbottom:t}),Q()}get formattext(){return this.$$.ctx[24]}set formattext(t){this.$$set({formattext:t}),Q()}get demomode(){return this.$$.ctx[25]}set demomode(t){this.$$set({demomode:t}),Q()}get customcssurl(){return this.$$.ctx[10]}set customcssurl(t){this.$$set({customcssurl:t}),Q()}get customtypography(){return this.$$.ctx[26]}set customtypography(t){this.$$set({customtypography:t}),Q()}get speechhandled(){return this.$$.ctx[27]}get speechstate(){return this.$$.ctx[28]}get speechsegment(){return this.$$.ctx[29]}}function qt(t){let e;return{c(){e=v("link"),C(e,"href",t[11]),C(e,"rel","stylesheet")},m(t,n){x(t,e,n)},p(t,n){2048&n[0]&&C(e,"href",t[11])},d(t){t&&w(e)}}}function Ut(e){let n,o,i,s,c,a,l,h,d,u,f=void 0!==e[11]&&qt(e);return{c(){f&&f.c(),n=_(),o=v("main"),i=v("div"),s=v("div"),c=v("big-transcript"),a=_(),l=v("div"),h=z(e[13]),this.c=t,S(c,"customtypography",e[12]),S(c,"customcssurl",e[11]),S(c,"formattext",e[9]),S(c,"fontsize",e[1]),S(c,"color",e[3]),S(c,"backgroundcolor","none"),S(c,"highlightcolor",e[5]),S(c,"gradientstop1",e[7]),S(c,"gradientstop2",e[8]),S(c,"demomode",e[10]),C(l,"class","hint"),R(l,"opacity",e[18].opacity),D(l,"defaultTypography",e[15]),C(s,"class","pad"),C(i,"class","drawer"),R(i,"background-color",e[6]),R(i,"opacity",e[16].opacity),R(i,"transform","translate(0px, "+e[17].y+"rem)"),C(o,"class","placementTop"),R(o,"--height",e[0]),R(o,"--smalltextcolor",e[4]),R(o,"--hintfontsize",e[2])},m(t,r){f&&f.m(t,r),x(t,n,r),x(t,o,r),$(o,i),$(i,s),$(s,c),e[29](c),$(s,a),$(s,l),$(l,h),d||(u=[E(window,"message",e[23]),E(c,"visibilitychanged",e[22])],d=!0)},p(t,e){void 0!==t[11]?f?f.p(t,e):(f=qt(t),f.c(),f.m(n.parentNode,n)):f&&(f.d(1),f=null),4096&e[0]&&S(c,"customtypography",t[12]),2048&e[0]&&S(c,"customcssurl",t[11]),512&e[0]&&S(c,"formattext",t[9]),2&e[0]&&S(c,"fontsize",t[1]),8&e[0]&&S(c,"color",t[3]),32&e[0]&&S(c,"highlightcolor",t[5]),128&e[0]&&S(c,"gradientstop1",t[7]),256&e[0]&&S(c,"gradientstop2",t[8]),1024&e[0]&&S(c,"demomode",t[10]),8192&e[0]&&P(h,t[13]),262144&e[0]&&R(l,"opacity",t[18].opacity),32768&e[0]&&D(l,"defaultTypography",t[15]),64&e[0]&&R(i,"background-color",t[6]),65536&e[0]&&R(i,"opacity",t[16].opacity),131072&e[0]&&R(i,"transform","translate(0px, "+t[17].y+"rem)"),1&e[0]&&R(o,"--height",t[0]),16&e[0]&&R(o,"--smalltextcolor",t[4]),4&e[0]&&R(o,"--hintfontsize",t[2])},i:t,o:t,d(t){f&&f.d(t),t&&w(n),t&&w(o),e[29](null),d=!1,r(u)}}}function Wt(t,n,o){let i,r,s,c,a,{height:l="8rem"}=n,{hint:d=""}=n,{fontsize:u="1.5rem"}=n,{hintfontsize:f="0.9rem"}=n,{color:g="#ffffff"}=n,{smalltextcolor:p="#ffffff70"}=n,{highlightcolor:m="#15e8b5"}=n,{backgroundcolor:$="#202020"}=n,{gradientstop1:y="#ffffff88"}=n,{gradientstop2:b="#ffffffcc"}=n,{formattext:x}=n,{demomode:w}=n,{customcssurl:v}=n,{customtypography:k}=n,z=[],_=0,T="";const E=(t,e=!0)=>{R.set({opacity:0}),a&&e&&a.speechsegment(t),t.isFinal&&(_++,_<z.length?o(13,T=z[_]):o(13,T=z[Math.floor(Math.random()*z.length)]))},C=t=>{_=0,o(24,d=t),z=[];try{z=JSON.parse(d),("string"==typeof z||z instanceof String)&&(z=[z])}catch(t){z[0]=d||""}o(13,T=z[_])};let S=vt({y:-1},{duration:200});h(t,S,(t=>o(17,s=t)));let P=vt({opacity:0},{duration:200,easing:e});h(t,P,(t=>o(16,r=t)));let R=vt({opacity:0},{duration:200,delay:200,easing:e});h(t,R,(t=>o(18,c=t)));return t.$$set=t=>{"height"in t&&o(0,l=t.height),"hint"in t&&o(24,d=t.hint),"fontsize"in t&&o(1,u=t.fontsize),"hintfontsize"in t&&o(2,f=t.hintfontsize),"color"in t&&o(3,g=t.color),"smalltextcolor"in t&&o(4,p=t.smalltextcolor),"highlightcolor"in t&&o(5,m=t.highlightcolor),"backgroundcolor"in t&&o(6,$=t.backgroundcolor),"gradientstop1"in t&&o(7,y=t.gradientstop1),"gradientstop2"in t&&o(8,b=t.gradientstop2),"formattext"in t&&o(9,x=t.formattext),"demomode"in t&&o(10,w=t.demomode),"customcssurl"in t&&o(11,v=t.customcssurl),"customtypography"in t&&o(12,k=t.customtypography)},t.$$.update=()=>{16777216&t.$$.dirty[0]&&C(d),4096&t.$$.dirty[0]&&o(15,i=void 0===k||"false"===k)},[l,u,f,g,p,m,$,y,b,x,w,v,k,T,a,i,r,s,c,S,P,R,t=>{!1===t.detail?(S.set({y:-1},{easing:$t}),P.set({opacity:0}),R.set({opacity:0})):(S.set({y:0},{easing:yt}),P.set({opacity:1}),R.set({opacity:1}))},t=>{switch(t.data.type){case ut.speechsegment:E(t.data.segment,!1);break;case ut.transcriptdrawerhint:C(t.data.hint)}},d,t=>{a&&a.speechhandled(t)},t=>{a&&a.speechstate(t)},E,C,function(t){H[t?"unshift":"push"]((()=>{a=t,o(14,a)}))}]}customElements.get("big-transcript")?console.warn("Skipping re-defining customElement big-transcript"):customElements.define("big-transcript",Vt);class Jt extends lt{constructor(t){super(),this.shadowRoot.innerHTML="<style>.placementTop{position:fixed;top:0;left:0;right:0;bottom:0;z-index:60;pointer-events:none}.drawer{width:100%;min-height:var(--height);display:flex;flex-direction:column;justify-content:flex-end;box-shadow:0 0 0.35rem #0004}.pad{position:relative;padding:2rem 2rem 0.65rem 1.5rem}.hint{margin-top:0.15rem}.defaultTypography{font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--smalltextcolor);font-size:var(--hintfontsize);line-height:135%}</style>",at(this,{target:this.shadowRoot,props:F(this.attributes),customElement:!0},Wt,Ut,a,{height:0,hint:24,fontsize:1,hintfontsize:2,color:3,smalltextcolor:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,formattext:9,demomode:10,customcssurl:11,customtypography:12,speechhandled:25,speechstate:26,speechsegment:27,sethint:28},null,[-1,-1]),t&&(t.target&&x(t.target,this,t.anchor),t.props&&(this.$set(t.props),Q()))}static get observedAttributes(){return["height","hint","fontsize","hintfontsize","color","smalltextcolor","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","formattext","demomode","customcssurl","customtypography","speechhandled","speechstate","speechsegment","sethint"]}get height(){return this.$$.ctx[0]}set height(t){this.$$set({height:t}),Q()}get hint(){return this.$$.ctx[24]}set hint(t){this.$$set({hint:t}),Q()}get fontsize(){return this.$$.ctx[1]}set fontsize(t){this.$$set({fontsize:t}),Q()}get hintfontsize(){return this.$$.ctx[2]}set hintfontsize(t){this.$$set({hintfontsize:t}),Q()}get color(){return this.$$.ctx[3]}set color(t){this.$$set({color:t}),Q()}get smalltextcolor(){return this.$$.ctx[4]}set smalltextcolor(t){this.$$set({smalltextcolor:t}),Q()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$$set({highlightcolor:t}),Q()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),Q()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$$set({gradientstop1:t}),Q()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$$set({gradientstop2:t}),Q()}get formattext(){return this.$$.ctx[9]}set formattext(t){this.$$set({formattext:t}),Q()}get demomode(){return this.$$.ctx[10]}set demomode(t){this.$$set({demomode:t}),Q()}get customcssurl(){return this.$$.ctx[11]}set customcssurl(t){this.$$set({customcssurl:t}),Q()}get customtypography(){return this.$$.ctx[12]}set customtypography(t){this.$$set({customtypography:t}),Q()}get speechhandled(){return this.$$.ctx[25]}get speechstate(){return this.$$.ctx[26]}get speechsegment(){return this.$$.ctx[27]}get sethint(){return this.$$.ctx[28]}}customElements.get("transcript-drawer")?console.warn("Skipping re-defining customElement transcript-drawer"):customElements.define("transcript-drawer",Jt)})); | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}const e=t=>t;function n(t,e){for(const n in e)t[n]=e[n];return t}function o(t){return t()}function i(){return Object.create(null)}function r(t){t.forEach(o)}function s(t){return"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e}function l(t){return 0===Object.keys(t).length}function h(e,n,o){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const o=e.subscribe(...n);return o.unsubscribe?()=>o.unsubscribe():o}(n,o))}const d="undefined"!=typeof window;let u=d?()=>window.performance.now():()=>Date.now(),f=d?t=>requestAnimationFrame(t):t;const g=new Set;function p(t){g.forEach((e=>{e.c(t)||(g.delete(e),e.f())})),0!==g.size&&f(p)}function m(t){let e;return 0===g.size&&f(p),{promise:new Promise((n=>{g.add(e={c:t,f:n})})),abort(){g.delete(e)}}}function $(t,e){t.appendChild(e)}function y(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function b(t,e){$(t.head||t,e)}function x(t,e,n){t.insertBefore(e,n||null)}function w(t){t.parentNode.removeChild(t)}function v(t){return document.createElement(t)}function k(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function z(t){return document.createTextNode(t)}function _(){return z(" ")}function T(){return z("")}function E(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 S(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:C(t,e,n)}function P(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function R(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function D(t,e,n){t.classList[n?"add":"remove"](e)}function N(t){const e={};for(const n of t)e[n.name]=n.value;return e}const F=new Set;let A,I=0;function M(t,e,n,o,i,r,s,c=0){const a=16.666/o;let l="{\n";for(let t=0;t<=1;t+=a){const o=e+(n-e)*r(t);l+=100*t+`%{${s(o,1-o)}}\n`}const h=l+`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}(h)}_${c}`,u=y(t);F.add(u);const f=u.__svelte_stylesheet||(u.__svelte_stylesheet=function(t){const e=v("style");return b(y(t),e),e}(t).sheet),g=u.__svelte_rules||(u.__svelte_rules={});g[d]||(g[d]=!0,f.insertRule(`@keyframes ${d} ${h}`,f.cssRules.length));const p=t.style.animation||"";return t.style.animation=`${p?`${p}, `:""}${d} ${o}ms linear ${i}ms 1 both`,I+=1,d}function B(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(", "),I-=i,I||f((()=>{I||(F.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),F.clear())})))}function j(t){A=t}function O(){if(!A)throw new Error("Function called outside component initialization");return A}const L=[],H=[],V=[],W=[],q=Promise.resolve();let U=!1;function J(t){V.push(t)}let G=!1;const K=new Set;function Q(){if(!G){G=!0;do{for(let t=0;t<L.length;t+=1){const e=L[t];j(e),X(e.$$)}for(j(null),L.length=0;H.length;)H.pop()();for(let t=0;t<V.length;t+=1){const e=V[t];K.has(e)||(K.add(e),e())}V.length=0}while(L.length);for(;W.length;)W.pop()();U=!1,G=!1,K.clear()}}function X(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(J)}}let Y;function Z(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 tt=new Set;function et(t,e){t&&t.i&&(tt.delete(t),t.i(e))}const nt={duration:0};function ot(n,o,i){let r,c,a=o(n,i),l=!1,h=0;function d(){r&&B(n,r)}function f(){const{delay:o=0,duration:i=300,easing:s=e,tick:f=t,css:g}=a||nt;g&&(r=M(n,0,1,i,o,s,g,h++)),f(0,1);const p=u()+o,$=p+i;c&&c.abort(),l=!0,J((()=>Z(n,!0,"start"))),c=m((t=>{if(l){if(t>=$)return f(1,0),Z(n,!0,"end"),d(),l=!1;if(t>=p){const e=s((t-p)/i);f(e,1-e)}}return l}))}let g=!1;return{start(){g||(g=!0,B(n),s(a)?(a=a(),(Y||(Y=Promise.resolve(),Y.then((()=>{Y=null}))),Y).then(f)):f())},invalidate(){g=!1},end(){l&&(d(),l=!1)}}}const it="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function rt(t,e,n,i){const{fragment:c,on_mount:a,on_destroy:l,after_update:h}=t.$$;c&&c.m(e,n),i||J((()=>{const e=a.map(o).filter(s);l?l.push(...e):r(e),t.$$.on_mount=[]})),h.forEach(J)}function st(t,e){const n=t.$$;null!==n.fragment&&(r(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]&&(L.push(t),U||(U=!0,q.then(Q)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function at(e,n,o,s,c,a,l,h=[-1]){const d=A;j(e);const u=e.$$={fragment:null,ctx:null,props:a,update:t,not_equal:c,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(d?d.$$.context:[])),callbacks:i(),dirty:h,skip_bound:!1,root:n.target||d.$$.root};l&&l(u.root);let f=!1;if(u.ctx=o?o(e,n.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return u.ctx&&c(u.ctx[t],u.ctx[t]=i)&&(!u.skip_bound&&u.bound[t]&&u.bound[t](i),f&&ct(e,t)),n})):[],u.update(),f=!0,r(u.before_update),u.fragment=!!s&&s(u.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);u.fragment&&u.fragment.l(t),t.forEach(w)}else u.fragment&&u.fragment.c();n.intro&&et(e.$$.fragment),rt(e,n.target,n.anchor,n.customElement),Q()}j(d)}let lt;"function"==typeof HTMLElement&&(lt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(o).filter(s);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){r(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)}});var ht,dt,ut,ft,gt,pt,mt;function $t(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function yt(t){return t*t*t}function bt(t){const e=t-1;return e*e*e+1}!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"}(ht||(ht={})),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.MicActive="micactive",t.Error="error",t.Denied="denied"}(ft||(ft={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(gt||(gt={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(pt||(pt={})),function(t){t.None="none",t.Whirl="whirl"}(mt||(mt={})),ht.Disconnected,ht.Disconnecting,ht.Connecting,ht.Connected,ht.Starting,ht.Recording,ht.Stopping,ht.Failed,ht.NoBrowserSupport,ht.NoAudioConsent;const xt=[];function wt(t){return"[object Date]"===Object.prototype.toString.call(t)}function vt(t,e){if(t===e||t!=t)return()=>t;const n=typeof t;if(n!==typeof e||Array.isArray(t)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const n=e.map(((e,n)=>vt(t[n],e)));return t=>n.map((e=>e(t)))}if("object"===n){if(!t||!e)throw new Error("Object cannot be null");if(wt(t)&&wt(e)){t=t.getTime();const n=(e=e.getTime())-t;return e=>new Date(t+e*n)}const n=Object.keys(e),o={};return n.forEach((n=>{o[n]=vt(t[n],e[n])})),t=>{const e={};return n.forEach((n=>{e[n]=o[n](t)})),e}}if("number"===n){const n=e-t;return e=>t+e*n}throw new Error(`Cannot interpolate ${n} values`)}function kt(o,i={}){const r=function(e,n=t){let o;const i=new Set;function r(t){if(c(e,t)&&(e=t,o)){const t=!xt.length;for(const t of i)t[1](),xt.push(t,e);if(t){for(let t=0;t<xt.length;t+=2)xt[t][0](xt[t+1]);xt.length=0}}}return{set:r,update:function(t){r(t(e))},subscribe:function(s,c=t){const a=[s,c];return i.add(a),1===i.size&&(o=n(r)||t),s(e),()=>{i.delete(a),0===i.size&&(o(),o=null)}}}}(o);let s,a=o;function l(t,c){if(null==o)return r.set(o=t),Promise.resolve();a=t;let l=s,h=!1,{delay:d=0,duration:f=400,easing:g=e,interpolate:p=vt}=n(n({},i),c);if(0===f)return l&&(l.abort(),l=null),r.set(o=a),Promise.resolve();const $=u()+d;let y;return s=m((e=>{if(e<$)return!0;h||(y=p(o,t),"function"==typeof f&&(f=f(o,t)),h=!0),l&&(l.abort(),l=null);const n=e-$;return n>f?(r.set(o=t),!1):(r.set(o=y(g(n/f))),!0)})),s.promise}return{set:l,update:(t,e)=>l(t(a,o),e),subscribe:r.subscribe}}function zt(t){return function(e,n){if(!e.hasOwnProperty("ownerDocument")){Object.defineProperty(e,"ownerDocument",{get:function(){return e.parentElement}});let t=e;for(;t.parentElement;)t=t.parentElement;e.parentElement.head=t}return t(e,n)}}function _t(t,{delay:e=0,speed:n,duration:o,easing:i=$t}={}){let r=t.getTotalLength();const s=getComputedStyle(t);return"butt"!==s.strokeLinecap&&(r+=parseInt(s.strokeWidth)),void 0===o?o=void 0===n?800:r/n:"function"==typeof o&&(o=o(r)),{delay:e,duration:o,easing:i,css:(t,e)=>`stroke-dasharray: ${t*r} ${e*r}`}}const Tt=[0,1];function Et(t,e,n,o){if(e<n)return t[0];if(e>o)return t[t.length-1];let i=(o-n)/(t.length-1);if(i<=0)return t[0];let r=(e-n)/i,s=Math.floor(r),c=Math.ceil(r),a=r-s;return(1-a)*t[s]+a*t[c]}function Ct(t){!function(t,e,n){const o=y(t);if(!o.getElementById(e)){const t=v("style");t.id=e,t.textContent=n,b(o,t)}}(t,"svelte-1fz8oog","canvas.svelte-1fz8oog{display:block;width:1.35rem;height:1.5rem;margin:0;padding:0 0.8rem 0 0rem;flex-grow:0;flex-shrink:0;flex-basis:1.35rem}")}function St(e){let n;return{c(){n=v("canvas"),R(n,"color",e[0]),R(n,"display","block"),R(n,"width","1.35rem"),R(n,"height","1.5rem"),R(n,"margin","0"),R(n,"padding","0 0.8rem 0 0rem"),R(n,"flex-grow","0"),R(n,"flex-shrink","0"),R(n,"flex-basis","1.35rem"),C(n,"class","svelte-1fz8oog")},m(t,o){x(t,n,o),e[3](n)},p(t,[e]){1&e&&R(n,"color",t[0])},i:t,o:t,d(t){t&&w(n),e[3](null)}}}function Pt(t,e,n){let{color:o="#60e0ff"}=e;const i=(t,e)=>{s=Date.now()>c?t:Math.max(s,t),c=Date.now()+e};let r,s=0,c=0,a=[0,0];const l=(t,e,n,o,i,r)=>{o<2*r&&(r=o/2),i<2*r&&(r=i/2),t.beginPath(),t.moveTo(e+r,n),t.arcTo(e+o,n,e+o,n+i,r),t.arcTo(e+o,n+i,e,n+i,r),t.arcTo(e,n+i,e,n,r),t.arcTo(e,n,e+o,n,r),t.closePath()};var h;return h=()=>{let t;const e=2*(a.length-1)+1,o=3*e+1*(e-1),h=()=>{if(t=requestAnimationFrame(h),!r)return;const e=r.getContext("2d");if(!e)return;let i=(t=>{var e=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/e})(e),d=Number.parseInt(getComputedStyle(r).getPropertyValue("width").slice(0,-2)),u=Number.parseInt(getComputedStyle(r).getPropertyValue("height").slice(0,-2));n(1,r.width=d*i,r),n(1,r.height=u*i,r),Date.now()<c?a[0]=.15*s+.85*a[0]:a[0]=.0625+.75*a[0];let f=1;for(;f<a.length;)a[f]=.25*a[f-1]+.5*a[f]+.0625,f++;e.clearRect(0,0,r.width,r.height);const g=3/o*r.width*.5,p=4/o*r.width;for(e.fillStyle=r.style.color||"#000000",f=0;f<a.length;f++){const t=a[f]*r.height;t*r.height>2*g?l(e,.5*r.width-g+f*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width+f*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill(),f>0&&(t*r.height>2*g?l(e,.5*r.width-g-f*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width-f*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill())}};return h(),i(1,500),()=>{cancelAnimationFrame(t)}},O().$$.on_mount.push(h),t.$$set=t=>{"color"in t&&n(0,o=t.color)},[o,r,i,function(t){H[t?"unshift":"push"]((()=>{r=t,n(1,r)}))}]}class Rt 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(),at(this,t,Pt,St,c,{color:0,updateVU:2},Ct)}get updateVU(){return this.$$.ctx[2]}}const{window:Dt}=it;function Nt(t,e,n){const o=t.slice();return o[42]=e[n],o[44]=n,o}function Ft(t){let e;return{c(){e=v("div"),C(e,"class","TransscriptItemBgDiv")},m(t,n){x(t,e,n)},d(t){t&&w(e)}}}function At(e){let n,o;return{c(){n=v("div"),n.textContent="Listening...",C(n,"class","listening")},m(t,e){x(t,n,e)},i(t){o||J((()=>{o=ot(n,e[21],{duration:400}),o.start()}))},o:t,d(t){t&&w(n)}}}function It(e){let n,o;return{c(){n=v("div"),C(n,"class","TransscriptItemBgDiv")},m(t,e){x(t,n,e)},p(t,n){e=t},i(t){o||J((()=>{o=ot(n,e[21],{duration:e[14]}),o.start()}))},o:t,d(t){t&&w(n)}}}function Mt(t){let e,n;return{c(){e=v("span"),C(e,"style",n=t[44]<t[11].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")},m(t,n){x(t,e,n)},p(t,o){10240&o[0]&&n!==(n=t[44]<t[11].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")&&C(e,"style",n)},d(t){t&&w(e)}}}function Bt(e){let n,o,i,r,s,c,a,l=e[42].word+"",h=e[16]&&It(e),d=e[44]<e[11].length&&Mt(e);return{c(){n=v("div"),h&&h.c(),o=_(),i=v("div"),r=z(l),s=_(),d&&d.c(),C(i,"class","TransscriptItemContent"),C(n,"class",a="TranscriptItem "+e[23](e[42])),D(n,"Entity",null!==e[42].entityType),D(n,"Final",e[42].isFinal)},m(t,e){x(t,n,e),h&&h.m(n,null),$(n,o),$(n,i),$(i,r),$(i,s),d&&d.m(i,null)},p(t,s){(e=t)[16]?h?65536&s[0]&&et(h,1):(h=It(e),h.c(),et(h,1),h.m(n,o)):h&&(h.d(1),h=null),2048&s[0]&&l!==(l=e[42].word+"")&&P(r,l),e[44]<e[11].length?d?d.p(e,s):(d=Mt(e),d.c(),d.m(i,null)):d&&(d.d(1),d=null),2048&s[0]&&a!==(a="TranscriptItem "+e[23](e[42]))&&C(n,"class",a),2048&s[0]&&D(n,"Entity",null!==e[42].entityType),2048&s[0]&&D(n,"Final",e[42].isFinal)},i(t){et(h),c||J((()=>{c=ot(i,e[21],{duration:e[14]}),c.start()}))},o:t,d(t){t&&w(n),h&&h.d(),d&&d.d()}}}function jt(e){let n,o,i,r,s,c,a,l;return{c(){n=v("div"),o=v("div"),i=_(),r=v("div"),s=k("svg"),c=k("path"),C(o,"class","TransscriptItemBgDiv"),R(o,"background-color",e[5]),C(c,"stroke","currentColor"),C(c,"stroke-width","3"),C(c,"d","M7.191 11.444l4.059 6.107 7.376-12.949"),C(c,"fill","none"),C(c,"fill-rule","evenodd"),R(s,"width","2rem"),R(s,"height","2rem"),R(s,"position","absolute"),R(s,"transform","translate(-0.6rem, -0.5rem)"),R(s,"stroke","#eee"),C(s,"viewBox","0 0 24 24"),C(s,"xmlns","http://www.w3.org/2000/svg"),R(r,"width","1.0rem"),R(r,"height","1rem"),R(r,"position","relative"),C(n,"class","TranscriptItem")},m(t,e){x(t,n,e),$(n,o),$(n,i),$(n,r),$(r,s),$(s,c)},p(t,e){32&e[0]&&R(o,"background-color",t[5])},i(t){a||J((()=>{a=ot(c,e[20],{duration:500}),a.start()})),l||J((()=>{l=ot(n,e[21],{duration:200,maxWidth:3}),l.start()}))},o:t,d(t){t&&w(n)}}}function Ot(t){let e;return{c(){e=v("link"),C(e,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),C(e,"rel","stylesheet")},m(t,n){x(t,e,n)},d(t){t&&w(e)}}}function Lt(t){let e;return{c(){e=v("link"),C(e,"href",t[10]),C(e,"rel","stylesheet")},m(t,n){x(t,e,n)},p(t,n){1024&n[0]&&C(e,"href",t[10])},d(t){t&&w(e)}}}function Ht(e){let n,o,i,r,s,c,a,l,h,d,u,f,g,p,m,y=e[16]&&Ft(),b={color:e[5]};s=new Rt({props:b}),e[34](s);let k=e[17]&&At(e),z=e[11],S=[];for(let t=0;t<z.length;t+=1)S[t]=Bt(Nt(e,z,t));let P=e[13]&&jt(e),N=e[15]&&Ot(),F=void 0!==e[10]&&Lt(e);return{c(){var g;n=v("main"),o=v("div"),y&&y.c(),i=_(),r=v("div"),(g=s.$$.fragment)&&g.c(),c=_(),k&&k.c(),a=_();for(let t=0;t<S.length;t+=1)S[t].c();l=_(),P&&P.c(),h=_(),N&&N.c(),d=T(),u=_(),F&&F.c(),f=T(),this.c=t,C(r,"class","TransscriptItemContent"),C(o,"class","TranscriptItem"),C(n,"class","BigTranscript"),R(n,"--voffset",e[1]),R(n,"--hoffset",e[2]),R(n,"--fontsize",e[3]),R(n,"--color",e[4]),R(n,"--highlight-color",e[5]),R(n,"--text-bg-color",e[6]),R(n,"--gradient-stop1",e[7]),R(n,"--gradient-stop2",e[8]),R(n,"--marginbottom",e[9]),R(n,"--transition",e[18].transition),R(n,"opacity",e[18].transition),R(n,"max-height",10*Et(Tt,e[18].transition,0,.6)+"rem"),R(n,"visibility",0!==e[18].transition?"visible":"hidden"),D(n,"placementTop","top"===e[0]),D(n,"defaultTypography",e[15])},m(t,b){x(t,n,b),$(n,o),y&&y.m(o,null),$(o,i),$(o,r),rt(s,r,null),$(r,c),k&&k.m(r,null),$(n,a);for(let t=0;t<S.length;t+=1)S[t].m(n,null);$(n,l),P&&P.m(n,null),x(t,h,b),N&&N.m(document.head,null),$(document.head,d),x(t,u,b),F&&F.m(t,b),x(t,f,b),g=!0,p||(m=E(Dt,"message",e[22]),p=!0)},p(t,e){t[16]?y||(y=Ft(),y.c(),y.m(o,i)):y&&(y.d(1),y=null);const c={};if(32&e[0]&&(c.color=t[5]),s.$set(c),t[17]?k?131072&e[0]&&et(k,1):(k=At(t),k.c(),et(k,1),k.m(r,null)):k&&(k.d(1),k=null),8464384&e[0]){let o;for(z=t[11],o=0;o<z.length;o+=1){const i=Nt(t,z,o);S[o]?(S[o].p(i,e),et(S[o],1)):(S[o]=Bt(i),S[o].c(),et(S[o],1),S[o].m(n,l))}for(;o<S.length;o+=1)S[o].d(1);S.length=z.length}t[13]?P?(P.p(t,e),8192&e[0]&&et(P,1)):(P=jt(t),P.c(),et(P,1),P.m(n,null)):P&&(P.d(1),P=null),(!g||2&e[0])&&R(n,"--voffset",t[1]),(!g||4&e[0])&&R(n,"--hoffset",t[2]),(!g||8&e[0])&&R(n,"--fontsize",t[3]),(!g||16&e[0])&&R(n,"--color",t[4]),(!g||32&e[0])&&R(n,"--highlight-color",t[5]),(!g||64&e[0])&&R(n,"--text-bg-color",t[6]),(!g||128&e[0])&&R(n,"--gradient-stop1",t[7]),(!g||256&e[0])&&R(n,"--gradient-stop2",t[8]),(!g||512&e[0])&&R(n,"--marginbottom",t[9]),(!g||262144&e[0])&&R(n,"--transition",t[18].transition),(!g||262144&e[0])&&R(n,"opacity",t[18].transition),(!g||262144&e[0])&&R(n,"max-height",10*Et(Tt,t[18].transition,0,.6)+"rem"),(!g||262144&e[0])&&R(n,"visibility",0!==t[18].transition?"visible":"hidden"),1&e[0]&&D(n,"placementTop","top"===t[0]),32768&e[0]&&D(n,"defaultTypography",t[15]),t[15]?N||(N=Ot(),N.c(),N.m(d.parentNode,d)):N&&(N.d(1),N=null),void 0!==t[10]?F?F.p(t,e):(F=Lt(t),F.c(),F.m(f.parentNode,f)):F&&(F.d(1),F=null)},i(t){if(!g){et(s.$$.fragment,t),et(k);for(let t=0;t<z.length;t+=1)et(S[t]);et(P),g=!0}},o(t){!function(t,e,n,o){if(t&&t.o){if(tt.has(t))return;tt.add(t),(void 0).c.push((()=>{tt.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}(s.$$.fragment,t),g=!1},d(t){t&&w(n),y&&y.d(),e[34](null),st(s),k&&k.d(),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(S,t),P&&P.d(),t&&w(h),N&&N.d(t),w(d),t&&w(u),F&&F.d(t),t&&w(f),p=!1,m()}}}function Vt(t,e,n){let o,i,r,s,c,a,l,d,{placement:u}=e,{voffset:f="3rem"}=e,{hoffset:g="2rem"}=e,{fontsize:p="1.5rem"}=e,{color:m="#ffffff"}=e,{highlightcolor:$="#15e8b5"}=e,{backgroundcolor:y="#202020"}=e,{gradientstop1:b="#ffffff88"}=e,{gradientstop2:x="#ffffffcc"}=e,{marginbottom:w="0rem"}=e,{formattext:v}=e,{demomode:k}=e,{customcssurl:z}=e,{customtypography:_}=e,T=[],E=null,C=null,S=ht.Disconnected,P=!1,R=!1,D=!1,N=kt({transition:0},{duration:200});h(t,N,(t=>n(18,l=t)));const F=O(),A=zt(_t),I=zt(((t,{delay:e=0,duration:n=350,maxWidth:o=10})=>({delay:e,duration:n,css:t=>`\n max-width: ${Et(Tt,t,0,1)*o}rem;\n `}))),M=t=>{n(13,D=D||t)},B=t=>{n(30,S=t),S===ht.Recording&&(n(13,D=!1),n(11,T=[]),C=null)},j=t=>{if(void 0===t)return;d&&(s||S===ht.Recording)&&d.updateVU(.5*Math.random()+.5,75*Math.random()+75),t.isFinal?L(T.length>0?s?3500:2e3:0):T.length>0&&(P||n(31,P=!0),L(2e3));const e=`${t.contextId}/${t.id}`;null!==C?C!==e&&(n(13,D=!1),C=e):C=e,n(11,T=[]),t.words.forEach((t=>{n(11,T[t.index]={word:t.value,serialNumber:t.index,entityType:null,isFinal:t.isFinal,hide:!1},T)})),r?t.entities.forEach((t=>{n(11,T[t.startPosition].word=t.value,T),n(11,T[t.startPosition].entityType=t.type,T),n(11,T[t.startPosition].isFinal=t.isFinal,T),n(11,T[t.startPosition].hide=!1,T);for(let e=t.startPosition+1;e<t.endPosition;e++)T[e]&&n(11,T[e].hide=!0,T)})):t.entities.forEach((t=>{for(let e=t.startPosition;e<t.endPosition;e++)T[e]&&(n(11,T[e].entityType=t.type,T),n(11,T[e].isFinal=t.isFinal,T))})),n(11,T=T.filter((t=>!t.hide)))},L=(t=0)=>{V(),E=window.setTimeout((()=>{E=null,P&&n(31,P=!1)}),t)},V=()=>{null!==E&&(window.clearTimeout(E),E=null)};return t.$$set=t=>{"placement"in t&&n(0,u=t.placement),"voffset"in t&&n(1,f=t.voffset),"hoffset"in t&&n(2,g=t.hoffset),"fontsize"in t&&n(3,p=t.fontsize),"color"in t&&n(4,m=t.color),"highlightcolor"in t&&n(5,$=t.highlightcolor),"backgroundcolor"in t&&n(6,y=t.backgroundcolor),"gradientstop1"in t&&n(7,b=t.gradientstop1),"gradientstop2"in t&&n(8,x=t.gradientstop2),"marginbottom"in t&&n(9,w=t.marginbottom),"formattext"in t&&n(24,v=t.formattext),"demomode"in t&&n(25,k=t.demomode),"customcssurl"in t&&n(10,z=t.customcssurl),"customtypography"in t&&n(26,_=t.customtypography)},t.$$.update=()=>{if(2048&t.$$.dirty[0]&&n(17,o=0===T.length),64&t.$$.dirty[0]&&n(16,i="none"!==y),16777216&t.$$.dirty[0]&&(r=void 0===v||"false"!==v),33554432&t.$$.dirty[0]&&n(33,s=void 0!==k&&"false"!==k),67108864&t.$$.dirty[0]&&n(15,c=void 0===_||"false"===_),4&t.$$.dirty[1]&&n(14,a=s?800:350),1073741824&t.$$.dirty[0]|3&t.$$.dirty[1]){const t=S===ht.Recording||P;t!==R&&(e="visibilitychanged",l=t,F.dispatchEvent(new CustomEvent(e,{detail:l,composed:!0}))),n(32,R=t),N.set({transition:R?1:0})}var e,l;4&t.$$.dirty[1]&&(s||L(0))},[u,f,g,p,m,$,y,b,x,w,z,T,d,D,a,c,i,o,l,N,A,I,t=>{switch(t.data.type){case ut.speechsegment:j(t.data.segment);break;case ut.speechhandled:M(t.data.success);break;case ut.speechstate:B(t.data.state)}},t=>t.entityType||"",v,k,_,M,B,j,S,P,R,s,function(t){H[t?"unshift":"push"]((()=>{d=t,n(12,d)}))}]}class Wt extends lt{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{position:relative;user-select:none;display:flex;flex-direction:row;justify-content:start;flex-wrap:wrap;margin-bottom:calc(var(--marginbottom) * var(--transition))}.defaultTypography{font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--color);font-size:var(--fontsize);line-height:135%}.TranscriptItem{position:relative;display:flex;flex-direction:row;align-items:center}.Entity{color:var(--highlight-color)}.TransscriptItemContent{z-index:1;display:flex;flex-wrap:nowrap;flex-direction:row;align-items:center;overflow:hidden;white-space:nowrap}.TransscriptItemBgDiv{position:absolute;box-sizing:content-box;width:100%;height:100%;top:-0.2rem;left:-0.8rem;margin:0;padding:0.2rem 0.8rem;background-color:var(--text-bg-color);z-index:-1}.placementTop{position:fixed;top:0;left:0;right:0;bottom:0;margin:var(--voffset) var(--hoffset) 0 var(--hoffset);z-index:50;pointer-events:none}.listening{animation:flow 1s linear infinite;background:linear-gradient(-60deg, var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1));background-size:200%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;-webkit-box-decoration-break:clone}@keyframes flow{0%{background-position:100% 50%}100%{background-position:0% 50%}}</style>",at(this,{target:this.shadowRoot,props:N(this.attributes),customElement:!0},Vt,Ht,a,{placement:0,voffset:1,hoffset:2,fontsize:3,color:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,marginbottom:9,formattext:24,demomode:25,customcssurl:10,customtypography:26,speechhandled:27,speechstate:28,speechsegment:29},null,[-1,-1]),t&&(t.target&&x(t.target,this,t.anchor),t.props&&(this.$set(t.props),Q()))}static get observedAttributes(){return["placement","voffset","hoffset","fontsize","color","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","marginbottom","formattext","demomode","customcssurl","customtypography","speechhandled","speechstate","speechsegment"]}get placement(){return this.$$.ctx[0]}set placement(t){this.$$set({placement:t}),Q()}get voffset(){return this.$$.ctx[1]}set voffset(t){this.$$set({voffset:t}),Q()}get hoffset(){return this.$$.ctx[2]}set hoffset(t){this.$$set({hoffset:t}),Q()}get fontsize(){return this.$$.ctx[3]}set fontsize(t){this.$$set({fontsize:t}),Q()}get color(){return this.$$.ctx[4]}set color(t){this.$$set({color:t}),Q()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$$set({highlightcolor:t}),Q()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),Q()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$$set({gradientstop1:t}),Q()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$$set({gradientstop2:t}),Q()}get marginbottom(){return this.$$.ctx[9]}set marginbottom(t){this.$$set({marginbottom:t}),Q()}get formattext(){return this.$$.ctx[24]}set formattext(t){this.$$set({formattext:t}),Q()}get demomode(){return this.$$.ctx[25]}set demomode(t){this.$$set({demomode:t}),Q()}get customcssurl(){return this.$$.ctx[10]}set customcssurl(t){this.$$set({customcssurl:t}),Q()}get customtypography(){return this.$$.ctx[26]}set customtypography(t){this.$$set({customtypography:t}),Q()}get speechhandled(){return this.$$.ctx[27]}get speechstate(){return this.$$.ctx[28]}get speechsegment(){return this.$$.ctx[29]}}function qt(t){let e;return{c(){e=v("link"),C(e,"href",t[11]),C(e,"rel","stylesheet")},m(t,n){x(t,e,n)},p(t,n){2048&n[0]&&C(e,"href",t[11])},d(t){t&&w(e)}}}function Ut(e){let n,o,i,s,c,a,l,h,d,u,f=void 0!==e[11]&&qt(e);return{c(){f&&f.c(),n=_(),o=v("main"),i=v("div"),s=v("div"),c=v("big-transcript"),a=_(),l=v("div"),h=z(e[13]),this.c=t,S(c,"customtypography",e[12]),S(c,"customcssurl",e[11]),S(c,"formattext",e[9]),S(c,"fontsize",e[1]),S(c,"color",e[3]),S(c,"backgroundcolor","none"),S(c,"highlightcolor",e[5]),S(c,"gradientstop1",e[7]),S(c,"gradientstop2",e[8]),S(c,"demomode",e[10]),C(l,"class","hint"),R(l,"opacity",e[18].opacity),D(l,"defaultTypography",e[15]),C(s,"class","pad"),C(i,"class","drawer"),R(i,"background-color",e[6]),R(i,"opacity",e[16].opacity),R(i,"transform","translate(0px, "+e[17].y+"rem)"),C(o,"class","placementTop"),R(o,"--height",e[0]),R(o,"--smalltextcolor",e[4]),R(o,"--hintfontsize",e[2])},m(t,r){f&&f.m(t,r),x(t,n,r),x(t,o,r),$(o,i),$(i,s),$(s,c),e[29](c),$(s,a),$(s,l),$(l,h),d||(u=[E(window,"message",e[23]),E(c,"visibilitychanged",e[22])],d=!0)},p(t,e){void 0!==t[11]?f?f.p(t,e):(f=qt(t),f.c(),f.m(n.parentNode,n)):f&&(f.d(1),f=null),4096&e[0]&&S(c,"customtypography",t[12]),2048&e[0]&&S(c,"customcssurl",t[11]),512&e[0]&&S(c,"formattext",t[9]),2&e[0]&&S(c,"fontsize",t[1]),8&e[0]&&S(c,"color",t[3]),32&e[0]&&S(c,"highlightcolor",t[5]),128&e[0]&&S(c,"gradientstop1",t[7]),256&e[0]&&S(c,"gradientstop2",t[8]),1024&e[0]&&S(c,"demomode",t[10]),8192&e[0]&&P(h,t[13]),262144&e[0]&&R(l,"opacity",t[18].opacity),32768&e[0]&&D(l,"defaultTypography",t[15]),64&e[0]&&R(i,"background-color",t[6]),65536&e[0]&&R(i,"opacity",t[16].opacity),131072&e[0]&&R(i,"transform","translate(0px, "+t[17].y+"rem)"),1&e[0]&&R(o,"--height",t[0]),16&e[0]&&R(o,"--smalltextcolor",t[4]),4&e[0]&&R(o,"--hintfontsize",t[2])},i:t,o:t,d(t){f&&f.d(t),t&&w(n),t&&w(o),e[29](null),d=!1,r(u)}}}function Jt(t,n,o){let i,r,s,c,a,{height:l="8rem"}=n,{hint:d=""}=n,{fontsize:u="1.5rem"}=n,{hintfontsize:f="0.9rem"}=n,{color:g="#ffffff"}=n,{smalltextcolor:p="#ffffff70"}=n,{highlightcolor:m="#15e8b5"}=n,{backgroundcolor:$="#202020"}=n,{gradientstop1:y="#ffffff88"}=n,{gradientstop2:b="#ffffffcc"}=n,{formattext:x}=n,{demomode:w}=n,{customcssurl:v}=n,{customtypography:k}=n,z=[],_=0,T="";const E=(t,e=!0)=>{R.set({opacity:0}),a&&e&&a.speechsegment(t),t.isFinal&&(_++,_<z.length?o(13,T=z[_]):o(13,T=z[Math.floor(Math.random()*z.length)]))},C=t=>{_=0,o(24,d=t),z=[];try{z=JSON.parse(d),("string"==typeof z||z instanceof String)&&(z=[z])}catch(t){z[0]=d||""}o(13,T=z[_])};let S=kt({y:-1},{duration:200});h(t,S,(t=>o(17,s=t)));let P=kt({opacity:0},{duration:200,easing:e});h(t,P,(t=>o(16,r=t)));let R=kt({opacity:0},{duration:200,delay:200,easing:e});h(t,R,(t=>o(18,c=t)));return t.$$set=t=>{"height"in t&&o(0,l=t.height),"hint"in t&&o(24,d=t.hint),"fontsize"in t&&o(1,u=t.fontsize),"hintfontsize"in t&&o(2,f=t.hintfontsize),"color"in t&&o(3,g=t.color),"smalltextcolor"in t&&o(4,p=t.smalltextcolor),"highlightcolor"in t&&o(5,m=t.highlightcolor),"backgroundcolor"in t&&o(6,$=t.backgroundcolor),"gradientstop1"in t&&o(7,y=t.gradientstop1),"gradientstop2"in t&&o(8,b=t.gradientstop2),"formattext"in t&&o(9,x=t.formattext),"demomode"in t&&o(10,w=t.demomode),"customcssurl"in t&&o(11,v=t.customcssurl),"customtypography"in t&&o(12,k=t.customtypography)},t.$$.update=()=>{16777216&t.$$.dirty[0]&&C(d),4096&t.$$.dirty[0]&&o(15,i=void 0===k||"false"===k)},[l,u,f,g,p,m,$,y,b,x,w,v,k,T,a,i,r,s,c,S,P,R,t=>{!1===t.detail?(S.set({y:-1},{easing:yt}),P.set({opacity:0}),R.set({opacity:0})):(S.set({y:0},{easing:bt}),P.set({opacity:1}),R.set({opacity:1}))},t=>{switch(t.data.type){case ut.speechsegment:E(t.data.segment,!1);break;case ut.transcriptdrawerhint:C(t.data.hint)}},d,t=>{a&&a.speechhandled(t)},t=>{a&&a.speechstate(t)},E,C,function(t){H[t?"unshift":"push"]((()=>{a=t,o(14,a)}))}]}customElements.get("big-transcript")?console.warn("Skipping re-defining customElement big-transcript"):customElements.define("big-transcript",Wt);class Gt extends lt{constructor(t){super(),this.shadowRoot.innerHTML="<style>.placementTop{position:fixed;top:0;left:0;right:0;bottom:0;z-index:60;pointer-events:none}.drawer{width:100%;min-height:var(--height);display:flex;flex-direction:column;justify-content:flex-end;box-shadow:0 0 0.35rem #0004}.pad{position:relative;padding:2rem 2rem 0.65rem 1.5rem}.hint{margin-top:0.15rem}.defaultTypography{font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--smalltextcolor);font-size:var(--hintfontsize);line-height:135%}</style>",at(this,{target:this.shadowRoot,props:N(this.attributes),customElement:!0},Jt,Ut,a,{height:0,hint:24,fontsize:1,hintfontsize:2,color:3,smalltextcolor:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,formattext:9,demomode:10,customcssurl:11,customtypography:12,speechhandled:25,speechstate:26,speechsegment:27,sethint:28},null,[-1,-1]),t&&(t.target&&x(t.target,this,t.anchor),t.props&&(this.$set(t.props),Q()))}static get observedAttributes(){return["height","hint","fontsize","hintfontsize","color","smalltextcolor","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","formattext","demomode","customcssurl","customtypography","speechhandled","speechstate","speechsegment","sethint"]}get height(){return this.$$.ctx[0]}set height(t){this.$$set({height:t}),Q()}get hint(){return this.$$.ctx[24]}set hint(t){this.$$set({hint:t}),Q()}get fontsize(){return this.$$.ctx[1]}set fontsize(t){this.$$set({fontsize:t}),Q()}get hintfontsize(){return this.$$.ctx[2]}set hintfontsize(t){this.$$set({hintfontsize:t}),Q()}get color(){return this.$$.ctx[3]}set color(t){this.$$set({color:t}),Q()}get smalltextcolor(){return this.$$.ctx[4]}set smalltextcolor(t){this.$$set({smalltextcolor:t}),Q()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$$set({highlightcolor:t}),Q()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),Q()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$$set({gradientstop1:t}),Q()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$$set({gradientstop2:t}),Q()}get formattext(){return this.$$.ctx[9]}set formattext(t){this.$$set({formattext:t}),Q()}get demomode(){return this.$$.ctx[10]}set demomode(t){this.$$set({demomode:t}),Q()}get customcssurl(){return this.$$.ctx[11]}set customcssurl(t){this.$$set({customcssurl:t}),Q()}get customtypography(){return this.$$.ctx[12]}set customtypography(t){this.$$set({customtypography:t}),Q()}get speechhandled(){return this.$$.ctx[25]}get speechstate(){return this.$$.ctx[26]}get speechsegment(){return this.$$.ctx[27]}get sethint(){return this.$$.ctx[28]}}customElements.get("transcript-drawer")?console.warn("Skipping re-defining customElement transcript-drawer"):customElements.define("transcript-drawer",Gt)})); | ||
//# sourceMappingURL=transcript-drawer.js.map |
@@ -1,2 +0,2 @@ | ||
import type { Behaviour, Effect, Icon } from "./constants"; | ||
import type { Behaviour, Effect, Icon, TriggerFx } from "./constants"; | ||
export type { Segment, Intent, Word, Entity } from "../node_modules/@speechly/browser-client/src/speechly/types"; | ||
@@ -14,2 +14,3 @@ export declare type ITaggedWord = { | ||
effect: Effect; | ||
triggerFx?: TriggerFx; | ||
}; | ||
@@ -16,0 +17,0 @@ export declare type IHoldEvent = { |
@@ -1,2 +0,2 @@ | ||
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(){}const t=e=>e;function n(e){return e()}function o(){return Object.create(null)}function r(e){e.forEach(n)}function i(e){return"function"==typeof e}let s;function c(e,t){return s||(s=document.createElement("a")),s.href=t,e===s.href}function a(e,t){return e!=e?t==t:e!==t}const l="undefined"!=typeof window;let d=l?()=>window.performance.now():()=>Date.now(),u=l?e=>requestAnimationFrame(e):e;const f=new Set;function h(e){f.forEach((t=>{t.c(e)||(f.delete(t),t.f())})),0!==f.size&&u(h)}function p(e,t){e.appendChild(t)}function m(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function g(e){const t=y("style");return function(e,t){p(e.head||e,t)}(m(e),t),t}function b(e,t,n){e.insertBefore(t,n||null)}function $(e){e.parentNode.removeChild(e)}function y(e){return document.createElement(e)}function v(e){return document.createTextNode(e)}function w(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function _(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function x(e,t,n,o){e.style.setProperty(t,n,o?"important":"")}function z(e){const t={};for(const n of e)t[n.name]=n.value;return t}const k=new Set;let E,C=0;function S(e,t,n,o,r,i,s,c=0){const a=16.666/o;let l="{\n";for(let e=0;e<=1;e+=a){const o=t+(n-t)*i(e);l+=100*e+`%{${s(o,1-o)}}\n`}const d=l+`100% {${s(n,1-n)}}\n}`,u=`__svelte_${function(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}(d)}_${c}`,f=m(e);k.add(f);const h=f.__svelte_stylesheet||(f.__svelte_stylesheet=g(e).sheet),p=f.__svelte_rules||(f.__svelte_rules={});p[u]||(p[u]=!0,h.insertRule(`@keyframes ${u} ${d}`,h.cssRules.length));const b=e.style.animation||"";return e.style.animation=`${b?`${b}, `:""}${u} ${o}ms linear ${r}ms 1 both`,C+=1,u}function D(e,t){const n=(e.style.animation||"").split(", "),o=n.filter(t?e=>e.indexOf(t)<0:e=>-1===e.indexOf("__svelte")),r=n.length-o.length;r&&(e.style.animation=o.join(", "),C-=r,C||u((()=>{C||(k.forEach((e=>{const t=e.__svelte_stylesheet;let n=t.cssRules.length;for(;n--;)t.deleteRule(n);e.__svelte_rules={}})),k.clear())})))}function N(e){E=e}function R(){if(!E)throw new Error("Function called outside component initialization");return E}const A=[],F=[],M=[],O=[],P=Promise.resolve();let T=!1;function B(e){M.push(e)}let L=!1;const j=new Set;function H(){if(!L){L=!0;do{for(let e=0;e<A.length;e+=1){const t=A[e];N(t),q(t.$$)}for(N(null),A.length=0;F.length;)F.pop()();for(let e=0;e<M.length;e+=1){const t=M[e];j.has(t)||(j.add(t),t())}M.length=0}while(A.length);for(;O.length;)O.pop()();T=!1,L=!1,j.clear()}}function q(e){if(null!==e.fragment){e.update(),r(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(B)}}let Y;function G(e,t,n){e.dispatchEvent(function(e,t,n=!1){const o=document.createEvent("CustomEvent");return o.initCustomEvent(e,n,!1,t),o}(`${t?"intro":"outro"}${n}`))}const I=new Set;let J;function K(e,t){e&&e.i&&(I.delete(e),e.i(t))}function Q(e,t,n,o){if(e&&e.o){if(I.has(e))return;I.add(e),J.c.push((()=>{I.delete(e),o&&(n&&e.d(1),o())})),e.o(t)}}const U={duration:0};function V(n,o,s,c){let a=o(n,s),l=c?0:1,p=null,m=null,g=null;function b(){g&&D(n,g)}function $(e,t){const n=e.b-l;return t*=Math.abs(n),{a:l,b:e.b,d:n,duration:t,start:e.start,end:e.start+t,group:e.group}}function y(o){const{delay:i=0,duration:s=300,easing:c=t,tick:y=e,css:v}=a||U,w={start:d()+i,b:o};o||(w.group=J,J.r+=1),p||m?m=w:(v&&(b(),g=S(n,l,o,s,i,c,v)),o&&y(0,1),p=$(w,s),B((()=>G(n,o,"start"))),function(e){let t;0===f.size&&u(h),new Promise((n=>{f.add(t={c:e,f:n})}))}((e=>{if(m&&e>m.start&&(p=$(m,s),m=null,G(n,p.b,"start"),v&&(b(),g=S(n,l,p.b,p.duration,0,c,a.css))),p)if(e>=p.end)y(l=p.b,1-l),G(n,p.b,"end"),m||(p.b?b():--p.group.r||r(p.group.c)),p=null;else if(e>=p.start){const t=e-p.start;l=p.a+p.d*c(t/p.duration),y(l,1-l)}return!(!p&&!m)})))}return{run(e){i(a)?(Y||(Y=Promise.resolve(),Y.then((()=>{Y=null}))),Y).then((()=>{a=a(),y(e)})):y(e)},end(){b(),p=m=null}}}const W="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function X(e,t){-1===e.$$.dirty[0]&&(A.push(e),T||(T=!0,P.then(H)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function Z(t,s,c,a,l,d,u,f=[-1]){const h=E;N(t);const p=t.$$={fragment:null,ctx:null,props:d,update:e,not_equal:l,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(h?h.$$.context:[])),callbacks:o(),dirty:f,skip_bound:!1,root:s.target||h.$$.root};u&&u(p.root);let m=!1;if(p.ctx=c?c(t,s.props||{},((e,n,...o)=>{const r=o.length?o[0]:n;return p.ctx&&l(p.ctx[e],p.ctx[e]=r)&&(!p.skip_bound&&p.bound[e]&&p.bound[e](r),m&&X(t,e)),n})):[],p.update(),m=!0,r(p.before_update),p.fragment=!!a&&a(p.ctx),s.target){if(s.hydrate){const e=function(e){return Array.from(e.childNodes)}(s.target);p.fragment&&p.fragment.l(e),e.forEach($)}else p.fragment&&p.fragment.c();s.intro&&K(t.$$.fragment),function(e,t,o,s){const{fragment:c,on_mount:a,on_destroy:l,after_update:d}=e.$$;c&&c.m(t,o),s||B((()=>{const t=a.map(n).filter(i);l?l.push(...t):r(t),e.$$.on_mount=[]})),d.forEach(B)}(t,s.target,s.anchor,s.customElement),H()}N(h)}let ee;function te(e,{delay:n=0,duration:o=400,easing:r=t}={}){const i=+getComputedStyle(e).opacity;return{delay:n,duration:o,easing:r,css:e=>"opacity: "+e*i}}var ne,oe,re,ie,se,ce;"function"==typeof HTMLElement&&(ee=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:e}=this.$$;this.$$.on_disconnect=e.map(n).filter(i);for(const e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(e,t,n){this[e]=n}disconnectedCallback(){r(this.$$.on_disconnect)}$destroy(){!function(e,t){const n=e.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=e}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}),function(e){e[e.Failed=0]="Failed",e[e.NoBrowserSupport=1]="NoBrowserSupport",e[e.NoAudioConsent=2]="NoAudioConsent",e[e.Disconnected=3]="Disconnected",e[e.Disconnecting=4]="Disconnecting",e[e.Connecting=5]="Connecting",e[e.Connected=6]="Connected",e[e.Starting=7]="Starting",e[e.Stopping=8]="Stopping",e[e.Recording=9]="Recording"}(ne||(ne={})),function(e){e.SpeechlyFirstConnect="SpeechlyFirstConnect"}(oe||(oe={})),function(e){e.speechlypoweron="speechlypoweron",e.holdstart="holdstart",e.holdend="holdend",e.speechlystarting="speechlystarting",e.speechstate="speechstate",e.initialized="initialized",e.speechsegment="speechsegment",e.speechhandled="speechhandled",e.showhint="showhint",e.transcriptdrawerhint="hint",e.speechlyintroready="speechlyintroready",e.speechlyintroclosed="speechlyintroclosed"}(re||(re={})),function(e){e.Mic="mic",e.Error="error",e.Denied="denied"}(ie||(ie={})),function(e){e.Hold="hold",e.Click="click",e.Noninteractive="noninteractive"}(se||(se={})),function(e){e.None="none",e.Connecting="connecting",e.Busy="busy"}(ce||(ce={})),ne.Disconnected,ne.Disconnecting,ne.Connecting,ne.Connected,ne.Starting,ne.Recording,ne.Stopping,ne.Failed,ne.NoBrowserSupport,ne.NoAudioConsent;const{window:ae}=W;function le(e){let t,n,o,r,i,s,a,l,d,u,f,h;return{c(){t=y("modalcontent"),n=y("animation"),o=y("button"),r=v(" "),i=y("video"),s=y("source"),l=v("\n Your browser does not support the video tag."),_(o,"class","close"),c(s.src,a=e[0])||_(s,"src",a),_(s,"type","video/mp4"),_(i,"width","100%"),_(i,"height","auto"),i.autoplay=!0,i.muted=!0,i.loop=!0,_(t,"class",e[2])},m(c,a){b(c,t,a),p(t,n),p(n,o),p(n,r),p(n,i),p(i,s),p(i,l),u=!0,f||(h=w(o,"click",e[5]),f=!0)},p(e,n){(!u||1&n&&!c(s.src,a=e[0]))&&_(s,"src",a),(!u||4&n)&&_(t,"class",e[2])},i(n){u||(B((()=>{d||(d=V(t,e[4],{},!0)),d.run(1)})),u=!0)},o(n){d||(d=V(t,e[4],{},!1)),d.run(0),u=!1},d(e){e&&$(t),e&&d&&d.end(),f=!1,h()}}}function de(t){let n,o,i,s,c=t[3]&&le(t);return{c(){n=y("modal"),c&&c.c(),this.c=e,x(n,"--remsize",t[1])},m(e,r){b(e,n,r),c&&c.m(n,null),o=!0,i||(s=w(ae,"keydown",t[6]),i=!0)},p(e,[t]){e[3]?c?(c.p(e,t),8&t&&K(c,1)):(c=le(e),c.c(),K(c,1),c.m(n,null)):c&&(J={r:0,c:[],p:J},Q(c,1,1,(()=>{c=null})),J.r||r(J.c),J=J.p),(!o||2&t)&&x(n,"--remsize",e[1])},i(e){o||(K(c),o=!0)},o(e){Q(c),o=!1},d(e){e&&$(n),c&&c.d(),i=!1,s()}}}function ue(e,t,n){let o,{video:r=""}=t,{hide:i}=t,{remsize:s="1.0rem"}=t,{position:c="fixed"}=t;const a=(()=>{const e=R();return(t,n)=>{e.dispatchEvent(new CustomEvent(t,{detail:n,composed:!0}))}})(),l=(d=te,function(e,t){if(!e.hasOwnProperty("ownerDocument")){Object.defineProperty(e,"ownerDocument",{get:function(){return e.parentElement}});let t=e;for(;t.parentElement;)t=t.parentElement;e.parentElement.head=t}return d(e,t)});var d;let u=!1;var f;f=()=>{n(8,u=!0)},R().$$.on_mount.push(f);const h=()=>{n(3,o=!1),a("speechlyvideoclosed"),window.postMessage({type:"speechlyvideoclosed"},"*")};return e.$$set=e=>{"video"in e&&n(0,r=e.video),"hide"in e&&n(7,i=e.hide),"remsize"in e&&n(1,s=e.remsize),"position"in e&&n(2,c=e.position)},e.$$.update=()=>{384&e.$$.dirty&&n(3,o=u&&"false"===i)},[r,s,c,o,l,h,e=>{u&&"Escape"===e.key&&(e.preventDefault(),h())},i,u]}class fe extends ee{constructor(e){super(),this.shadowRoot.innerHTML="<style>modal{font-size:var(--remsize);height:100%}modalcontent{z-index:2001;pointer-events:none}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}animation{position:absolute;box-sizing:border-box;width:300px;margin:1rem;top:0;right:0;border-radius:8px;pointer-events:auto}video{box-sizing:border-box;width:100%;border-radius:0.5rem;overflow:hidden;border:1px solid #0002}.close{--button-size:1.5rem;display:block;box-sizing:border-box;position:absolute;z-index:1000;top:0.25rem;right:0.25rem;margin:0;padding:0;width:var(--button-size);height:var(--button-size);border:0;color:black;border-radius:1.5rem;background:transparent;box-shadow:0 0 0 1px transparent;transition:transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);-webkit-appearance:none}.close:before,.close:after{content:'';display:block;box-sizing:border-box;position:absolute;top:50%;width:calc(var(--button-size) - 0.5rem);height:1px;background:#728195;transform-origin:center;transition:height 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1)}.close:before{-webkit-transform:translate(0, -50%) rotate(45deg);-moz-transform:translate(0, -50%) rotate(45deg);transform:translate(0, -50%) rotate(45deg);left:0.25rem}.close:after{-webkit-transform:translate(0, -50%) rotate(-45deg);-moz-transform:translate(0, -50%) rotate(-45deg);transform:translate(0, -50%) rotate(-45deg);left:0.25rem}.close:hover{background:#ffffff}.close:hover:before,.close:hover:after{height:2px;background:black}.close:focus{border-color:#3399ff;box-shadow:0 0 0 2px #3399ff}.close:active{transform:scale(0.9)}.close:hover,.close:focus,.close:active{outline:none}</style>",Z(this,{target:this.shadowRoot,props:z(this.attributes),customElement:!0},ue,de,a,{video:0,hide:7,remsize:1,position:2},null),e&&(e.target&&b(e.target,this,e.anchor),e.props&&(this.$set(e.props),H()))}static get observedAttributes(){return["video","hide","remsize","position"]}get video(){return this.$$.ctx[0]}set video(e){this.$$set({video:e}),H()}get hide(){return this.$$.ctx[7]}set hide(e){this.$$set({hide:e}),H()}get remsize(){return this.$$.ctx[1]}set remsize(e){this.$$set({remsize:e}),H()}get position(){return this.$$.ctx[2]}set position(e){this.$$set({position:e}),H()}}customElements.get("video-guide")?console.warn("Skipping re-defining customElement video-guide"):customElements.define("video-guide",fe)})); | ||
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(){}const t=e=>e;function n(e){return e()}function o(){return Object.create(null)}function i(e){e.forEach(n)}function r(e){return"function"==typeof e}let s;function c(e,t){return s||(s=document.createElement("a")),s.href=t,e===s.href}function a(e,t){return e!=e?t==t:e!==t}const l="undefined"!=typeof window;let d=l?()=>window.performance.now():()=>Date.now(),u=l?e=>requestAnimationFrame(e):e;const f=new Set;function h(e){f.forEach((t=>{t.c(e)||(f.delete(t),t.f())})),0!==f.size&&u(h)}function p(e,t){e.appendChild(t)}function m(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function g(e){const t=y("style");return function(e,t){p(e.head||e,t)}(m(e),t),t}function b(e,t,n){e.insertBefore(t,n||null)}function $(e){e.parentNode.removeChild(e)}function y(e){return document.createElement(e)}function v(e){return document.createTextNode(e)}function w(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function _(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function x(e,t,n,o){e.style.setProperty(t,n,o?"important":"")}function z(e){const t={};for(const n of e)t[n.name]=n.value;return t}const k=new Set;let E,C=0;function S(e,t,n,o,i,r,s,c=0){const a=16.666/o;let l="{\n";for(let e=0;e<=1;e+=a){const o=t+(n-t)*r(e);l+=100*e+`%{${s(o,1-o)}}\n`}const d=l+`100% {${s(n,1-n)}}\n}`,u=`__svelte_${function(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}(d)}_${c}`,f=m(e);k.add(f);const h=f.__svelte_stylesheet||(f.__svelte_stylesheet=g(e).sheet),p=f.__svelte_rules||(f.__svelte_rules={});p[u]||(p[u]=!0,h.insertRule(`@keyframes ${u} ${d}`,h.cssRules.length));const b=e.style.animation||"";return e.style.animation=`${b?`${b}, `:""}${u} ${o}ms linear ${i}ms 1 both`,C+=1,u}function N(e,t){const n=(e.style.animation||"").split(", "),o=n.filter(t?e=>e.indexOf(t)<0:e=>-1===e.indexOf("__svelte")),i=n.length-o.length;i&&(e.style.animation=o.join(", "),C-=i,C||u((()=>{C||(k.forEach((e=>{const t=e.__svelte_stylesheet;let n=t.cssRules.length;for(;n--;)t.deleteRule(n);e.__svelte_rules={}})),k.clear())})))}function D(e){E=e}function A(){if(!E)throw new Error("Function called outside component initialization");return E}const R=[],M=[],F=[],O=[],P=Promise.resolve();let T=!1;function B(e){F.push(e)}let L=!1;const j=new Set;function H(){if(!L){L=!0;do{for(let e=0;e<R.length;e+=1){const t=R[e];D(t),q(t.$$)}for(D(null),R.length=0;M.length;)M.pop()();for(let e=0;e<F.length;e+=1){const t=F[e];j.has(t)||(j.add(t),t())}F.length=0}while(R.length);for(;O.length;)O.pop()();T=!1,L=!1,j.clear()}}function q(e){if(null!==e.fragment){e.update(),i(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(B)}}let W;function Y(e,t,n){e.dispatchEvent(function(e,t,n=!1){const o=document.createEvent("CustomEvent");return o.initCustomEvent(e,n,!1,t),o}(`${t?"intro":"outro"}${n}`))}const G=new Set;let I;function J(e,t){e&&e.i&&(G.delete(e),e.i(t))}function K(e,t,n,o){if(e&&e.o){if(G.has(e))return;G.add(e),I.c.push((()=>{G.delete(e),o&&(n&&e.d(1),o())})),e.o(t)}}const Q={duration:0};function U(n,o,s,c){let a=o(n,s),l=c?0:1,p=null,m=null,g=null;function b(){g&&N(n,g)}function $(e,t){const n=e.b-l;return t*=Math.abs(n),{a:l,b:e.b,d:n,duration:t,start:e.start,end:e.start+t,group:e.group}}function y(o){const{delay:r=0,duration:s=300,easing:c=t,tick:y=e,css:v}=a||Q,w={start:d()+r,b:o};o||(w.group=I,I.r+=1),p||m?m=w:(v&&(b(),g=S(n,l,o,s,r,c,v)),o&&y(0,1),p=$(w,s),B((()=>Y(n,o,"start"))),function(e){let t;0===f.size&&u(h),new Promise((n=>{f.add(t={c:e,f:n})}))}((e=>{if(m&&e>m.start&&(p=$(m,s),m=null,Y(n,p.b,"start"),v&&(b(),g=S(n,l,p.b,p.duration,0,c,a.css))),p)if(e>=p.end)y(l=p.b,1-l),Y(n,p.b,"end"),m||(p.b?b():--p.group.r||i(p.group.c)),p=null;else if(e>=p.start){const t=e-p.start;l=p.a+p.d*c(t/p.duration),y(l,1-l)}return!(!p&&!m)})))}return{run(e){r(a)?(W||(W=Promise.resolve(),W.then((()=>{W=null}))),W).then((()=>{a=a(),y(e)})):y(e)},end(){b(),p=m=null}}}const V="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function X(e,t){-1===e.$$.dirty[0]&&(R.push(e),T||(T=!0,P.then(H)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function Z(t,s,c,a,l,d,u,f=[-1]){const h=E;D(t);const p=t.$$={fragment:null,ctx:null,props:d,update:e,not_equal:l,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(h?h.$$.context:[])),callbacks:o(),dirty:f,skip_bound:!1,root:s.target||h.$$.root};u&&u(p.root);let m=!1;if(p.ctx=c?c(t,s.props||{},((e,n,...o)=>{const i=o.length?o[0]:n;return p.ctx&&l(p.ctx[e],p.ctx[e]=i)&&(!p.skip_bound&&p.bound[e]&&p.bound[e](i),m&&X(t,e)),n})):[],p.update(),m=!0,i(p.before_update),p.fragment=!!a&&a(p.ctx),s.target){if(s.hydrate){const e=function(e){return Array.from(e.childNodes)}(s.target);p.fragment&&p.fragment.l(e),e.forEach($)}else p.fragment&&p.fragment.c();s.intro&&J(t.$$.fragment),function(e,t,o,s){const{fragment:c,on_mount:a,on_destroy:l,after_update:d}=e.$$;c&&c.m(t,o),s||B((()=>{const t=a.map(n).filter(r);l?l.push(...t):i(t),e.$$.on_mount=[]})),d.forEach(B)}(t,s.target,s.anchor,s.customElement),H()}D(h)}let ee;function te(e,{delay:n=0,duration:o=400,easing:i=t}={}){const r=+getComputedStyle(e).opacity;return{delay:n,duration:o,easing:i,css:e=>"opacity: "+e*r}}var ne,oe,ie,re,se,ce,ae;"function"==typeof HTMLElement&&(ee=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:e}=this.$$;this.$$.on_disconnect=e.map(n).filter(r);for(const e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(e,t,n){this[e]=n}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){!function(e,t){const n=e.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=e}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}),function(e){e[e.Failed=0]="Failed",e[e.NoBrowserSupport=1]="NoBrowserSupport",e[e.NoAudioConsent=2]="NoAudioConsent",e[e.Disconnected=3]="Disconnected",e[e.Disconnecting=4]="Disconnecting",e[e.Connecting=5]="Connecting",e[e.Connected=6]="Connected",e[e.Starting=7]="Starting",e[e.Stopping=8]="Stopping",e[e.Recording=9]="Recording"}(ne||(ne={})),function(e){e.SpeechlyFirstConnect="SpeechlyFirstConnect"}(oe||(oe={})),function(e){e.speechlypoweron="speechlypoweron",e.holdstart="holdstart",e.holdend="holdend",e.speechlystarting="speechlystarting",e.speechstate="speechstate",e.initialized="initialized",e.speechsegment="speechsegment",e.speechhandled="speechhandled",e.showhint="showhint",e.transcriptdrawerhint="hint",e.speechlyintroready="speechlyintroready",e.speechlyintroclosed="speechlyintroclosed"}(ie||(ie={})),function(e){e.Mic="mic",e.MicActive="micactive",e.Error="error",e.Denied="denied"}(re||(re={})),function(e){e.Hold="hold",e.Click="click",e.Noninteractive="noninteractive"}(se||(se={})),function(e){e.None="none",e.Connecting="connecting",e.Busy="busy"}(ce||(ce={})),function(e){e.None="none",e.Whirl="whirl"}(ae||(ae={})),ne.Disconnected,ne.Disconnecting,ne.Connecting,ne.Connected,ne.Starting,ne.Recording,ne.Stopping,ne.Failed,ne.NoBrowserSupport,ne.NoAudioConsent;const{window:le}=V;function de(e){let t,n,o,i,r,s,a,l,d,u,f,h;return{c(){t=y("modalcontent"),n=y("animation"),o=y("button"),i=v(" "),r=y("video"),s=y("source"),l=v("\n Your browser does not support the video tag."),_(o,"class","close"),c(s.src,a=e[0])||_(s,"src",a),_(s,"type","video/mp4"),_(r,"width","100%"),_(r,"height","auto"),r.autoplay=!0,r.muted=!0,r.loop=!0,_(t,"class",e[2])},m(c,a){b(c,t,a),p(t,n),p(n,o),p(n,i),p(n,r),p(r,s),p(r,l),u=!0,f||(h=w(o,"click",e[5]),f=!0)},p(e,n){(!u||1&n&&!c(s.src,a=e[0]))&&_(s,"src",a),(!u||4&n)&&_(t,"class",e[2])},i(n){u||(B((()=>{d||(d=U(t,e[4],{},!0)),d.run(1)})),u=!0)},o(n){d||(d=U(t,e[4],{},!1)),d.run(0),u=!1},d(e){e&&$(t),e&&d&&d.end(),f=!1,h()}}}function ue(t){let n,o,r,s,c=t[3]&&de(t);return{c(){n=y("modal"),c&&c.c(),this.c=e,x(n,"--remsize",t[1])},m(e,i){b(e,n,i),c&&c.m(n,null),o=!0,r||(s=w(le,"keydown",t[6]),r=!0)},p(e,[t]){e[3]?c?(c.p(e,t),8&t&&J(c,1)):(c=de(e),c.c(),J(c,1),c.m(n,null)):c&&(I={r:0,c:[],p:I},K(c,1,1,(()=>{c=null})),I.r||i(I.c),I=I.p),(!o||2&t)&&x(n,"--remsize",e[1])},i(e){o||(J(c),o=!0)},o(e){K(c),o=!1},d(e){e&&$(n),c&&c.d(),r=!1,s()}}}function fe(e,t,n){let o,{video:i=""}=t,{hide:r}=t,{remsize:s="1.0rem"}=t,{position:c="fixed"}=t;const a=(()=>{const e=A();return(t,n)=>{e.dispatchEvent(new CustomEvent(t,{detail:n,composed:!0}))}})(),l=(d=te,function(e,t){if(!e.hasOwnProperty("ownerDocument")){Object.defineProperty(e,"ownerDocument",{get:function(){return e.parentElement}});let t=e;for(;t.parentElement;)t=t.parentElement;e.parentElement.head=t}return d(e,t)});var d;let u=!1;var f;f=()=>{n(8,u=!0)},A().$$.on_mount.push(f);const h=()=>{n(3,o=!1),a("speechlyvideoclosed"),window.postMessage({type:"speechlyvideoclosed"},"*")};return e.$$set=e=>{"video"in e&&n(0,i=e.video),"hide"in e&&n(7,r=e.hide),"remsize"in e&&n(1,s=e.remsize),"position"in e&&n(2,c=e.position)},e.$$.update=()=>{384&e.$$.dirty&&n(3,o=u&&"false"===r)},[i,s,c,o,l,h,e=>{u&&"Escape"===e.key&&(e.preventDefault(),h())},r,u]}class he extends ee{constructor(e){super(),this.shadowRoot.innerHTML="<style>modal{font-size:var(--remsize);height:100%}modalcontent{z-index:2001;pointer-events:none}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}animation{position:absolute;box-sizing:border-box;width:300px;margin:1rem;top:0;right:0;border-radius:8px;pointer-events:auto}video{box-sizing:border-box;width:100%;border-radius:0.5rem;overflow:hidden;border:1px solid #0002}.close{--button-size:1.5rem;display:block;box-sizing:border-box;position:absolute;z-index:1000;top:0.25rem;right:0.25rem;margin:0;padding:0;width:var(--button-size);height:var(--button-size);border:0;color:black;border-radius:1.5rem;background:transparent;box-shadow:0 0 0 1px transparent;transition:transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);-webkit-appearance:none}.close:before,.close:after{content:'';display:block;box-sizing:border-box;position:absolute;top:50%;width:calc(var(--button-size) - 0.5rem);height:1px;background:#728195;transform-origin:center;transition:height 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1)}.close:before{-webkit-transform:translate(0, -50%) rotate(45deg);-moz-transform:translate(0, -50%) rotate(45deg);transform:translate(0, -50%) rotate(45deg);left:0.25rem}.close:after{-webkit-transform:translate(0, -50%) rotate(-45deg);-moz-transform:translate(0, -50%) rotate(-45deg);transform:translate(0, -50%) rotate(-45deg);left:0.25rem}.close:hover{background:#ffffff}.close:hover:before,.close:hover:after{height:2px;background:black}.close:focus{border-color:#3399ff;box-shadow:0 0 0 2px #3399ff}.close:active{transform:scale(0.9)}.close:hover,.close:focus,.close:active{outline:none}</style>",Z(this,{target:this.shadowRoot,props:z(this.attributes),customElement:!0},fe,ue,a,{video:0,hide:7,remsize:1,position:2},null),e&&(e.target&&b(e.target,this,e.anchor),e.props&&(this.$set(e.props),H()))}static get observedAttributes(){return["video","hide","remsize","position"]}get video(){return this.$$.ctx[0]}set video(e){this.$$set({video:e}),H()}get hide(){return this.$$.ctx[7]}set hide(e){this.$$set({hide:e}),H()}get remsize(){return this.$$.ctx[1]}set remsize(e){this.$$set({remsize:e}),H()}get position(){return this.$$.ctx[2]}set position(e){this.$$set({position:e}),H()}}customElements.get("video-guide")?console.warn("Skipping re-defining customElement video-guide"):customElements.define("video-guide",he)})); | ||
//# sourceMappingURL=video-guide.js.map |
{ | ||
"name": "@speechly/browser-ui", | ||
"version": "5.1.0-beta.4", | ||
"version": "5.1.0-beta.5", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "build": "rimraf core && rollup -c --silent && mv core/types/src/* core && rimraf core/types", |
@@ -23,3 +23,3 @@ <div align="center" markdown="1"> | ||
Ready made Speechly [UI components](https://docs.speechly.com/client-libraries/ui-components/) to build a reactive voice interface to a web site or app. | ||
Ready made Speechly [UI components](https://docs.speechly.com/client-libraries/ui-components/) to build a reactive voice interface to a web site or app. See these CodePens for a preview: | ||
@@ -31,10 +31,18 @@ - [Speech-to-text CodePen](https://codepen.io/speechly/pen/VwzoMrW) | ||
## Introduction To Components | ||
- [Push-To-Talk Button](https://docs.speechly.com/ui-components/push-to-talk-button/) provides a button to control listening on/off. It comes integrated with [browser-client](https://github.com/speechly/speechly/tree/main/libraries/browser-client). | ||
- [Big Transcript](https://docs.speechly.com/ui-components/big-transcript/) is an overlay-style component that displays real-time speech-to-text transcript and feedback to the user. Recognized entities are highlighted. | ||
- [Transcript Drawer](https://docs.speechly.com/ui-components/big-transcript/) is an alternative to Big Transcript that slides down from the top of the viewport. It displays usage hints along with the real-time speech-to-text transcript and feedback. | ||
- Intro Popup (optional) provides a customizable introduction to voice features, guides the user through browser mic permission setup and helps recover from common problems. | ||
- [Error Panel](https://docs.speechly.com/ui-components/error-panel/) is an alternative to Intro Popup. It helps recover from common problems. | ||
## Documentation | ||
- [Basic usage documentation](https://docs.speechly.com/client-libraries/usage/) | ||
- [UI component gallery and API](https://docs.speechly.com/client-libraries/ui-components/) | ||
- [UI component gallery and API](https://docs.speechly.com/ui-components/) | ||
- [Basic Speechly usage](https://docs.speechly.com/client-libraries/usage/) | ||
## Browser Usage | ||
Include the Web Components from a CDN that mirrors [`@speechly/browser-ui`](https://www.npmjs.com/package/@speechly/browser-ui) npm package. The script tags register `push-to-talk-button`, `big-transcript` and `error-panel` with the browser's customElement registry so you can use them like regular tags. | ||
Include the Web Components from a CDN that mirrors [`@speechly/browser-ui`](https://www.npmjs.com/package/@speechly/browser-ui) npm package. The script tags register `push-to-talk-button`, `big-transcript` and `intro-popup` with the browser's customElement registry so you can use them like regular tags. | ||
@@ -45,17 +53,22 @@ ``` | ||
<script type="text/javascript" src="https://unpkg.com/@speechly/browser-ui/core/big-transcript.js"></script> | ||
<script type="text/javascript" src="https://unpkg.com/@speechly/browser-ui/core/error-panel.js"></script> | ||
<script type="text/javascript" src="https://unpkg.com/@speechly/browser-ui/core/intro-popup.js"></script> | ||
</head> | ||
<body> | ||
<big-transcript placement="top"></big-transcript> | ||
<push-to-talk-button placement="bottom" appid="YOUR_APP_ID_FROM_SPEECHLY_DASHBOARD"></push-to-talk-button> | ||
<error-panel placement="bottom"></error-panel> | ||
<big-transcript | ||
placement="top"> | ||
</big-transcript> | ||
<push-to-talk-button | ||
placement="bottom" | ||
appid="YOUR_APP_ID_FROM_SPEECHLY_DASHBOARD"> | ||
</push-to-talk-button> | ||
<intro-popup> | ||
<span slot="welcome-body">You'll be able to control this web app faster with voice.</span> | ||
</intro-popup> | ||
</body> | ||
``` | ||
> Push-to-talk button component comes with built-in [browser-client](https://github.com/speechly/speechly/tree/main/libraries/browser-client) so you don't need to include it separately. | ||
## Node Usage | ||
> This example illustrates using browser-ui Web Components with a JS framework. For actual React development, you'll probably want to use [react-client](../react-client) and [react-ui](../react-ui) libraries for a better developer experience. | ||
> This example illustrates using browser-ui Web Components with a JS framework. For React development, [react-client](../react-client) and [react-ui](../react-ui) libraries offer a better developer experience. | ||
@@ -70,3 +83,3 @@ ``` | ||
import "@speechly/browser-ui/core/big-transcript"; | ||
import "@speechly/browser-ui/core/error-panel"; | ||
import "@speechly/browser-ui/core/intro-popup"; | ||
@@ -77,3 +90,3 @@ ... | ||
<push-to-talk-button placement="bottom" appid="YOUR_APP_ID_FROM_SPEECHLY_DASHBOARD"></push-to-talk-button> | ||
<error-panel placement="bottom"></error-panel> | ||
<intro-popup></intro-popup> | ||
``` | ||
@@ -80,0 +93,0 @@ |
@@ -29,2 +29,3 @@ import type { IAppearance } from "./types"; | ||
Mic = "mic", | ||
MicActive = "micactive", | ||
Error = "error", | ||
@@ -46,9 +47,14 @@ Denied = "denied", | ||
export const enum TriggerFx { | ||
None = "none", | ||
Whirl = "whirl", | ||
} | ||
export const clientStateToAppearance: {[state: string]: IAppearance} = { | ||
[ClientState.Disconnected]: { icon: Icon.Mic, behaviour: Behaviour.Click, effect: Effect.None}, | ||
[ClientState.Disconnected]: { icon: Icon.Mic, behaviour: Behaviour.Click, effect: Effect.None, triggerFx: TriggerFx.Whirl}, | ||
[ClientState.Disconnecting]: { icon: Icon.Mic, behaviour: Behaviour.Noninteractive, effect: Effect.Connecting}, | ||
[ClientState.Connecting]: { icon: Icon.Mic, behaviour: Behaviour.Noninteractive, effect: Effect.Connecting}, | ||
[ClientState.Connected]: { icon: Icon.Mic, behaviour: Behaviour.Hold, effect: Effect.None}, | ||
[ClientState.Connected]: { icon: Icon.Mic, behaviour: Behaviour.Hold, effect: Effect.None, triggerFx: TriggerFx.Whirl}, | ||
[ClientState.Starting]: { icon: Icon.Mic, behaviour: Behaviour.Hold, effect: Effect.Connecting}, | ||
[ClientState.Recording]: { icon: Icon.Mic, behaviour: Behaviour.Hold, effect: Effect.None}, | ||
[ClientState.Recording]: { icon: Icon.MicActive, behaviour: Behaviour.Hold, effect: Effect.None}, | ||
[ClientState.Stopping]: { icon: Icon.Mic, behaviour: Behaviour.Noninteractive, effect: Effect.Busy}, | ||
@@ -55,0 +61,0 @@ [ClientState.Failed]: { icon: Icon.Error, behaviour: Behaviour.Click, effect: Effect.None}, |
@@ -1,2 +0,2 @@ | ||
import type { Behaviour, Effect, Icon } from "./constants" | ||
import type { Behaviour, Effect, Icon, TriggerFx } from "./constants" | ||
@@ -17,2 +17,3 @@ export type { Segment, Intent, Word, Entity } from "../node_modules/@speechly/browser-client/src/speechly/types"; | ||
effect: Effect, | ||
triggerFx?: TriggerFx, | ||
} | ||
@@ -19,0 +20,0 @@ |
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
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1475730
1774
137