From 7126e355c988ce3588e288fcff4333d80bcf6038 Mon Sep 17 00:00:00 2001 From: blmage Date: Sat, 5 Sep 2020 10:25:51 +0200 Subject: [PATCH] Update production build and bump extension version --- dist/manifest.json | 2 +- dist/src/ui.js | 2 +- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/manifest.json b/dist/manifest.json index 726d7ab..0147ba8 100644 --- a/dist/manifest.json +++ b/dist/manifest.json @@ -1,6 +1,6 @@ { "name": "Duolingo Solution Viewer", - "version": "3.0.2", + "version": "3.0.3", "description": "Provides access to the lists of solutions for Duolingo's translation / listening challenges, and restores typos correction.", "permissions": [ "activeTab", diff --git a/dist/src/ui.js b/dist/src/ui.js index 88738f2..8e56cba 100644 --- a/dist/src/ui.js +++ b/dist/src/ui.js @@ -12,4 +12,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */var pr="object"==typeof window,hr=o((function(t,e){var n;n=function(){function t(){for(var t=0,e={};t=0?e%t.length:t.length+e%t.length,r())},setState:function(e){if(n()){var i=t.length?t.indexOf(e):-1;if(-1===i)throw new Error("State '"+e+"' is not a valid state (does not exist in state list)");o.current=i,r()}}}}),[t]),a=(0===o.current?t.length:o.current)-1,c=(o.current+1)%t.length;return sr({state:t[o.current],prevState:t[a],nextState:t[c],currentIndex:o.current,prevIndex:a,nextIndex:c},u)}var wr=function(t){for(var e=5381,n=t.length;n;)e=33*e^t.charCodeAt(--n);return e>>>0},kr=Sr;function Sr(t){Cr.length||Or(),Cr[Cr.length]=t}var Or,Cr=[],Ar=0;function jr(){for(;Ar1024){for(var e=0,n=Cr.length-Ar;e0&&(a[c]=f)}else{var d=(0,r.default)(u,c,l,a,e);d&&(a[c]=d),a=(0,n.default)(e,c,a)}}return a}};var n=u(ii),r=u(oi),i=u(ui),o=u(ai);function u(t){return t&&t.__esModule?t:{default:t}}}))),li=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if("string"==typeof e&&"text"===e)return["-webkit-text","text"]}}))),fi=ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return"string"==typeof t&&n.test(t)};var n=/-webkit-|-moz-|-ms-/;t.exports=e.default}));ei(fi);var si=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if("string"==typeof e&&!(0,r.default)(e)&&e.indexOf("calc(")>-1)return i.map((function(t){return e.replace(/calc\(/g,t+"calc(")}))};var n,r=(n=fi)&&n.__esModule?n:{default:n};var i=["-webkit-","-moz-",""]}))),pi=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if("string"==typeof e&&!(0,r.default)(e)&&e.indexOf("cross-fade(")>-1)return i.map((function(t){return e.replace(/cross-fade\(/g,t+"cross-fade(")}))};var n,r=(n=fi)&&n.__esModule?n:{default:n};var i=["-webkit-",""]}))),hi=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if("cursor"===t&&r.hasOwnProperty(e))return n.map((function(t){return t+e}))};var n=["-webkit-","-moz-",""],r={"zoom-in":!0,"zoom-out":!0,grab:!0,grabbing:!0}}))),di=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if("string"==typeof e&&!(0,r.default)(e)&&e.indexOf("filter(")>-1)return i.map((function(t){return e.replace(/filter\(/g,t+"filter(")}))};var n,r=(n=fi)&&n.__esModule?n:{default:n};var i=["-webkit-",""]}))),_i=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if("display"===t&&n.hasOwnProperty(e))return n[e]};var n={flex:["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex","flex"],"inline-flex":["-webkit-inline-box","-moz-inline-box","-ms-inline-flexbox","-webkit-inline-flex","inline-flex"]}}))),vi=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,u){Object.prototype.hasOwnProperty.call(r,t)&&(u[r[t]]=n[e]||e);if("flex"===t){if(Object.prototype.hasOwnProperty.call(i,e))return void(u.msFlex=i[e]);if(o.test(e))return void(u.msFlex=e+" 1 0%");var a=e.split(/\s/);switch(a.length){case 1:return void(u.msFlex="1 1 "+e);case 2:return void(o.test(a[1])?u.msFlex=a[0]+" "+a[1]+" 0%":u.msFlex=a[0]+" 1 "+a[1]);default:u.msFlex=e}}};var n={"space-around":"distribute","space-between":"justify","flex-start":"start","flex-end":"end"},r={alignContent:"msFlexLinePack",alignSelf:"msFlexItemAlign",alignItems:"msFlexAlign",justifyContent:"msFlexPack",order:"msFlexOrder",flexGrow:"msFlexPositive",flexShrink:"msFlexNegative",flexBasis:"msFlexPreferredSize"},i={auto:"1 1 auto",inherit:"inherit",initial:"0 1 auto",none:"0 0 auto",unset:"unset"},o=/^\d+(\.\d+)?$/}))),gi=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,i){"flexDirection"===t&&"string"==typeof e&&(e.indexOf("column")>-1?i.WebkitBoxOrient="vertical":i.WebkitBoxOrient="horizontal",e.indexOf("reverse")>-1?i.WebkitBoxDirection="reverse":i.WebkitBoxDirection="normal");r.hasOwnProperty(t)&&(i[r[t]]=n[e]||e)};var n={"space-around":"justify","space-between":"justify","flex-start":"start","flex-end":"end","wrap-reverse":"multiple",wrap:"multiple"},r={alignItems:"WebkitBoxAlign",justifyContent:"WebkitBoxPack",flexWrap:"WebkitBoxLines",flexGrow:"WebkitBoxFlex"}}))),yi=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if("string"==typeof e&&!(0,r.default)(e)&&o.test(e))return i.map((function(t){return e.replace(o,(function(e){return t+e}))}))};var n,r=(n=fi)&&n.__esModule?n:{default:n};var i=["-webkit-","-moz-",""],o=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/gi}))),mi=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function r(t){return"number"==typeof t&&!isNaN(t)}e.default=function(t,e,n){if("display"===t&&e in o)return o[e];if(t in u){(0,u[t])(e,n)}};var i=["center","end","start","stretch"],o={"inline-grid":["-ms-inline-grid","inline-grid"],grid:["-ms-grid","grid"]},u={alignSelf:function(t,e){i.indexOf(t)>-1&&(e.msGridRowAlign=t)},gridColumn:function(t,e){if(r(t))e.msGridColumn=t;else{var i=t.split("/").map((function(t){return+t})),o=n(i,2),a=o[0],c=o[1];u.gridColumnStart(a,e),u.gridColumnEnd(c,e)}},gridColumnEnd:function(t,e){var n=e.msGridColumn;r(t)&&r(n)&&(e.msGridColumnSpan=t-n)},gridColumnStart:function(t,e){r(t)&&(e.msGridColumn=t)},gridRow:function(t,e){if(r(t))e.msGridRow=t;else{var i=t.split("/").map((function(t){return+t})),o=n(i,2),a=o[0],c=o[1];u.gridRowStart(a,e),u.gridRowEnd(c,e)}},gridRowEnd:function(t,e){var n=e.msGridRow;r(t)&&r(n)&&(e.msGridRowSpan=t-n)},gridRowStart:function(t,e){r(t)&&(e.msGridRow=t)},gridTemplateColumns:function(t,e){e.msGridColumns=t},gridTemplateRows:function(t,e){e.msGridRows=t},justifySelf:function(t,e){i.indexOf(t)>-1&&(e.msGridColumnAlign=t)}}}))),bi=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if("string"==typeof e&&!(0,r.default)(e)&&e.indexOf("image-set(")>-1)return i.map((function(t){return e.replace(/image-set\(/g,t+"image-set(")}))};var n,r=(n=fi)&&n.__esModule?n:{default:n};var i=["-webkit-",""]}))),xi=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){if(Object.prototype.hasOwnProperty.call(n,t))for(var i=n[t],o=0,u=i.length;o-1&&"order"!==s)for(var p=e[f],h=0,d=p.length;h-1)return f;var s=l.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter((function(t){return!/-webkit-|-ms-/.test(t)})).join(",");return t.indexOf("Moz")>-1?s:(o["Webkit"+(0,i.default)(t)]=f,o["Moz"+(0,i.default)(t)]=s,l)}};var n=o(Ei),r=o(fi),i=o(ri);function o(t){return t&&t.__esModule?t:{default:t}}var u={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},a={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"}})))],prefixMap:{transform:Ti,transformOrigin:Ti,transformOriginX:Ti,transformOriginY:Ti,backfaceVisibility:zi,perspective:zi,perspectiveOrigin:zi,transformStyle:zi,transformOriginZ:zi,animation:zi,animationDelay:zi,animationDirection:zi,animationFillMode:zi,animationDuration:zi,animationIterationCount:zi,animationName:zi,animationPlayState:zi,animationTimingFunction:zi,appearance:Mi,userSelect:Ni,fontKerning:zi,textEmphasisPosition:zi,textEmphasis:zi,textEmphasisStyle:zi,textEmphasisColor:zi,boxDecorationBreak:zi,clipPath:zi,maskImage:zi,maskMode:zi,maskRepeat:zi,maskPosition:zi,maskClip:zi,maskOrigin:zi,maskSize:zi,maskComposite:zi,mask:zi,maskBorderSource:zi,maskBorderMode:zi,maskBorderSlice:zi,maskBorderWidth:zi,maskBorderOutset:zi,maskBorderRepeat:zi,maskBorder:zi,maskType:zi,textDecorationStyle:Mi,textDecorationSkip:Mi,textDecorationLine:Mi,textDecorationColor:Mi,filter:zi,fontFeatureSettings:Mi,breakAfter:Ni,breakBefore:Ni,breakInside:Ni,columnCount:Mi,columnFill:Mi,columnGap:Mi,columnRule:Mi,columnRuleColor:Mi,columnRuleStyle:Mi,columnRuleWidth:Mi,columns:Mi,columnSpan:Mi,columnWidth:Mi,writingMode:Ti,flex:Ti,flexBasis:zi,flexDirection:Ti,flexGrow:zi,flexFlow:Ti,flexShrink:zi,flexWrap:Ti,alignContent:zi,alignItems:zi,alignSelf:zi,justifyContent:zi,order:zi,transitionDelay:zi,transitionDuration:zi,transitionProperty:zi,transitionTimingFunction:zi,backdropFilter:zi,scrollSnapType:Ti,scrollSnapPointsX:Ti,scrollSnapPointsY:Ti,scrollSnapDestination:Ti,scrollSnapCoordinate:Ti,shapeImageThreshold:zi,shapeImageMargin:zi,shapeImageOutside:zi,hyphens:Ni,flowInto:Ti,flowFrom:Ti,regionFragment:Ti,textOrientation:zi,boxSizing:Ii,textAlignLast:Ii,tabSize:Ii,wrapFlow:Pi,wrapThrough:Pi,wrapMargin:Pi,touchAction:Pi,textSizeAdjust:Ti,borderImage:zi,borderImageOutset:zi,borderImageRepeat:zi,borderImageSlice:zi,borderImageSource:zi,borderImageWidth:zi}}),Wi=[function(t,e,n){return":"!==t[0]?null:n(e+t)},function(t,e,n){if("@"!==t[0])return null;var r=n(e);return["".concat(t,"{").concat(r.join(""),"}")]}],Bi=function t(e,n,r,i,o){for(var u=new ti,a=0;a4&&void 0!==arguments[4]?arguments[4]:[];if(!Hi[t]){var o=Bi(e,n,i,Ui,r);$i(t,o)}},Vi=function(){Gi=[],Hi={},Ki=!1,Di=null},Zi=function(t){delete Hi[t]},Yi=function(){Ki=!1;var t=Gi;return Gi=[],t},Xi=function(){var t=Yi();t.length>0&&function(t){if(null==Di&&null==(Di=document.querySelector("style[data-aphrodite]"))){var e=document.head||document.getElementsByTagName("head")[0];(Di=document.createElement("style")).type="text/css",Di.setAttribute("data-aphrodite",""),e.appendChild(Di)}var n=Di.styleSheet||Di.sheet;if(n.insertRule){var r=n.cssRules.length;t.forEach((function(t){try{n.insertRule(t,r),r+=1}catch(t){}}))}else Di.innerText=(Di.innerText||"")+t.join("")}(t)},Qi=function(t){t.forEach((function(t){Hi[t]=!0}))},to=function(t,e,n){var r,i=[],o=[],u=function t(e,n,r,i){for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:[];Qi(t)}},io="undefined"!=typeof window?null:{renderStatic:function(t){return Vi(),function(){if(Ki)throw new Error("Cannot buffer while already buffering");Ki=!0}(),{html:t(),css:{content:Yi().join(""),renderedClassNames:Object.keys(Hi)}}}};var oo=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wi;return{StyleSheet:Ur({},ro,{extend:function(r){var i=r.map((function(t){return t.selectorHandler})).filter((function(t){return t}));return t(e,n.concat(i))}}),StyleSheetServer:io,StyleSheetTestUtils:null,minify:function(t){no=t?Yr:eo},css:function(){for(var t=arguments.length,r=new Array(t),i=0;i1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return rr(r=>(Bn.isArray(r)?r:[r]).flatMap(r=>{var i=[];return e[So]&&e[So][r]&&i.push(ao(e[So][r])),t[So]&&t[So][r]&&i.push(...t[So][r]),n.forEach(n=>{n&&e[n]&&e[n][r]&&i.push(ao(e[n][r])),n&&t[n]&&t[n][r]&&i.push(...t[n][r])}),i}).join(" "),n.concat([t,e]))},jo=(t,e,n)=>function(t,e,n){if(!pr)return[e,br,br];if(!t)throw new Error("useLocalStorage key may not be falsy");var r=n?n.raw?function(t){return t}:n.deserializer:JSON.parse,i=Xn((function(){try{var i=n?n.raw?String:n.serializer:JSON.stringify,o=localStorage.getItem(t);return null!==o?r(o):(e&&localStorage.setItem(t,i(e)),e)}catch(t){return e}})),o=i[0],u=i[1],a=rr((function(e){try{var i="function"==typeof e?e(o):e;if(void 0===i)return;var a=void 0;a=n?n.raw?"string"==typeof i?i:JSON.stringify(i):n.serializer?n.serializer(i):JSON.stringify(i):JSON.stringify(i),localStorage.setItem(t,a),u(r(a))}catch(t){}}),[t,u]),c=rr((function(){try{localStorage.removeItem(t),u(void 0)}catch(t){}}),[t,u]);return[o,a,c]}(co+t,e,n),Eo=(t,e,n)=>{var[r,i]=jo(t,n),{state:o,prevState:u,nextState:a,prev:c,next:l}=xr(e,n!==r&&-1===e.indexOf(r)?n:r);return tr(()=>i(o),[o,i]),{state:o,prevState:u,nextState:a,prev:c,next:l}},zo=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=arguments.length>2?arguments[2]:void 0,r=er();return rr(()=>{r.current||(t(...n),r.current=setTimeout(()=>r.current=null,e))},n.concat(t,e))},Io=()=>{var t=Ao({},To);return en("div",{className:t(Po)},en("div",{className:t(Mo)}),en("div",{className:t(Mo)}),en("div",{className:t(Mo)}))},Po="wrapper",Mo="ball",To={[So]:uo.create({[Po]:{alignItems:"center",display:"inline-flex",justifyContent:"space-between"},[Mo]:{animationName:[{"0%, 80%, 100%":{opacity:.25},"40%":{opacity:1}}],animationDuration:"1.6s",animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",backgroundColor:"currentColor",borderRadius:"100%",height:"8px",margin:"0 5px",width:"8px",":nth-child(1)":{animationDelay:"-0.32s"},":nth-child(2)":{animationDelay:"-0.16s"}}})},No=i(o((function(t,e){!function(t){var e=Object.prototype.hasOwnProperty,n=function(t){for(var n,r=0;r<(arguments.length<=1?0:arguments.length-1);r++)if((n=r+1<1||arguments.length<=r+1?void 0:arguments[r+1])&&"object"==typeof n)for(var i in n)e.call(n,i)&&(t[i]=n[i]);return t},r=function(t){var e=t.length;if(!e)return[];if(1===e)return[t[0]];if(2===e)return[t[0],t[1]];if(3===e)return[t[0],t[1],t[2]];for(var n=new Array(e),r=0;r=v&&(z.pop(),I.pop());var u=j?i:r(n),c=t.apply(this,e);a(z,u,z.length),a(I,c,I.length),d&&A(E,P),y(E,O,P),b(E,O,P)}return I[0]}return Object.defineProperties(P,{cache:{configurable:!0,get:function(){return E}},cacheSnapshot:{configurable:!0,get:function(){return{keys:r(E.keys),size:E.size,values:r(E.values)}}},isMemoized:{configurable:!0,get:function(){return!0}},options:{configurable:!0,get:function(){return O}}}),P}function f(){for(var t=arguments.length,e=new Array(t),n=0;n=e.length)return e;switch(t){case 0:return[];case 1:return[e[0]];case 2:return[e[0],e[1]];case 3:return[e[0],e[1],e[2]];case 4:return[e[0],e[1],e[2],e[3]];case 5:return[e[0],e[1],e[2],e[3],e[4]]}return Array.prototype.slice.call(e,0,t)}}var P={equals:void 0,isDeepEqual:!1,isPromise:!1,isReact:!1,isSerialized:!1,matchesKey:void 0,maxAge:void 0,maxArgs:void 0,maxSize:1/0,onExpire:void 0,profileName:void 0,serializer:void 0,shouldSerializeFunctions:!1,transformArgs:void 0,updateExpire:!1},M=function(){for(var t=arguments.length,e=new Array(t),n=0;n=t.options.maxSize&&(t.cache.keys.pop(),t.cache.values.pop()),t.cache.keys.unshift(r),t.cache.values.unshift(n),u(t.cache,t.options,t),c(t.cache,t.options,t))},t.clear=function(){t.cache.keys.length=0,t.cache.values.length=0,c(t.cache,t.options,t)},t.get=function(e){var n=f(t.cache.keys,l?l(e):e);return~n?t.apply(this,t.cache.keys[n]):void 0},t.getStats=function(){return y(t.options.profileName)},t.has=function(e){return!!~f(t.cache.keys,l?l(e):e)},t.keys=function(){return t.cacheSnapshot.keys},t.remove=function(e){var r=f(t.cache.keys,l?l(e):e);if(~r){var i=t.cache.keys[r];t.cache.keys.splice(r,1),t.cache.values.splice(r,1),c(t.cache,t.options,t),d(n,i,!0)}},t.update=function(e,n){var r=f(t.cache.keys,l?l(e):e);if(~r){var i=t.cache.keys[r];a(t.cache.keys,i,r),a(t.cache.values,n,r),c(t.cache,t.options,t)}},t.values=function(){return t.cacheSnapshot.values}}(t,e),function(t,e){var n=e.expirations,r=e.options,i=e.originalFunction,o=t.options;Object.defineProperties(t,{_microMemoizeOptions:{configurable:!0,get:function(){return o}},expirations:{configurable:!0,get:function(){return n}},expirationsSnapshot:{configurable:!0,get:function(){return n.slice(0)}},isCollectingStats:{configurable:!0,get:function(){return R.isCollectingStats}},isMoized:{configurable:!0,get:function(){return!0}},options:{configurable:!0,get:function(){return r}},originalFunction:{configurable:!0,get:function(){return i}}}),r.isReact&&(t.contextTypes=i.contextTypes,t.defaultProps=i.defaultProps,t.displayName="Moized("+(i.displayName||i.name||"Component")+")",t.propTypes=i.propTypes)}(t,e),t},q="function"==typeof Map,D="function"==typeof Set,U="function"==typeof WeakSet,H=Object.keys,G=Array.isArray,K=(z(C()),z(C(w)),z()),$=z((function(){return w}));function J(t,e,n){return"[ref-"+n+"]"}var V=function(t,e){if(t[0]===e)return 0;for(var n=t.length,r=1;r{var r=t(e,n);return r<0?1:r>0?-1:0}}function qo(t){for(var e=0,n=t.length;en&&(e=n);var r=Math.max(1,e-Math.floor(this.length/2)),i=Math.min(n,e+Math.floor(this.length/2));i-r+1this.length&&(e>n/2?r++:i--);var o=this.per_page*(e-1);o<0&&(o=0);var u=this.per_page*e-1;return u<0&&(u=0),u>Math.max(t-1,0)&&(u=Math.max(t-1,0)),{total_pages:n,pages:Math.min(i-r+1,n),current_page:e,first_page:r,last_page:i,previous_page:e-1,next_page:e+1,has_previous_page:e>1,has_next_page:e1&&void 0!==arguments[1]?arguments[1]:null;t instanceof Element&&("none"===t.style.display?!1!==e&&(t.style.display=""):!0!==e&&(t.style.display="none"))}function Ho(t){t.preventDefault(),t.stopPropagation()}function Go(){return!!document.activeElement&&["input","select","textarea"].indexOf(document.activeElement.tagName.toLowerCase())>=0}var Ko=No((t,e)=>{var n={},r=document.createElement("div");r.style.display="none",t.forEach(t=>r.classList.add(t)),document.body.appendChild(r);var i=getComputedStyle(r);return e.forEach(t=>{n[t]=i.getPropertyValue(t)||""}),r.remove(),n}),$o=No(()=>{var t=document.querySelector("img._1TuHK");return"".concat(new URL(t&&t.src||"https://d35aaqx5ub95lt.cloudfront.net/").origin,"/")}),Jo=No(()=>{var t=document.querySelector('meta[name="'.concat(_o,'"]')),e=(t&&t.getAttribute("content")||"").trim();return e&&"url(".concat(e,")")||Ko(ho,["background-image"])["background-image"]||null});function Vo(){return String(Lo(window.duo)&&window.duo.uiLanguage||"").trim()||String(hr.get("ui_language")||"").trim()||"en"}function Zo(t,e){return Yo.apply(this,arguments)}function Yo(){return(Yo=e((function*(t,e){return new Promise((n,r)=>{var i=e=>{e.source===window&&e.data&&mo===e.data.type&&t===e.data.action&&(e.data.result===go?n(e.data.value||null):r(),e.stopPropagation(),window.removeEventListener("message",i))};window.addEventListener("message",i),window.postMessage({type:yo,action:t,value:e},"*")})}))).apply(this,arguments)}function Xo(t){return t.tokens.reduce((t,e)=>t+(1===e.length?e[0]:"[".concat(e.join(" / "),"]")),"")}function Qo(t,e){var n=function(t,e,n){return t.localeCompare(e,n,{ignorePunctuation:!0,numeric:!0,sensitivity:"accent",usage:"sort"})}(t.reference,e.reference,t.locale);return 0===n&&(n=e.isComplex-t.isComplex),n}function tu(t,e){var n=(e.score||0)-(t.score||0);return 0!==n?n:Qo(t,e)}var eu=t=>{var{context:e=Oo,activePage:n=1,totalItemCount:r=0,itemCountPerPage:i=20,displayedPageCount:o=5,onChange:u=Bo}=t,a=Ao(lu,fu,[e]),c=new Ro(i,o).build(r,n),[l]=function(t){var e=Xn([!1,null]),n=e[0],r=e[1];return mr(t,(function(t){return r([!0,t])}),{event:"keydown"},[n]),mr(t,(function(t){return r([!1,t])}),{event:"keyup"},[n]),n}("Control"),f=zo((t,e,n)=>{Go()||t.has_previous_page&&n(e?1:t.previous_page)},50,[c,l,u]),s=zo((t,e,n)=>{Go()||t.has_next_page&&n(e?t.total_pages:t.next_page)},50,[c,l,u]);if(mr("ArrowLeft",f,{},[f]),mr("ArrowRight",s,{},[s]),r<=i)return null;for(var p=t=>{var{key:e,label:n,title:r,titleKey:i,titleFields:o={},disabled:u,onClick:c}=t,l=a(iu);return Bn.isNumber(n)&&(l+=" ".concat(a(au))),l+=" ".concat(a(u?ou:uu)),en("div",{key:e,className:a(ru)},en(Wn,null,en("button",{disabled:u,onClick:c,className:l,title:en(Nn,{id:i,fields:o},r)},en("span",{className:a(cu)},n))))},h=[p({key:"first",label:"«",title:"Go to first page",titleKey:"go_to_first",disabled:!c.has_previous_page,onClick:()=>u(1)}),p({key:"previous",label:"⟨",title:"Go to previous page",titleKey:"go_to_previous",disabled:!c.has_previous_page,onClick:()=>u(c.previous_page)})],d=function(t){h.push(p({key:"page-".concat(t),label:t,title:"Go to page {{page}}",titleKey:"go_to_page",titleFields:{page:t},disabled:c.current_page===t,onClick:()=>u(t)}))},_=c.first_page;_<=c.last_page;_++)d(_);return h.push(p({key:"next",label:"⟩",title:"Go to next page",titleKey:"go_to_next",disabled:!c.has_next_page,onClick:()=>u(c.next_page)}),p({key:"last",label:"»",title:"Go to last page",titleKey:"go_to_last",disabled:c.current_page===c.total_pages,onClick:()=>u(c.total_pages)})),en(En,{scope:"pagination"},en("div",{className:a(nu)},h))},nu="wrapper",ru="item",iu="button",ou="disabled_button",uu="enabled_button",au="index_button",cu="button_label",lu={[Oo]:{[nu]:["gcfYU"],[ru]:["_1OCDB"],[iu]:["_3f9XI","_3iVqs","_2A7uO","_2gwtT","_1nlVc","_2fOC9","t5wFJ","_3dtSu","_25Cnc","_3yAjN","_3Ev3S","_1figt"]},[Co]:{[uu]:["_1O1Bz","_2NzLI"]}},fu={[So]:uo.create({[nu]:{textAlign:"center","@media (max-width: 699px)":{display:"block"}},[au]:{"@media (max-width: 530px)":{display:"none"}}}),[Co]:uo.create({[nu]:{alignItems:"center",display:"flex",justifyContent:"center",marginTop:"1em"},[iu]:{background:"transparent",borderRadius:"12px",color:"currentColor",display:"flex",height:"32px",justifyContent:"center",lineHeight:"26px",margin:"0 2px",opacity:"0.5",overflow:"hidden",position:"relative",width:"32px"},[ou]:{border:0},[uu]:{":hover":{":before":{background:"currentColor",bottom:0,content:'""',display:"block",filter:"invert(1)",left:0,opacity:"0.3",position:"absolute",right:0,top:0,zIndex:"-1"}}}})},su="similarity",pu={[su]:{labelId:"similarity_sort",defaultLabel:"Similarity sort",actionLabelId:"sort_by_similarity",defaultActionLabel:"Sort by similarity"},alphabetical:{labelId:"alphabetical_sort",defaultLabel:"Alphabetical sort",actionLabelId:"sort_alphabetically",defaultActionLabel:"Sort alphabetically"}},hu=No(t=>{var e=Object.keys(pu);return t||(e=e.filter(t=>su!==t)),e}),du="desc",_u={asc:{label:"↑",actionLabelId:"sort_ascending",defaultActionLabel:"Sort in ascending order"},[du]:{label:"↓",actionLabelId:"sort_descending",defaultActionLabel:"Sort in descending order"}},vu="all",gu=[10,20,50,200,vu];function yu(t,e){return String(t)===String(e)}var SolutionList=t=>{var{context:e=Oo,solutions:n=[],isScoreAvailable:r=!0,onPageChange:i=Bo}=t,o=Ao(Ru,Wu,[e]),[u,a]=Xn(1),c=er(),[l,f]=jo("page_size",20),s=rr(t=>{a(t),c.current=!0},[a]),p=rr(t=>{if(f(t),vu===t)a(1);else{var e=Number(t);if(-1===gu.indexOf(e))return;var r=vu===l?n.length:Math.min(l,n.length);a(Math.ceil(((u-1)*r+1)/e))}c.current=!0},[u,l,n.length,f]),h=hu(r),{state:d,nextState:_,next:v}=Eo("sort-type",h,h[0]),{state:g,nextState:y,next:m}=Eo("sort-direction",Object.keys(_u),du),[b,x]=Xn([]);tr(()=>{var t=su===d?("asc"===g?Fo:Bn.identity)(tu):(du===g?Fo:Bn.identity)(Qo);x(n.sort(t))},[n,d,g]);var[w,k]=Xn([]),S=rr(t=>en("li",{className:o(Cu)},Xo(t)),[o]);tr(()=>{var t=vu===l?b:b.slice((u-1)*l,u*l);k(t.map(S))},[b,d,g,u,l,S]),tr(()=>{c.current&&(setTimeout(i()),c.current=!1)},[w,i,c]);var O=t=>vu!==t?"".concat(t):en(Nn,{id:"all"},"all"),C=rr(t=>yu(t,l)?en("span",{className:o(Iu)},O(t)):en("a",{onClick:()=>p(t),className:o(Pu)},O(t)),[l,p,o]),A=rr(t=>en("option",{value:t,selected:yu(t,l),className:o(Nu)},O(t)),[l,o]);if(0===n.length)return null;var[j,E]=vu===l?[1,n.length]:[(u-1)*l+1,Math.min(n.length,u*l)];return en(En,{scope:"solution_list"},en("div",null,en("h3",{className:o(mu)},en("span",{className:o(bu)},en(Nn,{id:"correct_solutions"},"Correct solutions:")),en("div",{className:o(xu)},en(Wn,null,h.length>1?en("a",{className:o(wu),onClick:v,title:en(Nn,{id:pu[_].actionLabelId},pu[_].defaultActionLabel)},en("span",{className:o(ku)},en(Nn,{id:pu[d].labelId},pu[d].defaultLabel))):en("span",{className:o([ku,Ou])},en(Nn,{id:pu[d].labelId},pu[d].defaultLabel)),en("a",{className:o(wu),onClick:m,title:en(Nn,{id:_u[y].actionLabelId},_u[y].defaultActionLabel)},en("span",{className:o(Su)},_u[g].label))))),en("ul",null,w),en("div",{className:o(Au)},vu!==l&&en(eu,{activePage:u,itemCountPerPage:l,totalItemCount:n.length,onChange:s,context:e}),en("div",{className:o(ju)},en("div",{className:o(Eu)},j," - ",E," / ",n.length),en("div",{className:o(zu)},en(Nn,{id:"per_page"},"per page:"),gu.map(C),en("div",{className:o(Mu)},en("select",{onChange:t=>p(t.target.value),className:o(Tu)},gu.map(A))))))))},mu="title",bu="title_text",xu="title_link_wrapper",wu="sort_link",ku="sort_type_label",Su="sort_direction_label",Ou="single_sort_type_label",Cu="solution",Au="pagination",ju="pagination_footer",Eu="pagination_state",zu="pagination_size_wrapper",Iu="current_page_size",Pu="page_size_link",Mu="page_size_select_wrapper",Tu="page_size_select",Nu="page_size_option",Ru={[Oo]:{[wu]:["_1yq6r"],[Au]:["_3lUbm"],[Pu]:["_1yq6r"],[Mu]:["_1yq6r"],[Tu]:["_1yq6r"]},[Co]:{[bu]:["_2qRu2"],[Ou]:["uFNEM"],[Cu]:["_2qRu2"],[Mu]:["_1bO3u"]}},Wu={[So]:uo.create({[mu]:{alignItems:"center",display:"flex",flexWrap:"wrap",justifyContent:"space-between"},[bu]:{marginRight:"1em","@media (max-width: 699px)":{marginBottom:"0.5em"}},[xu]:{"@media (any-pointer: coarse)":{lineHeight:"2em"},"@media (max-width: 699px)":{marginBottom:"0.5em"}},[wu]:{cursor:"pointer",marginRight:"0.5em",userSelect:"none",whiteSpace:"nowrap","@media (any-pointer: coarse)":{display:"inline-block",padding:"0.125em 1em",position:"relative",":active":{transform:"translate3d(0, 2px, 0)",":before":{borderWidth:"2px"}},":before":{borderColor:"currentColor",borderRadius:"12px",borderStyle:"solid",borderWidth:"2px 2px 4px",bottom:0,content:'""',display:"block",left:0,position:"absolute",right:0,top:0}}},[ku]:{userSelect:"none"},[Su]:{fontSize:"1.2em",fontWeight:"900"},[Cu]:{padding:"0.4em 0.5em 0.3em",":nth-child(odd)":{background:"rgba(0, 0, 0, 0.125)"}},[Au]:{userSelect:"none"},[ju]:{alignItems:"center",display:"flex",flexWrap:"wrap",justifyContent:"center",marginTop:"1em"},[Eu]:{margin:"0 0.65em 0.5em"},[zu]:{alignItems:"center",display:"flex",fontSize:"0.85em",margin:"0 0.65em 0.5em"},[Iu]:{margin:"0 0.25em","@media (any-pointer: coarse)":{display:"none"}},[Pu]:{cursor:"pointer",margin:"0 0.25em","@media (any-pointer: coarse)":{display:"none"}},[Mu]:{display:"none",marginLeft:"0.5em",padding:"0",position:"relative",transform:"translate3d(0, 0, 0)",":active":{transform:"translate3d(0, 2px, 0)",":before":{borderWidth:"2px"}},":before":{borderColor:"currentColor",borderRadius:"12px",borderStyle:"solid",borderWidth:"2px 2px 4px",bottom:0,content:'""',display:"block",left:0,position:"absolute",right:0,top:0,zIndex:-1},"@media (any-pointer: coarse)":{display:"block"}},[Tu]:{appearance:"none",background:"none",border:0,fontWeight:"bold",padding:"0.75em",textAlign:"center",textAlignLast:"center"},[Nu]:{background:"initial",color:"initial"}}),[Oo]:uo.create({[wu]:{fontSize:"0.75em"},[Au]:{bottom:"0",paddingTop:"0.1em",position:"sticky"}}),[Co]:uo.create({[xu]:{"@media (max-width: 699px)":{marginBottom:"0.5em"}},[bu]:{padding:0,textTransform:"none"},[ku]:{marginRight:"0.5em",textTransform:"none"},[Ou]:{fontWeight:"normal"},[Tu]:{color:"inherit"}})},Bu=No(()=>{var t=Array.from(document.querySelectorAll("._1KvMS textarea + div button"));return 2!==t.length?null:{[Ju]:String(t[0].getAttribute("style")||""),[Vu]:String(t[1].getAttribute("style")||"")}}),Lu=No(()=>{var t=document.querySelector("._13Bfz button");return String(t&&t.getAttribute("style")||"")}),Fu=t=>{var{context:e=Oo,reference:n="",onChange:r=Bo,isEditable:i=!0}=t,[o,u]=Xn(!1),[a,c]=Xn(n),l=er(null),f=[Uu,i&&Gu,""===n&&Hu].filter(Boolean),s=Ao(Xu,Qu,[e]),p={},h=null;if(Co===e&&null===(p=Bu())){var d=Lu();p={[Ju]:d,[Vu]:d},h=Zu}var _=rr(t=>{Ho(t);var e=a.trim();""!==e&&e!==n&&a!==n?r(a):c(n),u(!1)},[n,r,u,a]),v=rr(t=>{Ho(t),u(!1),c(n)},[n,u,c]),g=rr(t=>{"Enter"===t.key?_(t):"Escape"===t.key&&v(t)},[_,v]),y=rr(t=>{Ho(t),c(t.target.value)},[c]);tr(()=>{l.current&&setTimeout(()=>{if(document.activeElement!==l.current.focused){var t=l.current.value.length;l.current.focus(),l.current.setSelectionRange(t+1,t+1)}})},[o,l]);var[m,b,x,w]=Oo===e?["div","h3","p","p"]:["h2","span","span",rn];return en(En,{scope:"user_reference"},en(m,{className:s(qu)},en(b,{className:s(Du)},en(Nn,{id:"your_reference"},"Your reference:")),o?en(w,null,en("textarea",{ref:l,dir:"auto",onKeyDown:g,onKeyUp:y,className:s(Ku)},a),en("button",{onClick:_,style:p[Ju]||"",className:s([$u,Ju,h])},en(Nn,{id:"update"},"Update")),en("span",{className:s(Yu)},en("button",{onClick:v,style:p[Vu]||"",className:s([$u,Vu,h])},en(Nn,{id:"cancel"},"Cancel")))):en(x,{onClick:()=>i&&u(!0),className:s(f)},""!==n?n:en(Nn,{id:"none"},"None yet"))))},qu="wrapper",Du="title",Uu="value",Hu="empty_value",Gu="editable_value",Ku="edit_field",$u="button",Ju="commit_button",Vu="rollback_button",Zu="fallback_button",Yu="button_spacer",Xu={[Oo]:{[Ku]:["_2EMUT","_1QDX9","st_Fn","_2ti2i","sXpqy"],[$u]:["_3iVqs","_2A7uO","_2gwtT","_1nlVc","_2fOC9","t5wFJ","_3dtSu","_25Cnc","_3yAjN","_3Ev3S","_1figt"],[Ju]:["_2__FI"]},[Co]:{[qu]:["_2qRu2"],[Du]:["_1gXMJ"],[Ku]:["_1Ch3x","_2yvtl","gFN2J"],[$u]:["_2NzLI","QHkFc"],[Ju]:["_1qPrY","_2pnz9"],[Vu]:["_3kaGF","_1O1Bz"],[Zu]:["_1O1Bz"],[Yu]:["_3cCqs"]}},Qu={[So]:uo.create({[Hu]:{fontStyle:"italic"},[Gu]:{cursor:"text"}}),[Oo]:uo.create({[Uu]:{fontWeight:"normal",marginTop:"10px"},[Ku]:{marginBottom:"10px"},[Ju]:{":after":{borderColor:"currentColor"}},[Yu]:{marginLeft:"10px"}})},ChallengeSolutions=t=>{var{context:e=Oo,statement:n="",solutions:r=[],userReference:i="",onUserReferenceUpdate:o=Bo,isUserReferenceEditable:u=!0,getScrollOffset:a=(()=>0)}=t,c=er(),[l,f]=Xn(!1),[s,p]=Xn(r),[h,d]=Xn(i),_=Ao({},ea,[e]),v=rr(t=>{f(!0),d(t),Promise.resolve(o(t)).then(t=>{Bn.isArray(t)?p(t):d(h)}).catch(()=>{d(h)}).then(()=>{f(!1)})},[o,f,p,h,d]),g=rr(()=>{if(c.current){var t=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=t.parentNode;n;){if(n.clientHeight>0&&n.scrollHeight-e>n.clientHeight)return n;n=n.parentNode}return document.body}(c.current),e=a()||0;t.scrollTo({top:c.current.offsetTop-e-10,behavior:"smooth"})}},[a,c,s]);return 0===s.length?null:en(En,{scope:"challenge"},""!==n&&en(rn,null,en("h3",null,en(Nn,{id:"statement"},"Statement:")),en("p",null,n)),en(Fu,{context:e,reference:h,onChange:v,isEditable:u&&!l}),en("div",{ref:c},l?en("div",{className:_(ta)},en(Io,null)):en(SolutionList,{context:e,solutions:s,isScoreAvailable:""!==h,onPageChange:g})))},ta="loader",ea={[So]:uo.create({[ta]:{padding:"0 0 18px",textAlign:"center"}})},ClosestSolution=t=>{var{solution:e="",result:n=fo}=t,r=Ao(ia,oa,[n]);return""===e.trim()?null:en(En,{scope:"closest_solution"},en("h2",{className:r(na)},en(Nn,{id:"title"},"Closest solution:"),en("div",{className:r(ra)},en("span",null,en("span",null,e)))))},na="wrapper",ra="value",ia={[So]:{[na]:["_2ez4I"],[ra]:["_1UqAr"]},[fo]:{[na]:["_1Nmv6"]},[so]:{[na]:["_1sqiF"]}},oa={[So]:uo.create({[na]:{marginBottom:"10px"}})},ua="original",aa="corrected",CorrectedAnswer=t=>{var{diffTokens:e=[],result:n=fo}=t,r=Ao(pa,ha,[n]),i=rr((t,e)=>{var n=null;if(t.added){if(aa===e)return null;t.ignorable||(n=fa)}else if(t.removed){if(ua===e)return null;t.ignorable||(n=sa)}return en("span",{className:n&&r(n)},t.value)},[r]),[o,u]=Xn([]),[a,c]=Xn([]);return tr(()=>{u(e.map(t=>i(t,ua))),c(e.map(t=>i(t,aa)))},[e,i]),0===e.length?null:en(En,{scope:"corrected_answer"},en("h2",{className:r(ca)},en(Nn,{id:"title"},"Corrected answer:"),en("div",{className:r(la)},o),en("div",{className:r(la)},a)))},ca="wrapper",la="value",fa="added_token",sa="removed_token",pa={[So]:{[ca]:["_2ez4I"],[la]:["_1UqAr"]},[fo]:{[ca]:["_1Nmv6 "],[fa]:["_1sqiF"]},[so]:{[ca]:["_1sqiF"]}},ha={[So]:uo.create({[ca]:{marginBottom:"10px"},[sa]:{textDecoration:"underline"}})},da=Symbol("pending"),_a=Symbol("opening"),va=Symbol("opened"),ga=Symbol("closing"),ya=Symbol("closed"),ma="default",ba="fit_to_content",xa="maximized",wa={[ma]:{actionLabel:"↑",actionTitleId:"minimize",defaultActionTitle:"Minimize"},[ba]:{actionLabel:"↓",actionTitleId:"fit_to_content",defaultActionTitle:"Fit to content"},[xa]:{actionLabel:"↕",actionTitleId:"maximize",defaultActionTitle:"Maximize"}},ka=t=>{var{children:e,onClose:n=Bo}=t,[r,i]=Xn(da),o=er(),u=er(null),{state:a,nextState:c,next:l}=Eo("modal-size",Object.keys(wa),ma),f=Ao(Ea,za,[r,a]),s=rr(()=>{-1===[ga,ya].indexOf(r)&&(i(ga),setTimeout(()=>{i(ya),n()},300),u.current&&clearTimeout(u.current))},[r,n]);return tr(()=>{if(-1===[ga,ya].indexOf(r)){var t=t=>{"Escape"===t.key&&(s(),Ho(t))};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)}},[r,s]),tr(()=>{da===r&&(setTimeout(()=>i(_a),1),u.current=setTimeout(()=>i(va),300))},[r]),tr(()=>{o.current&&o.current.focus()},[o]),ya===r?null:en(En,{scope:"modal"},en("div",{className:f(Sa),onClick:s},en("div",{className:f(Oa),role:"dialog",tabIndex:"-1",onClick:Ho},en("div",{className:f(Ca),onClick:s},en("img",{src:$o()+"images/x.svg"})),en(Wn,null,en("div",{onClick:l,className:f(Aa),title:en(Nn,{id:wa[c].actionTitleId},wa[c].defaultActionTitle)},wa[c].actionLabel)),en("div",{ref:o,className:f(ja),tabIndex:"0"},e))))},Sa="overlay",Oa="wrapper",Ca="close_button",Aa="size_button",ja="content",Ea={[So]:{[Sa]:["_2Rpqh","_36g-h","_1xa0a"],[Oa]:["_1hEOp","_13Rl7","_3lUbm","_1xa0a"],[Ca]:["FrL-W"],[Aa]:["FrL-W"],[ja]:["_2D1-v"]},[da]:{[Sa]:["_1VSis"],[Oa]:["_1VSis"]},[_a]:{[Sa]:["_2vfOI"],[Oa]:["_1VSis"]},[va]:{[Sa]:["_2vfOI"],[Oa]:["_2vfOI"]},[ga]:{[Sa]:["_1VSis"]}},za={[So]:uo.create({[Oa]:{maxHeight:"calc(95vh - 30px)",maxWidth:"calc(95vw - 30px)","@media (max-width: 699px)":{maxHeight:"95vh",maxWidth:"95vw"}},[ja]:{maxHeight:"calc(95vh - 90px)",overflowY:"auto",paddingRight:"0.5em",position:"relative"},[Aa]:{border:0,borderRadius:"100%",bottom:"1px",left:"auto",right:"1px",top:"auto",transform:"rotate(-45deg)","@media (max-width: 699px)":{fontSize:"1.25em"}}}),[ba]:uo.create({[ja]:{maxWidth:"100%"}}),[xa]:uo.create({[Oa]:{height:"calc(95vh - 30px)",maxHeight:"none",maxWidth:"none",width:"calc(95vw - 30px)","@media (max-width: 699px)":{height:"95vh",width:"95vw"}},[ja]:{maxWidth:"100%","@media (max-width: 699px)":{maxHeight:"100%"}}})},SolutionLink=t=>{var{context:e=Oo,result:n=lo,isLoading:r=!1,solutions:i=[],onClick:o=Ho}=t,u=Object.assign({},Ra,Co===e?{}:{[fo]:Wa(fo),[so]:Wa(so)}),a=Ao(Ta,u,[e,n]);if(!r&&0===i.length)return null;var c=function(t){var e=t.length,n=e.toString();return t.some(t=>!!t.isComplex)&&(++e,n+="+"),{display:n,plural:e}}(i);return en(En,{scope:"solution_link"},r?en("div",{className:a(Ia)},en(Io,null)):en("a",{className:a(Ia),onClick:o},en("div",{className:a(Pa)}),en("span",{className:a(Ma)},en(Nn,{id:"label",plural:c.plural,fields:{count:c.display}},"Solutions (",c.display,")"))))},Ia="wrapper",Pa="icon",Ma="title",Ta={[Oo]:{[Ia]:["_13CKi"],[Pa]:["_1eGRT"],[Ma]:["_2472G","_3yAjN"]},[Co]:{[Ia]:["_5j_V-"],[Ma]:["uFNEM","tCqcy"]},[fo]:{[Ia]:["_3NwXb"]},[so]:{[Ia]:["_1BszG"]}},Na={[fo]:["_3NwXb"],[so]:["_1BszG"]},Ra={[Co]:uo.create({[Ia]:{cursor:"pointer",float:"right",marginRight:"20px",userSelect:"none"}})},Wa=No(t=>{var e=Ko(Ta[Oo][Pa].concat(Na[t]||[]),["background-origin","background-position","background-repeat","background-size"]),n=Ko(Ta[Oo][Ia].concat(Ta[t][Ia]||[]),["color"]);return uo.create({[Pa]:{backgroundColor:n.color||po[t]||"",maskImage:Jo()||"",maskOrigin:e["background-origin"],maskPosition:e["background-position"],maskRepeat:e["background-repeat"],maskSize:e["background-size"]}})}),Ba={en:{challenge:{statement:"Statement:"},closest_solution:{title:"Closest solution:"},corrected_answer:{title:"Corrected answer:"},modal:{fit_to_content:"Fit to content",maximize:"Maximize",minimize:"Minimize"},pagination:{go_to_first:"Go to first page",go_to_last:"Go to last page",go_to_page:"Go to page {{page}}",go_to_next:"Go to next page",go_to_previous:"Go to previous page"},solution_link:{label:"Solutions ({{count}})"},solution_list:{all:"all",alphabetical_sort:"Alphabetical sort",correct_solutions:"Correct solutions:",per_page:"per page:",similarity_sort:"Similarity sort",sort_ascending:"Sort in ascending order",sort_alphabetically:"Sort alphabetically",sort_by_similarity:"Sort by similarity",sort_descending:"Sort in descending order"},user_reference:{cancel:"Cancel",none:"None yet",title:"Your reference:",update:"Update"}},fr:{challenge:{statement:"Énoncé :"},closest_solution:{title:"Solution la plus proche :"},corrected_answer:{title:"Réponse corrigée :"},modal:{fit_to_content:"Adapter au contenu",maximize:"Maximiser",minimize:"Minimiser"},pagination:{go_to_first:"Aller à la première page",go_to_last:"Aller à la dernière page",go_to_page:"Aller à la page {{page}}",go_to_next:"Aller à la page suivante",go_to_previous:"Aller à la page précédente"},solution_link:{label:"Solutions ({{count}})"},solution_list:{all:"tout",alphabetical_sort:"Tri alphabétique",correct_solutions:"Solutions correctes :",per_page:"par page :",similarity_sort:"Tri par similarité",sort_ascending:"Trier par ordre croissant",sort_alphabetically:"Trier alphabétiquement",sort_by_similarity:"Trier par similarité",sort_descending:"Trier par ordre décroissant"},user_reference:{cancel:"Annuler",none:"Aucune pour l'instant",update:"Modifier",your_reference:"Ta référence :"}}};function La(t){return Ba[t]||Ba[t.substring(0,2)]||{}}var Fa=250,qa=["name","translate","completeReverseTranslation"].map(t=>'[data-test^="challenge challenge-'.concat(t,'"]')).join(", "),Da=["listen","listenTap"].map(t=>'[data-test^="challenge challenge-'.concat(t,'"]')).join(", "),Ua=['[data-test="hint-sentence"]','[data-test="challenge-header"]','[data-test="challenge-translate-prompt"]'],Ha='[data-test="hint-popover"]',Ga="._3mObn > *:last-child > ._1UqAr",Ka=['input[data-test="challenge-text-input"]','textarea[data-test="challenge-translate-input"]'].join(", "),$a="._2ez4I",Ja="._2AOD4",Va="._1K9ZC, ._2Jt0i, ._2i8Km",Za="._3Rqyw",Ya={};function Xa(t,e){if(!Ya[t.name]||!Ya[t.name].isConnected){var n=document.createElement("div");n.id=function(t){var e;do{e=t+Do++}while(document.getElementById(e));return e}("".concat(co,"-").concat(t.name,"-")),Ya[t.name]=n}return e.appendChild(Ya[t.name]),Ya[t.name]}function renderChallengeClosestSolution(t,e){try{var n=document.querySelector($a);if(!n)throw new Error("Could not find the solution wrapper element.");wn(en(En,{definition:La(Vo())},en(ClosestSolution,{solution:Xo(t),result:e})),Xa(ClosestSolution,n))}catch(t){}}function renderChallengeCorrectedAnswer(t,e){try{var n=document.querySelector($a);if(!n)throw new Error("Could not find the solution wrapper element.");wn(en(En,{definition:La(Vo())},en(CorrectedAnswer,{diffTokens:t,result:e})),Xa(CorrectedAnswer,n))}catch(t){}}var Qa=!1;function tc(t){try{var e=document.querySelector(Ja);if(!e)throw new Error("Could not find the action link list element.");wn(en(En,{definition:La(Vo())},en(SolutionLink,{result:t,isLoading:!0})),Xa(SolutionLink,e))}catch(t){}}function ec(t,r,i){try{if(Qa)return;Qa=!0;var o=oc,u=(new Date).getTime().toString(),a=function(){var n=e((function*(e){try{tc(r),yield qn(Fa);var n=t.commentId?yield Zo(wo,{userReference:e,commentId:t.commentId}):yield Zo("match_challenge_with_user_answer",{challenge:t,userAnswer:e});if(Lo(n)&&Lo(n.challenge)&&o===oc)return renderChallengeSolutionLink(n.challenge,r,e),Lo(uc)&&(uc.userAnswer=e),n.challenge.solutions||[]}catch(e){renderChallengeSolutionLink(t,r,i)}}));return function(t){return n.apply(this,arguments)}}();wn(en(En,{definition:La(Vo())},en(ka,{key:u,onClose:()=>{Qa=!1}},en(ChallengeSolutions,n({context:Oo},t,{userReference:i,onUserReferenceUpdate:a})))),Xa(ka,document.body))}catch(t){}}function renderChallengeSolutionLink(t,e,n){try{var r=document.querySelector(Ja);if(!r)throw new Error("Could not find the action link list element.");wn(en(En,{definition:La(Vo())},en(SolutionLink,{result:e,solutions:t.solutions,onClick:()=>ec(t,e,n)})),Xa(SolutionLink,r))}catch(t){}}function nc(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{if(ac&&ac.isConnected){var i=document.querySelector(Za);if(!i)throw new Error("Could not find the action link list element.");var o=Xa(ChallengeSolutions,ac);0===o.childNodes.length&&Uo(o,!1);var u=function(){var n=e((function*(e){try{yield qn(Fa);var n=yield Zo(wo,{commentId:t,userReference:e});if(Lo(n)&&Lo(n.challenge)&&t===cc)return lc=n,n.challenge.solutions||[]}catch(t){}}));return function(t){return n.apply(this,arguments)}}(),a=()=>{var t=document.querySelector(Va);return t?t.clientHeight:0};wn(en(En,{definition:La(Vo()||n.fromLanguage)},en(ChallengeSolutions,{key:"forum-challenge-".concat(t),context:Co,solutions:n.solutions,userReference:r,onUserReferenceUpdate:u,getScrollOffset:a})),o),wn(en(En,{definition:La(Vo())},en(SolutionLink,{context:Co,solutions:n.solutions,onClick:()=>Uo(o)})),Xa(SolutionLink,i))}}catch(t){}}var rc=null,ic=null,oc=null,uc=null,ac=null,cc=null,lc=null;function fc(t,e,n){return sc.apply(this,arguments)}function sc(){return(sc=e((function*(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return yield qn(Fa),!ic||(uc={challenge:t,result:e,userAnswer:n},n&&(so===e?t.solutions.length>1&&renderChallengeClosestSolution(Bn.maxBy(t.solutions,"score"),e):Bn.isArray(r)&&renderChallengeCorrectedAnswer(r,e)),renderChallengeSolutionLink(t,e,n),!0)}))).apply(this,arguments)}function pc(){return(pc=e((function*(t,e){if(!document.querySelector(qa))return!1;var n=qo(Ua);if(!n)return!1;var r=n.cloneNode(!0),i=r.querySelectorAll(Ha);return i.length>0&&i.forEach(t=>t.parentNode.removeChild(t)),Zo(bo,{result:t,userAnswer:e,statement:r.innerText}).catch(()=>!1).then(n=>Lo(n)&&fc(n,t,e))}))).apply(this,arguments)}function hc(){return(hc=e((function*(t,e){if(!document.querySelector(Da))return!1;var n=document.querySelector(Ga);return!!n&&Zo(xo,{result:t,userAnswer:e,solutionTranslation:n.innerText}).catch(()=>!1).then(n=>Lo(n)&&Lo(n.challenge)&&fc(n.challenge,t,e,n.correctionDiff))}))).apply(this,arguments)}var dc=new MutationObserver(()=>{if(ic){var t=ic.querySelector("._1tuLI");if(t!==oc&&(uc=null,null!==(oc=t)))try{var e=function(){var t=document.querySelector(Ka),e=t&&t.value&&String(t.value).trim()||"";if(""===e){var n=document.querySelector(".PcKtj");n&&(e=Array.from(n.querySelectorAll('[data-test="challenge-tap-token"]')).map(t=>t.innerText.trim()).join(" ").normalize().trim())}return e}(),n=oc.classList.contains("_3e9O1")?fo:so;tc(n),function(t,e){return hc.apply(this,arguments)}(n,e).then(t=>t||function(t,e){return pc.apply(this,arguments)}(n,e)).then(t=>t||renderChallengeSolutionLink(ko,n,e)).catch(t=>{throw renderChallengeSolutionLink(ko,n,e),t})}catch(t){}}});document.addEventListener("keydown",t=>{t.ctrlKey||null===uc||Qa||Go()||"s"!==t.key.toLowerCase()||(Ho(t),ec(uc.challenge,uc.result,uc.userAnswer))}),setInterval(()=>{document.location.href!==rc&&function(t){cc=null,lc=null;var e=t.match(vo);if(Bn.isArray(e)){var n=Number(e[1]);n>0&&n!==cc&&(cc=n,Zo("get_comment_challenge",n).then(t=>{Lo(t)&&Lo(t.challenge)&&cc===t.commentId&&(lc=t,nc(t.commentId,t.challenge,t.userReference))}).catch(t=>{}))}}(rc=document.location.href);var t=document.querySelector("._2Fc1K");t?t!==ic&&(ic=t,dc.disconnect(),dc.observe(ic,{childList:!0,subtree:!0})):uc=null;var e=document.querySelector("._3eQwU");e&&e!==ac&&(ac=e,lc&&nc(lc.commentId,lc.challenge,lc.userReference))},50)}(); + ***************************************************************************** */var pr="object"==typeof window,hr=o((function(t,e){var n;n=function(){function t(){for(var t=0,e={};t=0?e%t.length:t.length+e%t.length,r())},setState:function(e){if(n()){var i=t.length?t.indexOf(e):-1;if(-1===i)throw new Error("State '"+e+"' is not a valid state (does not exist in state list)");o.current=i,r()}}}}),[t]),a=(0===o.current?t.length:o.current)-1,c=(o.current+1)%t.length;return sr({state:t[o.current],prevState:t[a],nextState:t[c],currentIndex:o.current,prevIndex:a,nextIndex:c},u)}var wr=function(t){for(var e=5381,n=t.length;n;)e=33*e^t.charCodeAt(--n);return e>>>0},kr=Sr;function Sr(t){Cr.length||Or(),Cr[Cr.length]=t}var Or,Cr=[],Ar=0;function jr(){for(;Ar1024){for(var e=0,n=Cr.length-Ar;e0&&(a[c]=f)}else{var d=(0,r.default)(u,c,l,a,e);d&&(a[c]=d),a=(0,n.default)(e,c,a)}}return a}};var n=u(ii),r=u(oi),i=u(ui),o=u(ai);function u(t){return t&&t.__esModule?t:{default:t}}}))),li=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if("string"==typeof e&&"text"===e)return["-webkit-text","text"]}}))),fi=ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return"string"==typeof t&&n.test(t)};var n=/-webkit-|-moz-|-ms-/;t.exports=e.default}));ei(fi);var si=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if("string"==typeof e&&!(0,r.default)(e)&&e.indexOf("calc(")>-1)return i.map((function(t){return e.replace(/calc\(/g,t+"calc(")}))};var n,r=(n=fi)&&n.__esModule?n:{default:n};var i=["-webkit-","-moz-",""]}))),pi=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if("string"==typeof e&&!(0,r.default)(e)&&e.indexOf("cross-fade(")>-1)return i.map((function(t){return e.replace(/cross-fade\(/g,t+"cross-fade(")}))};var n,r=(n=fi)&&n.__esModule?n:{default:n};var i=["-webkit-",""]}))),hi=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if("cursor"===t&&r.hasOwnProperty(e))return n.map((function(t){return t+e}))};var n=["-webkit-","-moz-",""],r={"zoom-in":!0,"zoom-out":!0,grab:!0,grabbing:!0}}))),di=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if("string"==typeof e&&!(0,r.default)(e)&&e.indexOf("filter(")>-1)return i.map((function(t){return e.replace(/filter\(/g,t+"filter(")}))};var n,r=(n=fi)&&n.__esModule?n:{default:n};var i=["-webkit-",""]}))),_i=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if("display"===t&&n.hasOwnProperty(e))return n[e]};var n={flex:["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex","flex"],"inline-flex":["-webkit-inline-box","-moz-inline-box","-ms-inline-flexbox","-webkit-inline-flex","inline-flex"]}}))),vi=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,u){Object.prototype.hasOwnProperty.call(r,t)&&(u[r[t]]=n[e]||e);if("flex"===t){if(Object.prototype.hasOwnProperty.call(i,e))return void(u.msFlex=i[e]);if(o.test(e))return void(u.msFlex=e+" 1 0%");var a=e.split(/\s/);switch(a.length){case 1:return void(u.msFlex="1 1 "+e);case 2:return void(o.test(a[1])?u.msFlex=a[0]+" "+a[1]+" 0%":u.msFlex=a[0]+" 1 "+a[1]);default:u.msFlex=e}}};var n={"space-around":"distribute","space-between":"justify","flex-start":"start","flex-end":"end"},r={alignContent:"msFlexLinePack",alignSelf:"msFlexItemAlign",alignItems:"msFlexAlign",justifyContent:"msFlexPack",order:"msFlexOrder",flexGrow:"msFlexPositive",flexShrink:"msFlexNegative",flexBasis:"msFlexPreferredSize"},i={auto:"1 1 auto",inherit:"inherit",initial:"0 1 auto",none:"0 0 auto",unset:"unset"},o=/^\d+(\.\d+)?$/}))),gi=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,i){"flexDirection"===t&&"string"==typeof e&&(e.indexOf("column")>-1?i.WebkitBoxOrient="vertical":i.WebkitBoxOrient="horizontal",e.indexOf("reverse")>-1?i.WebkitBoxDirection="reverse":i.WebkitBoxDirection="normal");r.hasOwnProperty(t)&&(i[r[t]]=n[e]||e)};var n={"space-around":"justify","space-between":"justify","flex-start":"start","flex-end":"end","wrap-reverse":"multiple",wrap:"multiple"},r={alignItems:"WebkitBoxAlign",justifyContent:"WebkitBoxPack",flexWrap:"WebkitBoxLines",flexGrow:"WebkitBoxFlex"}}))),yi=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if("string"==typeof e&&!(0,r.default)(e)&&o.test(e))return i.map((function(t){return e.replace(o,(function(e){return t+e}))}))};var n,r=(n=fi)&&n.__esModule?n:{default:n};var i=["-webkit-","-moz-",""],o=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/gi}))),mi=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function r(t){return"number"==typeof t&&!isNaN(t)}e.default=function(t,e,n){if("display"===t&&e in o)return o[e];if(t in u){(0,u[t])(e,n)}};var i=["center","end","start","stretch"],o={"inline-grid":["-ms-inline-grid","inline-grid"],grid:["-ms-grid","grid"]},u={alignSelf:function(t,e){i.indexOf(t)>-1&&(e.msGridRowAlign=t)},gridColumn:function(t,e){if(r(t))e.msGridColumn=t;else{var i=t.split("/").map((function(t){return+t})),o=n(i,2),a=o[0],c=o[1];u.gridColumnStart(a,e),u.gridColumnEnd(c,e)}},gridColumnEnd:function(t,e){var n=e.msGridColumn;r(t)&&r(n)&&(e.msGridColumnSpan=t-n)},gridColumnStart:function(t,e){r(t)&&(e.msGridColumn=t)},gridRow:function(t,e){if(r(t))e.msGridRow=t;else{var i=t.split("/").map((function(t){return+t})),o=n(i,2),a=o[0],c=o[1];u.gridRowStart(a,e),u.gridRowEnd(c,e)}},gridRowEnd:function(t,e){var n=e.msGridRow;r(t)&&r(n)&&(e.msGridRowSpan=t-n)},gridRowStart:function(t,e){r(t)&&(e.msGridRow=t)},gridTemplateColumns:function(t,e){e.msGridColumns=t},gridTemplateRows:function(t,e){e.msGridRows=t},justifySelf:function(t,e){i.indexOf(t)>-1&&(e.msGridColumnAlign=t)}}}))),bi=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if("string"==typeof e&&!(0,r.default)(e)&&e.indexOf("image-set(")>-1)return i.map((function(t){return e.replace(/image-set\(/g,t+"image-set(")}))};var n,r=(n=fi)&&n.__esModule?n:{default:n};var i=["-webkit-",""]}))),xi=ei(ni((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){if(Object.prototype.hasOwnProperty.call(n,t))for(var i=n[t],o=0,u=i.length;o-1&&"order"!==s)for(var p=e[f],h=0,d=p.length;h-1)return f;var s=l.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter((function(t){return!/-webkit-|-ms-/.test(t)})).join(",");return t.indexOf("Moz")>-1?s:(o["Webkit"+(0,i.default)(t)]=f,o["Moz"+(0,i.default)(t)]=s,l)}};var n=o(Ei),r=o(fi),i=o(ri);function o(t){return t&&t.__esModule?t:{default:t}}var u={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},a={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"}})))],prefixMap:{transform:Ti,transformOrigin:Ti,transformOriginX:Ti,transformOriginY:Ti,backfaceVisibility:zi,perspective:zi,perspectiveOrigin:zi,transformStyle:zi,transformOriginZ:zi,animation:zi,animationDelay:zi,animationDirection:zi,animationFillMode:zi,animationDuration:zi,animationIterationCount:zi,animationName:zi,animationPlayState:zi,animationTimingFunction:zi,appearance:Mi,userSelect:Ni,fontKerning:zi,textEmphasisPosition:zi,textEmphasis:zi,textEmphasisStyle:zi,textEmphasisColor:zi,boxDecorationBreak:zi,clipPath:zi,maskImage:zi,maskMode:zi,maskRepeat:zi,maskPosition:zi,maskClip:zi,maskOrigin:zi,maskSize:zi,maskComposite:zi,mask:zi,maskBorderSource:zi,maskBorderMode:zi,maskBorderSlice:zi,maskBorderWidth:zi,maskBorderOutset:zi,maskBorderRepeat:zi,maskBorder:zi,maskType:zi,textDecorationStyle:Mi,textDecorationSkip:Mi,textDecorationLine:Mi,textDecorationColor:Mi,filter:zi,fontFeatureSettings:Mi,breakAfter:Ni,breakBefore:Ni,breakInside:Ni,columnCount:Mi,columnFill:Mi,columnGap:Mi,columnRule:Mi,columnRuleColor:Mi,columnRuleStyle:Mi,columnRuleWidth:Mi,columns:Mi,columnSpan:Mi,columnWidth:Mi,writingMode:Ti,flex:Ti,flexBasis:zi,flexDirection:Ti,flexGrow:zi,flexFlow:Ti,flexShrink:zi,flexWrap:Ti,alignContent:zi,alignItems:zi,alignSelf:zi,justifyContent:zi,order:zi,transitionDelay:zi,transitionDuration:zi,transitionProperty:zi,transitionTimingFunction:zi,backdropFilter:zi,scrollSnapType:Ti,scrollSnapPointsX:Ti,scrollSnapPointsY:Ti,scrollSnapDestination:Ti,scrollSnapCoordinate:Ti,shapeImageThreshold:zi,shapeImageMargin:zi,shapeImageOutside:zi,hyphens:Ni,flowInto:Ti,flowFrom:Ti,regionFragment:Ti,textOrientation:zi,boxSizing:Ii,textAlignLast:Ii,tabSize:Ii,wrapFlow:Pi,wrapThrough:Pi,wrapMargin:Pi,touchAction:Pi,textSizeAdjust:Ti,borderImage:zi,borderImageOutset:zi,borderImageRepeat:zi,borderImageSlice:zi,borderImageSource:zi,borderImageWidth:zi}}),Wi=[function(t,e,n){return":"!==t[0]?null:n(e+t)},function(t,e,n){if("@"!==t[0])return null;var r=n(e);return["".concat(t,"{").concat(r.join(""),"}")]}],Bi=function t(e,n,r,i,o){for(var u=new ti,a=0;a4&&void 0!==arguments[4]?arguments[4]:[];if(!Hi[t]){var o=Bi(e,n,i,Ui,r);$i(t,o)}},Vi=function(){Gi=[],Hi={},Ki=!1,Di=null},Zi=function(t){delete Hi[t]},Yi=function(){Ki=!1;var t=Gi;return Gi=[],t},Xi=function(){var t=Yi();t.length>0&&function(t){if(null==Di&&null==(Di=document.querySelector("style[data-aphrodite]"))){var e=document.head||document.getElementsByTagName("head")[0];(Di=document.createElement("style")).type="text/css",Di.setAttribute("data-aphrodite",""),e.appendChild(Di)}var n=Di.styleSheet||Di.sheet;if(n.insertRule){var r=n.cssRules.length;t.forEach((function(t){try{n.insertRule(t,r),r+=1}catch(t){}}))}else Di.innerText=(Di.innerText||"")+t.join("")}(t)},Qi=function(t){t.forEach((function(t){Hi[t]=!0}))},to=function(t,e,n){var r,i=[],o=[],u=function t(e,n,r,i){for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:[];Qi(t)}},io="undefined"!=typeof window?null:{renderStatic:function(t){return Vi(),function(){if(Ki)throw new Error("Cannot buffer while already buffering");Ki=!0}(),{html:t(),css:{content:Yi().join(""),renderedClassNames:Object.keys(Hi)}}}};var oo=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wi;return{StyleSheet:Ur({},ro,{extend:function(r){var i=r.map((function(t){return t.selectorHandler})).filter((function(t){return t}));return t(e,n.concat(i))}}),StyleSheetServer:io,StyleSheetTestUtils:null,minify:function(t){no=t?Yr:eo},css:function(){for(var t=arguments.length,r=new Array(t),i=0;i1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return rr(r=>(Bn.isArray(r)?r:[r]).flatMap(r=>{var i=[];return e[So]&&e[So][r]&&i.push(ao(e[So][r])),t[So]&&t[So][r]&&i.push(...t[So][r]),n.forEach(n=>{n&&e[n]&&e[n][r]&&i.push(ao(e[n][r])),n&&t[n]&&t[n][r]&&i.push(...t[n][r])}),i}).join(" "),n.concat([t,e]))},jo=(t,e,n)=>function(t,e,n){if(!pr)return[e,br,br];if(!t)throw new Error("useLocalStorage key may not be falsy");var r=n?n.raw?function(t){return t}:n.deserializer:JSON.parse,i=Xn((function(){try{var i=n?n.raw?String:n.serializer:JSON.stringify,o=localStorage.getItem(t);return null!==o?r(o):(e&&localStorage.setItem(t,i(e)),e)}catch(t){return e}})),o=i[0],u=i[1],a=rr((function(e){try{var i="function"==typeof e?e(o):e;if(void 0===i)return;var a=void 0;a=n?n.raw?"string"==typeof i?i:JSON.stringify(i):n.serializer?n.serializer(i):JSON.stringify(i):JSON.stringify(i),localStorage.setItem(t,a),u(r(a))}catch(t){}}),[t,u]),c=rr((function(){try{localStorage.removeItem(t),u(void 0)}catch(t){}}),[t,u]);return[o,a,c]}(co+t,e,n),Eo=(t,e,n)=>{var[r,i]=jo(t,n),{state:o,prevState:u,nextState:a,prev:c,next:l}=xr(e,n!==r&&-1===e.indexOf(r)?n:r);return tr(()=>i(o),[o,i]),{state:o,prevState:u,nextState:a,prev:c,next:l}},zo=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=arguments.length>2?arguments[2]:void 0,r=er();return rr(()=>{r.current||(t(...n),r.current=setTimeout(()=>r.current=null,e))},n.concat(t,e))},Io=()=>{var t=Ao({},To);return en("div",{className:t(Po)},en("div",{className:t(Mo)}),en("div",{className:t(Mo)}),en("div",{className:t(Mo)}))},Po="wrapper",Mo="ball",To={[So]:uo.create({[Po]:{alignItems:"center",display:"inline-flex",justifyContent:"space-between"},[Mo]:{animationName:[{"0%, 80%, 100%":{opacity:.25},"40%":{opacity:1}}],animationDuration:"1.6s",animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",backgroundColor:"currentColor",borderRadius:"100%",height:"8px",margin:"0 5px",width:"8px",":nth-child(1)":{animationDelay:"-0.32s"},":nth-child(2)":{animationDelay:"-0.16s"}}})},No=i(o((function(t,e){!function(t){var e=Object.prototype.hasOwnProperty,n=function(t){for(var n,r=0;r<(arguments.length<=1?0:arguments.length-1);r++)if((n=r+1<1||arguments.length<=r+1?void 0:arguments[r+1])&&"object"==typeof n)for(var i in n)e.call(n,i)&&(t[i]=n[i]);return t},r=function(t){var e=t.length;if(!e)return[];if(1===e)return[t[0]];if(2===e)return[t[0],t[1]];if(3===e)return[t[0],t[1],t[2]];for(var n=new Array(e),r=0;r=v&&(z.pop(),I.pop());var u=j?i:r(n),c=t.apply(this,e);a(z,u,z.length),a(I,c,I.length),d&&A(E,P),y(E,O,P),b(E,O,P)}return I[0]}return Object.defineProperties(P,{cache:{configurable:!0,get:function(){return E}},cacheSnapshot:{configurable:!0,get:function(){return{keys:r(E.keys),size:E.size,values:r(E.values)}}},isMemoized:{configurable:!0,get:function(){return!0}},options:{configurable:!0,get:function(){return O}}}),P}function f(){for(var t=arguments.length,e=new Array(t),n=0;n=e.length)return e;switch(t){case 0:return[];case 1:return[e[0]];case 2:return[e[0],e[1]];case 3:return[e[0],e[1],e[2]];case 4:return[e[0],e[1],e[2],e[3]];case 5:return[e[0],e[1],e[2],e[3],e[4]]}return Array.prototype.slice.call(e,0,t)}}var P={equals:void 0,isDeepEqual:!1,isPromise:!1,isReact:!1,isSerialized:!1,matchesKey:void 0,maxAge:void 0,maxArgs:void 0,maxSize:1/0,onExpire:void 0,profileName:void 0,serializer:void 0,shouldSerializeFunctions:!1,transformArgs:void 0,updateExpire:!1},M=function(){for(var t=arguments.length,e=new Array(t),n=0;n=t.options.maxSize&&(t.cache.keys.pop(),t.cache.values.pop()),t.cache.keys.unshift(r),t.cache.values.unshift(n),u(t.cache,t.options,t),c(t.cache,t.options,t))},t.clear=function(){t.cache.keys.length=0,t.cache.values.length=0,c(t.cache,t.options,t)},t.get=function(e){var n=f(t.cache.keys,l?l(e):e);return~n?t.apply(this,t.cache.keys[n]):void 0},t.getStats=function(){return y(t.options.profileName)},t.has=function(e){return!!~f(t.cache.keys,l?l(e):e)},t.keys=function(){return t.cacheSnapshot.keys},t.remove=function(e){var r=f(t.cache.keys,l?l(e):e);if(~r){var i=t.cache.keys[r];t.cache.keys.splice(r,1),t.cache.values.splice(r,1),c(t.cache,t.options,t),d(n,i,!0)}},t.update=function(e,n){var r=f(t.cache.keys,l?l(e):e);if(~r){var i=t.cache.keys[r];a(t.cache.keys,i,r),a(t.cache.values,n,r),c(t.cache,t.options,t)}},t.values=function(){return t.cacheSnapshot.values}}(t,e),function(t,e){var n=e.expirations,r=e.options,i=e.originalFunction,o=t.options;Object.defineProperties(t,{_microMemoizeOptions:{configurable:!0,get:function(){return o}},expirations:{configurable:!0,get:function(){return n}},expirationsSnapshot:{configurable:!0,get:function(){return n.slice(0)}},isCollectingStats:{configurable:!0,get:function(){return R.isCollectingStats}},isMoized:{configurable:!0,get:function(){return!0}},options:{configurable:!0,get:function(){return r}},originalFunction:{configurable:!0,get:function(){return i}}}),r.isReact&&(t.contextTypes=i.contextTypes,t.defaultProps=i.defaultProps,t.displayName="Moized("+(i.displayName||i.name||"Component")+")",t.propTypes=i.propTypes)}(t,e),t},q="function"==typeof Map,D="function"==typeof Set,U="function"==typeof WeakSet,H=Object.keys,G=Array.isArray,K=(z(C()),z(C(w)),z()),$=z((function(){return w}));function J(t,e,n){return"[ref-"+n+"]"}var V=function(t,e){if(t[0]===e)return 0;for(var n=t.length,r=1;r{var r=t(e,n);return r<0?1:r>0?-1:0}}function qo(t){for(var e=0,n=t.length;en&&(e=n);var r=Math.max(1,e-Math.floor(this.length/2)),i=Math.min(n,e+Math.floor(this.length/2));i-r+1this.length&&(e>n/2?r++:i--);var o=this.per_page*(e-1);o<0&&(o=0);var u=this.per_page*e-1;return u<0&&(u=0),u>Math.max(t-1,0)&&(u=Math.max(t-1,0)),{total_pages:n,pages:Math.min(i-r+1,n),current_page:e,first_page:r,last_page:i,previous_page:e-1,next_page:e+1,has_previous_page:e>1,has_next_page:e1&&void 0!==arguments[1]?arguments[1]:null;t instanceof Element&&("none"===t.style.display?!1!==e&&(t.style.display=""):!0!==e&&(t.style.display="none"))}function Ho(t){t.preventDefault(),t.stopPropagation()}function Go(){return!!document.activeElement&&["input","select","textarea"].indexOf(document.activeElement.tagName.toLowerCase())>=0}var Ko=No((t,e)=>{var n={},r=document.createElement("div");r.style.display="none",t.forEach(t=>r.classList.add(t)),document.body.appendChild(r);var i=getComputedStyle(r);return e.forEach(t=>{n[t]=i.getPropertyValue(t)||""}),r.remove(),n}),$o=No(()=>{var t=document.querySelector("img._1TuHK");return"".concat(new URL(t&&t.src||"https://d35aaqx5ub95lt.cloudfront.net/").origin,"/")}),Jo=No(()=>{var t=document.querySelector('meta[name="'.concat(_o,'"]')),e=(t&&t.getAttribute("content")||"").trim();return e&&"url(".concat(e,")")||Ko(ho,["background-image"])["background-image"]||null});function Vo(){return String(Lo(window.duo)&&window.duo.uiLanguage||"").trim()||String(hr.get("ui_language")||"").trim()||"en"}function Zo(t,e){return Yo.apply(this,arguments)}function Yo(){return(Yo=e((function*(t,e){return new Promise((n,r)=>{var i=e=>{e.source===window&&e.data&&mo===e.data.type&&t===e.data.action&&(e.data.result===go?n(e.data.value||null):r(),e.stopPropagation(),window.removeEventListener("message",i))};window.addEventListener("message",i),window.postMessage({type:yo,action:t,value:e},"*")})}))).apply(this,arguments)}function Xo(t){return t.tokens.reduce((t,e)=>t+(1===e.length?e[0]:"[".concat(e.join(" / "),"]")),"")}function Qo(t,e){var n=function(t,e,n){return t.localeCompare(e,n,{ignorePunctuation:!0,numeric:!0,sensitivity:"accent",usage:"sort"})}(t.reference,e.reference,t.locale);return 0===n&&(n=e.isComplex-t.isComplex),n}function tu(t,e){var n=(e.score||0)-(t.score||0);return 0!==n?n:Qo(t,e)}var eu=t=>{var{context:e=Oo,activePage:n=1,totalItemCount:r=0,itemCountPerPage:i=20,displayedPageCount:o=5,onChange:u=Bo}=t,a=Ao(lu,fu,[e]),c=new Ro(i,o).build(r,n),[l]=function(t){var e=Xn([!1,null]),n=e[0],r=e[1];return mr(t,(function(t){return r([!0,t])}),{event:"keydown"},[n]),mr(t,(function(t){return r([!1,t])}),{event:"keyup"},[n]),n}("Control"),f=zo((t,e,n)=>{Go()||t.has_previous_page&&n(e?1:t.previous_page)},50,[c,l,u]),s=zo((t,e,n)=>{Go()||t.has_next_page&&n(e?t.total_pages:t.next_page)},50,[c,l,u]);if(mr("ArrowLeft",f,{},[f]),mr("ArrowRight",s,{},[s]),r<=i)return null;for(var p=t=>{var{key:e,label:n,title:r,titleKey:i,titleFields:o={},disabled:u,onClick:c}=t,l=a(iu);return Bn.isNumber(n)&&(l+=" ".concat(a(au))),l+=" ".concat(a(u?ou:uu)),en("div",{key:e,className:a(ru)},en(Wn,null,en("button",{disabled:u,onClick:c,className:l,title:en(Nn,{id:i,fields:o},r)},en("span",{className:a(cu)},n))))},h=[p({key:"first",label:"«",title:"Go to first page",titleKey:"go_to_first",disabled:!c.has_previous_page,onClick:()=>u(1)}),p({key:"previous",label:"⟨",title:"Go to previous page",titleKey:"go_to_previous",disabled:!c.has_previous_page,onClick:()=>u(c.previous_page)})],d=function(t){h.push(p({key:"page-".concat(t),label:t,title:"Go to page {{page}}",titleKey:"go_to_page",titleFields:{page:t},disabled:c.current_page===t,onClick:()=>u(t)}))},_=c.first_page;_<=c.last_page;_++)d(_);return h.push(p({key:"next",label:"⟩",title:"Go to next page",titleKey:"go_to_next",disabled:!c.has_next_page,onClick:()=>u(c.next_page)}),p({key:"last",label:"»",title:"Go to last page",titleKey:"go_to_last",disabled:c.current_page===c.total_pages,onClick:()=>u(c.total_pages)})),en(En,{scope:"pagination"},en("div",{className:a(nu)},h))},nu="wrapper",ru="item",iu="button",ou="disabled_button",uu="enabled_button",au="index_button",cu="button_label",lu={[Oo]:{[nu]:["gcfYU"],[ru]:["_1OCDB"],[iu]:["_3f9XI","_3iVqs","_2A7uO","_2gwtT","_1nlVc","_2fOC9","t5wFJ","_3dtSu","_25Cnc","_3yAjN","_3Ev3S","_1figt"]},[Co]:{[uu]:["_1O1Bz","_2NzLI"]}},fu={[So]:uo.create({[nu]:{textAlign:"center","@media (max-width: 699px)":{display:"block"}},[au]:{"@media (max-width: 530px)":{display:"none"}}}),[Co]:uo.create({[nu]:{alignItems:"center",display:"flex",justifyContent:"center",marginTop:"1em"},[iu]:{background:"transparent",borderRadius:"12px",color:"currentColor",display:"flex",height:"32px",justifyContent:"center",lineHeight:"26px",margin:"0 2px",opacity:"0.5",overflow:"hidden",position:"relative",width:"32px"},[ou]:{border:0},[uu]:{":hover":{":before":{background:"currentColor",bottom:0,content:'""',display:"block",filter:"invert(1)",left:0,opacity:"0.3",position:"absolute",right:0,top:0,zIndex:"-1"}}}})},su="similarity",pu={[su]:{labelId:"similarity_sort",defaultLabel:"Similarity sort",actionLabelId:"sort_by_similarity",defaultActionLabel:"Sort by similarity"},alphabetical:{labelId:"alphabetical_sort",defaultLabel:"Alphabetical sort",actionLabelId:"sort_alphabetically",defaultActionLabel:"Sort alphabetically"}},hu=No(t=>{var e=Object.keys(pu);return t||(e=e.filter(t=>su!==t)),e}),du="desc",_u={asc:{label:"↑",actionLabelId:"sort_ascending",defaultActionLabel:"Sort in ascending order"},[du]:{label:"↓",actionLabelId:"sort_descending",defaultActionLabel:"Sort in descending order"}},vu="all",gu=[10,20,50,200,vu];function yu(t,e){return String(t)===String(e)}var SolutionList=t=>{var{context:e=Oo,solutions:n=[],isScoreAvailable:r=!0,onPageChange:i=Bo}=t,o=Ao(Ru,Wu,[e]),[u,a]=Xn(1),c=er(),[l,f]=jo("page_size",20),s=rr(t=>{a(t),c.current=!0},[a]),p=rr(t=>{if(f(t),vu===t)a(1);else{var e=Number(t);if(-1===gu.indexOf(e))return;var r=vu===l?n.length:Math.min(l,n.length);a(Math.ceil(((u-1)*r+1)/e))}c.current=!0},[u,l,n.length,f]),h=hu(r),{state:d,nextState:_,next:v}=Eo("sort-type",h,h[0]),{state:g,nextState:y,next:m}=Eo("sort-direction",Object.keys(_u),du),[b,x]=Xn([]);tr(()=>{var t=su===d?("asc"===g?Fo:Bn.identity)(tu):(du===g?Fo:Bn.identity)(Qo);x(n.sort(t))},[n,d,g]);var[w,k]=Xn([]),S=rr(t=>en("li",{className:o(Cu)},Xo(t)),[o]);tr(()=>{var t=vu===l?b:b.slice((u-1)*l,u*l);k(t.map(S))},[b,d,g,u,l,S]),tr(()=>{c.current&&(setTimeout(i()),c.current=!1)},[w,i,c]);var O=t=>vu!==t?"".concat(t):en(Nn,{id:"all"},"all"),C=rr(t=>yu(t,l)?en("span",{className:o(Iu)},O(t)):en("a",{onClick:()=>p(t),className:o(Pu)},O(t)),[l,p,o]),A=rr(t=>en("option",{value:t,selected:yu(t,l),className:o(Nu)},O(t)),[l,o]);if(0===n.length)return null;var[j,E]=vu===l?[1,n.length]:[(u-1)*l+1,Math.min(n.length,u*l)];return en(En,{scope:"solution_list"},en("div",null,en("h3",{className:o(mu)},en("span",{className:o(bu)},en(Nn,{id:"correct_solutions"},"Correct solutions:")),en("div",{className:o(xu)},en(Wn,null,h.length>1?en("a",{className:o(wu),onClick:v,title:en(Nn,{id:pu[_].actionLabelId},pu[_].defaultActionLabel)},en("span",{className:o(ku)},en(Nn,{id:pu[d].labelId},pu[d].defaultLabel))):en("span",{className:o([ku,Ou])},en(Nn,{id:pu[d].labelId},pu[d].defaultLabel)),en("a",{className:o(wu),onClick:m,title:en(Nn,{id:_u[y].actionLabelId},_u[y].defaultActionLabel)},en("span",{className:o(Su)},_u[g].label))))),en("ul",null,w),en("div",{className:o(Au)},vu!==l&&en(eu,{activePage:u,itemCountPerPage:l,totalItemCount:n.length,onChange:s,context:e}),en("div",{className:o(ju)},en("div",{className:o(Eu)},j," - ",E," / ",n.length),en("div",{className:o(zu)},en(Nn,{id:"per_page"},"per page:"),gu.map(C),en("div",{className:o(Mu)},en("select",{onChange:t=>p(t.target.value),className:o(Tu)},gu.map(A))))))))},mu="title",bu="title_text",xu="title_link_wrapper",wu="sort_link",ku="sort_type_label",Su="sort_direction_label",Ou="single_sort_type_label",Cu="solution",Au="pagination",ju="pagination_footer",Eu="pagination_state",zu="pagination_size_wrapper",Iu="current_page_size",Pu="page_size_link",Mu="page_size_select_wrapper",Tu="page_size_select",Nu="page_size_option",Ru={[Oo]:{[wu]:["_1yq6r"],[Au]:["_3lUbm"],[Pu]:["_1yq6r"],[Mu]:["_1yq6r"],[Tu]:["_1yq6r"]},[Co]:{[bu]:["_2qRu2"],[Ou]:["uFNEM"],[Cu]:["_2qRu2"],[Mu]:["_1bO3u"]}},Wu={[So]:uo.create({[mu]:{alignItems:"center",display:"flex",flexWrap:"wrap",justifyContent:"space-between"},[bu]:{marginRight:"1em","@media (max-width: 699px)":{marginBottom:"0.5em"}},[xu]:{"@media (any-pointer: coarse)":{lineHeight:"2em"},"@media (max-width: 699px)":{marginBottom:"0.5em"}},[wu]:{cursor:"pointer",marginRight:"0.5em",userSelect:"none",whiteSpace:"nowrap","@media (any-pointer: coarse)":{display:"inline-block",padding:"0.125em 1em",position:"relative",":active":{transform:"translate3d(0, 2px, 0)",":before":{borderWidth:"2px"}},":before":{borderColor:"currentColor",borderRadius:"12px",borderStyle:"solid",borderWidth:"2px 2px 4px",bottom:0,content:'""',display:"block",left:0,position:"absolute",right:0,top:0}}},[ku]:{userSelect:"none"},[Su]:{fontSize:"1.2em",fontWeight:"900"},[Cu]:{padding:"0.4em 0.5em 0.3em",":nth-child(odd)":{background:"rgba(0, 0, 0, 0.125)"}},[Au]:{userSelect:"none"},[ju]:{alignItems:"center",display:"flex",flexWrap:"wrap",justifyContent:"center",marginTop:"1em"},[Eu]:{margin:"0 0.65em 0.5em"},[zu]:{alignItems:"center",display:"flex",fontSize:"0.85em",margin:"0 0.65em 0.5em"},[Iu]:{margin:"0 0.25em","@media (any-pointer: coarse)":{display:"none"}},[Pu]:{cursor:"pointer",margin:"0 0.25em","@media (any-pointer: coarse)":{display:"none"}},[Mu]:{display:"none",marginLeft:"0.5em",padding:"0",position:"relative",transform:"translate3d(0, 0, 0)",":active":{transform:"translate3d(0, 2px, 0)",":before":{borderWidth:"2px"}},":before":{borderColor:"currentColor",borderRadius:"12px",borderStyle:"solid",borderWidth:"2px 2px 4px",bottom:0,content:'""',display:"block",left:0,position:"absolute",right:0,top:0,zIndex:-1},"@media (any-pointer: coarse)":{display:"block"}},[Tu]:{appearance:"none",background:"none",border:0,fontWeight:"bold",padding:"0.75em",textAlign:"center",textAlignLast:"center"},[Nu]:{background:"initial",color:"initial"}}),[Oo]:uo.create({[wu]:{fontSize:"0.75em"},[Au]:{bottom:"0",paddingTop:"0.1em",position:"sticky"}}),[Co]:uo.create({[xu]:{"@media (max-width: 699px)":{marginBottom:"0.5em"}},[bu]:{padding:0,textTransform:"none"},[ku]:{marginRight:"0.5em",textTransform:"none"},[Ou]:{fontWeight:"normal"},[Tu]:{color:"inherit"}})},Bu=No(()=>{var t=Array.from(document.querySelectorAll("._1KvMS textarea + div button"));return 2!==t.length?null:{[Ju]:String(t[0].getAttribute("style")||""),[Vu]:String(t[1].getAttribute("style")||"")}}),Lu=No(()=>{var t=document.querySelector("._13Bfz button");return String(t&&t.getAttribute("style")||"")}),Fu=t=>{var{context:e=Oo,reference:n="",onChange:r=Bo,isEditable:i=!0}=t,[o,u]=Xn(!1),[a,c]=Xn(n),l=er(null),f=[Uu,i&&Gu,""===n&&Hu].filter(Boolean),s=Ao(Xu,Qu,[e]),p={},h=null;if(Co===e&&null===(p=Bu())){var d=Lu();p={[Ju]:d,[Vu]:d},h=Zu}var _=rr(t=>{Ho(t);var e=a.trim();""!==e&&e!==n&&a!==n?r(a):c(n),u(!1)},[n,r,u,a]),v=rr(t=>{Ho(t),u(!1),c(n)},[n,u,c]),g=rr(t=>{"Enter"===t.key?_(t):"Escape"===t.key&&v(t)},[_,v]),y=rr(t=>{Ho(t),c(t.target.value)},[c]);tr(()=>{l.current&&setTimeout(()=>{if(document.activeElement!==l.current.focused){var t=l.current.value.length;l.current.focus(),l.current.setSelectionRange(t+1,t+1)}})},[o,l]);var[m,b,x,w]=Oo===e?["div","h3","p","p"]:["h2","span","span",rn];return en(En,{scope:"user_reference"},en(m,{className:s(qu)},en(b,{className:s(Du)},en(Nn,{id:"your_reference"},"Your reference:")),o?en(w,null,en("textarea",{ref:l,dir:"auto",onKeyDown:g,onKeyUp:y,className:s(Ku)},a),en("button",{onClick:_,style:p[Ju]||"",className:s([$u,Ju,h])},en(Nn,{id:"update"},"Update")),en("span",{className:s(Yu)},en("button",{onClick:v,style:p[Vu]||"",className:s([$u,Vu,h])},en(Nn,{id:"cancel"},"Cancel")))):en(x,{onClick:()=>i&&u(!0),className:s(f)},""!==n?n:en(Nn,{id:"none"},"None yet"))))},qu="wrapper",Du="title",Uu="value",Hu="empty_value",Gu="editable_value",Ku="edit_field",$u="button",Ju="commit_button",Vu="rollback_button",Zu="fallback_button",Yu="button_spacer",Xu={[Oo]:{[Ku]:["_2EMUT","_1QDX9","st_Fn","_2ti2i","sXpqy"],[$u]:["_3iVqs","_2A7uO","_2gwtT","_1nlVc","_2fOC9","t5wFJ","_3dtSu","_25Cnc","_3yAjN","_3Ev3S","_1figt"],[Ju]:["_2__FI"]},[Co]:{[qu]:["_2qRu2"],[Du]:["_1gXMJ"],[Ku]:["_1Ch3x","_2yvtl","gFN2J"],[$u]:["_2NzLI","QHkFc"],[Ju]:["_1qPrY","_2pnz9"],[Vu]:["_3kaGF","_1O1Bz"],[Zu]:["_1O1Bz"],[Yu]:["_3cCqs"]}},Qu={[So]:uo.create({[Hu]:{fontStyle:"italic"},[Gu]:{cursor:"text"}}),[Oo]:uo.create({[Uu]:{fontWeight:"normal",marginTop:"10px"},[Ku]:{marginBottom:"10px"},[Ju]:{":after":{borderColor:"currentColor"}},[Yu]:{marginLeft:"10px"}})},ChallengeSolutions=t=>{var{context:e=Oo,statement:n="",solutions:r=[],userReference:i="",onUserReferenceUpdate:o=Bo,isUserReferenceEditable:u=!0,getScrollOffset:a=(()=>0)}=t,c=er(),[l,f]=Xn(!1),[s,p]=Xn(r),[h,d]=Xn(i),_=Ao({},ea,[e]),v=rr(t=>{f(!0),d(t),Promise.resolve(o(t)).then(t=>{Bn.isArray(t)?p(t):d(h)}).catch(()=>{d(h)}).then(()=>{f(!1)})},[o,f,p,h,d]),g=rr(()=>{if(c.current){var t=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=t.parentNode;n;){if(n.clientHeight>0&&n.scrollHeight-e>n.clientHeight)return n;n=n.parentNode}return document.body}(c.current),e=a()||0;t.scrollTo({top:c.current.offsetTop-e-10,behavior:"smooth"})}},[a,c,s]);return 0===s.length?null:en(En,{scope:"challenge"},""!==n&&en(rn,null,en("h3",null,en(Nn,{id:"statement"},"Statement:")),en("p",null,n)),en(Fu,{context:e,reference:h,onChange:v,isEditable:u&&!l}),en("div",{ref:c},l?en("div",{className:_(ta)},en(Io,null)):en(SolutionList,{context:e,solutions:s,isScoreAvailable:""!==h,onPageChange:g})))},ta="loader",ea={[So]:uo.create({[ta]:{padding:"0 0 18px",textAlign:"center"}})},ClosestSolution=t=>{var{solution:e="",result:n=fo}=t,r=Ao(ia,oa,[n]);return""===e.trim()?null:en(En,{scope:"closest_solution"},en("h2",{className:r(na)},en(Nn,{id:"title"},"Closest solution:"),en("div",{className:r(ra)},en("span",null,en("span",null,e)))))},na="wrapper",ra="value",ia={[So]:{[na]:["_2ez4I"],[ra]:["_1UqAr"]},[fo]:{[na]:["_1Nmv6"]},[so]:{[na]:["_1sqiF"]}},oa={[So]:uo.create({[na]:{marginBottom:"10px"}})},ua="original",aa="corrected",CorrectedAnswer=t=>{var{diffTokens:e=[],result:n=fo}=t,r=Ao(pa,ha,[n]),i=rr((t,e)=>{var n=null;if(t.added){if(aa===e)return null;t.ignorable||(n=fa)}else if(t.removed){if(ua===e)return null;t.ignorable||(n=sa)}return en("span",{className:n&&r(n)},t.value)},[r]),[o,u]=Xn([]),[a,c]=Xn([]);return tr(()=>{u(e.map(t=>i(t,ua))),c(e.map(t=>i(t,aa)))},[e,i]),0===e.length?null:en(En,{scope:"corrected_answer"},en("h2",{className:r(ca)},en(Nn,{id:"title"},"Corrected answer:"),en("div",{className:r(la)},o),en("div",{className:r(la)},a)))},ca="wrapper",la="value",fa="added_token",sa="removed_token",pa={[So]:{[ca]:["_2ez4I"],[la]:["_1UqAr"]},[fo]:{[ca]:["_1Nmv6 "],[fa]:["_1sqiF"]},[so]:{[ca]:["_1sqiF"]}},ha={[So]:uo.create({[ca]:{marginBottom:"10px"},[sa]:{textDecoration:"underline"}})},da=Symbol("pending"),_a=Symbol("opening"),va=Symbol("opened"),ga=Symbol("closing"),ya=Symbol("closed"),ma="default",ba="fit_to_content",xa="maximized",wa={[ma]:{actionLabel:"↑",actionTitleId:"minimize",defaultActionTitle:"Minimize"},[ba]:{actionLabel:"↓",actionTitleId:"fit_to_content",defaultActionTitle:"Fit to content"},[xa]:{actionLabel:"↕",actionTitleId:"maximize",defaultActionTitle:"Maximize"}},ka=t=>{var{children:e,onClose:n=Bo}=t,[r,i]=Xn(da),o=er(),u=er(null),{state:a,nextState:c,next:l}=Eo("modal-size",Object.keys(wa),ma),f=Ao(Ea,za,[r,a]),s=rr(()=>{-1===[ga,ya].indexOf(r)&&(i(ga),setTimeout(()=>{i(ya),n()},300),u.current&&clearTimeout(u.current))},[r,n]);return tr(()=>{if(-1===[ga,ya].indexOf(r)){var t=t=>{"Escape"===t.key&&(s(),Ho(t))};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)}},[r,s]),tr(()=>{da===r&&(setTimeout(()=>i(_a),1),u.current=setTimeout(()=>i(va),300))},[r]),tr(()=>{o.current&&o.current.focus()},[o]),ya===r?null:en(En,{scope:"modal"},en("div",{className:f(Sa),onClick:s},en("div",{className:f(Oa),role:"dialog",tabIndex:"-1",onClick:Ho},en("div",{className:f(Ca),onClick:s},en("img",{src:$o()+"images/x.svg"})),en(Wn,null,en("div",{onClick:l,className:f(Aa),title:en(Nn,{id:wa[c].actionTitleId},wa[c].defaultActionTitle)},wa[c].actionLabel)),en("div",{ref:o,className:f(ja),tabIndex:"0"},e))))},Sa="overlay",Oa="wrapper",Ca="close_button",Aa="size_button",ja="content",Ea={[So]:{[Sa]:["_2Rpqh","_36g-h","_1xa0a"],[Oa]:["_1hEOp","_13Rl7","_3lUbm","_1xa0a"],[Ca]:["FrL-W"],[Aa]:["FrL-W"],[ja]:["_2D1-v"]},[da]:{[Sa]:["_1VSis"],[Oa]:["_1VSis"]},[_a]:{[Sa]:["_2vfOI"],[Oa]:["_1VSis"]},[va]:{[Sa]:["_2vfOI"],[Oa]:["_2vfOI"]},[ga]:{[Sa]:["_1VSis"]}},za={[So]:uo.create({[Oa]:{maxHeight:"calc(95vh - 30px)",maxWidth:"calc(95vw - 30px)","@media (max-width: 699px)":{maxHeight:"95vh",maxWidth:"95vw"}},[ja]:{maxHeight:"calc(95vh - 90px)",overflowY:"auto",paddingRight:"0.5em",position:"relative"},[Aa]:{border:0,borderRadius:"100%",bottom:"1px",left:"auto",right:"1px",top:"auto",transform:"rotate(-45deg)","@media (max-width: 699px)":{fontSize:"1.25em"}}}),[ba]:uo.create({[ja]:{maxWidth:"100%"}}),[xa]:uo.create({[Oa]:{height:"calc(95vh - 30px)",maxHeight:"none",maxWidth:"none",width:"calc(95vw - 30px)","@media (max-width: 699px)":{height:"95vh",width:"95vw"}},[ja]:{maxWidth:"100%","@media (max-width: 699px)":{maxHeight:"100%"}}})},SolutionLink=t=>{var{context:e=Oo,result:n=lo,isLoading:r=!1,solutions:i=[],onClick:o=Ho}=t,u=Object.assign({},Ra,Co===e?{}:{[fo]:Wa(fo),[so]:Wa(so)}),a=Ao(Ta,u,[e,n]);if(!r&&0===i.length)return null;var c=function(t){var e=t.length,n=e.toString();return t.some(t=>!!t.isComplex)&&(++e,n+="+"),{display:n,plural:e}}(i);return en(En,{scope:"solution_link"},r?en("div",{className:a(Ia)},en(Io,null)):en("a",{className:a(Ia),onClick:o},en("div",{className:a(Pa)}),en("span",{className:a(Ma)},en(Nn,{id:"label",plural:c.plural,fields:{count:c.display}},"Solutions (",c.display,")"))))},Ia="wrapper",Pa="icon",Ma="title",Ta={[Oo]:{[Ia]:["_13CKi","_3CCt9"],[Pa]:["_1eGRT","sf9Rc"],[Ma]:["_2472G","_3yAjN"]},[Co]:{[Ia]:["_5j_V-"],[Ma]:["uFNEM","tCqcy"]},[fo]:{[Ia]:["_3NwXb","_34Jmg"]},[so]:{[Ia]:["_1BszG","_2tfS2"]}},Na={[fo]:["_3NwXb","_34Jmg"],[so]:["_1BszG","_2tfS2"]},Ra={[Co]:uo.create({[Ia]:{cursor:"pointer",float:"right",marginRight:"20px",userSelect:"none"}})},Wa=No(t=>{var e=Ko(Ta[Oo][Pa].concat(Na[t]||[]),["background-origin","background-position","background-repeat","background-size","color"]);return uo.create({[Pa]:{backgroundColor:e.color||po[t]||"",maskImage:Jo()||"",maskOrigin:e["background-origin"],maskPosition:e["background-position"],maskRepeat:e["background-repeat"],maskSize:e["background-size"]}})}),Ba={en:{challenge:{statement:"Statement:"},closest_solution:{title:"Closest solution:"},corrected_answer:{title:"Corrected answer:"},modal:{fit_to_content:"Fit to content",maximize:"Maximize",minimize:"Minimize"},pagination:{go_to_first:"Go to first page",go_to_last:"Go to last page",go_to_page:"Go to page {{page}}",go_to_next:"Go to next page",go_to_previous:"Go to previous page"},solution_link:{label:"Solutions ({{count}})"},solution_list:{all:"all",alphabetical_sort:"Alphabetical sort",correct_solutions:"Correct solutions:",per_page:"per page:",similarity_sort:"Similarity sort",sort_ascending:"Sort in ascending order",sort_alphabetically:"Sort alphabetically",sort_by_similarity:"Sort by similarity",sort_descending:"Sort in descending order"},user_reference:{cancel:"Cancel",none:"None yet",title:"Your reference:",update:"Update"}},fr:{challenge:{statement:"Énoncé :"},closest_solution:{title:"Solution la plus proche :"},corrected_answer:{title:"Réponse corrigée :"},modal:{fit_to_content:"Adapter au contenu",maximize:"Maximiser",minimize:"Minimiser"},pagination:{go_to_first:"Aller à la première page",go_to_last:"Aller à la dernière page",go_to_page:"Aller à la page {{page}}",go_to_next:"Aller à la page suivante",go_to_previous:"Aller à la page précédente"},solution_link:{label:"Solutions ({{count}})"},solution_list:{all:"tout",alphabetical_sort:"Tri alphabétique",correct_solutions:"Solutions correctes :",per_page:"par page :",similarity_sort:"Tri par similarité",sort_ascending:"Trier par ordre croissant",sort_alphabetically:"Trier alphabétiquement",sort_by_similarity:"Trier par similarité",sort_descending:"Trier par ordre décroissant"},user_reference:{cancel:"Annuler",none:"Aucune pour l'instant",update:"Modifier",your_reference:"Ta référence :"}}};function La(t){return Ba[t]||Ba[t.substring(0,2)]||{}}var Fa=250,qa=["name","translate","completeReverseTranslation"].map(t=>'[data-test^="challenge challenge-'.concat(t,'"]')).join(", "),Da=["listen","listenTap"].map(t=>'[data-test^="challenge challenge-'.concat(t,'"]')).join(", "),Ua=['[data-test="hint-sentence"]','[data-test="challenge-header"]','[data-test="challenge-translate-prompt"]'],Ha='[data-test="hint-popover"]',Ga="._3mObn > *:last-child > ._1UqAr",Ka=['input[data-test="challenge-text-input"]','textarea[data-test="challenge-translate-input"]'].join(", "),$a="._2ez4I",Ja="._2AOD4, ._3MD8I",Va="._1K9ZC, ._2Jt0i, ._2i8Km",Za="._3Rqyw",Ya={};function Xa(t,e){if(!Ya[t.name]||!Ya[t.name].isConnected){var n=document.createElement("div");n.id=function(t){var e;do{e=t+Do++}while(document.getElementById(e));return e}("".concat(co,"-").concat(t.name,"-")),Ya[t.name]=n}return e.appendChild(Ya[t.name]),Ya[t.name]}function renderChallengeClosestSolution(t,e){try{var n=document.querySelector($a);if(!n)throw new Error("Could not find the solution wrapper element.");wn(en(En,{definition:La(Vo())},en(ClosestSolution,{solution:Xo(t),result:e})),Xa(ClosestSolution,n))}catch(t){}}function renderChallengeCorrectedAnswer(t,e){try{var n=document.querySelector($a);if(!n)throw new Error("Could not find the solution wrapper element.");wn(en(En,{definition:La(Vo())},en(CorrectedAnswer,{diffTokens:t,result:e})),Xa(CorrectedAnswer,n))}catch(t){}}var Qa=!1;function tc(t){try{var e=document.querySelector(Ja);if(!e)throw new Error("Could not find the action link list element.");wn(en(En,{definition:La(Vo())},en(SolutionLink,{result:t,isLoading:!0})),Xa(SolutionLink,e))}catch(t){}}function ec(t,r,i){try{if(Qa)return;Qa=!0;var o=oc,u=(new Date).getTime().toString(),a=function(){var n=e((function*(e){try{tc(r),yield qn(Fa);var n=t.commentId?yield Zo(wo,{userReference:e,commentId:t.commentId}):yield Zo("match_challenge_with_user_answer",{challenge:t,userAnswer:e});if(Lo(n)&&Lo(n.challenge)&&o===oc)return renderChallengeSolutionLink(n.challenge,r,e),Lo(uc)&&(uc.userAnswer=e),n.challenge.solutions||[]}catch(e){renderChallengeSolutionLink(t,r,i)}}));return function(t){return n.apply(this,arguments)}}();wn(en(En,{definition:La(Vo())},en(ka,{key:u,onClose:()=>{Qa=!1}},en(ChallengeSolutions,n({context:Oo},t,{userReference:i,onUserReferenceUpdate:a})))),Xa(ka,document.body))}catch(t){}}function renderChallengeSolutionLink(t,e,n){try{var r=document.querySelector(Ja);if(!r)throw new Error("Could not find the action link list element.");wn(en(En,{definition:La(Vo())},en(SolutionLink,{result:e,solutions:t.solutions,onClick:()=>ec(t,e,n)})),Xa(SolutionLink,r))}catch(t){}}function nc(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{if(ac&&ac.isConnected){var i=document.querySelector(Za);if(!i)throw new Error("Could not find the action link list element.");var o=Xa(ChallengeSolutions,ac);0===o.childNodes.length&&Uo(o,!1);var u=function(){var n=e((function*(e){try{yield qn(Fa);var n=yield Zo(wo,{commentId:t,userReference:e});if(Lo(n)&&Lo(n.challenge)&&t===cc)return lc=n,n.challenge.solutions||[]}catch(t){}}));return function(t){return n.apply(this,arguments)}}(),a=()=>{var t=document.querySelector(Va);return t?t.clientHeight:0};wn(en(En,{definition:La(Vo()||n.fromLanguage)},en(ChallengeSolutions,{key:"forum-challenge-".concat(t),context:Co,solutions:n.solutions,userReference:r,onUserReferenceUpdate:u,getScrollOffset:a})),o),wn(en(En,{definition:La(Vo())},en(SolutionLink,{context:Co,solutions:n.solutions,onClick:()=>Uo(o)})),Xa(SolutionLink,i))}}catch(t){}}var rc=null,ic=null,oc=null,uc=null,ac=null,cc=null,lc=null;function fc(t,e,n){return sc.apply(this,arguments)}function sc(){return(sc=e((function*(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return yield qn(Fa),!ic||(uc={challenge:t,result:e,userAnswer:n},n&&(so===e?t.solutions.length>1&&renderChallengeClosestSolution(Bn.maxBy(t.solutions,"score"),e):Bn.isArray(r)&&renderChallengeCorrectedAnswer(r,e)),renderChallengeSolutionLink(t,e,n),!0)}))).apply(this,arguments)}function pc(){return(pc=e((function*(t,e){if(!document.querySelector(qa))return!1;var n=qo(Ua);if(!n)return!1;var r=n.cloneNode(!0),i=r.querySelectorAll(Ha);return i.length>0&&i.forEach(t=>t.parentNode.removeChild(t)),Zo(bo,{result:t,userAnswer:e,statement:r.innerText}).catch(()=>!1).then(n=>Lo(n)&&fc(n,t,e))}))).apply(this,arguments)}function hc(){return(hc=e((function*(t,e){if(!document.querySelector(Da))return!1;var n=document.querySelector(Ga);return!!n&&Zo(xo,{result:t,userAnswer:e,solutionTranslation:n.innerText}).catch(()=>!1).then(n=>Lo(n)&&Lo(n.challenge)&&fc(n.challenge,t,e,n.correctionDiff))}))).apply(this,arguments)}var dc=new MutationObserver(()=>{if(ic){var t=ic.querySelector("._1tuLI");if(t!==oc&&(uc=null,null!==(oc=t)))try{var e=function(){var t=document.querySelector(Ka),e=t&&t.value&&String(t.value).trim()||"";if(""===e){var n=document.querySelector(".PcKtj");n&&(e=Array.from(n.querySelectorAll('[data-test="challenge-tap-token"]')).map(t=>t.innerText.trim()).join(" ").normalize().trim())}return e}(),n=oc.classList.contains("_3e9O1")?fo:so;tc(n),function(t,e){return hc.apply(this,arguments)}(n,e).then(t=>t||function(t,e){return pc.apply(this,arguments)}(n,e)).then(t=>t||renderChallengeSolutionLink(ko,n,e)).catch(t=>{throw renderChallengeSolutionLink(ko,n,e),t})}catch(t){}}});document.addEventListener("keydown",t=>{t.ctrlKey||null===uc||Qa||Go()||"s"!==t.key.toLowerCase()||(Ho(t),ec(uc.challenge,uc.result,uc.userAnswer))}),setInterval(()=>{document.location.href!==rc&&function(t){cc=null,lc=null;var e=t.match(vo);if(Bn.isArray(e)){var n=Number(e[1]);n>0&&n!==cc&&(cc=n,Zo("get_comment_challenge",n).then(t=>{Lo(t)&&Lo(t.challenge)&&cc===t.commentId&&(lc=t,nc(t.commentId,t.challenge,t.userReference))}).catch(t=>{}))}}(rc=document.location.href);var t=document.querySelector("._2Fc1K");t?t!==ic&&(ic=t,dc.disconnect(),dc.observe(ic,{childList:!0,subtree:!0})):uc=null;var e=document.querySelector("._3eQwU");e&&e!==ac&&(ac=e,lc&&nc(lc.commentId,lc.challenge,lc.userReference))},50)}(); diff --git a/package-lock.json b/package-lock.json index 18173fd..94c9d38 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "duolingo-solution-viewer", - "version": "3.0.2", + "version": "3.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e8333b1..91c75b0 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "A browser extension providing access to the complete lists of accepted solutions for Duolingo's translation challenges.", "license": "MIT", "author": "blmage", - "version": "3.0.2", + "version": "3.0.3", "scripts": { "build": "rollup -c --environment production", "build-debug": "rollup -c --environment development",