(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[12],{IcyU:function(e,t,n){"use strict";n.d(t,"a",(function(){return S}));var r,a,i,o,c,s,u,p,l,b,f,h,j,O,v,y,d,m,x,w=n("4nv/"),g=n("H+61"),k=(n("cpVT"),n("EaFg")),J=(n("ACih"),n("+Jg9")),S=(r=Object(J.JsonObject)("MathOCRResponse"),a=Object(J.JsonProperty)("latex",String,!0),i=Object(J.JsonProperty)("ocrText",String,!0),o=Object(J.JsonProperty)("solution",String,!0),c=Object(J.JsonProperty)("timestamp",Number,!0),s=Object(J.JsonProperty)("isError",Boolean,!0),u=Object(J.JsonProperty)("errorMessage",String,!0),p=Object(J.JsonProperty)("customLatex",String,!0),l=Object(J.JsonProperty)("keyboardLatexInput",String,!0),r((f=function e(){Object(g.a)(this,e),Object(w.a)(this,"latex",h,this),Object(w.a)(this,"ocrText",j,this),Object(w.a)(this,"solution",O,this),Object(w.a)(this,"timestamp",v,this),Object(w.a)(this,"isError",y,this),Object(w.a)(this,"errorMessage",d,this),Object(w.a)(this,"customLatex",m,this),Object(w.a)(this,"keyboardLatexInput",x,this)},h=Object(k.a)(f.prototype,"latex",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),j=Object(k.a)(f.prototype,"ocrText",[i],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),O=Object(k.a)(f.prototype,"solution",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),v=Object(k.a)(f.prototype,"timestamp",[c],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),y=Object(k.a)(f.prototype,"isError",[s],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),d=Object(k.a)(f.prototype,"errorMessage",[u],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),m=Object(k.a)(f.prototype,"customLatex",[p],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),x=Object(k.a)(f.prototype,"keyboardLatexInput",[l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),b=f))||b)},oY9k:function(e,t,n){"use strict";var r=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof r)return r;throw new Error("unable to locate global object")}();e.exports=t=r.fetch,r.fetch&&(t.default=r.fetch.bind(r)),t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response},pLT7:function(e,t,n){"use strict";var r,a,i,o,c,s,u,p,l,b,f,h,j,O,v,y,d,m,x,w,g,k,J,S,P,I,C,z,E,T,A,G,q,R,N,L,F,D,Q,V,B,M,U,H,_=n("vJKn"),$=n.n(_),K=n("cpVT"),Y=n("rg98"),W=n("H+61"),X=n("UlJF"),Z=n("+Jg9"),ee=n("oY9k"),te=n.n(ee),ne=n("4nv/"),re=n("EaFg"),ae=(n("ACih"),n("snK7")),ie=(r=Object(Z.JsonProperty)("graphData",[ae.a],!0),Object(Z.JsonObject)((i=function e(){Object(W.a)(this,e),Object(ne.a)(this,"results",o,this)},o=Object(re.a)(i.prototype,"results",[r],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),a=i))||a),oe=n("reeQ"),ce=(c=Object(Z.JsonProperty)("latex",String),Object(Z.JsonObject)((u=function e(){Object(W.a)(this,e),Object(ne.a)(this,"latex",p,this)},p=Object(re.a)(u.prototype,"latex",[c],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),s=u))||s),se=(l=Object(Z.JsonProperty)("equation",String,!0),b=Object(Z.JsonProperty)("answerCount",Number,!0),f=Object(Z.JsonProperty)("correctAnswerIndex",Number,!0),h=Object(Z.JsonProperty)("answers",[String],!0),Object(Z.JsonObject)((O=function e(){Object(W.a)(this,e),Object(ne.a)(this,"equation",v,this),Object(ne.a)(this,"answerCount",y,this),Object(ne.a)(this,"correctAnswerIndex",d,this),Object(ne.a)(this,"answers",m,this)},v=Object(re.a)(O.prototype,"equation",[l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),y=Object(re.a)(O.prototype,"answerCount",[b],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),d=Object(re.a)(O.prototype,"correctAnswerIndex",[f],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return-1}}),m=Object(re.a)(O.prototype,"answers",[h],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),j=O))||j),ue=(x=Object(Z.JsonProperty)("variationCount",Number,!0),w=Object(Z.JsonProperty)("eqnVariations",[se],!0),g=Object(Z.JsonProperty)("equationId",String,!0),Object(Z.JsonObject)((J=function e(){Object(W.a)(this,e),Object(ne.a)(this,"variationCount",S,this),Object(ne.a)(this,"eqnVariations",P,this),Object(ne.a)(this,"equationId",I,this)},S=Object(re.a)(J.prototype,"variationCount",[x],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),P=Object(re.a)(J.prototype,"eqnVariations",[w],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),I=Object(re.a)(J.prototype,"equationId",[g],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),k=J))||k),pe=n("rW9P"),le=n("qJ2L"),be=n("vIqQ"),fe=n("rCjj"),he=(C=Object(Z.JsonProperty)("videos",[le.a],!0),z=Object(Z.JsonProperty)("entites",[pe.a],!0),E=Object(Z.JsonProperty)("images",[be.a],!0),T=Object(Z.JsonProperty)("worksheets",[fe.a],!0),Object(Z.JsonObject)((G=function e(){Object(W.a)(this,e),Object(ne.a)(this,"videos",q,this),Object(ne.a)(this,"entities",R,this),Object(ne.a)(this,"images",N,this),Object(ne.a)(this,"worksheets",L,this)},q=Object(re.a)(G.prototype,"videos",[C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),R=Object(re.a)(G.prototype,"entities",[z],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),N=Object(re.a)(G.prototype,"images",[E],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),L=Object(re.a)(G.prototype,"worksheets",[T],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),A=G))||A),je=n("IcyU"),Oe=(F=Object(Z.JsonProperty)("e",String,!0),Object(Z.JsonObject)((Q=function e(){Object(W.a)(this,e),Object(ne.a)(this,"e",V,this)},V=Object(re.a)(Q.prototype,"e",[F],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),D=Q))||D),ve=(B=Object(Z.JsonProperty)("values",[Oe],!0),Object(Z.JsonObject)((U=function e(){Object(W.a)(this,e),Object(ne.a)(this,"values",H,this)},H=Object(re.a)(U.prototype,"values",[B],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),M=U))||M),ye=n("vC87");function de(e,t){var n;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"===typeof e)return me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return me(e,t)}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){c=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(c)throw i}}}}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==c[1]?c[1]:"Sketch",r={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({data:t,clientInfo:we({platform:"web"},ye.a.GetClientInfo()),inputForm:n,timestamp:(new Date).getTime()}),credentials:"include"},e.prev=2,e.next=5,te()("".concat(ge,"/cameraexp/api/v1/getlatex"),r);case 5:if(!(a=e.sent)||!a.ok){e.next=14;break}return e.next=9,a.json();case 9:if(!(i=e.sent)){e.next=14;break}if(!(o=(new Z.JsonConvert).deserializeObject(i,je.a))||o.isError||!o.latex){e.next=14;break}return e.abrupt("return",o);case 14:e.next=18;break;case 16:e.prev=16,e.t0=e.catch(2);case 18:return e.abrupt("return",new je.a);case 19:case"end":return e.stop()}}),e,null,[[2,16]])})));return function(t){return e.apply(this,arguments)}}()},{key:"SolveSimpleLatex",value:function(){var e=Object(Y.a)($.a.mark((function e(t){var n,r,a,i;return $.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({LatexExpression:t,clientInfo:we({platform:"web"},ye.a.GetClientInfo())}),credentials:"include"},e.prev=1,e.next=4,te()("".concat(ge,"/cameraexp/api/v1/solvesimplelatex"),n);case 4:if(!(r=e.sent)||!r.ok){e.next=13;break}return e.next=8,r.json();case 8:if(!(a=e.sent)){e.next=13;break}if(!(i=(new Z.JsonConvert).deserializeObject(a,je.a))){e.next=13;break}return e.abrupt("return",i.solution);case 13:e.next=17;break;case 15:e.prev=15,e.t0=e.catch(1);case 17:return e.abrupt("return","");case 18:case"end":return e.stop()}}),e,null,[[1,15]])})));return function(t){return e.apply(this,arguments)}}()},{key:"GetExpressionFromEquationId",value:function(){var e=Object(Y.a)($.a.mark((function e(t){var n,r,a,i;return $.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={headers:{},method:"GET",credentials:"include"},e.prev=1,e.next=4,te()("".concat(ge,"/cameraexp/api/v1/getequation?equationId=").concat(t.replace("@","")),n);case 4:if(!(r=e.sent)||!r.ok){e.next=15;break}return e.next=8,r.json();case 8:if(!(a=e.sent)){e.next=15;break}if(!(i=(new Z.JsonConvert).deserializeObject(a,ce))){e.next=15;break}if(""!==i.latex){e.next=14;break}return e.abrupt("return","@NOTFOUND");case 14:return e.abrupt("return",i.latex);case 15:e.next=19;break;case 17:e.prev=17,e.t0=e.catch(1);case 19:return e.abrupt("return",void 0);case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t){return e.apply(this,arguments)}}()},{key:"GetAnswerFromExpression",value:function(){var e=Object(Y.a)($.a.mark((function e(t,n){var r,a,i,o,c,s,u,p,l,b,f=arguments;return $.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=f.length>2&&void 0!==f[2]?f[2]:{},a=r.customLatex,i=void 0===a?t:a,o=r.showCustomResult,c=void 0!==o&&o,s={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({latexExpression:t,clientInfo:we({platform:"web",mkt:n,skipGraphOutput:!0,skipBingVideoEntity:!0},ye.a.GetClientInfo()),customLatex:i,showCustomResult:c}),credentials:"include"},e.prev=3,e.next=6,te()("".concat(ge,"/cameraexp/api/v1/solvelatex"),s);case 6:if(!(u=e.sent)||!u.ok){e.next=15;break}return e.next=10,u.json();case 10:if(!(p=e.sent)){e.next=15;break}return(l=this.processSolveResponse(p))&&l.mathSolverResult&&"\\pi"===t&&(l.mathSolverResult.actions[0].solution="$3.1415926535897932$",l.mathSolverResult.keyboardLatexInput="\\pi"),e.abrupt("return",l);case 15:e.next=23;break;case 17:return e.prev=17,e.t0=e.catch(3),(b=new oe.a).isError=!0,b.errorMessage="OFFLINE",e.abrupt("return",b);case 23:return e.abrupt("return",void 0);case 24:case"end":return e.stop()}}),e,this,[[3,17]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"GetAnswerFromEquationId",value:function(){var e=Object(Y.a)($.a.mark((function e(t,n){var r,a,i;return $.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({skipCustomParser:!1,clientInfo:we({platform:"web",mkt:n},ye.a.GetClientInfo()),skipGraphOutput:!1,skipBingVideoEntity:!0,equationId:t.replace("@","")}),credentials:"include"},e.prev=1,e.next=4,te()("".concat(ge,"/cameraexp/api/v1/solveid"),r);case 4:if(!(a=e.sent)||!a.ok){e.next=11;break}return e.next=8,a.json();case 8:if(!(i=e.sent)){e.next=11;break}return e.abrupt("return",this.processSolveResponse(i));case 11:e.next=15;break;case 13:e.prev=13,e.t0=e.catch(1);case 15:return e.abrupt("return",void 0);case 16:case"end":return e.stop()}}),e,this,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"GetGraphDataFromGraphExpressions",value:function(){var e=Object(Y.a)($.a.mark((function e(){var t,n,r,a,i,o,c=arguments;return $.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=c.length>0&&void 0!==c[0]?c[0]:[],n=c.length>1&&void 0!==c[1]?c[1]:[],r=c.length>2&&void 0!==c[2]?c[2]:null,a={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({graphExpressions:t,latexExpressions:n,graphRange:r,getDetailedInfo:!0,clientInfo:we({platform:"web"},ye.a.GetClientInfo())}),credentials:"include"},e.next=6,te()("".concat(ge,"/cameraexp/api/v1/getgraphdata"),a);case 6:if(!(i=e.sent)||!i.ok){e.next=13;break}return e.next=10,i.json();case 10:if(!(o=e.sent)){e.next=13;break}return e.abrupt("return",(new Z.JsonConvert).deserializeObject(o,ie));case 13:return e.abrupt("return",void 0);case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"GetBingAnswers",value:function(){var e=Object(Y.a)($.a.mark((function e(t){var n,r,a;return $.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({queryInfo:t}),credentials:"include"},e.next=3,te()("".concat(ge,"/cameraexp/api/v1/generateCustomBingAnswers"),n);case 3:if(!(r=e.sent)||!r.ok){e.next=10;break}return e.next=7,r.json();case 7:if(!(a=e.sent)){e.next=10;break}return e.abrupt("return",(new Z.JsonConvert).deserializeObject(a,he));case 10:return e.abrupt("return",void 0);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"GetPopularProblems",value:function(){var e=Object(Y.a)($.a.mark((function e(t){var n,r,a,i;return $.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={headers:{},method:"GET",credentials:"include"},e.prev=1,e.next=4,te()("https://bingedu.azureedge.net/mathuxjs/popular/popular-".concat(t,".json"),n);case 4:if(!(r=e.sent)||!r.ok){e.next=13;break}return e.next=8,r.json();case 8:if(!(a=e.sent)){e.next=13;break}if(!(i=(new Z.JsonConvert).deserializeObject(a,ve))){e.next=13;break}return e.abrupt("return",i.values);case 13:e.next=17;break;case 15:e.prev=15,e.t0=e.catch(1);case 17:return e.abrupt("return",void 0);case 18:case"end":return e.stop()}}),e,null,[[1,15]])})));return function(t){return e.apply(this,arguments)}}()},{key:"GenerateQuiz",value:function(){var e=Object(Y.a)($.a.mark((function e(t){return $.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.fetchQuiz({latex:t,maxQuestions:5}));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"GetQuiz",value:function(){var e=Object(Y.a)($.a.mark((function e(t){return $.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.fetchQuiz({EquationId:t}));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"fetchQuiz",value:function(){var e=Object(Y.a)($.a.mark((function e(t){var n,r,a;return $.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify(t),credentials:"include"},e.prev=1,e.next=4,te()("".concat(ge,"/cameraexp/api/v1/generateproblems"),n);case 4:if(!(r=e.sent)||!r.ok){e.next=11;break}return e.next=8,r.json();case 8:if(!(a=e.sent)){e.next=11;break}return e.abrupt("return",(new Z.JsonConvert).deserializeObject(a,ue));case 11:e.next=15;break;case 13:e.prev=13,e.t0=e.catch(1);case 15:return e.abrupt("return",void 0);case 16:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t){return e.apply(this,arguments)}}()},{key:"processSolveResponse",value:function(e){var t=JSON.parse(e.results[0].tags[0].actions[0].customData),n=(new Z.JsonConvert).deserializeObject(JSON.parse(t.previewText),oe.a);if(n.mathSolverResult&&n.mathSolverResult.actions&&n.mathSolverResult.actions.length>0){var r,a=[],i=[],o=de(n.mathSolverResult.actions);try{for(o.s();!(r=o.n()).done;){var c=r.value;c.templateSteps&&c.templateSteps.length>0?a.push(c):i.push(c)}}catch(s){o.e(s)}finally{o.f()}n.mathSolverResult.actions=a.concat(i)}return n.entities=[],n.videos=[],n}}]),e}();t.a=new ke},rg98:function(e,t,n){"use strict";function r(e,t,n,r,a,i,o){try{var c=e[i](o),s=c.value}catch(u){return void n(u)}c.done?t(s):Promise.resolve(s).then(r,a)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(a,i){var o=e.apply(t,n);function c(e){r(o,a,i,c,s,"next",e)}function s(e){r(o,a,i,c,s,"throw",e)}c(void 0)}))}}n.d(t,"a",(function(){return a}))},vC87:function(e,t,n){"use strict";var r=n("H+61"),a=n("UlJF"),i=n("cpVT"),o=function(){function e(){Object(r.a)(this,e),Object(i.a)(this,"clientInfo",{})}return Object(a.a)(e,[{key:"SetClientInfo",value:function(e){this.clientInfo=e}},{key:"GetClientInfo",value:function(){return this.clientInfo}}]),e}();t.a=new o}}]);