azs-doc-editor 1.0.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/README.md +407 -0
- package/dist/converters-c15ebac4.mjs +14291 -0
- package/dist/index.d.ts +34 -0
- package/dist/style.css +1 -0
- package/dist/vue-document-editor.es.js +10583 -0
- package/dist/vue-document-editor.umd.js +58 -0
- package/package.json +87 -0
- package/types/index.d.ts +34 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
(function(Rt,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("vue"),require("vue-router"),require("@tiptap/core"),require("@tiptap/vue-3"),require("@tiptap/starter-kit")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@tiptap/core","@tiptap/vue-3","@tiptap/starter-kit"],S):(Rt=typeof globalThis<"u"?globalThis:Rt||self,S(Rt.VueDocumentEditor={},Rt.Vue,Rt.VueRouter,Rt.TiptapCore,Rt.TiptapVue3,Rt.TiptapStarterKit))})(this,function(Rt,S,Ul,ze,Ja,Hl){"use strict";var Wl=typeof global=="object"&&global&&global.Object===Object&&global;const jl=Wl;var $l=typeof self=="object"&&self&&self.Object===Object&&self,Vl=jl||$l||Function("return this")();const Ya=Vl;var Zl=Ya.Symbol;const pn=Zl;var Qa=Object.prototype,Xl=Qa.hasOwnProperty,Gl=Qa.toString,zr=pn?pn.toStringTag:void 0;function Kl(n){var t=Xl.call(n,zr),e=n[zr];try{n[zr]=void 0;var r=!0}catch{}var i=Gl.call(n);return r&&(t?n[zr]=e:delete n[zr]),i}var Jl=Object.prototype,Yl=Jl.toString;function Ql(n){return Yl.call(n)}var ql="[object Null]",ec="[object Undefined]",qa=pn?pn.toStringTag:void 0;function tc(n){return n==null?n===void 0?ec:ql:qa&&qa in Object(n)?Kl(n):Ql(n)}function rc(n){return n!=null&&typeof n=="object"}var nc="[object Symbol]";function ic(n){return typeof n=="symbol"||rc(n)&&tc(n)==nc}var ac=/\s/;function oc(n){for(var t=n.length;t--&&ac.test(n.charAt(t)););return t}var sc=/^\s+/;function lc(n){return n&&n.slice(0,oc(n)+1).replace(sc,"")}function ki(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}var eo=0/0,cc=/^[-+]0x[0-9a-f]+$/i,uc=/^0b[01]+$/i,fc=/^0o[0-7]+$/i,dc=parseInt;function to(n){if(typeof n=="number")return n;if(ic(n))return eo;if(ki(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=ki(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=lc(n);var e=uc.test(n);return e||fc.test(n)?dc(n.slice(2),e?2:8):cc.test(n)?eo:+n}var hc=function(){return Ya.Date.now()};const Ei=hc;var pc="Expected a function",mc=Math.max,gc=Math.min;function yc(n,t,e){var r,i,a,o,s,l,c=0,u=!1,f=!1,p=!0;if(typeof n!="function")throw new TypeError(pc);t=to(t)||0,ki(e)&&(u=!!e.leading,f="maxWait"in e,a=f?mc(to(e.maxWait)||0,t):a,p="trailing"in e?!!e.trailing:p);function d(T){var N=r,M=i;return r=i=void 0,c=T,o=n.apply(M,N),o}function b(T){return c=T,s=setTimeout(h,t),u?d(T):o}function y(T){var N=T-l,M=T-c,P=t-N;return f?gc(P,a-M):P}function g(T){var N=T-l,M=T-c;return l===void 0||N>=t||N<0||f&&M>=a}function h(){var T=Ei();if(g(T))return m(T);s=setTimeout(h,y(T))}function m(T){return s=void 0,p&&r?d(T):(r=i=void 0,o)}function w(){s!==void 0&&clearTimeout(s),c=0,r=l=i=s=void 0}function A(){return s===void 0?o:m(Ei())}function v(){var T=Ei(),N=g(T);if(r=arguments,i=this,l=T,N){if(s===void 0)return b(l);if(f)return clearTimeout(s),s=setTimeout(h,t),d(l)}return s===void 0&&(s=setTimeout(h,t)),o}return v.cancel=w,v.flush=A,v}const bc=["disabled"],vc=S.defineComponent({__name:"HeaderItem",props:{type:{},desc:{},disabled:{type:Boolean,default:!1},icon:{},active:{type:Boolean,default:void 0}},emits:["click"],setup(n,{emit:t}){const e=n,r=S.computed(()=>e.type==="action"?e.active!==!1:!!e.active),i=t;function a(){e.disabled||i("click")}return(o,s)=>{const l=S.resolveComponent("el-tooltip");return S.openBlock(),S.createBlock(l,{content:n.desc,placement:"top-start",effect:"dark","show-after":300},{default:S.withCtx(()=>[S.createElementVNode("i",{onClick:a,disabled:n.disabled,class:S.normalizeClass({[n.icon]:!0,"is-active":e.type==="style"&&r.value,"is-disabled":n.disabled})},null,10,bc)]),_:1},8,["content"])}}}),tm="",Ft=(n,t)=>{const e=n.__vccOpts||n;for(const[r,i]of t)e[r]=i;return e},lt=Ft(vc,[["__scopeId","data-v-8c3650b3"]]),_t=S.defineComponent({__name:"DropdownButton",props:{disabled:{type:Boolean,default:!1},icon:{}},emits:["click"],setup(n){return(t,e)=>{const r=S.resolveComponent("el-button"),i=S.resolveComponent("el-dropdown-item");return S.openBlock(),S.createBlock(i,null,{default:S.withCtx(()=>[S.createVNode(r,{text:"",class:"dropdown-btn",onClick:e[0]||(e[0]=a=>t.$emit("click")),disabled:n.disabled},{default:S.withCtx(()=>[S.createElementVNode("i",{class:S.normalizeClass(n.icon)},null,2),S.renderSlot(t.$slots,"default")]),_:3},8,["disabled"])]),_:3})}}}),rm="",wc={class:"icon-color-picker"},_c={class:"color-picker-container"},kc={class:"predefine-color-wrapper"},Ec={class:"predefine-color-list"},Cc=["onClick"],Sc={class:"predefine-color-list"},xc=["onClick"],Tc={class:"predefine-color-list"},Ac=["onClick"],Rc={class:"more-color"},Nc=S.defineComponent({__name:"IconColorPicker",props:{color:{},icon:{},disabled:{type:Boolean,default:!1},desc:{default:"取色器"},defaultColor:{default:""}},emits:["update:color","changeColor"],setup(n,{emit:t}){const e=[["#ffffff","#f2f2f2","#d8d8d8","#bfbfbf","#a5a5a5","#939393"],["#000000","#7f7f7f","#595959","#3f3f3f","#262626","#0d0d0d"],["#485368","#f3f5f7","#c5cad3","#808b9e","#353b45","#24272e"],["#2972f4","#e5efff","#c7dcff","#99beff","#1450b8","#0c306e"],["#00a3f5","#e5f6ff","#c7ecff","#9df9df","#1274a5","#0a415c"],["#319b62","#eafaf1","#c3ead5","#98d7b6","#277c4f","#184e32"],["#de3c36","#ffe9e8","#ffc9c7","#ff9c99","#9e1e1a","#58110e"],["#f88825","#fff3eb","#ffdcc4","#ffba84","#b86014","#5c300a"],["#f5c400","#fff9e3","#ffeead","#ffe270","#a38200","#665200"],["#9a38d7","#fdebff","#f2c7ff","#d58eff","#5e2281","#3b1551"]],r=["#c00000","#ff0000","#ffc000","#ff0ff0","#92d050","#00b050","#00b0f0","#0070c0","#002060","#7030a0"],i=S.ref([]),a=S.computed(()=>{const p=[];for(let d=0;d<10-i.value.length;d++)p.push("#ffffff");return p}),o=n,s=t,l=S.ref(),c=S.ref(),u=S.computed({get:()=>o.color,set:p=>s("update:color",p)});function f(p,d=!0,b=!0){var y;d&&p&&(i.value.length>=10&&i.value.pop(),i.value.unshift(p)),u.value=p||void 0,s("update:color",p),b&&((y=c.value)==null||y.hide()),s("changeColor")}return(p,d)=>{const b=S.resolveComponent("el-tooltip"),y=S.resolveComponent("el-divider"),g=S.resolveComponent("el-color-picker"),h=S.resolveComponent("el-popover");return S.openBlock(),S.createElementBlock("div",wc,[S.createElementVNode("div",_c,[S.createVNode(b,{content:o.desc,placement:"top-start",effect:"dark","show-after":300,teleported:!1},{default:S.withCtx(()=>[S.createElementVNode("div",{class:"icon-wrapper",onClick:d[0]||(d[0]=m=>s("changeColor"))},[S.createElementVNode("i",{class:S.normalizeClass([o.icon,"icon"])},null,2),S.createElementVNode("div",{class:"select-color-wrapper",style:S.normalizeStyle({background:u.value})},null,4)])]),_:1},8,["content"]),S.createVNode(h,{ref_key:"ColorWrapperRef",ref:c,trigger:"click",teleported:!1,"popper-class":"color-wrapper-popover"},{reference:S.withCtx(()=>[...d[5]||(d[5]=[S.createElementVNode("div",{class:"picker-container"},[S.createElementVNode("i",{class:"ri-arrow-drop-down-line"})],-1)])]),default:S.withCtx(()=>[S.createElementVNode("div",kc,[S.createVNode(y,{"content-position":"left",class:"color-title",style:{"margin-top":"10px"}},{default:S.withCtx(()=>[S.createTextVNode(S.toDisplayString(o.desc),1)]),_:1}),S.createElementVNode("div",{class:"default-color",onClick:d[1]||(d[1]=m=>f(n.defaultColor,!1))},"默认颜色"),S.createElementVNode("div",Ec,[(S.openBlock(),S.createElementBlock(S.Fragment,null,S.renderList(e,(m,w)=>S.createElementVNode("div",{key:w,class:"predefine-column"},[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(m,A=>(S.openBlock(),S.createElementBlock("div",{key:A,class:"predefine-item",style:S.normalizeStyle({background:A}),onClick:v=>f(A)},null,12,Cc))),128))])),64))]),S.createVNode(y,{"content-position":"left",class:"color-title"},{default:S.withCtx(()=>[...d[6]||(d[6]=[S.createTextVNode("标准色",-1)])]),_:1}),S.createElementVNode("div",Sc,[(S.openBlock(),S.createElementBlock(S.Fragment,null,S.renderList(r,(m,w)=>S.createElementVNode("div",{key:w,class:"predefine-item",style:S.normalizeStyle({background:m}),onClick:A=>f(m)},null,12,xc)),64))]),S.createVNode(y,{"content-position":"left",class:"color-title"},{default:S.withCtx(()=>[...d[7]||(d[7]=[S.createTextVNode("历史记录",-1)])]),_:1}),S.createElementVNode("div",Tc,[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(i.value,(m,w)=>(S.openBlock(),S.createElementBlock("div",{key:w,class:"predefine-item",style:S.normalizeStyle({background:m}),onClick:A=>f(m,!1)},null,12,Ac))),128)),(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(a.value,(m,w)=>(S.openBlock(),S.createElementBlock("div",{key:w,class:"predefine-item",style:{background:"#fff"}}))),128))])]),S.createElementVNode("div",Rc,[S.createElementVNode("div",{style:{flex:"1","padding-top":"12px"},onClick:d[2]||(d[2]=m=>{var w;return(w=l.value)==null?void 0:w.show()})},"更多颜色"),S.createVNode(g,{modelValue:u.value,"onUpdate:modelValue":d[3]||(d[3]=m=>u.value=m),ref_key:"colorPickerRef",ref:l,style:{width:"0px",height:"0px","padding-top":"36px",overflow:"hidden"},teleported:!1,disabled:o.disabled,onChange:f},null,8,["modelValue","disabled"]),S.createElementVNode("i",{class:"ri-arrow-drop-down-line",style:{flex:"1","padding-top":"12px","text-align":"right"},onClick:d[4]||(d[4]=m=>{var w;return(w=l.value)==null?void 0:w.show()})})])]),_:1},512)])])}}}),nm="",Ci=Ft(Nc,[["__scopeId","data-v-68dc6757"]]),Mc=S.defineComponent({__name:"TextEditor",props:{editor:{},editable:{type:Boolean}},setup(n){const t=n,e=S.ref("#000000");function r(){var o,s;e.value?(o=t.editor)==null||o.commands.setColor(e.value):(s=t.editor)==null||s.commands.setColor("#000000")}const i=S.ref();function a(){var o,s;i.value?(o=t.editor)==null||o.commands.toggleHighlight({color:i.value}):(s=t.editor)==null||s.commands.unsetHighlight()}return(o,s)=>{var l,c,u,f,p,d,b,y,g,h;return S.openBlock(),S.createElementBlock(S.Fragment,null,[S.createVNode(S.unref(lt),{type:"style",desc:"加粗",icon:"ri-bold",active:(l=n.editor)==null?void 0:l.isActive("bold"),onClick:s[0]||(s[0]=m=>{var w;return(w=n.editor)==null?void 0:w.chain().focus().toggleBold().run()}),disabled:!((c=n.editor)!=null&&c.can().chain().focus().toggleBold().run())||!n.editable},null,8,["active","disabled"]),S.createVNode(S.unref(lt),{type:"style",desc:"倾斜",icon:"ri-italic",active:(u=n.editor)==null?void 0:u.isActive("italic"),onClick:s[1]||(s[1]=m=>{var w;return(w=n.editor)==null?void 0:w.chain().focus().toggleItalic().run()}),disabled:!((f=n.editor)!=null&&f.can().chain().focus().toggleItalic().run())||!n.editable},null,8,["active","disabled"]),S.createVNode(S.unref(lt),{type:"style",desc:"删除线",icon:"ri-strikethrough",active:(p=n.editor)==null?void 0:p.isActive("strike"),onClick:s[2]||(s[2]=m=>{var w;return(w=n.editor)==null?void 0:w.chain().focus().toggleStrike().run()}),disabled:!((d=n.editor)!=null&&d.can().chain().focus().toggleStrike().run())||!n.editable},null,8,["active","disabled"]),S.createVNode(S.unref(lt),{type:"style",desc:"下划线",icon:"ri-underline",active:(b=n.editor)==null?void 0:b.isActive("underline"),onClick:s[3]||(s[3]=m=>{var w;return(w=n.editor)==null?void 0:w.chain().focus().toggleUnderline().run()}),disabled:!((y=n.editor)!=null&&y.can().chain().focus().toggleUnderline().run())||!n.editable},null,8,["active","disabled"]),S.createVNode(S.unref(lt),{type:"action",desc:"上标",icon:"ri-superscript",onClick:s[4]||(s[4]=m=>{var w;return(w=n.editor)==null?void 0:w.chain().focus().toggleSuperscript().run()}),disabled:!((g=n.editor)!=null&&g.can().chain().focus().toggleSuperscript().run())||!n.editable},null,8,["disabled"]),S.createVNode(S.unref(lt),{type:"action",desc:"下标",icon:"ri-subscript",onClick:s[5]||(s[5]=m=>{var w;return(w=n.editor)==null?void 0:w.chain().focus().toggleSubscript().run()}),disabled:!((h=n.editor)!=null&&h.can().chain().focus().toggleSubscript().run())||!n.editable},null,8,["disabled"]),S.createVNode(S.unref(Ci),{color:e.value,"onUpdate:color":s[6]||(s[6]=m=>e.value=m),desc:"字体颜色",icon:"ri-font-family",defaultColor:"#000",disabled:!n.editable,onChangeColor:r},null,8,["color","disabled"]),S.createVNode(S.unref(Ci),{color:i.value,"onUpdate:color":s[7]||(s[7]=m=>i.value=m),desc:"背景高亮",icon:"ri-mark-pen-line",disabled:!n.editable,onChangeColor:a},null,8,["color","disabled"])],64)}}}),Lc={class:"heading-menu"},Oc=S.defineComponent({__name:"HeadingEditor",props:{editor:{},editable:{type:Boolean}},setup(n){const t=n,e=[{value:0,label:"正文"},{value:1,label:"H1"},{value:2,label:"H2"},{value:3,label:"H3"},{value:4,label:"H4"},{value:5,label:"H5"},{value:6,label:"H6"}];function r(a){var o,s;t.editable&&(a?(o=t.editor)==null||o.chain().focus().toggleHeading({level:a}).run():(s=t.editor)==null||s.chain().focus().setParagraph().run())}function i(){var a,o,s,l,c,u;return(a=t.editor)!=null&&a.isActive("heading",{level:1})?"H1":(o=t.editor)!=null&&o.isActive("heading",{level:2})?"H2":(s=t.editor)!=null&&s.isActive("heading",{level:3})?"H3":(l=t.editor)!=null&&l.isActive("heading",{level:4})?"H4":(c=t.editor)!=null&&c.isActive("heading",{level:5})?"H5":(u=t.editor)!=null&&u.isActive("heading",{level:6})?"H6":"正文"}return(a,o)=>{const s=S.resolveComponent("el-dropdown-item"),l=S.resolveComponent("el-dropdown-menu"),c=S.resolveComponent("el-dropdown");return S.openBlock(),S.createBlock(c,{"hide-timeout":300},{dropdown:S.withCtx(()=>[S.createVNode(l,null,{default:S.withCtx(()=>[(S.openBlock(),S.createElementBlock(S.Fragment,null,S.renderList(e,u=>S.createVNode(s,{key:u.value,onClick:f=>r(u.value)},{default:S.withCtx(()=>[S.createTextVNode(S.toDisplayString(u.label),1)]),_:2},1032,["onClick"])),64))]),_:1})]),default:S.withCtx(()=>[S.createElementVNode("div",Lc,[S.createElementVNode("span",null,S.toDisplayString(i()),1),o[0]||(o[0]=S.createElementVNode("i",{class:"ri-arrow-drop-down-line"},null,-1))])]),_:1})}}}),im="",Ic=Ft(Oc,[["__scopeId","data-v-608d9daa"]]),Fc=S.defineComponent({__name:"TableEditor",props:{editor:{},editable:{type:Boolean}},setup(n){const t=n,e=S.ref("");function r(){var i;(i=t.editor)==null||i.chain().focus().setCellAttribute("backgroundColor",e.value).run()}return(i,a)=>{const o=S.resolveComponent("el-dropdown-menu"),s=S.resolveComponent("el-dropdown"),l=S.resolveComponent("el-tooltip");return S.openBlock(),S.createElementBlock(S.Fragment,null,[S.createVNode(l,{content:"表格",placement:"top-start",effect:"dark","show-after":500},{default:S.withCtx(()=>[S.createVNode(s,{disabled:!n.editable},{dropdown:S.withCtx(()=>[S.createVNode(o,{style:{"max-height":"300px","overflow-y":"auto"}},{default:S.withCtx(()=>{var c,u,f,p,d,b,y,g,h,m,w,A,v,T;return[S.createVNode(S.unref(_t),{onClick:a[0]||(a[0]=N=>{var M;return(M=n.editor)==null?void 0:M.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()}),disabled:!((c=n.editor)!=null&&c.can().insertTable()),icon:"ri-page-separator"},{default:S.withCtx(()=>[...a[15]||(a[15]=[S.createTextVNode(" 插入表格 ",-1)])]),_:1},8,["disabled"]),S.createVNode(S.unref(_t),{onClick:a[1]||(a[1]=N=>{var M;return(M=n.editor)==null?void 0:M.chain().focus().deleteTable().run()}),disabled:!((u=n.editor)!=null&&u.can().deleteTable()),icon:"ri-delete-bin-5-line"},{default:S.withCtx(()=>[...a[16]||(a[16]=[S.createTextVNode(" 删除表格 ",-1)])]),_:1},8,["disabled"]),S.createVNode(S.unref(_t),{onClick:a[2]||(a[2]=N=>{var M;return(M=n.editor)==null?void 0:M.chain().focus().addRowBefore().run()}),disabled:!((f=n.editor)!=null&&f.can().addRowBefore()),icon:"ri-insert-row-top"},{default:S.withCtx(()=>[...a[17]||(a[17]=[S.createTextVNode(" 插入行(上方) ",-1)])]),_:1},8,["disabled"]),S.createVNode(S.unref(_t),{onClick:a[3]||(a[3]=N=>{var M;return(M=n.editor)==null?void 0:M.chain().focus().addRowAfter().run()}),disabled:!((p=n.editor)!=null&&p.can().addRowAfter()),icon:"ri-insert-row-bottom"},{default:S.withCtx(()=>[...a[18]||(a[18]=[S.createTextVNode(" 插入行(下方) ",-1)])]),_:1},8,["disabled"]),S.createVNode(S.unref(_t),{onClick:a[4]||(a[4]=N=>{var M;return(M=n.editor)==null?void 0:M.chain().focus().addColumnBefore().run()}),disabled:!((d=n.editor)!=null&&d.can().addColumnBefore()),icon:"ri-insert-column-left"},{default:S.withCtx(()=>[...a[19]||(a[19]=[S.createTextVNode(" 插入列(左侧) ",-1)])]),_:1},8,["disabled"]),S.createVNode(S.unref(_t),{onClick:a[5]||(a[5]=N=>{var M;return(M=n.editor)==null?void 0:M.chain().focus().addColumnAfter().run()}),disabled:!((b=n.editor)!=null&&b.can().addColumnAfter()),icon:"ri-insert-column-right"},{default:S.withCtx(()=>[...a[20]||(a[20]=[S.createTextVNode(" 插入列(右侧) ",-1)])]),_:1},8,["disabled"]),S.createVNode(S.unref(_t),{onClick:a[6]||(a[6]=N=>{var M;return(M=n.editor)==null?void 0:M.chain().focus().deleteRow().run()}),disabled:!((y=n.editor)!=null&&y.can().deleteRow()),icon:"ri-delete-row"},{default:S.withCtx(()=>[...a[21]||(a[21]=[S.createTextVNode(" 删除行 ",-1)])]),_:1},8,["disabled"]),S.createVNode(S.unref(_t),{onClick:a[7]||(a[7]=N=>{var M;return(M=n.editor)==null?void 0:M.chain().focus().deleteColumn().run()}),disabled:!((g=n.editor)!=null&&g.can().deleteColumn()),icon:"ri-delete-column"},{default:S.withCtx(()=>[...a[22]||(a[22]=[S.createTextVNode(" 删除列 ",-1)])]),_:1},8,["disabled"]),S.createVNode(S.unref(_t),{onClick:a[8]||(a[8]=N=>{var M;return(M=n.editor)==null?void 0:M.chain().focus().mergeCells().run()}),disabled:!((h=n.editor)!=null&&h.can().mergeCells()),icon:"ri-merge-cells-vertical"},{default:S.withCtx(()=>[...a[23]||(a[23]=[S.createTextVNode(" 合并单元格 ",-1)])]),_:1},8,["disabled"]),S.createVNode(S.unref(_t),{onClick:a[9]||(a[9]=N=>{var M;return(M=n.editor)==null?void 0:M.chain().focus().splitCell().run()}),disabled:!((m=n.editor)!=null&&m.can().splitCell()),icon:"ri-merge-cells-vertical"},{default:S.withCtx(()=>[...a[24]||(a[24]=[S.createTextVNode(" 分割单元格 ",-1)])]),_:1},8,["disabled"]),S.createVNode(S.unref(_t),{onClick:a[10]||(a[10]=N=>{var M;return(M=n.editor)==null?void 0:M.chain().focus().mergeOrSplit().run()}),disabled:!((w=n.editor)!=null&&w.can().mergeOrSplit()),icon:"ri-merge-cells-vertical"},{default:S.withCtx(()=>[...a[25]||(a[25]=[S.createTextVNode(" 合并/分割单元格 ",-1)])]),_:1},8,["disabled"]),S.createVNode(S.unref(_t),{onClick:a[11]||(a[11]=N=>{var M;return(M=n.editor)==null?void 0:M.chain().focus().toggleHeaderRow().run()}),disabled:!((A=n.editor)!=null&&A.can().toggleHeaderRow()),icon:"ri-layout-row-fill"},{default:S.withCtx(()=>[...a[26]||(a[26]=[S.createTextVNode(" 设置/取消表头行 ",-1)])]),_:1},8,["disabled"]),S.createVNode(S.unref(_t),{onClick:a[12]||(a[12]=N=>{var M;return(M=n.editor)==null?void 0:M.chain().focus().toggleHeaderColumn().run()}),disabled:!((v=n.editor)!=null&&v.can().toggleHeaderColumn()),icon:"ri-layout-column-fill"},{default:S.withCtx(()=>[...a[27]||(a[27]=[S.createTextVNode(" 设置/取消表头列 ",-1)])]),_:1},8,["disabled"]),S.createVNode(S.unref(_t),{onClick:a[13]||(a[13]=N=>{var M;return(M=n.editor)==null?void 0:M.chain().focus().toggleHeaderCell().run()}),disabled:!((T=n.editor)!=null&&T.can().toggleHeaderCell()),icon:"ri-artboard-2-fill"},{default:S.withCtx(()=>[...a[28]||(a[28]=[S.createTextVNode(" 设置/取消表头 ",-1)])]),_:1},8,["disabled"])]}),_:1})]),default:S.withCtx(()=>[a[29]||(a[29]=S.createElementVNode("span",{style:{outline:"none",cursor:"pointer"}},[S.createElementVNode("i",{class:"ri-table-2"}),S.createElementVNode("i",{class:"ri-arrow-drop-down-line"})],-1))]),_:1},8,["disabled"])]),_:1}),S.createVNode(S.unref(Ci),{color:e.value,"onUpdate:color":a[14]||(a[14]=c=>e.value=c),desc:"表格颜色",icon:"ri-rectangle-line",disabled:!n.editable,onChangeColor:r},null,8,["color","disabled"])],64)}}}),Pc={class:"typography-editor-container"},Bc=S.defineComponent({__name:"TypographyEditor",props:{editor:{},editable:{type:Boolean}},setup(n){const t=n,e=[1,1.15,1.3,1.5,2,3];function r(i){t.editor&&t.editor.commands.setLineSpacing(i)}return(i,a)=>{var c,u,f,p,d,b,y,g;const o=S.resolveComponent("el-dropdown-item"),s=S.resolveComponent("el-dropdown-menu"),l=S.resolveComponent("el-dropdown");return S.openBlock(),S.createElementBlock("div",Pc,[S.createVNode(S.unref(lt),{type:"style",desc:"左对齐",icon:"ri-align-left",active:(c=n.editor)==null?void 0:c.isActive({textAlign:"left"}),disabled:!n.editable,onClick:a[0]||(a[0]=h=>{var m;return(m=n.editor)==null?void 0:m.chain().focus().setTextAlign("left").run()})},null,8,["active","disabled"]),S.createVNode(S.unref(lt),{type:"style",desc:"居中",icon:"ri-align-center",active:(u=n.editor)==null?void 0:u.isActive({textAlign:"center"}),disabled:!n.editable,onClick:a[1]||(a[1]=h=>{var m;return(m=n.editor)==null?void 0:m.chain().focus().setTextAlign("center").run()})},null,8,["active","disabled"]),S.createVNode(S.unref(lt),{type:"style",desc:"右对齐",icon:"ri-align-right",active:(f=n.editor)==null?void 0:f.isActive({textAlign:"right"}),disabled:!n.editable,onClick:a[2]||(a[2]=h=>{var m;return(m=n.editor)==null?void 0:m.chain().focus().setTextAlign("right").run()})},null,8,["active","disabled"]),S.createVNode(l,{trigger:"click",teleported:!1,disabled:!n.editable},{dropdown:S.withCtx(()=>[S.createVNode(s,null,{default:S.withCtx(()=>[(S.openBlock(),S.createElementBlock(S.Fragment,null,S.renderList(e,h=>{var m;return S.createVNode(o,{key:h,class:S.normalizeClass((m=n.editor)!=null&&m.isActive({lineHeight:h})?"active-spacing":""),onClick:w=>r(h)},{default:S.withCtx(()=>[S.createTextVNode(S.toDisplayString(h),1)]),_:2},1032,["class","onClick"])}),64))]),_:1})]),default:S.withCtx(()=>[S.createElementVNode("span",null,[S.createVNode(S.unref(lt),{type:"style",desc:"行距",icon:"ri-line-height",active:""})])]),_:1},8,["disabled"]),S.createVNode(S.unref(lt),{type:"style",desc:"块引用",icon:"ri-double-quotes-l",onClick:a[3]||(a[3]=h=>{var m;return(m=n.editor)==null?void 0:m.chain().focus().toggleBlockquote().run()}),active:(p=n.editor)==null?void 0:p.isActive("blockquote"),disabled:!((d=n.editor)!=null&&d.can().toggleBlockquote())||!n.editable},null,8,["active","disabled"]),S.createVNode(S.unref(lt),{type:"style",desc:"有序列表(可通过新的一行输入1. 触发)",icon:"ri-list-ordered",disabled:!n.editable,onClick:a[4]||(a[4]=h=>{var m;return(m=n.editor)==null?void 0:m.chain().focus().toggleOrderedList().run()})},null,8,["disabled"]),S.createVNode(S.unref(lt),{type:"style",desc:"无序列表(可通过新的一行输入+/-触发)",icon:"ri-list-unordered",disabled:!n.editable,onClick:a[5]||(a[5]=h=>{var m;return(m=n.editor)==null?void 0:m.chain().focus().toggleBulletList().run()})},null,8,["disabled"]),S.createVNode(S.unref(lt),{type:"style",desc:"待办事项(可通过新的一行输入[ ] 触发)",icon:"ri-list-check-3",disabled:!n.editable,onClick:a[6]||(a[6]=h=>{var m;return(m=n.editor)==null?void 0:m.chain().focus().toggleTaskList().run()})},null,8,["disabled"]),(b=n.editor)!=null&&b.can().splitListItem("listItem")?(S.openBlock(),S.createBlock(S.unref(lt),{key:0,type:"style",desc:"下方插入列表",icon:"ri-play-list-add-line",disabled:!n.editable,onClick:a[7]||(a[7]=h=>{var m;return(m=n.editor)==null?void 0:m.chain().focus().splitListItem("listItem").run()})},null,8,["disabled"])):S.createCommentVNode("",!0),(y=n.editor)!=null&&y.can().sinkListItem("listItem")?(S.openBlock(),S.createBlock(S.unref(lt),{key:1,type:"style",desc:"向右缩进列表",icon:"ri-play-list-2-fill",disabled:!n.editable,onClick:a[8]||(a[8]=h=>{var m;return(m=n.editor)==null?void 0:m.chain().focus().sinkListItem("listItem").run()})},null,8,["disabled"])):S.createCommentVNode("",!0),(g=n.editor)!=null&&g.can().liftListItem("listItem")?(S.openBlock(),S.createBlock(S.unref(lt),{key:2,type:"style",desc:"回退",icon:"ri-loop-left-fill",disabled:!n.editable,onClick:a[9]||(a[9]=h=>{var m;return(m=n.editor)==null?void 0:m.chain().focus().liftListItem("listItem").run()})},null,8,["disabled"])):S.createCommentVNode("",!0)])}}}),am="",om="",Dc=Ft(Bc,[["__scopeId","data-v-c65593c1"]]),zc={style:{outline:"none",cursor:"pointer","white-space":"nowrap"}},Uc={key:0},Hc={key:1,class:"ri-font-size"},Wc=S.defineComponent({__name:"FontSizeEditor",props:{editor:{},editable:{type:Boolean}},setup(n){const t=n,e=[{label:"初号",value:"56px"},{label:"小初",value:"48px"},{label:"一号",value:"34.7px"},{label:"小一",value:"32px"},{label:"二号",value:"29.3px"},{label:"小二",value:"24px"},{label:"三号",value:"21.3px"},{label:"小三",value:"20px"},{label:"四号",value:"18.7px"},{label:"小四",value:"16px"},{label:"五号",value:"14px"},{label:"小五",value:"12px"},{label:"六号",value:"10px"},{label:"小六",value:"8.7px"},{label:"七号",value:"7.3px"},{label:"八号",value:"6.7px"},{label:"9",value:"12px"},{label:"10",value:"13.3px"},{label:"12",value:"16px"},{label:"14",value:"18.7px"},{label:"16",value:"21.3px"},{label:"18",value:"24px"},{label:"20",value:"26.7px"},{label:"22",value:"29.3px"},{label:"24",value:"32px"},{label:"26",value:"34.7px"},{label:"28",value:"37.3px"},{label:"36",value:"48px"},{label:"48",value:"64px"}],r=S.computed(()=>{var s;const a=(s=t.editor)==null?void 0:s.getAttributes("textStyle").fontSize,o=e.find(l=>l.value===a);return o?o.label:""});function i(a){var o;(o=t.editor)==null||o.chain().focus().setFontSize(a).run()}return(a,o)=>{const s=S.resolveComponent("el-dropdown-item"),l=S.resolveComponent("el-dropdown-menu"),c=S.resolveComponent("el-dropdown");return S.openBlock(),S.createBlock(c,{"hide-timeout":300,disabled:!n.editable,"max-height":"400px"},{dropdown:S.withCtx(()=>[S.createVNode(l,null,{default:S.withCtx(()=>[(S.openBlock(),S.createElementBlock(S.Fragment,null,S.renderList(e,u=>S.createVNode(s,{key:u.value,onClick:f=>i(u.value)},{default:S.withCtx(()=>[S.createTextVNode(S.toDisplayString(u.label),1)]),_:2},1032,["onClick"])),64))]),_:1})]),default:S.withCtx(()=>[S.createElementVNode("div",zc,[r.value?(S.openBlock(),S.createElementBlock("span",Uc,S.toDisplayString(r.value),1)):(S.openBlock(),S.createElementBlock("i",Hc)),o[0]||(o[0]=S.createElementVNode("i",{class:"ri-arrow-drop-down-line"},null,-1))])]),_:1},8,["disabled"])}}}),jc={style:{outline:"none",cursor:"pointer","white-space":"nowrap"}},$c=S.defineComponent({__name:"FontFamilyEditor",props:{editor:{},editable:{type:Boolean}},setup(n){const t=n,e=[{label:"宋体",value:"SimSun"},{label:"黑体",value:"SimHei"},{label:"微软雅黑",value:"Microsoft YaHei"},{label:"仿宋",value:"FangSong"},{label:"楷体",value:"KaiTi"},{label:"无衬线(Inter)",value:"Inter"},{label:"手写风格(Comic Sans MS)",value:"Comic Sans MS"},{label:"手写风格(Comic Sans)",value:"Comic Sans"},{label:"有衬线(serif)",value:"serif"},{label:"等宽字体(monospace)",value:"monospace"},{label:"草书",value:"cursive"},{label:"新罗马字体",value:"Times New Roman"},{label:"等宽字体(Courier New)",value:"Courier New"},{label:"Arial",value:"Arial"},{label:"Helvetica",value:"Helvetica"},{label:"Verdana",value:"Verdana"},{label:"Georgia",value:"Georgia"},{label:"Palatino Linotype",value:"Palatino Linotype"},{label:"Tahoma",value:"Tahoma"},{label:"Lucida Sans",value:"Lucida Sans"},{label:"Lucida Grande",value:"Lucida Grande"}],r=S.computed(()=>{var o;const a=(o=t.editor)==null?void 0:o.getAttributes("textStyle").fontFamily;if((a==null?void 0:a.length)<20){const s=e.find(l=>l.value===a);return s?s.label:"默认字体"}else return"默认字体"});function i(a){var o;(o=t.editor)==null||o.chain().focus().setFontFamily(a).run()}return(a,o)=>{const s=S.resolveComponent("el-dropdown-item"),l=S.resolveComponent("el-dropdown-menu"),c=S.resolveComponent("el-dropdown");return S.openBlock(),S.createBlock(c,{"hide-timeout":300,disabled:!n.editable,"max-height":"300px"},{dropdown:S.withCtx(()=>[S.createVNode(l,null,{default:S.withCtx(()=>[(S.openBlock(),S.createElementBlock(S.Fragment,null,S.renderList(e,u=>S.createVNode(s,{key:u.value,onClick:f=>i(u.value),style:S.normalizeStyle({"font-family":u.value})},{default:S.withCtx(()=>[S.createTextVNode(S.toDisplayString(u.label),1)]),_:2},1032,["onClick","style"])),64))]),_:1})]),default:S.withCtx(()=>[S.createElementVNode("div",jc,[S.createElementVNode("span",null,S.toDisplayString(r.value),1),o[0]||(o[0]=S.createElementVNode("i",{class:"ri-arrow-drop-down-line"},null,-1))])]),_:1},8,["disabled"])}}}),Vc={key:0,style:{width:"100%",display:"flex","flex-direction":"column","align-items":"center","font-size":"12px"}},Zc={key:1,class:"ri-search-line",style:{cursor:"pointer"}},Xc={class:"search-popover"},Gc={key:0,class:"search-count"},Kc={class:"search-index"},Jc={key:1,class:"result-hint"},Yc={class:"action-list"},Qc=S.defineComponent({__name:"SearchPopover",props:{editor:{},editable:{type:Boolean},justIcon:{type:Boolean,default:!0}},setup(n){const t=n,e=S.ref(0),r=S.ref(-1),i=S.ref(""),a=S.ref("");S.watch(()=>i.value,p=>{p||s(!1)}),S.onBeforeUnmount(()=>{i.value="",s(!1)});function o(p){p.keyCode===13&&i.value&&s(!0)}function s(p){var b,y;if(!t.editor)return;t.editor.commands.setSearchTerm(i.value);const d=(y=(b=t.editor.extensionStorage)==null?void 0:b.searchAndReplace)==null?void 0:y.total;e.value=d||0,r.value=p?0:-1}function l(){var p,d;!t.editor||!((p=t.editor.storage.searchAndReplace)!=null&&p.canPrev)||(t.editor.commands.prevSearch(),r.value=(d=t.editor.storage.searchAndReplace)==null?void 0:d.currentIndex)}function c(){var p,d;!t.editor||!((p=t.editor.storage.searchAndReplace)!=null&&p.canNext)||(t.editor.commands.nextSearch(),r.value=(d=t.editor.storage.searchAndReplace)==null?void 0:d.currentIndex)}function u(){var d,b;if(!t.editor)return;t.editor.commands.setReplaceTerm(a.value),t.editor.commands.replace();const p=(b=(d=t.editor.extensionStorage)==null?void 0:d.searchAndReplace)==null?void 0:b.total;e.value=p||0,r.value=0}function f(){var d,b;if(!t.editor)return;t.editor.commands.setReplaceTerm(a.value),t.editor.commands.replaceAll();const p=(b=(d=t.editor.extensionStorage)==null?void 0:d.searchAndReplace)==null?void 0:b.total;e.value=p||0,r.value=0}return(p,d)=>{const b=S.resolveComponent("el-input"),y=S.resolveComponent("el-button"),g=S.resolveComponent("el-popover"),h=S.resolveComponent("el-tooltip");return S.openBlock(),S.createBlock(h,{effect:"dark",content:n.editable?"查找替换":"查找",placement:"top-start",disabled:!n.justIcon},{default:S.withCtx(()=>[S.createElementVNode("span",null,[S.createVNode(g,{trigger:"click",width:280},{reference:S.withCtx(()=>[n.justIcon?(S.openBlock(),S.createElementBlock("i",Zc)):(S.openBlock(),S.createElementBlock("div",Vc,[...d[3]||(d[3]=[S.createElementVNode("i",{class:"ri-search-line",style:{"font-size":"24px",color:"gray"}},null,-1),S.createTextVNode(" 搜索 ",-1)])]))]),default:S.withCtx(()=>[S.createElementVNode("div",Xc,[S.createVNode(b,{modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=m=>i.value=m),placeholder:"请输入搜索值",onKeydown:S.withKeys(o,["enter"])},{suffix:S.withCtx(()=>{var m,w,A,v,T,N;return[e.value>0?(S.openBlock(),S.createElementBlock("div",Gc,[S.createElementVNode("i",{class:S.normalizeClass(["ri-arrow-left-s-line",(A=(w=(m=t.editor)==null?void 0:m.storage)==null?void 0:w.searchAndReplace)!=null&&A.canPrev?"":"disabled-action"]),onClick:l},null,2),S.createElementVNode("span",Kc,S.toDisplayString(r.value+1),1),d[4]||(d[4]=S.createElementVNode("span",null,"/",-1)),S.createElementVNode("span",null,S.toDisplayString(e.value),1),S.createElementVNode("i",{class:S.normalizeClass(["ri-arrow-right-s-line",(N=(T=(v=t.editor)==null?void 0:v.storage)==null?void 0:T.searchAndReplace)!=null&&N.canNext?"":"disabled-action"]),onClick:c},null,2)])):r.value>=0?(S.openBlock(),S.createElementBlock("div",Jc,"无结果")):S.createCommentVNode("",!0)]}),_:1},8,["modelValue"]),n.editable?(S.openBlock(),S.createBlock(b,{key:0,modelValue:a.value,"onUpdate:modelValue":d[1]||(d[1]=m=>a.value=m),placeholder:"请输入替换值",onKeydown:S.withKeys(o,["enter"])},null,8,["modelValue"])):S.createCommentVNode("",!0),S.createElementVNode("div",Yc,[S.createVNode(y,{onClick:d[2]||(d[2]=()=>s(!0)),type:"primary",plain:""},{default:S.withCtx(()=>[...d[5]||(d[5]=[S.createTextVNode("搜索",-1)])]),_:1}),n.editable?(S.openBlock(),S.createBlock(y,{key:0,type:"primary",onClick:u},{default:S.withCtx(()=>[...d[6]||(d[6]=[S.createTextVNode("替换",-1)])]),_:1})):S.createCommentVNode("",!0),n.editable?(S.openBlock(),S.createBlock(y,{key:1,type:"primary",onClick:f},{default:S.withCtx(()=>[...d[7]||(d[7]=[S.createTextVNode("替换所有",-1)])]),_:1})):S.createCommentVNode("",!0)])])]),_:1})])]),_:1},8,["content","disabled"])}}}),sm="",qc=Ft(Qc,[["__scopeId","data-v-a2c0c0e3"]]),eu={class:"symbol-list"},tu=["onClick"],ru=S.defineComponent({__name:"SymbolEditor",props:{insertContent:{type:Function,required:!0}},setup(n){const t=["¥","@","#","&","*","_","$","+","-","=","|",";",":",'"',"'","<",">","/","?","~","`","!","%","^"],e=n,r=S.ref(!0);function i(a){e.insertContent(a),r.value=!0}return(a,o)=>{const s=S.resolveComponent("el-popover");return S.openBlock(),S.createBlock(s,{width:"200px",placement:"bottom-start",visible:r.value?!1:void 0},{reference:S.withCtx(()=>[S.createElementVNode("div",{onMouseover:o[0]||(o[0]=l=>r.value=!1)},[...o[1]||(o[1]=[S.createElementVNode("i",{class:"ri-omega"},null,-1),S.createElementVNode("span",{style:{"margin-left":"8px"}},"特殊符号",-1)])],32)]),default:S.withCtx(()=>[S.createElementVNode("div",eu,[(S.openBlock(),S.createElementBlock(S.Fragment,null,S.renderList(t,l=>S.createElementVNode("div",{class:"symbol-item",key:l},[S.createElementVNode("code",{onClick:()=>i(l)},S.toDisplayString(l),9,tu)])),64))])]),_:1},8,["visible"])}}}),lm="",nu=Ft(ru,[["__scopeId","data-v-5c3c319c"]]),iu=S.defineComponent({__name:"HyperlinkEditor",props:{editor:{},visible:{type:Boolean}},emits:["update:visible"],setup(n,{emit:t}){const e=n,r=t,i=S.ref(!1),a=S.reactive({text:"",href:""});S.watch(()=>e.visible,l=>{var c,u,f;if(i.value=l,l){const{from:p,to:d}=((c=e.editor)==null?void 0:c.state.selection)||{};p!==void 0&&d!==void 0&&p!==d&&(a.text=((u=e.editor)==null?void 0:u.state.doc.textBetween(p,d))||"");const b=(f=e.editor)==null?void 0:f.getAttributes("link");b!=null&&b.href&&(a.href=b.href)}}),S.watch(i,l=>{r("update:visible",l)});function o(){a.text="",a.href=""}function s(){e.editor&&(a.href&&(a.text?e.editor.chain().focus().insertContent({type:"text",text:a.text,marks:[{type:"link",attrs:{href:a.href,target:"_blank"}}]}).run():e.editor.chain().focus().setLink({href:a.href,target:"_blank"}).run()),i.value=!1,o())}return(l,c)=>{const u=S.resolveComponent("el-input"),f=S.resolveComponent("el-form-item"),p=S.resolveComponent("el-form"),d=S.resolveComponent("el-button"),b=S.resolveComponent("el-dialog");return S.openBlock(),S.createBlock(b,{modelValue:i.value,"onUpdate:modelValue":c[3]||(c[3]=y=>i.value=y),title:"插入链接",width:"400px",onClose:o},{footer:S.withCtx(()=>[S.createVNode(d,{onClick:c[2]||(c[2]=y=>i.value=!1)},{default:S.withCtx(()=>[...c[4]||(c[4]=[S.createTextVNode("取消",-1)])]),_:1}),S.createVNode(d,{type:"primary",onClick:s},{default:S.withCtx(()=>[...c[5]||(c[5]=[S.createTextVNode("确定",-1)])]),_:1})]),default:S.withCtx(()=>[S.createVNode(p,{model:a,"label-width":"80px"},{default:S.withCtx(()=>[S.createVNode(f,{label:"链接文字"},{default:S.withCtx(()=>[S.createVNode(u,{modelValue:a.text,"onUpdate:modelValue":c[0]||(c[0]=y=>a.text=y),placeholder:"请输入链接文字"},null,8,["modelValue"])]),_:1}),S.createVNode(f,{label:"链接地址"},{default:S.withCtx(()=>[S.createVNode(u,{modelValue:a.href,"onUpdate:modelValue":c[1]||(c[1]=y=>a.href=y),placeholder:"请输入链接地址"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])}}}),au=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,ou=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,su=ze.Mark.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:n=>n.getAttribute("data-color")||n.style.backgroundColor,renderHTML:n=>n.color?{"data-color":n.color,style:`background-color: ${n.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:n}){return["mark",ze.mergeAttributes(this.options.HTMLAttributes,n),0]},addCommands(){return{setHighlight:n=>({commands:t})=>t.setMark(this.name,n),toggleHighlight:n=>({commands:t})=>t.toggleMark(this.name,n),unsetHighlight:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[ze.markInputRule({find:au,type:this.type})]},addPasteRules(){return[ze.markPasteRule({find:ou,type:this.type})]}}),lu=ze.Mark.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",ze.mergeAttributes(this.options.HTMLAttributes,n),0]},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),cu=ze.Extension.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>{const t=n.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:n=>n.textAlign?{style:`text-align: ${n.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:n=>({commands:t})=>this.options.alignments.includes(n)?this.options.types.map(e=>t.updateAttributes(e,{textAlign:n})).every(e=>e):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.map(t=>n.resetAttributes(t,"textAlign")).every(t=>t),toggleTextAlign:n=>({editor:t,commands:e})=>this.options.alignments.includes(n)?t.isActive({textAlign:n})?e.unsetTextAlign():e.setTextAlign(n):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),uu=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,fu=ze.Node.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:n}){return["img",ze.mergeAttributes(this.options.HTMLAttributes,n)]},addCommands(){return{setImage:n=>({commands:t})=>t.insertContent({type:this.name,attrs:n})}},addInputRules(){return[ze.nodeInputRule({find:uu,type:this.type,getAttributes:n=>{const[,,t,e,r]=n;return{src:e,alt:t,title:r}}})]}}),du="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",hu="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Si="numeric",xi="ascii",Ti="alpha",Ur="asciinumeric",Hr="alphanumeric",Ai="domain",ro="emoji",pu="scheme",mu="slashscheme",Ri="whitespace";function gu(n,t){return n in t||(t[n]=[]),t[n]}function mr(n,t,e){t[Si]&&(t[Ur]=!0,t[Hr]=!0),t[xi]&&(t[Ur]=!0,t[Ti]=!0),t[Ur]&&(t[Hr]=!0),t[Ti]&&(t[Hr]=!0),t[Hr]&&(t[Ai]=!0),t[ro]&&(t[Ai]=!0);for(const r in t){const i=gu(r,e);i.indexOf(n)<0&&i.push(n)}}function yu(n,t){const e={};for(const r in t)t[r].indexOf(n)>=0&&(e[r]=!0);return e}function kt(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}kt.groups={},kt.prototype={accepts(){return!!this.t},go(n){const t=this,e=t.j[n];if(e)return e;for(let r=0;r<t.jr.length;r++){const i=t.jr[r][0],a=t.jr[r][1];if(a&&i.test(n))return a}return t.jd},has(n,t=!1){return t?n in this.j:!!this.go(n)},ta(n,t,e,r){for(let i=0;i<n.length;i++)this.tt(n[i],t,e,r)},tr(n,t,e,r){r=r||kt.groups;let i;return t&&t.j?i=t:(i=new kt(t),e&&r&&mr(t,e,r)),this.jr.push([n,i]),i},ts(n,t,e,r){let i=this;const a=n.length;if(!a)return i;for(let o=0;o<a-1;o++)i=i.tt(n[o]);return i.tt(n[a-1],t,e,r)},tt(n,t,e,r){r=r||kt.groups;const i=this;if(t&&t.j)return i.j[n]=t,t;const a=t;let o,s=i.go(n);if(s?(o=new kt,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new kt,a){if(r)if(o.t&&typeof o.t=="string"){const l=Object.assign(yu(o.t,r),e);mr(a,l,r)}else e&&mr(a,e,r);o.t=a}return i.j[n]=o,o}};const Ue=(n,t,e,r,i)=>n.ta(t,e,r,i),at=(n,t,e,r,i)=>n.tr(t,e,r,i),no=(n,t,e,r,i)=>n.ts(t,e,r,i),_e=(n,t,e,r,i)=>n.tt(t,e,r,i),Gt="WORD",Ni="UWORD",io="ASCIINUMERICAL",ao="ALPHANUMERICAL",Wr="LOCALHOST",Mi="TLD",Li="UTLD",mn="SCHEME",Rr="SLASH_SCHEME",Oi="NUM",Ii="WS",Fi="NL",jr="OPENBRACE",$r="CLOSEBRACE",gn="OPENBRACKET",yn="CLOSEBRACKET",bn="OPENPAREN",vn="CLOSEPAREN",wn="OPENANGLEBRACKET",_n="CLOSEANGLEBRACKET",kn="FULLWIDTHLEFTPAREN",En="FULLWIDTHRIGHTPAREN",Cn="LEFTCORNERBRACKET",Sn="RIGHTCORNERBRACKET",xn="LEFTWHITECORNERBRACKET",Tn="RIGHTWHITECORNERBRACKET",An="FULLWIDTHLESSTHAN",Rn="FULLWIDTHGREATERTHAN",Nn="AMPERSAND",Mn="APOSTROPHE",Ln="ASTERISK",er="AT",On="BACKSLASH",In="BACKTICK",Fn="CARET",tr="COLON",Pi="COMMA",Pn="DOLLAR",Wt="DOT",Bn="EQUALS",Bi="EXCLAMATION",Nt="HYPHEN",Vr="PERCENT",Dn="PIPE",zn="PLUS",Un="POUND",Zr="QUERY",Di="QUOTE",oo="FULLWIDTHMIDDLEDOT",zi="SEMI",jt="SLASH",Xr="TILDE",Hn="UNDERSCORE",so="EMOJI",Wn="SYM";var lo=Object.freeze({__proto__:null,ALPHANUMERICAL:ao,AMPERSAND:Nn,APOSTROPHE:Mn,ASCIINUMERICAL:io,ASTERISK:Ln,AT:er,BACKSLASH:On,BACKTICK:In,CARET:Fn,CLOSEANGLEBRACKET:_n,CLOSEBRACE:$r,CLOSEBRACKET:yn,CLOSEPAREN:vn,COLON:tr,COMMA:Pi,DOLLAR:Pn,DOT:Wt,EMOJI:so,EQUALS:Bn,EXCLAMATION:Bi,FULLWIDTHGREATERTHAN:Rn,FULLWIDTHLEFTPAREN:kn,FULLWIDTHLESSTHAN:An,FULLWIDTHMIDDLEDOT:oo,FULLWIDTHRIGHTPAREN:En,HYPHEN:Nt,LEFTCORNERBRACKET:Cn,LEFTWHITECORNERBRACKET:xn,LOCALHOST:Wr,NL:Fi,NUM:Oi,OPENANGLEBRACKET:wn,OPENBRACE:jr,OPENBRACKET:gn,OPENPAREN:bn,PERCENT:Vr,PIPE:Dn,PLUS:zn,POUND:Un,QUERY:Zr,QUOTE:Di,RIGHTCORNERBRACKET:Sn,RIGHTWHITECORNERBRACKET:Tn,SCHEME:mn,SEMI:zi,SLASH:jt,SLASH_SCHEME:Rr,SYM:Wn,TILDE:Xr,TLD:Mi,UNDERSCORE:Hn,UTLD:Li,UWORD:Ni,WORD:Gt,WS:Ii});const Kt=/[a-z]/,Gr=/\p{L}/u,Ui=/\p{Emoji}/u,Jt=/\d/,Hi=/\s/,co="\r",Wi=`
|
|
2
|
+
`,bu="️",vu="",ji="";let jn=null,$n=null;function wu(n=[]){const t={};kt.groups=t;const e=new kt;jn==null&&(jn=fo(du)),$n==null&&($n=fo(hu)),_e(e,"'",Mn),_e(e,"{",jr),_e(e,"}",$r),_e(e,"[",gn),_e(e,"]",yn),_e(e,"(",bn),_e(e,")",vn),_e(e,"<",wn),_e(e,">",_n),_e(e,"(",kn),_e(e,")",En),_e(e,"「",Cn),_e(e,"」",Sn),_e(e,"『",xn),_e(e,"』",Tn),_e(e,"<",An),_e(e,">",Rn),_e(e,"&",Nn),_e(e,"*",Ln),_e(e,"@",er),_e(e,"`",In),_e(e,"^",Fn),_e(e,":",tr),_e(e,",",Pi),_e(e,"$",Pn),_e(e,".",Wt),_e(e,"=",Bn),_e(e,"!",Bi),_e(e,"-",Nt),_e(e,"%",Vr),_e(e,"|",Dn),_e(e,"+",zn),_e(e,"#",Un),_e(e,"?",Zr),_e(e,'"',Di),_e(e,"/",jt),_e(e,";",zi),_e(e,"~",Xr),_e(e,"_",Hn),_e(e,"\\",On),_e(e,"・",oo);const r=at(e,Jt,Oi,{[Si]:!0});at(r,Jt,r);const i=at(r,Kt,io,{[Ur]:!0}),a=at(r,Gr,ao,{[Hr]:!0}),o=at(e,Kt,Gt,{[xi]:!0});at(o,Jt,i),at(o,Kt,o),at(i,Jt,i),at(i,Kt,i);const s=at(e,Gr,Ni,{[Ti]:!0});at(s,Kt),at(s,Jt,a),at(s,Gr,s),at(a,Jt,a),at(a,Kt),at(a,Gr,a);const l=_e(e,Wi,Fi,{[Ri]:!0}),c=_e(e,co,Ii,{[Ri]:!0}),u=at(e,Hi,Ii,{[Ri]:!0});_e(e,ji,u),_e(c,Wi,l),_e(c,ji,u),at(c,Hi,u),_e(u,co),_e(u,Wi),at(u,Hi,u),_e(u,ji,u);const f=at(e,Ui,so,{[ro]:!0});_e(f,"#"),at(f,Ui,f),_e(f,bu,f);const p=_e(f,vu);_e(p,"#"),at(p,Ui,f);const d=[[Kt,o],[Jt,i]],b=[[Kt,null],[Gr,s],[Jt,a]];for(let y=0;y<jn.length;y++)rr(e,jn[y],Mi,Gt,d);for(let y=0;y<$n.length;y++)rr(e,$n[y],Li,Ni,b);mr(Mi,{tld:!0,ascii:!0},t),mr(Li,{utld:!0,alpha:!0},t),rr(e,"file",mn,Gt,d),rr(e,"mailto",mn,Gt,d),rr(e,"http",Rr,Gt,d),rr(e,"https",Rr,Gt,d),rr(e,"ftp",Rr,Gt,d),rr(e,"ftps",Rr,Gt,d),mr(mn,{scheme:!0,ascii:!0},t),mr(Rr,{slashscheme:!0,ascii:!0},t),n=n.sort((y,g)=>y[0]>g[0]?1:-1);for(let y=0;y<n.length;y++){const g=n[y][0],m=n[y][1]?{[pu]:!0}:{[mu]:!0};g.indexOf("-")>=0?m[Ai]=!0:Kt.test(g)?Jt.test(g)?m[Ur]=!0:m[xi]=!0:m[Si]=!0,no(e,g,g,m)}return no(e,"localhost",Wr,{ascii:!0}),e.jd=new kt(Wn),{start:e,tokens:Object.assign({groups:t},lo)}}function uo(n,t){const e=_u(t.replace(/[A-Z]/g,s=>s.toLowerCase())),r=e.length,i=[];let a=0,o=0;for(;o<r;){let s=n,l=null,c=0,u=null,f=-1,p=-1;for(;o<r&&(l=s.go(e[o]));)s=l,s.accepts()?(f=0,p=0,u=s):f>=0&&(f+=e[o].length,p++),c+=e[o].length,a+=e[o].length,o++;a-=f,o-=p,c-=f,i.push({t:u.t,v:t.slice(a-c,a),s:a-c,e:a})}return i}function _u(n){const t=[],e=n.length;let r=0;for(;r<e;){let i=n.charCodeAt(r),a,o=i<55296||i>56319||r+1===e||(a=n.charCodeAt(r+1))<56320||a>57343?n[r]:n.slice(r,r+2);t.push(o),r+=o.length}return t}function rr(n,t,e,r,i){let a;const o=t.length;for(let s=0;s<o-1;s++){const l=t[s];n.j[l]?a=n.j[l]:(a=new kt(r),a.jr=i.slice(),n.j[l]=a),n=a}return a=new kt(e),a.jr=i.slice(),n.j[t[o-1]]=a,a}function fo(n){const t=[],e=[];let r=0,i="0123456789";for(;r<n.length;){let a=0;for(;i.indexOf(n[r+a])>=0;)a++;if(a>0){t.push(e.join(""));for(let o=parseInt(n.substring(r,r+a),10);o>0;o--)e.pop();r+=a}else e.push(n[r]),r++}return t}const Kr={defaultProtocol:"http",events:null,format:ho,formatHref:ho,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function $i(n,t=null){let e=Object.assign({},Kr);n&&(e=Object.assign(e,n instanceof $i?n.o:n));const r=e.ignoreTags,i=[];for(let a=0;a<r.length;a++)i.push(r[a].toUpperCase());this.o=e,t&&(this.defaultRender=t),this.ignoreTags=i}$i.prototype={o:Kr,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,t,e){const r=t!=null;let i=this.o[n];return i&&(typeof i=="object"?(i=e.t in i?i[e.t]:Kr[n],typeof i=="function"&&r&&(i=i(t,e))):typeof i=="function"&&r&&(i=i(t,e.t,e)),i)},getObj(n,t,e){let r=this.o[n];return typeof r=="function"&&t!=null&&(r=r(t,e.t,e)),r},render(n){const t=n.render(this);return(this.get("render",null,n)||this.defaultRender)(t,n.t,n)}};function ho(n){return n}function po(n,t){this.t="token",this.v=n,this.tk=t}po.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const t=this.toString(),e=n.get("truncate",t,this),r=n.get("format",t,this);return e&&r.length>e?r.substring(0,e)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=Kr.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const t=this,e=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",e,this),i=n.get("tagName",e,t),a=this.toFormattedString(n),o={},s=n.get("className",e,t),l=n.get("target",e,t),c=n.get("rel",e,t),u=n.getObj("attributes",e,t),f=n.getObj("events",e,t);return o.href=r,s&&(o.class=s),l&&(o.target=l),c&&(o.rel=c),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:f}}};function Vn(n,t){class e extends po{constructor(i,a){super(i,a),this.t=n}}for(const r in t)e.prototype[r]=t[r];return e.t=n,e}const mo=Vn("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),go=Vn("text"),ku=Vn("nl"),Zn=Vn("url",{isLink:!0,toHref(n=Kr.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Wr&&n[1].t===tr}}),Mt=n=>new kt(n);function Eu({groups:n}){const t=n.domain.concat([Nn,Ln,er,On,In,Fn,Pn,Bn,Nt,Oi,Vr,Dn,zn,Un,jt,Wn,Xr,Hn]),e=[Mn,tr,Pi,Wt,Bi,Vr,Zr,Di,zi,wn,_n,jr,$r,yn,gn,bn,vn,kn,En,Cn,Sn,xn,Tn,An,Rn],r=[Nn,Mn,Ln,On,In,Fn,Pn,Bn,Nt,jr,$r,Vr,Dn,zn,Un,Zr,jt,Wn,Xr,Hn],i=Mt(),a=_e(i,Xr);Ue(a,r,a),Ue(a,n.domain,a);const o=Mt(),s=Mt(),l=Mt();Ue(i,n.domain,o),Ue(i,n.scheme,s),Ue(i,n.slashscheme,l),Ue(o,r,a),Ue(o,n.domain,o);const c=_e(o,er);_e(a,er,c),_e(s,er,c),_e(l,er,c);const u=_e(a,Wt);Ue(u,r,a),Ue(u,n.domain,a);const f=Mt();Ue(c,n.domain,f),Ue(f,n.domain,f);const p=_e(f,Wt);Ue(p,n.domain,f);const d=Mt(mo);Ue(p,n.tld,d),Ue(p,n.utld,d),_e(c,Wr,d);const b=_e(f,Nt);_e(b,Nt,b),Ue(b,n.domain,f),Ue(d,n.domain,f),_e(d,Wt,p),_e(d,Nt,b);const y=_e(d,tr);Ue(y,n.numeric,mo);const g=_e(o,Nt),h=_e(o,Wt);_e(g,Nt,g),Ue(g,n.domain,o),Ue(h,r,a),Ue(h,n.domain,o);const m=Mt(Zn);Ue(h,n.tld,m),Ue(h,n.utld,m),Ue(m,n.domain,o),Ue(m,r,a),_e(m,Wt,h),_e(m,Nt,g),_e(m,er,c);const w=_e(m,tr),A=Mt(Zn);Ue(w,n.numeric,A);const v=Mt(Zn),T=Mt();Ue(v,t,v),Ue(v,e,T),Ue(T,t,v),Ue(T,e,T),_e(m,jt,v),_e(A,jt,v);const N=_e(s,tr),M=_e(l,tr),P=_e(M,jt),O=_e(P,jt);Ue(s,n.domain,o),_e(s,Wt,h),_e(s,Nt,g),Ue(l,n.domain,o),_e(l,Wt,h),_e(l,Nt,g),Ue(N,n.domain,v),_e(N,jt,v),_e(N,Zr,v),Ue(O,n.domain,v),Ue(O,t,v),_e(O,jt,v);const ne=[[jr,$r],[gn,yn],[bn,vn],[wn,_n],[kn,En],[Cn,Sn],[xn,Tn],[An,Rn]];for(let R=0;R<ne.length;R++){const[I,E]=ne[R],U=_e(v,I);_e(T,I,U),_e(U,E,v);const Z=Mt(Zn);Ue(U,t,Z);const $=Mt();Ue(U,e),Ue(Z,t,Z),Ue(Z,e,$),Ue($,t,Z),Ue($,e,$),_e(Z,E,v),_e($,E,v)}return _e(i,Wr,m),_e(i,Fi,ku),{start:i,tokens:lo}}function Cu(n,t,e){let r=e.length,i=0,a=[],o=[];for(;i<r;){let s=n,l=null,c=null,u=0,f=null,p=-1;for(;i<r&&!(l=s.go(e[i].t));)o.push(e[i++]);for(;i<r&&(c=l||s.go(e[i].t));)l=null,s=c,s.accepts()?(p=0,f=s):p>=0&&p++,i++,u++;if(p<0)i-=u,i<r&&(o.push(e[i]),i++);else{o.length>0&&(a.push(Vi(go,t,o)),o=[]),i-=p,u-=p;const d=f.t,b=e.slice(i-u,i);a.push(Vi(d,t,b))}}return o.length>0&&a.push(Vi(go,t,o)),a}function Vi(n,t,e){const r=e[0].s,i=e[e.length-1].e,a=t.slice(r,i);return new n(a,e)}const Su=typeof console<"u"&&console&&console.warn||(()=>{}),xu="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",et={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Tu(){return kt.groups={},et.scanner=null,et.parser=null,et.tokenQueue=[],et.pluginQueue=[],et.customSchemes=[],et.initialized=!1,et}function yo(n,t=!1){if(et.initialized&&Su(`linkifyjs: already initialized - will not register custom scheme "${n}" ${xu}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
|
|
3
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
4
|
+
2. Cannot start or end with "-"
|
|
5
|
+
3. "-" cannot repeat`);et.customSchemes.push([n,t])}function Au(){et.scanner=wu(et.customSchemes);for(let n=0;n<et.tokenQueue.length;n++)et.tokenQueue[n][1]({scanner:et.scanner});et.parser=Eu(et.scanner.tokens);for(let n=0;n<et.pluginQueue.length;n++)et.pluginQueue[n][1]({scanner:et.scanner,parser:et.parser});return et.initialized=!0,et}function Zi(n){return et.initialized||Au(),Cu(et.parser.start,n,uo(et.scanner.start,n))}Zi.scan=uo;function bo(n,t=null,e=null){if(t&&typeof t=="object"){if(e)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);e=t,t=null}const r=new $i(e),i=Zi(n),a=[];for(let o=0;o<i.length;o++){const s=i[o];s.isLink&&(!t||s.t===t)&&r.check(s)&&a.push(s.toFormattedObject(r))}return a}function vo(n,t,e){for(let r=0;;r++){if(r==n.childCount||r==t.childCount)return n.childCount==t.childCount?null:e;let i=n.child(r),a=t.child(r);if(i==a){e+=i.nodeSize;continue}if(!i.sameMarkup(a))return e;if(i.isText&&i.text!=a.text){for(let o=0;i.text[o]==a.text[o];o++)e++;return e}if(i.content.size||a.content.size){let o=vo(i.content,a.content,e+1);if(o!=null)return o}e+=i.nodeSize}}function wo(n,t,e,r){for(let i=n.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:e,b:r};let o=n.child(--i),s=t.child(--a),l=o.nodeSize;if(o==s){e-=l,r-=l;continue}if(!o.sameMarkup(s))return{a:e,b:r};if(o.isText&&o.text!=s.text){let c=0,u=Math.min(o.text.length,s.text.length);for(;c<u&&o.text[o.text.length-c-1]==s.text[s.text.length-c-1];)c++,e--,r--;return{a:e,b:r}}if(o.content.size||s.content.size){let c=wo(o.content,s.content,e-1,r-1);if(c)return c}e-=l,r-=l}}class Le{constructor(t,e){if(this.content=t,this.size=e||0,e==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,e,r,i=0,a){for(let o=0,s=0;s<e;o++){let l=this.content[o],c=s+l.nodeSize;if(c>t&&r(l,i+s,a||null,o)!==!1&&l.content.size){let u=s+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,e-u),r,i+u)}s=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,r,i){let a="",o=!0;return this.nodesBetween(t,e,(s,l)=>{let c=s.isText?s.text.slice(Math.max(t,l)-l,e-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&c||s.isTextblock)&&r&&(o?o=!1:a+=r),a+=c},0),a}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(e.isText&&e.sameMarkup(r)&&(i[i.length-1]=e.withText(e.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new Le(i,this.size+t.size)}cut(t,e=this.size){if(t==0&&e==this.size)return this;let r=[],i=0;if(e>t)for(let a=0,o=0;o<e;a++){let s=this.content[a],l=o+s.nodeSize;l>t&&((o<t||l>e)&&(s.isText?s=s.cut(Math.max(0,t-o),Math.min(s.text.length,e-o)):s=s.cut(Math.max(0,t-o-1),Math.min(s.content.size,e-o-1))),r.push(s),i+=s.nodeSize),o=l}return new Le(r,i)}cutByIndex(t,e){return t==e?Le.empty:t==0&&e==this.content.length?this:new Le(this.content.slice(t,e))}replaceChild(t,e){let r=this.content[t];if(r==e)return this;let i=this.content.slice(),a=this.size+e.nodeSize-r.nodeSize;return i[t]=e,new Le(i,a)}addToStart(t){return new Le([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Le(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,r=0;e<this.content.length;e++){let i=this.content[e];t(i,r,e),r+=i.nodeSize}}findDiffStart(t,e=0){return vo(this,t,e)}findDiffEnd(t,e=this.size,r=t.size){return wo(this,t,e,r)}findIndex(t){if(t==0)return Xn(0,t);if(t==this.size)return Xn(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let e=0,r=0;;e++){let i=this.child(e),a=r+i.nodeSize;if(a>=t)return a==t?Xn(e+1,a):Xn(e,r);r=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return Le.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new Le(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Le.empty;let e,r=0;for(let i=0;i<t.length;i++){let a=t[i];r+=a.nodeSize,i&&a.isText&&t[i-1].sameMarkup(a)?(e||(e=t.slice(0,i)),e[e.length-1]=a.withText(e[e.length-1].text+a.text)):e&&e.push(a)}return new Le(e||t,r)}static from(t){if(!t)return Le.empty;if(t instanceof Le)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Le([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Le.empty=new Le([],0);const Xi={index:0,offset:0};function Xn(n,t){return Xi.index=n,Xi.offset=t,Xi}function Gi(n,t){if(n===t)return!0;if(!(n&&typeof n=="object")||!(t&&typeof t=="object"))return!1;let e=Array.isArray(n);if(Array.isArray(t)!=e)return!1;if(e){if(n.length!=t.length)return!1;for(let r=0;r<n.length;r++)if(!Gi(n[r],t[r]))return!1}else{for(let r in n)if(!(r in t)||!Gi(n[r],t[r]))return!1;for(let r in t)if(!(r in n))return!1}return!0}class vt{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,r=!1;for(let i=0;i<t.length;i++){let a=t[i];if(this.eq(a))return t;if(this.type.excludes(a.type))e||(e=t.slice(0,i));else{if(a.type.excludes(this.type))return t;!r&&a.type.rank>this.type.rank&&(e||(e=t.slice(0,i)),e.push(this),r=!0),e&&e.push(a)}}return e||(e=t.slice()),r||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Gi(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[e.type];if(!r)throw new RangeError(`There is no mark type ${e.type} in this schema`);let i=r.create(e.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(e[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return vt.none;if(t instanceof vt)return[t];let e=t.slice();return e.sort((r,i)=>r.type.rank-i.type.rank),e}}vt.none=[];class Ru extends Error{}class Oe{constructor(t,e,r){this.content=t,this.openStart=e,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let r=ko(this.content,t+this.openStart,e);return r&&new Oe(r,this.openStart,this.openEnd)}removeBetween(t,e){return new Oe(_o(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return Oe.empty;let r=e.openStart||0,i=e.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Oe(Le.fromJSON(t,e.content),r,i)}static maxOpen(t,e=!0){let r=0,i=0;for(let a=t.firstChild;a&&!a.isLeaf&&(e||!a.type.spec.isolating);a=a.firstChild)r++;for(let a=t.lastChild;a&&!a.isLeaf&&(e||!a.type.spec.isolating);a=a.lastChild)i++;return new Oe(t,r,i)}}Oe.empty=new Oe(Le.empty,0,0);function _o(n,t,e){let{index:r,offset:i}=n.findIndex(t),a=n.maybeChild(r),{index:o,offset:s}=n.findIndex(e);if(i==t||a.isText){if(s!=e&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,t).append(n.cut(e))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,a.copy(_o(a.content,t-i-1,e-i-1)))}function ko(n,t,e,r){let{index:i,offset:a}=n.findIndex(t),o=n.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,e)?null:n.cut(0,t).append(e).append(n.cut(t));let s=ko(o.content,t-a-1,e,o);return s&&n.replaceChild(i,o.copy(s))}function Nu(n){let t=Object.create(null);for(let e in n){let r=n[e];if(!r.hasDefault)return null;t[e]=r.default}return t}function Mu(n,t){let e=Object.create(null);for(let r in n){let i=t&&t[r];if(i===void 0){let a=n[r];if(a.hasDefault)i=a.default;else throw new RangeError("No value supplied for attribute "+r)}e[r]=i}return e}function Lu(n,t,e,r){for(let i in t)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${e} of type ${i}`);for(let i in n){let a=n[i];a.validate&&a.validate(t[i])}}function Ou(n,t){let e=Object.create(null);if(t)for(let r in t)e[r]=new Fu(n,r,t[r]);return e}function Iu(n,t,e){let r=e.split("|");return i=>{let a=i===null?"null":typeof i;if(r.indexOf(a)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${n}, got ${a}`)}}class Fu{constructor(t,e,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Iu(t,e,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ki{constructor(t,e,r,i){this.name=t,this.rank=e,this.schema=r,this.spec=i,this.attrs=Ou(t,i.attrs),this.excluded=null;let a=Nu(this.attrs);this.instance=a?new vt(this,a):null}create(t=null){return!t&&this.instance?this.instance:new vt(this,Mu(this.attrs,t))}static compile(t,e){let r=Object.create(null),i=0;return t.forEach((a,o)=>r[a]=new Ki(a,i++,e,o)),r}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}checkAttrs(t){Lu(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}function Pu(n){return n.tag!=null}function Bu(n){return n.style!=null}let Du=class Ka{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let r=this.matchedStyles=[];e.forEach(i=>{if(Pu(i))this.tags.push(i);else if(Bu(i)){let a=/[^=]*/.exec(i.style)[0];r.indexOf(a)<0&&r.push(a),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let a=t.nodes[i.node];return a.contentMatch.matchType(a)})}parse(t,e={}){let r=new xo(this,e,!1);return r.addAll(t,vt.none,e.from,e.to),r.finish()}parseSlice(t,e={}){let r=new xo(this,e,!0);return r.addAll(t,vt.none,e.from,e.to),Oe.maxOpen(r.finish())}matchTag(t,e,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let a=this.tags[i];if(Hu(t,a.tag)&&(a.namespace===void 0||t.namespaceURI==a.namespace)&&(!a.context||e.matchesContext(a.context))){if(a.getAttrs){let o=a.getAttrs(t);if(o===!1)continue;a.attrs=o||void 0}return a}}}matchStyle(t,e,r,i){for(let a=i?this.styles.indexOf(i)+1:0;a<this.styles.length;a++){let o=this.styles[a],s=o.style;if(!(s.indexOf(t)!=0||o.context&&!r.matchesContext(o.context)||s.length>t.length&&(s.charCodeAt(t.length)!=61||s.slice(t.length+1)!=e))){if(o.getAttrs){let l=o.getAttrs(e);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(t){let e=[];function r(i){let a=i.priority==null?50:i.priority,o=0;for(;o<e.length;o++){let s=e[o];if((s.priority==null?50:s.priority)<a)break}e.splice(o,0,i)}for(let i in t.marks){let a=t.marks[i].spec.parseDOM;a&&a.forEach(o=>{r(o=To(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in t.nodes){let a=t.nodes[i].spec.parseDOM;a&&a.forEach(o=>{r(o=To(o)),o.node||o.ignore||o.mark||(o.node=i)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Ka(t,Ka.schemaRules(t)))}};const Eo={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},zu={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Co={ol:!0,ul:!0},Jr=1,Ji=2,Yr=4;function So(n,t,e){return t!=null?(t?Jr:0)|(t==="full"?Ji:0):n&&n.whitespace=="pre"?Jr|Ji:e&~Yr}class Gn{constructor(t,e,r,i,a,o){this.type=t,this.attrs=e,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=vt.none,this.match=a||(o&Yr?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(Le.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Jr)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let a=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let e=Le.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(Le.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Eo.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class xo{constructor(t,e,r){this.parser=t,this.options=e,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=e.topNode,a,o=So(null,e.preserveWhitespace,0)|(r?Yr:0);i?a=new Gn(i.type,i.attrs,vt.none,!0,e.topMatch||i.type.contentMatch,o):r?a=new Gn(null,null,vt.none,!0,null,o):a=new Gn(t.schema.topNodeType,null,vt.none,!0,null,o),this.nodes=[a],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){t.nodeType==3?this.addTextNode(t,e):t.nodeType==1&&this.addElement(t,e)}addTextNode(t,e){let r=t.nodeValue,i=this.top,a=i.options&Ji?"full":this.localPreserveWS||(i.options&Jr)>0,{schema:o}=this.parser;if(a==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(a)if(a==="full")r=r.replace(/\r\n?/g,`
|
|
6
|
+
`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let s=r.split(/\r?\n|\r/);for(let l=0;l<s.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),e,!0),s[l]&&this.insertNode(o.text(s[l]),e,!/\S/.test(s[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],l=t.previousSibling;(!s||l&&l.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),e,!/\S/.test(r)),this.findInText(t)}else this.findInside(t)}addElement(t,e,r){let i=this.localPreserveWS,a=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let o=t.nodeName.toLowerCase(),s;Co.hasOwnProperty(o)&&this.parser.normalizeLists&&Uu(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(s=this.parser.matchTag(t,this,r));e:if(l?l.ignore:zu.hasOwnProperty(o))this.findInside(t),this.ignoreFallback(t,e);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let c,u=this.needsBlock;if(Eo.hasOwnProperty(o))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),c=!0,a.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,e);break e}let f=l&&l.skip?e:this.readStyles(t,e);f&&this.addAll(t,f),c&&this.sync(a),this.needsBlock=u}else{let c=this.readStyles(t,e);c&&this.addElementByRule(t,l,c,l.consuming===!1?s:void 0)}this.localPreserveWS=i}leafFallback(t,e){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
7
|
+
`),e)}ignoreFallback(t,e){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),e,!0)}readStyles(t,e){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let a=this.parser.matchedStyles[i],o=r.getPropertyValue(a);if(o)for(let s=void 0;;){let l=this.parser.matchStyle(a,o,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?e=e.filter(c=>!l.clearMark(c)):e=e.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return e}addElementByRule(t,e,r,i){let a,o;if(e.node)if(o=this.parser.schema.nodes[e.node],o.isLeaf)this.insertNode(o.create(e.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let l=this.enter(o,e.attrs||null,r,e.preserveWhitespace);l&&(a=!0,r=l)}else{let l=this.parser.schema.marks[e.mark];r=r.concat(l.create(e.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=t;typeof e.contentElement=="string"?l=t.querySelector(e.contentElement):typeof e.contentElement=="function"?l=e.contentElement(t):e.contentElement&&(l=e.contentElement),this.findAround(t,l,!0),this.addAll(l,r),this.findAround(t,l,!1)}a&&this.sync(s)&&this.open--}addAll(t,e,r,i){let a=r||0;for(let o=r?t.childNodes[r]:t.firstChild,s=i==null?null:t.childNodes[i];o!=s;o=o.nextSibling,++a)this.findAtPoint(t,a),this.addDOM(o,e);this.findAtPoint(t,a)}findPlace(t,e,r){let i,a;for(let o=this.open,s=0;o>=0;o--){let l=this.nodes[o],c=l.findWrapping(t);if(c&&(!i||i.length>c.length+s)&&(i=c,a=l,!c.length))break;if(l.solid){if(r)break;s+=2}}if(!i)return null;this.sync(a);for(let o=0;o<i.length;o++)e=this.enterInner(i[o],null,e,!1);return e}insertNode(t,e,r){if(t.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(e=this.enterInner(a,null,e))}let i=this.findPlace(t,e,r);if(i){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(t.type));let o=vt.none;for(let s of i.concat(t.marks))(a.type?a.type.allowsMarkType(s.type):Ao(s.type,t.type))&&(o=s.addToSet(o));return a.content.push(t.mark(o)),!0}return!1}enter(t,e,r,i){let a=this.findPlace(t.create(e),r,!1);return a&&(a=this.enterInner(t,e,r,!0,i)),a}enterInner(t,e,r,i=!1,a){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(t);let s=So(t,a,o.options);o.options&Yr&&o.content.length==0&&(s|=Yr);let l=vt.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):Ao(c.type,t))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Gn(t,e,l,i,null,s)),this.open++,r}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let e=this.open;e>=0;e--){if(this.nodes[e]==t)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=Jr)}return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let r=this.nodes[e].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==e&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].pos==null&&t.nodeType==1&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,r){if(t!=e&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&e.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),a=-(r?r.depth+1:0)+(i?0:1),o=(s,l)=>{for(;s>=0;s--){let c=e[s];if(c==""){if(s==e.length-1||s==0)continue;for(;l>=a;l--)if(o(s-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=a?r.node(l-a).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return o(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let r=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let e in this.parser.schema.nodes){let r=this.parser.schema.nodes[e];if(r.isTextblock&&r.defaultAttrs)return r}}}function Uu(n){for(let t=n.firstChild,e=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&Co.hasOwnProperty(r)&&e?(e.appendChild(t),t=e):r=="li"?e=t:r&&(e=null)}}function Hu(n,t){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,t)}function To(n){let t={};for(let e in n)t[e]=n[e];return t}function Ao(n,t){let e=t.schema.nodes;for(let r in e){let i=e[r];if(!i.allowsMarkType(n))continue;let a=[],o=s=>{a.push(s);for(let l=0;l<s.edgeCount;l++){let{type:c,next:u}=s.edge(l);if(c==t||a.indexOf(u)<0&&o(u))return!0}};if(o(i.contentMatch))return!0}}class Kn{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},r){r||(r=Yi(e).createDocumentFragment());let i=r,a=[];return t.forEach(o=>{if(a.length||o.marks.length){let s=0,l=0;for(;s<a.length&&l<o.marks.length;){let c=o.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(a[s][0])||c.type.spec.spanning===!1)break;s++,l++}for(;s<a.length;)i=a.pop()[1];for(;l<o.marks.length;){let c=o.marks[l++],u=this.serializeMark(c,o.isInline,e);u&&(a.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(o,e))}),r}serializeNodeInner(t,e){let{dom:r,contentDOM:i}=Jn(Yi(e),this.nodes[t.type.name](t),null,t.attrs);if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,i)}return r}serializeNode(t,e={}){let r=this.serializeNodeInner(t,e);for(let i=t.marks.length-1;i>=0;i--){let a=this.serializeMark(t.marks[i],t.isInline,e);a&&((a.contentDOM||a.dom).appendChild(r),r=a.dom)}return r}serializeMark(t,e,r={}){let i=this.marks[t.type.name];return i&&Jn(Yi(r),i(t,e),null,t.attrs)}static renderSpec(t,e,r=null,i){return Jn(t,e,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Kn(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=Ro(t.nodes);return e.text||(e.text=r=>r.text),e}static marksFromSchema(t){return Ro(t.marks)}}function Ro(n){let t={};for(let e in n){let r=n[e].spec.toDOM;r&&(t[e]=r)}return t}function Yi(n){return n.document||window.document}const No=new WeakMap;function Wu(n){let t=No.get(n);return t===void 0&&No.set(n,t=ju(n)),t}function ju(n){let t=null;function e(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i<r.length;i++)e(r[i]);else for(let i in r)e(r[i])}return e(n),t}function Jn(n,t,e,r){if(typeof t=="string")return{dom:n.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(a=Wu(r))&&a.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(e=i.slice(0,o),i=i.slice(o+1));let s,l=e?n.createElementNS(e,i):n.createElement(i),c=t[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let f in c)if(c[f]!=null){let p=f.indexOf(" ");p>0?l.setAttributeNS(f.slice(0,p),f.slice(p+1),c[f]):f=="style"&&l.style?l.style.cssText=c[f]:l.setAttribute(f,c[f])}}for(let f=u;f<t.length;f++){let p=t[f];if(p===0){if(f<t.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:d,contentDOM:b}=Jn(n,p,e,r);if(l.appendChild(d),b){if(s)throw new RangeError("Multiple content holes");s=b}}}return{dom:l,contentDOM:s}}const Mo=65535,Lo=Math.pow(2,16);function $u(n,t){return n+t*Lo}function Oo(n){return n&Mo}function Vu(n){return(n-(n&Mo))/Lo}const Io=1,Fo=2,Yn=4,Po=8;class Qi{constructor(t,e,r){this.pos=t,this.delInfo=e,this.recover=r}get deleted(){return(this.delInfo&Po)>0}get deletedBefore(){return(this.delInfo&(Io|Yn))>0}get deletedAfter(){return(this.delInfo&(Fo|Yn))>0}get deletedAcross(){return(this.delInfo&Yn)>0}}class Ct{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&Ct.empty)return Ct.empty}recover(t){let e=0,r=Oo(t);if(!this.inverted)for(let i=0;i<r;i++)e+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+e+Vu(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,r){let i=0,a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?i:0);if(l>t)break;let c=this.ranges[s+a],u=this.ranges[s+o],f=l+c;if(t<=f){let p=c?t==l?-1:t==f?1:e:e,d=l+i+(p<0?0:u);if(r)return d;let b=t==(e<0?l:f)?null:$u(s/3,t-l),y=t==l?Fo:t==f?Io:Yn;return(e<0?t!=l:t!=f)&&(y|=Po),new Qi(d,y,b)}i+=u-c}return r?t+i:new Qi(t+i,0,null)}touches(t,e){let r=0,i=Oo(e),a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>t)break;let c=this.ranges[s+a],u=l+c;if(t<=u&&s==i*3)return!0;r+=this.ranges[s+o]-c}return!1}forEach(t){let e=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,a=0;i<this.ranges.length;i+=3){let o=this.ranges[i],s=o-(this.inverted?a:0),l=o+(this.inverted?0:a),c=this.ranges[i+e],u=this.ranges[i+r];t(s,s+c,l,l+u),a+=u-c}}invert(){return new Ct(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Ct.empty:new Ct(t<0?[0,-t,0]:[0,0,t])}}Ct.empty=new Ct([]);class Qn{constructor(t,e,r=0,i=t?t.length:0){this.mirror=e,this.from=r,this.to=i,this._maps=t||[],this.ownData=!(t||e)}get maps(){return this._maps}slice(t=0,e=this.maps.length){return new Qn(this._maps,this.mirror,t,e)}appendMap(t,e){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),e!=null&&this.setMirror(this._maps.length-1,e)}appendMapping(t){for(let e=0,r=this._maps.length;e<t._maps.length;e++){let i=t.getMirror(e);this.appendMap(t._maps[e],i!=null&&i<e?r+i:void 0)}}getMirror(t){if(this.mirror){for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,r=this._maps.length+t._maps.length;e>=0;e--){let i=t.getMirror(e);this.appendMap(t._maps[e].invert(),i!=null&&i>e?r-i-1:void 0)}}invert(){let t=new Qn;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let r=this.from;r<this.to;r++)t=this._maps[r].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,r){let i=0;for(let a=this.from;a<this.to;a++){let o=this._maps[a],s=o.mapResult(t,e);if(s.recover!=null){let l=this.getMirror(a);if(l!=null&&l>a&&l<this.to){a=l,t=this._maps[l].recover(s.recover);continue}}i|=s.delInfo,t=s.pos}return r?t:new Qi(t,i,null)}}const qi=Object.create(null);class gt{getMap(){return Ct.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=qi[e.stepType];if(!r)throw new RangeError(`No step type ${e.stepType} defined`);return r.fromJSON(t,e)}static jsonID(t,e){if(t in qi)throw new RangeError("Duplicate use of step JSON ID "+t);return qi[t]=e,e.prototype.jsonID=t,e}}class ct{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new ct(t,null)}static fail(t){return new ct(null,t)}static fromReplace(t,e,r,i){try{return ct.ok(t.replace(e,r,i))}catch(a){if(a instanceof Ru)return ct.fail(a.message);throw a}}}function ea(n,t,e){let r=[];for(let i=0;i<n.childCount;i++){let a=n.child(i);a.content.size&&(a=a.copy(ea(a.content,t,a))),a.isInline&&(a=t(a,e,i)),r.push(a)}return Le.fromArray(r)}class nr extends gt{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(t){let e=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),a=new Oe(ea(e.content,(o,s)=>!o.isAtom||!s.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),e.openStart,e.openEnd);return ct.fromReplace(t,this.from,this.to,a)}invert(){return new $t(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new nr(e.pos,r.pos,this.mark)}merge(t){return t instanceof nr&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new nr(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new nr(e.from,e.to,t.markFromJSON(e.mark))}}gt.jsonID("addMark",nr);class $t extends gt{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(t){let e=t.slice(this.from,this.to),r=new Oe(ea(e.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),e.openStart,e.openEnd);return ct.fromReplace(t,this.from,this.to,r)}invert(){return new nr(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new $t(e.pos,r.pos,this.mark)}merge(t){return t instanceof $t&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new $t(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new $t(e.from,e.to,t.markFromJSON(e.mark))}}gt.jsonID("removeMark",$t);class ir extends gt{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return ct.fail("No node at mark step's position");let r=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return ct.fromReplace(t,this.pos,this.pos+1,new Oe(Le.from(r),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let r=this.mark.addToSet(e.marks);if(r.length==e.marks.length){for(let i=0;i<e.marks.length;i++)if(!e.marks[i].isInSet(r))return new ir(this.pos,e.marks[i]);return new ir(this.pos,this.mark)}}return new gr(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new ir(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ir(e.pos,t.markFromJSON(e.mark))}}gt.jsonID("addNodeMark",ir);class gr extends gt{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return ct.fail("No node at mark step's position");let r=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return ct.fromReplace(t,this.pos,this.pos+1,new Oe(Le.from(r),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return!e||!this.mark.isInSet(e.marks)?this:new ir(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new gr(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new gr(e.pos,t.markFromJSON(e.mark))}}gt.jsonID("removeNodeMark",gr);class yt extends gt{constructor(t,e,r,i=!1){super(),this.from=t,this.to=e,this.slice=r,this.structure=i}apply(t){return this.structure&&ta(t,this.from,this.to)?ct.fail("Structure replace would overwrite content"):ct.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Ct([this.from,this.to-this.from,this.slice.size])}invert(t){return new yt(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deletedAcross&&r.deletedAcross?null:new yt(e.pos,Math.max(e.pos,r.pos),this.slice,this.structure)}merge(t){if(!(t instanceof yt)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let e=this.slice.size+t.slice.size==0?Oe.empty:new Oe(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new yt(this.from,this.to+(t.to-t.from),e,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let e=this.slice.size+t.slice.size==0?Oe.empty:new Oe(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new yt(t.from,this.to,e,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new yt(e.from,e.to,Oe.fromJSON(t,e.slice),!!e.structure)}}gt.jsonID("replace",yt);class Pt extends gt{constructor(t,e,r,i,a,o,s=!1){super(),this.from=t,this.to=e,this.gapFrom=r,this.gapTo=i,this.slice=a,this.insert=o,this.structure=s}apply(t){if(this.structure&&(ta(t,this.from,this.gapFrom)||ta(t,this.gapTo,this.to)))return ct.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return ct.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,e.content);return r?ct.fromReplace(t,this.from,this.to,r):ct.fail("Content does not fit in gap")}getMap(){return new Ct([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new Pt(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return e.deletedAcross&&r.deletedAcross||i<e.pos||a>r.pos?null:new Pt(e.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number"||typeof e.gapFrom!="number"||typeof e.gapTo!="number"||typeof e.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Pt(e.from,e.to,e.gapFrom,e.gapTo,Oe.fromJSON(t,e.slice),e.insert,!!e.structure)}}gt.jsonID("replaceAround",Pt);function ta(n,t,e){let r=n.resolve(t),i=e-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let o=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Zu(n,t,e,r){let i=[],a=[],o,s;n.doc.nodesBetween(t,e,(l,c,u)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let p=Math.max(c,t),d=Math.min(c+l.nodeSize,e),b=r.addToSet(f);for(let y=0;y<f.length;y++)f[y].isInSet(b)||(o&&o.to==p&&o.mark.eq(f[y])?o.to=d:i.push(o=new $t(p,d,f[y])));s&&s.to==p?s.to=d:a.push(s=new nr(p,d,r))}}),i.forEach(l=>n.step(l)),a.forEach(l=>n.step(l))}function Xu(n,t,e,r){let i=[],a=0;n.doc.nodesBetween(t,e,(o,s)=>{if(!o.isInline)return;a++;let l=null;if(r instanceof Ki){let c=o.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let c=Math.min(s+o.nodeSize,e);for(let u=0;u<l.length;u++){let f=l[u],p;for(let d=0;d<i.length;d++){let b=i[d];b.step==a-1&&f.eq(i[d].style)&&(p=b)}p?(p.to=c,p.step=a):i.push({style:f,from:Math.max(s,t),to:c,step:a})}}}),i.forEach(o=>n.step(new $t(o.from,o.to,o.style)))}function ra(n,t,e,r=e.contentMatch,i=!0){let a=n.doc.nodeAt(t),o=[],s=t+1;for(let l=0;l<a.childCount;l++){let c=a.child(l),u=s+c.nodeSize,f=r.matchType(c.type);if(!f)o.push(new yt(s,u,Oe.empty));else{r=f;for(let p=0;p<c.marks.length;p++)e.allowsMarkType(c.marks[p].type)||n.step(new $t(s,u,c.marks[p]));if(i&&c.isText&&e.whitespace!="pre"){let p,d=/\r?\n|\r/g,b;for(;p=d.exec(c.text);)b||(b=new Oe(Le.from(e.schema.text(" ",e.allowedMarks(c.marks))),0,0)),o.push(new yt(s+p.index,s+p.index+p[0].length,b))}}s=u}if(!r.validEnd){let l=r.fillBefore(Le.empty,!0);n.replace(s,s,new Oe(l,0,0))}for(let l=o.length-1;l>=0;l--)n.step(o[l])}function Gu(n,t,e){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),l=o,c=s,u=Le.empty,f=0;for(let b=a,y=!1;b>e;b--)y||r.index(b)>0?(y=!0,u=Le.from(r.node(b).copy(u)),f++):l--;let p=Le.empty,d=0;for(let b=a,y=!1;b>e;b--)y||i.after(b+1)<i.end(b)?(y=!0,p=Le.from(i.node(b).copy(p)),d++):c++;n.step(new Pt(l,c,o,s,new Oe(u.append(p),f,d),u.size-f,!0))}function Ku(n,t,e){let r=Le.empty;for(let o=e.length-1;o>=0;o--){if(r.size){let s=e[o].type.contentMatch.matchFragment(r);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Le.from(e[o].type.create(e[o].attrs,r))}let i=t.start,a=t.end;n.step(new Pt(i,a,i,a,new Oe(r,0,0),e.length,!0))}function Ju(n,t,e,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=n.steps.length;n.doc.nodesBetween(t,e,(o,s)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&Yu(n.doc,n.mapping.slice(a).map(s),r)){let c=null;if(r.schema.linebreakReplacement){let d=r.whitespace=="pre",b=!!r.contentMatch.matchType(r.schema.linebreakReplacement);d&&!b?c=!1:!d&&b&&(c=!0)}c===!1&&Do(n,o,s,a),ra(n,n.mapping.slice(a).map(s,1),r,void 0,c===null);let u=n.mapping.slice(a),f=u.map(s,1),p=u.map(s+o.nodeSize,1);return n.step(new Pt(f,p,f+1,p-1,new Oe(Le.from(r.create(l,null,o.marks)),0,0),1,!0)),c===!0&&Bo(n,o,s,a),!1}})}function Bo(n,t,e,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let l=n.mapping.slice(r).map(e+1+a+o.index);n.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function Do(n,t,e,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(e+1+a);n.replaceWith(o,o+1,t.type.schema.text(`
|
|
8
|
+
`))}})}function Yu(n,t,e){let r=n.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,e)}function Qu(n,t,e,r,i){let a=n.doc.nodeAt(t);if(!a)throw new RangeError("No node at given position");e||(e=a.type);let o=e.create(r,null,i||a.marks);if(a.isLeaf)return n.replaceWith(t,t+a.nodeSize,o);if(!e.validContent(a.content))throw new RangeError("Invalid content for node type "+e.name);n.step(new Pt(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new Oe(Le.from(o),0,0),1,!0))}function qu(n,t,e=1,r){let i=n.doc.resolve(t),a=Le.empty,o=Le.empty;for(let s=i.depth,l=i.depth-e,c=e-1;s>l;s--,c--){a=Le.from(i.node(s).copy(a));let u=r&&r[c];o=Le.from(u?u.type.create(u.attrs,o):i.node(s).copy(o))}n.step(new yt(t,t,new Oe(a.append(o),e,e),!0))}function ef(n,t,e){let r=null,{linebreakReplacement:i}=n.doc.type.schema,a=n.doc.resolve(t-e),o=a.node().type;if(i&&o.inlineContent){let u=o.whitespace=="pre",f=!!o.contentMatch.matchType(i);u&&!f?r=!1:!u&&f&&(r=!0)}let s=n.steps.length;if(r===!1){let u=n.doc.resolve(t+e);Do(n,u.node(),u.before(),s)}o.inlineContent&&ra(n,t+e-1,o,a.node().contentMatchAt(a.index()),r==null);let l=n.mapping.slice(s),c=l.map(t-e);if(n.step(new yt(c,l.map(t+e,-1),Oe.empty,!0)),r===!0){let u=n.doc.resolve(c);Bo(n,u.node(),u.before(),n.steps.length)}return n}function tf(n,t,e){let r=n.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),e))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let a=r.index(i);if(r.node(i).canReplaceWith(a,a,e))return r.before(i+1);if(a>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let a=r.indexAfter(i);if(r.node(i).canReplaceWith(a,a,e))return r.after(i+1);if(a<r.node(i).childCount)return null}return null}function rf(n,t,e){let r=n.resolve(t);if(!e.content.size)return t;let i=e.content;for(let a=0;a<e.openStart;a++)i=i.firstChild.content;for(let a=1;a<=(e.openStart==0&&e.size?2:1);a++)for(let o=r.depth;o>=0;o--){let s=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(s>0?1:0),c=r.node(o),u=!1;if(a==1)u=c.canReplace(l,l,i);else{let f=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=f&&c.canReplaceWith(l,l,f[0])}if(u)return s==0?r.pos:s<0?r.before(o+1):r.after(o+1)}return null}function nf(n,t,e=t,r=Oe.empty){if(t==e&&!r.size)return null;let i=n.resolve(t),a=n.resolve(e);return zo(i,a,r)?new yt(t,e,r):new af(i,a,r).fit()}function zo(n,t,e){return!e.openStart&&!e.openEnd&&n.start()==t.start()&&n.parent.canReplace(n.index(),t.index(),e.content)}class af{constructor(t,e,r){this.$from=t,this.$to=e,this.unplaced=r,this.frontier=[],this.placed=Le.empty;for(let i=0;i<=t.depth;i++){let a=t.node(i);this.frontier.push({type:a.type,match:a.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=Le.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let a=this.placed,o=r.depth,s=i.depth;for(;o&&s&&a.childCount==1;)a=a.firstChild.content,o--,s--;let l=new Oe(a,o,s);return t>-1?new Pt(r.pos,t,this.$to.pos,this.$to.end(),l,e):l.size||r.pos!=this.$to.pos?new yt(r.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let a=e.firstChild;if(e.childCount>1&&(i=0),a.type.spec.isolating&&i<=r){t=r;break}e=a.content}for(let e=1;e<=2;e++)for(let r=e==1?t:this.unplaced.openStart;r>=0;r--){let i,a=null;r?(a=na(this.unplaced.content,r-1).firstChild,i=a.content):i=this.unplaced.content;let o=i.firstChild;for(let s=this.depth;s>=0;s--){let{type:l,match:c}=this.frontier[s],u,f=null;if(e==1&&(o?c.matchType(o.type)||(f=c.fillBefore(Le.from(o),!1)):a&&l.compatibleContent(a.type)))return{sliceDepth:r,frontierDepth:s,parent:a,inject:f};if(e==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:s,parent:a,wrap:u};if(a&&c.matchType(a.type))break}}}openMore(){let{content:t,openStart:e,openEnd:r}=this.unplaced,i=na(t,e);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Oe(t,e+1,Math.max(r,i.size+e>=t.size-r?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:r}=this.unplaced,i=na(t,e);if(i.childCount<=1&&e>0){let a=t.size-e<=e+i.size;this.unplaced=new Oe(Qr(t,e-1,1),e-1,a?e-1:r)}else this.unplaced=new Oe(Qr(t,e,1),e,r)}placeNodes({sliceDepth:t,frontierDepth:e,parent:r,inject:i,wrap:a}){for(;this.depth>e;)this.closeFrontierNode();if(a)for(let y=0;y<a.length;y++)this.openFrontierNode(a[y]);let o=this.unplaced,s=r?r.content:o.content,l=o.openStart-t,c=0,u=[],{match:f,type:p}=this.frontier[e];if(i){for(let y=0;y<i.childCount;y++)u.push(i.child(y));f=f.matchFragment(i)}let d=s.size+t-(o.content.size-o.openEnd);for(;c<s.childCount;){let y=s.child(c),g=f.matchType(y.type);if(!g)break;c++,(c>1||l==0||y.content.size)&&(f=g,u.push(Uo(y.mark(p.allowedMarks(y.marks)),c==1?l:0,c==s.childCount?d:-1)))}let b=c==s.childCount;b||(d=-1),this.placed=qr(this.placed,e,Le.from(u)),this.frontier[e].match=f,b&&d<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let y=0,g=s;y<d;y++){let h=g.lastChild;this.frontier.push({type:h.type,match:h.contentMatchAt(h.childCount)}),g=h.content}this.unplaced=b?t==0?Oe.empty:new Oe(Qr(o.content,t-1,1),t-1,d<0?o.openEnd:t-1):new Oe(Qr(o.content,t,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],e;if(!t.type.isTextblock||!ia(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:r,type:i}=this.frontier[e],a=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),o=ia(t,e,i,r,a);if(o){for(let s=e-1;s>=0;s--){let{match:l,type:c}=this.frontier[s],u=ia(t,s,c,l,!0);if(!u||u.childCount)continue e}return{depth:e,fit:o,move:a?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=qr(this.placed,e.depth,e.fit)),t=e.move;for(let r=e.depth+1;r<=t.depth;r++){let i=t.node(r),a=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,a)}return t}openFrontierNode(t,e=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=qr(this.placed,this.depth,Le.from(t.create(e,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(Le.empty,!0);e.childCount&&(this.placed=qr(this.placed,this.frontier.length,e))}}function Qr(n,t,e){return t==0?n.cutByIndex(e,n.childCount):n.replaceChild(0,n.firstChild.copy(Qr(n.firstChild.content,t-1,e)))}function qr(n,t,e){return t==0?n.append(e):n.replaceChild(n.childCount-1,n.lastChild.copy(qr(n.lastChild.content,t-1,e)))}function na(n,t){for(let e=0;e<t;e++)n=n.firstChild.content;return n}function Uo(n,t,e){if(t<=0)return n;let r=n.content;return t>1&&(r=r.replaceChild(0,Uo(r.firstChild,t-1,r.childCount==1?e-1:0))),t>0&&(r=n.type.contentMatch.fillBefore(r).append(r),e<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(Le.empty,!0)))),n.copy(r)}function ia(n,t,e,r,i){let a=n.node(t),o=i?n.indexAfter(t):n.index(t);if(o==a.childCount&&!e.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!of(e,a.content,o)?s:null}function of(n,t,e){for(let r=e;r<t.childCount;r++)if(!n.allowsMarks(t.child(r).marks))return!0;return!1}function sf(n){return n.spec.defining||n.spec.definingForContent}function lf(n,t,e,r){if(!r.size)return n.deleteRange(t,e);let i=n.doc.resolve(t),a=n.doc.resolve(e);if(zo(i,a,r))return n.step(new yt(t,e,r));let o=Wo(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let p=i.depth,d=i.pos-1;p>0;p--,d--){let b=i.node(p).type.spec;if(b.defining||b.definingAsContext||b.isolating)break;o.indexOf(p)>-1?s=p:i.before(p)==d&&o.splice(1,0,-p)}let l=o.indexOf(s),c=[],u=r.openStart;for(let p=r.content,d=0;;d++){let b=p.firstChild;if(c.push(b),d==r.openStart)break;p=b.content}for(let p=u-1;p>=0;p--){let d=c[p],b=sf(d.type);if(b&&!d.sameMarkup(i.node(Math.abs(s)-1)))u=p;else if(b||!d.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let d=(p+u+1)%(r.openStart+1),b=c[d];if(b)for(let y=0;y<o.length;y++){let g=o[(y+l)%o.length],h=!0;g<0&&(h=!1,g=-g);let m=i.node(g-1),w=i.index(g-1);if(m.canReplaceWith(w,w,b.type,b.marks))return n.replace(i.before(g),h?a.after(g):e,new Oe(Ho(r.content,0,r.openStart,d),d,r.openEnd))}}let f=n.steps.length;for(let p=o.length-1;p>=0&&(n.replace(t,e,r),!(n.steps.length>f));p--){let d=o[p];d<0||(t=i.before(d),e=a.after(d))}}function Ho(n,t,e,r,i){if(t<e){let a=n.firstChild;n=n.replaceChild(0,a.copy(Ho(a.content,t+1,e,r,a)))}if(t>r){let a=i.contentMatchAt(0),o=a.fillBefore(n).append(n);n=o.append(a.matchFragment(o).fillBefore(Le.empty,!0))}return n}function cf(n,t,e,r){if(!r.isInline&&t==e&&n.doc.resolve(t).parent.content.size){let i=tf(n.doc,t,r.type);i!=null&&(t=e=i)}n.replaceRange(t,e,new Oe(Le.from(r),0,0))}function uf(n,t,e){let r=n.doc.resolve(t),i=n.doc.resolve(e),a=Wo(r,i);for(let o=0;o<a.length;o++){let s=a[o],l=o==a.length-1;if(l&&s==0||r.node(s).type.contentMatch.validEnd)return n.delete(r.start(s),i.end(s));if(s>0&&(l||r.node(s-1).canReplace(r.index(s-1),i.indexAfter(s-1))))return n.delete(r.before(s),i.after(s))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&e>r.end(o)&&i.end(o)-e!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return n.delete(r.before(o),e);n.delete(t,e)}function Wo(n,t){let e=[],r=Math.min(n.depth,t.depth);for(let i=r;i>=0;i--){let a=n.start(i);if(a<n.pos-(n.depth-i)||t.end(i)>t.pos+(t.depth-i)||n.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(a==t.start(i)||i==n.depth&&i==t.depth&&n.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==a-1)&&e.push(i)}return e}class Nr extends gt{constructor(t,e,r){super(),this.pos=t,this.attr=e,this.value=r}apply(t){let e=t.nodeAt(this.pos);if(!e)return ct.fail("No node at attribute step's position");let r=Object.create(null);for(let a in e.attrs)r[a]=e.attrs[a];r[this.attr]=this.value;let i=e.type.create(r,null,e.marks);return ct.fromReplace(t,this.pos,this.pos+1,new Oe(Le.from(i),0,e.isLeaf?0:1))}getMap(){return Ct.empty}invert(t){return new Nr(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Nr(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if(typeof e.pos!="number"||typeof e.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Nr(e.pos,e.attr,e.value)}}gt.jsonID("attr",Nr);class en extends gt{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let i in t.attrs)e[i]=t.attrs[i];e[this.attr]=this.value;let r=t.type.create(e,t.content,t.marks);return ct.ok(r)}getMap(){return Ct.empty}invert(t){return new en(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if(typeof e.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new en(e.attr,e.value)}}gt.jsonID("docAttr",en);let Mr=class extends Error{};Mr=function n(t){let e=Error.call(this,t);return e.__proto__=n.prototype,e},Mr.prototype=Object.create(Error.prototype),Mr.prototype.constructor=Mr,Mr.prototype.name="TransformError";class ff{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Qn}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Mr(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,r=Oe.empty){let i=nf(this.doc,t,e,r);return i&&this.step(i),this}replaceWith(t,e,r){return this.replace(t,e,new Oe(Le.from(r),0,0))}delete(t,e){return this.replace(t,e,Oe.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,r){return lf(this,t,e,r),this}replaceRangeWith(t,e,r){return cf(this,t,e,r),this}deleteRange(t,e){return uf(this,t,e),this}lift(t,e){return Gu(this,t,e),this}join(t,e=1){return ef(this,t,e),this}wrap(t,e){return Ku(this,t,e),this}setBlockType(t,e=t,r,i=null){return Ju(this,t,e,r,i),this}setNodeMarkup(t,e,r=null,i){return Qu(this,t,e,r,i),this}setNodeAttribute(t,e,r){return this.step(new Nr(t,e,r)),this}setDocAttribute(t,e){return this.step(new en(t,e)),this}addNodeMark(t,e){return this.step(new ir(t,e)),this}removeNodeMark(t,e){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(e instanceof vt)e.isInSet(r.marks)&&this.step(new gr(t,e));else{let i=r.marks,a,o=[];for(;a=e.isInSet(i);)o.push(new gr(t,a)),i=a.removeFromSet(i);for(let s=o.length-1;s>=0;s--)this.step(o[s])}return this}split(t,e=1,r){return qu(this,t,e,r),this}addMark(t,e,r){return Zu(this,t,e,r),this}removeMark(t,e,r){return Xu(this,t,e,r),this}clearIncompatible(t,e,r){return ra(this,t,e,r),this}}const aa=Object.create(null);class Xe{constructor(t,e,r){this.$anchor=t,this.$head=e,this.ranges=r||[new jo(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=Oe.empty){let r=e.content.lastChild,i=null;for(let s=0;s<e.openEnd;s++)i=r,r=r.lastChild;let a=t.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:l,$to:c}=o[s],u=t.mapping.slice(a);t.replaceRange(u.map(l.pos),u.map(c.pos),s?Oe.empty:e),s==0&&Zo(t,a,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,e){let r=t.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){let{$from:o,$to:s}=i[a],l=t.mapping.slice(r),c=l.map(o.pos),u=l.map(s.pos);a?t.deleteRange(c,u):(t.replaceRangeWith(c,u,e),Zo(t,r,e.isInline?-1:1))}}static findFrom(t,e,r=!1){let i=t.parent.inlineContent?new Je(t):Lr(t.node(0),t.parent,t.pos,t.index(),e,r);if(i)return i;for(let a=t.depth-1;a>=0;a--){let o=e<0?Lr(t.node(0),t.node(a),t.before(a+1),t.index(a),e,r):Lr(t.node(0),t.node(a),t.after(a+1),t.index(a)+1,e,r);if(o)return o}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new Vt(t.node(0))}static atStart(t){return Lr(t,t,0,0,1)||new Vt(t)}static atEnd(t){return Lr(t,t,t.content.size,t.childCount,-1)||new Vt(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=aa[e.type];if(!r)throw new RangeError(`No selection type ${e.type} defined`);return r.fromJSON(t,e)}static jsonID(t,e){if(t in aa)throw new RangeError("Duplicate use of selection JSON ID "+t);return aa[t]=e,e.prototype.jsonID=t,e}getBookmark(){return Je.between(this.$anchor,this.$head).getBookmark()}}Xe.prototype.visible=!0;class jo{constructor(t,e){this.$from=t,this.$to=e}}let $o=!1;function Vo(n){!$o&&!n.parent.inlineContent&&($o=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class Je extends Xe{constructor(t,e=t){Vo(t),Vo(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let r=t.resolve(e.map(this.head));if(!r.parent.inlineContent)return Xe.near(r);let i=t.resolve(e.map(this.anchor));return new Je(i.parent.inlineContent?i:r,r)}replace(t,e=Oe.empty){if(super.replace(t,e),e==Oe.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Je&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new qn(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if(typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Je(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,r=e){let i=t.resolve(e);return new this(i,r==e?i:t.resolve(r))}static between(t,e,r){let i=t.pos-e.pos;if((!r||i)&&(r=i>=0?1:-1),!e.parent.inlineContent){let a=Xe.findFrom(e,r,!0)||Xe.findFrom(e,-r,!0);if(a)e=a.$head;else return Xe.near(e,r)}return t.parent.inlineContent||(i==0?t=e:(t=(Xe.findFrom(t,-r,!0)||Xe.findFrom(t,r,!0)).$anchor,t.pos<e.pos!=i<0&&(t=e))),new Je(t,e)}}Xe.jsonID("text",Je);class qn{constructor(t,e){this.anchor=t,this.head=e}map(t){return new qn(t.map(this.anchor),t.map(this.head))}resolve(t){return Je.between(t.resolve(this.anchor),t.resolve(this.head))}}class Ze extends Xe{constructor(t){let e=t.nodeAfter,r=t.node(0).resolve(t.pos+e.nodeSize);super(t,r),this.node=e}map(t,e){let{deleted:r,pos:i}=e.mapResult(this.anchor),a=t.resolve(i);return r?Xe.near(a):new Ze(a)}content(){return new Oe(Le.from(this.node),0,0)}eq(t){return t instanceof Ze&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new oa(this.anchor)}static fromJSON(t,e){if(typeof e.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ze(t.resolve(e.anchor))}static create(t,e){return new Ze(t.resolve(e))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}Ze.prototype.visible=!1,Xe.jsonID("node",Ze);class oa{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:r}=t.mapResult(this.anchor);return e?new qn(r,r):new oa(r)}resolve(t){let e=t.resolve(this.anchor),r=e.nodeAfter;return r&&Ze.isSelectable(r)?new Ze(e):Xe.near(e)}}class Vt extends Xe{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=Oe.empty){if(e==Oe.empty){t.delete(0,t.doc.content.size);let r=Xe.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new Vt(t)}map(t){return new Vt(t)}eq(t){return t instanceof Vt}getBookmark(){return df}}Xe.jsonID("all",Vt);const df={map(){return this},resolve(n){return new Vt(n)}};function Lr(n,t,e,r,i,a=!1){if(t.inlineContent)return Je.create(n,e);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let s=t.child(o);if(s.isAtom){if(!a&&Ze.isSelectable(s))return Ze.create(n,e-(i<0?s.nodeSize:0))}else{let l=Lr(n,s,e+i,i<0?s.childCount:0,i,a);if(l)return l}e+=s.nodeSize*i}return null}function Zo(n,t,e){let r=n.steps.length-1;if(r<t)return;let i=n.steps[r];if(!(i instanceof yt||i instanceof Pt))return;let a=n.mapping.maps[r],o;a.forEach((s,l,c,u)=>{o==null&&(o=u)}),n.setSelection(Xe.near(n.doc.resolve(o),e))}function Xo(n,t){return!t||!n?n:n.bind(t)}class ei{constructor(t,e,r){this.name=t,this.init=Xo(e.init,r),this.apply=Xo(e.apply,r)}}new ei("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new ei("selection",{init(n,t){return n.selection||Xe.atStart(t.doc)},apply(n){return n.selection}}),new ei("storedMarks",{init(n){return n.storedMarks||null},apply(n,t,e,r){return r.selection.$cursor?n.storedMarks:null}}),new ei("scrollToSelection",{init(){return 0},apply(n,t){return n.scrolledIntoView?t+1:t}});function Go(n,t,e){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=Go(i,t,{})),e[r]=i}return e}class Or{constructor(t){this.spec=t,this.props={},t.props&&Go(t.props,this,this.props),this.key=t.key?t.key.key:Ko("plugin")}getState(t){return t[this.key]}}const sa=Object.create(null);function Ko(n){return n in sa?n+"$"+ ++sa[n]:(sa[n]=0,n+"$")}class yr{constructor(t="key"){this.key=Ko(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const la="[\0- -\u2029 ]",hf=new RegExp(la),pf=new RegExp(`${la}$`),mf=new RegExp(la,"g");function gf(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function yf(n){return new Or({key:new yr("autolink"),appendTransaction:(t,e,r)=>{const i=t.some(c=>c.docChanged)&&!e.doc.eq(r.doc),a=t.some(c=>c.getMeta("preventAutolink"));if(!i||a)return;const{tr:o}=r,s=ze.combineTransactionSteps(e.doc,[...t]);if(ze.getChangedRanges(s).forEach(({newRange:c})=>{const u=ze.findChildrenInRange(r.doc,c,d=>d.isTextblock);let f,p;if(u.length>1)f=u[0],p=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ");else if(u.length){const d=r.doc.textBetween(c.from,c.to," "," ");if(!pf.test(d))return;f=u[0],p=r.doc.textBetween(f.pos,c.to,void 0," ")}if(f&&p){const d=p.split(hf).filter(Boolean);if(d.length<=0)return!1;const b=d[d.length-1],y=f.pos+p.lastIndexOf(b);if(!b)return!1;const g=Zi(b).map(h=>h.toObject(n.defaultProtocol));if(!gf(g))return!1;g.filter(h=>h.isLink).map(h=>({...h,from:y+h.start+1,to:y+h.end+1})).filter(h=>r.schema.marks.code?!r.doc.rangeHasMark(h.from,h.to,r.schema.marks.code):!0).filter(h=>n.validate(h.value)).filter(h=>n.shouldAutoLink(h.value)).forEach(h=>{ze.getMarksBetween(h.from,h.to,r.doc).some(m=>m.mark.type===n.type)||o.addMark(h.from,h.to,n.type.create({href:h.href}))})}}),!!o.steps.length)return o}})}function bf(n){return new Or({key:new yr("handleClickLink"),props:{handleClick:(t,e,r)=>{var i,a;if(r.button!==0||!t.editable)return!1;let o=r.target;const s=[];for(;o.nodeName!=="DIV";)s.push(o),o=o.parentNode;if(!s.find(p=>p.nodeName==="A"))return!1;const l=ze.getAttributes(t.state,n.type.name),c=r.target,u=(i=c==null?void 0:c.href)!==null&&i!==void 0?i:l.href,f=(a=c==null?void 0:c.target)!==null&&a!==void 0?a:l.target;return c&&u?(window.open(u,f),!0):!1}}})}function vf(n){return new Or({key:new yr("handlePasteLink"),props:{handlePaste:(t,e,r)=>{const{state:i}=t,{selection:a}=i,{empty:o}=a;if(o)return!1;let s="";r.content.forEach(c=>{s+=c.textContent});const l=bo(s,{defaultProtocol:n.defaultProtocol}).find(c=>c.isLink&&c.value===s);return!s||!l?!1:n.editor.commands.setMark(n.type,{href:l.href})}}})}function br(n,t){const e=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&e.push(i)}),!n||n.replace(mf,"").match(new RegExp(`^(?:(?:${e.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const wf=ze.Mark.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){yo(n);return}yo(n.scheme,n.optionalSlashes)})},onDestroy(){Tu()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,t)=>!!br(n,t.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const t=n.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!br(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:t=>!!br(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ze.mergeAttributes(this.options.HTMLAttributes,n),0]:["a",ze.mergeAttributes(this.options.HTMLAttributes,{...n,href:""}),0]},addCommands(){return{setLink:n=>({chain:t})=>{const{href:e}=n;return this.options.isAllowedUri(e,{defaultValidate:r=>!!br(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:t})=>{const{href:e}=n;return this.options.isAllowedUri(e,{defaultValidate:r=>!!br(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ze.markPasteRule({find:n=>{const t=[];if(n){const{protocols:e,defaultProtocol:r}=this.options,i=bo(n).filter(a=>a.isLink&&this.options.isAllowedUri(a.value,{defaultValidate:o=>!!br(o,e),protocols:e,defaultProtocol:r}));i.length&&i.forEach(a=>t.push({text:a.value,data:{href:a.href},index:a.start}))}return t},type:this.type,getAttributes:n=>{var t;return{href:(t=n.data)===null||t===void 0?void 0:t.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:t,defaultProtocol:e}=this.options;return this.options.autolink&&n.push(yf({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!br(i,t),protocols:t,defaultProtocol:e}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(bf({type:this.type})),this.options.linkOnPaste&&n.push(vf({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),n}}),_f=n=>{if(!n.children.length)return;const t=n.querySelectorAll("span");t&&t.forEach(e=>{var r,i;const a=e.getAttribute("style"),o=(i=(r=e.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");e.setAttribute("style",`${o};${a}`)})},kf=ze.Mark.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&_f(n),{}):!1}]},renderHTML({HTMLAttributes:n}){return["span",ze.mergeAttributes(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:n})=>{const{selection:t}=n;return n.doc.nodesBetween(t.from,t.to,(e,r)=>{if(e.isTextblock)return!0;e.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(a=>!!a))||n.removeMark(r,r+e.nodeSize,this.type)}),!0}}}}),Ef=ze.Extension.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:n=>n.style.fontFamily,renderHTML:n=>n.fontFamily?{style:`font-family: ${n.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:n=>({chain:t})=>t().setMark("textStyle",{fontFamily:n}).run(),unsetFontFamily:()=>({chain:n})=>n().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}});var Cf=ze.Extension.create({name:"fontSize",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:function(e){return e.style.fontSize.replace(/['"]+/g,"")},renderHTML:function(e){return e.fontSize?{style:"font-size: "+e.fontSize}:{}}}}}]},addCommands:function(){return{setFontSize:function(e){return function(r){var i=r.chain;return i().setMark("textStyle",{fontSize:e}).run()}},unsetFontSize:function(){return function(e){var r=e.chain;return r().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}}});const Sf=Cf,xf=ze.Extension.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:n=>{var t;return(t=n.style.color)===null||t===void 0?void 0:t.replace(/['"]+/g,"")},renderHTML:n=>n.color?{style:`color: ${n.color}`}:{}}}}]},addCommands(){return{setColor:n=>({chain:t})=>t().setMark("textStyle",{color:n}).run(),unsetColor:()=>({chain:n})=>n().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),Tf=ze.Mark.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(n){return n!=="super"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sup",ze.mergeAttributes(this.options.HTMLAttributes,n),0]},addCommands(){return{setSuperscript:()=>({commands:n})=>n.setMark(this.name),toggleSuperscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSuperscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),Af=ze.Mark.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(n){return n!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sub",ze.mergeAttributes(this.options.HTMLAttributes,n),0]},addCommands(){return{setSubscript:()=>({commands:n})=>n.setMark(this.name),toggleSubscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSubscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),vr=function(n){for(var t=0;;t++)if(n=n.previousSibling,!n)return t},Jo=function(n,t,e,r){return e&&(Yo(n,t,e,r,-1)||Yo(n,t,e,r,1))},Rf=/^(img|br|input|textarea|hr)$/i;function Yo(n,t,e,r,i){for(var a;;){if(n==e&&t==r)return!0;if(t==(i<0?0:ti(n))){let o=n.parentNode;if(!o||o.nodeType!=1||ca(n)||Rf.test(n.nodeName)||n.contentEditable=="false")return!1;t=vr(n)+(i<0?0:1),n=o}else if(n.nodeType==1){let o=n.childNodes[t+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((a=o.pmViewDesc)===null||a===void 0)&&a.ignoreForSelection)t+=i;else return!1;else n=o,t=i<0?ti(n):0}else return!1}}function ti(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Nf(n,t,e){for(let r=t==0,i=t==ti(n);r||i;){if(n==e)return!0;let a=vr(n);if(n=n.parentNode,!n)return!1;r=r&&a==0,i=i&&a==ti(n)}}function ca(n){let t;for(let e=n;e&&!(t=e.pmViewDesc);e=e.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==n||t.contentDOM==n)}const Qo=function(n){return n.focusNode&&Jo(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function qo(n,t){let e=document.createEvent("Event");return e.initEvent("keydown",!0,!0),e.keyCode=n,e.key=e.code=t,e}const Zt=typeof navigator<"u"?navigator:null,es=typeof document<"u"?document:null,ar=Zt&&Zt.userAgent||"",ua=/Edge\/(\d+)/.exec(ar),ts=/MSIE \d/.exec(ar),fa=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ar),tn=!!(ts||fa||ua),rs=ts?document.documentMode:fa?+fa[1]:ua?+ua[1]:0,ri=!tn&&/gecko\/(\d+)/i.test(ar);ri&&+(/Firefox\/(\d+)/.exec(ar)||[0,0])[1];const da=!tn&&/Chrome\/(\d+)/.exec(ar),Yt=!!da,ns=da?+da[1]:0,wr=!tn&&!!Zt&&/Apple Computer/.test(Zt.vendor),ha=wr&&(/Mobile\/\w+/.test(ar)||!!Zt&&Zt.maxTouchPoints>2),Lt=ha||(Zt?/Mac/.test(Zt.platform):!1),is=Zt?/Win/.test(Zt.platform):!1,rn=/Android \d/.test(ar),pa=!!es&&"webkitFontSmoothing"in es.documentElement.style,Mf=pa?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Lf(n,t=null){let e=n.domSelectionRange(),r=n.state.doc;if(!e.focusNode)return null;let i=n.docView.nearestDesc(e.focusNode),a=i&&i.size==0,o=n.docView.posFromDOM(e.focusNode,e.focusOffset,1);if(o<0)return null;let s=r.resolve(o),l,c;if(Qo(e)){for(l=o;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&Ze.isSelectable(f)&&i.parent&&!(f.isInline&&Nf(e.focusNode,e.focusOffset,i.dom))){let p=i.posBefore;c=new Ze(o==p?s:r.resolve(p))}}else{if(e instanceof n.dom.ownerDocument.defaultView.Selection&&e.rangeCount>1){let f=o,p=o;for(let d=0;d<e.rangeCount;d++){let b=e.getRangeAt(d);f=Math.min(f,n.docView.posFromDOM(b.startContainer,b.startOffset,1)),p=Math.max(p,n.docView.posFromDOM(b.endContainer,b.endOffset,-1))}if(f<0)return null;[l,o]=p==n.state.selection.anchor?[p,f]:[f,p],s=r.resolve(o)}else l=n.docView.posFromDOM(e.anchorNode,e.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!c){let f=t=="pointer"||n.state.selection.head<s.pos&&!a?1:-1;c=us(n,u,s,f)}return c}function as(n){return n.editable?n.hasFocus():Pf(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function ma(n,t=!1){let e=n.state.selection;if(Ff(n,e),!!as(n)){if(!t&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&Yt){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Jo(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)If(n);else{let{anchor:r,head:i}=e,a,o;os&&!(e instanceof Je)&&(e.$from.parent.inlineContent||(a=ss(n,e.from)),!e.empty&&!e.$from.parent.inlineContent&&(o=ss(n,e.to))),n.docView.setSelection(r,i,n,t),os&&(a&&ls(a),o&&ls(o)),e.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Of(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const os=wr||Yt&&ns<63;function ss(n,t){let{node:e,offset:r}=n.docView.domFromPos(t,0),i=r<e.childNodes.length?e.childNodes[r]:null,a=r?e.childNodes[r-1]:null;if(wr&&i&&i.contentEditable=="false")return ga(i);if((!i||i.contentEditable=="false")&&(!a||a.contentEditable=="false")){if(i)return ga(i);if(a)return ga(a)}}function ga(n){return n.contentEditable="true",wr&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function ls(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function Of(n){let t=n.dom.ownerDocument;t.removeEventListener("selectionchange",n.input.hideSelectionGuard);let e=n.domSelectionRange(),r=e.anchorNode,i=e.anchorOffset;t.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(e.anchorNode!=r||e.anchorOffset!=i)&&(t.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!as(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function If(n){let t=n.domSelection();if(!t)return;let e=n.cursorWrapper.dom,r=e.nodeName=="IMG";r?t.collapse(e.parentNode,vr(e)+1):t.collapse(e,0),!r&&!n.state.selection.visible&&tn&&rs<=11&&(e.disabled=!0,e.disabled=!1)}function Ff(n,t){if(t instanceof Ze){let e=n.docView.descAt(t.from);e!=n.lastSelectedViewDesc&&(cs(n),e&&e.selectNode(),n.lastSelectedViewDesc=e)}else cs(n)}function cs(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function us(n,t,e,r){return n.someProp("createSelectionBetween",i=>i(n,t,e))||Je.between(t,e,r)}function Pf(n){let t=n.domSelectionRange();if(!t.anchorNode)return!1;try{return n.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(n.editable||n.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function ya(n,t){let{$anchor:e,$head:r}=n.selection,i=t>0?e.max(r):e.min(r),a=i.parent.inlineContent?i.depth?n.doc.resolve(t>0?i.after():i.before()):null:i;return a&&Xe.findFrom(a,t)}function or(n,t){return n.dispatch(n.state.tr.setSelection(t).scrollIntoView()),!0}function fs(n,t,e){let r=n.state.selection;if(r instanceof Je)if(e.indexOf("s")>-1){let{$head:i}=r,a=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;let o=n.state.doc.resolve(i.pos+a.nodeSize*(t<0?-1:1));return or(n,new Je(r.$anchor,o))}else if(r.empty){if(n.endOfTextblock(t>0?"forward":"backward")){let i=ya(n.state,t);return i&&i instanceof Ze?or(n,i):!1}else if(!(Lt&&e.indexOf("m")>-1)){let i=r.$head,a=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,o;if(!a||a.isText)return!1;let s=t<0?i.pos-a.nodeSize:i.pos;return a.isAtom||(o=n.docView.descAt(s))&&!o.contentDOM?Ze.isSelectable(a)?or(n,new Ze(t<0?n.state.doc.resolve(i.pos-a.nodeSize):i)):pa?or(n,new Je(n.state.doc.resolve(t<0?s:s+a.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Ze&&r.node.isInline)return or(n,new Je(t>0?r.$to:r.$from));{let i=ya(n.state,t);return i?or(n,i):!1}}}function ni(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function nn(n,t){let e=n.pmViewDesc;return e&&e.size==0&&(t<0||n.nextSibling||n.nodeName!="BR")}function Ir(n,t){return t<0?Bf(n):Df(n)}function Bf(n){let t=n.domSelectionRange(),e=t.focusNode,r=t.focusOffset;if(!e)return;let i,a,o=!1;for(ri&&e.nodeType==1&&r<ni(e)&&nn(e.childNodes[r],-1)&&(o=!0);;)if(r>0){if(e.nodeType!=1)break;{let s=e.childNodes[r-1];if(nn(s,-1))i=e,a=--r;else if(s.nodeType==3)e=s,r=e.nodeValue.length;else break}}else{if(ds(e))break;{let s=e.previousSibling;for(;s&&nn(s,-1);)i=e.parentNode,a=vr(s),s=s.previousSibling;if(s)e=s,r=ni(e);else{if(e=e.parentNode,e==n.dom)break;r=0}}}o?ba(n,e,r):i&&ba(n,i,a)}function Df(n){let t=n.domSelectionRange(),e=t.focusNode,r=t.focusOffset;if(!e)return;let i=ni(e),a,o;for(;;)if(r<i){if(e.nodeType!=1)break;let s=e.childNodes[r];if(nn(s,1))a=e,o=++r;else break}else{if(ds(e))break;{let s=e.nextSibling;for(;s&&nn(s,1);)a=s.parentNode,o=vr(s)+1,s=s.nextSibling;if(s)e=s,r=0,i=ni(e);else{if(e=e.parentNode,e==n.dom)break;r=i=0}}}a&&ba(n,a,o)}function ds(n){let t=n.pmViewDesc;return t&&t.node&&t.node.isBlock}function zf(n,t){for(;n&&t==n.childNodes.length&&!ca(n);)t=vr(n)+1,n=n.parentNode;for(;n&&t<n.childNodes.length;){let e=n.childNodes[t];if(e.nodeType==3)return e;if(e.nodeType==1&&e.contentEditable=="false")break;n=e,t=0}}function Uf(n,t){for(;n&&!t&&!ca(n);)t=vr(n),n=n.parentNode;for(;n&&t;){let e=n.childNodes[t-1];if(e.nodeType==3)return e;if(e.nodeType==1&&e.contentEditable=="false")break;n=e,t=n.childNodes.length}}function ba(n,t,e){if(t.nodeType!=3){let a,o;(o=zf(t,e))?(t=o,e=0):(a=Uf(t,e))&&(t=a,e=a.nodeValue.length)}let r=n.domSelection();if(!r)return;if(Qo(r)){let a=document.createRange();a.setEnd(t,e),a.setStart(t,e),r.removeAllRanges(),r.addRange(a)}else r.extend&&r.extend(t,e);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&ma(n)},50)}function hs(n,t){let e=n.state.doc.resolve(t);if(!(Yt||is)&&e.parent.inlineContent){let i=n.coordsAtPos(t);if(t>e.start()){let a=n.coordsAtPos(t-1),o=(a.top+a.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(a.left-i.left)>1)return a.left<i.left?"ltr":"rtl"}if(t<e.end()){let a=n.coordsAtPos(t+1),o=(a.top+a.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(a.left-i.left)>1)return a.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function ps(n,t,e){let r=n.state.selection;if(r instanceof Je&&!r.empty||e.indexOf("s")>-1||Lt&&e.indexOf("m")>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||n.endOfTextblock(t<0?"up":"down")){let o=ya(n.state,t);if(o&&o instanceof Ze)return or(n,o)}if(!i.parent.inlineContent){let o=t<0?i:a,s=r instanceof Vt?Xe.near(o,t):Xe.findFrom(o,t);return s?or(n,s):!1}return!1}function ms(n,t){if(!(n.state.selection instanceof Je))return!0;let{$head:e,$anchor:r,empty:i}=n.state.selection;if(!e.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(t>0?"forward":"backward"))return!0;let a=!e.textOffset&&(t<0?e.nodeBefore:e.nodeAfter);if(a&&!a.isText){let o=n.state.tr;return t<0?o.delete(e.pos-a.nodeSize,e.pos):o.delete(e.pos,e.pos+a.nodeSize),n.dispatch(o),!0}return!1}function gs(n,t,e){n.domObserver.stop(),t.contentEditable=e,n.domObserver.start()}function Hf(n){if(!wr||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:e}=n.domSelectionRange();if(t&&t.nodeType==1&&e==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;gs(n,r,"true"),setTimeout(()=>gs(n,r,"false"),20)}return!1}function Wf(n){let t="";return n.ctrlKey&&(t+="c"),n.metaKey&&(t+="m"),n.altKey&&(t+="a"),n.shiftKey&&(t+="s"),t}function jf(n,t){let e=t.keyCode,r=Wf(t);if(e==8||Lt&&e==72&&r=="c")return ms(n,-1)||Ir(n,-1);if(e==46&&!t.shiftKey||Lt&&e==68&&r=="c")return ms(n,1)||Ir(n,1);if(e==13||e==27)return!0;if(e==37||Lt&&e==66&&r=="c"){let i=e==37?hs(n,n.state.selection.from)=="ltr"?-1:1:-1;return fs(n,i,r)||Ir(n,i)}else if(e==39||Lt&&e==70&&r=="c"){let i=e==39?hs(n,n.state.selection.from)=="ltr"?1:-1:1;return fs(n,i,r)||Ir(n,i)}else{if(e==38||Lt&&e==80&&r=="c")return ps(n,-1,r)||Ir(n,-1);if(e==40||Lt&&e==78&&r=="c")return Hf(n)||ps(n,1,r)||Ir(n,1);if(r==(Lt?"m":"c")&&(e==66||e==73||e==89||e==90))return!0}return!1}function ys(n,t){n.someProp("transformCopied",d=>{t=d(t,n)});let e=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let d=r.firstChild;e.push(d.type.name,d.attrs!=d.type.defaultAttrs?d.attrs:null),r=d.content}let o=n.someProp("clipboardSerializer")||Kn.fromSchema(n.state.schema),s=Ss(),l=s.createElement("div");l.appendChild(o.serializeFragment(r,{document:s}));let c=l.firstChild,u,f=0;for(;c&&c.nodeType==1&&(u=Es[c.nodeName.toLowerCase()]);){for(let d=u.length-1;d>=0;d--){let b=s.createElement(u[d]);for(;l.firstChild;)b.appendChild(l.firstChild);l.appendChild(b),f++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${a}${f?` -${f}`:""} ${JSON.stringify(e)}`);let p=n.someProp("clipboardTextSerializer",d=>d(t,n))||t.content.textBetween(0,t.content.size,`
|
|
9
|
+
|
|
10
|
+
`);return{dom:l,text:p,slice:t}}function bs(n,t,e,r,i){let a=i.parent.type.spec.code,o,s;if(!e&&!t)return null;let l=!!t&&(r||a||!e);if(l){if(n.someProp("transformPastedText",p=>{t=p(t,a||r,n)}),a)return s=new Oe(Le.from(n.state.schema.text(t.replace(/\r\n?/g,`
|
|
11
|
+
`))),0,0),n.someProp("transformPasted",p=>{s=p(s,n,!0)}),s;let f=n.someProp("clipboardTextParser",p=>p(t,i,r,n));if(f)s=f;else{let p=i.marks(),{schema:d}=n.state,b=Kn.fromSchema(d);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(y=>{let g=o.appendChild(document.createElement("p"));y&&g.appendChild(b.serializeNode(d.text(y,p)))})}}else n.someProp("transformPastedHTML",f=>{e=f(e,n)}),o=Xf(e),pa&&Gf(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let p=o.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;o=p}if(s||(s=(n.someProp("clipboardParser")||n.someProp("domParser")||Du.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!$f.test(p.parentNode.nodeName)?{ignore:!0}:null}})),u)s=Kf(ks(s,+u[1],+u[2]),u[4]);else if(s=Oe.maxOpen(Vf(s.content,i),!0),s.openStart||s.openEnd){let f=0,p=0;for(let d=s.content.firstChild;f<s.openStart&&!d.type.spec.isolating;f++,d=d.firstChild);for(let d=s.content.lastChild;p<s.openEnd&&!d.type.spec.isolating;p++,d=d.lastChild);s=ks(s,f,p)}return n.someProp("transformPasted",f=>{s=f(s,n,l)}),s}const $f=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Vf(n,t){if(n.childCount<2)return n;for(let e=t.depth;e>=0;e--){let i=t.node(e).contentMatchAt(t.index(e)),a,o=[];if(n.forEach(s=>{if(!o)return;let l=i.findWrapping(s.type),c;if(!l)return o=null;if(c=o.length&&a.length&&ws(l,a,s,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=_s(o[o.length-1],a.length));let u=vs(s,l);o.push(u),i=i.matchType(u.type),a=l}}),o)return Le.from(o)}return n}function vs(n,t,e=0){for(let r=t.length-1;r>=e;r--)n=t[r].create(null,Le.from(n));return n}function ws(n,t,e,r,i){if(i<n.length&&i<t.length&&n[i]==t[i]){let a=ws(n,t,e,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?e.type:n[i+1]))return r.copy(r.content.append(Le.from(vs(e,n,i+1))))}}function _s(n,t){if(t==0)return n;let e=n.content.replaceChild(n.childCount-1,_s(n.lastChild,t-1)),r=n.contentMatchAt(n.childCount).fillBefore(Le.empty,!0);return n.copy(e.append(r))}function va(n,t,e,r,i,a){let o=t<0?n.firstChild:n.lastChild,s=o.content;return n.childCount>1&&(a=0),i<r-1&&(s=va(s,t,e,r,i+1,a)),i>=e&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(Le.empty,!0))),n.replaceChild(t<0?0:n.childCount-1,o.copy(s))}function ks(n,t,e){return t<n.openStart&&(n=new Oe(va(n.content,-1,t,n.openStart,0,n.openEnd),t,n.openEnd)),e<n.openEnd&&(n=new Oe(va(n.content,1,e,n.openEnd,0,0),n.openStart,e)),n}const Es={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Cs=null;function Ss(){return Cs||(Cs=document.implementation.createHTMLDocument("title"))}let wa=null;function Zf(n){let t=window.trustedTypes;return t?(wa||(wa=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),wa.createHTML(n)):n}function Xf(n){let t=/^(\s*<meta [^>]*>)*/.exec(n);t&&(n=n.slice(t[0].length));let e=Ss().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&Es[r[1].toLowerCase()])&&(n=i.map(a=>"<"+a+">").join("")+n+i.map(a=>"</"+a+">").reverse().join("")),e.innerHTML=Zf(n),i)for(let a=0;a<i.length;a++)e=e.querySelector(i[a])||e;return e}function Gf(n){let t=n.querySelectorAll(Yt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let e=0;e<t.length;e++){let r=t[e];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function Kf(n,t){if(!n.size)return n;let e=n.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return n}let{content:i,openStart:a,openEnd:o}=n;for(let s=r.length-2;s>=0;s-=2){let l=e.nodes[r[s]];if(!l||l.hasRequiredAttrs())break;i=Le.from(l.create(r[s+1],i)),a++,o++}return new Oe(i,a,o)}const Bt={},St={};function sr(n,t){n.input.lastSelectionOrigin=t,n.input.lastSelectionTime=Date.now()}St.keydown=(n,t)=>{let e=t;if(n.input.shiftKey=e.keyCode==16||e.shiftKey,!Ts(n,e)&&(n.input.lastKeyCode=e.keyCode,n.input.lastKeyCodeTime=Date.now(),!(rn&&Yt&&e.keyCode==13)))if(e.keyCode!=229&&n.domObserver.forceFlush(),ha&&e.keyCode==13&&!e.ctrlKey&&!e.altKey&&!e.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,qo(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,e))||jf(n,e)?e.preventDefault():sr(n,"key")},St.keyup=(n,t)=>{t.keyCode==16&&(n.input.shiftKey=!1)},St.keypress=(n,t)=>{let e=t;if(Ts(n,e)||!e.charCode||e.ctrlKey&&!e.altKey||Lt&&e.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,e))){e.preventDefault();return}let r=n.state.selection;if(!(r instanceof Je)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(e.charCode),a=()=>n.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i,a))&&n.dispatch(a()),e.preventDefault()}};function ii(n){return{left:n.clientX,top:n.clientY}}function Jf(n,t){let e=t.x-n.clientX,r=t.y-n.clientY;return e*e+r*r<100}function _a(n,t,e,r,i){if(r==-1)return!1;let a=n.state.doc.resolve(r);for(let o=a.depth+1;o>0;o--)if(n.someProp(t,s=>o>a.depth?s(n,e,a.nodeAfter,a.before(o),i,!0):s(n,e,a.node(o),a.before(o),i,!1)))return!0;return!1}function Fr(n,t,e){if(n.focused||n.focus(),n.state.selection.eq(t))return;let r=n.state.tr.setSelection(t);e=="pointer"&&r.setMeta("pointer",!0),n.dispatch(r)}function Yf(n,t){if(t==-1)return!1;let e=n.state.doc.resolve(t),r=e.nodeAfter;return r&&r.isAtom&&Ze.isSelectable(r)?(Fr(n,new Ze(e),"pointer"),!0):!1}function Qf(n,t){if(t==-1)return!1;let e=n.state.selection,r,i;e instanceof Ze&&(r=e.node);let a=n.state.doc.resolve(t);for(let o=a.depth+1;o>0;o--){let s=o>a.depth?a.nodeAfter:a.node(o);if(Ze.isSelectable(s)){r&&e.$from.depth>0&&o>=e.$from.depth&&a.before(e.$from.depth+1)==e.$from.pos?i=a.before(e.$from.depth):i=a.before(o);break}}return i!=null?(Fr(n,Ze.create(n.state.doc,i),"pointer"),!0):!1}function qf(n,t,e,r,i){return _a(n,"handleClickOn",t,e,r)||n.someProp("handleClick",a=>a(n,t,r))||(i?Qf(n,e):Yf(n,e))}function ed(n,t,e,r){return _a(n,"handleDoubleClickOn",t,e,r)||n.someProp("handleDoubleClick",i=>i(n,t,r))}function td(n,t,e,r){return _a(n,"handleTripleClickOn",t,e,r)||n.someProp("handleTripleClick",i=>i(n,t,r))||rd(n,e,r)}function rd(n,t,e){if(e.button!=0)return!1;let r=n.state.doc;if(t==-1)return r.inlineContent?(Fr(n,Je.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(t);for(let a=i.depth+1;a>0;a--){let o=a>i.depth?i.nodeAfter:i.node(a),s=i.before(a);if(o.inlineContent)Fr(n,Je.create(r,s+1,s+1+o.content.size),"pointer");else if(Ze.isSelectable(o))Fr(n,Ze.create(r,s),"pointer");else continue;return!0}}function ka(n){return ai(n)}const xs=Lt?"metaKey":"ctrlKey";Bt.mousedown=(n,t)=>{let e=t;n.input.shiftKey=e.shiftKey;let r=ka(n),i=Date.now(),a="singleClick";i-n.input.lastClick.time<500&&Jf(e,n.input.lastClick)&&!e[xs]&&n.input.lastClick.button==e.button&&(n.input.lastClick.type=="singleClick"?a="doubleClick":n.input.lastClick.type=="doubleClick"&&(a="tripleClick")),n.input.lastClick={time:i,x:e.clientX,y:e.clientY,type:a,button:e.button};let o=n.posAtCoords(ii(e));o&&(a=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new nd(n,o,e,!!r)):(a=="doubleClick"?ed:td)(n,o.pos,o.inside,e)?e.preventDefault():sr(n,"pointer"))};class nd{constructor(t,e,r,i){this.view=t,this.pos=e,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[xs],this.allowDefault=r.shiftKey;let a,o;if(e.inside>-1)a=t.state.doc.nodeAt(e.inside),o=e.inside;else{let u=t.state.doc.resolve(e.pos);a=u.parent,o=u.depth?u.before():0}const s=i?null:r.target,l=s?t.docView.nearestDesc(s,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=t.state;(r.button==0&&a.type.spec.draggable&&a.type.spec.selectable!==!1||c instanceof Ze&&c.from<=o&&c.to>o)&&(this.mightDrag={node:a,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ri&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),sr(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>ma(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(ii(t))),this.updateAllowDefault(t),this.allowDefault||!e?sr(this.view,"pointer"):qf(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||wr&&this.mightDrag&&!this.mightDrag.node.isAtom||Yt&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(Fr(this.view,Xe.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):sr(this.view,"pointer")}move(t){this.updateAllowDefault(t),sr(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Bt.touchstart=n=>{n.input.lastTouch=Date.now(),ka(n),sr(n,"pointer")},Bt.touchmove=n=>{n.input.lastTouch=Date.now(),sr(n,"pointer")},Bt.contextmenu=n=>ka(n);function Ts(n,t){return n.composing?!0:wr&&Math.abs(t.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const id=rn?5e3:-1;St.compositionstart=St.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:t}=n,e=t.selection.$to;if(t.selection instanceof Je&&(t.storedMarks||!e.textOffset&&e.parentOffset&&e.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Yt&&is&&ad(n)))n.markCursor=n.state.storedMarks||e.marks(),ai(n,!0),n.markCursor=null;else if(ai(n,!t.selection.empty),ri&&t.selection.empty&&e.parentOffset&&!e.textOffset&&e.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,a=r.focusOffset;i&&i.nodeType==1&&a!=0;){let o=a<0?i.lastChild:i.childNodes[a-1];if(!o)break;if(o.nodeType==3){let s=n.domSelection();s&&s.collapse(o,o.nodeValue.length);break}else i=o,a=-1}}n.input.composing=!0}As(n,id)};function ad(n){let{focusNode:t,focusOffset:e}=n.domSelectionRange();if(!t||t.nodeType!=1||e>=t.childNodes.length)return!1;let r=t.childNodes[e];return r.nodeType==1&&r.contentEditable=="false"}St.compositionend=(n,t)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=t.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,As(n,20))};function As(n,t){clearTimeout(n.input.composingTimeout),t>-1&&(n.input.composingTimeout=setTimeout(()=>ai(n),t))}function od(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=sd());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function sd(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function ai(n,t=!1){if(!(rn&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),od(n),t||n.docView&&n.docView.dirty){let e=Lf(n),r=n.state.selection;return e&&!e.eq(r)?n.dispatch(n.state.tr.setSelection(e)):(n.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function ld(n,t){if(!n.dom.parentNode)return;let e=n.dom.parentNode.appendChild(document.createElement("div"));e.appendChild(t),e.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e),n.focus()},50)}const an=tn&&rs<15||ha&&Mf<604;Bt.copy=St.cut=(n,t)=>{let e=t,r=n.state.selection,i=e.type=="cut";if(r.empty)return;let a=an?null:e.clipboardData,o=r.content(),{dom:s,text:l}=ys(n,o);a?(e.preventDefault(),a.clearData(),a.setData("text/html",s.innerHTML),a.setData("text/plain",l)):ld(n,s),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function cd(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function ud(n,t){if(!n.dom.parentNode)return;let e=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(e?"textarea":"div"));e||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),e?Ea(n,r.value,null,i,t):Ea(n,r.textContent,r.innerHTML,i,t)},50)}function Ea(n,t,e,r,i){let a=bs(n,t,e,r,n.state.selection.$from);if(n.someProp("handlePaste",l=>l(n,i,a||Oe.empty)))return!0;if(!a)return!1;let o=cd(a),s=o?n.state.tr.replaceSelectionWith(o,r):n.state.tr.replaceSelection(a);return n.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Rs(n){let t=n.getData("text/plain")||n.getData("Text");if(t)return t;let e=n.getData("text/uri-list");return e?e.replace(/\r?\n/g," "):""}St.paste=(n,t)=>{let e=t;if(n.composing&&!rn)return;let r=an?null:e.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&Ea(n,Rs(r),r.getData("text/html"),i,e)?e.preventDefault():ud(n,e)};class fd{constructor(t,e,r){this.slice=t,this.move=e,this.node=r}}const dd=Lt?"altKey":"ctrlKey";function Ns(n,t){let e=n.someProp("dragCopies",r=>!r(t));return e??!t[dd]}Bt.dragstart=(n,t)=>{let e=t,r=n.input.mouseDown;if(r&&r.done(),!e.dataTransfer)return;let i=n.state.selection,a=i.empty?null:n.posAtCoords(ii(e)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof Ze?i.to-1:i.to))){if(r&&r.mightDrag)o=Ze.create(n.state.doc,r.mightDrag.pos);else if(e.target&&e.target.nodeType==1){let f=n.docView.nearestDesc(e.target,!0);f&&f.node.type.spec.draggable&&f!=n.docView&&(o=Ze.create(n.state.doc,f.posBefore))}}let s=(o||n.state.selection).content(),{dom:l,text:c,slice:u}=ys(n,s);(!e.dataTransfer.files.length||!Yt||ns>120)&&e.dataTransfer.clearData(),e.dataTransfer.setData(an?"Text":"text/html",l.innerHTML),e.dataTransfer.effectAllowed="copyMove",an||e.dataTransfer.setData("text/plain",c),n.dragging=new fd(u,Ns(n,e),o)},Bt.dragend=n=>{let t=n.dragging;window.setTimeout(()=>{n.dragging==t&&(n.dragging=null)},50)},St.dragover=St.dragenter=(n,t)=>t.preventDefault(),St.drop=(n,t)=>{try{hd(n,t,n.dragging)}finally{n.dragging=null}};function hd(n,t,e){if(!t.dataTransfer)return;let r=n.posAtCoords(ii(t));if(!r)return;let i=n.state.doc.resolve(r.pos),a=e&&e.slice;a?n.someProp("transformPasted",d=>{a=d(a,n,!1)}):a=bs(n,Rs(t.dataTransfer),an?null:t.dataTransfer.getData("text/html"),!1,i);let o=!!(e&&Ns(n,t));if(n.someProp("handleDrop",d=>d(n,t,a||Oe.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?rf(n.state.doc,i.pos,a):i.pos;s==null&&(s=i.pos);let l=n.state.tr;if(o){let{node:d}=e;d?d.replace(l):l.deleteSelection()}let c=l.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,f=l.doc;if(u?l.replaceRangeWith(c,c,a.content.firstChild):l.replaceRange(c,c,a),l.doc.eq(f))return;let p=l.doc.resolve(c);if(u&&Ze.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))l.setSelection(new Ze(p));else{let d=l.mapping.map(s);l.mapping.maps[l.mapping.maps.length-1].forEach((b,y,g,h)=>d=h),l.setSelection(us(n,p,l.doc.resolve(d)))}n.focus(),n.dispatch(l.setMeta("uiEvent","drop"))}Bt.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&ma(n)},20))},Bt.blur=(n,t)=>{let e=t;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),e.relatedTarget&&n.dom.contains(e.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},Bt.beforeinput=(n,t)=>{if(Yt&&rn&&t.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",a=>a(n,qo(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in St)Bt[n]=St[n];function on(n,t){if(n==t)return!0;for(let e in n)if(n[e]!==t[e])return!1;for(let e in t)if(!(e in n))return!1;return!0}class oi{constructor(t,e){this.toDOM=t,this.spec=e||_r,this.side=this.spec.side||0}map(t,e,r,i){let{pos:a,deleted:o}=t.mapResult(e.from+i,this.side<0?-1:1);return o?null:new Et(a-r,a-r,this)}valid(){return!0}eq(t){return this==t||t instanceof oi&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&on(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class lr{constructor(t,e){this.attrs=t,this.spec=e||_r}map(t,e,r,i){let a=t.map(e.from+i,this.spec.inclusiveStart?-1:1)-r,o=t.map(e.to+i,this.spec.inclusiveEnd?1:-1)-r;return a>=o?null:new Et(a,o,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof lr&&on(this.attrs,t.attrs)&&on(this.spec,t.spec)}static is(t){return t.type instanceof lr}destroy(){}}class Ca{constructor(t,e){this.attrs=t,this.spec=e||_r}map(t,e,r,i){let a=t.mapResult(e.from+i,1);if(a.deleted)return null;let o=t.mapResult(e.to+i,-1);return o.deleted||o.pos<=a.pos?null:new Et(a.pos-r,o.pos-r,this)}valid(t,e){let{index:r,offset:i}=t.content.findIndex(e.from),a;return i==e.from&&!(a=t.child(r)).isText&&i+a.nodeSize==e.to}eq(t){return this==t||t instanceof Ca&&on(this.attrs,t.attrs)&&on(this.spec,t.spec)}destroy(){}}class Et{constructor(t,e,r){this.from=t,this.to=e,this.type=r}copy(t,e){return new Et(t,e,this.type)}eq(t,e=0){return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,r){return this.type.map(t,this,e,r)}static widget(t,e,r){return new Et(t,t,new oi(e,r))}static inline(t,e,r,i){return new Et(t,e,new lr(r,i))}static node(t,e,r,i){return new Et(t,e,new Ca(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof lr}get widget(){return this.type instanceof oi}}const Pr=[],_r={};class tt{constructor(t,e){this.local=t.length?t:Pr,this.children=e.length?e:Pr}static create(t,e){return e.length?si(e,t,0,_r):wt}find(t,e,r){let i=[];return this.findInner(t??0,e??1e9,i,0,r),i}findInner(t,e,r,i,a){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=e&&s.to>=t&&(!a||a(s.spec))&&r.push(s.copy(s.from+i,s.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<e&&this.children[o+1]>t){let s=this.children[o]+1;this.children[o+2].findInner(t-s,e-s,r,i+s,a)}}map(t,e,r){return this==wt||t.maps.length==0?this:this.mapInner(t,e,0,0,r||_r)}mapInner(t,e,r,i,a){let o;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(t,r,i);l&&l.type.valid(e,l)?(o||(o=[])).push(l):a.onRemove&&a.onRemove(this.local[s].spec)}return this.children.length?pd(this.children,o||[],t,e,r,i,a):o?new tt(o.sort(Er),Pr):wt}add(t,e){return e.length?this==wt?tt.create(t,e):this.addInner(t,e,0):this}addInner(t,e,r){let i,a=0;t.forEach((s,l)=>{let c=l+r,u;if(u=Ls(e,s,c)){for(i||(i=this.children.slice());a<i.length&&i[a]<l;)a+=3;i[a]==l?i[a+2]=i[a+2].addInner(s,u,c+1):i.splice(a,0,l,l+s.nodeSize,si(u,s,c+1,_r)),a+=3}});let o=Ms(a?Os(e):e,-r);for(let s=0;s<o.length;s++)o[s].type.valid(t,o[s])||o.splice(s--,1);return new tt(o.length?this.local.concat(o).sort(Er):this.local,i||this.children)}remove(t){return t.length==0||this==wt?this:this.removeInner(t,0)}removeInner(t,e){let r=this.children,i=this.local;for(let a=0;a<r.length;a+=3){let o,s=r[a]+e,l=r[a+1]+e;for(let u=0,f;u<t.length;u++)(f=t[u])&&f.from>s&&f.to<l&&(t[u]=null,(o||(o=[])).push(f));if(!o)continue;r==this.children&&(r=this.children.slice());let c=r[a+2].removeInner(o,s+1);c!=wt?r[a+2]=c:(r.splice(a,3),a-=3)}if(i.length){for(let a=0,o;a<t.length;a++)if(o=t[a])for(let s=0;s<i.length;s++)i[s].eq(o,e)&&(i==this.local&&(i=this.local.slice()),i.splice(s--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new tt(i,r):wt}forChild(t,e){if(this==wt)return this;if(e.isLeaf)return tt.empty;let r,i;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=t){this.children[s]==t&&(r=this.children[s+2]);break}let a=t+1,o=a+e.content.size;for(let s=0;s<this.local.length;s++){let l=this.local[s];if(l.from<o&&l.to>a&&l.type instanceof lr){let c=Math.max(a,l.from)-a,u=Math.min(o,l.to)-a;c<u&&(i||(i=[])).push(l.copy(c,u))}}if(i){let s=new tt(i.sort(Er),Pr);return r?new kr([s,r]):s}return r||wt}eq(t){if(this==t)return!0;if(!(t instanceof tt)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return Sa(this.localsInner(t))}localsInner(t){if(this==wt)return Pr;if(t.inlineContent||!this.local.some(lr.is))return this.local;let e=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof lr||e.push(this.local[r]);return e}forEachSet(t){t(this)}}tt.empty=new tt([],[]),tt.removeOverlap=Sa;const wt=tt.empty;class kr{constructor(t){this.members=t}map(t,e){const r=this.members.map(i=>i.map(t,e,_r));return kr.from(r)}forChild(t,e){if(e.isLeaf)return tt.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,e);a!=wt&&(a instanceof kr?r=r.concat(a.members):r.push(a))}return kr.from(r)}eq(t){if(!(t instanceof kr)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,r=!0;for(let i=0;i<this.members.length;i++){let a=this.members[i].localsInner(t);if(a.length)if(!e)e=a;else{r&&(e=e.slice(),r=!1);for(let o=0;o<a.length;o++)e.push(a[o])}}return e?Sa(r?e:e.sort(Er)):Pr}static from(t){switch(t.length){case 0:return wt;case 1:return t[0];default:return new kr(t.every(e=>e instanceof tt)?t:t.reduce((e,r)=>e.concat(r instanceof tt?r:r.members),[]))}}forEachSet(t){for(let e=0;e<this.members.length;e++)this.members[e].forEachSet(t)}}function pd(n,t,e,r,i,a,o){let s=n.slice();for(let c=0,u=a;c<e.maps.length;c++){let f=0;e.maps[c].forEach((p,d,b,y)=>{let g=y-b-(d-p);for(let h=0;h<s.length;h+=3){let m=s[h+1];if(m<0||p>m+u-f)continue;let w=s[h]+u-f;d>=w?s[h+1]=p<=w?-2:-1:p>=u&&g&&(s[h]+=g,s[h+1]+=g)}f+=g}),u=e.maps[c].map(u,-1)}let l=!1;for(let c=0;c<s.length;c+=3)if(s[c+1]<0){if(s[c+1]==-2){l=!0,s[c+1]=-1;continue}let u=e.map(n[c]+a),f=u-i;if(f<0||f>=r.content.size){l=!0;continue}let p=e.map(n[c+1]+a,-1),d=p-i,{index:b,offset:y}=r.content.findIndex(f),g=r.maybeChild(b);if(g&&y==f&&y+g.nodeSize==d){let h=s[c+2].mapInner(e,g,u+1,n[c]+a+1,o);h!=wt?(s[c]=f,s[c+1]=d,s[c+2]=h):(s[c+1]=-2,l=!0)}else l=!0}if(l){let c=md(s,n,t,e,i,a,o),u=si(c,r,0,o);t=u.local;for(let f=0;f<s.length;f+=3)s[f+1]<0&&(s.splice(f,3),f-=3);for(let f=0,p=0;f<u.children.length;f+=3){let d=u.children[f];for(;p<s.length&&s[p]<d;)p+=3;s.splice(p,0,u.children[f],u.children[f+1],u.children[f+2])}}return new tt(t.sort(Er),s)}function Ms(n,t){if(!t||!n.length)return n;let e=[];for(let r=0;r<n.length;r++){let i=n[r];e.push(new Et(i.from+t,i.to+t,i.type))}return e}function md(n,t,e,r,i,a,o){function s(l,c){for(let u=0;u<l.local.length;u++){let f=l.local[u].map(r,i,c);f?e.push(f):o.onRemove&&o.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)s(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<n.length;l+=3)n[l+1]==-1&&s(n[l+2],t[l]+a+1);return e}function Ls(n,t,e){if(t.isLeaf)return null;let r=e+t.nodeSize,i=null;for(let a=0,o;a<n.length;a++)(o=n[a])&&o.from>e&&o.to<r&&((i||(i=[])).push(o),n[a]=null);return i}function Os(n){let t=[];for(let e=0;e<n.length;e++)n[e]!=null&&t.push(n[e]);return t}function si(n,t,e,r){let i=[],a=!1;t.forEach((s,l)=>{let c=Ls(n,s,l+e);if(c){a=!0;let u=si(c,s,e+l+1,r);u!=wt&&i.push(l,l+s.nodeSize,u)}});let o=Ms(a?Os(n):n,-e).sort(Er);for(let s=0;s<o.length;s++)o[s].type.valid(t,o[s])||(r.onRemove&&r.onRemove(o[s].spec),o.splice(s--,1));return o.length||i.length?new tt(o,i):wt}function Er(n,t){return n.from-t.from||n.to-t.to}function Sa(n){let t=n;for(let e=0;e<t.length-1;e++){let r=t[e];if(r.from!=r.to)for(let i=e+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==n&&(t=n.slice()),t[i]=a.copy(a.from,r.to),Is(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==n&&(t=n.slice()),t[e]=r.copy(r.from,a.from),Is(t,i,r.copy(a.from,r.to)));break}}}return t}function Is(n,t,e){for(;t<n.length&&Er(e,n[t])>0;)t++;n.splice(t,0,e)}for(var cr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},li={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},gd=typeof navigator<"u"&&/Mac/.test(navigator.platform),yd=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),mt=0;mt<10;mt++)cr[48+mt]=cr[96+mt]=String(mt);for(var mt=1;mt<=24;mt++)cr[mt+111]="F"+mt;for(var mt=65;mt<=90;mt++)cr[mt]=String.fromCharCode(mt+32),li[mt]=String.fromCharCode(mt);for(var xa in cr)li.hasOwnProperty(xa)||(li[xa]=cr[xa]);function bd(n){var t=gd&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||yd&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",e=!t&&n.key||(n.shiftKey?li:cr)[n.keyCode]||n.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}const vd=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),wd=typeof navigator<"u"&&/Win/.test(navigator.platform);function _d(n){let t=n.split(/-(?!$)/),e=t[t.length-1];e=="Space"&&(e=" ");let r,i,a,o;for(let s=0;s<t.length-1;s++){let l=t[s];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))a=!0;else if(/^mod$/i.test(l))vd?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(e="Alt-"+e),i&&(e="Ctrl-"+e),o&&(e="Meta-"+e),a&&(e="Shift-"+e),e}function kd(n){let t=Object.create(null);for(let e in n)t[_d(e)]=n[e];return t}function Ta(n,t,e=!0){return t.altKey&&(n="Alt-"+n),t.ctrlKey&&(n="Ctrl-"+n),t.metaKey&&(n="Meta-"+n),e&&t.shiftKey&&(n="Shift-"+n),n}function Ed(n){let t=kd(n);return function(e,r){let i=bd(r),a,o=t[Ta(i,r)];if(o&&o(e.state,e.dispatch,e))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let s=t[Ta(i,r,!1)];if(s&&s(e.state,e.dispatch,e))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(wd&&r.ctrlKey&&r.altKey)&&(a=cr[r.keyCode])&&a!=i){let s=t[Ta(a,r)];if(s&&s(e.state,e.dispatch,e))return!0}}return!1}}let Aa,Ra;if(typeof WeakMap<"u"){let n=new WeakMap;Aa=t=>n.get(t),Ra=(t,e)=>(n.set(t,e),e)}else{const n=[];let e=0;Aa=r=>{for(let i=0;i<n.length;i+=2)if(n[i]==r)return n[i+1]},Ra=(r,i)=>(e==10&&(e=0),n[e++]=r,n[e++]=i)}var ot=class{constructor(n,t,e,r){this.width=n,this.height=t,this.map=e,this.problems=r}findCell(n){for(let t=0;t<this.map.length;t++){const e=this.map[t];if(e!=n)continue;const r=t%this.width,i=t/this.width|0;let a=r+1,o=i+1;for(let s=1;a<this.width&&this.map[t+s]==e;s++)a++;for(let s=1;o<this.height&&this.map[t+this.width*s]==e;s++)o++;return{left:r,top:i,right:a,bottom:o}}throw new RangeError(`No cell with offset ${n} found`)}colCount(n){for(let t=0;t<this.map.length;t++)if(this.map[t]==n)return t%this.width;throw new RangeError(`No cell with offset ${n} found`)}nextCell(n,t,e){const{left:r,right:i,top:a,bottom:o}=this.findCell(n);return t=="horiz"?(e<0?r==0:i==this.width)?null:this.map[a*this.width+(e<0?r-1:i)]:(e<0?a==0:o==this.height)?null:this.map[r+this.width*(e<0?a-1:o)]}rectBetween(n,t){const{left:e,right:r,top:i,bottom:a}=this.findCell(n),{left:o,right:s,top:l,bottom:c}=this.findCell(t);return{left:Math.min(e,o),top:Math.min(i,l),right:Math.max(r,s),bottom:Math.max(a,c)}}cellsInRect(n){const t=[],e={};for(let r=n.top;r<n.bottom;r++)for(let i=n.left;i<n.right;i++){const a=r*this.width+i,o=this.map[a];e[o]||(e[o]=!0,!(i==n.left&&i&&this.map[a-1]==o||r==n.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(n,t,e){for(let r=0,i=0;;r++){const a=i+e.child(r).nodeSize;if(r==n){let o=t+n*this.width;const s=(n+1)*this.width;for(;o<s&&this.map[o]<i;)o++;return o==s?a-1:this.map[o]}i=a}}static get(n){return Aa(n)||Ra(n,Cd(n))}};function Cd(n){if(n.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+n.type.name);const t=Sd(n),e=n.childCount,r=[];let i=0,a=null;const o=[];for(let c=0,u=t*e;c<u;c++)r[c]=0;for(let c=0,u=0;c<e;c++){const f=n.child(c);u++;for(let b=0;;b++){for(;i<r.length&&r[i]!=0;)i++;if(b==f.childCount)break;const y=f.child(b),{colspan:g,rowspan:h,colwidth:m}=y.attrs;for(let w=0;w<h;w++){if(w+c>=e){(a||(a=[])).push({type:"overlong_rowspan",pos:u,n:h-w});break}const A=i+w*t;for(let v=0;v<g;v++){r[A+v]==0?r[A+v]=u:(a||(a=[])).push({type:"collision",row:c,pos:u,n:g-v});const T=m&&m[v];if(T){const N=(A+v)%t*2,M=o[N];M==null||M!=T&&o[N+1]==1?(o[N]=T,o[N+1]=1):M==T&&o[N+1]++}}}i+=g,u+=y.nodeSize}const p=(c+1)*t;let d=0;for(;i<p;)r[i++]==0&&d++;d&&(a||(a=[])).push({type:"missing",row:c,n:d}),u++}(t===0||e===0)&&(a||(a=[])).push({type:"zero_sized"});const s=new ot(t,e,r,a);let l=!1;for(let c=0;!l&&c<o.length;c+=2)o[c]!=null&&o[c+1]<e&&(l=!0);return l&&xd(s,o,n),s}function Sd(n){let t=-1,e=!1;for(let r=0;r<n.childCount;r++){const i=n.child(r);let a=0;if(e)for(let o=0;o<r;o++){const s=n.child(o);for(let l=0;l<s.childCount;l++){const c=s.child(l);o+c.attrs.rowspan>r&&(a+=c.attrs.colspan)}}for(let o=0;o<i.childCount;o++){const s=i.child(o);a+=s.attrs.colspan,s.attrs.rowspan>1&&(e=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function xd(n,t,e){n.problems||(n.problems=[]);const r={};for(let i=0;i<n.map.length;i++){const a=n.map[i];if(r[a])continue;r[a]=!0;const o=e.nodeAt(a);if(!o)throw new RangeError(`No cell with offset ${a} found`);let s=null;const l=o.attrs;for(let c=0;c<l.colspan;c++){const u=t[(i+c)%n.width*2];u!=null&&(!l.colwidth||l.colwidth[c]!=u)&&((s||(s=Td(l)))[c]=u)}s&&n.problems.unshift({type:"colwidth mismatch",pos:a,colwidth:s})}}function Td(n){if(n.colwidth)return n.colwidth.slice();const t=[];for(let e=0;e<n.colspan;e++)t.push(0);return t}function bt(n){let t=n.cached.tableNodeTypes;if(!t){t=n.cached.tableNodeTypes={};for(const e in n.nodes){const r=n.nodes[e],i=r.spec.tableRole;i&&(t[i]=r)}}return t}const ur=new yr("selectingCells");function Cr(n){for(let t=n.depth-1;t>0;t--)if(n.node(t).type.spec.tableRole=="row")return n.node(0).resolve(n.before(t+1));return null}function Ad(n){for(let t=n.depth;t>0;t--){const e=n.node(t).type.spec.tableRole;if(e==="cell"||e==="header_cell")return n.node(t)}return null}function Dt(n){const t=n.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return!0;return!1}function ci(n){const t=n.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const e=Cr(t.$head)||Rd(t.$head);if(e)return e;throw new RangeError(`No cell found around position ${t.head}`)}function Rd(n){for(let t=n.nodeAfter,e=n.pos;t;t=t.firstChild,e++){const r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return n.doc.resolve(e)}for(let t=n.nodeBefore,e=n.pos;t;t=t.lastChild,e--){const r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return n.doc.resolve(e-t.nodeSize)}}function Na(n){return n.parent.type.spec.tableRole=="row"&&!!n.nodeAfter}function Nd(n){return n.node(0).resolve(n.pos+n.nodeAfter.nodeSize)}function Ma(n,t){return n.depth==t.depth&&n.pos>=t.start(-1)&&n.pos<=t.end(-1)}function Fs(n,t,e){const r=n.node(-1),i=ot.get(r),a=n.start(-1),o=i.nextCell(n.pos-a,t,e);return o==null?null:n.node(0).resolve(a+o)}function Sr(n,t,e=1){const r={...n,colspan:n.colspan-e};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,e),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function Ps(n,t,e=1){const r={...n,colspan:n.colspan+e};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<e;i++)r.colwidth.splice(t,0,0)}return r}function Md(n,t,e){const r=bt(t.type.schema).header_cell;for(let i=0;i<n.height;i++)if(t.nodeAt(n.map[e+i*n.width]).type!=r)return!1;return!0}var qe=class qt extends Xe{constructor(t,e=t){const r=t.node(-1),i=ot.get(r),a=t.start(-1),o=i.rectBetween(t.pos-a,e.pos-a),s=t.node(0),l=i.cellsInRect(o).filter(u=>u!=e.pos-a);l.unshift(e.pos-a);const c=l.map(u=>{const f=r.nodeAt(u);if(!f)throw new RangeError(`No cell with offset ${u} found`);const p=a+u+1;return new jo(s.resolve(p),s.resolve(p+f.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=e}map(t,e){const r=t.resolve(e.map(this.$anchorCell.pos)),i=t.resolve(e.map(this.$headCell.pos));if(Na(r)&&Na(i)&&Ma(r,i)){const a=this.$anchorCell.node(-1)!=r.node(-1);return a&&this.isRowSelection()?qt.rowSelection(r,i):a&&this.isColSelection()?qt.colSelection(r,i):new qt(r,i)}return Je.between(r,i)}content(){const t=this.$anchorCell.node(-1),e=ot.get(t),r=this.$anchorCell.start(-1),i=e.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),a={},o=[];for(let l=i.top;l<i.bottom;l++){const c=[];for(let u=l*e.width+i.left,f=i.left;f<i.right;f++,u++){const p=e.map[u];if(a[p])continue;a[p]=!0;const d=e.findCell(p);let b=t.nodeAt(p);if(!b)throw new RangeError(`No cell with offset ${p} found`);const y=i.left-d.left,g=d.right-i.right;if(y>0||g>0){let h=b.attrs;if(y>0&&(h=Sr(h,0,y)),g>0&&(h=Sr(h,h.colspan-g,g)),d.left<i.left){if(b=b.type.createAndFill(h),!b)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(h)}`)}else b=b.type.create(h,b.content)}if(d.top<i.top||d.bottom>i.bottom){const h={...b.attrs,rowspan:Math.min(d.bottom,i.bottom)-Math.max(d.top,i.top)};d.top<i.top?b=b.type.createAndFill(h):b=b.type.create(h,b.content)}c.push(b)}o.push(t.child(l).copy(Le.from(c)))}const s=this.isColSelection()&&this.isRowSelection()?t:o;return new Oe(Le.from(s),1,1)}replace(t,e=Oe.empty){const r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){const{$from:s,$to:l}=i[o],c=t.mapping.slice(r);t.replace(c.map(s.pos),c.map(l.pos),o?Oe.empty:e)}const a=Xe.findFrom(t.doc.resolve(t.mapping.slice(r).map(this.to)),-1);a&&t.setSelection(a)}replaceWith(t,e){this.replace(t,new Oe(Le.from(e),0,0))}forEachCell(t){const e=this.$anchorCell.node(-1),r=ot.get(e),i=this.$anchorCell.start(-1),a=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let o=0;o<a.length;o++)t(e.nodeAt(a[o]),i+a[o])}isColSelection(){const t=this.$anchorCell.index(-1),e=this.$headCell.index(-1);if(Math.min(t,e)>0)return!1;const r=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(t,e=t){const r=t.node(-1),i=ot.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(e.pos-a),l=t.node(0);return o.top<=s.top?(o.top>0&&(t=l.resolve(a+i.map[o.left])),s.bottom<i.height&&(e=l.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(e=l.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=l.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new qt(t,e)}isRowSelection(){const t=this.$anchorCell.node(-1),e=ot.get(t),r=this.$anchorCell.start(-1),i=e.colCount(this.$anchorCell.pos-r),a=e.colCount(this.$headCell.pos-r);if(Math.min(i,a)>0)return!1;const o=i+this.$anchorCell.nodeAfter.attrs.colspan,s=a+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,s)==e.width}eq(t){return t instanceof qt&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,e=t){const r=t.node(-1),i=ot.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(e.pos-a),l=t.node(0);return o.left<=s.left?(o.left>0&&(t=l.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(e=l.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(e=l.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=l.resolve(a+i.map[i.width*(o.top+1)-1]))),new qt(t,e)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,e){return new qt(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,r=e){return new qt(t.resolve(e),t.resolve(r))}getBookmark(){return new Ld(this.$anchorCell.pos,this.$headCell.pos)}};qe.prototype.visible=!1,Xe.jsonID("cell",qe);var Ld=class zl{constructor(t,e){this.anchor=t,this.head=e}map(t){return new zl(t.map(this.anchor),t.map(this.head))}resolve(t){const e=t.resolve(this.anchor),r=t.resolve(this.head);return e.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&e.index()<e.parent.childCount&&r.index()<r.parent.childCount&&Ma(e,r)?new qe(e,r):Xe.near(r,1)}};function Od(n){if(!(n.selection instanceof qe))return null;const t=[];return n.selection.forEachCell((e,r)=>{t.push(Et.node(r,r+e.nodeSize,{class:"selectedCell"}))}),tt.create(n.doc,t)}function Id({$from:n,$to:t}){if(n.pos==t.pos||n.pos<t.pos-6)return!1;let e=n.pos,r=t.pos,i=n.depth;for(;i>=0&&!(n.after(i+1)<n.end(i));i--,e++);for(let a=t.depth;a>=0&&!(t.before(a+1)>t.start(a));a--,r--);return e==r&&/row|table/.test(n.node(i).type.spec.tableRole)}function Fd({$from:n,$to:t}){let e,r;for(let i=n.depth;i>0;i--){const a=n.node(i);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){e=a;break}}for(let i=t.depth;i>0;i--){const a=t.node(i);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){r=a;break}}return e!==r&&t.parentOffset===0}function Pd(n,t,e){const r=(t||n).selection,i=(t||n).doc;let a,o;if(r instanceof Ze&&(o=r.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")a=qe.create(i,r.from);else if(o=="row"){const s=i.resolve(r.from+1);a=qe.rowSelection(s,s)}else if(!e){const s=ot.get(r.node),l=r.from+1,c=l+s.map[s.width*s.height-1];a=qe.create(i,l+1,c)}}else r instanceof Je&&Id(r)?a=Je.create(i,r.from):r instanceof Je&&Fd(r)&&(a=Je.create(i,r.$from.start(),r.$from.end()));return a&&(t||(t=n.tr)).setSelection(a),t}const Bd=new yr("fix-tables");function Bs(n,t,e,r){const i=n.childCount,a=t.childCount;e:for(let o=0,s=0;o<a;o++){const l=t.child(o);for(let c=s,u=Math.min(i,o+3);c<u;c++)if(n.child(c)==l){s=c+1,e+=l.nodeSize;continue e}r(l,e),s<i&&n.child(s).sameMarkup(l)?Bs(n.child(s),l,e+1,r):l.nodesBetween(0,l.content.size,r,e+1),e+=l.nodeSize}}function Ds(n,t){let e;const r=(i,a)=>{i.type.spec.tableRole=="table"&&(e=Dd(n,i,a,e))};return t?t.doc!=n.doc&&Bs(t.doc,n.doc,0,r):n.doc.descendants(r),e}function Dd(n,t,e,r){const i=ot.get(t);if(!i.problems)return r;r||(r=n.tr);const a=[];for(let l=0;l<i.height;l++)a.push(0);for(let l=0;l<i.problems.length;l++){const c=i.problems[l];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const f=u.attrs;for(let p=0;p<f.rowspan;p++)a[c.row+p]+=c.n;r.setNodeMarkup(r.mapping.map(e+1+c.pos),null,Sr(f,f.colspan-c.n,c.n))}else if(c.type=="missing")a[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(e+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(e+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=r.mapping.map(e);r.delete(u,u+t.nodeSize)}}let o,s;for(let l=0;l<a.length;l++)a[l]&&(o==null&&(o=l),s=l);for(let l=0,c=e+1;l<i.height;l++){const u=t.child(l),f=c+u.nodeSize,p=a[l];if(p>0){let d="cell";u.firstChild&&(d=u.firstChild.type.spec.tableRole);const b=[];for(let g=0;g<p;g++){const h=bt(n.schema)[d].createAndFill();h&&b.push(h)}const y=(l==0||o==l-1)&&s==l?c+1:f-1;r.insert(r.mapping.map(y),b)}c=f}return r.setMeta(Bd,{fixTables:!0})}function Xt(n){const t=n.selection,e=ci(n),r=e.node(-1),i=e.start(-1),a=ot.get(r);return{...t instanceof qe?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(e.pos-i),tableStart:i,map:a,table:r}}function zs(n,{map:t,tableStart:e,table:r},i){let a=i>0?-1:0;Md(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){const s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){const l=t.map[s],c=r.nodeAt(l);n.setNodeMarkup(n.mapping.map(e+l),null,Ps(c.attrs,i-t.colCount(l))),o+=c.attrs.rowspan-1}else{const l=a==null?bt(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,c=t.positionAt(o,i,r);n.insert(n.mapping.map(e+c),l.createAndFill())}}return n}function zd(n,t){if(!Dt(n))return!1;if(t){const e=Xt(n);t(zs(n.tr,e,e.left))}return!0}function Ud(n,t){if(!Dt(n))return!1;if(t){const e=Xt(n);t(zs(n.tr,e,e.right))}return!0}function Hd(n,{map:t,table:e,tableStart:r},i){const a=n.mapping.maps.length;for(let o=0;o<t.height;){const s=o*t.width+i,l=t.map[s],c=e.nodeAt(l),u=c.attrs;if(i>0&&t.map[s-1]==l||i<t.width-1&&t.map[s+1]==l)n.setNodeMarkup(n.mapping.slice(a).map(r+l),null,Sr(u,i-t.colCount(l)));else{const f=n.mapping.slice(a).map(r+l);n.delete(f,f+c.nodeSize)}o+=u.rowspan}}function Wd(n,t){if(!Dt(n))return!1;if(t){const e=Xt(n),r=n.tr;if(e.left==0&&e.right==e.map.width)return!1;for(let i=e.right-1;Hd(r,e,i),i!=e.left;i--){const a=e.tableStart?r.doc.nodeAt(e.tableStart-1):r.doc;if(!a)throw new RangeError("No table found");e.table=a,e.map=ot.get(a)}t(r)}return!0}function jd(n,t,e){var r;const i=bt(t.type.schema).header_cell;for(let a=0;a<n.width;a++)if(((r=t.nodeAt(n.map[a+e*n.width]))===null||r===void 0?void 0:r.type)!=i)return!1;return!0}function Us(n,{map:t,tableStart:e,table:r},i){let a=e;for(let c=0;c<i;c++)a+=r.child(c).nodeSize;const o=[];let s=i>0?-1:0;jd(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c<t.width;c++,u++)if(i>0&&i<t.height&&t.map[u]==t.map[u-t.width]){const f=t.map[u],p=r.nodeAt(f).attrs;n.setNodeMarkup(e+f,null,{...p,rowspan:p.rowspan+1}),c+=p.colspan-1}else{var l;const f=s==null?bt(r.type.schema).cell:(l=r.nodeAt(t.map[u+s*t.width]))===null||l===void 0?void 0:l.type,p=f==null?void 0:f.createAndFill();p&&o.push(p)}return n.insert(a,bt(r.type.schema).row.create(null,o)),n}function $d(n,t){if(!Dt(n))return!1;if(t){const e=Xt(n);t(Us(n.tr,e,e.top))}return!0}function Vd(n,t){if(!Dt(n))return!1;if(t){const e=Xt(n);t(Us(n.tr,e,e.bottom))}return!0}function Zd(n,{map:t,table:e,tableStart:r},i){let a=0;for(let c=0;c<i;c++)a+=e.child(c).nodeSize;const o=a+e.child(i).nodeSize,s=n.mapping.maps.length;n.delete(a+r,o+r);const l=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const f=t.map[u];if(!l.has(f)){if(l.add(f),i>0&&f==t.map[u-t.width]){const p=e.nodeAt(f).attrs;n.setNodeMarkup(n.mapping.slice(s).map(f+r),null,{...p,rowspan:p.rowspan-1}),c+=p.colspan-1}else if(i<t.height&&f==t.map[u+t.width]){const p=e.nodeAt(f),d=p.attrs,b=p.type.create({...d,rowspan:p.attrs.rowspan-1},p.content),y=t.positionAt(i+1,c,e);n.insert(n.mapping.slice(s).map(r+y),b),c+=d.colspan-1}}}}function Xd(n,t){if(!Dt(n))return!1;if(t){const e=Xt(n),r=n.tr;if(e.top==0&&e.bottom==e.map.height)return!1;for(let i=e.bottom-1;Zd(r,e,i),i!=e.top;i--){const a=e.tableStart?r.doc.nodeAt(e.tableStart-1):r.doc;if(!a)throw new RangeError("No table found");e.table=a,e.map=ot.get(e.table)}t(r)}return!0}function Hs(n){const t=n.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Gd({width:n,height:t,map:e},r){let i=r.top*n+r.left,a=i,o=(r.bottom-1)*n+r.left,s=i+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&e[a]==e[a-1]||r.right<n&&e[s]==e[s+1])return!0;a+=n,s+=n}for(let l=r.left;l<r.right;l++){if(r.top>0&&e[i]==e[i-n]||r.bottom<t&&e[o]==e[o+n])return!0;i++,o++}return!1}function Ws(n,t){const e=n.selection;if(!(e instanceof qe)||e.$anchorCell.pos==e.$headCell.pos)return!1;const r=Xt(n),{map:i}=r;if(Gd(i,r))return!1;if(t){const a=n.tr,o={};let s=Le.empty,l,c;for(let u=r.top;u<r.bottom;u++)for(let f=r.left;f<r.right;f++){const p=i.map[u*i.width+f],d=r.table.nodeAt(p);if(!(o[p]||!d))if(o[p]=!0,l==null)l=p,c=d;else{Hs(d)||(s=s.append(d.content));const b=a.mapping.map(p+r.tableStart);a.delete(b,b+d.nodeSize)}}if(l==null||c==null)return!0;if(a.setNodeMarkup(l+r.tableStart,null,{...Ps(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),s.size>0){const u=l+1+c.content.size,f=Hs(c)?l+1:u;a.replaceWith(f+r.tableStart,u+r.tableStart,s)}a.setSelection(new qe(a.doc.resolve(l+r.tableStart))),t(a)}return!0}function js(n,t){const e=bt(n.schema);return Kd(({node:r})=>e[r.type.spec.tableRole])(n,t)}function Kd(n){return(t,e)=>{const r=t.selection;let i,a;if(r instanceof qe){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{var o;if(i=Ad(r.$from),!i)return!1;a=(o=Cr(r.$from))===null||o===void 0?void 0:o.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(e){let s=i.attrs;const l=[],c=s.colwidth;s.rowspan>1&&(s={...s,rowspan:1}),s.colspan>1&&(s={...s,colspan:1});const u=Xt(t),f=t.tr;for(let d=0;d<u.right-u.left;d++)l.push(c?{...s,colwidth:c&&c[d]?[c[d]]:null}:s);let p;for(let d=u.top;d<u.bottom;d++){let b=u.map.positionAt(d,u.left,u.table);d==u.top&&(b+=i.nodeSize);for(let y=u.left,g=0;y<u.right;y++,g++)y==u.left&&d==u.top||f.insert(p=f.mapping.map(b+u.tableStart,1),n({node:i,row:d,col:y}).createAndFill(l[g]))}f.setNodeMarkup(a,n({node:i,row:u.top,col:u.left}),l[0]),r instanceof qe&&f.setSelection(new qe(f.doc.resolve(r.$anchorCell.pos),p?f.doc.resolve(p):void 0)),e(f)}return!0}}function Jd(n,t){return function(e,r){if(!Dt(e))return!1;const i=ci(e);if(i.nodeAfter.attrs[n]===t)return!1;if(r){const a=e.tr;e.selection instanceof qe?e.selection.forEachCell((o,s)=>{o.attrs[n]!==t&&a.setNodeMarkup(s,null,{...o.attrs,[n]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[n]:t}),r(a)}return!0}}function Yd(n){return function(t,e){if(!Dt(t))return!1;if(e){const r=bt(t.schema),i=Xt(t),a=t.tr,o=i.map.cellsInRect(n=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:n=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(l=>i.table.nodeAt(l));for(let l=0;l<o.length;l++)s[l].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[l],r.cell,s[l].attrs);if(a.steps.length===0)for(let l=0;l<o.length;l++)a.setNodeMarkup(i.tableStart+o[l],r.header_cell,s[l].attrs);e(a)}return!0}}function $s(n,t,e){const r=t.map.cellsInRect({left:0,top:0,right:n=="row"?t.map.width:1,bottom:n=="column"?t.map.height:1});for(let i=0;i<r.length;i++){const a=t.table.nodeAt(r[i]);if(a&&a.type!==e.header_cell)return!1}return!0}function sn(n,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?Yd(n):function(e,r){if(!Dt(e))return!1;if(r){const i=bt(e.schema),a=Xt(e),o=e.tr,s=$s("row",a,i),l=$s("column",a,i),c=(n==="column"?s:n==="row"&&l)?1:0,u=n=="column"?{left:0,top:c,right:1,bottom:a.map.height}:n=="row"?{left:c,top:0,right:a.map.width,bottom:1}:a,f=n=="column"?l?i.cell:i.header_cell:n=="row"?s?i.cell:i.header_cell:i.cell;a.map.cellsInRect(u).forEach(p=>{const d=p+a.tableStart,b=o.doc.nodeAt(d);b&&o.setNodeMarkup(d,f,b.attrs)}),r(o)}return!0}}sn("row",{useDeprecatedLogic:!0}),sn("column",{useDeprecatedLogic:!0});const Qd=sn("cell",{useDeprecatedLogic:!0});function qd(n,t){if(t<0){const e=n.nodeBefore;if(e)return n.pos-e.nodeSize;for(let r=n.index(-1)-1,i=n.before();r>=0;r--){const a=n.node(-1).child(r),o=a.lastChild;if(o)return i-1-o.nodeSize;i-=a.nodeSize}}else{if(n.index()<n.parent.childCount-1)return n.pos+n.nodeAfter.nodeSize;const e=n.node(-1);for(let r=n.indexAfter(-1),i=n.after();r<e.childCount;r++){const a=e.child(r);if(a.childCount)return i+1;i+=a.nodeSize}}return null}function Vs(n){return function(t,e){if(!Dt(t))return!1;const r=qd(ci(t),n);if(r==null)return!1;if(e){const i=t.doc.resolve(r);e(t.tr.setSelection(Je.between(i,Nd(i))).scrollIntoView())}return!0}}function eh(n,t){const e=n.selection.$anchor;for(let r=e.depth;r>0;r--)if(e.node(r).type.spec.tableRole=="table")return t&&t(n.tr.delete(e.before(r),e.after(r)).scrollIntoView()),!0;return!1}function ui(n,t){const e=n.selection;if(!(e instanceof qe))return!1;if(t){const r=n.tr,i=bt(n.schema).cell.createAndFill().content;e.forEachCell((a,o)=>{a.content.eq(i)||r.replace(r.mapping.map(o+1),r.mapping.map(o+a.nodeSize-1),new Oe(i,0,0))}),r.docChanged&&t(r)}return!0}function th(n){if(n.size===0)return null;let{content:t,openStart:e,openEnd:r}=n;for(;t.childCount==1&&(e>0&&r>0||t.child(0).type.spec.tableRole=="table");)e--,r--,t=t.child(0).content;const i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a=="row")for(let l=0;l<t.childCount;l++){let c=t.child(l).content;const u=l?0:Math.max(0,e-1),f=l<t.childCount-1?0:Math.max(0,r-1);(u||f)&&(c=La(bt(o).row,new Oe(c,u,f)).content),s.push(c)}else if(a=="cell"||a=="header_cell")s.push(e||r?La(bt(o).row,new Oe(t,e,r)).content:t);else return null;return rh(o,s)}function rh(n,t){const e=[];for(let i=0;i<t.length;i++){const a=t[i];for(let o=a.childCount-1;o>=0;o--){const{rowspan:s,colspan:l}=a.child(o).attrs;for(let c=i;c<i+s;c++)e[c]=(e[c]||0)+l}}let r=0;for(let i=0;i<e.length;i++)r=Math.max(r,e[i]);for(let i=0;i<e.length;i++)if(i>=t.length&&t.push(Le.empty),e[i]<r){const a=bt(n).cell.createAndFill(),o=[];for(let s=e[i];s<r;s++)o.push(a);t[i]=t[i].append(Le.from(o))}return{height:t.length,width:r,rows:t}}function La(n,t){const e=n.createAndFill();return new ff(e).replace(0,e.content.size,t).doc}function nh({width:n,height:t,rows:e},r,i){if(n!=r){const a=[],o=[];for(let s=0;s<e.length;s++){const l=e[s],c=[];for(let u=a[s]||0,f=0;u<r;f++){let p=l.child(f%l.childCount);u+p.attrs.colspan>r&&(p=p.type.createChecked(Sr(p.attrs,p.attrs.colspan,u+p.attrs.colspan-r),p.content)),c.push(p),u+=p.attrs.colspan;for(let d=1;d<p.attrs.rowspan;d++)a[s+d]=(a[s+d]||0)+p.attrs.colspan}o.push(Le.from(c))}e=o,n=r}if(t!=i){const a=[];for(let o=0,s=0;o<i;o++,s++){const l=[],c=e[s%t];for(let u=0;u<c.childCount;u++){let f=c.child(u);o+f.attrs.rowspan>i&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,i-f.attrs.rowspan)},f.content)),l.push(f)}a.push(Le.from(l))}e=a,t=i}return{width:n,height:t,rows:e}}function ih(n,t,e,r,i,a,o){const s=n.doc.type.schema,l=bt(s);let c,u;if(i>t.width)for(let f=0,p=0;f<t.height;f++){const d=e.child(f);p+=d.nodeSize;const b=[];let y;d.lastChild==null||d.lastChild.type==l.cell?y=c||(c=l.cell.createAndFill()):y=u||(u=l.header_cell.createAndFill());for(let g=t.width;g<i;g++)b.push(y);n.insert(n.mapping.slice(o).map(p-1+r),b)}if(a>t.height){const f=[];for(let b=0,y=(t.height-1)*t.width;b<Math.max(t.width,i);b++){const g=b>=t.width?!1:e.nodeAt(t.map[y+b]).type==l.header_cell;f.push(g?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const p=l.row.create(null,Le.from(f)),d=[];for(let b=t.height;b<a;b++)d.push(p);n.insert(n.mapping.slice(o).map(r+e.nodeSize-2),d)}return!!(c||u)}function Zs(n,t,e,r,i,a,o,s){if(o==0||o==t.height)return!1;let l=!1;for(let c=i;c<a;c++){const u=o*t.width+c,f=t.map[u];if(t.map[u-t.width]==f){l=!0;const p=e.nodeAt(f),{top:d,left:b}=t.findCell(f);n.setNodeMarkup(n.mapping.slice(s).map(f+r),null,{...p.attrs,rowspan:o-d}),n.insert(n.mapping.slice(s).map(t.positionAt(o,b,e)),p.type.createAndFill({...p.attrs,rowspan:d+p.attrs.rowspan-o})),c+=p.attrs.colspan-1}}return l}function Xs(n,t,e,r,i,a,o,s){if(o==0||o==t.width)return!1;let l=!1;for(let c=i;c<a;c++){const u=c*t.width+o,f=t.map[u];if(t.map[u-1]==f){l=!0;const p=e.nodeAt(f),d=t.colCount(f),b=n.mapping.slice(s).map(f+r);n.setNodeMarkup(b,null,Sr(p.attrs,o-d,p.attrs.colspan-(o-d))),n.insert(b+p.nodeSize,p.type.createAndFill(Sr(p.attrs,0,o-d))),c+=p.attrs.rowspan-1}}return l}function Gs(n,t,e,r,i){let a=e?n.doc.nodeAt(e-1):n.doc;if(!a)throw new Error("No table found");let o=ot.get(a);const{top:s,left:l}=r,c=l+i.width,u=s+i.height,f=n.tr;let p=0;function d(){if(a=e?f.doc.nodeAt(e-1):f.doc,!a)throw new Error("No table found");o=ot.get(a),p=f.mapping.maps.length}ih(f,o,a,e,c,u,p)&&d(),Zs(f,o,a,e,l,c,s,p)&&d(),Zs(f,o,a,e,l,c,u,p)&&d(),Xs(f,o,a,e,s,u,l,p)&&d(),Xs(f,o,a,e,s,u,c,p)&&d();for(let b=s;b<u;b++){const y=o.positionAt(b,l,a),g=o.positionAt(b,c,a);f.replace(f.mapping.slice(p).map(y+e),f.mapping.slice(p).map(g+e),new Oe(i.rows[b-s],0,0))}d(),f.setSelection(new qe(f.doc.resolve(e+o.positionAt(s,l,a)),f.doc.resolve(e+o.positionAt(u-1,c-1,a)))),t(f)}const ah=Ed({ArrowLeft:di("horiz",-1),ArrowRight:di("horiz",1),ArrowUp:di("vert",-1),ArrowDown:di("vert",1),"Shift-ArrowLeft":hi("horiz",-1),"Shift-ArrowRight":hi("horiz",1),"Shift-ArrowUp":hi("vert",-1),"Shift-ArrowDown":hi("vert",1),Backspace:ui,"Mod-Backspace":ui,Delete:ui,"Mod-Delete":ui});function fi(n,t,e){return e.eq(n.selection)?!1:(t&&t(n.tr.setSelection(e).scrollIntoView()),!0)}function di(n,t){return(e,r,i)=>{if(!i)return!1;const a=e.selection;if(a instanceof qe)return fi(e,r,Xe.near(a.$headCell,t));if(n!="horiz"&&!a.empty)return!1;const o=Ks(i,n,t);if(o==null)return!1;if(n=="horiz")return fi(e,r,Xe.near(e.doc.resolve(a.head+t),t));{const s=e.doc.resolve(o),l=Fs(s,n,t);let c;return l?c=Xe.near(l,1):t<0?c=Xe.near(e.doc.resolve(s.before(-1)),-1):c=Xe.near(e.doc.resolve(s.after(-1)),1),fi(e,r,c)}}}function hi(n,t){return(e,r,i)=>{if(!i)return!1;const a=e.selection;let o;if(a instanceof qe)o=a;else{const l=Ks(i,n,t);if(l==null)return!1;o=new qe(e.doc.resolve(l))}const s=Fs(o.$headCell,n,t);return s?fi(e,r,new qe(o.$anchorCell,s)):!1}}function oh(n,t){const e=n.state.doc,r=Cr(e.resolve(t));return r?(n.dispatch(n.state.tr.setSelection(new qe(r))),!0):!1}function sh(n,t,e){if(!Dt(n.state))return!1;let r=th(e);const i=n.state.selection;if(i instanceof qe){r||(r={width:1,height:1,rows:[Le.from(La(bt(n.state.schema).cell,e))]});const a=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),s=ot.get(a).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return r=nh(r,s.right-s.left,s.bottom-s.top),Gs(n.state,n.dispatch,o,s,r),!0}else if(r){const a=ci(n.state),o=a.start(-1);return Gs(n.state,n.dispatch,o,ot.get(a.node(-1)).findCell(a.pos-o),r),!0}else return!1}function lh(n,t){var e;if(t.button!=0||t.ctrlKey||t.metaKey)return;const r=Js(n,t.target);let i;if(t.shiftKey&&n.state.selection instanceof qe)a(n.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&(i=Cr(n.state.selection.$anchor))!=null&&((e=Oa(n,t))===null||e===void 0?void 0:e.pos)!=i.pos)a(i,t),t.preventDefault();else if(!r)return;function a(l,c){let u=Oa(n,c);const f=ur.getState(n.state)==null;if(!u||!Ma(l,u))if(f)u=l;else return;const p=new qe(l,u);if(f||!n.state.selection.eq(p)){const d=n.state.tr.setSelection(p);f&&d.setMeta(ur,l.pos),n.dispatch(d)}}function o(){n.root.removeEventListener("mouseup",o),n.root.removeEventListener("dragstart",o),n.root.removeEventListener("mousemove",s),ur.getState(n.state)!=null&&n.dispatch(n.state.tr.setMeta(ur,-1))}function s(l){const c=l,u=ur.getState(n.state);let f;if(u!=null)f=n.state.doc.resolve(u);else if(Js(n,c.target)!=r&&(f=Oa(n,t),!f))return o();f&&a(f,c)}n.root.addEventListener("mouseup",o),n.root.addEventListener("dragstart",o),n.root.addEventListener("mousemove",s)}function Ks(n,t,e){if(!(n.state.selection instanceof Je))return null;const{$head:r}=n.state.selection;for(let i=r.depth-1;i>=0;i--){const a=r.node(i);if((e<0?r.index(i):r.indexAfter(i))!=(e<0?0:a.childCount))return null;if(a.type.spec.tableRole=="cell"||a.type.spec.tableRole=="header_cell"){const o=r.before(i),s=t=="vert"?e>0?"down":"up":e>0?"right":"left";return n.endOfTextblock(s)?o:null}}return null}function Js(n,t){for(;t&&t!=n.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Oa(n,t){const e=n.posAtCoords({left:t.clientX,top:t.clientY});if(!e)return null;let{inside:r,pos:i}=e;return r>=0&&Cr(n.state.doc.resolve(r))||Cr(n.state.doc.resolve(i))}var ch=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Ia(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Ia(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Ia(n,t,e,r,i,a){let o=0,s=!0,l=t.firstChild;const c=n.firstChild;if(c){for(let f=0,p=0;f<c.childCount;f++){const{colspan:d,colwidth:b}=c.child(f).attrs;for(let y=0;y<d;y++,p++){const g=i==p?a:b&&b[y],h=g?g+"px":"";if(o+=g||r,g||(s=!1),l)l.style.width!=h&&(l.style.width=h),l=l.nextSibling;else{const m=document.createElement("col");m.style.width=h,t.appendChild(m)}}}for(;l;){var u;const f=l.nextSibling;(u=l.parentNode)===null||u===void 0||u.removeChild(l),l=f}s?(e.style.width=o+"px",e.style.minWidth=""):(e.style.width="",e.style.minWidth=o+"px")}}const xt=new yr("tableColumnResizing");function uh({handleWidth:n=5,cellMinWidth:t=25,defaultCellMinWidth:e=100,View:r=ch,lastColumnResizable:i=!0}={}){const a=new Or({key:xt,state:{init(o,s){var l;const c=(l=a.spec)===null||l===void 0||(l=l.props)===null||l===void 0?void 0:l.nodeViews,u=bt(s.schema).table.name;return r&&c&&(c[u]=(f,p)=>new r(f,e,p)),new fh(-1,!1)},apply(o,s){return s.apply(o)}},props:{attributes:o=>{const s=xt.getState(o);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,s)=>{dh(o,s,n,i)},mouseleave:o=>{hh(o)},mousedown:(o,s)=>{ph(o,s,t,e)}},decorations:o=>{const s=xt.getState(o);if(s&&s.activeHandle>-1)return vh(o,s.activeHandle)},nodeViews:{}}});return a}var fh=class _i{constructor(t,e){this.activeHandle=t,this.dragging=e}apply(t){const e=this,r=t.getMeta(xt);if(r&&r.setHandle!=null)return new _i(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new _i(e.activeHandle,r.setDragging);if(e.activeHandle>-1&&t.docChanged){let i=t.mapping.map(e.activeHandle,-1);return Na(t.doc.resolve(i))||(i=-1),new _i(i,e.dragging)}return e}};function dh(n,t,e,r){if(!n.editable)return;const i=xt.getState(n.state);if(i&&!i.dragging){const a=gh(t.target);let o=-1;if(a){const{left:s,right:l}=a.getBoundingClientRect();t.clientX-s<=e?o=Ys(n,t,"left",e):l-t.clientX<=e&&(o=Ys(n,t,"right",e))}if(o!=i.activeHandle){if(!r&&o!==-1){const s=n.state.doc.resolve(o),l=s.node(-1),c=ot.get(l),u=s.start(-1);if(c.colCount(s.pos-u)+s.nodeAfter.attrs.colspan-1==c.width-1)return}qs(n,o)}}}function hh(n){if(!n.editable)return;const t=xt.getState(n.state);t&&t.activeHandle>-1&&!t.dragging&&qs(n,-1)}function ph(n,t,e,r){var i;if(!n.editable)return!1;const a=(i=n.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,o=xt.getState(n.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const s=n.state.doc.nodeAt(o.activeHandle),l=mh(n,o.activeHandle,s.attrs);n.dispatch(n.state.tr.setMeta(xt,{setDragging:{startX:t.clientX,startWidth:l}}));function c(f){a.removeEventListener("mouseup",c),a.removeEventListener("mousemove",u);const p=xt.getState(n.state);p!=null&&p.dragging&&(yh(n,p.activeHandle,Qs(p.dragging,f,e)),n.dispatch(n.state.tr.setMeta(xt,{setDragging:null})))}function u(f){if(!f.which)return c(f);const p=xt.getState(n.state);if(p&&p.dragging){const d=Qs(p.dragging,f,e);el(n,p.activeHandle,d,r)}}return el(n,o.activeHandle,l,r),a.addEventListener("mouseup",c),a.addEventListener("mousemove",u),t.preventDefault(),!0}function mh(n,t,{colspan:e,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const a=n.domAtPos(t);let o=a.node.childNodes[a.offset].offsetWidth,s=e;if(r)for(let l=0;l<e;l++)r[l]&&(o-=r[l],s--);return o/s}function gh(n){for(;n&&n.nodeName!="TD"&&n.nodeName!="TH";)n=n.classList&&n.classList.contains("ProseMirror")?null:n.parentNode;return n}function Ys(n,t,e,r){const i=e=="right"?-r:r,a=n.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;const{pos:o}=a,s=Cr(n.state.doc.resolve(o));if(!s)return-1;if(e=="right")return s.pos;const l=ot.get(s.node(-1)),c=s.start(-1),u=l.map.indexOf(s.pos-c);return u%l.width==0?-1:c+l.map[u-1]}function Qs(n,t,e){const r=t.clientX-n.startX;return Math.max(e,n.startWidth+r)}function qs(n,t){n.dispatch(n.state.tr.setMeta(xt,{setHandle:t}))}function yh(n,t,e){const r=n.state.doc.resolve(t),i=r.node(-1),a=ot.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,l=n.state.tr;for(let c=0;c<a.height;c++){const u=c*a.width+s;if(c&&a.map[u]==a.map[u-a.width])continue;const f=a.map[u],p=i.nodeAt(f).attrs,d=p.colspan==1?0:s-a.colCount(f);if(p.colwidth&&p.colwidth[d]==e)continue;const b=p.colwidth?p.colwidth.slice():bh(p.colspan);b[d]=e,l.setNodeMarkup(o+f,null,{...p,colwidth:b})}l.docChanged&&n.dispatch(l)}function el(n,t,e,r){const i=n.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=ot.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1;let l=n.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&Ia(a,l.firstChild,l,r,s,e)}function bh(n){return Array(n).fill(0)}function vh(n,t){const e=[],r=n.doc.resolve(t),i=r.node(-1);if(!i)return tt.empty;const a=ot.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let c=0;c<a.height;c++){const u=s+c*a.width;if((s==a.width-1||a.map[u]!=a.map[u+1])&&(c==0||a.map[u]!=a.map[u-a.width])){var l;const f=a.map[u],p=o+f+i.nodeAt(f).nodeSize-1,d=document.createElement("div");d.className="column-resize-handle",!((l=xt.getState(n))===null||l===void 0)&&l.dragging&&e.push(Et.node(o+f,o+f+i.nodeAt(f).nodeSize,{class:"column-resize-dragging"})),e.push(Et.widget(p,d))}}return tt.create(n.doc,e)}function wh({allowTableNodeSelection:n=!1}={}){return new Or({key:ur,state:{init(){return null},apply(t,e){const r=t.getMeta(ur);if(r!=null)return r==-1?null:r;if(e==null||!t.docChanged)return e;const{deleted:i,pos:a}=t.mapping.mapResult(e);return i?null:a}},props:{decorations:Od,handleDOMEvents:{mousedown:lh},createSelectionBetween(t){return ur.getState(t.state)!=null?t.state.selection:null},handleTripleClick:oh,handleKeyDown:ah,handlePaste:sh},appendTransaction(t,e,r){return Pd(r,Ds(r,e),n)}})}function Fa(n,t){return t?["width",`${Math.max(t,n)}px`]:["min-width",`${n}px`]}function tl(n,t,e,r,i,a){var o;let s=0,l=!0,c=t.firstChild;const u=n.firstChild;if(u!==null)for(let f=0,p=0;f<u.childCount;f+=1){const{colspan:d,colwidth:b}=u.child(f).attrs;for(let y=0;y<d;y+=1,p+=1){const g=i===p?a:b&&b[y],h=g?`${g}px`:"";if(s+=g||r,g||(l=!1),c){if(c.style.width!==h){const[m,w]=Fa(r,g);c.style.setProperty(m,w)}c=c.nextSibling}else{const m=document.createElement("col"),[w,A]=Fa(r,g);m.style.setProperty(w,A),t.appendChild(m)}}}for(;c;){const f=c.nextSibling;(o=c.parentNode)===null||o===void 0||o.removeChild(c),c=f}l?(e.style.width=`${s}px`,e.style.minWidth=""):(e.style.width="",e.style.minWidth=`${s}px`)}class _h{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),tl(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,tl(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type==="attributes"&&(t.target===this.table||this.colgroup.contains(t.target))}}function kh(n,t,e,r){let i=0,a=!0;const o=[],s=n.firstChild;if(!s)return{};for(let f=0,p=0;f<s.childCount;f+=1){const{colspan:d,colwidth:b}=s.child(f).attrs;for(let y=0;y<d;y+=1,p+=1){const g=e===p?r:b&&b[y];i+=g||t,g||(a=!1);const[h,m]=Fa(t,g);o.push(["col",{style:`${h}: ${m}`}])}}const l=a?`${i}px`:"",c=a?"":`${i}px`;return{colgroup:["colgroup",{},...o],tableWidth:l,tableMinWidth:c}}function rl(n,t){return t?n.createChecked(null,t):n.createAndFill()}function Eh(n){if(n.cached.tableNodeTypes)return n.cached.tableNodeTypes;const t={};return Object.keys(n.nodes).forEach(e=>{const r=n.nodes[e];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),n.cached.tableNodeTypes=t,t}function Ch(n,t,e,r,i){const a=Eh(n),o=[],s=[];for(let c=0;c<e;c+=1){const u=rl(a.cell,i);if(u&&s.push(u),r){const f=rl(a.header_cell,i);f&&o.push(f)}}const l=[];for(let c=0;c<t;c+=1)l.push(a.row.createChecked(null,r&&c===0?o:s));return a.table.createChecked(null,l)}function Sh(n){return n instanceof qe}const pi=({editor:n})=>{const{selection:t}=n.state;if(!Sh(t))return!1;let e=0;const r=ze.findParentNodeClosestToPos(t.ranges[0].$from,a=>a.type.name==="table");return r==null||r.node.descendants(a=>{if(a.type.name==="table")return!1;["tableCell","tableHeader"].includes(a.type.name)&&(e+=1)}),e===t.ranges.length?(n.commands.deleteTable(),!0):!1},xh=ze.Node.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:_h,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:n,HTMLAttributes:t}){const{colgroup:e,tableWidth:r,tableMinWidth:i}=kh(n,this.options.cellMinWidth),a=["table",ze.mergeAttributes(this.options.HTMLAttributes,t,{style:r?`width: ${r}`:`min-width: ${i}`}),e,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},a]:a},addCommands(){return{insertTable:({rows:n=3,cols:t=3,withHeaderRow:e=!0}={})=>({tr:r,dispatch:i,editor:a})=>{const o=Ch(a.schema,n,t,e);if(i){const s=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(Je.near(r.doc.resolve(s)))}return!0},addColumnBefore:()=>({state:n,dispatch:t})=>zd(n,t),addColumnAfter:()=>({state:n,dispatch:t})=>Ud(n,t),deleteColumn:()=>({state:n,dispatch:t})=>Wd(n,t),addRowBefore:()=>({state:n,dispatch:t})=>$d(n,t),addRowAfter:()=>({state:n,dispatch:t})=>Vd(n,t),deleteRow:()=>({state:n,dispatch:t})=>Xd(n,t),deleteTable:()=>({state:n,dispatch:t})=>eh(n,t),mergeCells:()=>({state:n,dispatch:t})=>Ws(n,t),splitCell:()=>({state:n,dispatch:t})=>js(n,t),toggleHeaderColumn:()=>({state:n,dispatch:t})=>sn("column")(n,t),toggleHeaderRow:()=>({state:n,dispatch:t})=>sn("row")(n,t),toggleHeaderCell:()=>({state:n,dispatch:t})=>Qd(n,t),mergeOrSplit:()=>({state:n,dispatch:t})=>Ws(n,t)?!0:js(n,t),setCellAttribute:(n,t)=>({state:e,dispatch:r})=>Jd(n,t)(e,r),goToNextCell:()=>({state:n,dispatch:t})=>Vs(1)(n,t),goToPreviousCell:()=>({state:n,dispatch:t})=>Vs(-1)(n,t),fixTables:()=>({state:n,dispatch:t})=>(t&&Ds(n),!0),setCellSelection:n=>({tr:t,dispatch:e})=>{if(e){const r=qe.create(t.doc,n.anchorCell,n.headCell);t.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:pi,"Mod-Backspace":pi,Delete:pi,"Mod-Delete":pi}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[uh({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],wh({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(n){const t={name:n.name,options:n.options,storage:n.storage};return{tableRole:ze.callOrReturn(ze.getExtensionField(n,"tableRole",t))}}}),Th=ze.Node.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:n}){return["tr",ze.mergeAttributes(this.options.HTMLAttributes,n),0]}}),Ah=/^\s*(\[([( |x])?\])\s$/,Rh=ze.Node.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const t=n.getAttribute("data-checked");return t===""||t==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:t}){return["li",ze.mergeAttributes(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:t,getPos:e,editor:r})=>{const i=document.createElement("li"),a=document.createElement("label"),o=document.createElement("span"),s=document.createElement("input"),l=document.createElement("div"),c=()=>{var u,f;s.ariaLabel=((f=(u=this.options.a11y)===null||u===void 0?void 0:u.checkboxLabel)===null||f===void 0?void 0:f.call(u,n,s.checked))||`Task item checkbox for ${n.textContent||"empty task item"}`};return c(),a.contentEditable="false",s.type="checkbox",s.addEventListener("mousedown",u=>u.preventDefault()),s.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}const{checked:f}=u.target;r.isEditable&&typeof e=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const d=e();if(typeof d!="number")return!1;const b=p.doc.nodeAt(d);return p.setNodeMarkup(d,void 0,{...b==null?void 0:b.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,f)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,f])=>{i.setAttribute(u,f)}),i.dataset.checked=n.attrs.checked,s.checked=n.attrs.checked,a.append(s,o),i.append(a,l),Object.entries(t).forEach(([u,f])=>{i.setAttribute(u,f)}),{dom:i,contentDOM:l,update:u=>u.type!==this.type?!1:(i.dataset.checked=u.attrs.checked,s.checked=u.attrs.checked,c(),!0)}}},addInputRules(){return[ze.wrappingInputRule({find:Ah,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),Nh=ze.Node.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",ze.mergeAttributes(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),Mh=ze.Node.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const t=n.getAttribute("colwidth");return t?t.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:n}){return["td",ze.mergeAttributes(this.options.HTMLAttributes,n),0]}}).extend({addAttributes(){var n;return{...(n=this.parent)==null?void 0:n.call(this),backgroundColor:{default:null,parseHTML:t=>t.getAttribute("data-background-color")||t.style.backgroundColor,renderHTML:t=>t.backgroundColor?{"data-background-color":t.backgroundColor,style:`background-color: ${t.backgroundColor}`}:{}}}}}),Lh=ze.Node.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const t=n.getAttribute("colwidth");return t?t.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:n}){return["th",ze.mergeAttributes(this.options.HTMLAttributes,n),0]}}).extend({addAttributes(){var n;return{...(n=this.parent)==null?void 0:n.call(this),backgroundColor:{default:null,parseHTML:t=>t.getAttribute("data-background-color")||t.style.backgroundColor,renderHTML:t=>t.backgroundColor?{"data-background-color":t.backgroundColor,style:`background-color: ${t.backgroundColor}`}:{}}}}}),Oh=kf.extend({addAttributes(){return{background:{parseHTML:n=>{if(n.style.backgroundColor||n.style.background)return`${n.style.backgroundColor||n.style.background}`}}}},renderHTML({HTMLAttributes:n}){var t;if(n.background){const e=((t=n.style)==null?void 0:t.split(";"))||[];e.push(`background:${n.background}`),n.style=e.join(";")}return["span",ze.mergeAttributes(this.options.HTMLAttributes,n),0]}}),Ih=ze.Extension.create({name:"LineSpacing",addOptions(){return{types:["paragraph"]}},addStorage(){return{lineHeight:1.3}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:this.storage.lineHeight,parseHTML:n=>n.style.lineHeight||this.storage.lineHeight,renderHTML:n=>n.lineHeight?{style:`line-height: ${n.lineHeight}`}:{}}}}]},addCommands(){return{setLineSpacing:n=>({commands:t})=>this.storage.lineHeight===n?!1:(this.storage.lineHeight=n,this.options.types.every(e=>t.updateAttributes(e,{lineHeight:n})))}}}),Fh=ze.Node.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",ze.mergeAttributes(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}).extend({addAttributes(){return{minHeight:{default:"1em",renderHTML:n=>({style:`min-height: ${n.minHeight}`})}}}});function Ph(n,t){let e=[];const r=[];let i=0;if(!t)return[];n==null||n.descendants((a,o)=>{a.isText?e[i]?e[i]={text:e[i].text+a.text,pos:e[i].pos}:e[i]={text:`${a.text}`,pos:o}:i+=1}),e=e.filter(Boolean);for(let a=0;a<e.length;a+=1){const{text:o,pos:s}=e[a],l=Array.from(o.matchAll(t)).filter(([c])=>c.trim());for(let c=0;c<l.length;c+=1){const u=l[c];if(u[0]==="")break;u.index!==void 0&&r.push({from:s+u.index,to:s+u.index+u[0].length})}}return r}const Bh=(n,t,e)=>RegExp(t?n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"):n,e?"gu":"gui");function Dh(n,t,e,r){const i=[];for(let a=0;a<r.length;a+=1){const o=r[a],s=a===t?e.join(" "):e[0];i.push(Et.inline(o.from,o.to,{class:s}))}return tt.create(n,i)}const zh=(n,t,e,{state:r,dispatch:i})=>{if(t<0||t>=e.length||!e[t])return;const{from:o,to:s}=e[t];i&&i(r.tr.insertText(n,o,s))},Uh=(n,t,e,r)=>{const i=t+1;if(!r[i])return null;const{from:a,to:o}=r[t],s=o-a-n.length+e,{from:l,to:c}=r[i];return r[i]={to:c-s,from:l-s},[s,r]},Hh=(n,t,{tr:e,dispatch:r})=>{let i=0,a=t.slice();if(a.length){for(let o=0;o<a.length;o+=1){const{from:s,to:l}=a[o];e.insertText(n,s,l);const c=Uh(n,o,i,a);c&&(i=c[0],a=c[1])}r(e)}},Wh=new yr("searchAndReplacePlugin"),jh=ze.Extension.create({name:"searchAndReplace",addOptions(){return{searchResultClass:"search-result",currentSearchClass:"current-search",caseSensitive:!1,disableRegex:!0}},addStorage(){return{total:0,currentIndex:0,lastIndex:0,searchTerm:"",replaceTerm:"",results:[],lastSearchTerm:"",canPrev:!1,canNext:!1}},addCommands(){return{setSearchTerm:n=>({editor:t})=>(t.storage.searchAndReplace.currentIndex=0,t.storage.searchAndReplace.searchTerm=n,!1),setReplaceTerm:n=>({editor:t})=>(t.storage.searchAndReplace.replaceTerm=n,!1),replace:()=>({editor:n,state:t,dispatch:e})=>{const{replaceTerm:r,results:i,currentIndex:a}=n.storage.searchAndReplace;return zh(r,a,i,{state:t,dispatch:e}),n.storage.searchAndReplace.currentIndex=0,!1},replaceAll:()=>({editor:n,tr:t,dispatch:e})=>{const{replaceTerm:r,results:i}=n.storage.searchAndReplace;return Hh(r,i,{tr:t,dispatch:e}),n.storage.searchAndReplace.currentIndex=0,!1},nextSearch:()=>({editor:n})=>(n.storage.searchAndReplace.currentIndex+=1,!1),prevSearch:()=>({editor:n})=>(n.storage.searchAndReplace.currentIndex-=1,!1)}},addProseMirrorPlugins(){const n=this.editor,{searchResultClass:t,currentSearchClass:e,disableRegex:r,caseSensitive:i}=this.options,a=s=>n.storage.searchAndReplace.lastSearchTerm=s,o=s=>n.storage.searchAndReplace.lastIndex=s;return[new Or({key:Wh,state:{init:()=>tt.empty,apply({doc:s,docChanged:l},c){const{searchTerm:u,lastSearchTerm:f,lastIndex:p,currentIndex:d,total:b}=n.storage.searchAndReplace;if(!l&&f===u)return p===d?c:(o(d),n.storage.searchAndReplace.canPrev=d>0,n.storage.searchAndReplace.canNext=d<b-1,Dh(s,d,[t,e],n.storage.searchAndReplace.results));if(o(d),a(u),!u)return n.storage.searchAndReplace.total=0,tt.empty;const y=Ph(s,Bh(u,r,i));n.storage.searchAndReplace.total=y.length,n.storage.searchAndReplace.canPrev=!1,n.storage.searchAndReplace.canNext=y.length>0,n.storage.searchAndReplace.results=y;const g=[],h=[t,e];for(let m=0;m<y.length;m+=1){const w=y[m],A=m===0?h.join(" "):h[0];g.push(Et.inline(w.from,w.to,{class:A}))}return tt.create(s,g)}},props:{decorations(s){return this.getState(s)}}})]}}),$h=[Fh,su.configure({multicolor:!0}),Oh,lu,cu.configure({types:["heading","paragraph"]}),fu.configure({allowBase64:!0,inline:!0}),jh.configure(),wf,Ih,xf,xh.configure({resizable:!0}),Mh,Lh,Th,Tf,Af,Ef,Sf,Rh,Nh];/*! Element Plus Icons Vue v2.3.2 */var Vh=S.defineComponent({name:"Link",__name:"link",setup(n){return(t,e)=>(S.openBlock(),S.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[S.createElementVNode("path",{fill:"currentColor",d:"M715.648 625.152 670.4 579.904l90.496-90.56c75.008-74.944 85.12-186.368 22.656-248.896-62.528-62.464-173.952-52.352-248.96 22.656L444.16 353.6l-45.248-45.248 90.496-90.496c100.032-99.968 251.968-110.08 339.456-22.656 87.488 87.488 77.312 239.424-22.656 339.456l-90.496 90.496zm-90.496 90.496-90.496 90.496C434.624 906.112 282.688 916.224 195.2 828.8c-87.488-87.488-77.312-239.424 22.656-339.456l90.496-90.496 45.248 45.248-90.496 90.56c-75.008 74.944-85.12 186.368-22.656 248.896 62.528 62.464 173.952 52.352 248.96-22.656l90.496-90.496zm0-362.048 45.248 45.248L398.848 670.4 353.6 625.152z"})]))}}),Zh=Vh,Xh=S.defineComponent({name:"Picture",__name:"picture",setup(n){return(t,e)=>(S.openBlock(),S.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[S.createElementVNode("path",{fill:"currentColor",d:"M160 160v704h704V160zm-32-64h768a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H128a32 32 0 0 1-32-32V128a32 32 0 0 1 32-32"}),S.createElementVNode("path",{fill:"currentColor",d:"M384 288q64 0 64 64t-64 64-64-64 64-64M185.408 876.992l-50.816-38.912L350.72 556.032a96 96 0 0 1 134.592-17.856l1.856 1.472 122.88 99.136a32 32 0 0 0 44.992-4.864l216-269.888 49.92 39.936-215.808 269.824-.256.32a96 96 0 0 1-135.04 14.464l-122.88-99.072-.64-.512a32 32 0 0 0-44.8 5.952z"})]))}}),Gh=Xh;const Kh={class:"catalogue-container"},Jh={class:"catalogue-header"},Yh={class:"catalogue-content"},Qh={key:0,class:"empty-hint"},qh=["onClick"],ep=S.defineComponent({__name:"CatalogueList",props:{editor:{},isHeadingChange:{type:Boolean},isCatalogCollapse:{type:Boolean}},emits:["update:isCatalogCollapse","locateHeading"],setup(n,{emit:t}){const e=n,r=t,i=S.ref([]);S.onMounted(()=>{a()}),S.watch(()=>e.isHeadingChange,()=>{a()});function a(){if(!e.editor)return;const s=e.editor.options.element,l=s==null?void 0:s.children[0],c=(l==null?void 0:l.childNodes)??[],u=[];let f=0;c.forEach(p=>{if(["H1","H2","H3","H4","H5","H6"].includes(p.tagName)){const d=parseInt(p.tagName.replace("H",""));u.push({level:d,text:p.textContent||"",index:f}),f++}}),i.value=u}function o(s,l){r("locateHeading",{...s,index:l})}return(s,l)=>(S.openBlock(),S.createElementBlock(S.Fragment,null,[S.withDirectives(S.createElementVNode("div",Kh,[S.createElementVNode("div",Jh,[l[2]||(l[2]=S.createElementVNode("span",{class:"title"},"目录",-1)),S.createElementVNode("i",{class:"ri-close-line close-icon",onClick:l[0]||(l[0]=c=>r("update:isCatalogCollapse",!1))})]),S.createElementVNode("div",Yh,[i.value.length===0?(S.openBlock(),S.createElementBlock("div",Qh," 暂无目录 ")):S.createCommentVNode("",!0),(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(i.value,(c,u)=>(S.openBlock(),S.createElementBlock("div",{key:u,class:S.normalizeClass(["catalogue-item",[`level-${c.level}`]]),onClick:f=>o(c,u)},S.toDisplayString(c.text||"无标题"),11,qh))),128))])],512),[[S.vShow,n.isCatalogCollapse]]),S.withDirectives(S.createElementVNode("div",{class:"catalogue-toggle",onClick:l[1]||(l[1]=c=>r("update:isCatalogCollapse",!0))},[...l[3]||(l[3]=[S.createElementVNode("i",{class:"ri-menu-line"},null,-1)])],512),[[S.vShow,!n.isCatalogCollapse]])],64))}}),bm="",tp=Ft(ep,[["__scopeId","data-v-e8b5969a"]]),rp={class:"footer-toolbar"},np={class:"left-section"},ip={key:0,class:"word-count"},ap={class:"right-section"},op={class:"zoom-text"},sp=S.defineComponent({__name:"FooterToolbar",props:{editor:{},editorRef:{},scaleRatio:{}},emits:["update:scaleRatio"],setup(n,{emit:t}){const e=n,r=t,i=S.ref(100);S.watch(()=>e.scaleRatio,s=>{i.value=Math.round(s*100)},{immediate:!0});const a=S.computed(()=>{var s;return e.editor?((s=e.editor.storage.characterCount)==null?void 0:s.characters())||e.editor.getText().length:0});function o(s){r("update:scaleRatio",s/100)}return(s,l)=>{const c=S.resolveComponent("el-slider");return S.openBlock(),S.createElementBlock("div",rp,[S.createElementVNode("div",np,[a.value?(S.openBlock(),S.createElementBlock("span",ip," 字数: "+S.toDisplayString(a.value),1)):S.createCommentVNode("",!0)]),S.createElementVNode("div",ap,[S.createVNode(c,{modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=u=>i.value=u),min:50,max:200,step:10,"show-tooltip":!1,style:{width:"120px"},onChange:o},null,8,["modelValue"]),S.createElementVNode("span",op,S.toDisplayString(i.value)+"%",1)])])}}}),vm="",lp=Ft(sp,[["__scopeId","data-v-7c7b1a7b"]]),cp={class:"editor-page-main"},up={class:"editor-header"},fp={class:"editor-body"},dp={id:"editor",class:"editor-area-container"},hp=S.defineComponent({__name:"WordEditor",props:{content:{},editable:{type:Boolean,default:!0}},emits:["save","update","change"],setup(n,{expose:t,emit:e}){const r=n,i=e,a=S.ref(null),o=S.ref(null),s=S.ref(!0),l=S.ref(),c=S.ref(!1),u=S.ref(r.editable),f=S.ref(!0);S.onMounted(async()=>{c.value=!0,b(),c.value=!1,S.nextTick(()=>{o.value&&(o.value.scrollTop=0)}),window.addEventListener("beforeunload",p)});function p(M){if(!f.value)return M.preventDefault(),M.returnValue="数据暂未保存,是否要离开该页面","数据暂未保存,是否要离开该页面"}S.onBeforeUnmount(()=>{var M;window.removeEventListener("beforeunload",p),(M=l.value)==null||M.destroy(),l.value=void 0,window.removeEventListener("resize",y)});let d=!1;function b(){const M=[Hl.configure({paragraph:!1}),...$h];l.value=new Ja.Editor({content:r.content||"",editable:u.value,onCreate:()=>{d=!0,y()},onUpdate:()=>{var P;v(),i("update",((P=l.value)==null?void 0:P.getHTML())||"")},onSelectionUpdate:P=>{d&&P.transaction.docChanged&&(f.value=!1,i("change",!1))},extensions:M}),window.addEventListener("resize",y)}S.watch(()=>r.editable,M=>{var P;u.value=M,(P=l.value)==null||P.setEditable(M)}),S.watch(()=>r.content,M=>{l.value&&M!==l.value.getHTML()&&l.value.commands.setContent(M)}),S.watch([()=>s.value],()=>{y()});const y=yc(()=>{const M=window.innerWidth,P=document.getElementById("editor-content"),O=P==null?void 0:P.offsetWidth;O&&(M<O+270+270&&s.value?(P.parentElement&&(P.parentElement.style.justifyContent="flex-start"),P.style.marginLeft="270px"):(P.parentElement&&(P.parentElement.style.justifyContent="center"),P.style.marginLeft="50px"))},10),g=S.ref(!1),h=S.ref(1);function m(M){var P;(P=l.value)==null||P.commands.insertContent(M)}function w(M){var R;const P=M.target,O=(R=P==null?void 0:P.files)==null?void 0:R[0];if(!O)return;const ne=new FileReader;ne.readAsDataURL(O),ne.onload=function(){var I;(I=l.value)==null||I.commands.insertContent({type:"image",attrs:{src:ne.result}})}}const A=S.ref(!1);function v(){A.value=!A.value}function T(M){var U;const P=document.getElementById("editor"),O=(U=l.value)==null?void 0:U.options.element,ne=O==null?void 0:O.children[0],E=[...(ne==null?void 0:ne.childNodes)??[]].filter(Z=>["H1","H2","H3","H4","H5","H6"].includes(Z.tagName)).find((Z,$)=>M.index===$);if(E&&P){const Z=E.offsetTop<10?0:E.offsetTop-10;P.scrollTop=Z}}function N(){l.value&&(f.value=!0,i("change",!0),i("save",l.value.getHTML()))}return t({getContent:()=>{var M;return((M=l.value)==null?void 0:M.getHTML())||""},getJSON:()=>{var M;return(M=l.value)==null?void 0:M.getJSON()},setContent:M=>{var P;return(P=l.value)==null?void 0:P.commands.setContent(M)},getEditor:()=>l.value}),(M,P)=>{var Z,$,q;const O=S.resolveComponent("el-divider"),ne=S.resolveComponent("el-dropdown-item"),R=S.resolveComponent("el-dropdown-menu"),I=S.resolveComponent("el-dropdown"),E=S.resolveComponent("el-button"),U=S.resolveDirective("loading");return S.withDirectives((S.openBlock(),S.createElementBlock("div",{class:"editor-page-container",ref_key:"editorRef",ref:a},[S.createElementVNode("div",cp,[S.createElementVNode("div",up,[S.createVNode(S.unref(lt),{type:"action",desc:"撤销",icon:"ri-arrow-go-back-line",onClick:P[0]||(P[0]=J=>{var re;return(re=l.value)==null?void 0:re.chain().focus().undo().run()}),disabled:!((Z=l.value)!=null&&Z.can().chain().focus().undo().run())||!u.value},null,8,["disabled"]),S.createVNode(S.unref(lt),{type:"action",desc:"重做",icon:"ri-arrow-go-forward-line",onClick:P[1]||(P[1]=J=>{var re;return(re=l.value)==null?void 0:re.chain().focus().redo().run()}),disabled:!(($=l.value)!=null&&$.can().chain().focus().redo().run())||!u.value},null,8,["disabled"]),S.createVNode(S.unref(lt),{type:"action",desc:"清除样式",icon:"ri-eraser-fill",onClick:P[2]||(P[2]=J=>{var re;return(re=l.value)==null?void 0:re.chain().focus().unsetAllMarks().run()}),disabled:!((q=l.value)!=null&&q.can().chain().focus().unsetAllMarks().run())||!u.value},null,8,["disabled"]),S.createVNode(O,{direction:"vertical"}),S.createVNode(S.unref(Ic),{editor:l.value,editable:u.value},null,8,["editor","editable"]),S.createVNode(S.unref(Mc),{editor:l.value,editable:u.value},null,8,["editor","editable"]),S.createVNode(S.unref(Fc),{editor:l.value,editable:u.value},null,8,["editor","editable"]),S.createVNode(S.unref($c),{editor:l.value,editable:u.value},null,8,["editor","editable"]),S.createVNode(S.unref(Wc),{editor:l.value,editable:u.value},null,8,["editor","editable"]),S.createVNode(O,{direction:"vertical"}),S.createVNode(S.unref(Dc),{editor:l.value,editable:u.value},null,8,["editor","editable"]),S.createVNode(O,{direction:"vertical"}),S.createVNode(I,{trigger:"click",disabled:!u.value},{dropdown:S.withCtx(()=>[S.createVNode(R,{style:{overflow:"hidden"}},{default:S.withCtx(()=>[S.createVNode(ne,{icon:S.unref(Gh),class:"dropdown-item"},{default:S.withCtx(()=>[S.createElementVNode("input",{type:"file",id:"file",class:"select-file",title:"",accept:"image/*",onChange:w},null,32),P[8]||(P[8]=S.createElementVNode("span",{class:"desc"},"图片",-1))]),_:1},8,["icon"]),S.createVNode(ne,{icon:S.unref(Zh),class:"dropdown-item",onClick:P[3]||(P[3]=J=>g.value=!0)},{default:S.withCtx(()=>[...P[9]||(P[9]=[S.createElementVNode("span",{class:"desc"},"链接",-1)])]),_:1},8,["icon"]),S.createVNode(ne,{class:"dropdown-item",onClick:P[4]||(P[4]=J=>{var re;return(re=l.value)==null?void 0:re.chain().focus().setHorizontalRule().run()})},{default:S.withCtx(()=>[...P[10]||(P[10]=[S.createElementVNode("i",{class:"ri-separator"},null,-1),S.createElementVNode("span",{class:"desc"},"分割线",-1)])]),_:1}),S.createVNode(ne,{class:"dropdown-item"},{default:S.withCtx(()=>[S.createVNode(S.unref(nu),{"insert-content":m})]),_:1})]),_:1})]),default:S.withCtx(()=>[P[11]||(P[11]=S.createElementVNode("div",{style:{outline:"none",cursor:"pointer","font-size":"14px"}},[S.createElementVNode("i",{class:"ri-add-circle-fill"}),S.createElementVNode("span",null,"插入"),S.createElementVNode("i",{class:"ri-arrow-drop-down-line"})],-1))]),_:1},8,["disabled"]),S.createVNode(S.unref(qc),{editor:l.value,editable:u.value},null,8,["editor","editable"]),S.createVNode(O,{direction:"vertical"}),S.createVNode(E,{type:"primary",size:"small",onClick:N},{default:S.withCtx(()=>[...P[12]||(P[12]=[S.createTextVNode("保存",-1)])]),_:1})]),S.createElementVNode("div",fp,[S.createElementVNode("div",{class:"catalogue-list",style:S.normalizeStyle({width:s.value?"265px":"0px"})},[S.createVNode(tp,{editor:l.value,isHeadingChange:A.value,isCatalogCollapse:s.value,"onUpdate:isCatalogCollapse":P[5]||(P[5]=J=>s.value=J),onLocateHeading:T},null,8,["editor","isHeadingChange","isCatalogCollapse"])],4),S.createElementVNode("div",{ref_key:"editorAreaRef",ref:o,class:"editor-area"},[S.createElementVNode("div",dp,[S.createVNode(S.unref(Ja.EditorContent),{class:"doc-editor-content",id:"editor-content",style:S.normalizeStyle({transform:`scale(${h.value})`,"transform-origin":"top left"}),editor:l.value},null,8,["style","editor"])])],512)])]),S.createVNode(lp,{editor:l.value,"editor-ref":a.value,"scale-ratio":h.value,"onUpdate:scaleRatio":P[6]||(P[6]=J=>h.value=J)},null,8,["editor","editor-ref","scale-ratio"]),S.createVNode(S.unref(iu),{editor:l.value,visible:g.value,"onUpdate:visible":P[7]||(P[7]=J=>g.value=J)},null,8,["editor","visible"])])),[[U,c.value]])}}}),wm="",_m="",pp=Ft(hp,[["__scopeId","data-v-e75ae4bc"]]),mp={class:"excel-editor-container"},gp=["id"],yp=S.defineComponent({__name:"ExcelEditor",props:{content:{},editable:{type:Boolean,default:!0},title:{default:"未命名表格"}},emits:["save","update"],setup(n,{expose:t,emit:e}){const r=n,i=e,a=S.ref(`luckysheet-${Date.now()}`);let o=null;S.onMounted(()=>{if(typeof window.luckysheet>"u"){console.error("Luckysheet 未加载,请在 index.html 中引入 luckysheet 资源");return}const c={container:a.value,showinfobar:!1,lang:"zh",title:r.title,hook:{cellUpdated:function(){const u=window.luckysheet.getAllSheets();i("update",u)}}};r.content&&r.content.length>0&&(c.data=r.content),window.luckysheet.create(c),o=window.luckysheet}),S.onBeforeUnmount(()=>{const c=document.getElementById(a.value);c&&(c.innerHTML="")});function s(){if(o){const c=o.getAllSheets();i("save",c)}}function l(){o&&console.log("下载功能需要配合后端实现")}return t({getContent:()=>(o==null?void 0:o.getAllSheets())||[],setContent:c=>{console.warn("Luckysheet 不支持动态更新数据")}}),(c,u)=>(S.openBlock(),S.createElementBlock("div",mp,[S.createElementVNode("div",{class:"editor-toolbar"},[S.createElementVNode("button",{onClick:s},"保存"),S.createElementVNode("button",{onClick:l},"下载")]),S.createElementVNode("div",{id:a.value,class:"luckysheet-container"},null,8,gp)]))}}),km="",bp=Ft(yp,[["__scopeId","data-v-a8c6ba69"]]),vp={class:"document-editor-page"},wp={key:0,class:"loading"},_p={key:1,class:"error"},kp=S.defineComponent({__name:"DocumentEditorPage",props:{fileUrl:{},fileType:{},documentId:{},editable:{type:Boolean,default:!0},loadHandler:{},saveHandler:{}},emits:["saved","error","loaded"],setup(n,{emit:t}){const e=n,r=t,i=Ul.useRoute(),a=S.ref(!1),o=S.ref(""),s=S.ref("docx"),l=S.ref(""),c=S.ref("");S.onMounted(async()=>{const b=e.documentId||i.query.id,y=e.fileUrl||i.query.fileUrl,g=e.fileType||i.query.fileType;b&&e.loadHandler?await u(b):y&&g&&await f(y,g)});async function u(b){if(e.loadHandler){a.value=!0,o.value="";try{const y=await e.loadHandler(b);s.value=y.type,l.value=y.content,c.value=y.title,r("loaded",y)}catch(y){o.value=y instanceof Error?y.message:"加载文档失败",r("error",o.value)}finally{a.value=!1}}}async function f(b,y){a.value=!0,o.value="";try{const{convertDocx:g,convertExcel:h,getFileNameFromUrl:m}=await Promise.resolve().then(()=>q0),w=await fetch(b);if(!w.ok)throw new Error("文件下载失败");const A=await w.blob(),v=m(b);let T;if(y==="docx"?T=await g(A):T=await h(A),s.value=y,l.value=T,c.value=v,e.saveHandler){const N={type:y,content:T,fileName:v},M=await Promise.resolve(e.saveHandler(N));r("saved",{_id:M._id,result:N})}}catch(g){o.value=g instanceof Error?g.message:"文件处理失败",r("error",o.value)}finally{a.value=!1}}async function p(b){if(e.saveHandler){const y={type:s.value,content:b,fileName:c.value};try{const g=await Promise.resolve(e.saveHandler(y));r("saved",{_id:g._id,result:y})}catch(g){const h=g instanceof Error?g.message:"保存失败";o.value=h,r("error",h)}}}function d(b){l.value=b}return(b,y)=>(S.openBlock(),S.createElementBlock("div",vp,[a.value?(S.openBlock(),S.createElementBlock("div",wp,"加载中...")):o.value?(S.openBlock(),S.createElementBlock("div",_p,S.toDisplayString(o.value),1)):(S.openBlock(),S.createElementBlock(S.Fragment,{key:2},[s.value==="docx"?(S.openBlock(),S.createBlock(pp,{key:0,content:l.value,editable:n.editable,onSave:p,onUpdate:d},null,8,["content","editable"])):s.value==="xlsx"?(S.openBlock(),S.createBlock(bp,{key:1,content:l.value,title:c.value,editable:n.editable,onSave:p,onUpdate:d},null,8,["content","title","editable"])):S.createCommentVNode("",!0)],64))]))}}),Em="",nl=Ft(kp,[["__scopeId","data-v-c638ed34"]]),Ep={install(n){n.component("DocumentEditorPage",nl)}};var Ot=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function il(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function fr(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var al={exports:{}};/*!
|
|
12
|
+
|
|
13
|
+
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
|
|
14
|
+
<http://stuartk.com/jszip>
|
|
15
|
+
|
|
16
|
+
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
|
|
17
|
+
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
|
|
18
|
+
|
|
19
|
+
JSZip uses the library pako released under the MIT license :
|
|
20
|
+
https://github.com/nodeca/pako/blob/main/LICENSE
|
|
21
|
+
*/(function(n,t){(function(e){n.exports=e()})(function(){return function e(r,i,a){function o(c,u){if(!i[c]){if(!r[c]){var f=typeof fr=="function"&&fr;if(!u&&f)return f(c,!0);if(s)return s(c,!0);var p=new Error("Cannot find module '"+c+"'");throw p.code="MODULE_NOT_FOUND",p}var d=i[c]={exports:{}};r[c][0].call(d.exports,function(b){var y=r[c][1][b];return o(y||b)},d,d.exports,e,r,i,a)}return i[c].exports}for(var s=typeof fr=="function"&&fr,l=0;l<a.length;l++)o(a[l]);return o}({1:[function(e,r,i){var a=e("./utils"),o=e("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(l){for(var c,u,f,p,d,b,y,g=[],h=0,m=l.length,w=m,A=a.getTypeOf(l)!=="string";h<l.length;)w=m-h,f=A?(c=l[h++],u=h<m?l[h++]:0,h<m?l[h++]:0):(c=l.charCodeAt(h++),u=h<m?l.charCodeAt(h++):0,h<m?l.charCodeAt(h++):0),p=c>>2,d=(3&c)<<4|u>>4,b=1<w?(15&u)<<2|f>>6:64,y=2<w?63&f:64,g.push(s.charAt(p)+s.charAt(d)+s.charAt(b)+s.charAt(y));return g.join("")},i.decode=function(l){var c,u,f,p,d,b,y=0,g=0,h="data:";if(l.substr(0,h.length)===h)throw new Error("Invalid base64 input, it looks like a data url.");var m,w=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===s.charAt(64)&&w--,l.charAt(l.length-2)===s.charAt(64)&&w--,w%1!=0)throw new Error("Invalid base64 input, bad content length.");for(m=o.uint8array?new Uint8Array(0|w):new Array(0|w);y<l.length;)c=s.indexOf(l.charAt(y++))<<2|(p=s.indexOf(l.charAt(y++)))>>4,u=(15&p)<<4|(d=s.indexOf(l.charAt(y++)))>>2,f=(3&d)<<6|(b=s.indexOf(l.charAt(y++))),m[g++]=c,d!==64&&(m[g++]=u),b!==64&&(m[g++]=f);return m}},{"./support":30,"./utils":32}],2:[function(e,r,i){var a=e("./external"),o=e("./stream/DataWorker"),s=e("./stream/Crc32Probe"),l=e("./stream/DataLengthProbe");function c(u,f,p,d,b){this.compressedSize=u,this.uncompressedSize=f,this.crc32=p,this.compression=d,this.compressedContent=b}c.prototype={getContentWorker:function(){var u=new o(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return u.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new o(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,f,p){return u.pipe(new s).pipe(new l("uncompressedSize")).pipe(f.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,r,i){var a=e("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},i.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,r,i){var a=e("./utils"),o=function(){for(var s,l=[],c=0;c<256;c++){s=c;for(var u=0;u<8;u++)s=1&s?3988292384^s>>>1:s>>>1;l[c]=s}return l}();r.exports=function(s,l){return s!==void 0&&s.length?a.getTypeOf(s)!=="string"?function(c,u,f,p){var d=o,b=p+f;c^=-1;for(var y=p;y<b;y++)c=c>>>8^d[255&(c^u[y])];return-1^c}(0|l,s,s.length,0):function(c,u,f,p){var d=o,b=p+f;c^=-1;for(var y=p;y<b;y++)c=c>>>8^d[255&(c^u.charCodeAt(y))];return-1^c}(0|l,s,s.length,0):0}},{"./utils":32}],5:[function(e,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(e,r,i){var a=null;a=typeof Promise<"u"?Promise:e("lie"),r.exports={Promise:a}},{lie:37}],7:[function(e,r,i){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=e("pako"),s=e("./utils"),l=e("./stream/GenericWorker"),c=a?"uint8array":"array";function u(f,p){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=p,this.meta={}}i.magic="\b\0",s.inherits(u,l),u.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(s.transformTo(c,f.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(p){f.push({data:p,meta:f.meta})}},i.compressWorker=function(f){return new u("Deflate",f)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,r,i){function a(d,b){var y,g="";for(y=0;y<b;y++)g+=String.fromCharCode(255&d),d>>>=8;return g}function o(d,b,y,g,h,m){var w,A,v=d.file,T=d.compression,N=m!==c.utf8encode,M=s.transformTo("string",m(v.name)),P=s.transformTo("string",c.utf8encode(v.name)),O=v.comment,ne=s.transformTo("string",m(O)),R=s.transformTo("string",c.utf8encode(O)),I=P.length!==v.name.length,E=R.length!==O.length,U="",Z="",$="",q=v.dir,J=v.date,re={crc32:0,compressedSize:0,uncompressedSize:0};b&&!y||(re.crc32=d.crc32,re.compressedSize=d.compressedSize,re.uncompressedSize=d.uncompressedSize);var Q=0;b&&(Q|=8),N||!I&&!E||(Q|=2048);var X=0,me=0;q&&(X|=16),h==="UNIX"?(me=798,X|=function(V,ee){var ce=V;return V||(ce=ee?16893:33204),(65535&ce)<<16}(v.unixPermissions,q)):(me=20,X|=function(V){return 63&(V||0)}(v.dosPermissions)),w=J.getUTCHours(),w<<=6,w|=J.getUTCMinutes(),w<<=5,w|=J.getUTCSeconds()/2,A=J.getUTCFullYear()-1980,A<<=4,A|=J.getUTCMonth()+1,A<<=5,A|=J.getUTCDate(),I&&(Z=a(1,1)+a(u(M),4)+P,U+="up"+a(Z.length,2)+Z),E&&($=a(1,1)+a(u(ne),4)+R,U+="uc"+a($.length,2)+$);var pe="";return pe+=`
|
|
22
|
+
\0`,pe+=a(Q,2),pe+=T.magic,pe+=a(w,2),pe+=a(A,2),pe+=a(re.crc32,4),pe+=a(re.compressedSize,4),pe+=a(re.uncompressedSize,4),pe+=a(M.length,2),pe+=a(U.length,2),{fileRecord:f.LOCAL_FILE_HEADER+pe+M+U,dirRecord:f.CENTRAL_FILE_HEADER+a(me,2)+pe+a(ne.length,2)+"\0\0\0\0"+a(X,4)+a(g,4)+M+U+ne}}var s=e("../utils"),l=e("../stream/GenericWorker"),c=e("../utf8"),u=e("../crc32"),f=e("../signature");function p(d,b,y,g){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=b,this.zipPlatform=y,this.encodeFileName=g,this.streamFiles=d,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(p,l),p.prototype.push=function(d){var b=d.meta.percent||0,y=this.entriesCount,g=this._sources.length;this.accumulate?this.contentBuffer.push(d):(this.bytesWritten+=d.data.length,l.prototype.push.call(this,{data:d.data,meta:{currentFile:this.currentFile,percent:y?(b+100*(y-g-1))/y:100}}))},p.prototype.openedSource=function(d){this.currentSourceOffset=this.bytesWritten,this.currentFile=d.file.name;var b=this.streamFiles&&!d.file.dir;if(b){var y=o(d,b,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:y.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(d){this.accumulate=!1;var b=this.streamFiles&&!d.file.dir,y=o(d,b,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(y.dirRecord),b)this.push({data:function(g){return f.DATA_DESCRIPTOR+a(g.crc32,4)+a(g.compressedSize,4)+a(g.uncompressedSize,4)}(d),meta:{percent:100}});else for(this.push({data:y.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var d=this.bytesWritten,b=0;b<this.dirRecords.length;b++)this.push({data:this.dirRecords[b],meta:{percent:100}});var y=this.bytesWritten-d,g=function(h,m,w,A,v){var T=s.transformTo("string",v(A));return f.CENTRAL_DIRECTORY_END+"\0\0\0\0"+a(h,2)+a(h,2)+a(m,4)+a(w,4)+a(T.length,2)+T}(this.dirRecords.length,y,d,this.zipComment,this.encodeFileName);this.push({data:g,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(d){this._sources.push(d);var b=this;return d.on("data",function(y){b.processChunk(y)}),d.on("end",function(){b.closedSource(b.previous.streamInfo),b._sources.length?b.prepareNextSource():b.end()}),d.on("error",function(y){b.error(y)}),this},p.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(d){var b=this._sources;if(!l.prototype.error.call(this,d))return!1;for(var y=0;y<b.length;y++)try{b[y].error(d)}catch{}return!0},p.prototype.lock=function(){l.prototype.lock.call(this);for(var d=this._sources,b=0;b<d.length;b++)d[b].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,r,i){var a=e("../compressions"),o=e("./ZipFileWorker");i.generateWorker=function(s,l,c){var u=new o(l.streamFiles,c,l.platform,l.encodeFileName),f=0;try{s.forEach(function(p,d){f++;var b=function(m,w){var A=m||w,v=a[A];if(!v)throw new Error(A+" is not a valid compression method !");return v}(d.options.compression,l.compression),y=d.options.compressionOptions||l.compressionOptions||{},g=d.dir,h=d.date;d._compressWorker(b,y).withStreamInfo("file",{name:p,dir:g,date:h,comment:d.comment||"",unixPermissions:d.unixPermissions,dosPermissions:d.dosPermissions}).pipe(u)}),u.entriesCount=f}catch(p){u.error(p)}return u}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,r,i){function a(){if(!(this instanceof a))return new a;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var o=new a;for(var s in this)typeof this[s]!="function"&&(o[s]=this[s]);return o}}(a.prototype=e("./object")).loadAsync=e("./load"),a.support=e("./support"),a.defaults=e("./defaults"),a.version="3.10.1",a.loadAsync=function(o,s){return new a().loadAsync(o,s)},a.external=e("./external"),r.exports=a},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,r,i){var a=e("./utils"),o=e("./external"),s=e("./utf8"),l=e("./zipEntries"),c=e("./stream/Crc32Probe"),u=e("./nodejsUtils");function f(p){return new o.Promise(function(d,b){var y=p.decompressed.getContentWorker().pipe(new c);y.on("error",function(g){b(g)}).on("end",function(){y.streamInfo.crc32!==p.decompressed.crc32?b(new Error("Corrupted zip : CRC32 mismatch")):d()}).resume()})}r.exports=function(p,d){var b=this;return d=a.extend(d||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),u.isNode&&u.isStream(p)?o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):a.prepareContent("the loaded zip file",p,!0,d.optimizedBinaryString,d.base64).then(function(y){var g=new l(d);return g.load(y),g}).then(function(y){var g=[o.Promise.resolve(y)],h=y.files;if(d.checkCRC32)for(var m=0;m<h.length;m++)g.push(f(h[m]));return o.Promise.all(g)}).then(function(y){for(var g=y.shift(),h=g.files,m=0;m<h.length;m++){var w=h[m],A=w.fileNameStr,v=a.resolve(w.fileNameStr);b.file(v,w.decompressed,{binary:!0,optimizedBinaryString:!0,date:w.date,dir:w.dir,comment:w.fileCommentStr.length?w.fileCommentStr:null,unixPermissions:w.unixPermissions,dosPermissions:w.dosPermissions,createFolders:d.createFolders}),w.dir||(b.file(v).unsafeOriginalName=A)}return g.zipComment.length&&(b.comment=g.zipComment),b})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,r,i){var a=e("../utils"),o=e("../stream/GenericWorker");function s(l,c){o.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}a.inherits(s,o),s.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(u){c.push({data:u,meta:{percent:0}})}).on("error",function(u){c.isPaused?this.generatedError=u:c.error(u)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},s.prototype.pause=function(){return!!o.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,r,i){var a=e("readable-stream").Readable;function o(s,l,c){a.call(this,l),this._helper=s;var u=this;s.on("data",function(f,p){u.push(f)||u._helper.pause(),c&&c(p)}).on("error",function(f){u.emit("error",f)}).on("end",function(){u.push(null)})}e("../utils").inherits(o,a),o.prototype._read=function(){this._helper.resume()},r.exports=o},{"../utils":32,"readable-stream":16}],14:[function(e,r,i){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(a,o){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(a,o);if(typeof a=="number")throw new Error('The "data" argument must not be a number');return new Buffer(a,o)},allocBuffer:function(a){if(Buffer.alloc)return Buffer.alloc(a);var o=new Buffer(a);return o.fill(0),o},isBuffer:function(a){return Buffer.isBuffer(a)},isStream:function(a){return a&&typeof a.on=="function"&&typeof a.pause=="function"&&typeof a.resume=="function"}}},{}],15:[function(e,r,i){function a(v,T,N){var M,P=s.getTypeOf(T),O=s.extend(N||{},u);O.date=O.date||new Date,O.compression!==null&&(O.compression=O.compression.toUpperCase()),typeof O.unixPermissions=="string"&&(O.unixPermissions=parseInt(O.unixPermissions,8)),O.unixPermissions&&16384&O.unixPermissions&&(O.dir=!0),O.dosPermissions&&16&O.dosPermissions&&(O.dir=!0),O.dir&&(v=h(v)),O.createFolders&&(M=g(v))&&m.call(this,M,!0);var ne=P==="string"&&O.binary===!1&&O.base64===!1;N&&N.binary!==void 0||(O.binary=!ne),(T instanceof f&&T.uncompressedSize===0||O.dir||!T||T.length===0)&&(O.base64=!1,O.binary=!0,T="",O.compression="STORE",P="string");var R=null;R=T instanceof f||T instanceof l?T:b.isNode&&b.isStream(T)?new y(v,T):s.prepareContent(v,T,O.binary,O.optimizedBinaryString,O.base64);var I=new p(v,R,O);this.files[v]=I}var o=e("./utf8"),s=e("./utils"),l=e("./stream/GenericWorker"),c=e("./stream/StreamHelper"),u=e("./defaults"),f=e("./compressedObject"),p=e("./zipObject"),d=e("./generate"),b=e("./nodejsUtils"),y=e("./nodejs/NodejsStreamInputAdapter"),g=function(v){v.slice(-1)==="/"&&(v=v.substring(0,v.length-1));var T=v.lastIndexOf("/");return 0<T?v.substring(0,T):""},h=function(v){return v.slice(-1)!=="/"&&(v+="/"),v},m=function(v,T){return T=T!==void 0?T:u.createFolders,v=h(v),this.files[v]||a.call(this,v,null,{dir:!0,createFolders:T}),this.files[v]};function w(v){return Object.prototype.toString.call(v)==="[object RegExp]"}var A={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(v){var T,N,M;for(T in this.files)M=this.files[T],(N=T.slice(this.root.length,T.length))&&T.slice(0,this.root.length)===this.root&&v(N,M)},filter:function(v){var T=[];return this.forEach(function(N,M){v(N,M)&&T.push(M)}),T},file:function(v,T,N){if(arguments.length!==1)return v=this.root+v,a.call(this,v,T,N),this;if(w(v)){var M=v;return this.filter(function(O,ne){return!ne.dir&&M.test(O)})}var P=this.files[this.root+v];return P&&!P.dir?P:null},folder:function(v){if(!v)return this;if(w(v))return this.filter(function(P,O){return O.dir&&v.test(P)});var T=this.root+v,N=m.call(this,T),M=this.clone();return M.root=N.name,M},remove:function(v){v=this.root+v;var T=this.files[v];if(T||(v.slice(-1)!=="/"&&(v+="/"),T=this.files[v]),T&&!T.dir)delete this.files[v];else for(var N=this.filter(function(P,O){return O.name.slice(0,v.length)===v}),M=0;M<N.length;M++)delete this.files[N[M].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(v){var T,N={};try{if((N=s.extend(v||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:o.utf8encode})).type=N.type.toLowerCase(),N.compression=N.compression.toUpperCase(),N.type==="binarystring"&&(N.type="string"),!N.type)throw new Error("No output type specified.");s.checkSupport(N.type),N.platform!=="darwin"&&N.platform!=="freebsd"&&N.platform!=="linux"&&N.platform!=="sunos"||(N.platform="UNIX"),N.platform==="win32"&&(N.platform="DOS");var M=N.comment||this.comment||"";T=d.generateWorker(this,N,M)}catch(P){(T=new l("error")).error(P)}return new c(T,N.type||"string",N.mimeType)},generateAsync:function(v,T){return this.generateInternalStream(v).accumulate(T)},generateNodeStream:function(v,T){return(v=v||{}).type||(v.type="nodebuffer"),this.generateInternalStream(v).toNodejsStream(T)}};r.exports=A},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,r,i){r.exports=e("stream")},{stream:void 0}],17:[function(e,r,i){var a=e("./DataReader");function o(s){a.call(this,s);for(var l=0;l<this.data.length;l++)s[l]=255&s[l]}e("../utils").inherits(o,a),o.prototype.byteAt=function(s){return this.data[this.zero+s]},o.prototype.lastIndexOfSignature=function(s){for(var l=s.charCodeAt(0),c=s.charCodeAt(1),u=s.charCodeAt(2),f=s.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===l&&this.data[p+1]===c&&this.data[p+2]===u&&this.data[p+3]===f)return p-this.zero;return-1},o.prototype.readAndCheckSignature=function(s){var l=s.charCodeAt(0),c=s.charCodeAt(1),u=s.charCodeAt(2),f=s.charCodeAt(3),p=this.readData(4);return l===p[0]&&c===p[1]&&u===p[2]&&f===p[3]},o.prototype.readData=function(s){if(this.checkOffset(s),s===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=o},{"../utils":32,"./DataReader":18}],18:[function(e,r,i){var a=e("../utils");function o(s){this.data=s,this.length=s.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(s){this.checkIndex(this.index+s)},checkIndex:function(s){if(this.length<this.zero+s||s<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+s+"). Corrupted zip ?")},setIndex:function(s){this.checkIndex(s),this.index=s},skip:function(s){this.setIndex(this.index+s)},byteAt:function(){},readInt:function(s){var l,c=0;for(this.checkOffset(s),l=this.index+s-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=s,c},readString:function(s){return a.transformTo("string",this.readData(s))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var s=this.readInt(4);return new Date(Date.UTC(1980+(s>>25&127),(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(31&s)<<1))}},r.exports=o},{"../utils":32}],19:[function(e,r,i){var a=e("./Uint8ArrayReader");function o(s){a.call(this,s)}e("../utils").inherits(o,a),o.prototype.readData=function(s){this.checkOffset(s);var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,r,i){var a=e("./DataReader");function o(s){a.call(this,s)}e("../utils").inherits(o,a),o.prototype.byteAt=function(s){return this.data.charCodeAt(this.zero+s)},o.prototype.lastIndexOfSignature=function(s){return this.data.lastIndexOf(s)-this.zero},o.prototype.readAndCheckSignature=function(s){return s===this.readData(4)},o.prototype.readData=function(s){this.checkOffset(s);var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=o},{"../utils":32,"./DataReader":18}],21:[function(e,r,i){var a=e("./ArrayReader");function o(s){a.call(this,s)}e("../utils").inherits(o,a),o.prototype.readData=function(s){if(this.checkOffset(s),s===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(e,r,i){var a=e("../utils"),o=e("../support"),s=e("./ArrayReader"),l=e("./StringReader"),c=e("./NodeBufferReader"),u=e("./Uint8ArrayReader");r.exports=function(f){var p=a.getTypeOf(f);return a.checkSupport(p),p!=="string"||o.uint8array?p==="nodebuffer"?new c(f):o.uint8array?new u(a.transformTo("uint8array",f)):new s(a.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(e,r,i){var a=e("./GenericWorker"),o=e("../utils");function s(l){a.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(s,a),s.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},r.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(e,r,i){var a=e("./GenericWorker"),o=e("../crc32");function s(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(s,a),s.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,r,i){var a=e("../utils"),o=e("./GenericWorker");function s(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}a.inherits(s,o),s.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}o.prototype.processChunk.call(this,l)},r.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(e,r,i){var a=e("../utils"),o=e("./GenericWorker");function s(l){o.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=a.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}a.inherits(s,o),s.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(e,r,i){function a(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}a.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,s){return this._listeners[o].push(s),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,s){if(this._listeners[o])for(var l=0;l<this._listeners[o].length;l++)this._listeners[o][l].call(this,s)},pipe:function(o){return o.registerPrevious(this)},registerPrevious:function(o){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=o.streamInfo,this.mergeStreamInfo(),this.previous=o;var s=this;return o.on("data",function(l){s.processChunk(l)}),o.on("end",function(){s.end()}),o.on("error",function(l){s.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var o=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),o=!0),this.previous&&this.previous.resume(),!o},flush:function(){},processChunk:function(o){this.push(o)},withStreamInfo:function(o,s){return this.extraStreamInfo[o]=s,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var o in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,o)&&(this.streamInfo[o]=this.extraStreamInfo[o])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var o="Worker "+this.name;return this.previous?this.previous+" -> "+o:o}},r.exports=a},{}],29:[function(e,r,i){var a=e("../utils"),o=e("./ConvertWorker"),s=e("./GenericWorker"),l=e("../base64"),c=e("../support"),u=e("../external"),f=null;if(c.nodestream)try{f=e("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(b,y){return new u.Promise(function(g,h){var m=[],w=b._internalType,A=b._outputType,v=b._mimeType;b.on("data",function(T,N){m.push(T),y&&y(N)}).on("error",function(T){m=[],h(T)}).on("end",function(){try{var T=function(N,M,P){switch(N){case"blob":return a.newBlob(a.transformTo("arraybuffer",M),P);case"base64":return l.encode(M);default:return a.transformTo(N,M)}}(A,function(N,M){var P,O=0,ne=null,R=0;for(P=0;P<M.length;P++)R+=M[P].length;switch(N){case"string":return M.join("");case"array":return Array.prototype.concat.apply([],M);case"uint8array":for(ne=new Uint8Array(R),P=0;P<M.length;P++)ne.set(M[P],O),O+=M[P].length;return ne;case"nodebuffer":return Buffer.concat(M);default:throw new Error("concat : unsupported type '"+N+"'")}}(w,m),v);g(T)}catch(N){h(N)}m=[]}).resume()})}function d(b,y,g){var h=y;switch(y){case"blob":case"arraybuffer":h="uint8array";break;case"base64":h="string"}try{this._internalType=h,this._outputType=y,this._mimeType=g,a.checkSupport(h),this._worker=b.pipe(new o(h)),b.lock()}catch(m){this._worker=new s("error"),this._worker.error(m)}}d.prototype={accumulate:function(b){return p(this,b)},on:function(b,y){var g=this;return b==="data"?this._worker.on(b,function(h){y.call(g,h.data,h.meta)}):this._worker.on(b,function(){a.delay(y,arguments,g)}),this},resume:function(){return a.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(b){if(a.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:this._outputType!=="nodebuffer"},b)}},r.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,r,i){if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",i.nodebuffer=typeof Buffer<"u",i.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")i.blob=!1;else{var a=new ArrayBuffer(0);try{i.blob=new Blob([a],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(a),i.blob=o.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!e("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(e,r,i){for(var a=e("./utils"),o=e("./support"),s=e("./nodejsUtils"),l=e("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}i.utf8encode=function(d){return o.nodebuffer?s.newBufferFrom(d,"utf-8"):function(b){var y,g,h,m,w,A=b.length,v=0;for(m=0;m<A;m++)(64512&(g=b.charCodeAt(m)))==55296&&m+1<A&&(64512&(h=b.charCodeAt(m+1)))==56320&&(g=65536+(g-55296<<10)+(h-56320),m++),v+=g<128?1:g<2048?2:g<65536?3:4;for(y=o.uint8array?new Uint8Array(v):new Array(v),m=w=0;w<v;m++)(64512&(g=b.charCodeAt(m)))==55296&&m+1<A&&(64512&(h=b.charCodeAt(m+1)))==56320&&(g=65536+(g-55296<<10)+(h-56320),m++),g<128?y[w++]=g:(g<2048?y[w++]=192|g>>>6:(g<65536?y[w++]=224|g>>>12:(y[w++]=240|g>>>18,y[w++]=128|g>>>12&63),y[w++]=128|g>>>6&63),y[w++]=128|63&g);return y}(d)},i.utf8decode=function(d){return o.nodebuffer?a.transformTo("nodebuffer",d).toString("utf-8"):function(b){var y,g,h,m,w=b.length,A=new Array(2*w);for(y=g=0;y<w;)if((h=b[y++])<128)A[g++]=h;else if(4<(m=c[h]))A[g++]=65533,y+=m-1;else{for(h&=m===2?31:m===3?15:7;1<m&&y<w;)h=h<<6|63&b[y++],m--;1<m?A[g++]=65533:h<65536?A[g++]=h:(h-=65536,A[g++]=55296|h>>10&1023,A[g++]=56320|1023&h)}return A.length!==g&&(A.subarray?A=A.subarray(0,g):A.length=g),a.applyFromCharCode(A)}(d=a.transformTo(o.uint8array?"uint8array":"array",d))},a.inherits(f,l),f.prototype.processChunk=function(d){var b=a.transformTo(o.uint8array?"uint8array":"array",d.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var y=b;(b=new Uint8Array(y.length+this.leftOver.length)).set(this.leftOver,0),b.set(y,this.leftOver.length)}else b=this.leftOver.concat(b);this.leftOver=null}var g=function(m,w){var A;for((w=w||m.length)>m.length&&(w=m.length),A=w-1;0<=A&&(192&m[A])==128;)A--;return A<0||A===0?w:A+c[m[A]]>w?A:w}(b),h=b;g!==b.length&&(o.uint8array?(h=b.subarray(0,g),this.leftOver=b.subarray(g,b.length)):(h=b.slice(0,g),this.leftOver=b.slice(g,b.length))),this.push({data:i.utf8decode(h),meta:d.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=f,a.inherits(p,l),p.prototype.processChunk=function(d){this.push({data:i.utf8encode(d.data),meta:d.meta})},i.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,r,i){var a=e("./support"),o=e("./base64"),s=e("./nodejsUtils"),l=e("./external");function c(y){return y}function u(y,g){for(var h=0;h<y.length;++h)g[h]=255&y.charCodeAt(h);return g}e("setimmediate"),i.newBlob=function(y,g){i.checkSupport("blob");try{return new Blob([y],{type:g})}catch{try{var h=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return h.append(y),h.getBlob(g)}catch{throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(y,g,h){var m=[],w=0,A=y.length;if(A<=h)return String.fromCharCode.apply(null,y);for(;w<A;)g==="array"||g==="nodebuffer"?m.push(String.fromCharCode.apply(null,y.slice(w,Math.min(w+h,A)))):m.push(String.fromCharCode.apply(null,y.subarray(w,Math.min(w+h,A)))),w+=h;return m.join("")},stringifyByChar:function(y){for(var g="",h=0;h<y.length;h++)g+=String.fromCharCode(y[h]);return g},applyCanBeUsed:{uint8array:function(){try{return a.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return a.nodebuffer&&String.fromCharCode.apply(null,s.allocBuffer(1)).length===1}catch{return!1}}()}};function p(y){var g=65536,h=i.getTypeOf(y),m=!0;if(h==="uint8array"?m=f.applyCanBeUsed.uint8array:h==="nodebuffer"&&(m=f.applyCanBeUsed.nodebuffer),m)for(;1<g;)try{return f.stringifyByChunk(y,h,g)}catch{g=Math.floor(g/2)}return f.stringifyByChar(y)}function d(y,g){for(var h=0;h<y.length;h++)g[h]=y[h];return g}i.applyFromCharCode=p;var b={};b.string={string:c,array:function(y){return u(y,new Array(y.length))},arraybuffer:function(y){return b.string.uint8array(y).buffer},uint8array:function(y){return u(y,new Uint8Array(y.length))},nodebuffer:function(y){return u(y,s.allocBuffer(y.length))}},b.array={string:p,array:c,arraybuffer:function(y){return new Uint8Array(y).buffer},uint8array:function(y){return new Uint8Array(y)},nodebuffer:function(y){return s.newBufferFrom(y)}},b.arraybuffer={string:function(y){return p(new Uint8Array(y))},array:function(y){return d(new Uint8Array(y),new Array(y.byteLength))},arraybuffer:c,uint8array:function(y){return new Uint8Array(y)},nodebuffer:function(y){return s.newBufferFrom(new Uint8Array(y))}},b.uint8array={string:p,array:function(y){return d(y,new Array(y.length))},arraybuffer:function(y){return y.buffer},uint8array:c,nodebuffer:function(y){return s.newBufferFrom(y)}},b.nodebuffer={string:p,array:function(y){return d(y,new Array(y.length))},arraybuffer:function(y){return b.nodebuffer.uint8array(y).buffer},uint8array:function(y){return d(y,new Uint8Array(y.length))},nodebuffer:c},i.transformTo=function(y,g){if(g=g||"",!y)return g;i.checkSupport(y);var h=i.getTypeOf(g);return b[h][y](g)},i.resolve=function(y){for(var g=y.split("/"),h=[],m=0;m<g.length;m++){var w=g[m];w==="."||w===""&&m!==0&&m!==g.length-1||(w===".."?h.pop():h.push(w))}return h.join("/")},i.getTypeOf=function(y){return typeof y=="string"?"string":Object.prototype.toString.call(y)==="[object Array]"?"array":a.nodebuffer&&s.isBuffer(y)?"nodebuffer":a.uint8array&&y instanceof Uint8Array?"uint8array":a.arraybuffer&&y instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(y){if(!a[y.toLowerCase()])throw new Error(y+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(y){var g,h,m="";for(h=0;h<(y||"").length;h++)m+="\\x"+((g=y.charCodeAt(h))<16?"0":"")+g.toString(16).toUpperCase();return m},i.delay=function(y,g,h){setImmediate(function(){y.apply(h||null,g||[])})},i.inherits=function(y,g){function h(){}h.prototype=g.prototype,y.prototype=new h},i.extend=function(){var y,g,h={};for(y=0;y<arguments.length;y++)for(g in arguments[y])Object.prototype.hasOwnProperty.call(arguments[y],g)&&h[g]===void 0&&(h[g]=arguments[y][g]);return h},i.prepareContent=function(y,g,h,m,w){return l.Promise.resolve(g).then(function(A){return a.blob&&(A instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(A))!==-1)&&typeof FileReader<"u"?new l.Promise(function(v,T){var N=new FileReader;N.onload=function(M){v(M.target.result)},N.onerror=function(M){T(M.target.error)},N.readAsArrayBuffer(A)}):A}).then(function(A){var v=i.getTypeOf(A);return v?(v==="arraybuffer"?A=i.transformTo("uint8array",A):v==="string"&&(w?A=o.decode(A):h&&m!==!0&&(A=function(T){return u(T,a.uint8array?new Uint8Array(T.length):new Array(T.length))}(A))),A):l.Promise.reject(new Error("Can't read the data of '"+y+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,r,i){var a=e("./reader/readerFor"),o=e("./utils"),s=e("./signature"),l=e("./zipEntry"),c=e("./support");function u(f){this.files=[],this.loadOptions=f}u.prototype={checkSignature:function(f){if(!this.reader.readAndCheckSignature(f)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(p)+", expected "+o.pretty(f)+")")}},isSignature:function(f,p){var d=this.reader.index;this.reader.setIndex(f);var b=this.reader.readString(4)===p;return this.reader.setIndex(d),b},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var f=this.reader.readData(this.zipCommentLength),p=c.uint8array?"uint8array":"array",d=o.transformTo(p,f);this.zipComment=this.loadOptions.decodeFileName(d)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var f,p,d,b=this.zip64EndOfCentralSize-44;0<b;)f=this.reader.readInt(2),p=this.reader.readInt(4),d=this.reader.readData(p),this.zip64ExtensibleData[f]={id:f,length:p,value:d}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var f,p;for(f=0;f<this.files.length;f++)p=this.files[f],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var f;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(f=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(f);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var f=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(f<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(f);var p=f;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,(f=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(f),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var d=this.centralDirOffset+this.centralDirSize;this.zip64&&(d+=20,d+=12+this.zip64EndOfCentralSize);var b=p-d;if(0<b)this.isSignature(p,s.CENTRAL_FILE_HEADER)||(this.reader.zero=b);else if(b<0)throw new Error("Corrupted zip: missing "+Math.abs(b)+" bytes.")},prepareReader:function(f){this.reader=a(f)},load:function(f){this.prepareReader(f),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,r,i){var a=e("./reader/readerFor"),o=e("./utils"),s=e("./compressedObject"),l=e("./crc32"),c=e("./utf8"),u=e("./compressions"),f=e("./support");function p(d,b){this.options=d,this.loadOptions=b}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(d){var b,y;if(d.skip(22),this.fileNameLength=d.readInt(2),y=d.readInt(2),this.fileName=d.readData(this.fileNameLength),d.skip(y),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((b=function(g){for(var h in u)if(Object.prototype.hasOwnProperty.call(u,h)&&u[h].magic===g)return u[h];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,b,d.readData(this.compressedSize))},readCentralPart:function(d){this.versionMadeBy=d.readInt(2),d.skip(2),this.bitFlag=d.readInt(2),this.compressionMethod=d.readString(2),this.date=d.readDate(),this.crc32=d.readInt(4),this.compressedSize=d.readInt(4),this.uncompressedSize=d.readInt(4);var b=d.readInt(2);if(this.extraFieldsLength=d.readInt(2),this.fileCommentLength=d.readInt(2),this.diskNumberStart=d.readInt(2),this.internalFileAttributes=d.readInt(2),this.externalFileAttributes=d.readInt(4),this.localHeaderOffset=d.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");d.skip(b),this.readExtraFields(d),this.parseZIP64ExtraField(d),this.fileComment=d.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var d=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),d==0&&(this.dosPermissions=63&this.externalFileAttributes),d==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var d=a(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=d.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=d.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=d.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=d.readInt(4))}},readExtraFields:function(d){var b,y,g,h=d.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});d.index+4<h;)b=d.readInt(2),y=d.readInt(2),g=d.readData(y),this.extraFields[b]={id:b,length:y,value:g};d.setIndex(h)},handleUTF8:function(){var d=f.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var b=this.findExtraFieldUnicodePath();if(b!==null)this.fileNameStr=b;else{var y=o.transformTo(d,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(y)}var g=this.findExtraFieldUnicodeComment();if(g!==null)this.fileCommentStr=g;else{var h=o.transformTo(d,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(h)}}},findExtraFieldUnicodePath:function(){var d=this.extraFields[28789];if(d){var b=a(d.value);return b.readInt(1)!==1||l(this.fileName)!==b.readInt(4)?null:c.utf8decode(b.readData(d.length-5))}return null},findExtraFieldUnicodeComment:function(){var d=this.extraFields[25461];if(d){var b=a(d.value);return b.readInt(1)!==1||l(this.fileComment)!==b.readInt(4)?null:c.utf8decode(b.readData(d.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,r,i){function a(b,y,g){this.name=b,this.dir=g.dir,this.date=g.date,this.comment=g.comment,this.unixPermissions=g.unixPermissions,this.dosPermissions=g.dosPermissions,this._data=y,this._dataBinary=g.binary,this.options={compression:g.compression,compressionOptions:g.compressionOptions}}var o=e("./stream/StreamHelper"),s=e("./stream/DataWorker"),l=e("./utf8"),c=e("./compressedObject"),u=e("./stream/GenericWorker");a.prototype={internalStream:function(b){var y=null,g="string";try{if(!b)throw new Error("No output type specified.");var h=(g=b.toLowerCase())==="string"||g==="text";g!=="binarystring"&&g!=="text"||(g="string"),y=this._decompressWorker();var m=!this._dataBinary;m&&!h&&(y=y.pipe(new l.Utf8EncodeWorker)),!m&&h&&(y=y.pipe(new l.Utf8DecodeWorker))}catch(w){(y=new u("error")).error(w)}return new o(y,g,"")},async:function(b,y){return this.internalStream(b).accumulate(y)},nodeStream:function(b,y){return this.internalStream(b||"nodebuffer").toNodejsStream(y)},_compressWorker:function(b,y){if(this._data instanceof c&&this._data.compression.magic===b.magic)return this._data.getCompressedWorker();var g=this._decompressWorker();return this._dataBinary||(g=g.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(g,b,y)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof u?this._data:new s(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},d=0;d<f.length;d++)a.prototype[f[d]]=p;r.exports=a},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,r,i){(function(a){var o,s,l=a.MutationObserver||a.WebKitMutationObserver;if(l){var c=0,u=new l(b),f=a.document.createTextNode("");u.observe(f,{characterData:!0}),o=function(){f.data=c=++c%2}}else if(a.setImmediate||a.MessageChannel===void 0)o="document"in a&&"onreadystatechange"in a.document.createElement("script")?function(){var y=a.document.createElement("script");y.onreadystatechange=function(){b(),y.onreadystatechange=null,y.parentNode.removeChild(y),y=null},a.document.documentElement.appendChild(y)}:function(){setTimeout(b,0)};else{var p=new a.MessageChannel;p.port1.onmessage=b,o=function(){p.port2.postMessage(0)}}var d=[];function b(){var y,g;s=!0;for(var h=d.length;h;){for(g=d,d=[],y=-1;++y<h;)g[y]();h=d.length}s=!1}r.exports=function(y){d.push(y)!==1||s||o()}}).call(this,typeof Ot<"u"?Ot:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(e,r,i){var a=e("immediate");function o(){}var s={},l=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function f(h){if(typeof h!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,h!==o&&y(this,h)}function p(h,m,w){this.promise=h,typeof m=="function"&&(this.onFulfilled=m,this.callFulfilled=this.otherCallFulfilled),typeof w=="function"&&(this.onRejected=w,this.callRejected=this.otherCallRejected)}function d(h,m,w){a(function(){var A;try{A=m(w)}catch(v){return s.reject(h,v)}A===h?s.reject(h,new TypeError("Cannot resolve promise with itself")):s.resolve(h,A)})}function b(h){var m=h&&h.then;if(h&&(typeof h=="object"||typeof h=="function")&&typeof m=="function")return function(){m.apply(h,arguments)}}function y(h,m){var w=!1;function A(N){w||(w=!0,s.reject(h,N))}function v(N){w||(w=!0,s.resolve(h,N))}var T=g(function(){m(v,A)});T.status==="error"&&A(T.value)}function g(h,m){var w={};try{w.value=h(m),w.status="success"}catch(A){w.status="error",w.value=A}return w}(r.exports=f).prototype.finally=function(h){if(typeof h!="function")return this;var m=this.constructor;return this.then(function(w){return m.resolve(h()).then(function(){return w})},function(w){return m.resolve(h()).then(function(){throw w})})},f.prototype.catch=function(h){return this.then(null,h)},f.prototype.then=function(h,m){if(typeof h!="function"&&this.state===c||typeof m!="function"&&this.state===l)return this;var w=new this.constructor(o);return this.state!==u?d(w,this.state===c?h:m,this.outcome):this.queue.push(new p(w,h,m)),w},p.prototype.callFulfilled=function(h){s.resolve(this.promise,h)},p.prototype.otherCallFulfilled=function(h){d(this.promise,this.onFulfilled,h)},p.prototype.callRejected=function(h){s.reject(this.promise,h)},p.prototype.otherCallRejected=function(h){d(this.promise,this.onRejected,h)},s.resolve=function(h,m){var w=g(b,m);if(w.status==="error")return s.reject(h,w.value);var A=w.value;if(A)y(h,A);else{h.state=c,h.outcome=m;for(var v=-1,T=h.queue.length;++v<T;)h.queue[v].callFulfilled(m)}return h},s.reject=function(h,m){h.state=l,h.outcome=m;for(var w=-1,A=h.queue.length;++w<A;)h.queue[w].callRejected(m);return h},f.resolve=function(h){return h instanceof this?h:s.resolve(new this(o),h)},f.reject=function(h){var m=new this(o);return s.reject(m,h)},f.all=function(h){var m=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=h.length,A=!1;if(!w)return this.resolve([]);for(var v=new Array(w),T=0,N=-1,M=new this(o);++N<w;)P(h[N],N);return M;function P(O,ne){m.resolve(O).then(function(R){v[ne]=R,++T!==w||A||(A=!0,s.resolve(M,v))},function(R){A||(A=!0,s.reject(M,R))})}},f.race=function(h){var m=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=h.length,A=!1;if(!w)return this.resolve([]);for(var v=-1,T=new this(o);++v<w;)N=h[v],m.resolve(N).then(function(M){A||(A=!0,s.resolve(T,M))},function(M){A||(A=!0,s.reject(T,M))});var N;return T}},{immediate:36}],38:[function(e,r,i){var a={};(0,e("./lib/utils/common").assign)(a,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),r.exports=a},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,r,i){var a=e("./zlib/deflate"),o=e("./utils/common"),s=e("./utils/strings"),l=e("./zlib/messages"),c=e("./zlib/zstream"),u=Object.prototype.toString,f=0,p=-1,d=0,b=8;function y(h){if(!(this instanceof y))return new y(h);this.options=o.assign({level:p,method:b,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:""},h||{});var m=this.options;m.raw&&0<m.windowBits?m.windowBits=-m.windowBits:m.gzip&&0<m.windowBits&&m.windowBits<16&&(m.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var w=a.deflateInit2(this.strm,m.level,m.method,m.windowBits,m.memLevel,m.strategy);if(w!==f)throw new Error(l[w]);if(m.header&&a.deflateSetHeader(this.strm,m.header),m.dictionary){var A;if(A=typeof m.dictionary=="string"?s.string2buf(m.dictionary):u.call(m.dictionary)==="[object ArrayBuffer]"?new Uint8Array(m.dictionary):m.dictionary,(w=a.deflateSetDictionary(this.strm,A))!==f)throw new Error(l[w]);this._dict_set=!0}}function g(h,m){var w=new y(m);if(w.push(h,!0),w.err)throw w.msg||l[w.err];return w.result}y.prototype.push=function(h,m){var w,A,v=this.strm,T=this.options.chunkSize;if(this.ended)return!1;A=m===~~m?m:m===!0?4:0,typeof h=="string"?v.input=s.string2buf(h):u.call(h)==="[object ArrayBuffer]"?v.input=new Uint8Array(h):v.input=h,v.next_in=0,v.avail_in=v.input.length;do{if(v.avail_out===0&&(v.output=new o.Buf8(T),v.next_out=0,v.avail_out=T),(w=a.deflate(v,A))!==1&&w!==f)return this.onEnd(w),!(this.ended=!0);v.avail_out!==0&&(v.avail_in!==0||A!==4&&A!==2)||(this.options.to==="string"?this.onData(s.buf2binstring(o.shrinkBuf(v.output,v.next_out))):this.onData(o.shrinkBuf(v.output,v.next_out)))}while((0<v.avail_in||v.avail_out===0)&&w!==1);return A===4?(w=a.deflateEnd(this.strm),this.onEnd(w),this.ended=!0,w===f):A!==2||(this.onEnd(f),!(v.avail_out=0))},y.prototype.onData=function(h){this.chunks.push(h)},y.prototype.onEnd=function(h){h===f&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=h,this.msg=this.strm.msg},i.Deflate=y,i.deflate=g,i.deflateRaw=function(h,m){return(m=m||{}).raw=!0,g(h,m)},i.gzip=function(h,m){return(m=m||{}).gzip=!0,g(h,m)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,r,i){var a=e("./zlib/inflate"),o=e("./utils/common"),s=e("./utils/strings"),l=e("./zlib/constants"),c=e("./zlib/messages"),u=e("./zlib/zstream"),f=e("./zlib/gzheader"),p=Object.prototype.toString;function d(y){if(!(this instanceof d))return new d(y);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},y||{});var g=this.options;g.raw&&0<=g.windowBits&&g.windowBits<16&&(g.windowBits=-g.windowBits,g.windowBits===0&&(g.windowBits=-15)),!(0<=g.windowBits&&g.windowBits<16)||y&&y.windowBits||(g.windowBits+=32),15<g.windowBits&&g.windowBits<48&&!(15&g.windowBits)&&(g.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var h=a.inflateInit2(this.strm,g.windowBits);if(h!==l.Z_OK)throw new Error(c[h]);this.header=new f,a.inflateGetHeader(this.strm,this.header)}function b(y,g){var h=new d(g);if(h.push(y,!0),h.err)throw h.msg||c[h.err];return h.result}d.prototype.push=function(y,g){var h,m,w,A,v,T,N=this.strm,M=this.options.chunkSize,P=this.options.dictionary,O=!1;if(this.ended)return!1;m=g===~~g?g:g===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof y=="string"?N.input=s.binstring2buf(y):p.call(y)==="[object ArrayBuffer]"?N.input=new Uint8Array(y):N.input=y,N.next_in=0,N.avail_in=N.input.length;do{if(N.avail_out===0&&(N.output=new o.Buf8(M),N.next_out=0,N.avail_out=M),(h=a.inflate(N,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&P&&(T=typeof P=="string"?s.string2buf(P):p.call(P)==="[object ArrayBuffer]"?new Uint8Array(P):P,h=a.inflateSetDictionary(this.strm,T)),h===l.Z_BUF_ERROR&&O===!0&&(h=l.Z_OK,O=!1),h!==l.Z_STREAM_END&&h!==l.Z_OK)return this.onEnd(h),!(this.ended=!0);N.next_out&&(N.avail_out!==0&&h!==l.Z_STREAM_END&&(N.avail_in!==0||m!==l.Z_FINISH&&m!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(w=s.utf8border(N.output,N.next_out),A=N.next_out-w,v=s.buf2string(N.output,w),N.next_out=A,N.avail_out=M-A,A&&o.arraySet(N.output,N.output,w,A,0),this.onData(v)):this.onData(o.shrinkBuf(N.output,N.next_out)))),N.avail_in===0&&N.avail_out===0&&(O=!0)}while((0<N.avail_in||N.avail_out===0)&&h!==l.Z_STREAM_END);return h===l.Z_STREAM_END&&(m=l.Z_FINISH),m===l.Z_FINISH?(h=a.inflateEnd(this.strm),this.onEnd(h),this.ended=!0,h===l.Z_OK):m!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(N.avail_out=0))},d.prototype.onData=function(y){this.chunks.push(y)},d.prototype.onEnd=function(y){y===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=y,this.msg=this.strm.msg},i.Inflate=d,i.inflate=b,i.inflateRaw=function(y,g){return(g=g||{}).raw=!0,b(y,g)},i.ungzip=b},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,r,i){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";i.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var u=c.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var f in u)u.hasOwnProperty(f)&&(l[f]=u[f])}}return l},i.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var o={arraySet:function(l,c,u,f,p){if(c.subarray&&l.subarray)l.set(c.subarray(u,u+f),p);else for(var d=0;d<f;d++)l[p+d]=c[u+d]},flattenChunks:function(l){var c,u,f,p,d,b;for(c=f=0,u=l.length;c<u;c++)f+=l[c].length;for(b=new Uint8Array(f),c=p=0,u=l.length;c<u;c++)d=l[c],b.set(d,p),p+=d.length;return b}},s={arraySet:function(l,c,u,f,p){for(var d=0;d<f;d++)l[p+d]=c[u+d]},flattenChunks:function(l){return[].concat.apply([],l)}};i.setTyped=function(l){l?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,o)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,s))},i.setTyped(a)},{}],42:[function(e,r,i){var a=e("./common"),o=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch{o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{s=!1}for(var l=new a.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function u(f,p){if(p<65537&&(f.subarray&&s||!f.subarray&&o))return String.fromCharCode.apply(null,a.shrinkBuf(f,p));for(var d="",b=0;b<p;b++)d+=String.fromCharCode(f[b]);return d}l[254]=l[254]=1,i.string2buf=function(f){var p,d,b,y,g,h=f.length,m=0;for(y=0;y<h;y++)(64512&(d=f.charCodeAt(y)))==55296&&y+1<h&&(64512&(b=f.charCodeAt(y+1)))==56320&&(d=65536+(d-55296<<10)+(b-56320),y++),m+=d<128?1:d<2048?2:d<65536?3:4;for(p=new a.Buf8(m),y=g=0;g<m;y++)(64512&(d=f.charCodeAt(y)))==55296&&y+1<h&&(64512&(b=f.charCodeAt(y+1)))==56320&&(d=65536+(d-55296<<10)+(b-56320),y++),d<128?p[g++]=d:(d<2048?p[g++]=192|d>>>6:(d<65536?p[g++]=224|d>>>12:(p[g++]=240|d>>>18,p[g++]=128|d>>>12&63),p[g++]=128|d>>>6&63),p[g++]=128|63&d);return p},i.buf2binstring=function(f){return u(f,f.length)},i.binstring2buf=function(f){for(var p=new a.Buf8(f.length),d=0,b=p.length;d<b;d++)p[d]=f.charCodeAt(d);return p},i.buf2string=function(f,p){var d,b,y,g,h=p||f.length,m=new Array(2*h);for(d=b=0;d<h;)if((y=f[d++])<128)m[b++]=y;else if(4<(g=l[y]))m[b++]=65533,d+=g-1;else{for(y&=g===2?31:g===3?15:7;1<g&&d<h;)y=y<<6|63&f[d++],g--;1<g?m[b++]=65533:y<65536?m[b++]=y:(y-=65536,m[b++]=55296|y>>10&1023,m[b++]=56320|1023&y)}return u(m,b)},i.utf8border=function(f,p){var d;for((p=p||f.length)>f.length&&(p=f.length),d=p-1;0<=d&&(192&f[d])==128;)d--;return d<0||d===0?p:d+l[f[d]]>p?d:p}},{"./common":41}],43:[function(e,r,i){r.exports=function(a,o,s,l){for(var c=65535&a|0,u=a>>>16&65535|0,f=0;s!==0;){for(s-=f=2e3<s?2e3:s;u=u+(c=c+o[l++]|0)|0,--f;);c%=65521,u%=65521}return c|u<<16|0}},{}],44:[function(e,r,i){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,r,i){var a=function(){for(var o,s=[],l=0;l<256;l++){o=l;for(var c=0;c<8;c++)o=1&o?3988292384^o>>>1:o>>>1;s[l]=o}return s}();r.exports=function(o,s,l,c){var u=a,f=c+l;o^=-1;for(var p=c;p<f;p++)o=o>>>8^u[255&(o^s[p])];return-1^o}},{}],46:[function(e,r,i){var a,o=e("../utils/common"),s=e("./trees"),l=e("./adler32"),c=e("./crc32"),u=e("./messages"),f=0,p=4,d=0,b=-2,y=-1,g=4,h=2,m=8,w=9,A=286,v=30,T=19,N=2*A+1,M=15,P=3,O=258,ne=O+P+1,R=42,I=113,E=1,U=2,Z=3,$=4;function q(_,B){return _.msg=u[B],B}function J(_){return(_<<1)-(4<_?9:0)}function re(_){for(var B=_.length;0<=--B;)_[B]=0}function Q(_){var B=_.state,G=B.pending;G>_.avail_out&&(G=_.avail_out),G!==0&&(o.arraySet(_.output,B.pending_buf,B.pending_out,G,_.next_out),_.next_out+=G,B.pending_out+=G,_.total_out+=G,_.avail_out-=G,B.pending-=G,B.pending===0&&(B.pending_out=0))}function X(_,B){s._tr_flush_block(_,0<=_.block_start?_.block_start:-1,_.strstart-_.block_start,B),_.block_start=_.strstart,Q(_.strm)}function me(_,B){_.pending_buf[_.pending++]=B}function pe(_,B){_.pending_buf[_.pending++]=B>>>8&255,_.pending_buf[_.pending++]=255&B}function V(_,B){var G,z,j=_.max_chain_length,Y=_.strstart,L=_.prev_length,x=_.nice_match,k=_.strstart>_.w_size-ne?_.strstart-(_.w_size-ne):0,F=_.window,K=_.w_mask,ie=_.prev,se=_.strstart+O,Ce=F[Y+L-1],ke=F[Y+L];_.prev_length>=_.good_match&&(j>>=2),x>_.lookahead&&(x=_.lookahead);do if(F[(G=B)+L]===ke&&F[G+L-1]===Ce&&F[G]===F[Y]&&F[++G]===F[Y+1]){Y+=2,G++;do;while(F[++Y]===F[++G]&&F[++Y]===F[++G]&&F[++Y]===F[++G]&&F[++Y]===F[++G]&&F[++Y]===F[++G]&&F[++Y]===F[++G]&&F[++Y]===F[++G]&&F[++Y]===F[++G]&&Y<se);if(z=O-(se-Y),Y=se-O,L<z){if(_.match_start=B,x<=(L=z))break;Ce=F[Y+L-1],ke=F[Y+L]}}while((B=ie[B&K])>k&&--j!=0);return L<=_.lookahead?L:_.lookahead}function ee(_){var B,G,z,j,Y,L,x,k,F,K,ie=_.w_size;do{if(j=_.window_size-_.lookahead-_.strstart,_.strstart>=ie+(ie-ne)){for(o.arraySet(_.window,_.window,ie,ie,0),_.match_start-=ie,_.strstart-=ie,_.block_start-=ie,B=G=_.hash_size;z=_.head[--B],_.head[B]=ie<=z?z-ie:0,--G;);for(B=G=ie;z=_.prev[--B],_.prev[B]=ie<=z?z-ie:0,--G;);j+=ie}if(_.strm.avail_in===0)break;if(L=_.strm,x=_.window,k=_.strstart+_.lookahead,F=j,K=void 0,K=L.avail_in,F<K&&(K=F),G=K===0?0:(L.avail_in-=K,o.arraySet(x,L.input,L.next_in,K,k),L.state.wrap===1?L.adler=l(L.adler,x,K,k):L.state.wrap===2&&(L.adler=c(L.adler,x,K,k)),L.next_in+=K,L.total_in+=K,K),_.lookahead+=G,_.lookahead+_.insert>=P)for(Y=_.strstart-_.insert,_.ins_h=_.window[Y],_.ins_h=(_.ins_h<<_.hash_shift^_.window[Y+1])&_.hash_mask;_.insert&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[Y+P-1])&_.hash_mask,_.prev[Y&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=Y,Y++,_.insert--,!(_.lookahead+_.insert<P)););}while(_.lookahead<ne&&_.strm.avail_in!==0)}function ce(_,B){for(var G,z;;){if(_.lookahead<ne){if(ee(_),_.lookahead<ne&&B===f)return E;if(_.lookahead===0)break}if(G=0,_.lookahead>=P&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+P-1])&_.hash_mask,G=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),G!==0&&_.strstart-G<=_.w_size-ne&&(_.match_length=V(_,G)),_.match_length>=P)if(z=s._tr_tally(_,_.strstart-_.match_start,_.match_length-P),_.lookahead-=_.match_length,_.match_length<=_.max_lazy_match&&_.lookahead>=P){for(_.match_length--;_.strstart++,_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+P-1])&_.hash_mask,G=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart,--_.match_length!=0;);_.strstart++}else _.strstart+=_.match_length,_.match_length=0,_.ins_h=_.window[_.strstart],_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+1])&_.hash_mask;else z=s._tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++;if(z&&(X(_,!1),_.strm.avail_out===0))return E}return _.insert=_.strstart<P-1?_.strstart:P-1,B===p?(X(_,!0),_.strm.avail_out===0?Z:$):_.last_lit&&(X(_,!1),_.strm.avail_out===0)?E:U}function ue(_,B){for(var G,z,j;;){if(_.lookahead<ne){if(ee(_),_.lookahead<ne&&B===f)return E;if(_.lookahead===0)break}if(G=0,_.lookahead>=P&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+P-1])&_.hash_mask,G=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),_.prev_length=_.match_length,_.prev_match=_.match_start,_.match_length=P-1,G!==0&&_.prev_length<_.max_lazy_match&&_.strstart-G<=_.w_size-ne&&(_.match_length=V(_,G),_.match_length<=5&&(_.strategy===1||_.match_length===P&&4096<_.strstart-_.match_start)&&(_.match_length=P-1)),_.prev_length>=P&&_.match_length<=_.prev_length){for(j=_.strstart+_.lookahead-P,z=s._tr_tally(_,_.strstart-1-_.prev_match,_.prev_length-P),_.lookahead-=_.prev_length-1,_.prev_length-=2;++_.strstart<=j&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+P-1])&_.hash_mask,G=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),--_.prev_length!=0;);if(_.match_available=0,_.match_length=P-1,_.strstart++,z&&(X(_,!1),_.strm.avail_out===0))return E}else if(_.match_available){if((z=s._tr_tally(_,0,_.window[_.strstart-1]))&&X(_,!1),_.strstart++,_.lookahead--,_.strm.avail_out===0)return E}else _.match_available=1,_.strstart++,_.lookahead--}return _.match_available&&(z=s._tr_tally(_,0,_.window[_.strstart-1]),_.match_available=0),_.insert=_.strstart<P-1?_.strstart:P-1,B===p?(X(_,!0),_.strm.avail_out===0?Z:$):_.last_lit&&(X(_,!1),_.strm.avail_out===0)?E:U}function ve(_,B,G,z,j){this.good_length=_,this.max_lazy=B,this.nice_length=G,this.max_chain=z,this.func=j}function Ee(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=m,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new o.Buf16(2*N),this.dyn_dtree=new o.Buf16(2*(2*v+1)),this.bl_tree=new o.Buf16(2*(2*T+1)),re(this.dyn_ltree),re(this.dyn_dtree),re(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new o.Buf16(M+1),this.heap=new o.Buf16(2*A+1),re(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new o.Buf16(2*A+1),re(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Se(_){var B;return _&&_.state?(_.total_in=_.total_out=0,_.data_type=h,(B=_.state).pending=0,B.pending_out=0,B.wrap<0&&(B.wrap=-B.wrap),B.status=B.wrap?R:I,_.adler=B.wrap===2?0:1,B.last_flush=f,s._tr_init(B),d):q(_,b)}function Fe(_){var B=Se(_);return B===d&&function(G){G.window_size=2*G.w_size,re(G.head),G.max_lazy_match=a[G.level].max_lazy,G.good_match=a[G.level].good_length,G.nice_match=a[G.level].nice_length,G.max_chain_length=a[G.level].max_chain,G.strstart=0,G.block_start=0,G.lookahead=0,G.insert=0,G.match_length=G.prev_length=P-1,G.match_available=0,G.ins_h=0}(_.state),B}function Ne(_,B,G,z,j,Y){if(!_)return b;var L=1;if(B===y&&(B=6),z<0?(L=0,z=-z):15<z&&(L=2,z-=16),j<1||w<j||G!==m||z<8||15<z||B<0||9<B||Y<0||g<Y)return q(_,b);z===8&&(z=9);var x=new Ee;return(_.state=x).strm=_,x.wrap=L,x.gzhead=null,x.w_bits=z,x.w_size=1<<x.w_bits,x.w_mask=x.w_size-1,x.hash_bits=j+7,x.hash_size=1<<x.hash_bits,x.hash_mask=x.hash_size-1,x.hash_shift=~~((x.hash_bits+P-1)/P),x.window=new o.Buf8(2*x.w_size),x.head=new o.Buf16(x.hash_size),x.prev=new o.Buf16(x.w_size),x.lit_bufsize=1<<j+6,x.pending_buf_size=4*x.lit_bufsize,x.pending_buf=new o.Buf8(x.pending_buf_size),x.d_buf=1*x.lit_bufsize,x.l_buf=3*x.lit_bufsize,x.level=B,x.strategy=Y,x.method=G,Fe(_)}a=[new ve(0,0,0,0,function(_,B){var G=65535;for(G>_.pending_buf_size-5&&(G=_.pending_buf_size-5);;){if(_.lookahead<=1){if(ee(_),_.lookahead===0&&B===f)return E;if(_.lookahead===0)break}_.strstart+=_.lookahead,_.lookahead=0;var z=_.block_start+G;if((_.strstart===0||_.strstart>=z)&&(_.lookahead=_.strstart-z,_.strstart=z,X(_,!1),_.strm.avail_out===0)||_.strstart-_.block_start>=_.w_size-ne&&(X(_,!1),_.strm.avail_out===0))return E}return _.insert=0,B===p?(X(_,!0),_.strm.avail_out===0?Z:$):(_.strstart>_.block_start&&(X(_,!1),_.strm.avail_out),E)}),new ve(4,4,8,4,ce),new ve(4,5,16,8,ce),new ve(4,6,32,32,ce),new ve(4,4,16,16,ue),new ve(8,16,32,32,ue),new ve(8,16,128,128,ue),new ve(8,32,128,256,ue),new ve(32,128,258,1024,ue),new ve(32,258,258,4096,ue)],i.deflateInit=function(_,B){return Ne(_,B,m,15,8,0)},i.deflateInit2=Ne,i.deflateReset=Fe,i.deflateResetKeep=Se,i.deflateSetHeader=function(_,B){return _&&_.state?_.state.wrap!==2?b:(_.state.gzhead=B,d):b},i.deflate=function(_,B){var G,z,j,Y;if(!_||!_.state||5<B||B<0)return _?q(_,b):b;if(z=_.state,!_.output||!_.input&&_.avail_in!==0||z.status===666&&B!==p)return q(_,_.avail_out===0?-5:b);if(z.strm=_,G=z.last_flush,z.last_flush=B,z.status===R)if(z.wrap===2)_.adler=0,me(z,31),me(z,139),me(z,8),z.gzhead?(me(z,(z.gzhead.text?1:0)+(z.gzhead.hcrc?2:0)+(z.gzhead.extra?4:0)+(z.gzhead.name?8:0)+(z.gzhead.comment?16:0)),me(z,255&z.gzhead.time),me(z,z.gzhead.time>>8&255),me(z,z.gzhead.time>>16&255),me(z,z.gzhead.time>>24&255),me(z,z.level===9?2:2<=z.strategy||z.level<2?4:0),me(z,255&z.gzhead.os),z.gzhead.extra&&z.gzhead.extra.length&&(me(z,255&z.gzhead.extra.length),me(z,z.gzhead.extra.length>>8&255)),z.gzhead.hcrc&&(_.adler=c(_.adler,z.pending_buf,z.pending,0)),z.gzindex=0,z.status=69):(me(z,0),me(z,0),me(z,0),me(z,0),me(z,0),me(z,z.level===9?2:2<=z.strategy||z.level<2?4:0),me(z,3),z.status=I);else{var L=m+(z.w_bits-8<<4)<<8;L|=(2<=z.strategy||z.level<2?0:z.level<6?1:z.level===6?2:3)<<6,z.strstart!==0&&(L|=32),L+=31-L%31,z.status=I,pe(z,L),z.strstart!==0&&(pe(z,_.adler>>>16),pe(z,65535&_.adler)),_.adler=1}if(z.status===69)if(z.gzhead.extra){for(j=z.pending;z.gzindex<(65535&z.gzhead.extra.length)&&(z.pending!==z.pending_buf_size||(z.gzhead.hcrc&&z.pending>j&&(_.adler=c(_.adler,z.pending_buf,z.pending-j,j)),Q(_),j=z.pending,z.pending!==z.pending_buf_size));)me(z,255&z.gzhead.extra[z.gzindex]),z.gzindex++;z.gzhead.hcrc&&z.pending>j&&(_.adler=c(_.adler,z.pending_buf,z.pending-j,j)),z.gzindex===z.gzhead.extra.length&&(z.gzindex=0,z.status=73)}else z.status=73;if(z.status===73)if(z.gzhead.name){j=z.pending;do{if(z.pending===z.pending_buf_size&&(z.gzhead.hcrc&&z.pending>j&&(_.adler=c(_.adler,z.pending_buf,z.pending-j,j)),Q(_),j=z.pending,z.pending===z.pending_buf_size)){Y=1;break}Y=z.gzindex<z.gzhead.name.length?255&z.gzhead.name.charCodeAt(z.gzindex++):0,me(z,Y)}while(Y!==0);z.gzhead.hcrc&&z.pending>j&&(_.adler=c(_.adler,z.pending_buf,z.pending-j,j)),Y===0&&(z.gzindex=0,z.status=91)}else z.status=91;if(z.status===91)if(z.gzhead.comment){j=z.pending;do{if(z.pending===z.pending_buf_size&&(z.gzhead.hcrc&&z.pending>j&&(_.adler=c(_.adler,z.pending_buf,z.pending-j,j)),Q(_),j=z.pending,z.pending===z.pending_buf_size)){Y=1;break}Y=z.gzindex<z.gzhead.comment.length?255&z.gzhead.comment.charCodeAt(z.gzindex++):0,me(z,Y)}while(Y!==0);z.gzhead.hcrc&&z.pending>j&&(_.adler=c(_.adler,z.pending_buf,z.pending-j,j)),Y===0&&(z.status=103)}else z.status=103;if(z.status===103&&(z.gzhead.hcrc?(z.pending+2>z.pending_buf_size&&Q(_),z.pending+2<=z.pending_buf_size&&(me(z,255&_.adler),me(z,_.adler>>8&255),_.adler=0,z.status=I)):z.status=I),z.pending!==0){if(Q(_),_.avail_out===0)return z.last_flush=-1,d}else if(_.avail_in===0&&J(B)<=J(G)&&B!==p)return q(_,-5);if(z.status===666&&_.avail_in!==0)return q(_,-5);if(_.avail_in!==0||z.lookahead!==0||B!==f&&z.status!==666){var x=z.strategy===2?function(k,F){for(var K;;){if(k.lookahead===0&&(ee(k),k.lookahead===0)){if(F===f)return E;break}if(k.match_length=0,K=s._tr_tally(k,0,k.window[k.strstart]),k.lookahead--,k.strstart++,K&&(X(k,!1),k.strm.avail_out===0))return E}return k.insert=0,F===p?(X(k,!0),k.strm.avail_out===0?Z:$):k.last_lit&&(X(k,!1),k.strm.avail_out===0)?E:U}(z,B):z.strategy===3?function(k,F){for(var K,ie,se,Ce,ke=k.window;;){if(k.lookahead<=O){if(ee(k),k.lookahead<=O&&F===f)return E;if(k.lookahead===0)break}if(k.match_length=0,k.lookahead>=P&&0<k.strstart&&(ie=ke[se=k.strstart-1])===ke[++se]&&ie===ke[++se]&&ie===ke[++se]){Ce=k.strstart+O;do;while(ie===ke[++se]&&ie===ke[++se]&&ie===ke[++se]&&ie===ke[++se]&&ie===ke[++se]&&ie===ke[++se]&&ie===ke[++se]&&ie===ke[++se]&&se<Ce);k.match_length=O-(Ce-se),k.match_length>k.lookahead&&(k.match_length=k.lookahead)}if(k.match_length>=P?(K=s._tr_tally(k,1,k.match_length-P),k.lookahead-=k.match_length,k.strstart+=k.match_length,k.match_length=0):(K=s._tr_tally(k,0,k.window[k.strstart]),k.lookahead--,k.strstart++),K&&(X(k,!1),k.strm.avail_out===0))return E}return k.insert=0,F===p?(X(k,!0),k.strm.avail_out===0?Z:$):k.last_lit&&(X(k,!1),k.strm.avail_out===0)?E:U}(z,B):a[z.level].func(z,B);if(x!==Z&&x!==$||(z.status=666),x===E||x===Z)return _.avail_out===0&&(z.last_flush=-1),d;if(x===U&&(B===1?s._tr_align(z):B!==5&&(s._tr_stored_block(z,0,0,!1),B===3&&(re(z.head),z.lookahead===0&&(z.strstart=0,z.block_start=0,z.insert=0))),Q(_),_.avail_out===0))return z.last_flush=-1,d}return B!==p?d:z.wrap<=0?1:(z.wrap===2?(me(z,255&_.adler),me(z,_.adler>>8&255),me(z,_.adler>>16&255),me(z,_.adler>>24&255),me(z,255&_.total_in),me(z,_.total_in>>8&255),me(z,_.total_in>>16&255),me(z,_.total_in>>24&255)):(pe(z,_.adler>>>16),pe(z,65535&_.adler)),Q(_),0<z.wrap&&(z.wrap=-z.wrap),z.pending!==0?d:1)},i.deflateEnd=function(_){var B;return _&&_.state?(B=_.state.status)!==R&&B!==69&&B!==73&&B!==91&&B!==103&&B!==I&&B!==666?q(_,b):(_.state=null,B===I?q(_,-3):d):b},i.deflateSetDictionary=function(_,B){var G,z,j,Y,L,x,k,F,K=B.length;if(!_||!_.state||(Y=(G=_.state).wrap)===2||Y===1&&G.status!==R||G.lookahead)return b;for(Y===1&&(_.adler=l(_.adler,B,K,0)),G.wrap=0,K>=G.w_size&&(Y===0&&(re(G.head),G.strstart=0,G.block_start=0,G.insert=0),F=new o.Buf8(G.w_size),o.arraySet(F,B,K-G.w_size,G.w_size,0),B=F,K=G.w_size),L=_.avail_in,x=_.next_in,k=_.input,_.avail_in=K,_.next_in=0,_.input=B,ee(G);G.lookahead>=P;){for(z=G.strstart,j=G.lookahead-(P-1);G.ins_h=(G.ins_h<<G.hash_shift^G.window[z+P-1])&G.hash_mask,G.prev[z&G.w_mask]=G.head[G.ins_h],G.head[G.ins_h]=z,z++,--j;);G.strstart=z,G.lookahead=P-1,ee(G)}return G.strstart+=G.lookahead,G.block_start=G.strstart,G.insert=G.lookahead,G.lookahead=0,G.match_length=G.prev_length=P-1,G.match_available=0,_.next_in=x,_.input=k,_.avail_in=L,G.wrap=Y,d},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,r,i){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,r,i){r.exports=function(a,o){var s,l,c,u,f,p,d,b,y,g,h,m,w,A,v,T,N,M,P,O,ne,R,I,E,U;s=a.state,l=a.next_in,E=a.input,c=l+(a.avail_in-5),u=a.next_out,U=a.output,f=u-(o-a.avail_out),p=u+(a.avail_out-257),d=s.dmax,b=s.wsize,y=s.whave,g=s.wnext,h=s.window,m=s.hold,w=s.bits,A=s.lencode,v=s.distcode,T=(1<<s.lenbits)-1,N=(1<<s.distbits)-1;e:do{w<15&&(m+=E[l++]<<w,w+=8,m+=E[l++]<<w,w+=8),M=A[m&T];t:for(;;){if(m>>>=P=M>>>24,w-=P,(P=M>>>16&255)===0)U[u++]=65535&M;else{if(!(16&P)){if(!(64&P)){M=A[(65535&M)+(m&(1<<P)-1)];continue t}if(32&P){s.mode=12;break e}a.msg="invalid literal/length code",s.mode=30;break e}O=65535&M,(P&=15)&&(w<P&&(m+=E[l++]<<w,w+=8),O+=m&(1<<P)-1,m>>>=P,w-=P),w<15&&(m+=E[l++]<<w,w+=8,m+=E[l++]<<w,w+=8),M=v[m&N];r:for(;;){if(m>>>=P=M>>>24,w-=P,!(16&(P=M>>>16&255))){if(!(64&P)){M=v[(65535&M)+(m&(1<<P)-1)];continue r}a.msg="invalid distance code",s.mode=30;break e}if(ne=65535&M,w<(P&=15)&&(m+=E[l++]<<w,(w+=8)<P&&(m+=E[l++]<<w,w+=8)),d<(ne+=m&(1<<P)-1)){a.msg="invalid distance too far back",s.mode=30;break e}if(m>>>=P,w-=P,(P=u-f)<ne){if(y<(P=ne-P)&&s.sane){a.msg="invalid distance too far back",s.mode=30;break e}if(I=h,(R=0)===g){if(R+=b-P,P<O){for(O-=P;U[u++]=h[R++],--P;);R=u-ne,I=U}}else if(g<P){if(R+=b+g-P,(P-=g)<O){for(O-=P;U[u++]=h[R++],--P;);if(R=0,g<O){for(O-=P=g;U[u++]=h[R++],--P;);R=u-ne,I=U}}}else if(R+=g-P,P<O){for(O-=P;U[u++]=h[R++],--P;);R=u-ne,I=U}for(;2<O;)U[u++]=I[R++],U[u++]=I[R++],U[u++]=I[R++],O-=3;O&&(U[u++]=I[R++],1<O&&(U[u++]=I[R++]))}else{for(R=u-ne;U[u++]=U[R++],U[u++]=U[R++],U[u++]=U[R++],2<(O-=3););O&&(U[u++]=U[R++],1<O&&(U[u++]=U[R++]))}break}}break}}while(l<c&&u<p);l-=O=w>>3,m&=(1<<(w-=O<<3))-1,a.next_in=l,a.next_out=u,a.avail_in=l<c?c-l+5:5-(l-c),a.avail_out=u<p?p-u+257:257-(u-p),s.hold=m,s.bits=w}},{}],49:[function(e,r,i){var a=e("../utils/common"),o=e("./adler32"),s=e("./crc32"),l=e("./inffast"),c=e("./inftrees"),u=1,f=2,p=0,d=-2,b=1,y=852,g=592;function h(R){return(R>>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function m(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function w(R){var I;return R&&R.state?(I=R.state,R.total_in=R.total_out=I.total=0,R.msg="",I.wrap&&(R.adler=1&I.wrap),I.mode=b,I.last=0,I.havedict=0,I.dmax=32768,I.head=null,I.hold=0,I.bits=0,I.lencode=I.lendyn=new a.Buf32(y),I.distcode=I.distdyn=new a.Buf32(g),I.sane=1,I.back=-1,p):d}function A(R){var I;return R&&R.state?((I=R.state).wsize=0,I.whave=0,I.wnext=0,w(R)):d}function v(R,I){var E,U;return R&&R.state?(U=R.state,I<0?(E=0,I=-I):(E=1+(I>>4),I<48&&(I&=15)),I&&(I<8||15<I)?d:(U.window!==null&&U.wbits!==I&&(U.window=null),U.wrap=E,U.wbits=I,A(R))):d}function T(R,I){var E,U;return R?(U=new m,(R.state=U).window=null,(E=v(R,I))!==p&&(R.state=null),E):d}var N,M,P=!0;function O(R){if(P){var I;for(N=new a.Buf32(512),M=new a.Buf32(32),I=0;I<144;)R.lens[I++]=8;for(;I<256;)R.lens[I++]=9;for(;I<280;)R.lens[I++]=7;for(;I<288;)R.lens[I++]=8;for(c(u,R.lens,0,288,N,0,R.work,{bits:9}),I=0;I<32;)R.lens[I++]=5;c(f,R.lens,0,32,M,0,R.work,{bits:5}),P=!1}R.lencode=N,R.lenbits=9,R.distcode=M,R.distbits=5}function ne(R,I,E,U){var Z,$=R.state;return $.window===null&&($.wsize=1<<$.wbits,$.wnext=0,$.whave=0,$.window=new a.Buf8($.wsize)),U>=$.wsize?(a.arraySet($.window,I,E-$.wsize,$.wsize,0),$.wnext=0,$.whave=$.wsize):(U<(Z=$.wsize-$.wnext)&&(Z=U),a.arraySet($.window,I,E-U,Z,$.wnext),(U-=Z)?(a.arraySet($.window,I,E-U,U,0),$.wnext=U,$.whave=$.wsize):($.wnext+=Z,$.wnext===$.wsize&&($.wnext=0),$.whave<$.wsize&&($.whave+=Z))),0}i.inflateReset=A,i.inflateReset2=v,i.inflateResetKeep=w,i.inflateInit=function(R){return T(R,15)},i.inflateInit2=T,i.inflate=function(R,I){var E,U,Z,$,q,J,re,Q,X,me,pe,V,ee,ce,ue,ve,Ee,Se,Fe,Ne,_,B,G,z,j=0,Y=new a.Buf8(4),L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!R||!R.state||!R.output||!R.input&&R.avail_in!==0)return d;(E=R.state).mode===12&&(E.mode=13),q=R.next_out,Z=R.output,re=R.avail_out,$=R.next_in,U=R.input,J=R.avail_in,Q=E.hold,X=E.bits,me=J,pe=re,B=p;e:for(;;)switch(E.mode){case b:if(E.wrap===0){E.mode=13;break}for(;X<16;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}if(2&E.wrap&&Q===35615){Y[E.check=0]=255&Q,Y[1]=Q>>>8&255,E.check=s(E.check,Y,2,0),X=Q=0,E.mode=2;break}if(E.flags=0,E.head&&(E.head.done=!1),!(1&E.wrap)||(((255&Q)<<8)+(Q>>8))%31){R.msg="incorrect header check",E.mode=30;break}if((15&Q)!=8){R.msg="unknown compression method",E.mode=30;break}if(X-=4,_=8+(15&(Q>>>=4)),E.wbits===0)E.wbits=_;else if(_>E.wbits){R.msg="invalid window size",E.mode=30;break}E.dmax=1<<_,R.adler=E.check=1,E.mode=512&Q?10:12,X=Q=0;break;case 2:for(;X<16;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}if(E.flags=Q,(255&E.flags)!=8){R.msg="unknown compression method",E.mode=30;break}if(57344&E.flags){R.msg="unknown header flags set",E.mode=30;break}E.head&&(E.head.text=Q>>8&1),512&E.flags&&(Y[0]=255&Q,Y[1]=Q>>>8&255,E.check=s(E.check,Y,2,0)),X=Q=0,E.mode=3;case 3:for(;X<32;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}E.head&&(E.head.time=Q),512&E.flags&&(Y[0]=255&Q,Y[1]=Q>>>8&255,Y[2]=Q>>>16&255,Y[3]=Q>>>24&255,E.check=s(E.check,Y,4,0)),X=Q=0,E.mode=4;case 4:for(;X<16;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}E.head&&(E.head.xflags=255&Q,E.head.os=Q>>8),512&E.flags&&(Y[0]=255&Q,Y[1]=Q>>>8&255,E.check=s(E.check,Y,2,0)),X=Q=0,E.mode=5;case 5:if(1024&E.flags){for(;X<16;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}E.length=Q,E.head&&(E.head.extra_len=Q),512&E.flags&&(Y[0]=255&Q,Y[1]=Q>>>8&255,E.check=s(E.check,Y,2,0)),X=Q=0}else E.head&&(E.head.extra=null);E.mode=6;case 6:if(1024&E.flags&&(J<(V=E.length)&&(V=J),V&&(E.head&&(_=E.head.extra_len-E.length,E.head.extra||(E.head.extra=new Array(E.head.extra_len)),a.arraySet(E.head.extra,U,$,V,_)),512&E.flags&&(E.check=s(E.check,U,V,$)),J-=V,$+=V,E.length-=V),E.length))break e;E.length=0,E.mode=7;case 7:if(2048&E.flags){if(J===0)break e;for(V=0;_=U[$+V++],E.head&&_&&E.length<65536&&(E.head.name+=String.fromCharCode(_)),_&&V<J;);if(512&E.flags&&(E.check=s(E.check,U,V,$)),J-=V,$+=V,_)break e}else E.head&&(E.head.name=null);E.length=0,E.mode=8;case 8:if(4096&E.flags){if(J===0)break e;for(V=0;_=U[$+V++],E.head&&_&&E.length<65536&&(E.head.comment+=String.fromCharCode(_)),_&&V<J;);if(512&E.flags&&(E.check=s(E.check,U,V,$)),J-=V,$+=V,_)break e}else E.head&&(E.head.comment=null);E.mode=9;case 9:if(512&E.flags){for(;X<16;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}if(Q!==(65535&E.check)){R.msg="header crc mismatch",E.mode=30;break}X=Q=0}E.head&&(E.head.hcrc=E.flags>>9&1,E.head.done=!0),R.adler=E.check=0,E.mode=12;break;case 10:for(;X<32;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}R.adler=E.check=h(Q),X=Q=0,E.mode=11;case 11:if(E.havedict===0)return R.next_out=q,R.avail_out=re,R.next_in=$,R.avail_in=J,E.hold=Q,E.bits=X,2;R.adler=E.check=1,E.mode=12;case 12:if(I===5||I===6)break e;case 13:if(E.last){Q>>>=7&X,X-=7&X,E.mode=27;break}for(;X<3;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}switch(E.last=1&Q,X-=1,3&(Q>>>=1)){case 0:E.mode=14;break;case 1:if(O(E),E.mode=20,I!==6)break;Q>>>=2,X-=2;break e;case 2:E.mode=17;break;case 3:R.msg="invalid block type",E.mode=30}Q>>>=2,X-=2;break;case 14:for(Q>>>=7&X,X-=7&X;X<32;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}if((65535&Q)!=(Q>>>16^65535)){R.msg="invalid stored block lengths",E.mode=30;break}if(E.length=65535&Q,X=Q=0,E.mode=15,I===6)break e;case 15:E.mode=16;case 16:if(V=E.length){if(J<V&&(V=J),re<V&&(V=re),V===0)break e;a.arraySet(Z,U,$,V,q),J-=V,$+=V,re-=V,q+=V,E.length-=V;break}E.mode=12;break;case 17:for(;X<14;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}if(E.nlen=257+(31&Q),Q>>>=5,X-=5,E.ndist=1+(31&Q),Q>>>=5,X-=5,E.ncode=4+(15&Q),Q>>>=4,X-=4,286<E.nlen||30<E.ndist){R.msg="too many length or distance symbols",E.mode=30;break}E.have=0,E.mode=18;case 18:for(;E.have<E.ncode;){for(;X<3;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}E.lens[L[E.have++]]=7&Q,Q>>>=3,X-=3}for(;E.have<19;)E.lens[L[E.have++]]=0;if(E.lencode=E.lendyn,E.lenbits=7,G={bits:E.lenbits},B=c(0,E.lens,0,19,E.lencode,0,E.work,G),E.lenbits=G.bits,B){R.msg="invalid code lengths set",E.mode=30;break}E.have=0,E.mode=19;case 19:for(;E.have<E.nlen+E.ndist;){for(;ve=(j=E.lencode[Q&(1<<E.lenbits)-1])>>>16&255,Ee=65535&j,!((ue=j>>>24)<=X);){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}if(Ee<16)Q>>>=ue,X-=ue,E.lens[E.have++]=Ee;else{if(Ee===16){for(z=ue+2;X<z;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}if(Q>>>=ue,X-=ue,E.have===0){R.msg="invalid bit length repeat",E.mode=30;break}_=E.lens[E.have-1],V=3+(3&Q),Q>>>=2,X-=2}else if(Ee===17){for(z=ue+3;X<z;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}X-=ue,_=0,V=3+(7&(Q>>>=ue)),Q>>>=3,X-=3}else{for(z=ue+7;X<z;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}X-=ue,_=0,V=11+(127&(Q>>>=ue)),Q>>>=7,X-=7}if(E.have+V>E.nlen+E.ndist){R.msg="invalid bit length repeat",E.mode=30;break}for(;V--;)E.lens[E.have++]=_}}if(E.mode===30)break;if(E.lens[256]===0){R.msg="invalid code -- missing end-of-block",E.mode=30;break}if(E.lenbits=9,G={bits:E.lenbits},B=c(u,E.lens,0,E.nlen,E.lencode,0,E.work,G),E.lenbits=G.bits,B){R.msg="invalid literal/lengths set",E.mode=30;break}if(E.distbits=6,E.distcode=E.distdyn,G={bits:E.distbits},B=c(f,E.lens,E.nlen,E.ndist,E.distcode,0,E.work,G),E.distbits=G.bits,B){R.msg="invalid distances set",E.mode=30;break}if(E.mode=20,I===6)break e;case 20:E.mode=21;case 21:if(6<=J&&258<=re){R.next_out=q,R.avail_out=re,R.next_in=$,R.avail_in=J,E.hold=Q,E.bits=X,l(R,pe),q=R.next_out,Z=R.output,re=R.avail_out,$=R.next_in,U=R.input,J=R.avail_in,Q=E.hold,X=E.bits,E.mode===12&&(E.back=-1);break}for(E.back=0;ve=(j=E.lencode[Q&(1<<E.lenbits)-1])>>>16&255,Ee=65535&j,!((ue=j>>>24)<=X);){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}if(ve&&!(240&ve)){for(Se=ue,Fe=ve,Ne=Ee;ve=(j=E.lencode[Ne+((Q&(1<<Se+Fe)-1)>>Se)])>>>16&255,Ee=65535&j,!(Se+(ue=j>>>24)<=X);){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}Q>>>=Se,X-=Se,E.back+=Se}if(Q>>>=ue,X-=ue,E.back+=ue,E.length=Ee,ve===0){E.mode=26;break}if(32&ve){E.back=-1,E.mode=12;break}if(64&ve){R.msg="invalid literal/length code",E.mode=30;break}E.extra=15&ve,E.mode=22;case 22:if(E.extra){for(z=E.extra;X<z;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}E.length+=Q&(1<<E.extra)-1,Q>>>=E.extra,X-=E.extra,E.back+=E.extra}E.was=E.length,E.mode=23;case 23:for(;ve=(j=E.distcode[Q&(1<<E.distbits)-1])>>>16&255,Ee=65535&j,!((ue=j>>>24)<=X);){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}if(!(240&ve)){for(Se=ue,Fe=ve,Ne=Ee;ve=(j=E.distcode[Ne+((Q&(1<<Se+Fe)-1)>>Se)])>>>16&255,Ee=65535&j,!(Se+(ue=j>>>24)<=X);){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}Q>>>=Se,X-=Se,E.back+=Se}if(Q>>>=ue,X-=ue,E.back+=ue,64&ve){R.msg="invalid distance code",E.mode=30;break}E.offset=Ee,E.extra=15&ve,E.mode=24;case 24:if(E.extra){for(z=E.extra;X<z;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}E.offset+=Q&(1<<E.extra)-1,Q>>>=E.extra,X-=E.extra,E.back+=E.extra}if(E.offset>E.dmax){R.msg="invalid distance too far back",E.mode=30;break}E.mode=25;case 25:if(re===0)break e;if(V=pe-re,E.offset>V){if((V=E.offset-V)>E.whave&&E.sane){R.msg="invalid distance too far back",E.mode=30;break}ee=V>E.wnext?(V-=E.wnext,E.wsize-V):E.wnext-V,V>E.length&&(V=E.length),ce=E.window}else ce=Z,ee=q-E.offset,V=E.length;for(re<V&&(V=re),re-=V,E.length-=V;Z[q++]=ce[ee++],--V;);E.length===0&&(E.mode=21);break;case 26:if(re===0)break e;Z[q++]=E.length,re--,E.mode=21;break;case 27:if(E.wrap){for(;X<32;){if(J===0)break e;J--,Q|=U[$++]<<X,X+=8}if(pe-=re,R.total_out+=pe,E.total+=pe,pe&&(R.adler=E.check=E.flags?s(E.check,Z,pe,q-pe):o(E.check,Z,pe,q-pe)),pe=re,(E.flags?Q:h(Q))!==E.check){R.msg="incorrect data check",E.mode=30;break}X=Q=0}E.mode=28;case 28:if(E.wrap&&E.flags){for(;X<32;){if(J===0)break e;J--,Q+=U[$++]<<X,X+=8}if(Q!==(4294967295&E.total)){R.msg="incorrect length check",E.mode=30;break}X=Q=0}E.mode=29;case 29:B=1;break e;case 30:B=-3;break e;case 31:return-4;case 32:default:return d}return R.next_out=q,R.avail_out=re,R.next_in=$,R.avail_in=J,E.hold=Q,E.bits=X,(E.wsize||pe!==R.avail_out&&E.mode<30&&(E.mode<27||I!==4))&&ne(R,R.output,R.next_out,pe-R.avail_out)?(E.mode=31,-4):(me-=R.avail_in,pe-=R.avail_out,R.total_in+=me,R.total_out+=pe,E.total+=pe,E.wrap&&pe&&(R.adler=E.check=E.flags?s(E.check,Z,pe,R.next_out-pe):o(E.check,Z,pe,R.next_out-pe)),R.data_type=E.bits+(E.last?64:0)+(E.mode===12?128:0)+(E.mode===20||E.mode===15?256:0),(me==0&&pe===0||I===4)&&B===p&&(B=-5),B)},i.inflateEnd=function(R){if(!R||!R.state)return d;var I=R.state;return I.window&&(I.window=null),R.state=null,p},i.inflateGetHeader=function(R,I){var E;return R&&R.state&&2&(E=R.state).wrap?((E.head=I).done=!1,p):d},i.inflateSetDictionary=function(R,I){var E,U=I.length;return R&&R.state?(E=R.state).wrap!==0&&E.mode!==11?d:E.mode===11&&o(1,I,U,0)!==E.check?-3:ne(R,I,U,U)?(E.mode=31,-4):(E.havedict=1,p):d},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,r,i){var a=e("../utils/common"),o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(u,f,p,d,b,y,g,h){var m,w,A,v,T,N,M,P,O,ne=h.bits,R=0,I=0,E=0,U=0,Z=0,$=0,q=0,J=0,re=0,Q=0,X=null,me=0,pe=new a.Buf16(16),V=new a.Buf16(16),ee=null,ce=0;for(R=0;R<=15;R++)pe[R]=0;for(I=0;I<d;I++)pe[f[p+I]]++;for(Z=ne,U=15;1<=U&&pe[U]===0;U--);if(U<Z&&(Z=U),U===0)return b[y++]=20971520,b[y++]=20971520,h.bits=1,0;for(E=1;E<U&&pe[E]===0;E++);for(Z<E&&(Z=E),R=J=1;R<=15;R++)if(J<<=1,(J-=pe[R])<0)return-1;if(0<J&&(u===0||U!==1))return-1;for(V[1]=0,R=1;R<15;R++)V[R+1]=V[R]+pe[R];for(I=0;I<d;I++)f[p+I]!==0&&(g[V[f[p+I]]++]=I);if(N=u===0?(X=ee=g,19):u===1?(X=o,me-=257,ee=s,ce-=257,256):(X=l,ee=c,-1),R=E,T=y,q=I=Q=0,A=-1,v=(re=1<<($=Z))-1,u===1&&852<re||u===2&&592<re)return 1;for(;;){for(M=R-q,O=g[I]<N?(P=0,g[I]):g[I]>N?(P=ee[ce+g[I]],X[me+g[I]]):(P=96,0),m=1<<R-q,E=w=1<<$;b[T+(Q>>q)+(w-=m)]=M<<24|P<<16|O|0,w!==0;);for(m=1<<R-1;Q&m;)m>>=1;if(m!==0?(Q&=m-1,Q+=m):Q=0,I++,--pe[R]==0){if(R===U)break;R=f[p+g[I]]}if(Z<R&&(Q&v)!==A){for(q===0&&(q=Z),T+=E,J=1<<($=R-q);$+q<U&&!((J-=pe[$+q])<=0);)$++,J<<=1;if(re+=1<<$,u===1&&852<re||u===2&&592<re)return 1;b[A=Q&v]=Z<<24|$<<16|T-y|0}}return Q!==0&&(b[T+Q]=R-q<<24|64<<16|0),h.bits=Z,0}},{"../utils/common":41}],51:[function(e,r,i){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,r,i){var a=e("../utils/common"),o=0,s=1;function l(j){for(var Y=j.length;0<=--Y;)j[Y]=0}var c=0,u=29,f=256,p=f+1+u,d=30,b=19,y=2*p+1,g=15,h=16,m=7,w=256,A=16,v=17,T=18,N=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],M=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ne=new Array(2*(p+2));l(ne);var R=new Array(2*d);l(R);var I=new Array(512);l(I);var E=new Array(256);l(E);var U=new Array(u);l(U);var Z,$,q,J=new Array(d);function re(j,Y,L,x,k){this.static_tree=j,this.extra_bits=Y,this.extra_base=L,this.elems=x,this.max_length=k,this.has_stree=j&&j.length}function Q(j,Y){this.dyn_tree=j,this.max_code=0,this.stat_desc=Y}function X(j){return j<256?I[j]:I[256+(j>>>7)]}function me(j,Y){j.pending_buf[j.pending++]=255&Y,j.pending_buf[j.pending++]=Y>>>8&255}function pe(j,Y,L){j.bi_valid>h-L?(j.bi_buf|=Y<<j.bi_valid&65535,me(j,j.bi_buf),j.bi_buf=Y>>h-j.bi_valid,j.bi_valid+=L-h):(j.bi_buf|=Y<<j.bi_valid&65535,j.bi_valid+=L)}function V(j,Y,L){pe(j,L[2*Y],L[2*Y+1])}function ee(j,Y){for(var L=0;L|=1&j,j>>>=1,L<<=1,0<--Y;);return L>>>1}function ce(j,Y,L){var x,k,F=new Array(g+1),K=0;for(x=1;x<=g;x++)F[x]=K=K+L[x-1]<<1;for(k=0;k<=Y;k++){var ie=j[2*k+1];ie!==0&&(j[2*k]=ee(F[ie]++,ie))}}function ue(j){var Y;for(Y=0;Y<p;Y++)j.dyn_ltree[2*Y]=0;for(Y=0;Y<d;Y++)j.dyn_dtree[2*Y]=0;for(Y=0;Y<b;Y++)j.bl_tree[2*Y]=0;j.dyn_ltree[2*w]=1,j.opt_len=j.static_len=0,j.last_lit=j.matches=0}function ve(j){8<j.bi_valid?me(j,j.bi_buf):0<j.bi_valid&&(j.pending_buf[j.pending++]=j.bi_buf),j.bi_buf=0,j.bi_valid=0}function Ee(j,Y,L,x){var k=2*Y,F=2*L;return j[k]<j[F]||j[k]===j[F]&&x[Y]<=x[L]}function Se(j,Y,L){for(var x=j.heap[L],k=L<<1;k<=j.heap_len&&(k<j.heap_len&&Ee(Y,j.heap[k+1],j.heap[k],j.depth)&&k++,!Ee(Y,x,j.heap[k],j.depth));)j.heap[L]=j.heap[k],L=k,k<<=1;j.heap[L]=x}function Fe(j,Y,L){var x,k,F,K,ie=0;if(j.last_lit!==0)for(;x=j.pending_buf[j.d_buf+2*ie]<<8|j.pending_buf[j.d_buf+2*ie+1],k=j.pending_buf[j.l_buf+ie],ie++,x===0?V(j,k,Y):(V(j,(F=E[k])+f+1,Y),(K=N[F])!==0&&pe(j,k-=U[F],K),V(j,F=X(--x),L),(K=M[F])!==0&&pe(j,x-=J[F],K)),ie<j.last_lit;);V(j,w,Y)}function Ne(j,Y){var L,x,k,F=Y.dyn_tree,K=Y.stat_desc.static_tree,ie=Y.stat_desc.has_stree,se=Y.stat_desc.elems,Ce=-1;for(j.heap_len=0,j.heap_max=y,L=0;L<se;L++)F[2*L]!==0?(j.heap[++j.heap_len]=Ce=L,j.depth[L]=0):F[2*L+1]=0;for(;j.heap_len<2;)F[2*(k=j.heap[++j.heap_len]=Ce<2?++Ce:0)]=1,j.depth[k]=0,j.opt_len--,ie&&(j.static_len-=K[2*k+1]);for(Y.max_code=Ce,L=j.heap_len>>1;1<=L;L--)Se(j,F,L);for(k=se;L=j.heap[1],j.heap[1]=j.heap[j.heap_len--],Se(j,F,1),x=j.heap[1],j.heap[--j.heap_max]=L,j.heap[--j.heap_max]=x,F[2*k]=F[2*L]+F[2*x],j.depth[k]=(j.depth[L]>=j.depth[x]?j.depth[L]:j.depth[x])+1,F[2*L+1]=F[2*x+1]=k,j.heap[1]=k++,Se(j,F,1),2<=j.heap_len;);j.heap[--j.heap_max]=j.heap[1],function(ke,xe){var Be,Ie,Ve,Re,He,Ge,W=xe.dyn_tree,ye=xe.max_code,we=xe.stat_desc.static_tree,Te=xe.stat_desc.has_stree,oe=xe.stat_desc.extra_bits,ge=xe.stat_desc.extra_base,D=xe.stat_desc.max_length,be=0;for(Re=0;Re<=g;Re++)ke.bl_count[Re]=0;for(W[2*ke.heap[ke.heap_max]+1]=0,Be=ke.heap_max+1;Be<y;Be++)D<(Re=W[2*W[2*(Ie=ke.heap[Be])+1]+1]+1)&&(Re=D,be++),W[2*Ie+1]=Re,ye<Ie||(ke.bl_count[Re]++,He=0,ge<=Ie&&(He=oe[Ie-ge]),Ge=W[2*Ie],ke.opt_len+=Ge*(Re+He),Te&&(ke.static_len+=Ge*(we[2*Ie+1]+He)));if(be!==0){do{for(Re=D-1;ke.bl_count[Re]===0;)Re--;ke.bl_count[Re]--,ke.bl_count[Re+1]+=2,ke.bl_count[D]--,be-=2}while(0<be);for(Re=D;Re!==0;Re--)for(Ie=ke.bl_count[Re];Ie!==0;)ye<(Ve=ke.heap[--Be])||(W[2*Ve+1]!==Re&&(ke.opt_len+=(Re-W[2*Ve+1])*W[2*Ve],W[2*Ve+1]=Re),Ie--)}}(j,Y),ce(F,Ce,j.bl_count)}function _(j,Y,L){var x,k,F=-1,K=Y[1],ie=0,se=7,Ce=4;for(K===0&&(se=138,Ce=3),Y[2*(L+1)+1]=65535,x=0;x<=L;x++)k=K,K=Y[2*(x+1)+1],++ie<se&&k===K||(ie<Ce?j.bl_tree[2*k]+=ie:k!==0?(k!==F&&j.bl_tree[2*k]++,j.bl_tree[2*A]++):ie<=10?j.bl_tree[2*v]++:j.bl_tree[2*T]++,F=k,Ce=(ie=0)===K?(se=138,3):k===K?(se=6,3):(se=7,4))}function B(j,Y,L){var x,k,F=-1,K=Y[1],ie=0,se=7,Ce=4;for(K===0&&(se=138,Ce=3),x=0;x<=L;x++)if(k=K,K=Y[2*(x+1)+1],!(++ie<se&&k===K)){if(ie<Ce)for(;V(j,k,j.bl_tree),--ie!=0;);else k!==0?(k!==F&&(V(j,k,j.bl_tree),ie--),V(j,A,j.bl_tree),pe(j,ie-3,2)):ie<=10?(V(j,v,j.bl_tree),pe(j,ie-3,3)):(V(j,T,j.bl_tree),pe(j,ie-11,7));F=k,Ce=(ie=0)===K?(se=138,3):k===K?(se=6,3):(se=7,4)}}l(J);var G=!1;function z(j,Y,L,x){pe(j,(c<<1)+(x?1:0),3),function(k,F,K,ie){ve(k),ie&&(me(k,K),me(k,~K)),a.arraySet(k.pending_buf,k.window,F,K,k.pending),k.pending+=K}(j,Y,L,!0)}i._tr_init=function(j){G||(function(){var Y,L,x,k,F,K=new Array(g+1);for(k=x=0;k<u-1;k++)for(U[k]=x,Y=0;Y<1<<N[k];Y++)E[x++]=k;for(E[x-1]=k,k=F=0;k<16;k++)for(J[k]=F,Y=0;Y<1<<M[k];Y++)I[F++]=k;for(F>>=7;k<d;k++)for(J[k]=F<<7,Y=0;Y<1<<M[k]-7;Y++)I[256+F++]=k;for(L=0;L<=g;L++)K[L]=0;for(Y=0;Y<=143;)ne[2*Y+1]=8,Y++,K[8]++;for(;Y<=255;)ne[2*Y+1]=9,Y++,K[9]++;for(;Y<=279;)ne[2*Y+1]=7,Y++,K[7]++;for(;Y<=287;)ne[2*Y+1]=8,Y++,K[8]++;for(ce(ne,p+1,K),Y=0;Y<d;Y++)R[2*Y+1]=5,R[2*Y]=ee(Y,5);Z=new re(ne,N,f+1,p,g),$=new re(R,M,0,d,g),q=new re(new Array(0),P,0,b,m)}(),G=!0),j.l_desc=new Q(j.dyn_ltree,Z),j.d_desc=new Q(j.dyn_dtree,$),j.bl_desc=new Q(j.bl_tree,q),j.bi_buf=0,j.bi_valid=0,ue(j)},i._tr_stored_block=z,i._tr_flush_block=function(j,Y,L,x){var k,F,K=0;0<j.level?(j.strm.data_type===2&&(j.strm.data_type=function(ie){var se,Ce=4093624447;for(se=0;se<=31;se++,Ce>>>=1)if(1&Ce&&ie.dyn_ltree[2*se]!==0)return o;if(ie.dyn_ltree[18]!==0||ie.dyn_ltree[20]!==0||ie.dyn_ltree[26]!==0)return s;for(se=32;se<f;se++)if(ie.dyn_ltree[2*se]!==0)return s;return o}(j)),Ne(j,j.l_desc),Ne(j,j.d_desc),K=function(ie){var se;for(_(ie,ie.dyn_ltree,ie.l_desc.max_code),_(ie,ie.dyn_dtree,ie.d_desc.max_code),Ne(ie,ie.bl_desc),se=b-1;3<=se&&ie.bl_tree[2*O[se]+1]===0;se--);return ie.opt_len+=3*(se+1)+5+5+4,se}(j),k=j.opt_len+3+7>>>3,(F=j.static_len+3+7>>>3)<=k&&(k=F)):k=F=L+5,L+4<=k&&Y!==-1?z(j,Y,L,x):j.strategy===4||F===k?(pe(j,2+(x?1:0),3),Fe(j,ne,R)):(pe(j,4+(x?1:0),3),function(ie,se,Ce,ke){var xe;for(pe(ie,se-257,5),pe(ie,Ce-1,5),pe(ie,ke-4,4),xe=0;xe<ke;xe++)pe(ie,ie.bl_tree[2*O[xe]+1],3);B(ie,ie.dyn_ltree,se-1),B(ie,ie.dyn_dtree,Ce-1)}(j,j.l_desc.max_code+1,j.d_desc.max_code+1,K+1),Fe(j,j.dyn_ltree,j.dyn_dtree)),ue(j),x&&ve(j)},i._tr_tally=function(j,Y,L){return j.pending_buf[j.d_buf+2*j.last_lit]=Y>>>8&255,j.pending_buf[j.d_buf+2*j.last_lit+1]=255&Y,j.pending_buf[j.l_buf+j.last_lit]=255&L,j.last_lit++,Y===0?j.dyn_ltree[2*L]++:(j.matches++,Y--,j.dyn_ltree[2*(E[L]+f+1)]++,j.dyn_dtree[2*X(Y)]++),j.last_lit===j.lit_bufsize-1},i._tr_align=function(j){pe(j,2,3),V(j,w,ne),function(Y){Y.bi_valid===16?(me(Y,Y.bi_buf),Y.bi_buf=0,Y.bi_valid=0):8<=Y.bi_valid&&(Y.pending_buf[Y.pending++]=255&Y.bi_buf,Y.bi_buf>>=8,Y.bi_valid-=8)}(j)}},{"../utils/common":41}],53:[function(e,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,r,i){(function(a){(function(o,s){if(!o.setImmediate){var l,c,u,f,p=1,d={},b=!1,y=o.document,g=Object.getPrototypeOf&&Object.getPrototypeOf(o);g=g&&g.setTimeout?g:o,l={}.toString.call(o.process)==="[object process]"?function(A){process.nextTick(function(){m(A)})}:function(){if(o.postMessage&&!o.importScripts){var A=!0,v=o.onmessage;return o.onmessage=function(){A=!1},o.postMessage("","*"),o.onmessage=v,A}}()?(f="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",w,!1):o.attachEvent("onmessage",w),function(A){o.postMessage(f+A,"*")}):o.MessageChannel?((u=new MessageChannel).port1.onmessage=function(A){m(A.data)},function(A){u.port2.postMessage(A)}):y&&"onreadystatechange"in y.createElement("script")?(c=y.documentElement,function(A){var v=y.createElement("script");v.onreadystatechange=function(){m(A),v.onreadystatechange=null,c.removeChild(v),v=null},c.appendChild(v)}):function(A){setTimeout(m,0,A)},g.setImmediate=function(A){typeof A!="function"&&(A=new Function(""+A));for(var v=new Array(arguments.length-1),T=0;T<v.length;T++)v[T]=arguments[T+1];var N={callback:A,args:v};return d[p]=N,l(p),p++},g.clearImmediate=h}function h(A){delete d[A]}function m(A){if(b)setTimeout(m,0,A);else{var v=d[A];if(v){b=!0;try{(function(T){var N=T.callback,M=T.args;switch(M.length){case 0:N();break;case 1:N(M[0]);break;case 2:N(M[0],M[1]);break;case 3:N(M[0],M[1],M[2]);break;default:N.apply(s,M)}})(v)}finally{h(A),b=!1}}}}function w(A){A.source===o&&typeof A.data=="string"&&A.data.indexOf(f)===0&&m(+A.data.slice(f.length))}})(typeof self>"u"?a===void 0?this:a:self)}).call(this,typeof Ot<"u"?Ot:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(al);var Cp=al.exports;const Sp=il(Cp);/*
|
|
23
|
+
* @license
|
|
24
|
+
* docx-preview <https://github.com/VolodymyrBaydalka/docxjs>
|
|
25
|
+
* Released under Apache License 2.0 <https://github.com/VolodymyrBaydalka/docxjs/blob/master/LICENSE>
|
|
26
|
+
* Copyright Volodymyr Baydalka
|
|
27
|
+
*/var st;(function(n){n.OfficeDocument="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",n.FontTable="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",n.Image="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",n.Numbering="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",n.Styles="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",n.StylesWithEffects="http://schemas.microsoft.com/office/2007/relationships/stylesWithEffects",n.Theme="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",n.Settings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",n.WebSettings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",n.Hyperlink="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",n.Footnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",n.Endnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",n.Footer="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",n.Header="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",n.ExtendedProperties="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",n.CoreProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",n.CustomProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/custom-properties",n.Comments="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",n.CommentsExtended="http://schemas.microsoft.com/office/2011/relationships/commentsExtended",n.AltChunk="http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk"})(st||(st={}));function xp(n,t){return t.elements(n).map(e=>({id:t.attr(e,"Id"),type:t.attr(e,"Type"),target:t.attr(e,"Target"),targetMode:t.attr(e,"TargetMode")}))}function Tp(n){return n==null?void 0:n.replace(/[ .]+/g,"-").replace(/[&]+/g,"and").toLowerCase()}function Pa(n){return/^[^"'].*\s.*[^"']$/.test(n)?`'${n}'`:n}function mi(n){let t=n.lastIndexOf("/")+1,e=t==0?"":n.substring(0,t),r=t==0?n:n.substring(t);return[e,r]}function Ba(n,t){try{const e="http://docx/";return new URL(n,e+t).toString().substring(e.length)}catch{return`${t}${n}`}}function dr(n,t){return n.reduce((e,r)=>(e[t(r)]=r,e),{})}function Ap(n){return new Promise((t,e)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=()=>e(),r.readAsDataURL(n)})}function Da(n){return n&&typeof n=="object"&&!Array.isArray(n)}function Rp(n){return typeof n=="string"||n instanceof String}function gi(n,...t){if(!t.length)return n;const e=t.shift();if(Da(n)&&Da(e))for(const r in e)if(Da(e[r])){const i=n[r]??(n[r]={});gi(i,e[r])}else n[r]=e[r];return gi(n,...t)}function ln(n){return Array.isArray(n)?n:[n]}function Np(n,t,e){return t>n?t:e<n?e:n}const ol={wordml:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},ut={Dxa:{mul:.05,unit:"pt"},Emu:{mul:1/12700,unit:"pt"},FontSize:{mul:.5,unit:"pt"},Border:{mul:.125,unit:"pt",min:.25,max:12},Point:{mul:1,unit:"pt"},Percent:{mul:.02,unit:"%"}};function sl(n,t=ut.Dxa){if(n==null||/.+(p[xt]|[%])$/.test(n))return n;var e=parseInt(n)*t.mul;return t.min&&t.max&&(e=Np(e,t.min,t.max)),`${e.toFixed(2)}${t.unit}`}function Mp(n,t=!1){switch(n){case"1":return!0;case"0":return!1;case"on":return!0;case"off":return!1;case"true":return!0;case"false":return!1;default:return t}}function ll(n,t,e){if(n.namespaceURI!=ol.wordml)return!1;switch(n.localName){case"color":t.color=e.attr(n,"val");break;case"sz":t.fontSize=e.lengthAttr(n,"val",ut.FontSize);break;default:return!1}return!0}function Lp(n,t=!1){t&&(n=n.replace(/<[?].*[?]>/,"")),n=Ip(n);const e=new DOMParser().parseFromString(n,"application/xml"),r=Op(e);if(r)throw new Error(r);return e}function Op(n){var t;return(t=n.getElementsByTagName("parsererror")[0])==null?void 0:t.textContent}function Ip(n){return n.charCodeAt(0)===65279?n.substring(1):n}function Fp(n){return new XMLSerializer().serializeToString(n)}class cl{elements(t,e=null){const r=[];for(let i=0,a=t.childNodes.length;i<a;i++){let o=t.childNodes.item(i);o.nodeType==Node.ELEMENT_NODE&&(e==null||o.localName==e)&&r.push(o)}return r}element(t,e){for(let r=0,i=t.childNodes.length;r<i;r++){let a=t.childNodes.item(r);if(a.nodeType==1&&a.localName==e)return a}return null}elementAttr(t,e,r){var i=this.element(t,e);return i?this.attr(i,r):void 0}attrs(t){return Array.from(t.attributes)}attr(t,e){for(let r=0,i=t.attributes.length;r<i;r++){let a=t.attributes.item(r);if(a.localName==e)return a.value}return null}intAttr(t,e,r=null){var i=this.attr(t,e);return i?parseInt(i):r}hexAttr(t,e,r=null){var i=this.attr(t,e);return i?parseInt(i,16):r}floatAttr(t,e,r=null){var i=this.attr(t,e);return i?parseFloat(i):r}boolAttr(t,e,r=null){return Mp(this.attr(t,e),r)}lengthAttr(t,e,r=ut.Dxa){return sl(this.attr(t,e),r)}}const ae=new cl;class Tt{constructor(t,e){this._package=t,this.path=e}async load(){this.rels=await this._package.loadRelationships(this.path);const t=await this._package.load(this.path),e=this._package.parseXmlDocument(t);this._package.options.keepOrigin&&(this._xmlDocument=e),this.parseXml(e.firstElementChild)}save(){this._package.update(this.path,Fp(this._xmlDocument))}parseXml(t){}}const Pp={embedRegular:"regular",embedBold:"bold",embedItalic:"italic",embedBoldItalic:"boldItalic"};function Bp(n,t){return t.elements(n).map(e=>Dp(e,t))}function Dp(n,t){let e={name:t.attr(n,"name"),embedFontRefs:[]};for(let r of t.elements(n))switch(r.localName){case"family":e.family=t.attr(r,"val");break;case"altName":e.altName=t.attr(r,"val");break;case"embedRegular":case"embedBold":case"embedItalic":case"embedBoldItalic":e.embedFontRefs.push(zp(r,t));break}return e}function zp(n,t){return{id:t.attr(n,"id"),key:t.attr(n,"fontKey"),type:Pp[n.localName]}}class Up extends Tt{parseXml(t){this.fonts=Bp(t,this._package.xmlParser)}}class za{constructor(t,e){this._zip=t,this.options=e,this.xmlParser=new cl}get(t){const e=Hp(t);return this._zip.files[e]??this._zip.files[e.replace(/\//g,"\\")]}update(t,e){this._zip.file(t,e)}static async load(t,e){const r=await Sp.loadAsync(t);return new za(r,e)}save(t="blob"){return this._zip.generateAsync({type:t})}load(t,e="string"){var r;return((r=this.get(t))==null?void 0:r.async(e))??Promise.resolve(null)}async loadRelationships(t=null){let e="_rels/.rels";if(t!=null){const[i,a]=mi(t);e=`${i}_rels/${a}.rels`}const r=await this.load(e);return r?xp(this.parseXmlDocument(r).firstElementChild,this.xmlParser):null}parseXmlDocument(t){return Lp(t,this.options.trimXmlDeclaration)}}function Hp(n){return n.startsWith("/")?n.substr(1):n}class Wp extends Tt{constructor(t,e,r){super(t,e),this._documentParser=r}parseXml(t){this.body=this._documentParser.parseDocumentFile(t)}}function yi(n,t){return{type:t.attr(n,"val"),color:t.attr(n,"color"),size:t.lengthAttr(n,"sz",ut.Border),offset:t.lengthAttr(n,"space",ut.Point),frame:t.boolAttr(n,"frame"),shadow:t.boolAttr(n,"shadow")}}function jp(n,t){var e={};for(let r of t.elements(n))switch(r.localName){case"left":e.left=yi(r,t);break;case"top":e.top=yi(r,t);break;case"right":e.right=yi(r,t);break;case"bottom":e.bottom=yi(r,t);break}return e}var ul;(function(n){n.Continuous="continuous",n.NextPage="nextPage",n.NextColumn="nextColumn",n.EvenPage="evenPage",n.OddPage="oddPage"})(ul||(ul={}));function fl(n,t=ae){var e={};for(let r of t.elements(n))switch(r.localName){case"pgSz":e.pageSize={width:t.lengthAttr(r,"w"),height:t.lengthAttr(r,"h"),orientation:t.attr(r,"orient")};break;case"type":e.type=t.attr(r,"val");break;case"pgMar":e.pageMargins={left:t.lengthAttr(r,"left"),right:t.lengthAttr(r,"right"),top:t.lengthAttr(r,"top"),bottom:t.lengthAttr(r,"bottom"),header:t.lengthAttr(r,"header"),footer:t.lengthAttr(r,"footer"),gutter:t.lengthAttr(r,"gutter")};break;case"cols":e.columns=$p(r,t);break;case"headerReference":(e.headerRefs??(e.headerRefs=[])).push(dl(r,t));break;case"footerReference":(e.footerRefs??(e.footerRefs=[])).push(dl(r,t));break;case"titlePg":e.titlePage=t.boolAttr(r,"val",!0);break;case"pgBorders":e.pageBorders=jp(r,t);break;case"pgNumType":e.pageNumber=Vp(r,t);break}return e}function $p(n,t){return{numberOfColumns:t.intAttr(n,"num"),space:t.lengthAttr(n,"space"),separator:t.boolAttr(n,"sep"),equalWidth:t.boolAttr(n,"equalWidth",!0),columns:t.elements(n,"col").map(e=>({width:t.lengthAttr(e,"w"),space:t.lengthAttr(e,"space")}))}}function Vp(n,t){return{chapSep:t.attr(n,"chapSep"),chapStyle:t.attr(n,"chapStyle"),format:t.attr(n,"fmt"),start:t.intAttr(n,"start")}}function dl(n,t){return{id:t.attr(n,"id"),type:t.attr(n,"type")}}function Zp(n,t){return{before:t.lengthAttr(n,"before"),after:t.lengthAttr(n,"after"),line:t.intAttr(n,"line"),lineRule:t.attr(n,"lineRule")}}function Ua(n,t){let e={};for(let r of t.elements(n))Xp(r,e,t);return e}function Xp(n,t,e){return!!ll(n,t,e)}function hl(n,t){let e={};for(let r of t.elements(n))pl(r,e,t);return e}function pl(n,t,e){if(n.namespaceURI!=ol.wordml)return!1;if(ll(n,t,e))return!0;switch(n.localName){case"tabs":t.tabs=Gp(n,e);break;case"sectPr":t.sectionProps=fl(n,e);break;case"numPr":t.numbering=Kp(n,e);break;case"spacing":return t.lineSpacing=Zp(n,e),!1;case"textAlignment":return t.textAlignment=e.attr(n,"val"),!1;case"keepLines":t.keepLines=e.boolAttr(n,"val",!0);break;case"keepNext":t.keepNext=e.boolAttr(n,"val",!0);break;case"pageBreakBefore":t.pageBreakBefore=e.boolAttr(n,"val",!0);break;case"outlineLvl":t.outlineLevel=e.intAttr(n,"val");break;case"pStyle":t.styleName=e.attr(n,"val");break;case"rPr":t.runProps=Ua(n,e);break;default:return!1}return!0}function Gp(n,t){return t.elements(n,"tab").map(e=>({position:t.lengthAttr(e,"pos"),leader:t.attr(e,"leader"),style:t.attr(e,"val")}))}function Kp(n,t){var e={};for(let r of t.elements(n))switch(r.localName){case"numId":e.id=t.attr(r,"val");break;case"ilvl":e.level=t.intAttr(r,"val");break}return e}function Jp(n,t){let e={numberings:[],abstractNumberings:[],bulletPictures:[]};for(let r of t.elements(n))switch(r.localName){case"num":e.numberings.push(Yp(r,t));break;case"abstractNum":e.abstractNumberings.push(Qp(r,t));break;case"numPicBullet":e.bulletPictures.push(e0(r,t));break}return e}function Yp(n,t){let e={id:t.attr(n,"numId"),overrides:[]};for(let r of t.elements(n))switch(r.localName){case"abstractNumId":e.abstractId=t.attr(r,"val");break;case"lvlOverride":e.overrides.push(qp(r,t));break}return e}function Qp(n,t){let e={id:t.attr(n,"abstractNumId"),levels:[]};for(let r of t.elements(n))switch(r.localName){case"name":e.name=t.attr(r,"val");break;case"multiLevelType":e.multiLevelType=t.attr(r,"val");break;case"numStyleLink":e.numberingStyleLink=t.attr(r,"val");break;case"styleLink":e.styleLink=t.attr(r,"val");break;case"lvl":e.levels.push(ml(r,t));break}return e}function ml(n,t){let e={level:t.intAttr(n,"ilvl")};for(let r of t.elements(n))switch(r.localName){case"start":e.start=t.attr(r,"val");break;case"lvlRestart":e.restart=t.intAttr(r,"val");break;case"numFmt":e.format=t.attr(r,"val");break;case"lvlText":e.text=t.attr(r,"val");break;case"lvlJc":e.justification=t.attr(r,"val");break;case"lvlPicBulletId":e.bulletPictureId=t.attr(r,"val");break;case"pStyle":e.paragraphStyle=t.attr(r,"val");break;case"pPr":e.paragraphProps=hl(r,t);break;case"rPr":e.runProps=Ua(r,t);break}return e}function qp(n,t){let e={level:t.intAttr(n,"ilvl")};for(let r of t.elements(n))switch(r.localName){case"startOverride":e.start=t.intAttr(r,"val");break;case"lvl":e.numberingLevel=ml(r,t);break}return e}function e0(n,t){var e=t.element(n,"pict"),r=e&&t.element(e,"shape"),i=r&&t.element(r,"imagedata");return i?{id:t.attr(n,"numPicBulletId"),referenceId:t.attr(i,"id"),style:t.attr(r,"style")}:null}class t0 extends Tt{constructor(t,e,r){super(t,e),this._documentParser=r}parseXml(t){Object.assign(this,Jp(t,this._package.xmlParser)),this.domNumberings=this._documentParser.parseNumberingFile(t)}}class r0 extends Tt{constructor(t,e,r){super(t,e),this._documentParser=r}parseXml(t){this.styles=this._documentParser.parseStylesFile(t)}}var he;(function(n){n.Document="document",n.Paragraph="paragraph",n.Run="run",n.Break="break",n.NoBreakHyphen="noBreakHyphen",n.Table="table",n.Row="row",n.Cell="cell",n.Hyperlink="hyperlink",n.SmartTag="smartTag",n.Drawing="drawing",n.Image="image",n.Text="text",n.Tab="tab",n.Symbol="symbol",n.BookmarkStart="bookmarkStart",n.BookmarkEnd="bookmarkEnd",n.Footer="footer",n.Header="header",n.FootnoteReference="footnoteReference",n.EndnoteReference="endnoteReference",n.Footnote="footnote",n.Endnote="endnote",n.SimpleField="simpleField",n.ComplexField="complexField",n.Instruction="instruction",n.VmlPicture="vmlPicture",n.MmlMath="mmlMath",n.MmlMathParagraph="mmlMathParagraph",n.MmlFraction="mmlFraction",n.MmlFunction="mmlFunction",n.MmlFunctionName="mmlFunctionName",n.MmlNumerator="mmlNumerator",n.MmlDenominator="mmlDenominator",n.MmlRadical="mmlRadical",n.MmlBase="mmlBase",n.MmlDegree="mmlDegree",n.MmlSuperscript="mmlSuperscript",n.MmlSubscript="mmlSubscript",n.MmlPreSubSuper="mmlPreSubSuper",n.MmlSubArgument="mmlSubArgument",n.MmlSuperArgument="mmlSuperArgument",n.MmlNary="mmlNary",n.MmlDelimiter="mmlDelimiter",n.MmlRun="mmlRun",n.MmlEquationArray="mmlEquationArray",n.MmlLimit="mmlLimit",n.MmlLimitLower="mmlLimitLower",n.MmlMatrix="mmlMatrix",n.MmlMatrixRow="mmlMatrixRow",n.MmlBox="mmlBox",n.MmlBar="mmlBar",n.MmlGroupChar="mmlGroupChar",n.VmlElement="vmlElement",n.Inserted="inserted",n.Deleted="deleted",n.DeletedText="deletedText",n.Comment="comment",n.CommentReference="commentReference",n.CommentRangeStart="commentRangeStart",n.CommentRangeEnd="commentRangeEnd",n.AltChunk="altChunk"})(he||(he={}));class xr{constructor(){this.children=[],this.cssStyle={}}}class n0 extends xr{constructor(){super(...arguments),this.type=he.Header}}class i0 extends xr{constructor(){super(...arguments),this.type=he.Footer}}class gl extends Tt{constructor(t,e,r){super(t,e),this._documentParser=r}parseXml(t){this.rootElement=this.createRootElement(),this.rootElement.children=this._documentParser.parseBodyElements(t)}}class a0 extends gl{createRootElement(){return new n0}}class o0 extends gl{createRootElement(){return new i0}}function s0(n,t){const e={};for(let r of t.elements(n))switch(r.localName){case"Template":e.template=r.textContent;break;case"Pages":e.pages=cn(r.textContent);break;case"Words":e.words=cn(r.textContent);break;case"Characters":e.characters=cn(r.textContent);break;case"Application":e.application=r.textContent;break;case"Lines":e.lines=cn(r.textContent);break;case"Paragraphs":e.paragraphs=cn(r.textContent);break;case"Company":e.company=r.textContent;break;case"AppVersion":e.appVersion=r.textContent;break}return e}function cn(n){if(!(typeof n>"u"))return parseInt(n)}class l0 extends Tt{parseXml(t){this.props=s0(t,this._package.xmlParser)}}function c0(n,t){const e={};for(let r of t.elements(n))switch(r.localName){case"title":e.title=r.textContent;break;case"description":e.description=r.textContent;break;case"subject":e.subject=r.textContent;break;case"creator":e.creator=r.textContent;break;case"keywords":e.keywords=r.textContent;break;case"language":e.language=r.textContent;break;case"lastModifiedBy":e.lastModifiedBy=r.textContent;break;case"revision":r.textContent&&(e.revision=parseInt(r.textContent));break}return e}class u0 extends Tt{parseXml(t){this.props=c0(t,this._package.xmlParser)}}class f0{}function d0(n,t){var e=new f0,r=t.element(n,"themeElements");for(let i of t.elements(r))switch(i.localName){case"clrScheme":e.colorScheme=h0(i,t);break;case"fontScheme":e.fontScheme=p0(i,t);break}return e}function h0(n,t){var e={name:t.attr(n,"name"),colors:{}};for(let a of t.elements(n)){var r=t.element(a,"srgbClr"),i=t.element(a,"sysClr");r?e.colors[a.localName]=t.attr(r,"val"):i&&(e.colors[a.localName]=t.attr(i,"lastClr"))}return e}function p0(n,t){var e={name:t.attr(n,"name")};for(let r of t.elements(n))switch(r.localName){case"majorFont":e.majorFont=yl(r,t);break;case"minorFont":e.minorFont=yl(r,t);break}return e}function yl(n,t){return{latinTypeface:t.elementAttr(n,"latin","typeface"),eaTypeface:t.elementAttr(n,"ea","typeface"),csTypeface:t.elementAttr(n,"cs","typeface")}}class m0 extends Tt{constructor(t,e){super(t,e)}parseXml(t){this.theme=d0(t,this._package.xmlParser)}}class bl{}class g0 extends bl{constructor(){super(...arguments),this.type=he.Footnote}}class y0 extends bl{constructor(){super(...arguments),this.type=he.Endnote}}class vl extends Tt{constructor(t,e,r){super(t,e),this._documentParser=r}}class b0 extends vl{constructor(t,e,r){super(t,e,r)}parseXml(t){this.notes=this._documentParser.parseNotes(t,"footnote",g0)}}class v0 extends vl{constructor(t,e,r){super(t,e,r)}parseXml(t){this.notes=this._documentParser.parseNotes(t,"endnote",y0)}}function w0(n,t){var e={};for(let r of t.elements(n))switch(r.localName){case"defaultTabStop":e.defaultTabStop=t.lengthAttr(r,"val");break;case"footnotePr":e.footnoteProps=wl(r,t);break;case"endnotePr":e.endnoteProps=wl(r,t);break;case"autoHyphenation":e.autoHyphenation=t.boolAttr(r,"val");break}return e}function wl(n,t){var e={defaultNoteIds:[]};for(let r of t.elements(n))switch(r.localName){case"numFmt":e.nummeringFormat=t.attr(r,"val");break;case"footnote":case"endnote":e.defaultNoteIds.push(t.attr(r,"id"));break}return e}class _0 extends Tt{constructor(t,e){super(t,e)}parseXml(t){this.settings=w0(t,this._package.xmlParser)}}function k0(n,t){return t.elements(n,"property").map(e=>{const r=e.firstChild;return{formatId:t.attr(e,"fmtid"),name:t.attr(e,"name"),type:r.nodeName,value:r.textContent}})}class E0 extends Tt{parseXml(t){this.props=k0(t,this._package.xmlParser)}}class C0 extends Tt{constructor(t,e,r){super(t,e),this._documentParser=r}parseXml(t){this.comments=this._documentParser.parseComments(t),this.commentMap=dr(this.comments,e=>e.id)}}class S0 extends Tt{constructor(t,e){super(t,e),this.comments=[]}parseXml(t){const e=this._package.xmlParser;for(let r of e.elements(t,"commentEx"))this.comments.push({paraId:e.attr(r,"paraId"),paraIdParent:e.attr(r,"paraIdParent"),done:e.boolAttr(r,"done")});this.commentMap=dr(this.comments,r=>r.paraId)}}const x0=[{type:st.OfficeDocument,target:"word/document.xml"},{type:st.ExtendedProperties,target:"docProps/app.xml"},{type:st.CoreProperties,target:"docProps/core.xml"},{type:st.CustomProperties,target:"docProps/custom.xml"}];class Ha{constructor(){this.parts=[],this.partsMap={}}static async load(t,e,r){var i=new Ha;return i._options=r,i._parser=e,i._package=await za.load(t,r),i.rels=await i._package.loadRelationships(),await Promise.all(x0.map(a=>{const o=i.rels.find(s=>s.type===a.type)??a;return i.loadRelationshipPart(o.target,o.type)})),i}save(t="blob"){return this._package.save(t)}async loadRelationshipPart(t,e){var i;if(this.partsMap[t])return this.partsMap[t];if(!this._package.get(t))return null;let r=null;switch(e){case st.OfficeDocument:this.documentPart=r=new Wp(this._package,t,this._parser);break;case st.FontTable:this.fontTablePart=r=new Up(this._package,t);break;case st.Numbering:this.numberingPart=r=new t0(this._package,t,this._parser);break;case st.Styles:this.stylesPart=r=new r0(this._package,t,this._parser);break;case st.Theme:this.themePart=r=new m0(this._package,t);break;case st.Footnotes:this.footnotesPart=r=new b0(this._package,t,this._parser);break;case st.Endnotes:this.endnotesPart=r=new v0(this._package,t,this._parser);break;case st.Footer:r=new o0(this._package,t,this._parser);break;case st.Header:r=new a0(this._package,t,this._parser);break;case st.CoreProperties:this.corePropsPart=r=new u0(this._package,t);break;case st.ExtendedProperties:this.extendedPropsPart=r=new l0(this._package,t);break;case st.CustomProperties:r=new E0(this._package,t);break;case st.Settings:this.settingsPart=r=new _0(this._package,t);break;case st.Comments:this.commentsPart=r=new C0(this._package,t,this._parser);break;case st.CommentsExtended:this.commentsExtendedPart=r=new S0(this._package,t);break}if(r==null)return Promise.resolve(null);if(this.partsMap[t]=r,this.parts.push(r),await r.load(),((i=r.rels)==null?void 0:i.length)>0){const[a]=mi(r.path);await Promise.all(r.rels.map(o=>this.loadRelationshipPart(Ba(o.target,a),o.type)))}return r}async loadDocumentImage(t,e){const r=await this.loadResource(e??this.documentPart,t,"blob");return this.blobToURL(r)}async loadNumberingImage(t){const e=await this.loadResource(this.numberingPart,t,"blob");return this.blobToURL(e)}async loadFont(t,e){const r=await this.loadResource(this.fontTablePart,t,"uint8array");return r&&this.blobToURL(new Blob([T0(r,e)]))}async loadAltChunk(t,e){return await this.loadResource(e??this.documentPart,t,"string")}blobToURL(t){return t?this._options.useBase64URL?Ap(t):URL.createObjectURL(t):null}findPartByRelId(t,e=null){var r=(e.rels??this.rels).find(a=>a.id==t);const i=e?mi(e.path)[0]:"";return r?this.partsMap[Ba(r.target,i)]:null}getPathById(t,e){const r=t.rels.find(a=>a.id==e),[i]=mi(t.path);return r?Ba(r.target,i):null}loadResource(t,e,r){const i=this.getPathById(t,e);return i?this._package.load(i,r):Promise.resolve(null)}}function T0(n,t){const r=t.replace(/{|}|-/g,""),i=new Array(16);for(let a=0;a<16;a++)i[16-a-1]=parseInt(r.substring(a*2,a*2+2),16);for(let a=0;a<32;a++)n[a]=n[a]^i[a%16];return n}function A0(n,t){return{type:he.BookmarkStart,id:t.attr(n,"id"),name:t.attr(n,"name"),colFirst:t.intAttr(n,"colFirst"),colLast:t.intAttr(n,"colLast")}}function R0(n,t){return{type:he.BookmarkEnd,id:t.attr(n,"id")}}class N0 extends xr{constructor(){super(...arguments),this.type=he.VmlElement,this.attrs={}}}function _l(n,t){var e=new N0;switch(n.localName){case"rect":e.tagName="rect",Object.assign(e.attrs,{width:"100%",height:"100%"});break;case"oval":e.tagName="ellipse",Object.assign(e.attrs,{cx:"50%",cy:"50%",rx:"50%",ry:"50%"});break;case"line":e.tagName="line";break;case"shape":e.tagName="g";break;case"textbox":e.tagName="foreignObject",Object.assign(e.attrs,{width:"100%",height:"100%"});break;default:return null}for(const r of ae.attrs(n))switch(r.localName){case"style":e.cssStyleText=r.value;break;case"fillcolor":e.attrs.fill=r.value;break;case"from":const[i,a]=kl(r.value);Object.assign(e.attrs,{x1:i,y1:a});break;case"to":const[o,s]=kl(r.value);Object.assign(e.attrs,{x2:o,y2:s});break}for(const r of ae.elements(n))switch(r.localName){case"stroke":Object.assign(e.attrs,M0(r));break;case"fill":Object.assign(e.attrs,L0());break;case"imagedata":e.tagName="image",Object.assign(e.attrs,{width:"100%",height:"100%"}),e.imageHref={id:ae.attr(r,"id"),title:ae.attr(r,"title")};break;case"txbxContent":e.children.push(...t.parseBodyElements(r));break;default:const i=_l(r,t);i&&e.children.push(i);break}return e}function M0(n){return{stroke:ae.attr(n,"color"),"stroke-width":ae.lengthAttr(n,"weight",ut.Emu)??"1px"}}function L0(n){return{}}function kl(n){return n.split(",")}class O0 extends xr{constructor(){super(...arguments),this.type=he.Comment}}class I0 extends xr{constructor(t){super(),this.id=t,this.type=he.CommentReference}}class F0 extends xr{constructor(t){super(),this.id=t,this.type=he.CommentRangeStart}}class P0 extends xr{constructor(t){super(),this.id=t,this.type=he.CommentRangeEnd}}var bi={shd:"inherit",color:"black",borderColor:"black",highlight:"transparent"};const B0=[],El={oMath:he.MmlMath,oMathPara:he.MmlMathParagraph,f:he.MmlFraction,func:he.MmlFunction,fName:he.MmlFunctionName,num:he.MmlNumerator,den:he.MmlDenominator,rad:he.MmlRadical,deg:he.MmlDegree,e:he.MmlBase,sSup:he.MmlSuperscript,sSub:he.MmlSubscript,sPre:he.MmlPreSubSuper,sup:he.MmlSuperArgument,sub:he.MmlSubArgument,d:he.MmlDelimiter,nary:he.MmlNary,eqArr:he.MmlEquationArray,lim:he.MmlLimit,limLow:he.MmlLimitLower,m:he.MmlMatrix,mr:he.MmlMatrixRow,box:he.MmlBox,bar:he.MmlBar,groupChr:he.MmlGroupChar};class D0{constructor(t){this.options={ignoreWidth:!1,debug:!1,...t}}parseNotes(t,e,r){var i=[];for(let a of ae.elements(t,e)){const o=new r;o.id=ae.attr(a,"id"),o.noteType=ae.attr(a,"type"),o.children=this.parseBodyElements(a),i.push(o)}return i}parseComments(t){var e=[];for(let r of ae.elements(t,"comment")){const i=new O0;i.id=ae.attr(r,"id"),i.author=ae.attr(r,"author"),i.initials=ae.attr(r,"initials"),i.date=ae.attr(r,"date"),i.children=this.parseBodyElements(r),e.push(i)}return e}parseDocumentFile(t){var e=ae.element(t,"body"),r=ae.element(t,"background"),i=ae.element(e,"sectPr");return{type:he.Document,children:this.parseBodyElements(e),props:i?fl(i,ae):{},cssStyle:r?this.parseBackground(r):{}}}parseBackground(t){var e={},r=Br.colorAttr(t,"color");return r&&(e["background-color"]=r),e}parseBodyElements(t){var e=[];for(const r of ae.elements(t))switch(r.localName){case"p":e.push(this.parseParagraph(r));break;case"altChunk":e.push(this.parseAltChunk(r));break;case"tbl":e.push(this.parseTable(r));break;case"sdt":e.push(...this.parseSdt(r,i=>this.parseBodyElements(i)));break}return e}parseStylesFile(t){var e=[];for(const r of ae.elements(t))switch(r.localName){case"style":e.push(this.parseStyle(r));break;case"docDefaults":e.push(this.parseDefaultStyles(r));break}return e}parseDefaultStyles(t){var e={id:null,name:null,target:null,basedOn:null,styles:[]};for(const a of ae.elements(t))switch(a.localName){case"rPrDefault":var r=ae.element(a,"rPr");r&&e.styles.push({target:"span",values:this.parseDefaultProperties(r,{})});break;case"pPrDefault":var i=ae.element(a,"pPr");i&&e.styles.push({target:"p",values:this.parseDefaultProperties(i,{})});break}return e}parseStyle(t){var e={id:ae.attr(t,"styleId"),isDefault:ae.boolAttr(t,"default"),name:null,target:null,basedOn:null,styles:[],linked:null};switch(ae.attr(t,"type")){case"paragraph":e.target="p";break;case"table":e.target="table";break;case"character":e.target="span";break}for(const r of ae.elements(t))switch(r.localName){case"basedOn":e.basedOn=ae.attr(r,"val");break;case"name":e.name=ae.attr(r,"val");break;case"link":e.linked=ae.attr(r,"val");break;case"next":e.next=ae.attr(r,"val");break;case"aliases":e.aliases=ae.attr(r,"val").split(",");break;case"pPr":e.styles.push({target:"p",values:this.parseDefaultProperties(r,{})}),e.paragraphProps=hl(r,ae);break;case"rPr":e.styles.push({target:"span",values:this.parseDefaultProperties(r,{})}),e.runProps=Ua(r,ae);break;case"tblPr":case"tcPr":e.styles.push({target:"td",values:this.parseDefaultProperties(r,{})});break;case"tblStylePr":for(let i of this.parseTableStyle(r))e.styles.push(i);break;case"rsid":case"qFormat":case"hidden":case"semiHidden":case"unhideWhenUsed":case"autoRedefine":case"uiPriority":break;default:this.options.debug&&console.warn(`DOCX: Unknown style element: ${r.localName}`)}return e}parseTableStyle(t){var e=[],r=ae.attr(t,"type"),i="",a="";switch(r){case"firstRow":a=".first-row",i="tr.first-row td";break;case"lastRow":a=".last-row",i="tr.last-row td";break;case"firstCol":a=".first-col",i="td.first-col";break;case"lastCol":a=".last-col",i="td.last-col";break;case"band1Vert":a=":not(.no-vband)",i="td.odd-col";break;case"band2Vert":a=":not(.no-vband)",i="td.even-col";break;case"band1Horz":a=":not(.no-hband)",i="tr.odd-row";break;case"band2Horz":a=":not(.no-hband)",i="tr.even-row";break;default:return[]}for(const o of ae.elements(t))switch(o.localName){case"pPr":e.push({target:`${i} p`,mod:a,values:this.parseDefaultProperties(o,{})});break;case"rPr":e.push({target:`${i} span`,mod:a,values:this.parseDefaultProperties(o,{})});break;case"tblPr":case"tcPr":e.push({target:i,mod:a,values:this.parseDefaultProperties(o,{})});break}return e}parseNumberingFile(t){var e=[],r={},i=[];for(const s of ae.elements(t))switch(s.localName){case"abstractNum":this.parseAbstractNumbering(s,i).forEach(l=>e.push(l));break;case"numPicBullet":i.push(this.parseNumberingPicBullet(s));break;case"num":var a=ae.attr(s,"numId"),o=ae.elementAttr(s,"abstractNumId","val");r[o]=a;break}return e.forEach(s=>s.id=r[s.id]),e}parseNumberingPicBullet(t){var e=ae.element(t,"pict"),r=e&&ae.element(e,"shape"),i=r&&ae.element(r,"imagedata");return i?{id:ae.intAttr(t,"numPicBulletId"),src:ae.attr(i,"id"),style:ae.attr(r,"style")}:null}parseAbstractNumbering(t,e){var r=[],i=ae.attr(t,"abstractNumId");for(const a of ae.elements(t))switch(a.localName){case"lvl":r.push(this.parseNumberingLevel(i,a,e));break}return r}parseNumberingLevel(t,e,r){var i={id:t,level:ae.intAttr(e,"ilvl"),start:1,pStyleName:void 0,pStyle:{},rStyle:{},suff:"tab"};for(const o of ae.elements(e))switch(o.localName){case"start":i.start=ae.intAttr(o,"val");break;case"pPr":this.parseDefaultProperties(o,i.pStyle);break;case"rPr":this.parseDefaultProperties(o,i.rStyle);break;case"lvlPicBulletId":var a=ae.intAttr(o,"val");i.bullet=r.find(s=>(s==null?void 0:s.id)==a);break;case"lvlText":i.levelText=ae.attr(o,"val");break;case"pStyle":i.pStyleName=ae.attr(o,"val");break;case"numFmt":i.format=ae.attr(o,"val");break;case"suff":i.suff=ae.attr(o,"val");break}return i}parseSdt(t,e){const r=ae.element(t,"sdtContent");return r?e(r):[]}parseInserted(t,e){var r;return{type:he.Inserted,children:((r=e(t))==null?void 0:r.children)??[]}}parseDeleted(t,e){var r;return{type:he.Deleted,children:((r=e(t))==null?void 0:r.children)??[]}}parseAltChunk(t){return{type:he.AltChunk,children:[],id:ae.attr(t,"id")}}parseParagraph(t){var e={type:he.Paragraph,children:[]};for(let r of ae.elements(t))switch(r.localName){case"pPr":this.parseParagraphProperties(r,e);break;case"r":e.children.push(this.parseRun(r,e));break;case"hyperlink":e.children.push(this.parseHyperlink(r,e));break;case"smartTag":e.children.push(this.parseSmartTag(r,e));break;case"bookmarkStart":e.children.push(A0(r,ae));break;case"bookmarkEnd":e.children.push(R0(r,ae));break;case"commentRangeStart":e.children.push(new F0(ae.attr(r,"id")));break;case"commentRangeEnd":e.children.push(new P0(ae.attr(r,"id")));break;case"oMath":case"oMathPara":e.children.push(this.parseMathElement(r));break;case"sdt":e.children.push(...this.parseSdt(r,i=>this.parseParagraph(i).children));break;case"ins":e.children.push(this.parseInserted(r,i=>this.parseParagraph(i)));break;case"del":e.children.push(this.parseDeleted(r,i=>this.parseParagraph(i)));break}return e}parseParagraphProperties(t,e){this.parseDefaultProperties(t,e.cssStyle={},null,r=>{if(pl(r,e,ae))return!0;switch(r.localName){case"pStyle":e.styleName=ae.attr(r,"val");break;case"cnfStyle":e.className=Qe.classNameOfCnfStyle(r);break;case"framePr":this.parseFrame(r,e);break;case"rPr":break;default:return!1}return!0})}parseFrame(t,e){var r=ae.attr(t,"dropCap");r=="drop"&&(e.cssStyle.float="left")}parseHyperlink(t,e){var r={type:he.Hyperlink,parent:e,children:[]};r.anchor=ae.attr(t,"anchor"),r.id=ae.attr(t,"id");for(const i of ae.elements(t))switch(i.localName){case"r":r.children.push(this.parseRun(i,r));break}return r}parseSmartTag(t,e){var r={type:he.SmartTag,parent:e,children:[]},i=ae.attr(t,"uri"),a=ae.attr(t,"element");i&&(r.uri=i),a&&(r.element=a);for(const o of ae.elements(t))switch(o.localName){case"r":r.children.push(this.parseRun(o,r));break}return r}parseRun(t,e){var r={type:he.Run,parent:e,children:[]};for(let i of ae.elements(t))switch(i=this.checkAlternateContent(i),i.localName){case"t":r.children.push({type:he.Text,text:i.textContent});break;case"delText":r.children.push({type:he.DeletedText,text:i.textContent});break;case"commentReference":r.children.push(new I0(ae.attr(i,"id")));break;case"fldSimple":r.children.push({type:he.SimpleField,instruction:ae.attr(i,"instr"),lock:ae.boolAttr(i,"lock",!1),dirty:ae.boolAttr(i,"dirty",!1)});break;case"instrText":r.fieldRun=!0,r.children.push({type:he.Instruction,text:i.textContent});break;case"fldChar":r.fieldRun=!0,r.children.push({type:he.ComplexField,charType:ae.attr(i,"fldCharType"),lock:ae.boolAttr(i,"lock",!1),dirty:ae.boolAttr(i,"dirty",!1)});break;case"noBreakHyphen":r.children.push({type:he.NoBreakHyphen});break;case"br":r.children.push({type:he.Break,break:ae.attr(i,"type")||"textWrapping"});break;case"lastRenderedPageBreak":r.children.push({type:he.Break,break:"lastRenderedPageBreak"});break;case"sym":r.children.push({type:he.Symbol,font:Pa(ae.attr(i,"font")),char:ae.attr(i,"char")});break;case"tab":r.children.push({type:he.Tab});break;case"footnoteReference":r.children.push({type:he.FootnoteReference,id:ae.attr(i,"id")});break;case"endnoteReference":r.children.push({type:he.EndnoteReference,id:ae.attr(i,"id")});break;case"drawing":let a=this.parseDrawing(i);a&&(r.children=[a]);break;case"pict":r.children.push(this.parseVmlPicture(i));break;case"rPr":this.parseRunProperties(i,r);break}return r}parseMathElement(t){const e=`${t.localName}Pr`,r={type:El[t.localName],children:[]};for(const a of ae.elements(t))if(El[a.localName])r.children.push(this.parseMathElement(a));else if(a.localName=="r"){var i=this.parseRun(a);i.type=he.MmlRun,r.children.push(i)}else a.localName==e&&(r.props=this.parseMathProperies(a));return r}parseMathProperies(t){const e={};for(const r of ae.elements(t))switch(r.localName){case"chr":e.char=ae.attr(r,"val");break;case"vertJc":e.verticalJustification=ae.attr(r,"val");break;case"pos":e.position=ae.attr(r,"val");break;case"degHide":e.hideDegree=ae.boolAttr(r,"val");break;case"begChr":e.beginChar=ae.attr(r,"val");break;case"endChr":e.endChar=ae.attr(r,"val");break}return e}parseRunProperties(t,e){this.parseDefaultProperties(t,e.cssStyle={},null,r=>{switch(r.localName){case"rStyle":e.styleName=ae.attr(r,"val");break;case"vertAlign":e.verticalAlign=Qe.valueOfVertAlign(r,!0);break;default:return!1}return!0})}parseVmlPicture(t){const e={type:he.VmlPicture,children:[]};for(const r of ae.elements(t)){const i=_l(r,this);i&&e.children.push(i)}return e}checkAlternateContent(t){var a;if(t.localName!="AlternateContent")return t;var e=ae.element(t,"Choice");if(e){var r=ae.attr(e,"Requires"),i=t.lookupNamespaceURI(r);if(B0.includes(i))return e.firstElementChild}return(a=ae.element(t,"Fallback"))==null?void 0:a.firstElementChild}parseDrawing(t){for(var e of ae.elements(t))switch(e.localName){case"inline":case"anchor":return this.parseDrawingWrapper(e)}}parseDrawingWrapper(t){var e={type:he.Drawing,children:[],cssStyle:{}},r=t.localName=="anchor";let i=null,a=ae.boolAttr(t,"simplePos");ae.boolAttr(t,"behindDoc");let o={relative:"page",align:"left",offset:"0"},s={relative:"page",align:"top",offset:"0"};for(var l of ae.elements(t))switch(l.localName){case"simplePos":a&&(o.offset=ae.lengthAttr(l,"x",ut.Emu),s.offset=ae.lengthAttr(l,"y",ut.Emu));break;case"extent":e.cssStyle.width=ae.lengthAttr(l,"cx",ut.Emu),e.cssStyle.height=ae.lengthAttr(l,"cy",ut.Emu);break;case"positionH":case"positionV":if(!a){let p=l.localName=="positionH"?o:s;var c=ae.element(l,"align"),u=ae.element(l,"posOffset");p.relative=ae.attr(l,"relativeFrom")??p.relative,c&&(p.align=c.textContent),u&&(p.offset=sl(u.textContent,ut.Emu))}break;case"wrapTopAndBottom":i="wrapTopAndBottom";break;case"wrapNone":i="wrapNone";break;case"graphic":var f=this.parseGraphic(l);f&&e.children.push(f);break}return i=="wrapTopAndBottom"?(e.cssStyle.display="block",o.align&&(e.cssStyle["text-align"]=o.align,e.cssStyle.width="100%")):i=="wrapNone"?(e.cssStyle.display="block",e.cssStyle.position="relative",e.cssStyle.width="0px",e.cssStyle.height="0px",o.offset&&(e.cssStyle.left=o.offset),s.offset&&(e.cssStyle.top=s.offset)):r&&(o.align=="left"||o.align=="right")&&(e.cssStyle.float=o.align),e}parseGraphic(t){var e=ae.element(t,"graphicData");for(let r of ae.elements(e))switch(r.localName){case"pic":return this.parsePicture(r)}return null}parsePicture(t){var e={type:he.Image,src:"",cssStyle:{}},r=ae.element(t,"blipFill"),i=ae.element(r,"blip"),a=ae.element(r,"srcRect");e.src=ae.attr(i,"embed"),a&&(e.srcRect=[ae.intAttr(a,"l",0)/1e5,ae.intAttr(a,"t",0)/1e5,ae.intAttr(a,"r",0)/1e5,ae.intAttr(a,"b",0)/1e5]);var o=ae.element(t,"spPr"),s=ae.element(o,"xfrm");if(e.cssStyle.position="relative",s){e.rotation=ae.intAttr(s,"rot",0)/6e4;for(var l of ae.elements(s))switch(l.localName){case"ext":e.cssStyle.width=ae.lengthAttr(l,"cx",ut.Emu),e.cssStyle.height=ae.lengthAttr(l,"cy",ut.Emu);break;case"off":e.cssStyle.left=ae.lengthAttr(l,"x",ut.Emu),e.cssStyle.top=ae.lengthAttr(l,"y",ut.Emu);break}}return e}parseTable(t){var e={type:he.Table,children:[]};for(const r of ae.elements(t))switch(r.localName){case"tr":e.children.push(this.parseTableRow(r));break;case"tblGrid":e.columns=this.parseTableColumns(r);break;case"tblPr":this.parseTableProperties(r,e);break}return e}parseTableColumns(t){var e=[];for(const r of ae.elements(t))switch(r.localName){case"gridCol":e.push({width:ae.lengthAttr(r,"w")});break}return e}parseTableProperties(t,e){switch(e.cssStyle={},e.cellStyle={},this.parseDefaultProperties(t,e.cssStyle,e.cellStyle,r=>{switch(r.localName){case"tblStyle":e.styleName=ae.attr(r,"val");break;case"tblLook":e.className=Qe.classNameOftblLook(r);break;case"tblpPr":this.parseTablePosition(r,e);break;case"tblStyleColBandSize":e.colBandSize=ae.intAttr(r,"val");break;case"tblStyleRowBandSize":e.rowBandSize=ae.intAttr(r,"val");break;case"hidden":e.cssStyle.display="none";break;default:return!1}return!0}),e.cssStyle["text-align"]){case"center":delete e.cssStyle["text-align"],e.cssStyle["margin-left"]="auto",e.cssStyle["margin-right"]="auto";break;case"right":delete e.cssStyle["text-align"],e.cssStyle["margin-left"]="auto";break}}parseTablePosition(t,e){var r=ae.lengthAttr(t,"topFromText"),i=ae.lengthAttr(t,"bottomFromText"),a=ae.lengthAttr(t,"rightFromText"),o=ae.lengthAttr(t,"leftFromText");e.cssStyle.float="left",e.cssStyle["margin-bottom"]=Qe.addSize(e.cssStyle["margin-bottom"],i),e.cssStyle["margin-left"]=Qe.addSize(e.cssStyle["margin-left"],o),e.cssStyle["margin-right"]=Qe.addSize(e.cssStyle["margin-right"],a),e.cssStyle["margin-top"]=Qe.addSize(e.cssStyle["margin-top"],r)}parseTableRow(t){var e={type:he.Row,children:[]};for(const r of ae.elements(t))switch(r.localName){case"tc":e.children.push(this.parseTableCell(r));break;case"trPr":case"tblPrEx":this.parseTableRowProperties(r,e);break}return e}parseTableRowProperties(t,e){e.cssStyle=this.parseDefaultProperties(t,{},null,r=>{switch(r.localName){case"cnfStyle":e.className=Qe.classNameOfCnfStyle(r);break;case"tblHeader":e.isHeader=ae.boolAttr(r,"val");break;case"gridBefore":e.gridBefore=ae.intAttr(r,"val");break;case"gridAfter":e.gridAfter=ae.intAttr(r,"val");break;default:return!1}return!0})}parseTableCell(t){var e={type:he.Cell,children:[]};for(const r of ae.elements(t))switch(r.localName){case"tbl":e.children.push(this.parseTable(r));break;case"p":e.children.push(this.parseParagraph(r));break;case"tcPr":this.parseTableCellProperties(r,e);break}return e}parseTableCellProperties(t,e){e.cssStyle=this.parseDefaultProperties(t,{},null,r=>{switch(r.localName){case"gridSpan":e.span=ae.intAttr(r,"val",null);break;case"vMerge":e.verticalMerge=ae.attr(r,"val")??"continue";break;case"cnfStyle":e.className=Qe.classNameOfCnfStyle(r);break;default:return!1}return!0}),this.parseTableCellVerticalText(t,e)}parseTableCellVerticalText(t,e){const r={btLr:{writingMode:"vertical-rl",transform:"rotate(180deg)"},lrTb:{writingMode:"vertical-lr",transform:"none"},tbRl:{writingMode:"vertical-rl",transform:"none"}};for(const i of ae.elements(t))if(i.localName==="textDirection"){const a=ae.attr(i,"val"),o=r[a]||{writingMode:"horizontal-tb"};e.cssStyle["writing-mode"]=o.writingMode,e.cssStyle.transform=o.transform}}parseDefaultProperties(t,e=null,r=null,i=null){e=e||{};for(const a of ae.elements(t))if(!(i!=null&&i(a)))switch(a.localName){case"jc":e["text-align"]=Qe.valueOfJc(a);break;case"textAlignment":e["vertical-align"]=Qe.valueOfTextAlignment(a);break;case"color":e.color=Br.colorAttr(a,"val",null,bi.color);break;case"sz":e["font-size"]=e["min-height"]=ae.lengthAttr(a,"val",ut.FontSize);break;case"shd":e["background-color"]=Br.colorAttr(a,"fill",null,bi.shd);break;case"highlight":e["background-color"]=Br.colorAttr(a,"val",null,bi.highlight);break;case"vertAlign":break;case"position":e.verticalAlign=ae.lengthAttr(a,"val",ut.FontSize);break;case"tcW":if(this.options.ignoreWidth)break;case"tblW":e.width=Qe.valueOfSize(a,"w");break;case"trHeight":this.parseTrHeight(a,e);break;case"strike":e["text-decoration"]=ae.boolAttr(a,"val",!0)?"line-through":"none";break;case"b":e["font-weight"]=ae.boolAttr(a,"val",!0)?"bold":"normal";break;case"i":e["font-style"]=ae.boolAttr(a,"val",!0)?"italic":"normal";break;case"caps":e["text-transform"]=ae.boolAttr(a,"val",!0)?"uppercase":"none";break;case"smallCaps":e["font-variant"]=ae.boolAttr(a,"val",!0)?"small-caps":"none";break;case"u":this.parseUnderline(a,e);break;case"ind":case"tblInd":this.parseIndentation(a,e);break;case"rFonts":this.parseFont(a,e);break;case"tblBorders":this.parseBorderProperties(a,r||e);break;case"tblCellSpacing":e["border-spacing"]=Qe.valueOfMargin(a),e["border-collapse"]="separate";break;case"pBdr":this.parseBorderProperties(a,e);break;case"bdr":e.border=Qe.valueOfBorder(a);break;case"tcBorders":this.parseBorderProperties(a,e);break;case"vanish":ae.boolAttr(a,"val",!0)&&(e.display="none");break;case"kern":break;case"noWrap":break;case"tblCellMar":case"tcMar":this.parseMarginProperties(a,r||e);break;case"tblLayout":e["table-layout"]=Qe.valueOfTblLayout(a);break;case"vAlign":e["vertical-align"]=Qe.valueOfTextAlignment(a);break;case"spacing":t.localName=="pPr"&&this.parseSpacing(a,e);break;case"wordWrap":ae.boolAttr(a,"val")&&(e["overflow-wrap"]="break-word");break;case"suppressAutoHyphens":e.hyphens=ae.boolAttr(a,"val",!0)?"none":"auto";break;case"lang":e.$lang=ae.attr(a,"val");break;case"rtl":case"bidi":ae.boolAttr(a,"val",!0)&&(e.direction="rtl");break;case"bCs":case"iCs":case"szCs":case"tabs":case"outlineLvl":case"contextualSpacing":case"tblStyleColBandSize":case"tblStyleRowBandSize":case"webHidden":case"pageBreakBefore":case"suppressLineNumbers":case"keepLines":case"keepNext":case"widowControl":case"bidi":case"rtl":case"noProof":break;default:this.options.debug&&console.warn(`DOCX: Unknown document element: ${t.localName}.${a.localName}`);break}return e}parseUnderline(t,e){var r=ae.attr(t,"val");if(r!=null){switch(r){case"dash":case"dashDotDotHeavy":case"dashDotHeavy":case"dashedHeavy":case"dashLong":case"dashLongHeavy":case"dotDash":case"dotDotDash":e["text-decoration"]="underline dashed";break;case"dotted":case"dottedHeavy":e["text-decoration"]="underline dotted";break;case"double":e["text-decoration"]="underline double";break;case"single":case"thick":e["text-decoration"]="underline";break;case"wave":case"wavyDouble":case"wavyHeavy":e["text-decoration"]="underline wavy";break;case"words":e["text-decoration"]="underline";break;case"none":e["text-decoration"]="none";break}var i=Br.colorAttr(t,"color");i&&(e["text-decoration-color"]=i)}}parseFont(t,e){var r=ae.attr(t,"ascii"),i=Qe.themeValue(t,"asciiTheme"),a=ae.attr(t,"eastAsia"),o=[r,i,a].filter(s=>s).map(s=>Pa(s));o.length>0&&(e["font-family"]=[...new Set(o)].join(", "))}parseIndentation(t,e){var r=ae.lengthAttr(t,"firstLine"),i=ae.lengthAttr(t,"hanging"),a=ae.lengthAttr(t,"left"),o=ae.lengthAttr(t,"start"),s=ae.lengthAttr(t,"right"),l=ae.lengthAttr(t,"end");r&&(e["text-indent"]=r),i&&(e["text-indent"]=`-${i}`),(a||o)&&(e["margin-inline-start"]=a||o),(s||l)&&(e["margin-inline-end"]=s||l)}parseSpacing(t,e){var r=ae.lengthAttr(t,"before"),i=ae.lengthAttr(t,"after"),a=ae.intAttr(t,"line",null),o=ae.attr(t,"lineRule");if(r&&(e["margin-top"]=r),i&&(e["margin-bottom"]=i),a!==null)switch(o){case"auto":e["line-height"]=`${(a/240).toFixed(2)}`;break;case"atLeast":e["line-height"]=`calc(100% + ${a/20}pt)`;break;default:e["line-height"]=e["min-height"]=`${a/20}pt`;break}}parseMarginProperties(t,e){for(const r of ae.elements(t))switch(r.localName){case"left":e["padding-left"]=Qe.valueOfMargin(r);break;case"right":e["padding-right"]=Qe.valueOfMargin(r);break;case"top":e["padding-top"]=Qe.valueOfMargin(r);break;case"bottom":e["padding-bottom"]=Qe.valueOfMargin(r);break}}parseTrHeight(t,e){switch(ae.attr(t,"hRule")){case"exact":e.height=ae.lengthAttr(t,"val");break;case"atLeast":default:e.height=ae.lengthAttr(t,"val");break}}parseBorderProperties(t,e){for(const r of ae.elements(t))switch(r.localName){case"start":case"left":e["border-left"]=Qe.valueOfBorder(r);break;case"end":case"right":e["border-right"]=Qe.valueOfBorder(r);break;case"top":e["border-top"]=Qe.valueOfBorder(r);break;case"bottom":e["border-bottom"]=Qe.valueOfBorder(r);break}}}const z0=["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","none","red","white","yellow"];class Br{static colorAttr(t,e,r=null,i="black"){var a=ae.attr(t,e);if(a)return a=="auto"?i:z0.includes(a)?a:`#${a}`;var o=ae.attr(t,"themeColor");return o?`var(--docx-${o}-color)`:r}}class Qe{static themeValue(t,e){var r=ae.attr(t,e);return r?`var(--docx-${r}-font)`:null}static valueOfSize(t,e){var r=ut.Dxa;switch(ae.attr(t,"type")){case"dxa":break;case"pct":r=ut.Percent;break;case"auto":return"auto"}return ae.lengthAttr(t,e,r)}static valueOfMargin(t){return ae.lengthAttr(t,"w")}static valueOfBorder(t){var e=Qe.parseBorderType(ae.attr(t,"val"));if(e=="none")return"none";var r=Br.colorAttr(t,"color"),i=ae.lengthAttr(t,"sz",ut.Border);return`${i} ${e} ${r=="auto"?bi.borderColor:r}`}static parseBorderType(t){switch(t){case"single":return"solid";case"dashDotStroked":return"solid";case"dashed":return"dashed";case"dashSmallGap":return"dashed";case"dotDash":return"dotted";case"dotDotDash":return"dotted";case"dotted":return"dotted";case"double":return"double";case"doubleWave":return"double";case"inset":return"inset";case"nil":return"none";case"none":return"none";case"outset":return"outset";case"thick":return"solid";case"thickThinLargeGap":return"solid";case"thickThinMediumGap":return"solid";case"thickThinSmallGap":return"solid";case"thinThickLargeGap":return"solid";case"thinThickMediumGap":return"solid";case"thinThickSmallGap":return"solid";case"thinThickThinLargeGap":return"solid";case"thinThickThinMediumGap":return"solid";case"thinThickThinSmallGap":return"solid";case"threeDEmboss":return"solid";case"threeDEngrave":return"solid";case"triple":return"double";case"wave":return"solid"}return"solid"}static valueOfTblLayout(t){var e=ae.attr(t,"val");return e=="fixed"?"fixed":"auto"}static classNameOfCnfStyle(t){const e=ae.attr(t,"val");return["first-row","last-row","first-col","last-col","odd-col","even-col","odd-row","even-row","ne-cell","nw-cell","se-cell","sw-cell"].filter((i,a)=>e[a]=="1").join(" ")}static valueOfJc(t){var e=ae.attr(t,"val");switch(e){case"start":case"left":return"left";case"center":return"center";case"end":case"right":return"right";case"both":return"justify"}return e}static valueOfVertAlign(t,e=!1){var r=ae.attr(t,"val");switch(r){case"subscript":return"sub";case"superscript":return e?"sup":"super"}return e?null:r}static valueOfTextAlignment(t){var e=ae.attr(t,"val");switch(e){case"auto":case"baseline":return"baseline";case"top":return"top";case"center":return"middle";case"bottom":return"bottom"}return e}static addSize(t,e){return t==null?e:e==null?t:`calc(${t} + ${e})`}static classNameOftblLook(t){const e=ae.hexAttr(t,"val",0);let r="";return(ae.boolAttr(t,"firstRow")||e&32)&&(r+=" first-row"),(ae.boolAttr(t,"lastRow")||e&64)&&(r+=" last-row"),(ae.boolAttr(t,"firstColumn")||e&128)&&(r+=" first-col"),(ae.boolAttr(t,"lastColumn")||e&256)&&(r+=" last-col"),(ae.boolAttr(t,"noHBand")||e&512)&&(r+=" no-hband"),(ae.boolAttr(t,"noVBand")||e&1024)&&(r+=" no-vband"),r.trim()}}const Cl={pos:0,leader:"none",style:"left"},U0=50;function H0(n=document.body){const t=document.createElement("div");t.style.width="100pt",n.appendChild(t);const e=100/t.offsetWidth;return n.removeChild(t),e}function W0(n,t,e,r=72/96){const i=n.closest("p"),a=n.getBoundingClientRect(),o=i.getBoundingClientRect(),s=getComputedStyle(i),l=(t==null?void 0:t.length)>0?t.map(m=>({pos:Sl(m.position),leader:m.leader,style:m.style})).sort((m,w)=>m.pos-w.pos):[Cl],c=l[l.length-1],u=o.width*r,f=Sl(e);let p=c.pos+f;if(p<u)for(;p<u&&l.length<U0;p+=f)l.push({...Cl,pos:p});const d=parseFloat(s.marginLeft),b=o.left+d,y=(a.left-b)*r,g=l.find(m=>m.style!="clear"&&m.pos>y);if(g==null)return;let h=1;if(g.style=="right"||g.style=="center"){const m=Array.from(i.querySelectorAll(`.${n.className}`)),w=m.indexOf(n)+1,A=document.createRange();A.setStart(n,1),w<m.length?A.setEndBefore(m[w]):A.setEndAfter(i);const v=g.style=="center"?.5:1,T=A.getBoundingClientRect(),N=T.left+v*T.width-(o.left-d);h=g.pos-N*r}else h=g.pos-y;switch(n.innerHTML=" ",n.style.textDecoration="inherit",n.style.wordSpacing=`${h.toFixed(0)}pt`,g.leader){case"dot":case"middleDot":n.style.textDecoration="underline",n.style.textDecorationStyle="dotted";break;case"hyphen":case"heavy":case"underscore":n.style.textDecoration="underline";break}}function Sl(n){return parseFloat(n)}const We={svg:"http://www.w3.org/2000/svg",mathML:"http://www.w3.org/1998/Math/MathML"};class j0{constructor(t){this.htmlDocument=t,this.className="docx",this.styleMap={},this.currentPart=null,this.tableVerticalMerges=[],this.currentVerticalMerge=null,this.tableCellPositions=[],this.currentCellPosition=null,this.footnoteMap={},this.endnoteMap={},this.currentEndnoteIds=[],this.usedHederFooterParts=[],this.currentTabs=[],this.commentMap={},this.tasks=[],this.postRenderTasks=[]}async render(t,e,r=null,i){var o;this.document=t,this.options=i,this.className=i.className,this.rootSelector=i.inWrapper?`.${this.className}-wrapper`:":root",this.styleMap=null,this.tasks=[],this.options.renderComments&&globalThis.Highlight&&(this.commentHighlight=new Highlight),r=r||e,xl(r),xl(e),r.appendChild(this.createComment("docxjs library predefined styles")),r.appendChild(this.renderDefaultStyle()),t.themePart&&(r.appendChild(this.createComment("docxjs document theme values")),this.renderTheme(t.themePart,r)),t.stylesPart!=null&&(this.styleMap=this.processStyles(t.stylesPart.styles),r.appendChild(this.createComment("docxjs document styles")),r.appendChild(this.renderStyles(t.stylesPart.styles))),t.numberingPart&&(this.prodessNumberings(t.numberingPart.domNumberings),r.appendChild(this.createComment("docxjs document numbering styles")),r.appendChild(this.renderNumbering(t.numberingPart.domNumberings,r))),t.footnotesPart&&(this.footnoteMap=dr(t.footnotesPart.notes,s=>s.id)),t.endnotesPart&&(this.endnoteMap=dr(t.endnotesPart.notes,s=>s.id)),t.settingsPart&&(this.defaultTabSize=(o=t.settingsPart.settings)==null?void 0:o.defaultTabStop),!i.ignoreFonts&&t.fontTablePart&&this.renderFontTable(t.fontTablePart,r);var a=this.renderSections(t.documentPart.body);this.options.inWrapper?e.appendChild(this.renderWrapper(a)):Wa(e,a),this.commentHighlight&&i.renderComments&&CSS.highlights.set(`${this.className}-comments`,this.commentHighlight),this.postRenderTasks.forEach(s=>s()),await Promise.allSettled(this.tasks),this.refreshTabStops()}renderTheme(t,e){var s,l;const r={},i=(s=t.theme)==null?void 0:s.fontScheme;i&&(i.majorFont&&(r["--docx-majorHAnsi-font"]=i.majorFont.latinTypeface),i.minorFont&&(r["--docx-minorHAnsi-font"]=i.minorFont.latinTypeface));const a=(l=t.theme)==null?void 0:l.colorScheme;if(a)for(let[c,u]of Object.entries(a.colors))r[`--docx-${c}-color`]=`#${u}`;const o=this.styleToString(`.${this.className}`,r);e.appendChild(this.createStyleElement(o))}renderFontTable(t,e){for(let r of t.fonts)for(let i of r.embedFontRefs)this.tasks.push(this.document.loadFont(i.id,i.key).then(a=>{const o={"font-family":Pa(r.name),src:`url(${a})`};(i.type=="bold"||i.type=="boldItalic")&&(o["font-weight"]="bold"),(i.type=="italic"||i.type=="boldItalic")&&(o["font-style"]="italic");const s=this.styleToString("@font-face",o);e.appendChild(this.createComment(`docxjs ${r.name} font`)),e.appendChild(this.createStyleElement(s))}))}processStyleName(t){return t?`${this.className}_${Tp(t)}`:this.className}processStyles(t){const e=dr(t.filter(i=>i.id!=null),i=>i.id);for(const i of t.filter(a=>a.basedOn)){var r=e[i.basedOn];if(r){i.paragraphProps=gi(i.paragraphProps,r.paragraphProps),i.runProps=gi(i.runProps,r.runProps);for(const a of r.styles){const o=i.styles.find(s=>s.target==a.target);o?this.copyStyleProperties(a.values,o.values):i.styles.push({...a,values:{...a.values}})}}else this.options.debug&&console.warn(`Can't find base style ${i.basedOn}`)}for(let i of t)i.cssName=this.processStyleName(i.id);return e}prodessNumberings(t){var e;for(let r of t.filter(i=>i.pStyleName)){const i=this.findStyle(r.pStyleName);(e=i==null?void 0:i.paragraphProps)!=null&&e.numbering&&(i.paragraphProps.numbering.level=r.level)}}processElement(t){if(t.children)for(var e of t.children)e.parent=t,e.type==he.Table?this.processTable(e):this.processElement(e)}processTable(t){for(var e of t.children)for(var r of e.children)r.cssStyle=this.copyStyleProperties(t.cellStyle,r.cssStyle,["border-left","border-right","border-top","border-bottom","padding-left","padding-right","padding-top","padding-bottom"]),this.processElement(r)}copyStyleProperties(t,e,r=null){if(!t)return e;e==null&&(e={}),r==null&&(r=Object.getOwnPropertyNames(t));for(var i of r)t.hasOwnProperty(i)&&!e.hasOwnProperty(i)&&(e[i]=t[i]);return e}createPageElement(t,e){var r=this.createElement("section",{className:t});return e&&(e.pageMargins&&(r.style.paddingLeft=e.pageMargins.left,r.style.paddingRight=e.pageMargins.right,r.style.paddingTop=e.pageMargins.top,r.style.paddingBottom=e.pageMargins.bottom),e.pageSize&&(this.options.ignoreWidth||(r.style.width=e.pageSize.width),this.options.ignoreHeight||(r.style.minHeight=e.pageSize.height))),r}createSectionContent(t){var e=this.createElement("article");return t.columns&&t.columns.numberOfColumns&&(e.style.columnCount=`${t.columns.numberOfColumns}`,e.style.columnGap=t.columns.space,t.columns.separator&&(e.style.columnRule="1px solid black")),e}renderSections(t){const e=[];this.processElement(t);const r=this.splitBySection(t.children,t.props),i=this.groupByPageBreaks(r);let a=null;for(let s=0,l=i.length;s<l;s++){this.currentFootnoteIds=[];let u=i[s][0].sectProps;const f=this.createPageElement(this.className,u);this.renderStyleValues(t.cssStyle,f),this.options.renderHeaders&&this.renderHeaderFooter(u.headerRefs,u,e.length,a!=u,f);for(const p of i[s]){var o=this.createSectionContent(p.sectProps);this.renderElements(p.elements,o),f.appendChild(o),u=p.sectProps}this.options.renderFootnotes&&this.renderNotes(this.currentFootnoteIds,this.footnoteMap,f),this.options.renderEndnotes&&s==l-1&&this.renderNotes(this.currentEndnoteIds,this.endnoteMap,f),this.options.renderFooters&&this.renderHeaderFooter(u.footerRefs,u,e.length,a!=u,f),e.push(f),a=u}return e}renderHeaderFooter(t,e,r,i,a){if(t){var o=(e.titlePage&&i?t.find(l=>l.type=="first"):null)??(r%2==1?t.find(l=>l.type=="even"):null)??t.find(l=>l.type=="default"),s=o&&this.document.findPartByRelId(o.id,this.document.documentPart);if(s){this.currentPart=s,this.usedHederFooterParts.includes(s.path)||(this.processElement(s.rootElement),this.usedHederFooterParts.push(s.path));const[l]=this.renderElements([s.rootElement],a);e!=null&&e.pageMargins&&(s.rootElement.type===he.Header?(l.style.marginTop=`calc(${e.pageMargins.header} - ${e.pageMargins.top})`,l.style.minHeight=`calc(${e.pageMargins.top} - ${e.pageMargins.header})`):s.rootElement.type===he.Footer&&(l.style.marginBottom=`calc(${e.pageMargins.footer} - ${e.pageMargins.bottom})`,l.style.minHeight=`calc(${e.pageMargins.bottom} - ${e.pageMargins.footer})`)),this.currentPart=null}}}isPageBreakElement(t){return t.type!=he.Break?!1:t.break=="lastRenderedPageBreak"?!this.options.ignoreLastRenderedPageBreak:t.break=="page"}isPageBreakSection(t,e){var r,i,a,o,s,l;return!t||!e?!1:((r=t.pageSize)==null?void 0:r.orientation)!=((i=e.pageSize)==null?void 0:i.orientation)||((a=t.pageSize)==null?void 0:a.width)!=((o=e.pageSize)==null?void 0:o.width)||((s=t.pageSize)==null?void 0:s.height)!=((l=e.pageSize)==null?void 0:l.height)}splitBySection(t,e){var f;var r={sectProps:null,elements:[],pageBreak:!1},i=[r];for(let p of t){if(p.type==he.Paragraph){const d=this.findStyle(p.styleName);(f=d==null?void 0:d.paragraphProps)!=null&&f.pageBreakBefore&&(r.sectProps=a,r.pageBreak=!0,r={sectProps:null,elements:[],pageBreak:!1},i.push(r))}if(r.elements.push(p),p.type==he.Paragraph){const d=p;var a=d.sectionProps,o=-1,s=-1;if(this.options.breakPages&&d.children&&(o=d.children.findIndex(b=>{var y;return s=((y=b.children)==null?void 0:y.findIndex(this.isPageBreakElement.bind(this)))??-1,s!=-1})),(a||o!=-1)&&(r.sectProps=a,r.pageBreak=o!=-1,r={sectProps:null,elements:[],pageBreak:!1},i.push(r)),o!=-1){let b=d.children[o],y=s<b.children.length-1;if(o<d.children.length-1||y){var l=p.children,c={...p,children:l.slice(o)};if(p.children=l.slice(0,o),r.elements.push(c),y){let g=b.children,h={...b,children:g.slice(0,s)};p.children.push(h),b.children=g.slice(s)}}}}}let u=null;for(let p=i.length-1;p>=0;p--)i[p].sectProps==null?i[p].sectProps=u??e:u=i[p].sectProps;return i}groupByPageBreaks(t){let e=[],r;const i=[e];for(let a of t)e.push(a),(this.options.ignoreLastRenderedPageBreak||a.pageBreak||this.isPageBreakSection(r,a.sectProps))&&i.push(e=[]),r=a.sectProps;return i.filter(a=>a.length>0)}renderWrapper(t){return this.createElement("div",{className:`${this.className}-wrapper`},t)}renderDefaultStyle(){var t=this.className,e=`
|
|
28
|
+
.${t}-wrapper { background: gray; padding: 30px; padding-bottom: 0px; display: flex; flex-flow: column; align-items: center; }
|
|
29
|
+
.${t}-wrapper>section.${t} { background: white; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); margin-bottom: 30px; }`;this.options.hideWrapperOnPrint&&(e=`@media not print { ${e} }`);var r=`${e}
|
|
30
|
+
.${t} { color: black; hyphens: auto; text-underline-position: from-font; }
|
|
31
|
+
section.${t} { box-sizing: border-box; display: flex; flex-flow: column nowrap; position: relative; overflow: hidden; }
|
|
32
|
+
section.${t}>article { margin-bottom: auto; z-index: 1; }
|
|
33
|
+
section.${t}>footer { z-index: 1; }
|
|
34
|
+
.${t} table { border-collapse: collapse; }
|
|
35
|
+
.${t} table td, .${t} table th { vertical-align: top; }
|
|
36
|
+
.${t} p { margin: 0pt; min-height: 1em; }
|
|
37
|
+
.${t} span { white-space: pre-wrap; overflow-wrap: break-word; }
|
|
38
|
+
.${t} a { color: inherit; text-decoration: inherit; }
|
|
39
|
+
.${t} svg { fill: transparent; }
|
|
40
|
+
`;return this.options.renderComments&&(r+=`
|
|
41
|
+
.${t}-comment-ref { cursor: default; }
|
|
42
|
+
.${t}-comment-popover { display: none; z-index: 1000; padding: 0.5rem; background: white; position: absolute; box-shadow: 0 0 0.25rem rgba(0, 0, 0, 0.25); width: 30ch; }
|
|
43
|
+
.${t}-comment-ref:hover~.${t}-comment-popover { display: block; }
|
|
44
|
+
.${t}-comment-author,.${t}-comment-date { font-size: 0.875rem; color: #888; }
|
|
45
|
+
`),this.createStyleElement(r)}renderNumbering(t,e){var r="",i=[];for(var a of t){var o=`p.${this.numberingClass(a.id,a.level)}`,s="none";if(a.bullet){let l=`--${this.className}-${a.bullet.src}`.toLowerCase();r+=this.styleToString(`${o}:before`,{content:"' '",display:"inline-block",background:`var(${l})`},a.bullet.style),this.tasks.push(this.document.loadNumberingImage(a.bullet.src).then(c=>{var u=`${this.rootSelector} { ${l}: url(${c}) }`;e.appendChild(this.createStyleElement(u))}))}else if(a.levelText){let l=this.numberingCounter(a.id,a.level);const c=l+" "+(a.start-1);a.level>0&&(r+=this.styleToString(`p.${this.numberingClass(a.id,a.level-1)}`,{"counter-set":c})),i.push(c),r+=this.styleToString(`${o}:before`,{content:this.levelTextToContent(a.levelText,a.suff,a.id,this.numFormatToCssValue(a.format)),"counter-increment":l,...a.rStyle})}else s=this.numFormatToCssValue(a.format);r+=this.styleToString(o,{display:"list-item","list-style-position":"inside","list-style-type":s,...a.pStyle})}return i.length>0&&(r+=this.styleToString(this.rootSelector,{"counter-reset":i.join(" ")})),this.createStyleElement(r)}renderStyles(t){var e="";const r=this.styleMap,i=dr(t.filter(l=>l.isDefault),l=>l.target);for(const l of t){var a=l.styles;if(l.linked){var o=l.linked&&r[l.linked];o?a=a.concat(o.styles):this.options.debug&&console.warn(`Can't find linked style ${l.linked}`)}for(const c of a){var s=`${l.target??""}.${l.cssName}`;l.target!=c.target&&(s+=` ${c.target}`),i[l.target]==l&&(s=`.${this.className} ${l.target}, `+s),e+=this.styleToString(s,c.values)}}return this.createStyleElement(e)}renderNotes(t,e,r){var i=t.map(o=>e[o]).filter(o=>o);if(i.length>0){var a=this.createElement("ol",null,this.renderElements(i));r.appendChild(a)}}renderElement(t){switch(t.type){case he.Paragraph:return this.renderParagraph(t);case he.BookmarkStart:return this.renderBookmarkStart(t);case he.BookmarkEnd:return null;case he.Run:return this.renderRun(t);case he.Table:return this.renderTable(t);case he.Row:return this.renderTableRow(t);case he.Cell:return this.renderTableCell(t);case he.Hyperlink:return this.renderHyperlink(t);case he.SmartTag:return this.renderSmartTag(t);case he.Drawing:return this.renderDrawing(t);case he.Image:return this.renderImage(t);case he.Text:return this.renderText(t);case he.Text:return this.renderText(t);case he.DeletedText:return this.renderDeletedText(t);case he.Tab:return this.renderTab(t);case he.Symbol:return this.renderSymbol(t);case he.Break:return this.renderBreak(t);case he.Footer:return this.renderContainer(t,"footer");case he.Header:return this.renderContainer(t,"header");case he.Footnote:case he.Endnote:return this.renderContainer(t,"li");case he.FootnoteReference:return this.renderFootnoteReference(t);case he.EndnoteReference:return this.renderEndnoteReference(t);case he.NoBreakHyphen:return this.createElement("wbr");case he.VmlPicture:return this.renderVmlPicture(t);case he.VmlElement:return this.renderVmlElement(t);case he.MmlMath:return this.renderContainerNS(t,We.mathML,"math",{xmlns:We.mathML});case he.MmlMathParagraph:return this.renderContainer(t,"span");case he.MmlFraction:return this.renderContainerNS(t,We.mathML,"mfrac");case he.MmlBase:return this.renderContainerNS(t,We.mathML,t.parent.type==he.MmlMatrixRow?"mtd":"mrow");case he.MmlNumerator:case he.MmlDenominator:case he.MmlFunction:case he.MmlLimit:case he.MmlBox:return this.renderContainerNS(t,We.mathML,"mrow");case he.MmlGroupChar:return this.renderMmlGroupChar(t);case he.MmlLimitLower:return this.renderContainerNS(t,We.mathML,"munder");case he.MmlMatrix:return this.renderContainerNS(t,We.mathML,"mtable");case he.MmlMatrixRow:return this.renderContainerNS(t,We.mathML,"mtr");case he.MmlRadical:return this.renderMmlRadical(t);case he.MmlSuperscript:return this.renderContainerNS(t,We.mathML,"msup");case he.MmlSubscript:return this.renderContainerNS(t,We.mathML,"msub");case he.MmlDegree:case he.MmlSuperArgument:case he.MmlSubArgument:return this.renderContainerNS(t,We.mathML,"mn");case he.MmlFunctionName:return this.renderContainerNS(t,We.mathML,"ms");case he.MmlDelimiter:return this.renderMmlDelimiter(t);case he.MmlRun:return this.renderMmlRun(t);case he.MmlNary:return this.renderMmlNary(t);case he.MmlPreSubSuper:return this.renderMmlPreSubSuper(t);case he.MmlBar:return this.renderMmlBar(t);case he.MmlEquationArray:return this.renderMllList(t);case he.Inserted:return this.renderInserted(t);case he.Deleted:return this.renderDeleted(t);case he.CommentRangeStart:return this.renderCommentRangeStart(t);case he.CommentRangeEnd:return this.renderCommentRangeEnd(t);case he.CommentReference:return this.renderCommentReference(t);case he.AltChunk:return this.renderAltChunk(t)}return null}renderElements(t,e){if(t==null)return null;var r=t.flatMap(i=>this.renderElement(i)).filter(i=>i!=null);return e&&Wa(e,r),r}renderContainer(t,e,r){return this.createElement(e,r,this.renderElements(t.children))}renderContainerNS(t,e,r,i){return this.createElementNS(e,r,i,this.renderElements(t.children))}renderParagraph(t){var a,o;var e=this.renderContainer(t,"p");const r=this.findStyle(t.styleName);t.tabs??(t.tabs=(a=r==null?void 0:r.paragraphProps)==null?void 0:a.tabs),this.renderClass(t,e),this.renderStyleValues(t.cssStyle,e),this.renderCommonProperties(e.style,t);const i=t.numbering??((o=r==null?void 0:r.paragraphProps)==null?void 0:o.numbering);return i&&e.classList.add(this.numberingClass(i.id,i.level)),e}renderRunProperties(t,e){this.renderCommonProperties(t,e)}renderCommonProperties(t,e){e!=null&&(e.color&&(t.color=e.color),e.fontSize&&(t["font-size"]=e.fontSize))}renderHyperlink(t){var e=this.renderContainer(t,"a");this.renderStyleValues(t.cssStyle,e);let r="";if(t.id){const i=this.document.documentPart.rels.find(a=>a.id==t.id&&a.targetMode==="External");r=(i==null?void 0:i.target)??r}return t.anchor&&(r+=`#${t.anchor}`),e.href=r,e}renderSmartTag(t){return this.renderContainer(t,"span")}renderCommentRangeStart(t){var i;if(!this.options.renderComments)return null;const e=new Range;(i=this.commentHighlight)==null||i.add(e);const r=this.createComment(`start of comment #${t.id}`);return this.later(()=>e.setStart(r,0)),this.commentMap[t.id]=e,r}renderCommentRangeEnd(t){if(!this.options.renderComments)return null;const e=this.commentMap[t.id],r=this.createComment(`end of comment #${t.id}`);return this.later(()=>e==null?void 0:e.setEnd(r,0)),r}renderCommentReference(t){var o;if(!this.options.renderComments)return null;var e=(o=this.document.commentsPart)==null?void 0:o.commentMap[t.id];if(!e)return null;const r=new DocumentFragment,i=this.createElement("span",{className:`${this.className}-comment-ref`},["💬"]),a=this.createElement("div",{className:`${this.className}-comment-popover`});return this.renderCommentContent(e,a),r.appendChild(this.createComment(`comment #${e.id} by ${e.author} on ${e.date}`)),r.appendChild(i),r.appendChild(a),r}renderAltChunk(t){if(!this.options.renderAltChunks)return null;var e=this.createElement("iframe");return this.tasks.push(this.document.loadAltChunk(t.id,this.currentPart).then(r=>{e.srcdoc=r})),e}renderCommentContent(t,e){e.appendChild(this.createElement("div",{className:`${this.className}-comment-author`},[t.author])),e.appendChild(this.createElement("div",{className:`${this.className}-comment-date`},[new Date(t.date).toLocaleString()])),this.renderElements(t.children,e)}renderDrawing(t){var e=this.renderContainer(t,"div");return e.style.display="inline-block",e.style.position="relative",e.style.textIndent="0px",this.renderStyleValues(t.cssStyle,e),e}renderImage(t){var l;let e=this.createElement("img"),r=(l=t.cssStyle)==null?void 0:l.transform;if(this.renderStyleValues(t.cssStyle,e),t.srcRect&&t.srcRect.some(c=>c!=0)){var[i,a,o,s]=t.srcRect;r=`scale(${1/(1-i-o)}, ${1/(1-a-s)})`,e.style["clip-path"]=`rect(${(100*a).toFixed(2)}% ${(100*(1-o)).toFixed(2)}% ${(100*(1-s)).toFixed(2)}% ${(100*i).toFixed(2)}%)`}return t.rotation&&(r=`rotate(${t.rotation}deg) ${r??""}`),e.style.transform=r==null?void 0:r.trim(),this.document&&this.tasks.push(this.document.loadDocumentImage(t.src,this.currentPart).then(c=>{e.src=c})),e}renderText(t){return this.htmlDocument.createTextNode(t.text)}renderDeletedText(t){return this.options.renderChanges?this.renderText(t):null}renderBreak(t){return t.break=="textWrapping"?this.createElement("br"):null}renderInserted(t){return this.options.renderChanges?this.renderContainer(t,"ins"):this.renderElements(t.children)}renderDeleted(t){return this.options.renderChanges?this.renderContainer(t,"del"):null}renderSymbol(t){var e=this.createElement("span");return e.style.fontFamily=t.font,e.innerHTML=`&#x${t.char};`,e}renderFootnoteReference(t){var e=this.createElement("sup");return this.currentFootnoteIds.push(t.id),e.textContent=`${this.currentFootnoteIds.length}`,e}renderEndnoteReference(t){var e=this.createElement("sup");return this.currentEndnoteIds.push(t.id),e.textContent=`${this.currentEndnoteIds.length}`,e}renderTab(t){var i;var e=this.createElement("span");if(e.innerHTML=" ",this.options.experimental){e.className=this.tabStopClass();var r=(i=$0(t,he.Paragraph))==null?void 0:i.tabs;this.currentTabs.push({stops:r,span:e})}return e}renderBookmarkStart(t){return this.createElement("span",{id:t.name})}renderRun(t){if(t.fieldRun)return null;const e=this.createElement("span");if(t.id&&(e.id=t.id),this.renderClass(t,e),this.renderStyleValues(t.cssStyle,e),t.verticalAlign){const r=this.createElement(t.verticalAlign);this.renderElements(t.children,r),e.appendChild(r)}else this.renderElements(t.children,e);return e}renderTable(t){let e=this.createElement("table");return this.tableCellPositions.push(this.currentCellPosition),this.tableVerticalMerges.push(this.currentVerticalMerge),this.currentVerticalMerge={},this.currentCellPosition={col:0,row:0},t.columns&&e.appendChild(this.renderTableColumns(t.columns)),this.renderClass(t,e),this.renderElements(t.children,e),this.renderStyleValues(t.cssStyle,e),this.currentVerticalMerge=this.tableVerticalMerges.pop(),this.currentCellPosition=this.tableCellPositions.pop(),e}renderTableColumns(t){let e=this.createElement("colgroup");for(let r of t){let i=this.createElement("col");r.width&&(i.style.width=r.width),e.appendChild(i)}return e}renderTableRow(t){let e=this.createElement("tr");return this.currentCellPosition.col=0,t.gridBefore&&e.appendChild(this.renderTableCellPlaceholder(t.gridBefore)),this.renderClass(t,e),this.renderElements(t.children,e),this.renderStyleValues(t.cssStyle,e),t.gridAfter&&e.appendChild(this.renderTableCellPlaceholder(t.gridAfter)),this.currentCellPosition.row++,e}renderTableCellPlaceholder(t){const e=this.createElement("td",{colSpan:t});return e.style.border="none",e}renderTableCell(t){let e=this.renderContainer(t,"td");const r=this.currentCellPosition.col;return t.verticalMerge?t.verticalMerge=="restart"?(this.currentVerticalMerge[r]=e,e.rowSpan=1):this.currentVerticalMerge[r]&&(this.currentVerticalMerge[r].rowSpan+=1,e.style.display="none"):this.currentVerticalMerge[r]=null,this.renderClass(t,e),this.renderStyleValues(t.cssStyle,e),t.span&&(e.colSpan=t.span),this.currentCellPosition.col+=e.colSpan,e}renderVmlPicture(t){return this.renderContainer(t,"div")}renderVmlElement(t){var i,a;var e=this.createSvgElement("svg");e.setAttribute("style",t.cssStyleText);const r=this.renderVmlChildElement(t);return(i=t.imageHref)!=null&&i.id&&this.tasks.push((a=this.document)==null?void 0:a.loadDocumentImage(t.imageHref.id,this.currentPart).then(o=>r.setAttribute("href",o))),e.appendChild(r),requestAnimationFrame(()=>{const o=e.firstElementChild.getBBox();e.setAttribute("width",`${Math.ceil(o.x+o.width)}`),e.setAttribute("height",`${Math.ceil(o.y+o.height)}`)}),e}renderVmlChildElement(t){const e=this.createSvgElement(t.tagName);Object.entries(t.attrs).forEach(([r,i])=>e.setAttribute(r,i));for(let r of t.children)r.type==he.VmlElement?e.appendChild(this.renderVmlChildElement(r)):e.appendChild(...ln(this.renderElement(r)));return e}renderMmlRadical(t){var i;const e=t.children.find(a=>a.type==he.MmlBase);if((i=t.props)!=null&&i.hideDegree)return this.createElementNS(We.mathML,"msqrt",null,this.renderElements([e]));const r=t.children.find(a=>a.type==he.MmlDegree);return this.createElementNS(We.mathML,"mroot",null,this.renderElements([e,r]))}renderMmlDelimiter(t){const e=[];return e.push(this.createElementNS(We.mathML,"mo",null,[t.props.beginChar??"("])),e.push(...this.renderElements(t.children)),e.push(this.createElementNS(We.mathML,"mo",null,[t.props.endChar??")"])),this.createElementNS(We.mathML,"mrow",null,e)}renderMmlNary(t){var c;const e=[],r=dr(t.children,u=>u.type),i=r[he.MmlSuperArgument],a=r[he.MmlSubArgument],o=i?this.createElementNS(We.mathML,"mo",null,ln(this.renderElement(i))):null,s=a?this.createElementNS(We.mathML,"mo",null,ln(this.renderElement(a))):null,l=this.createElementNS(We.mathML,"mo",null,[((c=t.props)==null?void 0:c.char)??"∫"]);return o||s?e.push(this.createElementNS(We.mathML,"munderover",null,[l,s,o])):o?e.push(this.createElementNS(We.mathML,"mover",null,[l,o])):s?e.push(this.createElementNS(We.mathML,"munder",null,[l,s])):e.push(l),e.push(...this.renderElements(r[he.MmlBase].children)),this.createElementNS(We.mathML,"mrow",null,e)}renderMmlPreSubSuper(t){const e=[],r=dr(t.children,c=>c.type),i=r[he.MmlSuperArgument],a=r[he.MmlSubArgument],o=i?this.createElementNS(We.mathML,"mo",null,ln(this.renderElement(i))):null,s=a?this.createElementNS(We.mathML,"mo",null,ln(this.renderElement(a))):null,l=this.createElementNS(We.mathML,"mo",null);return e.push(this.createElementNS(We.mathML,"msubsup",null,[l,s,o])),e.push(...this.renderElements(r[he.MmlBase].children)),this.createElementNS(We.mathML,"mrow",null,e)}renderMmlGroupChar(t){const e=t.props.verticalJustification==="bot"?"mover":"munder",r=this.renderContainerNS(t,We.mathML,e);return t.props.char&&r.appendChild(this.createElementNS(We.mathML,"mo",null,[t.props.char])),r}renderMmlBar(t){const e=this.renderContainerNS(t,We.mathML,"mrow");switch(t.props.position){case"top":e.style.textDecoration="overline";break;case"bottom":e.style.textDecoration="underline";break}return e}renderMmlRun(t){const e=this.createElementNS(We.mathML,"ms",null,this.renderElements(t.children));return this.renderClass(t,e),this.renderStyleValues(t.cssStyle,e),e}renderMllList(t){const e=this.createElementNS(We.mathML,"mtable");this.renderClass(t,e),this.renderStyleValues(t.cssStyle,e);for(let r of this.renderElements(t.children))e.appendChild(this.createElementNS(We.mathML,"mtr",null,[this.createElementNS(We.mathML,"mtd",null,[r])]));return e}renderStyleValues(t,e){for(let r in t)r.startsWith("$")?e.setAttribute(r.slice(1),t[r]):e.style[r]=t[r]}renderClass(t,e){t.className&&(e.className=t.className),t.styleName&&e.classList.add(this.processStyleName(t.styleName))}findStyle(t){var e;return t&&((e=this.styleMap)==null?void 0:e[t])}numberingClass(t,e){return`${this.className}-num-${t}-${e}`}tabStopClass(){return`${this.className}-tab-stop`}styleToString(t,e,r=null){let i=`${t} {\r
|
|
46
|
+
`;for(const a in e)a.startsWith("$")||(i+=` ${a}: ${e[a]};\r
|
|
47
|
+
`);return r&&(i+=r),i+`}\r
|
|
48
|
+
`}numberingCounter(t,e){return`${this.className}-num-${t}-${e}`}levelTextToContent(t,e,r,i){const a={tab:"\\9",space:"\\a0"};var o=t.replace(/%\d*/g,s=>{let l=parseInt(s.substring(1),10)-1;return`"counter(${this.numberingCounter(r,l)}, ${i})"`});return`"${o}${a[e]??""}"`}numFormatToCssValue(t){var e={none:"none",bullet:"disc",decimal:"decimal",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",decimalZero:"decimal-leading-zero",aiueo:"katakana",aiueoFullWidth:"katakana",chineseCounting:"simp-chinese-informal",chineseCountingThousand:"simp-chinese-informal",chineseLegalSimplified:"simp-chinese-formal",chosung:"hangul-consonant",ideographDigital:"cjk-ideographic",ideographTraditional:"cjk-heavenly-stem",ideographLegalTraditional:"trad-chinese-formal",ideographZodiac:"cjk-earthly-branch",iroha:"katakana-iroha",irohaFullWidth:"katakana-iroha",japaneseCounting:"japanese-informal",japaneseDigitalTenThousand:"cjk-decimal",japaneseLegal:"japanese-formal",thaiNumbers:"thai",koreanCounting:"korean-hangul-formal",koreanDigital:"korean-hangul-formal",koreanDigital2:"korean-hanja-informal",hebrew1:"hebrew",hebrew2:"hebrew",hindiNumbers:"devanagari",ganada:"hangul",taiwaneseCounting:"cjk-ideographic",taiwaneseCountingThousand:"cjk-ideographic",taiwaneseDigital:"cjk-decimal"};return e[t]??t}refreshTabStops(){this.options.experimental&&setTimeout(()=>{const t=H0();for(let e of this.currentTabs)W0(e.span,e.stops,this.defaultTabSize,t)},500)}createElementNS(t,e,r,i){var a=t?this.htmlDocument.createElementNS(t,e):this.htmlDocument.createElement(e);return Object.assign(a,r),i&&Wa(a,i),a}createElement(t,e,r){return this.createElementNS(void 0,t,e,r)}createSvgElement(t,e,r){return this.createElementNS(We.svg,t,e,r)}createStyleElement(t){return this.createElement("style",{innerHTML:t})}createComment(t){return this.htmlDocument.createComment(t)}later(t){this.postRenderTasks.push(t)}}function xl(n){n.innerHTML=""}function Wa(n,t){t.forEach(e=>n.appendChild(Rp(e)?document.createTextNode(e):e))}function $0(n,t){for(var e=n.parent;e!=null&&e.type!=t;)e=e.parent;return e}const Tl={ignoreHeight:!1,ignoreWidth:!1,ignoreFonts:!1,breakPages:!0,debug:!1,experimental:!1,className:"docx",inWrapper:!0,hideWrapperOnPrint:!1,trimXmlDeclaration:!0,ignoreLastRenderedPageBreak:!0,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0,useBase64URL:!1,renderChanges:!1,renderComments:!1,renderAltChunks:!0};function V0(n,t){const e={...Tl,...t};return Ha.load(n,new D0(e),e)}async function Z0(n,t,e,r){const i={...Tl,...r};return await new j0(window.document).render(n,t,e,i)}async function X0(n,t,e,r){const i=await V0(n,r);return await Z0(i,t,e,r),i}var Al={exports:{}};(function(n,t){(function(e){n.exports=e()})(function(){return function(){function e(r,i,a){function o(c,u){if(!i[c]){if(!r[c]){var f=typeof fr=="function"&&fr;if(!u&&f)return f(c,!0);if(s)return s(c,!0);var p=new Error("Cannot find module '"+c+"'");throw p.code="MODULE_NOT_FOUND",p}var d=i[c]={exports:{}};r[c][0].call(d.exports,function(b){var y=r[c][1][b];return o(y||b)},d,d.exports,e,r,i,a)}return i[c].exports}for(var s=typeof fr=="function"&&fr,l=0;l<a.length;l++)o(a[l]);return o}return e}()({1:[function(e,r,i){i.byteLength=p,i.toByteArray=b,i.fromByteArray=h;for(var a=[],o=[],s=typeof Uint8Array<"u"?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,u=l.length;c<u;++c)a[c]=l[c],o[l.charCodeAt(c)]=c;o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63;function f(m){var w=m.length;if(w%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var A=m.indexOf("=");A===-1&&(A=w);var v=A===w?0:4-A%4;return[A,v]}function p(m){var w=f(m),A=w[0],v=w[1];return(A+v)*3/4-v}function d(m,w,A){return(w+A)*3/4-A}function b(m){var w,A=f(m),v=A[0],T=A[1],N=new s(d(m,v,T)),M=0,P=T>0?v-4:v,O;for(O=0;O<P;O+=4)w=o[m.charCodeAt(O)]<<18|o[m.charCodeAt(O+1)]<<12|o[m.charCodeAt(O+2)]<<6|o[m.charCodeAt(O+3)],N[M++]=w>>16&255,N[M++]=w>>8&255,N[M++]=w&255;return T===2&&(w=o[m.charCodeAt(O)]<<2|o[m.charCodeAt(O+1)]>>4,N[M++]=w&255),T===1&&(w=o[m.charCodeAt(O)]<<10|o[m.charCodeAt(O+1)]<<4|o[m.charCodeAt(O+2)]>>2,N[M++]=w>>8&255,N[M++]=w&255),N}function y(m){return a[m>>18&63]+a[m>>12&63]+a[m>>6&63]+a[m&63]}function g(m,w,A){for(var v,T=[],N=w;N<A;N+=3)v=(m[N]<<16&16711680)+(m[N+1]<<8&65280)+(m[N+2]&255),T.push(y(v));return T.join("")}function h(m){for(var w,A=m.length,v=A%3,T=[],N=16383,M=0,P=A-v;M<P;M+=N)T.push(g(m,M,M+N>P?P:M+N));return v===1?(w=m[A-1],T.push(a[w>>2]+a[w<<4&63]+"==")):v===2&&(w=(m[A-2]<<8)+m[A-1],T.push(a[w>>10]+a[w>>4&63]+a[w<<2&63]+"=")),T.join("")}},{}],2:[function(e,r,i){},{}],3:[function(e,r,i){(function(f){var o=e("base64-js"),s=e("ieee754");i.Buffer=f,i.SlowBuffer=v,i.INSPECT_MAX_BYTES=50;var l=2147483647;i.kMaxLength=l,f.TYPED_ARRAY_SUPPORT=c(),!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{var L=new Uint8Array(1);return L.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},L.foo()===42}catch{return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}});function u(L){if(L>l)throw new RangeError('The value "'+L+'" is invalid for option "size"');var x=new Uint8Array(L);return x.__proto__=f.prototype,x}function f(L,x,k){if(typeof L=="number"){if(typeof x=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(L)}return p(L,x,k)}typeof Symbol<"u"&&Symbol.species!=null&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),f.poolSize=8192;function p(L,x,k){if(typeof L=="string")return g(L,x);if(ArrayBuffer.isView(L))return h(L);if(L==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof L);if(j(L,ArrayBuffer)||L&&j(L.buffer,ArrayBuffer))return m(L,x,k);if(typeof L=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var F=L.valueOf&&L.valueOf();if(F!=null&&F!==L)return f.from(F,x,k);var K=w(L);if(K)return K;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof L[Symbol.toPrimitive]=="function")return f.from(L[Symbol.toPrimitive]("string"),x,k);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof L)}f.from=function(L,x,k){return p(L,x,k)},f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array;function d(L){if(typeof L!="number")throw new TypeError('"size" argument must be of type number');if(L<0)throw new RangeError('The value "'+L+'" is invalid for option "size"')}function b(L,x,k){return d(L),L<=0?u(L):x!==void 0?typeof k=="string"?u(L).fill(x,k):u(L).fill(x):u(L)}f.alloc=function(L,x,k){return b(L,x,k)};function y(L){return d(L),u(L<0?0:A(L)|0)}f.allocUnsafe=function(L){return y(L)},f.allocUnsafeSlow=function(L){return y(L)};function g(L,x){if((typeof x!="string"||x==="")&&(x="utf8"),!f.isEncoding(x))throw new TypeError("Unknown encoding: "+x);var k=T(L,x)|0,F=u(k),K=F.write(L,x);return K!==k&&(F=F.slice(0,K)),F}function h(L){for(var x=L.length<0?0:A(L.length)|0,k=u(x),F=0;F<x;F+=1)k[F]=L[F]&255;return k}function m(L,x,k){if(x<0||L.byteLength<x)throw new RangeError('"offset" is outside of buffer bounds');if(L.byteLength<x+(k||0))throw new RangeError('"length" is outside of buffer bounds');var F;return x===void 0&&k===void 0?F=new Uint8Array(L):k===void 0?F=new Uint8Array(L,x):F=new Uint8Array(L,x,k),F.__proto__=f.prototype,F}function w(L){if(f.isBuffer(L)){var x=A(L.length)|0,k=u(x);return k.length===0||L.copy(k,0,0,x),k}if(L.length!==void 0)return typeof L.length!="number"||Y(L.length)?u(0):h(L);if(L.type==="Buffer"&&Array.isArray(L.data))return h(L.data)}function A(L){if(L>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return L|0}function v(L){return+L!=L&&(L=0),f.alloc(+L)}f.isBuffer=function(x){return x!=null&&x._isBuffer===!0&&x!==f.prototype},f.compare=function(x,k){if(j(x,Uint8Array)&&(x=f.from(x,x.offset,x.byteLength)),j(k,Uint8Array)&&(k=f.from(k,k.offset,k.byteLength)),!f.isBuffer(x)||!f.isBuffer(k))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(x===k)return 0;for(var F=x.length,K=k.length,ie=0,se=Math.min(F,K);ie<se;++ie)if(x[ie]!==k[ie]){F=x[ie],K=k[ie];break}return F<K?-1:K<F?1:0},f.isEncoding=function(x){switch(String(x).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(x,k){if(!Array.isArray(x))throw new TypeError('"list" argument must be an Array of Buffers');if(x.length===0)return f.alloc(0);var F;if(k===void 0)for(k=0,F=0;F<x.length;++F)k+=x[F].length;var K=f.allocUnsafe(k),ie=0;for(F=0;F<x.length;++F){var se=x[F];if(j(se,Uint8Array)&&(se=f.from(se)),!f.isBuffer(se))throw new TypeError('"list" argument must be an Array of Buffers');se.copy(K,ie),ie+=se.length}return K};function T(L,x){if(f.isBuffer(L))return L.length;if(ArrayBuffer.isView(L)||j(L,ArrayBuffer))return L.byteLength;if(typeof L!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof L);var k=L.length,F=arguments.length>2&&arguments[2]===!0;if(!F&&k===0)return 0;for(var K=!1;;)switch(x){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":return Ne(L).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k*2;case"hex":return k>>>1;case"base64":return G(L).length;default:if(K)return F?-1:Ne(L).length;x=(""+x).toLowerCase(),K=!0}}f.byteLength=T;function N(L,x,k){var F=!1;if((x===void 0||x<0)&&(x=0),x>this.length||((k===void 0||k>this.length)&&(k=this.length),k<=0)||(k>>>=0,x>>>=0,k<=x))return"";for(L||(L="utf8");;)switch(L){case"hex":return me(this,x,k);case"utf8":case"utf-8":return q(this,x,k);case"ascii":return Q(this,x,k);case"latin1":case"binary":return X(this,x,k);case"base64":return $(this,x,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,x,k);default:if(F)throw new TypeError("Unknown encoding: "+L);L=(L+"").toLowerCase(),F=!0}}f.prototype._isBuffer=!0;function M(L,x,k){var F=L[x];L[x]=L[k],L[k]=F}f.prototype.swap16=function(){var x=this.length;if(x%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var k=0;k<x;k+=2)M(this,k,k+1);return this},f.prototype.swap32=function(){var x=this.length;if(x%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var k=0;k<x;k+=4)M(this,k,k+3),M(this,k+1,k+2);return this},f.prototype.swap64=function(){var x=this.length;if(x%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var k=0;k<x;k+=8)M(this,k,k+7),M(this,k+1,k+6),M(this,k+2,k+5),M(this,k+3,k+4);return this},f.prototype.toString=function(){var x=this.length;return x===0?"":arguments.length===0?q(this,0,x):N.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(x){if(!f.isBuffer(x))throw new TypeError("Argument must be a Buffer");return this===x?!0:f.compare(this,x)===0},f.prototype.inspect=function(){var x="",k=i.INSPECT_MAX_BYTES;return x=this.toString("hex",0,k).replace(/(.{2})/g,"$1 ").trim(),this.length>k&&(x+=" ... "),"<Buffer "+x+">"},f.prototype.compare=function(x,k,F,K,ie){if(j(x,Uint8Array)&&(x=f.from(x,x.offset,x.byteLength)),!f.isBuffer(x))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof x);if(k===void 0&&(k=0),F===void 0&&(F=x?x.length:0),K===void 0&&(K=0),ie===void 0&&(ie=this.length),k<0||F>x.length||K<0||ie>this.length)throw new RangeError("out of range index");if(K>=ie&&k>=F)return 0;if(K>=ie)return-1;if(k>=F)return 1;if(k>>>=0,F>>>=0,K>>>=0,ie>>>=0,this===x)return 0;for(var se=ie-K,Ce=F-k,ke=Math.min(se,Ce),xe=this.slice(K,ie),Be=x.slice(k,F),Ie=0;Ie<ke;++Ie)if(xe[Ie]!==Be[Ie]){se=xe[Ie],Ce=Be[Ie];break}return se<Ce?-1:Ce<se?1:0};function P(L,x,k,F,K){if(L.length===0)return-1;if(typeof k=="string"?(F=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),k=+k,Y(k)&&(k=K?0:L.length-1),k<0&&(k=L.length+k),k>=L.length){if(K)return-1;k=L.length-1}else if(k<0)if(K)k=0;else return-1;if(typeof x=="string"&&(x=f.from(x,F)),f.isBuffer(x))return x.length===0?-1:O(L,x,k,F,K);if(typeof x=="number")return x=x&255,typeof Uint8Array.prototype.indexOf=="function"?K?Uint8Array.prototype.indexOf.call(L,x,k):Uint8Array.prototype.lastIndexOf.call(L,x,k):O(L,[x],k,F,K);throw new TypeError("val must be string, number or Buffer")}function O(L,x,k,F,K){var ie=1,se=L.length,Ce=x.length;if(F!==void 0&&(F=String(F).toLowerCase(),F==="ucs2"||F==="ucs-2"||F==="utf16le"||F==="utf-16le")){if(L.length<2||x.length<2)return-1;ie=2,se/=2,Ce/=2,k/=2}function ke(Re,He){return ie===1?Re[He]:Re.readUInt16BE(He*ie)}var xe;if(K){var Be=-1;for(xe=k;xe<se;xe++)if(ke(L,xe)===ke(x,Be===-1?0:xe-Be)){if(Be===-1&&(Be=xe),xe-Be+1===Ce)return Be*ie}else Be!==-1&&(xe-=xe-Be),Be=-1}else for(k+Ce>se&&(k=se-Ce),xe=k;xe>=0;xe--){for(var Ie=!0,Ve=0;Ve<Ce;Ve++)if(ke(L,xe+Ve)!==ke(x,Ve)){Ie=!1;break}if(Ie)return xe}return-1}f.prototype.includes=function(x,k,F){return this.indexOf(x,k,F)!==-1},f.prototype.indexOf=function(x,k,F){return P(this,x,k,F,!0)},f.prototype.lastIndexOf=function(x,k,F){return P(this,x,k,F,!1)};function ne(L,x,k,F){k=Number(k)||0;var K=L.length-k;F?(F=Number(F),F>K&&(F=K)):F=K;var ie=x.length;F>ie/2&&(F=ie/2);for(var se=0;se<F;++se){var Ce=parseInt(x.substr(se*2,2),16);if(Y(Ce))return se;L[k+se]=Ce}return se}function R(L,x,k,F){return z(Ne(x,L.length-k),L,k,F)}function I(L,x,k,F){return z(_(x),L,k,F)}function E(L,x,k,F){return I(L,x,k,F)}function U(L,x,k,F){return z(G(x),L,k,F)}function Z(L,x,k,F){return z(B(x,L.length-k),L,k,F)}f.prototype.write=function(x,k,F,K){if(k===void 0)K="utf8",F=this.length,k=0;else if(F===void 0&&typeof k=="string")K=k,F=this.length,k=0;else if(isFinite(k))k=k>>>0,isFinite(F)?(F=F>>>0,K===void 0&&(K="utf8")):(K=F,F=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ie=this.length-k;if((F===void 0||F>ie)&&(F=ie),x.length>0&&(F<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");K||(K="utf8");for(var se=!1;;)switch(K){case"hex":return ne(this,x,k,F);case"utf8":case"utf-8":return R(this,x,k,F);case"ascii":return I(this,x,k,F);case"latin1":case"binary":return E(this,x,k,F);case"base64":return U(this,x,k,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,x,k,F);default:if(se)throw new TypeError("Unknown encoding: "+K);K=(""+K).toLowerCase(),se=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(L,x,k){return x===0&&k===L.length?o.fromByteArray(L):o.fromByteArray(L.slice(x,k))}function q(L,x,k){k=Math.min(L.length,k);for(var F=[],K=x;K<k;){var ie=L[K],se=null,Ce=ie>239?4:ie>223?3:ie>191?2:1;if(K+Ce<=k){var ke,xe,Be,Ie;switch(Ce){case 1:ie<128&&(se=ie);break;case 2:ke=L[K+1],(ke&192)===128&&(Ie=(ie&31)<<6|ke&63,Ie>127&&(se=Ie));break;case 3:ke=L[K+1],xe=L[K+2],(ke&192)===128&&(xe&192)===128&&(Ie=(ie&15)<<12|(ke&63)<<6|xe&63,Ie>2047&&(Ie<55296||Ie>57343)&&(se=Ie));break;case 4:ke=L[K+1],xe=L[K+2],Be=L[K+3],(ke&192)===128&&(xe&192)===128&&(Be&192)===128&&(Ie=(ie&15)<<18|(ke&63)<<12|(xe&63)<<6|Be&63,Ie>65535&&Ie<1114112&&(se=Ie))}}se===null?(se=65533,Ce=1):se>65535&&(se-=65536,F.push(se>>>10&1023|55296),se=56320|se&1023),F.push(se),K+=Ce}return re(F)}var J=4096;function re(L){var x=L.length;if(x<=J)return String.fromCharCode.apply(String,L);for(var k="",F=0;F<x;)k+=String.fromCharCode.apply(String,L.slice(F,F+=J));return k}function Q(L,x,k){var F="";k=Math.min(L.length,k);for(var K=x;K<k;++K)F+=String.fromCharCode(L[K]&127);return F}function X(L,x,k){var F="";k=Math.min(L.length,k);for(var K=x;K<k;++K)F+=String.fromCharCode(L[K]);return F}function me(L,x,k){var F=L.length;(!x||x<0)&&(x=0),(!k||k<0||k>F)&&(k=F);for(var K="",ie=x;ie<k;++ie)K+=Fe(L[ie]);return K}function pe(L,x,k){for(var F=L.slice(x,k),K="",ie=0;ie<F.length;ie+=2)K+=String.fromCharCode(F[ie]+F[ie+1]*256);return K}f.prototype.slice=function(x,k){var F=this.length;x=~~x,k=k===void 0?F:~~k,x<0?(x+=F,x<0&&(x=0)):x>F&&(x=F),k<0?(k+=F,k<0&&(k=0)):k>F&&(k=F),k<x&&(k=x);var K=this.subarray(x,k);return K.__proto__=f.prototype,K};function V(L,x,k){if(L%1!==0||L<0)throw new RangeError("offset is not uint");if(L+x>k)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function(x,k,F){x=x>>>0,k=k>>>0,F||V(x,k,this.length);for(var K=this[x],ie=1,se=0;++se<k&&(ie*=256);)K+=this[x+se]*ie;return K},f.prototype.readUIntBE=function(x,k,F){x=x>>>0,k=k>>>0,F||V(x,k,this.length);for(var K=this[x+--k],ie=1;k>0&&(ie*=256);)K+=this[x+--k]*ie;return K},f.prototype.readUInt8=function(x,k){return x=x>>>0,k||V(x,1,this.length),this[x]},f.prototype.readUInt16LE=function(x,k){return x=x>>>0,k||V(x,2,this.length),this[x]|this[x+1]<<8},f.prototype.readUInt16BE=function(x,k){return x=x>>>0,k||V(x,2,this.length),this[x]<<8|this[x+1]},f.prototype.readUInt32LE=function(x,k){return x=x>>>0,k||V(x,4,this.length),(this[x]|this[x+1]<<8|this[x+2]<<16)+this[x+3]*16777216},f.prototype.readUInt32BE=function(x,k){return x=x>>>0,k||V(x,4,this.length),this[x]*16777216+(this[x+1]<<16|this[x+2]<<8|this[x+3])},f.prototype.readIntLE=function(x,k,F){x=x>>>0,k=k>>>0,F||V(x,k,this.length);for(var K=this[x],ie=1,se=0;++se<k&&(ie*=256);)K+=this[x+se]*ie;return ie*=128,K>=ie&&(K-=Math.pow(2,8*k)),K},f.prototype.readIntBE=function(x,k,F){x=x>>>0,k=k>>>0,F||V(x,k,this.length);for(var K=k,ie=1,se=this[x+--K];K>0&&(ie*=256);)se+=this[x+--K]*ie;return ie*=128,se>=ie&&(se-=Math.pow(2,8*k)),se},f.prototype.readInt8=function(x,k){return x=x>>>0,k||V(x,1,this.length),this[x]&128?(255-this[x]+1)*-1:this[x]},f.prototype.readInt16LE=function(x,k){x=x>>>0,k||V(x,2,this.length);var F=this[x]|this[x+1]<<8;return F&32768?F|4294901760:F},f.prototype.readInt16BE=function(x,k){x=x>>>0,k||V(x,2,this.length);var F=this[x+1]|this[x]<<8;return F&32768?F|4294901760:F},f.prototype.readInt32LE=function(x,k){return x=x>>>0,k||V(x,4,this.length),this[x]|this[x+1]<<8|this[x+2]<<16|this[x+3]<<24},f.prototype.readInt32BE=function(x,k){return x=x>>>0,k||V(x,4,this.length),this[x]<<24|this[x+1]<<16|this[x+2]<<8|this[x+3]},f.prototype.readFloatLE=function(x,k){return x=x>>>0,k||V(x,4,this.length),s.read(this,x,!0,23,4)},f.prototype.readFloatBE=function(x,k){return x=x>>>0,k||V(x,4,this.length),s.read(this,x,!1,23,4)},f.prototype.readDoubleLE=function(x,k){return x=x>>>0,k||V(x,8,this.length),s.read(this,x,!0,52,8)},f.prototype.readDoubleBE=function(x,k){return x=x>>>0,k||V(x,8,this.length),s.read(this,x,!1,52,8)};function ee(L,x,k,F,K,ie){if(!f.isBuffer(L))throw new TypeError('"buffer" argument must be a Buffer instance');if(x>K||x<ie)throw new RangeError('"value" argument is out of bounds');if(k+F>L.length)throw new RangeError("Index out of range")}f.prototype.writeUIntLE=function(x,k,F,K){if(x=+x,k=k>>>0,F=F>>>0,!K){var ie=Math.pow(2,8*F)-1;ee(this,x,k,F,ie,0)}var se=1,Ce=0;for(this[k]=x&255;++Ce<F&&(se*=256);)this[k+Ce]=x/se&255;return k+F},f.prototype.writeUIntBE=function(x,k,F,K){if(x=+x,k=k>>>0,F=F>>>0,!K){var ie=Math.pow(2,8*F)-1;ee(this,x,k,F,ie,0)}var se=F-1,Ce=1;for(this[k+se]=x&255;--se>=0&&(Ce*=256);)this[k+se]=x/Ce&255;return k+F},f.prototype.writeUInt8=function(x,k,F){return x=+x,k=k>>>0,F||ee(this,x,k,1,255,0),this[k]=x&255,k+1},f.prototype.writeUInt16LE=function(x,k,F){return x=+x,k=k>>>0,F||ee(this,x,k,2,65535,0),this[k]=x&255,this[k+1]=x>>>8,k+2},f.prototype.writeUInt16BE=function(x,k,F){return x=+x,k=k>>>0,F||ee(this,x,k,2,65535,0),this[k]=x>>>8,this[k+1]=x&255,k+2},f.prototype.writeUInt32LE=function(x,k,F){return x=+x,k=k>>>0,F||ee(this,x,k,4,4294967295,0),this[k+3]=x>>>24,this[k+2]=x>>>16,this[k+1]=x>>>8,this[k]=x&255,k+4},f.prototype.writeUInt32BE=function(x,k,F){return x=+x,k=k>>>0,F||ee(this,x,k,4,4294967295,0),this[k]=x>>>24,this[k+1]=x>>>16,this[k+2]=x>>>8,this[k+3]=x&255,k+4},f.prototype.writeIntLE=function(x,k,F,K){if(x=+x,k=k>>>0,!K){var ie=Math.pow(2,8*F-1);ee(this,x,k,F,ie-1,-ie)}var se=0,Ce=1,ke=0;for(this[k]=x&255;++se<F&&(Ce*=256);)x<0&&ke===0&&this[k+se-1]!==0&&(ke=1),this[k+se]=(x/Ce>>0)-ke&255;return k+F},f.prototype.writeIntBE=function(x,k,F,K){if(x=+x,k=k>>>0,!K){var ie=Math.pow(2,8*F-1);ee(this,x,k,F,ie-1,-ie)}var se=F-1,Ce=1,ke=0;for(this[k+se]=x&255;--se>=0&&(Ce*=256);)x<0&&ke===0&&this[k+se+1]!==0&&(ke=1),this[k+se]=(x/Ce>>0)-ke&255;return k+F},f.prototype.writeInt8=function(x,k,F){return x=+x,k=k>>>0,F||ee(this,x,k,1,127,-128),x<0&&(x=255+x+1),this[k]=x&255,k+1},f.prototype.writeInt16LE=function(x,k,F){return x=+x,k=k>>>0,F||ee(this,x,k,2,32767,-32768),this[k]=x&255,this[k+1]=x>>>8,k+2},f.prototype.writeInt16BE=function(x,k,F){return x=+x,k=k>>>0,F||ee(this,x,k,2,32767,-32768),this[k]=x>>>8,this[k+1]=x&255,k+2},f.prototype.writeInt32LE=function(x,k,F){return x=+x,k=k>>>0,F||ee(this,x,k,4,2147483647,-2147483648),this[k]=x&255,this[k+1]=x>>>8,this[k+2]=x>>>16,this[k+3]=x>>>24,k+4},f.prototype.writeInt32BE=function(x,k,F){return x=+x,k=k>>>0,F||ee(this,x,k,4,2147483647,-2147483648),x<0&&(x=4294967295+x+1),this[k]=x>>>24,this[k+1]=x>>>16,this[k+2]=x>>>8,this[k+3]=x&255,k+4};function ce(L,x,k,F,K,ie){if(k+F>L.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function ue(L,x,k,F,K){return x=+x,k=k>>>0,K||ce(L,x,k,4),s.write(L,x,k,F,23,4),k+4}f.prototype.writeFloatLE=function(x,k,F){return ue(this,x,k,!0,F)},f.prototype.writeFloatBE=function(x,k,F){return ue(this,x,k,!1,F)};function ve(L,x,k,F,K){return x=+x,k=k>>>0,K||ce(L,x,k,8),s.write(L,x,k,F,52,8),k+8}f.prototype.writeDoubleLE=function(x,k,F){return ve(this,x,k,!0,F)},f.prototype.writeDoubleBE=function(x,k,F){return ve(this,x,k,!1,F)},f.prototype.copy=function(x,k,F,K){if(!f.isBuffer(x))throw new TypeError("argument should be a Buffer");if(F||(F=0),!K&&K!==0&&(K=this.length),k>=x.length&&(k=x.length),k||(k=0),K>0&&K<F&&(K=F),K===F||x.length===0||this.length===0)return 0;if(k<0)throw new RangeError("targetStart out of bounds");if(F<0||F>=this.length)throw new RangeError("Index out of range");if(K<0)throw new RangeError("sourceEnd out of bounds");K>this.length&&(K=this.length),x.length-k<K-F&&(K=x.length-k+F);var ie=K-F;if(this===x&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(k,F,K);else if(this===x&&F<k&&k<K)for(var se=ie-1;se>=0;--se)x[se+k]=this[se+F];else Uint8Array.prototype.set.call(x,this.subarray(F,K),k);return ie},f.prototype.fill=function(x,k,F,K){if(typeof x=="string"){if(typeof k=="string"?(K=k,k=0,F=this.length):typeof F=="string"&&(K=F,F=this.length),K!==void 0&&typeof K!="string")throw new TypeError("encoding must be a string");if(typeof K=="string"&&!f.isEncoding(K))throw new TypeError("Unknown encoding: "+K);if(x.length===1){var ie=x.charCodeAt(0);(K==="utf8"&&ie<128||K==="latin1")&&(x=ie)}}else typeof x=="number"&&(x=x&255);if(k<0||this.length<k||this.length<F)throw new RangeError("Out of range index");if(F<=k)return this;k=k>>>0,F=F===void 0?this.length:F>>>0,x||(x=0);var se;if(typeof x=="number")for(se=k;se<F;++se)this[se]=x;else{var Ce=f.isBuffer(x)?x:f.from(x,K),ke=Ce.length;if(ke===0)throw new TypeError('The value "'+x+'" is invalid for argument "value"');for(se=0;se<F-k;++se)this[se+k]=Ce[se%ke]}return this};var Ee=/[^+/0-9A-Za-z-_]/g;function Se(L){if(L=L.split("=")[0],L=L.trim().replace(Ee,""),L.length<2)return"";for(;L.length%4!==0;)L=L+"=";return L}function Fe(L){return L<16?"0"+L.toString(16):L.toString(16)}function Ne(L,x){x=x||1/0;for(var k,F=L.length,K=null,ie=[],se=0;se<F;++se){if(k=L.charCodeAt(se),k>55295&&k<57344){if(!K){if(k>56319){(x-=3)>-1&&ie.push(239,191,189);continue}else if(se+1===F){(x-=3)>-1&&ie.push(239,191,189);continue}K=k;continue}if(k<56320){(x-=3)>-1&&ie.push(239,191,189),K=k;continue}k=(K-55296<<10|k-56320)+65536}else K&&(x-=3)>-1&&ie.push(239,191,189);if(K=null,k<128){if((x-=1)<0)break;ie.push(k)}else if(k<2048){if((x-=2)<0)break;ie.push(k>>6|192,k&63|128)}else if(k<65536){if((x-=3)<0)break;ie.push(k>>12|224,k>>6&63|128,k&63|128)}else if(k<1114112){if((x-=4)<0)break;ie.push(k>>18|240,k>>12&63|128,k>>6&63|128,k&63|128)}else throw new Error("Invalid code point")}return ie}function _(L){for(var x=[],k=0;k<L.length;++k)x.push(L.charCodeAt(k)&255);return x}function B(L,x){for(var k,F,K,ie=[],se=0;se<L.length&&!((x-=2)<0);++se)k=L.charCodeAt(se),F=k>>8,K=k%256,ie.push(K),ie.push(F);return ie}function G(L){return o.toByteArray(Se(L))}function z(L,x,k,F){for(var K=0;K<F&&!(K+k>=x.length||K>=L.length);++K)x[K+k]=L[K];return K}function j(L,x){return L instanceof x||L!=null&&L.constructor!=null&&L.constructor.name!=null&&L.constructor.name===x.name}function Y(L){return L!==L}}).call(this,e("buffer").Buffer)},{"base64-js":1,buffer:3,ieee754:6}],4:[function(e,r,i){(function(a){function o(v){return Array.isArray?Array.isArray(v):A(v)==="[object Array]"}i.isArray=o;function s(v){return typeof v=="boolean"}i.isBoolean=s;function l(v){return v===null}i.isNull=l;function c(v){return v==null}i.isNullOrUndefined=c;function u(v){return typeof v=="number"}i.isNumber=u;function f(v){return typeof v=="string"}i.isString=f;function p(v){return typeof v=="symbol"}i.isSymbol=p;function d(v){return v===void 0}i.isUndefined=d;function b(v){return A(v)==="[object RegExp]"}i.isRegExp=b;function y(v){return typeof v=="object"&&v!==null}i.isObject=y;function g(v){return A(v)==="[object Date]"}i.isDate=g;function h(v){return A(v)==="[object Error]"||v instanceof Error}i.isError=h;function m(v){return typeof v=="function"}i.isFunction=m;function w(v){return v===null||typeof v=="boolean"||typeof v=="number"||typeof v=="string"||typeof v=="symbol"||typeof v>"u"}i.isPrimitive=w,i.isBuffer=a.isBuffer;function A(v){return Object.prototype.toString.call(v)}}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":9}],5:[function(e,r,i){var a=Object.create||O,o=Object.keys||ne,s=Function.prototype.bind||R;function l(){(!this._events||!Object.prototype.hasOwnProperty.call(this,"_events"))&&(this._events=a(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}r.exports=l,l.EventEmitter=l,l.prototype._events=void 0,l.prototype._maxListeners=void 0;var c=10,u;try{var f={};Object.defineProperty&&Object.defineProperty(f,"x",{value:0}),u=f.x===0}catch{u=!1}u?Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(I){if(typeof I!="number"||I<0||I!==I)throw new TypeError('"defaultMaxListeners" must be a positive number');c=I}}):l.defaultMaxListeners=c,l.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||isNaN(E))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=E,this};function p(I){return I._maxListeners===void 0?l.defaultMaxListeners:I._maxListeners}l.prototype.getMaxListeners=function(){return p(this)};function d(I,E,U){if(E)I.call(U);else for(var Z=I.length,$=M(I,Z),q=0;q<Z;++q)$[q].call(U)}function b(I,E,U,Z){if(E)I.call(U,Z);else for(var $=I.length,q=M(I,$),J=0;J<$;++J)q[J].call(U,Z)}function y(I,E,U,Z,$){if(E)I.call(U,Z,$);else for(var q=I.length,J=M(I,q),re=0;re<q;++re)J[re].call(U,Z,$)}function g(I,E,U,Z,$,q){if(E)I.call(U,Z,$,q);else for(var J=I.length,re=M(I,J),Q=0;Q<J;++Q)re[Q].call(U,Z,$,q)}function h(I,E,U,Z){if(E)I.apply(U,Z);else for(var $=I.length,q=M(I,$),J=0;J<$;++J)q[J].apply(U,Z)}l.prototype.emit=function(E){var U,Z,$,q,J,re,Q=E==="error";if(re=this._events,re)Q=Q&&re.error==null;else if(!Q)return!1;if(Q){if(arguments.length>1&&(U=arguments[1]),U instanceof Error)throw U;var X=new Error('Unhandled "error" event. ('+U+")");throw X.context=U,X}if(Z=re[E],!Z)return!1;var me=typeof Z=="function";switch($=arguments.length,$){case 1:d(Z,me,this);break;case 2:b(Z,me,this,arguments[1]);break;case 3:y(Z,me,this,arguments[1],arguments[2]);break;case 4:g(Z,me,this,arguments[1],arguments[2],arguments[3]);break;default:for(q=new Array($-1),J=1;J<$;J++)q[J-1]=arguments[J];h(Z,me,this,q)}return!0};function m(I,E,U,Z){var $,q,J;if(typeof U!="function")throw new TypeError('"listener" argument must be a function');if(q=I._events,q?(q.newListener&&(I.emit("newListener",E,U.listener?U.listener:U),q=I._events),J=q[E]):(q=I._events=a(null),I._eventsCount=0),!J)J=q[E]=U,++I._eventsCount;else if(typeof J=="function"?J=q[E]=Z?[U,J]:[J,U]:Z?J.unshift(U):J.push(U),!J.warned&&($=p(I),$&&$>0&&J.length>$)){J.warned=!0;var re=new Error("Possible EventEmitter memory leak detected. "+J.length+' "'+String(E)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');re.name="MaxListenersExceededWarning",re.emitter=I,re.type=E,re.count=J.length,typeof console=="object"&&console.warn&&console.warn("%s: %s",re.name,re.message)}return I}l.prototype.addListener=function(E,U){return m(this,E,U,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(E,U){return m(this,E,U,!0)};function w(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var I=new Array(arguments.length),E=0;E<I.length;++E)I[E]=arguments[E];this.listener.apply(this.target,I)}}function A(I,E,U){var Z={fired:!1,wrapFn:void 0,target:I,type:E,listener:U},$=s.call(w,Z);return $.listener=U,Z.wrapFn=$,$}l.prototype.once=function(E,U){if(typeof U!="function")throw new TypeError('"listener" argument must be a function');return this.on(E,A(this,E,U)),this},l.prototype.prependOnceListener=function(E,U){if(typeof U!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(E,A(this,E,U)),this},l.prototype.removeListener=function(E,U){var Z,$,q,J,re;if(typeof U!="function")throw new TypeError('"listener" argument must be a function');if($=this._events,!$)return this;if(Z=$[E],!Z)return this;if(Z===U||Z.listener===U)--this._eventsCount===0?this._events=a(null):(delete $[E],$.removeListener&&this.emit("removeListener",E,Z.listener||U));else if(typeof Z!="function"){for(q=-1,J=Z.length-1;J>=0;J--)if(Z[J]===U||Z[J].listener===U){re=Z[J].listener,q=J;break}if(q<0)return this;q===0?Z.shift():N(Z,q),Z.length===1&&($[E]=Z[0]),$.removeListener&&this.emit("removeListener",E,re||U)}return this},l.prototype.removeAllListeners=function(E){var U,Z,$;if(Z=this._events,!Z)return this;if(!Z.removeListener)return arguments.length===0?(this._events=a(null),this._eventsCount=0):Z[E]&&(--this._eventsCount===0?this._events=a(null):delete Z[E]),this;if(arguments.length===0){var q=o(Z),J;for($=0;$<q.length;++$)J=q[$],J!=="removeListener"&&this.removeAllListeners(J);return this.removeAllListeners("removeListener"),this._events=a(null),this._eventsCount=0,this}if(U=Z[E],typeof U=="function")this.removeListener(E,U);else if(U)for($=U.length-1;$>=0;$--)this.removeListener(E,U[$]);return this};function v(I,E,U){var Z=I._events;if(!Z)return[];var $=Z[E];return $?typeof $=="function"?U?[$.listener||$]:[$]:U?P($):M($,$.length):[]}l.prototype.listeners=function(E){return v(this,E,!0)},l.prototype.rawListeners=function(E){return v(this,E,!1)},l.listenerCount=function(I,E){return typeof I.listenerCount=="function"?I.listenerCount(E):T.call(I,E)},l.prototype.listenerCount=T;function T(I){var E=this._events;if(E){var U=E[I];if(typeof U=="function")return 1;if(U)return U.length}return 0}l.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function N(I,E){for(var U=E,Z=U+1,$=I.length;Z<$;U+=1,Z+=1)I[U]=I[Z];I.pop()}function M(I,E){for(var U=new Array(E),Z=0;Z<E;++Z)U[Z]=I[Z];return U}function P(I){for(var E=new Array(I.length),U=0;U<E.length;++U)E[U]=I[U].listener||I[U];return E}function O(I){var E=function(){};return E.prototype=I,new E}function ne(I){for(var E in I)Object.prototype.hasOwnProperty.call(I,E);return E}function R(I){var E=this;return function(){return E.apply(I,arguments)}}},{}],6:[function(e,r,i){i.read=function(a,o,s,l,c){var u,f,p=c*8-l-1,d=(1<<p)-1,b=d>>1,y=-7,g=s?c-1:0,h=s?-1:1,m=a[o+g];for(g+=h,u=m&(1<<-y)-1,m>>=-y,y+=p;y>0;u=u*256+a[o+g],g+=h,y-=8);for(f=u&(1<<-y)-1,u>>=-y,y+=l;y>0;f=f*256+a[o+g],g+=h,y-=8);if(u===0)u=1-b;else{if(u===d)return f?NaN:(m?-1:1)*(1/0);f=f+Math.pow(2,l),u=u-b}return(m?-1:1)*f*Math.pow(2,u-l)},i.write=function(a,o,s,l,c,u){var f,p,d,b=u*8-c-1,y=(1<<b)-1,g=y>>1,h=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=l?0:u-1,w=l?1:-1,A=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(p=isNaN(o)?1:0,f=y):(f=Math.floor(Math.log(o)/Math.LN2),o*(d=Math.pow(2,-f))<1&&(f--,d*=2),f+g>=1?o+=h/d:o+=h*Math.pow(2,1-g),o*d>=2&&(f++,d/=2),f+g>=y?(p=0,f=y):f+g>=1?(p=(o*d-1)*Math.pow(2,c),f=f+g):(p=o*Math.pow(2,g-1)*Math.pow(2,c),f=0));c>=8;a[s+m]=p&255,m+=w,p/=256,c-=8);for(f=f<<c|p,b+=c;b>0;a[s+m]=f&255,m+=w,f/=256,b-=8);a[s+m-w]|=A*128}},{}],7:[function(e,r,i){(function(a){var o=a.MutationObserver||a.WebKitMutationObserver,s;if(o){var l=0,c=new o(b),u=a.document.createTextNode("");c.observe(u,{characterData:!0}),s=function(){u.data=l=++l%2}}else if(!a.setImmediate&&typeof a.MessageChannel<"u"){var f=new a.MessageChannel;f.port1.onmessage=b,s=function(){f.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?s=function(){var g=a.document.createElement("script");g.onreadystatechange=function(){b(),g.onreadystatechange=null,g.parentNode.removeChild(g),g=null},a.document.documentElement.appendChild(g)}:s=function(){setTimeout(b,0)};var p,d=[];function b(){p=!0;for(var g,h,m=d.length;m;){for(h=d,d=[],g=-1;++g<m;)h[g]();m=d.length}p=!1}r.exports=y;function y(g){d.push(g)===1&&!p&&s()}}).call(this,typeof Ot<"u"?Ot:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(e,r,i){typeof Object.create=="function"?r.exports=function(o,s){s&&(o.super_=s,o.prototype=Object.create(s.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(o,s){if(s){o.super_=s;var l=function(){};l.prototype=s.prototype,o.prototype=new l,o.prototype.constructor=o}}},{}],9:[function(e,r,i){/*!
|
|
49
|
+
* Determine if an object is a Buffer
|
|
50
|
+
*
|
|
51
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
52
|
+
* @license MIT
|
|
53
|
+
*/r.exports=function(s){return s!=null&&(a(s)||o(s)||!!s._isBuffer)};function a(s){return!!s.constructor&&typeof s.constructor.isBuffer=="function"&&s.constructor.isBuffer(s)}function o(s){return typeof s.readFloatLE=="function"&&typeof s.slice=="function"&&a(s.slice(0,0))}},{}],10:[function(e,r,i){var a={}.toString;r.exports=Array.isArray||function(o){return a.call(o)=="[object Array]"}},{}],11:[function(e,r,i){var a=e("./utils"),o=e("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(l){for(var c=[],u,f,p,d,b,y,g,h=0,m=l.length,w=m,A=a.getTypeOf(l)!=="string";h<l.length;)w=m-h,A?(u=l[h++],f=h<m?l[h++]:0,p=h<m?l[h++]:0):(u=l.charCodeAt(h++),f=h<m?l.charCodeAt(h++):0,p=h<m?l.charCodeAt(h++):0),d=u>>2,b=(u&3)<<4|f>>4,y=w>1?(f&15)<<2|p>>6:64,g=w>2?p&63:64,c.push(s.charAt(d)+s.charAt(b)+s.charAt(y)+s.charAt(g));return c.join("")},i.decode=function(l){var c,u,f,p,d,b,y,g=0,h=0,m="data:";if(l.substr(0,m.length)===m)throw new Error("Invalid base64 input, it looks like a data url.");l=l.replace(/[^A-Za-z0-9\+\/\=]/g,"");var w=l.length*3/4;if(l.charAt(l.length-1)===s.charAt(64)&&w--,l.charAt(l.length-2)===s.charAt(64)&&w--,w%1!==0)throw new Error("Invalid base64 input, bad content length.");var A;for(o.uint8array?A=new Uint8Array(w|0):A=new Array(w|0);g<l.length;)p=s.indexOf(l.charAt(g++)),d=s.indexOf(l.charAt(g++)),b=s.indexOf(l.charAt(g++)),y=s.indexOf(l.charAt(g++)),c=p<<2|d>>4,u=(d&15)<<4|b>>2,f=(b&3)<<6|y,A[h++]=c,b!==64&&(A[h++]=u),y!==64&&(A[h++]=f);return A}},{"./support":40,"./utils":42}],12:[function(e,r,i){var a=e("./external"),o=e("./stream/DataWorker"),l=e("./stream/DataLengthProbe"),s=e("./stream/Crc32Probe"),l=e("./stream/DataLengthProbe");function c(u,f,p,d,b){this.compressedSize=u,this.uncompressedSize=f,this.crc32=p,this.compression=d,this.compressedContent=b}c.prototype={getContentWorker:function(){var u=new o(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return u.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new o(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,f,p){return u.pipe(new s).pipe(new l("uncompressedSize")).pipe(f.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},r.exports=c},{"./external":16,"./stream/Crc32Probe":35,"./stream/DataLengthProbe":36,"./stream/DataWorker":37}],13:[function(e,r,i){var a=e("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(o){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},i.DEFLATE=e("./flate")},{"./flate":17,"./stream/GenericWorker":38}],14:[function(e,r,i){var a=e("./utils");function o(){for(var u,f=[],p=0;p<256;p++){u=p;for(var d=0;d<8;d++)u=u&1?3988292384^u>>>1:u>>>1;f[p]=u}return f}var s=o();function l(u,f,p,d){var b=s,y=d+p;u=u^-1;for(var g=d;g<y;g++)u=u>>>8^b[(u^f[g])&255];return u^-1}function c(u,f,p,d){var b=s,y=d+p;u=u^-1;for(var g=d;g<y;g++)u=u>>>8^b[(u^f.charCodeAt(g))&255];return u^-1}r.exports=function(f,p){if(typeof f>"u"||!f.length)return 0;var d=a.getTypeOf(f)!=="string";return d?l(p|0,f,f.length,0):c(p|0,f,f.length,0)}},{"./utils":42}],15:[function(e,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],16:[function(e,r,i){var a=null;typeof Promise<"u"?a=Promise:a=e("lie"),r.exports={Promise:a}},{lie:46}],17:[function(e,r,i){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=e("pako"),s=e("./utils"),l=e("./stream/GenericWorker"),c=a?"uint8array":"array";i.magic="\b\0";function u(f,p){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=p,this.meta={}}s.inherits(u,l),u.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(s.transformTo(c,f.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(p){f.push({data:p,meta:f.meta})}},i.compressWorker=function(f){return new u("Deflate",f)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":38,"./utils":42,pako:47}],18:[function(e,r,i){var a=e("../utils"),o=e("../stream/GenericWorker"),s=e("../utf8"),l=e("../crc32"),c=e("../signature"),u=function(h,m){var w="",A;for(A=0;A<m;A++)w+=String.fromCharCode(h&255),h=h>>>8;return w},f=function(h,m){var w=h;return h||(w=m?16893:33204),(w&65535)<<16},p=function(h,m){return(h||0)&63},d=function(h,m,w,A,v,T){var N=h.file,M=h.compression,P=T!==s.utf8encode,O=a.transformTo("string",T(N.name)),ne=a.transformTo("string",s.utf8encode(N.name)),R=N.comment,I=a.transformTo("string",T(R)),E=a.transformTo("string",s.utf8encode(R)),U=ne.length!==N.name.length,Z=E.length!==R.length,$,q,J="",re="",Q="",X=N.dir,me=N.date,pe={crc32:0,compressedSize:0,uncompressedSize:0};(!m||w)&&(pe.crc32=h.crc32,pe.compressedSize=h.compressedSize,pe.uncompressedSize=h.uncompressedSize);var V=0;m&&(V|=8),!P&&(U||Z)&&(V|=2048);var ee=0,ce=0;X&&(ee|=16),v==="UNIX"?(ce=798,ee|=f(N.unixPermissions,X)):(ce=20,ee|=p(N.dosPermissions)),$=me.getUTCHours(),$=$<<6,$=$|me.getUTCMinutes(),$=$<<5,$=$|me.getUTCSeconds()/2,q=me.getUTCFullYear()-1980,q=q<<4,q=q|me.getUTCMonth()+1,q=q<<5,q=q|me.getUTCDate(),U&&(re=u(1,1)+u(l(O),4)+ne,J+="up"+u(re.length,2)+re),Z&&(Q=u(1,1)+u(l(I),4)+E,J+="uc"+u(Q.length,2)+Q);var ue="";ue+=`
|
|
54
|
+
\0`,ue+=u(V,2),ue+=M.magic,ue+=u($,2),ue+=u(q,2),ue+=u(pe.crc32,4),ue+=u(pe.compressedSize,4),ue+=u(pe.uncompressedSize,4),ue+=u(O.length,2),ue+=u(J.length,2);var ve=c.LOCAL_FILE_HEADER+ue+O+J,Ee=c.CENTRAL_FILE_HEADER+u(ce,2)+ue+u(I.length,2)+"\0\0\0\0"+u(ee,4)+u(A,4)+O+J+I;return{fileRecord:ve,dirRecord:Ee}},b=function(h,m,w,A,v){var T="",N=a.transformTo("string",v(A));return T=c.CENTRAL_DIRECTORY_END+"\0\0\0\0"+u(h,2)+u(h,2)+u(m,4)+u(w,4)+u(N.length,2)+N,T},y=function(h){var m="";return m=c.DATA_DESCRIPTOR+u(h.crc32,4)+u(h.compressedSize,4)+u(h.uncompressedSize,4),m};function g(h,m,w,A){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=m,this.zipPlatform=w,this.encodeFileName=A,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(g,o),g.prototype.push=function(h){var m=h.meta.percent||0,w=this.entriesCount,A=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,o.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:w?(m+100*(w-A-1))/w:100}}))},g.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var m=this.streamFiles&&!h.file.dir;if(m){var w=d(h,m,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:w.fileRecord,meta:{percent:0}})}else this.accumulate=!0},g.prototype.closedSource=function(h){this.accumulate=!1;var m=this.streamFiles&&!h.file.dir,w=d(h,m,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(w.dirRecord),m)this.push({data:y(h),meta:{percent:100}});else for(this.push({data:w.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},g.prototype.flush=function(){for(var h=this.bytesWritten,m=0;m<this.dirRecords.length;m++)this.push({data:this.dirRecords[m],meta:{percent:100}});var w=this.bytesWritten-h,A=b(this.dirRecords.length,w,h,this.zipComment,this.encodeFileName);this.push({data:A,meta:{percent:100}})},g.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},g.prototype.registerPrevious=function(h){this._sources.push(h);var m=this;return h.on("data",function(w){m.processChunk(w)}),h.on("end",function(){m.closedSource(m.previous.streamInfo),m._sources.length?m.prepareNextSource():m.end()}),h.on("error",function(w){m.error(w)}),this},g.prototype.resume=function(){if(!o.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0},g.prototype.error=function(h){var m=this._sources;if(!o.prototype.error.call(this,h))return!1;for(var w=0;w<m.length;w++)try{m[w].error(h)}catch{}return!0},g.prototype.lock=function(){o.prototype.lock.call(this);for(var h=this._sources,m=0;m<h.length;m++)h[m].lock()},r.exports=g},{"../crc32":14,"../signature":33,"../stream/GenericWorker":38,"../utf8":41,"../utils":42}],19:[function(e,r,i){var a=e("../compressions"),o=e("./ZipFileWorker"),s=function(l,c){var u=l||c,f=a[u];if(!f)throw new Error(u+" is not a valid compression method !");return f};i.generateWorker=function(l,c,u){var f=new o(c.streamFiles,u,c.platform,c.encodeFileName),p=0;try{l.forEach(function(d,b){p++;var y=s(b.options.compression,c.compression),g=b.options.compressionOptions||c.compressionOptions||{},h=b.dir,m=b.date;b._compressWorker(y,g).withStreamInfo("file",{name:d,dir:h,date:m,comment:b.comment||"",unixPermissions:b.unixPermissions,dosPermissions:b.dosPermissions}).pipe(f)}),f.entriesCount=p}catch(d){f.error(d)}return f}},{"../compressions":13,"./ZipFileWorker":18}],20:[function(e,r,i){function a(){if(!(this instanceof a))return new a;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var o=new a;for(var s in this)typeof this[s]!="function"&&(o[s]=this[s]);return o}}a.prototype=e("./object"),a.prototype.loadAsync=e("./load"),a.support=e("./support"),a.defaults=e("./defaults"),a.version="3.5.0",a.loadAsync=function(o,s){return new a().loadAsync(o,s)},a.external=e("./external"),r.exports=a},{"./defaults":15,"./external":16,"./load":21,"./object":25,"./support":40}],21:[function(e,r,i){var s=e("./utils"),a=e("./external"),o=e("./utf8"),s=e("./utils"),l=e("./zipEntries"),c=e("./stream/Crc32Probe"),u=e("./nodejsUtils");function f(p){return new a.Promise(function(d,b){var y=p.decompressed.getContentWorker().pipe(new c);y.on("error",function(g){b(g)}).on("end",function(){y.streamInfo.crc32!==p.decompressed.crc32?b(new Error("Corrupted zip : CRC32 mismatch")):d()}).resume()})}r.exports=function(p,d){var b=this;return d=s.extend(d||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),u.isNode&&u.isStream(p)?a.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",p,!0,d.optimizedBinaryString,d.base64).then(function(y){var g=new l(d);return g.load(y),g}).then(function(g){var h=[a.Promise.resolve(g)],m=g.files;if(d.checkCRC32)for(var w=0;w<m.length;w++)h.push(f(m[w]));return a.Promise.all(h)}).then(function(g){for(var h=g.shift(),m=h.files,w=0;w<m.length;w++){var A=m[w];b.file(A.fileNameStr,A.decompressed,{binary:!0,optimizedBinaryString:!0,date:A.date,dir:A.dir,comment:A.fileCommentStr.length?A.fileCommentStr:null,unixPermissions:A.unixPermissions,dosPermissions:A.dosPermissions,createFolders:d.createFolders})}return h.zipComment.length&&(b.comment=h.zipComment),b})}},{"./external":16,"./nodejsUtils":22,"./stream/Crc32Probe":35,"./utf8":41,"./utils":42,"./zipEntries":43}],22:[function(e,r,i){(function(a){r.exports={isNode:typeof a<"u",newBufferFrom:function(o,s){if(a.from&&a.from!==Uint8Array.from)return a.from(o,s);if(typeof o=="number")throw new Error('The "data" argument must not be a number');return new a(o,s)},allocBuffer:function(o){if(a.alloc)return a.alloc(o);var s=new a(o);return s.fill(0),s},isBuffer:function(o){return a.isBuffer(o)},isStream:function(o){return o&&typeof o.on=="function"&&typeof o.pause=="function"&&typeof o.resume=="function"}}}).call(this,e("buffer").Buffer)},{buffer:3}],23:[function(e,r,i){var a=e("../utils"),o=e("../stream/GenericWorker");function s(l,c){o.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}a.inherits(s,o),s.prototype._bindStream=function(l){var c=this;this._stream=l,l.pause(),l.on("data",function(u){c.push({data:u,meta:{percent:0}})}).on("error",function(u){c.isPaused?this.generatedError=u:c.error(u)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},s.prototype.pause=function(){return o.prototype.pause.call(this)?(this._stream.pause(),!0):!1},s.prototype.resume=function(){return o.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1},r.exports=s},{"../stream/GenericWorker":38,"../utils":42}],24:[function(e,r,i){var a=e("readable-stream").Readable,o=e("../utils");o.inherits(s,a);function s(l,c,u){a.call(this,c),this._helper=l;var f=this;l.on("data",function(p,d){f.push(p)||f._helper.pause(),u&&u(d)}).on("error",function(p){f.emit("error",p)}).on("end",function(){f.push(null)})}s.prototype._read=function(){this._helper.resume()},r.exports=s},{"../utils":42,"readable-stream":26}],25:[function(e,r,i){var a=e("./utf8"),o=e("./utils"),s=e("./stream/GenericWorker"),l=e("./stream/StreamHelper"),c=e("./defaults"),u=e("./compressedObject"),f=e("./zipObject"),p=e("./generate"),d=e("./nodejsUtils"),b=e("./nodejs/NodejsStreamInputAdapter"),y=function(v,T,N){var M=o.getTypeOf(T),P,O=o.extend(N||{},c);O.date=O.date||new Date,O.compression!==null&&(O.compression=O.compression.toUpperCase()),typeof O.unixPermissions=="string"&&(O.unixPermissions=parseInt(O.unixPermissions,8)),O.unixPermissions&&O.unixPermissions&16384&&(O.dir=!0),O.dosPermissions&&O.dosPermissions&16&&(O.dir=!0),O.dir&&(v=h(v)),O.createFolders&&(P=g(v))&&m.call(this,P,!0);var ne=M==="string"&&O.binary===!1&&O.base64===!1;(!N||typeof N.binary>"u")&&(O.binary=!ne);var R=T instanceof u&&T.uncompressedSize===0;(R||O.dir||!T||T.length===0)&&(O.base64=!1,O.binary=!0,T="",O.compression="STORE",M="string");var I=null;T instanceof u||T instanceof s?I=T:d.isNode&&d.isStream(T)?I=new b(v,T):I=o.prepareContent(v,T,O.binary,O.optimizedBinaryString,O.base64);var E=new f(v,I,O);this.files[v]=E},g=function(v){v.slice(-1)==="/"&&(v=v.substring(0,v.length-1));var T=v.lastIndexOf("/");return T>0?v.substring(0,T):""},h=function(v){return v.slice(-1)!=="/"&&(v+="/"),v},m=function(v,T){return T=typeof T<"u"?T:c.createFolders,v=h(v),this.files[v]||y.call(this,v,null,{dir:!0,createFolders:T}),this.files[v]};function w(v){return Object.prototype.toString.call(v)==="[object RegExp]"}var A={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(v){var T,N,M;for(T in this.files)this.files.hasOwnProperty(T)&&(M=this.files[T],N=T.slice(this.root.length,T.length),N&&T.slice(0,this.root.length)===this.root&&v(N,M))},filter:function(v){var T=[];return this.forEach(function(N,M){v(N,M)&&T.push(M)}),T},file:function(v,T,N){if(arguments.length===1)if(w(v)){var M=v;return this.filter(function(O,ne){return!ne.dir&&M.test(O)})}else{var P=this.files[this.root+v];return P&&!P.dir?P:null}else v=this.root+v,y.call(this,v,T,N);return this},folder:function(v){if(!v)return this;if(w(v))return this.filter(function(P,O){return O.dir&&v.test(P)});var T=this.root+v,N=m.call(this,T),M=this.clone();return M.root=N.name,M},remove:function(v){v=this.root+v;var T=this.files[v];if(T||(v.slice(-1)!=="/"&&(v+="/"),T=this.files[v]),T&&!T.dir)delete this.files[v];else for(var N=this.filter(function(P,O){return O.name.slice(0,v.length)===v}),M=0;M<N.length;M++)delete this.files[N[M].name];return this},generate:function(v){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(v){var T,N={};try{if(N=o.extend(v||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:a.utf8encode}),N.type=N.type.toLowerCase(),N.compression=N.compression.toUpperCase(),N.type==="binarystring"&&(N.type="string"),!N.type)throw new Error("No output type specified.");o.checkSupport(N.type),(N.platform==="darwin"||N.platform==="freebsd"||N.platform==="linux"||N.platform==="sunos")&&(N.platform="UNIX"),N.platform==="win32"&&(N.platform="DOS");var M=N.comment||this.comment||"";T=p.generateWorker(this,N,M)}catch(P){T=new s("error"),T.error(P)}return new l(T,N.type||"string",N.mimeType)},generateAsync:function(v,T){return this.generateInternalStream(v).accumulate(T)},generateNodeStream:function(v,T){return v=v||{},v.type||(v.type="nodebuffer"),this.generateInternalStream(v).toNodejsStream(T)}};r.exports=A},{"./compressedObject":12,"./defaults":15,"./generate":19,"./nodejs/NodejsStreamInputAdapter":23,"./nodejsUtils":22,"./stream/GenericWorker":38,"./stream/StreamHelper":39,"./utf8":41,"./utils":42,"./zipObject":45}],26:[function(e,r,i){r.exports=e("stream")},{stream:80}],27:[function(e,r,i){var a=e("./DataReader"),o=e("../utils");function s(l){a.call(this,l);for(var c=0;c<this.data.length;c++)l[c]=l[c]&255}o.inherits(s,a),s.prototype.byteAt=function(l){return this.data[this.zero+l]},s.prototype.lastIndexOfSignature=function(l){for(var c=l.charCodeAt(0),u=l.charCodeAt(1),f=l.charCodeAt(2),p=l.charCodeAt(3),d=this.length-4;d>=0;--d)if(this.data[d]===c&&this.data[d+1]===u&&this.data[d+2]===f&&this.data[d+3]===p)return d-this.zero;return-1},s.prototype.readAndCheckSignature=function(l){var c=l.charCodeAt(0),u=l.charCodeAt(1),f=l.charCodeAt(2),p=l.charCodeAt(3),d=this.readData(4);return c===d[0]&&u===d[1]&&f===d[2]&&p===d[3]},s.prototype.readData=function(l){if(this.checkOffset(l),l===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},r.exports=s},{"../utils":42,"./DataReader":28}],28:[function(e,r,i){var a=e("../utils");function o(s){this.data=s,this.length=s.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(s){this.checkIndex(this.index+s)},checkIndex:function(s){if(this.length<this.zero+s||s<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+s+"). Corrupted zip ?")},setIndex:function(s){this.checkIndex(s),this.index=s},skip:function(s){this.setIndex(this.index+s)},byteAt:function(s){},readInt:function(s){var l=0,c;for(this.checkOffset(s),c=this.index+s-1;c>=this.index;c--)l=(l<<8)+this.byteAt(c);return this.index+=s,l},readString:function(s){return a.transformTo("string",this.readData(s))},readData:function(s){},lastIndexOfSignature:function(s){},readAndCheckSignature:function(s){},readDate:function(){var s=this.readInt(4);return new Date(Date.UTC((s>>25&127)+1980,(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(s&31)<<1))}},r.exports=o},{"../utils":42}],29:[function(e,r,i){var a=e("./Uint8ArrayReader"),o=e("../utils");function s(l){a.call(this,l)}o.inherits(s,a),s.prototype.readData=function(l){this.checkOffset(l);var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},r.exports=s},{"../utils":42,"./Uint8ArrayReader":31}],30:[function(e,r,i){var a=e("./DataReader"),o=e("../utils");function s(l){a.call(this,l)}o.inherits(s,a),s.prototype.byteAt=function(l){return this.data.charCodeAt(this.zero+l)},s.prototype.lastIndexOfSignature=function(l){return this.data.lastIndexOf(l)-this.zero},s.prototype.readAndCheckSignature=function(l){var c=this.readData(4);return l===c},s.prototype.readData=function(l){this.checkOffset(l);var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},r.exports=s},{"../utils":42,"./DataReader":28}],31:[function(e,r,i){var a=e("./ArrayReader"),o=e("../utils");function s(l){a.call(this,l)}o.inherits(s,a),s.prototype.readData=function(l){if(this.checkOffset(l),l===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},r.exports=s},{"../utils":42,"./ArrayReader":27}],32:[function(e,r,i){var a=e("../utils"),o=e("../support"),s=e("./ArrayReader"),l=e("./StringReader"),c=e("./NodeBufferReader"),u=e("./Uint8ArrayReader");r.exports=function(f){var p=a.getTypeOf(f);return a.checkSupport(p),p==="string"&&!o.uint8array?new l(f):p==="nodebuffer"?new c(f):o.uint8array?new u(a.transformTo("uint8array",f)):new s(a.transformTo("array",f))}},{"../support":40,"../utils":42,"./ArrayReader":27,"./NodeBufferReader":29,"./StringReader":30,"./Uint8ArrayReader":31}],33:[function(e,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],34:[function(e,r,i){var a=e("./GenericWorker"),o=e("../utils");function s(l){a.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(s,a),s.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},r.exports=s},{"../utils":42,"./GenericWorker":38}],35:[function(e,r,i){var a=e("./GenericWorker"),o=e("../crc32"),s=e("../utils");function l(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}s.inherits(l,a),l.prototype.processChunk=function(c){this.streamInfo.crc32=o(c.data,this.streamInfo.crc32||0),this.push(c)},r.exports=l},{"../crc32":14,"../utils":42,"./GenericWorker":38}],36:[function(e,r,i){var a=e("../utils"),o=e("./GenericWorker");function s(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}a.inherits(s,o),s.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}o.prototype.processChunk.call(this,l)},r.exports=s},{"../utils":42,"./GenericWorker":38}],37:[function(e,r,i){var a=e("../utils"),o=e("./GenericWorker"),s=16*1024;function l(c){o.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(f){u.dataIsReady=!0,u.data=f,u.max=f&&f.length||0,u.type=a.getTypeOf(f),u.isPaused||u._tickAndRepeat()},function(f){u.error(f)})}a.inherits(l,o),l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},l.prototype.resume=function(){return o.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0):!1},l.prototype._tickAndRepeat=function(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},l.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=s,u=null,f=Math.min(this.max,this.index+c);if(this.index>=this.max)return this.end();switch(this.type){case"string":u=this.data.substring(this.index,f);break;case"uint8array":u=this.data.subarray(this.index,f);break;case"array":case"nodebuffer":u=this.data.slice(this.index,f);break}return this.index=f,this.push({data:u,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=l},{"../utils":42,"./GenericWorker":38}],38:[function(e,r,i){function a(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}a.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return this.isFinished?!1:(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,s){return this._listeners[o].push(s),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,s){if(this._listeners[o])for(var l=0;l<this._listeners[o].length;l++)this._listeners[o][l].call(this,s)},pipe:function(o){return o.registerPrevious(this)},registerPrevious:function(o){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=o.streamInfo,this.mergeStreamInfo(),this.previous=o;var s=this;return o.on("data",function(l){s.processChunk(l)}),o.on("end",function(){s.end()}),o.on("error",function(l){s.error(l)}),this},pause:function(){return this.isPaused||this.isFinished?!1:(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var o=!1;return this.generatedError&&(this.error(this.generatedError),o=!0),this.previous&&this.previous.resume(),!o},flush:function(){},processChunk:function(o){this.push(o)},withStreamInfo:function(o,s){return this.extraStreamInfo[o]=s,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var o in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(o)&&(this.streamInfo[o]=this.extraStreamInfo[o])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var o="Worker "+this.name;return this.previous?this.previous+" -> "+o:o}},r.exports=a},{}],39:[function(e,r,i){(function(a){var o=e("../utils"),s=e("./ConvertWorker"),l=e("./GenericWorker"),c=e("../base64"),u=e("../support"),f=e("../external"),p=null;if(u.nodestream)try{p=e("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(h,m,w){switch(h){case"blob":return o.newBlob(o.transformTo("arraybuffer",m),w);case"base64":return c.encode(m);default:return o.transformTo(h,m)}}function b(h,m){var w,A=0,v=null,T=0;for(w=0;w<m.length;w++)T+=m[w].length;switch(h){case"string":return m.join("");case"array":return Array.prototype.concat.apply([],m);case"uint8array":for(v=new Uint8Array(T),w=0;w<m.length;w++)v.set(m[w],A),A+=m[w].length;return v;case"nodebuffer":return a.concat(m);default:throw new Error("concat : unsupported type '"+h+"'")}}function y(h,m){return new f.Promise(function(w,A){var v=[],T=h._internalType,N=h._outputType,M=h._mimeType;h.on("data",function(P,O){v.push(P),m&&m(O)}).on("error",function(P){v=[],A(P)}).on("end",function(){try{var P=d(N,b(T,v),M);w(P)}catch(O){A(O)}v=[]}).resume()})}function g(h,m,w){var A=m;switch(m){case"blob":case"arraybuffer":A="uint8array";break;case"base64":A="string";break}try{this._internalType=A,this._outputType=m,this._mimeType=w,o.checkSupport(A),this._worker=h.pipe(new s(A)),h.lock()}catch(v){this._worker=new l("error"),this._worker.error(v)}}g.prototype={accumulate:function(h){return y(this,h)},on:function(h,m){var w=this;return h==="data"?this._worker.on(h,function(A){m.call(w,A.data,A.meta)}):this._worker.on(h,function(){o.delay(m,arguments,w)}),this},resume:function(){return o.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(h){if(o.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new p(this,{objectMode:this._outputType!=="nodebuffer"},h)}},r.exports=g}).call(this,e("buffer").Buffer)},{"../base64":11,"../external":16,"../nodejs/NodejsStreamOutputAdapter":24,"../support":40,"../utils":42,"./ConvertWorker":34,"./GenericWorker":38,buffer:3}],40:[function(e,r,i){(function(a){if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",i.nodebuffer=typeof a<"u",i.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")i.blob=!1;else{var o=new ArrayBuffer(0);try{i.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var s=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,l=new s;l.append(o),i.blob=l.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!e("readable-stream").Readable}catch{i.nodestream=!1}}).call(this,e("buffer").Buffer)},{buffer:3,"readable-stream":26}],41:[function(e,r,i){for(var a=e("./utils"),o=e("./support"),s=e("./nodejsUtils"),l=e("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;c[254]=c[254]=1;var f=function(g){var h,m,w,A,v,T=g.length,N=0;for(A=0;A<T;A++)m=g.charCodeAt(A),(m&64512)===55296&&A+1<T&&(w=g.charCodeAt(A+1),(w&64512)===56320&&(m=65536+(m-55296<<10)+(w-56320),A++)),N+=m<128?1:m<2048?2:m<65536?3:4;for(o.uint8array?h=new Uint8Array(N):h=new Array(N),v=0,A=0;v<N;A++)m=g.charCodeAt(A),(m&64512)===55296&&A+1<T&&(w=g.charCodeAt(A+1),(w&64512)===56320&&(m=65536+(m-55296<<10)+(w-56320),A++)),m<128?h[v++]=m:m<2048?(h[v++]=192|m>>>6,h[v++]=128|m&63):m<65536?(h[v++]=224|m>>>12,h[v++]=128|m>>>6&63,h[v++]=128|m&63):(h[v++]=240|m>>>18,h[v++]=128|m>>>12&63,h[v++]=128|m>>>6&63,h[v++]=128|m&63);return h},p=function(g,h){var m;for(h=h||g.length,h>g.length&&(h=g.length),m=h-1;m>=0&&(g[m]&192)===128;)m--;return m<0||m===0?h:m+c[g[m]]>h?m:h},d=function(g){var h,m,w,A,v=g.length,T=new Array(v*2);for(m=0,h=0;h<v;){if(w=g[h++],w<128){T[m++]=w;continue}if(A=c[w],A>4){T[m++]=65533,h+=A-1;continue}for(w&=A===2?31:A===3?15:7;A>1&&h<v;)w=w<<6|g[h++]&63,A--;if(A>1){T[m++]=65533;continue}w<65536?T[m++]=w:(w-=65536,T[m++]=55296|w>>10&1023,T[m++]=56320|w&1023)}return T.length!==m&&(T.subarray?T=T.subarray(0,m):T.length=m),a.applyFromCharCode(T)};i.utf8encode=function(h){return o.nodebuffer?s.newBufferFrom(h,"utf-8"):f(h)},i.utf8decode=function(h){return o.nodebuffer?a.transformTo("nodebuffer",h).toString("utf-8"):(h=a.transformTo(o.uint8array?"uint8array":"array",h),d(h))};function b(){l.call(this,"utf-8 decode"),this.leftOver=null}a.inherits(b,l),b.prototype.processChunk=function(g){var h=a.transformTo(o.uint8array?"uint8array":"array",g.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var m=h;h=new Uint8Array(m.length+this.leftOver.length),h.set(this.leftOver,0),h.set(m,this.leftOver.length)}else h=this.leftOver.concat(h);this.leftOver=null}var w=p(h),A=h;w!==h.length&&(o.uint8array?(A=h.subarray(0,w),this.leftOver=h.subarray(w,h.length)):(A=h.slice(0,w),this.leftOver=h.slice(w,h.length))),this.push({data:i.utf8decode(A),meta:g.meta})},b.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=b;function y(){l.call(this,"utf-8 encode")}a.inherits(y,l),y.prototype.processChunk=function(g){this.push({data:i.utf8encode(g.data),meta:g.meta})},i.Utf8EncodeWorker=y},{"./nodejsUtils":22,"./stream/GenericWorker":38,"./support":40,"./utils":42}],42:[function(e,r,i){var a=e("./support"),o=e("./base64"),s=e("./nodejsUtils"),l=e("set-immediate-shim"),c=e("./external");function u(h){var m=null;return a.uint8array?m=new Uint8Array(h.length):m=new Array(h.length),p(h,m)}i.newBlob=function(h,m){i.checkSupport("blob");try{return new Blob([h],{type:m})}catch{try{var w=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,A=new w;return A.append(h),A.getBlob(m)}catch{throw new Error("Bug : can't construct the Blob.")}}};function f(h){return h}function p(h,m){for(var w=0;w<h.length;++w)m[w]=h.charCodeAt(w)&255;return m}var d={stringifyByChunk:function(h,m,w){var A=[],v=0,T=h.length;if(T<=w)return String.fromCharCode.apply(null,h);for(;v<T;)m==="array"||m==="nodebuffer"?A.push(String.fromCharCode.apply(null,h.slice(v,Math.min(v+w,T)))):A.push(String.fromCharCode.apply(null,h.subarray(v,Math.min(v+w,T)))),v+=w;return A.join("")},stringifyByChar:function(h){for(var m="",w=0;w<h.length;w++)m+=String.fromCharCode(h[w]);return m},applyCanBeUsed:{uint8array:function(){try{return a.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return a.nodebuffer&&String.fromCharCode.apply(null,s.allocBuffer(1)).length===1}catch{return!1}}()}};function b(h){var m=65536,w=i.getTypeOf(h),A=!0;if(w==="uint8array"?A=d.applyCanBeUsed.uint8array:w==="nodebuffer"&&(A=d.applyCanBeUsed.nodebuffer),A)for(;m>1;)try{return d.stringifyByChunk(h,w,m)}catch{m=Math.floor(m/2)}return d.stringifyByChar(h)}i.applyFromCharCode=b;function y(h,m){for(var w=0;w<h.length;w++)m[w]=h[w];return m}var g={};g.string={string:f,array:function(h){return p(h,new Array(h.length))},arraybuffer:function(h){return g.string.uint8array(h).buffer},uint8array:function(h){return p(h,new Uint8Array(h.length))},nodebuffer:function(h){return p(h,s.allocBuffer(h.length))}},g.array={string:b,array:f,arraybuffer:function(h){return new Uint8Array(h).buffer},uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return s.newBufferFrom(h)}},g.arraybuffer={string:function(h){return b(new Uint8Array(h))},array:function(h){return y(new Uint8Array(h),new Array(h.byteLength))},arraybuffer:f,uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return s.newBufferFrom(new Uint8Array(h))}},g.uint8array={string:b,array:function(h){return y(h,new Array(h.length))},arraybuffer:function(h){return h.buffer},uint8array:f,nodebuffer:function(h){return s.newBufferFrom(h)}},g.nodebuffer={string:b,array:function(h){return y(h,new Array(h.length))},arraybuffer:function(h){return g.nodebuffer.uint8array(h).buffer},uint8array:function(h){return y(h,new Uint8Array(h.length))},nodebuffer:f},i.transformTo=function(h,m){if(m||(m=""),!h)return m;i.checkSupport(h);var w=i.getTypeOf(m),A=g[w][h](m);return A},i.getTypeOf=function(h){if(typeof h=="string")return"string";if(Object.prototype.toString.call(h)==="[object Array]")return"array";if(a.nodebuffer&&s.isBuffer(h))return"nodebuffer";if(a.uint8array&&h instanceof Uint8Array)return"uint8array";if(a.arraybuffer&&h instanceof ArrayBuffer)return"arraybuffer"},i.checkSupport=function(h){var m=a[h.toLowerCase()];if(!m)throw new Error(h+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(h){var m="",w,A;for(A=0;A<(h||"").length;A++)w=h.charCodeAt(A),m+="\\x"+(w<16?"0":"")+w.toString(16).toUpperCase();return m},i.delay=function(h,m,w){l(function(){h.apply(w||null,m||[])})},i.inherits=function(h,m){var w=function(){};w.prototype=m.prototype,h.prototype=new w},i.extend=function(){var h={},m,w;for(m=0;m<arguments.length;m++)for(w in arguments[m])arguments[m].hasOwnProperty(w)&&typeof h[w]>"u"&&(h[w]=arguments[m][w]);return h},i.prepareContent=function(h,m,w,A,v){var T=c.Promise.resolve(m).then(function(N){var M=a.blob&&(N instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(N))!==-1);return M&&typeof FileReader<"u"?new c.Promise(function(P,O){var ne=new FileReader;ne.onload=function(R){P(R.target.result)},ne.onerror=function(R){O(R.target.error)},ne.readAsArrayBuffer(N)}):N});return T.then(function(N){var M=i.getTypeOf(N);return M?(M==="arraybuffer"?N=i.transformTo("uint8array",N):M==="string"&&(v?N=o.decode(N):w&&A!==!0&&(N=u(N))),N):c.Promise.reject(new Error("Can't read the data of '"+h+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":11,"./external":16,"./nodejsUtils":22,"./support":40,"set-immediate-shim":79}],43:[function(e,r,i){var a=e("./reader/readerFor"),o=e("./utils"),s=e("./signature"),l=e("./zipEntry");e("./utf8");var c=e("./support");function u(f){this.files=[],this.loadOptions=f}u.prototype={checkSignature:function(f){if(!this.reader.readAndCheckSignature(f)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(p)+", expected "+o.pretty(f)+")")}},isSignature:function(f,p){var d=this.reader.index;this.reader.setIndex(f);var b=this.reader.readString(4),y=b===p;return this.reader.setIndex(d),y},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var f=this.reader.readData(this.zipCommentLength),p=c.uint8array?"uint8array":"array",d=o.transformTo(p,f);this.zipComment=this.loadOptions.decodeFileName(d)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var f=this.zip64EndOfCentralSize-44,p=0,d,b,y;p<f;)d=this.reader.readInt(2),b=this.reader.readInt(4),y=this.reader.readData(b),this.zip64ExtensibleData[d]={id:d,length:b,value:y}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var f,p;for(f=0;f<this.files.length;f++)p=this.files[f],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var f;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)f=new l({zip64:this.zip64},this.loadOptions),f.readCentralPart(this.reader),this.files.push(f);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var f=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(f<0){var p=!this.isSignature(0,s.LOCAL_FILE_HEADER);throw p?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex(f);var d=f;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,f=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),f<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(f),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var b=this.centralDirOffset+this.centralDirSize;this.zip64&&(b+=20,b+=12+this.zip64EndOfCentralSize);var y=d-b;if(y>0)this.isSignature(d,s.CENTRAL_FILE_HEADER)||(this.reader.zero=y);else if(y<0)throw new Error("Corrupted zip: missing "+Math.abs(y)+" bytes.")},prepareReader:function(f){this.reader=a(f)},load:function(f){this.prepareReader(f),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=u},{"./reader/readerFor":32,"./signature":33,"./support":40,"./utf8":41,"./utils":42,"./zipEntry":44}],44:[function(e,r,i){var a=e("./reader/readerFor"),o=e("./utils"),s=e("./compressedObject"),l=e("./crc32"),c=e("./utf8"),u=e("./compressions"),f=e("./support"),p=0,d=3,b=function(g){for(var h in u)if(u.hasOwnProperty(h)&&u[h].magic===g)return u[h];return null};function y(g,h){this.options=g,this.loadOptions=h}y.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function(g){var h,m;if(g.skip(22),this.fileNameLength=g.readInt(2),m=g.readInt(2),this.fileName=g.readData(this.fileNameLength),g.skip(m),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(h=b(this.compressionMethod),h===null)throw new Error("Corrupted zip : compression "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,h,g.readData(this.compressedSize))},readCentralPart:function(g){this.versionMadeBy=g.readInt(2),g.skip(2),this.bitFlag=g.readInt(2),this.compressionMethod=g.readString(2),this.date=g.readDate(),this.crc32=g.readInt(4),this.compressedSize=g.readInt(4),this.uncompressedSize=g.readInt(4);var h=g.readInt(2);if(this.extraFieldsLength=g.readInt(2),this.fileCommentLength=g.readInt(2),this.diskNumberStart=g.readInt(2),this.internalFileAttributes=g.readInt(2),this.externalFileAttributes=g.readInt(4),this.localHeaderOffset=g.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");g.skip(h),this.readExtraFields(g),this.parseZIP64ExtraField(g),this.fileComment=g.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var g=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),g===p&&(this.dosPermissions=this.externalFileAttributes&63),g===d&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(g){if(this.extraFields[1]){var h=a(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(g){var h=g.index+this.extraFieldsLength,m,w,A;for(this.extraFields||(this.extraFields={});g.index+4<h;)m=g.readInt(2),w=g.readInt(2),A=g.readData(w),this.extraFields[m]={id:m,length:w,value:A};g.setIndex(h)},handleUTF8:function(){var g=f.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var h=this.findExtraFieldUnicodePath();if(h!==null)this.fileNameStr=h;else{var m=o.transformTo(g,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var w=this.findExtraFieldUnicodeComment();if(w!==null)this.fileCommentStr=w;else{var A=o.transformTo(g,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(A)}}},findExtraFieldUnicodePath:function(){var g=this.extraFields[28789];if(g){var h=a(g.value);return h.readInt(1)!==1||l(this.fileName)!==h.readInt(4)?null:c.utf8decode(h.readData(g.length-5))}return null},findExtraFieldUnicodeComment:function(){var g=this.extraFields[25461];if(g){var h=a(g.value);return h.readInt(1)!==1||l(this.fileComment)!==h.readInt(4)?null:c.utf8decode(h.readData(g.length-5))}return null}},r.exports=y},{"./compressedObject":12,"./compressions":13,"./crc32":14,"./reader/readerFor":32,"./support":40,"./utf8":41,"./utils":42}],45:[function(e,r,i){var a=e("./stream/StreamHelper"),o=e("./stream/DataWorker"),s=e("./utf8"),l=e("./compressedObject"),c=e("./stream/GenericWorker"),u=function(b,y,g){this.name=b,this.dir=g.dir,this.date=g.date,this.comment=g.comment,this.unixPermissions=g.unixPermissions,this.dosPermissions=g.dosPermissions,this._data=y,this._dataBinary=g.binary,this.options={compression:g.compression,compressionOptions:g.compressionOptions}};u.prototype={internalStream:function(b){var y=null,g="string";try{if(!b)throw new Error("No output type specified.");g=b.toLowerCase();var h=g==="string"||g==="text";(g==="binarystring"||g==="text")&&(g="string"),y=this._decompressWorker();var m=!this._dataBinary;m&&!h&&(y=y.pipe(new s.Utf8EncodeWorker)),!m&&h&&(y=y.pipe(new s.Utf8DecodeWorker))}catch(w){y=new c("error"),y.error(w)}return new a(y,g,"")},async:function(b,y){return this.internalStream(b).accumulate(y)},nodeStream:function(b,y){return this.internalStream(b||"nodebuffer").toNodejsStream(y)},_compressWorker:function(b,y){if(this._data instanceof l&&this._data.compression.magic===b.magic)return this._data.getCompressedWorker();var g=this._decompressWorker();return this._dataBinary||(g=g.pipe(new s.Utf8EncodeWorker)),l.createWorkerFrom(g,b,y)},_decompressWorker:function(){return this._data instanceof l?this._data.getContentWorker():this._data instanceof c?this._data:new o(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},d=0;d<f.length;d++)u.prototype[f[d]]=p;r.exports=u},{"./compressedObject":12,"./stream/DataWorker":37,"./stream/GenericWorker":38,"./stream/StreamHelper":39,"./utf8":41}],46:[function(e,r,i){var a=e("immediate");function o(){}var s={},l=["REJECTED"],c=["FULFILLED"],u=["PENDING"];r.exports=f;function f(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,v!==o&&y(this,v)}f.prototype.finally=function(v){if(typeof v!="function")return this;var T=this.constructor;return this.then(N,M);function N(P){function O(){return P}return T.resolve(v()).then(O)}function M(P){function O(){throw P}return T.resolve(v()).then(O)}},f.prototype.catch=function(v){return this.then(null,v)},f.prototype.then=function(v,T){if(typeof v!="function"&&this.state===c||typeof T!="function"&&this.state===l)return this;var N=new this.constructor(o);if(this.state!==u){var M=this.state===c?v:T;d(N,M,this.outcome)}else this.queue.push(new p(N,v,T));return N};function p(v,T,N){this.promise=v,typeof T=="function"&&(this.onFulfilled=T,this.callFulfilled=this.otherCallFulfilled),typeof N=="function"&&(this.onRejected=N,this.callRejected=this.otherCallRejected)}p.prototype.callFulfilled=function(v){s.resolve(this.promise,v)},p.prototype.otherCallFulfilled=function(v){d(this.promise,this.onFulfilled,v)},p.prototype.callRejected=function(v){s.reject(this.promise,v)},p.prototype.otherCallRejected=function(v){d(this.promise,this.onRejected,v)};function d(v,T,N){a(function(){var M;try{M=T(N)}catch(P){return s.reject(v,P)}M===v?s.reject(v,new TypeError("Cannot resolve promise with itself")):s.resolve(v,M)})}s.resolve=function(v,T){var N=g(b,T);if(N.status==="error")return s.reject(v,N.value);var M=N.value;if(M)y(v,M);else{v.state=c,v.outcome=T;for(var P=-1,O=v.queue.length;++P<O;)v.queue[P].callFulfilled(T)}return v},s.reject=function(v,T){v.state=l,v.outcome=T;for(var N=-1,M=v.queue.length;++N<M;)v.queue[N].callRejected(T);return v};function b(v){var T=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof T=="function")return function(){T.apply(v,arguments)}}function y(v,T){var N=!1;function M(R){N||(N=!0,s.reject(v,R))}function P(R){N||(N=!0,s.resolve(v,R))}function O(){T(P,M)}var ne=g(O);ne.status==="error"&&M(ne.value)}function g(v,T){var N={};try{N.value=v(T),N.status="success"}catch(M){N.status="error",N.value=M}return N}f.resolve=h;function h(v){return v instanceof this?v:s.resolve(new this(o),v)}f.reject=m;function m(v){var T=new this(o);return s.reject(T,v)}f.all=w;function w(v){var T=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var N=v.length,M=!1;if(!N)return this.resolve([]);for(var P=new Array(N),O=0,ne=-1,R=new this(o);++ne<N;)I(v[ne],ne);return R;function I(E,U){T.resolve(E).then(Z,function($){M||(M=!0,s.reject(R,$))});function Z($){P[U]=$,++O===N&&!M&&(M=!0,s.resolve(R,P))}}}f.race=A;function A(v){var T=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var N=v.length,M=!1;if(!N)return this.resolve([]);for(var P=-1,O=new this(o);++P<N;)ne(v[P]);return O;function ne(R){T.resolve(R).then(function(I){M||(M=!0,s.resolve(O,I))},function(I){M||(M=!0,s.reject(O,I))})}}},{immediate:7}],47:[function(e,r,i){var a=e("./lib/utils/common").assign,o=e("./lib/deflate"),s=e("./lib/inflate"),l=e("./lib/zlib/constants"),c={};a(c,o,s,l),r.exports=c},{"./lib/deflate":48,"./lib/inflate":49,"./lib/utils/common":50,"./lib/zlib/constants":53}],48:[function(e,r,i){var a=e("./zlib/deflate"),o=e("./utils/common"),s=e("./utils/strings"),l=e("./zlib/messages"),c=e("./zlib/zstream"),u=Object.prototype.toString,f=0,p=4,d=0,b=1,y=2,g=-1,h=0,m=8;function w(N){if(!(this instanceof w))return new w(N);this.options=o.assign({level:g,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},N||{});var M=this.options;M.raw&&M.windowBits>0?M.windowBits=-M.windowBits:M.gzip&&M.windowBits>0&&M.windowBits<16&&(M.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var P=a.deflateInit2(this.strm,M.level,M.method,M.windowBits,M.memLevel,M.strategy);if(P!==d)throw new Error(l[P]);if(M.header&&a.deflateSetHeader(this.strm,M.header),M.dictionary){var O;if(typeof M.dictionary=="string"?O=s.string2buf(M.dictionary):u.call(M.dictionary)==="[object ArrayBuffer]"?O=new Uint8Array(M.dictionary):O=M.dictionary,P=a.deflateSetDictionary(this.strm,O),P!==d)throw new Error(l[P]);this._dict_set=!0}}w.prototype.push=function(N,M){var P=this.strm,O=this.options.chunkSize,ne,R;if(this.ended)return!1;R=M===~~M?M:M===!0?p:f,typeof N=="string"?P.input=s.string2buf(N):u.call(N)==="[object ArrayBuffer]"?P.input=new Uint8Array(N):P.input=N,P.next_in=0,P.avail_in=P.input.length;do{if(P.avail_out===0&&(P.output=new o.Buf8(O),P.next_out=0,P.avail_out=O),ne=a.deflate(P,R),ne!==b&&ne!==d)return this.onEnd(ne),this.ended=!0,!1;(P.avail_out===0||P.avail_in===0&&(R===p||R===y))&&(this.options.to==="string"?this.onData(s.buf2binstring(o.shrinkBuf(P.output,P.next_out))):this.onData(o.shrinkBuf(P.output,P.next_out)))}while((P.avail_in>0||P.avail_out===0)&&ne!==b);return R===p?(ne=a.deflateEnd(this.strm),this.onEnd(ne),this.ended=!0,ne===d):(R===y&&(this.onEnd(d),P.avail_out=0),!0)},w.prototype.onData=function(N){this.chunks.push(N)},w.prototype.onEnd=function(N){N===d&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=N,this.msg=this.strm.msg};function A(N,M){var P=new w(M);if(P.push(N,!0),P.err)throw P.msg||l[P.err];return P.result}function v(N,M){return M=M||{},M.raw=!0,A(N,M)}function T(N,M){return M=M||{},M.gzip=!0,A(N,M)}i.Deflate=w,i.deflate=A,i.deflateRaw=v,i.gzip=T},{"./utils/common":50,"./utils/strings":51,"./zlib/deflate":55,"./zlib/messages":60,"./zlib/zstream":62}],49:[function(e,r,i){var a=e("./zlib/inflate"),o=e("./utils/common"),s=e("./utils/strings"),l=e("./zlib/constants"),c=e("./zlib/messages"),u=e("./zlib/zstream"),f=e("./zlib/gzheader"),p=Object.prototype.toString;function d(g){if(!(this instanceof d))return new d(g);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},g||{});var h=this.options;h.raw&&h.windowBits>=0&&h.windowBits<16&&(h.windowBits=-h.windowBits,h.windowBits===0&&(h.windowBits=-15)),h.windowBits>=0&&h.windowBits<16&&!(g&&g.windowBits)&&(h.windowBits+=32),h.windowBits>15&&h.windowBits<48&&(h.windowBits&15||(h.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var m=a.inflateInit2(this.strm,h.windowBits);if(m!==l.Z_OK)throw new Error(c[m]);if(this.header=new f,a.inflateGetHeader(this.strm,this.header),h.dictionary&&(typeof h.dictionary=="string"?h.dictionary=s.string2buf(h.dictionary):p.call(h.dictionary)==="[object ArrayBuffer]"&&(h.dictionary=new Uint8Array(h.dictionary)),h.raw&&(m=a.inflateSetDictionary(this.strm,h.dictionary),m!==l.Z_OK)))throw new Error(c[m])}d.prototype.push=function(g,h){var m=this.strm,w=this.options.chunkSize,A=this.options.dictionary,v,T,N,M,P,O=!1;if(this.ended)return!1;T=h===~~h?h:h===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof g=="string"?m.input=s.binstring2buf(g):p.call(g)==="[object ArrayBuffer]"?m.input=new Uint8Array(g):m.input=g,m.next_in=0,m.avail_in=m.input.length;do{if(m.avail_out===0&&(m.output=new o.Buf8(w),m.next_out=0,m.avail_out=w),v=a.inflate(m,l.Z_NO_FLUSH),v===l.Z_NEED_DICT&&A&&(v=a.inflateSetDictionary(this.strm,A)),v===l.Z_BUF_ERROR&&O===!0&&(v=l.Z_OK,O=!1),v!==l.Z_STREAM_END&&v!==l.Z_OK)return this.onEnd(v),this.ended=!0,!1;m.next_out&&(m.avail_out===0||v===l.Z_STREAM_END||m.avail_in===0&&(T===l.Z_FINISH||T===l.Z_SYNC_FLUSH))&&(this.options.to==="string"?(N=s.utf8border(m.output,m.next_out),M=m.next_out-N,P=s.buf2string(m.output,N),m.next_out=M,m.avail_out=w-M,M&&o.arraySet(m.output,m.output,N,M,0),this.onData(P)):this.onData(o.shrinkBuf(m.output,m.next_out))),m.avail_in===0&&m.avail_out===0&&(O=!0)}while((m.avail_in>0||m.avail_out===0)&&v!==l.Z_STREAM_END);return v===l.Z_STREAM_END&&(T=l.Z_FINISH),T===l.Z_FINISH?(v=a.inflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===l.Z_OK):(T===l.Z_SYNC_FLUSH&&(this.onEnd(l.Z_OK),m.avail_out=0),!0)},d.prototype.onData=function(g){this.chunks.push(g)},d.prototype.onEnd=function(g){g===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=g,this.msg=this.strm.msg};function b(g,h){var m=new d(h);if(m.push(g,!0),m.err)throw m.msg||c[m.err];return m.result}function y(g,h){return h=h||{},h.raw=!0,b(g,h)}i.Inflate=d,i.inflate=b,i.inflateRaw=y,i.ungzip=b},{"./utils/common":50,"./utils/strings":51,"./zlib/constants":53,"./zlib/gzheader":56,"./zlib/inflate":58,"./zlib/messages":60,"./zlib/zstream":62}],50:[function(e,r,i){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function o(c,u){return Object.prototype.hasOwnProperty.call(c,u)}i.assign=function(c){for(var u=Array.prototype.slice.call(arguments,1);u.length;){var f=u.shift();if(f){if(typeof f!="object")throw new TypeError(f+"must be non-object");for(var p in f)o(f,p)&&(c[p]=f[p])}}return c},i.shrinkBuf=function(c,u){return c.length===u?c:c.subarray?c.subarray(0,u):(c.length=u,c)};var s={arraySet:function(c,u,f,p,d){if(u.subarray&&c.subarray){c.set(u.subarray(f,f+p),d);return}for(var b=0;b<p;b++)c[d+b]=u[f+b]},flattenChunks:function(c){var u,f,p,d,b,y;for(p=0,u=0,f=c.length;u<f;u++)p+=c[u].length;for(y=new Uint8Array(p),d=0,u=0,f=c.length;u<f;u++)b=c[u],y.set(b,d),d+=b.length;return y}},l={arraySet:function(c,u,f,p,d){for(var b=0;b<p;b++)c[d+b]=u[f+b]},flattenChunks:function(c){return[].concat.apply([],c)}};i.setTyped=function(c){c?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,s)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,l))},i.setTyped(a)},{}],51:[function(e,r,i){var a=e("./common"),o=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch{o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{s=!1}for(var l=new a.Buf8(256),c=0;c<256;c++)l[c]=c>=252?6:c>=248?5:c>=240?4:c>=224?3:c>=192?2:1;l[254]=l[254]=1,i.string2buf=function(f){var p,d,b,y,g,h=f.length,m=0;for(y=0;y<h;y++)d=f.charCodeAt(y),(d&64512)===55296&&y+1<h&&(b=f.charCodeAt(y+1),(b&64512)===56320&&(d=65536+(d-55296<<10)+(b-56320),y++)),m+=d<128?1:d<2048?2:d<65536?3:4;for(p=new a.Buf8(m),g=0,y=0;g<m;y++)d=f.charCodeAt(y),(d&64512)===55296&&y+1<h&&(b=f.charCodeAt(y+1),(b&64512)===56320&&(d=65536+(d-55296<<10)+(b-56320),y++)),d<128?p[g++]=d:d<2048?(p[g++]=192|d>>>6,p[g++]=128|d&63):d<65536?(p[g++]=224|d>>>12,p[g++]=128|d>>>6&63,p[g++]=128|d&63):(p[g++]=240|d>>>18,p[g++]=128|d>>>12&63,p[g++]=128|d>>>6&63,p[g++]=128|d&63);return p};function u(f,p){if(p<65534&&(f.subarray&&s||!f.subarray&&o))return String.fromCharCode.apply(null,a.shrinkBuf(f,p));for(var d="",b=0;b<p;b++)d+=String.fromCharCode(f[b]);return d}i.buf2binstring=function(f){return u(f,f.length)},i.binstring2buf=function(f){for(var p=new a.Buf8(f.length),d=0,b=p.length;d<b;d++)p[d]=f.charCodeAt(d);return p},i.buf2string=function(f,p){var d,b,y,g,h=p||f.length,m=new Array(h*2);for(b=0,d=0;d<h;){if(y=f[d++],y<128){m[b++]=y;continue}if(g=l[y],g>4){m[b++]=65533,d+=g-1;continue}for(y&=g===2?31:g===3?15:7;g>1&&d<h;)y=y<<6|f[d++]&63,g--;if(g>1){m[b++]=65533;continue}y<65536?m[b++]=y:(y-=65536,m[b++]=55296|y>>10&1023,m[b++]=56320|y&1023)}return u(m,b)},i.utf8border=function(f,p){var d;for(p=p||f.length,p>f.length&&(p=f.length),d=p-1;d>=0&&(f[d]&192)===128;)d--;return d<0||d===0?p:d+l[f[d]]>p?d:p}},{"./common":50}],52:[function(e,r,i){function a(o,s,l,c){for(var u=o&65535|0,f=o>>>16&65535|0,p=0;l!==0;){p=l>2e3?2e3:l,l-=p;do u=u+s[c++]|0,f=f+u|0;while(--p);u%=65521,f%=65521}return u|f<<16|0}r.exports=a},{}],53:[function(e,r,i){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],54:[function(e,r,i){function a(){for(var l,c=[],u=0;u<256;u++){l=u;for(var f=0;f<8;f++)l=l&1?3988292384^l>>>1:l>>>1;c[u]=l}return c}var o=a();function s(l,c,u,f){var p=o,d=f+u;l^=-1;for(var b=f;b<d;b++)l=l>>>8^p[(l^c[b])&255];return l^-1}r.exports=s},{}],55:[function(e,r,i){var a=e("../utils/common"),o=e("./trees"),s=e("./adler32"),l=e("./crc32"),c=e("./messages"),u=0,f=1,p=3,d=4,b=5,y=0,g=1,h=-2,m=-3,w=-5,A=-1,v=1,T=2,N=3,M=4,P=0,O=2,ne=8,R=9,I=15,E=8,U=29,Z=256,$=Z+1+U,q=30,J=19,re=2*$+1,Q=15,X=3,me=258,pe=me+X+1,V=32,ee=42,ce=69,ue=73,ve=91,Ee=103,Se=113,Fe=666,Ne=1,_=2,B=3,G=4,z=3;function j(C,fe){return C.msg=c[fe],fe}function Y(C){return(C<<1)-(C>4?9:0)}function L(C){for(var fe=C.length;--fe>=0;)C[fe]=0}function x(C){var fe=C.state,de=fe.pending;de>C.avail_out&&(de=C.avail_out),de!==0&&(a.arraySet(C.output,fe.pending_buf,fe.pending_out,de,C.next_out),C.next_out+=de,fe.pending_out+=de,C.total_out+=de,C.avail_out-=de,fe.pending-=de,fe.pending===0&&(fe.pending_out=0))}function k(C,fe){o._tr_flush_block(C,C.block_start>=0?C.block_start:-1,C.strstart-C.block_start,fe),C.block_start=C.strstart,x(C.strm)}function F(C,fe){C.pending_buf[C.pending++]=fe}function K(C,fe){C.pending_buf[C.pending++]=fe>>>8&255,C.pending_buf[C.pending++]=fe&255}function ie(C,fe,de,H){var te=C.avail_in;return te>H&&(te=H),te===0?0:(C.avail_in-=te,a.arraySet(fe,C.input,C.next_in,te,de),C.state.wrap===1?C.adler=s(C.adler,fe,te,de):C.state.wrap===2&&(C.adler=l(C.adler,fe,te,de)),C.next_in+=te,C.total_in+=te,te)}function se(C,fe){var de=C.max_chain_length,H=C.strstart,te,le,Pe=C.prev_length,Ae=C.nice_match,Me=C.strstart>C.w_size-pe?C.strstart-(C.w_size-pe):0,$e=C.window,zt=C.w_mask,rt=C.prev,je=C.strstart+me,it=$e[H+Pe-1],ft=$e[H+Pe];C.prev_length>=C.good_match&&(de>>=2),Ae>C.lookahead&&(Ae=C.lookahead);do if(te=fe,!($e[te+Pe]!==ft||$e[te+Pe-1]!==it||$e[te]!==$e[H]||$e[++te]!==$e[H+1])){H+=2,te++;do;while($e[++H]===$e[++te]&&$e[++H]===$e[++te]&&$e[++H]===$e[++te]&&$e[++H]===$e[++te]&&$e[++H]===$e[++te]&&$e[++H]===$e[++te]&&$e[++H]===$e[++te]&&$e[++H]===$e[++te]&&H<je);if(le=me-(je-H),H=je-me,le>Pe){if(C.match_start=fe,Pe=le,le>=Ae)break;it=$e[H+Pe-1],ft=$e[H+Pe]}}while((fe=rt[fe&zt])>Me&&--de!==0);return Pe<=C.lookahead?Pe:C.lookahead}function Ce(C){var fe=C.w_size,de,H,te,le,Pe;do{if(le=C.window_size-C.lookahead-C.strstart,C.strstart>=fe+(fe-pe)){a.arraySet(C.window,C.window,fe,fe,0),C.match_start-=fe,C.strstart-=fe,C.block_start-=fe,H=C.hash_size,de=H;do te=C.head[--de],C.head[de]=te>=fe?te-fe:0;while(--H);H=fe,de=H;do te=C.prev[--de],C.prev[de]=te>=fe?te-fe:0;while(--H);le+=fe}if(C.strm.avail_in===0)break;if(H=ie(C.strm,C.window,C.strstart+C.lookahead,le),C.lookahead+=H,C.lookahead+C.insert>=X)for(Pe=C.strstart-C.insert,C.ins_h=C.window[Pe],C.ins_h=(C.ins_h<<C.hash_shift^C.window[Pe+1])&C.hash_mask;C.insert&&(C.ins_h=(C.ins_h<<C.hash_shift^C.window[Pe+X-1])&C.hash_mask,C.prev[Pe&C.w_mask]=C.head[C.ins_h],C.head[C.ins_h]=Pe,Pe++,C.insert--,!(C.lookahead+C.insert<X)););}while(C.lookahead<pe&&C.strm.avail_in!==0)}function ke(C,fe){var de=65535;for(de>C.pending_buf_size-5&&(de=C.pending_buf_size-5);;){if(C.lookahead<=1){if(Ce(C),C.lookahead===0&&fe===u)return Ne;if(C.lookahead===0)break}C.strstart+=C.lookahead,C.lookahead=0;var H=C.block_start+de;if((C.strstart===0||C.strstart>=H)&&(C.lookahead=C.strstart-H,C.strstart=H,k(C,!1),C.strm.avail_out===0)||C.strstart-C.block_start>=C.w_size-pe&&(k(C,!1),C.strm.avail_out===0))return Ne}return C.insert=0,fe===d?(k(C,!0),C.strm.avail_out===0?B:G):(C.strstart>C.block_start&&(k(C,!1),C.strm.avail_out===0),Ne)}function xe(C,fe){for(var de,H;;){if(C.lookahead<pe){if(Ce(C),C.lookahead<pe&&fe===u)return Ne;if(C.lookahead===0)break}if(de=0,C.lookahead>=X&&(C.ins_h=(C.ins_h<<C.hash_shift^C.window[C.strstart+X-1])&C.hash_mask,de=C.prev[C.strstart&C.w_mask]=C.head[C.ins_h],C.head[C.ins_h]=C.strstart),de!==0&&C.strstart-de<=C.w_size-pe&&(C.match_length=se(C,de)),C.match_length>=X)if(H=o._tr_tally(C,C.strstart-C.match_start,C.match_length-X),C.lookahead-=C.match_length,C.match_length<=C.max_lazy_match&&C.lookahead>=X){C.match_length--;do C.strstart++,C.ins_h=(C.ins_h<<C.hash_shift^C.window[C.strstart+X-1])&C.hash_mask,de=C.prev[C.strstart&C.w_mask]=C.head[C.ins_h],C.head[C.ins_h]=C.strstart;while(--C.match_length!==0);C.strstart++}else C.strstart+=C.match_length,C.match_length=0,C.ins_h=C.window[C.strstart],C.ins_h=(C.ins_h<<C.hash_shift^C.window[C.strstart+1])&C.hash_mask;else H=o._tr_tally(C,0,C.window[C.strstart]),C.lookahead--,C.strstart++;if(H&&(k(C,!1),C.strm.avail_out===0))return Ne}return C.insert=C.strstart<X-1?C.strstart:X-1,fe===d?(k(C,!0),C.strm.avail_out===0?B:G):C.last_lit&&(k(C,!1),C.strm.avail_out===0)?Ne:_}function Be(C,fe){for(var de,H,te;;){if(C.lookahead<pe){if(Ce(C),C.lookahead<pe&&fe===u)return Ne;if(C.lookahead===0)break}if(de=0,C.lookahead>=X&&(C.ins_h=(C.ins_h<<C.hash_shift^C.window[C.strstart+X-1])&C.hash_mask,de=C.prev[C.strstart&C.w_mask]=C.head[C.ins_h],C.head[C.ins_h]=C.strstart),C.prev_length=C.match_length,C.prev_match=C.match_start,C.match_length=X-1,de!==0&&C.prev_length<C.max_lazy_match&&C.strstart-de<=C.w_size-pe&&(C.match_length=se(C,de),C.match_length<=5&&(C.strategy===v||C.match_length===X&&C.strstart-C.match_start>4096)&&(C.match_length=X-1)),C.prev_length>=X&&C.match_length<=C.prev_length){te=C.strstart+C.lookahead-X,H=o._tr_tally(C,C.strstart-1-C.prev_match,C.prev_length-X),C.lookahead-=C.prev_length-1,C.prev_length-=2;do++C.strstart<=te&&(C.ins_h=(C.ins_h<<C.hash_shift^C.window[C.strstart+X-1])&C.hash_mask,de=C.prev[C.strstart&C.w_mask]=C.head[C.ins_h],C.head[C.ins_h]=C.strstart);while(--C.prev_length!==0);if(C.match_available=0,C.match_length=X-1,C.strstart++,H&&(k(C,!1),C.strm.avail_out===0))return Ne}else if(C.match_available){if(H=o._tr_tally(C,0,C.window[C.strstart-1]),H&&k(C,!1),C.strstart++,C.lookahead--,C.strm.avail_out===0)return Ne}else C.match_available=1,C.strstart++,C.lookahead--}return C.match_available&&(H=o._tr_tally(C,0,C.window[C.strstart-1]),C.match_available=0),C.insert=C.strstart<X-1?C.strstart:X-1,fe===d?(k(C,!0),C.strm.avail_out===0?B:G):C.last_lit&&(k(C,!1),C.strm.avail_out===0)?Ne:_}function Ie(C,fe){for(var de,H,te,le,Pe=C.window;;){if(C.lookahead<=me){if(Ce(C),C.lookahead<=me&&fe===u)return Ne;if(C.lookahead===0)break}if(C.match_length=0,C.lookahead>=X&&C.strstart>0&&(te=C.strstart-1,H=Pe[te],H===Pe[++te]&&H===Pe[++te]&&H===Pe[++te])){le=C.strstart+me;do;while(H===Pe[++te]&&H===Pe[++te]&&H===Pe[++te]&&H===Pe[++te]&&H===Pe[++te]&&H===Pe[++te]&&H===Pe[++te]&&H===Pe[++te]&&te<le);C.match_length=me-(le-te),C.match_length>C.lookahead&&(C.match_length=C.lookahead)}if(C.match_length>=X?(de=o._tr_tally(C,1,C.match_length-X),C.lookahead-=C.match_length,C.strstart+=C.match_length,C.match_length=0):(de=o._tr_tally(C,0,C.window[C.strstart]),C.lookahead--,C.strstart++),de&&(k(C,!1),C.strm.avail_out===0))return Ne}return C.insert=0,fe===d?(k(C,!0),C.strm.avail_out===0?B:G):C.last_lit&&(k(C,!1),C.strm.avail_out===0)?Ne:_}function Ve(C,fe){for(var de;;){if(C.lookahead===0&&(Ce(C),C.lookahead===0)){if(fe===u)return Ne;break}if(C.match_length=0,de=o._tr_tally(C,0,C.window[C.strstart]),C.lookahead--,C.strstart++,de&&(k(C,!1),C.strm.avail_out===0))return Ne}return C.insert=0,fe===d?(k(C,!0),C.strm.avail_out===0?B:G):C.last_lit&&(k(C,!1),C.strm.avail_out===0)?Ne:_}function Re(C,fe,de,H,te){this.good_length=C,this.max_lazy=fe,this.nice_length=de,this.max_chain=H,this.func=te}var He;He=[new Re(0,0,0,0,ke),new Re(4,4,8,4,xe),new Re(4,5,16,8,xe),new Re(4,6,32,32,xe),new Re(4,4,16,16,Be),new Re(8,16,32,32,Be),new Re(8,16,128,128,Be),new Re(8,32,128,256,Be),new Re(32,128,258,1024,Be),new Re(32,258,258,4096,Be)];function Ge(C){C.window_size=2*C.w_size,L(C.head),C.max_lazy_match=He[C.level].max_lazy,C.good_match=He[C.level].good_length,C.nice_match=He[C.level].nice_length,C.max_chain_length=He[C.level].max_chain,C.strstart=0,C.block_start=0,C.lookahead=0,C.insert=0,C.match_length=C.prev_length=X-1,C.match_available=0,C.ins_h=0}function W(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ne,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new a.Buf16(re*2),this.dyn_dtree=new a.Buf16((2*q+1)*2),this.bl_tree=new a.Buf16((2*J+1)*2),L(this.dyn_ltree),L(this.dyn_dtree),L(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new a.Buf16(Q+1),this.heap=new a.Buf16(2*$+1),L(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new a.Buf16(2*$+1),L(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ye(C){var fe;return!C||!C.state?j(C,h):(C.total_in=C.total_out=0,C.data_type=O,fe=C.state,fe.pending=0,fe.pending_out=0,fe.wrap<0&&(fe.wrap=-fe.wrap),fe.status=fe.wrap?ee:Se,C.adler=fe.wrap===2?0:1,fe.last_flush=u,o._tr_init(fe),y)}function we(C){var fe=ye(C);return fe===y&&Ge(C.state),fe}function Te(C,fe){return!C||!C.state||C.state.wrap!==2?h:(C.state.gzhead=fe,y)}function oe(C,fe,de,H,te,le){if(!C)return h;var Pe=1;if(fe===A&&(fe=6),H<0?(Pe=0,H=-H):H>15&&(Pe=2,H-=16),te<1||te>R||de!==ne||H<8||H>15||fe<0||fe>9||le<0||le>M)return j(C,h);H===8&&(H=9);var Ae=new W;return C.state=Ae,Ae.strm=C,Ae.wrap=Pe,Ae.gzhead=null,Ae.w_bits=H,Ae.w_size=1<<Ae.w_bits,Ae.w_mask=Ae.w_size-1,Ae.hash_bits=te+7,Ae.hash_size=1<<Ae.hash_bits,Ae.hash_mask=Ae.hash_size-1,Ae.hash_shift=~~((Ae.hash_bits+X-1)/X),Ae.window=new a.Buf8(Ae.w_size*2),Ae.head=new a.Buf16(Ae.hash_size),Ae.prev=new a.Buf16(Ae.w_size),Ae.lit_bufsize=1<<te+6,Ae.pending_buf_size=Ae.lit_bufsize*4,Ae.pending_buf=new a.Buf8(Ae.pending_buf_size),Ae.d_buf=1*Ae.lit_bufsize,Ae.l_buf=(1+2)*Ae.lit_bufsize,Ae.level=fe,Ae.strategy=le,Ae.method=de,we(C)}function ge(C,fe){return oe(C,fe,ne,I,E,P)}function D(C,fe){var de,H,te,le;if(!C||!C.state||fe>b||fe<0)return C?j(C,h):h;if(H=C.state,!C.output||!C.input&&C.avail_in!==0||H.status===Fe&&fe!==d)return j(C,C.avail_out===0?w:h);if(H.strm=C,de=H.last_flush,H.last_flush=fe,H.status===ee)if(H.wrap===2)C.adler=0,F(H,31),F(H,139),F(H,8),H.gzhead?(F(H,(H.gzhead.text?1:0)+(H.gzhead.hcrc?2:0)+(H.gzhead.extra?4:0)+(H.gzhead.name?8:0)+(H.gzhead.comment?16:0)),F(H,H.gzhead.time&255),F(H,H.gzhead.time>>8&255),F(H,H.gzhead.time>>16&255),F(H,H.gzhead.time>>24&255),F(H,H.level===9?2:H.strategy>=T||H.level<2?4:0),F(H,H.gzhead.os&255),H.gzhead.extra&&H.gzhead.extra.length&&(F(H,H.gzhead.extra.length&255),F(H,H.gzhead.extra.length>>8&255)),H.gzhead.hcrc&&(C.adler=l(C.adler,H.pending_buf,H.pending,0)),H.gzindex=0,H.status=ce):(F(H,0),F(H,0),F(H,0),F(H,0),F(H,0),F(H,H.level===9?2:H.strategy>=T||H.level<2?4:0),F(H,z),H.status=Se);else{var Pe=ne+(H.w_bits-8<<4)<<8,Ae=-1;H.strategy>=T||H.level<2?Ae=0:H.level<6?Ae=1:H.level===6?Ae=2:Ae=3,Pe|=Ae<<6,H.strstart!==0&&(Pe|=V),Pe+=31-Pe%31,H.status=Se,K(H,Pe),H.strstart!==0&&(K(H,C.adler>>>16),K(H,C.adler&65535)),C.adler=1}if(H.status===ce)if(H.gzhead.extra){for(te=H.pending;H.gzindex<(H.gzhead.extra.length&65535)&&!(H.pending===H.pending_buf_size&&(H.gzhead.hcrc&&H.pending>te&&(C.adler=l(C.adler,H.pending_buf,H.pending-te,te)),x(C),te=H.pending,H.pending===H.pending_buf_size));)F(H,H.gzhead.extra[H.gzindex]&255),H.gzindex++;H.gzhead.hcrc&&H.pending>te&&(C.adler=l(C.adler,H.pending_buf,H.pending-te,te)),H.gzindex===H.gzhead.extra.length&&(H.gzindex=0,H.status=ue)}else H.status=ue;if(H.status===ue)if(H.gzhead.name){te=H.pending;do{if(H.pending===H.pending_buf_size&&(H.gzhead.hcrc&&H.pending>te&&(C.adler=l(C.adler,H.pending_buf,H.pending-te,te)),x(C),te=H.pending,H.pending===H.pending_buf_size)){le=1;break}H.gzindex<H.gzhead.name.length?le=H.gzhead.name.charCodeAt(H.gzindex++)&255:le=0,F(H,le)}while(le!==0);H.gzhead.hcrc&&H.pending>te&&(C.adler=l(C.adler,H.pending_buf,H.pending-te,te)),le===0&&(H.gzindex=0,H.status=ve)}else H.status=ve;if(H.status===ve)if(H.gzhead.comment){te=H.pending;do{if(H.pending===H.pending_buf_size&&(H.gzhead.hcrc&&H.pending>te&&(C.adler=l(C.adler,H.pending_buf,H.pending-te,te)),x(C),te=H.pending,H.pending===H.pending_buf_size)){le=1;break}H.gzindex<H.gzhead.comment.length?le=H.gzhead.comment.charCodeAt(H.gzindex++)&255:le=0,F(H,le)}while(le!==0);H.gzhead.hcrc&&H.pending>te&&(C.adler=l(C.adler,H.pending_buf,H.pending-te,te)),le===0&&(H.status=Ee)}else H.status=Ee;if(H.status===Ee&&(H.gzhead.hcrc?(H.pending+2>H.pending_buf_size&&x(C),H.pending+2<=H.pending_buf_size&&(F(H,C.adler&255),F(H,C.adler>>8&255),C.adler=0,H.status=Se)):H.status=Se),H.pending!==0){if(x(C),C.avail_out===0)return H.last_flush=-1,y}else if(C.avail_in===0&&Y(fe)<=Y(de)&&fe!==d)return j(C,w);if(H.status===Fe&&C.avail_in!==0)return j(C,w);if(C.avail_in!==0||H.lookahead!==0||fe!==u&&H.status!==Fe){var Me=H.strategy===T?Ve(H,fe):H.strategy===N?Ie(H,fe):He[H.level].func(H,fe);if((Me===B||Me===G)&&(H.status=Fe),Me===Ne||Me===B)return C.avail_out===0&&(H.last_flush=-1),y;if(Me===_&&(fe===f?o._tr_align(H):fe!==b&&(o._tr_stored_block(H,0,0,!1),fe===p&&(L(H.head),H.lookahead===0&&(H.strstart=0,H.block_start=0,H.insert=0))),x(C),C.avail_out===0))return H.last_flush=-1,y}return fe!==d?y:H.wrap<=0?g:(H.wrap===2?(F(H,C.adler&255),F(H,C.adler>>8&255),F(H,C.adler>>16&255),F(H,C.adler>>24&255),F(H,C.total_in&255),F(H,C.total_in>>8&255),F(H,C.total_in>>16&255),F(H,C.total_in>>24&255)):(K(H,C.adler>>>16),K(H,C.adler&65535)),x(C),H.wrap>0&&(H.wrap=-H.wrap),H.pending!==0?y:g)}function be(C){var fe;return!C||!C.state?h:(fe=C.state.status,fe!==ee&&fe!==ce&&fe!==ue&&fe!==ve&&fe!==Ee&&fe!==Se&&fe!==Fe?j(C,h):(C.state=null,fe===Se?j(C,m):y))}function De(C,fe){var de=fe.length,H,te,le,Pe,Ae,Me,$e,zt;if(!C||!C.state||(H=C.state,Pe=H.wrap,Pe===2||Pe===1&&H.status!==ee||H.lookahead))return h;for(Pe===1&&(C.adler=s(C.adler,fe,de,0)),H.wrap=0,de>=H.w_size&&(Pe===0&&(L(H.head),H.strstart=0,H.block_start=0,H.insert=0),zt=new a.Buf8(H.w_size),a.arraySet(zt,fe,de-H.w_size,H.w_size,0),fe=zt,de=H.w_size),Ae=C.avail_in,Me=C.next_in,$e=C.input,C.avail_in=de,C.next_in=0,C.input=fe,Ce(H);H.lookahead>=X;){te=H.strstart,le=H.lookahead-(X-1);do H.ins_h=(H.ins_h<<H.hash_shift^H.window[te+X-1])&H.hash_mask,H.prev[te&H.w_mask]=H.head[H.ins_h],H.head[H.ins_h]=te,te++;while(--le);H.strstart=te,H.lookahead=X-1,Ce(H)}return H.strstart+=H.lookahead,H.block_start=H.strstart,H.insert=H.lookahead,H.lookahead=0,H.match_length=H.prev_length=X-1,H.match_available=0,C.next_in=Me,C.input=$e,C.avail_in=Ae,H.wrap=Pe,y}i.deflateInit=ge,i.deflateInit2=oe,i.deflateReset=we,i.deflateResetKeep=ye,i.deflateSetHeader=Te,i.deflate=D,i.deflateEnd=be,i.deflateSetDictionary=De,i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":50,"./adler32":52,"./crc32":54,"./messages":60,"./trees":61}],56:[function(e,r,i){function a(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}r.exports=a},{}],57:[function(e,r,i){var a=30,o=12;r.exports=function(l,c){var u,f,p,d,b,y,g,h,m,w,A,v,T,N,M,P,O,ne,R,I,E,U,Z,$,q;u=l.state,f=l.next_in,$=l.input,p=f+(l.avail_in-5),d=l.next_out,q=l.output,b=d-(c-l.avail_out),y=d+(l.avail_out-257),g=u.dmax,h=u.wsize,m=u.whave,w=u.wnext,A=u.window,v=u.hold,T=u.bits,N=u.lencode,M=u.distcode,P=(1<<u.lenbits)-1,O=(1<<u.distbits)-1;e:do{T<15&&(v+=$[f++]<<T,T+=8,v+=$[f++]<<T,T+=8),ne=N[v&P];t:for(;;){if(R=ne>>>24,v>>>=R,T-=R,R=ne>>>16&255,R===0)q[d++]=ne&65535;else if(R&16){I=ne&65535,R&=15,R&&(T<R&&(v+=$[f++]<<T,T+=8),I+=v&(1<<R)-1,v>>>=R,T-=R),T<15&&(v+=$[f++]<<T,T+=8,v+=$[f++]<<T,T+=8),ne=M[v&O];r:for(;;){if(R=ne>>>24,v>>>=R,T-=R,R=ne>>>16&255,R&16){if(E=ne&65535,R&=15,T<R&&(v+=$[f++]<<T,T+=8,T<R&&(v+=$[f++]<<T,T+=8)),E+=v&(1<<R)-1,E>g){l.msg="invalid distance too far back",u.mode=a;break e}if(v>>>=R,T-=R,R=d-b,E>R){if(R=E-R,R>m&&u.sane){l.msg="invalid distance too far back",u.mode=a;break e}if(U=0,Z=A,w===0){if(U+=h-R,R<I){I-=R;do q[d++]=A[U++];while(--R);U=d-E,Z=q}}else if(w<R){if(U+=h+w-R,R-=w,R<I){I-=R;do q[d++]=A[U++];while(--R);if(U=0,w<I){R=w,I-=R;do q[d++]=A[U++];while(--R);U=d-E,Z=q}}}else if(U+=w-R,R<I){I-=R;do q[d++]=A[U++];while(--R);U=d-E,Z=q}for(;I>2;)q[d++]=Z[U++],q[d++]=Z[U++],q[d++]=Z[U++],I-=3;I&&(q[d++]=Z[U++],I>1&&(q[d++]=Z[U++]))}else{U=d-E;do q[d++]=q[U++],q[d++]=q[U++],q[d++]=q[U++],I-=3;while(I>2);I&&(q[d++]=q[U++],I>1&&(q[d++]=q[U++]))}}else if(R&64){l.msg="invalid distance code",u.mode=a;break e}else{ne=M[(ne&65535)+(v&(1<<R)-1)];continue r}break}}else if(R&64)if(R&32){u.mode=o;break e}else{l.msg="invalid literal/length code",u.mode=a;break e}else{ne=N[(ne&65535)+(v&(1<<R)-1)];continue t}break}}while(f<p&&d<y);I=T>>3,f-=I,T-=I<<3,v&=(1<<T)-1,l.next_in=f,l.next_out=d,l.avail_in=f<p?5+(p-f):5-(f-p),l.avail_out=d<y?257+(y-d):257-(d-y),u.hold=v,u.bits=T}},{}],58:[function(e,r,i){var a=e("../utils/common"),o=e("./adler32"),s=e("./crc32"),l=e("./inffast"),c=e("./inftrees"),u=0,f=1,p=2,d=4,b=5,y=6,g=0,h=1,m=2,w=-2,A=-3,v=-4,T=-5,N=8,M=1,P=2,O=3,ne=4,R=5,I=6,E=7,U=8,Z=9,$=10,q=11,J=12,re=13,Q=14,X=15,me=16,pe=17,V=18,ee=19,ce=20,ue=21,ve=22,Ee=23,Se=24,Fe=25,Ne=26,_=27,B=28,G=29,z=30,j=31,Y=32,L=852,x=592,k=15,F=k;function K(oe){return(oe>>>24&255)+(oe>>>8&65280)+((oe&65280)<<8)+((oe&255)<<24)}function ie(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function se(oe){var ge;return!oe||!oe.state?w:(ge=oe.state,oe.total_in=oe.total_out=ge.total=0,oe.msg="",ge.wrap&&(oe.adler=ge.wrap&1),ge.mode=M,ge.last=0,ge.havedict=0,ge.dmax=32768,ge.head=null,ge.hold=0,ge.bits=0,ge.lencode=ge.lendyn=new a.Buf32(L),ge.distcode=ge.distdyn=new a.Buf32(x),ge.sane=1,ge.back=-1,g)}function Ce(oe){var ge;return!oe||!oe.state?w:(ge=oe.state,ge.wsize=0,ge.whave=0,ge.wnext=0,se(oe))}function ke(oe,ge){var D,be;return!oe||!oe.state||(be=oe.state,ge<0?(D=0,ge=-ge):(D=(ge>>4)+1,ge<48&&(ge&=15)),ge&&(ge<8||ge>15))?w:(be.window!==null&&be.wbits!==ge&&(be.window=null),be.wrap=D,be.wbits=ge,Ce(oe))}function xe(oe,ge){var D,be;return oe?(be=new ie,oe.state=be,be.window=null,D=ke(oe,ge),D!==g&&(oe.state=null),D):w}function Be(oe){return xe(oe,F)}var Ie=!0,Ve,Re;function He(oe){if(Ie){var ge;for(Ve=new a.Buf32(512),Re=new a.Buf32(32),ge=0;ge<144;)oe.lens[ge++]=8;for(;ge<256;)oe.lens[ge++]=9;for(;ge<280;)oe.lens[ge++]=7;for(;ge<288;)oe.lens[ge++]=8;for(c(f,oe.lens,0,288,Ve,0,oe.work,{bits:9}),ge=0;ge<32;)oe.lens[ge++]=5;c(p,oe.lens,0,32,Re,0,oe.work,{bits:5}),Ie=!1}oe.lencode=Ve,oe.lenbits=9,oe.distcode=Re,oe.distbits=5}function Ge(oe,ge,D,be){var De,C=oe.state;return C.window===null&&(C.wsize=1<<C.wbits,C.wnext=0,C.whave=0,C.window=new a.Buf8(C.wsize)),be>=C.wsize?(a.arraySet(C.window,ge,D-C.wsize,C.wsize,0),C.wnext=0,C.whave=C.wsize):(De=C.wsize-C.wnext,De>be&&(De=be),a.arraySet(C.window,ge,D-be,De,C.wnext),be-=De,be?(a.arraySet(C.window,ge,D-be,be,0),C.wnext=be,C.whave=C.wsize):(C.wnext+=De,C.wnext===C.wsize&&(C.wnext=0),C.whave<C.wsize&&(C.whave+=De))),0}function W(oe,ge){var D,be,De,C,fe,de,H,te,le,Pe,Ae,Me,$e,zt,rt=0,je,it,ft,pt,hr,pr,Ye,dt,ht=new a.Buf8(4),It,At,un=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!oe||!oe.state||!oe.output||!oe.input&&oe.avail_in!==0)return w;D=oe.state,D.mode===J&&(D.mode=re),fe=oe.next_out,De=oe.output,H=oe.avail_out,C=oe.next_in,be=oe.input,de=oe.avail_in,te=D.hold,le=D.bits,Pe=de,Ae=H,dt=g;e:for(;;)switch(D.mode){case M:if(D.wrap===0){D.mode=re;break}for(;le<16;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}if(D.wrap&2&&te===35615){D.check=0,ht[0]=te&255,ht[1]=te>>>8&255,D.check=s(D.check,ht,2,0),te=0,le=0,D.mode=P;break}if(D.flags=0,D.head&&(D.head.done=!1),!(D.wrap&1)||(((te&255)<<8)+(te>>8))%31){oe.msg="incorrect header check",D.mode=z;break}if((te&15)!==N){oe.msg="unknown compression method",D.mode=z;break}if(te>>>=4,le-=4,Ye=(te&15)+8,D.wbits===0)D.wbits=Ye;else if(Ye>D.wbits){oe.msg="invalid window size",D.mode=z;break}D.dmax=1<<Ye,oe.adler=D.check=1,D.mode=te&512?$:J,te=0,le=0;break;case P:for(;le<16;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}if(D.flags=te,(D.flags&255)!==N){oe.msg="unknown compression method",D.mode=z;break}if(D.flags&57344){oe.msg="unknown header flags set",D.mode=z;break}D.head&&(D.head.text=te>>8&1),D.flags&512&&(ht[0]=te&255,ht[1]=te>>>8&255,D.check=s(D.check,ht,2,0)),te=0,le=0,D.mode=O;case O:for(;le<32;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}D.head&&(D.head.time=te),D.flags&512&&(ht[0]=te&255,ht[1]=te>>>8&255,ht[2]=te>>>16&255,ht[3]=te>>>24&255,D.check=s(D.check,ht,4,0)),te=0,le=0,D.mode=ne;case ne:for(;le<16;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}D.head&&(D.head.xflags=te&255,D.head.os=te>>8),D.flags&512&&(ht[0]=te&255,ht[1]=te>>>8&255,D.check=s(D.check,ht,2,0)),te=0,le=0,D.mode=R;case R:if(D.flags&1024){for(;le<16;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}D.length=te,D.head&&(D.head.extra_len=te),D.flags&512&&(ht[0]=te&255,ht[1]=te>>>8&255,D.check=s(D.check,ht,2,0)),te=0,le=0}else D.head&&(D.head.extra=null);D.mode=I;case I:if(D.flags&1024&&(Me=D.length,Me>de&&(Me=de),Me&&(D.head&&(Ye=D.head.extra_len-D.length,D.head.extra||(D.head.extra=new Array(D.head.extra_len)),a.arraySet(D.head.extra,be,C,Me,Ye)),D.flags&512&&(D.check=s(D.check,be,Me,C)),de-=Me,C+=Me,D.length-=Me),D.length))break e;D.length=0,D.mode=E;case E:if(D.flags&2048){if(de===0)break e;Me=0;do Ye=be[C+Me++],D.head&&Ye&&D.length<65536&&(D.head.name+=String.fromCharCode(Ye));while(Ye&&Me<de);if(D.flags&512&&(D.check=s(D.check,be,Me,C)),de-=Me,C+=Me,Ye)break e}else D.head&&(D.head.name=null);D.length=0,D.mode=U;case U:if(D.flags&4096){if(de===0)break e;Me=0;do Ye=be[C+Me++],D.head&&Ye&&D.length<65536&&(D.head.comment+=String.fromCharCode(Ye));while(Ye&&Me<de);if(D.flags&512&&(D.check=s(D.check,be,Me,C)),de-=Me,C+=Me,Ye)break e}else D.head&&(D.head.comment=null);D.mode=Z;case Z:if(D.flags&512){for(;le<16;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}if(te!==(D.check&65535)){oe.msg="header crc mismatch",D.mode=z;break}te=0,le=0}D.head&&(D.head.hcrc=D.flags>>9&1,D.head.done=!0),oe.adler=D.check=0,D.mode=J;break;case $:for(;le<32;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}oe.adler=D.check=K(te),te=0,le=0,D.mode=q;case q:if(D.havedict===0)return oe.next_out=fe,oe.avail_out=H,oe.next_in=C,oe.avail_in=de,D.hold=te,D.bits=le,m;oe.adler=D.check=1,D.mode=J;case J:if(ge===b||ge===y)break e;case re:if(D.last){te>>>=le&7,le-=le&7,D.mode=_;break}for(;le<3;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}switch(D.last=te&1,te>>>=1,le-=1,te&3){case 0:D.mode=Q;break;case 1:if(He(D),D.mode=ce,ge===y){te>>>=2,le-=2;break e}break;case 2:D.mode=pe;break;case 3:oe.msg="invalid block type",D.mode=z}te>>>=2,le-=2;break;case Q:for(te>>>=le&7,le-=le&7;le<32;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}if((te&65535)!==(te>>>16^65535)){oe.msg="invalid stored block lengths",D.mode=z;break}if(D.length=te&65535,te=0,le=0,D.mode=X,ge===y)break e;case X:D.mode=me;case me:if(Me=D.length,Me){if(Me>de&&(Me=de),Me>H&&(Me=H),Me===0)break e;a.arraySet(De,be,C,Me,fe),de-=Me,C+=Me,H-=Me,fe+=Me,D.length-=Me;break}D.mode=J;break;case pe:for(;le<14;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}if(D.nlen=(te&31)+257,te>>>=5,le-=5,D.ndist=(te&31)+1,te>>>=5,le-=5,D.ncode=(te&15)+4,te>>>=4,le-=4,D.nlen>286||D.ndist>30){oe.msg="too many length or distance symbols",D.mode=z;break}D.have=0,D.mode=V;case V:for(;D.have<D.ncode;){for(;le<3;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}D.lens[un[D.have++]]=te&7,te>>>=3,le-=3}for(;D.have<19;)D.lens[un[D.have++]]=0;if(D.lencode=D.lendyn,D.lenbits=7,It={bits:D.lenbits},dt=c(u,D.lens,0,19,D.lencode,0,D.work,It),D.lenbits=It.bits,dt){oe.msg="invalid code lengths set",D.mode=z;break}D.have=0,D.mode=ee;case ee:for(;D.have<D.nlen+D.ndist;){for(;rt=D.lencode[te&(1<<D.lenbits)-1],je=rt>>>24,it=rt>>>16&255,ft=rt&65535,!(je<=le);){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}if(ft<16)te>>>=je,le-=je,D.lens[D.have++]=ft;else{if(ft===16){for(At=je+2;le<At;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}if(te>>>=je,le-=je,D.have===0){oe.msg="invalid bit length repeat",D.mode=z;break}Ye=D.lens[D.have-1],Me=3+(te&3),te>>>=2,le-=2}else if(ft===17){for(At=je+3;le<At;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}te>>>=je,le-=je,Ye=0,Me=3+(te&7),te>>>=3,le-=3}else{for(At=je+7;le<At;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}te>>>=je,le-=je,Ye=0,Me=11+(te&127),te>>>=7,le-=7}if(D.have+Me>D.nlen+D.ndist){oe.msg="invalid bit length repeat",D.mode=z;break}for(;Me--;)D.lens[D.have++]=Ye}}if(D.mode===z)break;if(D.lens[256]===0){oe.msg="invalid code -- missing end-of-block",D.mode=z;break}if(D.lenbits=9,It={bits:D.lenbits},dt=c(f,D.lens,0,D.nlen,D.lencode,0,D.work,It),D.lenbits=It.bits,dt){oe.msg="invalid literal/lengths set",D.mode=z;break}if(D.distbits=6,D.distcode=D.distdyn,It={bits:D.distbits},dt=c(p,D.lens,D.nlen,D.ndist,D.distcode,0,D.work,It),D.distbits=It.bits,dt){oe.msg="invalid distances set",D.mode=z;break}if(D.mode=ce,ge===y)break e;case ce:D.mode=ue;case ue:if(de>=6&&H>=258){oe.next_out=fe,oe.avail_out=H,oe.next_in=C,oe.avail_in=de,D.hold=te,D.bits=le,l(oe,Ae),fe=oe.next_out,De=oe.output,H=oe.avail_out,C=oe.next_in,be=oe.input,de=oe.avail_in,te=D.hold,le=D.bits,D.mode===J&&(D.back=-1);break}for(D.back=0;rt=D.lencode[te&(1<<D.lenbits)-1],je=rt>>>24,it=rt>>>16&255,ft=rt&65535,!(je<=le);){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}if(it&&!(it&240)){for(pt=je,hr=it,pr=ft;rt=D.lencode[pr+((te&(1<<pt+hr)-1)>>pt)],je=rt>>>24,it=rt>>>16&255,ft=rt&65535,!(pt+je<=le);){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}te>>>=pt,le-=pt,D.back+=pt}if(te>>>=je,le-=je,D.back+=je,D.length=ft,it===0){D.mode=Ne;break}if(it&32){D.back=-1,D.mode=J;break}if(it&64){oe.msg="invalid literal/length code",D.mode=z;break}D.extra=it&15,D.mode=ve;case ve:if(D.extra){for(At=D.extra;le<At;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}D.length+=te&(1<<D.extra)-1,te>>>=D.extra,le-=D.extra,D.back+=D.extra}D.was=D.length,D.mode=Ee;case Ee:for(;rt=D.distcode[te&(1<<D.distbits)-1],je=rt>>>24,it=rt>>>16&255,ft=rt&65535,!(je<=le);){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}if(!(it&240)){for(pt=je,hr=it,pr=ft;rt=D.distcode[pr+((te&(1<<pt+hr)-1)>>pt)],je=rt>>>24,it=rt>>>16&255,ft=rt&65535,!(pt+je<=le);){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}te>>>=pt,le-=pt,D.back+=pt}if(te>>>=je,le-=je,D.back+=je,it&64){oe.msg="invalid distance code",D.mode=z;break}D.offset=ft,D.extra=it&15,D.mode=Se;case Se:if(D.extra){for(At=D.extra;le<At;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}D.offset+=te&(1<<D.extra)-1,te>>>=D.extra,le-=D.extra,D.back+=D.extra}if(D.offset>D.dmax){oe.msg="invalid distance too far back",D.mode=z;break}D.mode=Fe;case Fe:if(H===0)break e;if(Me=Ae-H,D.offset>Me){if(Me=D.offset-Me,Me>D.whave&&D.sane){oe.msg="invalid distance too far back",D.mode=z;break}Me>D.wnext?(Me-=D.wnext,$e=D.wsize-Me):$e=D.wnext-Me,Me>D.length&&(Me=D.length),zt=D.window}else zt=De,$e=fe-D.offset,Me=D.length;Me>H&&(Me=H),H-=Me,D.length-=Me;do De[fe++]=zt[$e++];while(--Me);D.length===0&&(D.mode=ue);break;case Ne:if(H===0)break e;De[fe++]=D.length,H--,D.mode=ue;break;case _:if(D.wrap){for(;le<32;){if(de===0)break e;de--,te|=be[C++]<<le,le+=8}if(Ae-=H,oe.total_out+=Ae,D.total+=Ae,Ae&&(oe.adler=D.check=D.flags?s(D.check,De,Ae,fe-Ae):o(D.check,De,Ae,fe-Ae)),Ae=H,(D.flags?te:K(te))!==D.check){oe.msg="incorrect data check",D.mode=z;break}te=0,le=0}D.mode=B;case B:if(D.wrap&&D.flags){for(;le<32;){if(de===0)break e;de--,te+=be[C++]<<le,le+=8}if(te!==(D.total&4294967295)){oe.msg="incorrect length check",D.mode=z;break}te=0,le=0}D.mode=G;case G:dt=h;break e;case z:dt=A;break e;case j:return v;case Y:default:return w}return oe.next_out=fe,oe.avail_out=H,oe.next_in=C,oe.avail_in=de,D.hold=te,D.bits=le,(D.wsize||Ae!==oe.avail_out&&D.mode<z&&(D.mode<_||ge!==d))&&Ge(oe,oe.output,oe.next_out,Ae-oe.avail_out),Pe-=oe.avail_in,Ae-=oe.avail_out,oe.total_in+=Pe,oe.total_out+=Ae,D.total+=Ae,D.wrap&&Ae&&(oe.adler=D.check=D.flags?s(D.check,De,Ae,oe.next_out-Ae):o(D.check,De,Ae,oe.next_out-Ae)),oe.data_type=D.bits+(D.last?64:0)+(D.mode===J?128:0)+(D.mode===ce||D.mode===X?256:0),(Pe===0&&Ae===0||ge===d)&&dt===g&&(dt=T),dt}function ye(oe){if(!oe||!oe.state)return w;var ge=oe.state;return ge.window&&(ge.window=null),oe.state=null,g}function we(oe,ge){var D;return!oe||!oe.state||(D=oe.state,!(D.wrap&2))?w:(D.head=ge,ge.done=!1,g)}function Te(oe,ge){var D=ge.length,be,De,C;return!oe||!oe.state||(be=oe.state,be.wrap!==0&&be.mode!==q)?w:be.mode===q&&(De=1,De=o(De,ge,D,0),De!==be.check)?A:(C=Ge(oe,ge,D,D),C?(be.mode=j,v):(be.havedict=1,g))}i.inflateReset=Ce,i.inflateReset2=ke,i.inflateResetKeep=se,i.inflateInit=Be,i.inflateInit2=xe,i.inflate=W,i.inflateEnd=ye,i.inflateGetHeader=we,i.inflateSetDictionary=Te,i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":50,"./adler32":52,"./crc32":54,"./inffast":57,"./inftrees":59}],59:[function(e,r,i){var a=e("../utils/common"),o=15,s=852,l=592,c=0,u=1,f=2,p=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],d=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],b=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],y=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(h,m,w,A,v,T,N,M){var P=M.bits,O=0,ne=0,R=0,I=0,E=0,U=0,Z=0,$=0,q=0,J=0,re,Q,X,me,pe,V=null,ee=0,ce,ue=new a.Buf16(o+1),ve=new a.Buf16(o+1),Ee=null,Se=0,Fe,Ne,_;for(O=0;O<=o;O++)ue[O]=0;for(ne=0;ne<A;ne++)ue[m[w+ne]]++;for(E=P,I=o;I>=1&&ue[I]===0;I--);if(E>I&&(E=I),I===0)return v[T++]=1<<24|64<<16|0,v[T++]=1<<24|64<<16|0,M.bits=1,0;for(R=1;R<I&&ue[R]===0;R++);for(E<R&&(E=R),$=1,O=1;O<=o;O++)if($<<=1,$-=ue[O],$<0)return-1;if($>0&&(h===c||I!==1))return-1;for(ve[1]=0,O=1;O<o;O++)ve[O+1]=ve[O]+ue[O];for(ne=0;ne<A;ne++)m[w+ne]!==0&&(N[ve[m[w+ne]]++]=ne);if(h===c?(V=Ee=N,ce=19):h===u?(V=p,ee-=257,Ee=d,Se-=257,ce=256):(V=b,Ee=y,ce=-1),J=0,ne=0,O=R,pe=T,U=E,Z=0,X=-1,q=1<<E,me=q-1,h===u&&q>s||h===f&&q>l)return 1;for(;;){Fe=O-Z,N[ne]<ce?(Ne=0,_=N[ne]):N[ne]>ce?(Ne=Ee[Se+N[ne]],_=V[ee+N[ne]]):(Ne=32+64,_=0),re=1<<O-Z,Q=1<<U,R=Q;do Q-=re,v[pe+(J>>Z)+Q]=Fe<<24|Ne<<16|_|0;while(Q!==0);for(re=1<<O-1;J&re;)re>>=1;if(re!==0?(J&=re-1,J+=re):J=0,ne++,--ue[O]===0){if(O===I)break;O=m[w+N[ne]]}if(O>E&&(J&me)!==X){for(Z===0&&(Z=E),pe+=R,U=O-Z,$=1<<U;U+Z<I&&($-=ue[U+Z],!($<=0));)U++,$<<=1;if(q+=1<<U,h===u&&q>s||h===f&&q>l)return 1;X=J&me,v[X]=E<<24|U<<16|pe-T|0}}return J!==0&&(v[pe+J]=O-Z<<24|64<<16|0),M.bits=E,0}},{"../utils/common":50}],60:[function(e,r,i){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],61:[function(e,r,i){var a=e("../utils/common"),o=4,s=0,l=1,c=2;function u(W){for(var ye=W.length;--ye>=0;)W[ye]=0}var f=0,p=1,d=2,b=3,y=258,g=29,h=256,m=h+1+g,w=30,A=19,v=2*m+1,T=15,N=16,M=7,P=256,O=16,ne=17,R=18,I=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],E=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],U=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],$=512,q=new Array((m+2)*2);u(q);var J=new Array(w*2);u(J);var re=new Array($);u(re);var Q=new Array(y-b+1);u(Q);var X=new Array(g);u(X);var me=new Array(w);u(me);function pe(W,ye,we,Te,oe){this.static_tree=W,this.extra_bits=ye,this.extra_base=we,this.elems=Te,this.max_length=oe,this.has_stree=W&&W.length}var V,ee,ce;function ue(W,ye){this.dyn_tree=W,this.max_code=0,this.stat_desc=ye}function ve(W){return W<256?re[W]:re[256+(W>>>7)]}function Ee(W,ye){W.pending_buf[W.pending++]=ye&255,W.pending_buf[W.pending++]=ye>>>8&255}function Se(W,ye,we){W.bi_valid>N-we?(W.bi_buf|=ye<<W.bi_valid&65535,Ee(W,W.bi_buf),W.bi_buf=ye>>N-W.bi_valid,W.bi_valid+=we-N):(W.bi_buf|=ye<<W.bi_valid&65535,W.bi_valid+=we)}function Fe(W,ye,we){Se(W,we[ye*2],we[ye*2+1])}function Ne(W,ye){var we=0;do we|=W&1,W>>>=1,we<<=1;while(--ye>0);return we>>>1}function _(W){W.bi_valid===16?(Ee(W,W.bi_buf),W.bi_buf=0,W.bi_valid=0):W.bi_valid>=8&&(W.pending_buf[W.pending++]=W.bi_buf&255,W.bi_buf>>=8,W.bi_valid-=8)}function B(W,ye){var we=ye.dyn_tree,Te=ye.max_code,oe=ye.stat_desc.static_tree,ge=ye.stat_desc.has_stree,D=ye.stat_desc.extra_bits,be=ye.stat_desc.extra_base,De=ye.stat_desc.max_length,C,fe,de,H,te,le,Pe=0;for(H=0;H<=T;H++)W.bl_count[H]=0;for(we[W.heap[W.heap_max]*2+1]=0,C=W.heap_max+1;C<v;C++)fe=W.heap[C],H=we[we[fe*2+1]*2+1]+1,H>De&&(H=De,Pe++),we[fe*2+1]=H,!(fe>Te)&&(W.bl_count[H]++,te=0,fe>=be&&(te=D[fe-be]),le=we[fe*2],W.opt_len+=le*(H+te),ge&&(W.static_len+=le*(oe[fe*2+1]+te)));if(Pe!==0){do{for(H=De-1;W.bl_count[H]===0;)H--;W.bl_count[H]--,W.bl_count[H+1]+=2,W.bl_count[De]--,Pe-=2}while(Pe>0);for(H=De;H!==0;H--)for(fe=W.bl_count[H];fe!==0;)de=W.heap[--C],!(de>Te)&&(we[de*2+1]!==H&&(W.opt_len+=(H-we[de*2+1])*we[de*2],we[de*2+1]=H),fe--)}}function G(W,ye,we){var Te=new Array(T+1),oe=0,ge,D;for(ge=1;ge<=T;ge++)Te[ge]=oe=oe+we[ge-1]<<1;for(D=0;D<=ye;D++){var be=W[D*2+1];be!==0&&(W[D*2]=Ne(Te[be]++,be))}}function z(){var W,ye,we,Te,oe,ge=new Array(T+1);for(we=0,Te=0;Te<g-1;Te++)for(X[Te]=we,W=0;W<1<<I[Te];W++)Q[we++]=Te;for(Q[we-1]=Te,oe=0,Te=0;Te<16;Te++)for(me[Te]=oe,W=0;W<1<<E[Te];W++)re[oe++]=Te;for(oe>>=7;Te<w;Te++)for(me[Te]=oe<<7,W=0;W<1<<E[Te]-7;W++)re[256+oe++]=Te;for(ye=0;ye<=T;ye++)ge[ye]=0;for(W=0;W<=143;)q[W*2+1]=8,W++,ge[8]++;for(;W<=255;)q[W*2+1]=9,W++,ge[9]++;for(;W<=279;)q[W*2+1]=7,W++,ge[7]++;for(;W<=287;)q[W*2+1]=8,W++,ge[8]++;for(G(q,m+1,ge),W=0;W<w;W++)J[W*2+1]=5,J[W*2]=Ne(W,5);V=new pe(q,I,h+1,m,T),ee=new pe(J,E,0,w,T),ce=new pe(new Array(0),U,0,A,M)}function j(W){var ye;for(ye=0;ye<m;ye++)W.dyn_ltree[ye*2]=0;for(ye=0;ye<w;ye++)W.dyn_dtree[ye*2]=0;for(ye=0;ye<A;ye++)W.bl_tree[ye*2]=0;W.dyn_ltree[P*2]=1,W.opt_len=W.static_len=0,W.last_lit=W.matches=0}function Y(W){W.bi_valid>8?Ee(W,W.bi_buf):W.bi_valid>0&&(W.pending_buf[W.pending++]=W.bi_buf),W.bi_buf=0,W.bi_valid=0}function L(W,ye,we,Te){Y(W),Te&&(Ee(W,we),Ee(W,~we)),a.arraySet(W.pending_buf,W.window,ye,we,W.pending),W.pending+=we}function x(W,ye,we,Te){var oe=ye*2,ge=we*2;return W[oe]<W[ge]||W[oe]===W[ge]&&Te[ye]<=Te[we]}function k(W,ye,we){for(var Te=W.heap[we],oe=we<<1;oe<=W.heap_len&&(oe<W.heap_len&&x(ye,W.heap[oe+1],W.heap[oe],W.depth)&&oe++,!x(ye,Te,W.heap[oe],W.depth));)W.heap[we]=W.heap[oe],we=oe,oe<<=1;W.heap[we]=Te}function F(W,ye,we){var Te,oe,ge=0,D,be;if(W.last_lit!==0)do Te=W.pending_buf[W.d_buf+ge*2]<<8|W.pending_buf[W.d_buf+ge*2+1],oe=W.pending_buf[W.l_buf+ge],ge++,Te===0?Fe(W,oe,ye):(D=Q[oe],Fe(W,D+h+1,ye),be=I[D],be!==0&&(oe-=X[D],Se(W,oe,be)),Te--,D=ve(Te),Fe(W,D,we),be=E[D],be!==0&&(Te-=me[D],Se(W,Te,be)));while(ge<W.last_lit);Fe(W,P,ye)}function K(W,ye){var we=ye.dyn_tree,Te=ye.stat_desc.static_tree,oe=ye.stat_desc.has_stree,ge=ye.stat_desc.elems,D,be,De=-1,C;for(W.heap_len=0,W.heap_max=v,D=0;D<ge;D++)we[D*2]!==0?(W.heap[++W.heap_len]=De=D,W.depth[D]=0):we[D*2+1]=0;for(;W.heap_len<2;)C=W.heap[++W.heap_len]=De<2?++De:0,we[C*2]=1,W.depth[C]=0,W.opt_len--,oe&&(W.static_len-=Te[C*2+1]);for(ye.max_code=De,D=W.heap_len>>1;D>=1;D--)k(W,we,D);C=ge;do D=W.heap[1],W.heap[1]=W.heap[W.heap_len--],k(W,we,1),be=W.heap[1],W.heap[--W.heap_max]=D,W.heap[--W.heap_max]=be,we[C*2]=we[D*2]+we[be*2],W.depth[C]=(W.depth[D]>=W.depth[be]?W.depth[D]:W.depth[be])+1,we[D*2+1]=we[be*2+1]=C,W.heap[1]=C++,k(W,we,1);while(W.heap_len>=2);W.heap[--W.heap_max]=W.heap[1],B(W,ye),G(we,De,W.bl_count)}function ie(W,ye,we){var Te,oe=-1,ge,D=ye[0*2+1],be=0,De=7,C=4;for(D===0&&(De=138,C=3),ye[(we+1)*2+1]=65535,Te=0;Te<=we;Te++)ge=D,D=ye[(Te+1)*2+1],!(++be<De&&ge===D)&&(be<C?W.bl_tree[ge*2]+=be:ge!==0?(ge!==oe&&W.bl_tree[ge*2]++,W.bl_tree[O*2]++):be<=10?W.bl_tree[ne*2]++:W.bl_tree[R*2]++,be=0,oe=ge,D===0?(De=138,C=3):ge===D?(De=6,C=3):(De=7,C=4))}function se(W,ye,we){var Te,oe=-1,ge,D=ye[0*2+1],be=0,De=7,C=4;for(D===0&&(De=138,C=3),Te=0;Te<=we;Te++)if(ge=D,D=ye[(Te+1)*2+1],!(++be<De&&ge===D)){if(be<C)do Fe(W,ge,W.bl_tree);while(--be!==0);else ge!==0?(ge!==oe&&(Fe(W,ge,W.bl_tree),be--),Fe(W,O,W.bl_tree),Se(W,be-3,2)):be<=10?(Fe(W,ne,W.bl_tree),Se(W,be-3,3)):(Fe(W,R,W.bl_tree),Se(W,be-11,7));be=0,oe=ge,D===0?(De=138,C=3):ge===D?(De=6,C=3):(De=7,C=4)}}function Ce(W){var ye;for(ie(W,W.dyn_ltree,W.l_desc.max_code),ie(W,W.dyn_dtree,W.d_desc.max_code),K(W,W.bl_desc),ye=A-1;ye>=3&&W.bl_tree[Z[ye]*2+1]===0;ye--);return W.opt_len+=3*(ye+1)+5+5+4,ye}function ke(W,ye,we,Te){var oe;for(Se(W,ye-257,5),Se(W,we-1,5),Se(W,Te-4,4),oe=0;oe<Te;oe++)Se(W,W.bl_tree[Z[oe]*2+1],3);se(W,W.dyn_ltree,ye-1),se(W,W.dyn_dtree,we-1)}function xe(W){var ye=4093624447,we;for(we=0;we<=31;we++,ye>>>=1)if(ye&1&&W.dyn_ltree[we*2]!==0)return s;if(W.dyn_ltree[9*2]!==0||W.dyn_ltree[10*2]!==0||W.dyn_ltree[13*2]!==0)return l;for(we=32;we<h;we++)if(W.dyn_ltree[we*2]!==0)return l;return s}var Be=!1;function Ie(W){Be||(z(),Be=!0),W.l_desc=new ue(W.dyn_ltree,V),W.d_desc=new ue(W.dyn_dtree,ee),W.bl_desc=new ue(W.bl_tree,ce),W.bi_buf=0,W.bi_valid=0,j(W)}function Ve(W,ye,we,Te){Se(W,(f<<1)+(Te?1:0),3),L(W,ye,we,!0)}function Re(W){Se(W,p<<1,3),Fe(W,P,q),_(W)}function He(W,ye,we,Te){var oe,ge,D=0;W.level>0?(W.strm.data_type===c&&(W.strm.data_type=xe(W)),K(W,W.l_desc),K(W,W.d_desc),D=Ce(W),oe=W.opt_len+3+7>>>3,ge=W.static_len+3+7>>>3,ge<=oe&&(oe=ge)):oe=ge=we+5,we+4<=oe&&ye!==-1?Ve(W,ye,we,Te):W.strategy===o||ge===oe?(Se(W,(p<<1)+(Te?1:0),3),F(W,q,J)):(Se(W,(d<<1)+(Te?1:0),3),ke(W,W.l_desc.max_code+1,W.d_desc.max_code+1,D+1),F(W,W.dyn_ltree,W.dyn_dtree)),j(W),Te&&Y(W)}function Ge(W,ye,we){return W.pending_buf[W.d_buf+W.last_lit*2]=ye>>>8&255,W.pending_buf[W.d_buf+W.last_lit*2+1]=ye&255,W.pending_buf[W.l_buf+W.last_lit]=we&255,W.last_lit++,ye===0?W.dyn_ltree[we*2]++:(W.matches++,ye--,W.dyn_ltree[(Q[we]+h+1)*2]++,W.dyn_dtree[ve(ye)*2]++),W.last_lit===W.lit_bufsize-1}i._tr_init=Ie,i._tr_stored_block=Ve,i._tr_flush_block=He,i._tr_tally=Ge,i._tr_align=Re},{"../utils/common":50}],62:[function(e,r,i){function a(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}r.exports=a},{}],63:[function(e,r,i){(function(a){typeof a>"u"||!a.version||a.version.indexOf("v0.")===0||a.version.indexOf("v1.")===0&&a.version.indexOf("v1.8.")!==0?r.exports={nextTick:o}:r.exports=a;function o(s,l,c,u){if(typeof s!="function")throw new TypeError('"callback" argument must be a function');var f=arguments.length,p,d;switch(f){case 0:case 1:return a.nextTick(s);case 2:return a.nextTick(function(){s.call(null,l)});case 3:return a.nextTick(function(){s.call(null,l,c)});case 4:return a.nextTick(function(){s.call(null,l,c,u)});default:for(p=new Array(f-1),d=0;d<p.length;)p[d++]=arguments[d];return a.nextTick(function(){s.apply(null,p)})}}}).call(this,e("_process"))},{_process:64}],64:[function(e,r,i){var a=r.exports={},o,s;function l(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?o=setTimeout:o=l}catch{o=l}try{typeof clearTimeout=="function"?s=clearTimeout:s=c}catch{s=c}})();function u(A){if(o===setTimeout)return setTimeout(A,0);if((o===l||!o)&&setTimeout)return o=setTimeout,setTimeout(A,0);try{return o(A,0)}catch{try{return o.call(null,A,0)}catch{return o.call(this,A,0)}}}function f(A){if(s===clearTimeout)return clearTimeout(A);if((s===c||!s)&&clearTimeout)return s=clearTimeout,clearTimeout(A);try{return s(A)}catch{try{return s.call(null,A)}catch{return s.call(this,A)}}}var p=[],d=!1,b,y=-1;function g(){!d||!b||(d=!1,b.length?p=b.concat(p):y=-1,p.length&&h())}function h(){if(!d){var A=u(g);d=!0;for(var v=p.length;v;){for(b=p,p=[];++y<v;)b&&b[y].run();y=-1,v=p.length}b=null,d=!1,f(A)}}a.nextTick=function(A){var v=new Array(arguments.length-1);if(arguments.length>1)for(var T=1;T<arguments.length;T++)v[T-1]=arguments[T];p.push(new m(A,v)),p.length===1&&!d&&u(h)};function m(A,v){this.fun=A,this.array=v}m.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function w(){}a.on=w,a.addListener=w,a.once=w,a.off=w,a.removeListener=w,a.removeAllListeners=w,a.emit=w,a.prependListener=w,a.prependOnceListener=w,a.listeners=function(A){return[]},a.binding=function(A){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(A){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],65:[function(e,r,i){r.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":66}],66:[function(e,r,i){var a=e("process-nextick-args"),o=Object.keys||function(g){var h=[];for(var m in g)h.push(m);return h};r.exports=d;var s=Object.create(e("core-util-is"));s.inherits=e("inherits");var l=e("./_stream_readable"),c=e("./_stream_writable");s.inherits(d,l);for(var u=o(c.prototype),f=0;f<u.length;f++){var p=u[f];d.prototype[p]||(d.prototype[p]=c.prototype[p])}function d(g){if(!(this instanceof d))return new d(g);l.call(this,g),c.call(this,g),g&&g.readable===!1&&(this.readable=!1),g&&g.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,g&&g.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",b)}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function b(){this.allowHalfOpen||this._writableState.ended||a.nextTick(y,this)}function y(g){g.end()}Object.defineProperty(d.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(g){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=g,this._writableState.destroyed=g)}}),d.prototype._destroy=function(g,h){this.push(null),this.end(),a.nextTick(h,g)}},{"./_stream_readable":68,"./_stream_writable":70,"core-util-is":4,inherits:8,"process-nextick-args":63}],67:[function(e,r,i){r.exports=s;var a=e("./_stream_transform"),o=Object.create(e("core-util-is"));o.inherits=e("inherits"),o.inherits(s,a);function s(l){if(!(this instanceof s))return new s(l);a.call(this,l)}s.prototype._transform=function(l,c,u){u(null,l)}},{"./_stream_transform":69,"core-util-is":4,inherits:8}],68:[function(e,r,i){(function(a,o){var s=e("process-nextick-args");r.exports=P;var l=e("isarray"),c;P.ReadableState=M,e("events").EventEmitter;var u=function(_,B){return _.listeners(B).length},f=e("./internal/streams/stream"),p=e("safe-buffer").Buffer,d=o.Uint8Array||function(){};function b(_){return p.from(_)}function y(_){return p.isBuffer(_)||_ instanceof d}var g=Object.create(e("core-util-is"));g.inherits=e("inherits");var h=e("util"),m=void 0;h&&h.debuglog?m=h.debuglog("stream"):m=function(){};var w=e("./internal/streams/BufferList"),A=e("./internal/streams/destroy"),v;g.inherits(P,f);var T=["error","close","destroy","pause","resume"];function N(_,B,G){if(typeof _.prependListener=="function")return _.prependListener(B,G);!_._events||!_._events[B]?_.on(B,G):l(_._events[B])?_._events[B].unshift(G):_._events[B]=[G,_._events[B]]}function M(_,B){c=c||e("./_stream_duplex"),_=_||{};var G=B instanceof c;this.objectMode=!!_.objectMode,G&&(this.objectMode=this.objectMode||!!_.readableObjectMode);var z=_.highWaterMark,j=_.readableHighWaterMark,Y=this.objectMode?16:16*1024;z||z===0?this.highWaterMark=z:G&&(j||j===0)?this.highWaterMark=j:this.highWaterMark=Y,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new w,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=_.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,_.encoding&&(v||(v=e("string_decoder/").StringDecoder),this.decoder=new v(_.encoding),this.encoding=_.encoding)}function P(_){if(c=c||e("./_stream_duplex"),!(this instanceof P))return new P(_);this._readableState=new M(_,this),this.readable=!0,_&&(typeof _.read=="function"&&(this._read=_.read),typeof _.destroy=="function"&&(this._destroy=_.destroy)),f.call(this)}Object.defineProperty(P.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(_){this._readableState&&(this._readableState.destroyed=_)}}),P.prototype.destroy=A.destroy,P.prototype._undestroy=A.undestroy,P.prototype._destroy=function(_,B){this.push(null),B(_)},P.prototype.push=function(_,B){var G=this._readableState,z;return G.objectMode?z=!0:typeof _=="string"&&(B=B||G.defaultEncoding,B!==G.encoding&&(_=p.from(_,B),B=""),z=!0),O(this,_,B,!1,z)},P.prototype.unshift=function(_){return O(this,_,null,!0,!1)};function O(_,B,G,z,j){var Y=_._readableState;if(B===null)Y.reading=!1,$(_,Y);else{var L;j||(L=R(Y,B)),L?_.emit("error",L):Y.objectMode||B&&B.length>0?(typeof B!="string"&&!Y.objectMode&&Object.getPrototypeOf(B)!==p.prototype&&(B=b(B)),z?Y.endEmitted?_.emit("error",new Error("stream.unshift() after end event")):ne(_,Y,B,!0):Y.ended?_.emit("error",new Error("stream.push() after EOF")):(Y.reading=!1,Y.decoder&&!G?(B=Y.decoder.write(B),Y.objectMode||B.length!==0?ne(_,Y,B,!1):re(_,Y)):ne(_,Y,B,!1))):z||(Y.reading=!1)}return I(Y)}function ne(_,B,G,z){B.flowing&&B.length===0&&!B.sync?(_.emit("data",G),_.read(0)):(B.length+=B.objectMode?1:G.length,z?B.buffer.unshift(G):B.buffer.push(G),B.needReadable&&q(_)),re(_,B)}function R(_,B){var G;return!y(B)&&typeof B!="string"&&B!==void 0&&!_.objectMode&&(G=new TypeError("Invalid non-string/buffer chunk")),G}function I(_){return!_.ended&&(_.needReadable||_.length<_.highWaterMark||_.length===0)}P.prototype.isPaused=function(){return this._readableState.flowing===!1},P.prototype.setEncoding=function(_){return v||(v=e("string_decoder/").StringDecoder),this._readableState.decoder=new v(_),this._readableState.encoding=_,this};var E=8388608;function U(_){return _>=E?_=E:(_--,_|=_>>>1,_|=_>>>2,_|=_>>>4,_|=_>>>8,_|=_>>>16,_++),_}function Z(_,B){return _<=0||B.length===0&&B.ended?0:B.objectMode?1:_!==_?B.flowing&&B.length?B.buffer.head.data.length:B.length:(_>B.highWaterMark&&(B.highWaterMark=U(_)),_<=B.length?_:B.ended?B.length:(B.needReadable=!0,0))}P.prototype.read=function(_){m("read",_),_=parseInt(_,10);var B=this._readableState,G=_;if(_!==0&&(B.emittedReadable=!1),_===0&&B.needReadable&&(B.length>=B.highWaterMark||B.ended))return m("read: emitReadable",B.length,B.ended),B.length===0&&B.ended?Se(this):q(this),null;if(_=Z(_,B),_===0&&B.ended)return B.length===0&&Se(this),null;var z=B.needReadable;m("need readable",z),(B.length===0||B.length-_<B.highWaterMark)&&(z=!0,m("length less than watermark",z)),B.ended||B.reading?(z=!1,m("reading or ended",z)):z&&(m("do read"),B.reading=!0,B.sync=!0,B.length===0&&(B.needReadable=!0),this._read(B.highWaterMark),B.sync=!1,B.reading||(_=Z(G,B)));var j;return _>0?j=ce(_,B):j=null,j===null?(B.needReadable=!0,_=0):B.length-=_,B.length===0&&(B.ended||(B.needReadable=!0),G!==_&&B.ended&&Se(this)),j!==null&&this.emit("data",j),j};function $(_,B){if(!B.ended){if(B.decoder){var G=B.decoder.end();G&&G.length&&(B.buffer.push(G),B.length+=B.objectMode?1:G.length)}B.ended=!0,q(_)}}function q(_){var B=_._readableState;B.needReadable=!1,B.emittedReadable||(m("emitReadable",B.flowing),B.emittedReadable=!0,B.sync?s.nextTick(J,_):J(_))}function J(_){m("emit readable"),_.emit("readable"),ee(_)}function re(_,B){B.readingMore||(B.readingMore=!0,s.nextTick(Q,_,B))}function Q(_,B){for(var G=B.length;!B.reading&&!B.flowing&&!B.ended&&B.length<B.highWaterMark&&(m("maybeReadMore read 0"),_.read(0),G!==B.length);)G=B.length;B.readingMore=!1}P.prototype._read=function(_){this.emit("error",new Error("_read() is not implemented"))},P.prototype.pipe=function(_,B){var G=this,z=this._readableState;switch(z.pipesCount){case 0:z.pipes=_;break;case 1:z.pipes=[z.pipes,_];break;default:z.pipes.push(_);break}z.pipesCount+=1,m("pipe count=%d opts=%j",z.pipesCount,B);var j=(!B||B.end!==!1)&&_!==a.stdout&&_!==a.stderr,Y=j?x:Be;z.endEmitted?s.nextTick(Y):G.once("end",Y),_.on("unpipe",L);function L(Ie,Ve){m("onunpipe"),Ie===G&&Ve&&Ve.hasUnpiped===!1&&(Ve.hasUnpiped=!0,K())}function x(){m("onend"),_.end()}var k=X(G);_.on("drain",k);var F=!1;function K(){m("cleanup"),_.removeListener("close",ke),_.removeListener("finish",xe),_.removeListener("drain",k),_.removeListener("error",Ce),_.removeListener("unpipe",L),G.removeListener("end",x),G.removeListener("end",Be),G.removeListener("data",se),F=!0,z.awaitDrain&&(!_._writableState||_._writableState.needDrain)&&k()}var ie=!1;G.on("data",se);function se(Ie){m("ondata"),ie=!1;var Ve=_.write(Ie);Ve===!1&&!ie&&((z.pipesCount===1&&z.pipes===_||z.pipesCount>1&&Ne(z.pipes,_)!==-1)&&!F&&(m("false write response, pause",G._readableState.awaitDrain),G._readableState.awaitDrain++,ie=!0),G.pause())}function Ce(Ie){m("onerror",Ie),Be(),_.removeListener("error",Ce),u(_,"error")===0&&_.emit("error",Ie)}N(_,"error",Ce);function ke(){_.removeListener("finish",xe),Be()}_.once("close",ke);function xe(){m("onfinish"),_.removeListener("close",ke),Be()}_.once("finish",xe);function Be(){m("unpipe"),G.unpipe(_)}return _.emit("pipe",G),z.flowing||(m("pipe resume"),G.resume()),_};function X(_){return function(){var B=_._readableState;m("pipeOnDrain",B.awaitDrain),B.awaitDrain&&B.awaitDrain--,B.awaitDrain===0&&u(_,"data")&&(B.flowing=!0,ee(_))}}P.prototype.unpipe=function(_){var B=this._readableState,G={hasUnpiped:!1};if(B.pipesCount===0)return this;if(B.pipesCount===1)return _&&_!==B.pipes?this:(_||(_=B.pipes),B.pipes=null,B.pipesCount=0,B.flowing=!1,_&&_.emit("unpipe",this,G),this);if(!_){var z=B.pipes,j=B.pipesCount;B.pipes=null,B.pipesCount=0,B.flowing=!1;for(var Y=0;Y<j;Y++)z[Y].emit("unpipe",this,G);return this}var L=Ne(B.pipes,_);return L===-1?this:(B.pipes.splice(L,1),B.pipesCount-=1,B.pipesCount===1&&(B.pipes=B.pipes[0]),_.emit("unpipe",this,G),this)},P.prototype.on=function(_,B){var G=f.prototype.on.call(this,_,B);if(_==="data")this._readableState.flowing!==!1&&this.resume();else if(_==="readable"){var z=this._readableState;!z.endEmitted&&!z.readableListening&&(z.readableListening=z.needReadable=!0,z.emittedReadable=!1,z.reading?z.length&&q(this):s.nextTick(me,this))}return G},P.prototype.addListener=P.prototype.on;function me(_){m("readable nexttick read 0"),_.read(0)}P.prototype.resume=function(){var _=this._readableState;return _.flowing||(m("resume"),_.flowing=!0,pe(this,_)),this};function pe(_,B){B.resumeScheduled||(B.resumeScheduled=!0,s.nextTick(V,_,B))}function V(_,B){B.reading||(m("resume read 0"),_.read(0)),B.resumeScheduled=!1,B.awaitDrain=0,_.emit("resume"),ee(_),B.flowing&&!B.reading&&_.read(0)}P.prototype.pause=function(){return m("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(m("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function ee(_){var B=_._readableState;for(m("flow",B.flowing);B.flowing&&_.read()!==null;);}P.prototype.wrap=function(_){var B=this,G=this._readableState,z=!1;_.on("end",function(){if(m("wrapped end"),G.decoder&&!G.ended){var L=G.decoder.end();L&&L.length&&B.push(L)}B.push(null)}),_.on("data",function(L){if(m("wrapped data"),G.decoder&&(L=G.decoder.write(L)),!(G.objectMode&&L==null)&&!(!G.objectMode&&(!L||!L.length))){var x=B.push(L);x||(z=!0,_.pause())}});for(var j in _)this[j]===void 0&&typeof _[j]=="function"&&(this[j]=function(L){return function(){return _[L].apply(_,arguments)}}(j));for(var Y=0;Y<T.length;Y++)_.on(T[Y],this.emit.bind(this,T[Y]));return this._read=function(L){m("wrapped _read",L),z&&(z=!1,_.resume())},this},Object.defineProperty(P.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),P._fromList=ce;function ce(_,B){if(B.length===0)return null;var G;return B.objectMode?G=B.buffer.shift():!_||_>=B.length?(B.decoder?G=B.buffer.join(""):B.buffer.length===1?G=B.buffer.head.data:G=B.buffer.concat(B.length),B.buffer.clear()):G=ue(_,B.buffer,B.decoder),G}function ue(_,B,G){var z;return _<B.head.data.length?(z=B.head.data.slice(0,_),B.head.data=B.head.data.slice(_)):_===B.head.data.length?z=B.shift():z=G?ve(_,B):Ee(_,B),z}function ve(_,B){var G=B.head,z=1,j=G.data;for(_-=j.length;G=G.next;){var Y=G.data,L=_>Y.length?Y.length:_;if(L===Y.length?j+=Y:j+=Y.slice(0,_),_-=L,_===0){L===Y.length?(++z,G.next?B.head=G.next:B.head=B.tail=null):(B.head=G,G.data=Y.slice(L));break}++z}return B.length-=z,j}function Ee(_,B){var G=p.allocUnsafe(_),z=B.head,j=1;for(z.data.copy(G),_-=z.data.length;z=z.next;){var Y=z.data,L=_>Y.length?Y.length:_;if(Y.copy(G,G.length-_,0,L),_-=L,_===0){L===Y.length?(++j,z.next?B.head=z.next:B.head=B.tail=null):(B.head=z,z.data=Y.slice(L));break}++j}return B.length-=j,G}function Se(_){var B=_._readableState;if(B.length>0)throw new Error('"endReadable()" called on non-empty stream');B.endEmitted||(B.ended=!0,s.nextTick(Fe,B,_))}function Fe(_,B){!_.endEmitted&&_.length===0&&(_.endEmitted=!0,B.readable=!1,B.emit("end"))}function Ne(_,B){for(var G=0,z=_.length;G<z;G++)if(_[G]===B)return G;return-1}}).call(this,e("_process"),typeof Ot<"u"?Ot:typeof self<"u"?self:typeof window<"u"?window:{})},{"./_stream_duplex":66,"./internal/streams/BufferList":71,"./internal/streams/destroy":72,"./internal/streams/stream":73,_process:64,"core-util-is":4,events:5,inherits:8,isarray:10,"process-nextick-args":63,"safe-buffer":78,"string_decoder/":81,util:2}],69:[function(e,r,i){r.exports=l;var a=e("./_stream_duplex"),o=Object.create(e("core-util-is"));o.inherits=e("inherits"),o.inherits(l,a);function s(f,p){var d=this._transformState;d.transforming=!1;var b=d.writecb;if(!b)return this.emit("error",new Error("write callback called multiple times"));d.writechunk=null,d.writecb=null,p!=null&&this.push(p),b(f);var y=this._readableState;y.reading=!1,(y.needReadable||y.length<y.highWaterMark)&&this._read(y.highWaterMark)}function l(f){if(!(this instanceof l))return new l(f);a.call(this,f),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,f&&(typeof f.transform=="function"&&(this._transform=f.transform),typeof f.flush=="function"&&(this._flush=f.flush)),this.on("prefinish",c)}function c(){var f=this;typeof this._flush=="function"?this._flush(function(p,d){u(f,p,d)}):u(this,null,null)}l.prototype.push=function(f,p){return this._transformState.needTransform=!1,a.prototype.push.call(this,f,p)},l.prototype._transform=function(f,p,d){throw new Error("_transform() is not implemented")},l.prototype._write=function(f,p,d){var b=this._transformState;if(b.writecb=d,b.writechunk=f,b.writeencoding=p,!b.transforming){var y=this._readableState;(b.needTransform||y.needReadable||y.length<y.highWaterMark)&&this._read(y.highWaterMark)}},l.prototype._read=function(f){var p=this._transformState;p.writechunk!==null&&p.writecb&&!p.transforming?(p.transforming=!0,this._transform(p.writechunk,p.writeencoding,p.afterTransform)):p.needTransform=!0},l.prototype._destroy=function(f,p){var d=this;a.prototype._destroy.call(this,f,function(b){p(b),d.emit("close")})};function u(f,p,d){if(p)return f.emit("error",p);if(d!=null&&f.push(d),f._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(f._transformState.transforming)throw new Error("Calling transform done when still transforming");return f.push(null)}},{"./_stream_duplex":66,"core-util-is":4,inherits:8}],70:[function(e,r,i){(function(a,o,s){var l=e("process-nextick-args");r.exports=N;function c(V){var ee=this;this.next=null,this.entry=null,this.finish=function(){pe(ee,V)}}var u=!a.browser&&["v0.10","v0.9."].indexOf(a.version.slice(0,5))>-1?s:l.nextTick,f;N.WritableState=v;var p=Object.create(e("core-util-is"));p.inherits=e("inherits");var d={deprecate:e("util-deprecate")},b=e("./internal/streams/stream"),y=e("safe-buffer").Buffer,g=o.Uint8Array||function(){};function h(V){return y.from(V)}function m(V){return y.isBuffer(V)||V instanceof g}var w=e("./internal/streams/destroy");p.inherits(N,b);function A(){}function v(V,ee){f=f||e("./_stream_duplex"),V=V||{};var ce=ee instanceof f;this.objectMode=!!V.objectMode,ce&&(this.objectMode=this.objectMode||!!V.writableObjectMode);var ue=V.highWaterMark,ve=V.writableHighWaterMark,Ee=this.objectMode?16:16*1024;ue||ue===0?this.highWaterMark=ue:ce&&(ve||ve===0)?this.highWaterMark=ve:this.highWaterMark=Ee,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Se=V.decodeStrings===!1;this.decodeStrings=!Se,this.defaultEncoding=V.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Fe){U(ee,Fe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new c(this)}v.prototype.getBuffer=function(){for(var ee=this.bufferedRequest,ce=[];ee;)ce.push(ee),ee=ee.next;return ce},function(){try{Object.defineProperty(v.prototype,"buffer",{get:d.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var T;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(T=Function.prototype[Symbol.hasInstance],Object.defineProperty(N,Symbol.hasInstance,{value:function(V){return T.call(this,V)?!0:this!==N?!1:V&&V._writableState instanceof v}})):T=function(V){return V instanceof this};function N(V){if(f=f||e("./_stream_duplex"),!T.call(N,this)&&!(this instanceof f))return new N(V);this._writableState=new v(V,this),this.writable=!0,V&&(typeof V.write=="function"&&(this._write=V.write),typeof V.writev=="function"&&(this._writev=V.writev),typeof V.destroy=="function"&&(this._destroy=V.destroy),typeof V.final=="function"&&(this._final=V.final)),b.call(this)}N.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function M(V,ee){var ce=new Error("write after end");V.emit("error",ce),l.nextTick(ee,ce)}function P(V,ee,ce,ue){var ve=!0,Ee=!1;return ce===null?Ee=new TypeError("May not write null values to stream"):typeof ce!="string"&&ce!==void 0&&!ee.objectMode&&(Ee=new TypeError("Invalid non-string/buffer chunk")),Ee&&(V.emit("error",Ee),l.nextTick(ue,Ee),ve=!1),ve}N.prototype.write=function(V,ee,ce){var ue=this._writableState,ve=!1,Ee=!ue.objectMode&&m(V);return Ee&&!y.isBuffer(V)&&(V=h(V)),typeof ee=="function"&&(ce=ee,ee=null),Ee?ee="buffer":ee||(ee=ue.defaultEncoding),typeof ce!="function"&&(ce=A),ue.ended?M(this,ce):(Ee||P(this,ue,V,ce))&&(ue.pendingcb++,ve=ne(this,ue,Ee,V,ee,ce)),ve},N.prototype.cork=function(){var V=this._writableState;V.corked++},N.prototype.uncork=function(){var V=this._writableState;V.corked&&(V.corked--,!V.writing&&!V.corked&&!V.finished&&!V.bufferProcessing&&V.bufferedRequest&&q(this,V))},N.prototype.setDefaultEncoding=function(ee){if(typeof ee=="string"&&(ee=ee.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ee+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+ee);return this._writableState.defaultEncoding=ee,this};function O(V,ee,ce){return!V.objectMode&&V.decodeStrings!==!1&&typeof ee=="string"&&(ee=y.from(ee,ce)),ee}Object.defineProperty(N.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ne(V,ee,ce,ue,ve,Ee){if(!ce){var Se=O(ee,ue,ve);ue!==Se&&(ce=!0,ve="buffer",ue=Se)}var Fe=ee.objectMode?1:ue.length;ee.length+=Fe;var Ne=ee.length<ee.highWaterMark;if(Ne||(ee.needDrain=!0),ee.writing||ee.corked){var _=ee.lastBufferedRequest;ee.lastBufferedRequest={chunk:ue,encoding:ve,isBuf:ce,callback:Ee,next:null},_?_.next=ee.lastBufferedRequest:ee.bufferedRequest=ee.lastBufferedRequest,ee.bufferedRequestCount+=1}else R(V,ee,!1,Fe,ue,ve,Ee);return Ne}function R(V,ee,ce,ue,ve,Ee,Se){ee.writelen=ue,ee.writecb=Se,ee.writing=!0,ee.sync=!0,ce?V._writev(ve,ee.onwrite):V._write(ve,Ee,ee.onwrite),ee.sync=!1}function I(V,ee,ce,ue,ve){--ee.pendingcb,ce?(l.nextTick(ve,ue),l.nextTick(X,V,ee),V._writableState.errorEmitted=!0,V.emit("error",ue)):(ve(ue),V._writableState.errorEmitted=!0,V.emit("error",ue),X(V,ee))}function E(V){V.writing=!1,V.writecb=null,V.length-=V.writelen,V.writelen=0}function U(V,ee){var ce=V._writableState,ue=ce.sync,ve=ce.writecb;if(E(ce),ee)I(V,ce,ue,ee,ve);else{var Ee=J(ce);!Ee&&!ce.corked&&!ce.bufferProcessing&&ce.bufferedRequest&&q(V,ce),ue?u(Z,V,ce,Ee,ve):Z(V,ce,Ee,ve)}}function Z(V,ee,ce,ue){ce||$(V,ee),ee.pendingcb--,ue(),X(V,ee)}function $(V,ee){ee.length===0&&ee.needDrain&&(ee.needDrain=!1,V.emit("drain"))}function q(V,ee){ee.bufferProcessing=!0;var ce=ee.bufferedRequest;if(V._writev&&ce&&ce.next){var ue=ee.bufferedRequestCount,ve=new Array(ue),Ee=ee.corkedRequestsFree;Ee.entry=ce;for(var Se=0,Fe=!0;ce;)ve[Se]=ce,ce.isBuf||(Fe=!1),ce=ce.next,Se+=1;ve.allBuffers=Fe,R(V,ee,!0,ee.length,ve,"",Ee.finish),ee.pendingcb++,ee.lastBufferedRequest=null,Ee.next?(ee.corkedRequestsFree=Ee.next,Ee.next=null):ee.corkedRequestsFree=new c(ee),ee.bufferedRequestCount=0}else{for(;ce;){var Ne=ce.chunk,_=ce.encoding,B=ce.callback,G=ee.objectMode?1:Ne.length;if(R(V,ee,!1,G,Ne,_,B),ce=ce.next,ee.bufferedRequestCount--,ee.writing)break}ce===null&&(ee.lastBufferedRequest=null)}ee.bufferedRequest=ce,ee.bufferProcessing=!1}N.prototype._write=function(V,ee,ce){ce(new Error("_write() is not implemented"))},N.prototype._writev=null,N.prototype.end=function(V,ee,ce){var ue=this._writableState;typeof V=="function"?(ce=V,V=null,ee=null):typeof ee=="function"&&(ce=ee,ee=null),V!=null&&this.write(V,ee),ue.corked&&(ue.corked=1,this.uncork()),!ue.ending&&!ue.finished&&me(this,ue,ce)};function J(V){return V.ending&&V.length===0&&V.bufferedRequest===null&&!V.finished&&!V.writing}function re(V,ee){V._final(function(ce){ee.pendingcb--,ce&&V.emit("error",ce),ee.prefinished=!0,V.emit("prefinish"),X(V,ee)})}function Q(V,ee){!ee.prefinished&&!ee.finalCalled&&(typeof V._final=="function"?(ee.pendingcb++,ee.finalCalled=!0,l.nextTick(re,V,ee)):(ee.prefinished=!0,V.emit("prefinish")))}function X(V,ee){var ce=J(ee);return ce&&(Q(V,ee),ee.pendingcb===0&&(ee.finished=!0,V.emit("finish"))),ce}function me(V,ee,ce){ee.ending=!0,X(V,ee),ce&&(ee.finished?l.nextTick(ce):V.once("finish",ce)),ee.ended=!0,V.writable=!1}function pe(V,ee,ce){var ue=V.entry;for(V.entry=null;ue;){var ve=ue.callback;ee.pendingcb--,ve(ce),ue=ue.next}ee.corkedRequestsFree?ee.corkedRequestsFree.next=V:ee.corkedRequestsFree=V}Object.defineProperty(N.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(V){this._writableState&&(this._writableState.destroyed=V)}}),N.prototype.destroy=w.destroy,N.prototype._undestroy=w.undestroy,N.prototype._destroy=function(V,ee){this.end(),ee(V)}}).call(this,e("_process"),typeof Ot<"u"?Ot:typeof self<"u"?self:typeof window<"u"?window:{},e("timers").setImmediate)},{"./_stream_duplex":66,"./internal/streams/destroy":72,"./internal/streams/stream":73,_process:64,"core-util-is":4,inherits:8,"process-nextick-args":63,"safe-buffer":78,timers:82,"util-deprecate":83}],71:[function(e,r,i){function a(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}var o=e("safe-buffer").Buffer,s=e("util");function l(c,u,f){c.copy(u,f)}r.exports=function(){function c(){a(this,c),this.head=null,this.tail=null,this.length=0}return c.prototype.push=function(f){var p={data:f,next:null};this.length>0?this.tail.next=p:this.head=p,this.tail=p,++this.length},c.prototype.unshift=function(f){var p={data:f,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length},c.prototype.shift=function(){if(this.length!==0){var f=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,f}},c.prototype.clear=function(){this.head=this.tail=null,this.length=0},c.prototype.join=function(f){if(this.length===0)return"";for(var p=this.head,d=""+p.data;p=p.next;)d+=f+p.data;return d},c.prototype.concat=function(f){if(this.length===0)return o.alloc(0);if(this.length===1)return this.head.data;for(var p=o.allocUnsafe(f>>>0),d=this.head,b=0;d;)l(d.data,p,b),b+=d.data.length,d=d.next;return p},c}(),s&&s.inspect&&s.inspect.custom&&(r.exports.prototype[s.inspect.custom]=function(){var c=s.inspect({length:this.length});return this.constructor.name+" "+c})},{"safe-buffer":78,util:2}],72:[function(e,r,i){var a=e("process-nextick-args");function o(c,u){var f=this,p=this._readableState&&this._readableState.destroyed,d=this._writableState&&this._writableState.destroyed;return p||d?(u?u(c):c&&(!this._writableState||!this._writableState.errorEmitted)&&a.nextTick(l,this,c),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(c||null,function(b){!u&&b?(a.nextTick(l,f,b),f._writableState&&(f._writableState.errorEmitted=!0)):u&&u(b)}),this)}function s(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function l(c,u){c.emit("error",u)}r.exports={destroy:o,undestroy:s}},{"process-nextick-args":63}],73:[function(e,r,i){r.exports=e("events").EventEmitter},{events:5}],74:[function(e,r,i){r.exports=e("./readable").PassThrough},{"./readable":75}],75:[function(e,r,i){i=r.exports=e("./lib/_stream_readable.js"),i.Stream=i,i.Readable=i,i.Writable=e("./lib/_stream_writable.js"),i.Duplex=e("./lib/_stream_duplex.js"),i.Transform=e("./lib/_stream_transform.js"),i.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":66,"./lib/_stream_passthrough.js":67,"./lib/_stream_readable.js":68,"./lib/_stream_transform.js":69,"./lib/_stream_writable.js":70}],76:[function(e,r,i){r.exports=e("./readable").Transform},{"./readable":75}],77:[function(e,r,i){r.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":70}],78:[function(e,r,i){var a=e("buffer"),o=a.Buffer;function s(c,u){for(var f in c)u[f]=c[f]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?r.exports=a:(s(a,i),i.Buffer=l);function l(c,u,f){return o(c,u,f)}s(o,l),l.from=function(c,u,f){if(typeof c=="number")throw new TypeError("Argument must not be a number");return o(c,u,f)},l.alloc=function(c,u,f){if(typeof c!="number")throw new TypeError("Argument must be a number");var p=o(c);return u!==void 0?typeof f=="string"?p.fill(u,f):p.fill(u):p.fill(0),p},l.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return o(c)},l.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return a.SlowBuffer(c)}},{buffer:3}],79:[function(e,r,i){(function(a){r.exports=typeof a=="function"?a:function(){var s=[].slice.apply(arguments);s.splice(1,0,0),setTimeout.apply(null,s)}}).call(this,e("timers").setImmediate)},{timers:82}],80:[function(e,r,i){r.exports=s;var a=e("events").EventEmitter,o=e("inherits");o(s,a),s.Readable=e("readable-stream/readable.js"),s.Writable=e("readable-stream/writable.js"),s.Duplex=e("readable-stream/duplex.js"),s.Transform=e("readable-stream/transform.js"),s.PassThrough=e("readable-stream/passthrough.js"),s.Stream=s;function s(){a.call(this)}s.prototype.pipe=function(l,c){var u=this;function f(m){l.writable&&l.write(m)===!1&&u.pause&&u.pause()}u.on("data",f);function p(){u.readable&&u.resume&&u.resume()}l.on("drain",p),!l._isStdio&&(!c||c.end!==!1)&&(u.on("end",b),u.on("close",y));var d=!1;function b(){d||(d=!0,l.end())}function y(){d||(d=!0,typeof l.destroy=="function"&&l.destroy())}function g(m){if(h(),a.listenerCount(this,"error")===0)throw m}u.on("error",g),l.on("error",g);function h(){u.removeListener("data",f),l.removeListener("drain",p),u.removeListener("end",b),u.removeListener("close",y),u.removeListener("error",g),l.removeListener("error",g),u.removeListener("end",h),u.removeListener("close",h),l.removeListener("close",h)}return u.on("end",h),u.on("close",h),l.on("close",h),l.emit("pipe",u),l}},{events:5,inherits:8,"readable-stream/duplex.js":65,"readable-stream/passthrough.js":74,"readable-stream/readable.js":75,"readable-stream/transform.js":76,"readable-stream/writable.js":77}],81:[function(e,r,i){var a=e("safe-buffer").Buffer,o=a.isEncoding||function(T){switch(T=""+T,T&&T.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(T){if(!T)return"utf8";for(var N;;)switch(T){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return T;default:if(N)return;T=(""+T).toLowerCase(),N=!0}}function l(T){var N=s(T);if(typeof N!="string"&&(a.isEncoding===o||!o(T)))throw new Error("Unknown encoding: "+T);return N||T}i.StringDecoder=c;function c(T){this.encoding=l(T);var N;switch(this.encoding){case"utf16le":this.text=g,this.end=h,N=4;break;case"utf8":this.fillLast=d,N=4;break;case"base64":this.text=m,this.end=w,N=3;break;default:this.write=A,this.end=v;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=a.allocUnsafe(N)}c.prototype.write=function(T){if(T.length===0)return"";var N,M;if(this.lastNeed){if(N=this.fillLast(T),N===void 0)return"";M=this.lastNeed,this.lastNeed=0}else M=0;return M<T.length?N?N+this.text(T,M):this.text(T,M):N||""},c.prototype.end=y,c.prototype.text=b,c.prototype.fillLast=function(T){if(this.lastNeed<=T.length)return T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,T.length),this.lastNeed-=T.length};function u(T){return T<=127?0:T>>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function f(T,N,M){var P=N.length-1;if(P<M)return 0;var O=u(N[P]);return O>=0?(O>0&&(T.lastNeed=O-1),O):--P<M||O===-2?0:(O=u(N[P]),O>=0?(O>0&&(T.lastNeed=O-2),O):--P<M||O===-2?0:(O=u(N[P]),O>=0?(O>0&&(O===2?O=0:T.lastNeed=O-3),O):0))}function p(T,N,M){if((N[0]&192)!==128)return T.lastNeed=0,"�";if(T.lastNeed>1&&N.length>1){if((N[1]&192)!==128)return T.lastNeed=1,"�";if(T.lastNeed>2&&N.length>2&&(N[2]&192)!==128)return T.lastNeed=2,"�"}}function d(T){var N=this.lastTotal-this.lastNeed,M=p(this,T);if(M!==void 0)return M;if(this.lastNeed<=T.length)return T.copy(this.lastChar,N,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,N,0,T.length),this.lastNeed-=T.length}function b(T,N){var M=f(this,T,N);if(!this.lastNeed)return T.toString("utf8",N);this.lastTotal=M;var P=T.length-(M-this.lastNeed);return T.copy(this.lastChar,0,P),T.toString("utf8",N,P)}function y(T){var N=T&&T.length?this.write(T):"";return this.lastNeed?N+"�":N}function g(T,N){if((T.length-N)%2===0){var M=T.toString("utf16le",N);if(M){var P=M.charCodeAt(M.length-1);if(P>=55296&&P<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],M.slice(0,-1)}return M}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",N,T.length-1)}function h(T){var N=T&&T.length?this.write(T):"";if(this.lastNeed){var M=this.lastTotal-this.lastNeed;return N+this.lastChar.toString("utf16le",0,M)}return N}function m(T,N){var M=(T.length-N)%3;return M===0?T.toString("base64",N):(this.lastNeed=3-M,this.lastTotal=3,M===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",N,T.length-M))}function w(T){var N=T&&T.length?this.write(T):"";return this.lastNeed?N+this.lastChar.toString("base64",0,3-this.lastNeed):N}function A(T){return T.toString(this.encoding)}function v(T){return T&&T.length?this.write(T):""}},{"safe-buffer":78}],82:[function(e,r,i){(function(a,o){var s=e("process/browser.js").nextTick,l=Function.prototype.apply,c=Array.prototype.slice,u={},f=0;i.setTimeout=function(){return new p(l.call(setTimeout,window,arguments),clearTimeout)},i.setInterval=function(){return new p(l.call(setInterval,window,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(d){d.close()};function p(d,b){this._id=d,this._clearFn=b}p.prototype.unref=p.prototype.ref=function(){},p.prototype.close=function(){this._clearFn.call(window,this._id)},i.enroll=function(d,b){clearTimeout(d._idleTimeoutId),d._idleTimeout=b},i.unenroll=function(d){clearTimeout(d._idleTimeoutId),d._idleTimeout=-1},i._unrefActive=i.active=function(d){clearTimeout(d._idleTimeoutId);var b=d._idleTimeout;b>=0&&(d._idleTimeoutId=setTimeout(function(){d._onTimeout&&d._onTimeout()},b))},i.setImmediate=typeof a=="function"?a:function(d){var b=f++,y=arguments.length<2?!1:c.call(arguments,1);return u[b]=!0,s(function(){u[b]&&(y?d.apply(null,y):d.call(null),i.clearImmediate(b))}),b},i.clearImmediate=typeof o=="function"?o:function(d){delete u[d]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":64,timers:82}],83:[function(e,r,i){(function(a){r.exports=o;function o(l,c){if(s("noDeprecation"))return l;var u=!1;function f(){if(!u){if(s("throwDeprecation"))throw new Error(c);s("traceDeprecation")?console.trace(c):console.warn(c),u=!0}return l.apply(this,arguments)}return f}function s(l){try{if(!a.localStorage)return!1}catch{return!1}var c=a.localStorage[l];return c==null?!1:String(c).toLowerCase()==="true"}}).call(this,typeof Ot<"u"?Ot:typeof self<"u"?self:typeof window<"u"?window:{})},{}],84:[function(e,r,i){var a=function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(i,"__esModule",{value:!0}),i.HandleZip=void 0;var o=a(e("jszip")),s=e("./common/method"),l=function(){function c(u){this.uploadFile=u}return c.prototype.unzipFile=function(u,f){o.default.loadAsync(this.uploadFile).then(function(p){var d={},b=Object.keys(p.files).length,y=0;p.forEach(function(g,h){var m=h.name,w=m.split("."),A=w[w.length-1].toLowerCase(),v="string";A in{png:1,jpeg:1,jpg:1,gif:1,bmp:1,tif:1,webp:1}?v="base64":A=="emf"&&(v="arraybuffer"),h.async(v).then(function(T){v=="base64"&&(T="data:image/"+A+";base64,"+T),d[h.name]=T,b==y+1&&u(d),y++})})},function(p){f(p)})},c.prototype.unzipFileByUrl=function(u,f,p){new o.default,s.getBinaryContent(u,function(d,b){if(d)throw d;o.default.loadAsync(b).then(function(y){var g={},h=Object.keys(y.files).length,m=0;y.forEach(function(w,A){var v=A.name,T=v.split("."),N=T[T.length-1].toLowerCase(),M="string";N in{png:1,jpeg:1,jpg:1,gif:1,bmp:1,tif:1,webp:1}?M="base64":N=="emf"&&(M="arraybuffer"),A.async(M).then(function(P){M=="base64"&&(P="data:image/"+N+";base64,"+P),g[A.name]=P,h==m+1&&f(g),m++})})},function(y){p(y)})})},c.prototype.newZipFile=function(){var u=new o.default;this.workBook=u},c.prototype.addToZipFile=function(u,f){if(this.workBook==null){var p=new o.default;this.workBook=p}this.workBook.file(u,f)},c}();i.HandleZip=l},{"./common/method":93,jszip:20}],85:[function(e,r,i){Object.defineProperty(i,"__esModule",{value:!0}),i.LuckyImageBase=i.LuckysheetCalcChain=i.LuckySheetConfigMerge=i.LuckySheetborderInfoCellValueStyle=i.LuckySheetborderInfoCellValue=i.LuckySheetborderInfoCellForImp=i.LuckyConfig=i.LuckyInlineString=i.LuckySheetCellFormat=i.LuckySheetCelldataValue=i.LuckySheetCelldataBase=i.LuckyFileInfo=i.LuckySheetBase=i.LuckyFileBase=void 0;var a=function(){function w(){}return w}();i.LuckyFileBase=a;var o=function(){function w(){}return w}();i.LuckySheetBase=o;var s=function(){function w(){}return w}();i.LuckyFileInfo=s;var l=function(){function w(){}return w}();i.LuckySheetCelldataBase=l;var c=function(){function w(){}return w}();i.LuckySheetCelldataValue=c;var u=function(){function w(){}return w}();i.LuckySheetCellFormat=u;var f=function(){function w(){}return w}();i.LuckyInlineString=f;var p=function(){function w(){}return w}();i.LuckyConfig=p;var d=function(){function w(){}return w}();i.LuckySheetborderInfoCellForImp=d;var b=function(){function w(){}return w}();i.LuckySheetborderInfoCellValue=b;var y=function(){function w(){}return w}();i.LuckySheetborderInfoCellValueStyle=y;var g=function(){function w(){}return w}();i.LuckySheetConfigMerge=g;var h=function(){function w(){}return w}();i.LuckysheetCalcChain=h;var m=function(){function w(){}return w}();i.LuckyImageBase=m},{}],86:[function(e,r,i){var a=function(){var f=function(d,b){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,g){y.__proto__=g}||function(y,g){for(var h in g)g.hasOwnProperty(h)&&(y[h]=g[h])},f(d,b)};return function(p,d){f(p,d);function b(){this.constructor=p}p.prototype=d===null?Object.create(d):(b.prototype=d.prototype,new b)}}();Object.defineProperty(i,"__esModule",{value:!0}),i.LuckySheetCelldata=void 0;var o=e("./ReadXml"),s=e("../common/method"),l=e("../common/constant"),c=e("./LuckyBase"),u=function(f){a(p,f);function p(d,b,y,g,h,m){var w=f.call(this)||this;w.cell=d,w.sheetFile=h,w.styles=b,w.sharedStrings=y,w.readXml=m,w.mergeCells=g;var A=d.attributeList,v=A.r,T=A.s,N=A.t,M=s.getcellrange(v);return w.r=M.row[0],w.c=M.column[0],w.v=w.generateValue(T,N),w}return p.prototype.generateValue=function(d,b){var y=this,g=this.cell.getInnerElements("v"),h=this.cell.getInnerElements("f");g==null&&(g=this.cell.getInnerElements("t"));var m=this.styles.cellXfs,w=this.styles.cellStyleXfs;this.styles.cellStyles;var A=this.styles.fonts,v=this.styles.fills,T=this.styles.borders,N=this.styles.numfmts,M=this.styles.clrScheme,P=this.sharedStrings,O=new c.LuckySheetCelldataValue;if(h!=null){var ne=h[0],R=ne.attributeList,I=R.t,E=R.ref,U=R.si,Z=h[0].value;I=="shared"&&(this._fomulaRef=E,this._formulaType=I,this._formulaSi=U),(E!=null||Z!=null&&Z.length>0)&&(Z=s.escapeCharacter(Z),O.f="="+Z)}var $=null,q;if(d!=null){var J=parseInt(d),re=m[J],Q=re.attributeList.xfId,X=void 0,me=void 0,pe=void 0,V=void 0,ee=void 0,ce=void 0,ue=void 0,ve=void 0;if(Q!=null){var Ee=w[parseInt(Q)],R=Ee.attributeList,Se=R.applyNumberFormat,Fe=R.applyFont,Ne=R.applyFill,_=R.applyBorder,B=R.applyAlignment;if(R.applyProtection,q=R.quotePrefix,Se!="0"&&R.numFmtId!=null&&(X=R.numFmtId),Fe!="0"&&R.fontId!=null&&(me=R.fontId),Ne!="0"&&R.fillId!=null&&(pe=R.fillId),_!="0"&&R.borderId!=null&&(V=R.borderId),B!=null&&B!="0"){var G=Ee.getInnerElements("alignment");if(G!=null){var z=G[0].attributeList;z.horizontal!=null&&(ee=z.horizontal),z.vertical!=null&&(ce=z.vertical),z.wrapText!=null&&(ue=z.wrapText),z.textRotation!=null&&(ve=z.textRotation),z.shrinkToFit!=null&&z.shrinkToFit,z.indent!=null&&z.indent}}}var j=re.attributeList.applyNumberFormat,Y=re.attributeList.applyFont,L=re.attributeList.applyFill,x=re.attributeList.applyBorder,k=re.attributeList.applyAlignment;if(re.attributeList.applyProtection!=null&&re.attributeList.applyProtection,re.attributeList.quotePrefix!=null&&(q=re.attributeList.quotePrefix),j!="0"&&re.attributeList.numFmtId!=null&&(X=re.attributeList.numFmtId),Y!="0"&&(me=re.attributeList.fontId),L!="0"&&(pe=re.attributeList.fillId),x!="0"&&(V=re.attributeList.borderId),k!="0"){var G=re.getInnerElements("alignment");if(G!=null&&G.length>0){var R=G[0].attributeList;R.horizontal!=null&&(ee=R.horizontal),R.vertical!=null&&(ce=R.vertical),R.wrapText!=null&&(ue=R.wrapText),R.textRotation!=null&&(ve=R.textRotation),R.shrinkToFit!=null&&R.shrinkToFit,R.indent!=null&&R.indent}}if(X!=null){var F=N[parseInt(X)],K=new c.LuckySheetCellFormat;K.fa=s.escapeCharacter(F),K.t=b,O.ct=K}if(pe!=null){var ie=parseInt(pe),se=v[ie],Ce=this.getBackgroundByFill(se,M);Ce!=null&&(O.bg=Ce)}if(me!=null){var ke=parseInt(me),xe=A[ke];if(xe!=null){var Be=xe.getInnerElements("sz"),Ie=xe.getInnerElements("color"),Ve=xe.getInnerElements("name"),Re=xe.getInnerElements("family");xe.getInnerElements("charset");var He=xe.getInnerElements("b"),Ge=xe.getInnerElements("i"),W=xe.getInnerElements("strike"),ye=xe.getInnerElements("u");if(Be!=null&&Be.length>0){var we=Be[0].attributeList.val;we!=null&&(O.fs=parseInt(we))}if(Ie!=null&&Ie.length>0){var Te=Ie[0],oe=o.getColor(Te,this.styles,"t");oe!=null&&(O.fc=oe)}if(Re!=null&&Re.length>0){var ge=Re[0].attributeList.val;ge!=null&&($=l.fontFamilys[ge])}if(Ve!=null&&Ve.length>0){var ge=Ve[0].attributeList.val;ge!=null&&(O.ff=ge)}if(He!=null&&He.length>0){var D=He[0].attributeList.val;D=="0"?O.bl=0:O.bl=1}if(Ge!=null&&Ge.length>0){var be=Ge[0].attributeList.val;be=="0"?O.it=0:O.it=1}if(W!=null&&W.length>0){var De=W[0].attributeList.val;De=="0"?O.cl=0:O.cl=1}if(ye!=null&&ye.length>0){var C=ye[0].attributeList.val;C=="single"?O.un=1:C=="double"?O.un=2:C=="singleAccounting"?O.un=3:C=="doubleAccounting"?O.un=4:O.un=0}}}if(ee!=null&&(ee=="center"||ee=="centerContinuous"?O.ht=0:ee=="left"?O.ht=1:ee=="right"?O.ht=2:ee=="distributed"?O.ht=0:ee=="fill"||ee=="general"?O.ht=1:ee=="justify"?O.ht=0:O.ht=1),ce!=null&&(ce=="bottom"?O.vt=2:ce=="center"||ce=="distributed"||ce=="justify"?O.vt=0:(ce=="top",O.vt=1)),ue!=null&&ue=="1"?O.tb=2:O.tb=1,ve!=null&&(ve=="255"?O.tr=3:(O.tr=0,O.rt=parseInt(ve))),V!=null){var fe=parseInt(V),de=T[fe],H=new c.LuckySheetborderInfoCellForImp;H.rangeType="cell";var te=new c.LuckySheetborderInfoCellValue;te.row_index=this.r,te.col_index=this.c;var le=de.getInnerElements("left"),Pe=de.getInnerElements("right"),Ae=de.getInnerElements("top"),Me=de.getInnerElements("bottom"),$e=de.getInnerElements("diagonal"),zt=de.getInnerElements("start"),rt=de.getInnerElements("end"),je=this.getBorderInfo(le),it=this.getBorderInfo(Pe),ft=this.getBorderInfo(Ae),pt=this.getBorderInfo(Me);this.getBorderInfo($e);var hr=this.getBorderInfo(zt),pr=this.getBorderInfo(rt),Ye=!1;hr!=null&&hr.color!=null&&(te.l=hr,Ye=!0),pr!=null&&pr.color!=null&&(te.r=pr,Ye=!0),je!=null&&je.color!=null&&(te.l=je,Ye=!0),it!=null&&it.color!=null&&(te.r=it,Ye=!0),ft!=null&&ft.color!=null&&(te.t=ft,Ye=!0),pt!=null&&pt.color!=null&&(te.b=pt,Ye=!0),Ye&&(H.value=te,this._borderObject=H)}}else O.tb=1;if(g!=null){var dt=g[0].value;if(/&#\d+;/.test(dt)&&(dt=this.htmlDecode(dt)),b==l.ST_CellType.SharedString){var ht=parseInt(g[0].value),It=P[ht],At=It.getInnerElements("r");if(At==null){var un=It.getInnerElements("t");if(un!=null){var Ut="";if(un.forEach(function(em){Ut+=em.value}),Ut=s.escapeCharacter(Ut),$=="Roman"&&Ut.length>0){var vi=Ut.split(""),wi=null,fn="",ja=null,Rl="Times New Roman";O.ff!=null&&(Rl=O.ff);var K=O.ct;K==null&&(K=new c.LuckySheetCellFormat),K.s==null&&(K.s=[]);for(var dn=0;dn<vi.length;dn++){var Tr=vi[dn],Ar=null,Dr=Rl;if(s.isChinese(Tr)?(Ar="c",Dr="宋体"):s.isJapanese(Tr)?(Ar="j",Dr="Yu Gothic"):s.isKoera(Tr)?(Ar="k",Dr="Malgun Gothic"):Ar="e",Ar!=wi&&wi!=null||dn==vi.length-1){var nt=new c.LuckyInlineString;if(nt.ff=ja,O.fc!=null&&(nt.fc=O.fc),O.fs!=null&&(nt.fs=O.fs),O.cl!=null&&(nt.cl=O.cl),O.un!=null&&(nt.un=O.un),O.bl!=null&&(nt.bl=O.bl),O.it!=null&&(nt.it=O.it),dn==vi.length-1)if(Ar==wi)nt.ff=Dr,nt.v=fn+Tr;else{nt.ff=ja,nt.v=fn,K.s.push(nt);var Qt=new c.LuckyInlineString;Qt.ff=Dr,Qt.v=Tr,O.fc!=null&&(Qt.fc=O.fc),O.fs!=null&&(Qt.fs=O.fs),O.cl!=null&&(Qt.cl=O.cl),O.un!=null&&(Qt.un=O.un),O.bl!=null&&(Qt.bl=O.bl),O.it!=null&&(Qt.it=O.it),K.s.push(Qt);break}else nt.v=fn;K.s.push(nt),fn=Tr}else fn+=Tr;wi=Ar,ja=Dr}K.t="inlineStr",O.ct=K}else if(Ut=this.replaceSpecialWrap(Ut),Ut.indexOf(`\r
|
|
55
|
+
`)>-1||Ut.indexOf(`
|
|
56
|
+
`)>-1){var nt=new c.LuckyInlineString;nt.v=Ut;var K=O.ct;K==null&&(K=new c.LuckySheetCellFormat),O.ff!=null&&(nt.ff=O.ff),O.fc!=null&&(nt.fc=O.fc),O.fs!=null&&(nt.fs=O.fs),O.cl!=null&&(nt.cl=O.cl),O.un!=null&&(nt.un=O.un),O.bl!=null&&(nt.bl=O.bl),O.it!=null&&(nt.it=O.it),K.t="inlineStr",K.s=[nt],O.ct=K}else O.v=Ut,q="1"}}else{var Nl=[];At.forEach(function(Ml){var $a=Ml.getInnerElements("t"),Va=Ml.getInnerElements("rPr"),Ke=new c.LuckyInlineString;if($a!=null&&$a.length>0){var hn=$a[0].value;hn=y.replaceSpecialWrap(hn),hn=s.escapeCharacter(hn),Ke.v=hn}if(Va!=null&&Va.length>0){var Ht=Va[0],Ll=o.getlineStringAttr(Ht,"sz"),Ol=o.getlineStringAttr(Ht,"rFont");o.getlineStringAttr(Ht,"family"),o.getlineStringAttr(Ht,"charset"),o.getlineStringAttr(Ht,"scheme");var Il=o.getlineStringAttr(Ht,"b"),Fl=o.getlineStringAttr(Ht,"i"),Pl=o.getlineStringAttr(Ht,"u"),Bl=o.getlineStringAttr(Ht,"strike"),Dl=o.getlineStringAttr(Ht,"vertAlign"),Za=void 0,Xa=Ht.getInnerElements("color");Xa!=null&&Xa.length>0&&(Za=o.getColor(Xa[0],y.styles,"t"));var Ga=void 0;Ol!=null&&(Ga=Ol),Ga!=null?Ke.ff=Ga:O.ff!=null&&(Ke.ff=O.ff),Za!=null?Ke.fc=Za:O.fc!=null&&(Ke.fc=O.fc),Ll!=null?Ke.fs=parseInt(Ll):O.fs!=null&&(Ke.fs=O.fs),Bl!=null?Ke.cl=parseInt(Bl):O.cl!=null&&(Ke.cl=O.cl),Pl!=null?Ke.un=parseInt(Pl):O.un!=null&&(Ke.un=O.un),Il!=null?Ke.bl=parseInt(Il):O.bl!=null&&(Ke.bl=O.bl),Fl!=null?Ke.it=parseInt(Fl):O.it!=null&&(Ke.it=O.it),Dl!=null&&(Ke.va=parseInt(Dl))}else Ke.ff==null&&O.ff!=null&&(Ke.ff=O.ff),Ke.fc==null&&O.fc!=null&&(Ke.fc=O.fc),Ke.fs==null&&O.fs!=null&&(Ke.fs=O.fs),Ke.cl==null&&O.cl!=null&&(Ke.cl=O.cl),Ke.un==null&&O.un!=null&&(Ke.un=O.un),Ke.bl==null&&O.bl!=null&&(Ke.bl=O.bl),Ke.it==null&&O.it!=null&&(Ke.it=O.it);Nl.push(Ke)});var K=O.ct;K==null&&(K=new c.LuckySheetCellFormat),K.t="inlineStr",K.s=Nl,O.ct=K}}else dt=s.escapeCharacter(dt),O.v=dt}return q!=null&&(O.qp=parseInt(q)),O},p.prototype.replaceSpecialWrap=function(d){return d=d.replace(/_x000D_/g,"").replace(/ /g,`\r
|
|
57
|
+
`).replace(/ /g,"\r").replace(/ /g,`
|
|
58
|
+
`),d},p.prototype.getBackgroundByFill=function(d,b){var y=d.getInnerElements("patternFill");if(y!=null){var g=y[0],h=g.getInnerElements("fgColor"),m=g.getInnerElements("bgColor"),w=void 0,A=void 0;if(h!=null){var v=h[0];w=o.getColor(v,this.styles)}if(m!=null){var T=m[0];A=o.getColor(T,this.styles)}if(w!=null)return w;if(A!=null)return A}else{var N=d.getInnerElements("gradientFill");if(N!=null)return null}},p.prototype.getBorderInfo=function(d){if(d==null)return null;var b=d[0],y=b.attributeList;this.styles.clrScheme;var g=y.style;if(g==null||g=="none")return null;var h=b.getInnerElements("color"),m="#000000";if(h!=null){var w=h[0];m=o.getColor(w,this.styles,"b"),m==null&&(m="#000000")}var A=new c.LuckySheetborderInfoCellValueStyle;return A.style=l.borderTypes[g],A.color=m,A},p.prototype.htmlDecode=function(d){return d.replace(/&#(x)?([^&]{1,5});?/g,function(b,y,g){return String.fromCharCode(parseInt(g,y?16:10))})},p}(c.LuckySheetCelldataBase);i.LuckySheetCelldata=u},{"../common/constant":91,"../common/method":93,"./LuckyBase":85,"./ReadXml":90}],87:[function(e,r,i){var a=function(){var d=function(y,g){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,m){h.__proto__=m}||function(h,m){for(var w in m)m.hasOwnProperty(w)&&(h[w]=m[w])},d(y,g)};return function(b,y){d(b,y);function g(){this.constructor=b}b.prototype=y===null?Object.create(y):(g.prototype=y.prototype,new g)}}();Object.defineProperty(i,"__esModule",{value:!0}),i.LuckyFile=void 0;var o=e("./LuckySheet"),s=e("../common/constant"),l=e("./ReadXml"),c=e("../common/method"),u=e("./LuckyBase"),f=e("./LuckyImage"),p=function(d){a(b,d);function b(y,g){var h=d.call(this)||this;h.columnWidthSet=[],h.rowHeightSet=[],h.files=y,h.fileName=g,h.readXml=new l.ReadXml(y),h.getSheetNameList(),h.sharedStrings=h.readXml.getElementsByTagName("sst/si",s.sharedStringsFile),h.calcChain=h.readXml.getElementsByTagName("calcChain/c",s.calcChainFile),h.styles={},h.styles.cellXfs=h.readXml.getElementsByTagName("cellXfs/xf",s.stylesFile),h.styles.cellStyleXfs=h.readXml.getElementsByTagName("cellStyleXfs/xf",s.stylesFile),h.styles.cellStyles=h.readXml.getElementsByTagName("cellStyles/cellStyle",s.stylesFile),h.styles.fonts=h.readXml.getElementsByTagName("fonts/font",s.stylesFile),h.styles.fills=h.readXml.getElementsByTagName("fills/fill",s.stylesFile),h.styles.borders=h.readXml.getElementsByTagName("borders/border",s.stylesFile),h.styles.clrScheme=h.readXml.getElementsByTagName("a:clrScheme/a:dk1|a:lt1|a:dk2|a:lt2|a:accent1|a:accent2|a:accent3|a:accent4|a:accent5|a:accent6|a:hlink|a:folHlink",s.theme1File),h.styles.indexedColors=h.readXml.getElementsByTagName("colors/indexedColors/rgbColor",s.stylesFile),h.styles.mruColors=h.readXml.getElementsByTagName("colors/mruColors/color",s.stylesFile),h.imageList=new f.ImageList(y);for(var m=h.readXml.getElementsByTagName("numFmt/numFmt",s.stylesFile),w=JSON.parse(JSON.stringify(s.numFmtDefault)),A=0;A<m.length;A++){var v=m[A].attributeList,T=c.getXmlAttibute(v,"numFmtId","49"),N=c.getXmlAttibute(v,"formatCode","@");T in s.numFmtDefault||(w[T]=N)}return h.styles.numfmts=w,h}return b.prototype.getSheetNameList=function(){var y=this.readXml.getElementsByTagName("Relationships/Relationship",s.workbookRels);if(y!=null){for(var g=new RegExp("worksheets/[^/]*?.xml"),h={},m=0;m<y.length;m++){var w=y[m],A=w.attributeList,v=A.Id,T=A.Target;g.test(T)&&(T.startsWith("/xl")?h[v]=T.substr(1):h[v]="xl/"+T)}this.sheetNameList=h}},b.prototype.getSheetFileBysheetId=function(y){return this.sheetNameList[y]},b.prototype.getWorkBookInfo=function(){var y=this.readXml.getElementsByTagName("Company",s.appFile),g=this.readXml.getElementsByTagName("AppVersion",s.appFile),h=this.readXml.getElementsByTagName("dc:creator",s.coreFile),m=this.readXml.getElementsByTagName("cp:lastModifiedBy",s.coreFile),w=this.readXml.getElementsByTagName("dcterms:created",s.coreFile),A=this.readXml.getElementsByTagName("dcterms:modified",s.coreFile);this.info=new u.LuckyFileInfo,this.info.name=this.fileName,this.info.creator=h.length>0?h[0].value:"",this.info.lastmodifiedby=m.length>0?m[0].value:"",this.info.createdTime=w.length>0?w[0].value:"",this.info.modifiedTime=A.length>0?A[0].value:"",this.info.company=y.length>0?y[0].value:"",this.info.appversion=g.length>0?g[0].value:""},b.prototype.getSheetsFull=function(y){y===void 0&&(y=!0);var g=this.readXml.getElementsByTagName("sheets/sheet",s.workBookFile),h={};for(var m in g){var w=g[m];h[w.attributeList.name]=w.attributeList.sheetId}this.sheets=[];var A=0;for(var m in g){var w=g[m],v=w.attributeList.name,T=w.attributeList.sheetId,N=w.attributeList["r:id"],M=this.getSheetFileBysheetId(N),P=this.readXml.getElementsByTagName("worksheet/drawing",M),O=void 0,ne=void 0;if(P!=null&&P.length>0){var R=P[0].attributeList,I=c.getXmlAttibute(R,"r:id",null);I!=null&&(O=this.getDrawingFile(I,M),ne=this.getDrawingRelsFile(O))}if(M!=null){var E=new o.LuckySheet(v,T,A,y,{sheetFile:M,readXml:this.readXml,sheetList:h,styles:this.styles,sharedStrings:this.sharedStrings,calcChain:this.calcChain,imageList:this.imageList,drawingFile:O,drawingRelsFile:ne});this.columnWidthSet=[],this.rowHeightSet=[],this.imagePositionCaculation(E),this.sheets.push(E),A++}}},b.prototype.extendArray=function(y,g,h,m,w){if(!(y<g.length)){var A=g.length,v=y,T=0;A>0&&(T=g[A-1]);for(var N=A;N<=v;N++){var M=h,P=N.toString();P in m?M=0:P in w&&(M=w[P]),T+=Math.round(M+1),g.push(T)}}},b.prototype.imagePositionCaculation=function(y){var g=y.images,h=y.defaultColWidth,m=y.defaultRowHeight,w={};y.config.colhidden&&(w=y.config.colhidden);var A={};y.config.columnlen&&(A=y.config.columnlen);var v={};y.config.rowhidden&&(v=y.config.rowhidden);var T={};y.config.rowlen&&(T=y.config.rowlen);for(var N in g){var M=g[N],P=M.fromCol,O=M.fromColOff,ne=M.fromRow,R=M.fromRowOff,I=M.toCol,E=M.toColOff,U=M.toRow,Z=M.toRowOff,$=0,q=0,J=0,re=0;P>=this.columnWidthSet.length&&this.extendArray(P,this.columnWidthSet,h,w,A),P==0?$=0:$=this.columnWidthSet[P-1],$=$+O,ne>=this.rowHeightSet.length&&this.extendArray(ne,this.rowHeightSet,m,v,T),ne==0?q=0:q=this.rowHeightSet[ne-1],q=q+R,I>=this.columnWidthSet.length&&this.extendArray(I,this.columnWidthSet,h,w,A),I==0?J=0:J=this.columnWidthSet[I-1],J=J+E-$,U>=this.rowHeightSet.length&&this.extendArray(U,this.rowHeightSet,m,v,T),U==0?re=0:re=this.rowHeightSet[U-1],re=re+Z-q,console.log(h,w,A),console.log(P,this.columnWidthSet[P],O),console.log(I,this.columnWidthSet[I],E,JSON.stringify(this.columnWidthSet)),M.originWidth=J,M.originHeight=re,M.crop.height=re,M.crop.width=J,M.default.height=re,M.default.left=$,M.default.top=q,M.default.width=J}console.log(this.columnWidthSet,this.rowHeightSet)},b.prototype.getDrawingFile=function(y,g){var h="xl/worksheets/_rels/",m=g.split("/"),w=m[m.length-1],A=h+w+".rels",v=this.readXml.getElementsByTagName("Relationships/Relationship",A);if(v.length>0)for(var T=0;T<v.length;T++){var N=v[T],M=N.attributeList,P=c.getXmlAttibute(M,"Id",null);if(P==y){var O=c.getXmlAttibute(M,"Target",null);if(O!=null)return O.replace(/\.\.\//g,"")}}return null},b.prototype.getDrawingRelsFile=function(y){var g="xl/drawings/_rels/",h=y.split("/"),m=h[h.length-1],w=g+m+".rels";return w},b.prototype.getSheetsWithoutCell=function(){this.getSheetsFull(!1)},b.prototype.Parse=function(){return this.getWorkBookInfo(),this.getSheetsFull(),this.toJsonString(this)},b.prototype.toJsonString=function(y){var g=new u.LuckyFileBase;return g.info=y.info,g.sheets=[],y.sheets.forEach(function(h){var m=new u.LuckySheetBase;h.name!=null&&(m.name=h.name),h.color!=null&&(m.color=h.color),h.config!=null&&(m.config=h.config),h.index!=null&&(m.index=h.index),h.status!=null&&(m.status=h.status),h.order!=null&&(m.order=h.order),h.row!=null&&(m.row=h.row),h.column!=null&&(m.column=h.column),h.luckysheet_select_save!=null&&(m.luckysheet_select_save=h.luckysheet_select_save),h.scrollLeft!=null&&(m.scrollLeft=h.scrollLeft),h.scrollTop!=null&&(m.scrollTop=h.scrollTop),h.zoomRatio!=null&&(m.zoomRatio=h.zoomRatio),h.showGridLines!=null&&(m.showGridLines=h.showGridLines),h.defaultColWidth!=null&&(m.defaultColWidth=h.defaultColWidth),h.defaultRowHeight!=null&&(m.defaultRowHeight=h.defaultRowHeight),h.celldata!=null&&(m.celldata=[],h.celldata.forEach(function(w){var A=new u.LuckySheetCelldataBase;A.r=w.r,A.c=w.c,A.v=w.v,m.celldata.push(A)})),h.chart!=null&&(m.chart=h.chart),h.isPivotTable!=null&&(m.isPivotTable=h.isPivotTable),h.pivotTable!=null&&(m.pivotTable=h.pivotTable),h.luckysheet_conditionformat_save!=null&&(m.luckysheet_conditionformat_save=h.luckysheet_conditionformat_save),h.freezen!=null&&(m.freezen=h.freezen),h.calcChain!=null&&(m.calcChain=h.calcChain),h.images!=null&&(m.images=h.images),g.sheets.push(m)}),JSON.stringify(g)},b}(u.LuckyFileBase);i.LuckyFile=p},{"../common/constant":91,"../common/method":93,"./LuckyBase":85,"./LuckyImage":88,"./LuckySheet":89,"./ReadXml":90}],88:[function(e,r,i){var a=function(){var u=function(p,d){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,y){b.__proto__=y}||function(b,y){for(var g in y)y.hasOwnProperty(g)&&(b[g]=y[g])},u(p,d)};return function(f,p){u(f,p);function d(){this.constructor=f}f.prototype=p===null?Object.create(p):(d.prototype=p.prototype,new d)}}();Object.defineProperty(i,"__esModule",{value:!0}),i.ImageList=void 0;var o=e("./LuckyBase"),s=e("../common/emf"),l=function(){function u(f){if(f!=null){this.images={};for(var p in f)if(p.indexOf("xl/media/")>-1){var d=p.split("."),b=d[d.length-1].toLowerCase();if(b in{png:1,jpeg:1,jpg:1,gif:1,bmp:1,tif:1,webp:1,emf:1})if(b=="emf"){var y=0,g=1,h=new s.ToContext2D(y,g),m,w,A;s.FromEMF.K=[],m=s.FromEMF.C,w=s.FromEMF.K,A=4;for(var v in m)w[m[v]]=v.slice(A);s.FromEMF.Parse(f[p],h),this.images[p]=h.canvas.toDataURL("image/png")}else this.images[p]=f[p]}}}return u.prototype.getImageByName=function(f){if(f in this.images){var p=this.images[f];return new c(f,p)}return null},u}();i.ImageList=l;var c=function(u){a(f,u);function f(p,d){var b=u.call(this)||this;return b.src=d,b}return f.prototype.setDefault=function(){},f}(o.LuckyImageBase)},{"../common/emf":92,"./LuckyBase":85}],89:[function(e,r,i){var a=function(){var f=function(d,b){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,g){y.__proto__=g}||function(y,g){for(var h in g)g.hasOwnProperty(h)&&(y[h]=g[h])},f(d,b)};return function(p,d){f(p,d);function b(){this.constructor=p}p.prototype=d===null?Object.create(d):(b.prototype=d.prototype,new b)}}();Object.defineProperty(i,"__esModule",{value:!0}),i.LuckySheet=void 0;var o=e("./LuckyCell"),s=e("../common/method"),l=e("./ReadXml"),c=e("./LuckyBase"),u=function(f){a(p,f);function p(d,b,y,g,h){g===void 0&&(g=!1);var m=f.call(this)||this;m.isInitialCell=g,m.readXml=h.readXml,m.sheetFile=h.sheetFile,m.styles=h.styles,m.sharedStrings=h.sharedStrings,m.calcChainEles=h.calcChain,m.sheetList=h.sheetList,m.imageList=h.imageList,m.name=d,m.index=b,m.order=y.toString(),m.config=new c.LuckyConfig,m.celldata=[],m.mergeCells=m.readXml.getElementsByTagName("mergeCells/mergeCell",m.sheetFile),m.styles.clrScheme;var w=m.readXml.getElementsByTagName("sheetViews/sheetView",m.sheetFile),A="1",v="0",T="100",N="A1";if(w.length>0){var M=w[0].attributeList;A=s.getXmlAttibute(M,"showGridLines","1"),v=s.getXmlAttibute(M,"tabSelected","0"),T=s.getXmlAttibute(M,"zoomScale","100");var P=w[0].getInnerElements("selection");if(P!=null&&P.length>0){N=s.getXmlAttibute(P[0].attributeList,"activeCell","A1");var O=s.getcellrange(N,m.sheetList,b);m.luckysheet_select_save=[],m.luckysheet_select_save.push(O)}}m.showGridLines=A,m.status=v,m.zoomRatio=parseInt(T)/100;var ne=m.readXml.getElementsByTagName("sheetPr/tabColor",m.sheetFile);if(ne!=null&&ne.length>0){var R=ne[0],M=R.attributeList,I=l.getColor(R,m.styles,"b");m.color=I}var E=m.readXml.getElementsByTagName("sheetFormatPr",m.sheetFile),U,Z;if(E.length>0){var M=E[0].attributeList;U=s.getXmlAttibute(M,"defaultColWidth","9.21"),Z=s.getXmlAttibute(M,"defaultRowHeight","19")}m.defaultColWidth=s.getColumnWidthPixel(parseFloat(U)),m.defaultRowHeight=s.getRowHeightPixel(parseFloat(Z)),m.generateConfigColumnLenAndHidden();var $=m.generateConfigRowLenAndHiddenAddCell();if(m.formulaRefList!=null)for(var q in m.formulaRefList){var J=m.formulaRefList[q],re=J.mainRef,Q=re.cellValue,X=re.fv,me=Q.r,pe=Q.c;for(var V in J)if(V!="mainRef"){var ee=J[V],ce=ee.cellValue;if(ce!=null){var ue=ce.r,ve=ce.c,Ee=X,Se=ue-me,Fe=ve-pe;Se>0?Ee="="+s.fromulaRef.functionCopy(Ee,"down",Se):Se<0&&(Ee="="+s.fromulaRef.functionCopy(Ee,"up",Math.abs(Se))),Fe>0?Ee="="+s.fromulaRef.functionCopy(Ee,"right",Fe):Fe<0&&(Ee="="+s.fromulaRef.functionCopy(Ee,"left",Math.abs(Fe))),ce.v.f=Ee}}}m.calcChain==null&&(m.calcChain=[]);for(var Ne={},ve=0;ve<m.calcChainEles.length;ve++){var _=m.calcChainEles[ve],M=_.attributeList;if(M.i==b){var ue=M.r,B=M.i;M.l,M.s,M.a,M.t;var O=s.getcellrange(ue),G=new c.LuckysheetCalcChain;G.r=O.row[0],G.c=O.column[0],G.index=m.index,m.calcChain.push(G),Ne["r"+ue+"c"+ve]=null}}for(var q in $.formulaList)if(!(q in Ne)){var z=$.formulaList[q],G=new c.LuckysheetCalcChain;G.r=z.r,G.c=z.c,G.index=m.index,m.calcChain.push(G)}if(m.mergeCells!=null)for(var B=0;B<m.mergeCells.length;B++){var j=m.mergeCells[B],M=j.attributeList,Y=M.ref;if(Y!=null){var O=s.getcellrange(Y,m.sheetList,b),L=new c.LuckySheetConfigMerge;L.r=O.row[0],L.c=O.column[0],L.rs=O.row[1]-O.row[0]+1,L.cs=O.column[1]-O.column[0]+1,m.config.merge==null&&(m.config.merge={}),m.config.merge[O.row[0]+"_"+O.column[0]]=L}}var x=h.drawingFile,k=h.drawingRelsFile;if(x!=null&&k!=null){var F=m.readXml.getElementsByTagName("xdr:twoCellAnchor",x);if(F!=null&&F.length>0)for(var B=0;B<F.length;B++){var K=F[B],ie=s.getXmlAttibute(K.attributeList,"editAs","twoCell"),se=K.getInnerElements("xdr:from"),Ce=K.getInnerElements("xdr:to"),ke=K.getInnerElements("a:blip");if(se!=null&&ke!=null&&se.length>0&&ke.length>0){var xe=se[0],Be=Ce[0],Ie=ke[0],Ve=s.getXmlAttibute(Ie.attributeList,"r:embed",null),Re=m.getBase64ByRid(Ve,k),He=0,Ge=0,W=0,ye=0;Re.fromCol=m.getXdrValue(xe.getInnerElements("xdr:col")),Re.fromColOff=s.getPxByEMUs(m.getXdrValue(xe.getInnerElements("xdr:colOff"))),Re.fromRow=m.getXdrValue(xe.getInnerElements("xdr:row")),Re.fromRowOff=s.getPxByEMUs(m.getXdrValue(xe.getInnerElements("xdr:rowOff"))),Re.toCol=m.getXdrValue(Be.getInnerElements("xdr:col")),Re.toColOff=s.getPxByEMUs(m.getXdrValue(Be.getInnerElements("xdr:colOff"))),Re.toRow=m.getXdrValue(Be.getInnerElements("xdr:row")),Re.toRowOff=s.getPxByEMUs(m.getXdrValue(Be.getInnerElements("xdr:rowOff"))),Re.originWidth=W,Re.originHeight=ye,ie=="absolute"?Re.type="3":ie=="oneCell"?Re.type="2":Re.type="1",Re.isFixedPos=!1,Re.fixedLeft=0,Re.fixedTop=0;var we={color:"#000",radius:0,style:"solid",width:0};Re.border=we;var Te={height:ye,offsetLeft:0,offsetTop:0,width:W};Re.crop=Te;var oe={height:ye,left:He,top:Ge,width:W};Re.default=oe,m.images==null&&(m.images={}),m.images[s.generateRandomIndex("image")]=Re}}}return m}return p.prototype.getXdrValue=function(d){return d==null||d.length==0?null:parseInt(d[0].value)},p.prototype.getBase64ByRid=function(d,b){var y=this.readXml.getElementsByTagName("Relationships/Relationship",b);if(y!=null&&y.length>0)for(var g=0;g<y.length;g++){var h=y[g],m=h.attributeList,w=s.getXmlAttibute(m,"Id",null),A=s.getXmlAttibute(m,"Target",null);if(w==d){A=A.replace(/\.\.\//g,""),A="xl/"+A;var v=this.imageList.getImageByName(A);return v}}return null},p.prototype.generateConfigColumnLenAndHidden=function(){for(var d=this.readXml.getElementsByTagName("cols/col",this.sheetFile),b=0;b<d.length;b++){var y=d[b],g=y.attributeList,h=s.getXmlAttibute(g,"min",null),m=s.getXmlAttibute(g,"max",null),w=s.getXmlAttibute(g,"width",null),A=s.getXmlAttibute(g,"hidden",null),v=s.getXmlAttibute(g,"customWidth",null);if(!(h==null||m==null))for(var T=parseInt(h)-1,N=parseInt(m)-1,M=parseFloat(w),P=T;P<=N;P++)w!=null&&(this.config.columnlen==null&&(this.config.columnlen={}),this.config.columnlen[P]=s.getColumnWidthPixel(M)),A=="1"&&(this.config.colhidden==null&&(this.config.colhidden={}),this.config.colhidden[P]=0,this.config.columnlen&&delete this.config.columnlen[P]),v!=null&&(this.config.customWidth==null&&(this.config.customWidth={}),this.config.customWidth[P]=1)}},p.prototype.generateConfigRowLenAndHiddenAddCell=function(){var d=this.readXml.getElementsByTagName("sheetData/row",this.sheetFile),b={},y={};b.formulaList=y;for(var g=0;g<d.length;g++){var h=d[g],m=h.attributeList,w=s.getXmlAttibute(m,"r",null),A=s.getXmlAttibute(m,"ht",null),v=s.getXmlAttibute(m,"hidden",null),T=s.getXmlAttibute(m,"customHeight",null);if(w!=null){var N=parseInt(w)-1;if(A!=null){var M=parseFloat(A);this.config.rowlen==null&&(this.config.rowlen={}),this.config.rowlen[N]=s.getRowHeightPixel(M)}if(v=="1"&&(this.config.rowhidden==null&&(this.config.rowhidden={}),this.config.rowhidden[N]=0,this.config.rowlen&&delete this.config.rowlen[N]),T!=null&&(this.config.customHeight==null&&(this.config.customHeight={}),this.config.customHeight[N]=1),this.isInitialCell){var P=h.getInnerElements("c");for(var O in P){var ne=P[O],R=new o.LuckySheetCelldata(ne,this.styles,this.sharedStrings,this.mergeCells,this.sheetFile,this.readXml);if(R._borderObject!=null&&(this.config.borderInfo==null&&(this.config.borderInfo=[]),this.config.borderInfo.push(R._borderObject),delete R._borderObject),R._formulaType=="shared"){this.formulaRefList==null&&(this.formulaRefList={}),this.formulaRefList[R._formulaSi]==null&&(this.formulaRefList[R._formulaSi]={});var I=void 0;R.v!=null&&(I=R.v.f);var E={t:R._formulaType,ref:R._fomulaRef,si:R._formulaSi,fv:I,cellValue:R};R._fomulaRef!=null?this.formulaRefList[R._formulaSi].mainRef=E:this.formulaRefList[R._formulaSi][R.r+"_"+R.c]=E}if(R.v!=null&&R.v.f!=null){var U={r:R.r,c:R.c};b.formulaList["r"+R.r+"c"+R.c]=U}this.celldata.push(R)}}}}return b},p}(c.LuckySheetBase);i.LuckySheet=u},{"../common/method":93,"./LuckyBase":85,"./LuckyCell":86,"./ReadXml":90}],90:[function(e,r,i){var a=function(){var b=function(g,h){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,w){m.__proto__=w}||function(m,w){for(var A in w)w.hasOwnProperty(A)&&(m[A]=w[A])},b(g,h)};return function(y,g){b(y,g);function h(){this.constructor=y}y.prototype=g===null?Object.create(g):(h.prototype=g.prototype,new h)}}();Object.defineProperty(i,"__esModule",{value:!0}),i.getlineStringAttr=i.getColor=i.Element=i.ReadXml=void 0;var o=e("../common/constant"),s=e("../common/method"),l=function(){function b(){}return b.prototype.getElementsByOneTag=function(y,g){var h;if(y.indexOf("|")>-1){for(var m=y.split("|"),w="",A=0;A<m.length;A++){var v=m[A];w+="|<"+v+" [^>]+?[^/]>[\\s\\S]*?</"+v+">|<"+v+" [^>]+?/>|<"+v+">[\\s\\S]*?</"+v+">|<"+v+"/>"}w=w.substr(1,w.length),h=new RegExp(w,"g")}else h=new RegExp("<"+y+" [^>]+?[^/]>[\\s\\S]*?</"+y+">|<"+y+" [^>]+?/>|<"+y+">[\\s\\S]*?</"+y+">|<"+y+"/>","g");var T=g.match(h);return T??[]},b}(),c=function(b){a(y,b);function y(g){var h=b.call(this)||this;return h.originFile=g,h}return y.prototype.getElementsByTagName=function(g,h){var m=this.getFileByName(h),w=g.split("/"),A;for(var v in w){var T=w[v];if(A==null)A=this.getElementsByOneTag(T,m);else if(A instanceof Array){var N=[];for(var M in A){var P=A[M];N=N.concat(this.getElementsByOneTag(T,P))}A=N}else A=this.getElementsByOneTag(T,A)}for(var O=[],ne=0;ne<A.length;ne++){var R=new u(A[ne]);O.push(R)}return O},y.prototype.getFileByName=function(g){for(var h in this.originFile)if(h.indexOf(g)>-1)return this.originFile[h];return""},y}(l);i.ReadXml=c;var u=function(b){a(y,b);function y(g){var h=b.call(this)||this;h.elementString=g,h.setValue();var m=new RegExp('[a-zA-Z0-9_:]*?=".*?"',"g"),w=h.container.match(m);if(h.attributeList={},w!=null)for(var A in w){var v=w[A];if(v.length!=0){var T=v.substr(0,v.indexOf("=")),N=v.substr(v.indexOf("=")+1);T==null||N==null||T.length==0||N.length==0||(h.attributeList[T]=N.substr(1,N.length-2))}}return h}return y.prototype.get=function(g){return this.attributeList[g]},y.prototype.getInnerElements=function(g){for(var h=this.getElementsByOneTag(g,this.elementString),m=[],w=0;w<h.length;w++){var A=new y(h[w]);m.push(A)}return m.length==0?null:m},y.prototype.setValue=function(){var g=this.elementString;if(g.substr(g.length-2,2)=="/>")this.value="",this.container=g;else{var h=this.getFirstTag(),m=new RegExp("(<"+h+" [^>]+?[^/]>)([\\s\\S]*?)</"+h+">|(<"+h+">)([\\s\\S]*?)</"+h+">","g"),w=m.exec(g);w!=null&&(w[1]!=null?(this.container=w[1],this.value=w[2]):(this.container=w[3],this.value=w[4]))}},y.prototype.getFirstTag=function(){var g=this.elementString,h=g.substr(0,g.indexOf(" "));return(h==""||h.indexOf(">")>-1)&&(h=g.substr(0,g.indexOf(">"))),h=h.substr(1,h.length),h},y}(l);i.Element=u;function f(b,y){var g={};if(b==null||b.length==0)return y;for(var h in y){var m=y[h],w=parseInt(h),A=b[w];if(A==null)g[h]=m;else{var v=A.attributeList.rgb;g[h]=v}}return g}function p(b,y,g){var h=b.attributeList,m=y.clrScheme,w=y.indexedColors;y.mruColors;var A=f(w,o.indexedColors),v=h.indexed,T=h.rgb,N=h.theme,M=h.tint,P;if(v!=null){var O=parseInt(v);P=A[O],P!=null&&(P=P.substring(P.length-6,P.length),P="#"+P)}else if(T!=null)T=T.substring(T.length-6,T.length),P="#"+T;else if(N!=null){var ne=parseInt(N);ne==0?ne=1:ne==1?ne=0:ne==2?ne=3:ne==3&&(ne=2);var R=m[ne];if(R!=null){var I=R.getInnerElements("a:sysClr|a:srgbClr");if(I!=null){var E=I[0],U=E.attributeList;E.container.indexOf("sysClr")>-1?U.lastClr!=null?P="#"+U.lastClr:U.val!=null&&(P="#"+U.val):E.container.indexOf("srgbClr")>-1&&(P="#"+U.val)}}}if(M!=null){var Z=parseFloat(M);P!=null&&(P=s.LightenDarkenColor(P,Z))}return P}i.getColor=p;function d(b,y){var g=b.getInnerElements(y),h;if(g!=null&&g.length>0)if(y=="b"||y=="i"||y=="strike")h="1";else if(y=="u"){var m=g[0].attributeList.val;m=="double"?h="2":m=="singleAccounting"?h="3":m=="doubleAccounting"?h="4":h="1"}else if(y=="vertAlign"){var m=g[0].attributeList.val;m=="subscript"?h="1":m=="superscript"&&(h="2")}else h=g[0].attributeList.val;return h}i.getlineStringAttr=d},{"../common/constant":91,"../common/method":93}],91:[function(e,r,i){Object.defineProperty(i,"__esModule",{value:!0}),i.fontFamilys=i.borderTypes=i.OEM_CHARSET=i.indexedColors=i.numFmtDefault=i.BuiltInCellStyles=i.ST_CellType=i.workbookRels=i.theme1File=i.worksheetFilePath=i.sharedStringsFile=i.stylesFile=i.calcChainFile=i.workBookFile=i.contentTypesFile=i.appFile=i.coreFile=i.columeHeader_word_index=i.columeHeader_word=void 0,i.columeHeader_word=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],i.columeHeader_word_index={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25},i.coreFile="docProps/core.xml",i.appFile="docProps/app.xml",i.contentTypesFile="[Content_Types].xml",i.workBookFile="xl/workbook.xml",i.calcChainFile="xl/calcChain.xml",i.stylesFile="xl/styles.xml",i.sharedStringsFile="xl/sharedStrings.xml",i.worksheetFilePath="xl/worksheets/",i.theme1File="xl/theme/theme1.xml",i.workbookRels="xl/_rels/workbook.xml.rels",i.ST_CellType={Boolean:"b",Date:"d",Error:"e",InlineString:"inlineStr",Number:"n",SharedString:"s",String:"str"},i.BuiltInCellStyles={0:"Normal"},i.numFmtDefault={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@"},i.indexedColors={0:"00000000",1:"00FFFFFF",2:"00FF0000",3:"0000FF00",4:"000000FF",5:"00FFFF00",6:"00FF00FF",7:"0000FFFF",8:"00000000",9:"00FFFFFF",10:"00FF0000",11:"0000FF00",12:"000000FF",13:"00FFFF00",14:"00FF00FF",15:"0000FFFF",16:"00800000",17:"00008000",18:"00000080",19:"00808000",20:"00800080",21:"00008080",22:"00C0C0C0",23:"00808080",24:"009999FF",25:"00993366",26:"00FFFFCC",27:"00CCFFFF",28:"00660066",29:"00FF8080",30:"000066CC",31:"00CCCCFF",32:"00000080",33:"00FF00FF",34:"00FFFF00",35:"0000FFFF",36:"00800080",37:"00800000",38:"00008080",39:"000000FF",40:"0000CCFF",41:"00CCFFFF",42:"00CCFFCC",43:"00FFFF99",44:"0099CCFF",45:"00FF99CC",46:"00CC99FF",47:"00FFCC99",48:"003366FF",49:"0033CCCC",50:"0099CC00",51:"00FFCC00",52:"00FF9900",53:"00FF6600",54:"00666699",55:"00969696",56:"00003366",57:"00339966",58:"00003300",59:"00333300",60:"00993300",61:"00993366",62:"00333399",63:"00333333",64:null,65:null},i.OEM_CHARSET={0:"ANSI_CHARSET",1:"DEFAULT_CHARSET",2:"SYMBOL_CHARSET",77:"MAC_CHARSET",128:"SHIFTJIS_CHARSET",129:"HANGUL_CHARSET",130:"JOHAB_CHARSET",134:"GB2312_CHARSET",136:"CHINESEBIG5_CHARSET",161:"GREEK_CHARSET",162:"TURKISH_CHARSET",163:"VIETNAMESE_CHARSET",177:"HEBREW_CHARSET",178:"ARABIC_CHARSET",186:"BALTIC_CHARSET",204:"RUSSIAN_CHARSET",222:"THAI_CHARSET",238:"EASTEUROPE_CHARSET",255:"OEM_CHARSET"},i.borderTypes={none:0,thin:1,hair:2,dotted:3,dashed:4,dashDot:5,dashDotDot:6,double:7,medium:8,mediumDashed:9,mediumDashDot:10,mediumDashDotDot:11,slantDashDot:12,thick:13},i.fontFamilys={0:"defualt",1:"Roman",2:"Swiss",3:"Modern",4:"Script",5:"Decorative"}},{}],92:[function(e,r,i){Object.defineProperty(i,"__esModule",{value:!0}),i.ToContext2D=i.FromEMF=i.UDOC=void 0,i.UDOC={},i.UDOC.G={concat:function(s,l){for(var c=0;c<l.cmds.length;c++)s.cmds.push(l.cmds[c]);for(var c=0;c<l.crds.length;c++)s.crds.push(l.crds[c])},getBB:function(s){for(var l=1e99,c=1e99,u=-l,f=-c,p=0;p<s.length;p+=2){var d=s[p],b=s[p+1];d<l?l=d:d>u&&(u=d),b<c?c=b:b>f&&(f=b)}return[l,c,u,f]},rectToPath:function(s){return{cmds:["M","L","L","L","Z"],crds:[s[0],s[1],s[2],s[1],s[2],s[3],s[0],s[3]]}},insideBox:function(s,l){return l[0]<=s[0]&&l[1]<=s[1]&&s[2]<=l[2]&&s[3]<=l[3]},isBox:function(s,l){var c=function(m,w){for(var A=0;A<8;A+=2){for(var v=!0,T=0;T<8;T++)if(Math.abs(w[T]-m[T+A&7])>=2){v=!1;break}if(v)return!0}return!1};if(s.cmds.length>10)return!1;var u=s.cmds.join(""),f=s.crds,p=!1;if(u=="MLLLZ"&&f.length==8||u=="MLLLLZ"&&f.length==10){f.length==10&&(f=f.slice(0,8));var d=l[0],b=l[1],y=l[2],g=l[3];p||(p=c(f,[d,b,y,b,y,g,d,g])),p||(p=c(f,[d,g,y,g,y,b,d,b]))}return p},boxArea:function(s){var l=s[2]-s[0],c=s[3]-s[1];return l*c},newPath:function(s){s.pth={cmds:[],crds:[]}},moveTo:function(s,l,c){var u=i.UDOC.M.multPoint(s.ctm,[l,c]);s.pth.cmds.push("M"),s.pth.crds.push(u[0],u[1]),s.cpos=u},lineTo:function(s,l,c){var u=i.UDOC.M.multPoint(s.ctm,[l,c]);s.cpos[0]==u[0]&&s.cpos[1]==u[1]||(s.pth.cmds.push("L"),s.pth.crds.push(u[0],u[1]),s.cpos=u)},curveTo:function(s,l,c,u,f,p,d){var b;b=i.UDOC.M.multPoint(s.ctm,[l,c]),l=b[0],c=b[1],b=i.UDOC.M.multPoint(s.ctm,[u,f]),u=b[0],f=b[1],b=i.UDOC.M.multPoint(s.ctm,[p,d]),p=b[0],d=b[1],s.cpos=b,s.pth.cmds.push("C"),s.pth.crds.push(l,c,u,f,p,d)},closePath:function(s){s.pth.cmds.push("Z")},arc:function(s,l,E,u,f,p,d){if(d)for(;p>f;)p-=2*Math.PI;else for(;p<f;)p+=2*Math.PI;var b=(p-f)/4,y=Math.cos(b/2),g=-Math.sin(b/2),h=(4-y)/3,m=g==0?g:(1-y)*(3-y)/(3*g),w=h,A=-m,v=y,T=-g,N=[h,m],M=[w,A],P=[v,T],O={cmds:[s.pth.cmds.length==0?"M":"L","C","C","C","C"],crds:[y,g,h,m,w,A,v,T]},ne=[1,0,0,1,0,0];i.UDOC.M.rotate(ne,-b);for(var R=0;R<3;R++)N=i.UDOC.M.multPoint(ne,N),M=i.UDOC.M.multPoint(ne,M),P=i.UDOC.M.multPoint(ne,P),O.crds.push(N[0],N[1],M[0],M[1],P[0],P[1]);var I=[u,0,0,u,l,E];i.UDOC.M.rotate(ne,-f+b/2),i.UDOC.M.concat(ne,I),i.UDOC.M.multArray(ne,O.crds),i.UDOC.M.multArray(s.ctm,O.crds),i.UDOC.G.concat(s.pth,O);var E=O.crds.pop();l=O.crds.pop(),s.cpos=[l,E]},toPoly:function(s){if(s.cmds[0]!="M"||s.cmds[s.cmds.length-1]!="Z")return null;for(var l=1;l<s.cmds.length-1;l++)if(s.cmds[l]!="L")return null;var c=[],u=s.crds.length;s.crds[0]==s.crds[u-2]&&s.crds[1]==s.crds[u-1]&&(u-=2);for(var l=0;l<u;l+=2)c.push([s.crds[l],s.crds[l+1]]);return i.UDOC.G.polyArea(s.crds)<0&&c.reverse(),c},fromPoly:function(s){for(var l={cmds:[],crds:[]},c=0;c<s.length;c++)l.crds.push(s[c][0],s[c][1]),l.cmds.push(c==0?"M":"L");return l.cmds.push("Z"),l},polyArea:function(s){if(s.length<6)return 0;for(var l=s.length-2,c=(s[0]-s[l])*(s[l+1]+s[1]),u=0;u<l;u+=2)c+=(s[u+2]-s[u])*(s[u+1]+s[u+3]);return-c*.5},polyClip:function(s,l){var c,u,f,p,d=function(A){return(u[0]-c[0])*(A[1]-c[1])>(u[1]-c[1])*(A[0]-c[0])},b=function(){var A=[c[0]-u[0],c[1]-u[1]],v=[f[0]-p[0],f[1]-p[1]],T=c[0]*u[1]-c[1]*u[0],N=f[0]*p[1]-f[1]*p[0],M=1/(A[0]*v[1]-A[1]*v[0]);return[(T*v[0]-N*A[0])*M,(T*v[1]-N*A[1])*M]},y=s;c=l[l.length-1];for(var g in l){var u=l[g],h=y;y=[],f=h[h.length-1];for(var m in h){var p=h[m];d(p)?(d(f)||y.push(b()),y.push(p)):d(f)&&y.push(b()),f=p}c=u}return y}},i.UDOC.M={getScale:function(s){return Math.sqrt(Math.abs(s[0]*s[3]-s[1]*s[2]))},translate:function(s,l,c){i.UDOC.M.concat(s,[1,0,0,1,l,c])},rotate:function(s,l){i.UDOC.M.concat(s,[Math.cos(l),-Math.sin(l),Math.sin(l),Math.cos(l),0,0])},scale:function(s,l,c){i.UDOC.M.concat(s,[l,0,0,c,0,0])},concat:function(s,l){var c=s[0],u=s[1],f=s[2],p=s[3],d=s[4],b=s[5];s[0]=c*l[0]+u*l[2],s[1]=c*l[1]+u*l[3],s[2]=f*l[0]+p*l[2],s[3]=f*l[1]+p*l[3],s[4]=d*l[0]+b*l[2]+l[4],s[5]=d*l[1]+b*l[3]+l[5]},invert:function(s){var l=s[0],c=s[1],u=s[2],f=s[3],p=s[4],d=s[5],b=l*f-c*u;s[0]=f/b,s[1]=-c/b,s[2]=-u/b,s[3]=l/b,s[4]=(u*d-f*p)/b,s[5]=(c*p-l*d)/b},multPoint:function(s,l){var c=l[0],u=l[1];return[c*s[0]+u*s[2]+s[4],c*s[1]+u*s[3]+s[5]]},multArray:function(s,l){for(var c=0;c<l.length;c+=2){var u=l[c],f=l[c+1];l[c]=u*s[0]+f*s[2]+s[4],l[c+1]=u*s[1]+f*s[3]+s[5]}}},i.UDOC.C={srgbGamma:function(s){return s<.0031308?12.92*s:1.055*Math.pow(s,1/2.4)-.055},cmykToRgb:function(s){var l=s[0],c=s[1],u=s[2],f=s[3],p=255+l*(-4.387332384609988*l+54.48615194189176*c+18.82290502165302*u+212.25662451639585*f+-285.2331026137004)+c*(1.7149763477362134*c-5.6096736904047315*u+-17.873870861415444*f-5.497006427196366)+u*(-2.5217340131683033*u-21.248923337353073*f+17.5119270841813)+f*(-21.86122147463605*f-189.48180835922747),d=255+l*(8.841041422036149*l+60.118027045597366*c+6.871425592049007*u+31.159100130055922*f+-79.2970844816548)+c*(-15.310361306967817*c+17.575251261109482*u+131.35250912493976*f-190.9453302588951)+u*(4.444339102852739*u+9.8632861493405*f-24.86741582555878)+f*(-20.737325471181034*f-187.80453709719578),b=255+l*(.8842522430003296*l+8.078677503112928*c+30.89978309703729*u-.23883238689178934*f+-14.183576799673286)+c*(10.49593273432072*c+63.02378494754052*u+50.606957656360734*f-112.23884253719248)+u*(.03296041114873217*u+115.60384449646641*f+-193.58209356861505)+f*(-22.33816807309886*f-180.12613974708367);return[Math.max(0,Math.min(1,p/255)),Math.max(0,Math.min(1,d/255)),Math.max(0,Math.min(1,b/255))]},labToRgb:function(s){for(var l=903.3,c=.008856,u=s[0],f=s[1],p=s[2],d=(u+16)/116,b=d*d*d,y=d-p/200,g=y*y*y,h=f/500+d,m=h*h*h,w=g>c?g:(116*y-16)/l,A=b>c?b:(116*d-16)/l,v=m>c?m:(116*h-16)/l,T=v*96.72,N=A*100,M=w*81.427,P=[T/100,N/100,M/100],O=[3.1338561,-1.6168667,-.4906146,-.9787684,1.9161415,.033454,.0719453,-.2289914,1.4052427],ne=[O[0]*P[0]+O[1]*P[1]+O[2]*P[2],O[3]*P[0]+O[4]*P[1]+O[5]*P[2],O[6]*P[0]+O[7]*P[1]+O[8]*P[2]],R=0;R<3;R++)ne[R]=Math.max(0,Math.min(1,i.UDOC.C.srgbGamma(ne[R])));return ne}},i.UDOC.getState=function(o){return{font:i.UDOC.getFont(),dd:{flat:1},space:"/DeviceGray",ca:1,colr:[0,0,0],sspace:"/DeviceGray",CA:1,COLR:[0,0,0],bmode:"/Normal",SA:!1,OPM:0,AIS:!1,OP:!1,op:!1,SMask:"/None",lwidth:1,lcap:0,ljoin:0,mlimit:10,SM:.1,doff:0,dash:[],ctm:[1,0,0,1,0,0],cpos:[0,0],pth:{cmds:[],crds:[]},cpth:o?i.UDOC.G.rectToPath(o):null}},i.UDOC.getFont=function(){return{Tc:0,Tw:0,Th:100,Tl:0,Tf:"Helvetica-Bold",Tfs:1,Tmode:0,Trise:0,Tk:0,Tal:0,Tun:0,Tm:[1,0,0,1,0,0],Tlm:[1,0,0,1,0,0],Trm:[1,0,0,1,0,0]}},i.FromEMF=function(){},i.FromEMF.Parse=function(o,s){o=new Uint8Array(o);for(var l=0,c={fill:!1,strk:!1,bb:[0,0,1,1],wbb:[0,0,1,1],fnt:{nam:"Arial",hgh:25,und:!1,orn:0},tclr:[0,0,0],talg:0},u,f=[],p=[],d=i.FromEMF.B.readShort,b=i.FromEMF.B.readUshort,y=i.FromEMF.B.readInt,g=i.FromEMF.B.readUint,h=i.FromEMF.B.readFloat;;){var m=g(o,l);l+=4;var w=i.FromEMF.K[m],A=g(o,l);l+=4;var v=l,T=null,N=0;if(w=="EOF")break;if(w=="HEADER")c.bb=i.FromEMF._readBox(o,v),v+=16,s.StartPage(c.bb[0],c.bb[1],c.bb[2],c.bb[3]),u=i.UDOC.getState(c.bb);else if(w=="SAVEDC")p.push(JSON.stringify(u),JSON.stringify(c));else if(w=="RESTOREDC"){var M=y(o,v);for(v+=4;M<-1;)p.pop(),p.pop();c=JSON.parse(p.pop()),u=JSON.parse(p.pop())}else if(w=="SELECTCLIPPATH")u.cpth=JSON.parse(JSON.stringify(u.pth));else if(["SETMAPMODE","SETPOLYFILLMODE","SETBKMODE","SETICMMODE","SETROP2","EXTSELECTCLIPRGN"].indexOf(w)==-1){if(w=="SETMITERLIMIT")u.mlimit=g(o,v);else if(w=="SETTEXTCOLOR")c.tclr=[o[v]/255,o[v+1]/255,o[v+2]/255];else if(w=="SETTEXTALIGN")c.talg=g(o,v);else if(w=="SETVIEWPORTEXTEX"||w=="SETVIEWPORTORGEX"){c.vbb==null&&(c.vbb=[]);var P=w=="SETVIEWPORTORGEX"?0:2;c.vbb[P]=y(o,v),v+=4,c.vbb[P+1]=y(o,v),v+=4,w=="SETVIEWPORTEXTEX"&&i.FromEMF._updateCtm(c,u)}else if(w=="SETWINDOWEXTEX"||w=="SETWINDOWORGEX"){var P=w=="SETWINDOWORGEX"?0:2;c.wbb[P]=y(o,v),v+=4,c.wbb[P+1]=y(o,v),v+=4,w=="SETWINDOWEXTEX"&&i.FromEMF._updateCtm(c,u)}else if(w=="COMMENT")g(o,v),v+=4;else if(w=="SELECTOBJECT"){var O=g(o,v);if(v+=4,O==2147483648)c.fill=!0,u.colr=[1,1,1];else if(O==2147483653)c.fill=!1;else if(O==2147483655)c.strk=!0,c.lwidth=1,u.COLR=[0,0,0];else if(O==2147483656)c.strk=!1;else if(O!=2147483661){if(O!=2147483662){var ne=f[O];if(ne.t=="b"){if(c.fill=ne.stl!=1,ne.stl!=0){if(ne.stl!=1)throw ne.stl+" e"}u.colr=ne.clr}else if(ne.t=="p")c.strk=ne.stl!=5,u.lwidth=ne.wid,u.COLR=ne.clr;else if(ne.t=="f")c.fnt=ne,u.font.Tf=ne.nam,u.font.Tfs=Math.abs(ne.hgh),u.font.Tun=ne.und;else throw"e"}}}else if(w=="DELETEOBJECT"){var O=g(o,v);if(v+=4,f[O]!=null)f[O]=null;else throw"e"}else if(w=="CREATEBRUSHINDIRECT")N=g(o,v),v+=4,T={t:"b"},T.stl=g(o,v),v+=4,T.clr=[o[v]/255,o[v+1]/255,o[v+2]/255],v+=4,T.htc=g(o,v),v+=4;else if(w=="CREATEPEN"||w=="EXTCREATEPEN")N=g(o,v),v+=4,T={t:"p"},w=="EXTCREATEPEN"?(v+=16,T.stl=g(o,v),v+=4,T.wid=g(o,v),v+=4,v+=4):(T.stl=g(o,v),v+=4,T.wid=g(o,v),v+=4,v+=4),T.clr=[o[v]/255,o[v+1]/255,o[v+2]/255],v+=4;else if(w=="EXTCREATEFONTINDIRECTW"){N=g(o,v),v+=4,T={t:"f",nam:""},T.hgh=y(o,v),v+=4,v+=4*2,T.orn=y(o,v)/10,v+=4;var R=g(o,v);for(v+=4,T.und=o[v+1],T.stk=o[v+2],v+=4*2;b(o,v)!=0;)T.nam+=String.fromCharCode(b(o,v)),v+=2;R>500&&(T.nam+="-Bold")}else if(w=="EXTTEXTOUTW"){v+=16;var I=g(o,v);v+=4,h(o,v),v+=4,h(o,v),v+=4;var E=y(o,v);v+=4;var U=y(o,v);v+=4,u.font.Tm=[1,0,0,-1,0,0],i.UDOC.M.rotate(u.font.Tm,c.fnt.orn*Math.PI/180),i.UDOC.M.translate(u.font.Tm,E,U);var Z=c.talg;if((Z&6)==6)u.font.Tal=2;else if(!(Z&7))u.font.Tal=0;else throw Z+" e";if((Z&24)!=24)if(!(Z&24))i.UDOC.M.translate(u.font.Tm,0,u.font.Tfs);else throw"e";var $=g(o,v);v+=4;var q=g(o,v);v+=4,g(o,v),v+=4,v+=16,g(o,v),v+=4,q+=l-8;for(var J="",re=0;re<$;re++){var Q=b(o,q+re*2);J+=String.fromCharCode(Q)}var X=u.colr;u.colr=c.tclr,s.PutText(u,J,J.length*u.font.Tfs*.5),u.colr=X}else if(w=="BEGINPATH")i.UDOC.G.newPath(u);else if(w!="ENDPATH")if(w=="CLOSEFIGURE")i.UDOC.G.closePath(u);else if(w=="MOVETOEX")i.UDOC.G.moveTo(u,y(o,v),y(o,v+4));else if(w=="LINETO"){if(u.pth.cmds.length==0){var me=u.ctm.slice(0);i.UDOC.M.invert(me);var pe=i.UDOC.M.multPoint(me,u.cpos);i.UDOC.G.moveTo(u,pe[0],pe[1])}i.UDOC.G.lineTo(u,y(o,v),y(o,v+4))}else if(w=="POLYGON"||w=="POLYGON16"||w=="POLYLINE"||w=="POLYLINE16"||w=="POLYLINETO"||w=="POLYLINETO16"){v+=16;var V=w.startsWith("POLYGON"),ee=w.indexOf("TO")!=-1,ce=g(o,v);v+=4,ee||i.UDOC.G.newPath(u),v=i.FromEMF._drawPoly(o,v,ce,u,w.endsWith("16")?2:4,V,ee),ee||i.FromEMF._draw(s,u,c,V)}else if(w=="POLYPOLYGON16"){v+=16;var V=w.startsWith("POLYPOLYGON"),ee=w.indexOf("TO")!=-1,ue=g(o,v);v+=4,v+=4;var ve=v;v+=ue*4,ee||i.UDOC.G.newPath(u);for(var re=0;re<ue;re++){var Ee=b(o,ve+re*4);v=i.FromEMF._drawPoly(o,v,Ee,u,w.endsWith("16")?2:4,V,ee)}ee||i.FromEMF._draw(s,u,c,V)}else if(w=="POLYBEZIER"||w=="POLYBEZIER16"||w=="POLYBEZIERTO"||w=="POLYBEZIERTO16"){v+=16;var Se=w.endsWith("16"),Fe=Se?d:y,Ne=Se?2:4,ce=g(o,v);for(v+=4,w.indexOf("TO")==-1&&(i.UDOC.G.moveTo(u,Fe(o,v),Fe(o,v+Ne)),v+=2*Ne,ce--);ce>0;)i.UDOC.G.curveTo(u,Fe(o,v),Fe(o,v+Ne),Fe(o,v+2*Ne),Fe(o,v+3*Ne),Fe(o,v+4*Ne),Fe(o,v+5*Ne)),v+=6*Ne,ce-=3}else if(w=="RECTANGLE"||w=="ELLIPSE"){i.UDOC.G.newPath(u);var _=i.FromEMF._readBox(o,v);if(w=="RECTANGLE")i.UDOC.G.moveTo(u,_[0],_[1]),i.UDOC.G.lineTo(u,_[2],_[1]),i.UDOC.G.lineTo(u,_[2],_[3]),i.UDOC.G.lineTo(u,_[0],_[3]);else{var B=(_[0]+_[2])/2,G=(_[1]+_[3])/2;i.UDOC.G.arc(u,B,G,(_[2]-_[0])/2,0,2*Math.PI,!1)}i.UDOC.G.closePath(u),i.FromEMF._draw(s,u,c,!0)}else if(w=="FILLPATH")s.Fill(u,!1);else if(w=="STROKEPATH")s.Stroke(u);else if(w=="STROKEANDFILLPATH")s.Fill(u,!1),s.Stroke(u);else if(w=="SETWORLDTRANSFORM"||w=="MODIFYWORLDTRANSFORM"){for(var z=[],re=0;re<6;re++)z.push(h(o,v+re*4));if(v+=24,w=="SETWORLDTRANSFORM")u.ctm=z;else{var I=g(o,v);if(v+=4,I==2){var j=u.ctm;u.ctm=z,i.UDOC.M.concat(u.ctm,j)}else throw"e"}}else if(w=="SETSTRETCHBLTMODE")g(o,v),v+=4;else if(w=="STRETCHDIBITS"){var _=i.FromEMF._readBox(o,v);v+=16;var Y=y(o,v);v+=4;var L=y(o,v);v+=4,y(o,v),v+=4,y(o,v),v+=4;var x=y(o,v);v+=4;var k=y(o,v);v+=4;var F=g(o,v)+l-8;v+=4,g(o,v),v+=4;var K=g(o,v)+l-8;v+=4,g(o,v),v+=4;var ie=g(o,v);if(v+=4,ie!=0)throw"e";g(o,v),v+=4;var se=y(o,v);v+=4;var Ce=y(o,v);v+=4,g(o,F),F+=4;var ke=g(o,F);F+=4;var xe=g(o,F);if(F+=4,ke!=x||xe!=k)throw"e";var Be=b(o,F);F+=2;var Ie=b(o,F);if(F+=2,Ie!=8&&Ie!=24&&Ie!=32)throw Ie+" e";var Ve=g(o,F);if(F+=4,Ve!=0)throw Ve+" e";g(o,F),F+=4,g(o,F),F+=4,g(o,F),F+=4,g(o,F),F+=4,g(o,F),F+=4;var Re=Math.floor((ke*Be*Ie+31&-32)/8),He=new Uint8Array(ke*xe*4);if(Ie==8)for(var G=0;G<xe;G++)for(var B=0;B<ke;B++){var Ge=G*ke+B<<2,O=o[K+(xe-1-G)*Re+B]<<2;He[Ge]=o[F+O+2],He[Ge+1]=o[F+O+1],He[Ge+2]=o[F+O+0],He[Ge+3]=255}if(Ie==24)for(var G=0;G<xe;G++)for(var B=0;B<ke;B++){var Ge=G*ke+B<<2,W=K+(xe-1-G)*Re+B*3;He[Ge]=o[W+2],He[Ge+1]=o[W+1],He[Ge+2]=o[W+0],He[Ge+3]=255}if(Ie==32)for(var G=0;G<xe;G++)for(var B=0;B<ke;B++){var Ge=G*ke+B<<2,W=K+(xe-1-G)*Re+B*4;He[Ge]=o[W+2],He[Ge+1]=o[W+1],He[Ge+2]=o[W+0],He[Ge+3]=o[W+3]}var ye=u.ctm.slice(0);u.ctm=[1,0,0,1,0,0],i.UDOC.M.scale(u.ctm,se,-Ce),i.UDOC.M.translate(u.ctm,Y,L+Ce),i.UDOC.M.concat(u.ctm,ye),s.PutImage(u,He,ke,xe),u.ctm=ye}else console.log(w,A)}T!=null&&(f[N]=T),l+=A-8}s.ShowPage(),s.Done()},i.FromEMF._readBox=function(o,s){for(var l=[],c=0;c<4;c++)l[c]=i.FromEMF.B.readInt(o,s+c*4);return l},i.FromEMF._updateCtm=function(o,s){var l=[1,0,0,1,0,0],c=o.wbb;o.bb;var u=o.vbb&&o.vbb.length==4?o.vbb:o.bb;i.UDOC.M.translate(l,-c[0],-c[1]),i.UDOC.M.scale(l,1/c[2],1/c[3]),i.UDOC.M.scale(l,u[2],u[3]),s.ctm=l},i.FromEMF._draw=function(o,s,l,c){l.fill&&c&&o.Fill(s,!1),l.strk&&s.lwidth!=0&&o.Stroke(s)},i.FromEMF._drawPoly=function(o,s,l,c,u,f,p){for(var d=u==2?i.FromEMF.B.readShort:i.FromEMF.B.readInt,b=0;b<l;b++){var y=d(o,s);s+=u;var g=d(o,s);s+=u,b==0&&!p?i.UDOC.G.moveTo(c,y,g):i.UDOC.G.lineTo(c,y,g)}return f&&i.UDOC.G.closePath(c),s},i.FromEMF.B={uint8:new Uint8Array(4),readShort:function(s,l){var c=i.FromEMF.B.uint8;return c[0]=s[l],c[1]=s[l+1],i.FromEMF.B.int16[0]},readUshort:function(s,l){var c=i.FromEMF.B.uint8;return c[0]=s[l],c[1]=s[l+1],i.FromEMF.B.uint16[0]},readInt:function(s,l){var c=i.FromEMF.B.uint8;return c[0]=s[l],c[1]=s[l+1],c[2]=s[l+2],c[3]=s[l+3],i.FromEMF.B.int32[0]},readUint:function(s,l){var c=i.FromEMF.B.uint8;return c[0]=s[l],c[1]=s[l+1],c[2]=s[l+2],c[3]=s[l+3],i.FromEMF.B.uint32[0]},readFloat:function(s,l){var c=i.FromEMF.B.uint8;return c[0]=s[l],c[1]=s[l+1],c[2]=s[l+2],c[3]=s[l+3],i.FromEMF.B.flot32[0]},readASCII:function(s,l,c){for(var u="",f=0;f<c;f++)u+=String.fromCharCode(s[l+f]);return u}},i.FromEMF.B.int16=new Int16Array(i.FromEMF.B.uint8.buffer),i.FromEMF.B.uint16=new Uint16Array(i.FromEMF.B.uint8.buffer),i.FromEMF.B.int32=new Int32Array(i.FromEMF.B.uint8.buffer),i.FromEMF.B.uint32=new Uint32Array(i.FromEMF.B.uint8.buffer),i.FromEMF.B.flot32=new Float32Array(i.FromEMF.B.uint8.buffer),i.FromEMF.C={EMR_HEADER:1,EMR_POLYBEZIER:2,EMR_POLYGON:3,EMR_POLYLINE:4,EMR_POLYBEZIERTO:5,EMR_POLYLINETO:6,EMR_POLYPOLYLINE:7,EMR_POLYPOLYGON:8,EMR_SETWINDOWEXTEX:9,EMR_SETWINDOWORGEX:10,EMR_SETVIEWPORTEXTEX:11,EMR_SETVIEWPORTORGEX:12,EMR_SETBRUSHORGEX:13,EMR_EOF:14,EMR_SETPIXELV:15,EMR_SETMAPPERFLAGS:16,EMR_SETMAPMODE:17,EMR_SETBKMODE:18,EMR_SETPOLYFILLMODE:19,EMR_SETROP2:20,EMR_SETSTRETCHBLTMODE:21,EMR_SETTEXTALIGN:22,EMR_SETCOLORADJUSTMENT:23,EMR_SETTEXTCOLOR:24,EMR_SETBKCOLOR:25,EMR_OFFSETCLIPRGN:26,EMR_MOVETOEX:27,EMR_SETMETARGN:28,EMR_EXCLUDECLIPRECT:29,EMR_INTERSECTCLIPRECT:30,EMR_SCALEVIEWPORTEXTEX:31,EMR_SCALEWINDOWEXTEX:32,EMR_SAVEDC:33,EMR_RESTOREDC:34,EMR_SETWORLDTRANSFORM:35,EMR_MODIFYWORLDTRANSFORM:36,EMR_SELECTOBJECT:37,EMR_CREATEPEN:38,EMR_CREATEBRUSHINDIRECT:39,EMR_DELETEOBJECT:40,EMR_ANGLEARC:41,EMR_ELLIPSE:42,EMR_RECTANGLE:43,EMR_ROUNDRECT:44,EMR_ARC:45,EMR_CHORD:46,EMR_PIE:47,EMR_SELECTPALETTE:48,EMR_CREATEPALETTE:49,EMR_SETPALETTEENTRIES:50,EMR_RESIZEPALETTE:51,EMR_REALIZEPALETTE:52,EMR_EXTFLOODFILL:53,EMR_LINETO:54,EMR_ARCTO:55,EMR_POLYDRAW:56,EMR_SETARCDIRECTION:57,EMR_SETMITERLIMIT:58,EMR_BEGINPATH:59,EMR_ENDPATH:60,EMR_CLOSEFIGURE:61,EMR_FILLPATH:62,EMR_STROKEANDFILLPATH:63,EMR_STROKEPATH:64,EMR_FLATTENPATH:65,EMR_WIDENPATH:66,EMR_SELECTCLIPPATH:67,EMR_ABORTPATH:68,EMR_COMMENT:70,EMR_FILLRGN:71,EMR_FRAMERGN:72,EMR_INVERTRGN:73,EMR_PAINTRGN:74,EMR_EXTSELECTCLIPRGN:75,EMR_BITBLT:76,EMR_STRETCHBLT:77,EMR_MASKBLT:78,EMR_PLGBLT:79,EMR_SETDIBITSTODEVICE:80,EMR_STRETCHDIBITS:81,EMR_EXTCREATEFONTINDIRECTW:82,EMR_EXTTEXTOUTA:83,EMR_EXTTEXTOUTW:84,EMR_POLYBEZIER16:85,EMR_POLYGON16:86,EMR_POLYLINE16:87,EMR_POLYBEZIERTO16:88,EMR_POLYLINETO16:89,EMR_POLYPOLYLINE16:90,EMR_POLYPOLYGON16:91,EMR_POLYDRAW16:92,EMR_CREATEMONOBRUSH:93,EMR_CREATEDIBPATTERNBRUSHPT:94,EMR_EXTCREATEPEN:95,EMR_POLYTEXTOUTA:96,EMR_POLYTEXTOUTW:97,EMR_SETICMMODE:98,EMR_CREATECOLORSPACE:99,EMR_SETCOLORSPACE:100,EMR_DELETECOLORSPACE:101,EMR_GLSRECORD:102,EMR_GLSBOUNDEDRECORD:103,EMR_PIXELFORMAT:104,EMR_DRAWESCAPE:105,EMR_EXTESCAPE:106,EMR_SMALLTEXTOUT:108,EMR_FORCEUFIMAPPING:109,EMR_NAMEDESCAPE:110,EMR_COLORCORRECTPALETTE:111,EMR_SETICMPROFILEA:112,EMR_SETICMPROFILEW:113,EMR_ALPHABLEND:114,EMR_SETLAYOUT:115,EMR_TRANSPARENTBLT:116,EMR_GRADIENTFILL:118,EMR_SETLINKEDUFIS:119,EMR_SETTEXTJUSTIFICATION:120,EMR_COLORMATCHTOTARGETW:121,EMR_CREATECOLORSPACEW:122},i.FromEMF.K=[],i.ToContext2D=function(o,s){this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.bb=null,this.currPage=0,this.needPage=o,this.scale=s},i.ToContext2D.prototype.StartPage=function(o,s,l,c){if(this.currPage==this.needPage){this.bb=[o,s,l,c];var u=this.scale,f=window.devicePixelRatio,p=this.canvas,d=this.ctx;p.width=Math.round(l*u),p.height=Math.round(c*u),d.translate(0,c*u),d.scale(u,-u),p.setAttribute("style","border:1px solid; width:"+p.width/f+"px; height:"+p.height/f+"px")}},i.ToContext2D.prototype.Fill=function(o,s){if(this.currPage==this.needPage){var l=this.ctx;l.beginPath(),this._setStyle(o,l),this._draw(o.pth,l),l.fill()}},i.ToContext2D.prototype.Stroke=function(o){if(this.currPage==this.needPage){var s=this.ctx;s.beginPath(),this._setStyle(o,s),this._draw(o.pth,s),s.stroke()}},i.ToContext2D.prototype.PutText=function(o,s,l){if(this.currPage==this.needPage){this._scale(o.ctm);var c=this.ctx;this._setStyle(o,c),c.save();var u=[1,0,0,-1,0,0];this._concat(u,o.font.Tm),this._concat(u,o.ctm),c.transform(u[0],u[1],u[2],u[3],u[4],u[5]),c.fillText(s,0,0),c.restore()}},i.ToContext2D.prototype.PutImage=function(o,s,l,c,u){if(this.currPage==this.needPage){var f=this.ctx;if(s.length==l*c*4){if(s=s.slice(0),u&&u.length==l*c*4)for(var p=0;p<s.length;p+=4)s[p+3]=u[p+1];var d=document.createElement("canvas"),b=d.getContext("2d");d.width=l,d.height=c;for(var y=b.createImageData(l,c),p=0;p<s.length;p++)y.data[p]=s[p];b.putImageData(y,0,0),f.save();var g=[1,0,0,1,0,0];this._concat(g,[1/l,0,0,-1/c,0,1]),this._concat(g,o.ctm),f.transform(g[0],g[1],g[2],g[3],g[4],g[5]),f.drawImage(d,0,0),f.restore()}}},i.ToContext2D.prototype.ShowPage=function(){this.currPage++},i.ToContext2D.prototype.Done=function(){};function a(o){return""+parseFloat(o.toFixed(2))}i.ToContext2D.prototype._setStyle=function(o,s){var l=this._scale(o.ctm);s.fillStyle=this._getFill(o.colr,o.ca,s),s.strokeStyle=this._getFill(o.COLR,o.CA,s),s.lineCap=["butt","round","square"][o.lcap],s.lineJoin=["miter","round","bevel"][o.ljoin],s.lineWidth=o.lwidth*l;for(var c=o.dash.slice(0),u=0;u<c.length;u++)c[u]=a(c[u]*l);s.setLineDash(c),s.miterLimit=o.mlimit*l;var f=o.font.Tf,p=f.toLowerCase(),d=p.indexOf("bold")!=-1?"bold ":"",b=p.indexOf("italic")!=-1||p.indexOf("oblique")!=-1?"italic ":"";s.font=d+b+o.font.Tfs+'px "'+f+'"'},i.ToContext2D.prototype._getFill=function(o,s,l){if(o.typ==null)return this._colr(o,s);var c=o,u=c.crds,f=c.mat,p=this._scale(f),d;if(c.typ=="lin"){var b=this._multPoint(f,u.slice(0,2)),y=this._multPoint(f,u.slice(2));d=l.createLinearGradient(b[0],b[1],y[0],y[1])}else if(c.typ=="rad"){var b=this._multPoint(f,u.slice(0,2)),y=this._multPoint(f,u.slice(3));d=l.createRadialGradient(b[0],b[1],u[2]*p,y[0],y[1],u[5]*p)}for(var g=0;g<c.grad.length;g++)d.addColorStop(c.grad[g][0],this._colr(c.grad[g][1],s));return d},i.ToContext2D.prototype._colr=function(o,s){return"rgba("+Math.round(o[0]*255)+","+Math.round(o[1]*255)+","+Math.round(o[2]*255)+","+s+")"},i.ToContext2D.prototype._scale=function(o){return Math.sqrt(Math.abs(o[0]*o[3]-o[1]*o[2]))},i.ToContext2D.prototype._concat=function(o,s){var l=o[0],c=o[1],u=o[2],f=o[3],p=o[4],d=o[5];o[0]=l*s[0]+c*s[2],o[1]=l*s[1]+c*s[3],o[2]=u*s[0]+f*s[2],o[3]=u*s[1]+f*s[3],o[4]=p*s[0]+d*s[2]+s[4],o[5]=p*s[1]+d*s[3]+s[5]},i.ToContext2D.prototype._multPoint=function(o,s){var l=s[0],c=s[1];return[l*o[0]+c*o[2]+o[4],l*o[1]+c*o[3]+o[5]]},i.ToContext2D.prototype._draw=function(o,s){for(var l=0,c=o.crds,u=0;u<o.cmds.length;u++){var f=o.cmds[u];f=="M"?(s.moveTo(c[l],c[l+1]),l+=2):f=="L"?(s.lineTo(c[l],c[l+1]),l+=2):f=="C"?(s.bezierCurveTo(c[l],c[l+1],c[l+2],c[l+3],c[l+4],c[l+5]),l+=6):f=="Q"?(s.quadraticCurveTo(c[l],c[l+1],c[l+2],c[l+3]),l+=4):f=="Z"&&s.closePath()}}},{}],93:[function(e,r,i){Object.defineProperty(i,"__esModule",{value:!0}),i.getBinaryContent=i.isContainMultiType=i.isKoera=i.isJapanese=i.isChinese=i.fromulaRef=i.escapeCharacter=i.generateRandomIndex=i.LightenDarkenColor=i.getRowHeightPixel=i.getColumnWidthPixel=i.getXmlAttibute=i.getPxByEMUs=i.getptToPxRatioByDPI=i.getcellrange=i.getRangetxt=void 0;var a=e("./constant");function o(R,I){var E=R.row[0],U=R.row[1],Z=R.column[0],$=R.column[1];return E==null&&U==null?I+c(Z)+":"+c($):Z==null&&$==null?I+(E+1)+":"+(U+1):Z==$&&E==U?I+c(Z)+(E+1):I+c(Z)+(E+1)+":"+c($)+(U+1)}i.getRangetxt=o;function s(R,I,E){I===void 0&&(I={}),E===void 0&&(E="1");var U=R.split("!"),Z="",$="",q=-1;if(U.length>1){Z=U[0],$=U[1];var J=I[Z];J==null?q=parseInt(E):q=parseInt(J)}else q=parseInt(E),$=U[0];if($.indexOf(":")==-1){var re=parseInt($.replace(/[^0-9]/g,""))-1,Q=l($.replace(/[^A-Za-z]/g,""));return!isNaN(re)&&!isNaN(Q)?{row:[re,re],column:[Q,Q],sheetIndex:q}:null}else{var X=$.split(":"),re=[],Q=[];return re[0]=parseInt(X[0].replace(/[^0-9]/g,""))-1,re[1]=parseInt(X[1].replace(/[^0-9]/g,""))-1,re[0]>re[1]||(Q[0]=l(X[0].replace(/[^A-Za-z]/g,"")),Q[1]=l(X[1].replace(/[^A-Za-z]/g,"")),Q[0]>Q[1])?null:{row:re,column:Q,sheetIndex:q}}}i.getcellrange=s;function l(R){R=R.toUpperCase();var I=R.length;if(I==0)return NaN;for(var E=R.split(""),U=a.columeHeader_word.length,Z=0,$=I-1;$>=0;$--)$==I-1?Z+=a.columeHeader_word_index[E[$]]:Z+=Math.pow(U,I-$-1)*(a.columeHeader_word_index[E[$]]+1);return Z}function c(R){var I=a.columeHeader_word.length;if(R<I)return a.columeHeader_word[R];for(var E=0,U="",Z=1,$=0;R>=I/(I-1)*(Math.pow(I,Z++)-1);)$=Z;var q=R-I/(I-1)*(Math.pow(I,$-1)-1);E=q+1;for(var J=$;J>0;J--){var re=E;if(J==1)return re=re%I,re==0&&(re=26),U+a.columeHeader_word[re-1];re=Math.ceil(re/Math.pow(I,J-1)),U+=a.columeHeader_word[re-1],J>1&&(E=E-(re-1)*I)}}function u(){return 72/96}i.getptToPxRatioByDPI=u;function f(R){if(R==null)return 0;var I=R/914400,E=I*72,U=E/u();return U}i.getPxByEMUs=f;function p(R,I,E){var U=R[I];return U=U??E,U}i.getXmlAttibute=p;function d(R){var I=Math.round((R-.83)*8+5);return I}i.getColumnWidthPixel=d;function b(R){var I=Math.round(R/u());return I}i.getRowHeightPixel=b;function y(R,I){var E=R.substring(R.length-6,R.length),U=h("#"+E),Z=w(U[0],U[1],U[2]);if(I>0)Z[2]=Z[2]*(1-I)+I;else if(I<0)Z[2]=Z[2]*(1+I);else return"#"+E;var $=m(Z[0],Z[1],Z[2]);return g("RGB("+$.join(",")+")")}i.LightenDarkenColor=y;function g(R){var I=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(/^(rgb|RGB)/.test(R)){for(var E=R.replace(/(?:\(|\)|rgb|RGB)*/g,"").split(","),U="#",Z=0;Z<E.length;Z++){var $=Number(E[Z]).toString(16);$.length<2&&($="0"+$),U+=$}return U.length!==7&&(U=R),U}else if(I.test(R)){var q=R.replace(/#/,"").split("");if(q.length===6)return R;if(q.length===3){for(var J="#",Z=0;Z<q.length;Z+=1)J+=q[Z]+q[Z];return J}}return R}function h(R){var I=R.toLowerCase(),E=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(I&&E.test(I)){if(I.length===4){for(var U="#",Z=1;Z<4;Z+=1)U+=I.slice(Z,Z+1).concat(I.slice(Z,Z+1));I=U}for(var $=[],Z=1;Z<7;Z+=2)$.push(parseInt("0x"+I.slice(Z,Z+2)));return $}return null}function m(R,I,E){var U,Z,$;if(I==0)U=Z=$=E;else{var q=function(X,me,pe){return pe<0&&(pe+=1),pe>1&&(pe-=1),pe<.16666666666666666?X+(me-X)*6*pe:pe<.5?me:pe<.6666666666666666?X+(me-X)*(.6666666666666666-pe)*6:X},J=E<.5?E*(1+I):E+I-E*I,re=2*E-J;U=q(re,J,R+1/3),Z=q(re,J,R),$=q(re,J,R-1/3)}return[Math.round(U*255),Math.round(Z*255),Math.round($*255)]}function w(R,I,E){R/=255,I/=255,E/=255;var U=Math.max(R,I,E),Z=Math.min(R,I,E),$,q,J=(U+Z)/2;if(U==Z)$=q=0;else{var re=U-Z;switch(q=J>.5?re/(2-U-Z):re/(U+Z),U){case R:$=(I-E)/re+(I<E?6:0);break;case I:$=(E-R)/re+2;break;case E:$=(R-I)/re+4;break}$/=6}return[$,q,J]}function A(R){R==null&&(R="Sheet");for(var I=window.navigator.userAgent.replace(/[^a-zA-Z0-9]/g,"").split(""),E="",U=0;U<5;U++)E+=I[Math.round(Math.random()*(I.length-1))];var Z=new Date().getTime();return R+"_"+E+"_"+Z}i.generateRandomIndex=A;function v(R){return R==null||R.length==0?R:R.replace(/&/g,"&").replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/ /g," ").replace(/'/g,"'").replace(/¡/g,"¡").replace(/¢/g,"¢").replace(/£/g,"£").replace(/¤/g,"¤").replace(/¥/g,"¥").replace(/¦/g,"¦").replace(/§/g,"§").replace(/¨/g,"¨").replace(/©/g,"©").replace(/ª/g,"ª").replace(/«/g,"«").replace(/¬/g,"¬").replace(/­/g,"").replace(/®/g,"®").replace(/¯/g,"¯").replace(/°/g,"°").replace(/±/g,"±").replace(/²/g,"²").replace(/³/g,"³").replace(/´/g,"´").replace(/µ/g,"µ").replace(/¶/g,"¶").replace(/·/g,"·").replace(/¸/g,"¸").replace(/¹/g,"¹").replace(/º/g,"º").replace(/»/g,"»").replace(/¼/g,"¼").replace(/½/g,"½").replace(/¾/g,"¾").replace(/¿/g,"¿").replace(/×/g,"×").replace(/÷/g,"÷").replace(/À/g,"À").replace(/Á/g,"Á").replace(/Â/g,"Â").replace(/Ã/g,"Ã").replace(/Ä/g,"Ä").replace(/Å/g,"Å").replace(/Æ/g,"Æ").replace(/Ç/g,"Ç").replace(/È/g,"È").replace(/É/g,"É").replace(/Ê/g,"Ê").replace(/Ë/g,"Ë").replace(/Ì/g,"Ì").replace(/Í/g,"Í").replace(/Î/g,"Î").replace(/Ï/g,"Ï").replace(/Ð/g,"Ð").replace(/Ñ/g,"Ñ").replace(/Ò/g,"Ò").replace(/Ó/g,"Ó").replace(/Ô/g,"Ô").replace(/Õ/g,"Õ").replace(/Ö/g,"Ö").replace(/Ø/g,"Ø").replace(/Ù/g,"Ù").replace(/Ú/g,"Ú").replace(/Û/g,"Û").replace(/Ü/g,"Ü").replace(/Ý/g,"Ý").replace(/Þ/g,"Þ").replace(/ß/g,"ß").replace(/à/g,"à").replace(/á/g,"á").replace(/â/g,"â").replace(/ã/g,"ã").replace(/ä/g,"ä").replace(/å/g,"å").replace(/æ/g,"æ").replace(/ç/g,"ç").replace(/è/g,"è").replace(/é/g,"é").replace(/ê/g,"ê").replace(/ë/g,"ë").replace(/ì/g,"ì").replace(/í/g,"í").replace(/î/g,"î").replace(/ï/g,"ï").replace(/ð/g,"ð").replace(/ñ/g,"ñ").replace(/ò/g,"ò").replace(/ó/g,"ó").replace(/ô/g,"ô").replace(/õ/g,"õ").replace(/ö/g,"ö").replace(/ø/g,"ø").replace(/ù/g,"ù").replace(/ú/g,"ú").replace(/û/g,"û").replace(/ü/g,"ü").replace(/ý/g,"ý").replace(/þ/g,"þ").replace(/ÿ/g,"ÿ")}i.escapeCharacter=v;var T=function(){function R(){}return R.trim=function(I){return I==null&&(I=""),I.replace(/(^\s*)|(\s*$)/g,"")},R.functionCopy=function(I,E,U){var Z=this;if(Z.operatorjson==null){for(var $=Z.operator.split("|"),q={},J=0;J<$.length;J++)q[$[J].toString()]=1;Z.operatorjson=q}E==null&&(E="down"),U==null&&(U=1),I.substr(0,1)=="="&&(I=I.substr(1));for(var re=I.split(""),Q=0,X="",me="",pe={bracket:0,comma:0,squote:0,dquote:0};Q<re.length;){var V=re[Q];if(V=="("&&pe.dquote==0)pe.bracket+=1,X.length>0?me+=X+"(":me+="(",X="";else if(V==")"&&pe.dquote==0)pe.bracket-=1,me+=Z.functionCopy(X,E,U)+")",X="";else if(V=='"'&&pe.squote==0)pe.dquote>0?(me+=X+'"',pe.dquote-=1,X=""):(pe.dquote+=1,X+='"');else if(V==","&&pe.dquote==0)me+=Z.functionCopy(X,E,U)+",",X="";else if(V=="&"&&pe.dquote==0)X.length>0?(me+=Z.functionCopy(X,E,U)+"&",X=""):me+="&";else if(V in Z.operatorjson&&pe.dquote==0){var ee="";Q+1<re.length&&(ee=re[Q+1]);var ce=Q-1,ue=null;if(ce>=0)do ue=re[ce--];while(ce>=0&&ue==" ");V+ee in Z.operatorjson?(X.length>0?(me+=Z.functionCopy(X,E,U)+V+ee,X=""):me+=V+ee,Q++):!/[^0-9]/.test(ee)&&V=="-"&&(ue=="("||ue==null||ue==","||ue==" "||ue in Z.operatorjson)?X+=V:X.length>0?(me+=Z.functionCopy(X,E,U)+V,X=""):me+=V}else X+=V;Q==re.length-1&&(Z.iscelldata(Z.trim(X))?E=="down"?me+=Z.downparam(Z.trim(X),U):E=="up"?me+=Z.upparam(Z.trim(X),U):E=="left"?me+=Z.leftparam(Z.trim(X),U):E=="right"&&(me+=Z.rightparam(Z.trim(X),U)):me+=Z.trim(X)),Q++}return me},R.downparam=function(I,E){return this.updateparam("d",I,E)},R.upparam=function(I,E){return this.updateparam("u",I,E)},R.leftparam=function(I,E){return this.updateparam("l",I,E)},R.rightparam=function(I,E){return this.updateparam("r",I,E)},R.updateparam=function(I,E,U){var Z=this,$=E.split("!"),q,J="";if($.length>1?(q=$[1],J=$[0]+"!"):q=$[0],q.indexOf(":")==-1){var re=parseInt(q.replace(/[^0-9]/g,"")),Q=l(q.replace(/[^A-Za-z]/g,"")),X=Z.isfreezonFuc(q),me=X[0]?"$":"",pe=X[1]?"$":"";return I=="u"&&!X[0]?re-=U:I=="r"&&!X[1]?Q+=U:I=="l"&&!X[1]?Q-=U:X[0]||(re+=U),re<0||Q<0?Z.error.r:!isNaN(re)&&!isNaN(Q)?J+pe+c(Q)+me+re:isNaN(re)?isNaN(Q)?E:J+pe+c(Q):J+me+re}else{q=q.split(":");var re=[],Q=[];if(re[0]=parseInt(q[0].replace(/[^0-9]/g,"")),re[1]=parseInt(q[1].replace(/[^0-9]/g,"")),re[0]>re[1]||(Q[0]=l(q[0].replace(/[^A-Za-z]/g,"")),Q[1]=l(q[1].replace(/[^A-Za-z]/g,"")),Q[0]>Q[1]))return E;var V=Z.isfreezonFuc(q[0]),ee=Z.isfreezonFuc(q[1]),ce=V[0]?"$":"",ue=V[1]?"$":"",ve=ee[0]?"$":"",Ee=ee[1]?"$":"";return I=="u"?(V[0]||(re[0]-=U),ee[0]||(re[1]-=U)):I=="r"?(V[1]||(Q[0]+=U),ee[1]||(Q[1]+=U)):I=="l"?(V[1]||(Q[0]-=U),ee[1]||(Q[1]-=U)):(V[0]||(re[0]+=U),ee[0]||(re[1]+=U)),re[0]<0||Q[0]<0?Z.error.r:isNaN(Q[0])&&isNaN(Q[1])?J+ce+re[0]+":"+ve+re[1]:isNaN(re[0])&&isNaN(re[1])?J+ue+c(Q[0])+":"+Ee+c(Q[1]):J+ue+c(Q[0])+ce+re[0]+":"+Ee+c(Q[1])+ve+re[1]}},R.iscelldata=function(I){var E=I.split("!"),U;E.length>1?U=E[1]:U=E[0];var Z=/^(([a-zA-Z]+)|([$][a-zA-Z]+))(([0-9]+)|([$][0-9]+))$/g,$=/^(((([a-zA-Z]+)|([$][a-zA-Z]+))(([0-9]+)|([$][0-9]+)))|((([a-zA-Z]+)|([$][a-zA-Z]+))))$/g;if(U.indexOf(":")==-1){var q=parseInt(U.replace(/[^0-9]/g,""))-1,J=l(U.replace(/[^A-Za-z]/g,""));return!isNaN(q)&&!isNaN(J)&&U.toString().match(Z)?!0:(isNaN(q)&&isNaN(J),!1)}else{$=/^(((([a-zA-Z]+)|([$][a-zA-Z]+))(([0-9]+)|([$][0-9]+)))|((([a-zA-Z]+)|([$][a-zA-Z]+)))|((([0-9]+)|([$][0-9]+s))))$/g,U=U.split(":");var q=[],J=[];return q[0]=parseInt(U[0].replace(/[^0-9]/g,""))-1,q[1]=parseInt(U[1].replace(/[^0-9]/g,""))-1,q[0]>q[1]||(J[0]=l(U[0].replace(/[^A-Za-z]/g,"")),J[1]=l(U[1].replace(/[^A-Za-z]/g,"")),J[0]>J[1])?!1:!!(U[0].toString().match($)&&U[1].toString().match($))}},R.isfreezonFuc=function(I){var E=I.replace(/[^0-9]/g,""),U=I.replace(/[^A-Za-z]/g,""),Z=I.substr(I.indexOf(E)-1,1),$=I.substr(I.indexOf(U)-1,1),q=[!1,!1];return Z=="$"&&(q[0]=!0),$=="$"&&(q[1]=!0),q},R.operator="==|!=|<>|<=|>=|=|+|-|>|<|/|*|%|&|^",R.error={v:"#VALUE!",n:"#NAME?",na:"#N/A",r:"#REF!",d:"#DIV/0!",nm:"#NUM!",nl:"#NULL!",sp:"#SPILL!"},R.operatorjson=null,R}();i.fromulaRef=T;function N(R){var I=/[^\u4e00-\u9fa5]/,E=/[\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|\uffe5]/;return E.test(R)?!0:!I.test(R)}i.isChinese=N;function M(R){var I=/[^\u0800-\u4e00]/;return!I.test(R)}i.isJapanese=M;function P(R){return R>12592&&R<12687||R>=44032&&R<=55203}i.isKoera=P;function O(R){var I=!1;escape(R).indexOf("%u")>-1&&(I=!0);var E=!1,U=/[0-9a-z]/gi;U.test(R)&&(E=!0);var Z=/[\x00-\xff]+/g;return Z.test(R)&&(E=!0),!!(I&&E)}i.isContainMultiType=O;function ne(R,I){var E,U,Z,$;I||(I={});var q=function(){try{return new window.XMLHttpRequest}catch{}},J=function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch{}},re=typeof window<"u"&&window.ActiveXObject?function(){return q()||J()}:q;typeof I=="function"?($=I,I={}):typeof I.callback=="function"&&($=I.callback),U=function(me){$(null,me)},Z=function(me){$(me,null)};try{var Q=re();Q.open("GET",R,!0),"responseType"in Q&&(Q.responseType="arraybuffer"),Q.overrideMimeType&&Q.overrideMimeType("text/plain; charset=x-user-defined"),Q.onreadystatechange=function(X){if(Q.readyState===4)if(Q.status===200||Q.status===0)try{U(function(me){return me.response||me.responseText}(Q))}catch(me){Z(new Error(me))}else Z(new Error("Ajax error for "+R+" : "+this.status+" "+this.statusText))},I.progress&&(Q.onprogress=function(X){I.progress({path:R,originalEvent:X,percent:X.loaded/X.total*100,loaded:X.loaded,total:X.total})}),Q.send()}catch(X){Z(new Error(X),null)}return E}i.getBinaryContent=ne},{"./constant":91}],94:[function(e,r,i){Object.defineProperty(i,"__esModule",{value:!0}),i.LuckyExcel=void 0;var a=e("./ToLuckySheet/LuckyFile"),o=e("./HandleZip"),s=function(){function l(){}return l.transformExcelToLucky=function(c,u){var f=new o.HandleZip(c);f.unzipFile(function(p){var d=new a.LuckyFile(p,c.name),b=d.Parse(),y=JSON.parse(b);u!=null&&u(y,b)},function(p){console.error(p)})},l.transformExcelToLuckyByUrl=function(c,u,f){var p=new o.HandleZip;p.unzipFileByUrl(c,function(d){var b=new a.LuckyFile(d,u),y=b.Parse(),g=JSON.parse(y);f!=null&&f(g,y)},function(d){console.error(d)})},l.transformLuckyToExcel=function(c,u){},l}();i.LuckyExcel=s},{"./HandleZip":84,"./ToLuckySheet/LuckyFile":87}],95:[function(e,r,i){var a=e("./main");r.exports=a.LuckyExcel},{"./main":94}]},{},[95])(95)})})(Al);var G0=Al.exports;const K0=il(G0);async function J0(n){return new Promise((t,e)=>{const r=new FileReader;r.readAsArrayBuffer(n),r.onload=function(){const i=document.createElement("div");X0(r.result,i,void 0,{useBase64URL:!0}).then(()=>{t(i.outerHTML)}).catch(e)},r.onerror=e})}async function Y0(n){return new Promise((t,e)=>{K0.transformExcelToLucky(n,function(r,i){if(r.sheets===null||r.sheets.length===0){e(new Error("读取 Excel 文件内容失败,当前不支持 xls 文件"));return}const a=JSON.parse(i).sheets;t(a)})})}function Q0(n){try{const e=new URL(n).pathname,r=e.substring(e.lastIndexOf("/")+1);return decodeURIComponent(r)}catch{return"未命名文档"}}const q0=Object.freeze(Object.defineProperty({__proto__:null,convertDocx:J0,convertExcel:Y0,getFileNameFromUrl:Q0},Symbol.toStringTag,{value:"Module"}));Rt.DocumentEditorPage=nl,Rt.default=Ep,Object.defineProperties(Rt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|