efficient-office 0.6.0 → 0.7.0
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/Documents-CVV64UEH.js +1 -0
- package/dist/Slides-JMP36AJH.js +1 -0
- package/dist/SlidesEditor-MZM7IR46.js +1 -0
- package/dist/Spreadsheet-55AVNUEA.js +1 -0
- package/dist/chunk-4NKXNXKY.js +1 -0
- package/dist/chunk-7K7AY3V3.js +1 -0
- package/dist/chunk-A5KQPSPX.js +1 -0
- package/dist/chunk-B32ASXHM.js +1 -0
- package/dist/chunk-B6JN7D6G.js +1 -0
- package/dist/chunk-COXKOQPZ.js +1 -0
- package/dist/chunk-GLT7O6TV.js +1 -0
- package/dist/{chunk-E4N3DBYM.js → chunk-HU4RI2OM.js} +1 -1
- package/dist/chunk-I3AC6PYR.js +1 -0
- package/dist/chunk-JCSB2PHB.js +1 -0
- package/dist/{chunk-QSM7NWZ2.js → chunk-OB4MLAZC.js} +1 -1
- package/dist/chunk-QFPW3KLL.js +1 -0
- package/dist/{chunk-USKJW3BA.js → chunk-RLNXQG4T.js} +1 -1
- package/dist/chunk-X6F3Z4KZ.js +1 -0
- package/dist/chunk-XYVQTQ6N.js +1 -0
- package/dist/deckPdf-Y2RE7MFX.js +1 -0
- package/dist/documents/documents.css +4 -0
- package/dist/documents/index.d.ts +22 -7
- package/dist/documents/index.js +1 -1
- package/dist/docxPdf-EW5I5JR3.js +1 -0
- package/dist/importDocument-274VK7OM.js +1 -0
- package/dist/importSpreadsheet-4U3KEJ76.js +1 -0
- package/dist/pptxImport-STLMOUNE.js +1 -0
- package/dist/slides/index.d.ts +34 -2
- package/dist/slides/index.js +1 -1
- package/dist/slides/slides.css +23 -0
- package/dist/spreadsheet/index.d.ts +62 -44
- package/dist/spreadsheet/index.js +1 -1
- package/dist/spreadsheet/spreadsheet.css +4 -0
- package/dist/words-DK_ajpEa.d.ts +67 -0
- package/dist/workbookPdf-C5SSN226.js +1 -0
- package/package.json +2 -2
- package/dist/Documents-HT324TAY.js +0 -1
- package/dist/Slides-EUDBOA5K.js +0 -1
- package/dist/SlidesEditor-6KDRHX4H.js +0 -1
- package/dist/Spreadsheet-SOF7NDLP.js +0 -1
- package/dist/chunk-2PIEDEY5.js +0 -1
- package/dist/chunk-3SRMKGQW.js +0 -1
- package/dist/chunk-AVUZSUQD.js +0 -1
- package/dist/chunk-SB3YS3LH.js +0 -1
- package/dist/chunk-XKOHIZO5.js +0 -1
- package/dist/chunk-YYHJJIA4.js +0 -1
- package/dist/deckPdf-Q4OXQ7HV.js +0 -1
- package/dist/docxPdf-NCSEKI4J.js +0 -1
- package/dist/options-Djr917yc.d.ts +0 -10
- package/dist/pptxImport-QEKBZWT2.js +0 -1
- package/dist/workbookPdf-OJDSHKRR.js +0 -1
package/dist/chunk-2PIEDEY5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={ABS:"Absolute value",AND:"True if all are true",AVERAGE:"Average of numbers",AVERAGEIF:"Average where a test passes",AVERAGEIFS:"Average on many tests",CEILING:"Rounds up to a multiple","CEILING.MATH":"Rounds up to a multiple",CHOOSE:"Picks by position",COLUMN:"Column number",COLUMNS:"Number of columns",CONCAT:"Joins text",CONCATENATE:"Joins text",COS:"Cosine",COUNT:"Counts numbers",COUNTA:"Counts non-blank cells",COUNTBLANK:"Counts blank cells",COUNTIF:"Counts where a test passes",COUNTIFS:"Counts on many tests",DATE:"Builds a date",DATEDIF:"Time between dates",DAY:"Day of the month",DAYS:"Days between dates",EDATE:"Date some months away",EOMONTH:"Last day of a month",EXACT:"Same text, case included",EXP:"e to a power",FIND:"Position of text, case exact",FLOOR:"Rounds down to a multiple","FLOOR.MATH":"Rounds down to a multiple",FV:"Future value",HLOOKUP:"Looks along the top row",HOUR:"Hour of a time",IF:"One value or another",IFERROR:"A fallback for an error",IFNA:"A fallback for #N/A",IFS:"First test that passes",INDEX:"The cell at a position",INT:"Rounds down to a whole number",ISBLANK:"True if blank",ISERROR:"True if an error",ISLOGICAL:"True if TRUE or FALSE",ISNA:"True if #N/A",ISNUMBER:"True if a number",ISTEXT:"True if text",LARGE:"The kth largest",LEFT:"Text from the start",LEN:"Length of text",LN:"Natural logarithm",LOG:"Logarithm",LOG10:"Base-10 logarithm",LOWER:"Lower case",MATCH:"Position of a value",MAX:"Largest number",MEDIAN:"Middle number",MID:"Text from the middle",MIN:"Smallest number",MINUTE:"Minute of a time",MOD:"Remainder",MODE:"Most common number","MODE.SNGL":"Most common number",MONTH:"Month of a date",N:"A value as a number",NA:"The #N/A error",NETWORKDAYS:"Working days between dates",NOT:"The opposite",NOW:"Date and time now",NPV:"Net present value",OR:"True if any is true",PI:"The number pi",PMT:"Loan payment",POWER:"A number to a power",PRODUCT:"Multiplies numbers",PROPER:"Capitals on each word",PV:"Present value",RAND:"Random from 0 to 1",RANDBETWEEN:"Random whole number",RANK:"Rank in a list","RANK.EQ":"Rank in a list",REPLACE:"Replaces by position",REPT:"Repeats text",RIGHT:"Text from the end",ROUND:"Rounds a number",ROUNDDOWN:"Rounds toward zero",ROUNDUP:"Rounds away from zero",ROW:"Row number",ROWS:"Number of rows",SEARCH:"Position of text, any case",SECOND:"Second of a time",SIGN:"Sign of a number",SIN:"Sine",SMALL:"The kth smallest",SQRT:"Square root",STDEV:"Standard deviation of a sample","STDEV.P":"Standard deviation of everything","STDEV.S":"Standard deviation of a sample",STDEVP:"Standard deviation of everything",SUBSTITUTE:"Replaces text",SUM:"Adds numbers",SUMIF:"Adds where a test passes",SUMIFS:"Adds on many tests",SUMPRODUCT:"Multiplies, then adds",SWITCH:"Picks a result by value",TAN:"Tangent",TEXT:"A number as formatted text",TEXTJOIN:"Joins with a separator",TIME:"Builds a time",TODAY:"Today's date",TRIM:"Removes extra spaces",TRUNC:"Cuts off decimals",UPPER:"Upper case",VALUE:"Text as a number",VAR:"Variance of a sample","VAR.P":"Variance of everything","VAR.S":"Variance of a sample",VARP:"Variance of everything",VLOOKUP:"Looks down the first column",WEEKDAY:"Day of the week",XLOOKUP:"Looks up in any column",XOR:"True if an odd number are true",YEAR:"Year of a date"},t={ABS:"绝对值",AND:"全部为真时返回真",AVERAGE:"数字的平均值",AVERAGEIF:"满足条件的平均值",AVERAGEIFS:"满足多个条件的平均值",CEILING:"向上舍入到倍数","CEILING.MATH":"向上舍入到倍数",CHOOSE:"按位置选择",COLUMN:"列号",COLUMNS:"列数",CONCAT:"连接文本",CONCATENATE:"连接文本",COS:"余弦",COUNT:"统计数字个数",COUNTA:"统计非空单元格",COUNTBLANK:"统计空单元格",COUNTIF:"统计满足条件的个数",COUNTIFS:"统计满足多个条件的个数",DATE:"生成日期",DATEDIF:"两个日期的间隔",DAY:"月份中的第几天",DAYS:"两个日期相差的天数",EDATE:"相隔若干个月的日期",EOMONTH:"月份的最后一天",EXACT:"文本完全相同",EXP:"e 的幂",FIND:"文本位置(区分大小写)",FLOOR:"向下舍入到倍数","FLOOR.MATH":"向下舍入到倍数",FV:"未来值",HLOOKUP:"在首行中查找",HOUR:"时间中的小时",IF:"二选一返回值",IFERROR:"出错时的备用值",IFNA:"#N/A 时的备用值",IFS:"第一个满足的条件",INDEX:"指定位置的单元格",INT:"向下取整",ISBLANK:"为空时返回真",ISERROR:"为错误时返回真",ISLOGICAL:"为逻辑值时返回真",ISNA:"为 #N/A 时返回真",ISNUMBER:"为数字时返回真",ISTEXT:"为文本时返回真",LARGE:"第 k 大的值",LEFT:"从开头截取文本",LEN:"文本长度",LN:"自然对数",LOG:"对数",LOG10:"以 10 为底的对数",LOWER:"转为小写",MATCH:"值的位置",MAX:"最大值",MEDIAN:"中位数",MID:"从中间截取文本",MIN:"最小值",MINUTE:"时间中的分钟",MOD:"余数",MODE:"出现最多的数字","MODE.SNGL":"出现最多的数字",MONTH:"日期中的月份",N:"转为数字",NA:"#N/A 错误",NETWORKDAYS:"两个日期之间的工作日",NOT:"取反",NOW:"当前日期和时间",NPV:"净现值",OR:"任一为真时返回真",PI:"圆周率",PMT:"贷款每期还款额",POWER:"幂运算",PRODUCT:"数字相乘",PROPER:"每个单词首字母大写",PV:"现值",RAND:"0 到 1 之间的随机数",RANDBETWEEN:"随机整数",RANK:"在列表中的排名","RANK.EQ":"在列表中的排名",REPLACE:"按位置替换",REPT:"重复文本",RIGHT:"从末尾截取文本",ROUND:"四舍五入",ROUNDDOWN:"向零舍入",ROUNDUP:"远离零舍入",ROW:"行号",ROWS:"行数",SEARCH:"文本位置(不区分大小写)",SECOND:"时间中的秒",SIGN:"数字的符号",SIN:"正弦",SMALL:"第 k 小的值",SQRT:"平方根",STDEV:"样本标准差","STDEV.P":"总体标准差","STDEV.S":"样本标准差",STDEVP:"总体标准差",SUBSTITUTE:"替换文本",SUM:"数字求和",SUMIF:"对满足条件的值求和",SUMIFS:"对满足多个条件的值求和",SUMPRODUCT:"相乘后求和",SWITCH:"按值选择结果",TAN:"正切",TEXT:"数字转为带格式的文本",TEXTJOIN:"用分隔符连接",TIME:"生成时间",TODAY:"今天的日期",TRIM:"删除多余空格",TRUNC:"截去小数",UPPER:"转为大写",VALUE:"文本转为数字",VAR:"样本方差","VAR.P":"总体方差","VAR.S":"样本方差",VARP:"总体方差",VLOOKUP:"在首列中查找",WEEKDAY:"星期几",XLOOKUP:"在任意列中查找",XOR:"奇数个为真时返回真",YEAR:"日期中的年份"},o={pdfPageFailed:e=>`Page ${e} couldn't be drawn for the PDF.`,untitled:"Untitled",backToFiles:"Back to files",filesHeading:"Spreadsheets",newFile:"New spreadsheet",openFile:"Open a file",filesEmptyTitle:"Make your first spreadsheet",filesEmptyBody:"Every change saves by itself.",deleteFile:"Delete",createFailed:"The spreadsheet could not be made.",deleteFailed:"The spreadsheet could not be deleted.",storedOpenFailed:"This spreadsheet could not be opened.",loading:"Loading",renameFailed:"The spreadsheet could not be renamed.",conflict:"Somebody else saved this spreadsheet, so your latest changes are not saved. Reload to see theirs.",reload:"Reload",noStoreEdited:"Not saved. Save as Excel to keep your changes",saveToFiles:"Save to Files",noStoreClean:"No autosave here. Save as Excel to keep a copy",deleteConfirm:e=>`Delete "${e}"? Nobody can open it again.`,spreadsheetFile:"spreadsheet",sheetBase:"Sheet",menuFile:"File",menuEdit:"Edit",menuView:"View",menuInsert:"Insert",menuFormat:"Format",menuData:"Data",menuNew:"New",menuOpen:"Open",saveExcel:"Save as Excel (.xlsx)",saveCsv:"Download this sheet as CSV",email:"Email",undo:"Undo",redo:"Redo",cut:"Cut",copy:"Copy",paste:"Paste",pasteValues:"Paste values only",pasteFormats:"Paste formatting only",findReplace:"Find and replace",clearValues:"Clear contents",freeze:"Freeze",gridlines:"Gridlines",showFormulas:"Show formulas",rowsAbove:"Rows above",rowsBelow:"Rows below",columnsLeft:"Columns left",columnsRight:"Columns right",sheet:"Sheet",function:"Function",functions:"Functions",number:"Number format",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",fontSize:"Font size",alignment:"Alignment",borders:"Borders",wrapText:"Wrap text",mergeCells:"Merge cells",clearFormatting:"Clear formatting",sortAscending:"Sort A to Z",sortDescending:"Sort Z to A",filter:"Filter",hideRows:"Hide rows",hideColumns:"Hide columns",unhideRows:"Show hidden rows",unhideColumns:"Show hidden columns",deleteRows:"Delete rows",deleteColumns:"Delete columns",formatGeneral:"Automatic",formatNumber:"Number",formatPercent:"Percent",formatScientific:"Scientific",formatCurrency:"Currency",formatDate:"Date",formatTime:"Time",formatDateTime:"Date and time",formatText:"Plain text",bordersAll:"All borders",bordersOuter:"Outer borders",bordersTop:"Top border",bordersBottom:"Bottom border",bordersLeft:"Left border",bordersRight:"Right border",bordersNone:"No borders",alignLeft:"Left",alignCenter:"Center",alignRight:"Right",alignTop:"Top",alignMiddle:"Middle",alignBottom:"Bottom",formatPainter:"Paint format",fewerDecimals:"Fewer decimal places",moreDecimals:"More decimal places",textColor:"Text color",fillColor:"Fill color",nameBox:"Selected cells",formulaBar:"Formula bar",cellEditor:"Cell contents",selectAll:"Select all",fillHandle:"Fill",find:"Find",replaceWith:"Replace with",replace:"Replace",replaceAll:"Replace all",previous:"Previous",next:"Next",close:"Close",matchCase:"Match case",wholeCell:"Whole cell",inFormulas:"In formulas",addSheet:"Add sheet",rename:"Rename",duplicate:"Duplicate",moveLeft:"Move left",moveRight:"Move right",tabColor:"Tab color",noColor:"No color",deleteSheet:"Delete sheet",deleteSheetTitle:"Delete this sheet?",sheetNameTaken:"Another sheet already has that name.",saveFailed:"Could not save the workbook. Try again.",openFailed:"Could not open that file. It may be damaged or an unsupported type.",statSum:"Sum",statAverage:"Average",statCount:"Count",statMin:"Min",statMax:"Max",blank:"(Blank)",clear:"Clear",apply:"Apply",sheetName:e=>`Sheet ${e}`,filterColumn:e=>`Filter column ${e}`,freezeRows:e=>0===e?"No frozen rows":1===e?"1 row":`${e} rows`,freezeColumns:e=>0===e?"No frozen columns":1===e?"1 column":`${e} columns`,freezeUpToRow:e=>`Up to row ${e}`,freezeUpToColumn:e=>`Up to column ${e}`,hitCount:(e,t)=>`${e} of ${t}`,replacedCount:e=>1===e?"Replaced in 1 cell":`Replaced in ${e} cells`,deleteSheetMessage:e=>`"${e}" and everything on it will be deleted. Formulas that use it will show #REF!.`,functionHelp:t=>e[t]??String(t)},a={pdfPageFailed:e=>`第 ${e} 页无法绘制到 PDF。`,untitled:"未命名",backToFiles:"返回文件",filesHeading:"电子表格",newFile:"新建电子表格",openFile:"打开文件",filesEmptyTitle:"创建您的第一个电子表格",filesEmptyBody:"每次更改都会自动保存。",deleteFile:"删除",createFailed:"无法创建电子表格。",deleteFailed:"无法删除电子表格。",storedOpenFailed:"无法打开此电子表格。",loading:"正在加载",renameFailed:"无法重命名电子表格。",conflict:"其他人已保存此电子表格,您最近的更改尚未保存。请重新加载以查看他们的版本。",reload:"重新加载",noStoreEdited:"未保存。请另存为 Excel 以保留更改",saveToFiles:"保存到文件",noStoreClean:"此处不会自动保存。请另存为 Excel 以保留副本",deleteConfirm:e=>`删除“${e}”?之后任何人都无法再打开它。`,spreadsheetFile:"电子表格",sheetBase:"工作表",menuFile:"文件",menuEdit:"编辑",menuView:"视图",menuInsert:"插入",menuFormat:"格式",menuData:"数据",menuNew:"新建",menuOpen:"打开",saveExcel:"另存为 Excel(.xlsx)",saveCsv:"将此工作表下载为 CSV",email:"发送邮件",undo:"撤销",redo:"重做",cut:"剪切",copy:"复制",paste:"粘贴",pasteValues:"仅粘贴数值",pasteFormats:"仅粘贴格式",findReplace:"查找和替换",clearValues:"清除内容",freeze:"冻结",gridlines:"网格线",showFormulas:"显示公式",rowsAbove:"在上方插入行",rowsBelow:"在下方插入行",columnsLeft:"在左侧插入列",columnsRight:"在右侧插入列",sheet:"工作表",function:"函数",functions:"函数",number:"数字格式",bold:"粗体",italic:"斜体",underline:"下划线",strikethrough:"删除线",fontSize:"字号",alignment:"对齐",borders:"边框",wrapText:"自动换行",mergeCells:"合并单元格",clearFormatting:"清除格式",sortAscending:"升序排序",sortDescending:"降序排序",filter:"筛选",hideRows:"隐藏行",hideColumns:"隐藏列",unhideRows:"显示隐藏的行",unhideColumns:"显示隐藏的列",deleteRows:"删除行",deleteColumns:"删除列",formatGeneral:"自动",formatNumber:"数字",formatPercent:"百分比",formatScientific:"科学计数",formatCurrency:"货币",formatDate:"日期",formatTime:"时间",formatDateTime:"日期和时间",formatText:"纯文本",bordersAll:"所有边框",bordersOuter:"外边框",bordersTop:"上边框",bordersBottom:"下边框",bordersLeft:"左边框",bordersRight:"右边框",bordersNone:"无边框",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",alignTop:"顶端对齐",alignMiddle:"垂直居中",alignBottom:"底端对齐",formatPainter:"格式刷",fewerDecimals:"减少小数位",moreDecimals:"增加小数位",textColor:"文字颜色",fillColor:"填充颜色",nameBox:"所选单元格",formulaBar:"编辑栏",cellEditor:"单元格内容",selectAll:"全选",fillHandle:"填充",find:"查找",replaceWith:"替换为",replace:"替换",replaceAll:"全部替换",previous:"上一个",next:"下一个",close:"关闭",matchCase:"区分大小写",wholeCell:"整个单元格",inFormulas:"在公式中",addSheet:"添加工作表",rename:"重命名",duplicate:"复制工作表",moveLeft:"左移",moveRight:"右移",tabColor:"标签颜色",noColor:"无颜色",deleteSheet:"删除工作表",deleteSheetTitle:"删除此工作表?",sheetNameTaken:"已有工作表使用该名称。",saveFailed:"无法保存工作簿,请重试。",openFailed:"无法打开该文件,文件可能已损坏或类型不受支持。",statSum:"求和",statAverage:"平均值",statCount:"计数",statMin:"最小值",statMax:"最大值",blank:"(空白)",clear:"清除",apply:"应用",sheetName:e=>`工作表 ${e}`,filterColumn:e=>`筛选 ${e} 列`,freezeRows:e=>0===e?"不冻结行":`${e} 行`,freezeColumns:e=>0===e?"不冻结列":`${e} 列`,freezeUpToRow:e=>`冻结至第 ${e} 行`,freezeUpToColumn:e=>`冻结至 ${e} 列`,hitCount:(e,t)=>`${e} / ${t}`,replacedCount:e=>`已替换 ${e} 个单元格`,deleteSheetMessage:e=>`将删除“${e}”及其全部内容。引用它的公式将显示 #REF!。`,functionHelp:e=>t[e]??String(e)};export{o as ENGLISH_WORDS,a as ZH_HANS_WORDS};
|
package/dist/chunk-3SRMKGQW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useCallback as e,useEffect as i,useRef as t,useState as l}from"react";import{WindowTitle as n,confirmDestructive as c,toast as r}from"efficient-shell";import{Icon as a}from"efficient-shell/icons";import{Button as o,EmptyState as s}from"efficient-shell/ui";import{jsx as f,jsxs as d}from"react/jsx-runtime";function m({words:m,list:h,create:p,remove:u,canCreate:g,canDelete:v,accept:w,onOpen:C,onOpenFile:N}){const[k,y]=l(null),F=t(null),D=e(()=>{h().then(y,()=>y([]))},[h]);i(D,[D]);const x=g&&f(o,{onClick:()=>{p().then(({id:e})=>C(e),()=>r.error(m.createFailed))},children:m.newFile}),z=f(o,{variant:"ghost",leftIcon:f(a,{name:"folder-open",size:16}),onClick:()=>F.current?.click(),children:m.openFile});return d("div",{className:"office-filelist",children:[f(n,{title:m.windowTitle}),f("input",{ref:F,type:"file",accept:w,className:"office-filelist-input",onChange:e=>{const i=e.target.files?.[0];e.target.value="",i&&N(i)}}),d("div",{className:"office-filelist-head",children:[f("h2",{children:m.heading}),z,k&&k.length>0&&x]}),0===k?.length?f("div",{className:"office-filelist-empty",children:f(s,{title:m.emptyTitle,description:m.emptyBody,children:x})}):f("ul",{className:"office-filelist-rows",children:k?.map(e=>d("li",{className:"office-filelist-row",children:[f(o,{variant:"link",onClick:()=>C(e.id),children:e.title}),f("span",{className:"office-filelist-date",children:new Date(e.updatedAt).toLocaleDateString()}),v&&f(o,{variant:"ghost",leftIcon:f(a,{name:"trash",size:16}),onClick:async()=>{await c({message:m.deleteConfirm(e.title),confirmWord:m.delete})&&u(e.id).then(D,()=>r.error(m.deleteFailed))},children:m.delete})]},e.id))})]})}export{m as FileList};
|
package/dist/chunk-AVUZSUQD.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={pdfPageFailed:e=>`Page ${e} couldn't be drawn for the PDF.`,backToFiles:"Back to files",filesHeading:"Documents",newFile:"New document",openFile:"Open a file",filesEmptyTitle:"Write your first document",filesEmptyBody:"Every change saves by itself.",deleteFile:"Delete",createFailed:"The document could not be made.",deleteFailed:"The document could not be deleted.",deleteConfirm:e=>`Delete "${e}"? Nobody can open it again.`,documentName:"Document name",documentPanel:"Document",pagePanel:"Page",outline:"Outline",outlineEmpty:"Headings in the document show here.",morePageSetup:"More page setup",export:"Export",renameFailed:"The document could not be renamed.",openFailed:"This document could not be opened.",conflict:"Somebody else saved this document, so your latest changes are not saved. Reload to see theirs.",reload:"Reload",noStoreEdited:"Not saved. Export to keep your changes",noStoreClean:"No autosave here. Export to keep a copy",openFromFiles:"Go back to your files to open another document.",untitled:"Untitled",loading:"Loading",newDocument:"New",open:"Open",rename:"Rename",menuFile:"File",menuInsert:"Insert",menuLayout:"Layout",save:"Save",saveDocx:"Save (.docx)",saveKeepType:"Save",saveAs:"Save as",saveAsWord:"Word document (.docx)",saveAsPdf:"PDF (from the print dialog)",saveAsWeb:"Web page (.html)",saveAsText:"Plain text (.txt)",print:"Print",undo:"Undo",redo:"Redo",find:"Find",replaceWith:"Replace with",replace:"Replace",replaceAll:"Replace all",matchCase:"Match case",previousMatch:"Previous match",nextMatch:"Next match",closeFind:"Close find",noMatches:"No matches",paragraphStyle:"Paragraph style",font:"Font",fontSize:"Font size",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",textColor:"Text color",highlight:"Highlight color",clearFormatting:"Clear formatting",bulletedList:"Bulleted list",numberedList:"Numbered list",decreaseIndent:"Decrease indent",increaseIndent:"Increase indent",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",justify:"Justify",lineSpacing:"Line spacing",styleNormal:"Normal",styleTitle:"Title",styleHeading1:"Heading 1",styleHeading2:"Heading 2",styleHeading3:"Heading 3",styleQuote:"Quote",table:"Table",image:"Image",link:"Link",linkPrompt:"Web address, or leave empty to remove the link.",linkInvalid:"That address can't be used as a link.",pageBreak:"Page break",pageNumber:"Page number",horizontalLine:"Horizontal line",rowAbove:"Insert row above",rowBelow:"Insert row below",columnLeft:"Insert column left",columnRight:"Insert column right",mergeCells:"Merge cells",mergeFailed:"These cells can't be merged: the selection would cut a merged cell.",cellShading:"Cell shading",noColor:"No color",deleteRow:"Delete row",deleteColumn:"Delete column",deleteTable:"Delete table",imageWidth:"Image width",imageOriginalSize:"Original size",imageRemove:"Remove image",pageSetup:"Page setup",paperSize:"Size",paperLetter:"US Letter",paperLegal:"US Legal",custom:"Custom",orientation:"Orientation",portrait:"Portrait",landscape:"Landscape",margins:"Margins",marginsNormal:"Normal, 2.54 cm",marginsNarrow:"Narrow, 1.27 cm",marginsModerate:"Moderate, 1.91 cm sides",marginsWide:"Wide, 5.08 cm sides",header:"Header",footer:"Footer",headerFooterHint:"{page} and {pages} become page numbers. A | pushes the text after it to the right.",headerFooterLocked:"This one holds a picture or a table, so it is kept as it is. Edit it in Word.",ok:"OK",cancel:"Cancel",dismiss:"Dismiss",zoomIn:"Zoom in",zoomOut:"Zoom out",wrapLines:"Wrap lines",objectTextBox:"Text box",objectChart:"Chart from Word. Kept as is.",objectDiagram:"Diagram from Word. Kept as is.",objectEquation:"Equation from Word. Kept as is.",objectPicture:"Picture from Word. Kept as is.",objectOther:"Object from Word. Kept as is.",objectField:"Field",discardMessage:"They haven't been saved.",discard:"Discard",keepEditing:"Keep editing",legacyDoc:".doc is the old Word format. Save it as .docx in Word first.",openedOldSave:"Opened as a document. Save it to get a Word file.",saveFailed:"The document could not be saved.",savedAsUtf8:"Saved as UTF-8: the original encoding can't be written from a browser.",dropHint:"Drop a document to open. Images insert into the page.",matchCount:(e,t)=>`${e} of ${t}`,replacedCount:e=>1===e?"1 replacement":`${e} replacements`,tableSize:(e,t)=>`${e} × ${t}`,pageLabel:e=>`Page ${e}`,pageOf:(e,t)=>`Page ${e} of ${t}`,wordCount:e=>1===e?"1 word":`${e.toLocaleString()} words`,lineColumn:(e,t)=>`Ln ${e}, Col ${t}`,lineCount:e=>1===e?"1 line":`${e.toLocaleString()} lines`,noticeComments:e=>1===e?"1 comment":`${e} comments`,noticeTracked:e=>1===e?"1 tracked change":`${e} tracked changes`,noticeObjects:e=>1===e?"1 object such as a text box":`${e} objects such as text boxes`,noticeFootnotes:e=>1===e?"1 footnote":`${e} footnotes`,noticeLead:e=>`Has ${e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]}. They stay in the file, but need Word to edit.`,discardTitle:e=>`Discard your changes to ${e}?`,cannotRead:e=>`${e} can't be opened. It may be damaged or password protected.`,unsupported:e=>`Unsupported file type: .${e||"unknown"}`},t={pdfPageFailed:e=>`第 ${e} 页无法绘制到 PDF。`,backToFiles:"返回文件",filesHeading:"文档",newFile:"新建文档",openFile:"打开文件",filesEmptyTitle:"写下您的第一份文档",filesEmptyBody:"每次更改都会自动保存。",deleteFile:"删除",createFailed:"无法创建文档。",deleteFailed:"无法删除文档。",deleteConfirm:e=>`删除“${e}”?之后任何人都无法再打开它。`,documentName:"文档名称",documentPanel:"文档",pagePanel:"页面",outline:"大纲",outlineEmpty:"文档中的标题会显示在这里。",morePageSetup:"更多页面设置",export:"导出",renameFailed:"无法重命名文档。",openFailed:"无法打开此文档。",conflict:"其他人已保存此文档,您最近的更改尚未保存。请重新加载以查看他们的版本。",reload:"重新加载",noStoreEdited:"未保存。请导出以保留更改",noStoreClean:"此处不会自动保存。请导出以保留副本",openFromFiles:"请返回文件列表以打开其他文档。",untitled:"未命名",loading:"正在加载",newDocument:"新建",open:"打开",rename:"重命名",menuFile:"文件",menuInsert:"插入",menuLayout:"布局",save:"保存",saveDocx:"保存 (.docx)",saveKeepType:"保存",saveAs:"另存为",saveAsWord:"Word 文档 (.docx)",saveAsPdf:"PDF(通过打印对话框)",saveAsWeb:"网页 (.html)",saveAsText:"纯文本 (.txt)",print:"打印",undo:"撤销",redo:"重做",find:"查找",replaceWith:"替换为",replace:"替换",replaceAll:"全部替换",matchCase:"区分大小写",previousMatch:"上一个匹配项",nextMatch:"下一个匹配项",closeFind:"关闭查找",noMatches:"无匹配项",paragraphStyle:"段落样式",font:"字体",fontSize:"字号",bold:"加粗",italic:"倾斜",underline:"下划线",strikethrough:"删除线",superscript:"上标",subscript:"下标",textColor:"文字颜色",highlight:"突出显示颜色",clearFormatting:"清除格式",bulletedList:"项目符号列表",numberedList:"编号列表",decreaseIndent:"减少缩进",increaseIndent:"增加缩进",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",justify:"两端对齐",lineSpacing:"行距",styleNormal:"正文",styleTitle:"标题",styleHeading1:"标题 1",styleHeading2:"标题 2",styleHeading3:"标题 3",styleQuote:"引用",table:"表格",image:"图片",link:"链接",linkPrompt:"输入网址;留空则移除链接。",linkInvalid:"该地址不能用作链接。",pageBreak:"分页符",pageNumber:"页码",horizontalLine:"水平线",rowAbove:"在上方插入行",rowBelow:"在下方插入行",columnLeft:"在左侧插入列",columnRight:"在右侧插入列",mergeCells:"合并单元格",mergeFailed:"无法合并这些单元格:所选范围会切开已合并的单元格。",cellShading:"单元格底纹",noColor:"无颜色",deleteRow:"删除行",deleteColumn:"删除列",deleteTable:"删除表格",imageWidth:"图片宽度",imageOriginalSize:"原始大小",imageRemove:"移除图片",pageSetup:"页面设置",paperSize:"纸张大小",paperLetter:"美国信纸",paperLegal:"美国法律用纸",custom:"自定义",orientation:"方向",portrait:"纵向",landscape:"横向",margins:"页边距",marginsNormal:"常规,2.54 厘米",marginsNarrow:"窄,1.27 厘米",marginsModerate:"中等,左右 1.91 厘米",marginsWide:"宽,左右 5.08 厘米",header:"页眉",footer:"页脚",headerFooterHint:"{page} 和 {pages} 会变成页码。| 会把其后的文字推到右侧。",headerFooterLocked:"此处包含图片或表格,因此保持原样。请在 Word 中编辑。",ok:"确定",cancel:"取消",dismiss:"关闭",zoomIn:"放大",zoomOut:"缩小",wrapLines:"自动换行",objectTextBox:"文本框",objectChart:"来自 Word 的图表,保持原样。",objectDiagram:"来自 Word 的示意图,保持原样。",objectEquation:"来自 Word 的公式,保持原样。",objectPicture:"来自 Word 的图片,保持原样。",objectOther:"来自 Word 的对象,保持原样。",objectField:"域",discardMessage:"这些更改尚未保存。",discard:"放弃",keepEditing:"继续编辑",legacyDoc:".doc 是旧版 Word 格式,请先在 Word 中另存为 .docx。",openedOldSave:"已作为文档打开。保存后即可得到 Word 文件。",saveFailed:"无法保存文档。",savedAsUtf8:"已保存为 UTF-8:浏览器无法写入原始编码。",dropHint:"拖放文档以打开;图片会插入页面。",matchCount:(e,t)=>`第 ${e} 个,共 ${t} 个`,replacedCount:e=>`已替换 ${e} 处`,tableSize:(e,t)=>`${e} × ${t}`,pageLabel:e=>`第 ${e} 页`,pageOf:(e,t)=>`第 ${e} 页,共 ${t} 页`,wordCount:e=>`${e.toLocaleString()} 字`,lineColumn:(e,t)=>`第 ${e} 行,第 ${t} 列`,lineCount:e=>`${e.toLocaleString()} 行`,noticeComments:e=>`${e} 条批注`,noticeTracked:e=>`${e} 处修订`,noticeObjects:e=>`${e} 个文本框等对象`,noticeFootnotes:e=>`${e} 条脚注`,noticeLead:e=>`包含 ${e.join("、")}。它们会保留在文件中,但需要在 Word 中编辑。`,discardTitle:e=>`放弃对 ${e} 的更改?`,cannotRead:e=>`无法打开 ${e}。文件可能已损坏或受密码保护。`,unsupported:e=>`不支持的文件类型:.${e||"未知"}`};export{e as ENGLISH_WORDS,t as ZH_HANS_WORDS};
|
package/dist/chunk-SB3YS3LH.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={decks:"Decks",newDeck:"New deck",untitledDeck:"Untitled deck",emptyTitle:"Make your first deck",emptyBody:"Build slides here, then present them or export to PowerPoint.",openFailed:"Couldn't open this deck",createFailed:"Could not create a deck.",deleteFailed:"Could not delete this deck.",backToDecks:"Back to decks",deleteConfirm:e=>`Delete "${e}"? This can't be undone.`,delete:"Delete",deckName:"Deck name",slidesPanel:"Slides",slideNumber:e=>`Slide ${e}`,slideOf:(e,t)=>`Slide ${e} of ${t}`,addSlide:"Add slide",duplicateSlide:"Duplicate slide",deleteSlide:"Delete slide",slideText:"Slide text",undo:"Undo",redo:"Redo",export:"Export",exportFailed:"Could not export this deck.",present:"Present",endShow:"End show",popupBlocked:"Your browser blocked the audience window. Allow pop-ups for this site, then end the show and present again.",back:"Back",next:"Next",nextSlide:"Next slide",endOfDeck:"End of the deck.",notes:"Notes",noNotes:"No notes for this slide.",speakerNotes:"Speaker notes",saveFailed:"Could not save this deck. Trying again.",renameFailed:"Could not rename this deck.",conflict:"Somebody else changed this deck. Your latest edits aren't saved. Reload to see their version.",reload:"Reload",addText:"Add text",addShape:"Add shape",addImage:"Add image",addChart:"Add chart",addTable:"Add table",elementText:"Text",elementShape:"Shape",elementImage:"Image",elementChart:"Chart",elementTable:"Table",slide:"Slide",objects:e=>`${e} objects`,background:"Background",positionAndSize:"Position and size",width:"W",height:"H",angle:"Angle",align:"Align",alignLeft:"Align left",alignCentre:"Align centre",alignRight:"Align right",bringForward:"Bring forward",size:"Size",weight:"Weight",regular:"Regular",bold:"Bold",textAlignment:"Text alignment",left:"Left",centre:"Centre",right:"Right",colour:"Colour",rectangle:"Rectangle",ellipse:"Ellipse",roundedRectangle:"Rounded rectangle",diamond:"Diamond",lineShape:"Line",outlineColour:"Outline colour",imageAddress:"Image address",chooseImage:"Choose image",imageTitle:"Slide image",description:"Description",data:"Data",chartType:"Chart type",bar:"Bar",line:"Line",values:"Values",valuesHint:"One label and number a line, like Sept, 42.",rows:"Rows",rowsHint:"One row a line, with commas between cells.",headingColour:"Heading colour",pptxPasswordProtected:"This file has a password. Remove it in PowerPoint, then import the file again.",pptxUnreadable:"This file can't be read as a PowerPoint (.pptx) file.",pptxLegacyFormat:"This is an older Office file. Save it as .pptx in PowerPoint, then import it again.",pptxTooManySlides:(e,t)=>`This deck has ${e} slides, and a deck can have at most ${t}.`,pptxTooLarge:(e,t)=>`This deck comes to ${e} MiB without its pictures, and a deck can be at most ${t} MiB. Split it into smaller decks.`,pdfSlideFailed:e=>`Slide ${e} couldn't be drawn for the PDF.`},t={decks:"演示文稿",newDeck:"新建演示文稿",untitledDeck:"未命名演示文稿",emptyTitle:"制作第一份演示文稿",emptyBody:"在这里制作幻灯片,然后放映或导出为 PowerPoint。",openFailed:"无法打开此演示文稿",createFailed:"无法创建演示文稿。",deleteFailed:"无法删除此演示文稿。",backToDecks:"返回演示文稿列表",deleteConfirm:e=>`要删除“${e}”吗?此操作无法撤销。`,delete:"删除",deckName:"演示文稿名称",slidesPanel:"幻灯片",slideNumber:e=>`第 ${e} 张幻灯片`,slideOf:(e,t)=>`第 ${e} 张,共 ${t} 张`,addSlide:"添加幻灯片",duplicateSlide:"复制幻灯片",deleteSlide:"删除幻灯片",slideText:"幻灯片文字",undo:"撤销",redo:"重做",export:"导出",exportFailed:"无法导出此演示文稿。",present:"放映",endShow:"结束放映",popupBlocked:"浏览器阻止了观众窗口。请允许此网站的弹出窗口,然后结束放映并重新放映。",back:"上一张",next:"下一张",nextSlide:"下一张幻灯片",endOfDeck:"演示文稿已结束。",notes:"备注",noNotes:"此幻灯片没有备注。",speakerNotes:"演讲者备注",saveFailed:"无法保存此演示文稿,正在重试。",renameFailed:"无法重命名此演示文稿。",conflict:"其他人修改了此演示文稿,您最近的编辑未保存。请重新加载以查看对方的版本。",reload:"重新加载",addText:"添加文字",addShape:"添加形状",addImage:"添加图片",addChart:"添加图表",addTable:"添加表格",elementText:"文字",elementShape:"形状",elementImage:"图片",elementChart:"图表",elementTable:"表格",slide:"幻灯片",objects:e=>`${e} 个对象`,background:"背景",positionAndSize:"位置和大小",width:"宽",height:"高",angle:"角度",align:"对齐",alignLeft:"左对齐",alignCentre:"居中对齐",alignRight:"右对齐",bringForward:"上移一层",size:"字号",weight:"字重",regular:"常规",bold:"粗体",textAlignment:"文字对齐",left:"左",centre:"中",right:"右",colour:"颜色",rectangle:"矩形",ellipse:"椭圆",roundedRectangle:"圆角矩形",diamond:"菱形",lineShape:"线条",outlineColour:"轮廓颜色",imageAddress:"图片地址",chooseImage:"选择图片",imageTitle:"幻灯片图片",description:"描述",data:"数据",chartType:"图表类型",bar:"柱形图",line:"折线图",values:"数值",valuesHint:"每行一个标签和数字,例如 九月, 42。",rows:"行",rowsHint:"每行一行数据,单元格之间用逗号分隔。",headingColour:"标题颜色",pptxPasswordProtected:"此文件设有密码。请先在 PowerPoint 中移除密码,再重新导入。",pptxUnreadable:"无法将此文件读取为 PowerPoint (.pptx) 文件。",pptxLegacyFormat:"这是旧版 Office 文件。请先在 PowerPoint 中另存为 .pptx,再重新导入。",pptxTooManySlides:(e,t)=>`此演示文稿有 ${e} 张幻灯片,最多只能有 ${t} 张。`,pptxTooLarge:(e,t)=>`此演示文稿不计图片已达 ${e} MiB,上限为 ${t} MiB。请拆分成较小的演示文稿。`,pdfSlideFailed:e=>`第 ${e} 张幻灯片无法绘制到 PDF。`};export{e as ENGLISH_WORDS,t as ZH_HANS_WORDS};
|
package/dist/chunk-XKOHIZO5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{BUILTIN_STYLES as e,DEFAULT_PAGE as t,REL as n,child as o,childrenOf as a,descendants as r,paraCss as s,parseParaProps as c,parseRunProps as l,parseXml as i,partText as d,readRels as p,readThemeFonts as f,readZip as w,resolveTarget as m,runCss as u}from"./chunk-RHW2M2UY.js";import{escapeHtml as g}from"efficient-shell/ui";var h={textBox:"Text box",chart:"Chart",diagram:"Diagram",equation:"Equation",picture:"Picture",object:"Object",contents:"Field"},b=new Set(["w:ins","w:del","w:moveFrom","w:moveTo","w:rPrChange","w:pPrChange","w:tcPrChange","w:trPrChange","w:tblPrChange","w:sectPrChange","w:cellIns","w:cellDel"]),$=new Set(["w:ins","w:del","w:moveFrom","w:moveTo"]),y={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",webp:"image/webp",svg:"image/svg+xml"},k=/^(https?:|mailto:|tel:)/i,v=e=>g(e);function x(e,t){let n="";for(let t=0;t<e.length;t+=32768)n+=String.fromCharCode(...e.subarray(t,t+32768));return`data:${t};base64,${btoa(n)}`}var T=(e,t)=>`${t}${++e.nextId}`,C=(e,t)=>e.src.slice(t.start,t.end),A=(e,t)=>t?C(e,t):void 0;function S(e,t){const n=[],a=new Set;let r=t;for(;r&&!a.has(r);){a.add(r);const t=e.styles.get(r);if(!t)break;n.unshift(t),r=o(t,"w:basedOn")?.attrs["w:val"]}return n}var P=e=>`"${e.replace(/["\\\n\r]/g,"")}"`;function j(e){return"w:t"===e.name||"w:delText"===e.name?e.text:"w:tab"===e.name?"\t":"w:instrText"===e.name||"w:instrDelText"===e.name?"":e.children.map(j).join("")}function N(e,t,n,o,a=""){const r=T(e,"x");return e.doc.raw.set(r,t),`<span data-raw="${r}" data-kind="${n}" contenteditable="false"${a}>${g(o)}</span>`}function E(e,t){const n=T(e,"x");return e.doc.raw.set(n,t),`<span data-raw="${n}" data-kind="mark"></span>`}function I(e,t,n){const a=n(C(e,t)),s=e=>r(t,new Set([e])).length>0,c=o(t,"wp:inline"),l=r(t,new Set(["a:blip"]))[0],i=l&&e.rels.get(l.attrs["r:embed"]),d=i&&!i.external?m(e.doc.docPath,i.target):void 0,p=d?.split(".").pop()?.toLowerCase()??"",f=d?e.doc.parts.get(d):void 0;if(f&&y[p]&&!s("wps:txbx")){const n=T(e,"x");e.doc.raw.set(n,a);const r=o(c??o(t,"wp:anchor"),"wp:extent"),s=Number(r?.attrs.cx)/12700,l=Number(r?.attrs.cy)/12700,i=s&&l?` style="width:${Math.round(100*s)/100}pt;height:${Math.round(100*l)/100}pt"`:"",d=c?"":' contenteditable="false"';return c||e.doc.notices.objects++,`<img data-raw="${n}" src="${v(e.imageUrl(f,y[p]))}"${i}${d} alt="">`}return e.doc.notices.objects++,s("wps:txbx")||s("w:txbxContent")?N(e,a,"object",`${e.labels.textBox}: ${j(t).slice(0,80)}`):s("c:chart")?N(e,a,"object",e.labels.chart):s("dgm:relIds")?N(e,a,"object",e.labels.diagram):N(e,a,"object",l?e.labels.picture:e.labels.object)}function M(e,t){const n=o(t,"w:rPr"),a=l(n,e.theme),s=A(e,n)??"",c=e=>`<w:r>${s}${e}</w:r>`;let i="";for(const n of t.children)switch(n.name){case"w:rPr":case"w:lastRenderedPageBreak":case"w:commentReference":case"w:fldChar":case"w:instrText":case"w:delInstrText":break;case"w:t":case"w:delText":i+=g(n.text);break;case"w:tab":i+="\t";break;case"w:noBreakHyphen":i+="‑";break;case"w:softHyphen":i+="";break;case"w:br":case"w:cr":"page"===n.attrs["w:type"]?i+='<span data-page-break contenteditable="false"></span>':"column"===n.attrs["w:type"]?i+=N(e,c(C(e,n)),"mark",""):i+="<br>";break;case"w:drawing":i+=I(e,n,c);break;case"mc:AlternateContent":case"w:pict":case"w:object":e.doc.notices.objects++,i+=N(e,c(C(e,n)),"object",r(n,new Set(["wps:txbx","w:txbxContent","v:textbox"])).length?`${e.labels.textBox}: ${j(r(n,new Set(["wps:txbx","w:txbxContent","v:textbox"]))[0]).slice(0,80)}`:e.labels.object);break;case"w:footnoteReference":case"w:endnoteReference":{const t=++e.footnoteCount;e.doc.notices.footnotes++;const o=e.footnotes.get(n.attrs["w:id"]);i+=N(e,c(C(e,n)),"note",String(t),o?` title="${v(o)}"`:"");break}default:i+=N(e,c(C(e,n)),"mark","")}if(!i)return"";if(a.vert&&(i=`<${"sub"===a.vert?"sub":"sup"}>${i}</${"sub"===a.vert?"sub":"sup"}>`),n){const t=T(e,"r");e.doc.runs.set(t,s);const r=u(a),c=o(n,"w:rStyle")?.attrs["w:val"];i=`<span data-r="${t}"${c?` data-rstyle="${v(c)}"`:""}${r?` style="${v(r)}"`:""}>${i}</span>`}for(const t of e.openComments)i=`<span data-comment="${v(t)}" title="${v(e.comments.get(t)??"")}">${i}</span>`;return i}function L(e,t){let n="",o=0,r=-1,s=-1,c="",l=!1;const i=()=>{r>=0&&(n+=N(e,e.src.slice(r,s),"field",c||e.labels.contents)),r=-1,c="",l=!1};for(const d of t){if("w:r"===d.name){const t=a(d,"w:fldChar");if(t.length||o>0){0===o&&(r=d.start,l=!1),l&&(c+=j(d));for(const e of t){const t=e.attrs["w:fldCharType"];"begin"===t?o++:"separate"===t&&1===o?l=!0:"end"===t&&o--}s=d.end,0===o&&i();continue}n+=M(e,d);continue}if(o>0)s=d.end;else switch(d.name){case"w:pPr":case"w:proofErr":break;case"w:commentRangeStart":e.openComments.add(d.attrs["w:id"]);break;case"w:commentRangeEnd":e.openComments.delete(d.attrs["w:id"]);break;case"w:hyperlink":{const t=d.attrs["r:id"]?e.rels.get(d.attrs["r:id"]):void 0,o=d.attrs["w:anchor"],a=t?.target??(o?`#${o}`:""),r=k.test(a)||a.startsWith("#"),s=`${t?` data-rel="${v(d.attrs["r:id"])}"`:""}${o?` data-anchor="${v(o)}"`:""}`;n+=`<a${r?` href="${v(a)}"`:""}${s}>${L(e,d.children)}</a>`;break}case"w:ins":case"w:moveTo":n+=`<ins>${L(e,d.children)}</ins>`;break;case"w:del":case"w:moveFrom":n+=`<del>${L(e,d.children)}</del>`;break;case"w:bookmarkStart":case"w:bookmarkEnd":case"w:permStart":case"w:permEnd":default:n+=E(e,C(e,d));break;case"m:oMath":case"m:oMathPara":e.doc.notices.objects++,n+=N(e,C(e,d),"object",e.labels.equation);break;case"w:fldSimple":case"w:sdt":case"w:smartTag":case"w:customXml":n+=N(e,C(e,d),"field",j(d)||e.labels.contents)}}return o>0&&(n+=g(c)),n}function O(e){return r(e,b).length>0}function B(e,t){const n=o(t,"w:pPr"),a=o(n,"w:pStyle")?.attrs["w:val"],r=o(n,"w:numPr")??function(e,t){let n;for(const a of S(e,t))n=o(o(a,"w:pPr"),"w:numPr")??n;return n}(e,a),s=o(r,"w:numId")?.attrs["w:val"];if(!s||"0"===s)return null;const c=Number(o(r,"w:ilvl")?.attrs["w:val"]??0),l=e.numbering.get(s)?.get(c);return{numId:s,ilvl:c,ordered:l?.ordered??!1,marker:l?.marker??""}}function R(e){const t=[],n=o(e,"w:pBdr");for(const e of["top","bottom","left","right"]){const a=o(n,`w:${e}`);if(!a||"nil"===a.attrs["w:val"]||"none"===a.attrs["w:val"])continue;const r=/^[0-9a-fA-F]{6}$/.test(a.attrs["w:color"]??"")?`#${a.attrs["w:color"]}`:"currentcolor";t.push(`border-${e}:${(Number(a.attrs["w:sz"])||4)/8}pt solid ${r}`)}const a=o(e,"w:shd")?.attrs["w:fill"];return a&&/^[0-9a-fA-F]{6}$/.test(a)&&t.push(`background-color:#${a}`),t.join(";")}function H(e,t,n){const a=o(t,"w:pPr"),l=o(a,"w:pStyle")?.attrs["w:val"],i=e.fieldOpen,d=function(e){let t=0;for(const n of r(e,new Set(["w:fldChar"]))){const e=n.attrs["w:fldCharType"];"begin"===e?t++:"end"===e&&t--}return t}(t),p=O(t)||i||0!==d;d>0&&(e.fieldOpen=!0),i&&d<0&&(e.fieldOpen=!1);const f=T(e,"p");e.doc.blocks.set(f,{xml:C(e,t),fingerprint:"",props:A(e,a),numId:n?.numId,ilvl:n?.ilvl});const w=n?0:function(e,t){if(!t)return 0;const n=o(e.styles.get(t),"w:name")?.attrs["w:val"]??"",a=/^heading ([1-6])$/i.exec(n);return a?Number(a[1]):0}(e,l),m=n?"li":w?`h${w}`:"p",u=c(a);n&&delete u.indentLeft,n&&delete u.firstLine;const g=[s(u),R(a)].filter(Boolean).join(";");let h=p?D(e,t):L(e,t.children);h&&!/<br>(<\/[^>]+>)*$/.test(h)||(h+="<br>");return`<${m} data-docx="${f}"${o(a,"w:pageBreakBefore")?" data-break-before":""}${l?` data-pstyle="${v(l)}"`:""}${g?` style="${v(g)}"`:""}${p?' data-locked contenteditable="false"':""}>${h}</${m}>`}function D(e,t){let n="";for(const o of t.children)"w:pPr"!==o.name&&"w:rPr"!==o.name&&"w:instrText"!==o.name&&"w:delInstrText"!==o.name&&("w:ins"===o.name||"w:moveTo"===o.name?n+=`<ins>${D(e,o)}</ins>`:"w:del"===o.name||"w:moveFrom"===o.name?n+=`<del>${D(e,o)}</del>`:"w:commentRangeStart"===o.name?e.openComments.add(o.attrs["w:id"]):"w:commentRangeEnd"===o.name?e.openComments.delete(o.attrs["w:id"]):"w:t"===o.name||"w:delText"===o.name?n+=g(o.text):"w:tab"===o.name?n+="\t":"w:br"===o.name?n+="<br>":"w:drawing"===o.name||"mc:AlternateContent"===o.name||"w:pict"===o.name?n+=`<span data-kind="object">${g(e.labels.object)}</span>`:n+=D(e,o));return n}function U(e,t){const n=T(e,"t"),r=o(t,"w:tblPr"),s=o(t,"w:tblGrid"),c=a(t,"w:tr"),l=c.some(e=>o(o(e,"w:trPr"),"w:gridBefore")||o(o(e,"w:trPr"),"w:gridAfter")),i=O(t)||l;l&&e.doc.notices.objects++,e.doc.blocks.set(n,{xml:C(e,t),fingerprint:"",props:A(e,r),tblGrid:A(e,s)});const d=o(r,"w:tblStyle")?.attrs["w:val"],p=a(s,"w:gridCol").map(e=>Number(e.attrs["w:w"])/20),f=new Map,w=c.map(e=>{const t=[];let n=0;for(const r of a(e,"w:tc")){const e=o(r,"w:tcPr"),a=Number(o(e,"w:gridSpan")?.attrs["w:val"]??1),s=o(e,"w:vMerge");if(s&&"restart"!==s.attrs["w:val"]&&f.has(n))f.get(n).rowSpan++;else{const e={node:r,rowSpan:1,col:n,span:a};t.push(e),s?f.set(n,e):f.delete(n)}n+=a}return t}),m=function(e,t,n){let a=o(t,"w:tblBorders");if(!a)for(const t of S(e,n))a=o(o(t,"w:tblPr"),"w:tblBorders")??a;return!!a&&a.children.some(e=>!["nil","none"].includes(e.attrs["w:val"]))}(e,r,d),u=c.map((t,n)=>{const a=T(e,"t");e.doc.blocks.set(a,{xml:"",fingerprint:"",props:A(e,o(t,"w:trPr"))});return`<tr data-docx="${a}">${w[n].map(t=>{const n=T(e,"t"),a=o(t.node,"w:tcPr");e.doc.blocks.set(n,{xml:"",fingerprint:"",props:A(e,a)});const r=o(a,"w:shd")?.attrs["w:fill"],s=[];r&&/^[0-9a-fA-F]{6}$/.test(r)&&s.push(`background-color:#${r.toLowerCase()}`);const c=o(a,"w:vAlign")?.attrs["w:val"];return"center"===c&&s.push("vertical-align:middle"),"bottom"===c&&s.push("vertical-align:bottom"),`<td data-docx="${n}"${t.span>1?` colspan="${t.span}"`:""}${t.rowSpan>1?` rowspan="${t.rowSpan}"`:""}${s.length?` style="${s.join(";")}"`:""}>${F(e,t.node.children)}</td>`}).join("")}</tr>`}).join(""),g=p.length?`<colgroup>${p.map(e=>`<col style="width:${Math.round(100*e)/100}pt">`).join("")}</colgroup>`:"";return`<table data-docx="${n}"${d?` data-tstyle="${v(d)}"`:""}${m?"":" data-no-borders"}${i?' data-locked contenteditable="false"':""}>${g}<tbody>${u}</tbody></table>`}function F(e,t){const n=[],r=[],s=e=>{for(;r.length>e;){const e=r.pop();n.push(`</li></${e.tag}>`)}};for(const c of t){const t="w:p"===c.name?B(e,c):null;if(t){for(;r.length&&r[r.length-1].ilvl>t.ilvl;)s(r.length-1);const o=r[r.length-1];!o||o.ilvl!==t.ilvl||o.numId===t.numId&&o.tag===(t.ordered?"ol":"ul")||s(r.length-1);const a=`${t.numId}:${t.ilvl}`,l=e.listCounters.get(a)??0;e.listCounters.set(a,l+1);const i=H(e,c,t),d=r[r.length-1];if(d&&d.ilvl===t.ilvl)n.push(`</li>${i.slice(0,i.lastIndexOf("</li>"))}`);else{const e=t.ordered?"ol":"ul",o=t.marker?` style="list-style-type:${t.marker}"`:"",a=t.ordered&&l?` start="${l+1}"`:"";n.push(`<${e} data-num-id="${v(t.numId)}" data-ilvl="${t.ilvl}"${a}${o}>${i.slice(0,i.lastIndexOf("</li>"))}`),r.push({tag:e,numId:t.numId,ilvl:t.ilvl})}continue}if("w:tcPr"!==c.name&&"w:sectPr"!==c.name)if(s(0),"w:p"===c.name)n.push(H(e,c,null));else if("w:tbl"===c.name)n.push(U(e,c));else if("w:sdt"===c.name){const t=T(e,"p");e.doc.blocks.set(t,{xml:C(e,c),fingerprint:""}),e.doc.notices.objects++;const r=F(e,a(o(c,"w:sdtContent"),"w:p"));n.push(`<div data-docx="${t}" data-locked contenteditable="false">${r}</div>`)}else{const t=T(e,"p");e.doc.blocks.set(t,{xml:C(e,c),fingerprint:""}),n.push(`<div data-docx="${t}" data-locked data-hidden contenteditable="false"></div>`)}}return s(0),n.join("")}function z(e){if("LI"!==e.tagName)return e.outerHTML;const t=e.cloneNode(!0);return Array.from(t.children).forEach(e=>{"UL"!==e.tagName&&"OL"!==e.tagName||e.remove()}),t.outerHTML}function V(e){const t=document.createElement("div");t.innerHTML=e.html,t.querySelectorAll("[data-docx]").forEach(t=>{const n=e.blocks.get(t.getAttribute("data-docx"));n&&(n.fingerprint=z(t))})}function q(e,t){const n=t?d(e,t):void 0;if(!n)return{text:"",editable:!0};const o=i(n),a=o.children.filter(e=>"w:p"===e.name),s=o.children.every(e=>"w:p"===e.name)&&0===r(o,new Set(["w:drawing","w:pict","mc:AlternateContent","w:sdt"])).length,c=a.map(e=>{let t="",n="",o=!1;const a=e=>{for(const r of e.children)if("w:t"===r.name)o||(t+=r.text);else if("w:tab"===r.name)o||(t+=" | ");else if("w:instrText"===r.name)n+=r.text;else if("w:fldChar"===r.name){const e=r.attrs["w:fldCharType"];"separate"!==e&&"end"!==e||(n&&(t+=G(n),n=""),o="separate"===e)}else"w:fldSimple"===r.name?t+=G(r.attrs["w:instr"]??"")||r.children.map(j).join(""):"w:pPr"!==r.name&&"w:rPr"!==r.name&&a(r)};return a(e),t}).filter(Boolean);return{text:c.join(" "),editable:s&&c.length<=1,part:t}}function G(e){const t=e.trim().split(/\s+/)[0]?.toUpperCase();return"PAGE"===t?"{page}":"NUMPAGES"===t?"{pages}":""}async function W(e,t={}){return K(await w(e),e,t)}function K(w,g,b={}){const y=p(w,"").find(e=>e.type.endsWith("/officeDocument")),k=y?m("",y.target):"word/document.xml",v=d(w,k);if(!v)throw new Error("Not a Word document");const T=i(v),C=o(T,"w:body");if(!C)throw new Error("Not a Word document");const A=p(w,k),N=e=>{const t=(e=>A.find(t=>t.type===e))(e);return t?m(k,t.target):void 0},E=f(N(n.theme)?d(w,N(n.theme)):void 0),I={parts:w,docPath:k,source:g,html:"",css:"",page:{...t},header:{text:"",editable:!0},footer:{text:"",editable:!0},blocks:new Map,runs:new Map,raw:new Map,notices:{comments:0,tracked:0,objects:0,footnotes:0},styles:[],theme:E},M={src:v,doc:I,labels:b.labels??h,rels:new Map(A.map(e=>[e.id,e])),theme:E,imageUrl:b.imageUrl??x,styles:new Map,numbering:new Map,listCounters:new Map,comments:new Map,footnotes:new Map,nextId:0,footnoteCount:0,openComments:new Set,fieldOpen:!1},L=N(n.styles),O=L?d(w,L):void 0,B=O?i(O):void 0;for(const e of a(B,"w:style"))M.styles.set(e.attrs["w:styleId"],e);const R=new Set(M.styles.keys());for(const[t,n]of Object.entries(e))R.has(t)||M.styles.set(t,i(n.xml));const H=o(B,"w:docDefaults");I.lang=o(o(o(H,"w:rPrDefault"),"w:rPr"),"w:lang")?.attrs["w:val"],I.css=function(e,t){const n=[],a=l(o(o(t,"w:rPrDefault"),"w:rPr"),e.theme),r=c(o(o(t,"w:pPrDefault"),"w:pPr"));e.doc.defaultFont=a.font,e.doc.defaultSize=a.size;let i=a,d=r;for(const[t,p]of e.styles){const f=p.attrs["w:type"];if("paragraph"!==f&&"character"!==f&&"table"!==f)continue;let w={},m={};for(const n of S(e,t))w={...w,...l(o(n,"w:rPr"),e.theme)},m={...m,...c(o(n,"w:pPr"))};if("paragraph"===f)n.push(`.docs-page [data-pstyle=${P(t)}]{${[u(w),s(m)].filter(Boolean).join(";")}}`),"1"===p.attrs["w:default"]&&(i={...a,...w},d={...r,...m});else if("character"===f)n.push(`.docs-page [data-rstyle=${P(t)}]{${u(w)}}`);else{const e=s(m);e&&n.push(`.docs-page table[data-tstyle=${P(t)}] p{${e}}`)}}return n.unshift(`.docs-page{${u(i)}}`,`.docs-page p,.docs-page h1,.docs-page h2,.docs-page h3,.docs-page h4,.docs-page h5,.docs-page h6,.docs-page li{${s(d)}}`),n.join("\n")}(M,H);const D=new Set(Object.keys(e));I.styles=[...M.styles.values()].filter(e=>"paragraph"===e.attrs["w:type"]&&"1"!==e.attrs["w:default"]&&(D.has(e.attrs["w:styleId"])||o(e,"w:qFormat"))&&!o(e,"w:hidden")&&!o(e,"w:semiHidden")).map(e=>({id:e.attrs["w:styleId"],name:o(e,"w:name")?.attrs["w:val"]??e.attrs["w:styleId"]}));const U=N(n.numbering),z=U?d(w,U):void 0;z&&function(e,t){const n=new Map;for(const e of a(t,"w:abstractNum")){const t=new Map;for(const n of a(e,"w:lvl")){const e=o(n,"w:numFmt")?.attrs["w:val"]??"decimal";t.set(Number(n.attrs["w:ilvl"]),{ordered:"bullet"!==e&&"none"!==e,marker:Y[e]??""})}n.set(e.attrs["w:abstractNumId"],t)}for(const r of a(t,"w:num")){const t=n.get(o(r,"w:abstractNumId")?.attrs["w:val"]??"");t&&e.numbering.set(r.attrs["w:numId"],t)}}(M,i(z));const G=N(n.comments),W=G?d(w,G):void 0;if(W){for(const e of a(i(W),"w:comment"))M.comments.set(e.attrs["w:id"],`${e.attrs["w:author"]??""}: ${j(e)}`);I.notices.comments=M.comments.size}const K=N(n.footnotes),Q=K?d(w,K):void 0;if(Q)for(const e of a(i(Q),"w:footnote"))M.footnotes.set(e.attrs["w:id"],j(e));I.notices.tracked=r(C,$).length;const X=o(C,"w:sectPr"),J=o(X,"w:pgSz"),Z=o(X,"w:pgMar"),_=(e,t,n)=>{const o=Number(e?.attrs[t]);return Number.isFinite(o)&&void 0!==e?.attrs[t]?o:n};I.page={width:_(J,"w:w",t.width),height:_(J,"w:h",t.height),top:Math.abs(_(Z,"w:top",t.top)),right:_(Z,"w:right",t.right),bottom:Math.abs(_(Z,"w:bottom",t.bottom)),left:_(Z,"w:left",t.left),header:_(Z,"w:header",t.header),footer:_(Z,"w:footer",t.footer)};const ee=e=>{const t=a(X,e).find(e=>"default"===e.attrs["w:type"]),n=t&&M.rels.get(t.attrs["r:id"]);return n?m(k,n.target):void 0};return I.header=q(w,ee("w:headerReference")),I.footer=q(w,ee("w:footerReference")),I.html=F(M,C.children),I.html||(I.html="<p><br></p>"),V(I),I}var Y={lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",decimalZero:"decimal-leading-zero"};var Q=new Set(["P","DIV","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","PRE","LI","TR","TABLE","UL","OL","TBODY"]);function X(e){let t="";const n=e=>{for(const o of Array.from(e.childNodes)){if(3===o.nodeType){t+=(o.nodeValue??"").replace(//g,"");continue}if(1!==o.nodeType)continue;const e=o;if("BR"===e.tagName){t+="\n";continue}if("DEL"===e.tagName||e.hasAttribute("data-hidden"))continue;if("object"===e.getAttribute("data-kind")||"mark"===e.getAttribute("data-kind"))continue;if("TD"===e.tagName||"TH"===e.tagName){n(e),t=`${t.replace(/\n+$/,"")}\t`;continue}const a=Q.has(e.tagName);n(e),a&&!t.endsWith("\n")&&(t+="\n")}};return n(e),t.replace(/\t\n/g,"\n").replace(/\n+$/,"\n")}function J(e){return(e.match(/[-ヿ㐀-鿿豈-]/g)?.length??0)+(e.replace(/[-ヿ㐀-鿿豈-]/g," ").match(/\S+/g)?.length??0)}function Z(e,t,n){if(!t)return[];const o=function(e){const t=[],n=e=>{for(const o of Array.from(e.childNodes))if(3===o.nodeType)t.push(o);else if(1===o.nodeType){const e=o;if("false"===e.getAttribute("contenteditable")||e.hasAttribute("data-raw"))continue;n(e)}};return n(e),t}(e),a=t=>{let n=t.parentNode;for(;n&&n!==e&&!Q.has(n.tagName)&&"TD"!==n.tagName;)n=n.parentNode;return n},r=[];let s=0;for(;s<o.length;){const e=a(o[s]);let c=s;const l=[];for(;c<o.length&&a(o[c])===e;)l.push(o[c++]);const i=l.map(e=>e.nodeValue??"").join(""),d=n?i:i.toLowerCase(),p=n?t:t.toLowerCase(),f=d.length===i.length?d:i;for(let e=f.indexOf(p);e>=0;e=f.indexOf(p,e+p.length)){const t=[];let n=0;for(const o of l){const a=(o.nodeValue??"").length,r=Math.max(e,n),s=Math.min(e+p.length,n+a);r<s&&t.push({node:o,start:r-n,end:s-n}),n+=a}r.push(t)}s=c}return r}function _(e,t){e.forEach((e,n)=>{const o=e.node.nodeValue??"";e.node.nodeValue=o.slice(0,e.start)+(0===n?t:"")+o.slice(e.end)})}function ee(e,t){const n=[0];if(t<=0)return n;let o=0;for(const a of e)if(a.breakBefore&&a.top>o&&(o=a.top,n.push(o)),!(a.top+a.height-o<=t))if(a.height<=t)a.top>o&&(o=a.top,n.push(o));else for(;a.top+a.height-o>t;)o+=t,n.push(o);return n}function te(e,t,n=1){const o=[],a=e=>{const a=e.getBoundingClientRect();o.push({top:(a.top-t)/n,height:a.height/n,breakBefore:e.hasAttribute("data-break-before")})};for(const r of Array.from(e.children))"TABLE"===r.tagName?r.querySelectorAll("tr").forEach(a):"UL"===r.tagName||"OL"===r.tagName?r.querySelectorAll("li").forEach(a):a(r),r.querySelectorAll("[data-page-break]").forEach(e=>{const a=e.getBoundingClientRect();o.push({top:(a.bottom-t)/n,height:0,breakBefore:!0})});return o}var ne=new Set(["P","DIV","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","LI","TABLE","THEAD","TBODY","TFOOT","TR","TD","TH","COLGROUP","COL","B","STRONG","I","EM","U","S","STRIKE","SUB","SUP","SPAN","FONT","A","BR","IMG","PRE","HR"]),oe=new Set(["SCRIPT","STYLE","TITLE","META","LINK","OBJECT","EMBED","IFRAME","NOSCRIPT","TEMPLATE","SVG","MATH","FORM","INPUT","BUTTON","SELECT","TEXTAREA","VIDEO","AUDIO","CANVAS"]),ae=new Set(["color","background-color","font-weight","font-style","text-decoration-line","text-decoration","font-family","font-size","text-align","margin-left","line-height","width","height","list-style-type"]),re=/^(https?:|mailto:|tel:|#)/i,se=/^(data:image\/(png|jpe?g|gif|webp|bmp);base64,|blob:)/i;function ce(e){const t=document.implementation.createHTMLDocument("");t.body.innerHTML=e;const n=(e,t,o)=>{for(const a of Array.from(e.childNodes)){if(3===a.nodeType){t.appendChild(o.createTextNode(a.nodeValue??""));continue}if(1!==a.nodeType)continue;const e=a,r=e.tagName.toUpperCase();if(oe.has(r))continue;if(!ne.has(r)){n(e,t,o);continue}if("IMG"===r&&!se.test(e.getAttribute("src")??""))continue;const s=o.createElement(r),c=(e.getAttribute("style")??"").split(";").map(e=>{const t=e.indexOf(":");if(t<0)return"";const n=e.slice(0,t).trim().toLowerCase(),o=e.slice(t+1).trim();return ae.has(n)&&!/url\(|expression|mso-/i.test(o)?`${n}:${o}`:""}).filter(Boolean).join(";");c&&s.setAttribute("style",c),"A"===r&&re.test(e.getAttribute("href")??"")&&s.setAttribute("href",e.getAttribute("href")),"IMG"===r&&s.setAttribute("src",e.getAttribute("src"));for(const t of["colspan","rowspan","start","color","face","size"]){const n=e.getAttribute(t);null!==n&&s.setAttribute(t,n)}n(e,s,o),t.appendChild(s)}},o=document.createElement("div");return n(t.body,o,document),o.innerHTML}import{escapeHtml as le}from"efficient-shell/ui";var ie="\nhtml,body{margin:0;background:#fff}\n.docs-page [data-comment]{background:none;border:0}\n.docs-page [data-locked]{background:none;box-shadow:none}\n.docs-page [data-page-break]{break-after:page;border:0;margin:0}\n.docs-page [data-break-before]{break-before:page}\n.docs-page tr,.docs-page img{break-inside:avoid}\n";function de(e,t){return`\n.docs-sheet{background:#fff;color:#777}\n.docs-sheet-line{border-color:#aaa}\n\n${`\n.docs-page{color:#000;background:#fff;white-space:pre-wrap;overflow-wrap:break-word;outline:none;line-height:1.08;tab-size:36pt;font-family:Calibri,Carlito,Arial,sans-serif;font-size:11pt}\n.docs-page p,.docs-page h1,.docs-page h2,.docs-page h3,.docs-page h4,.docs-page h5,.docs-page h6{margin:0;font:inherit;font-weight:400}\n.docs-page ul,.docs-page ol{margin:0;padding-left:24pt}\n.docs-page ul{list-style-type:disc}.docs-page ol{list-style-type:decimal}\n.docs-page ul ul{list-style-type:circle}.docs-page ul ul ul{list-style-type:square}\n.docs-page a{color:#0563c1;text-decoration:underline}\n.docs-page sub,.docs-page sup{font-size:.66em}\n.docs-page img{max-width:100%}\n.docs-page table{border-collapse:collapse;table-layout:fixed;width:100%}\n.docs-page td,.docs-page th{border:.5pt solid #000;padding:0 5.4pt;vertical-align:top}\n.docs-page table[data-no-borders] td,.docs-page table[data-no-borders] th{border:.5pt dotted #bbb}\n.docs-page td p{margin-bottom:0}\n.docs-page blockquote{margin:0 0 8pt 24pt;font-style:italic}\n.docs-page hr{border:0;border-top:.75pt solid #000;margin:6pt 0}\n.docs-page [data-hidden]{display:none}\n.docs-page [data-page-break]{display:block;height:0;border-top:1pt dashed #999;margin:6pt 0;user-select:none}\n.docs-page [data-comment]{background:#fff2cc;border-bottom:1.5pt solid #e0b000}\n.docs-page [data-locked]{background:#f4f4f4;box-shadow:-5pt 0 0 #bbb;cursor:not-allowed}\n.docs-page ins{color:#c00000;text-decoration:underline}\n.docs-page del{color:#c00000;text-decoration:line-through}\n.docs-page [data-kind="object"]{display:inline-block;background:#f4f4f4;border:.75pt dashed #999;color:#555;padding:1pt 5pt;cursor:not-allowed;white-space:normal}\n.docs-page [data-kind="field"]{background:#ededed}\n.docs-page [data-kind="note"]{vertical-align:super;font-size:.66em}\n.docs-page ::highlight(docs-find){background:#ffe680}\n.docs-page ::highlight(docs-find-current){background:#ff9f1a}\n\n${e.css}`.replaceAll(".docs-page",`.docs-page[data-doc="${t}"]`)}`}var pe=e=>ie.replaceAll(".docs-page",`.docs-page[data-doc="${e}"]`);function fe(e,t,n){const o=e=>(e??"").replaceAll("{page}",String(t)).replaceAll("{pages}",String(n)),[a,r]=e.split(/\s*\|\s*/);return[o(a),o(r)]}function we(e,t){const[n,o]=function(e){return e.split(/\s*\|\s*/).map(e=>e.split(/(\{page\}|\{pages\})/).map(e=>"{page}"===e?"counter(page)":"{pages}"===e?"counter(pages)":e?`"${e.replace(/["\\\n\r]/g,"")}"`:"").filter(Boolean).join(" "))}(t),a="font:9pt Calibri,Carlito,Arial,sans-serif;color:#555";return`${n?`@${e}-left{content:${n};${a}}`:""}${o?`@${e}-right{content:${o};${a}}`:""}`}function me({title:e,html:t,doc:n,scope:o,page:a,header:r,footer:s}){const c=e=>Math.round(e)/20+"pt",l=`@page{size:${c(a.width)} ${c(a.height)};margin:${c(a.top)} ${c(a.right)} ${c(a.bottom)} ${c(a.left)};${we("top",r)}${we("bottom",s)}}`;return`<!doctype html><html><head><meta charset="utf-8"><meta name="generator" content="efficient-shell Documents"><title>${le(e)}</title><style>${de(n,o)}\n${pe(o)}\n${l}</style></head><body><div class="docs-page" data-doc="${o}">${t}</div></body></html>`}export{z as fingerprintOf,V as stampFingerprints,W as readDocx,K as readParts,X as documentText,J as countWords,Z as findInNodes,_ as replaceSpots,ee as pageStarts,te as pageBlocks,ce as sanitizeHtml,de as pageStyles,pe as printStyles,fe as marginText,me as pageDocument};
|
package/dist/chunk-YYHJJIA4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ENGLISH_WORDS as r}from"./chunk-2PIEDEY5.js";import{newSheet as e}from"./chunk-VKCG3LPQ.js";import{createContext as t,useContext as n}from"react";import{jsx as o}from"react/jsx-runtime";var a=t(r);function s({words:r,children:e}){return o(a.Provider,{value:r,children:e})}var c=()=>n(a);import{createContext as i,useContext as m}from"react";import{jsx as u}from"react/jsx-runtime";var l=class extends Error{},p=i({});function f({value:r,children:e}){return u(p.Provider,{value:r,children:e})}var h=()=>m(p);function v(r,t){const n=Array.isArray(r?.sheets)?r.sheets:[];return n.length?n.map(r=>({...e(r.name),...r,cells:(r.cells??[]).map(r=>(r??[]).map(r=>r??""))})):[e(t)]}export{s as SpreadsheetWordsProvider,c as useSpreadsheetWords,l as SpreadsheetsConflict,f as SpreadsheetsProvider,h as useSpreadsheetsHost,v as sheetsOf};
|
package/dist/deckPdf-Q4OXQ7HV.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{drawJpeg as t,embeddedFonts as o,jpegPdf as r,openStage as n,settled as e}from"./chunk-JKYJGXJE.js";import{SLIDE_FONT as i,SlideView as a}from"./chunk-2AKHYM66.js";import"./chunk-2TZUCKZ7.js";import{ENGLISH_WORDS as c}from"./chunk-SB3YS3LH.js";import{flushSync as s}from"react-dom";import{createRoot as m}from"react-dom/client";import{jsx as l}from"react/jsx-runtime";async function d(o,r,n,i){const c=document.createElement("div");r.root.append(c);const d=m(c);try{s(()=>d.render(l(a,{slide:o,width:1600})));const r=c.firstElementChild;await e(r);return{jpeg:await t(r,{width:1600,height:900,pixelRatio:1,quality:i,fontCss:n,background:o.background}),width:720,height:405}}finally{d.unmount(),c.remove()}}async function u(t,e={}){const{signal:a,onProgress:s,quality:m}=e;a?.throwIfAborted();const l=n();try{const n=await async function(t){const r=document.createElement("div");r.style.fontFamily=i,t.root.append(r);try{return await o(r)}finally{r.remove()}}(l),e=[];for(const[o,r]of t.slides.entries()){a?.throwIfAborted();const i=await d(r,l,n,m).catch(t=>{throw new Error(c.pdfSlideFailed(o+1),{cause:t})});e.push(i),s?.(o+1,t.slides.length)}return r(e)}finally{l.close()}}export{u as deckToPdf};
|
package/dist/docxPdf-NCSEKI4J.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{boxesInWindow as t,pageWindows as e}from"./chunk-PWF37Y2N.js";import{drawJpeg as o,embeddedFonts as n,jpegPdf as i,openStage as r,settled as a}from"./chunk-JKYJGXJE.js";import{marginText as s,pageBlocks as p,pageStarts as c,pageStyles as l,printStyles as h,readDocx as d}from"./chunk-XKOHIZO5.js";import{ENGLISH_WORDS as f}from"./chunk-AVUZSUQD.js";import"./chunk-RHW2M2UY.js";var g="pdf",u=t=>t/20*(4/3);function m(t){const e=t.getBoundingClientRect().top;return Array.from(t.children,t=>{const o=t.getBoundingClientRect();return{top:o.top-e,height:o.height}})}function x(t,e,o,n,i){const r=document.createElement("div");r.style.cssText=`position:absolute;display:flex;justify-content:space-between;font:9pt Calibri,Carlito,Arial,sans-serif;color:#555;white-space:pre;left:${u(e.left)}px;right:${u(e.right)}px;${i}`;for(const e of s(t,o,n))r.append(Object.assign(document.createElement("span"),{textContent:e}));return r}function w(e,o,n,i){const{page:r,header:a,footer:s}=e.doc,p=document.createElement("div");p.style.cssText=`position:relative;overflow:hidden;background:#fff;width:${u(r.width)}px;height:${u(r.height)}px`;const c=document.createElement("div");return c.style.cssText=`position:absolute;overflow:hidden;left:${u(r.left)}px;top:${u(r.top)}px;right:${u(r.right)}px;height:${o.height}px`,c.append(function({body:e,boxes:o},n){const i=e.cloneNode(!1),r=t(o,n);if(!r)return i;for(let t=r.first;t<=r.last;t+=1)i.append(e.children[t].cloneNode(!0));const a=parseFloat(getComputedStyle(e.children[r.first]).marginTop)||0;return i.style.position="absolute",i.style.left="0",i.style.top=o[r.first].top-a-n.top+"px",i}(e,o)),p.append(c),a.text&&p.append(x(a.text,r,n,i,`top:${u(r.header)}px`)),s.text&&p.append(x(s.text,r,n,i,`bottom:${u(r.footer)}px`)),p}async function y(t,e,n,i,r){e.append(t);try{await a(t);return{jpeg:await o(t,{width:u(n.width),height:u(n.height),pixelRatio:2,quality:r,fontCss:i}),width:n.width/20,height:n.height/20}}finally{t.remove()}}async function b(t,o={}){const{signal:s,onProgress:x,quality:b}=o;s?.throwIfAborted();const $=await d(new Uint8Array(await t.arrayBuffer())),C=r();try{const t=function(t,e){const o=document.createElement("style");o.textContent=`${l(t,g)}\n${h(g)}`;const n=document.createElement("div");return n.className="docs-page",n.dataset.doc=g,n.style.cssText=`display:flow-root;width:${u(t.page.width-t.page.left-t.page.right)}px`,n.innerHTML=t.html,e.append(o,n),n}($,C.root);await a(t);const o={doc:$,body:t,boxes:m(t)},r=function(t,o){const n=u(t.page.height-t.page.top-t.page.bottom),i=c(p(o,o.getBoundingClientRect().top),n);return e(i,n,o.getBoundingClientRect().height)}($,t),d=await n(t),v=[];for(const[t,e]of r.entries()){s?.throwIfAborted();const n=w(o,e,t+1,r.length);v.push(await y(n,C.root,$.page,d,b).catch(e=>{throw new Error(f.pdfPageFailed(t+1),{cause:e})})),x?.(t+1,r.length)}return i(v)}finally{C.close()}}export{b as docxToPdf};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** How any of the three apps makes a PDF. */
|
|
2
|
-
interface PdfOptions {
|
|
3
|
-
/** Called after each page. */
|
|
4
|
-
onProgress?: (done: number, total: number) => void;
|
|
5
|
-
signal?: AbortSignal;
|
|
6
|
-
/** JPEG quality of each page, 0..1. */
|
|
7
|
-
quality?: number;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type { PdfOptions as P };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{PptxPasswordError as t,PptxUnreadableError as e}from"./chunk-USKJW3BA.js";import{DECK_FONT as n,MIN_SIZE as r,NO_FILL as a,SLIDE_H as o,SLIDE_W as s,newId as i,newSlide as l}from"./chunk-2TZUCKZ7.js";import{ENGLISH_WORDS as c}from"./chunk-SB3YS3LH.js";import{child as p,childrenOf as f,descendants as u,openZip as d,parseXml as m,partText as h,readRels as y,readThemeFonts as g,resolveTarget as w}from"./chunk-RHW2M2UY.js";var x=2097152;function b(t){if(Array.isArray(t))return t.reduce((t,e)=>t+b(e)+2,t.length?0:2);if(t&&"object"==typeof t){const e=Object.entries(t).filter(([,t])=>void 0!==t);return e.reduce((t,[e,n])=>t+b(e)+2+b(n)+2,e.length?0:2)}const e=JSON.stringify(t)??"null";return e.length+5*(e.match(/[^\x20-\x7e]/g)?.length??0)}var v=[208,207,17,224],M=Array.from("EncryptedPackage").flatMap(t=>[t.charCodeAt(0),0]),k=4194304;function P(t){for(let e=t.indexOf(M[0]);e>=0;e=t.indexOf(M[0],e+1))if(M.every((n,r)=>t[e+r]===n))return!0;return!1}var S={black:"000000",white:"ffffff",red:"ff0000",green:"008000",blue:"0000ff",yellow:"ffff00",gray:"808080",grey:"808080"},C={bg1:"lt1",tx1:"dk1",bg2:"lt2",tx2:"dk2"};function N(t){const e=t.children[0];return e?.attrs.lastClr??e?.attrs.val}function B(t,e){const n=new Map,r=p(p(t,"a:themeElements"),"a:clrScheme")?.children??[];for(const t of r){const e=N(t);e&&n.set(t.name.replace(/^a:/,""),e)}return{scheme:n,map:{...C,...e?.attrs}}}function A(t,e){const n=p(p(e,"p:clrMapOvr"),"a:overrideClrMapping");return n?{...t,map:{...t.map,...n.attrs}}:t}var I=t=>[0,2,4].map(e=>parseInt(t.slice(e,e+2),16)),F=t=>t.map(t=>{return(e=t,Math.max(0,Math.min(255,Math.round(e)))).toString(16).padStart(2,"0");var e}).join("");function T(t,e,n){const[r,a,o]=function([t,e,n]){const[r,a,o]=[t/255,e/255,n/255],s=Math.max(r,a,o),i=Math.min(r,a,o),l=(s+i)/2;if(s===i)return[0,0,l];const c=s-i;return[(s===r?(a-o)/c+(a<o?6:0):s===a?(o-r)/c+2:(r-a)/c+4)/6,l>.5?c/(2-s-i):c/(s+i),l]}(I(t));return F(function([t,e,n]){if(0===e)return[255*n,255*n,255*n];const r=n<.5?n*(1+e):n+e-n*e,a=2*n-r,o=t=>{const e=(t+1)%1;return e<1/6?a+6*(r-a)*e:e<.5?r:e<2/3?a+(r-a)*(2/3-e)*6:a};return[o(t+1/3),o(t),o(t-1/3)].map(t=>255*t)}([r,a,Math.max(0,Math.min(1,o*e+n))]))}function $(t,e){const n=Number(e.attrs.val)/1e5;if(!Number.isFinite(n))return t;switch(e.name){case"a:lumMod":return T(t,n,0);case"a:lumOff":return T(t,1,n);case"a:tint":return F(I(t).map(t=>t+(255-t)*(1-n)));case"a:shade":return F(I(t).map(t=>t*n));default:return t}}function j(t,e){const n=e.scheme.get(e.map[t]??t);return n?`#${n.toLowerCase()}`:void 0}function z(t,e){const n=t&&function(t,e){switch(t.name){case"a:srgbClr":return t.attrs.val;case"a:sysClr":return t.attrs.lastClr;case"a:prstClr":return S[t.attrs.val];case"a:schemeClr":return e.scheme.get(e.map[t.attrs.val]??t.attrs.val);default:return}}(t,e);if(t&&n&&/^[0-9a-f]{6}$/i.test(n)&&"0"!==p(t,"a:alpha")?.attrs.val)return`#${t.children.reduce($,n).toLowerCase()}`}function R(t,e){return z(p(t,"a:solidFill")?.children[0],e)}var O=t=>"1"===t||"true"===t,L=t=>Math.round(100*t)/100+0,H=(t,e)=>L(12700*t*e.scale),E=t=>t*Math.PI/180;function D(t){const e=p(t,"a:off")?.attrs,n=p(t,"a:ext")?.attrs;if(t&&e&&n)return{x:Number(e.x)||0,y:Number(e.y)||0,w:Number(n.cx)||0,h:Number(n.cy)||0,rotation:(Number(t.attrs.rot)||0)/6e4}}function V(t){const e=p(p(t,"p:grpSpPr"),"a:xfrm"),n=D(e),r=p(e,"a:chOff")?.attrs,a=p(e,"a:chExt")?.attrs;if(n&&r&&a)return{box:n,childX:Number(r.x)||0,childY:Number(r.y)||0,scaleX:Number(a.cx)?n.w/Number(a.cx):1,scaleY:Number(a.cy)?n.h/Number(a.cy):1,flipH:O(e?.attrs.flipH),flipV:O(e?.attrs.flipV)}}function W(t,e){const{box:n}=e,r=n.x+n.w/2,a=n.y+n.h/2;let o=n.x+(t.x-e.childX)*e.scaleX,s=n.y+(t.y-e.childY)*e.scaleY;e.flipH&&(o=2*r-o),e.flipV&&(s=2*a-s);const i=E(n.rotation),l=o-r,c=s-a;return{x:r+l*Math.cos(i)-c*Math.sin(i),y:a+l*Math.sin(i)+c*Math.cos(i)}}function Y(t,e){const n=W({x:t.x+t.w/2,y:t.y+t.h/2},e),r=t.w*e.scaleX,a=t.h*e.scaleY,o=e.flipH!==e.flipV;return{x:n.x-r/2,y:n.y-a/2,w:r,h:a,rotation:(o?-t.rotation:t.rotation)+e.box.rotation}}var U=t=>L((t%360+360)%360);function X(t,e,n){const r=e.reduce(Y,t);return{id:i(),x:L(n.left+r.x*n.scale),y:L(n.top+r.y*n.scale),w:L(r.w*n.scale),h:L(r.h*n.scale),rotation:U(r.rotation)}}function G(t,e,n,a){const o=t.x+t.w/2,s=t.y+t.h/2,l=E(t.rotation),c=r=>{const i=r*(e.flipH?-1:1)*t.w/2,c=r*(e.flipV?-1:1)*t.h/2,p={x:o+i*Math.cos(l)-c*Math.sin(l),y:s+i*Math.sin(l)+c*Math.cos(l)},f=n.reduce(W,p);return{x:a.left+f.x*a.scale,y:a.top+f.y*a.scale}},p=c(-1),f=c(1),u=Math.hypot(f.x-p.x,f.y-p.y);return{id:i(),x:L((p.x+f.x-u)/2),y:L((p.y+f.y-r)/2),w:L(u),h:r,rotation:U(180*Math.atan2(f.y-p.y,f.x-p.x)/Math.PI)}}var q={scheme:new Map,map:{}},J=(t,e)=>[...t.rels.values()].find(t=>t.type.endsWith(e)),K=t=>p(p(t,"p:cSld"),"p:spTree");function Z(t,e){const n=h(t,e);if(n)return{part:e,root:m(n),rels:new Map(y(t,e).map(t=>[t.id,t]))}}function Q(t,e,n){const r=Z(t,e);if(!r)return;const a=J(r,"/slideMaster"),o=a&&w(e,a.target);return o&&!n.has(o)&&n.set(o,function(t,e){const n=Z(t,e);if(!n)return;const r=J(n,"/theme"),a=r?h(t,w(e,r.target)):void 0;return{...n,palette:B(a?m(a):void 0,p(n.root,"p:clrMap")),fonts:g(a)}}(t,o)),{...r,master:o?n.get(o):void 0}}var _={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp"};var tt=t=>p(p(p(t,"p:nvSpPr"),"p:nvPr"),"p:ph")??p(p(p(t,"p:nvPicPr"),"p:nvPr"),"p:ph"),et=t=>!!tt(t),nt=t=>(K(t.root)?.children??[]).filter(t=>"p:sp"===t.name&&tt(t)),rt=new Set(["title","ctrTitle"]),at=new Set(["dt","ftr","sldNum"]);function ot(t){return t&&rt.has(t)?"title":t&&at.has(t)?t:"body"}function st(t,e){const n=tt(t);if(!n)return{shapes:[],style:"p:otherStyle",isPlaceholder:!1};const r=e.layout&&function(t,e){const n=nt(t),{idx:r,type:a}=e.attrs;return(void 0!==r?n.find(t=>tt(t)?.attrs.idx===r):void 0)??(void 0!==a?n.find(t=>tt(t)?.attrs.type===a):void 0)}(e.layout,n),a=r?tt(r)??n:n,o=e.master&&function(t,e){const n=ot(e.attrs.type);return nt(t).find(t=>ot(tt(t)?.attrs.type)===n)}(e.master,a),s=ot(a.attrs.type);return{shapes:[r,o].filter(t=>!!t),style:"title"===s?"p:titleStyle":"body"===s?"p:bodyStyle":"p:otherStyle",isPlaceholder:!0}}function it(t,e,n,r){const a=t=>p(p(t,"p:txBody"),"a:lstStyle"),o=p(p(n.master?.root,"p:txStyles"),e.style),s=e.isPlaceholder?[o,r]:[r,o];return[a(t),...e.shapes.map(a),...s]}function lt(t,e,n){for(const r of[t,...e.shapes]){const t=p(p(r,"p:txBody"),"a:bodyPr")?.attrs[n];if(void 0!==t)return t}}var ct={l:"left",ctr:"center",r:"right"},pt=(t,e)=>t.lists.flatMap(t=>{const n=p(t,`a:lvl${e+1}pPr`);return n?[n]:[]});function ft(t,e){return"+mj-lt"===t?e.fonts.major:"+mn-lt"===t?e.fonts.minor:t}function ut(t,e,n,r){const a=[t,p(e,"a:defRPr"),...n.map(t=>p(t,"a:defRPr"))].filter(t=>!!t),o=t=>a.find(e=>void 0!==e.attrs[t])?.attrs[t],s=Number(o("sz")),i=o("b"),l=a.map(t=>R(t,r.palette)),c=a.map(t=>p(t,"a:latin")?.attrs.typeface).find(Boolean);return{sizePt:Number.isFinite(s)&&s>0?s/100:18,bold:"1"===i||"true"===i,colour:l.find(Boolean)??r.styleColour??j("tx1",r.palette)??"#000000",typeface:ft(c,r)??(r.isTitle?r.fonts.major:r.fonts.minor)}}function dt(t,e){for(const n of[t,...e]){if(p(n,"a:buNone"))return{kind:"none"};if(p(n,"a:buChar")||p(n,"a:buBlip"))return{kind:"bullet"};const t=p(n,"a:buAutoNum");if(t)return{kind:"number",startAt:Number(t.attrs.startAt)||1}}return{kind:"none"}}function mt(t,e){const n=[t,...e].map(t=>t?.attrs.algn).find(Boolean);return n&&ct[n]||"left"}function ht(t,e,n){const r=p(t,"a:pPr"),a=[];let o="";for(const s of t.children){if("a:br"===s.name&&(o+="\n"),"a:r"!==s.name&&"a:fld"!==s.name)continue;const t=p(s,"a:t")?.text??"";o+=t,t.trim()&&a.push({text:t,style:ut(p(s,"a:rPr"),r,e,n)})}return{text:o,runs:a}}var yt=(t,e)=>t.sizePt===e.sizePt&&t.bold===e.bold&&t.colour===e.colour;function gt(t,e){const n=[],r=[],a=function(){const t=[];return(e,n)=>"bullet"===e.kind?"• ":"none"===e.kind?(t.length=Math.min(t.length,n),""):(t.length=Math.min(t.length,n+1),t[n]=(t[n]??e.startAt-1)+1,`${t[n]}. `)}();let o;for(const s of f(t,"a:p")){const t=p(s,"a:pPr"),i=Number(t?.attrs.lvl)||0,l=pt(e,i),c=ht(s,l,e),f=dt(t,l),u=c.text.trim()?a(f,i):"";n.push(u?`${" ".repeat(i)}${u}${c.text}`:c.text),c.runs.length&&!o&&(o=mt(t,l)),r.push(...c.runs)}if(!r[0])return null;const s=function(t){const e=[];for(const n of t){const t=e.find(t=>yt(t.style,n.style));t?t.length+=n.text.length:e.push({style:n.style,length:n.text.length})}return e.reduce((t,e)=>e.length>t.length?e:t).style}(r),i=Number(p(p(t,"a:bodyPr"),"a:normAutofit")?.attrs.fontScale);return{text:n.join("\n").trimEnd(),sizePt:s.sizePt*(i>0?i/1e5:1),bold:s.bold,colour:s.colour,align:o??"left",mixed:r.some(t=>!yt(t.style,s)),typefaces:new Set(r.flatMap(t=>t.style.typeface?[t.style.typeface]:[]))}}function wt(t,e){const n=t.map(t=>t.map(e));return n.some(t=>t.some(Boolean))?n:void 0}var xt=t=>t.reduce((t,e)=>t+e,0);function bt(t,e,n,r){const o=D(p(t,"p:xfrm")),s=f(e,"a:tr");if(!o||!s.length)return void(n.tally.skipped+=1);const i=f(p(e,"a:tblGrid"),"a:gridCol").map(t=>Number(t.attrs.w)||0),l=s.map(t=>Number(t.attrs.h)||0),c=s.map(t=>f(t,"a:tc").map(t=>function(t,e){const n=p(t,"a:txBody"),r=gt(n,{palette:e.palette,fonts:e.master?.fonts??{},lists:[p(n,"a:lstStyle"),e.presentation.defaultTextStyle],isTitle:!1});for(const t of r?.typefaces??[])e.tally.typefaces.add(t);return{text:r?.text.replace(/\s*\n\s*/g," ")??"",block:r,fill:R(p(t,"a:tcPr"),e.palette)??null}}(t,n))),u=X({...o,w:xt(i)||o.w,h:xt(l)||o.h},r,n.frame),d=function(t){const e=new Map;for(const{block:n}of t)n&&e.set(n.sizePt,(e.get(n.sizePt)??0)+1);return[...e].sort((t,e)=>e[1]-t[1])[0]?.[0]}(c.flat()),m={...u,type:"table",rows:c.map(t=>t.map(t=>t.text)),headerFill:c[0].map(t=>t.fill).find(Boolean)??a,headerColor:c[0].map(t=>t.block?.colour).find(Boolean),fontSize:void 0===d?void 0:H(d,n.frame),columnWidths:xt(i)?i.map(t=>{return e=t,n=xt(i),Math.round(e/n*1e4)/1e4;var e,n}):void 0,rowHeights:xt(l)?l.map(t=>Math.round(t/xt(l)*u.h*100)/100):void 0,cellFills:wt(c,t=>t.fill),cellColors:wt(c,t=>t.block?.colour??null)};n.elements.push(m)}var vt={rect:"rect",ellipse:"ellipse",roundRect:"roundRect",diamond:"diamond",line:"line",straightConnector1:"line",flowChartProcess:"rect",flowChartAlternateProcess:"roundRect",flowChartDecision:"diamond",flowChartConnector:"ellipse"},Mt=new Set(["a:videoFile","a:audioFile","a:quickTimeFile","p14:media"]);function kt(t,e,n,r){const a=gt(p(t,"p:txBody"),function(t,e,n){const r=p(p(t,"p:style"),"a:fontRef")?.children[0];return{palette:n.palette,fonts:n.master?.fonts??{},lists:it(t,e,n,n.presentation.defaultTextStyle),isTitle:"p:titleStyle"===e.style,styleColour:z(r,n.palette)}}(t,n,r));if(!a)return;const{scale:o}=r.frame,s=(e,r)=>(Number(lt(t,n,e)??r)||0)*o,l=H(a.sizePt,r.frame),c=s("lIns",91440),f=s("tIns",45720),u=Math.max(e.w-c-s("rIns",91440),1),d=Math.max(e.h-f-s("bIns",45720),1),m=lt(t,n,"anchor"),h=Math.max(d-function(t,e,n){const r=Math.max(1,Math.floor(n/(.52*e)));return t.split("\n").reduce((t,e)=>t+Math.max(1,Math.ceil(e.length/r)),0)*e*1.25}(a.text,l,u),0),y="ctr"===m?h/2:"b"===m?h:0;r.elements.push({id:i(),type:"text",rotation:e.rotation,x:L(e.x+c),y:L(e.y+f+y),w:L(u),h:L(d-y),text:a.text,fontSize:l,bold:a.bold,color:a.colour,align:a.align});for(const t of a.typefaces)r.tally.typefaces.add(t);a.mixed&&(r.tally.mixedTextSimplified+=1)}function Pt(t,e){const n=p(t,"p:spPr");if(p(n,"a:noFill"))return{kind:"none"};if(p(n,"a:solidFill")){const t=R(n,e.palette);return t?{kind:"colour",colour:t}:{kind:"none"}}if(["a:gradFill","a:blipFill","a:pattFill","a:grpFill"].some(t=>p(n,t))){const t=function(t,e){const n=p(p(p(t,"a:gradFill"),"a:gsLst"),"a:gs")?.children[0],r=p(p(t,"a:pattFill"),"a:fgClr")?.children[0];return z(n??r,e.palette)}(n,e);return t?{kind:"colour",colour:t}:{kind:"undrawable"}}const r=p(p(t,"p:style"),"a:fillRef"),a=r&&"0"!==r.attrs.idx?z(r.children[0],e.palette):void 0;return a?{kind:"colour",colour:a}:{kind:"none"}}function St(t,e){const n=p(p(t,"p:spPr"),"a:ln");if(p(n,"a:noFill"))return;const r=p(p(t,"p:style"),"a:lnRef"),a=R(n,e.palette)??(r&&"0"!==r.attrs.idx?z(r.children[0],e.palette):void 0);return a?{stroke:a,strokeWidth:L((Number(n?.attrs.w)||9525)*e.frame.scale)}:void 0}function Ct(t,e){const n=p(p(p(t,"a:prstGeom"),"a:avLst"),"a:gd")?.attrs.fmla,r=Number(n?.replace("val ",""));return L((Number.isFinite(r)?r:16667)/1e5*Math.min(e.w,e.h))}var Nt=t=>!!t?.attrs.type&&"none"!==t.attrs.type;function Bt(t,e,n){const r=p(t,"p:spPr"),o=p(r,"a:xfrm"),s=D(o);if(!s)return void(e.tally.skipped+=1);const i=St(t,e);if(!i)return;const l=p(r,"a:ln");e.elements.push({...G(s,{flipH:O(o?.attrs.flipH),flipV:O(o?.attrs.flipV)},n,e.frame),type:"shape",shape:"line",fill:a,...i,...Nt(p(l,"a:tailEnd"))?{arrowEnd:!0}:{},...Nt(p(l,"a:headEnd"))?{arrowStart:!0}:{}})}function At(t,e,n){const r=st(t,e),o=p(t,"p:spPr"),s=function(t){return vt[p(t,"a:prstGeom")?.attrs.prst??"rect"]??"rect"}(o);if("line"===s)return void Bt(t,e,n);const i=D(p(o,"a:xfrm"))??r.shapes.map(t=>D(p(p(t,"p:spPr"),"a:xfrm"))).find(Boolean);if(!i)return void(p(t,"p:txBody")&&u(t,new Set(["a:t"])).length&&(e.tally.skipped+=1));const l=X(i,n,e.frame),c=Pt(t,e),f=St(t,e),d="colour"===c.kind||!!f;d&&function(t,e,n,r,o,s){s.elements.push({...t,type:"shape",shape:e,fill:"colour"===n.kind?n.colour:a,...r,..."roundRect"===e?{radius:Ct(o,t)}:{}})}(l,s,c,f,o,e),kt(t,l,r,e),"undrawable"!==c.kind||d||(e.tally.skipped+=1)}function It(t,e){const n=e.rels.get(t?.attrs["r:embed"]??"");return n&&!n.external?w(e.part,n.target):void 0}function Ft(t,e,n){const r=p(t,"p:nvPicPr"),a=st(t,e),o=D(p(p(t,"p:spPr"),"a:xfrm"))??a.shapes.map(t=>D(p(p(t,"p:spPr"),"a:xfrm"))).find(Boolean),s=p(t,"p:blipFill"),i=It(p(s,"a:blip"),e.slide),l=i&&!u(t,Mt).length?e.useImage(i,function(t){const e=e=>(Number(t?.attrs[e])||0)/1e5,n={left:e("l"),top:e("t"),right:e("r"),bottom:e("b")},r=Object.values(n);if(!r.every(t=>0===t)&&!r.some(t=>t<0))return n.left+n.right<1&&n.top+n.bottom<1?n:void 0}(p(s,"a:srcRect"))):void 0;o&&l?e.elements.push({...X(o,n,e.frame),type:"image",src:l,alt:p(r,"p:cNvPr")?.attrs.descr??""}):e.tally.skipped+=1}function Tt(t,e,n){const r=p(p(p(t,"a:graphic"),"a:graphicData"),"a:tbl");r?bt(t,r,e,n):e.tally.skipped+=1}function $t(t,e,n=[]){for(const r of t)switch(r.name){case"p:sp":At(r,e,n);break;case"p:pic":Ft(r,e,n);break;case"p:graphicFrame":Tt(r,e,n);break;case"p:cxnSp":Bt(r,e,n);break;case"p:contentPart":e.tally.skipped+=1;break;case"p:grpSp":{const t=V(r);$t(r.children,e,t?[t,...n]:n);break}case"mc:AlternateContent":$t(p(r,"mc:Fallback")?.children??[],e,n)}}function jt(t){const e=function(t){const e=h(t,"[Content_Types].xml"),n=e?m(e):void 0,r=new Map(f(n,"Override").map(t=>[t.attrs.PartName,t.attrs.ContentType])),a=new Map(f(n,"Default").map(t=>[t.attrs.Extension?.toLowerCase(),t.attrs.ContentType]));return t=>{const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return r.get(`/${t}`)??a.get(e)??_[e]??"application/octet-stream"}}(t),n=new Map;return{use:(t,r)=>{const a=e(t);if(!a.startsWith("image/"))return;const o=`${t}${function(t){return t?`#${t.left},${t.top},${t.right},${t.bottom}`:""}(r)}`;return n.has(o)||n.set(o,{key:o,part:t,contentType:a,crop:r}),o},uses:n}}function zt(t){return t.children.map(t=>"a:br"===t.name?"\n":"a:r"===t.name||"a:fld"===t.name?p(t,"a:t")?.text??"":"").join("")}function Rt(t,e){const n=J(e,"/notesSlide"),r=n&&Z(t,w(e.part,n.target)),a=((r&&K(r.root)?.children)??[]).find(t=>"body"===p(p(p(t,"p:nvSpPr"),"p:nvPr"),"p:ph")?.attrs.type);return f(p(a,"p:txBody"),"a:p").map(zt).join("\n").trim()}function Ot(t,e){const n=p(p(t.root,"p:cSld"),"p:bg");if(!n)return;const r=p(n,"p:bgPr"),a=R(r,e.palette)??z(p(n,"p:bgRef")?.children[0],e.palette);if(a)return{colour:a};const o=It(p(p(r,"a:blipFill"),"a:blip"),t);return o?{picture:o}:void 0}var Lt=t=>"0"===t.root.attrs.showMasterSp||"false"===t.root.attrs.showMasterSp;function Ht(t,e){const n=function(t){for(const e of[t.slide,t.layout,t.master]){const n=e&&Ot(e,t);if(n)return n}return{}}(t);return n.picture&&function(t,e){const n=e.useImage(t,void 0);if(!n)return void(e.tally.skipped+=1);const{left:r,top:a,width:o,height:s}=e.frame;e.elements.push({id:i(),type:"image",x:r,y:a,w:o,h:s,rotation:0,src:n,alt:""})}(n.picture,t),function(t){const{layout:e,master:n,slide:r}=t;if(!Lt(r))for(const r of[e&&Lt(e)?void 0:n,e]){const e=r?K(r.root)?.children??[]:[];r&&$t(e.filter(t=>!et(t)),{...t,slide:r})}}(t),$t(K(t.slide.root)?.children??[],t),{id:i(),background:n.colour??"#ffffff",notes:Rt(e,t.slide),elements:(r=t.elements,a=t.tally,a.skipped+=Math.max(r.length-200,0),r.slice(0,200))};var r,a}var Et=t=>"0"===t.root.attrs.show||"false"===t.root.attrs.show;function Dt(t){const n=function(t){const n=y(t,"").find(t=>t.type.endsWith("/officeDocument")),r=Z(t,n?w("",n.target):"ppt/presentation.xml");if(!r||"p:presentation"!==r.root.name)throw new e;const a=f(p(r.root,"p:sldIdLst"),"p:sldId").flatMap(t=>{const e=r.rels.get(t.attrs["r:id"]);return e?[w(r.part,e.target)]:[]}),o=p(r.root,"p:sldSz")?.attrs;return{width:Number(o?.cx)||9144e3,height:Number(o?.cy)||5143500,slides:a,defaultTextStyle:p(r.root,"p:defaultTextStyle")}}(t),r=function(t){const e=new Map,n=new Map;return r=>{const a=J(r,"/slideLayout"),o=a&&w(r.part,a.target);o&&!n.has(o)&&n.set(o,Q(t,o,e));const s=o?n.get(o):void 0,i=s?.master,l=i?.palette??q;return{slide:r,layout:s,master:i,palette:A(s?A(l,s.root):l,r.root)}}}(t),a=jt(t),i=function(t,e){const n=Math.min(s/t,o/e);return{scale:n,left:(s-t*n)/2,top:(o-e*n)/2,width:t*n,height:e*n}}(n.width,n.height),c={skipped:0,mixedTextSimplified:0,typefaces:new Set},u=[];let d=0;for(const e of n.slides){const o=Z(t,e);o&&!Et(o)&&(p(o.root,"p:timing")&&(d+=1),u.push(Ht({...r(o),presentation:n,frame:i,tally:c,elements:[],useImage:a.use},t)))}const m=new Set(u.flatMap(t=>t.elements.flatMap(t=>"image"===t.type?[t.src]:[])));return{document:{slides:u.length?u:[l()]},slideCount:u.length,images:[...a.uses.values()].filter(t=>m.has(t.key)),animationsDropped:d,tally:c}}var Vt=.15,Wt=1048576,Yt=/\.(xml|rels)$/i;async function Ut(n,r){if(await async function(t){const e=new Uint8Array(await t.slice(0,v.length).arrayBuffer());return v.every((t,n)=>e[n]===t)}(n))throw await async function(t,e){for(let n=0;n<t.size;n+=k-M.length)if(e?.throwIfAborted(),P(new Uint8Array(await t.slice(n,n+k).arrayBuffer())))return!0;return!1}(n,r)?new t:new e(c.pptxLegacyFormat)}function Xt(t){if(t.slides.length>300)throw new e(c.pptxTooManySlides(t.slides.length,300));const n=b(t);if(n>x)throw new e(c.pptxTooLarge((n/Wt).toFixed(1),2))}var Gt={"image/webp":"webp","image/png":"png","image/jpeg":"jpg","image/gif":"gif"};async function qt(t,e,n){try{return await(n.prepareImage?n.prepareImage(e,t.contentType):async function(t,e,n){const r=await createImageBitmap(new Blob([t],{type:e}));try{const t=r.width*(n?.left??0),e=r.height*(n?.top??0),a=r.width-t-r.width*(n?.right??0),o=r.height-e-r.height*(n?.bottom??0),s=Math.min(1,1920/Math.max(a,o)),i=new OffscreenCanvas(Math.max(1,Math.round(a*s)),Math.max(1,Math.round(o*s))),l=i.getContext("2d");if(!l)throw new Error("No drawing context");return l.imageSmoothingQuality="high",l.drawImage(r,t,e,a,o,0,0,i.width,i.height),await i.convertToBlob({type:"image/webp",quality:.85})}finally{r.close()}}(e,t.contentType,t.crop))}catch(e){return n.signal?.throwIfAborted(),console.warn("A picture in the deck could not be read",t.part,e),null}}async function Jt(t,e,n){const r={addresses:new Map,count:0,bytesBefore:0,bytesAfter:0},a=function(t,e){const n=new Map;for(const r of t){const t=e.prepareImage?r.part:r.key;n.set(t,[...n.get(t)??[],r])}return[...n.values()]}(t,n),o=new Map;let s=0;return await async function(t,e,n){let r=0,a=!1;await Promise.all(Array.from({length:Math.min(e,t.length)},async()=>{for(;!a&&r<t.length;){const e=t[r];r+=1;try{await n(e)}catch(t){throw a=!0,t}}}))}(a,4,async t=>{n.signal?.throwIfAborted();const[i]=t,l=o.get(i.part)??0;o.set(i.part,l+1);const c=await e.read(i.part).catch(()=>null),p=c&&await qt(i,c,n);if(c&&p){n.signal?.throwIfAborted();const e=await n.storeImage(p,function(t,e,n){return`${t.slice(t.lastIndexOf("/")+1).replace(/\.[^.]*$/,"")}${n?`-${n}`:""}.${Gt[e.type]??"img"}`}(i.part,p,l));for(const{key:n}of t)r.addresses.set(n,e);r.count+=1,r.bytesBefore+=c.length,r.bytesAfter+=p.size}s+=1,n.onProgress?.(Vt+.85*s/a.length)}),r}async function Kt(t,r){r.signal?.throwIfAborted(),await Ut(t,r.signal);const a=await async function(t){try{return await d(t)}catch{throw new e}}(t),o=await async function(t,e){const n=new Map,r=t.names.filter(t=>Yt.test(t));for(const[a,o]of r.entries())e.signal?.throwIfAborted(),n.set(o,await t.read(o)),e.onProgress?.(Vt*(a+1)/r.length);return n}(a,r).catch(t=>{throw r.signal?.throwIfAborted(),t instanceof e?t:new e}),s=function(t){try{return Dt(t)}catch(t){if(t instanceof e)throw t;throw new e}}(o);Xt(s.document);const i=await Jt(s.images,a,r),l=function(t,e,n){const r=t=>{if("image"!==t.type)return[t];const r=e.get(t.src);return void 0===r&&(n.skipped+=1),void 0===r?[]:[{...t,src:r}]};return{slides:t.slides.map(t=>({...t,elements:t.elements.flatMap(r)}))}}(s.document,i.addresses,s.tally);return Xt(l),r.onProgress?.(1),{document:l,notes:{slides:s.slideCount,images:i.count,imageBytesBefore:i.bytesBefore,imageBytesAfter:i.bytesAfter,fontsReplaced:[...s.tally.typefaces].filter(t=>t!==n).sort(),animationsDropped:s.animationsDropped,mixedTextSimplified:s.tally.mixedTextSimplified,skipped:s.tally.skipped}}}export{Kt as importPptx};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{rowPageStarts as t}from"./chunk-PWF37Y2N.js";import{ENGLISH_WORDS as e}from"./chunk-2PIEDEY5.js";import{DEFAULT_COL_WIDTH as o,cellDisplay as n,filteredRows as r,formatKey as s,makeEvaluator as a,usedBounds as i}from"./chunk-VKCG3LPQ.js";import{drawJpeg as l,embeddedFonts as c,jpegPdf as d,openStage as p,settled as h}from"./chunk-JKYJGXJE.js";var m=t=>t*(4/3),f=m(842),u=m(595),w=f-2*m(36),g=u-2*m(36),y="Calibri,Carlito,Arial,sans-serif",b=t=>Array.from({length:t},(t,e)=>e);function x(t,e,a){const l=i(t);if(!l)return{name:t.name,widths:[],rows:[],headerRows:0};const c=new Set([...t.hiddenRows,...r(t,e,a)]),d=new Set(t.hiddenCols),p=b(l.col+1).filter(t=>!d.has(t)),h=b(l.row+1).filter(t=>!c.has(t)).map(o=>p.map(r=>{const{text:i,align:l,color:c}=n(t,e,a,o,r),d=t.formats[s(o,r)];return{text:i,align:d?.align??l,color:d?.color??c,format:d}}));return{name:t.name,widths:p.map(e=>t.colWidths[e]??o),rows:h,headerRows:Math.min(Math.max(t.frozenRows,1),h.length)}}function E(t){const e=document.createElement("td");e.textContent=t.text;const{format:o}=t;return e.style.cssText=`border:.5pt solid #bbb;padding:1pt 3pt;vertical-align:top;overflow-wrap:anywhere;white-space:pre-wrap;text-align:${t.align}`,t.color&&(e.style.color=t.color),o?.fill&&(e.style.background=o.fill),o?.bold&&(e.style.fontWeight="700"),o?.italic&&(e.style.fontStyle="italic"),o?.fontSize&&(e.style.fontSize=`${o.fontSize}pt`),e}function R(t){const e=document.createElement("tr");return e.append(...t.map(E)),e}function v(t,e){const o=document.createElement("table"),n=t.widths.reduce((t,e)=>t+e,0);o.style.cssText=`border-collapse:collapse;table-layout:fixed;width:${n}px;font:10pt ${y};color:#000`;const r=document.createElement("colgroup");r.append(...t.widths.map(t=>Object.assign(document.createElement("col"),{style:`width:${t}px`})));const s=document.createElement("tbody");return s.append(...e.map(R)),o.append(r,s),o}function $(t){const e=document.createElement("div");return e.textContent=t,e.style.cssText=`font:600 13pt ${y};color:#000;margin-bottom:6pt`,e}function C({table:t,scale:e,starts:o},n){const r=document.createElement("div");if(r.style.cssText=`position:relative;overflow:hidden;background:#fff;width:${f}px;height:${u}px;padding:${m(36)}px;box-sizing:border-box`,r.append($(t.name)),t.rows.length){const s=o[n+1]??t.rows.length,a=v(t,[...t.rows.slice(0,t.headerRows),...t.rows.slice(o[n],s)]);a.style.transform=`scale(${e})`,a.style.transformOrigin="0 0",r.append(a)}return r}async function k(t,e,o,n){e.append(t);try{await h(t);return{jpeg:await l(t,{width:f,height:u,pixelRatio:2,quality:n,fontCss:o}),width:842,height:595}}finally{t.remove()}}async function S(o,n={}){const{signal:r,onProgress:s,quality:i}=n;r?.throwIfAborted();const l=p();try{const n=a(o),p=o.map((e,o)=>function(e,o){const n=e.widths.reduce((t,e)=>t+e,0),r=n>w?w/n:1,s=$(e.name),a=v(e,e.rows);o.append(s,a);const i=s.getBoundingClientRect().height+m(6),l=Array.from(a.querySelectorAll("tr"),t=>t.getBoundingClientRect().height);s.remove(),a.remove();const c=l.slice(0,e.headerRows).reduce((t,e)=>t+e,0),d=(g-i)/r,p=t(l.slice(e.headerRows),d,c).map(t=>t+e.headerRows);return{table:e,scale:r,starts:p}}(x(e,o,n),l.root)),h=p.reduce((t,e)=>t+e.starts.length,0),f=await c(l.root),u=[];for(const t of p)for(const o of t.starts.keys())r?.throwIfAborted(),u.push(await k(C(t,o),l.root,f,i).catch(t=>{throw new Error(e.pdfPageFailed(u.length+1),{cause:t})})),s?.(u.length,h);return d(u)}finally{l.close()}}export{x as sheetTable,S as workbookToPdf};
|