text: !function(){"use strict";const e=()=>{},t=e=>"number"==typeof e&&Number.isFinite(e),n=e=>"string"==typeof e,a=Array.isArray,l=e=>"object"==typeof e&&!!e&&!a(e),o=e=>"function"==typeof e,s=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i=e=>{for(let t in e)if(s(e,t))return!1;return!0},r=e=>{let t=null;if("/"===e.charAt(0)&&("/"===e.charAt(1)?e="https://"+e:t=e),null===t)try{t=new URL(e).pathname}catch(n){t=e}return t},u=e=>"__duo-toolbox__-"+e,d=u("global_variables"),c=(e,t)=>(l(window[d])||(window[d]={}),s(window[d],e)?window[d][e]:t),p=(e,t)=>{l(window[d])||(window[d]={}),window[d][e]=t},v=(e,t,n)=>{const a=t(c(e,n));return p(e,a),a},g=u("original_function"),f=u("override_version"),_=(t,n,a,i=1)=>((e,t,n,a,l=1)=>{s(window,e)&&t(window[e])?n(window[e]):v("pending_global_listeners",(o={})=>{var s;if(!o[e]){o[e]={};let n=window[e];Object.defineProperty(window,e,{get:()=>n,set:a=>{t(a)?(Object.defineProperty(window,e,{value:a,configurable:!0,enumerable:!0,writable:!0}),Object.values(o[e]).forEach(e=>e.callback(a))):n=a},configurable:!0})}return l>(Number(null===(s=o[e][a])||void 0===s?void 0:s.version)||0)&&(o[e][a]={callback:n,version:l}),o})})(t,o,t=>((t,n,a,o=1)=>{var s;if(l(t)&&o>(Number(null===(s=t[n])||void 0===s?void 0:s[f])||0)){var i;const l=(null===(i=t[n])||void 0===i?void 0:i[g])||t[n]||e;t[n]=a(l),t[n][g]=l,t[n][f]=o}})(null==t?void 0:t.prototype,n,a,i),"instance_method:"+n,i),m=u("logging_iframe"),h=()=>(()=>{let e=document.getElementById(m);return e&&e.isConnected||(e=document.createElement("iframe"),e.id=m,e.style.display="none",document.body.appendChild(e)),e})().contentWindow.console,y=e=>{var t,n;return(null===(t=e.metadata)||void 0===t?void 0:t.source_language)||e.sourceLanguage||(null===(n=e.metadata)||void 0===n?void 0:n.learning_language)},w=e=>{var t;return(null===(t=e.metadata)||void 0===t?void 0:t.target_language)||e.targetLanguage||y(e)},b="tts_sentence",K="tts_word",O="normal",k="howler",V="rate",j="volume",x=u("forced_setting"),T=e=>l(e)&&!!e[x],q=e=>e.value,L=e=>({[x]:!0,value:e}),M=(e,n)=>V===e&&t(n)||j===e&&n>=0&&n<=1,E=(e,n)=>((e,t,n,a=1)=>{if(!l(e))return;const o=u(t+"_override_version");a>(Number(e[o])||0)&&Object.defineProperty(e,t,n(Object.getOwnPropertyDescriptor(e,t)))})(HTMLMediaElement,n,n=>({...n,set:function(a){const l=C[e];t(a)?(this[l.originalValueKey]=a,s(this,l.valueKey)&&(a=this[l.isRelativeKey]?P(e,a*this[l.valueKey]):this[l.valueKey])):T(a)&&(a=q(a)),t(a)&&(this[l.listenerValueKey]=a),n.set.call(this,a)}})),R=(e,t)=>_("Howl",t,n=>function(){const a=this,l=arguments,o=C[e];let i=!1;const r=a._queue.length;(1===l.length||2===l.length&&void 0===l[1])&&-1===a._getSoundIds().indexOf(l[0])&&(T(l[0])?(i=!0,l[0]=q(l[0])):M(e,l[0])&&(a[o.originalValueKey]=l[0],s(a,o.valueKey)&&(i=!0,a[o.isRelativeKey]?l[0]=P(e,l[0]*a[o.valueKey]):l[0]=a[o.valueKey])),i&&(a[o.listenerValueKey]=l[0]));const u=n.apply(a,arguments);return i&&r<a._queue.length&&(a._queue[a._queue.length-1].action=function(){l[0]=L(l[0]),a[t](...l)}),u}),$=(e,t,n,a)=>({...a,functions:{audio:{applyOverride:()=>E(e,n),getter:e=>e[t],setter:(e,n)=>e[t]=n,hasQueuedUpdate:()=>!1},[k]:{applyOverride:()=>R(e,n),getter:e=>e[n](),setter:(e,t)=>e[n](t),hasQueuedUpdate:e=>e._queue.find(e=>e.event===n)}},priorityKey:u(e+"_priority"),isRelativeKey:u(e+"_is_relative"),valueKey:u(`forced_${e}_value`),originalValueKey:u(`original_${e}_value`),listenerValueKey:u(e+"_value")}),C={[V]:$(V,"playbackRate","rate",{minValue:.5,maxValue:4,defaultValue:1}),[j]:$(j,"volume","volume",{minValue:0,maxValue:1,defaultValue:1})},P=(e,t)=>C[e]?Math.max(C[e].minValue,Math.min(t,C[e].maxValue)):t,H="event_listeners",N=()=>{return`__listener::${e="last_event_listener_id",v(`__counter::${e}__`,e=>e+1,0)}__`;var e},S=e=>{var t;return(null===(t=c(H,{}))||void 0===t?void 0:t[e])||{}},A=(e,t)=>{v(H,n=>Object.assign(n||{},{[e]:t}))},I=!i(e=>S(e)),U=(e,t)=>{const n=S(e);return i(n)?null:t(Object.values(n))},z=(e,t,n=N())=>{const a=S(e);return a[n]=t,A(e,a),()=>Q(e,n)},D=(e,t,n,l,o=z,s=N())=>{const i=`__${t}::${e}__`;var r;r=i,S(t)[r]||o(t,(...t)=>{const n=l(...t);a(n)&&X(e,...n)},i);const u=z(e,n,s);return()=>{u(),I(e)||Q(t,i)}},Q=(e,t)=>{const n=S(e);delete n[t],A(e,n)},X=(e,...t)=>U(e,e=>e.flatMap(e=>{try{return[e(...t)]}catch(e){return[]}})),B="practice_session_loaded",F="story_loaded",J="forum_discussion_loaded",W="dictionary_lexeme_loaded",G="sound_initialized",Y={[W]:/\/api\/1\/dictionary_page/g,[J]:/\/comments\/([\d]+)/g,[B]:/\/[\d]{4}-[\d]{2}-[\d]{2}\/sessions/g,[F]:/\/api2\/stories/g,user_data_loaded:/\/[\d]{4}-[\d]{2}-[\d]{2}\/users\/[\d]+/g},Z=(e,t,n=N())=>(_("XMLHttpRequest","open",e=>function(t,n,a,o,s){let i;for(const[e,t]of Object.entries(Y))if(n.match(t)){i=e;break}return i&&U(i,e=>{this.addEventListener("load",()=>{try{const t=l(this.response)?this.response:JSON.parse(this.responseText);e.forEach(e=>e(t))}catch(e){((...e)=>{h().error(...e)})(e,`Could not handle the XHR result (event: ${i}): `)}})}),e.call(this,t,n,a,o,s)}),z(e,t,n)),ee=(e,t)=>({url:e,type:b,speed:O,language:t}),te=(e,t)=>({url:e,type:K,speed:O,language:t}),ne=Object.fromEntries(["/sounds/7abe057dc8446ad325229edd6d8fd250.mp3","/sounds/2aae0ea735c8e9ed884107d6f0a09e35.mp3","/sounds/421d48c53ad6d52618dba715722278e0.mp3","/sounds/37d8f0b39dcfe63872192c89653a93f6.mp3","/sounds/0a27c1ee63dd220647e8410a0029aed2.mp3","/sounds/a28ff0a501ef5f33ca78c0afc45ee53e.mp3","/sounds/2e4669d8cf839272f0731f8afa488caf.mp3","/sounds/f0b6ab4396d5891241ef4ca73b4de13a.mp3"].map(e=>{return[e,(t=e,{url:t,type:"effect",speed:O,language:null})];var t})),ae=/\/duolingo-data\/tts\/(?<language>[a-z-_]+)\/token\//i,le="sound_type_map",oe=()=>c(le,ne),se=e=>{const t=oe()||{};for(const n of e)t[r(n.url)]=n;p(le,t)},ie="sound_detection_unregistration_callbacks",re=(e,t,n)=>{var a;return{url:e.url,type:t,speed:(null===(a=e.speed)||void 0===a?void 0:a.value)||O,language:n}},ue=()=>{var e,t,o,s;c(ie)||p(ie,[(s=e=>(e=>{const t=e.learningLanguage;a(e.elements)&&se(e.elements.map(e=>{var t;return(null==e||null===(t=e.line)||void 0===t?void 0:t.content)||(null==e?void 0:e.learningLanguageTitleContent)}).flatMap(e=>[null==e?void 0:e.audio,null==e?void 0:e.audioPrefix,null==e?void 0:e.audioSuffix]).map(e=>null==e?void 0:e.url).filter(n).map(e=>ee(e,t)))})(e),Z(F,s)),(o=e=>{var t;n((t=e).tts_url)&&se([ee(t.tts_url,t.sentence_language)])},Z(J,o)),(t=e=>(e=>{const t=[],l=e.learning_language;n(e.tts)&&t.push(te(e.tts,l)),a(e.alternative_forms)&&t.push(e.alternative_forms.map(e=>null==e?void 0:e.tts).filter(n).map(e=>ee(e,l))),se(t.flat())})(e),Z(W,t)),(e=e=>(e=>{const t=[];for(const r of e){var o;const e=y(r),u=w(r);if(n(r.tts)&&t.push(ee(r.tts,e)),n(r.slowTts)&&t.push({url:r.slowTts,type:b,speed:"slow",language:e}),n(r.solutionTts)&&t.push(ee(r.solutionTts,u)),a(r.choices)&&t.push(r.choices.map(e=>null==e?void 0:e.tts).filter(n).map(e=>te(e,u))),a(r.tokens)&&t.push(r.tokens.map(e=>null==e?void 0:e.tts).filter(n).map(t=>te(t,e))),a(r.questionTokens)&&t.push(r.questionTokens.map(e=>null==e?void 0:e.tts).filter(n).map(e=>te(e,u))),a(null===(o=r.metadata)||void 0===o?void 0:o.speakers))for(const e of r.metadata.speakers){var s,i;l(null===(s=e.tts)||void 0===s?void 0:s.tokens)&&t.push(Object.values(e.tts.tokens).filter(e=>n(e.url)).map(e=>re(e,K,u))),a(null===(i=e.tts)||void 0===i?void 0:i.sentence)&&t.push(e.tts.sentence.filter(e=>n(e.url)).map(e=>re(e,b,u)))}a(r.pairs)&&t.push(r.pairs.map(e=>null==e?void 0:e.tts).filter(n).map(e=>te(e,u)))}se(t.flat())})(e.challenges),D("practice_challenges_loaded",B,e,e=>{let t;var n;l(e)&&(t=[{challenges:[e.challenges,e.adaptiveChallenges,null===(n=e.adaptiveInterleavedChallenges)||void 0===n?void 0:n.challenges].filter(a).flat(),sessionMetaData:e.metadata||{}}]);return t},Z))])},de=(e,t,n)=>{const a=(e=>{const t=oe()[e];if(l(t))return t;const n=e.match(ae);return n?te(e,n.language):null})(r(t));return{url:t,type:(null==a?void 0:a.type)||"unknown",speed:(null==a?void 0:a.speed)||O,language:null==a?void 0:a.language,playbackStrategy:n,sound:e}};(e=>{_("Howl","init",e=>function(t){var n;p("is_howler_used",!0);const a=e.call(this,t),l=String(this._src||(null===(n=this._parent)||void 0===n?void 0:n._src)||"").trim();return""!==l&&X(G,de(this,l,k)),a}),ue();const t=z(G,e)})(e)}();
  