excelize-rs 0.1.9

Rust language library for reading and writing Microsoft Excel (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
Documentation
//! Default XML templates and lookup tables used when creating or validating
//! spreadsheet files.
//!
//! Ported from Go `templates.go`.

use std::{collections::HashMap, sync::LazyLock};

use crate::constants::{
    CONTENT_TYPE_ADDIN_MACRO, CONTENT_TYPE_MACRO, CONTENT_TYPE_SHEET_ML, CONTENT_TYPE_TEMPLATE,
    CONTENT_TYPE_TEMPLATE_MACRO,
};

// ------------------------------------------------------------------
// XML templates for default package parts
// ------------------------------------------------------------------

pub const TEMPLATE_DOC_PROPS_APP: &str = r#"<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><TotalTime>0</TotalTime><Application>Go Excelize</Application></Properties>"#;

pub const TEMPLATE_CONTENT_TYPES: &str = r#"<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/></Types>"#;

pub const TEMPLATE_WORKBOOK: &str = r#"<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x15" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"><fileVersion appName="xl" lastEdited="6" lowestEdited="6" rupBuild="14420"/><workbookPr filterPrivacy="1" defaultThemeVersion="164011"/><bookViews><workbookView xWindow="0" yWindow="0" windowWidth="14805" windowHeight="8010"/></bookViews><sheets><sheet name="Sheet1" sheetId="1" r:id="rId1"/></sheets><calcPr calcId="122211"/></workbook>"#;

pub const TEMPLATE_STYLES: &str = r#"<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac x16r2" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:x16r2="http://schemas.microsoft.com/office/spreadsheetml/2015/02/main"><fonts count="1" x14ac:knownFonts="1"><font><sz val="11"/><color theme="1"/><name val="宋体"/><charset val="134"/><family val="1"/></font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment vertical="center"/></xf></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles><dxfs count="0"/><tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleLight16"/></styleSheet>"#;

pub const TEMPLATE_SHEET: &str = r#"<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><dimension ref="A1"/><sheetViews><sheetView tabSelected="1" workbookViewId="0"/></sheetViews><sheetFormatPr defaultRowHeight="15"/><sheetData/></worksheet>"#;

pub const TEMPLATE_WORKBOOK_RELS: &str = r#"<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/></Relationships>"#;

pub const TEMPLATE_DOC_PROPS_CORE: &str = r#"<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:creator>xuri</dc:creator><dcterms:created xsi:type="dcterms:W3CDTF">2006-09-16T00:00:00Z</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">2006-09-16T00:00:00Z</dcterms:modified></cp:coreProperties>"#;

pub const TEMPLATE_RELS: &str = r#"<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>"#;

pub const TEMPLATE_THEME: &str = r#"<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="44546A"/></a:dk2><a:lt2><a:srgbClr val="E7E6E6"/></a:lt2><a:accent1><a:srgbClr val="5B9BD5"/></a:accent1><a:accent2><a:srgbClr val="ED7D31"/></a:accent2><a:accent3><a:srgbClr val="A5A5A5"/></a:accent3><a:accent4><a:srgbClr val="FFC000"/></a:accent4><a:accent5><a:srgbClr val="4472C4"/></a:accent5><a:accent6><a:srgbClr val="70AD47"/></a:accent6><a:hlink><a:srgbClr val="0563C1"/></a:hlink><a:folHlink><a:srgbClr val="954F72"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Calibri Light" panose="020F0302020204030204"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="游ゴシック Light"/><a:font script="Hang" typeface="맑은 고딕"/><a:font script="Hans" typeface="等线 Light"/><a:font script="Hant" typeface="新細明體"/><a:font script="Arab" typeface="Times New Roman"/><a:font script="Hebr" typeface="Times New Roman"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="MoolBoran"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Viet" typeface="Times New Roman"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/></a:majorFont><a:minorFont><a:latin typeface="Calibri" panose="020F0502020204030204"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="游ゴシック"/><a:font script="Hang" typeface="맑은 고딕"/><a:font script="Hans" typeface="等线"/><a:font script="Hant" typeface="新細明體"/><a:font script="Arab" typeface="Arial"/><a:font script="Hebr" typeface="Arial"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="MoolBoran"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Viet" typeface="Arial"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="1"/></a:gradFill><a:noFill/><a:patternFill patternType="pct5"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct10"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct20"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct25"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct30"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct40"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct50"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct60"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct70"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct75"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct80"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct90"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct5"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct10"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct20"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct25"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct30"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct40"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct50"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct60"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct70"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct75"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct80"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill><a:patternFill patternType="pct90"><a:fgClr val="BFBFBF"/><a:bgClr val="FFFFFF"/></a:patternFill></a:fillStyleLst><a:lnStyleLst><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln><a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln><a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="8000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="43000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="350000"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:tint val="65000"/><a:satMod val="350000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs></a:gsLst><a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements></a:theme>"#;

pub const TEMPLATE_NAMESPACE_ID_MAP: &str = r#" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:ap="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:op="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:cdr="http://schemas.openxmlformats.org/drawingml/2006/chartDrawing" xmlns:comp="http://schemas.openxmlformats.org/drawingml/2006/compatibility" xmlns:dgm="http://schemas.openxmlformats.org/drawingml/2006/diagram" xmlns:lc="http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:ds="http://schemas.openxmlformats.org/officeDocument/2006/customXml" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:xne="http://schemas.microsoft.com/office/excel/2006/main" xmlns:mso="http://schemas.microsoft.com/office/2006/01/customui" xmlns:ax="http://schemas.microsoft.com/office/2006/activeX" xmlns:cppr="http://schemas.microsoft.com/office/2006/coverPageProps" xmlns:cdip="http://schemas.microsoft.com/office/2006/customDocumentInformationPanel" xmlns:ct="http://schemas.microsoft.com/office/2006/metadata/contentType" xmlns:ntns="http://schemas.microsoft.com/office/2006/metadata/customXsn" xmlns:lp="http://schemas.microsoft.com/office/2006/metadata/longProperties" xmlns:ma="http://schemas.microsoft.com/office/2006/metadata/properties/metaAttributes" xmlns:msink="http://schemas.microsoft.com/ink/2010/main" xmlns:c14="http://schemas.microsoft.com/office/drawing/2007/8/2/chart" xmlns:c15="http://schemas.microsoft.com/office/drawing/2012/chart" xmlns:c16="http://schemas.microsoft.com/office/drawing/2014/chart" xmlns:c16r2="http://schemas.microsoft.com/office/drawing/2015/06/chart" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cxx="http://schemas.microsoft.com/office/drawing/2018/chartex" xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" xmlns:a15="http://schemas.microsoft.com/office/drawing/2012/main" xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main" xmlns:a16r2="http://schemas.microsoft.com/office/drawing/2015/main" xmlns:a17="http://schemas.microsoft.com/office/drawing/2017/main" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:pic14="http://schemas.microsoft.com/office/drawing/2010/picture" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main" xmlns:x15ac="http://schemas.microsoft.com/office/spreadsheetml/2015/02/ac" xmlns:x16="http://schemas.microsoft.com/office/spreadsheetml/2016/main" xmlns:x16r2="http://schemas.microsoft.com/office/spreadsheetml/2015/02/main" xmlns:x16r3="http://schemas.microsoft.com/office/spreadsheetml/2016/09/main" xmlns:xdr14="http://schemas.microsoft.com/office/drawing/2010/slicerDrawing" xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" xmlns:xr2="http://schemas.microsoft.com/office/spreadsheetml/2015/revision2" xmlns:xr3="http://schemas.microsoft.com/office/spreadsheetml/2016/revision3" xmlns:xr4="http://schemas.microsoft.com/office/spreadsheetml/2016/revision4" xmlns:xr5="http://schemas.microsoft.com/office/spreadsheetml/2016/revision5" xmlns:xr6="http://schemas.microsoft.com/office/spreadsheetml/2016/revision6" xmlns:xr7="http://schemas.microsoft.com/office/spreadsheetml/2016/revision7" xmlns:xr8="http://schemas.microsoft.com/office/spreadsheetml/2016/revision8" xmlns:xr9="http://schemas.microsoft.com/office/spreadsheetml/2016/revision9" xmlns:xr10="http://schemas.microsoft.com/office/spreadsheetml/2016/revision10" xmlns:xr11="http://schemas.microsoft.com/office/spreadsheetml/2016/revision11" xmlns:xr12="http://schemas.microsoft.com/office/spreadsheetml/2016/revision12" xmlns:xr13="http://schemas.microsoft.com/office/spreadsheetml/2016/revision13" xmlns:xr14="http://schemas.microsoft.com/office/spreadsheetml/2016/revision14" xmlns:xr15="http://schemas.microsoft.com/office/spreadsheetml/2016/revision15" xmlns:xr16="http://schemas.microsoft.com/office/spreadsheetml/2016/revision16" xmlns:dsp="http://schemas.microsoft.com/office/drawing/2008/diagram" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o10="urn:schemas-microsoft-com:office:office" xmlns:rte="http://schemas.microsoft.com/office/2006/01/rte" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps2="http://schemas.microsoft.com/office/word/2012/wordprocessingDrawing" xmlns:mc14="http://schemas.microsoft.com/office/drawing/2010/main" xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main" xmlns:mx="http://schemas.microsoft.com/office/mac/excel/2008/main" xmlns:mv="http://schemas.microsoft.com/office/mac/2005/internal" xmlns:sle="http://schemas.microsoft.com/office/drawing/2010/slicer" xmlns:sle15="http://schemas.microsoft.com/office/drawing/2012/slicer" xmlns:slicercache="http://schemas.microsoft.com/office/drawing/2010/slicerCache" xmlns:slicercache15="http://schemas.microsoft.com/office/drawing/2012/slicerCache" xmlns:asvg="http://schemas.microsoft.com/office/drawing/2016/SVG/main" xmlns:xr17="http://schemas.microsoft.com/office/spreadsheetml/2017/revision17" xmlns:xr18="http://schemas.microsoft.com/office/spreadsheetml/2018/revision18" xmlns:xr19="http://schemas.microsoft.com/office/spreadsheetml/2019/revision19" xmlns:xr20="http://schemas.microsoft.com/office/spreadsheetml/2020/revision20" mc:Ignorable="x14ac x15 x16r2 xr xr2 xr3 xr4 xr5 xr6 xr7 xr8 xr9 xr10 xr11 xr12 xr13 xr14 xr15 xr16 xr17 xr18 xr19 xr20">"#;

// ------------------------------------------------------------------
// Lookup tables
// ------------------------------------------------------------------

pub static SUPPORTED_CONTENT_TYPES: LazyLock<HashMap<String, String>> = LazyLock::new(|| {
    let mut map = HashMap::new();
    map.insert(".xlam".to_string(), CONTENT_TYPE_ADDIN_MACRO.to_string());
    map.insert(".xlsm".to_string(), CONTENT_TYPE_MACRO.to_string());
    map.insert(".xlsx".to_string(), CONTENT_TYPE_SHEET_ML.to_string());
    map.insert(".xltm".to_string(), CONTENT_TYPE_TEMPLATE_MACRO.to_string());
    map.insert(".xltx".to_string(), CONTENT_TYPE_TEMPLATE.to_string());
    map
});

pub const SUPPORTED_CALC_MODE: &[&str] = &["manual", "auto", "autoNoTable"];
pub const SUPPORTED_REF_MODE: &[&str] = &["A1", "R1C1"];
pub const SUPPORTED_UNDERLINE_TYPES: &[&str] = &["none", "single", "double"];
pub const SUPPORTED_VERT_ALIGN_TYPES: &[&str] = &["baseline", "superscript", "subscript"];
pub const SUPPORTED_PAGE_ORIENTATION: &[&str] = &["portrait", "landscape"];
pub const SUPPORTED_PAGE_ORDER: &[&str] = &["overThenDown", "downThenOver"];
pub const SUPPORTED_POSITIONING: &[&str] = &["absolute", "oneCell", "twoCell"];

pub const BUILT_IN_DEFINED_NAMES: &[&str] = &[
    "_xlnm.Print_Area",
    "_xlnm.Print_Titles",
    "_xlnm.Criteria",
    "_xlnm._FilterDatabase",
    "_xlnm.Extract",
    "_xlnm.Consolidate_Area",
    "_xlnm.Database",
    "_xlnm.Sheet_Title",
];

pub static SUPPORTED_IMAGE_TYPES: LazyLock<HashMap<String, String>> = LazyLock::new(|| {
    let mut map = HashMap::new();
    for (k, v) in [
        (".bmp", ".bmp"),
        (".emf", ".emf"),
        (".emz", ".emz"),
        (".gif", ".gif"),
        (".ico", ".ico"),
        (".jpeg", ".jpeg"),
        (".jpg", ".jpeg"),
        (".png", ".png"),
        (".svg", ".svg"),
        (".tif", ".tiff"),
        (".tiff", ".tiff"),
        (".wmf", ".wmf"),
        (".wmz", ".wmz"),
    ] {
        map.insert(k.to_string(), v.to_string());
    }
    map
});

/// Default indexed color palette (0-65, with 0-7 duplicated at 8-15).
pub const INDEXED_COLOR_MAPPING: &[&str] = &[
    "000000", "FFFFFF", "FF0000", "00FF00", "0000FF", "FFFF00", "FF00FF", "00FFFF", "000000",
    "FFFFFF", "FF0000", "00FF00", "0000FF", "FFFF00", "FF00FF", "00FFFF", "800000", "008000",
    "000080", "808000", "800080", "008080", "C0C0C0", "808080", "9999FF", "993366", "FFFFCC",
    "CCFFFF", "660066", "FF8080", "0066CC", "CCCCFF", "000080", "FF00FF", "FFFF00", "00FFFF",
    "800080", "800000", "008080", "0000FF", "00CCFF", "CCFFFF", "CCFFCC", "FFFF99", "99CCFF",
    "FF99CC", "CC99FF", "FFCC99", "3366FF", "33CCCC", "99CC00", "FFCC00", "FF9900", "FF6600",
    "666699", "969696", "003366", "339966", "003300", "333300", "993300", "993366", "333399",
    "333333", "000000", "FFFFFF",
];