@zakodium/nmrium-core 0.7.3 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nmrium-core.d.ts +54 -2
- package/dist/nmrium-core.js +3 -3
- package/package.json +5 -5
package/dist/nmrium-core.d.ts
CHANGED
|
@@ -141,8 +141,24 @@ export declare interface AxisPreferencesGridlines {
|
|
|
141
141
|
|
|
142
142
|
export declare type AxisUnit = (typeof axisUnits)[number];
|
|
143
143
|
|
|
144
|
+
export declare type AxisUnit1DFid = (typeof axisUnits1DFid)[number];
|
|
145
|
+
|
|
146
|
+
export declare type AxisUnit1DFt = (typeof axisUnits1DFt)[number];
|
|
147
|
+
|
|
148
|
+
export declare type AxisUnit2DFid = (typeof axisUnits2DFid)[number];
|
|
149
|
+
|
|
150
|
+
export declare type AxisUnit2DFt = (typeof axisUnits2DFt)[number];
|
|
151
|
+
|
|
144
152
|
export declare const axisUnits: readonly ["ppm", "hz", "pt", "s"];
|
|
145
153
|
|
|
154
|
+
export declare const axisUnits1DFid: ["pt", "s"];
|
|
155
|
+
|
|
156
|
+
export declare const axisUnits1DFt: ["pt", "ppm", "hz"];
|
|
157
|
+
|
|
158
|
+
export declare const axisUnits2DFid: ["pt", "s"];
|
|
159
|
+
|
|
160
|
+
export declare const axisUnits2DFt: ["pt", "ppm", "hz"];
|
|
161
|
+
|
|
146
162
|
declare interface BaseExportSettings {
|
|
147
163
|
useDefaultSettings: boolean;
|
|
148
164
|
dpi: number;
|
|
@@ -249,7 +265,7 @@ export declare interface CoreReadReturn {
|
|
|
249
265
|
containsNmrium: boolean;
|
|
250
266
|
}
|
|
251
267
|
|
|
252
|
-
export declare const CURRENT_EXPORT_VERSION:
|
|
268
|
+
export declare const CURRENT_EXPORT_VERSION: 15;
|
|
253
269
|
|
|
254
270
|
export declare type CustomWorkspaces = Record<string, InnerWorkspace>;
|
|
255
271
|
|
|
@@ -290,6 +306,14 @@ export declare type DeepPartial<T> = {
|
|
|
290
306
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
291
307
|
};
|
|
292
308
|
|
|
309
|
+
export declare const defaultAxisUnit1DFid: AxisUnit1DFid;
|
|
310
|
+
|
|
311
|
+
export declare const defaultAxisUnit1DFt: AxisUnit1DFt;
|
|
312
|
+
|
|
313
|
+
export declare const defaultAxisUnit2DFid: AxisUnit2DFid;
|
|
314
|
+
|
|
315
|
+
export declare const defaultAxisUnit2DFt: AxisUnit2DFt;
|
|
316
|
+
|
|
293
317
|
/**
|
|
294
318
|
* Define a plugin for NMRium.
|
|
295
319
|
* This function is useful for type hinting. It just returns its argument unchanged.
|
|
@@ -562,7 +586,7 @@ export declare interface MultipleSpectraAnalysisPreferences {
|
|
|
562
586
|
|
|
563
587
|
export declare class NMRiumCore {
|
|
564
588
|
#private;
|
|
565
|
-
readonly version:
|
|
589
|
+
readonly version: 15;
|
|
566
590
|
registerPlugin(plugin: NMRiumPlugin): void;
|
|
567
591
|
registerPlugins(plugins: NMRiumPlugin[]): void;
|
|
568
592
|
private getPlugin;
|
|
@@ -916,6 +940,10 @@ export declare interface NmrLoaderSelectors {
|
|
|
916
940
|
files?: string[];
|
|
917
941
|
}
|
|
918
942
|
|
|
943
|
+
export declare type Nuclei1DUnits = Record<Nucleus1D, Nucleus1DUnit | undefined>;
|
|
944
|
+
|
|
945
|
+
export declare type Nuclei2DUnits = Record<Nucleus2D, Nucleus2DUnit | undefined>;
|
|
946
|
+
|
|
919
947
|
export declare interface NucleiPreferences {
|
|
920
948
|
nucleus: string;
|
|
921
949
|
ppmFormat: string;
|
|
@@ -924,6 +952,28 @@ export declare interface NucleiPreferences {
|
|
|
924
952
|
axisTo?: number;
|
|
925
953
|
}
|
|
926
954
|
|
|
955
|
+
declare type Nucleus1D = Spectrum1D['info']['nucleus'];
|
|
956
|
+
|
|
957
|
+
export declare interface Nucleus1DUnit {
|
|
958
|
+
horizontal: {
|
|
959
|
+
fid: AxisUnit1DFid;
|
|
960
|
+
ft: AxisUnit1DFt;
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
declare type Nucleus2D = ReturnType<Spectrum2D['info']['nucleus']['join']>;
|
|
965
|
+
|
|
966
|
+
export declare interface Nucleus2DUnit {
|
|
967
|
+
direct: {
|
|
968
|
+
fid: AxisUnit2DFid;
|
|
969
|
+
ft: AxisUnit2DFt;
|
|
970
|
+
};
|
|
971
|
+
indirect: {
|
|
972
|
+
fid: AxisUnit2DFid;
|
|
973
|
+
ft: AxisUnit2DFt;
|
|
974
|
+
};
|
|
975
|
+
}
|
|
976
|
+
|
|
927
977
|
export declare interface OnLoadProcessing {
|
|
928
978
|
autoProcessing: boolean;
|
|
929
979
|
filters?: Partial<Record<string, AutoProcessingFilterEntry[]>>;
|
|
@@ -1467,6 +1517,8 @@ export declare interface ViewState {
|
|
|
1467
1517
|
* the current simulated spectrum key
|
|
1468
1518
|
*/
|
|
1469
1519
|
currentSimulatedSpectrumKey: string | null;
|
|
1520
|
+
units1D: Nuclei1DUnits;
|
|
1521
|
+
units2D: Nuclei2DUnits;
|
|
1470
1522
|
}
|
|
1471
1523
|
|
|
1472
1524
|
export declare interface WheelOptions {
|
package/dist/nmrium-core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var Ae={NORMAL:"NORMAL",FORMULA:"FORMULA"};var we={RELATIVE:"relative",ABSOLUTE:"absolute",MIN:"min",MAX:"max"};var Fe=[{name:"pixels",unit:"px"},{name:"inches",unit:"in"},{name:"feet",unit:"ft"},{name:"yards",unit:"yd"},{name:"centimeters",unit:"cm"},{name:"millimeters",unit:"mm"},{name:"meters",unit:"m"},{name:"points",unit:"pt"},{name:"picas",unit:"pc"}];var Te=["ppm","hz","pt","s"];var b=14;var Ee=[{key:"CT",description:"CT from NMR Solutions"}];import{isAnyArray as ke}from"is-any-array";import{xMultiply as B}from"ml-spectra-processing";var Le=crypto.randomUUID.bind(crypto),x=Le;function O(e){let{id:t=x(),meta:o,peaks:r={},filters:i=[],info:n={},ranges:c={},integrals:s={},selector:l,sourceId:a,dependentVariables:p=[],...m}=e,u={id:t,meta:o,filters:i},{data:f=ze(p[0]?.components??[])}=e;if(Array.isArray(n.nucleus)&&(n.nucleus=n.nucleus[0]),u.data={x:[],re:[],im:[],...f},"scaleFactor"in n){let{scaleFactor:g}=n,{re:S,im:y}=u.data;B(S,g,{output:S}),y&&B(y,g,{output:y})}l&&(u.selector=l),a&&(u.sourceId=a,u.fileCollectionId=a);let d=ke(f.im);if(u.info={phc0:0,phc1:0,nucleus:"1H",isFid:!1,isComplex:d,dimension:1,name:n?.name||t,...n},n.isFid&&n.reverse&&d){let{im:g}=u.data;B(g,-1,{output:g}),u.info.reverse=!1}return u.display={isVisible:!0,isPeaksMarkersVisible:!0,isRealSpectrumVisible:!0,isVisibleInDomain:!0,...e.display},u.peaks={values:[],options:{},...r},u.ranges={values:[],options:{sum:null,isSumConstant:!0,sumAuto:!0},...c},u.integrals={values:[],options:{},...s},{...m,...u}}function ze(e){let t=e[0]?.data?.x||[],o=e[0]?.data?.re||e[0]?.data?.y||[],r=e[0]?.data?.im||e[1]?.data?.y||null;return t.length>0&&t[0]>t[1]&&(t.reverse(),o.reverse(),r&&r.reverse()),{x:t,re:o,im:r}}import{matrixToArray as Ue,xMinMaxValues as Ve,xNoiseSanPlot as je}from"ml-spectra-processing";var K={z:[[]],minX:0,minY:0,maxX:0,maxY:0},_e={re:K,im:K},Be={rr:K};function M(e){let{id:t=x(),meta:o={},dependentVariables:r=[],info:i={},filters:n=[],zones:c=[],sourceId:s,...l}=e,a={id:t,meta:o,filters:n};s&&(a.sourceId=s,a.fileCollectionId=s),a.info={nucleus:["1H","1H"],isFid:!1,isComplex:!1,name:i?.name||x(),...i},a.originalInfo=structuredClone(a.info),a.display={isPositiveVisible:!0,isNegativeVisible:!0,isVisible:!0,dimension:2,...e.display};let{data:p=r[0]?.components??{}}=e;if(a.data={...a.info.isFid?_e:Be,...p},a.originalData=structuredClone(a.data),!("spectrumSize"in i)){let m=i.isFid?"re":"rr",u=a.data[m].z.length,f=u>0?a.data[m].z[0].length:0;a.info.spectrumSize=[f,u]}if(!i.isFid){let m=a.data.rr,u=Ue(m.z),{positive:f,negative:d}=je(u),{min:g,max:S}=Ve(u);a.data.rr={...m,minZ:g,maxZ:S},a.info.noise={positive:f,negative:d}}return a.zones={values:[],options:{},...c},{...l,...a}}import{xSequentialFillFromTo as We}from"ml-spectra-processing";import{isAnyArray as Ke}from"is-any-array";function W(e,t=0){if(Ke(e)){let o=e.at(t);if(o!==void 0)return o;throw new RangeError("An array with a index out of boundaries")}return e}var Xe=new Set(["t1ir","T1"]);function ae(e){let t=[];for(let o of e){let{info:{pulseSequence:r,isFid:i}}=o,{data:n,info:c,meta:{vdlistValues:s=[]}={}}=o;if(!(r&&Xe.has(r))||s.length===0){t.push(o);continue}let a=i?"re":"rr",p={};for(let y in c)p[y]=W(c[y]);let{z:m,maxX:u,minX:f}=n[a],d=We({from:f,to:u,size:m[0].length}),[g,S]=Ze(o);for(let y=0;y<s.length;y++){let P={re:d,x:d};for(let h in n)P[Ye(h)]=n[h].z.at(g*(y+S));t.push(O({data:P,info:{...p,name:`${p.name}_${s[y]}`,dimension:1,vd:s[y]}}))}}return t}function Ye(e){return["rr","re"].includes(e)?"re":["im","ri","ir","ii"].includes(e)?"im":"x"}function Ze(e){let{meta:{PAGE:t}}=e,o=!0;if(t){let r=i=>Number.parseFloat(i.replace(/[F|T]1=/,""));o=r(t[0])>r(t[2])}return o?[-1,1]:[1,0]}var Ge=2,$e=1;function Je(e){let{spectra:t=[],molecules:o}=e,r=[];for(let i of t){let{info:n}=i;switch(n.dimension){case $e:r.push(O(i));break;case Ge:r.push(M(i));break;default:throw new Error("dimension does not supported")}}return{molecules:o,spectra:ae(r)}}function qe(e){return e}function N(e,t){return JSON.parse(JSON.stringify(e),function(r,i){if(r in t){this[t[r]]=i;return}return i})}function X(e){if(e?.version===1)return e;let t={...e,version:1},o={j:"js",signal:"signals",integral:"integration",peak:"peaks",diaID:"diaIDs"};for(let r of t.spectra){if(r.ranges){let i=N(r.ranges,o);r.ranges=Array.isArray(i)?{values:i}:i}else if(r.zones){let i=N(r.zones,o);r.zones=Array.isArray(i)?{values:i}:i}r.peaks&&(r.peaks=Array.isArray(r.peaks)?{values:r.peaks}:r.peaks),r.integrals&&(r.integrals=Array.isArray(r.integrals)?{values:r.integrals}:r.integrals)}return t}function Y(e){if(e?.version===2)return e;let t={...e,version:2},o={peaks:{delta:"x",originDelta:"originalX",intensity:"y"},ranges:{atomIDs:"atoms",intensity:"y"}};for(let r of t.spectra)r.peaks?r.peaks=N(r.peaks,o.peaks):r.ranges?r.ranges=N(r.ranges,o.ranges):r.zones&&(r.zones.values=He(r.zones.values));return t}function He(e){return e.map(t=>(t.signals&&(t.signals=t.signals.map(o=>{if(o.x&&o.y){let{x:{fromTo:r,...i},y:{fromTo:n,...c}}=o;o={...o,x:{...i,...r},y:{...c,...n}}}else{let{fromTo:r,deltaX:i,resolutionX:n,nucleusX:c,deltaY:s,resolutionY:l,nucleusY:a,shiftX:p,shiftY:m,...u}=o;o={...u,x:{from:r[0].from,to:r[0].to,delta:i,resolution:n,nucleus:c},y:{from:r[1].from,to:r[1].to,delta:s,resolution:l,nucleus:a}}}return o},[])),t),[])}var Qe={name:"apodization",label:"Apodization",value:{lineBroadening:1,gaussBroadening:0,lineBroadeningCenter:0}};function Z(e){if(e?.version===3)return e;let t={...e,version:3};for(let o of t.spectra)if(Array.isArray(o?.filters)&&o?.filters.length>0){let r=o.filters.findIndex(i=>i.name==="lineBroadening");if(r!==-1){let i={...o.filters[r],...Qe};o.filters[r]=o.filters[r-1],o.filters[r-1]=i}}return t}function G(e){if(e?.version===4)return e;let{version:t,...o}=e,r=[],i={};for(let{source:s,...l}of o.spectra){let a={},{info:p={},display:m={}}=l;if(p?.dimension===2&&!s?.jcampURL)if(p.isFt)a.data={rr:l.data};else continue;if(s?.jcampURL){let{jcampURL:d,jcampSpectrumIndex:g}=s,S=d.match(/(?<baseURL>^\w+:\/{2}\w+\/)(?<relativePath>.*)/);i[d]||(i[d]={baseURL:S?.groups.baseURL||"",relativePath:S?.groups.relativePath||d.replace(/^\.\//,"")}),a.sourceSelector={files:[i[d].relativePath]},g!==void 0&&(a.sourceSelector.jcamp={index:g})}a.filters=et(l.filters);let{name:u,...f}=m;u&&(a.info={...p,name:u}),a.display=f,r.push({...l,...a})}let n={data:{...o,spectra:r},version:4},c={entries:Object.values(i)};return c.entries.length>0&&(n.data.source=c),n}function et(e=[]){let t=[];for(let o of e){let{name:r,value:i}=o;switch(r){case"zeroFilling":t.push({...o,value:{nbPoints:i}});break;case"shiftX":case"shift2DX":case"shift2DY":t.push({...o,value:{shift:i}});break;default:t.push({...o})}}return t}function $(e){if(e?.version===5)return e;let t={...e,version:5},o={originFrom:"originalFrom",originTo:"originalTo",originDelta:"originalDelta",originX:"originalX",originY:"originalY",originZ:"originalZ"};for(let r of t?.data?.spectra||[])for(let i of["peaks","ranges","zones"])r?.[i]&&(r[i]=N(r[i],o));return t}function J(e){if(e?.version===6)return e;let t={...e,version:6};for(let o of t?.data?.spectra||[]){let{digitalFilter:r,fft:i,phaseCorrection:n}=tt(o);i?.flag&&r?.flag&&n&&Math.floor(r.value.digitalFilterValue)%2>0&&(n.value.ph0-=180)}return t}function tt(e,t=["phaseCorrection","fft","digitalFilter"]){let{filters:o=[]}=e,r={};for(let i of t)r[i]=o.find(n=>n.name===i);return r}function C(e,t="localStorage"){if(e?.version===7)return e;if(t==="nmrium")return le(e);let o={...e,version:7};for(let r in e.workspaces)o.workspaces[r]=le(o.workspaces[r]);return o}function le(e){let{formatting:{nuclei:t,panels:o}={nuclei:null,panels:null},version:r,...i}=e,n={...i};return t&&(n.nuclei=rt(t)),o&&(n.panels=o),n}function rt(e){let t=[],o={name:"nucleus",ppm:"ppmFormat",hz:"hzFormat"};for(let r in e)t.push(N(e[r],o));return t}function q(e){if(e?.version===7)return e;let t={...e,version:7};return t?.settings&&(t.settings=C(t.settings,"nmrium")),t}function A(e,t="localStorage"){if(e?.version===8)return e;if(t==="nmrium")return ce(e);let o={...e,version:8};for(let r in e.workspaces)o.workspaces[r]=ce(o.workspaces[r]);return o}function ce(e){let{version:t,...o}=e,r={...o};return r.display.panels=ot(e),r}function ot(e){let t={},o=e.display.panels;for(let r of Object.keys(o)){let{display:i,open:n}=o[r];t[r]={display:i,visible:i,open:n}}return t}function H(e){if(e?.version===8)return e;let t={...e,version:8};t?.settings&&(t.settings=A(t.settings,"nmrium"));for(let o of t?.data?.spectra||[]){let{filters:r=[]}=o;for(let s=0;s<r.length;s++){let{flag:l,isDeleteAllow:a,label:p,...m}=r[s];r[s]={...m,enabled:l}}let i=r.findIndex(s=>s.name==="apodization");if(i!==-1){let s=r[i],{lineBroadening:l,gaussBroadening:a,lineBroadeningCenter:p}=s.value;s.value={exponential:{apply:!0,options:{lineBroadening:a>0?-l:l}}},a>0&&(s.value.gaussian={apply:!0,options:{lineBroadening:.6*a,lineBroadeningCenter:p}}),r[i]=s}let n=r.findIndex(s=>s.name==="apodizationDimension1"),c=r.findIndex(s=>s.name==="apodizationDimension2");if(n!==-1){let s=r[n],{shapes:l}=s.value.compose;s.value=ue(l)}if(c!==-1){let s=r[c],{shapes:l}=s.value.compose;s.value=ue(l)}}return t}function ue(e){let t={};for(let{shape:o}of e){let{kind:r,options:i}=o;if(r==="sineBell"){let{exponent:n,offset:c}=i,s=n===2?"sineSquare":"sineBell";t[s]={apply:!0,options:{offset:c}}}}return t}function Q(e){let{version:t,plugins:o,...r}=e;return t===9?e:{version:9,plugins:{},...r}}function ee(e){if(e?.version>=10)return e;let t={...e,version:10};if(e.data){let{source:o,spectra:r,...i}=e.data,n=o?x():void 0,c=o?[{...o,id:n}]:[];t.data={...i,sources:c,spectra:o?r?.map(s=>({...s,sourceId:n})):r}}return t}function te(e){let{version:t}=e;if(t>=11)return e;let o={...e,version:11};return e?.view?.molecules&&(o.view=it(e.view)),o}function it(e){let{molecules:t,...o}=e,r={};for(let[i,n]of Object.entries(t)){let{showAtomNumber:c,...s}=n;r[i]={...s,atomAnnotation:"none",showLabel:!1}}return{molecules:r,...o}}function re(e){if(e?.version>=12)return e;let t={...e,version:12};if(t.data){let o=e.data.spectra??[],r=e.data.molecules??[];for(let i of o){let{sourceId:n,fileCollectionId:c,sourceSelector:s}=i;delete i.sourceId,delete i.fileCollectionId,delete i.sourceSelector,s&&(i.selector={...s,root:c??n})}for(let i of r){let{sourceId:n,fileCollectionId:c,sourceSelector:s}=i;delete i.sourceId,delete i.fileCollectionId,delete i.sourceSelector,s&&(i.selector={...s,root:c??n})}}return t}function oe(e){if(e?.version>=13)return e;let t={...e,version:13};if(t.data){let o=e.data.spectra??[];for(let r of o){let i=r.ranges?.values??[];for(let n of i){let{diaIDs:c,assignment:s,nbAtoms:l,signals:a=[]}=n,p=a.some(m=>m.diaIDs&&m.diaIDs.length>0);for(let m of a)!p&&c&&l&&(m.diaIDs=c,m.nbAtoms=l),!m.assignment&&s&&(m.assignment=s);delete n.diaIDs,delete n.assignment,delete n.nbAtoms}}}return t}function ie(e){if(e?.version>=14)return e;let t={...e,version:14};if(e?.data?.spectra){let o=e.data.spectra??[],r={};for(let i of o){let{display:n={}}=i;if(!("contourOptions"in n))continue;let{contourOptions:c}=n;r[i.id]=c,delete i.display.contourOptions}Object.keys(r).length>0&&(t.view={...e.view,spectraContourLevels:r}),t.view&&delete t.view.zoom}return t}function I(e,t){e.plugins||(e.plugins={});let o=e.plugins;for(let r of t.values()){if(!r.shouldSerialize){delete o[r.id];continue}o[r.id]||(o[r.id]={id:r.id,version:r.version}),o[r.id].id=r.id,o[r.id].version=r.version}}var nt=[X,Y,Z,G,$,J,q,H,Q,ee,te,re,oe,ie];function pe(e,t,o){let r=structuredClone(e),i=Object.entries(e?.plugins??{});for(let[s,{version:l}]of i){let a=o.get(s);if(!(a&&a.version>=l)){if(a){console.warn(`Plugin "${a.id}" is loaded with a version older (${a.version}) than the one used to save the state (${l}).
|
|
1
|
+
var Ce={NORMAL:"NORMAL",FORMULA:"FORMULA"};var we={RELATIVE:"relative",ABSOLUTE:"absolute",MIN:"min",MAX:"max"};var Te=[{name:"pixels",unit:"px"},{name:"inches",unit:"in"},{name:"feet",unit:"ft"},{name:"yards",unit:"yd"},{name:"centimeters",unit:"cm"},{name:"millimeters",unit:"mm"},{name:"meters",unit:"m"},{name:"points",unit:"pt"},{name:"picas",unit:"pc"}];var Ee=["ppm","hz","pt","s"],Ue=["pt","s"],Le=["pt","ppm","hz"],ze=["pt","s"],ke=["pt","ppm","hz"],Ve="s",je="ppm",_e="s",Be="ppm";var b=15;var Ke=[{key:"CT",description:"CT from NMR Solutions"}];import{isAnyArray as Xe}from"is-any-array";import{xMultiply as B}from"ml-spectra-processing";var We=crypto.randomUUID.bind(crypto),x=We;function D(e){let{id:t=x(),meta:o,peaks:r={},filters:i=[],info:n={},ranges:c={},integrals:s={},selector:l,sourceId:a,dependentVariables:p=[],...m}=e,u={id:t,meta:o,filters:i},{data:f=Ye(p[0]?.components??[])}=e;if(Array.isArray(n.nucleus)&&(n.nucleus=n.nucleus[0]),u.data={x:[],re:[],im:[],...f},"scaleFactor"in n){let{scaleFactor:g}=n,{re:S,im:y}=u.data;B(S,g,{output:S}),y&&B(y,g,{output:y})}l&&(u.selector=l),a&&(u.sourceId=a,u.fileCollectionId=a);let d=Xe(f.im);if(u.info={phc0:0,phc1:0,nucleus:"1H",isFid:!1,isComplex:d,dimension:1,name:n?.name||t,...n},n.isFid&&n.reverse&&d){let{im:g}=u.data;B(g,-1,{output:g}),u.info.reverse=!1}return u.display={isVisible:!0,isPeaksMarkersVisible:!0,isRealSpectrumVisible:!0,isVisibleInDomain:!0,...e.display},u.peaks={values:[],options:{},...r},u.ranges={values:[],options:{sum:null,isSumConstant:!0,sumAuto:!0},...c},u.integrals={values:[],options:{},...s},{...m,...u}}function Ye(e){let t=e[0]?.data?.x||[],o=e[0]?.data?.re||e[0]?.data?.y||[],r=e[0]?.data?.im||e[1]?.data?.y||null;return t.length>0&&t[0]>t[1]&&(t.reverse(),o.reverse(),r&&r.reverse()),{x:t,re:o,im:r}}import{matrixToArray as Ze,xMinMaxValues as Ge,xNoiseSanPlot as $e}from"ml-spectra-processing";var K={z:[[]],minX:0,minY:0,maxX:0,maxY:0},Je={re:K,im:K},qe={rr:K};function A(e){let{id:t=x(),meta:o={},dependentVariables:r=[],info:i={},filters:n=[],zones:c=[],sourceId:s,...l}=e,a={id:t,meta:o,filters:n};s&&(a.sourceId=s,a.fileCollectionId=s),a.info={nucleus:["1H","1H"],isFid:!1,isComplex:!1,name:i?.name||x(),...i},a.originalInfo=structuredClone(a.info),a.display={isPositiveVisible:!0,isNegativeVisible:!0,isVisible:!0,dimension:2,...e.display};let{data:p=r[0]?.components??{}}=e;if(a.data={...a.info.isFid?Je:qe,...p},a.originalData=structuredClone(a.data),!("spectrumSize"in i)){let m=i.isFid?"re":"rr",u=a.data[m].z.length,f=u>0?a.data[m].z[0].length:0;a.info.spectrumSize=[f,u]}if(!i.isFid){let m=a.data.rr,u=Ze(m.z),{positive:f,negative:d}=$e(u),{min:g,max:S}=Ge(u);a.data.rr={...m,minZ:g,maxZ:S},a.info.noise={positive:f,negative:d}}return a.zones={values:[],options:{},...c},{...l,...a}}import{xSequentialFillFromTo as Qe}from"ml-spectra-processing";import{isAnyArray as He}from"is-any-array";function W(e,t=0){if(He(e)){let o=e.at(t);if(o!==void 0)return o;throw new RangeError("An array with a index out of boundaries")}return e}var et=new Set(["t1ir","T1"]);function le(e){let t=[];for(let o of e){let{info:{pulseSequence:r,isFid:i}}=o,{data:n,info:c,meta:{vdlistValues:s=[]}={}}=o;if(!(r&&et.has(r))||s.length===0){t.push(o);continue}let a=i?"re":"rr",p={};for(let y in c)p[y]=W(c[y]);let{z:m,maxX:u,minX:f}=n[a],d=Qe({from:f,to:u,size:m[0].length}),[g,S]=rt(o);for(let y=0;y<s.length;y++){let P={re:d,x:d};for(let h in n)P[tt(h)]=n[h].z.at(g*(y+S));t.push(D({data:P,info:{...p,name:`${p.name}_${s[y]}`,dimension:1,vd:s[y]}}))}}return t}function tt(e){return["rr","re"].includes(e)?"re":["im","ri","ir","ii"].includes(e)?"im":"x"}function rt(e){let{meta:{PAGE:t}}=e,o=!0;if(t){let r=i=>Number.parseFloat(i.replace(/[F|T]1=/,""));o=r(t[0])>r(t[2])}return o?[-1,1]:[1,0]}var ot=2,it=1;function nt(e){let{spectra:t=[],molecules:o}=e,r=[];for(let i of t){let{info:n}=i;switch(n.dimension){case it:r.push(D(i));break;case ot:r.push(A(i));break;default:throw new Error("dimension does not supported")}}return{molecules:o,spectra:le(r)}}function st(e){return e}function N(e,t){return JSON.parse(JSON.stringify(e),function(r,i){if(r in t){this[t[r]]=i;return}return i})}function X(e){if(e?.version===1)return e;let t={...e,version:1},o={j:"js",signal:"signals",integral:"integration",peak:"peaks",diaID:"diaIDs"};for(let r of t.spectra){if(r.ranges){let i=N(r.ranges,o);r.ranges=Array.isArray(i)?{values:i}:i}else if(r.zones){let i=N(r.zones,o);r.zones=Array.isArray(i)?{values:i}:i}r.peaks&&(r.peaks=Array.isArray(r.peaks)?{values:r.peaks}:r.peaks),r.integrals&&(r.integrals=Array.isArray(r.integrals)?{values:r.integrals}:r.integrals)}return t}function Y(e){if(e?.version===2)return e;let t={...e,version:2},o={peaks:{delta:"x",originDelta:"originalX",intensity:"y"},ranges:{atomIDs:"atoms",intensity:"y"}};for(let r of t.spectra)r.peaks?r.peaks=N(r.peaks,o.peaks):r.ranges?r.ranges=N(r.ranges,o.ranges):r.zones&&(r.zones.values=at(r.zones.values));return t}function at(e){return e.map(t=>(t.signals&&(t.signals=t.signals.map(o=>{if(o.x&&o.y){let{x:{fromTo:r,...i},y:{fromTo:n,...c}}=o;o={...o,x:{...i,...r},y:{...c,...n}}}else{let{fromTo:r,deltaX:i,resolutionX:n,nucleusX:c,deltaY:s,resolutionY:l,nucleusY:a,shiftX:p,shiftY:m,...u}=o;o={...u,x:{from:r[0].from,to:r[0].to,delta:i,resolution:n,nucleus:c},y:{from:r[1].from,to:r[1].to,delta:s,resolution:l,nucleus:a}}}return o},[])),t),[])}var lt={name:"apodization",label:"Apodization",value:{lineBroadening:1,gaussBroadening:0,lineBroadeningCenter:0}};function Z(e){if(e?.version===3)return e;let t={...e,version:3};for(let o of t.spectra)if(Array.isArray(o?.filters)&&o?.filters.length>0){let r=o.filters.findIndex(i=>i.name==="lineBroadening");if(r!==-1){let i={...o.filters[r],...lt};o.filters[r]=o.filters[r-1],o.filters[r-1]=i}}return t}function G(e){if(e?.version===4)return e;let{version:t,...o}=e,r=[],i={};for(let{source:s,...l}of o.spectra){let a={},{info:p={},display:m={}}=l;if(p?.dimension===2&&!s?.jcampURL)if(p.isFt)a.data={rr:l.data};else continue;if(s?.jcampURL){let{jcampURL:d,jcampSpectrumIndex:g}=s,S=d.match(/(?<baseURL>^\w+:\/{2}\w+\/)(?<relativePath>.*)/);i[d]||(i[d]={baseURL:S?.groups.baseURL||"",relativePath:S?.groups.relativePath||d.replace(/^\.\//,"")}),a.sourceSelector={files:[i[d].relativePath]},g!==void 0&&(a.sourceSelector.jcamp={index:g})}a.filters=ct(l.filters);let{name:u,...f}=m;u&&(a.info={...p,name:u}),a.display=f,r.push({...l,...a})}let n={data:{...o,spectra:r},version:4},c={entries:Object.values(i)};return c.entries.length>0&&(n.data.source=c),n}function ct(e=[]){let t=[];for(let o of e){let{name:r,value:i}=o;switch(r){case"zeroFilling":t.push({...o,value:{nbPoints:i}});break;case"shiftX":case"shift2DX":case"shift2DY":t.push({...o,value:{shift:i}});break;default:t.push({...o})}}return t}function $(e){if(e?.version===5)return e;let t={...e,version:5},o={originFrom:"originalFrom",originTo:"originalTo",originDelta:"originalDelta",originX:"originalX",originY:"originalY",originZ:"originalZ"};for(let r of t?.data?.spectra||[])for(let i of["peaks","ranges","zones"])r?.[i]&&(r[i]=N(r[i],o));return t}function J(e){if(e?.version===6)return e;let t={...e,version:6};for(let o of t?.data?.spectra||[]){let{digitalFilter:r,fft:i,phaseCorrection:n}=ut(o);i?.flag&&r?.flag&&n&&Math.floor(r.value.digitalFilterValue)%2>0&&(n.value.ph0-=180)}return t}function ut(e,t=["phaseCorrection","fft","digitalFilter"]){let{filters:o=[]}=e,r={};for(let i of t)r[i]=o.find(n=>n.name===i);return r}function F(e,t="localStorage"){if(e?.version===7)return e;if(t==="nmrium")return ce(e);let o={...e,version:7};for(let r in e.workspaces)o.workspaces[r]=ce(o.workspaces[r]);return o}function ce(e){let{formatting:{nuclei:t,panels:o}={nuclei:null,panels:null},version:r,...i}=e,n={...i};return t&&(n.nuclei=pt(t)),o&&(n.panels=o),n}function pt(e){let t=[],o={name:"nucleus",ppm:"ppmFormat",hz:"hzFormat"};for(let r in e)t.push(N(e[r],o));return t}function q(e){if(e?.version===7)return e;let t={...e,version:7};return t?.settings&&(t.settings=F(t.settings,"nmrium")),t}function M(e,t="localStorage"){if(e?.version===8)return e;if(t==="nmrium")return ue(e);let o={...e,version:8};for(let r in e.workspaces)o.workspaces[r]=ue(o.workspaces[r]);return o}function ue(e){let{version:t,...o}=e,r={...o};return r.display.panels=mt(e),r}function mt(e){let t={},o=e.display.panels;for(let r of Object.keys(o)){let{display:i,open:n}=o[r];t[r]={display:i,visible:i,open:n}}return t}function H(e){if(e?.version===8)return e;let t={...e,version:8};t?.settings&&(t.settings=M(t.settings,"nmrium"));for(let o of t?.data?.spectra||[]){let{filters:r=[]}=o;for(let s=0;s<r.length;s++){let{flag:l,isDeleteAllow:a,label:p,...m}=r[s];r[s]={...m,enabled:l}}let i=r.findIndex(s=>s.name==="apodization");if(i!==-1){let s=r[i],{lineBroadening:l,gaussBroadening:a,lineBroadeningCenter:p}=s.value;s.value={exponential:{apply:!0,options:{lineBroadening:a>0?-l:l}}},a>0&&(s.value.gaussian={apply:!0,options:{lineBroadening:.6*a,lineBroadeningCenter:p}}),r[i]=s}let n=r.findIndex(s=>s.name==="apodizationDimension1"),c=r.findIndex(s=>s.name==="apodizationDimension2");if(n!==-1){let s=r[n],{shapes:l}=s.value.compose;s.value=pe(l)}if(c!==-1){let s=r[c],{shapes:l}=s.value.compose;s.value=pe(l)}}return t}function pe(e){let t={};for(let{shape:o}of e){let{kind:r,options:i}=o;if(r==="sineBell"){let{exponent:n,offset:c}=i,s=n===2?"sineSquare":"sineBell";t[s]={apply:!0,options:{offset:c}}}}return t}function Q(e){let{version:t,plugins:o,...r}=e;return t===9?e:{version:9,plugins:{},...r}}function ee(e){if(e?.version>=10)return e;let t={...e,version:10};if(e.data){let{source:o,spectra:r,...i}=e.data,n=o?x():void 0,c=o?[{...o,id:n}]:[];t.data={...i,sources:c,spectra:o?r?.map(s=>({...s,sourceId:n})):r}}return t}function te(e){let{version:t}=e;if(t>=11)return e;let o={...e,version:11};return e?.view?.molecules&&(o.view=ft(e.view)),o}function ft(e){let{molecules:t,...o}=e,r={};for(let[i,n]of Object.entries(t)){let{showAtomNumber:c,...s}=n;r[i]={...s,atomAnnotation:"none",showLabel:!1}}return{molecules:r,...o}}function re(e){if(e?.version>=12)return e;let t={...e,version:12};if(t.data){let o=e.data.spectra??[],r=e.data.molecules??[];for(let i of o){let{sourceId:n,fileCollectionId:c,sourceSelector:s}=i;delete i.sourceId,delete i.fileCollectionId,delete i.sourceSelector,s&&(i.selector={...s,root:c??n})}for(let i of r){let{sourceId:n,fileCollectionId:c,sourceSelector:s}=i;delete i.sourceId,delete i.fileCollectionId,delete i.sourceSelector,s&&(i.selector={...s,root:c??n})}}return t}function oe(e){if(e?.version>=13)return e;let t={...e,version:13};if(t.data){let o=e.data.spectra??[];for(let r of o){let i=r.ranges?.values??[];for(let n of i){let{diaIDs:c,assignment:s,nbAtoms:l,signals:a=[]}=n,p=a.some(m=>m.diaIDs&&m.diaIDs.length>0);for(let m of a)!p&&c&&l&&(m.diaIDs=c,m.nbAtoms=l),!m.assignment&&s&&(m.assignment=s);delete n.diaIDs,delete n.assignment,delete n.nbAtoms}}}return t}function ie(e){if(e?.version>=14)return e;let t={...e,version:14};if(e?.data?.spectra){let o=e.data.spectra??[],r={};for(let i of o){let{display:n={}}=i;if(!("contourOptions"in n))continue;let{contourOptions:c}=n;r[i.id]=c,delete i.display.contourOptions}Object.keys(r).length>0&&(t.view={...e.view,spectraContourLevels:r}),t.view&&delete t.view.zoom}return t}function ne(e){if(e?.version>=15)return e;let t={...e,version:15};return t.view&&(t.view.units1D={},t.view.units2D={}),t}function O(e,t){e.plugins||(e.plugins={});let o=e.plugins;for(let r of t.values()){if(!r.shouldSerialize){delete o[r.id];continue}o[r.id]||(o[r.id]={id:r.id,version:r.version}),o[r.id].id=r.id,o[r.id].version=r.version}}var dt=[X,Y,Z,G,$,J,q,H,Q,ee,te,re,oe,ie,ne];function me(e,t,o){let r=structuredClone(e),i=Object.entries(e?.plugins??{});for(let[s,{version:l}]of i){let a=o.get(s);if(!(a&&a.version>=l)){if(a){console.warn(`Plugin "${a.id}" is loaded with a version older (${a.version}) than the one used to save the state (${l}).
|
|
2
2
|
NMRium may fail to load the state.
|
|
3
3
|
Please update the plugin to the latest version.`);continue}console.warn(`Plugin "${s}@${l}" is not registered. NMRium may fail to load the state.
|
|
4
|
-
Please consider open this file with the plugin installed.`)}}let n=new Set,c=()=>{let s=r.version;for(let l of o.values())for(let a of l.migrations){if(n.has(a)||s<a.minCore||a.maxCore&&s>a.maxCore)continue;if((r.plugins?.[l.id]?.version||0)===l.version)break;r=a.up(r),n.add(a)}};for(let s=e?.version||0;s<t;s++){let l=nt[s];r=l(r),c()}return c(),I(r,o),r}var st=["topbar.right","topbar.about_us.modal"],at=[],so=[...st,...at],lt={},ne={};ct(lt,ne);function ct(e,t){for(let[o,r]of Object.entries(e))t[r]||(t[r]=[]),t[r]?.push(o)}function*me(e){let{slot:t,plugins:o,supportedToDeprecatedSlots:r=ne}=e,i=r[t];for(let[n,c]of o.entries()){let s=c.ui;if(!s)continue;let l=s[t];if(l){yield[n,l];continue}if(i)for(let a of i){let p=c.ui?.[a];if(p){yield[n,p],console.warn(`Plugin ${c.id} used deprecated slot "${a}". Please update this plugin to use "${t}" instead.`);break}}}}import{FileCollection as Pe}from"file-collection";var fe={SDF:"sdf",MOL:"mol",NMRIUM:"nmrium",NMRIUM_ARCHIVE:"nmrium.zip",JSON:"json",JCAMP:"jcamp",DX:"dx",JDX:"jdx",JDF:"jdf",NMREDATA:"nmredata",SMILES:"smiles",SMI:"smi"};function w(e){return e.includes(".")?e.replace(/^.*\./,"").toLowerCase():""}function T(e,t={},o){let{data:r,...i}=e;if(!r)return e;let{spectra:n=[]}=r,{keep1D:c=!0,keep2D:s=!0,onlyReal:l}=t,a=l?"ft":t.dataSelection||"both",p=[];for(let m of n){if(!m.info){p.push(m);continue}let{isFid:u,dimension:f,name:d}=m.info;if(!F(f===1&&!c,d,o)&&!F(f===2&&!s,d,o)&&!F(u&&a==="ft",d,o)&&!F(!u&&a==="fid",d,o))if(l&&!u)if(m.info.isComplex=!1,ut(m)){let{rr:g}=m.data;p.push({...m,data:{rr:g}})}else{let{re:g,x:S}=m.data;p.push({...m,data:{re:g,x:S}})}else p.push(m)}return{data:{...r,spectra:p},...i}}function F(e,t,o){return e?(o?.warn(`Skipping ${t} because it didn't match the import filters.`),!0):!1}function ut(e){let{info:t}=e;return t?.dimension===2}function E(e){let{nmriumState:t,plugins:o,options:r}=e;for(let i of o.values()){let n=i.onReadProcess?.onProcessing;n&&n(t,r)}}async function L(e,t,o={}){let{selector:r,converter:i,logger:n}=o,c=[],s=[];for(let u of t.values()){let{onReadProcess:f}=u;f&&(f?.onFiles&&c.push(u),f?.supportedExtensions?.length&&f?.onFile&&s.push(u))}let l=await Promise.allSettled(c.map(u=>u.onReadProcess.onFiles(e,o))),a=[],p=await Promise.allSettled(e.files.flatMap(u=>{let f=w(u.name).toLowerCase();return s.flatMap(d=>{let{supportedExtensions:g,onFile:S}=d.onReadProcess;return g.includes(f)?(a.push({file:u,plugin:d}),S(u,{logger:n,selector:r,converter:i})):[]})})),m={spectra:[],molecules:[]};for(let u=0;u<l.length;u++){let f=l[u];switch(f.status){case"fulfilled":{let{spectra:d=[],molecules:g=[]}=f.value||{};m.spectra.push(...d),m.molecules.push(...g);break}case"rejected":{let d=f.reason,g=c[u];o.logger?.error(`Load file collection with plugin ${g.id}@${g.version} fails with: ${d}`);break}}}for(let u=0;u<p.length;u++){let f=p[u];switch(f.status){case"fulfilled":{let{spectra:d=[],molecules:g=[]}=f.value||{};m.spectra.push(...d),m.molecules.push(...g);break}case"rejected":{let d=f.reason,{file:g,plugin:S}=a[u];o.logger?.error(`Load file ${g.relativePath} with plugin ${S.id}@${S.version} fails with: ${d}`);break}}}return m}import{FileCollection as ye}from"file-collection";import{FileCollection as Se}from"file-collection";import de from"lodash.merge";import{xIsEquallySpaced as pt}from"ml-spectra-processing";async function k(e){let{input:t,spectraResult:o,unserializedSpectrum:r,options:i,plugins:n,migrator:c}=e,l=(await v({input:t,migrator:c,plugins:n,options:{...i,selector:r.selector}}))?.state?.data?.spectra??[],a=l.pop();if(a){o.push(ge(r,a));for(let p of l)o.push(ge(r,mt(p)))}}function ge(e,t){let{data:o,...r}=e;if(!t.selector?.root&&e.selector?.root&&(t.selector??=e.selector,t.selector.root=e.selector.root),"ranges"in t){let{data:i,...n}=t;return{...de(n,r),data:i}}else if("zones"in t){let{data:i,...n}=t;return{...de(n,r),data:i}}else return t}function mt(e){return{...e,id:x()}}function z(e){let{spectrum:t,spectraResult:o,logger:r}=e,{dimension:i}=t.info;if(i===1){if(!pt(t.data)){r?.error('The ".nmrium" file is corrupted; the X-axis values are not equally distant.');return}o.push(O(t))}else i===2&&o.push(M(t))}async function U(e){let{input:t,moleculesResult:o,unserializedMolecule:r,options:i,plugins:n,migrator:c}=e,{selector:s}=r,a=(await v({input:t,migrator:c,plugins:n,options:{...i,selector:s}}))?.state?.data?.molecules??[];for(let p of a)!p.selector?.root&&s?.root&&(p.selector??=s,p.selector.root=s.root),o.push({...r,...p})}function V(e){let{molecule:t,moleculesResult:o}=e;o.push(t)}async function j(e){let{nmriumObjectInput:t,options:o={},migrator:r,plugins:i,fromSourceOptions:n}=e,c=r(t),{data:s,...l}=c,a=new Se;if(!s)return{state:l,aggregator:a,containsNmrium:!0};let p={data:{...s,spectra:[],molecules:[]},...l},m=p.data,{sources:u=[],spectra:f,molecules:d}=m,g=await Promise.all(u.map(async P=>{let h=await Se.fromSource(P,{unzip:{zipExtensions:["zip","nmredata"]}},n);if(!P.baseURL)for(let R of P.entries)R.baseURL||(R.baseURL=n?.baseURL);return[P.id,h]})),S=new Map(g),y=[];for(let P of s.spectra){let h=P.selector?.root??"",R=S.get(h);if(!R){z({spectrum:P,spectraResult:f,logger:o.logger});continue}y.push(k({input:R,spectraResult:f,unserializedSpectrum:P,migrator:r,plugins:i,options:o}))}for(let P of s.molecules??[]){let h=P.selector?.root??"",R=S.get(h);if(!R){V({molecule:P,moleculesResult:d,logger:o.logger});continue}y.push(U({input:R,unserializedMolecule:P,moleculesResult:d,migrator:r,plugins:i,options:o}))}await Promise.allSettled(y);for(let[P,h]of S.entries())a.appendFileCollection(h,P);return{state:p,aggregator:a,containsNmrium:!0}}async function _(e){let{file:t,options:o={},migrator:r,plugins:i,fromSourceOptions:n}=e,c="byteLength"in t?t:await t.arrayBuffer(),s=ye.isZip(c)?await ft(c):new TextDecoder("utf-8").decode(c);return j({nmriumObjectInput:JSON.parse(s),plugins:i,migrator:r,options:o,fromSourceOptions:n})}async function ft(e){let t=await ye.fromZip(e);if(t.files.length===0)throw new Error("compressed nmrium file is corrupted");return t.files[0].text()}async function v(e){let{options:t={},input:o,migrator:r,plugins:i,fromSourceOptions:n}=e,{selectorRoot:c=x()}=t,s=St(await dt(o),t.selector?.files),l=yt(s);if(l)return await _({file:l,migrator:r,plugins:i,options:t,fromSourceOptions:n});let a=await L(s,i,t),p=T({version:14,data:a},t?.selector?.general,t.logger),{onLoadProcessing:m,experimentalFeatures:u}=t,f={...m,autoProcessing:m?.autoProcessing??!1,experimentalFeatures:u};E({nmriumState:p,plugins:i,options:f}),Pt(p,c);let d=new Pe().appendFileCollection(s,c);return{state:p,aggregator:d,containsNmrium:!1}}function dt(e){return Array.isArray(e)?Promise.reject(new Error("For a set of fileCollectionItems pass a FileCollection instance")):gt(e)?Promise.resolve(e):new Pe().appendExtendedSource({...e,uuid:x()})}function gt(e){return typeof e=="object"&&"files"in e}function St(e,t){if(!t)return e;let o=new Set(t);return e.filter(r=>o.has(r.relativePath))}function yt(e){return e.files.find(t=>w(t.name).toLowerCase()===fe.NMRIUM)}function Pt(e,t){for(let o of e.data?.spectra??[])o.selector?.root||(o.selector??={root:t},o.selector.root||=t);for(let o of e.data?.molecules??[])o.selector?.root||(o.selector??={root:t},o.selector.root||=t)}import{FileCollection as ht}from"file-collection";async function xe(e){let t={},o=[];for(let r of e.sources)switch(r.relativePath){case"META-INF/NMRIUM_ARCHIVE":t.archive=r;break;case"META-INF/VERSION":o.push(r.text().then(i=>{t.version=Number.parseInt(i,10)}));break;case"state.json":o.push(r.text().then(i=>{t.state=JSON.parse(i)}));break;default:}return await Promise.all(o),t}function he(e){if(!e.archive)throw new Error("Not a valid NMRium archive");if(typeof e.version!="number"||Number.isNaN(e.version))throw new Error("Not a valid NMRium archive, no version specified");if(e.version===0)throw new Error("NMRium Archive generated behind experimental flag are not supported.");if(!e.state)throw new Error("NMRium Archive corrupted, state.json is missing")}function be(e){return e.filter(t=>!xt(t.relativePath))}function xt(e){return e.startsWith("META-INF/")||e==="state.json"||e==="index.txt"}async function Ne(e){let{options:t,plugins:o,migrator:r}=e,i=await ht.fromIum(e.input),n=await xe(i);he(n);let c=be(i),s=r(n.state),l={...s,data:{...s.data,spectra:[],molecules:[]}},a=l.data.spectra,p=l.data.molecules,m=s.data?.spectra??[],u=s.data?.molecules??[],f=bt(i),d=[];for(let g of m)d.push(Nt({subRoots:f,unserializedSpectrum:g,spectraResult:a,options:t,plugins:o,migrator:r}));for(let g of u)d.push(Rt({subRoots:f,unserializedMolecule:g,moleculesResult:p,options:t,plugins:o,migrator:r}));return await Promise.allSettled(d),{state:l,aggregator:c,containsNmrium:!0}}function bt(e){let t=new Map;return{get(o){let r=t.get(o);return r||(r=e.subroot(o),t.set(o,r)),r},[Symbol("debug")]:{ium:e,views:t}}}async function Nt(e){let{subRoots:t}=e,{unserializedSpectrum:o,spectraResult:r}=e,{options:i,plugins:n,migrator:c}=e,{selector:s}=o,l=await Re({subRoots:t,selector:s});if(!l)return z({spectrum:o,spectraResult:r,logger:i?.logger});await k({input:l,unserializedSpectrum:o,spectraResult:r,options:i,plugins:n,migrator:c})}async function Rt(e){let{subRoots:t}=e,{unserializedMolecule:o,moleculesResult:r}=e,{options:i,plugins:n,migrator:c}=e,{selector:s}=o,l=await Re({subRoots:t,selector:s});if(!l)return V({molecule:o,moleculesResult:r,logger:i?.logger});await U({input:l,unserializedMolecule:o,moleculesResult:r,options:i,plugins:n,migrator:c})}async function Re(e){let{subRoots:t,selector:o}=e;if(!o)return;let{root:r}=o;if(r)return t.get(r)}import{FileCollection as Oe}from"file-collection";async function Ie(e){let{source:t,plugins:o,options:r={}}=e,{converter:i,...n}=r,{selectorRoot:c=x()}=r,s={...t,id:c},l={spectra:[],molecules:[]},a=await Oe.fromSource(s,{unzip:{zipExtensions:["zip","nmredata"]}}),{spectra:p=[],molecules:m=[]}=await L(a,o,{converter:{...i,bruker:{keepFiles:!0,...Reflect.get(i??{},"bruker")}},...n});l.spectra.push(...p),l.molecules.push(...m);for(let S of l.spectra)S.selector??={root:c},S.selector.root=c;for(let S of l.molecules)S.selector??={root:c},S.selector.root=c;l.sources??=[],l.sources.push(s);let u=T({version:14,data:l},r?.selector?.general),{onLoadProcessing:f}=n,d={filters:f?.filters,autoProcessing:f?.autoProcessing??!1,experimentalFeatures:r.experimentalFeatures};E({nmriumState:u,plugins:o,options:d});let g=new Oe().appendFileCollection(a,c);return{state:u,aggregator:g,containsNmrium:!1}}function D(e,t){let o={};for(let r in e)t.includes(r)||(o[r]=e[r]);return o}var Ot=["data","originalData","info","originalInfo","meta","customInfo"],It=["data","originalData","info","originalInfo","meta","customInfo"],vt=["selector","originalData","originalInfo"];function ve(e,t,o={}){let{version:r,data:i}=e;if(i.actionType)return e;let n={version:r,plugins:e.plugins},{includeData:c,forceRawSpectra:s=[]}=o;c!=="noData"&&(n.data=Dt({...i},c,s));let{includeSettings:l,includeView:a}=o;return l&&(n.settings=e.settings),a&&(n.view=e.view),I(n,t),n}function Dt(e,t="rawData",o){let{spectra:r}=e;switch(t){case"dataSource":return Mt(e);case"selfContained":case"selfContainedExternalDatasource":return Ct(e,o);case"rawData":return{...D(e,["sources"]),spectra:r.map(De)};default:return e}}function Mt(e){let{spectra:t}=e;if(!e.sources)throw new Error("sources property should exists for dataSource serialization");return{...e,spectra:t.map(At)}}function Ct(e,t){let{spectra:o,sources:r,...i}=e;return{...i,spectra:o.map(n=>wt(n,t))}}function At(e){return D(e,Ot)}function wt(e,t){return!("selector"in e)||t?.includes(e.id)?De(e):D(e,It)}function De(e){let{data:t,info:o,originalData:r,originalInfo:i}=e,n=D(e,vt);return n.data=r||t,n.info=i||o,n}import{FileCollection as Ft}from"file-collection";async function Me(e,t){let{state:o,aggregator:r,externalData:i="embedded",includeData:n=!0,includeSettings:c,includeView:s}=t,{spectra:l,molecules:a}=o.data,p=new Ft({filter:{ignoreDotfiles:!1}});return n&&p.appendFileCollection(r),p.toIum({includeData:i==="embedded",mimetype:"chemical/x-nmrium+zip",*getExtraFiles(m){yield{relativePath:"META-INF/NMRIUM_ARCHIVE",data:""},yield{relativePath:"META-INF/VERSION",data:"1"},yield{relativePath:"state.json",data:Tt(e,o,r,{externalData:i,includeData:n,includeView:s,includeSettings:c})},yield{relativePath:"index.txt",data:Et({aggregator:r,spectra:l,molecules:a,index:m})}}})}function Tt(e,t,o,r){let{includeData:i,includeView:n,includeSettings:c,externalData:s="embedded"}=r,l="noData";i&&(l=s==="embedded"?"selfContained":"selfContainedExternalDatasource");let a=[];if(l!=="noData")for(let u of t.data?.spectra??[]){let f=u.selector?.root;f&&o.subroot(f).files.length>0||a.push(u.id)}let p=e(t,{includeData:l,includeView:n,includeSettings:c,forceRawSpectra:a}),m=JSON.stringify(p,(u,f)=>ArrayBuffer.isView(f)?Array.from(f):f,2);return new Blob([m],{type:"application/json"})}function Et(e){let{aggregator:t,spectra:o,molecules:r,index:i}=e,n=new Map,c=new Map(i.sources.map(l=>[l.uuid,l]));for(let l of o){let a=l.selector?.root;a&&(n.has(a)||n.set(a,t.subroot(a)))}for(let l of r){let a=l.selector?.root;a&&(n.has(a)||n.set(a,t.subroot(a)))}let s=[];for(let[l,a]of n.entries()){let p=new Map(a.sources.map(u=>[u.uuid,u])),m=`data/${l}/`;s.push(m);for(let u of a.files){let f=c.get(u.sourceUUID),d=p.get(u.sourceUUID),g=f?.baseURL?.startsWith("ium:/")?"embedded":"linked",y=i.paths[u.sourceUUID]?.replace(m,""),P=u.relativePath.replace(d?.relativePath??"",""),h=y?y+P:u.relativePath;s.push(` ${h} (${g})`)}s.push(`
|
|
4
|
+
Please consider open this file with the plugin installed.`)}}let n=new Set,c=()=>{let s=r.version;for(let l of o.values())for(let a of l.migrations){if(n.has(a)||s<a.minCore||a.maxCore&&s>a.maxCore)continue;if((r.plugins?.[l.id]?.version||0)===l.version)break;r=a.up(r),n.add(a)}};for(let s=e?.version||0;s<t;s++){let l=dt[s];r=l(r),c()}return c(),O(r,o),r}var gt=["topbar.right","topbar.about_us.modal"],St=[],Po=[...gt,...St],yt={},se={};Pt(yt,se);function Pt(e,t){for(let[o,r]of Object.entries(e))t[r]||(t[r]=[]),t[r]?.push(o)}function*fe(e){let{slot:t,plugins:o,supportedToDeprecatedSlots:r=se}=e,i=r[t];for(let[n,c]of o.entries()){let s=c.ui;if(!s)continue;let l=s[t];if(l){yield[n,l];continue}if(i)for(let a of i){let p=c.ui?.[a];if(p){yield[n,p],console.warn(`Plugin ${c.id} used deprecated slot "${a}". Please update this plugin to use "${t}" instead.`);break}}}}import{FileCollection as xe}from"file-collection";var de={SDF:"sdf",MOL:"mol",NMRIUM:"nmrium",NMRIUM_ARCHIVE:"nmrium.zip",JSON:"json",JCAMP:"jcamp",DX:"dx",JDX:"jdx",JDF:"jdf",NMREDATA:"nmredata",SMILES:"smiles",SMI:"smi"};function C(e){return e.includes(".")?e.replace(/^.*\./,"").toLowerCase():""}function T(e,t={},o){let{data:r,...i}=e;if(!r)return e;let{spectra:n=[]}=r,{keep1D:c=!0,keep2D:s=!0,onlyReal:l}=t,a=l?"ft":t.dataSelection||"both",p=[];for(let m of n){if(!m.info){p.push(m);continue}let{isFid:u,dimension:f,name:d}=m.info;if(!w(f===1&&!c,d,o)&&!w(f===2&&!s,d,o)&&!w(u&&a==="ft",d,o)&&!w(!u&&a==="fid",d,o))if(l&&!u)if(m.info.isComplex=!1,xt(m)){let{rr:g}=m.data;p.push({...m,data:{rr:g}})}else{let{re:g,x:S}=m.data;p.push({...m,data:{re:g,x:S}})}else p.push(m)}return{data:{...r,spectra:p},...i}}function w(e,t,o){return e?(o?.warn(`Skipping ${t} because it didn't match the import filters.`),!0):!1}function xt(e){let{info:t}=e;return t?.dimension===2}function E(e){let{nmriumState:t,plugins:o,options:r}=e;for(let i of o.values()){let n=i.onReadProcess?.onProcessing;n&&n(t,r)}}async function U(e,t,o={}){let{selector:r,converter:i,logger:n}=o,c=[],s=[];for(let u of t.values()){let{onReadProcess:f}=u;f&&(f?.onFiles&&c.push(u),f?.supportedExtensions?.length&&f?.onFile&&s.push(u))}let l=await Promise.allSettled(c.map(u=>u.onReadProcess.onFiles(e,o))),a=[],p=await Promise.allSettled(e.files.flatMap(u=>{let f=C(u.name).toLowerCase();return s.flatMap(d=>{let{supportedExtensions:g,onFile:S}=d.onReadProcess;return g.includes(f)?(a.push({file:u,plugin:d}),S(u,{logger:n,selector:r,converter:i})):[]})})),m={spectra:[],molecules:[]};for(let u=0;u<l.length;u++){let f=l[u];switch(f.status){case"fulfilled":{let{spectra:d=[],molecules:g=[]}=f.value||{};m.spectra.push(...d),m.molecules.push(...g);break}case"rejected":{let d=f.reason,g=c[u];o.logger?.error(`Load file collection with plugin ${g.id}@${g.version} fails with: ${d}`);break}}}for(let u=0;u<p.length;u++){let f=p[u];switch(f.status){case"fulfilled":{let{spectra:d=[],molecules:g=[]}=f.value||{};m.spectra.push(...d),m.molecules.push(...g);break}case"rejected":{let d=f.reason,{file:g,plugin:S}=a[u];o.logger?.error(`Load file ${g.relativePath} with plugin ${S.id}@${S.version} fails with: ${d}`);break}}}return m}import{FileCollection as Pe}from"file-collection";import{FileCollection as ye}from"file-collection";import ge from"lodash.merge";import{xIsEquallySpaced as ht}from"ml-spectra-processing";async function L(e){let{input:t,spectraResult:o,unserializedSpectrum:r,options:i,plugins:n,migrator:c}=e,l=(await v({input:t,migrator:c,plugins:n,options:{...i,selector:r.selector}}))?.state?.data?.spectra??[],a=l.pop();if(a){o.push(Se(r,a));for(let p of l)o.push(Se(r,bt(p)))}}function Se(e,t){let{data:o,...r}=e;if(!t.selector?.root&&e.selector?.root&&(t.selector??=e.selector,t.selector.root=e.selector.root),"ranges"in t){let{data:i,...n}=t;return{...ge(n,r),data:i}}else if("zones"in t){let{data:i,...n}=t;return{...ge(n,r),data:i}}else return t}function bt(e){return{...e,id:x()}}function z(e){let{spectrum:t,spectraResult:o,logger:r}=e,{dimension:i}=t.info;if(i===1){if(!ht(t.data)){r?.error('The ".nmrium" file is corrupted; the X-axis values are not equally distant.');return}o.push(D(t))}else i===2&&o.push(A(t))}async function k(e){let{input:t,moleculesResult:o,unserializedMolecule:r,options:i,plugins:n,migrator:c}=e,{selector:s}=r,a=(await v({input:t,migrator:c,plugins:n,options:{...i,selector:s}}))?.state?.data?.molecules??[];for(let p of a)!p.selector?.root&&s?.root&&(p.selector??=s,p.selector.root=s.root),o.push({...r,...p})}function V(e){let{molecule:t,moleculesResult:o}=e;o.push(t)}async function j(e){let{nmriumObjectInput:t,options:o={},migrator:r,plugins:i,fromSourceOptions:n}=e,c=r(t),{data:s,...l}=c,a=new ye;if(!s)return{state:l,aggregator:a,containsNmrium:!0};let p={data:{...s,spectra:[],molecules:[]},...l},m=p.data,{sources:u=[],spectra:f,molecules:d}=m,g=await Promise.all(u.map(async P=>{let h=await ye.fromSource(P,{unzip:{zipExtensions:["zip","nmredata"]}},n);if(!P.baseURL)for(let R of P.entries)R.baseURL||(R.baseURL=n?.baseURL);return[P.id,h]})),S=new Map(g),y=[];for(let P of s.spectra){let h=P.selector?.root??"",R=S.get(h);if(!R){z({spectrum:P,spectraResult:f,logger:o.logger});continue}y.push(L({input:R,spectraResult:f,unserializedSpectrum:P,migrator:r,plugins:i,options:o}))}for(let P of s.molecules??[]){let h=P.selector?.root??"",R=S.get(h);if(!R){V({molecule:P,moleculesResult:d,logger:o.logger});continue}y.push(k({input:R,unserializedMolecule:P,moleculesResult:d,migrator:r,plugins:i,options:o}))}await Promise.allSettled(y);for(let[P,h]of S.entries())a.appendFileCollection(h,P);return{state:p,aggregator:a,containsNmrium:!0}}async function _(e){let{file:t,options:o={},migrator:r,plugins:i,fromSourceOptions:n}=e,c="byteLength"in t?t:await t.arrayBuffer(),s=Pe.isZip(c)?await Nt(c):new TextDecoder("utf-8").decode(c);return j({nmriumObjectInput:JSON.parse(s),plugins:i,migrator:r,options:o,fromSourceOptions:n})}async function Nt(e){let t=await Pe.fromZip(e);if(t.files.length===0)throw new Error("compressed nmrium file is corrupted");return t.files[0].text()}async function v(e){let{options:t={},input:o,migrator:r,plugins:i,fromSourceOptions:n}=e,{selectorRoot:c=x()}=t,s=Ot(await Rt(o),t.selector?.files),l=vt(s);if(l)return await _({file:l,migrator:r,plugins:i,options:t,fromSourceOptions:n});let a=await U(s,i,t),p=T({version:15,data:a},t?.selector?.general,t.logger),{onLoadProcessing:m,experimentalFeatures:u}=t,f={...m,autoProcessing:m?.autoProcessing??!1,experimentalFeatures:u};E({nmriumState:p,plugins:i,options:f}),It(p,c);let d=new xe().appendFileCollection(s,c);return{state:p,aggregator:d,containsNmrium:!1}}function Rt(e){return Array.isArray(e)?Promise.reject(new Error("For a set of fileCollectionItems pass a FileCollection instance")):Dt(e)?Promise.resolve(e):new xe().appendExtendedSource({...e,uuid:x()})}function Dt(e){return typeof e=="object"&&"files"in e}function Ot(e,t){if(!t)return e;let o=new Set(t);return e.filter(r=>o.has(r.relativePath))}function vt(e){return e.files.find(t=>C(t.name).toLowerCase()===de.NMRIUM)}function It(e,t){for(let o of e.data?.spectra??[])o.selector?.root||(o.selector??={root:t},o.selector.root||=t);for(let o of e.data?.molecules??[])o.selector?.root||(o.selector??={root:t},o.selector.root||=t)}import{FileCollection as Ft}from"file-collection";async function he(e){let t={},o=[];for(let r of e.sources)switch(r.relativePath){case"META-INF/NMRIUM_ARCHIVE":t.archive=r;break;case"META-INF/VERSION":o.push(r.text().then(i=>{t.version=Number.parseInt(i,10)}));break;case"state.json":o.push(r.text().then(i=>{t.state=JSON.parse(i)}));break;default:}return await Promise.all(o),t}function be(e){if(!e.archive)throw new Error("Not a valid NMRium archive");if(typeof e.version!="number"||Number.isNaN(e.version))throw new Error("Not a valid NMRium archive, no version specified");if(e.version===0)throw new Error("NMRium Archive generated behind experimental flag are not supported.");if(!e.state)throw new Error("NMRium Archive corrupted, state.json is missing")}function Ne(e){return e.filter(t=>!At(t.relativePath))}function At(e){return e.startsWith("META-INF/")||e==="state.json"||e==="index.txt"}async function Re(e){let{options:t,plugins:o,migrator:r}=e,i=await Ft.fromIum(e.input),n=await he(i);be(n);let c=Ne(i),s=r(n.state),l={...s,data:{...s.data,spectra:[],molecules:[]}},a=l.data.spectra,p=l.data.molecules,m=s.data?.spectra??[],u=s.data?.molecules??[],f=Mt(i),d=[];for(let g of m)d.push(Ct({subRoots:f,unserializedSpectrum:g,spectraResult:a,options:t,plugins:o,migrator:r}));for(let g of u)d.push(wt({subRoots:f,unserializedMolecule:g,moleculesResult:p,options:t,plugins:o,migrator:r}));return await Promise.allSettled(d),{state:l,aggregator:c,containsNmrium:!0}}function Mt(e){let t=new Map;return{get(o){let r=t.get(o);return r||(r=e.subroot(o),t.set(o,r)),r},[Symbol("debug")]:{ium:e,views:t}}}async function Ct(e){let{subRoots:t}=e,{unserializedSpectrum:o,spectraResult:r}=e,{options:i,plugins:n,migrator:c}=e,{selector:s}=o,l=await De({subRoots:t,selector:s});if(!l)return z({spectrum:o,spectraResult:r,logger:i?.logger});await L({input:l,unserializedSpectrum:o,spectraResult:r,options:i,plugins:n,migrator:c})}async function wt(e){let{subRoots:t}=e,{unserializedMolecule:o,moleculesResult:r}=e,{options:i,plugins:n,migrator:c}=e,{selector:s}=o,l=await De({subRoots:t,selector:s});if(!l)return V({molecule:o,moleculesResult:r,logger:i?.logger});await k({input:l,unserializedMolecule:o,moleculesResult:r,options:i,plugins:n,migrator:c})}async function De(e){let{subRoots:t,selector:o}=e;if(!o)return;let{root:r}=o;if(r)return t.get(r)}import{FileCollection as Oe}from"file-collection";async function ve(e){let{source:t,plugins:o,options:r={}}=e,{converter:i,...n}=r,{selectorRoot:c=x()}=r,s={...t,id:c},l={spectra:[],molecules:[]},a=await Oe.fromSource(s,{unzip:{zipExtensions:["zip","nmredata"]}}),{spectra:p=[],molecules:m=[]}=await U(a,o,{converter:{...i,bruker:{keepFiles:!0,...Reflect.get(i??{},"bruker")}},...n});l.spectra.push(...p),l.molecules.push(...m);for(let S of l.spectra)S.selector??={root:c},S.selector.root=c;for(let S of l.molecules)S.selector??={root:c},S.selector.root=c;l.sources??=[],l.sources.push(s);let u=T({version:15,data:l},r?.selector?.general),{onLoadProcessing:f}=n,d={filters:f?.filters,autoProcessing:f?.autoProcessing??!1,experimentalFeatures:r.experimentalFeatures};E({nmriumState:u,plugins:o,options:d});let g=new Oe().appendFileCollection(a,c);return{state:u,aggregator:g,containsNmrium:!1}}function I(e,t){let o={};for(let r in e)t.includes(r)||(o[r]=e[r]);return o}var Tt=["data","originalData","info","originalInfo","meta","customInfo"],Et=["data","originalData","info","originalInfo","meta","customInfo"],Ut=["selector","originalData","originalInfo"];function Ie(e,t,o={}){let{version:r,data:i}=e;if(i.actionType)return e;let n={version:r,plugins:e.plugins},{includeData:c,forceRawSpectra:s=[]}=o;c!=="noData"&&(n.data=Lt({...i},c,s));let{includeSettings:l,includeView:a}=o;return l&&(n.settings=e.settings),a&&(n.view=e.view),O(n,t),n}function Lt(e,t="rawData",o){let{spectra:r}=e;switch(t){case"dataSource":return zt(e);case"selfContained":case"selfContainedExternalDatasource":return kt(e,o);case"rawData":return{...I(e,["sources"]),spectra:r.map(Ae)};default:return e}}function zt(e){let{spectra:t}=e;if(!e.sources)throw new Error("sources property should exists for dataSource serialization");return{...e,spectra:t.map(Vt)}}function kt(e,t){let{spectra:o,sources:r,...i}=e;return{...i,spectra:o.map(n=>jt(n,t))}}function Vt(e){return I(e,Tt)}function jt(e,t){return!("selector"in e)||t?.includes(e.id)?Ae(e):I(e,Et)}function Ae(e){let{data:t,info:o,originalData:r,originalInfo:i}=e,n=I(e,Ut);return n.data=r||t,n.info=i||o,n}import{FileCollection as _t}from"file-collection";async function Fe(e,t){let{state:o,aggregator:r,externalData:i="embedded",includeData:n=!0,includeSettings:c,includeView:s}=t,{spectra:l,molecules:a}=o.data,p=new _t({filter:{ignoreDotfiles:!1}});return n&&p.appendFileCollection(r),p.toIum({includeData:i==="embedded",mimetype:"chemical/x-nmrium+zip",*getExtraFiles(m){yield{relativePath:"META-INF/NMRIUM_ARCHIVE",data:""},yield{relativePath:"META-INF/VERSION",data:"1"},yield{relativePath:"state.json",data:Bt(e,o,r,{externalData:i,includeData:n,includeView:s,includeSettings:c})},yield{relativePath:"index.txt",data:Kt({aggregator:r,spectra:l,molecules:a,index:m})}}})}function Bt(e,t,o,r){let{includeData:i,includeView:n,includeSettings:c,externalData:s="embedded"}=r,l="noData";i&&(l=s==="embedded"?"selfContained":"selfContainedExternalDatasource");let a=[];if(l!=="noData")for(let u of t.data?.spectra??[]){let f=u.selector?.root;f&&o.subroot(f).files.length>0||a.push(u.id)}let p=e(t,{includeData:l,includeView:n,includeSettings:c,forceRawSpectra:a}),m=JSON.stringify(p,(u,f)=>ArrayBuffer.isView(f)?Array.from(f):f,2);return new Blob([m],{type:"application/json"})}function Kt(e){let{aggregator:t,spectra:o,molecules:r,index:i}=e,n=new Map,c=new Map(i.sources.map(l=>[l.uuid,l]));for(let l of o){let a=l.selector?.root;a&&(n.has(a)||n.set(a,t.subroot(a)))}for(let l of r){let a=l.selector?.root;a&&(n.has(a)||n.set(a,t.subroot(a)))}let s=[];for(let[l,a]of n.entries()){let p=new Map(a.sources.map(u=>[u.uuid,u])),m=`data/${l}/`;s.push(m);for(let u of a.files){let f=c.get(u.sourceUUID),d=p.get(u.sourceUUID),g=f?.baseURL?.startsWith("ium:/")?"embedded":"linked",y=i.paths[u.sourceUUID]?.replace(m,""),P=u.relativePath.replace(d?.relativePath??"",""),h=y?y+P:u.relativePath;s.push(` ${h} (${g})`)}s.push(`
|
|
5
5
|
`)}return s.join(`
|
|
6
|
-
`)}var
|
|
6
|
+
`)}var ae=class{version=15;#e=new Map;registerPlugin(t){if(this.#e.has(t.id)){console.warn(`Plugin ${t.id} is already registered. skip.`),console.debug("Plugin already registered:",this.#e.get(t.id)),console.debug("Plugin to register:",t);return}this.#e.set(t.id,t)}registerPlugins(t){for(let o of t)this.registerPlugin(o)}getPlugin(t){return this.#e.get(t)}migrate(t){return me(t,this.version,this.#e)}read(t,o={},r){return v({input:t,options:o,fromSourceOptions:r,migrator:this.migrate.bind(this),plugins:this.#e})}readNMRiumArchive(t,o={}){return Re({input:t,options:o,plugins:this.#e,migrator:this.migrate.bind(this)})}readNMRiumObject(t,o,r){return j({nmriumObjectInput:t,options:o,fromSourceOptions:r,plugins:this.#e,migrator:this.migrate.bind(this)})}readNMRiumFile(t,o={},r){return _({file:t,options:o,fromSourceOptions:r,plugins:this.#e,migrator:this.migrate.bind(this)})}readFromWebSource(t,o){return ve({source:t,options:o,plugins:this.#e})}serializeNmriumState(t,o){return Ie(t,this.#e,o)}serializeNmriumArchive(t){let o=this.serializeNmriumState.bind(this);return Fe(o,t)}serializePlugins(){let t={plugins:{}};return O(t,this.#e),t.plugins}slot(t){return fe({slot:t,plugins:this.#e})}};function Wt(e,t){if(t>15)return 0;let o=-1;for(let r=0;r<e.length;r++)if(e[r].version>t){o=r;break}return o}var Me=[{version:6,fun:F},{version:7,fun:M}];function Xt(e){let{version:t}=e||{},o=Wt(Me,t);if(o===-1)return{...e,version:15};let r=Me.slice(o);for(let i of r)e=i.fun(e);return e}export{Ce as ANALYSIS_COLUMN_TYPES,we as ANALYSIS_COLUMN_VALUES_KEYS,b as CURRENT_EXPORT_VERSION,Ke as EXTERNAL_API_KEYS,ae as NMRiumCore,Ee as axisUnits,Ue as axisUnits1DFid,Le as axisUnits1DFt,ze as axisUnits2DFid,ke as axisUnits2DFt,Ve as defaultAxisUnit1DFid,je as defaultAxisUnit1DFt,_e as defaultAxisUnit2DFid,Be as defaultAxisUnit2DFt,st as defineNMRiumPlugin,nt as formatSpectra,x as generateID,W as getOneIfArray,Xt as migrateSettings,Te as units};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zakodium/nmrium-core",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "The core of NMRium: types, state, state migration and plugin system.",
|
|
5
5
|
"author": "Zakodium Sàrl",
|
|
6
6
|
"license": "CC-BY-NC-SA-4.0",
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/lodash.merge": "^4.6.9",
|
|
27
|
-
"@types/node": "^24.
|
|
27
|
+
"@types/node": "^24.12.0",
|
|
28
28
|
"@types/react": "^18.3.13",
|
|
29
|
-
"@zakodium/nmr-types": "^0.5.
|
|
29
|
+
"@zakodium/nmr-types": "^0.5.5",
|
|
30
30
|
"esbuild": "^0.27.3",
|
|
31
31
|
"jest-matcher-deep-close-to": "^3.0.2",
|
|
32
32
|
"msw": "^2.12.10",
|
|
33
33
|
"react-science": "^19.9.0",
|
|
34
34
|
"rimraf": "^6.1.3",
|
|
35
35
|
"typescript": "~5.9.3",
|
|
36
|
-
"vitest": "^4.
|
|
36
|
+
"vitest": "^4.1.1"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"cheminfo-types": "^1.10.0",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"volta": {
|
|
48
48
|
"extends": "../../../package.json"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "87638691a8007787968410fad4984505529549c8"
|
|
51
51
|
}
|