@pie-element/venn-classification 0.1.3 → 0.1.4-next.20261007075859

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,47 +2,47 @@ this.VennClassificationElement=(function(){typeof window<`u`&&((window.__svelte?
2
2
  `).some(e=>e.startsWith(`https://svelte.dev/e/`)))throw i;return i!==e&&console.warn(`Failed to hydrate: `,i),n.recover===!1&&Ne(),Gt(),Qt(r),ye(!1),jr(t,n)}finally{ye(i),j(a)}}var Nr=new Map;function Pr(t,{target:n,anchor:r,props:i={},events:a,context:o,intro:s=!0,transformError:l}){Gt();var u=void 0,d=mn(()=>{var s=r??n.appendChild(Kt());Or(s,{pending:()=>{}},n=>{Be({});var r=P;if(o&&(r.c=o),a&&(i.$$events=a),k&&yr(n,null),u=t(n,i)||He(),k&&(G.nodes.end=A,A===null||A.nodeType!==8||A.data!==`]`))throw _e(),e;Ve()},l);var d=new Set,f=e=>{for(var t=0;t<e.length;t++){var r=e[t];if(!d.has(r)){d.add(r);var i=Tr(r);for(let e of[n,document]){var a=Nr.get(e);a===void 0&&(a=new Map,Nr.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,hr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return f(c(sr)),cr.add(f),()=>{for(var e of d)for(let r of[n,document]){var t=Nr.get(r),i=t.get(e);--i==0?(r.removeEventListener(e,hr),t.delete(e),t.size===0&&Nr.delete(r)):t.set(e,i)}cr.delete(f),s!==r&&s.parentNode?.removeChild(s)}});return Fr.set(u,d),u}var Fr=new WeakMap;function Ir(e,t){let n=Fr.get(e);return n?(Fr.delete(e),n(t)):Promise.resolve()}var Lr=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)On(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(On(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(Cn(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();An(r,t),t.append(Kt()),this.#n.set(e,{effect:r,fragment:t})}else Cn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),En(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(Cn(n.effect),this.#n.delete(e))};ensure(e,t){var n=R,r=$t();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=Kt();i.append(a),this.#n.set(e,{effect:yn(()=>t(a)),fragment:i})}else this.#t.set(e,yn(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else k&&(this.anchor=A),this.#a(n)}};function Rr(e,t,...n){var r=new Lr(e);vn(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},te)}function zr(e){P===null&&Ee(`onMount`),un(()=>{let t=ar(e);if(typeof t==`function`)return t})}function Br(e){P===null&&Ee(`onDestroy`),zr(()=>()=>ar(e))}function Vr(e,t,n=!1){var r;k&&(r=A,M());var i=new Lr(e),a=n?te:0;function o(e,t){if(k){var n=Se(r);if(e!==parseInt(n.substring(1))){var a=xe();j(a),i.anchor=a,ye(!1),i.ensure(e,t),ye(!0);return}}i.ensure(e,t)}vn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function Hr(e,t){return t}function Ur(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];En(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;Wr(e,c(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else--o},!1)}if(o===0){var l=r.length===0&&n!==null&&e.pending.size===0;if(l){var u=n,d=u.parentNode;Qt(d),d.append(u),e.items.clear()}Wr(e,t,!l)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Wr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=ie,An(a,document.createDocumentFragment())):Cn(t[i],n)}}var Gr;function Kr(e,t,n,r,i,o=null){var s=e,l=new Map;if(t&4){var u=e;s=k?j(qt(u)):u.appendChild(Kt())}k&&M();var d=null,f=at(()=>{var e=n();return a(e)?e:e==null?[]:c(e)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,Jr(v,p,s,t,r),d!==null&&(p.length===0?d.f&33554432?(d.f^=ie,Xr(d,null,s)):On(d):En(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:vn(()=>{p=K(f);var e=p.length;let a=!1;k&&Se(s)===`[!`!=(e===0)&&(s=xe(),j(s),ye(!1),a=!0);for(var c=new Set,u=R,v=$t(),y=0;y<e;y+=1){k&&A.nodeType===8&&A.data===`]`&&(s=A,a=!0,ye(!1));var b=p[y],x=r(b,y),S=h?null:l.get(x);S?(S.v&&It(S.v,b),S.i&&It(S.i,y),v&&u.unskip_effect(S.e)):(S=Yr(l,h?s:Gr??=Kt(),b,x,y,i,t,n),h||(S.e.f|=ie),l.set(x,S)),c.add(x)}if(e===0&&o&&!d&&(h?d=yn(()=>o(s)):(d=yn(()=>o(Gr??=Kt())),d.f|=ie)),e>c.size&&Oe(``,``,``),k&&e>0&&j(xe()),!h)if(m.set(u,c),v){for(let[e,t]of l)c.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u);a&&ye(!0),K(f)}),flags:t,items:l,pending:m,outrogroups:null,fallback:d};h=!1,k&&(s=A)}function qr(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Jr(e,t,n,r,i){var a=(r&8)!=0,o=t.length,s=e.items,l=qr(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(a)for(v=0;v<o;v+=1)h=t[v],g=i(h,v),_=s.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<o;v+=1){if(h=t[v],g=i(h,v),_=s.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(On(_),a&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432)if(_.f^=ie,_===l)Xr(_,null,n);else{var y=d?d.next:l;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),Zr(e,d,_),Zr(e,_,y),Xr(_,y,n),d=_,p=[],m=[],l=qr(d.next);continue}if(_!==l){if(u!==void 0&&u.has(_)){if(p.length<m.length){var b=m[0],x;d=b.prev;var S=p[0],C=p[p.length-1];for(x=0;x<p.length;x+=1)Xr(p[x],b,n);for(x=0;x<m.length;x+=1)u.delete(m[x]);Zr(e,S.prev,C.next),Zr(e,d,S),Zr(e,C,b),l=b,d=C,--v,p=[],m=[]}else u.delete(_),Xr(_,l,n),Zr(e,_.prev,_.next),Zr(e,_,d===null?e.effect.first:d.next),Zr(e,d,_),d=_;continue}for(p=[],m=[];l!==null&&l!==_;)(u??=new Set).add(l),m.push(l),l=qr(l.next);if(l===null)continue}_.f&33554432||p.push(_),d=_,l=qr(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(Wr(e,c(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||u!==void 0){var w=[];if(u!==void 0)for(_ of u)_.f&8192||w.push(_);for(;l!==null;)!(l.f&8192)&&l!==e.fallback&&w.push(l),l=qr(l.next);var T=w.length;if(T>0){var E=r&4&&o===0?n:null;if(a){for(v=0;v<T;v+=1)w[v].nodes?.a?.measure();for(v=0;v<T;v+=1)w[v].nodes?.a?.fix()}Ur(e,w,E)}}a&&Ke(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function Yr(e,t,n,r,i,a,o,s){var c=o&1?o&16?jt(n):Nt(n,!1,!1):null,l=o&2?jt(i):null;return{v:c,i:l,e:yn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Xr(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=Jt(r);if(a.before(r),r===i)return;r=o}}function Zr(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Qr(t,n,a=!1,o=!1,s=!1,c=!1){var l=t,u=``;if(a){var d=t;k&&(l=j(qt(d)))}U(()=>{var t=G;if(u===(u=n()??``)){k&&M();return}if(a&&!k){t.nodes=null,d.innerHTML=u,u!==``&&yr(qt(d),d.lastChild);return}if(t.nodes!==null&&(wn(t.nodes.start,t.nodes.end),t.nodes=null),u!==``){if(k){for(var c=A.data,f=M(),p=f;f!==null&&(f.nodeType!==8||f.data!==``);)p=f,f=Jt(f);if(f===null)throw _e(),e;yr(A,p),l=j(f);return}var m=en(o?`svg`:s?`math`:`template`,o?r:s?i:void 0);m.innerHTML=u;var h=o||s?m:m.content;if(yr(qt(h),h.lastChild),o||s)for(;qt(h);)l.before(qt(h));else l.before(h)}})}function $r(e,t){hn(()=>{e=G?.parent?.nodes?.start??e;var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector(`#`+t.hash)){let e=en(`style`);e.id=t.hash,e.textContent=t.code,r.appendChild(e)}})}var ei=[...`
3
3
  \r\f\xA0\v`];function ti(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||ei.includes(r[o-1]))&&(s===r.length||ei.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function ni(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function ri(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function ii(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(ri)),i&&c.push(...Object.keys(i).map(ri));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=ri(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=ni(r)),i&&(n+=ni(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function ai(e,t,n,r,i,a){var o=e[O];if(k||o!==n||o===void 0){var s=ti(n,r,a);(!k||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[O]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function oi(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function si(e,t,n,r){var i=e[fe];if(k||i!==t){var a=ii(t,r);(!k||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[fe]=t}else r&&(Array.isArray(r)?(oi(e,n?.[0],r[0]),oi(e,n?.[1],r[1],`important`)):oi(e,n,r));return r}var ci=Symbol(`is custom element`),li=Symbol(`is html`),ui=he?`link`:`LINK`;function J(e,t,n,r){var i=di(e);k&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===ui)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[ue]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&pi(e).has(t)?e[t]=n:e.setAttribute(t,n))}function di(e){return e[de]??={[ci]:e.nodeName.includes(`-`),[li]:e.namespaceURI===n}}var fi=new Map;function pi(e){var t=e.getAttribute(`is`)||e.nodeName,n=fi.get(t);if(n)return n;fi.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=f(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.add(o);i=h(i)}return n}var mi=new class e{#e=new WeakMap;#t;#n;static entries=new WeakMap;constructor(e){this.#n=e}observe(e,t){var n=this.#e.get(e)||new Set;return n.add(t),this.#e.set(e,n),this.#r().observe(e,this.#n),()=>{var n=this.#e.get(e);n.delete(t),n.size===0&&(this.#e.delete(e),this.#t.unobserve(e))}}#r(){return this.#t??=new ResizeObserver(t=>{for(var n of t){e.entries.set(n.target,n);for(var r of this.#e.get(n.target)||[])r(n)}})}}({box:`border-box`});function hi(e,t,n){var r=mi.observe(e,()=>n(e[t]));hn(()=>(ar(()=>n(e[t])),r))}function gi(e,t){return e===t||e?.[se]===t}function _i(e=He(),t,n,r){var i=P.r,a=G;return hn(()=>{var o,s;return _n(()=>{o=s,s=r?.()||[],ar(()=>{gi(n(...s),e)||(t(e,...s),o&&gi(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&gi(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}var vi=!1;function yi(e){var t=vi;try{return vi=!1,[e(),vi]}finally{vi=t}}function Y(e,t,n,r){var i=!0,a=(n&8)!=0,o=(n&16)!=0,s=r,c=!0,l=void 0,u=()=>o&&i?(l??=nt(r),K(l)):(c&&(c=!1,s=o?ar(r):r),s);let f;if(a){var p=se in e||le in e;f=d(e,t)?.set??(p&&t in e?n=>e[t]=n:void 0)}var m,h=!1;a?[m,h]=yi(()=>e[t]):m=e[t],m===void 0&&r!==void 0&&(m=u(),f&&(i&&Pe(t),f(m)));var g=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return g;if(f){var _=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||_||h)&&f(t?g():e),e):g()})}var v=!1,y=(n&1?nt:at)(()=>(v=!1,g()));a&&K(y);var b=G;return(function(e,t){if(arguments.length>0){let n=t?K(y):i&&a?Bt(e):e;return V(y,n),v=!0,s!==void 0&&(s=n),e}return Nn&&v||b.f&16384?y.v:K(y)})}function bi(e){return new xi(e)}var xi=class{#e;#t;constructor(e){var t=new Map,n=(e,n)=>{var r=Nt(n,!1,!1);return t.set(e,r),r};let r=new Proxy({...e.props||{},$$events:{}},{get(e,r){return K(t.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===le?!0:(K(t.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,i){return V(t.get(r)??n(r,i),i),Reflect.set(e,r,i)}});this.#t=(e.hydrate?Mr:jr)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),(!e?.props?.$$host||e.sync===!1)&&z(),this.#e=r.$$events;for(let e of Object.keys(this.#t))e===`$set`||e===`$destroy`||e===`$on`||u(this,e,{get(){return this.#t[e]},set(t){this.#t[e]=t},enumerable:!0});this.#t.$set=e=>{Object.assign(r,e)},this.#t.$destroy=()=>{Ir(this.#t)}}$set(e){this.#t.$set(e)}$on(e,t){this.#e[e]=this.#e[e]||[];let n=(...e)=>t.call(this,...e);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(e=>e!==n)}}$destroy(){this.#t.$destroy()}},Si;typeof HTMLElement==`function`&&(Si=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){let e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn||this.$$c)return;function e(e){return t=>{let n=en(`slot`);e!=="default"&&(n.name=e),q(t,n)}}let t={},n=wi(this);for(let r of this.$$s)r in n&&(r==="default"&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(let e of this.attributes){let t=this.$$g_p(e.name);t in this.$$d||(this.$$d[t]=Ci(t,e.value,this.$$p_d,`toProp`))}for(let e in this.$$p_d)!(e in this.$$d)&&this[e]!==void 0&&(this.$$d[e]=this[e],delete this[e]);this.$$c=bi({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=pn(()=>{_n(()=>{this.$$r=!0;for(let e of l(this.$$c)){if(!this.$$p_d[e]?.reflect)continue;this.$$d[e]=this.$$c[e];let t=Ci(e,this.$$d[e],this.$$p_d,`toAttribute`);t==null?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1})});for(let e in this.$$l)for(let t of this.$$l[e]){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Ci(e,n,this.$$p_d,`toProp`),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return l(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Ci(e,t,n,r){let i=n[e]?.type;if(t=i===`Boolean`&&typeof t!=`boolean`?t!=null:t,!r||!n[e])return t;if(r===`toAttribute`)switch(i){case`Object`:case`Array`:return t==null?null:JSON.stringify(t);case`Boolean`:return t?``:null;case`Number`:return t??null;default:return t}else switch(i){case`Object`:case`Array`:return t&&JSON.parse(t);case`Boolean`:return t;case`Number`:return t==null?t:+t;default:return t}}function wi(e){let t={};return e.childNodes.forEach(e=>{t[e.slot||`default`]=!0}),t}function Ti(e,t,n,r,i,a){let o=class extends Si{constructor(){super(e,n,i),this.$$p_d=t}static get observedAttributes(){return l(t).map(e=>(t[e].attribute||e).toLowerCase())}};return l(t).forEach(e=>{u(o.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){n=Ci(e,n,t),this.$$d[e]=n;var r=this.$$c;r&&(d(r,e)?.get?r[e]=n:r.$set({[e]:n}))}})}),r.forEach(e=>{u(o.prototype,e,{get(){return this.$$c?.[e]}})}),a&&(o=a(o)),e.element=o,o}function Ei(e,t){this.v=e,this.k=t}function Di(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Oi(e){if(Array.isArray(e))return e}function ki(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Ai(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ji(e,t){return Oi(e)||ki(e,t)||Mi(e,t)||Ai()}function Mi(e,t){if(e){if(typeof e==`string`)return Di(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Di(e,t):void 0}}function Ni(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Ei;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}Ni.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},Ni.prototype.next=function(e){return this._invoke(`next`,e)},Ni.prototype.throw=function(e){return this._invoke(`throw`,e)},Ni.prototype.return=function(e){return this._invoke(`return`,e)};var Pi=Object.entries,Fi=Object.setPrototypeOf,Ii=Object.isFrozen,Li=Object.getPrototypeOf,Ri=Object.getOwnPropertyDescriptor,zi=Object.freeze,Bi=Object.seal,Vi=Object.create,Hi=typeof Reflect<`u`&&Reflect,Ui=Hi.apply,Wi=Hi.construct;zi||=function(e){return e},Bi||=function(e){return e},Ui||=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)},Wi||=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)};var Gi=X(Array.prototype.forEach);Array.prototype.indexOf;var Ki=X(Array.prototype.lastIndexOf),qi=X(Array.prototype.pop),Ji=X(Array.prototype.push);Array.prototype.slice;var Yi=X(Array.prototype.splice),Xi=Array.isArray,Zi=X(String.prototype.toLowerCase),Qi=X(String.prototype.toString),$i=X(String.prototype.match),ea=X(String.prototype.replace),ta=X(String.prototype.indexOf),na=X(String.prototype.trim),ra=X(Number.prototype.toString),ia=X(Boolean.prototype.toString),aa=typeof BigInt>`u`?null:X(BigInt.prototype.toString),oa=typeof Symbol>`u`?null:X(Symbol.prototype.toString),sa=X(Object.prototype.hasOwnProperty),ca=X(Object.prototype.toString),la=X(RegExp.prototype.test),ua=da(TypeError);function X(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Ui(e,t,r)}}function da(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Wi(e,n)}}function Z(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Zi;if(Fi&&Fi(e,null),!Xi(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Ii(t)||(t[r]=e),i=e)}e[i]=!0}return e}function fa(e){for(let t=0;t<e.length;t++)sa(e,t)||(e[t]=null);return e}function pa(e){let t=Vi(null);for(let r of Pi(e)){var n=ji(r,2);let i=n[0],a=n[1];sa(e,i)&&(Xi(a)?t[i]=fa(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=pa(a):t[i]=a)}return t}function ma(e){switch(typeof e){case`string`:return e;case`number`:return ra(e);case`boolean`:return ia(e);case`bigint`:return aa?aa(e):`0`;case`symbol`:return oa?oa(e):`Symbol()`;case`undefined`:return ca(e);case`function`:case`object`:{if(e===null)return ca(e);let t=e,n=ha(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:ca(e)}return ca(e)}default:return ca(e)}}function ha(e,t){for(;e!==null;){let n=Ri(e,t);if(n){if(n.get)return X(n.get);if(typeof n.value==`function`)return X(n.value)}e=Li(e)}function n(){return null}return n}function ga(e){try{return la(e,``),!0}catch{return!1}}var _a=zi(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),va=zi(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),ya=zi([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),ba=zi([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),xa=zi(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Sa=zi([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Ca=zi([`#text`]),wa=zi(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Ta=zi(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Ea=zi(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Da=zi([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Oa=Bi(/{{[\w\W]*|^[\w\W]*}}/g),ka=Bi(/<%[\w\W]*|^[\w\W]*%>/g),Aa=Bi(/\${[\w\W]*/g),ja=Bi(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ma=Bi(/^aria-[\-\w]+$/),Na=Bi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pa=Bi(/^(?:\w+script|data):/i),Fa=Bi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ia=Bi(/^html$/i),La=Bi(/^[a-z][.\w]*(-[.\w]+)+$/i),Ra=Bi(/<[/\w!]/g),za=Bi(/<[/\w]/g),Ba=Bi(/<\/no(script|embed|frames)/i),Va=Bi(/\/>/i),Ha={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ua=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],Wa=zi(Z({},Ua)),Ga=function(){let e={};return Gi(Ua,t=>{e[t]=Bi(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),zi(e)}(),Ka=function(){return typeof window>`u`?null:window},qa=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Ja=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ya=function(e,t,n,r){return sa(e,t)&&Xi(e[t])?Z(r.base?pa(r.base):{},e[t],r.transform):n},Xa=function(e,t,n){let r=sa(e,t)?e[t]:void 0;return r&&typeof r==`object`?pa(r):n()};function Za(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ka(),t=e=>Za(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==Ha.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=ha(d,`cloneNode`),p=ha(d,`remove`),m=ha(d,`removeAttributeNode`),h=ha(d,`nextSibling`),g=ha(d,`childNodes`),_=ha(d,`parentNode`),v=ha(d,`shadowRoot`),y=ha(d,`attributes`),b=o&&o.prototype?ha(o.prototype,`nodeType`):null,x=o&&o.prototype?ha(o.prototype,`nodeName`):null,S=o&&o.prototype?ha(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,E=``,ee,te=!1,ne=0,re=function(){if(ne>0)throw ua(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},ie=function(e){re(),ne++;try{return T.createHTML(e)}finally{ne--}},D=function(e){re(),ne++;try{return T.createScriptURL(e)}finally{ne--}},ae=function(){return te||=(ee=qa(u,i),!0),ee},oe=n,se=oe.implementation,ce=oe.createNodeIterator,le=oe.createDocumentFragment,ue=oe.getElementsByTagName,de=r.importNode,O=Ja();t.isSupported=typeof Pi==`function`&&typeof _==`function`&&se&&se.createHTMLDocument!==void 0;let fe=Oa,pe=ka,me=Aa,he=ja,ge=Ma,_e=Pa,ve=Fa,k=La,ye=Na,A=null,j=Z({},[..._a,...va,...ya,...xa,...Ca]),M=null,N=Z({},[...wa,...Ta,...Ea,...Da]),be=Object.seal(Vi(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),xe=null,Se=null,Ce=Object.seal(Vi(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),we=!0,Te=!0,Ee=!1,De=!0,Oe=!1,ke=!0,Ae=!1,je=!1,Me=null,Ne=null,Pe=!1,Fe=!1,Ie=!1,Le=!1,Re=!0,P=!1,ze=`user-content-`,Be=!0,Ve=!1,He={},Ue=null,We=Z({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ge=null,Ke=Z({},[`audio`,`video`,`img`,`source`,`image`,`track`]),qe=null,Je=Z({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),F=`http://www.w3.org/1998/Math/MathML`,Ye=`http://www.w3.org/2000/svg`,Xe=`http://www.w3.org/1999/xhtml`,Ze=Xe,Qe=!1,$e=null,et=Z({},[F,Ye,Xe],Qi),tt=zi([`mi`,`mo`,`mn`,`ms`,`mtext`]),nt=Z({},tt),rt=zi([`annotation-xml`]),it=Z({},rt),I=Z({},[`title`,`style`,`font`,`a`,`script`]),at=null,ot=[`application/xhtml+xml`,`text/html`],L=null,st=null,ct=n.createElement(`form`),lt=function(e){return e instanceof RegExp||e instanceof Function},ut=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(st&&st===e)return;(!e||typeof e!=`object`)&&(e={}),e=pa(e),at=ot.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,L=at===`application/xhtml+xml`?Qi:Zi,A=Ya(e,`ALLOWED_TAGS`,j,{transform:L}),M=Ya(e,`ALLOWED_ATTR`,N,{transform:L}),$e=Ya(e,`ALLOWED_NAMESPACES`,et,{transform:Qi}),qe=Ya(e,`ADD_URI_SAFE_ATTR`,Je,{transform:L,base:Je}),Ge=Ya(e,`ADD_DATA_URI_TAGS`,Ke,{transform:L,base:Ke}),Ue=Ya(e,`FORBID_CONTENTS`,We,{transform:L}),xe=Ya(e,`FORBID_TAGS`,pa({}),{transform:L}),Se=Ya(e,`FORBID_ATTR`,pa({}),{transform:L}),He=sa(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?pa(e.USE_PROFILES):e.USE_PROFILES:!1,we=e.ALLOW_ARIA_ATTR!==!1,Te=e.ALLOW_DATA_ATTR!==!1,Ee=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Oe=e.SAFE_FOR_TEMPLATES||!1,ke=e.SAFE_FOR_XML!==!1,Ae=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Ie=e.RETURN_DOM_FRAGMENT||!1,Le=e.RETURN_TRUSTED_TYPE||!1,Pe=e.FORCE_BODY||!1,Re=e.SANITIZE_DOM!==!1,P=e.SANITIZE_NAMED_PROPS||!1,Be=e.KEEP_CONTENT!==!1,Ve=e.IN_PLACE||!1,ye=ga(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Na,Ze=typeof e.NAMESPACE==`string`?e.NAMESPACE:Xe,nt=Xa(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>Z({},tt)),it=Xa(e,`HTML_INTEGRATION_POINTS`,()=>Z({},rt));let t=Xa(e,`CUSTOM_ELEMENT_HANDLING`,()=>Vi(null));if(be=Vi(null),sa(t,`tagNameCheck`)&&lt(t.tagNameCheck)&&(be.tagNameCheck=t.tagNameCheck),sa(t,`attributeNameCheck`)&&lt(t.attributeNameCheck)&&(be.attributeNameCheck=t.attributeNameCheck),sa(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(be.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Bi(be),Oe&&(Te=!1),Ie&&(Fe=!0),He&&(A=Z({},Ca),M=Vi(null),He.html===!0&&(Z(A,_a),Z(M,wa)),He.svg===!0&&(Z(A,va),Z(M,Ta),Z(M,Da)),He.svgFilters===!0&&(Z(A,ya),Z(M,Ta),Z(M,Da)),He.mathMl===!0&&(Z(A,xa),Z(M,Ea),Z(M,Da))),Ce.tagCheck=null,Ce.attributeCheck=null,sa(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Ce.tagCheck=e.ADD_TAGS:Xi(e.ADD_TAGS)&&(A===j&&(A=pa(A)),Z(A,e.ADD_TAGS,L))),sa(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Ce.attributeCheck=e.ADD_ATTR:Xi(e.ADD_ATTR)&&(M===N&&(M=pa(M)),Z(M,e.ADD_ATTR,L))),sa(e,`ADD_FORBID_CONTENTS`)&&Xi(e.ADD_FORBID_CONTENTS)&&(Ue===We&&(Ue=pa(Ue)),Z(Ue,e.ADD_FORBID_CONTENTS,L)),Be&&(A[`#text`]=!0),Ae&&Z(A,[`html`,`head`,`body`]),A.table&&(Z(A,[`tbody`]),delete xe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw ua(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw ua(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{E=ie(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,E=``):(T===void 0&&(T=ae()),T&&typeof E==`string`&&(E=ie(``)));zi&&zi(e),st=e},R=Z({},[...va,...ya,...ba]),dt=Z({},[...xa,...Sa]),ft=function(e,t,n){return t.namespaceURI===Xe?e===`svg`:t.namespaceURI===F?e===`svg`&&(n===`annotation-xml`||nt[n]):!!R[e]},pt=function(e,t,n){return t.namespaceURI===Xe?e===`math`:t.namespaceURI===Ye?e===`math`&&it[n]:!!dt[e]},mt=function(e,t,n){return t.namespaceURI===Ye&&!it[n]||t.namespaceURI===F&&!nt[n]?!1:!dt[e]&&(I[e]||!R[e])},ht=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:Ze,tagName:`template`});let n=Zi(e.tagName),r=Zi(t.tagName);return $e[e.namespaceURI]?e.namespaceURI===Ye?ft(n,t,r):e.namespaceURI===F?pt(n,t,r):e.namespaceURI===Xe?mt(n,t,r):!!(at===`application/xhtml+xml`&&$e[e.namespaceURI]):!1},gt=function(e){Ji(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw ua(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},_t=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},vt=function(e){z(e);let t=g(e);if(t){let e=[];Gi(t,t=>{Ji(e,t)}),Gi(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&_t(e,r,i)}},yt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}Ji(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`)if(Fe||Ie)try{gt(n)}catch{}else try{n.setAttribute(e,``)}catch{}},bt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||M[L(i)]||_t(e,r,i)}},z=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===Ha.element&&bt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},xt=function(e,t){return ke?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},St=function(e){if(!ke)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===Ha.processingInstruction||n===Ha.comment&&la(za,e.data)){try{p(e)}catch{}continue}if(n===Ha.element){let t=e,n=L(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&xt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Ct=function(e){let t=null,r=null;if(Pe)e=`<remove></remove>`+e;else{let t=$i(e,/^[\r\n\t ]+/);r=t&&t[0]}at===`application/xhtml+xml`&&Ze===Xe&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?ie(e):e;if(Ze===Xe)try{t=new l().parseFromString(i,at)}catch{}if(!t||!t.documentElement){t=se.createDocument(Ze,`template`,null);try{t.documentElement.innerHTML=Qe?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ze===Xe?ue.call(t,Ae?`html`:`body`)[0]:Ae?t.documentElement:a},wt=function(e){let t=S?S(e):e.ownerDocument;return ce.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Tt=function(e){return e=ea(e,fe,` `),e=ea(e,pe,` `),e=ea(e,me,` `),e},Et=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=ce.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Tt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&Gi(i,e=>{Ot(e.content)&&Et(e.content)})},Dt=function(e){let t=x?x(e):null;return typeof t!=`string`||L(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Ot=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===Ha.documentFragment}catch{return!1}},kt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function B(e,n,r){e.length!==0&&Gi(e,e=>{e.call(t,n,r,st)})}let At=function(e,t){return!!(ke&&e.hasChildNodes()&&!kt(e.firstElementChild)&&la(Ra,e.textContent)&&la(Ra,e.innerHTML)||ke&&e.namespaceURI===Xe&&Wa[t]&&(kt(e.firstElementChild)||typeof e.textContent==`string`&&la(Ga[t],e.textContent))||e.nodeType===Ha.processingInstruction||ke&&e.nodeType===Ha.comment&&la(za,e.data))},jt=function(e,t){if(e instanceof RegExp)return la(e,t);if(e instanceof Function){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return!!e(t,...r)}return!1},Mt=function(e,t,n){if(!xe[t]&&Lt(t)&&jt(be.tagNameCheck,t))return!1;if(Be&&!Ue[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return gt(e),!0},Nt=function(e,t,n,r){return e.length===0?t:t===n||t===r?pa(t):t},V=function(e,t){return e===t||_(e)!==null?!1:(Ve&&z(e),!0)},Pt=function(e,n){if(B(O.beforeSanitizeElements,e,null),V(e,n))return!0;if(Dt(e))return gt(e),!0;let r=L(w(e));if(A=Nt(O.uponSanitizeElement,A,j,Me),B(O.uponSanitizeElement,e,{tagName:r,allowedTags:A}),V(e,n))return!0;if(At(e,r))return gt(e),!0;if(xe[r]||!(Ce.tagCheck instanceof Function&&Ce.tagCheck(r))&&!A[r]){let t=Mt(e,r,n);return t===!1&&(B(O.afterSanitizeElements,e,null),V(e,n))?!0:t}if(C(e)===Ha.element&&!ht(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&la(Ba,e.innerHTML))return gt(e),!0;if(Oe&&e.nodeType===Ha.text){let n=Tt(e.textContent);e.textContent!==n&&(Ji(t.removed,{element:e.cloneNode()}),e.textContent=n)}return B(O.afterSanitizeElements,e,null),V(e,n)},Ft=function(e,t,r){if(Se[t]||xt(t,e)||Re&&(t===`id`||t===`name`)&&(r in n||r in ct))return!1;let i=M[t]||Ce.attributeCheck instanceof Function&&Ce.attributeCheck(t,e);return Te&&la(he,t)||we&&la(ge,t)?!0:i?qe[t]||la(ye,ea(r,ve,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ta(r,`data:`)===0&&Ge[e]||Ee&&!la(_e,ea(r,ve,``))?!0:!r:Lt(e)&&jt(be.tagNameCheck,e)&&jt(be.attributeNameCheck,t,e)||t===`is`&&be.allowCustomizedBuiltInElements&&jt(be.tagNameCheck,r)},It=Z({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Lt=function(e){return!It[Zi(e)]&&la(k,e)},Rt=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ie(r);case`TrustedScriptURL`:return D(r)}return r},zt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),Dt(e)?(gt(e),!1):!0}catch{return yt(t,e),!1}},Bt=function(e,n){if(B(O.beforeSanitizeAttributes,e,null),V(e,n))return;let r=e.attributes;if(!r||Dt(e))return;M=Nt(O.uponSanitizeAttribute,M,N,Ne);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0},a=r.length,o=L(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=L(s),d=l,f=s===`value`?d:na(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,B(O.uponSanitizeAttribute,e,i),f=i.attrValue,P&&(u===`id`||u===`name`)&&ta(f,ze)!==0&&(yt(s,e,n),f=ze+f,p=!0),ke&&la(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){yt(s,e,n);continue}if(u===`attributename`&&$i(f,`href`)){yt(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){yt(s,e,n);continue}if(!De&&la(Va,f)){yt(s,e,n);continue}if(Oe&&(f=Tt(f)),!Ft(o,u,f)){yt(s,e,n);continue}f=Rt(o,u,c,f),f!==d&&zt(e,s,c,f)&&p&&qi(t.removed)}}B(O.afterSanitizeAttributes,e,null),V(e,n)},Vt=function(e){let t=null,n=wt(e);for(B(O.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(B(O.uponSanitizeShadowNode,t,null),Pt(t,e),Bt(t,e),Ot(t.content)&&Vt(t.content),C(t)===Ha.element){let e=v(t);Ot(e)&&(Ht(e),Vt(e))}B(O.afterSanitizeShadowDOM,e,null)},Ht=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Vt(e.shadow);continue}let n=e.node,r=C(n)===Ha.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&L(e)===`template`){let e=n.content;Ot(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Ot(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Qe=!e,Qe&&(e=`<!-->`),typeof e!=`string`&&!kt(e)&&(e=ma(e),typeof e!=`string`))throw ua(`dirty is not a string, aborting`);if(!t.isSupported)return e;je?(A=Me,M=Ne):ut(n),(O.uponSanitizeElement.length>0||O.uponSanitizeAttribute.length>0)&&(A=pa(A)),O.uponSanitizeAttribute.length>0&&(M=pa(M)),t.removed=[];let c=Ve&&typeof e!=`string`&&kt(e);if(c){St(e);let t=w(e);if(typeof t==`string`){let n=L(t);if(!A[n]||xe[n])throw vt(e),ua(`root node is forbidden and cannot be sanitized in-place`)}if(Dt(e))throw vt(e),ua(`root node is clobbered and cannot be sanitized in-place`);try{Ht(e)}catch(t){throw vt(e),t}}else if(kt(e))i=Ct(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Ha.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Ht(i);else{if(!Fe&&!Oe&&!Ae&&e.indexOf(`<`)===-1)return T&&Le?ie(e):e;if(i=Ct(e),!i)return Fe?null:Le?E:``}i&&Pe&&gt(i.firstChild);let l=c?e:i;try{let e=wt(l);for(;o=e.nextNode();)Pt(o,l),Bt(o,l),Ot(o.content)&&Vt(o.content)}catch(n){throw c&&(vt(e),Gi(t.removed,e=>{e.element&&z(e.element)})),n}if(c){let n=!1;if(Gi(t.removed,t=>{t.element&&(t.element===e&&(n=!0),z(t.element))}),n)throw ua(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Oe&&Et(e),e}if(Fe){if(Oe&&Et(i),Ie)for(s=le.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(M.shadowroot||M.shadowrootmode)&&(s=de.call(r,s,!0)),s}let u=Ae?i.outerHTML:i.innerHTML;return Ae&&A[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&la(Ia,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
5
- `+u),Oe&&(u=Tt(u)),T&&Le?ie(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ut(e),je=!0,Me=A,Ne=M},t.clearConfig=function(){st=null,je=!1,Me=null,Ne=null,T=ee,E=``},t.isValidAttribute=function(e,t,n){st||ut({});let r=L(e),i=L(t);return Ft(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&sa(O,e)&&Ji(O[e],t)},t.removeHook=function(e,t){if(sa(O,e)){if(t!==void 0){let n=Ki(O[e],t);return n===-1?void 0:Yi(O[e],n,1)[0]}return qi(O[e])}},t.removeHooks=function(e){sa(O,e)&&(O[e]=[])},t.removeAllHooks=function(){O=Ja()},t}var Qa=Za(),$a=[`script`,`embed`,`base`,`form`,`meta`,`link`,`style`,`foreignobject`],eo=[`onerror`,`onload`,`onclick`,`onmouseover`,`onmouseout`,`onmouseenter`,`onmouseleave`,`onfocus`,`onblur`,`onkeydown`,`onkeyup`,`onkeypress`,`onsubmit`,`onchange`,`onbeforeunload`,`formaction`,`xlink:href`],to=new Set([`iframe`,`object`,`semantics`,`annotation`,`none`]),no=/^[a-z_][\w.-]*:[a-z][\w.-]*$/,ro={ADD_TAGS:e=>to.has(e)||no.test(e),ADD_ATTR:[`alignment`,`target`,`allow`,`allowfullscreen`,`frameborder`,`scrolling`,`data`],FORBID_TAGS:$a,FORBID_ATTR:eo,ALLOW_UNKNOWN_PROTOCOLS:!1,RETURN_TRUSTED_TYPE:!1},io=1e6,ao=new Map,oo=0;function so(e){if(e==null||e===``||!Qa.isSupported)return``;let t=typeof e==`string`?e:String(e),n=ao.get(t);if(n!==void 0)return n;let r=String(Qa.sanitize(t,ro)),i=t.length+r.length;if(i>io)return r;for(let[e,t]of ao){if(oo+i<=io)break;ao.delete(e),oo-=e.length+t.length}return ao.set(t,r),oo+=i,r}var co=`4.1.3`,lo=`https://github.com/pie-framework/pie-elements-ng/blob/develop/docs/MATH-RENDERING.md#assets`,uo=`@pie-lib/math-rendering@2`,fo=[`nemeth`,`euro`],po=`mathjax@${co}/sre`,mo=/^[^@]+@[^@]+$/;function ho(e){if(!e)return;let t;try{t=new URL(e)}catch{return}if(t.origin===`null`)return;let n=t.pathname.split(`/`);for(let e=n.length-1;e>0;e--){let r=n[e];if(r===`node_modules`)return;if(!mo.test(r))continue;let i=n[e-1]?.startsWith(`@`)?e-1:e;return t.origin+n.slice(0,i).join(`/`)}}function go(){let e=globalThis[uo]?.opts;return e&&typeof e==`object`?e:{}}function _o(e){if(typeof e!=`string`||!e)return;let t=typeof document>`u`?void 0:document.baseURI;try{return new URL(e,t).href.replace(/\/+$/,``)}catch{return}}function vo(e){if(!e||typeof e!=`object`)return;let t=new Map;for(let[n,r]of Object.entries(e)){let e=_o(r);e&&t.set(n,e)}return t.size?t:void 0}function yo(e){if(Array.isArray(e))return new Map(e.filter(e=>typeof e==`string`).map(e=>[e,void 0]));if(e&&typeof e==`object`)return new Map(Object.entries(e).map(([e,t])=>[e,typeof t==`string`?t:void 0]))}function bo(e,t){let n=go(),r=_o(e.assetRoot??n.assetRoot)??ho(t);return{root:r,speechPath:_o(e.speechPath??n.speechPath)??(r?`${r}/${po}`:void 0),speechLocales:yo(e.speechLocales??n.speechLocales),urls:vo(e.assetUrls??n.assetUrls)}}function xo(e,t){if(!(!e||!t)){for(let n of[...e.keys()])!t.has(n)&&!fo.includes(n)&&e.delete(n);for(let[n,r]of t)(r||!e.has(n))&&e.set(n,r??n)}}function So(e){if(!(!e||e.has(`en`)))return[...e.keys()].find(e=>!fo.includes(e))}var Co={untypeset:`no MathJax loads, so math stays untypeset`,"no-web-fonts":`math renders without web fonts`,"no-web-fonts-or-speech":`math renders without web fonts and speech`},wo=Symbol.for(`@pie-element/shared-math-rendering-mathjax/no-assets`);function To(e){let t=globalThis;t[wo]??=[];let n=t[wo];if(n.includes(e))return;n.push(e);let r=`[math-rendering] No asset root for MathJax: ${Co[e]}. Set window['${uo}'].opts.assetRoot to an npm root. See ${lo}`;e===`untypeset`?console.error(r):console.warn(r),!(typeof window>`u`)&&window.dispatchEvent(new CustomEvent(`pie-mathjax-no-asset-root`,{detail:{effect:e,message:r,docsUrl:lo}}))}var Eo=`https://github.com/pie-framework/pie-players/blob/develop/docs/item-player/loading-strategies.md#one-mathjax-version-per-page`,Do=`pie-mathjax-version-conflict`,Oo=Symbol.for(`@pie-element/shared-math-rendering-mathjax/unsupported-page`);function ko(e,t){if(typeof window>`u`)return;let n=globalThis;n[Oo]??={logged:!1,conditions:[]};let r=n[Oo];if(r.conditions.includes(e))return;r.conditions.push(e);let i=`[math-rendering] Unsupported page (${e}): ${t}. PIE supports one MathJax major version per page; with MathJax 3 and 4 on one page, math rendering is best effort and may break. See ${Eo}`;r.logged||(r.logged=!0,console.error(i)),window.dispatchEvent(new CustomEvent(Do,{detail:{condition:e,message:i,docsUrl:Eo}}))}function Ao(){let e=window.MathJax?.version;return typeof e==`string`&&e.startsWith(`3.`)?e:void 0}function jo(){return window.MathJax}function Mo(e,{root:t,speechPath:n}){t&&(e.loader={...e.loader,paths:{fonts:`${t}/@mathjax`,"mathjax-newcm":`${t}/@mathjax/mathjax-newcm-font@${co}`,"mathjax-mhchem-extension":`${t}/@mathjax/mathjax-mhchem-font-extension@${co}`}}),n&&(e.options={...e.options,worker:{path:n,maps:`${n}/mathmaps`}})}function No(e,t){let n=t.srcUrl||(t.root?`${t.root}/mathjax@4.1.3/tex-mml-chtml.js`:void 0);return n?(Mo(e,t),new Promise((t,r)=>{window.MathJax=e;let i=document.createElement(`script`);i.src=n,i.async=!0,i.onload=()=>t(!0),i.onerror=()=>r(Error(`Failed to load MathJax`)),document.head.appendChild(i)})):(To(`untypeset`),Promise.resolve(!1))}var Po=globalThis,Fo=`PIE-MJX-CHTML-styles`,Io=[`MJX-CHTML-styles`,`MJX-SVG-styles`],Lo=Ao,Ro=`http://www.w3.org/1998/Math/MathML`,zo=/^([a-z_][\w.-]*):math$/,Bo=/^[a-z][a-z0-9-]*$/;function Vo(e){for(let t of e.querySelectorAll(`*`)){let n=zo.exec(t.tagName.toLowerCase())?.[1];!n||!e.contains(t)||t.closest(`mjx-container`)||t.replaceWith(Ho(t,`${n}:`))}}function Ho(e,t){let n=e.tagName.toLowerCase().slice(t.length);if(!Bo.test(n))return e;let r=e.ownerDocument.createElementNS(Ro,n);for(let t of e.attributes)r.setAttribute(t.name,t.value);for(let n of[...e.childNodes]){let e=n instanceof Element&&n.tagName.toLowerCase().startsWith(t);r.appendChild(e?Ho(n,t):n)}return r}var Uo=new Set([`updiagonalstrike`,`downdiagonalstrike`,`verticalstrike`,`horizontalstrike`]),Wo={thin:`0.035em`,medium:`0.07em`,thick:`0.14em`},Go={tight:`0em`,medium:`0.1em`,loose:`0.2em`},Ko=/^(\d+(\.\d*)?|\.\d+)(em|ex|px|pt|pc|in|cm|mm)$/,qo=/^(#[0-9a-f]{3,8}|[a-z]+)$/i,Jo=/^(\d+(\.\d*)?|\.\d+)$/,Yo=new Set([`mn`,`mo`,`mi`,`mtext`]),Xo=new Set([`stackalign`,`charalign`,`charspacing`,`longdivstyle`]);function Zo(e,t,n=[],r={}){let i=e.createElementNS(Ro,t);for(let[e,t]of Object.entries(r))i.setAttribute(e,t);for(let e of n)e&&i.appendChild(e);return i}function Qo(e,t){let n=Zo(e.document,`mo`);return n.textContent=t,n}function $o(e){let t=Zo(e.document,`mn`);return t.textContent=`0`,Zo(e.document,`mphantom`,[t])}function es(e,t){return e.getAttribute(t)?.trim().toLowerCase()||void 0}function ts(e,t){let n=Number.parseInt(e.getAttribute(t)??``,10);return Number.isFinite(n)?n:0}function ns(e){return e.localName===`none`||e.localName===`mrow`&&e.children.length===0&&!e.textContent?.trim()}function rs(e,t,n=e){switch(t){case`left`:return 0;case`center`:return Math.floor(e/2);case`right`:return e;default:return n}}function is(e,t,n){let r=[],i,a,o=(e,t)=>{let s=e=>t.reduceRight((e,t)=>{let n=t.cloneNode(!1);return n.appendChild(e),n},e);if(e.localName===`mstyle`)for(let n of[...e.children])o(n,[...t,e]);else if(ns(e))r.push(null);else if(e.localName===`mn`&&e.children.length===0){let t=[...(e.textContent??``).trim()];for(let a of t){a===n.decimalPoint&&(i??=r.length);let t=e.cloneNode(!1);t.textContent=a,r.push(s(t))}t.length&&(a??=r.length)}else Yo.has(e.localName)&&e.textContent?.trim()===n.decimalPoint&&(i??=r.length),r.push(s(e))};for(let t of e)o(t,[]);return{kind:`digits`,cells:r,anchor:rs(r.length,n.stackAlign,i??a),position:t}}function as(e){return(e??``).toLowerCase().split(/\s+/).filter(e=>Uo.has(e))}function os(e,t){let n=[...e.children].filter(e=>!ns(e));return n.length<=1?n[0]??null:Zo(t.document,`mrow`,n)}function ss(e,t,n){let r=es(e,`location`)??`n`,i=as(e.getAttribute(`crossout`)),a=[...e.children].map(e=>ns(e)?null:e.localName===`mscarry`?{content:os(e,n),location:es(e,`location`)??r,crossout:e.hasAttribute(`crossout`)?as(e.getAttribute(`crossout`)):i}:{content:e,location:r,crossout:i}),o=e.getAttribute(`scriptsizemultiplier`)?.trim()??``;return{kind:`carries`,carries:a,anchor:rs(a.length,n.stackAlign),position:t,scale:Jo.test(o)?o:`0.6`}}function cs(e){let t=es(e,`mslinethickness`)??`medium`,n=Wo[t]??(Ko.test(t)?t:`0.07em`),r=e.getAttribute(`mathcolor`)?.trim()??``;return`${n} solid ${qo.test(r)?r:`currentColor`}`}function ls(e,t,n){let r=Math.max(0,ts(e,`length`));return{kind:`line`,length:r,anchor:rs(r,n.stackAlign),position:t,border:cs(e)}}function us(e,t,n,r,i){e.forEach((e,a)=>{let o=t+a*n+ts(e,`position`);switch(e.localName){case`msgroup`:us([...e.children],o,ts(e,`shift`),r,i);break;case`msline`:i.push(ls(e,o,r));break;case`mscarries`:i.push(ss(e,o,r));break;case`msrow`:case`mrow`:i.push(is([...e.children],o,r));break;default:i.push(is([e],o,r))}})}function ds(e){return-e.anchor-e.position}function fs(e){return e.kind===`digits`?e.cells.length:e.kind===`carries`?e.carries.length:e.length}function ps(e){return ds(e)+fs(e)-1}function ms(e,t,n,r){let i=e=>Zo(r.document,`mpadded`,[t],{width:`0`,...e?{lspace:e}:{}}),a=(e,t)=>Zo(r.document,e,t);switch(n){case`s`:return a(`munder`,[e,i(`-0.5width`)]);case`ne`:return a(`msup`,[e,i()]);case`se`:return a(`msub`,[e,i()]);case`nw`:return a(`mmultiscripts`,[e,a(`mprescripts`,[]),a(`none`,[]),i(`-1width`)]);case`sw`:return a(`mmultiscripts`,[e,a(`mprescripts`,[]),i(`-1width`),a(`none`,[])]);case`w`:return t.setAttribute(`scriptlevel`,`+1`),a(`mrow`,[i(`-1width`),e]);case`e`:return t.setAttribute(`scriptlevel`,`+1`),a(`mrow`,[e,i()]);default:return a(`mover`,[e,i(`-0.5width`)])}}function hs(e,t,n){let r=Zo(n.document,`menclose`,[e],{notation:t.join(` `),"data-padding":`0.1em`,"data-thickness":`0.067em`}),i=t.some(e=>e.endsWith(`diagonalstrike`))?.167:t.includes(`horizontalstrike`)?.1:0;return i?Zo(n.document,`mpadded`,[r],{lspace:`-${i}em`,width:`-${2*i}em`}):r}function gs(e,t,n,r,i){let a=e&&t.crossout.length?hs(e,t.crossout,i):e;if(!t.content)return a;let o=Zo(i.document,`mstyle`,[t.content],{scriptsizemultiplier:r});return ms(a??$o(i),o,n,i)}function _s(e,t){return e.carries[t-ds(e)]??null}function vs(e,t,n,r){let i=e.content;n.forEach((e,a)=>{let o=n.length-1-a,s=n[o],c=_s(s,t),l=n.slice(0,o).some(e=>_s(e,t));if(!c&&!l)return;let u=c??{content:$o(r),location:`n`,crossout:[]},d=a===0?u.location:`n`;i=gs(i,u,d,s.scale,r)}),e.content=i}function ys(e,t){let n=e.filter(e=>fs(e)>0),r=Math.min(0,...n.map(ds)),i=Math.max(r,...n.map(ps))-r+1,a=-r,o=[],s=new Map,c=()=>Array.from({length:i},()=>({content:null,borders:{}})),l=e=>e.length===0?Array.from({length:i},(e,t)=>t):Array.from({length:e.length},(t,n)=>a+ds(e)+n),u=[],d=[],f=e=>{let n=c();e.cells.forEach((t,r)=>{n[a+ds(e)+r].content=t}),u.length&&n.forEach((e,n)=>{vs(e,n-a,u,t)});for(let e of d)for(let t of l(e))n[t].borders.top=e.border;u=[],d=[],s.set(e,o.length),o.push(n)};for(let t of e)t.kind===`digits`?f(t):t.kind===`carries`?u.push(t):d.push(t);(u.length||!o.length)&&f({kind:`digits`,cells:[],anchor:0,position:0});let p=o[o.length-1];for(let e of d)for(let t of l(e))p[t].borders.bottom=e.border;return{rows:o,rowOf:s,origin:a}}function bs(e,{rows:t},n){let r=Zo(n.document,`mtable`,t.map(e=>Zo(n.document,`mtr`,e.map(e=>{let t=Object.entries(e.borders).map(([e,t])=>`border-${e}:${t}`).join(`;`);return Zo(n.document,`mtd`,[e.content],{...t?{style:t}:{},...e.align?{columnalign:e.align}:{}})}))));for(let{name:t,value:n}of[...e.attributes])Xo.has(t)||r.setAttribute(t,n);let i=es(e,`charspacing`)??`medium`,a=es(e,`charalign`);return r.setAttribute(`columnspacing`,Go[i]??(Ko.test(i)?i:Go.medium)),r.setAttribute(`columnalign`,a===`left`||a===`center`?a:`right`),r.setAttribute(`rowspacing`,`0`),r.setAttribute(`align`,e.getAttribute(`align`)??`baseline`),r}function xs(e){return{document:e.ownerDocument,stackAlign:es(e,`stackalign`)??`decimalpoint`,decimalPoint:e.closest(`[decimalpoint]`)?.getAttribute(`decimalpoint`)?.trim().charAt(0)||`.`}}function Ss(e){let t=xs(e),n=[];return us([...e.children],0,0,t,n),bs(e,ys(n,t),t)}function Cs(e,t,n,r,i,a){for(let o=n;o<=r;o++)e[t][o].borders[i]=a}function ws(e,t){let n=Qo(t,`)`);return n.setAttribute(`minsize`,`1.2em`),[Zo(t.document,`mrow`,[e,Zo(t.document,`mspace`,[],{width:`0.2em`})]),Zo(t.document,`mpadded`,[n],{voffset:`0.1em`,lspace:`-0.15em`,depth:`-0.2em`,height:`-0.2em`})]}function Ts(e){let t=xs(e),[n,r,...i]=[...e.children],a=n&&!ns(n)?n:null,o=r&&!ns(r)?r:null,s=es(e,`longdivstyle`)??`lefttop`,c=cs(e),l=[];us(i,0,0,t,l);let u=l.find(e=>e.kind===`digits`);u||(u={kind:`digits`,cells:[],anchor:0,position:0},l.unshift(u));let d=[],f=(...e)=>{u.cells.unshift(...e),u.anchor+=e.length},p=(...e)=>{let n=e.flatMap(e=>e?e.localName===`mrow`?[...e.children]:[e]:[]);u.cells.push(...is(n,0,t).cells)};switch(s){case`left/\\right`:f(a,Qo(t,`/`)),p(Qo(t,`\\`),o);break;case`left)(right`:f(a,Qo(t,`)`)),p(Qo(t,`(`),o);break;case`:right=right`:p(Qo(t,`:`),a,Qo(t,`=`),o);break;case`righttop`:case`stackedleftlinetop`:case`lefttop`:o&&us([o],0,0,t,d),l.splice(l.indexOf(u),0,...d),s===`righttop`?p(a):s===`stackedleftlinetop`?f(a):f(...ws(a,t));break}let m=ys(l,t),h=m.rows,g=m.rowOf.get(u)??0,_=e=>m.origin+ds(u)+e,v=Math.max(_(u.cells.length-1),...d.map(e=>m.origin+ps(e)));switch(s){case`left/\\right`:case`left)(right`:case`:right=right`:break;case`righttop`:{let e=h[g][_(u.cells.length-1)];e.borders.left=c,e.borders.bottom=c,Cs(h,g,_(0),_(u.cells.length-1),`top`,c);break}case`stackedleftlinetop`:{let e=h[g][_(0)];e.borders.right=c,e.borders.bottom=c,Cs(h,g,_(1),v,`top`,c);break}case`stackedrightright`:case`mediumstackedrightright`:case`shortstackedrightright`:case`stackedleftleft`:Es(h,g,s,a,o,c,t);break;default:Cs(h,g,_(1),v,`top`,c)}return bs(e,m,t)}function Es(e,t,n,r,i,a,o){let s=n===`stackedleftleft`,c=s?`right`:`left`,l=e=>e&&Zo(o.document,`mpadded`,[e],{lspace:`0.2em`,width:`+0.4em`});e.length<t+2&&e.push(e[0].map(()=>({content:null,borders:{}}))),e.forEach((e,o)=>{let u={content:null,borders:{},align:s?`right`:`left`};o===t?(u.content=l(r),u.borders={[c]:a,bottom:a}):o===t+1?(u.content=l(i),n!==`shortstackedrightright`&&(u.borders[c]=a)):o>t+1&&(n===`stackedrightright`||s)&&(u.borders[c]=a),s?e.unshift(u):e.push(u)})}function Ds(e){for(let t of[...e.querySelectorAll(`mstack, mlongdiv`)])!t.closest(`math`)||t.closest(`mjx-container`)||t.replaceWith(t.localName===`mstack`?Ss(t):Ts(t))}var Os=`PIE-MJX-explorer-styles`,ks=`var(--pie-text, black)`,As=`var(--pie-background, #ffffff)`,js=`var(--pie-border-dark, #66686A)`,Ms=`var(--pie-focus-outline, var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565C0)))`,Ns=`color-mix(in srgb, ${Ms} 15%, transparent)`,Ps=`
5
+ `+u),Oe&&(u=Tt(u)),T&&Le?ie(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ut(e),je=!0,Me=A,Ne=M},t.clearConfig=function(){st=null,je=!1,Me=null,Ne=null,T=ee,E=``},t.isValidAttribute=function(e,t,n){st||ut({});let r=L(e),i=L(t);return Ft(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&sa(O,e)&&Ji(O[e],t)},t.removeHook=function(e,t){if(sa(O,e)){if(t!==void 0){let n=Ki(O[e],t);return n===-1?void 0:Yi(O[e],n,1)[0]}return qi(O[e])}},t.removeHooks=function(e){sa(O,e)&&(O[e]=[])},t.removeAllHooks=function(){O=Ja()},t}var Qa=Za(),$a=[`script`,`embed`,`base`,`form`,`meta`,`link`,`style`,`foreignobject`],eo=[`onerror`,`onload`,`onclick`,`onmouseover`,`onmouseout`,`onmouseenter`,`onmouseleave`,`onfocus`,`onblur`,`onkeydown`,`onkeyup`,`onkeypress`,`onsubmit`,`onchange`,`onbeforeunload`,`formaction`,`xlink:href`],to=new Set([`iframe`,`object`,`mstack`,`mlongdiv`,`msgroup`,`msrow`,`msline`,`mscarries`,`mscarry`,`semantics`,`annotation`,`none`]),no=/^[a-z_][\w.-]*:[a-z][\w.-]*$/,ro=[`alignment`,`target`,`allow`,`allowfullscreen`,`frameborder`,`scrolling`,`data`,`stackalign`,`charalign`,`charspacing`,`longdivstyle`,`position`,`shift`,`location`,`crossout`,`leftoverhang`,`rightoverhang`,`mslinethickness`,`linebreak`],io=/^\s*document\.getElementById\((['"])([^'"]+)\1\)\.play\(\)\s*;?\s*(?:return\s+false\s*;?\s*)?$/,ao=`data-pie-play-audio`,oo={ADD_TAGS:e=>to.has(e)||no.test(e),ADD_ATTR:ro,FORBID_TAGS:$a,FORBID_ATTR:eo,ALLOW_UNKNOWN_PROTOCOLS:!1,RETURN_TRUSTED_TYPE:!1},so=!1;function co(e){for(let t of e.composedPath()){if(!(t instanceof Element))continue;let n=t.getAttribute(ao);if(n===null)continue;e.preventDefault();let r=t.getRootNode().getElementById?.(n)??document.getElementById(n);r instanceof HTMLMediaElement&&r.play()?.catch(()=>void 0);return}}var lo=null;function uo(){return lo||(lo=Qa(window),lo.addHook(`beforeSanitizeAttributes`,e=>{if(e.nodeName!==`A`)return;let t=io.exec(e.getAttribute(`onclick`)??``)?.[2];t!==void 0&&(e.removeAttribute(`onclick`),e.setAttribute(`data-pie-play-audio`,t),so||=(document.addEventListener(`click`,co),!0))}),lo)}var fo=1e6,po=new Map,mo=0;function ho(e){if(e==null||e===``||!Qa.isSupported)return``;let t=typeof e==`string`?e:String(e),n=po.get(t);if(n!==void 0)return n;let r=String(uo().sanitize(t,oo)),i=t.length+r.length;if(i>fo)return r;for(let[e,t]of po){if(mo+i<=fo)break;po.delete(e),mo-=e.length+t.length}return po.set(t,r),mo+=i,r}var go=`4.1.3`,_o=`https://github.com/pie-framework/pie-elements-ng/blob/develop/docs/MATH-RENDERING.md#assets`,vo=`@pie-lib/math-rendering@2`,yo=[`nemeth`,`euro`],bo=`mathjax@${go}/sre`,xo=/^[^@]+@[^@]+$/;function So(e){if(!e)return;let t;try{t=new URL(e)}catch{return}if(t.origin===`null`)return;let n=t.pathname.split(`/`);for(let e=n.length-1;e>0;e--){let r=n[e];if(r===`node_modules`)return;if(!xo.test(r))continue;let i=n[e-1]?.startsWith(`@`)?e-1:e;return t.origin+n.slice(0,i).join(`/`)}}function Co(){let e=globalThis[vo]?.opts;return e&&typeof e==`object`?e:{}}function wo(e){if(typeof e!=`string`||!e)return;let t=typeof document>`u`?void 0:document.baseURI;try{return new URL(e,t).href.replace(/\/+$/,``)}catch{return}}function To(e){if(!e||typeof e!=`object`)return;let t=new Map;for(let[n,r]of Object.entries(e)){let e=wo(r);e&&t.set(n,e)}return t.size?t:void 0}function Eo(e){if(Array.isArray(e))return new Map(e.filter(e=>typeof e==`string`).map(e=>[e,void 0]));if(e&&typeof e==`object`)return new Map(Object.entries(e).map(([e,t])=>[e,typeof t==`string`?t:void 0]))}function Do(e,t){let n=Co(),r=wo(e.assetRoot??n.assetRoot)??So(t);return{root:r,speechPath:wo(e.speechPath??n.speechPath)??(r?`${r}/${bo}`:void 0),speechLocales:Eo(e.speechLocales??n.speechLocales),urls:To(e.assetUrls??n.assetUrls)}}function Oo(e,t){if(!(!e||!t)){for(let n of[...e.keys()])!t.has(n)&&!yo.includes(n)&&e.delete(n);for(let[n,r]of t)(r||!e.has(n))&&e.set(n,r??n)}}function ko(e){if(!(!e||e.has(`en`)))return[...e.keys()].find(e=>!yo.includes(e))}var Ao={untypeset:`no MathJax loads, so math stays untypeset`,"no-web-fonts":`math renders without web fonts`,"no-web-fonts-or-speech":`math renders without web fonts and speech`},jo=Symbol.for(`@pie-element/shared-math-rendering-mathjax/no-assets`);function Mo(e){let t=globalThis;t[jo]??=[];let n=t[jo];if(n.includes(e))return;n.push(e);let r=`[math-rendering] No asset root for MathJax: ${Ao[e]}. Set window['${vo}'].opts.assetRoot to an npm root. See ${_o}`;e===`untypeset`?console.error(r):console.warn(r),!(typeof window>`u`)&&window.dispatchEvent(new CustomEvent(`pie-mathjax-no-asset-root`,{detail:{effect:e,message:r,docsUrl:_o}}))}var No=`https://github.com/pie-framework/pie-players/blob/develop/docs/item-player/loading-strategies.md#one-mathjax-version-per-page`,Po=`pie-mathjax-version-conflict`,Fo=Symbol.for(`@pie-element/shared-math-rendering-mathjax/unsupported-page`);function Io(e,t){if(typeof window>`u`)return;let n=globalThis;n[Fo]??={logged:!1,conditions:[]};let r=n[Fo];if(r.conditions.includes(e))return;r.conditions.push(e);let i=`[math-rendering] Unsupported page (${e}): ${t}. PIE supports one MathJax major version per page; with MathJax 3 and 4 on one page, math rendering is best effort and may break. See ${No}`;r.logged||(r.logged=!0,console.error(i)),window.dispatchEvent(new CustomEvent(Po,{detail:{condition:e,message:i,docsUrl:No}}))}function Lo(){let e=window.MathJax?.version;return typeof e==`string`&&e.startsWith(`3.`)?e:void 0}function Ro(){return window.MathJax}function zo(e,{root:t,speechPath:n}){t&&(e.loader={...e.loader,paths:{fonts:`${t}/@mathjax`,"mathjax-newcm":`${t}/@mathjax/mathjax-newcm-font@${go}`,"mathjax-mhchem-extension":`${t}/@mathjax/mathjax-mhchem-font-extension@${go}`}}),n&&(e.options={...e.options,worker:{path:n,maps:`${n}/mathmaps`}})}function Bo(e,t){let n=t.srcUrl||(t.root?`${t.root}/mathjax@4.1.3/tex-mml-chtml.js`:void 0);return n?(zo(e,t),new Promise((t,r)=>{window.MathJax=e;let i=document.createElement(`script`);i.src=n,i.async=!0,i.onload=()=>t(!0),i.onerror=()=>r(Error(`Failed to load MathJax`)),document.head.appendChild(i)})):(Mo(`untypeset`),Promise.resolve(!1))}var Vo=globalThis,Ho=`PIE-MJX-CHTML-styles`,Uo=[`MJX-CHTML-styles`,`MJX-SVG-styles`],Wo=Lo,Go=`http://www.w3.org/1998/Math/MathML`,Ko=/^([a-z_][\w.-]*):math$/,qo=/^[a-z][a-z0-9-]*$/;function Jo(e){for(let t of e.querySelectorAll(`*`)){let n=Ko.exec(t.tagName.toLowerCase())?.[1];!n||!e.contains(t)||t.closest(`mjx-container`)||t.replaceWith(Yo(t,`${n}:`))}}function Yo(e,t){let n=e.tagName.toLowerCase().slice(t.length);if(!qo.test(n))return e;let r=e.ownerDocument.createElementNS(Go,n);for(let t of e.attributes)r.setAttribute(t.name,t.value);for(let n of[...e.childNodes]){let e=n instanceof Element&&n.tagName.toLowerCase().startsWith(t);r.appendChild(e?Yo(n,t):n)}return r}var Xo=new Set([`updiagonalstrike`,`downdiagonalstrike`,`verticalstrike`,`horizontalstrike`]),Zo={thin:`0.035em`,medium:`0.07em`,thick:`0.14em`},Qo={tight:`0em`,medium:`0.1em`,loose:`0.2em`},$o=/^(\d+(\.\d*)?|\.\d+)(em|ex|px|pt|pc|in|cm|mm)$/,es=/^(#[0-9a-f]{3,8}|[a-z]+)$/i,ts=/^(\d+(\.\d*)?|\.\d+)$/,ns=new Set([`mn`,`mo`,`mi`,`mtext`]),rs=new Set([`stackalign`,`charalign`,`charspacing`,`longdivstyle`]);function is(e,t,n=[],r={}){let i=e.createElementNS(Go,t);for(let[e,t]of Object.entries(r))i.setAttribute(e,t);for(let e of n)e&&i.appendChild(e);return i}function as(e,t){let n=is(e.document,`mo`);return n.textContent=t,n}function os(e){let t=is(e.document,`mn`);return t.textContent=`0`,is(e.document,`mphantom`,[t])}function ss(e,t){return e.getAttribute(t)?.trim().toLowerCase()||void 0}function cs(e,t){let n=Number.parseInt(e.getAttribute(t)??``,10);return Number.isFinite(n)?n:0}function ls(e){return e.localName===`none`||e.localName===`mrow`&&e.children.length===0&&!e.textContent?.trim()}function us(e,t,n=e){switch(t){case`left`:return 0;case`center`:return Math.floor(e/2);case`right`:return e;default:return n}}function ds(e,t,n){let r=[],i,a,o=(e,t)=>{let s=e=>t.reduceRight((e,t)=>{let n=t.cloneNode(!1);return n.appendChild(e),n},e);if(e.localName===`mstyle`)for(let n of[...e.children])o(n,[...t,e]);else if(ls(e))r.push(null);else if(e.localName===`mn`&&e.children.length===0){let t=[...(e.textContent??``).trim()];for(let a of t){a===n.decimalPoint&&(i??=r.length);let t=e.cloneNode(!1);t.textContent=a,r.push(s(t))}t.length&&(a??=r.length)}else ns.has(e.localName)&&e.textContent?.trim()===n.decimalPoint&&(i??=r.length),r.push(s(e))};for(let t of e)o(t,[]);return{kind:`digits`,cells:r,anchor:us(r.length,n.stackAlign,i??a),position:t}}function fs(e){return(e??``).toLowerCase().split(/\s+/).filter(e=>Xo.has(e))}function ps(e,t){let n=[...e.children].filter(e=>!ls(e));return n.length<=1?n[0]??null:is(t.document,`mrow`,n)}function ms(e,t,n){let r=ss(e,`location`)??`n`,i=fs(e.getAttribute(`crossout`)),a=[...e.children].map(e=>ls(e)?null:e.localName===`mscarry`?{content:ps(e,n),location:ss(e,`location`)??r,crossout:e.hasAttribute(`crossout`)?fs(e.getAttribute(`crossout`)):i}:{content:e,location:r,crossout:i}),o=e.getAttribute(`scriptsizemultiplier`)?.trim()??``;return{kind:`carries`,carries:a,anchor:us(a.length,n.stackAlign),position:t,scale:ts.test(o)?o:`0.6`}}function hs(e){let t=ss(e,`mslinethickness`)??`medium`,n=Zo[t]??($o.test(t)?t:`0.07em`),r=e.getAttribute(`mathcolor`)?.trim()??``;return`${n} solid ${es.test(r)?r:`currentColor`}`}function gs(e,t,n){let r=Math.max(0,cs(e,`length`));return{kind:`line`,length:r,anchor:us(r,n.stackAlign),position:t,border:hs(e)}}function _s(e,t,n,r,i){e.forEach((e,a)=>{let o=t+a*n+cs(e,`position`);switch(e.localName){case`msgroup`:_s([...e.children],o,cs(e,`shift`),r,i);break;case`msline`:i.push(gs(e,o,r));break;case`mscarries`:i.push(ms(e,o,r));break;case`msrow`:case`mrow`:i.push(ds([...e.children],o,r));break;default:i.push(ds([e],o,r))}})}function vs(e){return-e.anchor-e.position}function ys(e){return e.kind===`digits`?e.cells.length:e.kind===`carries`?e.carries.length:e.length}function bs(e){return vs(e)+ys(e)-1}function xs(e,t,n,r){let i=e=>is(r.document,`mpadded`,[t],{width:`0`,...e?{lspace:e}:{}}),a=(e,t)=>is(r.document,e,t);switch(n){case`s`:return a(`munder`,[e,i(`-0.5width`)]);case`ne`:return a(`msup`,[e,i()]);case`se`:return a(`msub`,[e,i()]);case`nw`:return a(`mmultiscripts`,[e,a(`mprescripts`,[]),a(`none`,[]),i(`-1width`)]);case`sw`:return a(`mmultiscripts`,[e,a(`mprescripts`,[]),i(`-1width`),a(`none`,[])]);case`w`:return t.setAttribute(`scriptlevel`,`+1`),a(`mrow`,[i(`-1width`),e]);case`e`:return t.setAttribute(`scriptlevel`,`+1`),a(`mrow`,[e,i()]);default:return a(`mover`,[e,i(`-0.5width`)])}}function Ss(e,t,n){let r=is(n.document,`menclose`,[e],{notation:t.join(` `),"data-padding":`0.1em`,"data-thickness":`0.067em`}),i=t.some(e=>e.endsWith(`diagonalstrike`))?.167:t.includes(`horizontalstrike`)?.1:0;return i?is(n.document,`mpadded`,[r],{lspace:`-${i}em`,width:`-${2*i}em`}):r}function Cs(e,t,n,r,i){let a=e&&t.crossout.length?Ss(e,t.crossout,i):e;if(!t.content)return a;let o=is(i.document,`mstyle`,[t.content],{scriptsizemultiplier:r});return xs(a??os(i),o,n,i)}function ws(e,t){return e.carries[t-vs(e)]??null}function Ts(e,t,n,r){let i=e.content;n.forEach((e,a)=>{let o=n.length-1-a,s=n[o],c=ws(s,t),l=n.slice(0,o).some(e=>ws(e,t));if(!c&&!l)return;let u=c??{content:os(r),location:`n`,crossout:[]},d=a===0?u.location:`n`;i=Cs(i,u,d,s.scale,r)}),e.content=i}function Es(e,t){let n=e.filter(e=>ys(e)>0),r=Math.min(0,...n.map(vs)),i=Math.max(r,...n.map(bs))-r+1,a=-r,o=[],s=new Map,c=()=>Array.from({length:i},()=>({content:null,borders:{}})),l=e=>e.length===0?Array.from({length:i},(e,t)=>t):Array.from({length:e.length},(t,n)=>a+vs(e)+n),u=[],d=[],f=e=>{let n=c();e.cells.forEach((t,r)=>{n[a+vs(e)+r].content=t}),u.length&&n.forEach((e,n)=>{Ts(e,n-a,u,t)});for(let e of d)for(let t of l(e))n[t].borders.top=e.border;u=[],d=[],s.set(e,o.length),o.push(n)};for(let t of e)t.kind===`digits`?f(t):t.kind===`carries`?u.push(t):d.push(t);(u.length||!o.length)&&f({kind:`digits`,cells:[],anchor:0,position:0});let p=o[o.length-1];for(let e of d)for(let t of l(e))p[t].borders.bottom=e.border;return{rows:o,rowOf:s,origin:a}}function Ds(e,{rows:t},n){let r=is(n.document,`mtable`,t.map(e=>is(n.document,`mtr`,e.map(e=>{let t=Object.entries(e.borders).map(([e,t])=>`border-${e}:${t}`).join(`;`);return is(n.document,`mtd`,[e.content],{...t?{style:t}:{},...e.align?{columnalign:e.align}:{}})}))));for(let{name:t,value:n}of[...e.attributes])rs.has(t)||r.setAttribute(t,n);let i=ss(e,`charspacing`)??`medium`,a=ss(e,`charalign`);return r.setAttribute(`columnspacing`,Qo[i]??($o.test(i)?i:Qo.medium)),r.setAttribute(`columnalign`,a===`left`||a===`center`?a:`right`),r.setAttribute(`rowspacing`,`0`),r.setAttribute(`align`,e.getAttribute(`align`)??`baseline`),r}function Os(e){return{document:e.ownerDocument,stackAlign:ss(e,`stackalign`)??`decimalpoint`,decimalPoint:e.closest(`[decimalpoint]`)?.getAttribute(`decimalpoint`)?.trim().charAt(0)||`.`}}function ks(e){let t=Os(e),n=[];return _s([...e.children],0,0,t,n),Ds(e,Es(n,t),t)}function As(e,t,n,r,i,a){for(let o=n;o<=r;o++)e[t][o].borders[i]=a}function js(e,t){let n=as(t,`)`);return n.setAttribute(`minsize`,`1.2em`),[is(t.document,`mrow`,[e,is(t.document,`mspace`,[],{width:`0.2em`})]),is(t.document,`mpadded`,[n],{voffset:`0.1em`,lspace:`-0.15em`,depth:`-0.2em`,height:`-0.2em`})]}function Ms(e){let t=Os(e),[n,r,...i]=[...e.children],a=n&&!ls(n)?n:null,o=r&&!ls(r)?r:null,s=ss(e,`longdivstyle`)??`lefttop`,c=hs(e),l=[];_s(i,0,0,t,l);let u=l.find(e=>e.kind===`digits`);u||(u={kind:`digits`,cells:[],anchor:0,position:0},l.unshift(u));let d=[],f=(...e)=>{u.cells.unshift(...e),u.anchor+=e.length},p=(...e)=>{let n=e.flatMap(e=>e?e.localName===`mrow`?[...e.children]:[e]:[]);u.cells.push(...ds(n,0,t).cells)};switch(s){case`left/\\right`:f(a,as(t,`/`)),p(as(t,`\\`),o);break;case`left)(right`:f(a,as(t,`)`)),p(as(t,`(`),o);break;case`:right=right`:p(as(t,`:`),a,as(t,`=`),o);break;case`righttop`:case`stackedleftlinetop`:case`lefttop`:o&&_s([o],0,0,t,d),l.splice(l.indexOf(u),0,...d),s===`righttop`?p(a):s===`stackedleftlinetop`?f(a):f(...js(a,t));break}let m=Es(l,t),h=m.rows,g=m.rowOf.get(u)??0,_=e=>m.origin+vs(u)+e,v=Math.max(_(u.cells.length-1),...d.map(e=>m.origin+bs(e)));switch(s){case`left/\\right`:case`left)(right`:case`:right=right`:break;case`righttop`:{let e=h[g][_(u.cells.length-1)];e.borders.left=c,e.borders.bottom=c,As(h,g,_(0),_(u.cells.length-1),`top`,c);break}case`stackedleftlinetop`:{let e=h[g][_(0)];e.borders.right=c,e.borders.bottom=c,As(h,g,_(1),v,`top`,c);break}case`stackedrightright`:case`mediumstackedrightright`:case`shortstackedrightright`:case`stackedleftleft`:Ns(h,g,s,a,o,c,t);break;default:As(h,g,_(1),v,`top`,c)}return Ds(e,m,t)}function Ns(e,t,n,r,i,a,o){let s=n===`stackedleftleft`,c=s?`right`:`left`,l=e=>e&&is(o.document,`mpadded`,[e],{lspace:`0.2em`,width:`+0.4em`});e.length<t+2&&e.push(e[0].map(()=>({content:null,borders:{}}))),e.forEach((e,o)=>{let u={content:null,borders:{},align:s?`right`:`left`};o===t?(u.content=l(r),u.borders={[c]:a,bottom:a}):o===t+1?(u.content=l(i),n!==`shortstackedrightright`&&(u.borders[c]=a)):o>t+1&&(n===`stackedrightright`||s)&&(u.borders[c]=a),s?e.unshift(u):e.push(u)})}function Ps(e){for(let t of[...e.querySelectorAll(`mstack, mlongdiv`)])!t.closest(`math`)||t.closest(`mjx-container`)||t.replaceWith(t.localName===`mstack`?ks(t):Ms(t))}var Fs=`PIE-MJX-explorer-styles`,Is=`var(--pie-text, black)`,Ls=`var(--pie-background, #ffffff)`,Rs=`var(--pie-border-dark, #66686A)`,zs=`var(--pie-focus-outline, var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565C0)))`,Bs=`color-mix(in srgb, ${zs} 15%, transparent)`,Vs=`
6
6
  :root mjx-container [data-sre-highlight-1]:not([data-mjx-collapsed], rect) {
7
- color: ${ks} !important;
8
- fill: ${ks} !important;
7
+ color: ${Is} !important;
8
+ fill: ${Is} !important;
9
9
  }
10
10
  :root mjx-container:not([data-mjx-clone-container]) [data-sre-highlight-1]:not([data-sre-enclosed], rect) {
11
- background-color: ${Ns} !important;
11
+ background-color: ${Bs} !important;
12
12
  }
13
13
  :root mjx-container rect[data-sre-highlight-1]:not([data-sre-enclosed]) {
14
- fill: ${Ns} !important;
14
+ fill: ${Bs} !important;
15
15
  }
16
16
  :root mjx-container .mjx-selected {
17
- outline: 2px solid ${Ms} !important;
17
+ outline: 2px solid ${zs} !important;
18
18
  }
19
19
  :root mjx-container [data-sre-highlight-2] {
20
- color: ${ks} !important;
20
+ color: ${Is} !important;
21
21
  background-color: transparent !important;
22
- fill: ${ks} !important;
23
- outline: 2px dashed ${Ms} !important;
22
+ fill: ${Is} !important;
23
+ outline: 2px dashed ${zs} !important;
24
24
  }
25
25
  :root mjx-container rect[data-sre-highlight-2] {
26
26
  fill: transparent !important;
27
- stroke: ${Ms} !important;
27
+ stroke: ${zs} !important;
28
28
  stroke-width: 2px !important;
29
29
  vector-effect: non-scaling-stroke;
30
30
  }
31
31
  :root .MJX_LiveRegion, :root .MJX_HoverRegion, :root .MJX_ToolTip {
32
- color: ${ks} !important;
33
- background-color: ${As} !important;
34
- border-color: ${js} !important;
32
+ color: ${Is} !important;
33
+ background-color: ${Ls} !important;
34
+ border-color: ${Rs} !important;
35
35
  }
36
36
  :root .MJX_LiveRegion > div, :root .MJX_HoverRegion > div {
37
- color: ${ks} !important;
38
- background-color: ${Ns} !important;
37
+ color: ${Is} !important;
38
+ background-color: ${Bs} !important;
39
39
  }
40
- `;function Fs(e=document){if(e.getElementById(`PIE-MJX-explorer-styles`))return;let t=e.createElement(`style`);t.id=Os,t.textContent=Ps,e.head.appendChild(t)}var Is=Symbol.for(`@pie-element/shared-math-rendering-mathjax/speech-worker-failed`);function Ls(){let e=globalThis;e[Is]||(e[Is]=!0,console.warn(`[math-rendering] MathJax's speech worker did not start, so speech, braille and the explorer are off. A content security policy must allow blob: workers, and scripts and fetches from the asset root. See ${lo}`))}function Rs(e){let t=e.webworker;if(!t||t.ready)return;e.options??={};let n=e.options;n.enableSpeech=!1,n.enableBraille=!1,n.speechError=()=>{},t.Post=()=>Promise.reject(Error(`The speech worker did not start`)),t.Terminate(),Ls()}function zs(e){let t=e?.adaptor,n=t?.createWorker;!e||!t||!n||(t.createWorker=async(r,i)=>{let a=await n.call(t,r,i);return a.addEventListener(`error`,()=>Rs(e),{once:!0}),a})}`${po}`;var Bs={parallelogram:`\\lower.2em{\\Huge\\unicode{x25B1}}`,overarc:`\\overparen`,napprox:`\\not\\approx`,longdiv:`\\enclose{longdiv}`,abs:[`\\left|#1\\right|`,1]},Vs=`[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)`,Hs=/\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/,Us=/\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/,Ws=/\\embed\{newLine\}\[\]/g,Gs=[[`$$`,`$$`],[`$`,`$`],[`\\[`,`\\]`],[`\\(`,`\\)`]],Ks=Symbol.for(`@pie-element/shared-math-rendering-mathjax/loading`),qs=`MJX-CHTML-styles`,Js=`PIE-MJX-SVG-styles`,Ys=`PIE-MathJax-Menu-Settings`,Xs={'mjx-container[overflow="linebreak"][display]':{overflow:`auto clip`,"min-width":`initial !important`}},Zs=200,Qs=201;function $s(e){let t=[...e.matches(`mjx-container`)?[e]:[],...e.querySelectorAll(`mjx-container`)];for(let e of t)for(let t of[e,...e.querySelectorAll(`[data-latex],[data-latex-item]`)])t.removeAttribute(`data-latex`),t.removeAttribute(`data-latex-item`)}function ec(e){for(let[t,n]of Gs)if(e.startsWith(t)&&e.endsWith(n))return e.substring(t.length,e.length-n.length);return e}function tc(e){return ec(e.includes(`\\displaystyle`)?e.replace(`\\displaystyle`,``).trim():e)}var nc=`mathjax_ignore`,rc=`mathjax_process`;function ic(e,t){let n=e.closest(`.${nc}, .${rc}`);return n!==null&&t.contains(n)&&!n.classList.contains(rc)}function ac(e){for(let t of e.querySelectorAll(`[data-latex]`)){if(t.dataset.mathHandled||t.closest(`mjx-container`)||ic(t,e))continue;let n=t.textContent;n&&(t.textContent=`\\(${tc(n)}\\)`.replace(Ws,`\\newline `),t.dataset.mathHandled=`true`)}}function oc(e){for(let t of e.querySelectorAll(`math`))t.closest(`mjx-container`)||t.setAttribute(`displaystyle`,`true`)}function sc(e,t){for(let t of e.querySelectorAll(`math`))if(!t.closest(`mjx-assistive-mml`))return!0;return(t?Us:Hs).test(e.textContent??``)}function cc(e){return new Promise((t,n)=>{let{useSingleDollar:r=!1,accessibility:i=!0,loadFonts:a=!0,srcUrl:o}=e,s=bo(e,{}.url),c={loader:{load:i?[`a11y/assistive-mml`]:[],failed:e=>n(e),"output/svg":{ready:e=>{let t=jo();return lc(t)&&uc(t),e}}},startup:{typeset:!1,ready:()=>{let e=jo(),r=e?.startup,i=lc(e);i&&(uc(e),dc(e,s.speechLocales),xo(e?._?.a11y?.sre_ts?.locales,s.speechLocales)),r?.defaultReady?.(),i&&(fc(r?.document),r?.document?.addStyles?.(Xs),zs(r?.document)),Promise.resolve(r?.promise).then(()=>t(),n)}},tex:{macros:{...Bs}},output:{displayOverflow:`linebreak`},options:{enableMenu:i,menuOptions:{settings:{assistiveMml:i,enrich:!1,inTabOrder:!1}},a11y:{inTabOrder:!1}}};r&&c.tex&&(console.warn(Vs),c.tex.inlineMath=[[`$`,`$`],[`\\(`,`\\)`]],c.tex.processEscapes=!0),a||(c.chtml={fontURL:``});let l=So(s.speechLocales);l&&c.options&&(c.options.sre={locale:l}),No(c,{...s,srcUrl:o}).then(e=>{e||t()},n)})}function lc(e){return!!e?.version?.startsWith(`4.`)}function uc(e){let t=e?._?.output,n=t?.chtml_ts?.CHTML;n&&(n.STYLESHEETID=Fo);let r=t?.svg_ts?.SVG;r&&(r.STYLESHEETID=Js)}function dc(e,t){let n=e?._?.ui?.menu?.Menu?.Menu;if(n){n.MENU_STORAGE=Ys;try{let e=localStorage.getItem(Ys);if(!e)return;let{assistiveMml:n,locale:r,...i}=JSON.parse(e),a=r===void 0||!t||t.has(r);if(n===void 0&&a)return;a&&r!==void 0&&(i.locale=r),Object.keys(i).length?localStorage.setItem(Ys,JSON.stringify(i)):localStorage.removeItem(Ys)}catch{}}}function fc(e){if(!e)return;let t=new WeakSet,n=e=>{let n=e.typesetRoot;!n||t.has(n)||($s(n),t.add(n))};e.addRenderAction?.(`pie-strip-latex`,Qs,e=>{for(let t of e.math??[])n(t);return!1},e=>{let t=e.typesetRoot;return t&&$s(t),!1});let r=e.outputJax?.chtmlStyles;r?.id===qs&&(r.id=Fo),hc()}function pc(e){return e instanceof HTMLStyleElement&&Io.includes(e.id)}function mc(e){ko(`foreign-output-stylesheet`,`another MathJax added <style id="${e.id}"> to <head>`)}function hc(){let e=document.head,t=[...e.children].find(pc);if(t){mc(t);return}let n=new MutationObserver(e=>{for(let t of e){let e=[...t.addedNodes].find(pc);if(e){mc(e),n.disconnect();return}}});n.observe(e,{childList:!0})}function gc(e){let t=e?.math;if(!t?.remove)return;let n=[...t].filter(e=>(e.state?.()??0)>=Zs&&e.typesetRoot?.isConnected===!1);if(n.length!==0){for(let e of[...n].reverse())e.clear?.();t.remove(...n)}}function _c(e){return new Promise((t,n)=>{let r=e.startup??{};e.startup=r;let i=r.ready;r.ready=()=>{let e=jo()?.startup;i?i.call(r):e?.defaultReady?.(),Promise.resolve(e?.promise).then(()=>t(),n)}})}function vc(e){let t=jo();return t?t.version?t.startup?.promise?Promise.resolve(t.startup.promise).then(()=>void 0):Promise.resolve():_c(t):cc(e)}function yc(e){return vc(e).then(()=>{let e=jo();e&&typeof e.typesetPromise!=`function`&&console.warn(`[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.`)})}function bc(e){let t=Po,n=t[Ks];return n||(n=yc(e),t[Ks]=n),n}function xc(e={}){let t=e.useSingleDollar??!1;return async n=>{if(typeof window>`u`)return;let r=Lo();r&&ko(`mathjax-3-global`,`window.MathJax is MathJax ${r}`),ac(n),Vo(n),oc(n),Ds(n);let i=bc(e);if(!sc(n,t)){i.catch(()=>{});return}await i;let a=jo();if(await a?.startup?.promise,typeof a?.typesetPromise==`function`){Fs(),gc(a.startup?.document);try{await a.typesetPromise([n])}catch(e){throw a.typesetClear?.([n]),e}$s(n)}}}var Sc=`@pie-lib/math-rendering`,Cc=`@pie-lib/math-rendering@2`,wc=`pie-print`,Tc=50,Ec=1e4,Dc=null;function Oc(){return!!window[Cc]?.opts?.useSingleDollar}function kc(){return Dc||=xc({useSingleDollar:Oc()}),Dc}function Ac(){if(typeof window>`u`)return null;let e=window[Sc];return typeof e?.renderMath==`function`&&e.renderMath!==Pc?e:null}function jc(e){let t=e;for(;t;){if(t instanceof Element&&t.localName===wc)return t;t=t instanceof ShadowRoot?t.host:t.parentNode}return null}function Mc(){let e=window.renderMath;return typeof e==`function`?e:null}async function Nc(e){let t=jc(e);if(!t)return null;let n=Mc();if(n||t.mathRenderingModuleUrlImported!==!0)return n;let r=Date.now()+Ec;for(;Date.now()<r;){await new Promise(e=>setTimeout(e,Tc));let e=Mc();if(e)return e}return null}var Pc=async e=>{if(typeof window>`u`)return;let t=typeof e==`string`,n;t?(n=document.createElement(`div`),n.innerHTML=e):n=e||document.body;let r=Ac(),i=r||t?null:await Nc(n);return r?await r.renderMath?.(n):i&&i!==Pc?await i(n):await kc()(n),t?n.innerHTML:void 0},Fc={translation:{categorize:{limitMaxChoicesPerCategory:`You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.`,maxChoicesPerCategoryRestriction:`To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s].`},dragInTheBlank:{blank:`Blank {{index}}`},ebsr:{part:`Part {{index}}`,twoPartQuestion:`Two-Part Question`},editableHtml:{responseAreaToolbar:`Response area`,toolbar:`Editing tools`,buttons:{insertTable:`Insert table`,addTableRow:`Add table row`,removeTableRow:`Remove table row`,addTableColumn:`Add table column`,removeTableColumn:`Remove table column`,removeTable:`Remove table`,tableBorders:`Table borders`,bold:`Bold`,italic:`Italic`,strikethrough:`Strikethrough`,code:`Code`,underline:`Underline`,subscript:`Subscript`,superscript:`Superscript`,insertImage:`Insert image`,insertVideo:`Insert video`,insertAudio:`Insert audio`,cssClasses:`CSS classes`,blockquote:`Blockquote`,heading:`Heading`,insertMath:`Insert math`,spanishCharacters:`Spanish characters (ñ)`,specialCharacters:`Special characters (€)`,textAlignment:`Text alignment`,bulletedList:`Bulleted list`,numberedList:`Numbered list`,done:`Done`}},explicitConstructedResponse:{fillInTheBlankQuestion:`Fill in the Blank Question`,response:`Response {{index}} of {{total}}`},extendedTextEntry:{comment:`Comment`,constructedResponseQuestion:`Constructed Response Question`,response:`Your response`,writtenResponseQuestion:`Written Response Question`},fractionModel:{modelLabel_one:`Model {{index}} of {{total}}: {{selected}} of {{count}} part selected`,modelLabel_other:`Model {{index}} of {{total}}: {{selected}} of {{count}} parts selected`},numberLine:{addElementLimit_one:`You can only add {{count}} element`,addElementLimit_other:`You can only add {{count}} elements`,clearAll:`Clear all`,closedEnd:`closed`,elementCorrect:`Correct.`,elementIncorrect:`Incorrect.`,graphLabel:`Number line from {{min}} to {{max}}, with a tick every {{interval}}`,line:`Line from {{left}} ({{leftEnd}}) to {{right}} ({{rightEnd}}).`,openEnd:`open`,plottedNone:`Nothing is plotted.`,pointClosed:`Closed point at {{position}}.`,pointOpen:`Open point at {{position}}.`,rayLeft:`Ray from {{position}} ({{end}}) to the left.`,rayRight:`Ray from {{position}} ({{end}}) to the right.`},hotspot:{correctlySelected:`Correctly selected`,image_one:`Image with {{count}} hotspot`,image_other:`Image with {{count}} hotspots`,shape:`Hotspot {{index}} of {{total}}`,shouldHaveBeenSelected:`Should have been selected`,shouldNotHaveBeenSelected:`Should not have been selected`},imageClozeAssociation:{answerChoice:`Answer choice {{index}} of {{total}}`,image_one:`Image with {{count}} response area`,image_other:`Image with {{count}} response areas`,reachedLimit_one:`You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.`,reachedLimit_other:`Full`,responseArea:`Response area {{index}} of {{total}}`},inlineDropdown:{inlineDropdownQuestion:`Inline Dropdown Question`,query:`Query`,queryNumber:`Query {{index}}`,showRationaleForChoices:`Show Rationale for choices`,hideRationaleForChoices:`Hide Rationale for choices`},drawingResponse:{fillColor:`Fill color`,outlineColor:`Outline color`,noFill:`No fill`,lightblue:`Light blue`,lightyellow:`Light yellow`,red:`Red`,orange:`Orange`,yellow:`Yellow`,violet:`Violet`,blue:`Blue`,green:`Green`,white:`White`,black:`Black`,onDoubleClick:`Double click to edit this text. Press Enter to submit.`,drawingArea:`Drawing area`,drawingAreaOverImage:`Drawing area over a background image`,tools:{select:`Select`,freeDraw:`Free Draw`,line:`Line`,rectangle:`Rectangle`,circle:`Circle`,textEntry:`Text Entry`,eraser:`Eraser`}},charting:{addCategory:`Add category`,actions:`Actions`,add:`Add`,delete:`Delete`,newLabel:`New label`,categoryLabel:`Category {{index}} label`,categoryLabelValue:`Category {{index}} label: {{label}}`,category:`Category {{index}}`,reachedLimit_other:`There can't be more than {{count}} categories.`,keyLegend:{incorrectAnswer:`Student incorrect answer`,correctAnswer:`Student correct answer`,correctKeyAnswer:`Answer key correct`},chartTypes:{bar:`Bar chart`,histogram:`Histogram`,lineDot:`Line chart with dots`,lineCross:`Line chart with crosses`,dotPlot:`Dot plot`,linePlot:`Line plot`},categories_zero:`No categories.`,categories_one:`{{count}} category: {{categories}}.`,categories_other:`{{count}} categories: {{categories}}.`,valueRange:`Values from {{min}} to {{max}}.`,labelledValueRange:`{{label}} from {{min}} to {{max}}.`},graphing:{graph:`Coordinate graph`,axisRange:`{{axis}} axis from {{min}} to {{max}}.`,plotted_zero:`Nothing plotted.`,plotted_one:`{{count}} object plotted: {{marks}}.`,plotted_other:`{{count}} objects plotted: {{marks}}.`,shadedRegion:`Shaded region`,point:`Point`,circle:`Circle`,line:`Line`,parabola:`Parabola`,absolute:`Absolute Value`,exponential:`Exponential`,polygon:`Polygon`,ray:`Ray`,segment:`Segment`,sine:`Sine`,vector:`Vector`,label:`Label`,markLabel:`Label at ({{x}}, {{y}})`,correctMarkLabel:`Correct label at ({{x}}, {{y}})`,redo:`Redo`,reset:`Reset`,keyLegend:{missingRequiredLabel:`Missing Required Label`,answerKeyCorrect:`Answer Key Correct`,answerKeyCorrectLabel:`Answer Key Correct Label`,studentIncorrect:`Student Incorrect`,incorrectStudentLabel:`Incorrect Student Label`,studentCorrect:`Student Correct`,studentCorrectLabel:`Student Correct Label`}},mathInline:{keypadInstructions:`This field supports both keypad and keyboard input. Use the keyboard to access and interact with the on-screen math keypad, which accepts LaTeX markup. Use the down arrow key to open the keypad and navigate its buttons. Use the escape key to close the keypad and return to the input field.`,mathEquationResponseQuestion:`Math Equation Response Question`,mathResponseQuestion:`Math Response Question`,primaryCorrectWithAlternates:`Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct.`},mathInput:{enterAnswer:`Enter answer`},mcPopulatedBlank:{answerChoices:`Answer choices`,blankLabel:`blank`,emptyBlank:`(blank)`,blankPreSelectionHint:`The answer you choose will appear on the blank line above.`,correctAnswerSelected:`Correct answer selected`,incorrectAnswerSelected:`Incorrect answer selected`,selectedAnswerImage:`Selected answer image`,choiceImage:`Choice {{id}}`,clickToEnableAutoplay:`Click to enable audio autoplay`,audioResourceUnavailable:`Audio is enabled but no playable audio URL is configured.`,listen:`Listen`,listenSilentAlt:`Repeat instructions`,listenPlayingAlt:`Instructions are playing`,printAudio:`Audio:`,printTranscript:`Transcript:`},multipleChoice:{minSelections:`Select at least {{minSelections}}.`,maxSelections_one:`Only {{maxSelections}} answer is allowed.`,maxSelections_other:`Only {{maxSelections}} answers are allowed.`,minmaxSelections_equal:`Select {{minSelections}}.`,minmaxSelections_range:`Select between {{minSelections}} and {{maxSelections}}.`,multipleChoiceQuestion:`Multiple Choice Question`,multipleCorrectAnswerQuestion:`Multiple Correct Answer Question`,multipleSelectQuestion:`Multiple Select Question`},rubric:{rubric:`Rubric`,showRubric:`Show Rubric`,hideRubric:`Hide Rubric`},selectText:{correctAnswerSelected:`Correct`,correctAnswerNotSelected:`Correct Answer Not Selected`,incorrectSelection:`Incorrect Selection`,key:`Key`,textGroup:`Selectable text`,textGroupWithLimit:`Selectable text, select up to {{max}}`,tokenPosition:`{{index}} of {{total}}`},simpleCloze:{correctAnswerShown:`Correct answer`,correct:`Correct`,incorrect:`Incorrect`,unanswered:`No answer`,placeholder:`Enter your answer...`,answerInput:`Your answer`,printCorrectAnswer:`Correct answer:`,printAnswerBlank:`Answer blank`},vennClassification:{tray:`Tiles to classify`,unknownTarget:`unknown`,cancelled:`Cancelled`,returnedToTray:`{{name}} returned to tray`,placedIn:`{{name}} placed in {{target}}`,pickedUp:`Picked up {{name}}`,pickedUpWithKeyboard:`Picked up {{name}}, drop target: {{target}}. Use arrow keys to choose a drop target, Enter to drop, Escape to cancel.`,dropTarget:`Drop target: {{target}}`,unsupportedCircles_one:`This diagram cannot be shown: it has {{count}} circle, and only {{supported}} are supported.`,unsupportedCircles_other:`This diagram cannot be shown: it has {{count}} circles, and only {{supported}} are supported.`,setNumber:`Set {{number}}`,regionOnly:`{{set}} only`,regionNeither:`Neither {{first}} nor {{second}}`,regionNoneOf:`None of {{sets}}`,regionAndSeparator:` and `,tileFallbackName:`Tile`,tileNotPlaced:`not placed`,tileInRegion:`in {{region}}`,tileCorrect:`correct`,tileIncorrect:`incorrect`}},common:{undo:`Undo`,clearAll:`Clear all`,correct:`Correct`,incorrect:`Incorrect`,showCorrectAnswer:`Show correct answer`,hideCorrectAnswer:`Hide correct answer`,showTeacherInstructions:`Show Teacher Instructions`,hideTeacherInstructions:`Hide Teacher Instructions`,show:`Show`,hide:`Hide`,showRationale:`Show Rationale`,hideRationale:`Hide Rationale`,commonCorrectAnswerWithAlternates:`Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.`,warning:`Warning`,showNote:`Show Note`,hideNote:`Hide Note`,cancel:`Cancel`,playAudio:`Play audio`}},Ic={translation:{categorize:{limitMaxChoicesPerCategory:`Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.`,maxChoicesPerCategoryRestriction:`Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta`},dragInTheBlank:{blank:`Espacio en blanco {{index}}`},ebsr:{part:`Parte {{index}}`,twoPartQuestion:`Pregunta de dos partes`},editableHtml:{responseAreaToolbar:`Área de respuesta`,toolbar:`Herramientas de edición`,buttons:{insertTable:`Insertar tabla`,addTableRow:`Agregar fila a la tabla`,removeTableRow:`Eliminar fila de la tabla`,addTableColumn:`Agregar columna a la tabla`,removeTableColumn:`Eliminar columna de la tabla`,removeTable:`Eliminar tabla`,tableBorders:`Bordes de la tabla`,bold:`Negrita`,italic:`Cursiva`,strikethrough:`Tachado`,code:`Código`,underline:`Subrayado`,subscript:`Subíndice`,superscript:`Superíndice`,insertImage:`Insertar imagen`,insertVideo:`Insertar video`,insertAudio:`Insertar audio`,cssClasses:`Clases CSS`,blockquote:`Cita en bloque`,heading:`Encabezado`,insertMath:`Insertar expresión matemática`,spanishCharacters:`Caracteres del español (ñ)`,specialCharacters:`Caracteres especiales (€)`,textAlignment:`Alineación del texto`,bulletedList:`Lista con viñetas`,numberedList:`Lista numerada`,done:`Listo`}},explicitConstructedResponse:{fillInTheBlankQuestion:`Pregunta para completar espacios en blanco`,response:`Respuesta {{index}} de {{total}}`},extendedTextEntry:{comment:`Comentario`,constructedResponseQuestion:`Pregunta de respuesta construida`,response:`Tu respuesta`,writtenResponseQuestion:`Pregunta de respuesta escrita`},fractionModel:{modelLabel_one:`Modelo {{index}} de {{total}}: {{selected}} de {{count}} parte seleccionada`,modelLabel_other:`Modelo {{index}} de {{total}}: {{selected}} de {{count}} partes seleccionadas`},numberLine:{addElementLimit_one:`Solo puedes agregar {{count}} elemento`,addElementLimit_other:`Solo puedes agregar {{count}} elementos`,clearAll:`Borrar todo`,closedEnd:`cerrado`,elementCorrect:`Correcto.`,elementIncorrect:`Incorrecto.`,graphLabel:`Recta numérica de {{min}} a {{max}}, con una marca cada {{interval}}`,line:`Línea de {{left}} ({{leftEnd}}) a {{right}} ({{rightEnd}}).`,openEnd:`abierto`,plottedNone:`No hay nada marcado en la recta.`,pointClosed:`Punto cerrado en {{position}}.`,pointOpen:`Punto abierto en {{position}}.`,rayLeft:`Rayo desde {{position}} ({{end}}) hacia la izquierda.`,rayRight:`Rayo desde {{position}} ({{end}}) hacia la derecha.`},hotspot:{correctlySelected:`Seleccionada correctamente`,image_one:`Imagen con {{count}} zona activa`,image_other:`Imagen con {{count}} zonas activas`,shape:`Zona activa {{index}} de {{total}}`,shouldHaveBeenSelected:`Debía seleccionarse`,shouldNotHaveBeenSelected:`No debía seleccionarse`},imageClozeAssociation:{answerChoice:`Opción de respuesta {{index}} de {{total}}`,image_one:`Imagen con {{count}} área de respuesta`,image_other:`Imagen con {{count}} áreas de respuesta`,reachedLimit_one:`Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.`,reachedLimit_other:`Lleno`,responseArea:`Área de respuesta {{index}} de {{total}}`},inlineDropdown:{inlineDropdownQuestion:`Pregunta con menú desplegable`,query:`Consulta`,queryNumber:`Consulta {{index}}`,showRationaleForChoices:`Mostrar justificación de las opciones`,hideRationaleForChoices:`Ocultar justificación de las opciones`},drawingResponse:{fillColor:`Color de relleno`,outlineColor:`Color del contorno`,noFill:`Sin relleno`,lightblue:`Azul claro`,lightyellow:`Amarillo claro`,red:`Rojo`,orange:`Naranja`,yellow:`Amarillo`,violet:`Violeta`,blue:`Azul`,green:`Verde`,white:`Blanco`,black:`Negro`,onDoubleClick:`Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar`,drawingArea:`Área de dibujo`,drawingAreaOverImage:`Área de dibujo sobre una imagen de fondo`,tools:{select:`Seleccionar`,freeDraw:`Dibujo libre`,line:`Línea`,rectangle:`Rectángulo`,circle:`Círculo`,textEntry:`Entrada de texto`,eraser:`Borrador`}},charting:{addCategory:`Añadir categoría`,actions:`Acciones`,add:`Añadir`,delete:`Eliminar`,newLabel:`Nueva etiqueta`,categoryLabel:`Etiqueta de la categoría {{index}}`,categoryLabelValue:`Etiqueta de la categoría {{index}}: {{label}}`,category:`Categoría {{index}}`,reachedLimit_other:`No puede haber más de {{count}} categorías.`,keyLegend:{incorrectAnswer:`Respuesta incorrecta del estudiante`,correctAnswer:`Respuesta correcta del estudiante`,correctKeyAnswer:`Clave de respuesta correcta`},chartTypes:{bar:`Gráfico de barras`,histogram:`Histograma`,lineDot:`Gráfico de líneas con puntos`,lineCross:`Gráfico de líneas con cruces`,dotPlot:`Diagrama de puntos`,linePlot:`Diagrama de líneas`},categories_zero:`Sin categorías.`,categories_one:`{{count}} categoría: {{categories}}.`,categories_other:`{{count}} categorías: {{categories}}.`,valueRange:`Valores de {{min}} a {{max}}.`,labelledValueRange:`{{label}} de {{min}} a {{max}}.`},graphing:{graph:`Gráfica de coordenadas`,axisRange:`Eje {{axis}} de {{min}} a {{max}}.`,plotted_zero:`Nada trazado.`,plotted_one:`{{count}} objeto trazado: {{marks}}.`,plotted_other:`{{count}} objetos trazados: {{marks}}.`,shadedRegion:`Región sombreada`,point:`Punto`,circle:`Circulo`,line:`Línea`,parabola:`Parábola`,absolute:`Valor absoluto`,exponential:`Exponencial`,polygon:`Polígono`,ray:`Semirrecta`,segment:`Segmento `,sine:`Seno`,vector:`Vector`,label:`Etiqueta`,markLabel:`Etiqueta en ({{x}}, {{y}})`,correctMarkLabel:`Etiqueta correcta en ({{x}}, {{y}})`,redo:`Rehacer`,reset:`Reiniciar`,keyLegend:{missingRequiredLabel:`Falta una etiqueta obligatoria`,answerKeyCorrect:`Clave de respuesta correcta`,answerKeyCorrectLabel:`Etiqueta correcta de la clave de respuesta`,studentIncorrect:`Respuesta incorrecta del estudiante`,incorrectStudentLabel:`Etiqueta incorrecta del estudiante`,studentCorrect:`Respuesta correcta del estudiante`,studentCorrectLabel:`Etiqueta correcta del estudiante`}},mathInline:{keypadInstructions:`Este campo admite la entrada con el teclado en pantalla y con el teclado físico. Usa el teclado físico para acceder al teclado matemático en pantalla e interactuar con él; este acepta notación LaTeX. Usa la tecla de flecha hacia abajo para abrir el teclado en pantalla y recorrer sus botones. Usa la tecla Escape para cerrar el teclado en pantalla y volver al campo de entrada.`,mathEquationResponseQuestion:`Pregunta de respuesta con ecuación matemática`,mathResponseQuestion:`Pregunta de respuesta matemática`,primaryCorrectWithAlternates:`Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas.`},mathInput:{enterAnswer:`Escribe la respuesta`},mcPopulatedBlank:{answerChoices:`Opciones de respuesta`,blankLabel:`espacio en blanco`,emptyBlank:`(en blanco)`,blankPreSelectionHint:`La respuesta que elijas aparecerá en la línea en blanco de arriba.`,correctAnswerSelected:`Respuesta correcta seleccionada`,incorrectAnswerSelected:`Respuesta incorrecta seleccionada`,selectedAnswerImage:`Imagen de la respuesta seleccionada`,choiceImage:`Opción {{id}}`,clickToEnableAutoplay:`Haz clic para activar la reproducción automática del audio`,audioResourceUnavailable:`El audio está activado, pero no hay una URL de audio reproducible configurada.`,listen:`Escuchar`,listenSilentAlt:`Escuchar. Repetir las instrucciones.`,listenPlayingAlt:`Escuchar. Estas son las instrucciones.`,printAudio:`Audio:`,printTranscript:`Transcripción:`},multipleChoice:{minSelections:`Seleccione al menos {{minSelections}}.`,maxSelections_one:`Sólo se permite {{maxSelections}} respuesta.`,maxSelections_other:`Sólo se permiten {{maxSelections}} respuestas.`,minmaxSelections_equal:`Seleccione {{minSelections}}.`,minmaxSelections_range:`Seleccione entre {{minSelections}} y {{maxSelections}}.`,multipleChoiceQuestion:`Pregunta de opción múltiple`,multipleCorrectAnswerQuestion:`Pregunta con varias respuestas correctas`,multipleSelectQuestion:`Pregunta de selección múltiple`},rubric:{rubric:`Rúbrica`,showRubric:`Mostrar rúbrica`,hideRubric:`Ocultar rúbrica`},selectText:{correctAnswerSelected:`Respuesta Correcta`,correctAnswerNotSelected:`Respuesta Correcta No Seleccionada`,incorrectSelection:`Selección Incorrecta`,key:`Clave`,textGroup:`Texto seleccionable`,textGroupWithLimit:`Texto seleccionable, selecciona hasta {{max}}`,tokenPosition:`{{index}} de {{total}}`},simpleCloze:{correctAnswerShown:`Respuesta correcta`,correct:`Correcto`,incorrect:`Incorrecto`,unanswered:`Sin respuesta`,placeholder:`Escribe tu respuesta...`,answerInput:`Tu respuesta`,printCorrectAnswer:`Respuesta correcta:`,printAnswerBlank:`Espacio para la respuesta`},vennClassification:{tray:`Fichas para clasificar`,unknownTarget:`desconocido`,cancelled:`Cancelado`,returnedToTray:`Se devolvió {{name}} a la bandeja`,placedIn:`Se colocó {{name}} en {{target}}`,pickedUp:`Se tomó {{name}}`,pickedUpWithKeyboard:`Se tomó {{name}}, destino: {{target}}. Usa las flechas para elegir un destino, Enter para soltar y Escape para cancelar.`,dropTarget:`Destino: {{target}}`,unsupportedCircles_one:`No se puede mostrar este diagrama: tiene {{count}} círculo, y solo se admiten {{supported}}.`,unsupportedCircles_other:`No se puede mostrar este diagrama: tiene {{count}} círculos, y solo se admiten {{supported}}.`,setNumber:`Conjunto {{number}}`,regionOnly:`Solo {{set}}`,regionNeither:`Ni {{first}} ni {{second}}`,regionNoneOf:`Ninguno de {{sets}}`,regionAndSeparator:` y `,tileFallbackName:`Ficha`,tileNotPlaced:`sin colocar`,tileInRegion:`en {{region}}`,tileCorrect:`correcta`,tileIncorrect:`incorrecta`}},common:{undo:`Deshacer`,clearAll:`Borrar todo`,correct:`Correcto`,incorrect:`Incorrecto`,showCorrectAnswer:`Mostrar respuesta correcta`,hideCorrectAnswer:`Ocultar respuesta correcta`,showTeacherInstructions:`Mostrar instrucciones para el maestro`,hideTeacherInstructions:`Ocultar instrucciones para el maestro`,show:`Mostrar`,hide:`Ocultar`,showRationale:`Mostrar justificación`,hideRationale:`Ocultar justificación`,commonCorrectAnswerWithAlternates:`Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.`,warning:`Advertencia`,showNote:`Mostrar Nota`,hideNote:`Ocultar Nota`,cancel:`Cancelar`,playAudio:`Reproducir audio`}},Q=e=>typeof e==`string`,Lc=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Rc=e=>e==null?``:``+e,zc=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},Bc=/###/g,Vc=e=>e&&e.indexOf(`###`)>-1?e.replace(Bc,`.`):e,Hc=e=>!e||Q(e),Uc=(e,t,n)=>{let r=Q(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(Hc(e))return{};let t=Vc(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Hc(e)?{}:{obj:e,k:Vc(r[i])}},Wc=(e,t,n)=>{let{obj:r,k:i}=Uc(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=Uc(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=Uc(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Gc=(e,t,n,r)=>{let{obj:i,k:a}=Uc(e,t,Object);i[a]=i[a]||[],i[a].push(n)},Kc=(e,t)=>{let{obj:n,k:r}=Uc(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},qc=(e,t,n)=>{let r=Kc(e,n);return r===void 0?Kc(t,n):r},Jc=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?Q(e[r])||e[r]instanceof String||Q(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Jc(e[r],t[r],n):e[r]=t[r]);return e},Yc=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Xc={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},Zc=e=>Q(e)?e.replace(/[&<>"'\/]/g,e=>Xc[e]):e,Qc=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},$c=[` `,`,`,`?`,`!`,`;`],el=new Qc(20),tl=(e,t,n)=>{t||=``,n||=``;let r=$c.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=el.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},nl=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},rl=e=>e?.replace(/_/g,`-`),il={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},al=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||il,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(Q(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},ol=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}},sl=class extends ol{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):Q(n)&&i?o.push(...n.split(i)):o.push(n)));let s=Kc(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!Q(n)?s:nl(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),Wc(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(Q(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=Kc(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Jc(s,n,i):s={...s,...n},Wc(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},cl={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},ll=Symbol(`i18next/PATH_KEY`);function ul(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===ll?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function dl(e,t){let{[ll]:n}=e(ul()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var fl={},pl=e=>!Q(e)&&typeof e!=`boolean`&&typeof e!=`number`,ml=class e extends ol{constructor(e,t={}){super(),zc([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=al.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=pl(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!tl(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Q(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:Q(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=dl(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?dl(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!Q(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let ee=pl(E),te=Object.prototype.toString.apply(E);if(y&&E&&ee&&_.indexOf(te)<0&&!(Q(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:pl(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&Q(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=Q(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!Q(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=Q(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=cl.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return Q(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?dl(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!Q(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(Q(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!fl[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(fl[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!Q(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},hl=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=al.create(`languageUtils`)}getScriptPartFromCode(e){if(e=rl(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=rl(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Q(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),Q(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Q(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):Q(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},gl={zero:0,one:1,two:2,few:3,many:4,other:5},_l={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},vl=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=al.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=rl(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),_l;if(!e.match(/-|_/))return _l;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>gl[e]-gl[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},yl=(e,t,n,r=`.`,i=!0)=>{let a=qc(e,t,n);return!a&&i&&Q(n)&&(a=nl(e,n,r),a===void 0&&(a=nl(t,n,r))),a},bl=e=>e.replace(/\$/g,`$$$$`),xl=class{constructor(e={}){this.logger=al.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Zc:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?Yc(i):a||`{{`,this.suffix=o?Yc(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?Yc(d):f||Yc(`$t(`),this.nestingSuffix=p?Yc(p):m||Yc(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=yl(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(yl(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>bl(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?bl(this.escape(e)):bl(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=Q(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else!Q(a)&&!this.useRawValueToEscape&&(a=Rc(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${Yc(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!Q(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!Q(i))return i;Q(i)||(i=Rc(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Sl=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},Cl=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(rl(r),i),t[o]=s),s(n)}},wl=e=>(t,n,r)=>e(rl(n),r)(t),Tl=class{constructor(e={}){this.logger=al.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?Cl:wl;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Cl(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Sl(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},El=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Dl=class extends ol{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=al.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{Gc(n.loaded,[i],a),El(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();Q(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Q(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},Ol=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,simplifyPluralSuffix:!0,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),Q(e[1])&&(t.defaultValue=e[1]),Q(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),kl=e=>(Q(e.ns)&&(e.ns=[e.ns]),Q(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Q(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),Al=()=>{},jl=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},Ml=`__i18next_supportNoticeShown`,Nl=()=>!!(typeof globalThis<`u`&&globalThis[Ml]||typeof process<`u`&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`&&process.env&&process.env.NODE_ENV===`production`),Pl=()=>{typeof globalThis<`u`&&(globalThis[Ml]=!0)},Fl=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),Il=class e extends ol{constructor(e={},t){if(super(),this.options=kl(e),this.services={},this.logger=al,this.modules={external:[]},jl(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(Q(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=Ol();this.options={...n,...this.options,...kl(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Fl(this)&&!Nl()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),Pl());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?al.init(r(this.modules.logger),this.options):al.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Tl;let t=new hl(this.options);this.store=new sl(this.options.resources,this.options);let i=this.services;i.logger=al,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new vl(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new xl(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Dl(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new ml(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=Al,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=Lc(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=Al){let n=t,r=Q(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=Lc();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=Al,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&cl.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!([`cimode`,`dev`].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!([`cimode`,`dev`].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=Lc();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=Q(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Q(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=dl(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=dl(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=dl(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return Q(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=Lc();return this.options.ns?(Q(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=Lc();Q(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new hl(Ol());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=Al){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new sl(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...Ol().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new xl(n)}return a.translator=new ml(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();Il.createInstance,Il.dir,Il.init,Il.loadResources,Il.reloadResources,Il.use,Il.changeLanguage,Il.getFixedT,Il.t,Il.exists,Il.setDefaultNamespace,Il.hasLoadedNamespace,Il.loadNamespaces,Il.loadLanguages,Il.init({fallbackLng:`en`,lng:`en`,showSupportNotice:!1,resources:{en:Fc,es:Ic}});var{translator:Ll}={translator:{...Il,t:(e,t)=>{let{lng:n}=t;switch(n){case`en_US`:case`en-US`:t.lng=`en`;break;case`es_ES`:case`es-ES`:case`es_MX`:case`es-MX`:t.lng=`es`;break;default:break}return Il.t(e,{lng:n,...t})}},languageOptions:[{value:`en_US`,label:`English (US)`},{value:`es_ES`,label:`Spanish`}]};function $(e,t,n={}){return Ll.t(`translation:vennClassification:${e}`,{lng:t,...n,interpolation:{escapeValue:!1}})}function Rl(e,t){return Ll.t(`common:${e}`,{lng:t})}function zl(e){return(e||``).replace(/<[^>]+>/g,` `).replace(/\s+/g,` `).trim()}function Bl(e,t){let n=(e.imageAlt??``).trim();return(e.imageUrl??``).trim()&&n?n:zl(e.label??``)||$(`tileFallbackName`,t)}function Vl(e,t,n,r){let i=[Bl(e,r),t===null?$(`tileNotPlaced`,r):$(`tileInRegion`,r,{region:t})];return n===`correct`&&i.push($(`tileCorrect`,r)),n===`incorrect`&&i.push($(`tileIncorrect`,r)),i.join(`, `)}var Hl=br(`<img alt="" class="tile-img svelte-1hgaksk" aria-hidden="true" draggable="false"/>`),Ul=br(`<span></span>`),Wl=br(`<span class="venn-badge venn-badge-correct svelte-1hgaksk" aria-hidden="true"><svg viewBox="0 0 24 24" width="14" height="14" fill="currentColor"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"></path></svg></span>`),Gl=br(`<span class="venn-badge venn-badge-incorrect svelte-1hgaksk" aria-hidden="true"><svg viewBox="0 0 24 24" width="14" height="14" fill="currentColor"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path></svg></span>`),Kl=br(`<button type="button"><span><!> <!></span> <!></button>`),ql={hash:`svelte-1hgaksk`,code:`.venn-tile.svelte-1hgaksk {position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:64px;min-height:44px;padding:8px 14px;border:1.5px solid var(--pie-border-dark, #334155);border-radius:10px;background:var(--pie-background, #ffffff);color:var(--pie-text, #0f172a);font-size:14px;font-weight:500;box-shadow:0 1px 2px rgba(15, 23, 42, 0.06);cursor:grab;touch-action:none;user-select:none;transition:box-shadow 120ms ease, transform 120ms ease, background 120ms ease;}.venn-tile.svelte-1hgaksk:focus-visible,
40
+ `;function Hs(e=document){if(e.getElementById(`PIE-MJX-explorer-styles`))return;let t=e.createElement(`style`);t.id=Fs,t.textContent=Vs,e.head.appendChild(t)}var Us=Symbol.for(`@pie-element/shared-math-rendering-mathjax/speech-worker-failed`);function Ws(){let e=globalThis;e[Us]||(e[Us]=!0,console.warn(`[math-rendering] MathJax's speech worker did not start, so speech, braille and the explorer are off. A content security policy must allow blob: workers, and scripts and fetches from the asset root. See ${_o}`))}function Gs(e){let t=e.webworker;if(!t||t.ready)return;e.options??={};let n=e.options;n.enableSpeech=!1,n.enableBraille=!1,n.speechError=()=>{},t.Post=()=>Promise.reject(Error(`The speech worker did not start`)),t.Terminate(),Ws()}function Ks(e){let t=e?.adaptor,n=t?.createWorker;!e||!t||!n||(t.createWorker=async(r,i)=>{let a=await n.call(t,r,i);return a.addEventListener(`error`,()=>Gs(e),{once:!0}),a})}`${bo}`;var qs={parallelogram:`\\lower.2em{\\Huge\\unicode{x25B1}}`,overarc:`\\overparen`,napprox:`\\not\\approx`,longdiv:`\\enclose{longdiv}`,abs:[`\\left|#1\\right|`,1]},Js=`[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)`,Ys=/\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/,Xs=/\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/,Zs=/\\embed\{newLine\}\[\]/g,Qs=[[`$$`,`$$`],[`$`,`$`],[`\\[`,`\\]`],[`\\(`,`\\)`]],$s=Symbol.for(`@pie-element/shared-math-rendering-mathjax/loading`),ec=`MJX-CHTML-styles`,tc=`PIE-MJX-SVG-styles`,nc=`PIE-MathJax-Menu-Settings`,rc={'mjx-container[overflow="linebreak"][display]':{overflow:`auto clip`,"min-width":`initial !important`}},ic=200,ac=201;function oc(e){let t=[...e.matches(`mjx-container`)?[e]:[],...e.querySelectorAll(`mjx-container`)];for(let e of t)for(let t of[e,...e.querySelectorAll(`[data-latex],[data-latex-item]`)])t.removeAttribute(`data-latex`),t.removeAttribute(`data-latex-item`)}function sc(e){for(let[t,n]of Qs)if(e.startsWith(t)&&e.endsWith(n))return e.substring(t.length,e.length-n.length);return e}function cc(e){return sc(e.includes(`\\displaystyle`)?e.replace(`\\displaystyle`,``).trim():e)}var lc=`mathjax_ignore`,uc=`mathjax_process`;function dc(e,t){let n=e.closest(`.${lc}, .${uc}`);return n!==null&&t.contains(n)&&!n.classList.contains(uc)}function fc(e){for(let t of e.querySelectorAll(`[data-latex]`)){if(t.dataset.mathHandled||t.closest(`mjx-container`)||dc(t,e))continue;let n=t.textContent;n&&(t.textContent=`\\(${cc(n)}\\)`.replace(Zs,`\\newline `),t.dataset.mathHandled=`true`)}}function pc(e){for(let t of e.querySelectorAll(`math`))t.closest(`mjx-container`)||t.setAttribute(`displaystyle`,`true`)}function mc(e,t){for(let t of e.querySelectorAll(`math`))if(!t.closest(`mjx-assistive-mml`))return!0;return(t?Xs:Ys).test(e.textContent??``)}function hc(e){return new Promise((t,n)=>{let{useSingleDollar:r=!1,accessibility:i=!0,loadFonts:a=!0,srcUrl:o}=e,s=Do(e,{}.url),c={loader:{load:i?[`a11y/assistive-mml`]:[],failed:e=>n(e),"output/svg":{ready:e=>{let t=Ro();return gc(t)&&_c(t),e}}},startup:{typeset:!1,ready:()=>{let e=Ro(),r=e?.startup,i=gc(e);i&&(_c(e),vc(e,s.speechLocales),Oo(e?._?.a11y?.sre_ts?.locales,s.speechLocales)),r?.defaultReady?.(),i&&(yc(r?.document),r?.document?.addStyles?.(rc),Ks(r?.document)),Promise.resolve(r?.promise).then(()=>t(),n)}},tex:{macros:{...qs}},output:{displayOverflow:`linebreak`},options:{enableMenu:i,menuOptions:{settings:{assistiveMml:i,enrich:!1,inTabOrder:!1}},a11y:{inTabOrder:!1}}};r&&c.tex&&(console.warn(Js),c.tex.inlineMath=[[`$`,`$`],[`\\(`,`\\)`]],c.tex.processEscapes=!0),a||(c.chtml={fontURL:``});let l=ko(s.speechLocales);l&&c.options&&(c.options.sre={locale:l}),Bo(c,{...s,srcUrl:o}).then(e=>{e||t()},n)})}function gc(e){return!!e?.version?.startsWith(`4.`)}function _c(e){let t=e?._?.output,n=t?.chtml_ts?.CHTML;n&&(n.STYLESHEETID=Ho);let r=t?.svg_ts?.SVG;r&&(r.STYLESHEETID=tc)}function vc(e,t){let n=e?._?.ui?.menu?.Menu?.Menu;if(n){n.MENU_STORAGE=nc;try{let e=localStorage.getItem(nc);if(!e)return;let{assistiveMml:n,locale:r,...i}=JSON.parse(e),a=r===void 0||!t||t.has(r);if(n===void 0&&a)return;a&&r!==void 0&&(i.locale=r),Object.keys(i).length?localStorage.setItem(nc,JSON.stringify(i)):localStorage.removeItem(nc)}catch{}}}function yc(e){if(!e)return;let t=new WeakSet,n=e=>{let n=e.typesetRoot;!n||t.has(n)||(oc(n),t.add(n))};e.addRenderAction?.(`pie-strip-latex`,ac,e=>{for(let t of e.math??[])n(t);return!1},e=>{let t=e.typesetRoot;return t&&oc(t),!1});let r=e.outputJax?.chtmlStyles;r?.id===ec&&(r.id=Ho),Sc()}function bc(e){return e instanceof HTMLStyleElement&&Uo.includes(e.id)}function xc(e){Io(`foreign-output-stylesheet`,`another MathJax added <style id="${e.id}"> to <head>`)}function Sc(){let e=document.head,t=[...e.children].find(bc);if(t){xc(t);return}let n=new MutationObserver(e=>{for(let t of e){let e=[...t.addedNodes].find(bc);if(e){xc(e),n.disconnect();return}}});n.observe(e,{childList:!0})}function Cc(e){let t=e?.math;if(!t?.remove)return;let n=[...t].filter(e=>(e.state?.()??0)>=ic&&e.typesetRoot?.isConnected===!1);if(n.length!==0){for(let e of[...n].reverse())e.clear?.();t.remove(...n)}}function wc(e){return new Promise((t,n)=>{let r=e.startup??{};e.startup=r;let i=r.ready;r.ready=()=>{let e=Ro()?.startup;i?i.call(r):e?.defaultReady?.(),Promise.resolve(e?.promise).then(()=>t(),n)}})}function Tc(e){let t=Ro();return t?t.version?t.startup?.promise?Promise.resolve(t.startup.promise).then(()=>void 0):Promise.resolve():wc(t):hc(e)}function Ec(e){return Tc(e).then(()=>{let e=Ro();e&&typeof e.typesetPromise!=`function`&&console.warn(`[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.`)})}function Dc(e){let t=Vo,n=t[$s];return n||(n=Ec(e),t[$s]=n),n}function Oc(e={}){let t=e.useSingleDollar??!1;return async n=>{if(typeof window>`u`)return;let r=Wo();r&&Io(`mathjax-3-global`,`window.MathJax is MathJax ${r}`),fc(n),Jo(n),pc(n),Ps(n);let i=Dc(e);if(!mc(n,t)){i.catch(()=>{});return}await i;let a=Ro();if(await a?.startup?.promise,typeof a?.typesetPromise==`function`){Hs(),Cc(a.startup?.document);try{await a.typesetPromise([n])}catch(e){throw a.typesetClear?.([n]),e}oc(n)}}}var kc=`@pie-lib/math-rendering`,Ac=`@pie-lib/math-rendering@2`,jc=`pie-print`,Mc=50,Nc=1e4,Pc=null;function Fc(){return!!window[Ac]?.opts?.useSingleDollar}function Ic(){return Pc||=Oc({useSingleDollar:Fc()}),Pc}function Lc(){if(typeof window>`u`)return null;let e=window[kc];return typeof e?.renderMath==`function`&&e.renderMath!==Vc?e:null}function Rc(e){let t=e;for(;t;){if(t instanceof Element&&t.localName===jc)return t;t=t instanceof ShadowRoot?t.host:t.parentNode}return null}function zc(){let e=window.renderMath;return typeof e==`function`?e:null}async function Bc(e){let t=Rc(e);if(!t)return null;let n=zc();if(n||t.mathRenderingModuleUrlImported!==!0)return n;let r=Date.now()+Nc;for(;Date.now()<r;){await new Promise(e=>setTimeout(e,Mc));let e=zc();if(e)return e}return null}var Vc=async e=>{if(typeof window>`u`)return;let t=typeof e==`string`,n;t?(n=document.createElement(`div`),n.innerHTML=e):n=e||document.body;let r=Lc(),i=r||t?null:await Bc(n);return r?await r.renderMath?.(n):i&&i!==Vc?await i(n):await Ic()(n),t?n.innerHTML:void 0},Hc={translation:{categorize:{limitMaxChoicesPerCategory:`You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.`,maxChoicesPerCategoryRestriction:`To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s].`},dragInTheBlank:{blank:`Blank {{index}}`},ebsr:{part:`Part {{index}}`,twoPartQuestion:`Two-Part Question`},editableHtml:{responseAreaToolbar:`Response area`,toolbar:`Editing tools`,buttons:{insertTable:`Insert table`,addTableRow:`Add table row`,removeTableRow:`Remove table row`,addTableColumn:`Add table column`,removeTableColumn:`Remove table column`,removeTable:`Remove table`,tableBorders:`Table borders`,bold:`Bold`,italic:`Italic`,strikethrough:`Strikethrough`,code:`Code`,underline:`Underline`,subscript:`Subscript`,superscript:`Superscript`,insertImage:`Insert image`,insertVideo:`Insert video`,insertAudio:`Insert audio`,cssClasses:`CSS classes`,blockquote:`Blockquote`,heading:`Heading`,insertMath:`Insert math`,spanishCharacters:`Spanish characters (ñ)`,specialCharacters:`Special characters (€)`,textAlignment:`Text alignment`,bulletedList:`Bulleted list`,numberedList:`Numbered list`,done:`Done`}},explicitConstructedResponse:{fillInTheBlankQuestion:`Fill in the Blank Question`,response:`Response {{index}} of {{total}}`},extendedTextEntry:{comment:`Comment`,constructedResponseQuestion:`Constructed Response Question`,response:`Your response`,writtenResponseQuestion:`Written Response Question`},fractionModel:{modelLabel_one:`Model {{index}} of {{total}}: {{selected}} of {{count}} part selected`,modelLabel_other:`Model {{index}} of {{total}}: {{selected}} of {{count}} parts selected`},numberLine:{addElementLimit_one:`You can only add {{count}} element`,addElementLimit_other:`You can only add {{count}} elements`,clearAll:`Clear all`,closedEnd:`closed`,elementCorrect:`Correct.`,elementIncorrect:`Incorrect.`,graphLabel:`Number line from {{min}} to {{max}}, with a tick every {{interval}}`,line:`Line from {{left}} ({{leftEnd}}) to {{right}} ({{rightEnd}}).`,openEnd:`open`,plottedNone:`Nothing is plotted.`,pointClosed:`Closed point at {{position}}.`,pointOpen:`Open point at {{position}}.`,rayLeft:`Ray from {{position}} ({{end}}) to the left.`,rayRight:`Ray from {{position}} ({{end}}) to the right.`},hotspot:{correctlySelected:`Correctly selected`,image_one:`Image with {{count}} hotspot`,image_other:`Image with {{count}} hotspots`,shape:`Hotspot {{index}} of {{total}}`,shouldHaveBeenSelected:`Should have been selected`,shouldNotHaveBeenSelected:`Should not have been selected`},imageClozeAssociation:{answerChoice:`Answer choice {{index}} of {{total}}`,image_one:`Image with {{count}} response area`,image_other:`Image with {{count}} response areas`,reachedLimit_one:`You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.`,reachedLimit_other:`Full`,responseArea:`Response area {{index}} of {{total}}`},inlineDropdown:{inlineDropdownQuestion:`Inline Dropdown Question`,query:`Query`,queryNumber:`Query {{index}}`,showRationaleForChoices:`Show Rationale for choices`,hideRationaleForChoices:`Hide Rationale for choices`},drawingResponse:{fillColor:`Fill color`,outlineColor:`Outline color`,noFill:`No fill`,lightblue:`Light blue`,lightyellow:`Light yellow`,red:`Red`,orange:`Orange`,yellow:`Yellow`,violet:`Violet`,blue:`Blue`,green:`Green`,white:`White`,black:`Black`,onDoubleClick:`Double click to edit this text. Press Enter to submit.`,drawingArea:`Drawing area`,drawingAreaOverImage:`Drawing area over a background image`,tools:{select:`Select`,freeDraw:`Free Draw`,line:`Line`,rectangle:`Rectangle`,circle:`Circle`,textEntry:`Text Entry`,eraser:`Eraser`}},charting:{addCategory:`Add category`,actions:`Actions`,add:`Add`,delete:`Delete`,newLabel:`New label`,categoryLabel:`Category {{index}} label`,categoryLabelValue:`Category {{index}} label: {{label}}`,category:`Category {{index}}`,reachedLimit_other:`There can't be more than {{count}} categories.`,keyLegend:{incorrectAnswer:`Student incorrect answer`,correctAnswer:`Student correct answer`,correctKeyAnswer:`Answer key correct`},chartTypes:{bar:`Bar chart`,histogram:`Histogram`,lineDot:`Line chart with dots`,lineCross:`Line chart with crosses`,dotPlot:`Dot plot`,linePlot:`Line plot`},categories_zero:`No categories.`,categories_one:`{{count}} category: {{categories}}.`,categories_other:`{{count}} categories: {{categories}}.`,valueRange:`Values from {{min}} to {{max}}.`,labelledValueRange:`{{label}} from {{min}} to {{max}}.`},graphing:{graph:`Coordinate graph`,axisRange:`{{axis}} axis from {{min}} to {{max}}.`,plotted_zero:`Nothing plotted.`,plotted_one:`{{count}} object plotted: {{marks}}.`,plotted_other:`{{count}} objects plotted: {{marks}}.`,shadedRegion:`Shaded region`,point:`Point`,circle:`Circle`,line:`Line`,parabola:`Parabola`,absolute:`Absolute Value`,exponential:`Exponential`,polygon:`Polygon`,ray:`Ray`,segment:`Segment`,sine:`Sine`,vector:`Vector`,label:`Label`,markLabel:`Label at ({{x}}, {{y}})`,correctMarkLabel:`Correct label at ({{x}}, {{y}})`,redo:`Redo`,reset:`Reset`,keyLegend:{missingRequiredLabel:`Missing Required Label`,answerKeyCorrect:`Answer Key Correct`,answerKeyCorrectLabel:`Answer Key Correct Label`,studentIncorrect:`Student Incorrect`,incorrectStudentLabel:`Incorrect Student Label`,studentCorrect:`Student Correct`,studentCorrectLabel:`Student Correct Label`}},mathInline:{keypadInstructions:`This field supports both keypad and keyboard input. Use the keyboard to access and interact with the on-screen math keypad, which accepts LaTeX markup. Use the down arrow key to open the keypad and navigate its buttons. Use the escape key to close the keypad and return to the input field.`,mathEquationResponseQuestion:`Math Equation Response Question`,mathResponseQuestion:`Math Response Question`,primaryCorrectWithAlternates:`Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct.`},mathInput:{enterAnswer:`Enter answer`},mcPopulatedBlank:{answerChoices:`Answer choices`,blankLabel:`blank`,emptyBlank:`(blank)`,blankPreSelectionHint:`The answer you choose will appear on the blank line above.`,correctAnswerSelected:`Correct answer selected`,incorrectAnswerSelected:`Incorrect answer selected`,selectedAnswerImage:`Selected answer image`,choiceImage:`Choice {{id}}`,clickToEnableAutoplay:`Click to enable audio autoplay`,audioResourceUnavailable:`Audio is enabled but no playable audio URL is configured.`,listen:`Listen`,listenSilentAlt:`Repeat instructions`,listenPlayingAlt:`Instructions are playing`,printAudio:`Audio:`,printTranscript:`Transcript:`},multipleChoice:{minSelections:`Select at least {{minSelections}}.`,maxSelections_one:`Only {{maxSelections}} answer is allowed.`,maxSelections_other:`Only {{maxSelections}} answers are allowed.`,minmaxSelections_equal:`Select {{minSelections}}.`,minmaxSelections_range:`Select between {{minSelections}} and {{maxSelections}}.`,multipleChoiceQuestion:`Multiple Choice Question`,multipleCorrectAnswerQuestion:`Multiple Correct Answer Question`,multipleSelectQuestion:`Multiple Select Question`},rubric:{rubric:`Rubric`,showRubric:`Show Rubric`,hideRubric:`Hide Rubric`},selectText:{correctAnswerSelected:`Correct`,correctAnswerNotSelected:`Correct Answer Not Selected`,incorrectSelection:`Incorrect Selection`,key:`Key`,textGroup:`Selectable text`,textGroupWithLimit:`Selectable text, select up to {{max}}`,tokenPosition:`{{index}} of {{total}}`},simpleCloze:{correctAnswerShown:`Correct answer`,correct:`Correct`,incorrect:`Incorrect`,unanswered:`No answer`,placeholder:`Enter your answer...`,answerInput:`Your answer`,printCorrectAnswer:`Correct answer:`,printAnswerBlank:`Answer blank`},vennClassification:{tray:`Tiles to classify`,unknownTarget:`unknown`,cancelled:`Cancelled`,returnedToTray:`{{name}} returned to tray`,placedIn:`{{name}} placed in {{target}}`,pickedUp:`Picked up {{name}}`,pickedUpWithKeyboard:`Picked up {{name}}, drop target: {{target}}. Use arrow keys to choose a drop target, Enter to drop, Escape to cancel.`,dropTarget:`Drop target: {{target}}`,unsupportedCircles_one:`This diagram cannot be shown: it has {{count}} circle, and only {{supported}} are supported.`,unsupportedCircles_other:`This diagram cannot be shown: it has {{count}} circles, and only {{supported}} are supported.`,setNumber:`Set {{number}}`,regionOnly:`{{set}} only`,regionNeither:`Neither {{first}} nor {{second}}`,regionNoneOf:`None of {{sets}}`,regionAndSeparator:` and `,tileFallbackName:`Tile`,tileNotPlaced:`not placed`,tileInRegion:`in {{region}}`,tileCorrect:`correct`,tileIncorrect:`incorrect`}},common:{undo:`Undo`,clearAll:`Clear all`,correct:`Correct`,incorrect:`Incorrect`,showCorrectAnswer:`Show correct answer`,hideCorrectAnswer:`Hide correct answer`,showTeacherInstructions:`Show Teacher Instructions`,hideTeacherInstructions:`Hide Teacher Instructions`,show:`Show`,hide:`Hide`,showRationale:`Show Rationale`,hideRationale:`Hide Rationale`,commonCorrectAnswerWithAlternates:`Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.`,warning:`Warning`,showNote:`Show Note`,hideNote:`Hide Note`,cancel:`Cancel`,playAudio:`Play audio`}},Uc={translation:{categorize:{limitMaxChoicesPerCategory:`Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.`,maxChoicesPerCategoryRestriction:`Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta`},dragInTheBlank:{blank:`Espacio en blanco {{index}}`},ebsr:{part:`Parte {{index}}`,twoPartQuestion:`Pregunta de dos partes`},editableHtml:{responseAreaToolbar:`Área de respuesta`,toolbar:`Herramientas de edición`,buttons:{insertTable:`Insertar tabla`,addTableRow:`Agregar fila a la tabla`,removeTableRow:`Eliminar fila de la tabla`,addTableColumn:`Agregar columna a la tabla`,removeTableColumn:`Eliminar columna de la tabla`,removeTable:`Eliminar tabla`,tableBorders:`Bordes de la tabla`,bold:`Negrita`,italic:`Cursiva`,strikethrough:`Tachado`,code:`Código`,underline:`Subrayado`,subscript:`Subíndice`,superscript:`Superíndice`,insertImage:`Insertar imagen`,insertVideo:`Insertar video`,insertAudio:`Insertar audio`,cssClasses:`Clases CSS`,blockquote:`Cita en bloque`,heading:`Encabezado`,insertMath:`Insertar expresión matemática`,spanishCharacters:`Caracteres del español (ñ)`,specialCharacters:`Caracteres especiales (€)`,textAlignment:`Alineación del texto`,bulletedList:`Lista con viñetas`,numberedList:`Lista numerada`,done:`Listo`}},explicitConstructedResponse:{fillInTheBlankQuestion:`Pregunta para completar espacios en blanco`,response:`Respuesta {{index}} de {{total}}`},extendedTextEntry:{comment:`Comentario`,constructedResponseQuestion:`Pregunta de respuesta construida`,response:`Tu respuesta`,writtenResponseQuestion:`Pregunta de respuesta escrita`},fractionModel:{modelLabel_one:`Modelo {{index}} de {{total}}: {{selected}} de {{count}} parte seleccionada`,modelLabel_other:`Modelo {{index}} de {{total}}: {{selected}} de {{count}} partes seleccionadas`},numberLine:{addElementLimit_one:`Solo puedes agregar {{count}} elemento`,addElementLimit_other:`Solo puedes agregar {{count}} elementos`,clearAll:`Borrar todo`,closedEnd:`cerrado`,elementCorrect:`Correcto.`,elementIncorrect:`Incorrecto.`,graphLabel:`Recta numérica de {{min}} a {{max}}, con una marca cada {{interval}}`,line:`Línea de {{left}} ({{leftEnd}}) a {{right}} ({{rightEnd}}).`,openEnd:`abierto`,plottedNone:`No hay nada marcado en la recta.`,pointClosed:`Punto cerrado en {{position}}.`,pointOpen:`Punto abierto en {{position}}.`,rayLeft:`Rayo desde {{position}} ({{end}}) hacia la izquierda.`,rayRight:`Rayo desde {{position}} ({{end}}) hacia la derecha.`},hotspot:{correctlySelected:`Seleccionada correctamente`,image_one:`Imagen con {{count}} zona activa`,image_other:`Imagen con {{count}} zonas activas`,shape:`Zona activa {{index}} de {{total}}`,shouldHaveBeenSelected:`Debía seleccionarse`,shouldNotHaveBeenSelected:`No debía seleccionarse`},imageClozeAssociation:{answerChoice:`Opción de respuesta {{index}} de {{total}}`,image_one:`Imagen con {{count}} área de respuesta`,image_other:`Imagen con {{count}} áreas de respuesta`,reachedLimit_one:`Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.`,reachedLimit_other:`Lleno`,responseArea:`Área de respuesta {{index}} de {{total}}`},inlineDropdown:{inlineDropdownQuestion:`Pregunta con menú desplegable`,query:`Consulta`,queryNumber:`Consulta {{index}}`,showRationaleForChoices:`Mostrar justificación de las opciones`,hideRationaleForChoices:`Ocultar justificación de las opciones`},drawingResponse:{fillColor:`Color de relleno`,outlineColor:`Color del contorno`,noFill:`Sin relleno`,lightblue:`Azul claro`,lightyellow:`Amarillo claro`,red:`Rojo`,orange:`Naranja`,yellow:`Amarillo`,violet:`Violeta`,blue:`Azul`,green:`Verde`,white:`Blanco`,black:`Negro`,onDoubleClick:`Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar`,drawingArea:`Área de dibujo`,drawingAreaOverImage:`Área de dibujo sobre una imagen de fondo`,tools:{select:`Seleccionar`,freeDraw:`Dibujo libre`,line:`Línea`,rectangle:`Rectángulo`,circle:`Círculo`,textEntry:`Entrada de texto`,eraser:`Borrador`}},charting:{addCategory:`Añadir categoría`,actions:`Acciones`,add:`Añadir`,delete:`Eliminar`,newLabel:`Nueva etiqueta`,categoryLabel:`Etiqueta de la categoría {{index}}`,categoryLabelValue:`Etiqueta de la categoría {{index}}: {{label}}`,category:`Categoría {{index}}`,reachedLimit_other:`No puede haber más de {{count}} categorías.`,keyLegend:{incorrectAnswer:`Respuesta incorrecta del estudiante`,correctAnswer:`Respuesta correcta del estudiante`,correctKeyAnswer:`Clave de respuesta correcta`},chartTypes:{bar:`Gráfico de barras`,histogram:`Histograma`,lineDot:`Gráfico de líneas con puntos`,lineCross:`Gráfico de líneas con cruces`,dotPlot:`Diagrama de puntos`,linePlot:`Diagrama de líneas`},categories_zero:`Sin categorías.`,categories_one:`{{count}} categoría: {{categories}}.`,categories_other:`{{count}} categorías: {{categories}}.`,valueRange:`Valores de {{min}} a {{max}}.`,labelledValueRange:`{{label}} de {{min}} a {{max}}.`},graphing:{graph:`Gráfica de coordenadas`,axisRange:`Eje {{axis}} de {{min}} a {{max}}.`,plotted_zero:`Nada trazado.`,plotted_one:`{{count}} objeto trazado: {{marks}}.`,plotted_other:`{{count}} objetos trazados: {{marks}}.`,shadedRegion:`Región sombreada`,point:`Punto`,circle:`Circulo`,line:`Línea`,parabola:`Parábola`,absolute:`Valor absoluto`,exponential:`Exponencial`,polygon:`Polígono`,ray:`Semirrecta`,segment:`Segmento `,sine:`Seno`,vector:`Vector`,label:`Etiqueta`,markLabel:`Etiqueta en ({{x}}, {{y}})`,correctMarkLabel:`Etiqueta correcta en ({{x}}, {{y}})`,redo:`Rehacer`,reset:`Reiniciar`,keyLegend:{missingRequiredLabel:`Falta una etiqueta obligatoria`,answerKeyCorrect:`Clave de respuesta correcta`,answerKeyCorrectLabel:`Etiqueta correcta de la clave de respuesta`,studentIncorrect:`Respuesta incorrecta del estudiante`,incorrectStudentLabel:`Etiqueta incorrecta del estudiante`,studentCorrect:`Respuesta correcta del estudiante`,studentCorrectLabel:`Etiqueta correcta del estudiante`}},mathInline:{keypadInstructions:`Este campo admite la entrada con el teclado en pantalla y con el teclado físico. Usa el teclado físico para acceder al teclado matemático en pantalla e interactuar con él; este acepta notación LaTeX. Usa la tecla de flecha hacia abajo para abrir el teclado en pantalla y recorrer sus botones. Usa la tecla Escape para cerrar el teclado en pantalla y volver al campo de entrada.`,mathEquationResponseQuestion:`Pregunta de respuesta con ecuación matemática`,mathResponseQuestion:`Pregunta de respuesta matemática`,primaryCorrectWithAlternates:`Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas.`},mathInput:{enterAnswer:`Escribe la respuesta`},mcPopulatedBlank:{answerChoices:`Opciones de respuesta`,blankLabel:`espacio en blanco`,emptyBlank:`(en blanco)`,blankPreSelectionHint:`La respuesta que elijas aparecerá en la línea en blanco de arriba.`,correctAnswerSelected:`Respuesta correcta seleccionada`,incorrectAnswerSelected:`Respuesta incorrecta seleccionada`,selectedAnswerImage:`Imagen de la respuesta seleccionada`,choiceImage:`Opción {{id}}`,clickToEnableAutoplay:`Haz clic para activar la reproducción automática del audio`,audioResourceUnavailable:`El audio está activado, pero no hay una URL de audio reproducible configurada.`,listen:`Escuchar`,listenSilentAlt:`Escuchar. Repetir las instrucciones.`,listenPlayingAlt:`Escuchar. Estas son las instrucciones.`,printAudio:`Audio:`,printTranscript:`Transcripción:`},multipleChoice:{minSelections:`Seleccione al menos {{minSelections}}.`,maxSelections_one:`Sólo se permite {{maxSelections}} respuesta.`,maxSelections_other:`Sólo se permiten {{maxSelections}} respuestas.`,minmaxSelections_equal:`Seleccione {{minSelections}}.`,minmaxSelections_range:`Seleccione entre {{minSelections}} y {{maxSelections}}.`,multipleChoiceQuestion:`Pregunta de opción múltiple`,multipleCorrectAnswerQuestion:`Pregunta con varias respuestas correctas`,multipleSelectQuestion:`Pregunta de selección múltiple`},rubric:{rubric:`Rúbrica`,showRubric:`Mostrar rúbrica`,hideRubric:`Ocultar rúbrica`},selectText:{correctAnswerSelected:`Respuesta Correcta`,correctAnswerNotSelected:`Respuesta Correcta No Seleccionada`,incorrectSelection:`Selección Incorrecta`,key:`Clave`,textGroup:`Texto seleccionable`,textGroupWithLimit:`Texto seleccionable, selecciona hasta {{max}}`,tokenPosition:`{{index}} de {{total}}`},simpleCloze:{correctAnswerShown:`Respuesta correcta`,correct:`Correcto`,incorrect:`Incorrecto`,unanswered:`Sin respuesta`,placeholder:`Escribe tu respuesta...`,answerInput:`Tu respuesta`,printCorrectAnswer:`Respuesta correcta:`,printAnswerBlank:`Espacio para la respuesta`},vennClassification:{tray:`Fichas para clasificar`,unknownTarget:`desconocido`,cancelled:`Cancelado`,returnedToTray:`Se devolvió {{name}} a la bandeja`,placedIn:`Se colocó {{name}} en {{target}}`,pickedUp:`Se tomó {{name}}`,pickedUpWithKeyboard:`Se tomó {{name}}, destino: {{target}}. Usa las flechas para elegir un destino, Enter para soltar y Escape para cancelar.`,dropTarget:`Destino: {{target}}`,unsupportedCircles_one:`No se puede mostrar este diagrama: tiene {{count}} círculo, y solo se admiten {{supported}}.`,unsupportedCircles_other:`No se puede mostrar este diagrama: tiene {{count}} círculos, y solo se admiten {{supported}}.`,setNumber:`Conjunto {{number}}`,regionOnly:`Solo {{set}}`,regionNeither:`Ni {{first}} ni {{second}}`,regionNoneOf:`Ninguno de {{sets}}`,regionAndSeparator:` y `,tileFallbackName:`Ficha`,tileNotPlaced:`sin colocar`,tileInRegion:`en {{region}}`,tileCorrect:`correcta`,tileIncorrect:`incorrecta`}},common:{undo:`Deshacer`,clearAll:`Borrar todo`,correct:`Correcto`,incorrect:`Incorrecto`,showCorrectAnswer:`Mostrar respuesta correcta`,hideCorrectAnswer:`Ocultar respuesta correcta`,showTeacherInstructions:`Mostrar instrucciones para el maestro`,hideTeacherInstructions:`Ocultar instrucciones para el maestro`,show:`Mostrar`,hide:`Ocultar`,showRationale:`Mostrar justificación`,hideRationale:`Ocultar justificación`,commonCorrectAnswerWithAlternates:`Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.`,warning:`Advertencia`,showNote:`Mostrar Nota`,hideNote:`Ocultar Nota`,cancel:`Cancelar`,playAudio:`Reproducir audio`}},Q=e=>typeof e==`string`,Wc=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Gc=e=>e==null?``:``+e,Kc=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},qc=/###/g,Jc=e=>e&&e.indexOf(`###`)>-1?e.replace(qc,`.`):e,Yc=e=>!e||Q(e),Xc=(e,t,n)=>{let r=Q(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(Yc(e))return{};let t=Jc(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Yc(e)?{}:{obj:e,k:Jc(r[i])}},Zc=(e,t,n)=>{let{obj:r,k:i}=Xc(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=Xc(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=Xc(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Qc=(e,t,n,r)=>{let{obj:i,k:a}=Xc(e,t,Object);i[a]=i[a]||[],i[a].push(n)},$c=(e,t)=>{let{obj:n,k:r}=Xc(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},el=(e,t,n)=>{let r=$c(e,n);return r===void 0?$c(t,n):r},tl=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?Q(e[r])||e[r]instanceof String||Q(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):tl(e[r],t[r],n):e[r]=t[r]);return e},nl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),rl={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},il=e=>Q(e)?e.replace(/[&<>"'\/]/g,e=>rl[e]):e,al=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},ol=[` `,`,`,`?`,`!`,`;`],sl=new al(20),cl=(e,t,n)=>{t||=``,n||=``;let r=ol.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=sl.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},ll=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},ul=e=>e?.replace(/_/g,`-`),dl={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},fl=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||dl,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(Q(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},pl=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}},ml=class extends pl{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):Q(n)&&i?o.push(...n.split(i)):o.push(n)));let s=$c(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!Q(n)?s:ll(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),Zc(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(Q(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=$c(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?tl(s,n,i):s={...s,...n},Zc(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},hl={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},gl=Symbol(`i18next/PATH_KEY`);function _l(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===gl?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function vl(e,t){let{[gl]:n}=e(_l()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var yl={},bl=e=>!Q(e)&&typeof e!=`boolean`&&typeof e!=`number`,xl=class e extends pl{constructor(e,t={}){super(),Kc([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=fl.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=bl(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!cl(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Q(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:Q(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=vl(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?vl(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!Q(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let ee=bl(E),te=Object.prototype.toString.apply(E);if(y&&E&&ee&&_.indexOf(te)<0&&!(Q(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:bl(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&Q(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=Q(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!Q(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=Q(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=hl.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return Q(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?vl(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!Q(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(Q(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!yl[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(yl[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!Q(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},Sl=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=fl.create(`languageUtils`)}getScriptPartFromCode(e){if(e=ul(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=ul(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Q(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),Q(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Q(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):Q(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},Cl={zero:0,one:1,two:2,few:3,many:4,other:5},wl={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},Tl=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=fl.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=ul(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),wl;if(!e.match(/-|_/))return wl;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>Cl[e]-Cl[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},El=(e,t,n,r=`.`,i=!0)=>{let a=el(e,t,n);return!a&&i&&Q(n)&&(a=ll(e,n,r),a===void 0&&(a=ll(t,n,r))),a},Dl=e=>e.replace(/\$/g,`$$$$`),Ol=class{constructor(e={}){this.logger=fl.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?il:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?nl(i):a||`{{`,this.suffix=o?nl(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?nl(d):f||nl(`$t(`),this.nestingSuffix=p?nl(p):m||nl(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=El(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(El(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Dl(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Dl(this.escape(e)):Dl(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=Q(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else!Q(a)&&!this.useRawValueToEscape&&(a=Gc(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${nl(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!Q(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!Q(i))return i;Q(i)||(i=Gc(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},kl=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},Al=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(ul(r),i),t[o]=s),s(n)}},jl=e=>(t,n,r)=>e(ul(n),r)(t),Ml=class{constructor(e={}){this.logger=fl.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?Al:jl;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Al(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=kl(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},Nl=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Pl=class extends pl{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=fl.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{Qc(n.loaded,[i],a),Nl(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();Q(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Q(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},Fl=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,simplifyPluralSuffix:!0,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),Q(e[1])&&(t.defaultValue=e[1]),Q(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Il=e=>(Q(e.ns)&&(e.ns=[e.ns]),Q(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Q(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),Ll=()=>{},Rl=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},zl=`__i18next_supportNoticeShown`,Bl=()=>!!(typeof globalThis<`u`&&globalThis[zl]||typeof process<`u`&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`&&process.env&&process.env.NODE_ENV===`production`),Vl=()=>{typeof globalThis<`u`&&(globalThis[zl]=!0)},Hl=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),Ul=class e extends pl{constructor(e={},t){if(super(),this.options=Il(e),this.services={},this.logger=fl,this.modules={external:[]},Rl(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(Q(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=Fl();this.options={...n,...this.options,...Il(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Hl(this)&&!Bl()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),Vl());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?fl.init(r(this.modules.logger),this.options):fl.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Ml;let t=new Sl(this.options);this.store=new ml(this.options.resources,this.options);let i=this.services;i.logger=fl,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new Tl(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new Ol(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Pl(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new xl(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=Ll,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=Wc(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=Ll){let n=t,r=Q(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=Wc();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=Ll,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&hl.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!([`cimode`,`dev`].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!([`cimode`,`dev`].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=Wc();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=Q(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Q(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=vl(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=vl(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=vl(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return Q(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=Wc();return this.options.ns?(Q(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=Wc();Q(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new Sl(Fl());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=Ll){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new ml(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...Fl().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new Ol(n)}return a.translator=new xl(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();Ul.createInstance,Ul.dir,Ul.init,Ul.loadResources,Ul.reloadResources,Ul.use,Ul.changeLanguage,Ul.getFixedT,Ul.t,Ul.exists,Ul.setDefaultNamespace,Ul.hasLoadedNamespace,Ul.loadNamespaces,Ul.loadLanguages,Ul.init({fallbackLng:`en`,lng:`en`,showSupportNotice:!1,resources:{en:Hc,es:Uc}});var{translator:Wl}={translator:{...Ul,t:(e,t)=>{let{lng:n}=t;switch(n){case`en_US`:case`en-US`:t.lng=`en`;break;case`es_ES`:case`es-ES`:case`es_MX`:case`es-MX`:t.lng=`es`;break;default:break}return Ul.t(e,{lng:n,...t})}},languageOptions:[{value:`en_US`,label:`English (US)`},{value:`es_ES`,label:`Spanish`}]};function $(e,t,n={}){return Wl.t(`translation:vennClassification:${e}`,{lng:t,...n,interpolation:{escapeValue:!1}})}function Gl(e,t){return Wl.t(`common:${e}`,{lng:t})}function Kl(e){return(e||``).replace(/<[^>]+>/g,` `).replace(/\s+/g,` `).trim()}function ql(e,t){let n=(e.imageAlt??``).trim();return(e.imageUrl??``).trim()&&n?n:Kl(e.label??``)||$(`tileFallbackName`,t)}function Jl(e,t,n,r){let i=[ql(e,r),t===null?$(`tileNotPlaced`,r):$(`tileInRegion`,r,{region:t})];return n===`correct`&&i.push($(`tileCorrect`,r)),n===`incorrect`&&i.push($(`tileIncorrect`,r)),i.join(`, `)}var Yl=br(`<img alt="" class="tile-img svelte-1hgaksk" aria-hidden="true" draggable="false"/>`),Xl=br(`<span></span>`),Zl=br(`<span class="venn-badge venn-badge-correct svelte-1hgaksk" aria-hidden="true"><svg viewBox="0 0 24 24" width="14" height="14" fill="currentColor"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"></path></svg></span>`),Ql=br(`<span class="venn-badge venn-badge-incorrect svelte-1hgaksk" aria-hidden="true"><svg viewBox="0 0 24 24" width="14" height="14" fill="currentColor"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path></svg></span>`),$l=br(`<button type="button"><span><!> <!></span> <!></button>`),eu={hash:`svelte-1hgaksk`,code:`.venn-tile.svelte-1hgaksk {position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:64px;min-height:44px;padding:8px 14px;border:1.5px solid var(--pie-border-dark, #334155);border-radius:10px;background:var(--pie-background, #ffffff);color:var(--pie-text, #0f172a);font-size:14px;font-weight:500;box-shadow:0 1px 2px rgba(15, 23, 42, 0.06);cursor:grab;touch-action:none;user-select:none;transition:box-shadow 120ms ease, transform 120ms ease, background 120ms ease;}.venn-tile.svelte-1hgaksk:focus-visible,
41
41
  .venn-tile.focused.svelte-1hgaksk {outline:2px solid var(--vc-focus-ring, #1565c0);outline-offset:2px;}.venn-tile.svelte-1hgaksk:hover:not(:disabled) {background:var(--pie-background-dark, #f8fafc);}.venn-tile.held.svelte-1hgaksk {cursor:grabbing;box-shadow:0 6px 18px rgba(15, 23, 42, 0.18);transform:translateY(-1px);background:var(--pie-faded-primary, #eef2ff);}.venn-tile.invisible.svelte-1hgaksk {visibility:hidden;}.venn-tile.ghost.svelte-1hgaksk {pointer-events:none;cursor:grabbing;box-shadow:0 10px 24px rgba(15, 23, 42, 0.22);transform:rotate(-1.5deg);background:var(--pie-background, #ffffff);opacity:0.96;}.venn-tile.correct.svelte-1hgaksk {border-color:var(--pie-correct-tertiary, #0ea449);}.venn-tile.incorrect.svelte-1hgaksk {border-color:var(--pie-incorrect-icon, #bf0d00);}.venn-tile.svelte-1hgaksk:disabled {cursor:default;}.tile-body.svelte-1hgaksk {display:inline-flex;flex-direction:row;align-items:center;justify-content:center;gap:8px;pointer-events:none;max-width:220px;}.tile-body-image.svelte-1hgaksk {flex-direction:column;gap:4px;}.tile-img.svelte-1hgaksk {width:40px;height:40px;object-fit:contain;flex-shrink:0;}.tile-label.svelte-1hgaksk {pointer-events:none;text-align:center;line-height:1.25;word-break:break-word;}.tile-label-below.svelte-1hgaksk {font-size:12px;font-weight:600;}.venn-tile.fit.svelte-1hgaksk {box-sizing:border-box;width:100%;height:100%;min-width:0;min-height:0;padding:6px 10px;}.fit.svelte-1hgaksk .tile-body:where(.svelte-1hgaksk) {max-width:100%;max-height:100%;overflow:hidden;}.fit.svelte-1hgaksk .tile-label:where(.svelte-1hgaksk) {display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;}.fit.svelte-1hgaksk .tile-label-below:where(.svelte-1hgaksk) {-webkit-line-clamp:1;line-clamp:1;}.venn-badge.svelte-1hgaksk {position:absolute;top:-8px;right:-8px;width:20px;height:20px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:var(--pie-background, #ffffff);}.venn-badge-correct.svelte-1hgaksk {background:var(--pie-correct-tertiary, #0ea449);}.venn-badge-incorrect.svelte-1hgaksk {background:var(--pie-incorrect-icon, #bf0d00);}
42
42
  @media (prefers-reduced-motion: reduce) {.venn-tile.svelte-1hgaksk {transition:none;}
43
- }`};function Jl(e,t){Be(t,!0),$r(e,ql);let n=Y(t,`id`,7),r=Y(t,`label`,7),i=Y(t,`imageUrl`,7),a=Y(t,`imageAlt`,7),o=Y(t,`name`,7),s=Y(t,`language`,7),c=Y(t,`correctness`,7,`neutral`),l=Y(t,`held`,7,!1),u=Y(t,`invisible`,7,!1),d=Y(t,`ghost`,7,!1),f=Y(t,`disabled`,7,!1),p=Y(t,`focused`,7,!1),m=Y(t,`fit`,7,!1),h=Y(t,`onpointerdown`,7),g=Y(t,`onkeydown`,7),_=Y(t,`onkeyup`,7),v=Y(t,`onfocus`,7),y=Y(t,`onclick`,7),b=I(()=>o()??Bl({label:r(),imageUrl:i(),imageAlt:a()},s())),x=I(()=>!!(i()??``).trim()),S=I(()=>!!(r()??``).replace(/<[^>]*>/g,``).trim());var C={get id(){return n()},set id(e){n(e),z()},get label(){return r()},set label(e){r(e),z()},get imageUrl(){return i()},set imageUrl(e){i(e),z()},get imageAlt(){return a()},set imageAlt(e){a(e),z()},get name(){return o()},set name(e){o(e),z()},get language(){return s()},set language(e){s(e),z()},get correctness(){return c()},set correctness(e=`neutral`){c(e),z()},get held(){return l()},set held(e=!1){l(e),z()},get invisible(){return u()},set invisible(e=!1){u(e),z()},get ghost(){return d()},set ghost(e=!1){d(e),z()},get disabled(){return f()},set disabled(e=!1){f(e),z()},get focused(){return p()},set focused(e=!1){p(e),z()},get fit(){return m()},set fit(e=!1){m(e),z()},get onpointerdown(){return h()},set onpointerdown(e){h(e),z()},get onkeydown(){return g()},set onkeydown(e){g(e),z()},get onkeyup(){return _()},set onkeyup(e){_(e),z()},get onfocus(){return v()},set onfocus(e){v(e),z()},get onclick(){return y()},set onclick(e){y(e),z()}},w=Kl();let T;var E=Yt(w);let ee;var te=Yt(E),ne=e=>{var t=Hl();U(()=>J(t,`src`,i())),q(e,t)};Vr(te,e=>{K(x)&&e(ne)});var re=H(te,2),ie=e=>{var t=Ul();let n;Qr(t,()=>so(r()),!0),N(t),U(()=>n=ai(t,1,`tile-label svelte-1hgaksk`,null,n,{"tile-label-below":K(x)})),q(e,t)};Vr(re,e=>{K(S)&&e(ie)}),N(E);var D=H(E,2),ae=e=>{q(e,Wl())},oe=e=>{q(e,Gl())};return Vr(D,e=>{c()===`correct`?e(ae):c()===`incorrect`&&e(oe,1)}),N(w),U(()=>{T=ai(w,1,`venn-tile svelte-1hgaksk`,null,T,{held:l(),focused:p(),invisible:u(),ghost:d(),fit:m(),correct:c()===`correct`,incorrect:c()===`incorrect`}),J(w,`data-tile-id`,n()),J(w,`aria-label`,K(b)),J(w,`aria-pressed`,l()),J(w,`aria-hidden`,d()),w.disabled=f(),J(w,`tabindex`,d()||f()?-1:0),ee=ai(E,1,`tile-body svelte-1hgaksk`,null,ee,{"tile-body-image":K(x)})}),dr(`pointerdown`,w,function(...e){h()?.apply(this,e)}),dr(`keydown`,w,function(...e){g()?.apply(this,e)}),dr(`keyup`,w,function(...e){_()?.apply(this,e)}),ur(`focus`,w,function(...e){v()?.apply(this,e)}),dr(`click`,w,function(...e){y()?.apply(this,e)}),q(e,w),Ve(C)}fr([`pointerdown`,`keydown`,`keyup`,`click`]),Ti(Jl,{id:{},label:{},imageUrl:{},imageAlt:{},name:{},language:{},correctness:{},held:{},invisible:{},ghost:{},disabled:{},focused:{},fit:{},onpointerdown:{},onkeydown:{},onkeyup:{},onfocus:{},onclick:{}},[],[],{mode:`open`});var Yl=br(`<div role="region" data-region-key="tray"><div class="tray-label svelte-1ogsh8s"> </div> <div class="tray-items svelte-1ogsh8s"><!></div></div>`),Xl={hash:`svelte-1ogsh8s`,code:`.venn-tray.svelte-1ogsh8s {border:1.5px dashed var(--pie-border-dark, #64748b);border-radius:12px;padding:14px 16px;background:var(--pie-surface, #f8fafc);min-height:120px;transition:background 120ms ease, border-color 120ms ease;}.venn-tray.drop-target.svelte-1ogsh8s {background:var(--pie-faded-primary, #e0f2fe);border-color:var(--pie-tertiary, #0284c7);}.venn-tray.focused.svelte-1ogsh8s {outline:2px solid var(--vc-focus-ring, #1565c0);outline-offset:2px;}.tray-label.svelte-1ogsh8s {font-size:12px;font-weight:600;color:var(--pie-text, #475569);text-transform:uppercase;letter-spacing:0.05em;margin-bottom:8px;}.tray-items.svelte-1ogsh8s {display:flex;flex-wrap:wrap;gap:10px;}
43
+ }`};function tu(e,t){Be(t,!0),$r(e,eu);let n=Y(t,`id`,7),r=Y(t,`label`,7),i=Y(t,`imageUrl`,7),a=Y(t,`imageAlt`,7),o=Y(t,`name`,7),s=Y(t,`language`,7),c=Y(t,`correctness`,7,`neutral`),l=Y(t,`held`,7,!1),u=Y(t,`invisible`,7,!1),d=Y(t,`ghost`,7,!1),f=Y(t,`disabled`,7,!1),p=Y(t,`focused`,7,!1),m=Y(t,`fit`,7,!1),h=Y(t,`onpointerdown`,7),g=Y(t,`onkeydown`,7),_=Y(t,`onkeyup`,7),v=Y(t,`onfocus`,7),y=Y(t,`onclick`,7),b=I(()=>o()??ql({label:r(),imageUrl:i(),imageAlt:a()},s())),x=I(()=>!!(i()??``).trim()),S=I(()=>!!(r()??``).replace(/<[^>]*>/g,``).trim());var C={get id(){return n()},set id(e){n(e),z()},get label(){return r()},set label(e){r(e),z()},get imageUrl(){return i()},set imageUrl(e){i(e),z()},get imageAlt(){return a()},set imageAlt(e){a(e),z()},get name(){return o()},set name(e){o(e),z()},get language(){return s()},set language(e){s(e),z()},get correctness(){return c()},set correctness(e=`neutral`){c(e),z()},get held(){return l()},set held(e=!1){l(e),z()},get invisible(){return u()},set invisible(e=!1){u(e),z()},get ghost(){return d()},set ghost(e=!1){d(e),z()},get disabled(){return f()},set disabled(e=!1){f(e),z()},get focused(){return p()},set focused(e=!1){p(e),z()},get fit(){return m()},set fit(e=!1){m(e),z()},get onpointerdown(){return h()},set onpointerdown(e){h(e),z()},get onkeydown(){return g()},set onkeydown(e){g(e),z()},get onkeyup(){return _()},set onkeyup(e){_(e),z()},get onfocus(){return v()},set onfocus(e){v(e),z()},get onclick(){return y()},set onclick(e){y(e),z()}},w=$l();let T;var E=Yt(w);let ee;var te=Yt(E),ne=e=>{var t=Yl();U(()=>J(t,`src`,i())),q(e,t)};Vr(te,e=>{K(x)&&e(ne)});var re=H(te,2),ie=e=>{var t=Xl();let n;Qr(t,()=>ho(r()),!0),N(t),U(()=>n=ai(t,1,`tile-label svelte-1hgaksk`,null,n,{"tile-label-below":K(x)})),q(e,t)};Vr(re,e=>{K(S)&&e(ie)}),N(E);var D=H(E,2),ae=e=>{q(e,Zl())},oe=e=>{q(e,Ql())};return Vr(D,e=>{c()===`correct`?e(ae):c()===`incorrect`&&e(oe,1)}),N(w),U(()=>{T=ai(w,1,`venn-tile svelte-1hgaksk`,null,T,{held:l(),focused:p(),invisible:u(),ghost:d(),fit:m(),correct:c()===`correct`,incorrect:c()===`incorrect`}),J(w,`data-tile-id`,n()),J(w,`aria-label`,K(b)),J(w,`aria-pressed`,l()),J(w,`aria-hidden`,d()),w.disabled=f(),J(w,`tabindex`,d()||f()?-1:0),ee=ai(E,1,`tile-body svelte-1hgaksk`,null,ee,{"tile-body-image":K(x)})}),dr(`pointerdown`,w,function(...e){h()?.apply(this,e)}),dr(`keydown`,w,function(...e){g()?.apply(this,e)}),dr(`keyup`,w,function(...e){_()?.apply(this,e)}),ur(`focus`,w,function(...e){v()?.apply(this,e)}),dr(`click`,w,function(...e){y()?.apply(this,e)}),q(e,w),Ve(C)}fr([`pointerdown`,`keydown`,`keyup`,`click`]),Ti(tu,{id:{},label:{},imageUrl:{},imageAlt:{},name:{},language:{},correctness:{},held:{},invisible:{},ghost:{},disabled:{},focused:{},fit:{},onpointerdown:{},onkeydown:{},onkeyup:{},onfocus:{},onclick:{}},[],[],{mode:`open`});var nu=br(`<div role="region" data-region-key="tray"><div class="tray-label svelte-1ogsh8s"> </div> <div class="tray-items svelte-1ogsh8s"><!></div></div>`),ru={hash:`svelte-1ogsh8s`,code:`.venn-tray.svelte-1ogsh8s {border:1.5px dashed var(--pie-border-dark, #64748b);border-radius:12px;padding:14px 16px;background:var(--pie-surface, #f8fafc);min-height:120px;transition:background 120ms ease, border-color 120ms ease;}.venn-tray.drop-target.svelte-1ogsh8s {background:var(--pie-faded-primary, #e0f2fe);border-color:var(--pie-tertiary, #0284c7);}.venn-tray.focused.svelte-1ogsh8s {outline:2px solid var(--vc-focus-ring, #1565c0);outline-offset:2px;}.tray-label.svelte-1ogsh8s {font-size:12px;font-weight:600;color:var(--pie-text, #475569);text-transform:uppercase;letter-spacing:0.05em;margin-bottom:8px;}.tray-items.svelte-1ogsh8s {display:flex;flex-wrap:wrap;gap:10px;}
44
44
  @media (prefers-reduced-motion: reduce) {.venn-tray.svelte-1ogsh8s {transition:none;}
45
- }`};function Zl(e,t){Be(t,!0),$r(e,Xl);let n=Y(t,`isDropTarget`,7,!1),r=Y(t,`focused`,7,!1),i=Y(t,`label`,7),a=Y(t,`onpointerenter`,7),o=Y(t,`onpointerleave`,7),s=Y(t,`children`,7);var c={get isDropTarget(){return n()},set isDropTarget(e=!1){n(e),z()},get focused(){return r()},set focused(e=!1){r(e),z()},get label(){return i()},set label(e){i(e),z()},get onpointerenter(){return a()},set onpointerenter(e){a(e),z()},get onpointerleave(){return o()},set onpointerleave(e){o(e),z()},get children(){return s()},set children(e){s(e),z()}},l=Yl();let u;var d=Yt(l),f=Zt(d,!0),p=H(d,2),m=Yt(p),h=e=>{var t=Cr();Rr(Xt(t),s),q(e,t)};return Vr(m,e=>{s()&&e(h)}),N(p),N(l),U(()=>{u=ai(l,1,`venn-tray svelte-1ogsh8s`,null,u,{"drop-target":n(),focused:r()}),J(l,`aria-label`,i()),Ar(f,i())}),ur(`pointerenter`,l,function(...e){a()?.apply(this,e)}),ur(`pointerleave`,l,function(...e){o()?.apply(this,e)}),q(e,l),Ve(c)}Ti(Zl,{isDropTarget:{},focused:{},label:{},onpointerenter:{},onpointerleave:{},children:{}},[],[],{mode:`open`});var Ql=br(`<div class="teacher-instructions pie-teacher-instructions svelte-1jhejbv"><button type="button" class="teacher-instructions-toggle pie-teacher-instructions-toggle svelte-1jhejbv"> </button> <div class="teacher-instructions-content pie-teacher-instructions-content svelte-1jhejbv"></div></div>`),$l={hash:`svelte-1jhejbv`,code:`.teacher-instructions.svelte-1jhejbv {margin-bottom:1rem;}.teacher-instructions-toggle.svelte-1jhejbv {padding:0;border:0;border-bottom:1px dotted currentColor;background:transparent;font:inherit;color:var(--pie-primary, #3f51b5);cursor:pointer;}.teacher-instructions-toggle.svelte-1jhejbv:focus-visible {outline:2px solid var(--vc-focus-ring, #1565c0);outline-offset:2px;}.teacher-instructions-content.svelte-1jhejbv {padding-top:1rem;}`};function eu(e,t){Be(t,!0),$r(e,$l);let n=Y(t,`html`,7),r=Y(t,`language`,7),i=Mt(!1),a=`venn-teacher-instructions-${Math.random().toString(36).slice(2,10)}`;var o={get html(){return n()},set html(e){n(e),z()},get language(){return r()},set language(e){r(e),z()}},s=Ql(),c=Yt(s),l=Zt(c,!0),u=H(c,2);return Qr(u,()=>so(n()),!0),N(u),N(s),U(e=>{J(c,`aria-expanded`,K(i)),J(c,`aria-controls`,a),Ar(l,e),J(u,`id`,a),J(u,`hidden`,!K(i))},[()=>Rl(K(i)?`hideTeacherInstructions`:`showTeacherInstructions`,r())]),dr(`click`,c,()=>V(i,!K(i))),q(e,s),Ve(o)}fr([`click`]),Ti(eu,{html:{},language:{}},[],[],{mode:`open`});function tu(e){return!e||e.length===0?``:[...e].sort((e,t)=>e-t).join(`,`)}function nu(e){return!e||e.length===0?[]:[...e].sort((e,t)=>e-t)}function ru(e,t){if(!e||!t)return!e==!t&&(e?.length??0)===(t?.length??0);if(e.length!==t.length)return!1;let n=nu(e),r=nu(t);for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!1;return!0}function iu(e){let t=[],n=1<<e;for(let r=0;r<n;r++){let n=[];for(let t=0;t<e;t++)r&1<<t&&n.push(t);t.push(n)}return t}function au(e,t,n){let r=nu(t),i=t=>e[t]?.label??$(`setNumber`,n,{number:t+1}),a=r.map(i);return r.length===0?e.length===2?$(`regionNeither`,n,{first:i(0),second:i(1)}):$(`regionNoneOf`,n,{sets:e.map((e,t)=>i(t)).join(`, `)}):r.length===1?$(`regionOnly`,n,{set:a[0]}):a.join($(`regionAndSeparator`,n))}function ou(e,t){let n=tu(t),r=e.regionLabels?.[n];return typeof r==`string`&&r.trim().length>0?r:au(e.circles??[],t,e.language)}var su={w:120,h:52},cu={w:120,h:84},lu=.6;function uu(e){return Math.min(1,44/Math.min(e.w,e.h))}var du={side:24,top:40,radius:236,centerDistance:200,outsideGap:12,outsideStripHeight:136},fu=.05;function pu(e=1,t=0){let n=du.side*e,r=du.radius*e,i=du.centerDistance*e,a=du.top*e+r,o=du.outsideGap*e,s=Math.max(du.outsideStripHeight*e,t);return{width:2*n+2*r+i,height:a+r+o+s,scale:e,outsideGap:o,outsideStripHeight:s,circles:[{cx:n+r,cy:a,r},{cx:n+r+i,cy:a,r}]}}function mu(){return pu()}function hu(e,t){return`min(100%, max(min(720px, ${lu*100*e.width/e.height}vh), ${e.width*uu(t)}px))`}function gu(e,t,n){return e>0?Math.max(uu(n),Math.min(1,e/t.width)):1}function _u(e,t){return Math.max(0,Math.floor((e+8)/(t.w+8)+1e-9))}function vu(e,t){return t>e.r?-1:Math.sqrt(e.r*e.r-t*t)}function yu(e,t,n){let r=vu(e,Math.max(Math.abs(t-e.cy),Math.abs(n-e.cy)));return r<0?null:[e.cx-r,e.cx+r]}function bu(e,t,n){return vu(e,t<=e.cy&&e.cy<=n?0:Math.min(Math.abs(t-e.cy),Math.abs(n-e.cy)))}function xu(e,t,n,r,i){let a=yu(t,r,i),o=yu(n,r,i),s,c;if(e===`0`){if(!a)return null;let e=bu(n,r,i);[s,c]=[a[0],e<0?a[1]:Math.min(a[1],n.cx-e)]}else if(e===`1`){if(!o)return null;let e=bu(t,r,i);[s,c]=[e<0?o[0]:Math.max(o[0],t.cx+e),o[1]]}else{if(!a||!o)return null;[s,c]=[Math.max(a[0],o[0]),Math.min(a[1],o[1])]}return c>s?[s,c]:null}function Su(e,t,n,r){let i=r.h+8,a=t.cy,o=Math.max(t.r,n.r);return[0,.5].map(s=>{let c=[],l=Math.ceil(o/i)+1;for(let o=-l;o<=l;o++){let l=a+(o+s)*i,u=xu(e,t,n,l-r.h/2-6,l+r.h/2+6);if(!u)continue;let d=u[0]+6,f=u[1]-6,p=_u(f-d,r);p>0&&c.push({y:l,lo:d,hi:f,n:p})}return c})}function Cu(e){return e.reduce((e,t)=>e+t.n,0)}function wu(e,t,n){let r=e.width-6,i=_u(r-6,n),a=n.h+8,o=e.height-t,s=i*Math.max(0,Math.floor((o-12+8)/a+1e-9)),c={x:e.width/2,y:t+o/2};return{capacity:s,slots:e=>{if(e<=0)return[];let l=Math.min(e,s),u=i>0?Math.ceil(l/i):0,d=t+(o-(u*a-8))/2;return ku(Ou(Array.from({length:u},(e,t)=>({y:d+n.h/2+t*a,lo:6,hi:r,n:i})),l,n),e,c)}}}function Tu(e){return{x:e.x+e.w/2,y:e.y+e.h/2}}function Eu(e,t,n){let r=t*n.w+(t-1)*8,i=(e.lo+e.hi)/2-r/2+n.w/2;return Array.from({length:t},(t,r)=>({x:i+r*(n.w+8),y:e.y}))}function Du(e,t,n){let r=[...e].sort((e,n)=>Math.abs(e.y-t)-Math.abs(n.y-t)||e.y-n.y),i=[],a=0;for(let e of r){if(a>=n)break;i.push(e),a+=e.n}return i.sort((e,t)=>e.y-t.y)}function Ou(e,t,n){let r=[],i=t;for(let t of e){let e=Math.min(t.n,i);r.push(...Eu(t,e,n)),i-=e}return r}function ku(e,t,n){let r=e[e.length-1]??n;for(;e.length<t;)e.push({...r});return e}function Au(e,t,n,r){let i=Math.max(...e.map(Cu));return a=>{if(a<=0)return[];let o=Math.min(a,i),s=null,c=[1/0,1/0];for(let n of e){if(Cu(n)<o)continue;let e=Du(n,t,o),r=Math.abs(e.reduce((e,t)=>e+t.y,0)/e.length-t),i=[e.length,r];(i[0]<c[0]||i[0]===c[0]&&i[1]<c[1]-1e-9)&&(s=e,c=i)}return ku(s?Ou(s,o,n):[],a,r)}}function ju(e,t,n){let r=t.cy,i=0,a=Math.min(t.r,n.r);for(let o=0;o<40;o++){let o=(i+a)/2,s=xu(e,t,n,r-o,r+o);s&&s[1]-s[0]>=2*o?i=o:a=o}let o=xu(e,t,n,r-i,r+i)??[0,0];return{x:o[0]+1,y:r-i+1,w:o[1]-o[0]-2,h:2*i-2}}function Mu(e,t,n){let[r,i]=t.circles;return Math.max(...Su(e,r,i,n).map(Cu))}var Nu=[`0`,`0,1`,`1`];function Pu(e,t=su){let n=pu();for(let r=1;;r++){let i=n;if(Nu.every(n=>Mu(n,i,t)>=(e[n]??0)))break;n=pu(1+r*fu)}let r=e[``]??0,i=_u(n.width-12,t),a=Math.ceil(r/i)*(t.h+8)-8+12;return a>n.outsideStripHeight?pu(n.scale,a):n}function Fu(e,t=mu(),n=su){if(e.circles?.length!==2)throw Error(`buildLayout2Set requires exactly 2 circles (got ${e.circles?.length??0})`);let[r,i]=t.circles,a=iu(2),o=Math.max(r.cy+r.r,i.cy+i.r),s=Math.min(t.height-t.outsideStripHeight,o+t.outsideGap),c=(e,t,n)=>(r,i)=>{let a=r-e,o=i-t;return a*a+o*o<=n*n},l=c(r.cx,r.cy,r.r),u=c(i.cx,i.cy,i.r),d={};return{geometry:t,cell:n,regions:a.map(a=>{let o=tu(a),c=ou(e,a),f,p,m,h;if(o===``)f=(e,n)=>e>=0&&e<=t.width&&n>=0&&n<=t.height&&!l(e,n)&&!u(e,n),p={x:0,y:s,w:t.width,h:t.height-s},{capacity:m,slots:h}=wu(t,s,n);else if(o===`0`||o===`1`||o===`0,1`){f=o===`0`?(e,t)=>l(e,t)&&!u(e,t):o===`1`?(e,t)=>u(e,t)&&!l(e,t):(e,t)=>l(e,t)&&u(e,t),p=ju(o,r,i);let e=Su(o,r,i,n);m=Math.max(...e.map(Cu)),h=Au(e,r.cy,n,Tu(p))}else f=()=>!1,p={x:0,y:0,w:0,h:0},m=0,h=()=>[];let g={region:a,key:o,label:c,hitRect:p,pointInRegion:f,capacity:m,slots:h};return d[o]=g,g}),regionByKey:d,outsideStripTop:s}}function Iu(e,t,n){for(let r of[`0,1`,`0`,`1`,``]){let i=e.regionByKey[r];if(i?.pointInRegion(t,n))return i}return null}function Lu(e,t){let n={...e||{}},r=e?.placements??{},i={};for(let[e,t]of Object.entries(r))t==null?i[e]=null:Array.isArray(t)?i[e]=nu(t):i[e]=null;if(t?.tiles)for(let e of t.tiles)e.id in i||(i[e.id]=null);return n.placements=i,n.completed=Ru(t,{...n,placements:i}),n}function Ru(e,t){if(!e||!Array.isArray(e.tiles)||e.tiles.length===0)return!1;let n=t?.placements??{};for(let t of e.tiles)if(n[t.id]==null)return!1;return!0}function zu({model:e,session:t,tileId:n,placement:r}){let i=Lu(t,e),a={...i,placements:{...i.placements,[n]:r===null?null:nu(r)}};return a.completed=Ru(e,a),a}function Bu(e,t){let n=e?.placements?.[t];return Array.isArray(n)?nu(n):null}function Vu(e,t,n){let r=Bu(e,t);return r===null||n===null?r===n:ru(r,n)}function Hu(e,t){let n=t?.placements??{};return(e.tiles||[]).filter(e=>n[e.id]==null)}function Uu(e,t){let n=t?.placements??{},r={};for(let t of e.tiles||[]){let e=n[t.id];if(e==null)continue;let i=nu(e).join(`,`);r[i]||(r[i]=[]),r[i].push(t)}return r}var Wu=br(`<div class="venn-prompt svelte-gkcqor"></div>`),Gu=Sr(`<svg class="toggle-icon svelte-gkcqor" preserveAspectRatio="xMinYMin meet" version="1.1" viewBox="-283 359 34 35" aria-hidden="true"><circle cx="-266" cy="375.9" r="14" fill="var(--pie-tertiary-light, #bce2ff)"></circle><path d="M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z" fill="var(--pie-tertiary-light, #bce2ff)"></path><polygon points="-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6" fill="var(--pie-tertiary, #1a9cff)"></polygon></svg>`),Ku=Sr(`<svg class="toggle-icon svelte-gkcqor" preserveAspectRatio="xMinYMin meet" version="1.1" viewBox="-129.5 127 34 35" aria-hidden="true"><path style="fill: var(--pie-border-light, #D0CAC5); stroke: var(--pie-border-light, #E6E3E0); stroke-width: 0.75; stroke-miterlimit: 10;" d="M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z"></path><path style="fill: var(--pie-border-light, #B3ABA4); stroke: var(--pie-border-light, #CDC7C2); stroke-width: 0.5; stroke-miterlimit: 10;" d="M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z"></path><circle cx="-114.2" cy="143.5" r="14" fill="var(--pie-background, white)"></circle><path d="M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z" fill="var(--pie-tertiary-light, #bce2ff)"></path><polygon points="-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2" fill="var(--pie-tertiary, #1a9cff)"></polygon></svg>`),qu=br(`<button type="button" class="toggle-correct svelte-gkcqor"><!> <span class="toggle-label svelte-gkcqor"> </span></button>`),Ju=br(`<div class="venn-error svelte-gkcqor" role="alert"> </div>`),Yu=Sr(`<circle fill="color-mix(in srgb, var(--pie-primary, #0ea5e9) 12%, transparent)"></circle>`),Xu=Sr(`<rect x="0" y="0"></rect>`),Zu=Sr(`<circle></circle>`),Qu=Sr(`<circle fill="none" stroke="var(--pie-text, #1e293b)"></circle>`),$u=Sr(`<text font-weight="600" fill="var(--pie-text, #0f172a)"> </text>`),ed=br(`<div class="region-aria svelte-gkcqor" role="region"></div>`),td=br(`<div class="tile-wrapper svelte-gkcqor"><!></div>`),nd=br(`<div class="venn-diagram svelte-gkcqor"><svg preserveAspectRatio="xMidYMid meet" aria-hidden="true" class="svelte-gkcqor"><defs><mask maskUnits="userSpaceOnUse" x="0" y="0"><rect x="0" y="0" fill="black"></rect><circle fill="white"></circle><circle fill="black"></circle></mask><mask maskUnits="userSpaceOnUse" x="0" y="0"><rect x="0" y="0" fill="black"></rect><circle fill="white"></circle><circle fill="black"></circle></mask><clipPath clipPathUnits="userSpaceOnUse"><circle></circle></clipPath><mask maskUnits="userSpaceOnUse" x="0" y="0"><rect x="0" y="0" fill="white"></rect><circle fill="black"></circle><circle fill="black"></circle></mask></defs><rect fill="var(--pie-background, #ffffff)" stroke="var(--pie-border-light, #cbd5e1)"></rect><!><!><!><!><!><!><!><line stroke="var(--pie-border, #64748b)"></line></svg> <div class="region-labels svelte-gkcqor" aria-hidden="false"></div> <div class="placed-tiles svelte-gkcqor"></div></div> <!>`,1),rd=br(`<div class="drag-ghost svelte-gkcqor"><!></div>`),id=br(`<div class="venn-root svelte-gkcqor"><!> <!> <!> <!> <!> <div class="sr-only svelte-gkcqor" aria-live="polite" aria-atomic="true"></div></div>`),ad={hash:`svelte-gkcqor`,code:`.venn-root.svelte-gkcqor {display:flex;flex-direction:column;gap:16px;padding:16px;color:var(--pie-text, #0f172a);font-family:system-ui, -apple-system, Segoe UI, Roboto, sans-serif;--vc-focus-ring: var(
45
+ }`};function iu(e,t){Be(t,!0),$r(e,ru);let n=Y(t,`isDropTarget`,7,!1),r=Y(t,`focused`,7,!1),i=Y(t,`label`,7),a=Y(t,`onpointerenter`,7),o=Y(t,`onpointerleave`,7),s=Y(t,`children`,7);var c={get isDropTarget(){return n()},set isDropTarget(e=!1){n(e),z()},get focused(){return r()},set focused(e=!1){r(e),z()},get label(){return i()},set label(e){i(e),z()},get onpointerenter(){return a()},set onpointerenter(e){a(e),z()},get onpointerleave(){return o()},set onpointerleave(e){o(e),z()},get children(){return s()},set children(e){s(e),z()}},l=nu();let u;var d=Yt(l),f=Zt(d,!0),p=H(d,2),m=Yt(p),h=e=>{var t=Cr();Rr(Xt(t),s),q(e,t)};return Vr(m,e=>{s()&&e(h)}),N(p),N(l),U(()=>{u=ai(l,1,`venn-tray svelte-1ogsh8s`,null,u,{"drop-target":n(),focused:r()}),J(l,`aria-label`,i()),Ar(f,i())}),ur(`pointerenter`,l,function(...e){a()?.apply(this,e)}),ur(`pointerleave`,l,function(...e){o()?.apply(this,e)}),q(e,l),Ve(c)}Ti(iu,{isDropTarget:{},focused:{},label:{},onpointerenter:{},onpointerleave:{},children:{}},[],[],{mode:`open`});var au=br(`<div class="teacher-instructions pie-teacher-instructions svelte-1jhejbv"><button type="button" class="teacher-instructions-toggle pie-teacher-instructions-toggle svelte-1jhejbv"> </button> <div class="teacher-instructions-content pie-teacher-instructions-content svelte-1jhejbv"></div></div>`),ou={hash:`svelte-1jhejbv`,code:`.teacher-instructions.svelte-1jhejbv {margin-bottom:1rem;}.teacher-instructions-toggle.svelte-1jhejbv {padding:0;border:0;border-bottom:1px dotted currentColor;background:transparent;font:inherit;color:var(--pie-primary, #3f51b5);cursor:pointer;}.teacher-instructions-toggle.svelte-1jhejbv:focus-visible {outline:2px solid var(--vc-focus-ring, #1565c0);outline-offset:2px;}.teacher-instructions-content.svelte-1jhejbv {padding-top:1rem;}`};function su(e,t){Be(t,!0),$r(e,ou);let n=Y(t,`html`,7),r=Y(t,`language`,7),i=Mt(!1),a=`venn-teacher-instructions-${Math.random().toString(36).slice(2,10)}`;var o={get html(){return n()},set html(e){n(e),z()},get language(){return r()},set language(e){r(e),z()}},s=au(),c=Yt(s),l=Zt(c,!0),u=H(c,2);return Qr(u,()=>ho(n()),!0),N(u),N(s),U(e=>{J(c,`aria-expanded`,K(i)),J(c,`aria-controls`,a),Ar(l,e),J(u,`id`,a),J(u,`hidden`,!K(i))},[()=>Gl(K(i)?`hideTeacherInstructions`:`showTeacherInstructions`,r())]),dr(`click`,c,()=>V(i,!K(i))),q(e,s),Ve(o)}fr([`click`]),Ti(su,{html:{},language:{}},[],[],{mode:`open`});function cu(e){return!e||e.length===0?``:[...e].sort((e,t)=>e-t).join(`,`)}function lu(e){return!e||e.length===0?[]:[...e].sort((e,t)=>e-t)}function uu(e,t){if(!e||!t)return!e==!t&&(e?.length??0)===(t?.length??0);if(e.length!==t.length)return!1;let n=lu(e),r=lu(t);for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!1;return!0}function du(e){let t=[],n=1<<e;for(let r=0;r<n;r++){let n=[];for(let t=0;t<e;t++)r&1<<t&&n.push(t);t.push(n)}return t}function fu(e,t,n){let r=lu(t),i=t=>e[t]?.label??$(`setNumber`,n,{number:t+1}),a=r.map(i);return r.length===0?e.length===2?$(`regionNeither`,n,{first:i(0),second:i(1)}):$(`regionNoneOf`,n,{sets:e.map((e,t)=>i(t)).join(`, `)}):r.length===1?$(`regionOnly`,n,{set:a[0]}):a.join($(`regionAndSeparator`,n))}function pu(e,t){let n=cu(t),r=e.regionLabels?.[n];return typeof r==`string`&&r.trim().length>0?r:fu(e.circles??[],t,e.language)}var mu={w:120,h:52},hu={w:120,h:84},gu=.6;function _u(e){return Math.min(1,44/Math.min(e.w,e.h))}var vu={side:24,top:40,radius:236,centerDistance:200,outsideGap:12,outsideStripHeight:136},yu=.05;function bu(e=1,t=0){let n=vu.side*e,r=vu.radius*e,i=vu.centerDistance*e,a=vu.top*e+r,o=vu.outsideGap*e,s=Math.max(vu.outsideStripHeight*e,t);return{width:2*n+2*r+i,height:a+r+o+s,scale:e,outsideGap:o,outsideStripHeight:s,circles:[{cx:n+r,cy:a,r},{cx:n+r+i,cy:a,r}]}}function xu(){return bu()}function Su(e,t){return`min(100%, max(min(720px, ${gu*100*e.width/e.height}vh), ${e.width*_u(t)}px))`}function Cu(e,t,n){return e>0?Math.max(_u(n),Math.min(1,e/t.width)):1}function wu(e,t){return Math.max(0,Math.floor((e+8)/(t.w+8)+1e-9))}function Tu(e,t){return t>e.r?-1:Math.sqrt(e.r*e.r-t*t)}function Eu(e,t,n){let r=Tu(e,Math.max(Math.abs(t-e.cy),Math.abs(n-e.cy)));return r<0?null:[e.cx-r,e.cx+r]}function Du(e,t,n){return Tu(e,t<=e.cy&&e.cy<=n?0:Math.min(Math.abs(t-e.cy),Math.abs(n-e.cy)))}function Ou(e,t,n,r,i){let a=Eu(t,r,i),o=Eu(n,r,i),s,c;if(e===`0`){if(!a)return null;let e=Du(n,r,i);[s,c]=[a[0],e<0?a[1]:Math.min(a[1],n.cx-e)]}else if(e===`1`){if(!o)return null;let e=Du(t,r,i);[s,c]=[e<0?o[0]:Math.max(o[0],t.cx+e),o[1]]}else{if(!a||!o)return null;[s,c]=[Math.max(a[0],o[0]),Math.min(a[1],o[1])]}return c>s?[s,c]:null}function ku(e,t,n,r){let i=r.h+8,a=t.cy,o=Math.max(t.r,n.r);return[0,.5].map(s=>{let c=[],l=Math.ceil(o/i)+1;for(let o=-l;o<=l;o++){let l=a+(o+s)*i,u=Ou(e,t,n,l-r.h/2-6,l+r.h/2+6);if(!u)continue;let d=u[0]+6,f=u[1]-6,p=wu(f-d,r);p>0&&c.push({y:l,lo:d,hi:f,n:p})}return c})}function Au(e){return e.reduce((e,t)=>e+t.n,0)}function ju(e,t,n){let r=e.width-6,i=wu(r-6,n),a=n.h+8,o=e.height-t,s=i*Math.max(0,Math.floor((o-12+8)/a+1e-9)),c={x:e.width/2,y:t+o/2};return{capacity:s,slots:e=>{if(e<=0)return[];let l=Math.min(e,s),u=i>0?Math.ceil(l/i):0,d=t+(o-(u*a-8))/2;return Iu(Fu(Array.from({length:u},(e,t)=>({y:d+n.h/2+t*a,lo:6,hi:r,n:i})),l,n),e,c)}}}function Mu(e){return{x:e.x+e.w/2,y:e.y+e.h/2}}function Nu(e,t,n){let r=t*n.w+(t-1)*8,i=(e.lo+e.hi)/2-r/2+n.w/2;return Array.from({length:t},(t,r)=>({x:i+r*(n.w+8),y:e.y}))}function Pu(e,t,n){let r=[...e].sort((e,n)=>Math.abs(e.y-t)-Math.abs(n.y-t)||e.y-n.y),i=[],a=0;for(let e of r){if(a>=n)break;i.push(e),a+=e.n}return i.sort((e,t)=>e.y-t.y)}function Fu(e,t,n){let r=[],i=t;for(let t of e){let e=Math.min(t.n,i);r.push(...Nu(t,e,n)),i-=e}return r}function Iu(e,t,n){let r=e[e.length-1]??n;for(;e.length<t;)e.push({...r});return e}function Lu(e,t,n,r){let i=Math.max(...e.map(Au));return a=>{if(a<=0)return[];let o=Math.min(a,i),s=null,c=[1/0,1/0];for(let n of e){if(Au(n)<o)continue;let e=Pu(n,t,o),r=Math.abs(e.reduce((e,t)=>e+t.y,0)/e.length-t),i=[e.length,r];(i[0]<c[0]||i[0]===c[0]&&i[1]<c[1]-1e-9)&&(s=e,c=i)}return Iu(s?Fu(s,o,n):[],a,r)}}function Ru(e,t,n){let r=t.cy,i=0,a=Math.min(t.r,n.r);for(let o=0;o<40;o++){let o=(i+a)/2,s=Ou(e,t,n,r-o,r+o);s&&s[1]-s[0]>=2*o?i=o:a=o}let o=Ou(e,t,n,r-i,r+i)??[0,0];return{x:o[0]+1,y:r-i+1,w:o[1]-o[0]-2,h:2*i-2}}function zu(e,t,n){let[r,i]=t.circles;return Math.max(...ku(e,r,i,n).map(Au))}var Bu=[`0`,`0,1`,`1`];function Vu(e,t=mu){let n=bu();for(let r=1;;r++){let i=n;if(Bu.every(n=>zu(n,i,t)>=(e[n]??0)))break;n=bu(1+r*yu)}let r=e[``]??0,i=wu(n.width-12,t),a=Math.ceil(r/i)*(t.h+8)-8+12;return a>n.outsideStripHeight?bu(n.scale,a):n}function Hu(e,t=xu(),n=mu){if(e.circles?.length!==2)throw Error(`buildLayout2Set requires exactly 2 circles (got ${e.circles?.length??0})`);let[r,i]=t.circles,a=du(2),o=Math.max(r.cy+r.r,i.cy+i.r),s=Math.min(t.height-t.outsideStripHeight,o+t.outsideGap),c=(e,t,n)=>(r,i)=>{let a=r-e,o=i-t;return a*a+o*o<=n*n},l=c(r.cx,r.cy,r.r),u=c(i.cx,i.cy,i.r),d={};return{geometry:t,cell:n,regions:a.map(a=>{let o=cu(a),c=pu(e,a),f,p,m,h;if(o===``)f=(e,n)=>e>=0&&e<=t.width&&n>=0&&n<=t.height&&!l(e,n)&&!u(e,n),p={x:0,y:s,w:t.width,h:t.height-s},{capacity:m,slots:h}=ju(t,s,n);else if(o===`0`||o===`1`||o===`0,1`){f=o===`0`?(e,t)=>l(e,t)&&!u(e,t):o===`1`?(e,t)=>u(e,t)&&!l(e,t):(e,t)=>l(e,t)&&u(e,t),p=Ru(o,r,i);let e=ku(o,r,i,n);m=Math.max(...e.map(Au)),h=Lu(e,r.cy,n,Mu(p))}else f=()=>!1,p={x:0,y:0,w:0,h:0},m=0,h=()=>[];let g={region:a,key:o,label:c,hitRect:p,pointInRegion:f,capacity:m,slots:h};return d[o]=g,g}),regionByKey:d,outsideStripTop:s}}function Uu(e,t,n){for(let r of[`0,1`,`0`,`1`,``]){let i=e.regionByKey[r];if(i?.pointInRegion(t,n))return i}return null}function Wu(e,t){let n={...e||{}},r=e?.placements??{},i={};for(let[e,t]of Object.entries(r))t==null?i[e]=null:Array.isArray(t)?i[e]=lu(t):i[e]=null;if(t?.tiles)for(let e of t.tiles)e.id in i||(i[e.id]=null);return n.placements=i,n.completed=Gu(t,{...n,placements:i}),n}function Gu(e,t){if(!e||!Array.isArray(e.tiles)||e.tiles.length===0)return!1;let n=t?.placements??{};for(let t of e.tiles)if(n[t.id]==null)return!1;return!0}function Ku({model:e,session:t,tileId:n,placement:r}){let i=Wu(t,e),a={...i,placements:{...i.placements,[n]:r===null?null:lu(r)}};return a.completed=Gu(e,a),a}function qu(e,t){let n=e?.placements?.[t];return Array.isArray(n)?lu(n):null}function Ju(e,t,n){let r=qu(e,t);return r===null||n===null?r===n:uu(r,n)}function Yu(e,t){let n=t?.placements??{};return(e.tiles||[]).filter(e=>n[e.id]==null)}function Xu(e,t){let n=t?.placements??{},r={};for(let t of e.tiles||[]){let e=n[t.id];if(e==null)continue;let i=lu(e).join(`,`);r[i]||(r[i]=[]),r[i].push(t)}return r}var Zu=br(`<div class="venn-prompt svelte-gkcqor"></div>`),Qu=Sr(`<svg class="toggle-icon svelte-gkcqor" preserveAspectRatio="xMinYMin meet" version="1.1" viewBox="-283 359 34 35" aria-hidden="true"><circle cx="-266" cy="375.9" r="14" fill="var(--pie-tertiary-light, #bce2ff)"></circle><path d="M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z" fill="var(--pie-tertiary-light, #bce2ff)"></path><polygon points="-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6" fill="var(--pie-tertiary, #1a9cff)"></polygon></svg>`),$u=Sr(`<svg class="toggle-icon svelte-gkcqor" preserveAspectRatio="xMinYMin meet" version="1.1" viewBox="-129.5 127 34 35" aria-hidden="true"><path style="fill: var(--pie-border-light, #D0CAC5); stroke: var(--pie-border-light, #E6E3E0); stroke-width: 0.75; stroke-miterlimit: 10;" d="M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z"></path><path style="fill: var(--pie-border-light, #B3ABA4); stroke: var(--pie-border-light, #CDC7C2); stroke-width: 0.5; stroke-miterlimit: 10;" d="M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z"></path><circle cx="-114.2" cy="143.5" r="14" fill="var(--pie-background, white)"></circle><path d="M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z" fill="var(--pie-tertiary-light, #bce2ff)"></path><polygon points="-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2" fill="var(--pie-tertiary, #1a9cff)"></polygon></svg>`),ed=br(`<button type="button" class="toggle-correct svelte-gkcqor"><!> <span class="toggle-label svelte-gkcqor"> </span></button>`),td=br(`<div class="venn-error svelte-gkcqor" role="alert"> </div>`),nd=Sr(`<circle fill="color-mix(in srgb, var(--pie-primary, #0ea5e9) 12%, transparent)"></circle>`),rd=Sr(`<rect x="0" y="0"></rect>`),id=Sr(`<circle></circle>`),ad=Sr(`<circle fill="none" stroke="var(--pie-text, #1e293b)"></circle>`),od=Sr(`<text font-weight="600" fill="var(--pie-text, #0f172a)"> </text>`),sd=br(`<div class="region-aria svelte-gkcqor" role="region"></div>`),cd=br(`<div class="tile-wrapper svelte-gkcqor"><!></div>`),ld=br(`<div class="venn-diagram svelte-gkcqor"><svg preserveAspectRatio="xMidYMid meet" aria-hidden="true" class="svelte-gkcqor"><defs><mask maskUnits="userSpaceOnUse" x="0" y="0"><rect x="0" y="0" fill="black"></rect><circle fill="white"></circle><circle fill="black"></circle></mask><mask maskUnits="userSpaceOnUse" x="0" y="0"><rect x="0" y="0" fill="black"></rect><circle fill="white"></circle><circle fill="black"></circle></mask><clipPath clipPathUnits="userSpaceOnUse"><circle></circle></clipPath><mask maskUnits="userSpaceOnUse" x="0" y="0"><rect x="0" y="0" fill="white"></rect><circle fill="black"></circle><circle fill="black"></circle></mask></defs><rect fill="var(--pie-background, #ffffff)" stroke="var(--pie-border-light, #cbd5e1)"></rect><!><!><!><!><!><!><!><line stroke="var(--pie-border, #64748b)"></line></svg> <div class="region-labels svelte-gkcqor" aria-hidden="false"></div> <div class="placed-tiles svelte-gkcqor"></div></div> <!>`,1),ud=br(`<div class="drag-ghost svelte-gkcqor"><!></div>`),dd=br(`<div class="venn-root svelte-gkcqor"><!> <!> <!> <!> <!> <div class="sr-only svelte-gkcqor" aria-live="polite" aria-atomic="true"></div></div>`),fd={hash:`svelte-gkcqor`,code:`.venn-root.svelte-gkcqor {display:flex;flex-direction:column;gap:16px;padding:16px;color:var(--pie-text, #0f172a);font-family:system-ui, -apple-system, Segoe UI, Roboto, sans-serif;--vc-focus-ring: var(
46
46
  --pie-focus-outline,
47
47
  var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565c0))
48
48
  );}.venn-prompt.svelte-gkcqor {font-size:16px;line-height:1.5;}.venn-prompt.svelte-gkcqor p {margin:0 0 8px 0;}.toggle-correct.svelte-gkcqor {align-self:center;display:inline-flex;align-items:center;gap:8px;margin:0 0 4px 0;padding:0;background:transparent;border:0;color:inherit;font:inherit;font-size:14px;cursor:pointer;user-select:none;}.toggle-correct.svelte-gkcqor:focus-visible {outline:2px solid var(--vc-focus-ring, #1565c0);outline-offset:2px;border-radius:2px;}.toggle-icon.svelte-gkcqor {width:25px;height:25px;flex-shrink:0;}.toggle-label.svelte-gkcqor {line-height:1.2;}.toggle-correct.svelte-gkcqor:hover .toggle-label:where(.svelte-gkcqor),
@@ -54,4 +54,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
54
54
  * to the width that keeps tiles at 44 px (\`diagramCssWidth\`).
55
55
  */position:relative;margin:0 auto;}.venn-diagram.svelte-gkcqor svg:where(.svelte-gkcqor) {width:100%;height:100%;display:block;}.placed-tiles.svelte-gkcqor,
56
56
  .region-labels.svelte-gkcqor {position:absolute;inset:0;pointer-events:none;}.tile-wrapper.svelte-gkcqor {position:absolute;display:flex;pointer-events:auto;}.region-aria.svelte-gkcqor {position:absolute;width:1px;height:1px;transform:translate(-50%, -50%);opacity:0;pointer-events:none;}.venn-error.svelte-gkcqor {padding:12px 16px;border:1.5px solid var(--pie-incorrect-icon, #bf0d00);border-radius:8px;background:var(--pie-incorrect-secondary, #fef2f2);color:var(--pie-text, #7f1d1d);font-size:14px;}
57
- /* Tailwind's \`sr-only\`, scoped: PIE players ship no Tailwind. */.sr-only.svelte-gkcqor {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}.drag-ghost.svelte-gkcqor {position:fixed;top:0;left:0;transform:translate(-50%, -50%);pointer-events:none;z-index:1000;}`};function od(e,t){Be(t,!0),$r(e,ad);let n=[{label:`Set A`},{label:`Set B`}],r=`venn-${Math.random().toString(36).slice(2,10)}`,i=`${r}-mask-left-only`,a=`${r}-mask-right-only`,o=`${r}-mask-outside`,s=`${r}-clip-left`,c=null,l=Mt(null),u=null,d=Mt(!1),f=Mt(null),p=Mt(null),m=Mt(null),h=Mt(null),g=Mt(0),_=null,v=null,y=I(()=>t?.model?.circles??n),x=I(()=>K(y).length===2),S=I(()=>t?.model?.language),C=I(()=>({circles:K(y),tiles:t?.model?.tiles??[],regionLabels:t?.model?.regionLabels??{},language:K(S),scoringPolicy:`partialPerTile`,promptEnabled:!0})),w=I(()=>t?.model?.env?.mode===`evaluate`),T=I(()=>t?.model?.disabled===!0),E=I(()=>t?.model?.prompt??null),ee=I(()=>le(t?.session,t?.model,K(d))),te=I(()=>({placements:K(ee)})),ne=I(()=>Uu(K(C),K(te))),re=I(()=>Hu(K(C),K(te))),ie=I(()=>(K(C).tiles??[]).some(e=>(e.imageUrl??``).trim())?cu:su),D=I(()=>Pu(Object.fromEntries(Object.entries(K(ne)).map(([e,t])=>[e,t.length])),K(ie))),ae=I(()=>K(x)?Fu(K(C),K(D),K(ie)):null),oe=I(()=>gu(K(g),K(D),K(ie))),se=I(()=>[`0`,`0,1`,`1`,``,`tray`]),ce;fn(()=>{let e=t?.session,n=K(w)&&!!t?.model?.correctRegionsById;ar(()=>{(!n||e!==ce)&&V(d,!1),ce=e})}),un(()=>{K(T)&&ar(_e)}),Br(()=>{_?.()});function le(e,t,n){let r={...e?.placements??{}};if(n&&t?.correctRegionsById)for(let[e,n]of Object.entries(t.correctRegionsById))r[e]=n;return r}function ue(e){u&&(u.textContent=``,requestAnimationFrame(()=>{u&&(u.textContent=e)}))}function de(e,t){return{left:e/K(D).width*100,top:t/K(D).height*100}}function O(e,t){if(!K(l))return null;let n=K(l).getBoundingClientRect();if(n.width===0||n.height===0)return null;let r=(e-n.left)/n.width,i=(t-n.top)/n.height;return{x:r*K(D).width,y:i*K(D).height}}function fe(e,n){let r=zu({model:K(C),session:t?.session,tileId:e,placement:n});t.onSessionChange?.(r)}function pe(e){return e?(K(C).tiles||[]).find(t=>t.id===e)??null:null}function me(e){return K(ae)?.regionByKey[e]}function he(e){return e===`tray`?$(`tray`,K(S)):me(e)?.label??$(`unknownTarget`,K(S))}function ge(){V(f,null),V(m,null),V(p,null),V(h,null)}function _e(){_?.(),K(f)!==null&&ge()}function ve(e,n){let r=Bl(e,K(S)),i=n===`tray`?null:n===null?void 0:me(n)?.region;if(i===void 0||Vu(t?.session,e.id,i)){ue($(`cancelled`,K(S)));return}fe(e.id,i),ue(i===null?$(`returnedToTray`,K(S),{name:r}):$(`placedIn`,K(S),{name:r,target:he(n)}))}function k(e,t){if(K(T))return;t.preventDefault(),_?.(),t.currentTarget.setPointerCapture?.(t.pointerId),V(f,e.id,!0),V(m,null),V(h,{x:t.clientX,y:t.clientY},!0),V(p,ye(t.clientX,t.clientY),!0),ue($(`pickedUp`,K(S),{name:Bl(e,K(S))}));let n=e=>{V(h,{x:e.clientX,y:e.clientY},!0),V(p,ye(e.clientX,e.clientY),!0)},r=t=>{a();let n=ye(t.clientX,t.clientY),r=K(p);ge(),!K(T)&&ve(e,n??r)},i=()=>{a(),ge(),ue($(`cancelled`,K(S)))},a=()=>{window.removeEventListener(`pointermove`,n),window.removeEventListener(`pointerup`,r),window.removeEventListener(`pointercancel`,i),_===a&&(_=null)};_=a,window.addEventListener(`pointermove`,n),window.addEventListener(`pointerup`,r),window.addEventListener(`pointercancel`,i)}function ye(e,t){if(A(e,t))return`tray`;let n=O(e,t);if(!n||!K(ae))return null;let r=Iu(K(ae),n.x,n.y);return r?r.key:null}function A(e,t){let n=c?.querySelector(`[data-region-key="tray"]`);if(!n)return!1;let r=n.getBoundingClientRect();return e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom}async function j(e){await nr();let t=c?.querySelectorAll(`button[data-tile-id]`)??[];for(let n of t)if(n.dataset.tileId===e&&n.getAttribute(`aria-hidden`)!==`true`){n.focus();return}}function M(e){if(K(f)===e.id){let t=K(m);ge(),ve(e,t),j(e.id)}else{let t=Bu(K(te),e.id),n=t===null?K(se)[0]??null:tu(t);V(f,e.id,!0),V(m,n,!0),ue($(`pickedUpWithKeyboard`,K(S),{name:Bl(e,K(S)),target:he(n??``)}))}}function be(e,t){if(!(K(T)||t.detail!==0)){if(v===e.id){v=null;return}M(e)}}function xe(){setTimeout(()=>{v=null},0)}function Se(e,t){if(!K(T)){if(t.key===` `||t.key===`Enter`){t.preventDefault(),v=e.id,M(e);return}if(t.key===`Escape`&&K(f)===e.id){t.preventDefault(),ge(),ue($(`cancelled`,K(S)));return}if(K(f)===e.id&&(t.key===`ArrowLeft`||t.key===`ArrowRight`||t.key===`ArrowUp`||t.key===`ArrowDown`||t.key===`Tab`)){t.preventDefault();let e=K(m)??K(se)[0]??`0`,n=K(se).indexOf(e);n<0&&(n=0);let r=t.key===`ArrowLeft`||t.key===`ArrowUp`||t.key===`Tab`&&t.shiftKey?-1:1;n=(n+r+K(se).length)%K(se).length,V(m,K(se)[n],!0),ue($(`dropTarget`,K(S),{target:he(K(m))}))}}}function Ce(e){if(K(f)===null||K(h)!==null)return;let t=e.relatedTarget;t&&c?.contains(t)||(ge(),ue($(`cancelled`,K(S))))}function we(e){if(!K(w)||K(d))return null;let n=t?.model?.correctness?.[e];return n===`correct`||n===`incorrect`||n===`unanswered`?n:null}function Te(){if(!c)return;let e=e=>console.warn(`venn-classification: MathJax render failed`,e);try{Promise.resolve(Pc(c)).catch(e)}catch(t){e(t)}}zr(()=>{nr().then(Te)}),un(()=>{K(ee),K(C).tiles?.length,nr().then(Te)});let Ee=I(()=>K(w)?Object.values(t?.model?.correctness??{}).filter(e=>e===`incorrect`||e===`unanswered`).length:0),De=I(()=>K(f)===null?K(p)??null:K(p)??K(m)??null),Oe=I(()=>K(De)===`0`),ke=I(()=>K(De)===`1`),Ae=I(()=>K(De)===`0,1`),je=I(()=>K(De)===``),Me=`color-mix(in srgb, var(--pie-primary, #2563eb) 18%, transparent)`,Ne=I(()=>K(f)!==null&&K(h)!==null?pe(K(f)):null);var Pe=id(),Fe=Yt(Pe),Ie=e=>{eu(e,{get html(){return t.model.teacherInstructions},get language(){return K(S)}})};Vr(Fe,e=>{t?.model?.teacherInstructions&&e(Ie)});var Le=H(Fe,2),Re=e=>{var t=Wu();Qr(t,()=>so(K(E)),!0),N(t),q(e,t)};Vr(Le,e=>{K(E)&&e(Re)});var P=H(Le,2),ze=e=>{var t=qu(),n=Yt(t),r=e=>{q(e,Gu())},i=e=>{q(e,Ku())};Vr(n,e=>{K(d)?e(r):e(i,-1)});var a=Zt(H(n,2),!0);N(t),U(e=>{J(t,`aria-pressed`,K(d)),Ar(a,e)},[()=>Rl(K(d)?`hideCorrectAnswer`:`showCorrectAnswer`,K(S))]),dr(`click`,t,()=>V(d,!K(d))),q(e,t)};Vr(P,e=>{K(w)&&K(Ee)>0&&e(ze)});var He=H(P,2),Ue=e=>{var t=Ju(),n=Zt(t,!0);U(e=>Ar(n,e),[()=>$(`unsupportedCircles`,K(S),{count:K(y).length,supported:2})]),q(e,t)},We=e=>{var t=nd(),n=Xt(t);let r;var c=Yt(n),u=Yt(c),d=Yt(u),_=Yt(d),v=H(_),y=H(v);N(d);var x=H(d),w=Yt(x),E=H(w),ee=H(E);N(x);var te=H(x),se=Zt(te),ce=H(te),le=Yt(ce),ue=H(le),O=H(ue);N(ce),N(u);var fe=H(u),pe=H(fe);Kr(pe,17,()=>K(D).circles,Hr,(e,t)=>{var n=Yu();U(()=>{J(n,`cx`,K(t).cx),J(n,`cy`,K(t).cy),J(n,`r`,K(t).r)}),q(e,n)});var me=H(pe),he=e=>{var t=Xu();J(t,`fill`,Me),U(()=>{J(t,`width`,K(D).width),J(t,`height`,K(D).height),J(t,`mask`,`url(#${i})`)}),q(e,t)};Vr(me,e=>{K(Oe)&&e(he)});var ge=H(me),_e=e=>{var t=Xu();J(t,`fill`,Me),U(()=>{J(t,`width`,K(D).width),J(t,`height`,K(D).height),J(t,`mask`,`url(#${a})`)}),q(e,t)};Vr(ge,e=>{K(ke)&&e(_e)});var ve=H(ge),ye=e=>{var t=Zu();J(t,`fill`,Me),U(()=>{J(t,`cx`,K(D).circles[1].cx),J(t,`cy`,K(D).circles[1].cy),J(t,`r`,K(D).circles[1].r),J(t,`clip-path`,`url(#${s})`)}),q(e,t)};Vr(ve,e=>{K(Ae)&&e(ye)});var A=H(ve),j=e=>{var t=Xu();J(t,`fill`,Me),U(()=>{J(t,`width`,K(D).width),J(t,`height`,K(D).height),J(t,`mask`,`url(#${o})`)}),q(e,t)};Vr(A,e=>{K(je)&&e(j)});var M=H(A);Kr(M,17,()=>K(D).circles,Hr,(e,t)=>{var n=Qu();U(()=>{J(n,`cx`,K(t).cx),J(n,`cy`,K(t).cy),J(n,`r`,K(t).r),J(n,`stroke-width`,2*K(D).scale)}),q(e,n)});var Ce=H(M);Kr(Ce,17,()=>K(D).circles,Hr,(e,t,n)=>{var r=$u();J(r,`text-anchor`,n===0?`start`:`end`);var i=Zt(r,!0);U((e,t)=>{J(r,`x`,e),J(r,`y`,t),J(r,`font-size`,18*K(D).scale),Ar(i,K(C).circles[n]?.label??``)},[()=>n===0?Math.max(20*K(D).scale,K(t).cx-K(t).r):Math.min(K(D).width-20*K(D).scale,K(t).cx+K(t).r),()=>Math.max(26*K(D).scale,K(t).cy-K(t).r-12*K(D).scale)]),q(e,r)});var Te=H(Ce);N(c);var Ee=H(c,2);Kr(Ee,21,()=>K(ae).regions,Hr,(e,t)=>{let n=I(()=>de(K(t).hitRect.x+K(t).hitRect.w/2,K(t).hitRect.y+K(t).hitRect.h/2));var r=ed();U(()=>{J(r,`aria-label`,K(t).label),J(r,`data-region-key`,K(t).key),si(r,`left: ${K(n).left??``}%; top: ${K(n).top??``}%;`)}),q(e,r)}),N(Ee);var De=H(Ee,2);Kr(De,21,()=>Object.entries(K(ne)),Hr,(e,t)=>{var n=I(()=>b(K(t),2));let r=()=>K(n)[0],i=()=>K(n)[1],a=I(()=>K(ae).regionByKey[r()]);var o=Cr(),s=Xt(o),c=e=>{let t=I(()=>K(a).slots(i().length));var n=Cr();Kr(Xt(n),19,i,e=>e.id,(e,n,r)=>{let i=I(()=>de(K(t)[K(r)].x,K(t)[K(r)].y));var o=td(),s=Yt(o);{let e=I(()=>Vl(K(n),K(a).label,we(K(n).id),K(S))),t=I(()=>we(K(n).id)??`neutral`),r=I(()=>K(f)===K(n).id),i=I(()=>K(f)===K(n).id&&K(h)!==null);Jl(s,{fit:!0,get id(){return K(n).id},get label(){return K(n).label},get imageUrl(){return K(n).imageUrl},get imageAlt(){return K(n).imageAlt},get name(){return K(e)},get correctness(){return K(t)},get held(){return K(r)},get invisible(){return K(i)},get disabled(){return K(T)},onpointerdown:e=>k(K(n),e),onkeydown:e=>Se(K(n),e),onkeyup:xe,onclick:e=>be(K(n),e)})}N(o),U(()=>si(o,`left: ${K(i).left??``}%; top: ${K(i).top??``}%; width: ${K(ie).w??``}px; height: ${K(ie).h??``}px; transform: translate(-50%, -50%) scale(${K(oe)??``});`)),q(e,o)}),q(e,n)};Vr(s,e=>{K(a)&&e(c)}),q(e,o)}),N(De),N(n),_i(n,e=>V(l,e),()=>K(l));var Ne=H(n,2);{let e=I(()=>K(p)===`tray`||K(f)!==null&&K(m)===`tray`),t=I(()=>$(`tray`,K(S)));Zl(Ne,{get isDropTarget(){return K(e)},get label(){return K(t)},children:(e,t)=>{var n=Cr();Kr(Xt(n),17,()=>K(re),e=>e.id,(e,t)=>{{let n=I(()=>Vl(K(t),null,we(K(t).id),K(S))),r=I(()=>we(K(t).id)??`neutral`),i=I(()=>K(f)===K(t).id),a=I(()=>K(f)===K(t).id&&K(h)!==null);Jl(e,{get id(){return K(t).id},get label(){return K(t).label},get imageUrl(){return K(t).imageUrl},get imageAlt(){return K(t).imageAlt},get name(){return K(n)},get correctness(){return K(r)},get held(){return K(i)},get invisible(){return K(a)},get disabled(){return K(T)},onpointerdown:e=>k(K(t),e),onkeydown:e=>Se(K(t),e),onkeyup:xe,onclick:e=>be(K(t),e)})}}),q(e,n)},$$slots:{default:!0}})}U(e=>{r=si(n,``,r,{width:e,"aspect-ratio":`${K(D).width??``} / ${K(D).height??``}`}),J(c,`viewBox`,`0 0 ${K(D).width??``} ${K(D).height??``}`),J(d,`id`,i),J(d,`width`,K(D).width),J(d,`height`,K(D).height),J(_,`width`,K(D).width),J(_,`height`,K(D).height),J(v,`cx`,K(D).circles[0].cx),J(v,`cy`,K(D).circles[0].cy),J(v,`r`,K(D).circles[0].r),J(y,`cx`,K(D).circles[1].cx),J(y,`cy`,K(D).circles[1].cy),J(y,`r`,K(D).circles[1].r),J(x,`id`,a),J(x,`width`,K(D).width),J(x,`height`,K(D).height),J(w,`width`,K(D).width),J(w,`height`,K(D).height),J(E,`cx`,K(D).circles[1].cx),J(E,`cy`,K(D).circles[1].cy),J(E,`r`,K(D).circles[1].r),J(ee,`cx`,K(D).circles[0].cx),J(ee,`cy`,K(D).circles[0].cy),J(ee,`r`,K(D).circles[0].r),J(te,`id`,s),J(se,`cx`,K(D).circles[0].cx),J(se,`cy`,K(D).circles[0].cy),J(se,`r`,K(D).circles[0].r),J(ce,`id`,o),J(ce,`width`,K(D).width),J(ce,`height`,K(D).height),J(le,`width`,K(D).width),J(le,`height`,K(D).height),J(ue,`cx`,K(D).circles[0].cx),J(ue,`cy`,K(D).circles[0].cy),J(ue,`r`,K(D).circles[0].r),J(O,`cx`,K(D).circles[1].cx),J(O,`cy`,K(D).circles[1].cy),J(O,`r`,K(D).circles[1].r),J(fe,`x`,K(D).scale),J(fe,`y`,K(D).scale),J(fe,`width`,K(D).width-2*K(D).scale),J(fe,`height`,K(D).height-2*K(D).scale),J(fe,`stroke-width`,1.5*K(D).scale),J(fe,`rx`,12*K(D).scale),J(Te,`x1`,16*K(D).scale),J(Te,`x2`,K(D).width-16*K(D).scale),J(Te,`y1`,K(ae).outsideStripTop),J(Te,`y2`,K(ae).outsideStripTop),J(Te,`stroke-width`,K(D).scale),J(Te,`stroke-dasharray`,`${4*K(D).scale} ${6*K(D).scale}`)},[()=>hu(K(D),K(ie))]),hi(n,`clientWidth`,e=>V(g,e)),q(e,t)};Vr(He,e=>{K(ae)?e(We,-1):e(Ue)});var Ge=H(He,2),Ke=e=>{var t=rd();Jl(Yt(t),{get id(){return K(Ne).id},get label(){return K(Ne).label},get imageUrl(){return K(Ne).imageUrl},get imageAlt(){return K(Ne).imageAlt},get language(){return K(S)},correctness:`neutral`,ghost:!0}),N(t),U(()=>si(t,`left: ${K(h).x??``}px; top: ${K(h).y??``}px;`)),q(e,t)};Vr(Ge,e=>{K(Ne)&&K(h)&&e(Ke)}),_i(H(Ge,2),e=>u=e,()=>u),N(Pe),_i(Pe,e=>c=e,()=>c),dr(`focusout`,Pe,Ce),q(e,Pe),Ve()}fr([`focusout`,`click`]),Ti(od,{model:{type:`Object`},session:{type:`Object`},onSessionChange:{}},[],[]);function sd(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function cd(e,t){if(e===t)return e;if(!sd(e)||!sd(t)||Object.isFrozen(e)||!Object.isExtensible(e))return t;try{for(let n of Object.keys(e))n in t||delete e[n];Object.assign(e,t)}catch{return t}return e}var ld=class e extends CustomEvent{static{this.TYPE=`model-set`}constructor(t,n,r){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t,hasModel:r}}),this.component=t,this.complete=n}},ud=class e extends CustomEvent{static{this.TYPE=`session-changed`}constructor(t,n){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t}}),this.component=t,this.complete=n}};function dd(e,t){let n=e.element;if(!n)throw TypeError("defineDeliveryElement: the component was not compiled with `customElement`");class r extends n{#e;#t;constructor(){super(),this.onSessionChange=e=>{this.writeSession(e),this.dispatchSessionChanged()}}set model(e){this.#e=e,super.model=e,queueMicrotask(()=>{this.dispatchEvent(new ld(this.tagName.toLowerCase(),this.isComplete(),this.#e!==void 0))})}get model(){return this.#e}set session(e){this.#t=e,super.session=e,this.dispatchSessionChanged()}get session(){return this.#t}isComplete(){return t.isComplete(this.#e,this.#t)}writeSession(e){this.#t=cd(this.#t,e),super.session=e}dispatchSessionChanged(){this.dispatchEvent(new ud(this.tagName.toLowerCase(),this.isComplete()))}}return r}return dd(od,{isComplete:Ru})})();
57
+ /* Tailwind's \`sr-only\`, scoped: PIE players ship no Tailwind. */.sr-only.svelte-gkcqor {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}.drag-ghost.svelte-gkcqor {position:fixed;top:0;left:0;transform:translate(-50%, -50%);pointer-events:none;z-index:1000;}`};function pd(e,t){Be(t,!0),$r(e,fd);let n=[{label:`Set A`},{label:`Set B`}],r=`venn-${Math.random().toString(36).slice(2,10)}`,i=`${r}-mask-left-only`,a=`${r}-mask-right-only`,o=`${r}-mask-outside`,s=`${r}-clip-left`,c=null,l=Mt(null),u=null,d=Mt(!1),f=Mt(null),p=Mt(null),m=Mt(null),h=Mt(null),g=Mt(0),_=null,v=null,y=I(()=>t?.model?.circles??n),x=I(()=>K(y).length===2),S=I(()=>t?.model?.language),C=I(()=>({circles:K(y),tiles:t?.model?.tiles??[],regionLabels:t?.model?.regionLabels??{},language:K(S),scoringPolicy:`partialPerTile`,promptEnabled:!0})),w=I(()=>t?.model?.env?.mode===`evaluate`),T=I(()=>t?.model?.disabled===!0),E=I(()=>t?.model?.prompt??null),ee=I(()=>le(t?.session,t?.model,K(d))),te=I(()=>({placements:K(ee)})),ne=I(()=>Xu(K(C),K(te))),re=I(()=>Yu(K(C),K(te))),ie=I(()=>(K(C).tiles??[]).some(e=>(e.imageUrl??``).trim())?hu:mu),D=I(()=>Vu(Object.fromEntries(Object.entries(K(ne)).map(([e,t])=>[e,t.length])),K(ie))),ae=I(()=>K(x)?Hu(K(C),K(D),K(ie)):null),oe=I(()=>Cu(K(g),K(D),K(ie))),se=I(()=>[`0`,`0,1`,`1`,``,`tray`]),ce;fn(()=>{let e=t?.session,n=K(w)&&!!t?.model?.correctRegionsById;ar(()=>{(!n||e!==ce)&&V(d,!1),ce=e})}),un(()=>{K(T)&&ar(_e)}),Br(()=>{_?.()});function le(e,t,n){let r={...e?.placements??{}};if(n&&t?.correctRegionsById)for(let[e,n]of Object.entries(t.correctRegionsById))r[e]=n;return r}function ue(e){u&&(u.textContent=``,requestAnimationFrame(()=>{u&&(u.textContent=e)}))}function de(e,t){return{left:e/K(D).width*100,top:t/K(D).height*100}}function O(e,t){if(!K(l))return null;let n=K(l).getBoundingClientRect();if(n.width===0||n.height===0)return null;let r=(e-n.left)/n.width,i=(t-n.top)/n.height;return{x:r*K(D).width,y:i*K(D).height}}function fe(e,n){let r=Ku({model:K(C),session:t?.session,tileId:e,placement:n});t.onSessionChange?.(r)}function pe(e){return e?(K(C).tiles||[]).find(t=>t.id===e)??null:null}function me(e){return K(ae)?.regionByKey[e]}function he(e){return e===`tray`?$(`tray`,K(S)):me(e)?.label??$(`unknownTarget`,K(S))}function ge(){V(f,null),V(m,null),V(p,null),V(h,null)}function _e(){_?.(),K(f)!==null&&ge()}function ve(e,n){let r=ql(e,K(S)),i=n===`tray`?null:n===null?void 0:me(n)?.region;if(i===void 0||Ju(t?.session,e.id,i)){ue($(`cancelled`,K(S)));return}fe(e.id,i),ue(i===null?$(`returnedToTray`,K(S),{name:r}):$(`placedIn`,K(S),{name:r,target:he(n)}))}function k(e,t){if(K(T))return;t.preventDefault(),_?.(),t.currentTarget.setPointerCapture?.(t.pointerId),V(f,e.id,!0),V(m,null),V(h,{x:t.clientX,y:t.clientY},!0),V(p,ye(t.clientX,t.clientY),!0),ue($(`pickedUp`,K(S),{name:ql(e,K(S))}));let n=e=>{V(h,{x:e.clientX,y:e.clientY},!0),V(p,ye(e.clientX,e.clientY),!0)},r=t=>{a();let n=ye(t.clientX,t.clientY),r=K(p);ge(),!K(T)&&ve(e,n??r)},i=()=>{a(),ge(),ue($(`cancelled`,K(S)))},a=()=>{window.removeEventListener(`pointermove`,n),window.removeEventListener(`pointerup`,r),window.removeEventListener(`pointercancel`,i),_===a&&(_=null)};_=a,window.addEventListener(`pointermove`,n),window.addEventListener(`pointerup`,r),window.addEventListener(`pointercancel`,i)}function ye(e,t){if(A(e,t))return`tray`;let n=O(e,t);if(!n||!K(ae))return null;let r=Uu(K(ae),n.x,n.y);return r?r.key:null}function A(e,t){let n=c?.querySelector(`[data-region-key="tray"]`);if(!n)return!1;let r=n.getBoundingClientRect();return e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom}async function j(e){await nr();let t=c?.querySelectorAll(`button[data-tile-id]`)??[];for(let n of t)if(n.dataset.tileId===e&&n.getAttribute(`aria-hidden`)!==`true`){n.focus();return}}function M(e){if(K(f)===e.id){let t=K(m);ge(),ve(e,t),j(e.id)}else{let t=qu(K(te),e.id),n=t===null?K(se)[0]??null:cu(t);V(f,e.id,!0),V(m,n,!0),ue($(`pickedUpWithKeyboard`,K(S),{name:ql(e,K(S)),target:he(n??``)}))}}function be(e,t){if(!(K(T)||t.detail!==0)){if(v===e.id){v=null;return}M(e)}}function xe(){setTimeout(()=>{v=null},0)}function Se(e,t){if(!K(T)){if(t.key===` `||t.key===`Enter`){t.preventDefault(),v=e.id,M(e);return}if(t.key===`Escape`&&K(f)===e.id){t.preventDefault(),ge(),ue($(`cancelled`,K(S)));return}if(K(f)===e.id&&(t.key===`ArrowLeft`||t.key===`ArrowRight`||t.key===`ArrowUp`||t.key===`ArrowDown`||t.key===`Tab`)){t.preventDefault();let e=K(m)??K(se)[0]??`0`,n=K(se).indexOf(e);n<0&&(n=0);let r=t.key===`ArrowLeft`||t.key===`ArrowUp`||t.key===`Tab`&&t.shiftKey?-1:1;n=(n+r+K(se).length)%K(se).length,V(m,K(se)[n],!0),ue($(`dropTarget`,K(S),{target:he(K(m))}))}}}function Ce(e){if(K(f)===null||K(h)!==null)return;let t=e.relatedTarget;t&&c?.contains(t)||(ge(),ue($(`cancelled`,K(S))))}function we(e){if(!K(w)||K(d))return null;let n=t?.model?.correctness?.[e];return n===`correct`||n===`incorrect`||n===`unanswered`?n:null}function Te(){if(!c)return;let e=e=>console.warn(`venn-classification: MathJax render failed`,e);try{Promise.resolve(Vc(c)).catch(e)}catch(t){e(t)}}zr(()=>{nr().then(Te)}),un(()=>{K(ee),K(C).tiles?.length,nr().then(Te)});let Ee=I(()=>K(w)?Object.values(t?.model?.correctness??{}).filter(e=>e===`incorrect`||e===`unanswered`).length:0),De=I(()=>K(f)===null?K(p)??null:K(p)??K(m)??null),Oe=I(()=>K(De)===`0`),ke=I(()=>K(De)===`1`),Ae=I(()=>K(De)===`0,1`),je=I(()=>K(De)===``),Me=`color-mix(in srgb, var(--pie-primary, #2563eb) 18%, transparent)`,Ne=I(()=>K(f)!==null&&K(h)!==null?pe(K(f)):null);var Pe=dd(),Fe=Yt(Pe),Ie=e=>{su(e,{get html(){return t.model.teacherInstructions},get language(){return K(S)}})};Vr(Fe,e=>{t?.model?.teacherInstructions&&e(Ie)});var Le=H(Fe,2),Re=e=>{var t=Zu();Qr(t,()=>ho(K(E)),!0),N(t),q(e,t)};Vr(Le,e=>{K(E)&&e(Re)});var P=H(Le,2),ze=e=>{var t=ed(),n=Yt(t),r=e=>{q(e,Qu())},i=e=>{q(e,$u())};Vr(n,e=>{K(d)?e(r):e(i,-1)});var a=Zt(H(n,2),!0);N(t),U(e=>{J(t,`aria-pressed`,K(d)),Ar(a,e)},[()=>Gl(K(d)?`hideCorrectAnswer`:`showCorrectAnswer`,K(S))]),dr(`click`,t,()=>V(d,!K(d))),q(e,t)};Vr(P,e=>{K(w)&&K(Ee)>0&&e(ze)});var He=H(P,2),Ue=e=>{var t=td(),n=Zt(t,!0);U(e=>Ar(n,e),[()=>$(`unsupportedCircles`,K(S),{count:K(y).length,supported:2})]),q(e,t)},We=e=>{var t=ld(),n=Xt(t);let r;var c=Yt(n),u=Yt(c),d=Yt(u),_=Yt(d),v=H(_),y=H(v);N(d);var x=H(d),w=Yt(x),E=H(w),ee=H(E);N(x);var te=H(x),se=Zt(te),ce=H(te),le=Yt(ce),ue=H(le),O=H(ue);N(ce),N(u);var fe=H(u),pe=H(fe);Kr(pe,17,()=>K(D).circles,Hr,(e,t)=>{var n=nd();U(()=>{J(n,`cx`,K(t).cx),J(n,`cy`,K(t).cy),J(n,`r`,K(t).r)}),q(e,n)});var me=H(pe),he=e=>{var t=rd();J(t,`fill`,Me),U(()=>{J(t,`width`,K(D).width),J(t,`height`,K(D).height),J(t,`mask`,`url(#${i})`)}),q(e,t)};Vr(me,e=>{K(Oe)&&e(he)});var ge=H(me),_e=e=>{var t=rd();J(t,`fill`,Me),U(()=>{J(t,`width`,K(D).width),J(t,`height`,K(D).height),J(t,`mask`,`url(#${a})`)}),q(e,t)};Vr(ge,e=>{K(ke)&&e(_e)});var ve=H(ge),ye=e=>{var t=id();J(t,`fill`,Me),U(()=>{J(t,`cx`,K(D).circles[1].cx),J(t,`cy`,K(D).circles[1].cy),J(t,`r`,K(D).circles[1].r),J(t,`clip-path`,`url(#${s})`)}),q(e,t)};Vr(ve,e=>{K(Ae)&&e(ye)});var A=H(ve),j=e=>{var t=rd();J(t,`fill`,Me),U(()=>{J(t,`width`,K(D).width),J(t,`height`,K(D).height),J(t,`mask`,`url(#${o})`)}),q(e,t)};Vr(A,e=>{K(je)&&e(j)});var M=H(A);Kr(M,17,()=>K(D).circles,Hr,(e,t)=>{var n=ad();U(()=>{J(n,`cx`,K(t).cx),J(n,`cy`,K(t).cy),J(n,`r`,K(t).r),J(n,`stroke-width`,2*K(D).scale)}),q(e,n)});var Ce=H(M);Kr(Ce,17,()=>K(D).circles,Hr,(e,t,n)=>{var r=od();J(r,`text-anchor`,n===0?`start`:`end`);var i=Zt(r,!0);U((e,t)=>{J(r,`x`,e),J(r,`y`,t),J(r,`font-size`,18*K(D).scale),Ar(i,K(C).circles[n]?.label??``)},[()=>n===0?Math.max(20*K(D).scale,K(t).cx-K(t).r):Math.min(K(D).width-20*K(D).scale,K(t).cx+K(t).r),()=>Math.max(26*K(D).scale,K(t).cy-K(t).r-12*K(D).scale)]),q(e,r)});var Te=H(Ce);N(c);var Ee=H(c,2);Kr(Ee,21,()=>K(ae).regions,Hr,(e,t)=>{let n=I(()=>de(K(t).hitRect.x+K(t).hitRect.w/2,K(t).hitRect.y+K(t).hitRect.h/2));var r=sd();U(()=>{J(r,`aria-label`,K(t).label),J(r,`data-region-key`,K(t).key),si(r,`left: ${K(n).left??``}%; top: ${K(n).top??``}%;`)}),q(e,r)}),N(Ee);var De=H(Ee,2);Kr(De,21,()=>Object.entries(K(ne)),Hr,(e,t)=>{var n=I(()=>b(K(t),2));let r=()=>K(n)[0],i=()=>K(n)[1],a=I(()=>K(ae).regionByKey[r()]);var o=Cr(),s=Xt(o),c=e=>{let t=I(()=>K(a).slots(i().length));var n=Cr();Kr(Xt(n),19,i,e=>e.id,(e,n,r)=>{let i=I(()=>de(K(t)[K(r)].x,K(t)[K(r)].y));var o=cd(),s=Yt(o);{let e=I(()=>Jl(K(n),K(a).label,we(K(n).id),K(S))),t=I(()=>we(K(n).id)??`neutral`),r=I(()=>K(f)===K(n).id),i=I(()=>K(f)===K(n).id&&K(h)!==null);tu(s,{fit:!0,get id(){return K(n).id},get label(){return K(n).label},get imageUrl(){return K(n).imageUrl},get imageAlt(){return K(n).imageAlt},get name(){return K(e)},get correctness(){return K(t)},get held(){return K(r)},get invisible(){return K(i)},get disabled(){return K(T)},onpointerdown:e=>k(K(n),e),onkeydown:e=>Se(K(n),e),onkeyup:xe,onclick:e=>be(K(n),e)})}N(o),U(()=>si(o,`left: ${K(i).left??``}%; top: ${K(i).top??``}%; width: ${K(ie).w??``}px; height: ${K(ie).h??``}px; transform: translate(-50%, -50%) scale(${K(oe)??``});`)),q(e,o)}),q(e,n)};Vr(s,e=>{K(a)&&e(c)}),q(e,o)}),N(De),N(n),_i(n,e=>V(l,e),()=>K(l));var Ne=H(n,2);{let e=I(()=>K(p)===`tray`||K(f)!==null&&K(m)===`tray`),t=I(()=>$(`tray`,K(S)));iu(Ne,{get isDropTarget(){return K(e)},get label(){return K(t)},children:(e,t)=>{var n=Cr();Kr(Xt(n),17,()=>K(re),e=>e.id,(e,t)=>{{let n=I(()=>Jl(K(t),null,we(K(t).id),K(S))),r=I(()=>we(K(t).id)??`neutral`),i=I(()=>K(f)===K(t).id),a=I(()=>K(f)===K(t).id&&K(h)!==null);tu(e,{get id(){return K(t).id},get label(){return K(t).label},get imageUrl(){return K(t).imageUrl},get imageAlt(){return K(t).imageAlt},get name(){return K(n)},get correctness(){return K(r)},get held(){return K(i)},get invisible(){return K(a)},get disabled(){return K(T)},onpointerdown:e=>k(K(t),e),onkeydown:e=>Se(K(t),e),onkeyup:xe,onclick:e=>be(K(t),e)})}}),q(e,n)},$$slots:{default:!0}})}U(e=>{r=si(n,``,r,{width:e,"aspect-ratio":`${K(D).width??``} / ${K(D).height??``}`}),J(c,`viewBox`,`0 0 ${K(D).width??``} ${K(D).height??``}`),J(d,`id`,i),J(d,`width`,K(D).width),J(d,`height`,K(D).height),J(_,`width`,K(D).width),J(_,`height`,K(D).height),J(v,`cx`,K(D).circles[0].cx),J(v,`cy`,K(D).circles[0].cy),J(v,`r`,K(D).circles[0].r),J(y,`cx`,K(D).circles[1].cx),J(y,`cy`,K(D).circles[1].cy),J(y,`r`,K(D).circles[1].r),J(x,`id`,a),J(x,`width`,K(D).width),J(x,`height`,K(D).height),J(w,`width`,K(D).width),J(w,`height`,K(D).height),J(E,`cx`,K(D).circles[1].cx),J(E,`cy`,K(D).circles[1].cy),J(E,`r`,K(D).circles[1].r),J(ee,`cx`,K(D).circles[0].cx),J(ee,`cy`,K(D).circles[0].cy),J(ee,`r`,K(D).circles[0].r),J(te,`id`,s),J(se,`cx`,K(D).circles[0].cx),J(se,`cy`,K(D).circles[0].cy),J(se,`r`,K(D).circles[0].r),J(ce,`id`,o),J(ce,`width`,K(D).width),J(ce,`height`,K(D).height),J(le,`width`,K(D).width),J(le,`height`,K(D).height),J(ue,`cx`,K(D).circles[0].cx),J(ue,`cy`,K(D).circles[0].cy),J(ue,`r`,K(D).circles[0].r),J(O,`cx`,K(D).circles[1].cx),J(O,`cy`,K(D).circles[1].cy),J(O,`r`,K(D).circles[1].r),J(fe,`x`,K(D).scale),J(fe,`y`,K(D).scale),J(fe,`width`,K(D).width-2*K(D).scale),J(fe,`height`,K(D).height-2*K(D).scale),J(fe,`stroke-width`,1.5*K(D).scale),J(fe,`rx`,12*K(D).scale),J(Te,`x1`,16*K(D).scale),J(Te,`x2`,K(D).width-16*K(D).scale),J(Te,`y1`,K(ae).outsideStripTop),J(Te,`y2`,K(ae).outsideStripTop),J(Te,`stroke-width`,K(D).scale),J(Te,`stroke-dasharray`,`${4*K(D).scale} ${6*K(D).scale}`)},[()=>Su(K(D),K(ie))]),hi(n,`clientWidth`,e=>V(g,e)),q(e,t)};Vr(He,e=>{K(ae)?e(We,-1):e(Ue)});var Ge=H(He,2),Ke=e=>{var t=ud();tu(Yt(t),{get id(){return K(Ne).id},get label(){return K(Ne).label},get imageUrl(){return K(Ne).imageUrl},get imageAlt(){return K(Ne).imageAlt},get language(){return K(S)},correctness:`neutral`,ghost:!0}),N(t),U(()=>si(t,`left: ${K(h).x??``}px; top: ${K(h).y??``}px;`)),q(e,t)};Vr(Ge,e=>{K(Ne)&&K(h)&&e(Ke)}),_i(H(Ge,2),e=>u=e,()=>u),N(Pe),_i(Pe,e=>c=e,()=>c),dr(`focusout`,Pe,Ce),q(e,Pe),Ve()}fr([`focusout`,`click`]),Ti(pd,{model:{type:`Object`},session:{type:`Object`},onSessionChange:{}},[],[]);function md(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function hd(e,t){if(e===t)return e;if(!md(e)||!md(t)||Object.isFrozen(e)||!Object.isExtensible(e))return t;try{for(let n of Object.keys(e))n in t||delete e[n];Object.assign(e,t)}catch{return t}return e}var gd=class e extends CustomEvent{static{this.TYPE=`model-set`}constructor(t,n,r){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t,hasModel:r}}),this.component=t,this.complete=n}},_d=class e extends CustomEvent{static{this.TYPE=`session-changed`}constructor(t,n){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t}}),this.component=t,this.complete=n}};function vd(e,t){let n=e.element;if(!n)throw TypeError("defineDeliveryElement: the component was not compiled with `customElement`");class r extends n{#e;#t;constructor(){super(),this.onSessionChange=e=>{this.writeSession(e),this.dispatchSessionChanged()}}set model(e){this.#e=e,super.model=e,queueMicrotask(()=>{this.dispatchEvent(new gd(this.tagName.toLowerCase(),this.isComplete(),this.#e!==void 0))})}get model(){return this.#e}set session(e){this.#t=e,super.session=e,this.dispatchSessionChanged()}get session(){return this.#t}isComplete(){return t.isComplete(this.#e,this.#t)}writeSession(e){this.#t=hd(this.#t,e),super.session=e}dispatchSessionChanged(){this.dispatchEvent(new _d(this.tagName.toLowerCase(),this.isComplete()))}}return r}return vd(pd,{isComplete:Gu})})();