PageSourceSearch

https://www.aatbio.com/_next/static/chunks/5700.0952e6d370c9a400.js

js aatbio.com collected 2026-10-02 10:37:00 UTC 12,597 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5700],{15700:(e,t,r)=>{r.r(t),r.d(t,{Graphable_Calculate_Polynomial:()=>m});var l=r(95155),a=r(12115),s=r(19332),i=r(49080),n=r(35693),o=r(28282),c=r(38713),u=r(36284),h=r(40344);let p=e=>e[0].toUpperCase()+e.substring(1);var d=r(10536),x=r(37675),f=r(71024),g=r(34027),j=r(55773);class b{}b.prepareEmpty=()=>({forward:()=>NaN,reverse:()=>NaN}),b.prepareLinear=(e,t)=>{let r=b.prepareEmpty();return 2!==e.length||(r.forward=r=>{let l=e[0]*r+e[1];return(0,j.e)(l,t)},r.reverse=r=>{let l=(r-e[1])/e[0];return(0,j.e)(l,t)}),r},b.prepareQuadratic=(e,t)=>{let r=b.prepareEmpty();return 3!==e.length||(r.forward=r=>{let l=e[0]*Math.pow(r,2)+e[1]*r+e[2];return(0,j.e)(l,t)},r.reverse=r=>{let l=e[2]-r,a=Math.pow(e[1],2)-4*e[0]*l;if(a<0)return["complex","complex"];let s=(-1*e[1]+Math.sqrt(a))/(2*e[0]),i=(-1*e[1]-Math.sqrt(a))/(2*e[0]);return[(0,j.e)(s,t),(0,j.e)(i,t)]}),r},b.prepareCubic=(e,t)=>{let r=b.prepareEmpty();return 4!==e.length||(r.forward=r=>{let l=e[0]*Math.pow(r,3)+e[1]*Math.pow(r,2)+e[2]*r+e[3];return(0,j.e)(l,t)},r.reverse=r=>{let[l,a,s]=e,i=e[3]-r,n=[],o=(3*s/l-Math.pow(a,2)/Math.pow(l,2))/3,c=(2*Math.pow(a,3)/Math.pow(l,3)-9*a*s/Math.pow(l,2)+27*i/l)/27,u=Math.pow(c,2)/4+Math.pow(o,3)/27;if(u>0){let e=-(c/2*1)+Math.sqrt(u),t=e<0?-1:1,r=Math.pow(e*t,1/3)*t,s=-(c/2*1)-Math.sqrt(u),i=s<0?-1:1,o=Math.pow(s*i,1/3)*i;n.push(r+o-a/(3*l))}else if(0===o&&0===c&&0===u){let e=i/l,t=e<0?-1:1,r=Math.pow(e*t,1/3)*t;n.push(-1*r)}else if(u<=0){let e=Math.sqrt(Math.pow(c,2)/4-u),t=e<0?-1:1,r=Math.pow(e*t,1/3)*t,s=Math.acos(-(c/(2*e)*1)),i=-1*r,o=Math.cos(s/3),h=Math.sqrt(3)*Math.sin(s/3),p=-(a/(3*l)*1);n.push(2*r*Math.cos(s/3)-a/(3*l)),n.push(i*(o+h)+p),n.push(i*(o-h)+p)}for(let e=0,r=n.length;e<r;e++)n[e]=(0,j.e)(n[e],t);return n}),r},b.prepareQuartic=async(e,t)=>{let l=b.prepareEmpty();if(5!==e.length)return l;let a=await r.e(4196).then(r.bind(r,4196)).then(e=>e.mathSolvePolyRoot);return l.forward=r=>{let l=e[0]*Math.pow(r,4)+e[1]*Math.pow(r,3)+e[2]*Math.pow(r,2)+e[3]*r+e[4];return(0,j.e)(l,t)},l.reverse=r=>{let[l,s,i,n]=e,[o]=a([l,s,i,n,e[4]-r]),c=[];for(let e=0,r=o.length;e<r;e++)c.push((0,j.e)(o[e],t));return c},l},b.prepareEquations=async e=>{let t=[];for(let r=0,l=e.equations.length;r<l;r++){let l=e.equations[r],a=e.significance[r],s={linear:b.prepareLinear(l.linear.coefficients,a.linear),quadratic:b.prepareQuadratic(l.quadratic.coefficients,a.quadratic),cubic:b.prepareCubic(l.cubic.coefficients,a.cubic),quartic:await b.prepareQuartic(l.quartic.coefficients,a.quartic)};t.push(s)}return t};class m{constructor(e,t,r){this.titles=["linear","quadratic","cubic","quartic"],this.prettySign=(e,t)=>e>=0?[(0,l.jsx)(a.Fragment,{children:"+"},t),e]:[(0,l.jsx)(a.Fragment,{children:"−"},t),-1*e],this.generateEquations=async()=>{if(!this.calculate_results)return null;this.calculate_equations=await b.prepareEquations(this.calculate_results)},this.resultsTable=()=>{try{if(!this.calculate_results)throw Error("No data");let e="Results Table",t={rows:[["Data","Type","Form","Equation",(0,l.jsxs)(a.Fragment,{children:["R",(0,l.jsx)(u.K9,{children:"2"})]},0)]],title:e,config:{allowCopy:!0}},{equations:r,labels:s}=this.calculate_results;for(let e=0,i=r.length;e<i;e++){let i=r[e],{array:n}=d.k.typed(i);for(let i=0,o=n.length;i<o;i++){let o=[];o.push(s[e]);let c=n[i],h=(0,l.jsx)(a.Fragment,{}),p=(0,l.jsx)(a.Fragment,{}),d=[];for(let t=0,l=r[e][c].coefficients.length;t<l;t++)d.push(this.prettySign(r[e][c].coefficients[t],t));switch(c){case"linear":h=(0,l.jsx)(a.Fragment,{children:"ax + b"}),p=(0,l.jsxs)(a.Fragment,{children:[r[e][c].coefficients[0],"x ",d[1][0]," ",d[1][1]]});break;case"quadratic":h=(0,l.jsxs)(a.Fragment,{children:["ax",(0,l.jsx)(u.K9,{children:"2"})," + bx + c"]}),p=(0,l.jsxs)(a.Fragment,{children:[r[e][c].coefficients[0],"x",(0,l.jsx)(u.K9,{children:"2"}),"\xa0",d[1][0]," ",d[1][1],"x\xa0",d[2][0]," ",d[2][1]]});break;case"cubic":h=(0,l.jsxs)(a.Fragment,{children:["ax",(0,l.jsx)(u.K9,{children:"3"})," + bx",(0,l.jsx)(u.K9,{children:"2"})," + cx + d"]}),p=(0,l.jsxs)(a.Fragment,{children:[r[e][c].coefficients[0],"x",(0,l.jsx)(u.K9,{children:"3"}),"\xa0",d[1][0]," ",d[1][1],"x",(0,l.jsx)(u.K9,{children:"2"}),"\xa0",d[2][0]," ",d[2][1],"x\xa0",d[3][0]," ",d[3][1]]});break;case"quartic":h=(0,l.jsxs)(a.Fragment,{children:["ax",(0,l.jsx)(u.K9,{children:"4"})," + bx",(0,l.jsx)(u.K9,{children:"3"})," + cx",(0,l.jsx)(u.K9,{children:"2"})," + dx + e"]}),p=(0,l.jsxs)(a.Fragment,{children:[r[e][c].coefficients[0],"x",(0,l.jsx)(u.K9,{children:"4"}),"\xa0",d[1][0]," ",d[1][1],"x",(0,l.jsx)(u.K9,{children:"3"}),"\xa0",d[2][0]," ",d[2][1],"x",(0,l.jsx)(u.K9,{children:"2"}),"\xa0",d[3][0]," ",d[3][1],"x\xa0",d[4][0]," ",d[4][1]]})}o.push(c.toUpperCase()),o.push(h),o.push(p),o.push(r[e][c].r),t.rows.push(o)}}return[e,t]}
1catch(e){return[null,null]}},this.generateCalculationTable=(e,t,r,s)=>{let n={rows:[],title:r?(0,l.jsx)(a.Fragment,{children:r}):null,config:{allowCopy:!0,hideHeader:s}};return n.rows.push((0,l.jsx)(i.m,{equation:e,title:t},r)),[r,n]},this.generateCalculationTableController=e=>{if(!this.calculate_equations||!this.calculate_results)return[];let t=this.calculate_results.labels[e],r="Polynomial Calculator [".concat(t,"]"),l=[],a=this.calculate_equations[e];for(let e=0,t=this.titles.length;e<t;e++){let t=this.titles[e],s=p(t),[i,n]=this.generateCalculationTable(a[t],s,r,0!==e);"string"==typeof i&&n&&l.push([i,n])}return l},this.prepareData=(e,t)=>{if(!this.calculate_results)return null;let{points:r,sem:l,labels:a}=this.calculate_results,s=new c.d,i=this.inputs_options.error.value;return s.addLinePointsSem({points:r[e],id:"".concat(a[e],"-").concat(t),count:e,$label:a[e],sem:i?l[e]:void 0}),s},this.generatePlots=()=>{let e=[];try{if(!this.calculate_results||!this.calculate_equations)throw Error("No plots");let{labels:t}=this.calculate_results;for(let r=0,a=t.length;r<a;r++){let a=t[r],s=this.calculate_equations[r];for(let t=0,i=this.titles.length;t<i;t++){let i=this.titles[t],c={},u=s[i];c["".concat(a,"-").concat(i,"-bfl")]=u.forward;let h=this.prepareData(r,i);if(!h)return e;let d=new n.f(this.inputs_options.title.value,this.inputs_options.xLabel.value,this.inputs_options.yLabel.value);d.xTickNumber=10,d.yTickNumber=10;let x="".concat(p(i)," [").concat(a,"]"),f={plot:(0,l.jsx)(o.W,{$chartProps:h,$config:d,functions:c,chartKey:x}),title:x};e.push([x,f])}}return e}catch(t){return e}},this.renderResults=()=>{let e=this.calculate_results,t=this.calculate_equations;if(!e||!t)return;this.output=new g.B;let[r,l]=this.resultsTable();r&&l&&this.output.addTable(l);for(let t=0,r=e.labels.length;t<r;t++)for(let e of this.generateCalculationTableController(t)){let[t,r]=e;t&&r&&this.output.addTable(r)}for(let e of this.generatePlots()){let[t,r]=e;t&&r&&this.output.addPlot(r)}},this.calculate=async()=>{try{let{labels:e,sets:t}=x.O.generateLabelsAndSets(this.inputs_data),r=s.e.convertToApi(this.inputs_options),l=new h.ApiWrapper("/api/tools/polynomial"),a=await l.post({labels:e,sets:t,options:r});if(!a||!a.results)throw Error("Calculation failed");this.calculate_results=a.results,await this.generateEquations(),this.renderResults()}catch(e){f.i.generic();return}},this.inputs_data=e,this.inputs_options=t,this.url=r}}},49080:(e,t,r)=>{r.d(t,{m:()=>z});var l=r(95155),a=r(54463),s=r(31512),i=r(96869),n=r(50645);let o=(0,n.A)((0,l.jsx)("path",{d:"M19 7H9c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2m0 2v2H9V9zm-6 6v-2h2v2zm2 2v2h-2v-2zm-4-2H9v-2h2zm6-2h2v2h-2zm-8 4h2v2H9zm8 2v-2h2v2zM6 17H5c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2v1h-2V5H5v10h1z"}),"TableView");var c=r(75265),u=r(2021),h=r(56919),p=r(41477),d=r(1123),x=r(40670),f=r(66370),g=r(12115),j=r(15636),b=r(20999);let m=(0,g.createContext)(void 0),y=e=>{let{children:t}=e,[r,a]=(0,g.useState)([{x:"",y:""}]);return(0,l.jsx)(m.Provider,{value:{rows:r,_rows:a},children:t})},w=()=>{let e=(0,g.useContext)(m);if(void 0===e)throw Error("useContext must be used within a valid context provider");return e},v=e=>{let{calcBulk:t,open:r,_open:a}=e,[s,n]=(0,g.useState)("x"),[o,j]=(0,g.useState)(""),m=(0,g.useCallback)(()=>{t(s,o.trim().split("\n").map(e=>e.trim())),a(!1)},[s,o,t,a]);return(0,l.jsxs)(c.A,{open:r,onClose:()=>{a(!1)},children:[(0,l.jsx)(u.A,{children:"Paste in multiple X or Y values, one per line"}),(0,l.jsxs)(i.default,{gap:2,px:4,alignItems:"center",children:[(0,l.jsxs)(h.A,{row:!0,onChange:e=>{n("x"===e.target.value?"x":"y")},value:s,children:[(0,l.jsx)(p.A,{value:"x",control:(0,l.jsx)(d.A,{}),label:"X"}),(0,l.jsx)(p.A,{value:"y",control:(0,l.jsx)(d.A,{}),label:"Y"})]}),(0,l.jsx)(x.A,{type:"text",multiline:!0,rows:6,placeholder:"Paste one value per line",value:o,onChange:e=>{j(e.target.value)},fullWidth:!0}),(0,l.jsx)(f.A,{children:(0,l.jsx)(b.I,{onClick:m,children:"Calculate"})})]})]})},C=e=>{let{equation:t}=e,{_rows:r}=w(),[a,s]=(0,g.useState)(!1),i=(0,g.useCallback)((e,l)=>{if(!t||!l.length)return;let a=[];for(let r of l){let l={x:"",y:""};switch(e){case"x":{l.x=r;let e=Number(r);
1if(isNaN(e))l.y="";else{let r=t.forward(e);l.y="number"!=typeof r||isNaN(r)?"":r.toString()}break}case"y":{l.y=r;let e=Number(r);if(isNaN(e))l.x="";else{let r=t.reverse(e);l.x=Array.isArray(r)?r:isNaN(r)?"":r.toString()}}}a.push(l)}r(e=>{let t=[...e];for(let e of a)t.push(e);return t.push({x:"",y:""}),t})},[t,r]);return(0,l.jsxs)(j.V,{children:[(0,l.jsx)(b.I,{variant:"text",color:"aat_gray_dark",onClick:()=>{s(!0)},size:"small",startIcon:(0,l.jsx)(o,{}),children:"Bulk Calculate"}),(0,l.jsx)(v,{calcBulk:i,open:a,_open:s})]})},_={"& .MuiOutlinedInput-root":{"& fieldset":{border:0},"&.Mui-focused fieldset":{border:"2px solid",borderColor:"aat_blue_light.main"}}},q=e=>{let{equation:t,row:r,index:i,rowCount:n}=e,{_rows:o}=w(),c=(0,g.useCallback)(e=>{let r,{target:l}=e,{value:a}=l,s=Number(a);if(isNaN(s))r="";else{let e=t.forward(s);r="number"!=typeof e||isNaN(e)?"":e.toString()}o(e=>{let t=[...e];return t[i]={x:a,y:r},t})},[t,o,i]),u=(0,g.useCallback)(e=>{let r,{target:l}=e,{value:a}=l,s=Number(a);if(isNaN(s))r="";else{let e=t.reverse(s);r=Array.isArray(e)?e:isNaN(e)?"":e.toString()}o(e=>{let t=[...e];return t[i]={x:r,y:a},t})},[t,o,i]),h=(0,g.useCallback)(()=>{o(e=>{let t=[...e];return t.push({x:"",y:""}),t})},[o]),p=(0,g.useCallback)(()=>{i+1===n&&h()},[n,i,h]);return t&&"function"==typeof t.forward&&"function"==typeof t.reverse&&n?(0,l.jsxs)(a.default,{children:[(0,l.jsx)(s.default,{children:(0,l.jsx)(x.A,{size:"small",fullWidth:!0,type:Array.isArray(r.x)?"text":"number",onChange:c,value:Array.isArray(r.x)?r.x.join("; "):r.x,placeholder:"Enter X to calculate Y",onClick:p,sx:_})}),(0,l.jsx)(s.default,{children:(0,l.jsx)(x.A,{size:"small",fullWidth:!0,type:"number",onChange:u,value:r.y,placeholder:"Enter Y to calculate X",onClick:p,sx:_})})]}):null},M=(0,n.A)((0,l.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy");var k=r(25367),N=r(4615);let A=()=>{let{rows:e}=w(),[t,r]=(0,g.useState)(!1),a=(0,g.useCallback)(async()=>{if(!e.length)return;r(!0);let t=e.map(e=>[e.x,e.y].join("	")).join("\n");await navigator.clipboard.writeText("X	Y\n"+t)},[e]),s=(0,g.useCallback)(()=>{r(!1)},[]);return(0,l.jsxs)(j.V,{children:[(0,l.jsx)(b.I,{variant:"text",startIcon:(0,l.jsx)(M,{}),color:"aat_gray_dark",onClick:a,size:"small",children:"Copy Table"}),(0,l.jsx)(k.A,{open:t,autoHideDuration:3e3,onClose:s,message:"Table copied to clipboard",color:"success",anchorOrigin:{vertical:"bottom",horizontal:"center"},children:(0,l.jsx)(N.default,{onClose:s,severity:"success",variant:"filled",children:"Table copied to clipboard"})})]})},E=e=>{let{title:t,equation:r}=e;return(0,l.jsx)(a.default,{sx:{backgroundColor:"aat_green_light.main"},children:(0,l.jsx)(s.default,{colSpan:2,sx:{fontWeight:"semi"},children:(0,l.jsxs)(i.default,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[t,(0,l.jsxs)(i.default,{direction:"row",gap:2,children:[(0,l.jsx)(C,{equation:r}),(0,l.jsx)(A,{})]})]})})})},T=e=>{let{title:t}=e;return(0,l.jsxs)(a.default,{sx:{backgroundColor:t?"aat_gray_lighter.main":void 0},children:[(0,l.jsx)(s.default,{children:"X"}),(0,l.jsx)(s.default,{children:"Y"})]})},F=e=>{let{equation:t}=e,{rows:r}=w();return(0,l.jsx)(l.Fragment,{children:r.map((e,a)=>(0,l.jsx)(q,{equation:t,row:e,index:a,rowCount:r.length},a))})},z=e=>{let{equation:t,title:r}=e;return(0,l.jsxs)(y,{children:[(0,l.jsx)(E,{title:r,equation:t}),(0,l.jsx)(T,{title:r}),(0,l.jsx)(F,{equation:t})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.