doccraft 0.1.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 +84 -0
- package/dist/blocks/base-styles.d.ts +6 -0
- package/dist/blocks/for-block/extension.d.ts +16 -0
- package/dist/blocks/for-block/index.d.ts +2 -0
- package/dist/blocks/for-block/styles.d.ts +2 -0
- package/dist/blocks/for-block/view.d.ts +2 -0
- package/dist/blocks/if-block/extension.d.ts +11 -0
- package/dist/blocks/if-block/index.d.ts +2 -0
- package/dist/blocks/if-block/styles.d.ts +2 -0
- package/dist/blocks/if-block/view.d.ts +2 -0
- package/dist/blocks/index.d.ts +5 -0
- package/dist/blocks/readonly-block/extension.d.ts +12 -0
- package/dist/blocks/readonly-block/index.d.ts +2 -0
- package/dist/blocks/readonly-block/styles.d.ts +2 -0
- package/dist/blocks/readonly-block/view.d.ts +2 -0
- package/dist/blocks/types.d.ts +47 -0
- package/dist/canvas/HeaderFooterField.d.ts +11 -0
- package/dist/canvas/PageCanvas.d.ts +16 -0
- package/dist/canvas/canvas-config.d.ts +25 -0
- package/dist/core/DocCraft.d.ts +54 -0
- package/dist/core/page-flow-plugin.d.ts +22 -0
- package/dist/core/use-editor.d.ts +14 -0
- package/dist/doccraft.cjs +1006 -0
- package/dist/doccraft.cjs.map +1 -0
- package/dist/doccraft.css +2 -0
- package/dist/doccraft.js +53090 -0
- package/dist/doccraft.js.map +1 -0
- package/dist/extensions/TemplateVariableView.d.ts +2 -0
- package/dist/extensions/page-break.d.ts +9 -0
- package/dist/extensions/paste-handler.d.ts +14 -0
- package/dist/extensions/resizable-image.d.ts +15 -0
- package/dist/extensions/template-variable.d.ts +21 -0
- package/dist/hooks/use-block-styles.d.ts +7 -0
- package/dist/image/HfResizableImage.d.ts +2 -0
- package/dist/image/ImageCropOverlay.d.ts +14 -0
- package/dist/image/ImageNodeView.d.ts +2 -0
- package/dist/index.d.ts +13 -0
- package/dist/pdf-C0490ZCf.js +15393 -0
- package/dist/pdf-C0490ZCf.js.map +1 -0
- package/dist/pdf-DDIBR0qz.cjs +12 -0
- package/dist/pdf-DDIBR0qz.cjs.map +1 -0
- package/dist/table/TableControls.d.ts +6 -0
- package/dist/toolbar/BubbleToolbar.d.ts +6 -0
- package/dist/toolbar/EditorActions.d.ts +25 -0
- package/dist/toolbar/EditorToolbar.d.ts +17 -0
- package/dist/toolbar/toolbar-config.d.ts +3 -0
- package/dist/types.d.ts +35 -0
- package/dist/ui/button.d.ts +8 -0
- package/dist/ui/card.d.ts +11 -0
- package/dist/ui/dialog.d.ts +17 -0
- package/dist/ui/dropdown-menu.d.ts +29 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/label.d.ts +3 -0
- package/dist/ui/popover.d.ts +9 -0
- package/dist/ui/separator.d.ts +3 -0
- package/dist/ui/toggle-group.d.ts +10 -0
- package/dist/ui/toggle.d.ts +8 -0
- package/dist/ui/tooltip.d.ts +6 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/export-html.d.ts +39 -0
- package/dist/utils/image-utils.d.ts +8 -0
- package/dist/utils/import-docx.d.ts +20 -0
- package/dist/utils/import-pdf.d.ts +19 -0
- package/package.json +93 -0
|
@@ -0,0 +1,1006 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);let f=require(`react`);f=u(f);let p=require(`react-dom`);p=u(p);let m=require(`react/jsx-runtime`);var h=s((e=>{var t=require(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),g=s((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}function n(e,t){d||a.startTransition===void 0||(d=!0,console.error(`You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.`));var n=t();if(!f){var i=t();o(n,i)||(console.error(`The result of getSnapshot should be cached to avoid an infinite loop`),f=!0)}i=s({inst:{value:n,getSnapshot:t}});var p=i[0].inst,m=i[1];return l(function(){p.value=n,p.getSnapshot=t,r(p)&&m({inst:p})},[e,n,t]),c(function(){return r(p)&&m({inst:p}),e(function(){r(p)&&m({inst:p})})},[e]),u(n),n}function r(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch{return!0}}function i(e,t){return t()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=require(`react`),o=typeof Object.is==`function`?Object.is:t,s=a.useState,c=a.useEffect,l=a.useLayoutEffect,u=a.useDebugValue,d=!1,f=!1,p=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?i:n;e.useSyncExternalStore=a.useSyncExternalStore===void 0?p:a.useSyncExternalStore,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),_=s(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=h():t.exports=g()})),v=_();function y(e){this.content=e}y.prototype={constructor:y,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new y(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new y(n)},addToStart:function(e,t){return new y([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new y(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new y(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=y.from(e),e.size?new y(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=y.from(e),e.size?new y(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=y.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},y.from=function(e){if(e instanceof y)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new y(t)};function b(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=b(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function x(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=x(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var S=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return b(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return x(this,e,t,n)}findIndex(e){if(e==0)return w(0,e);if(e==this.size)return w(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?w(t+1,i):w(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};S.empty=new S([],0);var C={index:0,offset:0};function w(e,t){return C.index=e,C.offset=t,C}function T(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!T(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!T(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var E=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&T(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};E.none=[];var D=class extends Error{},O=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=A(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(k(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(S.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};O.empty=new O(S.empty,0,0);function k(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(k(a.content,t-i-1,n-i-1)))}function A(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=A(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function j(e,t,n){if(n.openStart>e.depth)throw new D(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new D(`Inconsistent open depths`);return M(e,t,n,0)}function M(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=M(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return L(a,z(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return L(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=B(n,e);return L(a,R(e,i,o,t,r))}}function N(e,t){if(!t.type.compatibleContent(e.type))throw new D(`Cannot join `+t.type.name+` onto `+e.type.name)}function P(e,t,n){let r=e.node(n);return N(r,t.node(n)),r}function F(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function I(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(F(e.nodeAfter,r),a++));for(let e=a;e<o;e++)F(i.child(e),r);t&&t.depth==n&&t.textOffset&&F(t.nodeBefore,r)}function L(e,t){return e.type.checkContent(t),e.copy(t)}function R(e,t,n,r,i){let a=e.depth>i&&P(e,t,i+1),o=r.depth>i&&P(n,r,i+1),s=[];return I(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(N(a,o),F(L(a,R(e,t,n,r,i+1)),s)):(a&&F(L(a,z(e,t,i+1)),s),I(t,n,i,s),o&&F(L(o,z(n,r,i+1)),s)),I(r,null,i,s),new S(s)}function z(e,t,n){let r=[];return I(null,e,n,r),e.depth>n&&F(L(P(e,t,n+1),z(e,t,n+1)),r),I(t,null,n,r),new S(r)}function B(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(S.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var ee=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return E.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ie(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=re.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else re.set(t,r=new te);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%ne,i}},te=class{constructor(){this.elts=[],this.i=0}},ne=12,re=new WeakMap,ie=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},V=Object.create(null),H=class e{constructor(e,t,n,r=E.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||S.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&T(this.attrs,t||e.defaultAttrs||V)&&E.sameSet(this.marks,n||E.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return O.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new O(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return j(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return ee.resolveCached(this,e)}resolveNoCache(e){return ee.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),oe(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=S.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=E.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!E.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=S.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};H.prototype.text=void 0;var ae=class e extends H{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):oe(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function oe(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var se=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new ce(t,n);if(r.next==null)return e.empty;let i=le(r);r.next&&r.err(`Unexpected trailing text`);let a=ye(ge(i));return be(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return S.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
2
|
+
`)}};se.empty=new se(!0);var ce=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function le(e){let t=[];do t.push(ue(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function ue(e){let t=[];do t.push(de(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function de(e){let t=he(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=pe(e,t);else break;return t}function fe(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function pe(e,t){let n=fe(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:fe(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function me(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function he(e){if(e.eat(`(`)){let t=le(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=me(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function ge(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function _e(e,t){return t-e}function ve(e,t){let n=[];return r(t),n.sort(_e);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function ye(e){let t=Object.create(null);return n(ve(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);ve(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new se(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(_e);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function be(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function xe(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Se(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function Ce(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function we(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new De(e,r,t[r]);return n}var Te=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=we(e,n.attrs),this.defaultAttrs=xe(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==se.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Se(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new H(this,this.computeAttrs(e),S.from(t),E.setFrom(n))}createChecked(e=null,t,n){return t=S.from(t),this.checkContent(t),new H(this,this.computeAttrs(e),t,E.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=S.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(S.empty,!0);return i?new H(this,e,t.append(i),E.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Ce(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:E.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function Ee(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var De=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Ee(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},Oe=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=we(e,r.attrs),this.excluded=null;let i=xe(this.attrs);this.instance=i?new E(this,i):null}create(e=null){return!e&&this.instance?this.instance:new E(this,Se(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Ce(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},ke=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=y.from(e.nodes),t.marks=y.from(e.marks||{}),this.nodes=Te.compile(this.spec.nodes,this),this.marks=Oe.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=se.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?Ae(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:Ae(this,n.split(` `))}this.nodeFromJSON=e=>H.fromJSON(this,e),this.markFromJSON=e=>E.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof Te))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new ae(n,n.defaultAttrs,e,E.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function Ae(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function je(e){return e.tag!=null}function Me(e){return e.style!=null}var Ne=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(je(e))this.tags.push(e);else if(Me(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new He(this,t,!1);return n.addAll(e,E.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new He(this,t,!0);return n.addAll(e,E.none,t.from,t.to),O.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(We(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Ge(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Ge(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},Pe={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},Fe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ie={ol:!0,ul:!0},Le=1,Re=2,ze=4;function Be(e,t,n){return t==null?e&&e.whitespace==`pre`?Le|Re:n&~ze:(t?Le:0)|(t===`full`?Re:0)}var Ve=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=E.none,this.match=i||(a&ze?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(S.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Le)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=S.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(S.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Pe.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},He=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=Be(null,t.preserveWhitespace,0)|(n?ze:0);i=r?new Ve(r.type,r.attrs,E.none,!0,t.topMatch||r.type.contentMatch,a):n?new Ve(null,null,E.none,!0,null,a):new Ve(e.schema.topNodeType,null,E.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&Re?`full`:this.localPreserveWS||(r.options&Le)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
|
|
3
|
+
`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;Ie.hasOwnProperty(a)&&this.parser.normalizeLists&&Ue(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:Fe.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(Pe.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
|
+
`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=E.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):Ke(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=Be(e,i,a.options);a.options&ze&&a.content.length==0&&(o|=ze);let s=E.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):Ke(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new Ve(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));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(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=Le);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function Ue(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Ie.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function We(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Ge(e){let t={};for(let n in e)t[n]=e[n];return t}function Ke(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var qe=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=Ye(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=$e(Ye(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&$e(Ye(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return $e(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Je(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Je(e.marks)}};function Je(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Ye(e){return e.document||window.document}var Xe=new WeakMap;function Ze(e){let t=Xe.get(e);return t===void 0&&Xe.set(e,t=Qe(e)),t}function Qe(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function $e(e,t,n,r){if(typeof t==`string`)return{dom:e.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 RangeError(`Invalid array passed to renderSpec`);if(r&&(a=Ze(r))&&a.indexOf(t)>-1)throw 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&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=$e(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var et=65535,tt=2**16;function nt(e,t){return e+t*tt}function rt(e){return e&et}function it(e){return(e-(e&et))/tt}var at=1,ot=2,st=4,ct=8,lt=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&ct)>0}get deletedBefore(){return(this.delInfo&(at|st))>0}get deletedAfter(){return(this.delInfo&(ot|st))>0}get deletedAcross(){return(this.delInfo&st)>0}},ut=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=rt(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+it(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:nt(o/3,e-s),f=e==s?ot:e==u?at:st;return(t<0?e!=s:e!=u)&&(f|=ct),new lt(a,f,d)}r+=l-c}return n?e+r:new lt(e+r,0,null)}touches(e,t){let n=0,r=rt(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};ut.empty=new ut([]);var dt=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new lt(e,r,null)}},ft=Object.create(null),pt=class{getMap(){return ut.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=ft[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in ft)throw RangeError(`Duplicate use of step JSON ID `+e);return ft[e]=t,t.prototype.jsonID=e,t}},mt=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof D)return e.fail(t.message);throw t}}};function ht(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(ht(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return S.fromArray(r)}var gt=class e extends pt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new O(ht(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return mt.fromReplace(e,this.from,this.to,i)}invert(){return new _t(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(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,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};pt.jsonID(`addMark`,gt);var _t=class e extends pt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new O(ht(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return mt.fromReplace(e,this.from,this.to,n)}invert(){return new gt(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(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,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};pt.jsonID(`removeMark`,_t);var vt=class e extends pt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return mt.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return mt.fromReplace(e,this.pos,this.pos+1,new O(S.from(n),0,t.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new yt(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};pt.jsonID(`addNodeMark`,vt);var yt=class e extends pt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return mt.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return mt.fromReplace(e,this.pos,this.pos+1,new O(S.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new vt(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};pt.jsonID(`removeNodeMark`,yt);var bt=class e extends pt{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&St(e,this.from,this.to)?mt.fail(`Structure replace would overwrite content`):mt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ut([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?O.empty:new O(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?O.empty:new O(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,O.fromJSON(t,n.slice),!!n.structure)}};pt.jsonID(`replace`,bt);var xt=class e extends pt{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(St(e,this.from,this.gapFrom)||St(e,this.gapTo,this.to)))return mt.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return mt.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?mt.fromReplace(e,this.from,this.to,n):mt.fail(`Content does not fit in gap`)}getMap(){return new ut([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,O.fromJSON(t,n.slice),n.insert,!!n.structure)}};pt.jsonID(`replaceAround`,xt);function St(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Ct(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new _t(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new gt(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function wt(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof Oe){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new _t(t.from,t.to,t.style)))}function Tt(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new bt(s,l,O.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new _t(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new O(S.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new bt(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(S.empty,!0);e.replace(s,s,new O(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Et(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Dt(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Et(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function Ot(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=S.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=S.from(r.node(e).copy(u)),d++):c--;let f=S.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=S.from(i.node(e).copy(f)),p++):l++;e.step(new xt(c,l,o,s,new O(u.append(f),d,p),u.size-d,!0))}function kt(e,t,n=null,r=e){let i=jt(e,t),a=i&&Mt(r,t);return a?i.map(At).concat({type:t,attrs:n}).concat(a.map(At)):null}function At(e){return{type:e,attrs:null}}function jt(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Mt(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function Nt(e,t,n){let r=S.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=S.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new xt(i,a,i,a,new O(r,0,0),n.length,!0))}function Pt(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&Lt(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&It(e,t,n,a),Tt(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new xt(c,l,c+1,l-1,new O(S.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Ft(e,t,n,a),!1}})}function Ft(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function It(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
|
|
5
|
+
`))}})}function Lt(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Rt(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new xt(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new O(S.from(o),0,0),1,!0))}function zt(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function Bt(e,t,n=1,r){let i=e.doc.resolve(t),a=S.empty,o=S.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=S.from(i.node(e).copy(a));let t=r&&r[s];o=S.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new bt(t,t,new O(a.append(o),n,n),!0))}function Vt(e,t){let n=e.resolve(t),r=n.index();return Ut(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Ht(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function Ut(e,t){return!!(e&&t&&!e.isLeaf&&Ht(e,t))}function Wt(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&Ut(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function Gt(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);It(e,r.node(),r.before(),s)}o.inlineContent&&Tt(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new bt(l,c.map(t+n,-1),O.empty,!0)),r===!0){let t=e.doc.resolve(l);Ft(e,t.node(),t.before(),e.steps.length)}return e}function Kt(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function qt(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+(n>0?1:0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Jt(e,t,n=t,r=O.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Yt(i,a,r)?new bt(t,n,r):new Xt(i,a,r).fit()}function Yt(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var Xt=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=S.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=S.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new O(i,a,o);return e>-1?new xt(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new bt(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=$t(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(S.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=$t(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new O(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=$t(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new O(Zt(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new O(Zt(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(en(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=Qt(this.placed,t,S.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?O.empty:new O(Zt(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new O(Zt(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!tn(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=tn(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=tn(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Qt(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Qt(this.placed,this.depth,S.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(S.empty,!0);e.childCount&&(this.placed=Qt(this.placed,this.frontier.length,e))}};function Zt(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Zt(e.firstChild.content,t-1,n)))}function Qt(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Qt(e.lastChild.content,t-1,n)))}function $t(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function en(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,en(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(S.empty,!0)))),e.copy(r)}function tn(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!nn(n,a.content,o)?s:null}function nn(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function rn(e){return e.spec.defining||e.spec.definingForContent}function an(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(Yt(i,a,r))return e.step(new bt(t,n,r));let o=ln(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=rn(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new O(on(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function on(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(on(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(S.empty,!0))}return e}function sn(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=Kt(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new O(S.from(r),0,0))}function cn(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),a=ln(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function ln(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var un=class e extends pt{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return mt.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return mt.fromReplace(e,this.pos,this.pos+1,new O(S.from(r),0,t.isLeaf?0:1))}getMap(){return ut.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};pt.jsonID(`attr`,un);var dn=class e extends pt{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return mt.ok(n)}getMap(){return ut.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};pt.jsonID(`docAttr`,dn);var fn=class extends Error{};fn=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},fn.prototype=Object.create(Error.prototype),fn.prototype.constructor=fn,fn.prototype.name=`TransformError`;var pn=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new dt}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new fn(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=O.empty){let r=Jt(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new O(S.from(n),0,0))}delete(e,t){return this.replace(e,t,O.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return an(this,e,t,n),this}replaceRangeWith(e,t,n){return sn(this,e,t,n),this}deleteRange(e,t){return cn(this,e,t),this}lift(e,t){return Ot(this,e,t),this}join(e,t=1){return Gt(this,e,t),this}wrap(e,t){return Nt(this,e,t),this}setBlockType(e,t=e,n,r=null){return Pt(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return Rt(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new un(e,t,n)),this}setDocAttribute(e,t){return this.step(new dn(e,t)),this}addNodeMark(e,t){return this.step(new vt(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof E)t.isInSet(n.marks)&&this.step(new yt(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new yt(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return Bt(this,e,t,n),this}addMark(e,t,n){return Ct(this,e,t,n),this}removeMark(e,t,n){return wt(this,e,t,n),this}clearIncompatible(e,t,n){return Tt(this,e,t,n),this}},mn=Object.create(null),U=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new hn(e.min(t),e.max(t))]}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 e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=O.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?O.empty:t),o==0&&Cn(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),Cn(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new W(e):Sn(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?Sn(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Sn(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new bn(e.node(0))}static atStart(e){return Sn(e,e,0,0,1)||new bn(e)}static atEnd(e){return Sn(e,e,e.content.size,e.childCount,-1)||new bn(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=mn[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in mn)throw RangeError(`Duplicate use of selection JSON ID `+e);return mn[e]=t,t.prototype.jsonID=e,t}getBookmark(){return W.between(this.$anchor,this.$head).getBookmark()}};U.prototype.visible=!0;var hn=class{constructor(e,t){this.$from=e,this.$to=t}},gn=!1;function _n(e){!gn&&!e.parent.inlineContent&&(gn=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var W=class e extends U{constructor(e,t=e){_n(e),_n(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return U.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=O.empty){if(super.replace(e,t),t==O.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new vn(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=U.findFrom(n,r,!0)||U.findFrom(n,-r,!0);if(e)n=e.$head;else return U.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(U.findFrom(t,-r,!0)||U.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};U.jsonID(`text`,W);var vn=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return W.between(e.resolve(this.anchor),e.resolve(this.head))}},G=class e extends U{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?U.near(a):new e(a)}content(){return new O(S.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new yn(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};G.prototype.visible=!1,U.jsonID(`node`,G);var yn=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new vn(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&G.isSelectable(n)?new G(t):U.near(t)}},bn=class e extends U{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=O.empty){if(t==O.empty){e.delete(0,e.doc.content.size);let t=U.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return xn}};U.jsonID(`all`,bn);var xn={map(){return this},resolve(e){return new bn(e)}};function Sn(e,t,n,r,i,a=!1){if(t.inlineContent)return W.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=Sn(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&G.isSelectable(r))return G.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function Cn(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof bt||i instanceof xt))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(U.near(e.doc.resolve(o),n))}var wn=1,Tn=2,En=4,Dn=class extends pn{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|wn)&~Tn,this.storedMarks=null,this}get selectionSet(){return(this.updated&wn)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Tn,this}ensureMarks(e){return E.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Tn)>0}addStep(e,t){super.addStep(e,t),this.updated&=~Tn,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||E.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(U.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=En,this}get scrolledIntoView(){return(this.updated&En)>0}};function On(e,t){return!t||!e?e:e.bind(t)}var kn=class{constructor(e,t,n){this.name=e,this.init=On(t.init,n),this.apply=On(t.apply,n)}},An=[new kn(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new kn(`selection`,{init(e,t){return e.selection||U.atStart(t.doc)},apply(e){return e.selection}}),new kn(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new kn(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],jn=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=An.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new kn(e.key,e.spec.state,e))})}},Mn=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new Dn(this)}static create(t){let n=new jn(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new jn(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new jn(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=H.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=U.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function Nn(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=Nn(i,t,{})),n[r]=i}return n}var Pn=class{constructor(e){this.spec=e,this.props={},e.props&&Nn(e.props,this,this.props),this.key=e.key?e.key.key:In(`plugin`)}getState(e){return e[this.key]}},Fn=Object.create(null);function In(e){return e in Fn?e+`$`+ ++Fn[e]:(Fn[e]=0,e+`$`)}var Ln=class{constructor(e=`key`){this.key=In(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Rn=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function zn(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var Bn=(e,t,n)=>{let r=zn(e,n);if(!r)return!1;let i=Kn(r);if(!i){let n=r.blockRange(),i=n&&Dt(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(ur(e,i,t,-1))return!0;if(r.parent.content.size==0&&(Wn(a,`end`)||G.isSelectable(a)))for(let n=r.depth;;n--){let o=Jt(e.doc,r.before(n),r.after(n),O.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(Wn(a,`end`)?U.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):G.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},Vn=(e,t,n)=>{let r=zn(e,n);if(!r)return!1;let i=Kn(r);return i?Un(e,i,t):!1},Hn=(e,t,n)=>{let r=qn(e,n);if(!r)return!1;let i=Xn(r);return i?Un(e,i,t):!1};function Un(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=Jt(e.doc,i,o,O.empty);if(!s||s.from!=i||s instanceof bt&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(W.create(t.doc,i)),n(t.scrollIntoView())}return!0}function Wn(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var Gn=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=Kn(r)}let o=a&&a.nodeBefore;return!o||!G.isSelectable(o)?!1:(t&&t(e.tr.setSelection(G.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function Kn(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function qn(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var Jn=(e,t,n)=>{let r=qn(e,n);if(!r)return!1;let i=Xn(r);if(!i)return!1;let a=i.nodeAfter;if(ur(e,i,t,1))return!0;if(r.parent.content.size==0&&(Wn(a,`start`)||G.isSelectable(a))){let n=Jt(e.doc,r.before(),r.after(),O.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Wn(a,`start`)?U.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):G.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},Yn=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=Xn(r)}let o=a&&a.nodeAfter;return!o||!G.isSelectable(o)?!1:(t&&t(e.tr.setSelection(G.create(e.doc,a.pos)).scrollIntoView()),!0)};function Xn(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var Zn=(e,t)=>{let n=e.selection,r=n instanceof G,i;if(r){if(n.node.isTextblock||!Vt(e.doc,n.from))return!1;i=n.from}else if(i=Wt(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(G.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},Qn=(e,t)=>{let n=e.selection,r;if(n instanceof G){if(n.node.isTextblock||!Vt(e.doc,n.to))return!1;r=n.to}else if(r=Wt(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},$n=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&Dt(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},er=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
6
|
+
`).scrollIntoView()),!0)};function tr(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var nr=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=tr(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(U.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},rr=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof bn||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=tr(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(W.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},ir=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(zt(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Dt(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function ar(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof G&&t.selection.node.isBlock)return!r.parentOffset||!zt(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=tr(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof W||t.selection instanceof bn)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=zt(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,zt(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}var or=ar(),sr=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(G.create(e.doc,i))),!0)},cr=(e,t)=>(t&&t(e.tr.setSelection(new bn(e.doc))),!0);function lr(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||Vt(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function ur(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&lr(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=S.empty;for(let e=o.length-1;e>=0;e--)s=S.from(o[e].create(null,s));s=S.from(i.copy(s));let c=e.tr.step(new xt(t.pos-1,r,t.pos,r,new O(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&Vt(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:U.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&Dt(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&Wn(a,`start`,!0)&&Wn(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=S.empty;for(let e=o.length-1;e>=0;e--)r=S.from(o[e].copy(r));n(e.tr.step(new xt(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new O(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function dr(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(W.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var fr=dr(-1),pr=dr(1);function mr(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&kt(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function hr(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function gr(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var _r=gr(Rn,Bn,Gn),vr=gr(Rn,Jn,Yn),yr={Enter:gr(er,rr,ir,or),"Mod-Enter":nr,Backspace:_r,"Mod-Backspace":_r,"Shift-Backspace":_r,Delete:vr,"Mod-Delete":vr,"Mod-a":cr},br={"Ctrl-h":yr.Backspace,"Alt-Backspace":yr[`Mod-Backspace`],"Ctrl-d":yr.Delete,"Ctrl-Alt-Backspace":yr[`Mod-Delete`],"Alt-Delete":yr[`Mod-Delete`],"Alt-d":yr[`Mod-Delete`],"Ctrl-a":fr,"Ctrl-e":pr};for(let e in yr)br[e]=yr[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function xr(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return Sr(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function Sr(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new ie(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new ie(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=kt(a,n,r,t);return s?(e&&Cr(e,t,s,i,n),!0):!1}function Cr(e,t,n,r,i){let a=S.empty;for(let e=n.length-1;e>=0;e--)a=S.from(n[e].type.create(n[e].attrs,a));e.step(new xt(t.start-(r?2:0),t.end,t.start,t.end,new O(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&zt(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function wr(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?Tr(t,n,e,a):Er(t,n,a):!0:!1}}function Tr(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new xt(a-1,o,a,o,new O(S.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ie(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=Dt(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return Vt(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function Er(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+(s?0:1),u+1,o.content.append(c?S.empty:S.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new xt(d-(s?1:0),f+(c?1:0),d+1,f-1,new O((s?S.empty:S.from(i.copy(S.empty))).append(c?S.empty:S.from(i.copy(S.empty))),s?0:1,c?0:1),s?0:1)),t(r.scrollIntoView()),!0}function Dr(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=S.from(r?e.create():null),o=new O(S.from(e.create(null,S.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new xt(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var Or=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},kr=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},Ar=null,jr=function(e,t,n){let r=Ar||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Mr=function(){Ar=null},Nr=function(e,t,n,r){return n&&(Fr(e,t,n,r,-1)||Fr(e,t,n,r,1))},Pr=/^(img|br|input|textarea|hr)$/i;function Fr(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Ir(e))){let n=e.parentNode;if(!n||n.nodeType!=1||Br(e)||Pr.test(e.nodeName)||e.contentEditable==`false`)return!1;t=Or(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?Ir(e):0}else return!1}}function Ir(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Lr(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=Ir(e)}else if(e.parentNode&&!Br(e))t=Or(e),e=e.parentNode;else return null}}function Rr(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Br(e))t=Or(e)+1,e=e.parentNode;else return null}}function zr(e,t,n){for(let r=t==0,i=t==Ir(e);r||i;){if(e==n)return!0;let t=Or(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==Ir(e)}}function Br(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var Vr=function(e){return e.focusNode&&Nr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Hr(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function Ur(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Wr(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Ir(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Ir(r.startContainer),r.startOffset)}}}var Gr=typeof navigator<`u`?navigator:null,Kr=typeof document<`u`?document:null,qr=Gr&&Gr.userAgent||``,Jr=/Edge\/(\d+)/.exec(qr),Yr=/MSIE \d/.exec(qr),Xr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(qr),Zr=!!(Yr||Xr||Jr),Qr=Yr?document.documentMode:Xr?+Xr[1]:Jr?+Jr[1]:0,$r=!Zr&&/gecko\/(\d+)/i.test(qr);$r&&+(/Firefox\/(\d+)/.exec(qr)||[0,0])[1];var ei=!Zr&&/Chrome\/(\d+)/.exec(qr),ti=!!ei,ni=ei?+ei[1]:0,ri=!Zr&&!!Gr&&/Apple Computer/.test(Gr.vendor),ii=ri&&(/Mobile\/\w+/.test(qr)||!!Gr&&Gr.maxTouchPoints>2),ai=ii||(Gr?/Mac/.test(Gr.platform):!1),oi=Gr?/Win/.test(Gr.platform):!1,si=/Android \d/.test(qr),ci=!!Kr&&`webkitFontSmoothing`in Kr.documentElement.style,li=ci?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function ui(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function di(e,t){return typeof e==`number`?e:e[t]}function fi(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function pi(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=kr(o);continue}let e=o,n=e==a.body,s=n?ui(a):fi(e),c=0,l=0;if(t.top<s.top+di(r,`top`)?l=-(s.top-t.top+di(i,`top`)):t.bottom>s.bottom-di(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+di(i,`top`)-s.top:t.bottom-s.bottom+di(i,`bottom`)),t.left<s.left+di(r,`left`)?c=-(s.left-t.left+di(i,`left`)):t.right>s.right-di(r,`right`)&&(c=t.right-s.right+di(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:kr(o)}}function mi(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:hi(e.dom)}}function hi(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=kr(r));return t}function gi({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;_i(n,r==0?0:r-t)}function _i(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var vi=null;function yi(e){if(e.setActive)return e.setActive();if(vi)return e.focus(vi);let t=hi(e);e.focus(vi==null?{get preventScroll(){return vi={preventScroll:!0},!0}}:void 0),vi||(vi=!1,_i(t,0))}function bi(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=jr(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?xi(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:bi(n,i)}function xi(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=ki(r,1);if(n.top!=n.bottom&&Si(t,n)){i={node:e,offset:a+(t.left>=(n.left+n.right)/2?1:0)};break}}return r.detach(),i||{node:e,offset:0}}function Si(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Ci(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function wi(e,t,n){let{node:r,offset:i}=bi(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function Ti(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function Ei(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Si(t,i))return Ei(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function Di(e,t){let n=e.dom.ownerDocument,r,i=0,a=Wr(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!Si(t,n)||(o=Ei(e.dom,t,n),!o))return null}if(ri)for(let e=o;r&&e;e=kr(e))e.draggable&&(r=void 0);if(o=Ci(o,t),r){if($r&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;ci&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=Ti(e,r,i,t))}s??=wi(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function Oi(e){return e.top<e.bottom||e.left<e.right}function ki(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Oi(e))return e}return Array.prototype.find.call(n,Oi)||e.getBoundingClientRect()}var Ai=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ji(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=ci||$r;if(r.nodeType==3)if(o&&(Ai.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=ki(jr(r,i,i),n);if($r&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=ki(jr(r,i-1,i-1),-1);if(t.top==e.top){let n=ki(jr(r,i,i+1),-1);if(n.top!=e.top)return Mi(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,Mi(ki(jr(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==Ir(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return Ni(e.getBoundingClientRect(),!1)}if(a==null&&i<Ir(r)){let e=r.childNodes[i];if(e.nodeType==1)return Ni(e.getBoundingClientRect(),!0)}return Ni(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==Ir(r))){let e=r.childNodes[i-1],t=e.nodeType==3?jr(e,Ir(e)-(o?0:1)):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return Mi(ki(t,1),!1)}if(a==null&&i<Ir(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?jr(e,0,o?0:1):e.nodeType==1?e:null:null;if(t)return Mi(ki(t,-1),!0)}return Mi(ki(r.nodeType==3?jr(r):r,-n),n>=0)}function Mi(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Ni(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Pi(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function Fi(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return Pi(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=ji(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=jr(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var Ii=/[\u0590-\u08ac]/;function Li(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!Ii.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:Pi(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var Ri=null,zi=null,Bi=!1;function Vi(e,t,n){return Ri==t&&zi==n?Bi:(Ri=t,zi=n,Bi=n==`up`||n==`down`?Fi(e,t,n):Li(e,t,n))}var Hi=0,Ui=1,Wi=2,Gi=3,Ki=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=Hi,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>Or(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof $i){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof qi&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Or(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?Or(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Or(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=Or(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if(($r||ri)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
|
|
7
|
+
`),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:Or(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if($r&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&ri)&&Nr(o.node,o.offset,l.anchorNode,l.anchorOffset)&&Nr(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&$r)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?Wi:Ui,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Gi:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Wi:Gi}n=a}this.dirty=Wi}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?Wi:Ui;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},qi=class extends Ki{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Hi&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},Ji=class extends Ki{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},Yi=class e extends Ki{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=qe.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Gi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Gi&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Hi){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=Hi}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=ga(a,n,o,r)),t>0&&(a=ga(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},Xi=class e extends Ki{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=qe.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=sa(u,r,n),l?c=new ea(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new Qi(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>S.empty)}return e}matchesNode(e,t,n){return this.dirty==Hi&&e.eq(this.node)&&ca(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new ua(this,a&&a.node,e);pa(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?E.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==Wi)&&(a&&this.protectLocalComposition(e,a),ta(this.contentDOM,this.children,e),ii&&ma(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof W)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=ha(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new Ji(this,i,t,r);e.input.compositionNodes.push(a),this.children=ga(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==Gi||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Hi}updateOuterDeco(e){if(ca(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=aa(this.dom,this.nodeDOM,ia(this.outerDeco,this.node,t),ia(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function Zi(e,t,n,r,i){sa(r,t,e);let a=new Xi(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var Qi=class e extends Xi{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==Gi||this.dirty!=Hi&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Hi||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=Hi,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Gi)}get domAtom(){return!1}isText(e){return this.node.text==e}},$i=class extends Ki{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Hi&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},ea=class extends Xi{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==Gi)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function ta(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=la(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof Yi){let t=r?r.previousSibling:e.lastChild;ta(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=la(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var na=function(e){e&&(this.nodeName=e)};na.prototype=Object.create(null);var ra=[new na];function ia(e,t,n){if(e.length==0)return ra;let r=n?ra[0]:new na,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new na(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new na(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function aa(e,t,n,r){if(n==ra&&r==ra)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=ra[0],i=t)}oa(i,o||ra[0],a)}return i}function oa(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function sa(e,t,n){return aa(e,e,ra,ia(t,n,e.nodeType!=1))}function ca(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function la(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var ua=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=da(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=Hi,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=Yi.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==Gi&&a.dom==a.contentDOM&&(a.dirty=Wi),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof Xi){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=Gi&&ca(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=Wi,u.updateChildren(r,a+1),u.dirty=Hi),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!ca(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=Xi.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=Xi.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new qi(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Yi;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Qi)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((ri||ti)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new $i(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function da(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof Yi)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function fa(e,t){return e.type.side-t.type.side}function pa(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(fa);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function ma(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function ha(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function ga(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function _a(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(Vr(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&G.isSelectable(e)&&i.parent&&!(e.isInline&&zr(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new G(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=Oa(e,u,s,n)}return l}function va(e){return e.editable?e.hasFocus():Aa(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ya(e,t=!1){let n=e.state.selection;if(Ea(e,n),va(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&ti){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Nr(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Ta(e);else{let{anchor:r,head:i}=n,a,o;ba&&!(n instanceof W)&&(n.$from.parent.inlineContent||(a=xa(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=xa(e,n.to))),e.docView.setSelection(r,i,e,t),ba&&(a&&Ca(a),o&&Ca(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&wa(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var ba=ri||ti&&ni<63;function xa(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(ri&&i&&i.contentEditable==`false`)return Sa(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return Sa(i);if(a)return Sa(a)}}function Sa(e){return e.contentEditable=`true`,ri&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Ca(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function wa(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!va(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function Ta(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,Or(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Zr&&Qr<=11&&(n.disabled=!0,n.disabled=!1)}function Ea(e,t){if(t instanceof G){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Da(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Da(e)}function Da(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function Oa(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||W.between(t,n,r)}function ka(e){return e.editable&&!e.hasFocus()?!1:Aa(e)}function Aa(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function ja(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Nr(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Ma(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&U.findFrom(a,t)}function Na(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Pa(e,t,n){let r=e.state.selection;if(r instanceof W){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return Na(e,new W(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=Ma(e.state,t);return n&&n instanceof G?Na(e,n):!1}else if(!(ai&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?G.isSelectable(i)?Na(e,new G(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):ci?Na(e,new W(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof G&&r.node.isInline)return Na(e,new W(t>0?r.$to:r.$from));else{let n=Ma(e.state,t);return n?Na(e,n):!1}}function Fa(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Ia(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function La(e,t){return t<0?Ra(e):za(e)}function Ra(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for($r&&n.nodeType==1&&r<Fa(n)&&Ia(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(Ia(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(Ba(n))break;else{let t=n.previousSibling;for(;t&&Ia(t,-1);)i=n.parentNode,a=Or(t),t=t.previousSibling;if(t)n=t,r=Fa(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?Ua(e,n,r):i&&Ua(e,i,a)}function za(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Fa(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(Ia(e,1))a=n,o=++r;else break}else if(Ba(n))break;else{let t=n.nextSibling;for(;t&&Ia(t,1);)a=t.parentNode,o=Or(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=Fa(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&Ua(e,a,o)}function Ba(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Va(e,t){for(;e&&t==e.childNodes.length&&!Br(e);)t=Or(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function Ha(e,t){for(;e&&!t&&!Br(e);)t=Or(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function Ua(e,t,n){if(t.nodeType!=3){let e,r;(r=Va(t,n))?(t=r,n=0):(e=Ha(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Vr(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&ya(e)},50)}function Wa(e,t){let n=e.state.doc.resolve(t);if(!(ti||oi)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function Ga(e,t,n){let r=e.state.selection;if(r instanceof W&&!r.empty||n.indexOf(`s`)>-1||ai&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=Ma(e.state,t);if(n&&n instanceof G)return Na(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof bn?U.near(n,t):U.findFrom(n,t);return o?Na(e,o):!1}return!1}function Ka(e,t){if(!(e.state.selection instanceof W))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function qa(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Ja(e){if(!ri||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;qa(e,n,`true`),setTimeout(()=>qa(e,n,`false`),20)}return!1}function Ya(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function Xa(e,t){let n=t.keyCode,r=Ya(t);if(n==8||ai&&n==72&&r==`c`)return Ka(e,-1)||La(e,-1);if(n==46&&!t.shiftKey||ai&&n==68&&r==`c`)return Ka(e,1)||La(e,1);if(n==13||n==27)return!0;if(n==37||ai&&n==66&&r==`c`){let t=n==37?Wa(e,e.state.selection.from)==`ltr`?-1:1:-1;return Pa(e,t,r)||La(e,t)}else if(n==39||ai&&n==70&&r==`c`){let t=n==39?Wa(e,e.state.selection.from)==`ltr`?1:-1:1;return Pa(e,t,r)||La(e,t)}else if(n==38||ai&&n==80&&r==`c`)return Ga(e,-1,r)||La(e,-1);else if(n==40||ai&&n==78&&r==`c`)return Ja(e)||Ga(e,1,r)||La(e,1);else if(r==(ai?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function Za(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||qe.fromSchema(e.state.schema),s=co(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=oo[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
|
|
8
|
+
|
|
9
|
+
`),slice:t}}function Qa(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new O(S.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
10
|
+
`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=qe.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=fo(n),ci&&po(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||Ne.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!$a.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=mo(ao(s,+u[1],+u[2]),u[4]);else if(s=O.maxOpen(eo(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=ao(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var $a=/^(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 eo(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&no(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=ro(a[a.length-1],i.length));let n=to(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return S.from(a)}return e}function to(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,S.from(e));return e}function no(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=no(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(S.from(to(n,e,i+1))))}}function ro(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,ro(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(S.empty,!0);return e.copy(n.append(r))}function io(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=io(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(S.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function ao(e,t,n){return t<e.openStart&&(e=new O(io(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new O(io(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var oo={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},so=null;function co(){return so||=document.implementation.createHTMLDocument(`title`)}var lo=null;function uo(e){let t=window.trustedTypes;return t?(lo||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),lo.createHTML(e)):e}function fo(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=co().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&oo[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=uo(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function po(e){let t=e.querySelectorAll(ti?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function mo(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=S.from(t.create(r[e+1],i)),a++,o++}return new O(i,a,o)}var ho={},go={},_o={touchstart:!0,touchmove:!0},vo=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function yo(e){for(let t in ho){let n=ho[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{wo(e,t)&&!Co(e,t)&&(e.editable||!(t.type in go))&&n(e,t)},_o[t]?{passive:!0}:void 0)}ri&&e.dom.addEventListener(`input`,()=>null),So(e)}function bo(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function xo(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function So(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Co(e,t))})}function Co(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function wo(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function To(e,t){!Co(e,t)&&ho[t.type]&&(e.editable||!(t.type in go))&&ho[t.type](e,t)}go.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!zo(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(si&&ti&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),ii&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,Hr(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||Xa(e,n)?n.preventDefault():bo(e,`key`)},go.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},go.keypress=(e,t)=>{let n=t;if(zo(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||ai&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof W)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function Eo(e){return{left:e.clientX,top:e.clientY}}function Do(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function Oo(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function ko(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function Ao(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&G.isSelectable(r)?(ko(e,new G(n),`pointer`),!0):!1}function jo(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof G&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(G.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(ko(e,G.create(e.state.doc,i),`pointer`),!0)}function Mo(e,t,n,r,i){return Oo(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?jo(e,n):Ao(e,n))}function No(e,t,n,r){return Oo(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function Po(e,t,n,r){return Oo(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||Fo(e,n,r)}function Fo(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(ko(e,W.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)ko(e,W.create(r,a+1,a+1+n.content.size),`pointer`);else if(G.isSelectable(n))ko(e,G.create(r,a),`pointer`);else continue;return!0}}function Io(e){return Ko(e)}var Lo=ai?`metaKey`:`ctrlKey`;ho.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Io(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&Do(n,e.input.lastClick)&&!n[Lo]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(Eo(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Ro(e,o,n,!!r)):(a==`doubleClick`?No:Po)(e,o.pos,o.inside,n)?n.preventDefault():bo(e,`pointer`))};var Ro=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Lo],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;(n.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof G&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&$r&&!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()),e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this)),bo(e,`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(()=>ya(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Eo(e))),this.updateAllowDefault(e),this.allowDefault||!t?bo(this.view,`pointer`):Mo(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ri&&this.mightDrag&&!this.mightDrag.node.isAtom||ti&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(ko(this.view,U.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):bo(this.view,`pointer`)}move(e){this.updateAllowDefault(e),bo(this.view,`pointer`),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};ho.touchstart=e=>{e.input.lastTouch=Date.now(),Io(e),bo(e,`pointer`)},ho.touchmove=e=>{e.input.lastTouch=Date.now(),bo(e,`pointer`)},ho.contextmenu=e=>Io(e);function zo(e,t){return e.composing?!0:ri&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var Bo=si?5e3:-1;go.compositionstart=go.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof W&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||ti&&oi&&Vo(e)))e.markCursor=e.state.storedMarks||n.marks(),Ko(e,!0),e.markCursor=null;else if(Ko(e,!t.selection.empty),$r&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}Ho(e,Bo)};function Vo(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}go.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Ho(e,20))};function Ho(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Ko(e),t))}function Uo(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Go());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Wo(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Lr(t.focusNode,t.focusOffset),r=Rr(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function Go(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function Ko(e,t=!1){if(!(si&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Uo(e),t||e.docView&&e.docView.dirty){let n=_a(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function qo(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var Jo=Zr&&Qr<15||ii&&li<604;ho.copy=go.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=Jo?null:n.clipboardData,{dom:o,text:s}=Za(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):qo(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function Yo(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Xo(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Zo(e,r.value,null,i,t):Zo(e,r.textContent,r.innerHTML,i,t)},50)}function Zo(e,t,n,r,i){let a=Qa(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||O.empty)))return!0;if(!a)return!1;let o=Yo(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function Qo(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}go.paste=(e,t)=>{let n=t;if(e.composing&&!si)return;let r=Jo?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Zo(e,Qo(r),r.getData(`text/html`),i,n)?n.preventDefault():Xo(e,n)};var $o=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},es=ai?`altKey`:`ctrlKey`;function ts(e,t){return e.someProp(`dragCopies`,e=>!e(t))??!t[es]}ho.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(Eo(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof G?i.to-1:i.to))){if(r&&r.mightDrag)o=G.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=G.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=Za(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!ti||ni>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Jo?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,Jo||n.dataTransfer.setData(`text/plain`,c),e.dragging=new $o(l,ts(e,n),o)},ho.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},go.dragover=go.dragenter=(e,t)=>t.preventDefault(),go.drop=(e,t)=>{try{ns(e,t,e.dragging)}finally{e.dragging=null}};function ns(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Eo(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=Qa(e,Qo(t.dataTransfer),Jo?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&ts(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||O.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?qt(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&G.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new G(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(Oa(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}ho.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&ya(e)},20))},ho.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},ho.beforeinput=(e,t)=>{if(ti&&si&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,Hr(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in go)ho[e]=go[e];function rs(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var is=class e{constructor(e,t){this.toDOM=e,this.spec=t||us,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new cs(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&rs(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},as=class e{constructor(e,t){this.attrs=e,this.spec=t||us}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new cs(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&rs(this.attrs,t.attrs)&&rs(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},ss=class e{constructor(e,t){this.attrs=e,this.spec=t||us}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new cs(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&rs(this.attrs,t.attrs)&&rs(this.spec,t.spec)}destroy(){}},cs=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new is(n,r))}static inline(t,n,r,i){return new e(t,n,new as(r,i))}static node(t,n,r,i){return new e(t,n,new ss(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof as}get widget(){return this.type instanceof is}},ls=[],us={},ds=class e{constructor(e,t){this.local=e.length?e:ls,this.children=t.length?t:ls}static create(e,t){return t.length?ys(t,e,0,us):fs}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==fs||e.maps.length==0?this:this.mapInner(e,t,0,0,n||us)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?ms(this.children,o||[],t,n,r,i,a):o?new e(o.sort(bs),ls):fs}add(t,n){return n.length?this==fs?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=_s(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,ys(s,e,o+1,us)),a+=3}});let o=hs(a?vs(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(bs):this.local,i||this.children)}remove(e){return e.length==0||this==fs?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==fs?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):fs}forChild(t,n){if(this==fs)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof as){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(bs),ls);return r?new ps([t,r]):t}return r||fs}eq(t){if(this==t)return!0;if(!(t instanceof e)||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(e){return xs(this.localsInner(e))}localsInner(e){if(this==fs)return ls;if(e.inlineContent||!this.local.some(as.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof as||t.push(this.local[e]);return t}forEachSet(e){e(this)}};ds.empty=new ds([],[]),ds.removeOverlap=xs;var fs=ds.empty,ps=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,us));return e.from(r)}forChild(t,n){if(n.isLeaf)return ds.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=fs&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||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(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?xs(n?t:t.sort(bs)):ls}static from(t){switch(t.length){case 0:return fs;case 1:return t[0];default:return new e(t.every(e=>e instanceof ds)?t:t.reduce((e,t)=>e.concat(t instanceof ds?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function ms(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==fs?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=ys(gs(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new ds(t.sort(bs),s)}function hs(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new cs(i.from+t,i.to+t,i.type))}return n}function gs(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function _s(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function vs(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function ys(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=_s(e,t,o+n);if(s){a=!0;let e=ys(s,t,n+o+1,r);e!=fs&&i.push(o,o+t.nodeSize,e)}});let o=hs(a?vs(e):e,-n).sort(bs);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new ds(o,i):fs}function bs(e,t){return e.from-t.from||e.to-t.to}function xs(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),Ss(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),Ss(t,i,r.copy(a.from,r.to)));break}}}return t}function Ss(e,t,n){for(;t<e.length&&bs(n,e[t])>0;)t++;e.splice(t,0,n)}function Cs(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=fs&&t.push(r)}),e.cursorWrapper&&t.push(ds.create(e.state.doc,[e.cursorWrapper.deco])),ps.from(t)}var ws={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Ts=Zr&&Qr<=11,Es=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},Ds=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Es,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);Zr&&Qr<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():ri&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Ts&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,ws)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(ka(this.view)){if(this.suppressingSelectionUpdates)return ya(this.view);if(Zr&&Qr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Nr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=kr(n))t.add(n);for(let r=e.anchorNode;r;r=kr(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&ka(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if($r&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||Ns(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Vr(n)&&(c=_a(e))&&c.eq(U.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,ya(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),As(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Ps(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||ya(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(Zr&&Qr<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?Or(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?Or(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},Os=new WeakMap,ks=!1;function As(e){if(!Os.has(e)&&(Os.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=$r,ks)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),ks=!0}}function js(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return Nr(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Ms(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return js(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?js(e,n):null}function Ns(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function Ps(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function Fs(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],Vr(c)||l.push({node:c.focusNode,offset:c.focusOffset})),ti&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||Ne.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:Is,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function Is(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(ri&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||ri&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var Ls=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Rs(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=_a(e,t);if(n&&!e.state.selection.eq(n)){if(ti&&si&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,Hr(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=Fs(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=Us(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(ii&&e.input.lastIOSEnter>Date.now()-225||si)&&i.some(e=>e.nodeType==1&&!Ls.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,Hr(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof W&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=zs(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof W&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),Zr&&Qr<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((ii&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,Hr(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&Vs(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,Hr(8,`Backspace`)))){si&&ti&&e.domObserver.suppressSelectionUpdates();return}ti&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),si&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,Hr(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=zs(e,n.doc,l.sel);t&&!(ti&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||Zr&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){Zr&&Qr<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>ya(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=Bs(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-(g.textOffset?0:1)){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function zs(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Oa(e,t.resolve(n.anchor),t.resolve(n.head))}function Bs(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(S.from(l).eq(e))return{mark:s,type:o}}function Vs(e,t,n,r,i){if(n-t<=i.pos-r.pos||Hs(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(Hs(a,!0,!0));return!o.parent.isTextblock||o.pos>n||Hs(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Hs(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function Us(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&Ws(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&Ws(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function Ws(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}var Gs=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new vo,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Qs),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Js(this),qs(this),this.nodeViews=Xs(this),this.docView=Zi(this.state.doc,Ks(this),Cs(this),this.dom,this),this.domObserver=new Ds(this,(e,t,n,r)=>Rs(this,e,t,n,r)),this.domObserver.start(),yo(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&So(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Qs),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(Uo(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Xs(this);Zs(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&So(this),this.editable=Js(this),qs(this);let o=Cs(this),s=Ks(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&mi(this);if(i){this.domObserver.stop();let t=l&&(Zr||ti)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&Ys(n.selection,e.selection);if(l){let n=ti?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Wo(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=Zi(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&ja(this))?ya(this,t):(Ea(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&gi(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof G){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&pi(this,t.getBoundingClientRect(),e)}else pi(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new $o(e.slice,e.move,r<0?void 0:G.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(Zr){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&yi(this.dom),ya(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Di(this,e)}coordsAtPos(e,t=1){return ji(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return Vi(this,t||this.state,e)}pasteHTML(e,t){return Zo(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return Zo(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return Za(this,e)}destroy(){this.docView&&(xo(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Cs(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Mr())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return To(this,e)}domSelectionRange(){let e=this.domSelection();return e?ri&&this.root.nodeType===11&&Ur(this.dom.ownerDocument)==this.dom&&Ms(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Gs.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function Ks(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[cs.node(0,e.state.doc.content.size,t)]}function qs(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:cs.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Js(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function Ys(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function Xs(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function Zs(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function Qs(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}for(var $s={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:`'`},ec={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},tc=typeof navigator<`u`&&/Mac/.test(navigator.platform),nc=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),rc=0;rc<10;rc++)$s[48+rc]=$s[96+rc]=String(rc);for(var rc=1;rc<=24;rc++)$s[rc+111]=`F`+rc;for(var rc=65;rc<=90;rc++)$s[rc]=String.fromCharCode(rc+32),ec[rc]=String.fromCharCode(rc);for(var ic in $s)ec.hasOwnProperty(ic)||(ec[ic]=$s[ic]);function ac(e){var t=!(tc&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||nc&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?ec:$s)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var oc=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),sc=typeof navigator<`u`&&/Win/.test(navigator.platform);function cc(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))oc?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function lc(e){let t=Object.create(null);for(let n in e)t[cc(n)]=e[n];return t}function uc(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function dc(e){return new Pn({props:{handleKeyDown:fc(e)}})}function fc(e){let t=lc(e);return function(e,n){let r=ac(n),i,a=t[uc(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[uc(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(sc&&n.ctrlKey&&n.altKey)&&(i=$s[n.keyCode])&&i!=r){let r=t[uc(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var pc=Object.defineProperty,mc=(e,t)=>{for(var n in t)pc(e,n,{get:t[n],enumerable:!0})};function hc(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var gc=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:hc({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},_c={};mc(_c,{blur:()=>vc,clearContent:()=>yc,clearNodes:()=>bc,command:()=>xc,createParagraphNear:()=>Sc,cut:()=>Cc,deleteCurrentNode:()=>wc,deleteNode:()=>Ec,deleteRange:()=>Dc,deleteSelection:()=>Oc,enter:()=>kc,exitCode:()=>Ac,extendMarkRange:()=>Lc,first:()=>Rc,focus:()=>Gc,forEach:()=>Kc,insertContent:()=>qc,insertContentAt:()=>$c,joinBackward:()=>nl,joinDown:()=>tl,joinForward:()=>rl,joinItemBackward:()=>il,joinItemForward:()=>al,joinTextblockBackward:()=>ol,joinTextblockForward:()=>sl,joinUp:()=>el,keyboardShortcut:()=>ul,lift:()=>fl,liftEmptyBlock:()=>pl,liftListItem:()=>ml,newlineInCode:()=>hl,resetAttributes:()=>vl,scrollIntoView:()=>yl,selectAll:()=>bl,selectNodeBackward:()=>xl,selectNodeForward:()=>Sl,selectParentNode:()=>Cl,selectTextblockEnd:()=>wl,selectTextblockStart:()=>Tl,setContent:()=>Dl,setMark:()=>Tu,setMeta:()=>Eu,setNode:()=>Du,setNodeSelection:()=>Ou,setTextDirection:()=>ku,setTextSelection:()=>Au,sinkListItem:()=>ju,splitBlock:()=>Nu,splitListItem:()=>Pu,toggleList:()=>Lu,toggleMark:()=>Ru,toggleNode:()=>zu,toggleWrap:()=>Bu,undoInputRule:()=>Vu,unsetAllMarks:()=>Hu,unsetMark:()=>Uu,unsetTextDirection:()=>Wu,updateAttributes:()=>Gu,wrapIn:()=>Ku,wrapInList:()=>qu});var vc=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),yc=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),bc=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=Dt(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},xc=e=>t=>e(t),Sc=()=>({state:e,dispatch:t})=>rr(e,t),Cc=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new W(r.doc.resolve(Math.max(o-1,0)))),!0},wc=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function Tc(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var Ec=e=>({tr:t,state:n,dispatch:r})=>{let i=Tc(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},Dc=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},Oc=()=>({state:e,dispatch:t})=>Rn(e,t),kc=()=>({commands:e})=>e.keyboardShortcut(`Enter`),Ac=()=>({state:e,dispatch:t})=>nr(e,t);function jc(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function Mc(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:jc(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function Nc(e,t,n={}){return e.find(e=>e.type===t&&Mc(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function Pc(e,t,n={}){return!!Nc(e,t,n)}function Fc(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t)||(n||=r.node.marks[0]?.attrs,!Nc([...r.node.marks],t,n)))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&Pc([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&Pc([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function Ic(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var Lc=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=Ic(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=Fc(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=W.create(o,e.from,e.to);n.setSelection(t)}}return!0},Rc=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function zc(e){return e instanceof W}function Bc(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Vc(e,t=null){if(!t)return null;let n=U.atStart(e),r=U.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?W.create(e,Bc(0,i,a),Bc(e.content.size,i,a)):W.create(e,Bc(t,i,a),Bc(t,i,a))}function Hc(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function Uc(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function Wc(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var Gc=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(Uc()||Hc())&&r.dom.focus(),Wc()&&!Uc()&&!Hc()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!zc(n.state.selection))return o(),!0;let s=Vc(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Kc=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),qc=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Jc=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&Jc(r)}return e};function Yc(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return Jc(n)}function Xc(e,t,n){if(e instanceof H||e instanceof S)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return S.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),Xc(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new ke({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?Ne.fromSchema(a).parseSlice(Yc(e),n.parseOptions):Ne.fromSchema(a).parse(Yc(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=Ne.fromSchema(t);return n.slice?r.parseSlice(Yc(e),n.parseOptions).content:r.parse(Yc(e),n.parseOptions)}return Xc(``,t,n)}function Zc(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof bt||i instanceof xt))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(U.near(e.doc.resolve(o),n))}var Qc=e=>!(`type`in e),$c=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Xc(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=Xc(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((Qc(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof S){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&Zc(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},el=()=>({state:e,dispatch:t})=>Zn(e,t),tl=()=>({state:e,dispatch:t})=>Qn(e,t),nl=()=>({state:e,dispatch:t})=>Bn(e,t),rl=()=>({state:e,dispatch:t})=>Jn(e,t),il=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Wt(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},al=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Wt(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},ol=()=>({state:e,dispatch:t})=>Vn(e,t),sl=()=>({state:e,dispatch:t})=>Hn(e,t);function cl(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function ll(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))Uc()||cl()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var ul=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=ll(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function dl(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?Tc(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>Mc(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var fl=(e,t={})=>({state:n,dispatch:r})=>dl(n,Tc(e,n.schema),t)?$n(n,r):!1,pl=()=>({state:e,dispatch:t})=>ir(e,t),ml=e=>({state:t,dispatch:n})=>wr(Tc(e,t.schema))(t,n),hl=()=>({state:e,dispatch:t})=>er(e,t);function gl(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function _l(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var vl=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=gl(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Tc(e,r.schema)),s===`mark`&&(o=Ic(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,_l(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(_l(a.attrs,t))))})})}),c},yl=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),bl=()=>({tr:e,dispatch:t})=>{if(t){let t=new bn(e.doc);e.setSelection(t)}return!0},xl=()=>({state:e,dispatch:t})=>Gn(e,t),Sl=()=>({state:e,dispatch:t})=>Yn(e,t),Cl=()=>({state:e,dispatch:t})=>sr(e,t),wl=()=>({state:e,dispatch:t})=>pr(e,t),Tl=()=>({state:e,dispatch:t})=>fr(e,t);function El(e,t,n={},r={}){return Xc(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Dl=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=El(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function Ol(e,t){let n=Ic(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function kl(e,t){let n=new pn(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function Al(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function jl(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function Ml(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function Nl(e){return t=>Ml(t.$from,e)}function K(e,t,n){return e.config[t]===void 0&&e.parent?K(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?K(e.parent,t,n):null}):e.config[t]}function Pl(e){return e.map(e=>{let t=K(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...Pl(t())]:e}).flat(10)}function Fl(e,t){let n=qe.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function Il(e){return typeof e==`function`}function Ll(e,t=void 0,...n){return Il(e)?t?e.bind(t)(...n):e(...n):e}function Rl(e={}){return Object.keys(e).length===0&&e.constructor===Object}function zl(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function Bl(e){let t=[],{nodeExtensions:n,markExtensions:r}=zl(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=K(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=K(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function Vl(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function Hl(e){let t=[],n=Vl(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function Ul(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...Hl(n[e]),...Hl(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function Wl(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>Ul(e,t),{})}function Gl(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function Kl(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):Gl(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function ql(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&Rl(t)?!1:t!=null))}function Jl(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function Yl(e,t){let n=Bl(e),{nodeExtensions:r,markExtensions:i}=zl(e);return new ke({topNode:r.find(e=>K(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=ql({...e.reduce((e,t)=>{let n=K(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:Ll(K(r,`content`,a)),marks:Ll(K(r,`marks`,a)),group:Ll(K(r,`group`,a)),inline:Ll(K(r,`inline`,a)),atom:Ll(K(r,`atom`,a)),selectable:Ll(K(r,`selectable`,a)),draggable:Ll(K(r,`draggable`,a)),code:Ll(K(r,`code`,a)),whitespace:Ll(K(r,`whitespace`,a)),linebreakReplacement:Ll(K(r,`linebreakReplacement`,a)),defining:Ll(K(r,`defining`,a)),isolating:Ll(K(r,`isolating`,a)),attrs:Object.fromEntries(i.map(Jl))}),s=Ll(K(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Kl(e,i)));let c=K(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:Wl(e,i)}));let l=K(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=ql({...e.reduce((e,t)=>{let n=K(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:Ll(K(r,`inclusive`,a)),excludes:Ll(K(r,`excludes`,a)),group:Ll(K(r,`group`,a)),spanning:Ll(K(r,`spanning`,a)),code:Ll(K(r,`code`,a)),attrs:Object.fromEntries(i.map(Jl))}),s=Ll(K(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Kl(e,i)));let c=K(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:Wl(e,i)})),[r.name,o]}))})}function Xl(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function Zl(e){return e.sort((e,t)=>{let n=K(e,`priority`)||100,r=K(t,`priority`)||100;return n>r?-1:n<r?1:0})}function Ql(e){let t=Zl(Pl(e)),n=Xl(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function $l(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
|
|
11
|
+
|
|
12
|
+
`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function eu(e,t){return $l(e,{from:0,to:e.content.size},t)}function tu(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function nu(e,t){let n=Tc(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function ru(e,t){let n=gl(typeof t==`string`?t:t.name,e.schema);return n===`node`?nu(e,t):n===`mark`?Ol(e,t):{}}function iu(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function au(e){let t=iu(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function ou(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),au(r)}function su(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=Fc(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var cu=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]};function lu(e,t){return t.nodes[e]||t.marks[e]||null}function uu(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var du=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function fu(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?Ic(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>Mc(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>Mc(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function pu(e,t,n={}){if(!t)return dl(e,null,n)||fu(e,null,n);let r=gl(t,e.schema);return r===`node`?dl(e,t,n):r===`mark`?fu(e,t,n):!1}var mu=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=Nl(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},hu=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function gu(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function _u(e,t){let{nodeExtensions:n}=zl(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=Ll(K(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function vu(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(vu(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function yu(e){return e instanceof G}var bu=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function xu(e,t){let n=t.mapping.mapResult(e.position);return{position:new bu(n.pos),mapResult:n}}function Su(e){return new bu(e)}function Cu(e,t,n){let r=e.state.doc.content.size,i=Bc(t,0,r),a=Bc(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return{...f,toJSON:()=>f}}function wu(e,t,n){let{selection:r}=t,i=null;if(zc(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var Tu=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=Ic(e,r.schema);if(i)if(o){let e=Ol(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return wu(r,n,c)},Eu=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Du=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=Tc(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>hr(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>hr(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},Ou=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=Bc(e,0,n.content.size),i=G.create(n,r);t.setSelection(i)}return!0},ku=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},Au=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=W.atStart(n).from,o=W.atEnd(n).to,s=Bc(r,a,o),c=Bc(i,a,o),l=W.create(n,s,c);t.setSelection(l)}return!0},ju=e=>({state:t,dispatch:n})=>Dr(Tc(e,t.schema))(t,n);function Mu(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var Nu=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=uu(l,s.node().type.name,s.node().attrs);if(a instanceof G&&a.node.isBlock)return!s.parentOffset||!zt(o,s.pos)?!1:(r&&(e&&Mu(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:Al(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=zt(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&zt(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof W&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&Mu(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},Pu=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=Tc(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=S.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=S.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...uu(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(S.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new O(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(W.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...uu(d,u.type.name,u.attrs),...t},m={...uu(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!zt(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},Fu=(e,t)=>{let n=Nl(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&Vt(e.doc,n.pos)&&e.join(n.pos),!0},Iu=(e,t)=>{let n=Nl(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&Vt(e.doc,r)&&e.join(r),!0},Lu=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=Tc(e,o.schema),m=Tc(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=Nl(e=>_u(e.type.name,d))(h);if(y.depth>=1&&x&&y.depth-x.depth<=1){if(x.node.type===p)return l.liftListItem(m);if(_u(x.node.type.name,d)&&p.validContent(x.node.content)&&s)return c().command(()=>(a.setNodeMarkup(x.pos,p),!0)).command(()=>Fu(a,p)).command(()=>Iu(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>Fu(a,p)).command(()=>Iu(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>Fu(a,p)).command(()=>Iu(a,p)).run()},Ru=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=Ic(e,r.schema);return fu(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},zu=(e,t,n={})=>({state:r,commands:i})=>{let a=Tc(e,r.schema),o=Tc(t,r.schema),s=dl(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},Bu=(e,t={})=>({state:n,commands:r})=>{let i=Tc(e,n.schema);return dl(n,i,t)?r.lift(i):r.wrapIn(i,t)},Vu=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},Hu=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},Uu=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=Ic(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=Fc(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},Wu=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},Gu=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=gl(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Tc(e,r.schema)),s===`mark`&&(o=Ic(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},Ku=(e,t={})=>({state:n,dispatch:r})=>mr(Tc(e,n.schema),t)(n,r),qu=(e,t={})=>({state:n,dispatch:r})=>xr(Tc(e,n.schema),t)(n,r),Ju=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},Yu=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},Xu=(e,t)=>{if(jc(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function Zu(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=du(c)+i;return a.forEach(e=>{if(l)return;let a=Xu(u,e.find);if(!a)return;let c=s.state.tr,d=hc({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new gc({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function Qu(e){let{editor:t,rules:n}=e,r=new Pn({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:Fl(S.from(e),a.schema);let{from:i}=s;Zu({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return Zu({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&Zu({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?Zu({editor:t,from:a.pos,to:a.pos,text:`
|
|
13
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function $u(e){return Object.prototype.toString.call(e).slice(8,-1)}function ed(e){return $u(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function td(e,t){let n={...e};return ed(e)&&ed(t)&&Object.keys(t).forEach(r=>{ed(t[r])&&ed(e[r])?n[r]=td(e[r],t[r]):n[r]=t[r]}),n}var nd=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Ll(K(this,`addOptions`,{name:this.name}))||{}}}get storage(){return{...Ll(K(this,`addStorage`,{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>td(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},rd=class e extends nd{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function id(e){return typeof e==`number`}var ad=class{constructor(e){this.find=e.find,this.handler=e.handler}},od=(e,t,n)=>{if(jc(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function sd(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new gc({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||od(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var cd=null,ld=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function ud(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!sd({editor:t,state:hc({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new Pn({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(cd=t)},i=()=>{cd&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=cd;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:Fl(S.from(t),r.schema);let{from:n}=d,i=n+t.length,a=ld(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!id(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var dd=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=Ql(e),this.schema=Yl(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=K(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:lu(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return Zl([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:lu(t.name,this.schema)},r=[],i=K(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&K(t,`exitable`,n)&&(a.ArrowRight=()=>rd.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=dc(a);r.push(o);let s=K(t,`addInputRules`,n);if(gu(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=Qu({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=K(t,`addPasteRules`,n);if(gu(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=ud({editor:e,rules:t});r.push(...n)}}let l=K(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return Bl(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=zl(this.extensions);return Object.fromEntries(t.filter(e=>!!K(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=K(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Tc(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:Wl(r,n)})]:[]}))}dispatchTransaction(e){let{editor:t}=this;return Zl([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:lu(n.name,this.schema)},i=K(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return Zl([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:lu(n.name,this.schema)},i=K(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=zl(this.extensions);return Object.fromEntries(t.filter(e=>!!K(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=K(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Ic(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=Wl(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{Ud(i,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:lu(e.name,this.schema)};e.type===`mark`&&(Ll(K(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name);let n=K(e,`onBeforeCreate`,t),r=K(e,`onCreate`,t),i=K(e,`onUpdate`,t),a=K(e,`onSelectionUpdate`,t),o=K(e,`onTransaction`,t),s=K(e,`onFocus`,t),c=K(e,`onBlur`,t),l=K(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};dd.resolve=Ql,dd.sort=Zl,dd.flatten=Pl,mc({},{ClipboardTextSerializer:()=>pd,Commands:()=>md,Delete:()=>hd,Drop:()=>gd,Editable:()=>_d,FocusEvents:()=>yd,Keymap:()=>bd,Paste:()=>xd,Tabindex:()=>Sd,TextDirection:()=>Cd,focusEventsPluginKey:()=>vd});var fd=class e extends nd{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},pd=fd.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Pn({key:new Ln(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:a}=i,o=Math.min(...a.map(e=>e.$from.pos)),s=Math.max(...a.map(e=>e.$to.pos)),c=tu(n);return $l(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator},textSerializers:c})}}})]}}),md=fd.create({name:`commands`,addCommands(){return{..._c}}}),hd=fd.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=kl(e.before,[e,...t]);ou(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof _t){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)),u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),gd=fd.create({name:`drop`,addProseMirrorPlugins(){return[new Pn({key:new Ln(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),_d=fd.create({name:`editable`,addProseMirrorPlugins(){return[new Pn({key:new Ln(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),vd=new Ln(`focusEvents`),yd=fd.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new Pn({key:vd,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),bd=fd.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:U.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Uc()||cl()?i:r},addProseMirrorPlugins(){return[new Pn({key:new Ln(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=U.atStart(t.doc).from,l=U.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!vu(n.doc))return;let u=n.tr,d=hc({state:n,transaction:u}),{commands:f}=new gc({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),xd=fd.create({name:`paste`,addProseMirrorPlugins(){return[new Pn({key:new Ln(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),Sd=fd.create({name:`tabindex`,addProseMirrorPlugins(){return[new Pn({key:new Ln(`tabindex`),props:{attributes:()=>this.editor.isEditable?{tabindex:`0`}:{}}})]}}),Cd=fd.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=zl(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Pn({key:new Ln(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),wd=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+(a?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},Td=`.ProseMirror {
|
|
14
|
+
position: relative;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ProseMirror {
|
|
18
|
+
word-wrap: break-word;
|
|
19
|
+
white-space: pre-wrap;
|
|
20
|
+
white-space: break-spaces;
|
|
21
|
+
-webkit-font-variant-ligatures: none;
|
|
22
|
+
font-variant-ligatures: none;
|
|
23
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ProseMirror [contenteditable="false"] {
|
|
27
|
+
white-space: normal;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
31
|
+
white-space: pre-wrap;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ProseMirror pre {
|
|
35
|
+
white-space: pre-wrap;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
img.ProseMirror-separator {
|
|
39
|
+
display: inline !important;
|
|
40
|
+
border: none !important;
|
|
41
|
+
margin: 0 !important;
|
|
42
|
+
width: 0 !important;
|
|
43
|
+
height: 0 !important;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ProseMirror-gapcursor {
|
|
47
|
+
display: none;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
position: absolute;
|
|
50
|
+
margin: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ProseMirror-gapcursor:after {
|
|
54
|
+
content: "";
|
|
55
|
+
display: block;
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: -2px;
|
|
58
|
+
width: 20px;
|
|
59
|
+
border-top: 1px solid black;
|
|
60
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes ProseMirror-cursor-blink {
|
|
64
|
+
to {
|
|
65
|
+
visibility: hidden;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ProseMirror-hideselection *::selection {
|
|
70
|
+
background: transparent;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
74
|
+
background: transparent;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ProseMirror-hideselection * {
|
|
78
|
+
caret-color: transparent;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
82
|
+
display: block;
|
|
83
|
+
}`;function Ed(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}var Dd=class extends Ju{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:xu,createMappablePosition:Su},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc(),n=Vc(t,this.options.autofocus);this.editorState=Mn.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=Ed(Td,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=Il(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){this.extensionManager=new dd([...this.options.enableCoreExtensions?[_d,pd.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),md,yd,bd,Sd,gd,xd,hd,Cd.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions==`object`?this.options.enableCoreExtensions[e.name]!==!1:!0):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type)),this)}createCommandManager(){this.commandManager=new gc({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=El(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(t.message))throw t;this.emit(`contentError`,{editor:this,error:t,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=El(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new Gs(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return ru(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return pu(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Fl(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
|
|
84
|
+
|
|
85
|
+
`,textSerializers:n={}}=e||{};return eu(this.state.doc,{blockSeparator:t,textSerializers:{...tu(this.schema),...n}})}get isEmpty(){return vu(this.state.doc)}destroy(){this.emit(`destroy`),this.unmount(),this.removeAllListeners()}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){return new wd(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}};function Od(e){return new Yu({find:e.find,handler:({state:t,range:n,match:r})=>{let i=Ll(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(su(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function kd(e){return new Yu({find:e.find,handler:({state:t,range:n,match:r})=>{let i=Ll(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function Ad(e){return new Yu({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=Ll(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function jd(e){return new Yu({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,a=n.from,o=n.to;if(r[1]){let e=r[0].lastIndexOf(r[1]);i+=r[0].slice(e+r[1].length),a+=e;let t=a-o;t>0&&(i=r[0].slice(e-t,e)+i,a=o)}t.tr.insertText(i,a,o)},undoable:e.undoable})}function Md(e){return new Yu({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=Ll(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&kt(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Vt(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}function Nd(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof G){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}mc({},{createAtomBlockMarkdownSpec:()=>Id,createBlockMarkdownSpec:()=>Ld,createInlineMarkdownSpec:()=>Bd,parseAttributes:()=>Pd,parseIndentedBlocks:()=>Vd,renderNestedMarkdownContent:()=>Hd,serializeAttributes:()=>Fd});function Pd(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=n[parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10)];i&&(t[e]=i.slice(1,-1))});let o=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,``).replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,``).replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,``).trim();return o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function Fd(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e===`class`||e===`id`||(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function Id(e){let{nodeName:t,name:n,parseAttributes:r=Pd,serializeAttributes:i=Fd,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=r(s[1]||``);if(!o.find(e=>!(e in l)))return{type:t,raw:s[0],attributes:l}}},renderMarkdown:e=>{let t=i(l(e.attrs||{}));return`:::${c}${t?` {${t}}`:``} :::`}}}function Ld(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=Pd,serializeAttributes:a=Fd,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m)if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m);return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=a(u(e.attrs||{}));return`:::${l}${n?` {${n}}`:``}
|
|
86
|
+
|
|
87
|
+
${t.renderChildren(e.content||[],`
|
|
88
|
+
|
|
89
|
+
`)}
|
|
90
|
+
|
|
91
|
+
:::`}}}function Rd(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function zd(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function Bd(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=Rd,serializeAttributes:a=zd,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\[${d}\\s*[^\\]]*\\]`:`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\[${d}\\s*([^\\]]*)\\]`:`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=a(u(e.attrs||{})),i=n?` ${n}`:``;return s?`[${l}${i}]`:`[${l}${i}]${t}[/${l}]`}}}function Vd(e,t,n){let r=e.split(`
|
|
92
|
+
`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}
|
|
93
|
+
`;continue}else return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}
|
|
94
|
+
`;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}
|
|
95
|
+
`,o+=1;continue}else break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}
|
|
96
|
+
`,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`
|
|
97
|
+
`);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function Hd(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`
|
|
98
|
+
`).map(e=>e?t.indent(e):t.indent(``)).join(`
|
|
99
|
+
`);s+=e.type===`paragraph`?`
|
|
100
|
+
|
|
101
|
+
${n}`:`
|
|
102
|
+
${n}`}}),s}function Ud(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var Wd=class e extends nd{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Gd=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t;let{view:n}=this.editor,r=e.target,i=r.nodeType===3?r.parentElement?.closest(`[data-drag-handle]`):r.closest(`[data-drag-handle]`);if(!this.dom||this.contentDOM?.contains(r)||!i)return;let a=0,o=0;if(this.dom!==i){let t=this.dom.getBoundingClientRect(),n=i.getBoundingClientRect(),r=e.offsetX??e.nativeEvent?.offsetX,s=e.offsetY??e.nativeEvent?.offsetY;a=n.x-t.x+r,o=n.y-t.y+s}let s=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();s.style.width=`${Math.round(e.width)}px`,s.style.height=`${Math.round(e.height)}px`,s.style.boxSizing=`border-box`,s.style.pointerEvents=`none`}catch{}let c=null;try{c=document.createElement(`div`),c.style.position=`absolute`,c.style.top=`-9999px`,c.style.left=`-9999px`,c.style.pointerEvents=`none`,c.appendChild(s),document.body.appendChild(c),(t=e.dataTransfer)==null||t.setDragImage(s,a,o)}finally{c&&setTimeout(()=>{try{c?.remove()}catch{}},0)}let l=this.getPos();if(typeof l!=`number`)return;let u=G.create(n.state.doc,l),d=n.state.tr.setSelection(u);n.dispatch(d)}stopEvent(e){if(!this.dom)return!1;if(typeof this.options.stopEvent==`function`)return this.options.stopEvent({event:e});let t=e.target;if(!(this.dom.contains(t)&&!this.contentDOM?.contains(t)))return!1;let n=e.type.startsWith(`drag`),r=e.type===`drop`;if(([`INPUT`,`BUTTON`,`SELECT`,`TEXTAREA`].includes(t.tagName)||t.isContentEditable)&&!r&&!n)return!0;let{isEditable:i}=this.editor,{isDragging:a}=this,o=!!this.node.type.spec.draggable,s=G.isSelectable(this.node),c=e.type===`copy`,l=e.type===`paste`,u=e.type===`cut`,d=e.type===`mousedown`;if(!o&&s&&n&&e.target===this.dom&&e.preventDefault(),o&&n&&!a&&e.target===this.dom)return e.preventDefault(),!1;if(o&&i&&!a&&d){let e=t.closest(`[data-drag-handle]`);e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener(`dragend`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`drop`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`mouseup`,()=>{this.isDragging=!1},{once:!0}))}return!(a||r||c||l||u||d&&s)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation==`function`?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type===`selection`||this.dom.contains(e.target)&&e.type===`childList`&&(Uc()||Hc())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return typeof n==`number`?(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0):!1})}deleteNode(){let e=this.getPos();if(typeof e!=`number`)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function Kd(e){return new ad({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=Ll(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let r=c.search(/\S/),i=n.from+c.indexOf(s),u=i+s.length;if(su(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>i).length)return null;u<n.to&&o.delete(u,n.to),i>n.from&&o.delete(n.from+r,i),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(a||{})),o.removeStoredMark(e.type)}}})}var{getOwnPropertyNames:qd,getOwnPropertySymbols:Jd}=Object,{hasOwnProperty:Yd}=Object.prototype;function Xd(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function Zd(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function Qd(e){return e?.[Symbol.toStringTag]}function $d(e){return qd(e).concat(Jd(e))}var ef=Object.hasOwn||((e,t)=>Yd.call(e,t));function tf(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var nf=`__v`,rf=`__o`,af=`_owner`,{getOwnPropertyDescriptor:of,keys:sf}=Object;function cf(e,t){return e.byteLength===t.byteLength&&xf(new Uint8Array(e),new Uint8Array(t))}function lf(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function uf(e,t){return e.byteLength===t.byteLength&&xf(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function df(e,t){return tf(e.getTime(),t.getTime())}function ff(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function pf(e,t){return e===t}function mf(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var hf=tf;function gf(e,t,n){let r=sf(e),i=r.length;if(sf(t).length!==i)return!1;for(;i-- >0;)if(!Cf(e,t,n,r[i]))return!1;return!0}function _f(e,t,n){let r=$d(e),i=r.length;if($d(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=r[i],!Cf(e,t,n,a)||(o=of(e,a),s=of(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function vf(e,t){return tf(e.valueOf(),t.valueOf())}function yf(e,t){return e.source===t.source&&e.flags===t.flags}function bf(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function xf(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Sf(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Cf(e,t,n,r){return(r===af||r===rf||r===nf)&&(e.$$typeof||t.$$typeof)?!0:ef(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var wf=`[object ArrayBuffer]`,Tf=`[object Arguments]`,Ef=`[object Boolean]`,Df=`[object DataView]`,Of=`[object Date]`,kf=`[object Error]`,Af=`[object Map]`,jf=`[object Number]`,Mf=`[object Object]`,Nf=`[object RegExp]`,Pf=`[object Set]`,Ff=`[object String]`,If={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Lf=`[object URL]`,Rf=Object.prototype.toString;function zf({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`?a(h,g,_):!1;let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=Rf.call(h);if(b===Of)return r(h,g,_);if(b===Nf)return u(h,g,_);if(b===Af)return o(h,g,_);if(b===Pf)return d(h,g,_);if(b===Mf)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===Lf)return p(h,g,_);if(b===kf)return i(h,g,_);if(b===Tf)return c(h,g,_);if(If[b])return f(h,g,_);if(b===wf)return e(h,g,_);if(b===Df)return n(h,g,_);if(b===Ef||b===jf||b===Ff)return l(h,g,_);if(m){let e=m[b];if(!e){let t=Qd(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function Bf({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:cf,areArraysEqual:n?_f:lf,areDataViewsEqual:uf,areDatesEqual:df,areErrorsEqual:ff,areFunctionsEqual:pf,areMapsEqual:n?Xd(mf,_f):mf,areNumbersEqual:hf,areObjectsEqual:n?_f:gf,arePrimitiveWrappersEqual:vf,areRegExpsEqual:yf,areSetsEqual:n?Xd(bf,_f):bf,areTypedArraysEqual:n?Xd(xf,_f):xf,areUrlsEqual:Sf,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=Zd(r.areArraysEqual),t=Zd(r.areMapsEqual),n=Zd(r.areObjectsEqual),i=Zd(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function Vf(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function Hf({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var Uf=Wf();Wf({strict:!0}),Wf({circular:!0}),Wf({circular:!0,strict:!0}),Wf({createInternalComparator:()=>tf}),Wf({strict:!0,createInternalComparator:()=>tf}),Wf({circular:!0,createInternalComparator:()=>tf}),Wf({circular:!0,createInternalComparator:()=>tf,strict:!0});function Wf(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=zf(Bf(e));return Hf({circular:t,comparator:a,createState:r,equals:n?n(a):Vf(a),strict:i})}var Gf=s((e=>{var t=require(`react`),n=_();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Kf=s((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=require(`react`),r=_(),i=typeof Object.is==`function`?Object.is:t,a=r.useSyncExternalStore,o=n.useRef,s=n.useEffect,c=n.useMemo,l=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),qf=s(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=Gf():t.exports=Kf()}))(),Jf=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},Yf=({contentComponent:e})=>{let t=(0,v.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,m.jsx)(m.Fragment,{children:Object.values(t)})};function Xf(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:p.default.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var Zf=class extends f.default.Component{constructor(e){super(e),this.editorContentRef=f.default.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!e.editor?.contentComponent}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=Xf(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){let e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{ref:Jf(t,this.editorContentRef),...n}),e?.contentComponent&&(0,m.jsx)(Yf,{contentComponent:e.contentComponent})]})}},Qf=(0,f.forwardRef)((e,t)=>{let n=f.default.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return f.default.createElement(Zf,{key:n,innerRef:t,...e})}),$f=f.default.memo(Qf),ep=typeof window<`u`?f.useLayoutEffect:f.useEffect,tp=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on(`transaction`,e),()=>{t.off(`transaction`,e)}}}};function np(e){let[t]=(0,f.useState)(()=>new tp(e.editor)),n=(0,qf.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??Uf);return ep(()=>t.watch(e.editor),[e.editor,t]),(0,f.useDebugValue)(n),n}var rp=process.env.NODE_ENV!==`production`,ip=typeof window>`u`,ap=ip||!!(typeof window<`u`&&window.next),op=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=``,this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0){if(ip||ap){if(rp)throw Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&ip&&rp)throw Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){return new Dd({...this.options.current,onBeforeCreate:(...e)=>{var t;return(t=this.options.current).onBeforeCreate?.call(t,...e)},onBlur:(...e)=>{var t;return(t=this.options.current).onBlur?.call(t,...e)},onCreate:(...e)=>{var t;return(t=this.options.current).onCreate?.call(t,...e)},onDestroy:(...e)=>{var t;return(t=this.options.current).onDestroy?.call(t,...e)},onFocus:(...e)=>{var t;return(t=this.options.current).onFocus?.call(t,...e)},onSelectionUpdate:(...e)=>{var t;return(t=this.options.current).onSelectionUpdate?.call(t,...e)},onTransaction:(...e)=>{var t;return(t=this.options.current).onTransaction?.call(t,...e)},onUpdate:(...e)=>{var t;return(t=this.options.current).onUpdate?.call(t,...e)},onContentError:(...e)=>{var t;return(t=this.options.current).onContentError?.call(t,...e)},onDrop:(...e)=>{var t;return(t=this.options.current).onDrop?.call(t,...e)},onPaste:(...e)=>{var t;return(t=this.options.current).onPaste?.call(t,...e)},onDelete:(...e)=>{var t;return(t=this.options.current).onDelete?.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>[`onCreate`,`onBeforeCreate`,`onDestroy`,`onUpdate`,`onTransaction`,`onFocus`,`onBlur`,`onSelectionUpdate`,`onContentError`,`onDrop`,`onPaste`].includes(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length?e.extensions.every((e,n)=>e===t.extensions?.[n]):!1:e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function sp(e={},t=[]){let n=(0,f.useRef)(e);n.current=e;let[r]=(0,f.useState)(()=>new op(n)),i=(0,v.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,f.useDebugValue)(i),(0,f.useEffect)(r.onRender(t)),np({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&t===0?0:t+1}),i}var cp=(0,f.createContext)({editor:null});cp.Consumer;var lp=()=>(0,f.useContext)(cp),up=(0,f.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),dp=()=>(0,f.useContext)(up);function fp({as:e=`div`,...t}){let{nodeViewContentRef:n,nodeViewContentChildren:r}=dp();return(0,m.jsx)(e,{...t,ref:n,"data-node-view-content":``,style:{whiteSpace:`pre-wrap`,...t.style},children:r})}var pp=f.default.forwardRef((e,t)=>{let{onDragStart:n}=dp();return(0,m.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})});function mp(e){return!!(typeof e==`function`&&e.prototype&&e.prototype.isReactComponent)}function hp(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.forward_ref)`||e.$$typeof.description===`react.forward_ref`))}function gp(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.memo)`||e.$$typeof.description===`react.memo`))}function _p(e){if(mp(e)||hp(e))return!0;if(gp(e)){let t=e.type;if(t)return mp(t)||hp(t)}return!1}function vp(){try{if(f.version)return parseInt(f.version.split(`.`)[0],10)>=19}catch{}return!1}var yp=class{constructor(e,{editor:t,props:n={},as:r=`div`,className:i=``}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add(`react-renderer`),i&&this.element.classList.add(...i.split(` `)),this.editor.isInitialized?(0,p.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;let t=this.component,n=this.props,r=this.editor,i=vp(),a=_p(t),o={...n};o.ref&&!(i||a)&&delete o.ref,!o.ref&&(i||a)&&(o.ref=e=>{this.ref=e}),this.reactElement=(0,m.jsx)(t,{...o}),(e=r?.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){this.destroyed||(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0,(e=this.editor?.contentComponent)==null||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};f.default.createContext({markViewContentRef:()=>{}});var bp=class extends Gd{constructor(e,t,n){if(super(e,t,n),this.selectionRafId=null,this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?`span`:`div`),this.contentDOMElement.dataset.nodeViewContentReact=``,this.contentDOMElement.dataset.nodeViewWrapper=``,this.contentDOMElement.style.whiteSpace=`inherit`;let e=this.dom.querySelector(`[data-node-view-content]`);if(!e)return;e.appendChild(this.contentDOMElement)}}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){return r===`storage`?e.storage[t.name]??{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,f.createRef)()};if(!this.component.displayName){let e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}let t={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&(e.hasAttribute(`data-node-view-wrapper`)&&e.removeAttribute(`data-node-view-wrapper`),e.appendChild(this.contentDOMElement))}},n=this.component,r=(0,f.memo)(e=>(0,m.jsx)(up.Provider,{value:t,children:(0,f.createElement)(n,e)}));r.displayName=`ReactNodeView`;let i=this.node.isInline?`span`:`div`;this.options.as&&(i=this.options.as);let{className:a=``}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new yp(r,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on(`selectionUpdate`,this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){if(this.renderer.element.firstElementChild&&!this.renderer.element.firstElementChild?.hasAttribute(`data-node-view-wrapper`))throw Error(`Please use the NodeViewWrapper component for your node view.`);return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&=(cancelAnimationFrame(this.selectionRafId),null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;let{from:e,to:t}=this.editor.state.selection,n=this.getPos();if(typeof n==`number`)if(e<=n&&t>=n+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,n){let r=e=>{this.renderer.updateProps(e),typeof this.options.attrs==`function`&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update==`function`){let i=this.node,a=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}return e===this.node&&this.decorations===t&&this.innerDecorations===n?!0:(this.node=e,this.decorations=t,this.innerDecorations=n,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage}),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add(`ProseMirror-selectednode`)}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove(`ProseMirror-selectednode`)}destroy(){this.renderer.destroy(),this.editor.off(`selectionUpdate`,this.handleSelectionUpdate),this.contentDOMElement=null,this.selectionRafId&&=(cancelAnimationFrame(this.selectionRafId),null)}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs==`function`){let t=this.editor.extensionManager.attributes,n=Wl(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function xp(e,t){return n=>n.editor.contentComponent?new bp(e,n,t):{}}var Sp=(0,f.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});Sp.displayName=`TiptapContext`;var Cp=()=>(0,f.useContext)(Sp);function wp({editor:e,instance:t,children:n}){let r=e??t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,f.useMemo)(()=>({editor:r}),[r]),a=(0,f.useMemo)(()=>({editor:r}),[r]);return(0,m.jsx)(cp.Provider,{value:a,children:(0,m.jsx)(Sp.Provider,{value:i,children:n})})}wp.displayName=`Tiptap`;function Tp({...e}){let{editor:t}=Cp();return(0,m.jsx)($f,{editor:t,...e})}Tp.displayName=`Tiptap.Content`,Object.assign(wp,{Content:Tp});var Ep=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]},Dp=/^\s*>\s$/,Op=Wd.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return Ep(`blockquote`,{...Ul(this.options.HTMLAttributes,e),children:Ep(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
|
|
103
|
+
`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
|
|
104
|
+
`))}),n.join(`
|
|
105
|
+
>
|
|
106
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Md({find:Dp,type:this.type})]}}),kp=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Ap=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,jp=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Mp=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Np=rd.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return Ep(`strong`,{...Ul(this.options.HTMLAttributes,e),children:Ep(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Od({find:kp,type:this.type}),Od({find:jp,type:this.type})]},addPasteRules(){return[Kd({find:Ap,type:this.type}),Kd({find:Mp,type:this.type})]}}),Pp=/(^|[^`])`([^`]+)`(?!`)$/,Fp=/(^|[^`])`([^`]+)`(?!`)/g,Ip=rd.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,Ul(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Od({find:Pp,type:this.type})]},addPasteRules(){return[Kd({find:Fp,type:this.type})]}}),Lp=4,Rp=/^```([a-z]+)?[\s\n]$/,zp=/^~~~([a-z]+)?[\s\n]$/,Bp=Wd.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Lp,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,Ul(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
|
|
107
|
+
`):`\`\`\`${r}
|
|
108
|
+
|
|
109
|
+
\`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??Lp,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
|
|
110
|
+
`,`
|
|
111
|
+
`).split(`
|
|
112
|
+
`).map(e=>o+e).join(`
|
|
113
|
+
`);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??Lp,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
|
|
114
|
+
`,`
|
|
115
|
+
`).split(`
|
|
116
|
+
`),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(W.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
|
|
117
|
+
`,`
|
|
118
|
+
`).split(`
|
|
119
|
+
`).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
|
|
120
|
+
`);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
|
|
121
|
+
|
|
122
|
+
`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(U.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[Ad({find:Rp,type:this.type,getAttributes:e=>({language:e[1]})}),Ad({find:zp,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Pn({key:new Ln(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
|
|
123
|
+
`));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(W.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),Vp=Wd.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
124
|
+
|
|
125
|
+
`):``}),Hp=Wd.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,Ul(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
126
|
+
`},renderMarkdown:()=>`
|
|
127
|
+
`,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Up=Wd.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Ul(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Ad({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),Wp=Wd.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,Ul(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!Nd(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return yu(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(W.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(G.create(t.doc,n.pos)):t.setSelection(W.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(W.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[kd({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Gp=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Kp=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,qp=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Jp=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Yp=rd.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,Ul(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Od({find:Gp,type:this.type}),Od({find:qp,type:this.type})]},addPasteRules(){return[Kd({find:Kp,type:this.type}),Kd({find:Jp,type:this.type})]}}),Xp=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,Zp=`ελ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`,Qp=`numeric`,$p=`ascii`,em=`alpha`,tm=`asciinumeric`,nm=`alphanumeric`,rm=`domain`,im=`emoji`,am=`scheme`,om=`slashscheme`,sm=`whitespace`;function cm(e,t){return e in t||(t[e]=[]),t[e]}function lm(e,t,n){t[Qp]&&(t[tm]=!0,t[nm]=!0),t[$p]&&(t[tm]=!0,t[em]=!0),t[tm]&&(t[nm]=!0),t[em]&&(t[nm]=!0),t[nm]&&(t[rm]=!0),t[im]&&(t[rm]=!0);for(let r in t){let t=cm(r,n);t.indexOf(e)<0&&t.push(e)}}function um(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function dm(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}dm.groups={},dm.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=dm.groups;let i;return t&&t.j?i=t:(i=new dm(t),n&&r&&lm(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=dm.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new dm,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new dm,a&&(r&&(o.t&&typeof o.t==`string`?lm(a,Object.assign(um(o.t,r),n),r):n&&lm(a,n,r)),o.t=a),i.j[e]=o,o}};var fm=(e,t,n,r,i)=>e.ta(t,n,r,i),pm=(e,t,n,r,i)=>e.tr(t,n,r,i),mm=(e,t,n,r,i)=>e.ts(t,n,r,i),q=(e,t,n,r,i)=>e.tt(t,n,r,i),hm=`WORD`,gm=`UWORD`,_m=`ASCIINUMERICAL`,vm=`ALPHANUMERICAL`,ym=`LOCALHOST`,bm=`TLD`,xm=`UTLD`,Sm=`SCHEME`,Cm=`SLASH_SCHEME`,wm=`NUM`,Tm=`WS`,Em=`NL`,Dm=`OPENBRACE`,Om=`CLOSEBRACE`,km=`OPENBRACKET`,Am=`CLOSEBRACKET`,jm=`OPENPAREN`,Mm=`CLOSEPAREN`,Nm=`OPENANGLEBRACKET`,Pm=`CLOSEANGLEBRACKET`,Fm=`FULLWIDTHLEFTPAREN`,Im=`FULLWIDTHRIGHTPAREN`,Lm=`LEFTCORNERBRACKET`,Rm=`RIGHTCORNERBRACKET`,zm=`LEFTWHITECORNERBRACKET`,Bm=`RIGHTWHITECORNERBRACKET`,Vm=`FULLWIDTHLESSTHAN`,Hm=`FULLWIDTHGREATERTHAN`,Um=`AMPERSAND`,Wm=`APOSTROPHE`,Gm=`ASTERISK`,Km=`AT`,qm=`BACKSLASH`,Jm=`BACKTICK`,Ym=`CARET`,Xm=`COLON`,Zm=`COMMA`,Qm=`DOLLAR`,$m=`DOT`,eh=`EQUALS`,th=`EXCLAMATION`,nh=`HYPHEN`,rh=`PERCENT`,ih=`PIPE`,ah=`PLUS`,oh=`POUND`,sh=`QUERY`,ch=`QUOTE`,lh=`FULLWIDTHMIDDLEDOT`,uh=`SEMI`,dh=`SLASH`,fh=`TILDE`,ph=`UNDERSCORE`,mh=`EMOJI`,hh=`SYM`,gh=Object.freeze({__proto__:null,ALPHANUMERICAL:vm,AMPERSAND:Um,APOSTROPHE:Wm,ASCIINUMERICAL:_m,ASTERISK:Gm,AT:Km,BACKSLASH:qm,BACKTICK:Jm,CARET:Ym,CLOSEANGLEBRACKET:Pm,CLOSEBRACE:Om,CLOSEBRACKET:Am,CLOSEPAREN:Mm,COLON:Xm,COMMA:Zm,DOLLAR:Qm,DOT:$m,EMOJI:mh,EQUALS:eh,EXCLAMATION:th,FULLWIDTHGREATERTHAN:Hm,FULLWIDTHLEFTPAREN:Fm,FULLWIDTHLESSTHAN:Vm,FULLWIDTHMIDDLEDOT:lh,FULLWIDTHRIGHTPAREN:Im,HYPHEN:nh,LEFTCORNERBRACKET:Lm,LEFTWHITECORNERBRACKET:zm,LOCALHOST:ym,NL:Em,NUM:wm,OPENANGLEBRACKET:Nm,OPENBRACE:Dm,OPENBRACKET:km,OPENPAREN:jm,PERCENT:rh,PIPE:ih,PLUS:ah,POUND:oh,QUERY:sh,QUOTE:ch,RIGHTCORNERBRACKET:Rm,RIGHTWHITECORNERBRACKET:Bm,SCHEME:Sm,SEMI:uh,SLASH:dh,SLASH_SCHEME:Cm,SYM:hh,TILDE:fh,TLD:bm,UNDERSCORE:ph,UTLD:xm,UWORD:gm,WORD:hm,WS:Tm}),_h=/[a-z]/,vh=/\p{L}/u,yh=/\p{Emoji}/u,bh=/\d/,xh=/\s/,Sh=`\r`,Ch=`
|
|
128
|
+
`,wh=`️`,Th=``,Eh=``,Dh=null,Oh=null;function kh(e=[]){let t={};dm.groups=t;let n=new dm;Dh??=Nh(Xp),Oh??=Nh(Zp),q(n,`'`,Wm),q(n,`{`,Dm),q(n,`}`,Om),q(n,`[`,km),q(n,`]`,Am),q(n,`(`,jm),q(n,`)`,Mm),q(n,`<`,Nm),q(n,`>`,Pm),q(n,`(`,Fm),q(n,`)`,Im),q(n,`「`,Lm),q(n,`」`,Rm),q(n,`『`,zm),q(n,`』`,Bm),q(n,`<`,Vm),q(n,`>`,Hm),q(n,`&`,Um),q(n,`*`,Gm),q(n,`@`,Km),q(n,"`",Jm),q(n,`^`,Ym),q(n,`:`,Xm),q(n,`,`,Zm),q(n,`$`,Qm),q(n,`.`,$m),q(n,`=`,eh),q(n,`!`,th),q(n,`-`,nh),q(n,`%`,rh),q(n,`|`,ih),q(n,`+`,ah),q(n,`#`,oh),q(n,`?`,sh),q(n,`"`,ch),q(n,`/`,dh),q(n,`;`,uh),q(n,`~`,fh),q(n,`_`,ph),q(n,`\\`,qm),q(n,`・`,lh);let r=pm(n,bh,wm,{[Qp]:!0});pm(r,bh,r);let i=pm(r,_h,_m,{[tm]:!0}),a=pm(r,vh,vm,{[nm]:!0}),o=pm(n,_h,hm,{[$p]:!0});pm(o,bh,i),pm(o,_h,o),pm(i,bh,i),pm(i,_h,i);let s=pm(n,vh,gm,{[em]:!0});pm(s,_h),pm(s,bh,a),pm(s,vh,s),pm(a,bh,a),pm(a,_h),pm(a,vh,a);let c=q(n,Ch,Em,{[sm]:!0}),l=q(n,Sh,Tm,{[sm]:!0}),u=pm(n,xh,Tm,{[sm]:!0});q(n,Eh,u),q(l,Ch,c),q(l,Eh,u),pm(l,xh,u),q(u,Sh),q(u,Ch),pm(u,xh,u),q(u,Eh,u);let d=pm(n,yh,mh,{[im]:!0});q(d,`#`),pm(d,yh,d),q(d,wh,d);let f=q(d,Th);q(f,`#`),pm(f,yh,d);let p=[[_h,o],[bh,i]],m=[[_h,null],[vh,s],[bh,a]];for(let e=0;e<Dh.length;e++)Mh(n,Dh[e],bm,hm,p);for(let e=0;e<Oh.length;e++)Mh(n,Oh[e],xm,gm,m);lm(bm,{tld:!0,ascii:!0},t),lm(xm,{utld:!0,alpha:!0},t),Mh(n,`file`,Sm,hm,p),Mh(n,`mailto`,Sm,hm,p),Mh(n,`http`,Cm,hm,p),Mh(n,`https`,Cm,hm,p),Mh(n,`ftp`,Cm,hm,p),Mh(n,`ftps`,Cm,hm,p),lm(Sm,{scheme:!0,ascii:!0},t),lm(Cm,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[am]:!0}:{[om]:!0};r.indexOf(`-`)>=0?i[rm]=!0:_h.test(r)?bh.test(r)?i[tm]=!0:i[$p]=!0:i[Qp]=!0,mm(n,r,r,i)}return mm(n,`localhost`,ym,{ascii:!0}),n.jd=new dm(hh),{start:n,tokens:Object.assign({groups:t},gh)}}function Ah(e,t){let n=jh(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function jh(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function Mh(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new dm(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new dm(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function Nh(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var Ph={defaultProtocol:`http`,events:null,format:Ih,formatHref:Ih,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Fh(e,t=null){let n=Object.assign({},Ph);e&&(n=Object.assign(n,e instanceof Fh?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}Fh.prototype={o:Ph,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:Ph[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function Ih(e){return e}function Lh(e,t){this.t=`token`,this.v=e,this.tk=t}Lh.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Ph.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function Rh(e,t){class n extends Lh{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var zh=Rh(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),Bh=Rh(`text`),Vh=Rh(`nl`),Hh=Rh(`url`,{isLink:!0,toHref(e=Ph.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==ym&&e[1].t===Xm}}),Uh=e=>new dm(e);function Wh({groups:e}){let t=e.domain.concat([Um,Gm,Km,qm,Jm,Ym,Qm,eh,nh,wm,rh,ih,ah,oh,dh,hh,fh,ph]),n=[Wm,Xm,Zm,$m,th,rh,sh,ch,uh,Nm,Pm,Dm,Om,Am,km,jm,Mm,Fm,Im,Lm,Rm,zm,Bm,Vm,Hm],r=[Um,Wm,Gm,qm,Jm,Ym,Qm,eh,nh,Dm,Om,rh,ih,ah,oh,sh,dh,hh,fh,ph],i=Uh(),a=q(i,fh);fm(a,r,a),fm(a,e.domain,a);let o=Uh(),s=Uh(),c=Uh();fm(i,e.domain,o),fm(i,e.scheme,s),fm(i,e.slashscheme,c),fm(o,r,a),fm(o,e.domain,o);let l=q(o,Km);q(a,Km,l),q(s,Km,l),q(c,Km,l);let u=q(a,$m);fm(u,r,a),fm(u,e.domain,a);let d=Uh();fm(l,e.domain,d),fm(d,e.domain,d);let f=q(d,$m);fm(f,e.domain,d);let p=Uh(zh);fm(f,e.tld,p),fm(f,e.utld,p),q(l,ym,p);let m=q(d,nh);q(m,nh,m),fm(m,e.domain,d),fm(p,e.domain,d),q(p,$m,f),q(p,nh,m),fm(q(p,Xm),e.numeric,zh);let h=q(o,nh),g=q(o,$m);q(h,nh,h),fm(h,e.domain,o),fm(g,r,a),fm(g,e.domain,o);let _=Uh(Hh);fm(g,e.tld,_),fm(g,e.utld,_),fm(_,e.domain,o),fm(_,r,a),q(_,$m,g),q(_,nh,h),q(_,Km,l);let v=q(_,Xm),y=Uh(Hh);fm(v,e.numeric,y);let b=Uh(Hh),x=Uh();fm(b,t,b),fm(b,n,x),fm(x,t,b),fm(x,n,x),q(_,dh,b),q(y,dh,b);let S=q(s,Xm),C=q(q(q(c,Xm),dh),dh);fm(s,e.domain,o),q(s,$m,g),q(s,nh,h),fm(c,e.domain,o),q(c,$m,g),q(c,nh,h),fm(S,e.domain,b),q(S,dh,b),q(S,sh,b),fm(C,e.domain,b),fm(C,t,b),q(C,dh,b);let w=[[Dm,Om],[km,Am],[jm,Mm],[Nm,Pm],[Fm,Im],[Lm,Rm],[zm,Bm],[Vm,Hm]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=q(b,r);q(x,r,a),q(a,i,b);let o=Uh(Hh);fm(a,t,o);let s=Uh();fm(a,n),fm(o,t,o),fm(o,n,s),fm(s,t,o),fm(s,n,s),q(o,i,b),q(s,i,b)}return q(i,ym,_),q(i,Em,Vh),{start:i,tokens:gh}}function Gh(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(Kh(Bh,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(Kh(e,t,r))}}return o.length>0&&a.push(Kh(Bh,t,o)),a}function Kh(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var qh=typeof console<`u`&&console&&console.warn||(()=>{}),Jh=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,Yh={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Xh(){return dm.groups={},Yh.scanner=null,Yh.parser=null,Yh.tokenQueue=[],Yh.pluginQueue=[],Yh.customSchemes=[],Yh.initialized=!1,Yh}function Zh(e,t=!1){if(Yh.initialized&&qh(`linkifyjs: already initialized - will not register custom scheme "${e}" ${Jh}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
|
|
129
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
130
|
+
2. Cannot start or end with "-"
|
|
131
|
+
3. "-" cannot repeat`);Yh.customSchemes.push([e,t])}function Qh(){Yh.scanner=kh(Yh.customSchemes);for(let e=0;e<Yh.tokenQueue.length;e++)Yh.tokenQueue[e][1]({scanner:Yh.scanner});Yh.parser=Wh(Yh.scanner.tokens);for(let e=0;e<Yh.pluginQueue.length;e++)Yh.pluginQueue[e][1]({scanner:Yh.scanner,parser:Yh.parser});return Yh.initialized=!0,Yh}function $h(e){return Yh.initialized||Qh(),Gh(Yh.parser.start,e,Ah(Yh.scanner.start,e))}$h.scan=Ah;function eg(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new Fh(n),i=$h(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var tg=`[\0- \xA0 -\u2029 ]`,ng=new RegExp(tg),rg=RegExp(`${tg}$`),ig=new RegExp(tg,`g`);function ag(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function og(e){return new Pn({key:new Ln(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(ou(kl(n.doc,[...t])).forEach(({newRange:t})=>{let n=jl(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!rg.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(ng).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=$h(n).map(t=>t.toObject(e.defaultProtocol));if(!ag(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{su(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function sg(e){return new Pn({key:new Ln(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=ru(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function cg(e){return new Pn({key:new Ln(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=eg(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function lg(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(ig,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,`i`))}var ug=rd.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(e=>{if(typeof e==`string`){Zh(e);return}Zh(e.scheme,e.optionalSlashes)})},onDestroy(){Xh()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!lg(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!lg(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!lg(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,Ul(this.options.HTMLAttributes,e),0]:[`a`,Ul(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!lg(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!lg(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[Kd({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=eg(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!lg(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(og({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!lg(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(sg({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(cg({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),dg=Object.defineProperty,fg=(e,t)=>{for(var n in t)dg(e,n,{get:t[n],enumerable:!0})},pg=`listItem`,mg=`textStyle`,hg=/^\s*([-+*])\s$/,gg=Wd.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,Ul(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
132
|
+
`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(pg,this.editor.getAttributes(mg)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Md({find:hg,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Md({find:hg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(mg),editor:this.editor})),[e]}}),_g=Wd.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,Ul(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>Hd(e,t,e=>e.parentType===`bulletList`?`- `:e.parentType===`orderedList`?`${(e.meta?.parentAttrs?.start||1)+e.index}. `:`- `,n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});fg({},{findListItemPos:()=>vg,getNextListDepth:()=>yg,handleBackspace:()=>Cg,handleDelete:()=>Eg,hasListBefore:()=>bg,hasListItemAfter:()=>Dg,hasListItemBefore:()=>xg,listItemHasSubList:()=>Sg,nextListIsDeeper:()=>wg,nextListIsHigher:()=>Tg});var vg=(e,t)=>{let{$from:n}=t.selection,r=Tc(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},yg=(e,t)=>{let n=vg(e,t);if(!n)return!1;let[,r]=cu(t,e,n.$pos.pos+4);return r},bg=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},xg=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},Sg=(e,t,n)=>{if(!n)return!1;let r=Tc(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},Cg=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!dl(e.state,t)&&bg(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!dl(e.state,t)||!hu(e.state))return!1;let r=vg(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=Sg(t,e.state,i);return xg(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},wg=(e,t)=>{let n=yg(e,t),r=vg(e,t);return!r||!n?!1:n>r.depth},Tg=(e,t)=>{let n=yg(e,t),r=vg(e,t);return!r||!n?!1:n<r.depth},Eg=(e,t)=>{if(!dl(e.state,t)||!mu(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:wg(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Tg(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},Dg=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},Og=fd.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Eg(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Eg(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Cg(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Cg(e,n,r)&&(t=!0)}),t}}}}),kg=/^(\s*)(\d+)\.\s+(.*)$/,Ag=/^\s/;function jg(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(kg);if(!a)break;let[,o,s,c]=a,l=o.length,u=c,d=n+1,f=[i];for(;d<e.length;){let t=e[d];if(t.match(kg))break;if(t.trim()===``)f.push(t),u+=`
|
|
133
|
+
`,d+=1;else if(t.match(Ag))f.push(t),u+=`
|
|
134
|
+
${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:u.trim(),raw:f.join(`
|
|
135
|
+
`)}),r=d,n=d}return[t,r]}function Mg(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let o=a.content.split(`
|
|
136
|
+
`),s=o[0]?.trim()||``,c=[];s&&c.push({type:`paragraph`,raw:s,tokens:n.inlineTokens(s)});let l=o.slice(1).join(`
|
|
137
|
+
`).trim();if(l){let e=n.blockTokens(l);c.push(...e)}let u=i+1,d=[];for(;u<e.length&&e[u].indent>t;)d.push(e[u]),u+=1;if(d.length>0){let e=Mg(d,Math.min(...d.map(e=>e.indent)),n);c.push({type:`list`,ordered:!0,start:d[0].number,items:e,raw:d.map(e=>e.raw).join(`
|
|
138
|
+
`)})}r.push({type:`list_item`,raw:a.raw,tokens:c}),i=u}else i+=1}return r}function Ng(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var Pg=`listItem`,Fg=`textStyle`,Ig=/^(\d+)\.\s$/,Lg=Wd.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,Ul(this.options.HTMLAttributes,n),0]:[`ol`,Ul(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.items?Ng(e.items,t):[];return n===1?{type:`orderedList`,content:r}:{type:`orderedList`,attrs:{start:n},content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
139
|
+
`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
|
|
140
|
+
`),[i,a]=jg(r);if(i.length===0)return;let o=Mg(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
|
|
141
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Pg,this.editor.getAttributes(Fg)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Md({find:Ig,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Md({find:Ig,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Fg)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),Rg=/^\s*(\[([( |x])?\])\s$/,zg=Wd.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:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,Ul(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>Hd(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=Wl(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[Md({find:Rg,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),Bg=Wd.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:e}){return[`ul`,Ul(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
142
|
+
`):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=Vd(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=Vd(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});fd.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(gg.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(_g.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Og.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Lg.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(zg.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(Bg.configure(this.options.taskList)),e}});var Vg=` `,Hg=`\xA0`,Ug=Wd.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,Ul(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return r.length===1&&r[0].type===`text`&&(r[0].text===Vg||r[0].text===Hg)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?Vg:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Wg=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Gg=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Kg=rd.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,Ul(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Od({find:Wg,type:this.type})]},addPasteRules(){return[Kd({find:Gg,type:this.type})]}}),qg=Wd.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),Jg=rd.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,Ul(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function Yg(e={}){return new Pn({view(t){return new Xg(t,e)}})}var Xg=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=qt(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},Zg=class e extends U{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):U.near(r)}content(){return O.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new Qg(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!e_(e)||!t_(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!G.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};Zg.prototype.visible=!1,Zg.findFrom=Zg.findGapCursorFrom,U.jsonID(`gapcursor`,Zg);var Qg=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Zg.valid(t)?new Zg(t):U.near(t)}};function $g(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function e_(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||$g(e.type))return!0;if(e.inlineContent)return!1}}return!0}function t_(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||$g(e.type))return!0;if(e.inlineContent)return!1}}return!0}function n_(){return new Pn({props:{decorations:s_,createSelectionBetween(e,t,n){return t.pos==n.pos&&Zg.valid(n)?new Zg(n):null},handleClick:a_,handleKeyDown:r_,handleDOMEvents:{beforeinput:o_}}})}var r_=fc({ArrowLeft:i_(`horiz`,-1),ArrowRight:i_(`horiz`,1),ArrowUp:i_(`vert`,-1),ArrowDown:i_(`vert`,1)});function i_(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof W){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=Zg.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new Zg(c))),!0):!1}}function a_(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Zg.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&G.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Zg(r))),!0)}function o_(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof Zg))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=S.empty;for(let e=r.length-1;e>=0;e--)i=S.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new O(i,0,0));return a.setSelection(W.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function s_(e){if(!(e.selection instanceof Zg))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,ds.create(e.doc,[cs.widget(e.selection.head,t,{key:`gapcursor`})])}var c_=200,l_=function(){};l_.prototype.append=function(e){return e.length?(e=l_.from(e),!this.length&&e||e.length<c_&&this.leafAppend(e)||this.length<c_&&e.leafPrepend(this)||this.appendInner(e)):this},l_.prototype.prepend=function(e){return e.length?l_.from(e).append(this):this},l_.prototype.appendInner=function(e){return new d_(this,e)},l_.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?l_.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},l_.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},l_.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},l_.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},l_.from=function(e){return e instanceof l_?e:e&&e.length?new u_(e):l_.empty};var u_=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=c_)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=c_)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(l_);l_.empty=new u_([]);var d_=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(l_),f_=500,p_=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new h_(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new h_(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new h_(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>__&&(s=m_(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new dt;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new h_(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new h_(i,o,l))}else r.push(new h_(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new h_(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>f_&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new h_(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(l_.from(i.reverse()),a)}};p_.empty=new p_(l_.empty,0);function m_(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var h_=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},g_=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},__=20;function v_(e,t,n,r){let i=n.getMeta(E_),a;if(i)return i.historyState;n.getMeta(D_)&&(e=new g_(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(E_))return o.getMeta(E_).redo?new g_(e.done.addTransform(n,void 0,r,T_(t)),e.undone,b_(n.mapping.maps),e.prevTime,e.prevComposition):new g_(e.done,e.undone.addTransform(n,void 0,r,T_(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!y_(n,e.prevRanges)),s=o?x_(e.prevRanges,n.mapping):b_(n.mapping.maps);return new g_(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,T_(t)),p_.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new g_(e.done.rebased(n,a),e.undone.rebased(n,a),x_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new g_(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),x_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function y_(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function b_(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function x_(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function S_(e,t,n){let r=T_(t),i=E_.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new g_(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(E_,{redo:n,historyState:c})}var C_=!1,w_=null;function T_(e){let t=e.plugins;if(w_!=t){C_=!1,w_=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){C_=!0;break}}return C_}var E_=new Ln(`history`),D_=new Ln(`closeHistory`);function O_(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Pn({key:E_,state:{init(){return new g_(p_.empty,p_.empty,null,0,-1)},apply(t,n,r){return v_(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?A_:n==`historyRedo`?j_:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function k_(e,t){return(n,r)=>{let i=E_.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=S_(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var A_=k_(!1,!0),j_=k_(!0,!0);fd.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new Pn({key:new Ln(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var M_=fd.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[Yg(this.options)]}});fd.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new Pn({key:new Ln(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return ds.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(cs.node(t,t+e.nodeSize,{class:this.options.className}))}),ds.create(e,a)}}})]}});var N_=fd.create({name:`gapCursor`,addProseMirrorPlugins(){return[n_()]},extendNodeSchema(e){return{allowGapCursor:Ll(K(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),P_=`placeholder`;function F_(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}var I_=fd.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:P_,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${F_(this.options.dataAttribute)}`:`data-${P_}`;return[new Pn({key:new Ln(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&vu(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=cs.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),ds.create(t,a)}}})]}});fd.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new Pn({key:new Ln(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||yu(n.selection)||e.view.dragging?null:ds.create(n.doc,[cs.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function L_({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var R_=fd.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new Ln(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new Pn({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!L_({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!L_({node:r,types:n})}}})]}}),z_=fd.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>A_(e,t),redo:()=>({state:e,dispatch:t})=>j_(e,t)}},addProseMirrorPlugins(){return[O_(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),B_=fd.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(Np.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(Op.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(gg.configure(this.options.bulletList)),this.options.code!==!1&&e.push(Ip.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(Bp.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(Vp.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(M_.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(N_.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(Hp.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Up.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(z_.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(Wp.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(Yp.configure(this.options.italic)),this.options.listItem!==!1&&e.push(_g.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Og.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(ug.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(Lg.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(Ug.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(Kg.configure(this.options.strike)),this.options.text!==!1&&e.push(qg.configure(this.options.text)),this.options.underline!==!1&&e.push(Jg.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(R_.configure(this.options?.trailingNode)),e}}),V_,H_;if(typeof WeakMap<`u`){let e=new WeakMap;V_=t=>e.get(t),H_=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;V_=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},H_=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var U_=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return V_(e)||H_(e,W_(e))}};function W_(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=G_(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new U_(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&K_(s,o,e),s}function G_(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function K_(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=q_(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function q_(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function J_(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var Y_=new Ln(`selectingCells`);function X_(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function Z_(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function Q_(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function $_(e){let t=e.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;let n=X_(t.$head)||ev(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function ev(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function tv(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function nv(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function rv(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function iv(e,t,n){let r=e.node(-1),i=U_.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function av(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function ov(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function sv(e,t,n){let r=J_(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var cv=class e extends U{constructor(e,t=e){let n=e.node(-1),r=U_.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new hn(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(tv(r)&&tv(i)&&rv(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return W.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=U_.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=av(e,0,l)),u>0&&(e=av(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(S.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new O(S.from(o),1,1)}replace(e,t=O.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?O.empty:t)}let i=U.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new O(S.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=U_.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=U_.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=U_.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=U_.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new lv(this.$anchorCell.pos,this.$headCell.pos)}};cv.prototype.visible=!1,U.jsonID(`cell`,cv);var lv=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&rv(t,n)?new cv(t,n):U.near(n,1)}};function uv(e){if(!(e.selection instanceof cv))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(cs.node(n,n+e.nodeSize,{class:`selectedCell`}))}),ds.create(e.doc,t)}function dv({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function fv({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function pv(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof G&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=cv.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=cv.rowSelection(e,e)}else if(!n){let e=U_.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=cv.create(i,t+1,n)}}else r instanceof W&&dv(r)?a=W.create(i,r.from):r instanceof W&&fv(r)&&(a=W.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var mv=new Ln(`fix-tables`);function hv(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?hv(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function gv(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=_v(e,t,r,n))};return t?t.doc!=e.doc&&hv(t.doc,e.doc,0,r):e.doc.descendants(r),n}function _v(e,t,n,r){let i=U_.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,av(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=J_(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(mv,{fixTables:!0})}function vv(e){let t=e.selection,n=$_(e),r=n.node(-1),i=n.start(-1),a=U_.get(r);return{...t instanceof cv?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function yv(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;sv(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,ov(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?J_(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function bv(e,t){if(!Q_(e))return!1;if(t){let n=vv(e);t(yv(e.tr,n,n.left))}return!0}function xv(e,t){if(!Q_(e))return!1;if(t){let n=vv(e);t(yv(e.tr,n,n.right))}return!0}function Sv(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,av(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function Cv(e,t){if(!Q_(e))return!1;if(t){let n=vv(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;Sv(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=U_.get(e)}t(r)}return!0}function wv(e,t,n){let r=J_(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function Tv(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;wv(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?J_(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,J_(r.type.schema).row.create(null,o)),e}function Ev(e,t){if(!Q_(e))return!1;if(t){let n=vv(e);t(Tv(e.tr,n,n.top))}return!0}function Dv(e,t){if(!Q_(e))return!1;if(t){let n=vv(e);t(Tv(e.tr,n,n.bottom))}return!0}function Ov(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function kv(e,t){if(!Q_(e))return!1;if(t){let n=vv(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;Ov(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=U_.get(n.table)}t(r)}return!0}function Av(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function jv({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function Mv(e,t){let n=e.selection;if(!(n instanceof cv)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=vv(e),{map:i}=r;if(jv(i,r))return!1;if(t){let n=e.tr,a={},o=S.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{Av(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...ov(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=Av(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new cv(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function Nv(e,t){let n=J_(e.schema);return Pv(({node:e})=>n[e.type.spec.tableRole])(e,t)}function Pv(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof cv){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=Z_(r.$from),!i)return!1;a=X_(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=vv(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof cv&&u.setSelection(new cv(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function Fv(e,t){return function(n,r){if(!Q_(n))return!1;let i=$_(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof cv?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function Iv(e){return function(t,n){if(!Q_(t))return!1;if(n){let r=J_(t.schema),i=vv(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function Lv(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function Rv(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?Iv(e):function(t,n){if(!Q_(t))return!1;if(n){let r=J_(t.schema),i=vv(t),a=t.tr,o=Lv(`row`,i,r),s=Lv(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}Rv(`row`,{useDeprecatedLogic:!0}),Rv(`column`,{useDeprecatedLogic:!0});var zv=Rv(`cell`,{useDeprecatedLogic:!0});function Bv(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function Vv(e){return function(t,n){if(!Q_(t))return!1;let r=Bv($_(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(W.between(e,nv(e))).scrollIntoView())}return!0}}function Hv(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Uv(e,t){let n=e.selection;if(!(n instanceof cv))return!1;if(t){let r=e.tr,i=J_(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new O(i,0,0))}),r.docChanged&&t(r)}return!0}function Wv(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=Kv(J_(o).row,new O(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?Kv(J_(o).row,new O(t,n,r)).content:t);else return null;return Gv(o,s)}function Gv(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(S.empty),n[i]<r){let a=J_(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(S.from(o))}return{height:t.length,width:r,rows:t}}function Kv(e,t){let n=e.createAndFill();return new pn(n).replace(0,n.content.size,t).doc}function qv({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(av(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(S.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(S.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function Jv(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=J_(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,S.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function Yv(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function Xv(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,av(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(av(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function Zv(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=U_.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=U_.get(a),f=d.mapping.maps.length}Jv(d,o,a,n,l,u,f)&&p(),Yv(d,o,a,n,c,l,s,f)&&p(),Yv(d,o,a,n,c,l,u,f)&&p(),Xv(d,o,a,n,s,u,c,f)&&p(),Xv(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new O(i.rows[e-s],0,0))}p(),d.setSelection(new cv(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var Qv=fc({ArrowLeft:ey(`horiz`,-1),ArrowRight:ey(`horiz`,1),ArrowUp:ey(`vert`,-1),ArrowDown:ey(`vert`,1),"Shift-ArrowLeft":ty(`horiz`,-1),"Shift-ArrowRight":ty(`horiz`,1),"Shift-ArrowUp":ty(`vert`,-1),"Shift-ArrowDown":ty(`vert`,1),Backspace:Uv,"Mod-Backspace":Uv,Delete:Uv,"Mod-Delete":Uv});function $v(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function ey(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof cv)return $v(n,r,U.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=ay(i,e,t);if(o==null)return!1;if(e==`horiz`)return $v(n,r,U.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=iv(i,e,t),s;return s=a?U.near(a,1):t<0?U.near(n.doc.resolve(i.before(-1)),-1):U.near(n.doc.resolve(i.after(-1)),1),$v(n,r,s)}}}function ty(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof cv)o=a;else{let r=ay(i,e,t);if(r==null)return!1;o=new cv(n.doc.resolve(r))}let s=iv(o.$headCell,e,t);return s?$v(n,r,new cv(o.$anchorCell,s)):!1}}function ny(e,t){let n=e.state.doc,r=X_(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new cv(r))),!0):!1}function ry(e,t,n){if(!Q_(e.state))return!1;let r=Wv(n),i=e.state.selection;if(i instanceof cv){r||={width:1,height:1,rows:[S.from(Kv(J_(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=U_.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=qv(r,o.right-o.left,o.bottom-o.top),Zv(e.state,e.dispatch,a,o,r),!0}else if(r){let t=$_(e.state),n=t.start(-1);return Zv(e.state,e.dispatch,n,U_.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function iy(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=oy(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof cv)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=X_(e.state.selection.$anchor))!=null&&sy(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=sy(e,n),i=Y_.getState(e.state)==null;if(!r||!rv(t,r))if(i)r=t;else return;let a=new cv(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(Y_,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),Y_.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(Y_,-1))}function o(r){let o=r,s=Y_.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(oy(e,o.target)!=n&&(c=sy(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function ay(e,t,n){if(!(e.state.selection instanceof W))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function oy(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function sy(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&X_(e.state.doc.resolve(r))||X_(e.state.doc.resolve(i))}var cy=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,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`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),ly(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,ly(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function ly(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var uy=new Ln(`tableColumnResizing`);function dy({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=cy,lastColumnResizable:i=!0}={}){let a=new Pn({key:uy,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=J_(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new fy(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=uy.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{py(t,n,e,i)},mouseleave:e=>{my(e)},mousedown:(e,r)=>{hy(e,r,t,n)}},decorations:e=>{let t=uy.getState(e);if(t&&t.activeHandle>-1)return wy(e,t.activeHandle)},nodeViews:{}}});return a}var fy=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(uy);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return tv(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function py(e,t,n,r){if(!e.editable)return;let i=uy.getState(e.state);if(i&&!i.dragging){let a=_y(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=vy(e,t,`left`,n):i-t.clientX<=n&&(o=vy(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=U_.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}by(e,o)}}}function my(e){if(!e.editable)return;let t=uy.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&by(e,-1)}function hy(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=uy.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=gy(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(uy,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=uy.getState(e.state);r?.dragging&&(xy(e,r.activeHandle,yy(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(uy,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=uy.getState(e.state);if(i&&i.dragging){let a=yy(i.dragging,t,n);Sy(e,i.activeHandle,a,r)}}return Sy(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function gy(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function _y(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function vy(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=X_(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=U_.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function yy(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function by(e,t){e.dispatch(e.state.tr.setMeta(uy,{setHandle:t}))}function xy(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=U_.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():Cy(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function Sy(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=U_.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&ly(a,c.firstChild,c,r,s,n)}function Cy(e){return Array(e).fill(0)}function wy(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return ds.empty;let a=U_.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,uy.getState(e)?.dragging&&n.push(cs.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(cs.widget(s,c))}}return ds.create(e.doc,n)}function Ty({allowTableNodeSelection:e=!1}={}){return new Pn({key:Y_,state:{init(){return null},apply(e,t){let n=e.getMeta(Y_);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:uv,handleDOMEvents:{mousedown:iy},createSelectionBetween(e){return Y_.getState(e.state)==null?null:e.state.selection},handleTripleClick:ny,handleKeyDown:Qv,handlePaste:ry},appendTransaction(t,n,r){return pv(r,gv(r,n),e)}})}var Ey=Wd.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`),n=t?t.split(`,`).map(e=>parseInt(e,10)):null;if(!n){let t=e.closest(`table`)?.querySelectorAll(`colgroup > col`),n=Array.from(e.parentElement?.children||[]).indexOf(e);if(n&&n>-1&&t&&t[n]){let e=t[n].getAttribute(`width`);return e?[parseInt(e,10)]:null}}return n}}}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,Ul(this.options.HTMLAttributes,e),0]}}),Dy=Wd.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}}}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,Ul(this.options.HTMLAttributes,e),0]}}),Oy=Wd.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,Ul(this.options.HTMLAttributes,e),0]}});function ky(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function Ay(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=ky(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=ky(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);c&&!d?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}var jy=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),Ay(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type===this.node.type?(this.node=e,Ay(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}};function My(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=ky(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function Ny(e,t){return t?e.createChecked(null,t):e.createAndFill()}function Py(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function Fy(e,t,n,r,i){let a=Py(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=Ny(a.cell,i);if(e&&s.push(e),r){let e=Ny(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function Iy(e){return e instanceof cv}var Ly=({editor:e})=>{let{selection:t}=e.state;if(!Iy(t))return!1;let n=0;return Ml(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1};function Ry(e){return(e||``).replace(/\s+/g,` `).trim()}function zy(e,t,n={}){let r=n.cellLineSeparator??``;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=Ry(i),o=e.type===`tableHeader`;n.push({text:a,isHeader:o})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array(a).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=`
|
|
143
|
+
`,d=Array(a).fill(0).map((e,t)=>l&&c[t]&&c[t].text||``);return u+=`| ${d.map((e,t)=>s(e,o[t])).join(` | `)} |
|
|
144
|
+
`,u+=`| ${o.map(e=>`-`.repeat(Math.max(3,e))).join(` | `)} |
|
|
145
|
+
`,(l?i.slice(1):i).forEach(e=>{u+=`| ${Array(a).fill(0).map((t,n)=>s(e[n]&&e[n].text||``,o[n])).join(` | `)} |
|
|
146
|
+
`}),u}var By=zy,Vy=Wd.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:jy,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=My(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,Ul(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[];if(e.header){let r=[];e.header.forEach(e=>{r.push(t.createNode(`tableHeader`,{},[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},r))}return e.rows&&e.rows.forEach(e=>{let r=[];e.forEach(e=>{r.push(t.createNode(`tableCell`,{},[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},r))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>By(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=Fy(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(W.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>bv(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>xv(e,t),deleteColumn:()=>({state:e,dispatch:t})=>Cv(e,t),addRowBefore:()=>({state:e,dispatch:t})=>Ev(e,t),addRowAfter:()=>({state:e,dispatch:t})=>Dv(e,t),deleteRow:()=>({state:e,dispatch:t})=>kv(e,t),deleteTable:()=>({state:e,dispatch:t})=>Hv(e,t),mergeCells:()=>({state:e,dispatch:t})=>Mv(e,t),splitCell:()=>({state:e,dispatch:t})=>Nv(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>Rv(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>Rv(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>zv(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>Mv(e,t)?!0:Nv(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>Fv(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>Vv(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>Vv(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&gv(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=cv.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}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:Ly,"Mod-Backspace":Ly,Delete:Ly,"Mod-Delete":Ly}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[dy({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Ty({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){return{tableRole:Ll(K(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}});fd.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(Vy.configure(this.options.table)),this.options.tableCell!==!1&&e.push(Ey.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(Dy.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(Oy.configure(this.options.tableRow)),e}});var Hy=fd.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:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(e=>e):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,`textAlign`)).some(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!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`)}}}),Uy=20,Wy=(e,t=0)=>{let n=[];return!e.children.length||t>Uy||Array.from(e.children).forEach(e=>{e.tagName===`SPAN`?n.push(e):e.children.length&&n.push(...Wy(e,t+1))}),n},Gy=e=>{if(!e.children.length)return;let t=Wy(e);t&&t.forEach(e=>{let t=e.getAttribute(`style`),n=(e.parentElement?.closest(`span`))?.getAttribute(`style`);e.setAttribute(`style`,`${n};${t}`)})},Ky=rd.create({name:`textStyle`,priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:`span`,consuming:!1,getAttrs:e=>e.hasAttribute(`style`)?(this.options.mergeNestedSpanStyles&&Gy(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return[`span`,Ul(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{let{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(e=>e.type===this.type).some(e=>Object.values(e.attrs).some(e=>!!e))||e.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),qy=fd.create({name:`backgroundColor`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>{let t=e.getAttribute(`style`);if(t){let e=t.split(`;`).map(e=>e.trim()).filter(Boolean);for(let t=e.length-1;t>=0;--t){let n=e[t].split(`:`);if(n.length>=2){let e=n[0].trim().toLowerCase(),t=n.slice(1).join(`:`).trim();if(e===`background-color`)return t.replace(/['"]+/g,``)}}}return e.style.backgroundColor?.replace(/['"]+/g,``)},renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:e=>({chain:t})=>t().setMark(`textStyle`,{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark(`textStyle`,{backgroundColor:null}).removeEmptyTextStyle().run()}}}),Jy=fd.create({name:`color`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{let t=e.getAttribute(`style`);if(t){let e=t.split(`;`).map(e=>e.trim()).filter(Boolean);for(let t=e.length-1;t>=0;--t){let n=e[t].split(`:`);if(n.length>=2){let e=n[0].trim().toLowerCase(),t=n.slice(1).join(`:`).trim();if(e===`color`)return t.replace(/['"]+/g,``)}}}return e.style.color?.replace(/['"]+/g,``)},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark(`textStyle`,{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark(`textStyle`,{color:null}).removeEmptyTextStyle().run()}}}),Yy=fd.create({name:`fontFamily`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>e.style.fontFamily,renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:e=>({chain:t})=>t().setMark(`textStyle`,{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark(`textStyle`,{fontFamily:null}).removeEmptyTextStyle().run()}}}),Xy=fd.create({name:`fontSize`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>e.style.fontSize,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:e=>({chain:t})=>t().setMark(`textStyle`,{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark(`textStyle`,{fontSize:null}).removeEmptyTextStyle().run()}}}),Zy=fd.create({name:`lineHeight`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight,renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:e=>({chain:t})=>t().setMark(`textStyle`,{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark(`textStyle`,{lineHeight:null}).removeEmptyTextStyle().run()}}});fd.create({name:`textStyleKit`,addExtensions(){let e=[];return this.options.backgroundColor!==!1&&e.push(qy.configure(this.options.backgroundColor)),this.options.color!==!1&&e.push(Jy.configure(this.options.color)),this.options.fontFamily!==!1&&e.push(Yy.configure(this.options.fontFamily)),this.options.fontSize!==!1&&e.push(Xy.configure(this.options.fontSize)),this.options.lineHeight!==!1&&e.push(Zy.configure(this.options.lineHeight)),this.options.textStyle!==!1&&e.push(Ky.configure(this.options.textStyle)),e}});var Qy=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,$y=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,eb=rd.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,Ul(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Od({find:Qy,type:this.type})]},addPasteRules(){return[Kd({find:$y,type:this.type})]}}),tb=e=>jd({find:/--$/,replace:e??`—`}),nb=e=>jd({find:/\.\.\.$/,replace:e??`…`}),rb=e=>jd({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:e??`“`}),ib=e=>jd({find:/"$/,replace:e??`”`}),ab=e=>jd({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:e??`‘`}),ob=e=>jd({find:/'$/,replace:e??`’`}),sb=e=>jd({find:/<-$/,replace:e??`←`}),cb=e=>jd({find:/->$/,replace:e??`→`}),lb=e=>jd({find:/\(c\)$/,replace:e??`©`}),ub=e=>jd({find:/\(tm\)$/,replace:e??`™`}),db=e=>jd({find:/\(sm\)$/,replace:e??`℠`}),fb=e=>jd({find:/\(r\)$/,replace:e??`®`}),pb=e=>jd({find:/(?:^|\s)(1\/2)\s$/,replace:e??`½`}),mb=e=>jd({find:/\+\/-$/,replace:e??`±`}),hb=e=>jd({find:/!=$/,replace:e??`≠`}),gb=e=>jd({find:/<<$/,replace:e??`«`}),_b=e=>jd({find:/>>$/,replace:e??`»`}),vb=e=>jd({find:/\d+\s?([*x])\s?\d+$/,replace:e??`×`}),yb=e=>jd({find:/\^2$/,replace:e??`²`}),bb=e=>jd({find:/\^3$/,replace:e??`³`}),xb=e=>jd({find:/(?:^|\s)(1\/4)\s$/,replace:e??`¼`}),Sb=e=>jd({find:/(?:^|\s)(3\/4)\s$/,replace:e??`¾`}),Cb=fd.create({name:`typography`,addOptions(){return{closeDoubleQuote:`”`,closeSingleQuote:`’`,copyright:`©`,ellipsis:`…`,emDash:`—`,laquo:`«`,leftArrow:`←`,multiplication:`×`,notEqual:`≠`,oneHalf:`½`,oneQuarter:`¼`,openDoubleQuote:`“`,openSingleQuote:`‘`,plusMinus:`±`,raquo:`»`,registeredTrademark:`®`,rightArrow:`→`,servicemark:`℠`,superscriptThree:`³`,superscriptTwo:`²`,threeQuarters:`¾`,trademark:`™`}},addInputRules(){let e=[];return this.options.emDash!==!1&&e.push(tb(this.options.emDash)),this.options.ellipsis!==!1&&e.push(nb(this.options.ellipsis)),this.options.openDoubleQuote!==!1&&e.push(rb(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&e.push(ib(this.options.closeDoubleQuote)),this.options.openSingleQuote!==!1&&e.push(ab(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&e.push(ob(this.options.closeSingleQuote)),this.options.leftArrow!==!1&&e.push(sb(this.options.leftArrow)),this.options.rightArrow!==!1&&e.push(cb(this.options.rightArrow)),this.options.copyright!==!1&&e.push(lb(this.options.copyright)),this.options.trademark!==!1&&e.push(ub(this.options.trademark)),this.options.servicemark!==!1&&e.push(db(this.options.servicemark)),this.options.registeredTrademark!==!1&&e.push(fb(this.options.registeredTrademark)),this.options.oneHalf!==!1&&e.push(pb(this.options.oneHalf)),this.options.plusMinus!==!1&&e.push(mb(this.options.plusMinus)),this.options.notEqual!==!1&&e.push(hb(this.options.notEqual)),this.options.laquo!==!1&&e.push(gb(this.options.laquo)),this.options.raquo!==!1&&e.push(_b(this.options.raquo)),this.options.multiplication!==!1&&e.push(vb(this.options.multiplication)),this.options.superscriptTwo!==!1&&e.push(yb(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&e.push(bb(this.options.superscriptThree)),this.options.oneQuarter!==!1&&e.push(xb(this.options.oneQuarter)),this.options.threeQuarters!==!1&&e.push(Sb(this.options.threeQuarters)),e}}),wb=rd.create({name:`subscript`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`sub`},{style:`vertical-align`,getAttrs(e){return e===`sub`?null:!1}}]},renderHTML({HTMLAttributes:e}){return[`sub`,Ul(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),Tb=rd.create({name:`superscript`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`sup`},{style:`vertical-align`,getAttrs(e){return e===`super`?null:!1}}]},renderHTML({HTMLAttributes:e}){return[`sup`,Ul(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),Eb=Wd.create({name:`pageBreak`,group:`block`,atom:!0,selectable:!0,draggable:!1,parseHTML(){return[{tag:`div[data-page-break]`},{tag:`hr.page-break`}]},renderHTML({HTMLAttributes:e}){return[`div`,Ul(e,{"data-page-break":``,class:`page-break`})]},addCommands(){return{insertPageBreak:()=>({commands:e})=>e.insertContent({type:this.name})}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.insertPageBreak()}}});function Db(){return typeof window<`u`}function Ob(e){return jb(e)?(e.nodeName||``).toLowerCase():`#document`}function kb(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ab(e){return((jb(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function jb(e){return Db()?e instanceof Node||e instanceof kb(e).Node:!1}function Mb(e){return Db()?e instanceof Element||e instanceof kb(e).Element:!1}function Nb(e){return Db()?e instanceof HTMLElement||e instanceof kb(e).HTMLElement:!1}function Pb(e){return!Db()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof kb(e).ShadowRoot}function Fb(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Kb(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ib(e){return/^(table|td|th)$/.test(Ob(e))}function Lb(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Rb=/transform|translate|scale|rotate|perspective|filter/,zb=/paint|layout|strict|content/,Bb=e=>!!e&&e!==`none`,Vb;function Hb(e){let t=Mb(e)?Kb(e):e;return Bb(t.transform)||Bb(t.translate)||Bb(t.scale)||Bb(t.rotate)||Bb(t.perspective)||!Wb()&&(Bb(t.backdropFilter)||Bb(t.filter))||Rb.test(t.willChange||``)||zb.test(t.contain||``)}function Ub(e){let t=Jb(e);for(;Nb(t)&&!Gb(t);){if(Hb(t))return t;if(Lb(t))return null;t=Jb(t)}return null}function Wb(){return Vb??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Vb}function Gb(e){return/^(html|body|#document)$/.test(Ob(e))}function Kb(e){return kb(e).getComputedStyle(e)}function qb(e){return Mb(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jb(e){if(Ob(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Pb(e)&&e.host||Ab(e);return Pb(t)?t.host:t}function Yb(e){let t=Jb(e);return Gb(t)?e.ownerDocument?e.ownerDocument.body:e.body:Nb(t)&&Fb(t)?t:Yb(t)}function Xb(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Yb(e),i=r===e.ownerDocument?.body,a=kb(r);if(i){let e=Zb(a);return t.concat(a,a.visualViewport||[],Fb(r)?r:[],e&&n?Xb(e):[])}else return t.concat(r,Xb(r,[],n))}function Zb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Qb={};function $b(e,t){let n=f.useRef(Qb);return n.current===Qb&&(n.current=e(t)),n}var ex=f[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],tx=ex&&ex!==f.useLayoutEffect?ex:e=>e();function J(e){let t=$b(nx).current;return t.next=e,tx(t.effect),t.trampoline}function nx(){let e={next:void 0,callback:rx,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function rx(){if(process.env.NODE_ENV!==`production`)throw Error(`Base UI: Cannot call an event handler while rendering.`)}var ix;process.env.NODE_ENV!==`production`&&(ix=new Set);function ax(...e){if(process.env.NODE_ENV!==`production`){let t=e.join(` `);ix.has(t)||(ix.add(t),console.error(`Base UI: ${t}`))}}var ox={...f},Y=typeof document<`u`?f.useLayoutEffect:()=>{};function sx(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var cx={};function lx(e,t,n,r,i){let a={...hx(e,cx)};return t&&(a=dx(a,t)),n&&(a=dx(a,n)),r&&(a=dx(a,r)),i&&(a=dx(a,i)),a}function ux(e){if(e.length===0)return cx;if(e.length===1)return hx(e[0],cx);let t={...hx(e[0],cx)};for(let n=1;n<e.length;n+=1)t=dx(t,e[n]);return t}function dx(e,t){return mx(t)?t(e):fx(e,t)}function fx(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=sx(e.style,r);break;case`className`:e[n]=vx(e.className,r);break;default:px(n,r)?e[n]=gx(e[n],r):e[n]=r}}return e}function px(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function mx(e){return typeof e==`function`}function hx(e,t){return mx(e)?e(t):e??cx}function gx(e,t){return t?e?n=>{if(yx(n)){let r=n;_x(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function _x(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function vx(e,t){return t?e?t+` `+e:t:e}function yx(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function bx(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var xx=bx(`https://base-ui.com/production-error`,`Base UI`),Sx=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(Sx.displayName=`CompositeRootContext`);function Cx(e=!1){let t=f.useContext(Sx);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?xx(16):`Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.`);return t}function wx(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:f.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Tx(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=f.useRef(null),s=Cx(!0),c=a??s!==void 0,{props:l}=wx({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i});process.env.NODE_ENV!==`production`&&f.useEffect(()=>{if(!o.current)return;let e=Ex(o.current);i?e||ax(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${ox.captureOwnerStack?.()||``}`):e&&ax(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${ox.captureOwnerStack?.()||``}`)},[i]);let u=f.useCallback(()=>{let e=o.current;Ex(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Y(u,[u]),{getButtonProps:f.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return lx({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(_x(e),o?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,a=e.currentTarget,s=Ex(a),l=!i&&Dx(a),u=r&&(i?s:!l),d=e.key===`Enter`,f=e.key===` `,p=a.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(r&&c&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),l||i&&s?(a.click(),e.preventBaseUIHandler()):u&&(n?.(e),e.preventBaseUIHandler());return}u&&(!i&&(f||d)&&e.preventDefault(),!i&&d&&n?.(e))},onKeyUp(e){if(!t){if(_x(e),a?.(e),e.target===e.currentTarget&&i&&c&&Ex(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&e.key===` `&&n?.(e)}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?void 0:{role:`button`},l,u)},[t,l,c,i]),buttonRef:J(e=>{o.current=e,u()})}}function Ex(e){return Nb(e)&&e.tagName===`BUTTON`}function Dx(e){return!!(e?.tagName===`A`&&e?.href)}function Ox(e,t,n,r){let i=$b(Ax).current;return jx(i,e,t,n,r)&&Nx(i,[e,t,n,r]),i.callback}function kx(e){let t=$b(Ax).current;return Mx(t,e)&&Nx(t,e),t.callback}function Ax(){return{callback:null,cleanup:null,refs:[]}}function jx(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Mx(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Nx(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var Px=parseInt(f.version,10);function Fx(e){return Px>=e}function Ix(e){if(!f.isValidElement(e))return null;let t=e,n=t.props;return(Fx(19)?n?.ref:t.ref)??null}var Lx;process.env.NODE_ENV!==`production`&&(Lx=new Set);function Rx(...e){if(process.env.NODE_ENV!==`production`){let t=e.join(` `);Lx.has(t)||(Lx.add(t),console.warn(`Base UI: ${t}`))}}function zx(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Bx(e,t){return typeof e==`function`?e(t):e}function Vx(e,t){return typeof e==`function`?e(t):e}function Hx(){}var Ux=Object.freeze([]),Wx=Object.freeze({}),Gx={style:{transition:`none`}},Kx=`data-base-ui-click-trigger`,qx={fallbackAxisSide:`none`},Jx={fallbackAxisSide:`end`},Yx={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function Xx(e,t,n={}){let r=t.render,i=Zx(t,n);return n.enabled===!1?null:$x(e,r,i,n.state??Wx)}function Zx(e,t={}){let{className:n,style:r,render:i}=e,{state:a=Wx,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Bx(n,a):void 0,d=l?Vx(r,a):void 0,f=l?zx(a,c):Wx,p=l?sx(f,Array.isArray(s)?ux(s):s)??Wx:Wx;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=kx([p.ref,Ix(i),...o]):p.ref=Ox(p.ref,Ix(i),o):Ox(null,null)),l?(u!==void 0&&(p.className=vx(p.className,u)),d!==void 0&&(p.style=sx(p.style,d)),p):Wx}var Qx=Symbol.for(`react.lazy`);function $x(e,t,n,r){if(t){if(typeof t==`function`)return process.env.NODE_ENV!==`production`&&eS(t),t(n,r);let e=lx(n,t.props);e.ref=n.ref;let i=t;if(i?.$$typeof===Qx&&(i=f.Children.toArray(t)[0]),process.env.NODE_ENV!==`production`&&!f.isValidElement(i))throw Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.",`https://base-ui.com/r/invalid-render-prop`].join(`
|
|
147
|
+
`));return f.cloneElement(i,e)}if(e&&typeof e==`string`)return tS(e,n);throw Error(process.env.NODE_ENV===`production`?xx(8):`Base UI: Render element or function are not defined.`)}function eS(e){let t=e.name;if(t.length===0)return;let n=t.charCodeAt(0);n<65||n>90||Rx(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`,"This usually means a React component was passed directly as `render={Component}`.","Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.",`If this is an intentional render callback, rename it to start with a lowercase letter.`,"Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.",`https://base-ui.com/r/invalid-render-prop`)}function tS(e,t){return e===`button`?(0,f.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,f.createElement)(`img`,{alt:``,...t,key:t.key}):f.createElement(e,t)}var nS=f.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,...s}=e,{getButtonProps:c,buttonRef:l}=Tx({disabled:i,focusableWhenDisabled:a,native:o});return Xx(`button`,e,{state:{disabled:i},ref:[t,l],props:[s,c]})});process.env.NODE_ENV!==`production`&&(nS.displayName=`Button`);function rS(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=rS(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function iS(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=rS(e))&&(r&&(r+=` `),r+=t);return r}var aS=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,oS=iS,sS=(e,t)=>n=>{if(t?.variants==null)return oS(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=aS(t)||aS(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return oS(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},cS=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},lS=(e,t)=>({classGroupId:e,validator:t}),uS=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),dS=`-`,fS=[],pS=`arbitrary..`,mS=e=>{let t=_S(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return gS(e);let n=e.split(dS);return hS(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?cS(i,t):t:i||fS}return n[e]||fS}}},hS=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=hS(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(dS):e.slice(t).join(dS),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},gS=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?pS+r:void 0})(),_S=e=>{let{theme:t,classGroups:n}=e;return vS(n,t)},vS=(e,t)=>{let n=uS();for(let r in e){let i=e[r];yS(i,n,r,t)}return n},yS=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];bS(i,t,n,r)}},bS=(e,t,n,r)=>{if(typeof e==`string`){xS(e,t,n);return}if(typeof e==`function`){SS(e,t,n,r);return}CS(e,t,n,r)},xS=(e,t,n)=>{let r=e===``?t:wS(t,e);r.classGroupId=n},SS=(e,t,n,r)=>{if(TS(e)){yS(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(lS(n,e))},CS=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];yS(o,wS(t,a),n,r)}},wS=(e,t)=>{let n=e,r=t.split(dS),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=uS(),n.nextPart.set(t,i)),n=i}return n},TS=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ES=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},DS=`!`,OS=`:`,kS=[],AS=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),jS=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===OS){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(DS)?(c=s.slice(0,-1),l=!0):s.startsWith(DS)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return AS(t,l,c,u)};if(t){let e=t+OS,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):AS(kS,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},MS=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},NS=e=>({cache:ES(e.cacheSize),parseClassName:jS(e),sortModifiers:MS(e),...mS(e)}),PS=/\s+/,FS=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(PS),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+DS:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},IS=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=LS(n))&&(i&&(i+=` `),i+=r);return i},LS=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=LS(e[r]))&&(n&&(n+=` `),n+=t);return n},RS=(e,...t)=>{let n,r,i,a,o=o=>(n=NS(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=FS(e,n);return i(e,a),a};return a=o,(...e)=>a(IS(...e))},zS=[],BS=e=>{let t=t=>t[e]||zS;return t.isThemeGetter=!0,t},VS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,HS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,US=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,WS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,GS=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,KS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,JS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,YS=e=>US.test(e),XS=e=>!!e&&!Number.isNaN(Number(e)),ZS=e=>!!e&&Number.isInteger(Number(e)),QS=e=>e.endsWith(`%`)&&XS(e.slice(0,-1)),$S=e=>WS.test(e),eC=()=>!0,tC=e=>GS.test(e)&&!KS.test(e),nC=()=>!1,rC=e=>qS.test(e),iC=e=>JS.test(e),aC=e=>!X(e)&&!Z(e),oC=e=>xC(e,TC,nC),X=e=>VS.test(e),sC=e=>xC(e,EC,tC),cC=e=>xC(e,DC,XS),lC=e=>xC(e,kC,eC),uC=e=>xC(e,OC,nC),dC=e=>xC(e,CC,nC),fC=e=>xC(e,wC,iC),pC=e=>xC(e,AC,rC),Z=e=>HS.test(e),mC=e=>SC(e,EC),hC=e=>SC(e,OC),gC=e=>SC(e,CC),_C=e=>SC(e,TC),vC=e=>SC(e,wC),yC=e=>SC(e,AC,!0),bC=e=>SC(e,kC,!0),xC=(e,t,n)=>{let r=VS.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},SC=(e,t,n=!1)=>{let r=HS.exec(e);return r?r[1]?t(r[1]):n:!1},CC=e=>e===`position`||e===`percentage`,wC=e=>e===`image`||e===`url`,TC=e=>e===`length`||e===`size`||e===`bg-size`,EC=e=>e===`length`,DC=e=>e===`number`,OC=e=>e===`family-name`,kC=e=>e===`number`||e===`weight`,AC=e=>e===`shadow`,jC=RS(()=>{let e=BS(`color`),t=BS(`font`),n=BS(`text`),r=BS(`font-weight`),i=BS(`tracking`),a=BS(`leading`),o=BS(`breakpoint`),s=BS(`container`),c=BS(`spacing`),l=BS(`radius`),u=BS(`shadow`),d=BS(`inset-shadow`),f=BS(`text-shadow`),p=BS(`drop-shadow`),m=BS(`blur`),h=BS(`perspective`),g=BS(`aspect`),_=BS(`ease`),v=BS(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Z,X],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Z,X,c],T=()=>[YS,`full`,`auto`,...w()],E=()=>[ZS,`none`,`subgrid`,Z,X],D=()=>[`auto`,{span:[`full`,ZS,Z,X]},ZS,Z,X],O=()=>[ZS,`auto`,Z,X],k=()=>[`auto`,`min`,`max`,`fr`,Z,X],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[YS,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[YS,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[YS,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,Z,X],L=()=>[...b(),gC,dC,{position:[Z,X]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,_C,oC,{size:[Z,X]}],B=()=>[QS,mC,sC],ee=()=>[``,`none`,`full`,l,Z,X],te=()=>[``,XS,mC,sC],ne=()=>[`solid`,`dashed`,`dotted`,`double`],re=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ie=()=>[XS,QS,gC,dC],V=()=>[``,`none`,m,Z,X],H=()=>[`none`,XS,Z,X],ae=()=>[`none`,XS,Z,X],oe=()=>[XS,Z,X],se=()=>[YS,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[$S],breakpoint:[$S],color:[eC],container:[$S],"drop-shadow":[$S],ease:[`in`,`out`,`in-out`],font:[aC],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[$S],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[$S],shadow:[$S],spacing:[`px`,XS],text:[$S],"text-shadow":[$S],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,YS,X,Z,g]}],container:[`container`],columns:[{columns:[XS,X,Z,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[ZS,`auto`,Z,X]}],basis:[{basis:[YS,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[XS,YS,`auto`,`initial`,`none`,X]}],grow:[{grow:[``,XS,Z,X]}],shrink:[{shrink:[``,XS,Z,X]}],order:[{order:[ZS,`first`,`last`,`none`,Z,X]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,mC,sC]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,bC,lC]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,QS,X]}],"font-family":[{font:[hC,uC,t]}],"font-features":[{"font-features":[X]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Z,X]}],"line-clamp":[{"line-clamp":[XS,`none`,Z,cC]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Z,X]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Z,X]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ne(),`wavy`]}],"text-decoration-thickness":[{decoration:[XS,`from-font`,`auto`,Z,sC]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[XS,`auto`,Z,X]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Z,X]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Z,X]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},ZS,Z,X],radial:[``,Z,X],conic:[ZS,Z,X]},vC,fC]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":te()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ne(),`hidden`,`none`]}],"divide-style":[{divide:[...ne(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...ne(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[XS,Z,X]}],"outline-w":[{outline:[``,XS,mC,sC]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,yC,pC]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,yC,pC]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:te()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[XS,sC]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,yC,pC]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[XS,Z,X]}],"mix-blend":[{"mix-blend":[...re(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":re()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[XS]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Z,X]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[XS]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Z,X]}],filter:[{filter:[``,`none`,Z,X]}],blur:[{blur:V()}],brightness:[{brightness:[XS,Z,X]}],contrast:[{contrast:[XS,Z,X]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,yC,pC]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,XS,Z,X]}],"hue-rotate":[{"hue-rotate":[XS,Z,X]}],invert:[{invert:[``,XS,Z,X]}],saturate:[{saturate:[XS,Z,X]}],sepia:[{sepia:[``,XS,Z,X]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Z,X]}],"backdrop-blur":[{"backdrop-blur":V()}],"backdrop-brightness":[{"backdrop-brightness":[XS,Z,X]}],"backdrop-contrast":[{"backdrop-contrast":[XS,Z,X]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,XS,Z,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[XS,Z,X]}],"backdrop-invert":[{"backdrop-invert":[``,XS,Z,X]}],"backdrop-opacity":[{"backdrop-opacity":[XS,Z,X]}],"backdrop-saturate":[{"backdrop-saturate":[XS,Z,X]}],"backdrop-sepia":[{"backdrop-sepia":[``,XS,Z,X]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Z,X]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[XS,`initial`,Z,X]}],ease:[{ease:[`linear`,`initial`,_,Z,X]}],delay:[{delay:[XS,Z,X]}],animate:[{animate:[`none`,v,Z,X]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Z,X]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:H()}],"rotate-x":[{"rotate-x":H()}],"rotate-y":[{"rotate-y":H()}],"rotate-z":[{"rotate-z":H()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":[`scale-3d`],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[Z,X,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:se()}],"translate-x":[{"translate-x":se()}],"translate-y":[{"translate-y":se()}],"translate-z":[{"translate-z":se()}],"translate-none":[`translate-none`],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Z,X]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Z,X]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[XS,mC,sC,cC]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function MC(...e){return jC(iS(e))}var NC=sS(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function PC({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,m.jsx)(nS,{"data-slot":`button`,className:MC(NC({variant:t,size:n,className:e})),...r})}var FC=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),IC=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),LC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),RC=e=>{let t=LC(e);return t.charAt(0).toUpperCase()+t.slice(1)},zC={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},BC=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},VC=(0,f.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,f.createElement)(`svg`,{ref:c,...zC,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:FC(`lucide`,i),...!a&&!BC(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,f.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Q=(e,t)=>{let n=(0,f.forwardRef)(({className:n,...r},i)=>(0,f.createElement)(VC,{ref:i,iconNode:t,className:FC(`lucide-${IC(RC(e))}`,`lucide-${e}`,n),...r}));return n.displayName=RC(e),n},HC=Q(`blocks`,[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]),UC=Q(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),WC=Q(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),GC=Q(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),KC=Q(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),qC=Q(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),JC=Q(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),YC=Q(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),XC=Q(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),ZC=Q(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),QC=Q(`crop`,[[`path`,{d:`M6 2v14a2 2 0 0 0 2 2h14`,key:`ron5a4`}],[`path`,{d:`M18 22V8a2 2 0 0 0-2-2H2`,key:`7s9ehn`}]]),$C=Q(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),ew=Q(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),tw=Q(`file-down`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`m9 15 3 3 3-3`,key:`1npd3o`}]]),nw=Q(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),rw=Q(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),iw=Q(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),aw=Q(`highlighter`,[[`path`,{d:`m9 11-6 6v3h9l3-3`,key:`1a3l36`}],[`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`,key:`14a9rk`}]]),ow=Q(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),sw=Q(`italic`,[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]),cw=Q(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),lw=Q(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),uw=Q(`list-indent-decrease`,[[`path`,{d:`M21 5H11`,key:`us1j55`}],[`path`,{d:`M21 12H11`,key:`wd7e0v`}],[`path`,{d:`M21 19H11`,key:`saa85w`}],[`path`,{d:`m7 8-4 4 4 4`,key:`o5hrat`}]]),dw=Q(`list-indent-increase`,[[`path`,{d:`M21 5H11`,key:`us1j55`}],[`path`,{d:`M21 12H11`,key:`wd7e0v`}],[`path`,{d:`M21 19H11`,key:`saa85w`}],[`path`,{d:`m3 8 4 4-4 4`,key:`1a3j6y`}]]),fw=Q(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),pw=Q(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),mw=Q(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),hw=Q(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),gw=Q(`merge`,[[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}],[`path`,{d:`M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22`,key:`1hyw0i`}],[`path`,{d:`m20 22-5-5`,key:`1m27yz`}]]),_w=Q(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),vw=Q(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),yw=Q(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),bw=Q(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),xw=Q(`printer`,[[`path`,{d:`M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2`,key:`143wyd`}],[`path`,{d:`M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6`,key:`1itne7`}],[`rect`,{x:`6`,y:`14`,width:`12`,height:`8`,rx:`1`,key:`1ue0tg`}]]),Sw=Q(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),Cw=Q(`redo-2`,[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]),ww=Q(`remove-formatting`,[[`path`,{d:`M4 7V4h16v3`,key:`9msm58`}],[`path`,{d:`M5 20h6`,key:`1h6pxn`}],[`path`,{d:`M13 4 8 20`,key:`kqq6aj`}],[`path`,{d:`m15 15 5 5`,key:`me55sn`}],[`path`,{d:`m20 15-5 5`,key:`11p7ol`}]]),Tw=Q(`repeat`,[[`path`,{d:`m17 2 4 4-4 4`,key:`nntrym`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`,key:`84bu3i`}],[`path`,{d:`m7 22-4-4 4-4`,key:`1wqhfi`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`,key:`1rx37r`}]]),Ew=Q(`rows-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}]]),Dw=Q(`separator-horizontal`,[[`path`,{d:`m16 16-4 4-4-4`,key:`3dv8je`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`m8 8 4-4 4 4`,key:`2bscm2`}]]),Ow=Q(`split`,[[`path`,{d:`M16 3h5v5`,key:`1806ms`}],[`path`,{d:`M8 3H3v5`,key:`15dfkv`}],[`path`,{d:`M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3`,key:`1qrqzj`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}]]),kw=Q(`strikethrough`,[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]),Aw=Q(`subscript`,[[`path`,{d:`m4 5 8 8`,key:`1eunvl`}],[`path`,{d:`m12 5-8 8`,key:`1ah0jp`}],[`path`,{d:`M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07`,key:`e8ta8j`}]]),jw=Q(`superscript`,[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]]),Mw=Q(`table`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]),Nw=Q(`text-align-center`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]]),Pw=Q(`text-align-end`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]]),Fw=Q(`text-align-justify`,[[`path`,{d:`M3 5h18`,key:`1u36vt`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 19h18`,key:`awlh7x`}]]),Iw=Q(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),Lw=Q(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Rw=Q(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),zw=Q(`underline`,[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]]),Bw=Q(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),Vw=Q(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Hw(e,t){return new Promise((n,r)=>{let i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`);e.width=t.width,e.height=t.height;let a=e.getContext(`2d`);if(!a)return r(Error(`Canvas context unavailable`));a.drawImage(i,t.x,t.y,t.width,t.height,0,0,t.width,t.height),n(e.toDataURL(`image/png`))},i.onerror=r,i.src=e})}function Uw(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=n,r.readAsDataURL(e)})}function Ww(e,t,n){return Math.min(Math.max(e,t),n)}function Gw({imageWidth:e,imageHeight:t,onCrop:n,onCancel:r}){let[i,a]=(0,f.useState)({x:e*.1,y:t*.1,width:e*.8,height:t*.8}),[o,s]=(0,f.useState)(null),c=(0,f.useRef)({x:0,y:0,crop:{...i}}),l=(0,f.useCallback)((e,t)=>{t.preventDefault(),t.stopPropagation(),s(e),c.current={x:t.clientX,y:t.clientY,crop:{...i}}},[i]);return(0,f.useEffect)(()=>{if(!o)return;let n=n=>{let r=n.clientX-c.current.x,i=n.clientY-c.current.y,s=c.current.crop;if(o===`move`)a({x:Ww(s.x+r,0,e-s.width),y:Ww(s.y+i,0,t-s.height),width:s.width,height:s.height});else{let n=s.x,c=s.y,l=s.width,u=s.height;o.includes(`right`)&&(l=Ww(s.width+r,20,e-s.x)),o.includes(`left`)&&(n=Ww(s.x+r,0,s.x+s.width-20),l=s.width-(n-s.x)),o.includes(`bottom`)&&(u=Ww(s.height+i,20,t-s.y)),o.includes(`top`)&&(c=Ww(s.y+i,0,s.y+s.height-20),u=s.height-(c-s.y)),a({x:n,y:c,width:l,height:u})}},r=()=>s(null);return window.addEventListener(`mousemove`,n),window.addEventListener(`mouseup`,r),()=>{window.removeEventListener(`mousemove`,n),window.removeEventListener(`mouseup`,r)}},[o,e,t]),(0,m.jsxs)(`div`,{className:`absolute inset-0 z-20`,style:{width:e,height:t},children:[(0,m.jsx)(`div`,{className:`absolute bg-black/50`,style:{top:0,left:0,right:0,height:i.y}}),(0,m.jsx)(`div`,{className:`absolute bg-black/50`,style:{top:i.y+i.height,left:0,right:0,bottom:0}}),(0,m.jsx)(`div`,{className:`absolute bg-black/50`,style:{top:i.y,left:0,width:i.x,height:i.height}}),(0,m.jsx)(`div`,{className:`absolute bg-black/50`,style:{top:i.y,left:i.x+i.width,right:0,height:i.height}}),(0,m.jsx)(`div`,{className:`absolute border-2 border-white cursor-move`,style:{left:i.x,top:i.y,width:i.width,height:i.height},onMouseDown:e=>l(`move`,e),children:(0,m.jsxs)(`div`,{className:`absolute inset-0 pointer-events-none`,children:[(0,m.jsx)(`div`,{className:`absolute left-1/3 top-0 bottom-0 w-px bg-white/40`}),(0,m.jsx)(`div`,{className:`absolute left-2/3 top-0 bottom-0 w-px bg-white/40`}),(0,m.jsx)(`div`,{className:`absolute top-1/3 left-0 right-0 h-px bg-white/40`}),(0,m.jsx)(`div`,{className:`absolute top-2/3 left-0 right-0 h-px bg-white/40`})]})}),[`top-left`,`top-right`,`bottom-left`,`bottom-right`].map(e=>{let[t,n]=e.split(`-`);return(0,m.jsx)(`div`,{className:`absolute w-3 h-3 bg-white border-2 border-blue-500 rounded-sm z-30`,style:{top:t===`top`?i.y-6:i.y+i.height-6,left:n===`left`?i.x-6:i.x+i.width-6,cursor:`${t===`top`?`n`:`s`}${n===`left`?`w`:`e`}-resize`},onMouseDown:t=>l(e,t)},e)}),(0,m.jsxs)(`div`,{className:`absolute flex gap-1`,style:{top:i.y+i.height+8,left:i.x+i.width-64},children:[(0,m.jsx)(PC,{size:`icon-xs`,variant:`secondary`,onClick:r,children:(0,m.jsx)(Vw,{className:`size-3`,strokeWidth:1.5})}),(0,m.jsx)(PC,{size:`icon-xs`,onClick:()=>n(i),children:(0,m.jsx)(GC,{className:`size-3`,strokeWidth:1.5})})]})]})}function Kw({node:e,updateAttributes:t,deleteNode:n,selected:r,editor:i}){let{src:a,width:o,alignment:s}=e.attrs,c=i.isEditable,[l,u]=(0,f.useState)(!1),[d,p]=(0,f.useState)(!1),[h,g]=(0,f.useState)(o),[_,v]=(0,f.useState)({width:0,height:0}),y=(0,f.useRef)(null),b=(0,f.useRef)({x:0,width:0}),x=(0,f.useCallback)(()=>{y.current&&(v({width:y.current.naturalWidth,height:y.current.naturalHeight}),h||g(Math.min(y.current.naturalWidth,600)))},[h]),S=(0,f.useCallback)((e,t)=>{e.preventDefault(),e.stopPropagation(),u(!0),b.current={x:e.clientX,width:h||300}},[h]);(0,f.useEffect)(()=>{if(!l)return;let e=h||300,n=t=>{let n=t.clientX-b.current.x;e=Math.max(100,b.current.width+n),g(e)},r=()=>{u(!1),t({width:e})};return window.addEventListener(`mousemove`,n),window.addEventListener(`mouseup`,r),()=>{window.removeEventListener(`mousemove`,n),window.removeEventListener(`mouseup`,r)}},[l,t]);let C=(0,f.useCallback)(async e=>{if(!y.current)return;let n=h||y.current.clientWidth,r=y.current.clientHeight,i=_.width/n,o=_.height/r;t({src:await Hw(a,{x:e.x*i,y:e.y*o,width:e.width*i,height:e.height*o}),width:e.width}),p(!1)},[a,h,_,t]);return(0,m.jsx)(pp,{className:`flex ${s===`left`?`justify-start`:s===`right`?`justify-end`:`justify-center`} my-2`,"data-drag-handle":!0,children:(0,m.jsxs)(`div`,{className:`relative inline-block group`,children:[(0,m.jsx)(`img`,{ref:y,src:a,alt:e.attrs.alt||``,style:{width:h?`${h}px`:`auto`},className:`block max-w-full`,draggable:!1,onLoad:x}),r&&c&&!d&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`absolute inset-0 ring-2 ring-blue-500 ring-offset-2 rounded pointer-events-none`}),[`top-left`,`top-right`,`bottom-left`,`bottom-right`].map(e=>(0,m.jsx)(`div`,{className:`absolute w-2.5 h-2.5 bg-white border-2 border-blue-500 rounded-full z-10`,style:{top:e.includes(`top`)?-5:void 0,bottom:e.includes(`bottom`)?-5:void 0,left:e.includes(`left`)?-5:void 0,right:e.includes(`right`)?-5:void 0,cursor:`${e.includes(`top`)?`n`:`s`}${e.includes(`left`)?`w`:`e`}-resize`},onMouseDown:t=>S(t,e)},e)),(0,m.jsxs)(`div`,{className:`absolute -top-10 left-1/2 -translate-x-1/2 flex items-center gap-0.5 bg-background border border-border rounded-lg shadow-lg p-0.5 z-20`,children:[(0,m.jsx)(PC,{size:`icon-xs`,variant:`ghost`,onClick:()=>t({alignment:`left`}),className:s===`left`?`bg-muted`:``,children:(0,m.jsx)(Iw,{className:`size-3`,strokeWidth:1.5})}),(0,m.jsx)(PC,{size:`icon-xs`,variant:`ghost`,onClick:()=>t({alignment:`center`}),className:s===`center`?`bg-muted`:``,children:(0,m.jsx)(Nw,{className:`size-3`,strokeWidth:1.5})}),(0,m.jsx)(PC,{size:`icon-xs`,variant:`ghost`,onClick:()=>t({alignment:`right`}),className:s===`right`?`bg-muted`:``,children:(0,m.jsx)(Pw,{className:`size-3`,strokeWidth:1.5})}),(0,m.jsx)(`div`,{className:`w-px h-4 bg-border mx-0.5`}),(0,m.jsx)(PC,{size:`icon-xs`,variant:`ghost`,onClick:()=>p(!0),children:(0,m.jsx)(QC,{className:`size-3`,strokeWidth:1.5})}),(0,m.jsx)(PC,{size:`icon-xs`,variant:`ghost`,onClick:n,className:`text-destructive hover:text-destructive`,children:(0,m.jsx)(Lw,{className:`size-3`,strokeWidth:1.5})})]})]}),d&&c&&y.current&&(0,m.jsx)(Gw,{imageWidth:y.current.clientWidth,imageHeight:y.current.clientHeight,onCrop:C,onCancel:()=>p(!1)})]})})}var qw=Wd.create({name:`resizableImage`,group:`block`,atom:!0,draggable:!0,selectable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null},alignment:{default:`center`}}},parseHTML(){return[{tag:`img[src]`,getAttrs:e=>{let t=e;return{src:t.getAttribute(`src`),alt:t.getAttribute(`alt`),title:t.getAttribute(`title`),width:t.getAttribute(`width`)?parseInt(t.getAttribute(`width`)):null,alignment:t.getAttribute(`data-alignment`)||`center`}}}]},renderHTML({HTMLAttributes:e}){let{alignment:t,...n}=e;return[`div`,{style:`text-align: ${t||`center`}`,class:`image-container`},[`img`,Ul(n,{"data-alignment":t,style:n.width?`width: ${n.width}px`:void 0})]]},addNodeView(){return xp(Kw)},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}}}),Jw=fd.create({name:`pasteHandler`,addProseMirrorPlugins(){let e=this.editor;return[new Pn({key:new Ln(`pasteHandler`),props:{handlePaste(t,n){let r=n.clipboardData;if(!r)return!1;let i=r.items;if(i){for(let t of Array.from(i))if(t.type.startsWith(`image/`)){n.preventDefault();let r=t.getAsFile();if(!r)continue;let i=new FileReader;return i.onload=()=>{let t=i.result;e.commands.setImage({src:t})},i.readAsDataURL(r),!0}}let a=r.getData(`text/html`);if(!a||!(a.includes(`docs-internal-guid`)||a.includes(`google-sheets-html`)))return!1;let o=Yw(a);return e.commands.insertContent(o,{parseOptions:{preserveWhitespace:`full`}}),!0}}})]}});function Yw(e){let t=new DOMParser().parseFromString(e,`text/html`),n=new Map;t.querySelectorAll(`style`).forEach(e=>{let t=e.textContent||``,r=/\.([a-zA-Z][\w-]*)\s*\{([^}]*)\}/g,i;for(;(i=r.exec(t))!==null;){let e=i[1],t=i[2],r={};t.split(`;`).forEach(e=>{let t=e.split(`:`),n=t[0]?.trim(),i=t.slice(1).join(`:`).trim();n&&i&&(r[n]=i)}),n.set(e,r)}}),t.querySelectorAll(`meta, style, script`).forEach(e=>e.remove());let r=t.querySelectorAll(`*`);for(let e=0;e<r.length;e++){let i=r[e],a={};i.classList.forEach(e=>{let t=n.get(e);t&&Object.assign(a,t)});for(let e=0;e<i.style.length;e++){let t=i.style[e];a[t]=i.style.getPropertyValue(t)}let o=[],s=a[`font-weight`];(s===`bold`||s===`700`||s===`800`||s===`900`)&&i.tagName!==`STRONG`&&i.tagName!==`B`&&o.push(`strong`),a[`font-style`]===`italic`&&i.tagName!==`EM`&&i.tagName!==`I`&&o.push(`em`);let c=a[`text-decoration`]||a[`text-decoration-line`]||``;if(c.includes(`underline`)&&i.tagName!==`U`&&o.push(`u`),c.includes(`line-through`)&&i.tagName!==`S`&&i.tagName!==`DEL`&&o.push(`s`),o.length>0&&i.childNodes.length>0){let e=[`DIV`,`P`,`H1`,`H2`,`H3`,`H4`,`H5`,`H6`,`UL`,`OL`,`TABLE`,`BLOCKQUOTE`,`LI`];if(!Array.from(i.children).some(t=>e.includes(t.tagName))){let e=Array.from(i.childNodes),n=t.createDocumentFragment();e.forEach(e=>n.appendChild(e));for(let e=o.length-1;e>=0;e--){let r=t.createElement(o[e]);r.appendChild(n),n=r}i.appendChild(n)}}let l=a.color;l&&!Xw(l)&&(i.style.color=l);let u=a[`background-color`];u&&!Zw(u)&&(i.style.backgroundColor=u);let d=a[`text-align`];d&&d!==`start`&&d!==`left`&&(i.style.textAlign=d);let f=a[`font-size`];f&&(i.style.fontSize=f);let p=a[`margin-left`];p&&p!==`0px`&&p!==`0`&&(i.style.marginLeft=p);let m=a[`padding-left`];m&&m!==`0px`&&m!==`0`&&(i.style.paddingLeft=m),Array.from(i.classList).filter(e=>/^c\d+$/.test(e)||e.startsWith(`docs-internal`)).forEach(e=>i.classList.remove(e)),i.classList.length===0&&i.removeAttribute(`class`)}return t.querySelectorAll(`span`).forEach(e=>{let t=e.hasAttribute(`style`)&&e.style.cssText.trim().length>0,n=e.hasAttribute(`class`),r=e.hasAttribute(`id`);if(!t&&!n&&!r){let t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}}),t.body.innerHTML}function Xw(e){return e===`rgb(0, 0, 0)`||e===`#000000`||e===`#000`||e===`black`}function Zw(e){return e===`transparent`||e===`rgba(0, 0, 0, 0)`||e===`initial`||e===`inherit`}function Qw({node:e,selected:t}){let n=e.attrs.name||`variable`;return(0,m.jsx)(pp,{as:`span`,className:`template-variable-wrapper`,children:(0,m.jsxs)(`span`,{className:`template-variable-chip ${t?`selected`:``}`,contentEditable:!1,children:[(0,m.jsx)(`span`,{className:`template-variable-braces`,children:`{{`}),(0,m.jsx)(`span`,{className:`template-variable-name`,children:n}),(0,m.jsx)(`span`,{className:`template-variable-braces`,children:`}}`})]})})}var $w=Wd.create({name:`templateVariable`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!0,addOptions(){return{variables:[],allowCustom:!0,syntax:{open:`{{`,close:`}}`}}},addAttributes(){return{name:{default:null,parseHTML:e=>e.getAttribute(`data-variable`)}}},parseHTML(){return[{tag:`span[data-variable]`}]},renderHTML({HTMLAttributes:e}){let t=e.name||``,{open:n,close:r}=this.options.syntax;return[`span`,Ul(e,{"data-variable":t,class:`template-variable`}),`${n}${t}${r}`]},addNodeView(){return xp(Qw)},addCommands(){return{insertVariable:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{name:e}})}}}),eT=fd.create({name:`pageFlow`,addOptions(){return{contentHeight:930.5,paddingTop:96,paddingBottom:96,pageGap:40,enabled:!0}},onCreate(){if(!this.options.enabled)return;let e=document.createElement(`style`);e.setAttribute(`data-page-flow`,`true`),document.head.appendChild(e);let t=this.editor,n=this.options,r=null,i=-1,a=-1;function o(){r&&clearTimeout(r),r=setTimeout(()=>{requestAnimationFrame(()=>{let r;try{r=t.view.dom}catch{return}if(!r)return;let o=r.children.length,s=r.scrollHeight;o===i&&Math.abs(s-a)<5||(i=o,a=s,tT(r,e,n))})},100)}t.on(`update`,o),t.on(`create`,o),o(),this._pageFlowCleanup=()=>{r&&clearTimeout(r),t.off(`update`,o),e.remove()}},onDestroy(){this._pageFlowCleanup?.()}});function tT(e,t,n){if(!e)return;let r=n.contentHeight,i=n.paddingTop+n.pageGap+n.paddingBottom,a=r+i;t.textContent=``,e.offsetHeight;let o=[],s=0;for(let t=0;t<e.children.length;t++){let n=e.children[t];if(!n||n.nodeType!==1||n.classList.contains(`page-break`)||n.hasAttribute(`data-page-break`))continue;let c=n.offsetTop,l=n.offsetHeight,u=c+s,d=u+l,f=Math.floor(u/a)*a+r;if(d>f+1&&u<f-1){let e=f+i-u;e>0&&(o.push(`.ProseMirror > :nth-child(${t+1}) { margin-top: ${e}px !important; }`),s+=e)}}t.textContent=o.join(`
|
|
148
|
+
`)}function nT(e,t,n,r,i){let a=new Map;if(a.set(`starterKit`,B_.configure({heading:{levels:[1,2,3,4]}})),a.set(`table`,Vy.configure({resizable:!0,handleWidth:5,cellMinWidth:80,lastColumnResizable:!0})),a.set(`tableRow`,Oy),a.set(`tableCell`,Ey),a.set(`tableHeader`,Dy),a.set(`textAlign`,Hy.configure({types:[`heading`,`paragraph`]})),a.set(`underline`,Jg),a.set(`textStyle`,Ky),a.set(`color`,Jy),a.set(`highlight`,eb.configure({multicolor:!0})),a.set(`placeholder`,I_.configure({placeholder:i})),a.set(`typography`,Cb),a.set(`taskList`,Bg),a.set(`taskItem`,zg.configure({nested:!0})),a.set(`link`,ug.configure({openOnClick:!1,HTMLAttributes:{rel:`noopener noreferrer`,target:`_blank`}})),a.set(`subscript`,wb),a.set(`superscript`,Tb),a.set(`pageBreak`,Eb),a.set(`resizableImage`,qw),a.set(`pasteHandler`,Jw),a.set(`pageFlow`,eT.configure({contentHeight:t?.contentHeightPx||930.5,paddingTop:t?.paddingPx.top||96,paddingBottom:t?.paddingPx.bottom||96,pageGap:t?.pageGap||40,enabled:t?.paginate??!0})),n!==!1&&a.set(`templateVariable`,$w.configure({variables:n||[]})),e?.configure)for(let[t,n]of Object.entries(e.configure)){let e=a.get(t);e&&typeof e.configure==`function`&&a.set(t,e.configure(n))}if(e?.remove)for(let t of e.remove)a.delete(t);t&&!t.paginate&&a.delete(`pageBreak`);let o={variables:n===!1?[]:n},s=r.map(e=>typeof e.extension==`function`?e.extension(o):e.extension);return[...a.values(),...e?.add||[],...s]}function rT(e={}){let{content:t=``,placeholder:n=`Start typing...`,variables:r=!1,blocks:i=[],canvas:a,extensions:o,onUpdate:s}=e;return sp({extensions:nT(o,a,r,i,n),content:t,onUpdate:({editor:e})=>{s?.(e.getHTML())},editorProps:{attributes:{class:`ProseMirror`,spellcheck:`true`},transformPastedHTML(e){return e.replace(/<!--\[if[\s\S]*?endif\]-->/gi,``).replace(/<!--[\s\S]*?-->/g,``).replace(/<o:p[\s\S]*?<\/o:p>/gi,``).replace(/<w:[\s\S]*?<\/w:[\s\S]*?>/gi,``).replace(/\s*mso-[^:]+:[^;"]+;?/gi,``).replace(/\s*class="Mso[^"]*"/gi,``)},handleDrop(e,t){let n=t.dataTransfer?.files;if(!n||n.length===0)return!1;let r=Array.from(n).filter(e=>e.type.startsWith(`image/`));return r.length===0?!1:(t.preventDefault(),r.forEach(n=>{let r=new FileReader;r.onload=()=>{let n=r.result,{schema:i}=e.state,a=e.posAtCoords({left:t.clientX,top:t.clientY});if(a){let t=i.nodes.resizableImage?.create({src:n});if(t){let n=e.state.tr.insert(a.pos,t);e.dispatch(n)}}},r.readAsDataURL(n)}),!0)}}})}var iT=`
|
|
149
|
+
.s-block {
|
|
150
|
+
position: relative;
|
|
151
|
+
margin: 0.75em 0;
|
|
152
|
+
border-radius: 6px;
|
|
153
|
+
border: 1.5px solid transparent;
|
|
154
|
+
transition: border-color 0.15s;
|
|
155
|
+
}
|
|
156
|
+
.s-block--selected {
|
|
157
|
+
border-color: currentColor;
|
|
158
|
+
}
|
|
159
|
+
.s-block__header {
|
|
160
|
+
display: flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
justify-content: space-between;
|
|
163
|
+
padding: 4px 10px;
|
|
164
|
+
border-radius: 5px 5px 0 0;
|
|
165
|
+
font-size: 11px;
|
|
166
|
+
font-weight: 500;
|
|
167
|
+
user-select: none;
|
|
168
|
+
gap: 6px;
|
|
169
|
+
}
|
|
170
|
+
.s-block__header-left {
|
|
171
|
+
display: flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
gap: 6px;
|
|
174
|
+
min-width: 0;
|
|
175
|
+
flex: 1;
|
|
176
|
+
}
|
|
177
|
+
.s-block__footer {
|
|
178
|
+
padding: 3px 10px;
|
|
179
|
+
border-radius: 0 0 5px 5px;
|
|
180
|
+
font-size: 10px;
|
|
181
|
+
font-weight: 500;
|
|
182
|
+
user-select: none;
|
|
183
|
+
opacity: 0.7;
|
|
184
|
+
}
|
|
185
|
+
.s-block__body {
|
|
186
|
+
padding: 8px 12px;
|
|
187
|
+
min-height: 2em;
|
|
188
|
+
}
|
|
189
|
+
.s-block__expr {
|
|
190
|
+
cursor: default;
|
|
191
|
+
white-space: nowrap;
|
|
192
|
+
overflow: hidden;
|
|
193
|
+
text-overflow: ellipsis;
|
|
194
|
+
}
|
|
195
|
+
.s-block__expr strong {
|
|
196
|
+
font-weight: 700;
|
|
197
|
+
font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
|
|
198
|
+
}
|
|
199
|
+
.s-block__expr-edit {
|
|
200
|
+
display: inline-flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
gap: 4px;
|
|
203
|
+
}
|
|
204
|
+
.s-block__expr-kw {
|
|
205
|
+
opacity: 0.7;
|
|
206
|
+
}
|
|
207
|
+
.s-block__expr-input {
|
|
208
|
+
background: rgba(255,255,255,0.3);
|
|
209
|
+
border: 1px solid rgba(255,255,255,0.5);
|
|
210
|
+
border-radius: 3px;
|
|
211
|
+
padding: 0 4px;
|
|
212
|
+
font-size: 11px;
|
|
213
|
+
font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
|
|
214
|
+
font-weight: 700;
|
|
215
|
+
color: inherit;
|
|
216
|
+
outline: none;
|
|
217
|
+
min-width: 3ch;
|
|
218
|
+
}
|
|
219
|
+
.s-block__expr-input:focus {
|
|
220
|
+
border-color: rgba(255,255,255,0.8);
|
|
221
|
+
background: rgba(255,255,255,0.4);
|
|
222
|
+
}
|
|
223
|
+
.s-block__delete {
|
|
224
|
+
opacity: 0;
|
|
225
|
+
transition: opacity 0.15s;
|
|
226
|
+
flex-shrink: 0;
|
|
227
|
+
background: none;
|
|
228
|
+
border: none;
|
|
229
|
+
color: inherit;
|
|
230
|
+
cursor: pointer;
|
|
231
|
+
padding: 2px;
|
|
232
|
+
border-radius: 3px;
|
|
233
|
+
display: flex;
|
|
234
|
+
align-items: center;
|
|
235
|
+
}
|
|
236
|
+
.s-block__delete:hover {
|
|
237
|
+
background: rgba(0,0,0,0.1);
|
|
238
|
+
}
|
|
239
|
+
.s-block:hover .s-block__delete,
|
|
240
|
+
.s-block--selected .s-block__delete {
|
|
241
|
+
opacity: 1;
|
|
242
|
+
}
|
|
243
|
+
`;function aT(e){let t=(0,f.useRef)(null);(0,f.useEffect)(()=>{if(e.length===0)return;let n=[iT,...e.map(e=>e.styles)].join(`
|
|
244
|
+
`);return t.current||(t.current=document.createElement(`style`),t.current.setAttribute(`data-doccraft-blocks`,`true`),document.head.appendChild(t.current)),t.current.textContent=n,()=>{t.current&&=(t.current.remove(),null)}},[e])}var oT=f.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,...a}=e;return Xx(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},a]})});process.env.NODE_ENV!==`production`&&(oT.displayName=`Separator`);function sT({className:e,orientation:t=`horizontal`,...n}){return(0,m.jsx)(oT,{"data-slot":`separator`,orientation:t,className:MC(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}var cT=[],lT=void 0;function uT(){return lT}function dT(e){cT.push(e)}function fT(e){let t=(t,n)=>{let r=$b(mT).current,i;try{lT=r;for(let e of cT)e.before(r);i=e(t,n);for(let e of cT)e.after(r);r.didInitialize=!0}finally{lT=void 0}return i};return t.displayName=e.displayName||e.name,t}function pT(e){return f.forwardRef(fT(e))}function mT(){return{didInitialize:!1}}function hT(e){let t=f.useRef(!0);t.current&&(t.current=!1,e())}var gT=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(gT.displayName=`TooltipRootContext`);function _T(e){let t=f.useContext(gT);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?xx(72):`Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.`);return t}var vT=[];function yT(e){f.useEffect(e,vT)}var bT=0,xT=class e{static create(){return new e}currentId=bT;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=bT,t()},e)}isStarted(){return this.currentId!==bT}clear=()=>{this.currentId!==bT&&(clearTimeout(this.currentId),this.currentId=bT)};disposeEffect=()=>this.clear};function ST(){let e=$b(xT.create).current;return yT(e.disposeEffect),e}var CT=typeof navigator<`u`,wT=NT(),TT=FT(),ET=PT(),DT=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),OT=wT.platform===`MacIntel`&&wT.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(wT.platform);CT&&/firefox/i.test(ET);var kT=CT&&/apple/i.test(navigator.vendor);CT&&/Edg/i.test(ET);var AT=CT&&/android/i.test(TT)||/android/i.test(ET),jT=CT&&TT.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,MT=ET.includes(`jsdom/`);function NT(){if(!CT)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function PT(){if(!CT)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function FT(){if(!CT)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}var IT=`data-base-ui-focusable`,LT=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,RT=`ArrowLeft`,zT=`ArrowRight`,BT=`ArrowUp`,VT=`ArrowDown`;function HT(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function UT(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Pb(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function WT(e,t){if(!Mb(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(UT(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function GT(e){return`composedPath`in e?e.composedPath()[0]:e.target}function KT(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function qT(e){return e.matches(`html,body`)}function JT(e){return Nb(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function YT(e){return e?e.getAttribute(`role`)===`combobox`&&JT(e):!1}function XT(e){if(!e||MT)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function ZT(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function QT(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...QT(e,t.id,n)])}function $T(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function eE(e){e.preventDefault(),e.stopPropagation()}function tE(e){return`nativeEvent`in e}function nE(e){return e.pointerType===``&&e.isTrusted?!0:AT&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function rE(e){return MT?!1:!AT&&e.width===0&&e.height===0||AT&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function iE(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function aE(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var oE=[`top`,`right`,`bottom`,`left`],sE=[`start`,`end`],cE=oE.reduce((e,t)=>e.concat(t,t+`-`+sE[0],t+`-`+sE[1]),[]),lE=Math.min,uE=Math.max,dE=Math.round,fE=Math.floor,pE=e=>({x:e,y:e}),mE={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function hE(e,t,n){return uE(e,lE(t,n))}function gE(e,t){return typeof e==`function`?e(t):e}function _E(e){return e.split(`-`)[0]}function vE(e){return e.split(`-`)[1]}function yE(e){return e===`x`?`y`:`x`}function bE(e){return e===`y`?`height`:`width`}function xE(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function SE(e){return yE(xE(e))}function CE(e,t,n){n===void 0&&(n=!1);let r=vE(e),i=SE(e),a=bE(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ME(o)),[o,ME(o)]}function wE(e){let t=ME(e);return[TE(e),t,TE(t)]}function TE(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var EE=[`left`,`right`],DE=[`right`,`left`],OE=[`top`,`bottom`],kE=[`bottom`,`top`];function AE(e,t,n){switch(e){case`top`:case`bottom`:return n?t?DE:EE:t?EE:DE;case`left`:case`right`:return t?OE:kE;default:return[]}}function jE(e,t,n,r){let i=vE(e),a=AE(_E(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(TE)))),a}function ME(e){let t=_E(e);return mE[t]+e.slice(t.length)}function NE(e){return{top:0,right:0,bottom:0,left:0,...e}}function PE(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:NE(e)}function FE(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function IE(e,t,n){return Math.floor(e/t)!==n}function LE(e,t){return t<0||t>=e.current.length}function RE(e,t){return BE(e,{disabledIndices:t})}function zE(e,t){return BE(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function BE(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.current.length-1&&GE(e,a,r));return a}function VE(e,{event:t,orientation:n,loopFocus:r,rtl:i,cols:a,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:l,stopEvent:u=!1}){let d=l,f;if(t.key===`ArrowUp`?f=`up`:t.key===`ArrowDown`&&(f=`down`),f){let n=[],i=[],p=!1,m=0;{let t=null,r=-1;e.current.forEach((e,a)=>{if(e==null)return;m+=1;let o=e.closest(`[role="row"]`);o&&(p=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(a),i[a]=r})}let h=!1,g=0;if(p)for(let e of n){let t=e.length;t>g&&(g=t),t!==a&&(h=!0)}let _=h&&m<e.current.length,v=g||a,y=t=>{if(!h||l===-1)return;let a=i[l];if(a==null)return;let s=n[a].indexOf(l),c=t===`up`?-1:1;for(let t=a+c,i=0;i<n.length;i+=1,t+=c){if(t<0||t>=n.length){if(!r||_)return;t=t<0?n.length-1:0}let i=n[t];for(let t=Math.min(s,i.length-1);t>=0;--t){let n=i[t];if(!GE(e,n,o))return n}}},b=t=>{if(!_||l===-1)return;let n=l%v,i=t===`up`?-v:v,a=c-c%v,s=fE(c/v)+1;for(let t=l-n+i,u=0;u<s;u+=1,t+=i){if(t<0||t>c){if(!r)return;t=t<0?a:0}let i=Math.min(t+v-1,c);for(let r=Math.min(t+n,i);r>=t;--r)if(!GE(e,r,o))return r}};u&&eE(t);let x=y(f)??b(f);if(x!==void 0)d=x;else if(l===-1)d=f===`up`?c:s;else if(d=BE(e,{startingIndex:l,amount:v,decrement:f===`up`,disabledIndices:o}),r){if(f===`up`&&(l-v<s||d<0)){let e=l%v,t=c%v,n=c-(t-e);d=t===e?c:t>e?n:n-v}f===`down`&&l+v>c&&(d=BE(e,{startingIndex:l%v-v,amount:v,disabledIndices:o}))}LE(e,d)&&(d=l)}if(n===`both`){let n=fE(l/a);t.key===(i?`ArrowLeft`:`ArrowRight`)&&(u&&eE(t),l%a===a-1?r&&(d=BE(e,{startingIndex:l-l%a-1,disabledIndices:o})):(d=BE(e,{startingIndex:l,disabledIndices:o}),r&&IE(d,a,n)&&(d=BE(e,{startingIndex:l-l%a-1,disabledIndices:o}))),IE(d,a,n)&&(d=l)),t.key===(i?`ArrowRight`:`ArrowLeft`)&&(u&&eE(t),l%a===0?r&&(d=BE(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o})):(d=BE(e,{startingIndex:l,decrement:!0,disabledIndices:o}),r&&IE(d,a,n)&&(d=BE(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o}))),IE(d,a,n)&&(d=l));let s=fE(c/a)===n;LE(e,d)&&(d=r&&s?t.key===(i?`ArrowRight`:`ArrowLeft`)?c:BE(e,{startingIndex:l-l%a-1,disabledIndices:o}):l)}return d}function HE(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{if(e>t&&process.env.NODE_ENV!==`production`)throw Error(`[Floating UI]: Invalid grid - item width at index ${o} is greater than grid columns`);let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function UE(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function WE(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function GE(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e.current[t];return r?KE(r)?!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!0:!1}function KE(e){return Kb(e).display!==`none`}var qE=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),JE=typeof Element>`u`,YE=JE?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,XE=!JE&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},ZE=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):ZE(e.parentNode))},QE=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},$E=function(e,t,n){if(ZE(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(qE));return t&&YE.call(e,qE)&&r.unshift(e),r=r.filter(n),r},eD=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!ZE(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=eD(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{YE.call(a,qE)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!ZE(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=eD(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},tD=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},nD=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||QE(e))&&!tD(e)?0:e.tabIndex},rD=function(e,t){var n=nD(e);return n<0&&t&&!tD(e)?0:n},iD=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},aD=function(e){return e.tagName===`INPUT`},oD=function(e){return aD(e)&&e.type===`hidden`},sD=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},cD=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},lD=function(e){if(!e.name)return!0;var t=e.form||XE(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=cD(r,e.form);return!i||i===e},uD=function(e){return aD(e)&&e.type===`radio`},dD=function(e){return uD(e)&&!lD(e)},fD=function(e){var t=e&&XE(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=XE(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},pD=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},mD=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=YE.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(YE.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=XE(e);if(o&&!o.shadowRoot&&r(o)===!0)return pD(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(fD(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return pD(e);return!1},hD=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return YE.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},gD=function(e,t){return!(t.disabled||oD(t)||mD(t,e)||sD(t)||hD(t))},_D=function(e,t){return!(dD(t)||nD(t)<0||!gD(e,t))},vD=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},yD=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=rD(a,i),s=i?yD(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(iD).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},bD=function(e,t){return t||={},yD(t.getShadowRoot?eD([e],t.includeContainer,{filter:_D.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:vD}):$E(e,t.includeContainer,_D.bind(null,t)))},xD=function(e,t){return t||={},t.getShadowRoot?eD([e],t.includeContainer,{filter:gD.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):$E(e,t.includeContainer,gD.bind(null,t))},SD=function(e,t){if(t||={},!e)throw Error(`No node provided`);return YE.call(e,qE)===!1?!1:_D(t,e)};function CD(e){return e?.ownerDocument||document}var wD=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function TD(e,t){let n=bD(e,wD()),r=n.length;if(r===0)return;let i=HT(CD(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function ED(e){return TD(CD(e).body,1)||e}function DD(e){return TD(CD(e).body,-1)||e}function OD(e,t){if(!e)return null;let n=bD(CD(e).body,wD()),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function kD(e){return OD(e,1)}function AD(e){return OD(e,-1)}function jD(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!UT(n,r)}function MD(e){bD(e,wD()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function ND(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function PD(e,t){return t!=null&&!iE(t)?0:typeof e==`function`?e():e}function FD(e,t,n){let r=PD(e,n);return typeof r==`number`?r:r?.[t]}function ID(e){return typeof e==`function`?e():e}function LD(e,t){return t||e===`click`||e===`mousedown`}var RD=`none`,zD=`trigger-press`,BD=`trigger-hover`,VD=`trigger-focus`,HD=`outside-press`,UD=`item-press`,WD=`focus-out`,GD=`escape-key`,KD=`list-navigation`,qD=`cancel-open`,JD=`sibling-open`,YD=`disabled`,XD=`imperative-action`;function ZD(e,t,n,r){let i=!1,a=!1,o=r??Wx;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var QD=f.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new xT,currentIdRef:{current:null},currentContextRef:{current:null}});process.env.NODE_ENV!==`production`&&(QD.displayName=`FloatingDelayGroupContext`);function $D(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=f.useRef(n),a=f.useRef(n),o=f.useRef(null),s=f.useRef(null),c=ST();return(0,m.jsx)(QD.Provider,{value:f.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function eO(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{open:i}=t,{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=f.useContext(QD),[p,m]=f.useState(!1);return Y(()=>{function e(){m(!1),l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current}if(a.current&&!i&&a.current===r){if(m(!1),s){let t=r;return d.start(s,()=>{n.select(`open`)||a.current&&a.current!==t||e()}),()=>{d.clear()}}e()}},[i,r,a,o,s,c,l,d,n]),Y(()=>{if(!i)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:n.setOpen,setIsInstantPhase:m},a.current=r,o.current={open:0,close:FD(c.current,`close`)},t!==null&&t!==r?(m(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,ZD(RD))):(m(!1),e?.setIsInstantPhase(!1))},[i,r,n,a,o,s,c,l,d]),Y(()=>()=>{l.current=null},[l]),f.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:p}),[u,o,p])}function tO(e){let t=$b(nO,e).current;return t.next=e,Y(t.effect),t}function nO(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var rO=null,iO=globalThis.requestAnimationFrame,aO=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1;let n=process.env.NODE_ENV!==`production`&&iO!==requestAnimationFrame&&(iO=requestAnimationFrame,!0);return(!this.isScheduled||n)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},oO=class e{static create(){return new e}static request(e){return aO.request(e)}static cancel(e){return aO.cancel(e)}currentId=rO;request(e){this.cancel(),this.currentId=aO.request(()=>{this.currentId=rO,e()})}cancel=()=>{this.currentId!==rO&&(aO.cancel(this.currentId),this.currentId=rO)};disposeEffect=()=>this.cancel};function sO(){let e=$b(oO.create).current;return yT(e.disposeEffect),e}var cO={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},lO={...cO,position:`fixed`,top:0,left:0};({...cO});var uO=f.forwardRef(function(e,t){let[n,r]=f.useState();Y(()=>{kT&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,m.jsx)(`span`,{...e,ref:t,style:lO,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})});process.env.NODE_ENV!==`production`&&(uO.displayName=`FocusGuard`);function dO(e){return`data-base-ui-${e}`}var fO=0;function pO(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(fO);let a=()=>e?.focus({preventScroll:n});i?a():fO=requestAnimationFrame(a)}var mO={inert:new WeakMap,"aria-hidden":new WeakMap},hO=`data-base-ui-inert`,gO={inert:new WeakSet,"aria-hidden":new WeakSet},_O=new WeakMap,vO=0;function yO(e){return gO[e]}function bO(e){return e?Pb(e)?e.host:bO(e.parentNode):null}var xO=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=bO(t);return e.contains(n)?n:null}).filter(e=>e!=null),SO=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},CO=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{Ob(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function wO(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let o=r?`inert`:n?`aria-hidden`:null,s=null,c=null,l=xO(t,e),u=i?xO(t,a):[],d=new Set(u),f=i?CO(t,SO(l),new Set(l)).filter(e=>!d.has(e)):[],p=[],m=[];if(o){let e=mO[o],n=yO(o);c=n,s=e;let r=xO(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=l.concat(r);CO(t,SO(i),new Set(i)).forEach(t=>{let r=t.getAttribute(o),i=r!==null&&r!==`false`,a=(e.get(t)||0)+1;e.set(t,a),p.push(t),a===1&&i&&n.add(t),i||t.setAttribute(o,o===`inert`?``:`true`)})}return i&&f.forEach(e=>{let t=(_O.get(e)||0)+1;_O.set(e,t),m.push(e),t===1&&e.setAttribute(hO,``)}),vO+=1,()=>{s&&p.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&o&&e.removeAttribute(o),c?.delete(e))}),i&&m.forEach(e=>{let t=(_O.get(e)||0)-1;_O.set(e,t),t||e.removeAttribute(hO)}),--vO,vO||(mO.inert=new WeakMap,mO[`aria-hidden`]=new WeakMap,gO.inert=new WeakSet,gO[`aria-hidden`]=new WeakSet,_O=new WeakMap)}}function TO(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,o=CD(e[0]).body;return wO(e,o,n,r,{mark:i,markerIgnoreElements:a})}var EO=0;function DO(e,t=`mui`){let[n,r]=f.useState(e),i=e||n;return f.useEffect(()=>{n??(EO+=1,r(`${t}-${EO}`))},[n,t]),i}var OO=ox.useId;function kO(e,t){if(OO!==void 0){let n=OO();return e??(t?`${t}-${n}`:n)}return DO(e,t)}var AO=f.createContext(null);process.env.NODE_ENV!==`production`&&(AO.displayName=`PortalContext`);var jO=()=>f.useContext(AO),MO=dO(`portal`);function NO(e={}){let{ref:t,container:n,componentProps:r=Wx,elementProps:i}=e,a=kO(),o=jO()?.portalNode,[s,c]=f.useState(null),[l,u]=f.useState(null),d=J(e=>{e!==null&&u(e)}),m=f.useRef(null);Y(()=>{if(n===null){m.current&&(m.current=null,u(null),c(null));return}if(a==null)return;let e=(n&&(jb(n)?n:n.current))??o??document.body;if(e==null){m.current&&(m.current=null,u(null),c(null));return}m.current!==e&&(m.current=e,u(null),c(e))},[n,o,a]);let h=Xx(`div`,r,{ref:[t,d],props:[{id:a,[MO]:``},i]});return{portalNode:l,portalSubtree:s&&h?p.createPortal(h,s):null}}var PO=f.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,...s}=e,{portalNode:c,portalSubtree:l}=NO({container:r,ref:t,componentProps:e,elementProps:s}),u=f.useRef(null),d=f.useRef(null),h=f.useRef(null),g=f.useRef(null),[_,v]=f.useState(null),y=_?.modal,b=_?.open,x=typeof o==`boolean`?o:!!_&&!_.modal&&_.open&&!!c;f.useEffect(()=>{if(!c||y)return;function e(e){c&&e.relatedTarget&&jD(e)&&(e.type===`focusin`?ND:MD)(c)}return c.addEventListener(`focusin`,e,!0),c.addEventListener(`focusout`,e,!0),()=>{c.removeEventListener(`focusin`,e,!0),c.removeEventListener(`focusout`,e,!0)}},[c,y]),f.useEffect(()=>{!c||b||ND(c)},[b,c]);let S=f.useMemo(()=>({beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:h,afterInsideRef:g,portalNode:c,setFocusManagerState:v}),[c]);return(0,m.jsxs)(f.Fragment,{children:[l,(0,m.jsxs)(AO.Provider,{value:S,children:[x&&c&&(0,m.jsx)(uO,{"data-type":`outside`,ref:u,onFocus:e=>{jD(e,c)?h.current?.focus():DD(_?_.domReference:null)?.focus()}}),x&&c&&(0,m.jsx)(`span`,{"aria-owns":c.id,style:Yx}),c&&p.createPortal(n,c),x&&c&&(0,m.jsx)(uO,{"data-type":`outside`,ref:d,onFocus:e=>{jD(e,c)?g.current?.focus():(ED(_?_.domReference:null)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,ZD(`focus-out`,e.nativeEvent)))}})]})]})});process.env.NODE_ENV!==`production`&&(PO.displayName=`FloatingPortal`);function FO(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var IO=class{nodesRef={current:[]};events=FO();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},LO=f.createContext(null);process.env.NODE_ENV!==`production`&&(LO.displayName=`FloatingNodeContext`);var RO=f.createContext(null);process.env.NODE_ENV!==`production`&&(RO.displayName=`FloatingTreeContext`);var zO=()=>f.useContext(LO)?.id||null,BO=e=>{let t=f.useContext(RO);return e??t};function VO(e){let t=kO(),n=BO(e),r=zO();return Y(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function HO(e){let{children:t,id:n}=e,r=zO();return(0,m.jsx)(LO.Provider,{value:f.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function UO(e){let{children:t,externalTree:n}=e,r=$b(()=>n??new IO).current;return(0,m.jsx)(RO.Provider,{value:r,children:t})}function WO(e){return e==null?e:`current`in e?e.current:e}function GO(e,t){let n=kb(e.target);return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var KO=20,qO=[];function JO(){qO=qO.filter(e=>e.deref()?.isConnected)}function YO(e){JO(),e&&Ob(e)!==`body`&&(qO.push(new WeakRef(e)),qO.length>KO&&(qO=qO.slice(-KO)))}function XO(){return JO(),qO[qO.length-1]?.deref()}function ZO(e){if(!e)return null;let t=wD();return SD(e,t)?e:bD(e,t)[0]||e}function QO(e){return!e||!e.isConnected?!1:typeof e.checkVisibility==`function`?e.checkVisibility():KE(e)}function $O(e,t){if(!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=wD(),r=xD(e,n).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return SD(e,n)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),i=e.getAttribute(`tabindex`);t.current.includes(`floating`)||r.length===0?i!==`0`&&e.setAttribute(`tabindex`,`0`):(i!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function ek(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:p,externalTree:h,getInsideElements:g}=e,_=`rootStore`in t?t.rootStore:t,v=_.useState(`open`),y=_.useState(`domReferenceElement`),b=_.useState(`floatingElement`),{events:x,dataRef:S}=_.context,C=J(()=>S.current.floatingContext?.nodeId),w=i===!1,T=YT(y)&&w,E=f.useRef([`content`]),D=tO(i),O=tO(a),k=tO(l),A=BO(h),j=jO(),M=f.useRef(!1),N=f.useRef(!1),P=f.useRef(!1),F=f.useRef(-1),I=f.useRef(``),L=f.useRef(``),R=f.useRef(null),z=f.useRef(null),B=Ox(R,p,j?.beforeInsideRef),ee=Ox(z,j?.afterInsideRef),te=ST(),ne=ST(),re=sO(),ie=j!=null,V=ZT(b),H=J((e=V)=>e?bD(e,wD()):[]),ae=J(()=>g?.().filter(e=>e!=null)??[]),oe=J(e=>{let t=H(e);return E.current.map(()=>t).filter(Boolean).flat()});f.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&UT(V,HT(CD(V)))&&H().length===0&&!T&&eE(e)}let t=CD(V);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,y,V,s,E,T,H,oe]),f.useEffect(()=>{if(r||!v)return;let e=CD(V);function t(){P.current=!1}function n(e){let t=GT(e),n=ae();P.current=!(UT(b,t)||UT(y,t)||UT(j?.portalNode,t)||n.some(e=>e===t||UT(e,t))),L.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(N.current=!0)}function i(){L.current=`keyboard`}return e.addEventListener(`pointerdown`,n,!0),e.addEventListener(`pointerup`,t,!0),e.addEventListener(`pointercancel`,t,!0),e.addEventListener(`keydown`,i,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),e.removeEventListener(`pointerup`,t,!0),e.removeEventListener(`pointercancel`,t,!0),e.removeEventListener(`keydown`,i,!0)}},[r,b,y,V,v,j,ae]),f.useEffect(()=>{if(r||!c)return;let e=CD(V);function t(){N.current=!0,ne.start(0,()=>{N.current=!1})}function n(e){let t=GT(e),n=H().indexOf(t);n!==-1&&(F.current=n)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=GT(t);queueMicrotask(()=>{let a=C(),c=_.context.triggerElements,l=ae(),f=n?.hasAttribute(dO(`focus-guard`))&&[R.current,z.current,j?.beforeInsideRef.current,j?.afterInsideRef.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,WO(d),WO(u)].includes(n),p=!(UT(y,n)||UT(b,n)||UT(n,b)||UT(j?.portalNode,n)||l.some(e=>e===n||UT(e,n))||n!=null&&c.hasElement(n)||c.hasMatchingElement(e=>UT(e,n))||f||A&&(QT(A.nodesRef.current,a).find(e=>UT(e.context?.elements.floating,n)||UT(e.context?.elements.domReference,n))||$T(A.nodesRef.current,a).find(e=>[e.context?.elements.floating,ZT(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===y&&V&&$O(V,E),o&&r!==y&&!QO(i)&&HT(e)===e.body){if(Nb(V)&&(V.focus(),o===`popup`)){re.request(()=>{V.focus()});return}let e=F.current,t=H(),n=t[e]||t[t.length-1]||V;Nb(n)&&n.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(T||!s)&&n&&p&&!N.current&&(T||n!==XO())&&(M.current=!0,_.setOpen(!1,ZD(WD,t)))})}function a(){P.current||(S.current.insideReactTree=!0,te.start(0,()=>{S.current.insideReactTree=!1}))}let l=Nb(y)?y:null,f=[];if(!(!b&&!l))return l&&(l.addEventListener(`focusout`,i),l.addEventListener(`pointerdown`,t),f.push(()=>{l.removeEventListener(`focusout`,i),l.removeEventListener(`pointerdown`,t)})),b&&(b.addEventListener(`focusin`,n),b.addEventListener(`focusout`,i),j&&(b.addEventListener(`focusout`,a,!0),f.push(()=>{b.removeEventListener(`focusout`,a,!0)})),f.push(()=>{b.removeEventListener(`focusin`,n),b.removeEventListener(`focusout`,i)})),()=>{f.forEach(e=>{e()})}},[r,y,b,V,s,A,j,_,c,o,H,T,C,E,S,te,ne,re,u,d,ae]),f.useEffect(()=>{if(r||!b||!v)return;let e=Array.from(j?.portalNode?.querySelectorAll(`[${dO(`portal`)}]`)||[]),t=(A?$T(A.nodesRef.current,C()):[]).find(e=>YT(e.context?.elements.domReference||null))?.context?.elements.domReference,n=TO([...[b,...e,R.current,z.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,...ae()],t,WO(d),WO(u),T?y:null].filter(e=>e!=null),{ariaHidden:s||T,mark:!1}),i=TO([b,...e].filter(e=>e!=null));return()=>{i(),n()}},[v,r,y,b,s,E,j,T,A,C,u,d,ae]),Y(()=>{if(!v||r||!Nb(V))return;let e=HT(CD(V));queueMicrotask(()=>{let t=oe(V),n=D.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1)return;let i;i=r===!0||r===null?t[0]||V:WO(r),i=i||t[0]||V,!UT(V,e)&&pO(i,{preventScroll:i===V})})},[r,v,V,w,oe,D,k]),Y(()=>{if(r||!V)return;let e=CD(V);YO(HT(e));function t(e){if(e.open||(I.current=GO(e.nativeEvent,L.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(M.current=!0),e.reason===`outside-press`)if(e.nested)M.current=!1;else if(nE(e.nativeEvent)||rE(e.nativeEvent))M.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?M.current=!1:M.current=!0}}x.on(`openchange`,t);function n(){let e=O.current,t=typeof e==`function`?e(I.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=y||XO();return e&&e.isConnected?e:null}let n=y||XO();return WO(t)||n||null}return()=>{x.off(`openchange`,t);let r=HT(e),i=ae(),a=UT(b,r)||i.some(e=>e===r||UT(e,r))||A&&QT(A.nodesRef.current,C(),!1).some(e=>UT(e.context?.elements.floating,r)),o=n();queueMicrotask(()=>{let t=ZO(o),n=typeof O.current!=`boolean`;O.current&&!M.current&&Nb(t)&&(!(!n&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),M.current=!1})}},[r,b,V,O,S,x,A,y,C,ae]),Y(()=>{if(!DT||v||!b)return;let e=HT(CD(b));!Nb(e)||!JT(e)||UT(b,e)&&e.blur()},[v,b]),Y(()=>{if(!(r||!j))return j.setFocusManagerState({modal:s,closeOnFocusOut:c,open:v,onOpenChange:_.setOpen,domReference:y}),()=>{j.setFocusManagerState(null)}},[r,j,s,v,_,c,y]),Y(()=>{if(!(r||!V))return $O(V,E),()=>{queueMicrotask(JO)}},[r,V,E]);let se=!r&&(s?!T:!0)&&(ie||s);return(0,m.jsxs)(f.Fragment,{children:[se&&(0,m.jsx)(uO,{"data-type":`inside`,ref:B,onFocus:e=>{if(s){let e=oe();pO(e[e.length-1])}else j?.portalNode&&(M.current=!1,jD(e,j.portalNode)?ED(y)?.focus():WO(d??j.beforeOutsideRef)?.focus())}}),n,se&&(0,m.jsx)(uO,{"data-type":`inside`,ref:ee,onFocus:e=>{s?pO(oe()[0]):j?.portalNode&&(c&&(M.current=!0),jD(e,j.portalNode)?DD(y)?.focus():WO(u??j.afterOutsideRef)?.focus())}})]})}function tk(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,{enabled:i=!0,event:a=`click`,toggle:o=!0,ignoreMouse:s=!1,stickIfOpen:c=!0,touchOpenDelay:l=0,reason:u=zD}=t,d=f.useRef(void 0),p=sO(),m=ST(),h=f.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){let t=d.current,i=e.nativeEvent,f=n.select(`open`);if(e.button!==0||a===`click`||iE(t,!0)&&s)return;let h=r.current.openEvent,g=h?.type,_=n.select(`domReferenceElement`)!==e.currentTarget,v=f&&_||!(f&&o&&(!(h&&c)||g===`click`||g===`mousedown`));if(JT(i.target)){let e=ZD(u,i,i.target);v&&t===`touch`&&l>0?m.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(v,e);return}let y=e.currentTarget;p.request(()=>{let e=ZD(u,i,y);v&&t===`touch`&&l>0?m.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(v,e)})},onClick(e){if(a===`mousedown-only`)return;let t=d.current;if(a===`mousedown`&&t){d.current=void 0;return}if(iE(t,!0)&&s)return;let i=n.select(`open`),f=r.current.openEvent,p=n.select(`domReferenceElement`)!==e.currentTarget,h=i&&p||!(i&&o&&(!(f&&c)||aE(f))),g=ZD(u,e.nativeEvent,e.currentTarget);h&&t===`touch`&&l>0?m.start(l,()=>{n.setOpen(!0,g)}):n.setOpen(h,g)},onKeyDown(){d.current=void 0}}),[r,a,s,n,c,o,p,m,l,u]);return f.useMemo(()=>i?{reference:h}:Wx,[i,h])}function nk(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function rk(e){return e!=null&&e.clientX!=null}function ik(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`}=t,l=f.useRef(!1),u=f.useRef(null),[d,p]=f.useState(),[m,h]=f.useState([]),g=J((e,t,r)=>{l.current||o.current.openEvent&&!rk(o.current.openEvent)||n.set(`positionReference`,nk(r??a,{x:e,y:t,axis:c,dataRef:o,pointerType:d}))}),_=J(e=>{r?u.current||h([]):g(e.clientX,e.clientY,e.currentTarget)}),v=iE(d)?i:r,y=f.useCallback(()=>{if(!v||!s)return;let e=kb(i);function t(n){UT(i,GT(n))?(e.removeEventListener(`mousemove`,t),u.current=null):g(n.clientX,n.clientY)}if(!o.current.openEvent||rk(o.current.openEvent)){e.addEventListener(`mousemove`,t);let n=()=>{e.removeEventListener(`mousemove`,t),u.current=null};return u.current=n,n}n.set(`positionReference`,a)},[v,s,i,o,a,n,g]);f.useEffect(()=>y(),[y,m]),f.useEffect(()=>{s&&!i&&(l.current=!1)},[s,i]),f.useEffect(()=>{!s&&r&&(l.current=!0)},[s,r]);let b=f.useMemo(()=>{function e(e){p(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return f.useMemo(()=>s?{reference:b,trigger:b}:{},[s,b])}var ak={intentional:`onClick`,sloppy:`onPointerDown`};function ok(){return!1}function sk(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function ck(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),{dataRef:a}=n.context,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`sloppy`,referencePress:u=ok,referencePressEvent:d=`sloppy`,bubbles:p,externalTree:m}=t,h=BO(m),g=J(typeof c==`function`?c:()=>!1),_=typeof c==`function`?g:c,v=_!==!1,y=J(()=>l),b=f.useRef(!1),x=f.useRef(!1),S=f.useRef(!1),{escapeKey:C,outsidePress:w}=sk(p),T=f.useRef(null),E=ST(),D=ST(),O=J(()=>{D.clear(),a.current.insideReactTree=!1}),k=f.useRef(!1),A=f.useRef(``),j=J(u),M=J(e=>{if(!r||!o||!s||e.key!==`Escape`||k.current)return;let t=a.current.floatingContext?.nodeId,i=h?QT(h.nodesRef.current,t):[];if(!C&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let c=ZD(GD,tE(e)?e.nativeEvent:e);n.setOpen(!1,c),!C&&!c.isPropagationAllowed&&e.stopPropagation()}),N=J(()=>{a.current.insideReactTree=!0,D.start(0,O)});f.useEffect(()=>{if(!r||!o)return;a.current.__escapeKeyBubbles=C,a.current.__outsidePressBubbles=w;let e=new xT,t=new xT;function c(){e.clear(),k.current=!0}function l(){e.start(Wb()?5:0,()=>{k.current=!1})}function u(){S.current=!0,t.start(0,()=>{S.current=!1})}function d(){b.current=!1,x.current=!1}function f(){let e=A.current,t=e===`pen`||!e?`mouse`:e,n=y(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function m(e){let t=a.current.floatingContext?.nodeId,r=h&&QT(h.nodesRef.current,t).some(t=>KT(e,t.context?.elements.floating));return KT(e,n.select(`floatingElement`))||KT(e,n.select(`domReferenceElement`))||r}function g(e){if(p(e)){O();return}if(a.current.insideReactTree){O();return}let r=GT(e),i=`[${dO(`inert`)}]`,o=Array.from(CD(n.select(`floatingElement`)).querySelectorAll(i)),s=Mb(r)?r.getRootNode():null;Pb(s)&&(o=o.concat(Array.from(s.querySelectorAll(i))));let c=n.context.triggerElements;if(r&&(c.hasElement(r)||c.hasMatchingElement(e=>UT(e,r))))return;let l=Mb(r)?r:null;for(;l&&!Gb(l);){let e=Jb(l);if(Gb(e)||!Mb(e))break;l=e}if(o.length&&Mb(r)&&!qT(r)&&!UT(r,n.select(`floatingElement`))&&o.every(e=>!UT(l,e)))return;if(Nb(r)&&!(`touches`in e)){let t=Gb(r),n=Kb(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}if(m(e))return;if(f()===`intentional`&&S.current){t.clear(),S.current=!1;return}if(typeof _==`function`&&!_(e))return;let u=a.current.floatingContext?.nodeId,d=h?QT(h.nodesRef.current,u):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,ZD(HD,e)),O()}function D(e){f()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!o||KT(e,n.select(`floatingElement`))||KT(e,n.select(`domReferenceElement`))||g(e)}function j(e){if(f()!==`sloppy`||!n.select(`open`)||!o||KT(e,n.select(`floatingElement`))||KT(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}function N(e){A.current=`touch`;let t=GT(e);function n(){j(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}function P(e){if(E.clear(),e.type===`pointerdown`&&(A.current=e.pointerType),e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)return;let t=GT(e);function n(){e.type===`pointerdown`?D(e):g(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}function F(e){if(!b.current)return;let n=x.current;if(d(),f()===`intentional`){if(e.type===`pointercancel`){n&&u();return}if(!m(e)){if(n){u();return}typeof _==`function`&&!_(e)||(t.clear(),S.current=!0,O())}}}function I(e){if(f()!==`sloppy`||!T.current||KT(e,n.select(`floatingElement`))||KT(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-T.current.startX),i=Math.abs(t.clientY-T.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(T.current.dismissOnTouchEnd=!0),a>10&&(g(e),E.clear(),T.current=null)}function L(e){let t=GT(e);function n(){I(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}function R(e){f()!==`sloppy`||!T.current||KT(e,n.select(`floatingElement`))||KT(e,n.select(`domReferenceElement`))||(T.current.dismissOnTouchEnd&&g(e),E.clear(),T.current=null)}function z(e){let t=GT(e);function n(){R(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}let B=CD(i);return s&&(B.addEventListener(`keydown`,M),B.addEventListener(`compositionstart`,c),B.addEventListener(`compositionend`,l)),v&&(B.addEventListener(`click`,P,!0),B.addEventListener(`pointerdown`,P,!0),B.addEventListener(`pointerup`,F,!0),B.addEventListener(`pointercancel`,F,!0),B.addEventListener(`mousedown`,P,!0),B.addEventListener(`mouseup`,F,!0),B.addEventListener(`touchstart`,N,!0),B.addEventListener(`touchmove`,L,!0),B.addEventListener(`touchend`,z,!0)),()=>{s&&(B.removeEventListener(`keydown`,M),B.removeEventListener(`compositionstart`,c),B.removeEventListener(`compositionend`,l)),v&&(B.removeEventListener(`click`,P,!0),B.removeEventListener(`pointerdown`,P,!0),B.removeEventListener(`pointerup`,F,!0),B.removeEventListener(`pointercancel`,F,!0),B.removeEventListener(`mousedown`,P,!0),B.removeEventListener(`mouseup`,F,!0),B.removeEventListener(`touchstart`,N,!0),B.removeEventListener(`touchmove`,L,!0),B.removeEventListener(`touchend`,z,!0)),e.clear(),t.clear(),d(),S.current=!1}},[a,i,s,v,_,r,o,C,w,M,O,y,h,n,E]),f.useEffect(O,[_,O]);let P=f.useMemo(()=>({onKeyDown:M,[ak[d]]:e=>{j()&&n.setOpen(!1,ZD(zD,e.nativeEvent))},...d!==`intentional`&&{onClick(e){j()&&n.setOpen(!1,ZD(`trigger-press`,e.nativeEvent))}}}),[M,n,d,j]),F=J(e=>{if(!r||!o||e.button!==0)return;let t=GT(e.nativeEvent);UT(n.select(`floatingElement`),t)&&(b.current||(b.current=!0,x.current=!1))}),I=J(e=>{!r||!o||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)}),L=f.useMemo(()=>({onKeyDown:M,onPointerDown:I,onMouseDown:I,onClickCapture:N,onMouseDownCapture(e){N(),F(e)},onPointerDownCapture(e){N(),F(e)},onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[M,N,F,I]);return f.useMemo(()=>o?{reference:P,floating:L,trigger:P}:{},[o,P,L])}function lk(e,t,n){let{reference:r,floating:i}=e,a=xE(t),o=SE(t),s=bE(o),c=_E(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(vE(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function uk(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=gE(t,e),p=PE(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=FE(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=FE(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var dk=50,fk=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:uk},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=lk(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<dk&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=lk(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},pk=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=gE(e,t)||{};if(l==null)return{};let d=PE(u),f={x:n,y:r},p=SE(i),m=bE(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=lE(d[_],T),D=lE(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=hE(O,A,k),M=!c.arrow&&vE(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}});function mk(e,t,n){return(e?[...n.filter(t=>vE(t)===e),...n.filter(t=>vE(t)!==e)]:n.filter(e=>_E(e)===e)).filter(n=>e?vE(n)===e||(t?TE(n)!==n:!1):!0)}var hk=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=cE,autoAlignment:u=!0,...d}=gE(e,t),f=c!==void 0||l===cE?mk(c||null,u,l):l,p=await a.detectOverflow(t,d),m=r.autoPlacement?.index||0,h=f[m];if(h==null)return{};let g=CE(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[_E(h)],p[g[0]],p[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:h,overflows:_}],y=f[m+1];if(y)return{data:{index:m+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=vE(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,vE(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:m+1,overflows:v},reset:{placement:x}}}}},gk=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=gE(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=_E(r),_=xE(o),v=_E(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ME(o)]:wE(o)),x=p!==`none`;!d&&x&&b.push(...jE(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=CE(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==xE(t))||T.every(e=>xE(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=xE(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function _k(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vk(e){return oE.some(t=>e[t]>=0)}var yk=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=gE(e,t);switch(i){case`referenceHidden`:{let e=_k(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:vk(e)}}}case`escaped`:{let e=_k(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:vk(e)}}}default:return{}}}}};function bk(e){let t=lE(...e.map(e=>e.left)),n=lE(...e.map(e=>e.top)),r=uE(...e.map(e=>e.right)),i=uE(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function xk(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>FE(bk(e)))}var Sk=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=gE(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=xk(u),f=FE(bk(u)),p=PE(s);function m(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(xE(n)===`y`){let e=d[0],t=d[d.length-1],r=_E(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=_E(n)===`left`,t=uE(...d.map(e=>e.right)),r=lE(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Ck=new Set([`left`,`top`]);async function wk(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=_E(n),s=vE(n),c=xE(n)===`y`,l=Ck.has(o)?-1:1,u=a&&c?-1:1,d=gE(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Tk=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await wk(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ek=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=gE(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=xE(_E(i)),p=yE(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=hE(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=hE(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Dk=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=gE(e,t),u={x:n,y:r},d=xE(i),f=yE(d),p=u[f],m=u[d],h=gE(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ck.has(_E(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ok=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=gE(e,t),u=await o.detectOverflow(t,l),d=_E(i),f=vE(i),p=xE(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=lE(h-u[g],v),x=lE(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=uE(u.left,0),t=uE(u.right,0),n=uE(u.top,0),r=uE(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:uE(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:uE(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function kk(e){let t=Kb(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Nb(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=dE(n)!==a||dE(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ak(e){return Mb(e)?e:e.contextElement}function jk(e){let t=Ak(e);if(!Nb(t))return pE(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=kk(t),o=(a?dE(n.width):n.width)/r,s=(a?dE(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Mk=pE(0);function Nk(e){let t=kb(e);return!Wb()||!t.visualViewport?Mk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Pk(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==kb(e)?!1:t}function Fk(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ak(e),o=pE(1);t&&(r?Mb(r)&&(o=jk(r)):o=jk(e));let s=Pk(a,n,r)?Nk(a):pE(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=kb(a),t=r&&Mb(r)?kb(r):r,n=e,i=Zb(n);for(;i&&r&&t!==n;){let e=jk(i),t=i.getBoundingClientRect(),r=Kb(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=kb(i),i=Zb(n)}}return FE({width:u,height:d,x:c,y:l})}function Ik(e,t){let n=qb(e).scrollLeft;return t?t.left+n:Fk(Ab(e)).left+n}function Lk(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ik(e,n),y:n.top+t.scrollTop}}function Rk(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ab(r),s=t?Lb(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=pE(1),u=pE(0),d=Nb(r);if((d||!d&&!a)&&((Ob(r)!==`body`||Fb(o))&&(c=qb(r)),d)){let e=Fk(r);l=jk(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Lk(o,c):pE(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function zk(e){return Array.from(e.getClientRects())}function Bk(e){let t=Ab(e),n=qb(e),r=e.ownerDocument.body,i=uE(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=uE(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ik(e),s=-n.scrollTop;return Kb(r).direction===`rtl`&&(o+=uE(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Vk=25;function Hk(e,t){let n=kb(e),r=Ab(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Wb();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ik(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Vk&&(a-=o)}else l<=Vk&&(a+=l);return{width:a,height:o,x:s,y:c}}function Uk(e,t){let n=Fk(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Nb(e)?jk(e):pE(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Wk(e,t,n){let r;if(t===`viewport`)r=Hk(e,n);else if(t===`document`)r=Bk(Ab(e));else if(Mb(t))r=Uk(t,n);else{let n=Nk(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return FE(r)}function Gk(e,t){let n=Jb(e);return n===t||!Mb(n)||Gb(n)?!1:Kb(n).position===`fixed`||Gk(n,t)}function Kk(e,t){let n=t.get(e);if(n)return n;let r=Xb(e,[],!1).filter(e=>Mb(e)&&Ob(e)!==`body`),i=null,a=Kb(e).position===`fixed`,o=a?Jb(e):e;for(;Mb(o)&&!Gb(o);){let t=Kb(o),n=Hb(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Fb(o)&&!n&&Gk(e,o))?r=r.filter(e=>e!==o):i=t,o=Jb(o)}return t.set(e,r),r}function qk(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Lb(t)?[]:Kk(t,this._c):[].concat(n),r],o=Wk(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Wk(t,a[e],i);s=uE(n.top,s),c=lE(n.right,c),l=lE(n.bottom,l),u=uE(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Jk(e){let{width:t,height:n}=kk(e);return{width:t,height:n}}function Yk(e,t,n){let r=Nb(t),i=Ab(t),a=n===`fixed`,o=Fk(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=pE(0);function l(){c.x=Ik(i)}if(r||!r&&!a)if((Ob(t)!==`body`||Fb(i))&&(s=qb(t)),r){let e=Fk(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Lk(i,s):pE(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Xk(e){return Kb(e).position===`static`}function Zk(e,t){if(!Nb(e)||Kb(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ab(e)===n&&(n=n.ownerDocument.body),n}function Qk(e,t){let n=kb(e);if(Lb(e))return n;if(!Nb(e)){let t=Jb(e);for(;t&&!Gb(t);){if(Mb(t)&&!Xk(t))return t;t=Jb(t)}return n}let r=Zk(e,t);for(;r&&Ib(r)&&Xk(r);)r=Zk(r,t);return r&&Gb(r)&&Xk(r)&&!Hb(r)?n:r||Ub(e)||n}var $k=async function(e){let t=this.getOffsetParent||Qk,n=this.getDimensions,r=await n(e.floating);return{reference:Yk(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function eA(e){return Kb(e).direction===`rtl`}var tA={convertOffsetParentRelativeRectToViewportRelativeRect:Rk,getDocumentElement:Ab,getClippingRect:qk,getOffsetParent:Qk,getElementRects:$k,getClientRects:zk,getDimensions:Jk,getScale:jk,isElement:Mb,isRTL:eA};function nA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rA(e,t){let n=null,r,i=Ab(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=fE(d),h=fE(i.clientWidth-(u+f)),g=fE(i.clientHeight-(d+p)),_=fE(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:uE(0,lE(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!nA(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function iA(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ak(e),u=i||a?[...l?Xb(l):[],...t?Xb(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?rA(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Fk(e):null;c&&g();function g(){let t=Fk(e);h&&!nA(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var aA=Tk,oA=hk,sA=Ek,cA=gk,lA=Ok,uA=yk,dA=pk,fA=Sk,pA=Dk,mA=(e,t,n)=>{let r=new Map,i={platform:tA,...n},a={...i.platform,_c:r};return fk(e,t,{...i,platform:a})},hA=typeof document<`u`?f.useLayoutEffect:function(){};function gA(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!gA(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!gA(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function _A(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vA(e,t){let n=_A(e);return Math.round(t*n)/n}function yA(e){let t=f.useRef(e);return hA(()=>{t.current=e}),t}function bA(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=f.useState(r);gA(m,r)||h(r);let[g,_]=f.useState(null),[v,y]=f.useState(null),b=f.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=f.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=f.useRef(null),T=f.useRef(null),E=f.useRef(u),D=c!=null,O=yA(c),k=yA(i),A=yA(l),j=f.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),mA(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!gA(E.current,t)&&(E.current=t,p.flushSync(()=>{d(t)}))})},[m,t,n,k,A]);hA(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=f.useRef(!1);hA(()=>(M.current=!0,()=>{M.current=!1}),[]),hA(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=f.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=f.useMemo(()=>({reference:S,floating:C}),[S,C]),F=f.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=vA(P.floating,u.x),r=vA(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,..._A(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var xA=(e,t)=>{let n=aA(e);return{name:n.name,fn:n.fn,options:[e,t]}},SA=(e,t)=>{let n=sA(e);return{name:n.name,fn:n.fn,options:[e,t]}},CA=(e,t)=>({fn:pA(e).fn,options:[e,t]}),wA=(e,t)=>{let n=cA(e);return{name:n.name,fn:n.fn,options:[e,t]}},TA=(e,t)=>{let n=lA(e);return{name:n.name,fn:n.fn,options:[e,t]}},EA=(e,t)=>{let n=uA(e);return{name:n.name,fn:n.fn,options:[e,t]}},DA=(e,t,n)=>{if(t.length===1&&t[0]===n){let t=!1;try{let n={};e(n)===n&&(t=!0)}catch{}if(t){let e;try{throw Error()}catch(t){({stack:e}=t)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
245
|
+
\`createSelector([state => state.todos], todos => todos)\`
|
|
246
|
+
This could lead to inefficient memoization and unnecessary re-renders.
|
|
247
|
+
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:e})}}},OA=(e,t,n)=>{let{memoize:r,memoizeOptions:i}=t,{inputSelectorResults:a,inputSelectorResultsCopy:o}=e,s=r(()=>({}),...i);if(s.apply(null,a)!==s.apply(null,o)){let e;try{throw Error()}catch(t){({stack:e}=t)}console.warn(`An input selector returned a different result when passed same arguments.
|
|
248
|
+
This means your output selector will likely run more frequently than intended.
|
|
249
|
+
Avoid returning a new reference inside your input selector, e.g.
|
|
250
|
+
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:a,secondInputs:o,stack:e})}},kA={inputStabilityCheck:`once`,identityFunctionCheck:`once`},AA=Symbol(`NOT_FOUND`);function jA(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function MA(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function NA(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var PA=e=>Array.isArray(e)?e:[e];function FA(e){let t=Array.isArray(e[0])?e[0]:e;return NA(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function IA(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var LA=(e,t)=>{let{identityFunctionCheck:n,inputStabilityCheck:r}={...kA,...t};return{identityFunctionCheck:{shouldRun:n===`always`||n===`once`&&e,run:DA},inputStabilityCheck:{shouldRun:r===`always`||r===`once`&&e,run:OA}}};function RA(e){let t;return{get(n){return t&&e(t.key,n)?t.value:AA},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function zA(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return AA}function i(t,i){r(t)===AA&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var BA=(e,t)=>e===t;function VA(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function HA(e,t){let{equalityCheck:n=BA,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=VA(n),o=0,s=r<=1?RA(a):zA(r,a);function c(){let t=s.get(arguments);if(t===AA){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var UA=class{constructor(e){this.value=e}deref(){return this.value}},WA=typeof WeakRef<`u`?WeakRef:UA,GA=0,KA=1;function qA(){return{s:GA,v:void 0,o:null,p:null}}function JA(e,t={}){let n=qA(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=qA(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=qA(),e.set(n,t)):t=r}}let s=t,c;if(t.s===KA)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new WA(c):c}return s.s=KA,s.v=c,c}return o.clearCache=()=>{n=qA(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function YA(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),jA(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=JA,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=PA(c),p=PA(u),m=FA(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=!0,_=l(function(){r++;let e=IA(m,arguments);if(i=h.apply(null,e),process.env.NODE_ENV!==`production`){let{identityFunctionCheck:t,inputStabilityCheck:n}=LA(g,d);if(t.shouldRun&&t.run(o,e,i),n.shouldRun){let t=IA(m,arguments);n.run({inputSelectorResults:e,inputSelectorResultsCopy:t},{memoize:s,memoizeOptions:f},arguments)}g&&=!1}return i},...p);return Object.assign(_,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var XA=YA(JA),ZA=Object.assign((e,t=XA)=>{MA(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>ZA});YA({memoize:HA,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});var $=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(process.env.NODE_ENV===`production`?xx(1):`Unsupported number of selectors`);let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},QA=Fx(19)?tj:nj;function $A(e,t,n,r,i){return QA(e,t,n,r,i)}function ej(e,t,n,r,i){let a=f.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,v.useSyncExternalStore)(e.subscribe,a,a)}dT({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,v.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function tj(e,t,n,r,i){let a=uT();if(!a)return ej(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function nj(e,t,n,r,i){return(0,qf.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var rj=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return $A(this,e,t,n,r)}},ij=class extends rj{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){f.useDebugValue(e),Y(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;Y(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;if(process.env.NODE_ENV!==`production`){f.useDebugValue(e,e=>Object.keys(e));let t=f.useRef(Object.keys(e)).current,n=Object.keys(e);(t.length!==n.length||t.some((e,t)=>e!==n[t]))&&console.error(`ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.`)}Y(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){f.useDebugValue(e);let n=t!==void 0;if(Y(()=>{n&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n]),process.env.NODE_ENV!==`production`){let t=this.controlledValues??=new Map;t.has(e)||t.set(e,n);let r=t.get(e);r!==void 0&&r!==n&&console.error(`A component is changing the ${n?``:`un`}controlled state of ${e.toString()} to be ${n?`un`:``}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return f.useDebugValue(e),$A(this,this.selectors[e],t,n,r)}useContextCallback(e,t){f.useDebugValue(e);let n=J(t??Hx);this.context[e]=n}useStateSetter(e){let t=f.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},aj={open:$(e=>e.open),domReferenceElement:$(e=>e.domReferenceElement),referenceElement:$(e=>e.positionReference??e.referenceElement),floatingElement:$(e=>e.floatingElement),floatingId:$(e=>e.floatingId)},oj=class extends ij{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:FO(),nested:t,noEmit:n,triggerElements:i},aj)}setOpen=(e,t)=>{if((!e||!this.state.open||aE(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}this.context.onOpenChange?.(e,t)}};function sj(e,t=!1,n=!1){let[r,i]=f.useState(e&&t?`idle`:void 0),[a,o]=f.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),Y(()=>{if(!e&&a&&r!==`ending`&&n){let e=oO.request(()=>{i(`ending`)});return()=>{oO.cancel(e)}}},[e,a,r,n]),Y(()=>{if(!e||t)return;let n=oO.request(()=>{i(void 0)});return()=>{oO.cancel(n)}},[t,e]),Y(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=oO.request(()=>{i(`idle`)});return()=>{oO.cancel(n)}},[t,e,a,i,r]),f.useMemo(()=>({mounted:a,setMounted:o,transitionStatus:r}),[a,r])}var cj=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),lj={[cj.startingStyle]:``},uj={[cj.endingStyle]:``},dj={transitionStatus(e){return e===`starting`?lj:e===`ending`?uj:null}};function fj(e,t=!1,n=!0){let r=sO();return J((i,a=null)=>{r.cancel();function o(){p.flushSync(i)}let s=WO(e);if(s==null)return;let c=s;if(typeof c.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{function e(){let e=cj.startingStyle;if(!c.hasAttribute(e)){r.request(i);return}let t=new MutationObserver(()=>{c.hasAttribute(e)||(t.disconnect(),i())});t.observe(c,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}function i(){Promise.all(c.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||o()}).catch(()=>{let e=c.getAnimations();if(n){if(a?.aborted)return;o()}else e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&i()})}if(t){e();return}r.request(i)}})}function pj(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=J(i),o=fj(r,n,!1);f.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}function mj(e,t){let n=f.useRef(null),r=f.useRef(null);return f.useCallback(i=>{if(e!==void 0){if(n.current!==null){let e=n.current,i=r.current,a=t.context.triggerElements.getById(e);i&&a===i&&t.context.triggerElements.delete(e),n.current=null,r.current=null}i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function hj(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=mj(e,n),o=J(t=>{if(a(t),!t||!n.select(`open`))return;let i=n.select(`activeTriggerId`);if(i===e){n.update({activeTriggerElement:t,...r});return}i??n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return Y(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function gj(e){let t=e.useState(`open`);Y(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function _j(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=sj(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=J(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return pj({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var vj=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);if(n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t),process.env.NODE_ENV!==`production`&&this.elementsSet.size!==this.idMap.size))throw Error(`Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.`)}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function yj(){return new oj({open:!1,floatingElement:null,referenceElement:null,triggerElements:new vj,floatingId:``,nested:!1,noEmit:!1,onOpenChange:void 0})}function bj(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:`idle`,floatingRootContext:yj(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Wx,inactiveTriggerProps:Wx,popupProps:Wx}}var xj=$(e=>e.triggerIdProp??e.activeTriggerId),Sj={open:$(e=>e.openProp??e.open),mounted:$(e=>e.mounted),transitionStatus:$(e=>e.transitionStatus),floatingRootContext:$(e=>e.floatingRootContext),preventUnmountingOnClose:$(e=>e.preventUnmountingOnClose),payload:$(e=>e.payload),activeTriggerId:xj,activeTriggerElement:$(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:$((e,t)=>t!==void 0&&xj(e)===t),isOpenedByTrigger:$((e,t)=>t!==void 0&&xj(e)===t&&e.open),isMountedByTrigger:$((e,t)=>t!==void 0&&xj(e)===t&&e.mounted),triggerProps:$((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:$(e=>e.popupProps),popupElement:$(e=>e.popupElement),positionerElement:$(e=>e.positionerElement)};function Cj(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=kO(),a=zO()!=null;if(process.env.NODE_ENV!==`production`){let e=r.reference;e&&!Mb(e)&&console.error("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `context.setPositionReference()`",`instead.`)}let o=$b(()=>new oj({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new vj,floatingId:i,nested:a,noEmit:!1})).current;return Y(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Mb(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o.context.noEmit=!1,o}function wj(e={}){let{nodeId:t,externalTree:n}=e,r=Cj(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=f.useState(null),c=f.useRef(null),l=BO(n);Y(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let u=bA({...e,elements:{...a,...o&&{reference:o}}}),d=f.useCallback(e=>{let t=Mb(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[p,m]=f.useState(null),[h,g]=f.useState(null);i.useSyncedValue(`referenceElement`,p),i.useSyncedValue(`domReferenceElement`,Mb(p)?p:null),i.useSyncedValue(`floatingElement`,h);let _=f.useCallback(e=>{(Mb(e)||e===null)&&(c.current=e,m(e)),(Mb(u.refs.reference.current)||u.refs.reference.current===null||e!==null&&!Mb(e))&&u.refs.setReference(e)},[u.refs,m]),v=f.useCallback(e=>{g(e),u.refs.setFloating(e)},[u.refs]),y=f.useMemo(()=>({...u.refs,setReference:_,setFloating:v,setPositionReference:d,domReference:c}),[u.refs,_,v,d]),b=f.useMemo(()=>({...u.elements,domReference:a.domReference}),[u.elements,a.domReference]),x=i.useState(`open`),S=i.useState(`floatingId`),C=f.useMemo(()=>({...u,dataRef:i.context.dataRef,open:x,onOpenChange:i.setOpen,events:i.context.events,floatingId:S,refs:y,elements:b,nodeId:t,rootStore:i}),[u,y,b,t,i,x,S]);return Y(()=>{i.context.dataRef.current.floatingContext=C;let e=l?.nodesRef.current.find(e=>e.id===t);e&&(e.context=C)}),f.useMemo(()=>({...u,context:C,refs:y,elements:b,rootStore:i}),[u,y,b,C,i])}function Tj(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,a=kO(),o=zO()!=null,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(r?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=$b(()=>new oj({open:s,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:i,floatingId:a,nested:o,noEmit:n})).current;return Y(()=>{let e={open:s,floatingId:a,referenceElement:c,floatingElement:l};Mb(c)&&(e.domReferenceElement=c),d.state.positionReference===d.state.referenceElement&&(e.positionReference=c),d.update(e)},[s,a,c,l,d]),d.context.onOpenChange=i,d.context.nested=o,d.context.noEmit=n,d}var Ej=jT&&kT;function Dj(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,delay:o}=t,s=f.useRef(!1),c=f.useRef(null),l=ST(),u=f.useRef(!0);f.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=kb(e);function r(){let e=n.select(`domReferenceElement`);!n.select(`open`)&&Nb(e)&&e===HT(CD(e))&&(s.current=!0)}function i(){u.current=!0}function o(){u.current=!1}return t.addEventListener(`blur`,r),Ej&&(t.addEventListener(`keydown`,i,!0),t.addEventListener(`pointerdown`,o,!0)),()=>{t.removeEventListener(`blur`,r),Ej&&(t.removeEventListener(`keydown`,i,!0),t.removeEventListener(`pointerdown`,o,!0))}},[n,a]),f.useEffect(()=>{if(!a)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=n.select(`domReferenceElement`);Mb(e)&&(c.current=e,s.current=!0)}}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a,n]);let d=f.useMemo(()=>({onMouseLeave(){s.current=!1,c.current=null},onFocus(e){let t=e.currentTarget;if(s.current){if(c.current===t)return;s.current=!1,c.current=null}let r=GT(e.nativeEvent);if(Mb(r)){if(Ej&&!e.relatedTarget){if(!u.current&&!JT(r))return}else if(!XT(r))return}let i=WT(e.relatedTarget,n.context.triggerElements),{nativeEvent:a,currentTarget:d}=e,f=typeof o==`function`?o():o;if(n.select(`open`)&&i||f===0||f===void 0){n.setOpen(!0,ZD(VD,a,d));return}l.start(f,()=>{s.current||n.setOpen(!0,ZD(VD,a,d))})},onBlur(e){s.current=!1,c.current=null;let t=e.relatedTarget,r=e.nativeEvent,a=Mb(t)&&t.hasAttribute(dO(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let e=n.select(`domReferenceElement`),o=HT(e?e.ownerDocument:document);!t&&o===e||UT(i.current.floatingContext?.refs.floating.current,o)||UT(e,o)||a||WT(t??o,n.context.triggerElements)||n.setOpen(!1,ZD(VD,r))})}}),[i,n,l,o]);return f.useMemo(()=>a?{reference:d,trigger:d}:{},[a,d])}var Oj=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${LT}`;function kj(e){return e?!!e.closest(Oj):!1}var Aj=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new xT,this.restTimeout=new xT,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose};function jj(e){e.performedPointerEventsMutation&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null)}function Mj(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t;jj(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Nj(e){let t=$b(Aj.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||=t,yT(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function Pj(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0}=t,l=Nj(n),u=BO(),d=zO(),p=J(()=>LD(o.current.openEvent?.type,l.interactedInside)),m=J(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),h=J(e=>WT(e,n.context.triggerElements)),g=f.useCallback(e=>{let t=FD(c,`close`,l.pointerType),r=()=>{n.setOpen(!1,ZD(BD,e)),u?.events.emit(`floating.closed`,e)};t?l.openChangeTimeout.start(t,r):(l.openChangeTimeout.clear(),r())},[c,n,l,u]),_=J(()=>{jj(l)}),v=J(e=>{let t=GT(e);if(!kj(t)){l.interactedInside=!1;return}l.interactedInside=t?.closest(`[aria-haspopup]`)!=null});Y(()=>{r||(l.pointerType=void 0,l.restTimeoutPending=!1,l.interactedInside=!1,_())},[r,l,_]),f.useEffect(()=>_,[_]),Y(()=>{if(s&&r&&l.handleCloseOptions?.blockPointerEvents&&m()&&Mb(a)&&i){let e=a,t=i,n=CD(i),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),Mj(l,{scopeElement:l.handleCloseOptions?.getScope?.()??l.pointerEventsScopeElement??r??e.closest(`[data-rootownerid]`)??n.body,referenceElement:e,floatingElement:t}),()=>{_()}}},[s,r,a,i,l,m,u,d,_]);let y=ST();f.useEffect(()=>{if(!s)return;function e(){l.openChangeTimeout.clear(),y.clear(),u?.events.off(`floating.closed`,r),_()}function t(e){if(u&&d&&QT(u.nodesRef.current,d).length>0){u.events.on(`floating.closed`,r);return}if(!h(e.relatedTarget)){if(l.handler){l.handler(e);return}_(),p()||g(e)}}function r(e){!u||!d||QT(u.nodesRef.current,d).length>0||y.start(0,()=>{u.events.off(`floating.closed`,r),n.setOpen(!1,ZD(BD,e)),u.events.emit(`floating.closed`,e)})}let a=i;return a&&(a.addEventListener(`mouseenter`,e),a.addEventListener(`mouseleave`,t),a.addEventListener(`pointerdown`,v,!0)),()=>{a&&(a.removeEventListener(`mouseenter`,e),a.removeEventListener(`mouseleave`,t),a.removeEventListener(`pointerdown`,v,!0)),u?.events.off(`floating.closed`,r)}},[s,i,n,o,p,h,g,_,v,l,u,d,y])}var Fj={current:null};function Ij(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=Fj,externalTree:m,isActiveTrigger:h=!0,getHandleCloseContext:g}=t,_=BO(m),v=Nj(n),y=tO(s),b=tO(o),x=tO(l),S=tO(a);h&&(v.handleCloseOptions=y.current?.__options);let C=J(()=>LD(r.current.openEvent?.type,v.interactedInside)),w=J(e=>WT(e,n.context.triggerElements)),T=J((e,t,r)=>{let i=n.context.triggerElements;if(i.hasElement(t))return!e||!UT(e,t);if(!Mb(r))return!1;let a=r;return i.hasMatchingElement(e=>UT(e,a))&&(!e||!UT(e,a))}),E=f.useCallback((e,t=!0)=>{let r=FD(b.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{n.setOpen(!1,ZD(BD,e)),_?.events.emit(`floating.closed`,e)}):t&&(v.openChangeTimeout.clear(),n.setOpen(!1,ZD(BD,e)),_?.events.emit(`floating.closed`,e))},[b,n,v,_]),D=J(()=>{v.handler&&=(CD(n.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)});f.useEffect(()=>D,[D]);let O=J(()=>{jj(v)});return f.useEffect(()=>{if(!a)return;function e(e){e.open||(D(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,v,D]),f.useEffect(()=>{if(!a)return;let e=d.current??(h?n.select(`domReferenceElement`):null);if(!Mb(e))return;function t(e){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,c&&!iE(v.pointerType)||ID(x.current)>0&&!FD(b.current,`open`))return;let t=FD(b.current,`open`,v.pointerType),r=e.currentTarget??null,i=n.select(`domReferenceElement`),a=r==null?!1:T(i,r,e.target),o=n.select(`open`),s=!o||a;a&&o?n.setOpen(!0,ZD(BD,e,r)):t?v.openChangeTimeout.start(t,()=>{s&&n.setOpen(!0,ZD(BD,e,r))}):s&&n.setOpen(!0,ZD(BD,e,r))}function i(e){if(C()){O();return}D();let t=CD(n.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=r.current.floatingContext??g?.();if(!w(e.relatedTarget)){if(y.current&&i){n.select(`open`)||v.openChangeTimeout.clear();let r=d.current;v.handler=y.current({...i,tree:_,x:e.clientX,y:e.clientY,onClose(){O(),D(),S.current&&!C()&&r===n.select(`domReferenceElement`)&&E(e,!0)}}),t.addEventListener(`mousemove`,v.handler),v.handler(e);return}(v.pointerType!==`touch`||!UT(n.select(`floatingElement`),e.relatedTarget))&&E(e)}}return u&&e.addEventListener(`mousemove`,t,{once:!0}),e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,i),()=>{u&&e.removeEventListener(`mousemove`,t),e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,i)}},[D,O,r,b,E,n,a,y,v,h,T,C,w,c,u,x,d,_,S,g]),f.useMemo(()=>{if(!a)return;function e(e){v.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.select(`open`),o=T(i,r,e.target);if(c&&!iE(v.pointerType))return;let s=ID(x.current);if(a&&!o||s===0||!o&&v.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,C())return;let e=n.select(`open`);!v.blockMouseMove&&(!e||o)&&n.setOpen(!0,ZD(BD,t,r))}v.pointerType===`touch`?p.flushSync(()=>{l()}):o&&a?l():(v.restTimeoutPending=!0,v.restTimeout.start(s,l))}}},[a,v,C,T,c,n,x])}function Lj(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=f.useCallback(t=>Rj(t,e,`reference`),t),o=f.useCallback(t=>Rj(t,e,`floating`),n),s=f.useCallback(t=>Rj(t,e,`item`),r),c=f.useCallback(t=>Rj(t,e,`trigger`),i);return f.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function Rj(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[IT]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&zj(a,s,i,r)}return zj(a,e,i,r),a}function zj(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var Bj=`Escape`;function Vj(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Hj(e,t){return Vj(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Uj(e,t,n){return Vj(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Wj(e,t,n){return Vj(t,n?e===RT:e===zT,e===VT)}function Gj(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===Bj:Vj(t,n?e===zT:e===RT,e===BT)}function Kj(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{listRef:s,activeIndex:c,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:p=!1,loopFocus:m=!1,nested:h=!1,rtl:g=!1,virtual:_=!1,focusItemOnOpen:v=`auto`,focusItemOnHover:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:x=void 0,orientation:S=`vertical`,parentOrientation:C,cols:w=1,id:T,resetOnPointerLeave:E=!0,externalTree:D}=t;process.env.NODE_ENV!==`production`&&(p&&(m||console.warn("`useListNavigation` looping must be enabled to allow escaping."),_||console.warn("`useListNavigation` must be virtual to allow escaping.")),S===`vertical`&&w>1&&console.warn("In grid list navigation mode (`cols` > 1), the `orientation` should",`be either "horizontal" or "both".`));let O=tO(ZT(i)),k=zO(),A=BO(D);Y(()=>{o.current.orientation=S},[o,S]);let j=YT(a),M=f.useRef(v),N=f.useRef(d??-1),P=f.useRef(null),F=f.useRef(!0),I=J(e=>{l(N.current===-1?null:N.current,e)}),L=f.useRef(I),R=f.useRef(!!i),z=f.useRef(r),B=f.useRef(!1),ee=f.useRef(!1),te=tO(x),ne=tO(r),re=tO(d),ie=tO(E),V=J(()=>{function e(e){_?A?.events.emit(`virtualfocus`,e):pO(e,{sync:B.current,preventScroll:!0})}let t=s.current[N.current],n=ee.current;t&&e(t),(B.current?e=>e():requestAnimationFrame)(()=>{let r=s.current[N.current]||t;r&&(t||e(r),ae&&(n||!F.current)&&r.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Y(()=>{u&&(r&&i?(N.current=d??-1,M.current&&d!=null&&(ee.current=!0,I())):R.current&&(N.current=-1,L.current()))},[u,r,i,d,I]),Y(()=>{if(u){if(!r){B.current=!1;return}if(i)if(c==null){if(B.current=!1,re.current!=null)return;if(R.current&&(N.current=-1,V()),(!z.current||!R.current)&&M.current&&(P.current!=null||M.current===!0&&P.current==null)){let e=0,t=()=>{s.current[0]==null?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e+=1):(N.current=P.current==null||Uj(P.current,S,g)||h?RE(s):zE(s),P.current=null,I())};t()}}else LE(s,c)||(N.current=c,V(),ee.current=!1)}},[u,r,i,c,re,h,s,S,g,I,V,te]),Y(()=>{if(!u||i||!A||_||!R.current)return;let e=A.nodesRef.current,t=e.find(e=>e.id===k)?.context?.elements.floating,n=HT(CD(i)),r=e.some(e=>e.context&&UT(e.context.elements.floating,n));t&&!r&&F.current&&t.focus({preventScroll:!0})},[u,i,A,k,_]),Y(()=>{L.current=I,z.current=r,R.current=!!i}),Y(()=>{r||(P.current=null,M.current=v)},[r,v]);let H=c!=null,ae=f.useMemo(()=>{function e(e){if(!ne.current)return;let t=s.current.indexOf(e.currentTarget);t!==-1&&N.current!==t&&(N.current=t,I(e))}return{onFocus(t){B.current=!0,e(t)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(t){B.current=!0,ee.current=!1,y&&e(t)},onPointerLeave(e){if(!ne.current||!F.current||e.pointerType===`touch`)return;B.current=!0;let t=e.relatedTarget;if(!(!y||s.current.includes(t))&&ie.current&&(pO(null,{sync:!0}),N.current=-1,I(e),!_)){let e=O.current,t=HT(CD(e));e&&UT(e,t)&&e.focus({preventScroll:!0})}}}},[ne,O,y,s,I,ie,_]),oe=f.useCallback(()=>C??A?.nodesRef.current.find(e=>e.id===k)?.context?.dataRef?.current.orientation,[k,A,C]),se=J(e=>{if(F.current=!1,B.current=!0,e.which===229||!ne.current&&e.currentTarget===O.current)return;if(h&&Gj(e.key,S,g,w)){Hj(e.key,oe())||eE(e),n.setOpen(!1,ZD(KD,e.nativeEvent)),Nb(a)&&(_?A?.events.emit(`virtualfocus`,a):a.focus());return}let t=N.current,i=RE(s,x),o=zE(s,x);if(j||(e.key===`Home`&&(eE(e),N.current=i,I(e)),e.key===`End`&&(eE(e),N.current=o,I(e))),w>1){let t=Array.from({length:s.current.length},()=>({width:1,height:1})),n=HE(t,w,!1),r=n.findIndex(e=>e!=null&&!GE(s,e,x)),a=n.reduce((e,t,n)=>t!=null&&!GE(s,t,x)?n:e,-1),c=n[VE({current:n.map(e=>e==null?null:s.current[e])},{event:e,orientation:S,loopFocus:m,rtl:g,cols:w,disabledIndices:WE([...(typeof x==`function`?null:x)||s.current.map((e,t)=>GE(s,t,x)?t:void 0),void 0],n),minIndex:r,maxIndex:a,prevIndex:UE(N.current>o?i:N.current,t,n,w,e.key===`ArrowDown`?`bl`:e.key===(g?`ArrowLeft`:`ArrowRight`)?`tr`:`tl`),stopEvent:!0})];if(c!=null&&(N.current=c,I(e)),S===`both`)return}if(Hj(e.key,S)){if(eE(e),r&&!_&&HT(e.currentTarget.ownerDocument)===e.currentTarget){N.current=Uj(e.key,S,g)?i:o,I(e);return}Uj(e.key,S,g)?m?t>=o?p&&t!==s.current.length?N.current=-1:(B.current=!1,N.current=i):N.current=BE(s,{startingIndex:t,disabledIndices:x}):N.current=Math.min(o,BE(s,{startingIndex:t,disabledIndices:x})):m?t<=i?p&&t!==-1?N.current=s.current.length:(B.current=!1,N.current=o):N.current=BE(s,{startingIndex:t,decrement:!0,disabledIndices:x}):N.current=Math.max(i,BE(s,{startingIndex:t,decrement:!0,disabledIndices:x})),LE(s,N.current)&&(N.current=-1),I(e)}}),ce=f.useMemo(()=>_&&r&&H&&{"aria-activedescendant":`${T}-${c}`},[_,r,H,T,c]),le=f.useMemo(()=>({"aria-orientation":S===`both`?void 0:S,...j?{}:ce,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&r&&!_){let t=GT(e.nativeEvent);if(t&&!UT(O.current,t))return;eE(e),n.setOpen(!1,ZD(WD,e.nativeEvent)),Nb(a)&&a.focus();return}se(e)},onPointerMove(){F.current=!0}}),[ce,se,O,S,j,n,r,_,a]),ue=f.useMemo(()=>{function e(e){v===`auto`&&nE(e.nativeEvent)&&(M.current=!_)}function t(e){M.current=v,v===`auto`&&rE(e.nativeEvent)&&(M.current=!0)}return{onKeyDown(e){let t=n.select(`open`);F.current=!1;let r=e.key.startsWith(`Arrow`),i=Wj(e.key,oe(),g),a=Hj(e.key,S),o=(h?i:a)||e.key===`Enter`||e.key.trim()===``;if(_&&t)return se(e);if(!(!t&&!b&&r)){if(o){let t=Hj(e.key,oe());P.current=h&&t?null:e.key}if(h){i&&(eE(e),t?(N.current=RE(s,te.current),I(e)):n.setOpen(!0,ZD(KD,e.nativeEvent,e.currentTarget)));return}a&&(re.current!=null&&(N.current=re.current),eE(e),!t&&b?n.setOpen(!0,ZD(KD,e.nativeEvent,e.currentTarget)):se(e),t&&I(e))}},onFocus(e){n.select(`open`)&&!_&&(N.current=-1,I(e))},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[se,te,v,s,h,I,n,b,S,oe,g,re,_]),de=f.useMemo(()=>({...ce,...ue}),[ce,ue]);return f.useMemo(()=>u?{reference:de,floating:le,item:ae,trigger:ue}:{},[u,de,le,ue,ae])}var qj=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Jj(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{role:s=`dialog`}=t,c=kO(),l=a?.id||c,u=f.useMemo(()=>ZT(o)?.id||i,[o,i]),d=qj.get(s)??s,p=zO()!=null,m=f.useMemo(()=>d===`tooltip`||s===`label`?Wx:{"aria-haspopup":d===`alertdialog`?`dialog`:d,"aria-expanded":`false`,...d===`listbox`&&{role:`combobox`},...d===`menu`&&p&&{role:`menuitem`},...s===`select`&&{"aria-autocomplete":`none`},...s===`combobox`&&{"aria-autocomplete":`list`}},[d,p,s]),h=f.useMemo(()=>d===`tooltip`||s===`label`?{[`aria-${s===`label`?`labelledby`:`describedby`}`]:r?u:void 0}:{...m,"aria-expanded":r?`true`:`false`,"aria-controls":r?u:void 0,...d===`menu`&&{id:l}},[d,u,r,l,s,m]),g=f.useMemo(()=>{let e={id:u,...d&&{role:d}};return d===`tooltip`||s===`label`?e:{...e,...d===`menu`&&{"aria-labelledby":l}}},[d,u,l,s]),_=f.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${u}-fui-option`}};switch(s){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[u,s]);return f.useMemo(()=>({reference:h,floating:g,item:_,trigger:m}),[h,g,m,_])}function Yj(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,i=n.useState(`open`),{listRef:a,elementsRef:o,activeIndex:s,onMatch:c,onTypingChange:l,enabled:u=!0,resetMs:d=750,selectedIndex:p=null}=t,m=ST(),h=f.useRef(``),g=f.useRef(p??s??-1),_=f.useRef(null);Y(()=>{!i&&p!==null||(m.clear(),_.current=null,h.current!==``&&(h.current=``))},[i,p,m]),Y(()=>{i&&h.current===``&&(g.current=p??s??-1)},[i,p,s]);let v=J(e=>{e?r.current.typing||(r.current.typing=e,l?.(e)):r.current.typing&&(r.current.typing=e,l?.(e))}),y=J(e=>{function t(e){let t=o?.current[e];return!t||KE(t)}function n(e,n,r=0){if(e.length===0)return-1;let i=(r%e.length+e.length)%e.length,a=n.toLocaleLowerCase();for(let n=0;n<e.length;n+=1){let r=(i+n)%e.length;if(!(!e[r]?.toLocaleLowerCase().startsWith(a)||!t(r)))return r}return-1}let r=a.current;if(h.current.length>0&&e.key===` `&&(eE(e),v(!0)),h.current.length>0&&h.current[0]!==` `&&n(r,h.current)===-1&&e.key!==` `&&v(!1),r==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;i&&e.key!==` `&&(eE(e),v(!0));let l=h.current===``;l&&(g.current=p??s??-1),r.every(e=>e?e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(d,()=>{h.current=``,g.current=_.current,v(!1)});let u=((l?p??s??-1:g.current)??0)+1,f=n(r,h.current,u);f===-1?e.key!==` `&&(h.current=``,v(!1)):(c?.(f),_.current=f)}),b=J(e=>{let t=e.relatedTarget,r=n.select(`domReferenceElement`),i=n.select(`floatingElement`),a=UT(r,t),o=UT(i,t);a||o||(m.clear(),h.current=``,g.current=_.current,v(!1))}),x=f.useMemo(()=>({onKeyDown:y,onBlur:b}),[y,b]),S=f.useMemo(()=>({onKeyDown:y,onBlur:b}),[y,b]);return f.useMemo(()=>u?{reference:x,floating:S}:{},[u,x,S])}var Xj=.1,Zj=Xj*Xj,Qj=.5;function $j(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function eM(e,t,n,r,i,a,o,s,c,l){let u=!1;return $j(e,t,n,r,i,a)&&(u=!u),$j(e,t,i,a,o,s)&&(u=!u),$j(e,t,o,s,c,l)&&(u=!u),$j(e,t,c,l,n,r)&&(u=!u),u}function tM(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function nM(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function rM(e={}){let{blockPointerEvents:t=!1}=e,n=new xT,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Zj;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=GT(r),g=r.type===`mouseleave`,_=UT(u,h),v=UT(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&Mb(r.relatedTarget)&&UT(u,r.relatedTarget))return;function y(){return!!(s&&QT(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=nM(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=nM(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=nM(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=nM(d,f,x.right-1,A,S.left+1,k);break;default:}if(j)return;if(l&&!tM(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Qj/2:Qj*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Qj+1,o=C||T?S.bottom-Qj:S.top,s=C?T?S.bottom-Qj:S.top:S.bottom-Qj;M=eM(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Qj/2:Qj*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Qj,o=C||T?S.top+Qj:S.bottom,s=C?T?S.top+Qj:S.bottom:S.top+Qj;M=eM(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Qj/2:Qj*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Qj+1,o=w||E?S.right-Qj:S.left,s=w?E?S.right-Qj:S.left:S.right-Qj;M=eM(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Qj/2:Qj*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Qj,o=w||E?S.left+Qj:S.right,s=w?E?S.left+Qj:S.right:S.left+Qj;M=eM(d,f,a,r,a,i,o,S.top,s,S.bottom);break}default:}M?l||n.start(40,b):b()}};return r.__options={blockPointerEvents:t},r}var iM={...Sj,disabled:$(e=>e.disabled),instantType:$(e=>e.instantType),isInstantPhase:$(e=>e.isInstantPhase),trackCursorAxis:$(e=>e.trackCursorAxis),disableHoverablePopup:$(e=>e.disableHoverablePopup),lastOpenChangeReason:$(e=>e.openChangeReason),closeOnClick:$(e=>e.closeOnClick),closeDelay:$(e=>e.closeDelay),hasViewport:$(e=>e.hasViewport)},aM=class e extends ij{constructor(e){super({...oM(),...e},{popupRef:f.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new vj},iM)}setOpen=(e,t)=>{let n=t.reason,r=n===BD,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?p.flushSync(o):o()};static useStore(t,n){let r=$b(()=>new e(n)).current,i=t??r,a=Tj({popupStore:i,onOpenChange:i.setOpen});return i.state.floatingRootContext=a,i}};function oM(){return{...bj(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var sM=fT(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:p}=e,h=aM.useStore(l?.store,{open:n,openProp:r,activeTriggerId:d,triggerIdProp:u});hT(()=>{r===void 0&&h.state.open===!1&&n===!0&&h.update({open:!0,activeTriggerId:d})}),h.useControlledProp(`openProp`,r),h.useControlledProp(`triggerIdProp`,u),h.useContextCallback(`onOpenChange`,s),h.useContextCallback(`onOpenChangeComplete`,c);let g=h.useState(`open`),_=!t&&g,v=h.useState(`activeTriggerId`),y=h.useState(`payload`);h.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i}),Y(()=>{g&&t&&h.setOpen(!1,ZD(YD))},[g,t,h]),h.useSyncedValue(`disabled`,t),gj(h);let{forceUnmount:b,transitionStatus:x}=_j(_,h),S=h.useState(`isInstantPhase`),C=h.useState(`instantType`),w=h.useState(`lastOpenChangeReason`),T=f.useRef(null);Y(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),h.set(`instantType`,`delay`)):T.current!==null&&(h.set(`instantType`,T.current),T.current=null)},[x,S,w,C,h]),Y(()=>{_&&(v??h.set(`payload`,void 0))},[h,v,_]);let E=f.useCallback(()=>{h.setOpen(!1,cM(h,XD))},[h]);f.useImperativeHandle(o,()=>({unmount:b,close:E}),[b,E]);let D=h.useState(`floatingRootContext`),{getReferenceProps:O,getFloatingProps:k,getTriggerProps:A}=Lj([ck(D,{enabled:!t,referencePress:()=>h.select(`closeOnClick`)}),ik(D,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),j=f.useMemo(()=>O(),[O]),M=f.useMemo(()=>A(),[A]),N=f.useMemo(()=>k(),[k]);return h.useSyncedValues({activeTriggerProps:j,inactiveTriggerProps:M,popupProps:N}),(0,m.jsx)(gT.Provider,{value:h,children:typeof p==`function`?p({payload:y}):p})});process.env.NODE_ENV!==`production`&&(sM.displayName=`TooltipRoot`);function cM(e,t){let n=ZD(t);return n.preventUnmountOnClose=()=>{e.set(`preventUnmountingOnClose`,!0)},n}var lM=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=cj.startingStyle]=`startingStyle`,e[e.endingStyle=cj.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),uM=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),dM={[uM.popupOpen]:``},fM={[uM.popupOpen]:``,[uM.pressed]:``},pM={[lM.open]:``},mM={[lM.closed]:``},hM={[lM.anchorHidden]:``},gM={open(e){return e?dM:null}},_M={open(e){return e?fM:null}},vM={open(e){return e?pM:mM},anchorHidden(e){return e?hM:null}};function yM(e){return kO(e,`base-ui`)}var bM=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(bM.displayName=`TooltipProviderContext`);function xM(){return f.useContext(bM)}var SM=function(e){return e[e.popupOpen=uM.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({}),CM=pT(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeOnClick:c=!0,closeDelay:l,id:u,...d}=e,p=_T(!0),m=i?.store??p;if(!m)throw Error(process.env.NODE_ENV===`production`?xx(82):`Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.`);let h=yM(u),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=f.useRef(null),b=s??600,x=l??0,{registerTrigger:S,isMountedByThisTrigger:C}=hj(h,y,m,{payload:a,closeOnClick:c,closeDelay:x}),w=xM(),{delayRef:T,isInstantPhase:E,hasProvider:D}=eO(v,{open:_});m.useSyncedValue(`isInstantPhase`,E);let O=m.useState(`disabled`),k=o??O,A=m.useState(`trackCursorAxis`),j=m.useState(`disableHoverablePopup`),M=Ij(v,{enabled:!k,mouseOnly:!0,move:!1,handleClose:!j&&A!==`both`?rM():null,restMs(){let e=w?.delay,t=typeof T.current==`object`?T.current.open:void 0,n=b;return D&&(n=t===0?0:s??e??b),n},delay(){let e=typeof T.current==`object`?T.current.close:void 0,t=x;return l==null&&D&&(t=e),{close:t}},triggerElementRef:y,isActiveTrigger:g}),N=Dj(v,{enabled:!k}).reference,P={open:_},F=m.useState(`triggerProps`,C);return Xx(`button`,e,{state:P,ref:[t,S,y],props:[M,N,F,{onPointerDown(){m.set(`closeOnClick`,c)},id:h,[SM.triggerDisabled]:k?``:void 0},d],stateAttributesMapping:gM})});process.env.NODE_ENV!==`production`&&(CM.displayName=`TooltipTrigger`);var wM=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(wM.displayName=`TooltipPortalContext`);function TM(){let e=f.useContext(wM);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?xx(70):`Base UI: <Tooltip.Portal> is missing.`);return e}var EM=f.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,...o}=e,{portalNode:s,portalSubtree:c}=NO({container:r,ref:t,componentProps:e,elementProps:o});return!c&&!s?null:(0,m.jsxs)(f.Fragment,{children:[c,s&&p.createPortal(n,s)]})});process.env.NODE_ENV!==`production`&&(EM.displayName=`FloatingPortalLite`);var DM=f.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return _T().useState(`mounted`)||n?(0,m.jsx)(wM.Provider,{value:n,children:(0,m.jsx)(EM,{ref:t,...r})}):null});process.env.NODE_ENV!==`production`&&(DM.displayName=`TooltipPortal`);var OM=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(OM.displayName=`TooltipPositionerContext`);function kM(){let e=f.useContext(OM);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?xx(71):`Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.`);return e}var AM=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(AM.displayName=`DirectionContext`);function jM(){return f.useContext(AM)?.direction??`ltr`}var MM=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=gE(e,t)||{};if(l==null)return{};let f=PE(u),p={x:n,y:r},m=SE(i),h=bE(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=hE(k,j,A),N=!c.arrow&&vE(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),NM=(e,t)=>({...MM(e),options:[e,t]}),PM={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await EA().fn(e)).data?.referenceHidden||a}}}},FM={sideX:`left`,sideY:`top`},IM={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=kb(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:FM};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=CD(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=_E(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:FM.sideX,g=f===`top`?`bottom`:FM.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function LM(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function RM(e,t,n){let{rects:r,placement:i}=e;return{side:LM(t,_E(i),n),align:vE(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function zM(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:p=!1,floatingRootContext:m,mounted:h,collisionAvoidance:g,shiftCrossAxis:_=!1,nodeId:v,adaptiveOrigin:y,lazyFlip:b=!1,externalTree:x}=e,[S,C]=f.useState(null);!h&&S!==null&&C(null);let w=g.side||`flip`,T=g.align||`flip`,E=g.fallbackAxisSide||`end`,D=typeof t==`function`?t:void 0,O=J(D),k=D?O:t,A=tO(t),j=jM()===`rtl`,M=S||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":j?`left`:`right`,"inline-start":j?`right`:`left`}[r],N=a===`center`?M:`${M}-${a}`,P=c,F=r===`bottom`?1:0,I=r===`top`?1:0,L=r===`right`?1:0,R=r===`left`?1:0;typeof P==`number`?P={top:P+F,right:P+R,bottom:P+I,left:P+L}:P&&={top:(P.top||0)+F,right:(P.right||0)+R,bottom:(P.bottom||0)+I,left:(P.left||0)+L};let z={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:P},B=f.useRef(null),ee=tO(i),te=tO(o),ne=[xA(e=>{let t=RM(e,r,j),n=typeof ee.current==`function`?ee.current(t):ee.current,i=typeof te.current==`function`?te.current(t):te.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,j,r])],re=T===`none`&&w!==`shift`,ie=!re&&(l||_||w===`shift`),V=w===`none`?null:wA({...z,padding:{top:P.top+1,right:P.right+1,bottom:P.bottom+1,left:P.left+1},mainAxis:!_&&w===`flip`,crossAxis:T===`flip`?`alignment`:!1,fallbackAxisSideDirection:E}),H=re?null:SA(e=>{let t=CD(e.elements.floating).documentElement;return{...z,rootBoundary:_?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:T!==`none`,crossAxis:ie,limiter:l||_?void 0:CA(e=>{if(!B.current)return{};let{width:t,height:n}=B.current.getBoundingClientRect(),r=xE(_E(e.placement)),i=r===`y`?t:n,a=r===`y`?P.left+P.right:P.top+P.bottom;return{offset:i/2+a/2}})}},[z,l,_,P,T]);w===`shift`||T===`shift`||a===`center`?ne.push(H,V):ne.push(V,H),ne.push(TA({...z,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=window.devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),NM(()=>({element:B.current||document.createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=_E(a),l=xE(c),u=B.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(RM(e,r,j)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,ie&&l===`y`&&b?S:x),{}}},PM,y),Y(()=>{!h&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[h,m]);let ae=f.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:oe,elements:se,x:ce,y:le,middlewareData:ue,update:de,placement:fe,context:pe,isPositioned:me,floatingStyles:he}=wj({rootContext:m,placement:N,middleware:ne,strategy:n,whileElementsMounted:p?void 0:(...e)=>iA(...e,ae),nodeId:v,externalTree:x}),{sideX:ge,sideY:_e}=ue.adaptiveOrigin||FM,ve=me?n:`fixed`,ye=f.useMemo(()=>{let e=y?{position:ve,[ge]:ce,[_e]:le}:{position:ve,...he};return me||(e.opacity=0),e},[y,ve,ge,ce,_e,le,he,me]),be=f.useRef(null);Y(()=>{if(!h)return;let e=A.current,t=typeof e==`function`?e():e,n=(BM(t)?t.current:t)||null;n!==be.current&&(oe.setPositionReference(n),be.current=n)},[h,oe,k,A]),f.useEffect(()=>{if(!h)return;let e=A.current;typeof e!=`function`&&BM(e)&&e.current!==be.current&&(oe.setPositionReference(e.current),be.current=e.current)},[h,oe,k,A]),f.useEffect(()=>{if(p&&h&&se.domReference&&se.floating)return iA(se.domReference,se.floating,de,ae)},[p,h,se,de,ae]);let xe=_E(fe),Se=LM(r,xe,j),Ce=vE(fe)||`center`,we=!!ue.hide?.referenceHidden;Y(()=>{b&&h&&me&&C(xe)},[b,h,me,xe]);let Te=f.useMemo(()=>({position:`absolute`,top:ue.arrow?.y,left:ue.arrow?.x}),[ue.arrow]),Ee=ue.arrow?.centerOffset!==0;return f.useMemo(()=>({positionerStyles:ye,arrowStyles:Te,arrowRef:B,arrowUncentered:Ee,side:Se,align:Ce,physicalSide:xe,anchorHidden:we,refs:oe,context:pe,isPositioned:me,update:de}),[ye,Te,B,Ee,Se,Ce,xe,we,oe,pe,me,de])}function BM(e){return e!=null&&`current`in e}function VM(e){return e===`starting`?Gx:Wx}var HM=f.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:p=5,sticky:h=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=Jx,...v}=e,y=_T(),b=TM(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`trackCursorAxis`),w=y.useState(`disableHoverablePopup`),T=y.useState(`floatingRootContext`),E=y.useState(`instantType`),D=y.useState(`transitionStatus`),O=zM({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:h,arrowPadding:p,disableAnchorTracking:g,keepMounted:b,collisionAvoidance:_,adaptiveOrigin:y.useState(`hasViewport`)?IM:void 0}),k=f.useMemo(()=>{let e={};return(!x||C===`both`||w)&&(e.pointerEvents=`none`),{role:`presentation`,hidden:!S,style:{...O.positionerStyles,...e}}},[x,C,w,S,O.positionerStyles]),A=f.useMemo(()=>({open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,O.side,O.align,O.anchorHidden,C,E]),j=f.useMemo(()=>({...A,arrowRef:O.arrowRef,arrowStyles:O.arrowStyles,arrowUncentered:O.arrowUncentered}),[A,O.arrowRef,O.arrowStyles,O.arrowUncentered]),M=Xx(`div`,e,{state:A,props:[k,VM(D),v],ref:[t,y.useStateSetter(`positionerElement`)],stateAttributesMapping:vM});return(0,m.jsx)(OM.Provider,{value:j,children:M})});process.env.NODE_ENV!==`production`&&(HM.displayName=`TooltipPositioner`);var UM={...vM,...dj},WM=f.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=_T(),{side:o,align:s}=kM(),c=a.useState(`open`),l=a.useState(`instantType`),u=a.useState(`transitionStatus`),d=a.useState(`popupProps`),f=a.useState(`floatingRootContext`);pj({open:c,ref:a.context.popupRef,onComplete(){c&&a.context.onOpenChangeComplete?.(!0)}});let p=a.useState(`disabled`),m=a.useState(`closeDelay`);return Pj(f,{enabled:!p,closeDelay:m}),Xx(`div`,e,{state:{open:c,side:o,align:s,instant:l,transitionStatus:u},ref:[t,a.context.popupRef,a.useStateSetter(`popupElement`)],props:[d,VM(u),i],stateAttributesMapping:UM})});process.env.NODE_ENV!==`production`&&(WM.displayName=`TooltipPopup`);var GM=f.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=_T().useState(`instantType`),{open:o,arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=kM();return Xx(`div`,e,{state:{open:o,side:c,align:l,uncentered:u,instant:a},ref:[t,s],props:[{style:d,"aria-hidden":!0},i],stateAttributesMapping:vM})});process.env.NODE_ENV!==`production`&&(GM.displayName=`TooltipArrow`);var KM=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=f.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=f.useMemo(()=>({open:t,close:n}),[t,n]);return(0,m.jsx)(bM.Provider,{value:i,children:(0,m.jsx)($D,{delay:a,timeoutMs:r,children:e.children})})};process.env.NODE_ENV!==`production`&&(KM.displayName=`TooltipProvider`);function qM(e){return Fx(19)?e:e?`true`:void 0}function JM({delay:e=0,...t}){return(0,m.jsx)(KM,{"data-slot":`tooltip-provider`,delay:e,...t})}function YM({...e}){return(0,m.jsx)(sM,{"data-slot":`tooltip`,...e})}function XM({...e}){return(0,m.jsx)(CM,{"data-slot":`tooltip-trigger`,...e})}function ZM({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,m.jsx)(DM,{children:(0,m.jsx)(HM,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,m.jsxs)(WM,{"data-slot":`tooltip-content`,className:MC(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,m.jsx)(GM,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var QM=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(QM.displayName=`MenuPositionerContext`);function $M(e){let t=f.useContext(QM);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?xx(33):`Base UI: MenuPositionerContext is missing. MenuPositioner parts must be placed within <Menu.Positioner>.`);return t}var eN=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(eN.displayName=`MenuRootContext`);function tN(e){let t=f.useContext(eN);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?xx(36):`Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>.`);return t}var nN=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(nN.displayName=`ContextMenuRootContext`);function rN(e=!0){let t=f.useContext(nN);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?xx(25):`Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>.`);return t}function iN({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=f.useRef(e!==void 0),[a,o]=f.useState(t),s=i?e:a;if(process.env.NODE_ENV!==`production`){f.useEffect(()=>{i!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${i?``:`un`}controlled ${r} state of ${n} to be ${i?`un`:``}controlled.`,`Elements should not switch from uncontrolled to controlled (or vice versa).`,`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.",`More info: https://fb.me/react-controlled-components`].join(`
|
|
251
|
+
`))},[r,n,e]);let{current:a}=f.useRef(t);f.useEffect(()=>{!i&&JSON.stringify(a)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
|
|
252
|
+
`))},[JSON.stringify(t)])}return[s,f.useCallback(e=>{i||o(e)},[])]}function aN(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=rN(!0),d=u!==void 0;return f.useMemo(()=>({id:r,role:`menuitem`,tabIndex:n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:UD})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,d&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||d&&!jT&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!d||e.button===2)&&(!c||c.type===`regular-item`)&&s.current.click()}}),[t,n,r,l,i,a,o,s,u,d,c])}var oN={type:`regular-item`};function sN(e){let{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=f.useRef(null),{getButtonProps:d,buttonRef:p}=Tx({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),m=aN({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),h=f.useCallback(e=>lx(m,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[m,d,c]),g=Ox(u,p);return f.useMemo(()=>({getItemProps:h,itemRef:g}),[h,g])}var cN=f.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});process.env.NODE_ENV!==`production`&&(cN.displayName=`CompositeListContext`);function lN(){return f.useContext(cN)}var uN=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function dN(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=lN(),p=f.useRef(-1),[m,h]=f.useState(a??(i===uN.GuessFromOrder?()=>{if(p.current===-1){let e=d.current;d.current+=1,p.current=e}return p.current}:-1)),g=f.useRef(null),_=f.useCallback(e=>{if(g.current=e,m!==-1&&e!==null&&(l.current[m]=e,u)){let n=t!==void 0;u.current[m]=n?t:r?.current?.textContent??e.textContent}},[m,l,u,t,r]);return Y(()=>{if(a!=null)return;let e=g.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),Y(()=>{if(a==null)return c(e=>{let t=g.current?e.get(g.current)?.index:null;t!=null&&h(t)})},[a,c,h]),f.useMemo(()=>({ref:_,index:m}),[m,_])}var fN=f.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,...l}=e,u=dN({label:a}),d=$M(!0),f=yM(i),{store:p}=tN(),m=p.useState(`isActive`,u.index),h=p.useState(`itemProps`),{getItemProps:g,itemRef:_}=sN({closeOnClick:c,disabled:s,highlighted:m,id:f,store:p,nativeButton:o,nodeId:d?.nodeId,itemMetadata:oN});return Xx(`div`,e,{state:{disabled:s,highlighted:m},props:[h,l,g],ref:[_,t,u.ref]})});process.env.NODE_ENV!==`production`&&(fN.displayName=`MenuItem`);var pN=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(pN.displayName=`ToolbarRootContext`);function mN(e){let t=f.useContext(pN);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?xx(69):`Base UI: ToolbarRootContext is missing. Toolbar parts must be placed within <Toolbar.Root>.`);return t}var hN=`ArrowUp`,gN=`ArrowDown`,_N=`ArrowLeft`,vN=`ArrowRight`,yN=`Home`,bN=new Set([_N,vN]),xN=new Set([hN,gN]),SN=new Set([...bN,...xN]);new Set([...SN,yN,`End`]);var CN=new Set([hN,gN,_N,vN,yN,`End`]),wN={...vM,...dj},TN=f.forwardRef(function(e,t){let{render:n,className:r,finalFocus:i,...a}=e,{store:o}=tN(),{side:s,align:c}=$M(),l=mN(!0)!=null,u=o.useState(`open`),d=o.useState(`transitionStatus`),p=o.useState(`popupProps`),h=o.useState(`mounted`),g=o.useState(`instantType`),_=o.useState(`activeTriggerElement`),v=o.useState(`parent`),y=o.useState(`lastOpenChangeReason`),b=o.useState(`rootId`),x=o.useState(`floatingRootContext`),S=o.useState(`floatingTreeRoot`),C=o.useState(`closeDelay`),w=o.useState(`activeTriggerElement`),T=v.type===`context-menu`;pj({open:u,ref:o.context.popupRef,onComplete(){u&&o.context.onOpenChangeComplete?.(!0)}}),f.useEffect(()=>{function e(e){o.setOpen(!1,ZD(e.reason,e.domEvent))}return S.events.on(`close`,e),()=>{S.events.off(`close`,e)}},[S.events,o]);let E=o.useState(`hoverEnabled`),D=o.useState(`disabled`);Pj(x,{enabled:E&&!D&&!T&&v.type!==`menubar`,closeDelay:C});let O={transitionStatus:d,side:s,align:c,open:u,nested:v.type===`menu`,instant:g},k=f.useCallback(e=>{o.set(`popupElement`,e)},[o]),A=Xx(`div`,e,{state:O,ref:[t,o.context.popupRef,k],stateAttributesMapping:wN,props:[p,{onKeyDown(e){l&&CN.has(e.key)&&e.stopPropagation()}},VM(d),a,{"data-rootownerid":b}]}),j=v.type===void 0||T;return(_||v.type===`menubar`&&y!==`outside-press`)&&(j=!0),(0,m.jsx)(ek,{context:x,modal:T,disabled:!h,returnFocus:i===void 0?j:i,initialFocus:v.type!==`menu`,restoreFocus:!0,externalTree:v.type===`menubar`?void 0:S,previousFocusableElement:w,nextFocusableElement:v.type===void 0?o.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:v.type===void 0?o.context.beforeContentFocusGuardRef:void 0,children:A})});process.env.NODE_ENV!==`production`&&(TN.displayName=`MenuPopup`);var EN=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(EN.displayName=`MenuPortalContext`);function DN(){let e=f.useContext(EN);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?xx(32):`Base UI: <Menu.Portal> is missing.`);return e}var ON=f.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=tN();return i.useState(`mounted`)||n?(0,m.jsx)(EN.Provider,{value:n,children:(0,m.jsx)(PO,{ref:t,...r})}):null});process.env.NODE_ENV!==`production`&&(ON.displayName=`MenuPortal`);function kN(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=J(i),o=f.useRef(0),s=$b(jN).current,c=$b(AN).current,[l,u]=f.useState(0),d=f.useRef(l),p=J((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),h=J(e=>{c.delete(e),d.current+=1,u(d.current)}),g=f.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(MN).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);Y(()=>{if(typeof MutationObserver!=`function`||g.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return g.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[g]),Y(()=>{d.current===l&&(n.current.length!==g.size&&(n.current.length=g.size),r&&r.current.length!==g.size&&(r.current.length=g.size),o.current=g.size),a(g)},[a,g,n,r,l]),Y(()=>()=>{n.current=[]},[n]),Y(()=>()=>{r&&(r.current=[])},[r]);let _=J(e=>(s.add(e),()=>{s.delete(e)}));Y(()=>{s.forEach(e=>e(g))},[s,g]);let v=f.useMemo(()=>({register:p,unregister:h,subscribeMapChange:_,elementsRef:n,labelsRef:r,nextIndexRef:o}),[p,h,_,n,r,o]);return(0,m.jsx)(cN.Provider,{value:v,children:t})}function AN(){return new Map}function jN(){return new Set}function MN(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var NN=f.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon(
|
|
253
|
+
0% 0%,
|
|
254
|
+
100% 0%,
|
|
255
|
+
100% 100%,
|
|
256
|
+
0% 100%,
|
|
257
|
+
0% 0%,
|
|
258
|
+
${e.left}px ${e.top}px,
|
|
259
|
+
${e.left}px ${e.bottom}px,
|
|
260
|
+
${e.right}px ${e.bottom}px,
|
|
261
|
+
${e.right}px ${e.top}px,
|
|
262
|
+
${e.left}px ${e.top}px
|
|
263
|
+
)`}return(0,m.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});process.env.NODE_ENV!==`production`&&(NN.displayName=`InternalBackdrop`);var PN=f.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:p=5,sticky:h=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=qx,...v}=e,{store:y}=tN(),b=DN(),x=rN(!0),S=y.useState(`parent`),C=y.useState(`floatingRootContext`),w=y.useState(`floatingTreeRoot`),T=y.useState(`mounted`),E=y.useState(`open`),D=y.useState(`modal`),O=y.useState(`activeTriggerElement`),k=y.useState(`transitionStatus`),A=y.useState(`positionerElement`),j=y.useState(`instantType`),M=y.useState(`hasViewport`),N=y.useState(`lastOpenChangeReason`),P=y.useState(`floatingNodeId`),F=y.useState(`floatingParentNodeId`),I=C.useState(`domReferenceElement`),L=f.useRef(null),R=fj(A,!1,!1),z=n,B=c,ee=l,te=s,ne=_;S.type===`context-menu`&&(z=n??S.context?.anchor,te??=`start`,!o&&te!==`center`&&(ee=e.alignOffset??2,B=e.sideOffset??-5));let re=o,ie=te;S.type===`menu`?(re??=`inline-end`,ie??=`start`,ne=e.collisionAvoidance??Jx):S.type===`menubar`&&(re??=`bottom`,ie??=`start`);let V=S.type===`context-menu`,H=zM({anchor:z,floatingRootContext:C,positionMethod:x?`fixed`:r,mounted:T,side:re,sideOffset:B,align:ie,alignOffset:ee,arrowPadding:V?0:p,collisionBoundary:u,collisionPadding:d,sticky:h,nodeId:P,keepMounted:b,disableAnchorTracking:g,collisionAvoidance:ne,shiftCrossAxis:V&&!(`side`in ne&&ne.side===`flip`),externalTree:w,adaptiveOrigin:M?IM:void 0}),ae=f.useMemo(()=>{let e={};return E||(e.pointerEvents=`none`),{role:`presentation`,hidden:!T,style:{...H.positionerStyles,...e}}},[E,T,H.positionerStyles]);f.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===P&&y.set(`hoverEnabled`,!1),e.nodeId!==P&&e.parentNodeId===y.select(`floatingParentNodeId`)&&y.setOpen(!1,ZD(JD)))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[y,w.events,P]),f.useEffect(()=>{if(y.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==y.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;y.setOpen(!1,ZD(t))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[w.events,y]);let oe=ST();f.useEffect(()=>{E||oe.clear()},[E,oe]),f.useEffect(()=>{function e(e){if(!(!E||e.nodeId!==y.select(`floatingParentNodeId`)))if(e.target&&O&&O!==e.target){let e=y.select(`closeDelay`);e>0?oe.isStarted()||oe.start(e,()=>{y.setOpen(!1,ZD(JD))}):y.setOpen(!1,ZD(JD))}else oe.clear()}return w.events.on(`itemhover`,e),()=>{w.events.off(`itemhover`,e)}},[w.events,E,O,y,oe]),f.useEffect(()=>{let e={open:E,nodeId:P,parentNodeId:F,reason:y.select(`lastOpenChangeReason`)};w.events.emit(`menuopenchange`,e)},[w.events,E,y,P,F]),Y(()=>{let e=I,t=L.current;if(e&&(L.current=e),t&&e&&e!==t){y.set(`instantType`,void 0);let e=new AbortController;return R(()=>{y.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,R,y]);let se={open:E,side:H.side,align:H.align,anchorHidden:H.anchorHidden,nested:S.type===`menu`,instant:j},ce=f.useMemo(()=>({side:H.side,align:H.align,arrowRef:H.arrowRef,arrowUncentered:H.arrowUncentered,arrowStyles:H.arrowStyles,nodeId:H.context.nodeId}),[H.side,H.align,H.arrowRef,H.arrowUncentered,H.arrowStyles,H.context.nodeId]),le=Xx(`div`,e,{state:se,stateAttributesMapping:vM,ref:[t,y.useStateSetter(`positionerElement`)],props:[ae,VM(k),v]}),ue=T&&S.type!==`menu`&&(S.type!==`menubar`&&D&&N!==`trigger-hover`||S.type===`menubar`&&S.context.modal),de=null;return S.type===`menubar`?de=S.context.contentElement:S.type===void 0&&(de=O),(0,m.jsxs)(QM.Provider,{value:ce,children:[ue&&(0,m.jsx)(NN,{ref:S.type===`context-menu`||S.type===`nested-context-menu`?S.context.internalBackdropRef:null,inert:qM(!E),cutout:de}),(0,m.jsx)(HO,{id:P,children:(0,m.jsx)(kN,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,children:le})})]})});process.env.NODE_ENV!==`production`&&(PN.displayName=`MenuPositioner`);var FN={},IN={},LN=``;function RN(e){if(typeof document>`u`)return!1;let t=CD(e);return kb(t).innerWidth-t.documentElement.clientWidth>0}function zN(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=CD(e),n=t.documentElement,r=t.body,i=Fb(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function BN(e){let t=CD(e),n=t.documentElement,r=t.body,i=Fb(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function VN(e){let t=CD(e),n=t.documentElement,r=t.body,i=kb(n),a=0,o=0,s=!1,c=oO.create();if(DT&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,FN={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},LN=n.style.scrollBehavior,IN={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Fb(n)?n:r;if(s=zN(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,FN),Object.assign(r.style,IN),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=LN)}function d(){u(),c.request(l)}return l(),i.addEventListener(`resize`,d),()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var HN=new class{lockCount=0;restore=null;timeoutLock=xT.create();timeoutUnlock=xT.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=CD(e).documentElement,n=kb(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=Hx;return}this.restore=OT||!RN(e)?BN(e):VN(e)}};function UN(e=!0,t=null){Y(()=>{if(e)return HN.acquire(t)},[e,t])}var WN=f.createContext(null);process.env.NODE_ENV!==`production`&&(WN.displayName=`MenubarContext`);function GN(e){let t=f.useContext(WN);if(t===null&&!e)throw Error(process.env.NODE_ENV===`production`?xx(5):`Base UI: MenubarContext is missing. Menubar parts must be placed within <Menubar>.`);return t}function KN(e){let t=f.useRef(``),n=f.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:f.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function qN(e,t){let n=f.useRef(e),r=J(t);Y(()=>{n.current!==e&&r(n.current)},[e,r]),Y(()=>{n.current=e},[e])}function JN(e){let[t,n]=f.useState(null),r=J((t,r)=>{e||n(r||(OT?`touch`:``))});qN(e,t=>{t&&!e&&n(null)});let{onClick:i,onPointerDown:a}=KN(r);return f.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:a}}),[t,i,a])}var YN={...Sj,disabled:$(e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled),modal:$(e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0)),allowMouseEnter:$(e=>e.allowMouseEnter),stickIfOpen:$(e=>e.stickIfOpen),parent:$(e=>e.parent),rootId:$(e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId),activeIndex:$(e=>e.activeIndex),isActive:$((e,t)=>e.activeIndex===t),hoverEnabled:$(e=>e.hoverEnabled),instantType:$(e=>e.instantType),lastOpenChangeReason:$(e=>e.openChangeReason),floatingTreeRoot:$(e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot),floatingNodeId:$(e=>e.floatingNodeId),floatingParentNodeId:$(e=>e.floatingParentNodeId),itemProps:$(e=>e.itemProps),closeDelay:$(e=>e.closeDelay),hasViewport:$(e=>e.hasViewport),keyboardEventRelay:$(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)})},XN=class e extends ij{constructor(e){super({...ZN(),...e},{positionerRef:f.createRef(),popupRef:f.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:f.createRef(),beforeContentFocusGuardRef:f.createRef(),onOpenChangeComplete:void 0,triggerElements:new vj},YN),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);t===i&&n===a&&r===o||(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}static useStore(t,n){let r=$b(()=>new e(n)).current;return t??r}unsubscribeParentListener=null};function ZN(){return{...bj(),disabled:!1,modal:!0,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new IO,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Wx,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}var QN=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(QN.displayName=`MenuSubmenuRootContext`);function $N(){return f.useContext(QN)}var eP=fT(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:p,triggerId:h,defaultTriggerId:g=null,highlightItemOnHover:_=!0}=e,v=rN(!0),y=tN(!0),b=GN(!0),x=$N(),S=f.useMemo(()=>x&&y?{type:`menu`,store:y.store}:b?{type:`menubar`,context:b}:v&&!y?{type:`context-menu`,context:v}:{type:void 0},[v,y,b,x]),C=XN.useStore(p?.store,{open:a,openProp:n,activeTriggerId:g,triggerIdProp:h,parent:S});hT(()=>{n===void 0&&C.state.open===!1&&a===!0&&C.update({open:!0,activeTriggerId:g})}),C.useControlledProp(`openProp`,n),C.useControlledProp(`triggerIdProp`,h),C.useContextCallback(`onOpenChangeComplete`,i);let w=C.useState(`floatingTreeRoot`),T=VO(w),E=zO();Y(()=>{v&&!y?C.update({parent:{type:`context-menu`,context:v},floatingNodeId:T,floatingParentNodeId:E}):y&&C.update({floatingNodeId:T,floatingParentNodeId:E})},[v,y,T,E,C]);let D=C.useState(`open`),O=C.useState(`activeTriggerElement`),k=C.useState(`positionerElement`),A=C.useState(`hoverEnabled`),j=C.useState(`modal`),M=C.useState(`disabled`),N=C.useState(`lastOpenChangeReason`),P=C.useState(`parent`),F=C.useState(`activeIndex`),I=C.useState(`payload`),L=C.useState(`floatingParentNodeId`),R=f.useRef(null),z=L!=null,B;process.env.NODE_ENV!==`production`&&P.type!==void 0&&s!==void 0&&console.warn("Base UI: The `modal` prop is not supported on nested menus. It will be ignored."),C.useSyncedValues({disabled:o,modal:P.type===void 0?s:void 0,rootId:kO()});let{openMethod:ee,triggerProps:te}=JN(D);gj(C);let{forceUnmount:ne}=_j(D,C,()=>{C.update({allowMouseEnter:!1,stickIfOpen:!0})}),re=f.useRef(P.type!==`context-menu`),ie=ST();f.useEffect(()=>{if(D||(R.current=null),P.type===`context-menu`){if(!D){ie.clear(),re.current=!1;return}ie.start(500,()=>{re.current=!0})}},[ie,D,P.type]),UN(D&&j&&N!==`trigger-hover`&&ee!==`touch`,k),Y(()=>{!D&&!A&&C.set(`hoverEnabled`,!0)},[D,A,C]);let V=f.useRef(!0),H=ST(),ae=J((e,t)=>{let n=t.reason;if(D===e&&t.trigger===O&&N===n||(t.preventUnmountOnClose=()=>{C.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&(t.trigger=O??void 0),r?.(e,t),t.isCanceled))return;let i={open:e,nativeEvent:t.event,reason:t.reason,nested:z};B?.emit(`openchange`,i);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!V.current)return;if(!e&&F!==null){let e=C.context.itemDomElements.current[F];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}e&&n===`trigger-focus`?(V.current=!1,H.start(300,()=>{V.current=!0})):(V.current=!0,H.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0&&a?.isTrusted,s=!e&&(n===`escape-key`||n==null),c={open:e,openChangeReason:n};R.current=t.event??null;let l=t.trigger?.id??null;(l||e)&&(c.activeTriggerId=l,c.activeTriggerElement=t.trigger??null),C.update(c),P.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?C.set(`instantType`,`group`):o||s?C.set(`instantType`,o?`click`:`dismiss`):C.set(`instantType`,void 0)}),oe=f.useCallback(e=>{let t=ZD(e);return t.preventUnmountOnClose=()=>{C.set(`preventUnmountingOnClose`,!0)},t},[C]),se=f.useCallback(()=>{C.setOpen(!1,oe(XD))},[C,oe]);f.useImperativeHandle(u,()=>({unmount:ne,close:se}),[ne,se]);let ce;P.type===`context-menu`&&(ce=P.context),f.useImperativeHandle(ce?.positionerRef,()=>k,[k]),f.useImperativeHandle(ce?.actionsRef,()=>({setOpen:ae}),[ae]);let le=Tj({popupStore:C,onOpenChange:ae});B=le.context.events,f.useEffect(()=>{let e=({open:e,eventDetails:t})=>ae(e,t);return B.on(`setOpen`,e),()=>{B?.off(`setOpen`,e)}},[B,ae]);let ue=ck(le,{enabled:!M,bubbles:{escapeKey:d&&P.type===`menu`},outsidePress(){return P.type!==`context-menu`||R.current?.type===`contextmenu`?!0:re.current},externalTree:z?w:void 0}),de=Jj(le,{role:`menu`}),fe=jM(),pe=f.useCallback(e=>{C.select(`activeIndex`)!==e&&C.set(`activeIndex`,e)},[C]),me=Kj(le,{enabled:!M,listRef:C.context.itemDomElements,activeIndex:F,nested:P.type!==void 0,loopFocus:c,orientation:l,parentOrientation:P.type===`menubar`?P.context.orientation:void 0,rtl:fe===`rtl`,disabledIndices:Ux,onNavigate:pe,openOnArrowKeyDown:P.type!==`context-menu`,externalTree:z?w:void 0,focusItemOnHover:_}),he=f.useCallback(e=>{C.context.typingRef.current=e},[C]),{getReferenceProps:ge,getFloatingProps:_e,getItemProps:ve,getTriggerProps:ye}=Lj([ue,de,me,Yj(le,{listRef:C.context.itemLabels,elementsRef:C.context.itemDomElements,activeIndex:F,resetMs:500,onMatch:e=>{D&&e!==F&&C.set(`activeIndex`,e)},onTypingChange:he})]),be=f.useMemo(()=>{let e=lx(ge(),{onMouseMove(){C.set(`allowMouseEnter`,!0)}},te);return delete e.role,e},[ge,C,te]),xe=f.useMemo(()=>{let e=ye();if(!e)return e;let t=lx(e,te);return delete t.role,delete t[`aria-controls`],t},[ye,te]),Se=f.useMemo(()=>_e({onMouseMove(){C.set(`allowMouseEnter`,!0),P.type===`menu`&&C.set(`hoverEnabled`,!1)},onClick(){C.select(`hoverEnabled`)&&C.set(`hoverEnabled`,!1)},onKeyDown(e){let t=C.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}}),[_e,P.type,C]),Ce=f.useMemo(()=>ve(),[ve]);C.useSyncedValues({floatingRootContext:le,activeTriggerProps:be,inactiveTriggerProps:xe,popupProps:Se,itemProps:Ce});let we=f.useMemo(()=>({store:C,parent:S}),[C,S]),Te=(0,m.jsx)(eN.Provider,{value:we,children:typeof t==`function`?t({payload:I}):t});return P.type===void 0||P.type===`context-menu`?(0,m.jsx)(UO,{externalTree:w,children:Te}):Te});process.env.NODE_ENV!==`production`&&(eP.displayName=`MenuRoot`);function tP(e){let t=tN().store,n=f.useMemo(()=>({parentMenu:t}),[t]);return(0,m.jsx)(QN.Provider,{value:n,children:(0,m.jsx)(eP,{...e})})}function nP(e){let t=e.getBoundingClientRect();if(process.env.NODE_ENV!==`production`)return t;let n=window.getComputedStyle(e,`::before`),r=window.getComputedStyle(e,`::after`);if(!(n.content!==`none`||r.content!==`none`))return t;let i=parseFloat(n.width)||0,a=parseFloat(n.height)||0,o=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=Math.max(t.width,i,o),l=Math.max(t.height,a,s),u=c-t.width,d=l-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-d/2,bottom:t.bottom+d/2}}function rP(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Cx(),{ref:i,index:a}=dN(e),o=n===a,s=f.useRef(null),c=Ox(i,s);return{compositeProps:f.useMemo(()=>({tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}}),[o,r,a,t]),compositeRef:c,index:a}}function iP(e){let{render:t,className:n,state:r=Wx,props:i=Ux,refs:a=Ux,metadata:o,stateAttributesMapping:s,tag:c=`div`,...l}=e,{compositeProps:u,compositeRef:d}=rP({metadata:o});return Xx(c,e,{state:r,ref:[...a,d],props:[u,...i,l],stateAttributesMapping:s})}function aP(e){if(Nb(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`)??void 0;if(!Gb(e))return aP(Jb(e))}function oP(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=f.useRef(!1);return f.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,CD(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Wx,[t,n,r])}var sP=2,cP=pT(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,openOnHover:s,delay:c=100,closeDelay:l=0,handle:u,payload:d,...h}=e,g=tN(!0),_=u?.store??g?.store;if(!_)throw Error(process.env.NODE_ENV===`production`?xx(85):`Base UI: <Menu.Trigger> must be either used within a <Menu.Root> component or provided with a handle.`);let v=yM(o),y=_.useState(`isTriggerActive`,v),b=_.useState(`floatingRootContext`),x=_.useState(`isOpenedByTrigger`,v),S=f.useRef(null),C=uP(),w=Cx(!0),T=BO(),E=f.useMemo(()=>T??new IO,[T]),{registerTrigger:D,isMountedByThisTrigger:O}=hj(v,S,_,{payload:d,closeDelay:l,parent:C,floatingTreeRoot:E,floatingNodeId:VO(E),floatingParentNodeId:zO(),keyboardEventRelay:w?.relayKeyboardEvent}),k=C.type===`menubar`,A=_.useState(`disabled`),j=i||A||k&&C.context.disabled,{getButtonProps:M,buttonRef:N}=Tx({disabled:j,native:a});f.useEffect(()=>{!x&&C.type===void 0&&(_.context.allowMouseUpTriggerRef.current=!1)},[_,x,C.type]);let P=f.useRef(null),F=ST(),I=J(e=>{if(!P.current)return;F.clear(),_.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(UT(P.current,t)||UT(_.select(`positionerElement`),t)||t===P.current||t!=null&&aP(t)===_.select(`rootId`))return;let n=nP(P.current);e.clientX>=n.left-sP&&e.clientX<=n.right+sP&&e.clientY>=n.top-sP&&e.clientY<=n.bottom+sP||E.events.emit(`close`,{domEvent:e,reason:qD})});f.useEffect(()=>{x&&_.select(`lastOpenChangeReason`)===`trigger-hover`&&CD(P.current).addEventListener(`mouseup`,I,{once:!0})},[x,I,_]);let L=k&&C.context.hasSubmenuOpen,R=Ij(b,{enabled:(s??L)&&!j&&C.type!==`context-menu`&&(!k||L&&!O),handleClose:rM({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:C.type===void 0?c:void 0,delay:{close:l},triggerElementRef:S,externalTree:E,isActiveTrigger:y}),z=lP(x,_.select(`lastOpenChangeReason`)),B=tk(b,{enabled:!j&&C.type!==`context-menu`,event:x&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0?z:!1}),ee=Dj(b,{enabled:!j&&L}),te=oP({open:x,enabled:k,mouseDownAction:`open`}),ne=Lj([B,ee]),re={disabled:j,open:x},ie=_.useState(`triggerProps`,O),V=[P,t,N,D,S],H=[ne.getReferenceProps(),R??Wx,ie,{"aria-haspopup":`menu`,id:v,onMouseDown:e=>{_.select(`open`)||(F.start(200,()=>{_.context.allowMouseUpTriggerRef.current=!0}),CD(e.currentTarget).addEventListener(`mouseup`,I,{once:!0}))}},k?{role:`menuitem`}:{},te,h,M],ae=f.useRef(null),oe=J(e=>{p.flushSync(()=>{_.setOpen(!1,ZD(WD,e.nativeEvent,e.currentTarget))}),AD(ae.current)?.focus()}),se=J(e=>{let t=_.select(`positionerElement`);if(t&&jD(e,t))_.context.beforeContentFocusGuardRef.current?.focus();else{p.flushSync(()=>{_.setOpen(!1,ZD(WD,e.nativeEvent,e.currentTarget))});let n=kD(_.context.triggerFocusTargetRef.current||S.current);for(;n!==null&&UT(t,n);){let e=n;if(n=ED(n),n===e)break}n?.focus()}}),ce=Xx(`button`,e,{enabled:!k,stateAttributesMapping:_M,state:re,ref:V,props:H});return k?(0,m.jsx)(iP,{tag:`button`,render:n,className:r,state:re,refs:V,props:H,stateAttributesMapping:_M}):x?(0,m.jsxs)(f.Fragment,{children:[(0,m.jsx)(uO,{ref:ae,onFocus:oe},`${v}-pre-focus-guard`),(0,m.jsx)(f.Fragment,{children:ce},v),(0,m.jsx)(uO,{ref:_.context.triggerFocusTargetRef,onFocus:se},`${v}-post-focus-guard`)]}):(0,m.jsx)(f.Fragment,{children:ce},v)});process.env.NODE_ENV!==`production`&&(cP.displayName=`MenuTrigger`);function lP(e,t){let n=ST(),[r,i]=f.useState(!1);return Y(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function uP(){let e=rN(!0),t=tN(!0),n=GN(!0);return f.useMemo(()=>n?{type:`menubar`,context:n}:e&&!t?{type:`context-menu`,context:e}:{type:void 0},[e,t,n])}var dP=f.forwardRef(function(e,t){let{render:n,className:r,label:i,id:a,nativeButton:o=!1,openOnHover:s=!0,delay:c=100,closeDelay:l=0,disabled:u=!1,...d}=e,p=dN(),m=$M(),{store:h}=tN(),g=yM(a),_=h.useState(`open`),v=h.useState(`floatingRootContext`),y=h.useState(`floatingTreeRoot`),b=mj(g,h),x=f.useCallback(e=>{let t=b(e);return e!==null&&h.select(`open`)&&h.select(`activeTriggerId`)==null&&h.update({activeTriggerId:g,activeTriggerElement:e,closeDelay:l}),t},[b,l,h,g]),S=f.useRef(null),C=f.useCallback(e=>{S.current=e,h.set(`activeTriggerElement`,e)},[h]),w=$N();if(!w?.parentMenu)throw Error(process.env.NODE_ENV===`production`?xx(37):`Base UI: <Menu.SubmenuTrigger> must be placed in <Menu.SubmenuRoot>.`);h.useSyncedValue(`closeDelay`,l);let T=w.parentMenu,E=T.useState(`itemProps`),D=T.useState(`isActive`,p.index),O=f.useMemo(()=>({type:`submenu-trigger`,setActive(){T.set(`activeIndex`,p.index)}}),[T,p.index]),k=h.useState(`disabled`),A=u||k,{getItemProps:j,itemRef:M}=sN({closeOnClick:!1,disabled:A,highlighted:D,id:g,store:h,typingRef:T.context.typingRef,nativeButton:o,itemMetadata:O,nodeId:m?.nodeId}),N=h.useState(`hoverEnabled`),P=T.useState(`allowMouseEnter`),F=Ij(v,{enabled:N&&s&&!A,handleClose:rM({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:c,delay:P?{open:c,close:l}:0,triggerElementRef:S,externalTree:y}),I=Lj([tk(v,{enabled:!A,event:`mousedown`,toggle:!s,ignoreMouse:s,stickIfOpen:!1})]),L=h.useState(`triggerProps`,!0);return delete L.id,Xx(`div`,e,{state:{disabled:A,highlighted:D,open:_},stateAttributesMapping:gM,props:[I.getReferenceProps(),F,L,E,{tabIndex:_||D?0:-1,onBlur(){D&&T.set(`activeIndex`,null)}},d,j],ref:[t,p.ref,M,x,C]})});process.env.NODE_ENV!==`production`&&(dP.displayName=`MenuSubmenuTrigger`);function fP({...e}){return(0,m.jsx)(eP,{"data-slot":`dropdown-menu`,...e})}function pP({...e}){return(0,m.jsx)(cP,{"data-slot":`dropdown-menu-trigger`,...e})}function mP({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,m.jsx)(ON,{children:(0,m.jsx)(PN,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,m.jsx)(TN,{"data-slot":`dropdown-menu-content`,className:MC(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function hP({className:e,inset:t,variant:n=`default`,...r}){return(0,m.jsx)(fN,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:MC(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function gP({...e}){return(0,m.jsx)(tP,{"data-slot":`dropdown-menu-sub`,...e})}function _P({className:e,inset:t,children:n,...r}){return(0,m.jsxs)(dP,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:MC(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,m.jsx)(qC,{className:`ml-auto`})]})}function vP({align:e=`start`,alignOffset:t=-3,side:n=`right`,sideOffset:r=0,className:i,...a}){return(0,m.jsx)(mP,{"data-slot":`dropdown-menu-sub-content`,className:MC(`w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,i),align:e,alignOffset:t,side:n,sideOffset:r,...a})}function yP({className:e,...t}){return(0,m.jsx)(oT,{"data-slot":`dropdown-menu-separator`,className:MC(`-mx-1 my-1 h-px bg-border`,e),...t})}var bP=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(bP.displayName=`PopoverRootContext`);function xP(e){let t=f.useContext(bP);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?xx(47):`Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.`);return t}function SP(){return{...bj(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var CP={...Sj,disabled:$(e=>e.disabled),instantType:$(e=>e.instantType),openMethod:$(e=>e.openMethod),openChangeReason:$(e=>e.openChangeReason),modal:$(e=>e.modal),stickIfOpen:$(e=>e.stickIfOpen),titleElementId:$(e=>e.titleElementId),descriptionElementId:$(e=>e.descriptionElementId),openOnHover:$(e=>e.openOnHover),closeDelay:$(e=>e.closeDelay),hasViewport:$(e=>e.hasViewport)},wP=class e extends ij{constructor(e){let t={...SP(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:f.createRef(),backdropRef:f.createRef(),internalBackdropRef:f.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:f.createRef(),beforeContentFocusGuardRef:f.createRef(),stickIfOpenTimeout:new xT,triggerElements:new vj},CP)}setOpen=(e,t)=>{let n=t.reason===BD,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let a={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger};this.state.floatingRootContext.context.events?.emit(`openchange`,a);let o=()=>{let n={open:e,openChangeReason:t.reason},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),p.flushSync(o)):o(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let r=$b(()=>new e(n)).current,i=t??r;return yT(r.disposeEffect),i}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function TP({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=wP.useStore(s?.store,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});hT(()=>{n===void 0&&u.state.open===!1&&r===!0&&u.update({open:!0,activeTriggerId:l})}),u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),p=u.useState(`positionerElement`),h=u.useState(`payload`),g=u.useState(`openChangeReason`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a);let{openMethod:_,triggerProps:v}=JN(d);gj(u);let{forceUnmount:y}=_j(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});UN(d&&o===!0&&g!==`trigger-hover`&&_!==`touch`,p),f.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let b=f.useCallback(e=>{let t=ZD(e);return t.preventUnmountOnClose=()=>{u.set(`preventUnmountingOnClose`,!0)},t},[u]),x=f.useCallback(()=>{u.setOpen(!1,b(XD))},[u,b]);f.useImperativeHandle(e.actionsRef,()=>({unmount:y,close:x}),[y,x]);let S=Tj({popupStore:u,onOpenChange:u.setOpen}),{getReferenceProps:C,getFloatingProps:w,getTriggerProps:T}=Lj([ck(S,{outsidePressEvent:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),Jj(S)]),E=f.useMemo(()=>C(v),[C,v]),D=f.useMemo(()=>T(v),[T,v]),O=f.useMemo(()=>w(),[w]);u.useSyncedValues({modal:o,openMethod:_,activeTriggerProps:E,inactiveTriggerProps:D,popupProps:O,floatingRootContext:S,nested:zO()!=null});let k=f.useMemo(()=>({store:u}),[u]);return(0,m.jsx)(bP.Provider,{value:k,children:typeof t==`function`?t({payload:h}):t})}function EP(e){return xP(!0)?(0,m.jsx)(TP,{props:e}):(0,m.jsx)(UO,{children:(0,m.jsx)(TP,{props:e})})}var DP=f.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,handle:o,payload:s,openOnHover:c=!1,delay:l=300,closeDelay:u=0,id:d,...h}=e,g=xP(!0),_=o?.store??g?.store;if(!_)throw Error(process.env.NODE_ENV===`production`?xx(74):`Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle.`);let v=yM(d),y=_.useState(`isTriggerActive`,v),b=_.useState(`floatingRootContext`),x=_.useState(`isOpenedByTrigger`,v),S=f.useRef(null),{registerTrigger:C,isMountedByThisTrigger:w}=hj(v,S,_,{payload:s,disabled:i,openOnHover:c,closeDelay:u}),T=_.useState(`openChangeReason`),E=_.useState(`stickIfOpen`),D=_.useState(`openMethod`),O=Ij(b,{enabled:b!=null&&c&&(D!==`touch`||T!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:rM(),restMs:l,delay:{close:u},triggerElementRef:S,isActiveTrigger:y}),k=Lj([tk(b,{enabled:b!=null,stickIfOpen:E})]),A=_.useState(`triggerProps`,w),j={disabled:i,open:x},{getButtonProps:M,buttonRef:N}=Tx({disabled:i,native:a}),P=f.useMemo(()=>({open(e){return e&&T===`trigger-press`?_M.open(e):gM.open(e)}}),[T]),F=Xx(`button`,e,{state:j,ref:[N,t,C,S],props:[k.getReferenceProps(),O,A,{[Kx]:``,id:v},h,M],stateAttributesMapping:P}),I=f.useRef(null),L=J(e=>{p.flushSync(()=>{_.setOpen(!1,ZD(WD,e.nativeEvent,e.currentTarget))}),AD(I.current)?.focus()}),R=J(e=>{let t=_.select(`positionerElement`);if(t&&jD(e,t))_.context.beforeContentFocusGuardRef.current?.focus();else{p.flushSync(()=>{_.setOpen(!1,ZD(WD,e.nativeEvent,e.currentTarget))});let n=kD(_.context.triggerFocusTargetRef.current||S.current);for(;n!==null&&UT(t,n);){let e=n;if(n=ED(n),n===e)break}n?.focus()}});return y?(0,m.jsxs)(f.Fragment,{children:[(0,m.jsx)(uO,{ref:I,onFocus:L}),(0,m.jsx)(f.Fragment,{children:F},v),(0,m.jsx)(uO,{ref:_.context.triggerFocusTargetRef,onFocus:R})]}):(0,m.jsx)(f.Fragment,{children:F},v)});process.env.NODE_ENV!==`production`&&(DP.displayName=`PopoverTrigger`);var OP=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(OP.displayName=`PopoverPortalContext`);function kP(){let e=f.useContext(OP);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?xx(45):`Base UI: <Popover.Portal> is missing.`);return e}var AP=f.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=xP();return i.useState(`mounted`)||n?(0,m.jsx)(OP.Provider,{value:n,children:(0,m.jsx)(PO,{ref:t,...r})}):null});process.env.NODE_ENV!==`production`&&(AP.displayName=`PopoverPortal`);var jP=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(jP.displayName=`PopoverPositionerContext`);function MP(){let e=f.useContext(jP);if(!e)throw Error(process.env.NODE_ENV===`production`?xx(46):`Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.`);return e}var NP=f.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:p=5,sticky:h=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=Jx,...v}=e,{store:y}=xP(),b=kP(),x=VO(),S=y.useState(`floatingRootContext`),C=y.useState(`mounted`),w=y.useState(`open`),T=y.useState(`openChangeReason`),E=y.useState(`activeTriggerElement`),D=y.useState(`modal`),O=y.useState(`positionerElement`),k=y.useState(`instantType`),A=y.useState(`transitionStatus`),j=y.useState(`hasViewport`),M=f.useRef(null),N=fj(O,!1,!1),P=zM({anchor:i,floatingRootContext:S,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:p,collisionBoundary:u,collisionPadding:d,sticky:h,disableAnchorTracking:g,keepMounted:b,nodeId:x,collisionAvoidance:_,adaptiveOrigin:j?IM:void 0}),F=f.useMemo(()=>{let e={};return w||(e.pointerEvents=`none`),{role:`presentation`,hidden:!C,style:{...P.positionerStyles,...e}}},[w,C,P.positionerStyles]),I=f.useMemo(()=>({props:F,...P}),[F,P]),L=S.useState(`domReferenceElement`);Y(()=>{let e=L,t=M.current;if(e&&(M.current=e),t&&e&&e!==t){y.set(`instantType`,void 0);let e=new AbortController;return N(()=>{y.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[L,N,y]);let R={open:w,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:k},z=f.useCallback(e=>{y.set(`positionerElement`,e)},[y]),B=Xx(`div`,e,{state:R,props:[I.props,VM(A),v],ref:[t,z],stateAttributesMapping:vM});return(0,m.jsxs)(jP.Provider,{value:I,children:[C&&D===!0&&T!==`trigger-hover`&&(0,m.jsx)(NN,{ref:y.context.internalBackdropRef,inert:qM(!w),cutout:E}),(0,m.jsx)(HO,{id:x,children:B})]})});process.env.NODE_ENV!==`production`&&(NP.displayName=`PopoverPositioner`);var PP=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(PP.displayName=`ClosePartContext`);function FP(){let[e,t]=f.useState(0),n=J(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:f.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function IP(e){let{value:t,children:n}=e;return(0,m.jsx)(PP.Provider,{value:t,children:n})}var LP={...vM,...dj},RP=f.forwardRef(function(e,t){let{className:n,render:r,initialFocus:i,finalFocus:a,...o}=e,{store:s}=xP(),c=MP(),l=mN(!0)!=null,{context:u,hasClosePart:d}=FP(),p=s.useState(`open`),h=s.useState(`openMethod`),g=s.useState(`instantType`),_=s.useState(`transitionStatus`),v=s.useState(`popupProps`),y=s.useState(`titleElementId`),b=s.useState(`descriptionElementId`),x=s.useState(`modal`),S=s.useState(`mounted`),C=s.useState(`openChangeReason`),w=s.useState(`activeTriggerElement`),T=s.useState(`floatingRootContext`);pj({open:p,ref:s.context.popupRef,onComplete(){p&&s.context.onOpenChangeComplete?.(!0)}});let E=s.useState(`disabled`),D=s.useState(`openOnHover`),O=s.useState(`closeDelay`);Pj(T,{enabled:D&&!E,closeDelay:O});function k(e){return e===`touch`?s.context.popupRef.current:!0}let A=i===void 0?k:i,j={open:p,side:c.side,align:c.align,instant:g,transitionStatus:_},M=x!==!1&&d,N=f.useCallback(e=>{s.set(`popupElement`,e)},[s]),P=Xx(`div`,e,{state:j,ref:[t,s.context.popupRef,N],props:[v,{"aria-labelledby":y,"aria-describedby":b,onKeyDown(e){l&&CN.has(e.key)&&e.stopPropagation()}},VM(_),o],stateAttributesMapping:LP});return(0,m.jsx)(ek,{context:T,openInteractionType:h,modal:M,disabled:!S||C===`trigger-hover`,initialFocus:A,returnFocus:a,restoreFocus:`popup`,previousFocusableElement:Nb(w)?w:void 0,nextFocusableElement:s.context.triggerFocusTargetRef,beforeContentFocusGuardRef:s.context.beforeContentFocusGuardRef,children:(0,m.jsx)(IP,{value:u,children:P})})});process.env.NODE_ENV!==`production`&&(RP.displayName=`PopoverPopup`);function zP({...e}){return(0,m.jsx)(EP,{"data-slot":`popover`,...e})}function BP({...e}){return(0,m.jsx)(DP,{"data-slot":`popover-trigger`,...e})}function VP({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,m.jsx)(AP,{children:(0,m.jsx)(NP,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,m.jsx)(RP,{"data-slot":`popover-content`,className:MC(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}var HP=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),UP={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},WP={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},GP={disabled:!1,...WP},KP={valid(e){return e===null?null:e?{[HP.valid]:``}:{[HP.invalid]:``}}},qP=f.createContext({invalid:void 0,name:void 0,validityData:{state:UP,errors:[],error:``,value:``,initialValue:null},setValidityData:Hx,disabled:void 0,touched:WP.touched,setTouched:Hx,dirty:WP.dirty,setDirty:Hx,filled:WP.filled,setFilled:Hx,focused:WP.focused,setFocused:Hx,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:GP,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Wx)=>e,getInputValidationProps:(e=Wx)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!==`production`&&(qP.displayName=`FieldRootContext`);function JP(e=!0){let t=f.useContext(qP);if(t.setValidityData===Hx&&!e)throw Error(process.env.NODE_ENV===`production`?xx(28):`Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.`);return t}var YP=f.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Hx,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});process.env.NODE_ENV!==`production`&&(YP.displayName=`FormContext`);function XP(){return f.useContext(YP)}var ZP=f.createContext({controlId:void 0,registerControlId:Hx,labelId:void 0,setLabelId:Hx,messageIds:[],setMessageIds:Hx,getDescriptionProps:e=>e});process.env.NODE_ENV!==`production`&&(ZP.displayName=`LabelableContext`);function QP(){return f.useContext(ZP)}function $P(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function eF(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=QP(),o=yM(t),s=n?i:void 0,c=$b(()=>Symbol(`labelable-control`)),l=f.useRef(!1),u=f.useRef(t!=null),d=J(()=>{!l.current||a===Hx||(l.current=!1,a(c.current,void 0))});return Y(()=>{if(a===Hx)return;let e;if(n){let n=r?.current;e=Mb(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),f.useEffect(()=>d,[d]),i??o}function tF(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:o}=e,{formRef:s}=XP(),{invalid:c,markedDirtyRef:l,validityData:u,setValidityData:d}=JP(),f=J(e.getValue);Y(()=>{if(!t)return;let e=n;e===void 0&&(e=f()),u.initialValue===null&&e!==null&&d(t=>({...t,initialValue:e}))},[t,d,n,u.initialValue,f]),Y(()=>{!t||!r||s.current.fields.set(r,{getValue:f,name:i,controlRef:a,validityData:$P(u,c),validate(e=!0){let t=n;t===void 0&&(t=f()),l.current=!0,e?p.flushSync(()=>o(t)):o(t)}})},[o,a,t,s,f,r,c,l,i,u,n]),Y(()=>{let e=s.current.fields;return()=>{r&&e.delete(r)}},[s,r])}var nF=f.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,...d}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFocused:y,setFilled:b,validationMode:x,validation:S}=JP(),C=h||s,w=m??a,T={...p,disabled:C},{labelId:E}=QP(),D=eF({id:i});Y(()=>{let e=o!=null;S.inputRef.current?.value||e&&o!==``?b(!0):e&&o===``&&b(!1)},[S.inputRef,b,o]);let O=f.useRef(null);Y(()=>{u&&O.current===HT(CD(O.current))&&y(!0)},[u,y]);let[k]=iN({controlled:o,default:l,name:`FieldControl`,state:`value`}),A=o!==void 0,j=A?k:void 0;return tF({id:D,name:w,commit:S.commit,value:j,getValue:()=>S.inputRef.current?.value,controlRef:S.inputRef}),Xx(`input`,e,{ref:[t,O],state:T,props:[{id:D,disabled:C,name:w,ref:S.inputRef,"aria-labelledby":E,autoFocus:u,...A?{value:j}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,ZD(RD,e.nativeEvent)),_(t!==v.initialValue),b(t!==``)},onFocus(){y(!0)},onBlur(e){g(!0),y(!1),x===`onBlur`&&S.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(g(!0),S.commit(e.currentTarget.value))}},S.getInputValidationProps(),d],stateAttributesMapping:KP})});process.env.NODE_ENV!==`production`&&(nF.displayName=`FieldControl`);var rF=f.forwardRef(function(e,t){return(0,m.jsx)(nF,{ref:t,...e})});process.env.NODE_ENV!==`production`&&(rF.displayName=`Input`);function iF({className:e,type:t,...n}){return(0,m.jsx)(rF,{type:t,"data-slot":`input`,className:MC(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}var aF=`#000000.#434343.#666666.#999999.#b7b7b7.#cccccc.#d9d9d9.#efefef.#f3f3f3.#ffffff.#980000.#ff0000.#ff9900.#ffff00.#00ff00.#00ffff.#4a86e8.#0000ff.#9900ff.#ff00ff.#e6b8af.#f4cccc.#fce5cd.#fff2cc.#d9ead3.#d0e0e3.#c9daf8.#cfe2f3.#d9d2e9.#ead1dc`.split(`.`),oF=[`#ffff00`,`#00ff00`,`#00ffff`,`#ff00ff`,`#ff0000`,`#0000ff`,`#fce5cd`,`#d9ead3`,`#cfe2f3`,`#d9d2e9`,`#ead1dc`,`#fff2cc`];function sF({onClick:e,isActive:t=!1,disabled:n=!1,tooltip:r,children:i}){return(0,m.jsxs)(YM,{children:[(0,m.jsx)(XM,{render:(0,m.jsx)(PC,{variant:`ghost`,size:`icon-xs`,onClick:e,disabled:n,className:t?`bg-muted text-foreground`:``}),children:i}),(0,m.jsx)(ZM,{side:`bottom`,className:`text-xs`,children:r})]})}function cF(e,t){let n=e.can();return typeof n[t]==`function`?!!n[t]():!1}function lF({editor:e,variables:t=[],onAddVariable:n,blocks:r=[],actions:i,readOnly:a=!1,features:o}){let s=(0,f.useRef)(null),[c,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(``),[,p]=(0,f.useReducer)(e=>e+1,0);(0,f.useEffect)(()=>{if(e)return e.on(`selectionUpdate`,p),e.on(`transaction`,p),()=>{e.off(`selectionUpdate`,p),e.off(`transaction`,p)}},[e]);let h=e=>!o||o.has(e),g=(0,f.useCallback)(async t=>{let n=t.target.files;if(!(!n||!e)){for(let t of Array.from(n))if(t.type.startsWith(`image/`)){let n=await Uw(t);e.chain().focus().setImage({src:n}).run()}s.current&&(s.current.value=``)}},[e]),_=(0,f.useCallback)(()=>{if(e){if(u===``)e.chain().focus().extendMarkRange(`link`).unsetLink().run();else{let t=u.startsWith(`http`)?u:`https://${u}`;e.chain().focus().extendMarkRange(`link`).setLink({href:t}).run()}d(``)}},[e,u]);if(!e)return null;let v=h(`undo`)||h(`redo`),y=h(`heading`),b=h(`bold`)||h(`italic`)||h(`underline`)||h(`strikethrough`)||h(`subscript`)||h(`superscript`),x=h(`color`)||h(`highlight`),S=h(`alignLeft`)||h(`alignCenter`)||h(`alignRight`)||h(`alignJustify`),C=h(`bulletList`)||h(`orderedList`)||h(`taskList`)||h(`indent`)||h(`outdent`),w=h(`link`),T=h(`table`)||h(`image`)||h(`horizontalRule`)||h(`pageBreak`)||h(`blockquote`)||h(`codeBlock`),E=h(`variables`)&&t.length>0,D=h(`blocks`)&&r.length>0,O=[v,y,b,x,S,C,w,T,E,D],k=e=>{if(!O[e])return!1;for(let t=0;t<e;t++)if(O[t])return!0;return!1};return(0,m.jsx)(JM,{delay:300,children:(0,m.jsxs)(`div`,{className:`flex items-center border-b border-border bg-background px-1.5 py-0.5 sticky top-0 z-50`,style:{position:`sticky`,top:0,zIndex:50,borderBottom:`1px solid #e5e7eb`},children:[!a&&(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-0.5`,children:[v&&(0,m.jsxs)(m.Fragment,{children:[h(`undo`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().undo().run(),disabled:!e.can().undo(),tooltip:`Undo (Ctrl+Z)`,children:(0,m.jsx)(Bw,{className:`size-3.5`,strokeWidth:1.5})}),h(`redo`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().redo().run(),disabled:!e.can().redo(),tooltip:`Redo (Ctrl+Y)`,children:(0,m.jsx)(Cw,{className:`size-3.5`,strokeWidth:1.5})})]}),k(1)&&(0,m.jsx)(sT,{orientation:`vertical`,className:`mx-1 h-6`}),y&&(0,m.jsxs)(fP,{children:[(0,m.jsxs)(pP,{render:(0,m.jsx)(PC,{variant:`ghost`,size:`xs`,className:`gap-1 min-w-[100px] justify-between`}),children:[(0,m.jsx)(Rw,{className:`size-3.5`,strokeWidth:1.5}),(0,m.jsx)(`span`,{className:`text-xs`,children:e.isActive(`heading`,{level:1})?`Heading 1`:e.isActive(`heading`,{level:2})?`Heading 2`:e.isActive(`heading`,{level:3})?`Heading 3`:e.isActive(`heading`,{level:4})?`Heading 4`:`Paragraph`}),(0,m.jsx)(KC,{className:`size-3`,strokeWidth:1.5})]}),(0,m.jsxs)(mP,{align:`start`,children:[(0,m.jsx)(hP,{onClick:()=>e.chain().focus().setParagraph().run(),children:(0,m.jsx)(`span`,{className:`text-sm`,children:`Paragraph`})}),(0,m.jsx)(hP,{onClick:()=>e.chain().focus().toggleHeading({level:1}).run(),children:(0,m.jsx)(`span`,{className:`text-xl font-bold`,children:`Heading 1`})}),(0,m.jsx)(hP,{onClick:()=>e.chain().focus().toggleHeading({level:2}).run(),children:(0,m.jsx)(`span`,{className:`text-lg font-semibold`,children:`Heading 2`})}),(0,m.jsx)(hP,{onClick:()=>e.chain().focus().toggleHeading({level:3}).run(),children:(0,m.jsx)(`span`,{className:`text-base font-semibold`,children:`Heading 3`})}),(0,m.jsx)(hP,{onClick:()=>e.chain().focus().toggleHeading({level:4}).run(),children:(0,m.jsx)(`span`,{className:`text-sm font-semibold`,children:`Heading 4`})})]})]}),k(2)&&(0,m.jsx)(sT,{orientation:`vertical`,className:`mx-1 h-6`}),b&&(0,m.jsxs)(m.Fragment,{children:[h(`bold`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().toggleBold().run(),isActive:e.isActive(`bold`),tooltip:`Bold (Ctrl+B)`,children:(0,m.jsx)(UC,{className:`size-3.5`,strokeWidth:1.5})}),h(`italic`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().toggleItalic().run(),isActive:e.isActive(`italic`),tooltip:`Italic (Ctrl+I)`,children:(0,m.jsx)(sw,{className:`size-3.5`,strokeWidth:1.5})}),h(`underline`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().toggleUnderline().run(),isActive:e.isActive(`underline`),tooltip:`Underline (Ctrl+U)`,children:(0,m.jsx)(zw,{className:`size-3.5`,strokeWidth:1.5})}),h(`strikethrough`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().toggleStrike().run(),isActive:e.isActive(`strike`),tooltip:`Strikethrough`,children:(0,m.jsx)(kw,{className:`size-3.5`,strokeWidth:1.5})}),h(`subscript`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().toggleSubscript().run(),isActive:e.isActive(`subscript`),tooltip:`Subscript`,children:(0,m.jsx)(Aw,{className:`size-3.5`,strokeWidth:1.5})}),h(`superscript`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().toggleSuperscript().run(),isActive:e.isActive(`superscript`),tooltip:`Superscript`,children:(0,m.jsx)(jw,{className:`size-3.5`,strokeWidth:1.5})})]}),k(3)&&(0,m.jsx)(sT,{orientation:`vertical`,className:`mx-1 h-6`}),x&&(0,m.jsxs)(m.Fragment,{children:[h(`color`)&&(0,m.jsxs)(zP,{children:[(0,m.jsx)(BP,{render:(0,m.jsx)(PC,{variant:`ghost`,size:`icon-xs`}),children:(0,m.jsx)(vw,{className:`size-3.5`,strokeWidth:1.5})}),(0,m.jsxs)(VP,{className:`w-auto p-2`,align:`start`,children:[(0,m.jsx)(`div`,{className:`grid grid-cols-10 gap-1`,children:aF.map(t=>(0,m.jsx)(`button`,{className:`size-5 rounded border border-border hover:scale-110 transition-transform`,style:{backgroundColor:t},onClick:()=>e.chain().focus().setColor(t).run()},t))}),(0,m.jsx)(`button`,{className:`mt-2 text-xs text-muted-foreground hover:text-foreground w-full text-left`,onClick:()=>e.chain().focus().unsetColor().run(),children:`Reset color`})]})]}),h(`highlight`)&&(0,m.jsxs)(zP,{children:[(0,m.jsx)(BP,{render:(0,m.jsx)(PC,{variant:`ghost`,size:`icon-xs`}),children:(0,m.jsx)(aw,{className:`size-3.5`,strokeWidth:1.5})}),(0,m.jsxs)(VP,{className:`w-auto p-2`,align:`start`,children:[(0,m.jsx)(`div`,{className:`grid grid-cols-6 gap-1`,children:oF.map(t=>(0,m.jsx)(`button`,{className:`size-5 rounded border border-border hover:scale-110 transition-transform`,style:{backgroundColor:t},onClick:()=>e.chain().focus().toggleHighlight({color:t}).run()},t))}),(0,m.jsx)(`button`,{className:`mt-2 text-xs text-muted-foreground hover:text-foreground w-full text-left`,onClick:()=>e.chain().focus().unsetHighlight().run(),children:`Remove highlight`})]})]})]}),k(4)&&(0,m.jsx)(sT,{orientation:`vertical`,className:`mx-1 h-6`}),S&&(0,m.jsxs)(m.Fragment,{children:[h(`alignLeft`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().setTextAlign(`left`).run(),isActive:e.isActive({textAlign:`left`}),tooltip:`Align left`,children:(0,m.jsx)(Iw,{className:`size-3.5`,strokeWidth:1.5})}),h(`alignCenter`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().setTextAlign(`center`).run(),isActive:e.isActive({textAlign:`center`}),tooltip:`Align center`,children:(0,m.jsx)(Nw,{className:`size-3.5`,strokeWidth:1.5})}),h(`alignRight`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().setTextAlign(`right`).run(),isActive:e.isActive({textAlign:`right`}),tooltip:`Align right`,children:(0,m.jsx)(Pw,{className:`size-3.5`,strokeWidth:1.5})}),h(`alignJustify`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().setTextAlign(`justify`).run(),isActive:e.isActive({textAlign:`justify`}),tooltip:`Justify`,children:(0,m.jsx)(Fw,{className:`size-3.5`,strokeWidth:1.5})})]}),k(5)&&(0,m.jsx)(sT,{orientation:`vertical`,className:`mx-1 h-6`}),C&&(0,m.jsxs)(m.Fragment,{children:[h(`bulletList`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().toggleBulletList().run(),isActive:e.isActive(`bulletList`),tooltip:`Bullet list`,children:(0,m.jsx)(pw,{className:`size-3.5`,strokeWidth:1.5})}),h(`orderedList`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().toggleOrderedList().run(),isActive:e.isActive(`orderedList`),tooltip:`Numbered list`,children:(0,m.jsx)(fw,{className:`size-3.5`,strokeWidth:1.5})}),h(`taskList`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().toggleTaskList().run(),isActive:e.isActive(`taskList`),tooltip:`Task list`,children:(0,m.jsx)(lw,{className:`size-3.5`,strokeWidth:1.5})}),h(`indent`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().sinkListItem(`listItem`).run(),disabled:!cF(e,`sinkListItem`),tooltip:`Increase indent`,children:(0,m.jsx)(dw,{className:`size-3.5`,strokeWidth:1.5})}),h(`outdent`)&&(0,m.jsx)(sF,{onClick:()=>e.chain().focus().liftListItem(`listItem`).run(),disabled:!cF(e,`liftListItem`),tooltip:`Decrease indent`,children:(0,m.jsx)(uw,{className:`size-3.5`,strokeWidth:1.5})})]}),k(6)&&(0,m.jsx)(sT,{orientation:`vertical`,className:`mx-1 h-6`}),w&&(0,m.jsxs)(zP,{children:[(0,m.jsx)(BP,{render:(0,m.jsx)(PC,{variant:`ghost`,size:`icon-xs`,className:e.isActive(`link`)?`bg-muted text-foreground`:``}),children:(0,m.jsx)(cw,{className:`size-3.5`,strokeWidth:1.5})}),(0,m.jsxs)(VP,{className:`w-72 p-3`,align:`start`,children:[(0,m.jsxs)(`div`,{className:`flex gap-2`,children:[(0,m.jsx)(iF,{placeholder:`https://example.com`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>e.key===`Enter`&&_(),className:`h-8 text-sm`}),(0,m.jsx)(PC,{size:`xs`,onClick:_,children:e.isActive(`link`)?`Update`:`Add`})]}),e.isActive(`link`)&&(0,m.jsx)(`button`,{className:`mt-2 text-xs text-destructive hover:underline`,onClick:()=>e.chain().focus().unsetLink().run(),children:`Remove link`})]})]}),k(7)&&(0,m.jsx)(sT,{orientation:`vertical`,className:`mx-1 h-6`}),T&&(0,m.jsxs)(fP,{children:[(0,m.jsxs)(pP,{render:(0,m.jsx)(PC,{variant:`ghost`,size:`xs`,className:`gap-1`}),children:[(0,m.jsx)(bw,{className:`size-3.5`,strokeWidth:1.5}),(0,m.jsx)(`span`,{className:`text-xs`,children:`Insert`}),(0,m.jsx)(KC,{className:`size-3`,strokeWidth:1.5})]}),(0,m.jsxs)(mP,{align:`start`,children:[h(`table`)&&(0,m.jsxs)(gP,{children:[(0,m.jsxs)(_P,{children:[(0,m.jsx)(Mw,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Table`]}),(0,m.jsxs)(vP,{children:[(0,m.jsxs)(hP,{onClick:()=>e.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),children:[(0,m.jsx)(Mw,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Insert 3x3 Table`]}),(0,m.jsxs)(hP,{onClick:()=>e.chain().focus().insertTable({rows:4,cols:4,withHeaderRow:!0}).run(),children:[(0,m.jsx)(Mw,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Insert 4x4 Table`]}),(0,m.jsx)(yP,{}),(0,m.jsxs)(hP,{onClick:()=>e.chain().focus().addColumnAfter().run(),disabled:!cF(e,`addColumnAfter`),children:[(0,m.jsx)(XC,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Add Column After`]}),(0,m.jsxs)(hP,{onClick:()=>e.chain().focus().addColumnBefore().run(),disabled:!cF(e,`addColumnBefore`),children:[(0,m.jsx)(XC,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Add Column Before`]}),(0,m.jsxs)(hP,{onClick:()=>e.chain().focus().deleteColumn().run(),disabled:!cF(e,`deleteColumn`),children:[(0,m.jsx)(Lw,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Delete Column`]}),(0,m.jsx)(yP,{}),(0,m.jsxs)(hP,{onClick:()=>e.chain().focus().addRowAfter().run(),disabled:!cF(e,`addRowAfter`),children:[(0,m.jsx)(Ew,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Add Row After`]}),(0,m.jsxs)(hP,{onClick:()=>e.chain().focus().addRowBefore().run(),disabled:!cF(e,`addRowBefore`),children:[(0,m.jsx)(Ew,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Add Row Before`]}),(0,m.jsxs)(hP,{onClick:()=>e.chain().focus().deleteRow().run(),disabled:!cF(e,`deleteRow`),children:[(0,m.jsx)(Lw,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Delete Row`]}),(0,m.jsx)(yP,{}),(0,m.jsxs)(hP,{onClick:()=>e.chain().focus().mergeCells().run(),disabled:!cF(e,`mergeCells`),children:[(0,m.jsx)(gw,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Merge Cells`]}),(0,m.jsxs)(hP,{onClick:()=>e.chain().focus().splitCell().run(),disabled:!cF(e,`splitCell`),children:[(0,m.jsx)(Ow,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Split Cell`]}),(0,m.jsx)(yP,{}),(0,m.jsxs)(hP,{onClick:()=>e.chain().focus().deleteTable().run(),disabled:!cF(e,`deleteTable`),children:[(0,m.jsx)(Lw,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Delete Table`]})]})]}),h(`image`)&&(0,m.jsxs)(hP,{onClick:()=>s.current?.click(),children:[(0,m.jsx)(ow,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Image`]}),h(`horizontalRule`)&&(0,m.jsxs)(hP,{onClick:()=>e.chain().focus().setHorizontalRule().run(),children:[(0,m.jsx)(_w,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Horizontal Rule`]}),h(`pageBreak`)&&(0,m.jsxs)(hP,{onClick:()=>e.chain().focus().insertPageBreak().run(),children:[(0,m.jsx)(Dw,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Page Break`]}),(h(`blockquote`)||h(`codeBlock`))&&(0,m.jsx)(yP,{}),h(`blockquote`)&&(0,m.jsxs)(hP,{onClick:()=>e.chain().focus().toggleBlockquote().run(),children:[(0,m.jsx)(Sw,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Blockquote`]}),h(`codeBlock`)&&(0,m.jsxs)(hP,{onClick:()=>e.chain().focus().toggleCodeBlock().run(),children:[(0,m.jsx)(JC,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Code Block`]})]})]}),E&&(0,m.jsxs)(m.Fragment,{children:[k(8)&&(0,m.jsx)(sT,{orientation:`vertical`,className:`mx-1 h-6`}),(0,m.jsxs)(fP,{children:[(0,m.jsxs)(pP,{render:(0,m.jsx)(PC,{variant:`ghost`,size:`xs`,className:`gap-1`}),children:[(0,m.jsx)(WC,{className:`size-3.5`,strokeWidth:1.5}),(0,m.jsx)(`span`,{className:`text-xs`,children:`Variables`}),(0,m.jsx)(KC,{className:`size-3`,strokeWidth:1.5})]}),(0,m.jsxs)(mP,{align:`start`,children:[t.map(t=>(0,m.jsxs)(hP,{onClick:()=>e.chain().focus().insertVariable(t.key).run(),children:[(0,m.jsx)(WC,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),(0,m.jsx)(`span`,{className:`text-xs`,children:t.label||t.key})]},t.key)),t.length>0&&n&&(0,m.jsx)(yP,{}),n&&(0,m.jsx)(`div`,{className:`px-1.5 py-1`,children:(0,m.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,m.jsx)(iF,{placeholder:`custom_variable`,value:c,onChange:e=>l(e.target.value.replace(/[^a-zA-Z0-9_]/g,`_`).toLowerCase()),onKeyDown:t=>{t.key===`Enter`&&c.trim()&&(n(c.trim()),e.chain().focus().insertVariable(c.trim()).run(),l(``))},className:`h-7 text-xs font-mono`}),(0,m.jsx)(PC,{size:`xs`,disabled:!c.trim(),onClick:()=>{c.trim()&&(n(c.trim()),e.chain().focus().insertVariable(c.trim()).run(),l(``))},children:`Add`})]})})]})]})]}),D&&(0,m.jsxs)(m.Fragment,{children:[k(9)&&(0,m.jsx)(sT,{orientation:`vertical`,className:`mx-1 h-6`}),(0,m.jsxs)(fP,{children:[(0,m.jsxs)(pP,{render:(0,m.jsx)(PC,{variant:`ghost`,size:`xs`,className:`gap-1`}),children:[(0,m.jsx)(HC,{className:`size-3.5`,strokeWidth:1.5}),(0,m.jsx)(`span`,{className:`text-xs`,children:`Blocks`}),(0,m.jsx)(KC,{className:`size-3`,strokeWidth:1.5})]}),(0,m.jsx)(mP,{align:`start`,children:r.map(t=>{let n=t.icon;return(0,m.jsxs)(hP,{onClick:()=>t.insert(e),children:[(0,m.jsx)(n,{className:`size-4 mr-2`}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`text-sm`,children:t.label}),t.description&&(0,m.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:t.description})]})]},t.name)})})]})]}),(0,m.jsx)(`input`,{ref:s,type:`file`,accept:`image/*`,multiple:!0,style:{display:`none`},onChange:g})]}),i&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`flex-1`}),(0,m.jsx)(sT,{orientation:`vertical`,className:`mx-1 h-6`}),(0,m.jsx)(`div`,{className:`flex items-center gap-1`,children:i})]})]})})}function uF(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var dF=class{constructor({editor:e,element:t,view:n,pluginKey:r=`bubbleMenu`,updateDelay:i=250,resizeDelay:a=60,shouldShow:o,appendTo:s,getReferencedVirtualElement:c,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:`absolute`,placement:`top`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&zc(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);!n&&!r||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`&&this.updateOptions(t.options)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=l?.scrollTarget??window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener(`dragstart`,this.dragstartHandler),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(cA(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(sA(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(aA(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(dA(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(lA(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(oA(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(uA(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(fA(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){let{selection:e}=this.editor.state,t=this.getReferencedVirtualElement?.call(this);if(t)return t;if(!this.view?.dom?.parentNode)return;let n=Cu(this.view,e.from,e.to),r={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof G){let t=this.view.nodeDOM(e.from),n=t.dataset.nodeViewWrapper?t:t.querySelector(`[data-node-view-wrapper]`);n&&(t=n),t&&(r={getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>[t.getBoundingClientRect()]})}if(e instanceof cv){let{$anchorCell:t,$headCell:n}=e,i=t?t.pos:n.pos,a=n?n.pos:t.pos,o=this.view.nodeDOM(i),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():uF(o.getBoundingClientRect(),s.getBoundingClientRect());r={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return r}updatePosition(){let e=this.virtualElement;e&&mA(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},fF=e=>new Pn({key:typeof e.pluginKey==`string`?new Ln(e.pluginKey):e.pluginKey,view:t=>new dF({view:t,...e})});fd.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[fF({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var pF=class{constructor({editor:e,element:t,view:n,pluginKey:r=`floatingMenu`,updateDelay:i=250,resizeDelay:a=60,options:o,appendTo:s,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.floatingUIOptions={strategy:`absolute`,placement:`right`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`&&this.updateOptions(t.options)},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=o?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,c&&(this.shouldShow=c),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return eu(e,{textSerializers:tu(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(cA(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(sA(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(aA(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(dA(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(lA(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(oA(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(uA(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(fA(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){let{selection:e}=this.editor.state,t=Cu(this.view,e.from,e.to);mA({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},mF=e=>new Pn({key:typeof e.pluginKey==`string`?new Ln(e.pluginKey):e.pluginKey,view:t=>new pF({view:t,...e})});fd.create({name:`floatingMenu`,addOptions(){return{element:null,options:{},pluginKey:`floatingMenu`,updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,`updatePosition`),!0)}},addProseMirrorPlugins(){return this.options.element?[mF({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function hF(e,t){return e??new Ln(t)}var gF=typeof window<`u`?f.useLayoutEffect:f.useEffect,_F=new Set([`left`,`opacity`,`position`,`top`,`visibility`,`width`]),vF=new Set(`animationIterationCount.aspectRatio.borderImageOutset.borderImageSlice.borderImageWidth.columnCount.columns.fillOpacity.flex.flexGrow.flexShrink.fontWeight.gridArea.gridColumn.gridColumnEnd.gridColumnStart.gridRow.gridRowEnd.gridRowStart.lineClamp.lineHeight.opacity.order.orphans.scale.stopOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeOpacity.strokeWidth.tabSize.widows.zIndex.zoom`.split(`.`)),yF=new Set([`children`,`className`,`style`]),bF=new Set([`tabIndex`]),xF=new Set([`accessKey`,`autoCapitalize`,`contentEditable`,`contextMenu`,`dir`,`draggable`,`enterKeyHint`,`hidden`,`id`,`lang`,`nonce`,`role`,`slot`,`spellCheck`,`tabIndex`,`title`,`translate`]),SF={Blur:`focusout`,DoubleClick:`dblclick`,Focus:`focusin`,MouseEnter:`mouseenter`,MouseLeave:`mouseleave`};function CF(e,t){return/^on[A-Z]/.test(e)&&typeof t==`function`}function wF(e){return e.startsWith(`aria-`)||e.startsWith(`data-`),e}function TF(e){return e.startsWith(`aria-`)||e.startsWith(`data-`)||xF.has(e)}function EF(e){return e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function DF(e){let t=e.endsWith(`Capture`),n=(t?e.slice(0,-7):e).slice(2);return{eventName:SF[n]??n.toLowerCase(),options:t?{capture:!0}:void 0}}function OF(e,t){let n=t.defaultPrevented,r=!1,i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>void 0},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>r},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{r=!0,t.stopPropagation()}}}),i}function kF(e){return bF.has(e)}function AF(e,t,n){if(t===`tabIndex`){e.tabIndex=Number(n);return}e[t]=n}function jF(e,t){if(t===`tabIndex`){e.removeAttribute(`tabindex`);return}let n=e[t];if(typeof n==`boolean`){e[t]=!1;return}if(typeof n==`number`){e[t]=0;return}e[t]=``}function MF(e,t){return typeof t!=`number`||t===0||e.startsWith(`--`)||vF.has(e)?String(t):`${t}px`}function NF(e,t){_F.has(t)||e.style.removeProperty(EF(t))}function PF(e,t,n){_F.has(t)||e.style.setProperty(EF(t),MF(t,n))}function FF(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(r=>{if(yF.has(r)||!TF(r)||CF(r,t[r])||CF(r,n[r]))return;let i=t[r],a=n[r];if(i===a)return;let o=wF(r);if(a==null||a===!1){kF(r)&&jF(e,r),e.removeAttribute(o);return}if(a===!0){kF(r)&&AF(e,r,!0),e.setAttribute(o,``);return}if(kF(r)){AF(e,r,a);return}e.setAttribute(o,String(a))})}function IF(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute(`class`)}}function LF(e,t,n){let r=t??{},i=n??{};new Set([...Object.keys(r),...Object.keys(i)]).forEach(t=>{let n=r[t],a=i[t];if(n!==a){if(a==null){NF(e,t);return}PF(e,t,a)}})}function RF(e,t,n){t.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)});let r=[];return Object.entries(n).forEach(([t,n])=>{if(!CF(t,n))return;let{eventName:i,options:a}=DF(t),o=t=>{n(OF(e,t))};e.addEventListener(i,o,a),r.push({eventName:i,listener:o,options:a})}),r}function zF(e,t){let n=(0,f.useRef)({}),r=(0,f.useRef)([]);gF(()=>{let i=n.current;return IF(e,i.className,t.className),LF(e,i.style,t.style),FF(e,i,t),r.current=RF(e,r.current,t),n.current=t,()=>{r.current.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),r.current=[]}},[e,t])}var BF=f.default.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,getReferencedVirtualElement:o,options:s,children:c,...l},u)=>{let d=(0,f.useRef)(document.createElement(`div`)),m=(0,f.useRef)(hF(e,`bubbleMenu`)).current;zF(d.current,l),typeof u==`function`?u(d.current):u&&(u.current=d.current);let{editor:h}=lp(),g=t||h,_={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:m,shouldShow:a,getReferencedVirtualElement:o,options:s},v=(0,f.useRef)(_);v.current=_;let[y,b]=(0,f.useState)(!1),x=(0,f.useRef)(!0);return(0,f.useEffect)(()=>{if(g?.isDestroyed)return;if(!g){console.warn(`BubbleMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=d.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=fF({...v.current,editor:g,element:e});g.registerPlugin(t);let n=v.current.pluginKey;return x.current=!0,b(!0),()=>{b(!1),g.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[g]),(0,f.useEffect)(()=>{if(!(!y||!g||g.isDestroyed)){if(x.current){x.current=!1;return}g.view.dispatch(g.state.tr.setMeta(m,{type:`updateOptions`,options:v.current}))}},[y,g,n,r,a,s,i,o,m]),(0,p.createPortal)(c,d.current)});f.default.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,options:o,children:s,...c},l)=>{let u=(0,f.useRef)(document.createElement(`div`)),d=(0,f.useRef)(hF(e,`floatingMenu`)).current;zF(u.current,c),typeof l==`function`?l(u.current):l&&(l.current=u.current);let{editor:m}=lp(),h=t||m,g={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:d,shouldShow:a,options:o},_=(0,f.useRef)(g);_.current=g;let[v,y]=(0,f.useState)(!1),b=(0,f.useRef)(!0);return(0,f.useEffect)(()=>{if(h?.isDestroyed)return;if(!h){console.warn(`FloatingMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=u.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=mF({..._.current,editor:h,element:e});h.registerPlugin(t);let n=_.current.pluginKey;return b.current=!0,y(!0),()=>{y(!1),h.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[h]),(0,f.useEffect)(()=>{if(!(!v||!h||h.isDestroyed)){if(b.current){b.current=!1;return}h.view.dispatch(h.state.tr.setMeta(d,{type:`updateOptions`,options:_.current}))}},[v,h,n,r,a,o,i,d]),(0,p.createPortal)(s,u.current)});function VF({editor:e}){let[t,n]=(0,f.useState)(``),r=(0,f.useCallback)(()=>{if(!t)e.chain().focus().unsetLink().run();else{let n=t.startsWith(`http`)?t:`https://${t}`;e.chain().focus().extendMarkRange(`link`).setLink({href:n}).run()}n(``)},[e,t]);return(0,m.jsxs)(BF,{editor:e,options:{placement:`top`,offset:8},shouldShow:({editor:e,state:t})=>{let{empty:n}=t.selection;return!(n||e.isActive(`resizableImage`)||e.isActive(`codeBlock`))},className:`flex items-center gap-0.5 bg-background border border-border rounded-lg shadow-xl p-1`,children:[(0,m.jsx)(PC,{variant:`ghost`,size:`icon-xs`,onClick:()=>e.chain().focus().toggleBold().run(),className:e.isActive(`bold`)?`bg-muted`:``,children:(0,m.jsx)(UC,{className:`size-3`,strokeWidth:1.5})}),(0,m.jsx)(PC,{variant:`ghost`,size:`icon-xs`,onClick:()=>e.chain().focus().toggleItalic().run(),className:e.isActive(`italic`)?`bg-muted`:``,children:(0,m.jsx)(sw,{className:`size-3`,strokeWidth:1.5})}),(0,m.jsx)(PC,{variant:`ghost`,size:`icon-xs`,onClick:()=>e.chain().focus().toggleUnderline().run(),className:e.isActive(`underline`)?`bg-muted`:``,children:(0,m.jsx)(zw,{className:`size-3`,strokeWidth:1.5})}),(0,m.jsx)(PC,{variant:`ghost`,size:`icon-xs`,onClick:()=>e.chain().focus().toggleStrike().run(),className:e.isActive(`strike`)?`bg-muted`:``,children:(0,m.jsx)(kw,{className:`size-3`,strokeWidth:1.5})}),(0,m.jsx)(PC,{variant:`ghost`,size:`icon-xs`,onClick:()=>e.chain().focus().toggleCode().run(),className:e.isActive(`code`)?`bg-muted`:``,children:(0,m.jsx)(YC,{className:`size-3`,strokeWidth:1.5})}),(0,m.jsx)(PC,{variant:`ghost`,size:`icon-xs`,onClick:()=>e.chain().focus().toggleHighlight().run(),className:e.isActive(`highlight`)?`bg-muted`:``,children:(0,m.jsx)(aw,{className:`size-3`,strokeWidth:1.5})}),(0,m.jsx)(`div`,{className:`w-px h-4 bg-border mx-0.5`}),(0,m.jsxs)(zP,{children:[(0,m.jsx)(BP,{render:(0,m.jsx)(PC,{variant:`ghost`,size:`icon-xs`,className:e.isActive(`link`)?`bg-muted`:``}),children:(0,m.jsx)(cw,{className:`size-3`,strokeWidth:1.5})}),(0,m.jsx)(VP,{className:`w-64 p-2`,side:`top`,children:(0,m.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,m.jsx)(iF,{placeholder:`https://...`,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>e.key===`Enter`&&r(),className:`h-7 text-xs`}),(0,m.jsx)(PC,{size:`xs`,onClick:r,children:`Set`})]})})]}),(0,m.jsx)(`div`,{className:`w-px h-4 bg-border mx-0.5`}),(0,m.jsx)(PC,{variant:`ghost`,size:`icon-xs`,onClick:()=>e.chain().focus().unsetAllMarks().run(),title:`Clear formatting`,children:(0,m.jsx)(ww,{className:`size-3`,strokeWidth:1.5})})]})}function HF({node:e,updateAttributes:t,selected:n,editor:r}){let{src:i,width:a}=e.attrs,o=r.isEditable,[s,c]=(0,f.useState)(a),[l,u]=(0,f.useState)(!1),d=(0,f.useRef)(null),p=(0,f.useRef)({x:0,w:0}),h=(0,f.useCallback)(()=>{d.current&&!s&&c(Math.min(d.current.naturalWidth,200))},[s]),g=(0,f.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),u(!0),p.current={x:e.clientX,w:s||100}},[s]);return(0,f.useEffect)(()=>{if(!l)return;let e=s||100,n=t=>{let n=t.clientX-p.current.x;e=Math.max(20,p.current.w+n),c(e)},r=()=>{u(!1),t({width:e})};return window.addEventListener(`mousemove`,n),window.addEventListener(`mouseup`,r),()=>{window.removeEventListener(`mousemove`,n),window.removeEventListener(`mouseup`,r)}},[l,t]),(0,m.jsxs)(pp,{as:`span`,style:{display:`inline-block`,position:`relative`,lineHeight:0},children:[(0,m.jsx)(`img`,{ref:d,src:i,alt:e.attrs.alt||``,draggable:!1,onLoad:h,style:{width:s?`${s}px`:`auto`,maxHeight:`100%`,verticalAlign:`top`,borderRadius:`2px`,outline:n&&o?`2px solid #3b82f6`:`none`,outlineOffset:`1px`,cursor:`default`}}),n&&o&&(0,m.jsx)(`span`,{onMouseDown:g,style:{position:`absolute`,bottom:-3,right:-3,width:8,height:8,background:`white`,border:`2px solid #3b82f6`,borderRadius:`50%`,cursor:`se-resize`,zIndex:1}})]})}var UF=Wd.create({name:`image`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!0,addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null}}},parseHTML(){return[{tag:`img[src]`}]},renderHTML({HTMLAttributes:e}){let{width:t,...n}=e;return[`img`,Ul(n,{style:t?`width: ${t}px`:void 0})]},addNodeView(){return xp(HF)}});function WF({content:e,onChange:t,placeholder:n,isEditing:r,onStartEdit:i,editorRef:a}){let o=(0,f.useRef)(t);o.current=t;let s=sp({extensions:[B_.configure({heading:!1,bulletList:!1,orderedList:!1,codeBlock:!1,blockquote:!1,horizontalRule:!1}),UF,Hy.configure({types:[`paragraph`]}),Jg,ug.configure({openOnClick:!1}),Ky,Jy],content:e||``,editable:r,onUpdate:({editor:e})=>{o.current(e.getHTML())},editorProps:{attributes:{class:`doccraft-hf-editor`,spellcheck:`true`},handleDrop(e,t){let n=t.dataTransfer?.files;if(!n||n.length===0)return!1;let r=Array.from(n).filter(e=>e.type.startsWith(`image/`));return r.length===0?!1:(t.preventDefault(),r.forEach(t=>{let n=new FileReader;n.onload=()=>{let t=n.result;e.dispatch(e.state.tr.replaceSelectionWith(e.state.schema.nodes.image.create({src:t})))},n.readAsDataURL(t)}),!0)}}});(0,f.useEffect)(()=>{a&&(a.current=s)},[s,a]),(0,f.useEffect)(()=>{s&&(s.setEditable(r),r&&setTimeout(()=>s.commands.focus(`end`),0))},[s,r]);let c=(0,f.useRef)(e);(0,f.useEffect)(()=>{s&&(s.isFocused||e!==c.current&&(c.current=e,s.commands.setContent(e||``)))},[s,e]);let l=e&&e!==`<p></p>`;return(0,m.jsxs)(`div`,{className:`doccraft-hf-field ${r?`doccraft-hf-field--editing`:``}`,onDoubleClick:r?void 0:i,children:[!r&&!l&&(0,m.jsx)(`span`,{className:`doccraft-hf-display__placeholder`,children:n}),(0,m.jsx)(`div`,{className:`doccraft-hf-field__editor ${!r&&!l?`doccraft-hf-field__editor--hidden`:``}`,children:(0,m.jsx)($f,{editor:s})})]})}var GF=50;function KF({editor:e}){let[t,n]=(0,f.useState)([]),[r,i]=(0,f.useState)([]),[a,o]=(0,f.useState)(null),[s,c]=(0,f.useState)(null),[l,u]=(0,f.useState)(-1),[d,p]=(0,f.useState)(-1),[h,g]=(0,f.useState)(!1),_=(0,f.useRef)(!1),v=(0,f.useCallback)(()=>{if(!e.isEditable||!s){n([]),i([]),o(null);return}let t=s.closest(`.editor-pages-container`);if(!t)return;let r=t.getBoundingClientRect(),a=s.getBoundingClientRect(),c=a.right-r.left,l=a.bottom-r.top;o({top:a.top-r.top,left:a.left-r.left});let u=s.querySelectorAll(`tr`),d=[];u.forEach(e=>{let t=e.getBoundingClientRect();d.push({top:t.top-r.top,height:t.height,right:c})}),n(d);let f=u[0];if(!f){i([]);return}let p=f.querySelectorAll(`td, th`),m=[];p.forEach(e=>{let t=e.getBoundingClientRect();m.push({left:t.left-r.left,width:t.width,bottom:l})}),i(m)},[e,s]);(0,f.useEffect)(()=>{let e=e=>{let t=e.target;if(t.closest(`.table-control`)||_.current)return;let n=t.closest(`table`);if(n!==s&&(c(n),u(-1),p(-1)),!n){u(-1),p(-1),g(!1);return}let r=n.getBoundingClientRect(),i=Math.abs(e.clientX-r.left),a=Math.abs(e.clientY-r.top);if(g(i<GF&&a<GF),Math.abs(e.clientX-r.right)<GF){let t=n.querySelectorAll(`tr`),r=-1;t.forEach((t,n)=>{let i=t.getBoundingClientRect();e.clientY>=i.top&&e.clientY<=i.bottom&&(r=n)}),u(r)}else u(-1);if(Math.abs(e.clientY-r.bottom)<GF){let t=n.querySelector(`tr`);if(t){let n=t.querySelectorAll(`td, th`),r=-1;n.forEach((t,n)=>{let i=t.getBoundingClientRect();e.clientX>=i.left&&e.clientX<=i.right&&(r=n)}),p(r)}}else p(-1)};return document.addEventListener(`mousemove`,e),()=>document.removeEventListener(`mousemove`,e)},[s]),(0,f.useEffect)(()=>{v();let t=e.view.dom.closest(`.editor-canvas`),n=()=>v();return t?.addEventListener(`scroll`,n,{passive:!0}),e.on(`update`,v),()=>{t?.removeEventListener(`scroll`,n),e.off(`update`,v)}},[e,v]);let y=(0,f.useCallback)((t,n)=>{if(!s)return;let r=s.querySelectorAll(`tr`)[t];if(!r)return;let i=r.querySelectorAll(`td, th`)[n];if(!i)return;let a=e.view.posAtDOM(i,0);e.chain().focus(a).run()},[e,s]),b=(0,f.useCallback)((t,n)=>{_.current=!0,y(t,0),setTimeout(()=>{n===`add`?e.chain().addRowAfter().run():e.chain().deleteRow().run(),_.current=!1},0)},[e,y]),x=(0,f.useCallback)(()=>{_.current=!0,y(0,0),setTimeout(()=>{e.chain().deleteTable().run(),c(null),_.current=!1},0)},[e,y]),S=(0,f.useCallback)((t,n)=>{_.current=!0,y(0,t),setTimeout(()=>{n===`add`?e.chain().addColumnAfter().run():e.chain().deleteColumn().run(),_.current=!1},0)},[e,y]);return t.length===0&&r.length===0?null:(0,m.jsxs)(`div`,{className:`table-controls`,children:[h&&a&&(0,m.jsx)(`div`,{className:`table-control table-control--delete-table table-control--visible`,style:{position:`absolute`,top:a.top-10,left:a.left-10,zIndex:20},children:(0,m.jsx)(`button`,{className:`table-control__btn table-control__btn--delete-table`,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),x()},title:`Delete table`,children:(0,m.jsx)(Lw,{className:`size-3.5`,strokeWidth:1.5})})}),l>=0&&l<t.length&&(()=>{let e=t[l];return(0,m.jsxs)(`div`,{className:`table-control table-control--row table-control--visible`,style:{position:`absolute`,top:e.top+e.height/2-10,left:e.right-10,zIndex:20},children:[(0,m.jsx)(`button`,{className:`table-control__btn table-control__btn--add`,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),b(l,`add`)},title:`Add row below`,children:(0,m.jsx)(bw,{className:`size-3`,strokeWidth:1.5})}),(0,m.jsx)(`button`,{className:`table-control__btn table-control__btn--delete`,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),b(l,`delete`)},title:`Delete row`,children:(0,m.jsx)(Vw,{className:`size-3`,strokeWidth:1.5})})]})})(),d>=0&&d<r.length&&(()=>{let e=r[d];return(0,m.jsxs)(`div`,{className:`table-control table-control--col table-control--visible`,style:{position:`absolute`,top:e.bottom-10,left:e.left+e.width/2-21,zIndex:20},children:[(0,m.jsx)(`button`,{className:`table-control__btn table-control__btn--add`,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),S(d,`add`)},title:`Add column right`,children:(0,m.jsx)(bw,{className:`size-3`,strokeWidth:1.5})}),(0,m.jsx)(`button`,{className:`table-control__btn table-control__btn--delete`,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),S(d,`delete`)},title:`Delete column`,children:(0,m.jsx)(Vw,{className:`size-3`,strokeWidth:1.5})})]})})()]})}function qF({html:e,className:t}){let n=(0,f.useRef)(null);return(0,f.useEffect)(()=>{if(!n.current||(n.current.textContent=``,!e||e===`<p></p>`))return;let t=new DOMParser().parseFromString(e,`text/html`);t.querySelectorAll(`script, [onload], [onerror], [onclick]`).forEach(e=>e.remove()),Array.from(t.body.childNodes).forEach(e=>{n.current.appendChild(document.importNode(e,!0))})},[e]),(0,m.jsx)(`div`,{ref:n,className:t})}function JF({editor:e,canvas:t,header:n=``,footer:r=``,onHeaderChange:i,onFooterChange:a,onActiveHfEditor:o,readOnly:s=!1,theme:c}){let l=t.heightPx||0,u=t.paddingPx.top,d=t.contentHeightPx||0,p=t.pageGap,h=(0,f.useRef)(null),g=(0,f.useRef)(null),_=(0,f.useRef)(null),v=(0,f.useRef)(null),[y,b]=(0,f.useState)([{top:0,height:l}]),x=(0,f.useRef)(y);x.current=y;let[S,C]=(0,f.useState)(!1),[w,T]=(0,f.useState)(!1);(0,f.useEffect)(()=>{s&&(C(!1),T(!1))},[s]);let E=(0,f.useCallback)(()=>{s||(T(!1),C(!0),setTimeout(()=>o?.(_.current),0))},[o,s]),D=(0,f.useCallback)(()=>{s||(C(!1),T(!0),setTimeout(()=>o?.(v.current),0))},[o,s]),O=(0,f.useCallback)(()=>{(S||w)&&(C(!1),T(!1),o?.(null))},[S,w,o]),k=(0,f.useCallback)(()=>{if(!g.current||!h.current)return;let e=g.current.querySelector(`.ProseMirror`);if(!e)return;let t=g.current.getBoundingClientRect(),n=e.querySelectorAll(`[data-page-break], .page-break`),r=[];n.forEach(e=>{let n=e.getBoundingClientRect().top-t.top;r.push(n)}),r.sort((e,t)=>e-t);let i=[],a=0,o=0,s=document.querySelector(`style[data-page-flow]`);if(s){let e=s.textContent?.match(/margin-top:\s*([\d.]+)px/g);e&&e.forEach(e=>{let t=parseFloat(e.replace(`margin-top:`,``));isNaN(t)||(o+=t)})}let c=e.scrollHeight-o+u*2,f=[0,...r,c];for(let e=0;e<f.length-1;e++){let t=f[e],n=f[e+1]-t-(e>0?p:0);e>0&&(a+=p);let r=Math.max(0,n-u*2),o=Math.max(1,Math.ceil(r/d));for(let e=0;e<o;e++)i.push({top:a,height:l}),e<o-1?a+=l+p:a+=l}let m=x.current;(i.length!==m.length||i.some((e,t)=>e.top!==m[t]?.top||e.height!==m[t]?.height))&&b(i)},[]);(0,f.useEffect)(()=>{let t=g.current?.querySelector(`.ProseMirror`);if(!t)return;let n=new ResizeObserver(()=>{requestAnimationFrame(k)});n.observe(t);let r=null,i=()=>{r&&clearTimeout(r),r=setTimeout(()=>requestAnimationFrame(k),150)};return e.on(`update`,i),requestAnimationFrame(k),setTimeout(()=>requestAnimationFrame(k),200),()=>{n.disconnect(),e.off(`update`,i),r&&clearTimeout(r)}},[e,k]);let A=y[y.length-1],j=A?A.top+A.height+p:l,M=n&&n!==`<p></p>`,N=r&&r!==`<p></p>`;return t.paginate?(0,m.jsx)(`div`,{className:`editor-canvas flex-1`,ref:h,style:{...c?.canvasBackground&&{background:c.canvasBackground}},children:(0,m.jsxs)(`div`,{className:`editor-pages-container`,style:{position:`relative`,minHeight:j},children:[y.map((e,n)=>(0,m.jsx)(`div`,{style:{position:`absolute`,top:e.top,left:`50%`,transform:`translateX(-50%)`,width:t.width,height:e.height,background:c?.pageBackground||`white`,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05)`,borderRadius:`2px`,pointerEvents:`none`,zIndex:0}},`bg-${n}`)),(0,m.jsx)(`div`,{ref:g,className:`editor-content-layer`,style:{position:`relative`,zIndex:1,width:t.width,margin:`0 auto`,padding:`${t.padding.top} ${t.padding.right} ${t.padding.bottom} ${t.padding.left}`,minHeight:j,...c?.fontFamily&&{fontFamily:c.fontFamily},...c?.fontSize&&{fontSize:c.fontSize},...c?.lineHeight&&{lineHeight:c.lineHeight},...c?.textColor&&{color:c.textColor}},onClick:O,children:(0,m.jsx)($f,{editor:e})}),!s&&(0,m.jsx)(KF,{editor:e}),y.slice(0,-1).map((e,t)=>{let n=e.top+e.height,r=y[t+1],i=r?r.top-n:p;return i<=0?null:(0,m.jsx)(`div`,{style:{position:`absolute`,top:n,left:0,right:0,height:i,background:`#f0f0f0`,zIndex:2,display:`flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`},children:(0,m.jsxs)(`div`,{style:{fontSize:`10px`,color:`#9ca3af`,letterSpacing:`0.05em`,padding:`0 12px`},children:[t+1,` / `,y.length]})},`gap-${t}`)}),y.map((e,o)=>(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`doccraft-hf doccraft-hf--header`,style:{position:`absolute`,top:e.top,left:`50%`,transform:`translateX(-50%)`,width:t.width,height:u,zIndex:10,display:`flex`,alignItems:`flex-end`},children:o===0?(0,m.jsx)(WF,{content:n,onChange:e=>i?.(e),placeholder:`Double-click to add header`,isEditing:S,onStartEdit:E,editorRef:_}):(0,m.jsx)(`div`,{className:`doccraft-hf-display`,onDoubleClick:E,children:M?(0,m.jsx)(qF,{html:n,className:`doccraft-hf-display__content`}):(0,m.jsx)(`span`,{className:`doccraft-hf-display__placeholder`,children:`Double-click to add header`})})}),(0,m.jsx)(`div`,{className:`doccraft-hf doccraft-hf--footer`,style:{position:`absolute`,top:e.top+e.height-u,left:`50%`,transform:`translateX(-50%)`,width:t.width,height:u,zIndex:10,display:`flex`,alignItems:`flex-start`},children:o===0?(0,m.jsx)(WF,{content:r,onChange:e=>a?.(e),placeholder:`Double-click to add footer`,isEditing:w,onStartEdit:D,editorRef:v}):(0,m.jsx)(`div`,{className:`doccraft-hf-display`,onDoubleClick:D,children:N?(0,m.jsx)(qF,{html:r,className:`doccraft-hf-display__content`}):(0,m.jsx)(`span`,{className:`doccraft-hf-display__placeholder`,children:`Double-click to add footer`})})})]},`hf-${o}`))]})}):(0,m.jsxs)(`div`,{className:`editor-canvas flex-1`,ref:h,style:{...c?.canvasBackground&&{background:c.canvasBackground}},children:[(0,m.jsx)(`div`,{style:{width:t.width,margin:`0 auto`,padding:`${t.padding.top} ${t.padding.right} ${t.padding.bottom} ${t.padding.left}`,background:c?.pageBackground||`white`,minHeight:`100%`,boxShadow:`0 2px 8px rgba(0,0,0,0.1)`,...c?.fontFamily&&{fontFamily:c.fontFamily},...c?.fontSize&&{fontSize:c.fontSize},...c?.lineHeight&&{lineHeight:c.lineHeight},...c?.textColor&&{color:c.textColor}},children:(0,m.jsx)($f,{editor:e})}),!s&&(0,m.jsx)(KF,{editor:e})]})}var YF,XF,ZF,QF,$F,eI,tI,nI,rI,iI,aI,oI,sI,cI,lI,uI,dI,fI,pI,mI,hI=o((()=>{YF=`1.13.8`,XF=typeof self==`object`&&self.self===self&&self||typeof global==`object`&&global.global===global&&global||Function(`return this`)()||{},ZF=Array.prototype,QF=Object.prototype,$F=typeof Symbol<`u`?Symbol.prototype:null,eI=ZF.push,tI=ZF.slice,nI=QF.toString,rI=QF.hasOwnProperty,iI=typeof ArrayBuffer<`u`,aI=typeof DataView<`u`,oI=Array.isArray,sI=Object.keys,cI=Object.create,lI=iI&&ArrayBuffer.isView,uI=isNaN,dI=isFinite,fI=!{toString:null}.propertyIsEnumerable(`toString`),pI=[`valueOf`,`isPrototypeOf`,`toString`,`propertyIsEnumerable`,`hasOwnProperty`,`toLocaleString`],mI=2**53-1}));function gI(e,t){return t=t==null?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+t];switch(t){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var a=Array(t+1);for(i=0;i<t;i++)a[i]=arguments[i];return a[t]=r,e.apply(this,a)}}var _I=o((()=>{}));function vI(e){var t=typeof e;return t===`function`||t===`object`&&!!e}var yI=o((()=>{}));function bI(e){return e===null}var xI=o((()=>{}));function SI(e){return e===void 0}var CI=o((()=>{}));function wI(e){return e===!0||e===!1||nI.call(e)===`[object Boolean]`}var TI=o((()=>{hI()}));function EI(e){return!!(e&&e.nodeType===1)}var DI=o((()=>{}));function OI(e){var t=`[object `+e+`]`;return function(e){return nI.call(e)===t}}var kI=o((()=>{hI()})),AI,jI=o((()=>{kI(),AI=OI(`String`)})),MI,NI=o((()=>{kI(),MI=OI(`Number`)})),PI,FI=o((()=>{kI(),PI=OI(`Date`)})),II,LI=o((()=>{kI(),II=OI(`RegExp`)})),RI,zI=o((()=>{kI(),RI=OI(`Error`)})),BI,VI=o((()=>{kI(),BI=OI(`Symbol`)})),HI,UI=o((()=>{kI(),HI=OI(`ArrayBuffer`)})),WI,GI,KI,qI=o((()=>{kI(),hI(),WI=OI(`Function`),GI=XF.document&&XF.document.childNodes,typeof/./!=`function`&&typeof Int8Array!=`object`&&typeof GI!=`function`&&(WI=function(e){return typeof e==`function`||!1}),KI=WI})),JI,YI=o((()=>{kI(),JI=OI(`Object`)})),XI,ZI,QI=o((()=>{hI(),YI(),XI=aI&&(!/\[native code\]/.test(String(DataView))||JI(new DataView(new ArrayBuffer(8)))),ZI=typeof Map<`u`&&JI(new Map)}));function $I(e){return e!=null&&KI(e.getInt8)&&HI(e.buffer)}var eL,tL,nL=o((()=>{kI(),qI(),UI(),QI(),eL=OI(`DataView`),tL=XI?$I:eL})),rL,iL=o((()=>{hI(),kI(),rL=oI||OI(`Array`)}));function aL(e,t){return e!=null&&rI.call(e,t)}var oL=o((()=>{hI()})),sL,cL,lL=o((()=>{kI(),oL(),sL=OI(`Arguments`),(function(){sL(arguments)||(sL=function(e){return aL(e,`callee`)})})(),cL=sL}));function uL(e){return!BI(e)&&dI(e)&&!isNaN(parseFloat(e))}var dL=o((()=>{hI(),VI()}));function fL(e){return MI(e)&&uI(e)}var pL=o((()=>{hI(),NI()}));function mL(e){return function(){return e}}var hL=o((()=>{}));function gL(e){return function(t){var n=e(t);return typeof n==`number`&&n>=0&&n<=mI}}var _L=o((()=>{hI()}));function vL(e){return function(t){return t?.[e]}}var yL=o((()=>{})),bL,xL=o((()=>{yL(),bL=vL(`byteLength`)})),SL,CL=o((()=>{_L(),xL(),SL=gL(bL)}));function wL(e){return lI?lI(e)&&!tL(e):SL(e)&&TL.test(nI.call(e))}var TL,EL,DL=o((()=>{hI(),nL(),hL(),CL(),TL=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,EL=iI?wL:mL(!1)})),OL,kL=o((()=>{yL(),OL=vL(`length`)}));function AL(e){for(var t={},n=e.length,r=0;r<n;++r)t[e[r]]=!0;return{contains:function(e){return t[e]===!0},push:function(n){return t[n]=!0,e.push(n)}}}function jL(e,t){t=AL(t);var n=pI.length,r=e.constructor,i=KI(r)&&r.prototype||QF,a=`constructor`;for(aL(e,a)&&!t.contains(a)&&t.push(a);n--;)a=pI[n],a in e&&e[a]!==i[a]&&!t.contains(a)&&t.push(a)}var ML=o((()=>{hI(),qI(),oL()}));function NL(e){if(!vI(e))return[];if(sI)return sI(e);var t=[];for(var n in e)aL(e,n)&&t.push(n);return fI&&jL(e,t),t}var PL=o((()=>{yI(),hI(),oL(),ML()}));function FL(e){if(e==null)return!0;var t=OL(e);return typeof t==`number`&&(rL(e)||AI(e)||cL(e))?t===0:OL(NL(e))===0}var IL=o((()=>{kL(),iL(),jI(),lL(),PL()}));function LL(e,t){var n=NL(t),r=n.length;if(e==null)return!r;for(var i=Object(e),a=0;a<r;a++){var o=n[a];if(t[o]!==i[o]||!(o in i))return!1}return!0}var RL=o((()=>{PL()}));function zL(e){if(e instanceof zL)return e;if(!(this instanceof zL))return new zL(e);this._wrapped=e}var BL=o((()=>{hI(),zL.VERSION=YF,zL.prototype.value=function(){return this._wrapped},zL.prototype.valueOf=zL.prototype.toJSON=zL.prototype.value,zL.prototype.toString=function(){return String(this._wrapped)}}));function VL(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,bL(e))}var HL=o((()=>{xL()}));function UL(e,t){for(var n=[{a:e,b:t}],r=[],i=[];n.length;){var a=n.pop();if(a===!0){r.pop(),i.pop();continue}if(e=a.a,t=a.b,e===t){if(e!==0||1/e==1/t)continue;return!1}if(e==null||t==null)return!1;if(e!==e){if(t!==t)continue;return!1}var o=typeof e;if(o!==`function`&&o!==`object`&&typeof t!=`object`)return!1;e instanceof zL&&(e=e._wrapped),t instanceof zL&&(t=t._wrapped);var s=nI.call(e);if(s!==nI.call(t))return!1;if(XI&&s==`[object Object]`&&tL(e)){if(!tL(t))return!1;s=WL}switch(s){case`[object RegExp]`:case`[object String]`:if(``+e==``+t)continue;return!1;case`[object Number]`:n.push({a:+e,b:+t});continue;case`[object Date]`:case`[object Boolean]`:if(+e==+t)continue;return!1;case`[object Symbol]`:if($F.valueOf.call(e)===$F.valueOf.call(t))continue;return!1;case`[object ArrayBuffer]`:case WL:n.push({a:VL(e),b:VL(t)});continue}var c=s===`[object Array]`;if(!c&&EL(e)){if(bL(e)!==bL(t))return!1;if(e.buffer===t.buffer&&e.byteOffset===t.byteOffset)continue;c=!0}if(!c){if(typeof e!=`object`||typeof t!=`object`)return!1;var l=e.constructor,u=t.constructor;if(l!==u&&!(KI(l)&&l instanceof l&&KI(u)&&u instanceof u)&&`constructor`in e&&`constructor`in t)return!1}for(var d=r.length;d--;)if(r[d]===e){if(i[d]===t)break;return!1}if(!(d>=0))if(r.push(e),i.push(t),n.push(!0),c){if(d=e.length,d!==t.length)return!1;for(;d--;)n.push({a:e[d],b:t[d]})}else{var f=NL(e),p;if(d=f.length,NL(t).length!==d)return!1;for(;d--;){if(p=f[d],!aL(t,p))return!1;n.push({a:e[p],b:t[p]})}}}return!0}var WL,GL=o((()=>{BL(),hI(),xL(),DL(),qI(),QI(),nL(),PL(),oL(),HL(),WL=`[object DataView]`}));function KL(e){if(!vI(e))return[];var t=[];for(var n in e)t.push(n);return fI&&jL(e,t),t}var qL=o((()=>{yI(),hI(),ML()}));function JL(e){var t=OL(e);return function(n){if(n==null||OL(KL(n)))return!1;for(var r=0;r<t;r++)if(!KI(n[e[r]]))return!1;return e!==eR||!KI(n[YL])}}var YL,XL,ZL,QL,$L,eR,tR,nR=o((()=>{kL(),qI(),qL(),YL=`forEach`,XL=`has`,ZL=[`clear`,`delete`],QL=[`get`,XL,`set`],$L=ZL.concat(YL,QL),eR=ZL.concat(QL),tR=[`add`].concat(ZL,YL,XL)})),rR,iR=o((()=>{kI(),QI(),nR(),rR=ZI?JL($L):OI(`Map`)})),aR,oR=o((()=>{kI(),QI(),nR(),aR=ZI?JL(eR):OI(`WeakMap`)})),sR,cR=o((()=>{kI(),QI(),nR(),sR=ZI?JL(tR):OI(`Set`)})),lR,uR=o((()=>{kI(),lR=OI(`WeakSet`)}));function dR(e){for(var t=NL(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=e[t[i]];return r}var fR=o((()=>{PL()}));function pR(e){for(var t=NL(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r}var mR=o((()=>{PL()}));function hR(e){for(var t={},n=NL(e),r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t}var gR=o((()=>{PL()}));function _R(e){var t=[];for(var n in e)KI(e[n])&&t.push(n);return t.sort()}var vR=o((()=>{qI()}));function yR(e,t){return function(n){var r=arguments.length;if(t&&(n=Object(n)),r<2||n==null)return n;for(var i=1;i<r;i++)for(var a=arguments[i],o=e(a),s=o.length,c=0;c<s;c++){var l=o[c];(!t||n[l]===void 0)&&(n[l]=a[l])}return n}}var bR=o((()=>{})),xR,SR=o((()=>{bR(),qL(),xR=yR(KL)})),CR,wR=o((()=>{bR(),PL(),CR=yR(NL)})),TR,ER=o((()=>{bR(),qL(),TR=yR(KL,!0)}));function DR(){return function(){}}function OR(e){if(!vI(e))return{};if(cI)return cI(e);var t=DR();t.prototype=e;var n=new t;return t.prototype=null,n}var kR=o((()=>{yI(),hI()}));function AR(e,t){var n=OR(e);return t&&CR(n,t),n}var jR=o((()=>{kR(),wR()}));function MR(e){return vI(e)?rL(e)?e.slice():xR({},e):e}var NR=o((()=>{yI(),iL(),SR()}));function PR(e,t){return t(e),e}var FR=o((()=>{}));function IR(e){return rL(e)?e:[e]}var LR=o((()=>{BL(),iL(),zL.toPath=IR}));function RR(e){return zL.toPath(e)}var zR=o((()=>{BL(),LR()}));function BR(e,t){for(var n=t.length,r=0;r<n;r++){if(e==null)return;e=e[t[r]]}return n?e:void 0}var VR=o((()=>{}));function HR(e,t,n){var r=BR(e,RR(t));return SI(r)?n:r}var UR=o((()=>{zR(),VR(),CI()}));function WR(e,t){t=RR(t);for(var n=t.length,r=0;r<n;r++){var i=t[r];if(!aL(e,i))return!1;e=e[i]}return!!n}var GR=o((()=>{oL(),zR()}));function KR(e){return e}var qR=o((()=>{}));function JR(e){return e=CR({},e),function(t){return LL(t,e)}}var YR=o((()=>{wR(),RL()}));function XR(e){return e=RR(e),function(t){return BR(t,e)}}var ZR=o((()=>{VR(),zR()}));function QR(e,t,n){if(t===void 0)return e;switch(n??3){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,a){return e.call(t,n,r,i,a)}}return function(){return e.apply(t,arguments)}}var $R=o((()=>{}));function ez(e,t,n){return e==null?KR:KI(e)?QR(e,t,n):vI(e)&&!rL(e)?JR(e):XR(e)}var tz=o((()=>{qR(),qI(),yI(),iL(),YR(),ZR(),$R()}));function nz(e,t){return ez(e,t,1/0)}var rz=o((()=>{BL(),tz(),zL.iteratee=nz}));function iz(e,t,n){return zL.iteratee===nz?ez(e,t,n):zL.iteratee(e,t)}var az=o((()=>{BL(),tz(),rz()}));function oz(e,t,n){t=iz(t,n);for(var r=NL(e),i=r.length,a={},o=0;o<i;o++){var s=r[o];a[s]=t(e[s],s,e)}return a}var sz=o((()=>{az(),PL()}));function cz(){}var lz=o((()=>{}));function uz(e){return e==null?cz:function(t){return HR(e,t)}}var dz=o((()=>{lz(),UR()}));function fz(e,t,n){var r=Array(Math.max(0,e));t=QR(t,n,1);for(var i=0;i<e;i++)r[i]=t(i);return r}var pz=o((()=>{$R()}));function mz(e,t){return t??(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}var hz=o((()=>{})),gz,_z=o((()=>{gz=Date.now||function(){return new Date().getTime()}}));function vz(e){var t=function(t){return e[t]},n=`(?:`+NL(e).join(`|`)+`)`,r=RegExp(n),i=RegExp(n,`g`);return function(e){return e=e==null?``:``+e,r.test(e)?e.replace(i,t):e}}var yz=o((()=>{PL()})),bz,xz=o((()=>{bz={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"`":```}})),Sz,Cz=o((()=>{yz(),xz(),Sz=vz(bz)})),wz,Tz=o((()=>{gR(),xz(),wz=hR(bz)})),Ez,Dz=o((()=>{yz(),Tz(),Ez=vz(wz)})),Oz,kz=o((()=>{BL(),Oz=zL.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g}}));function Az(e){return`\\`+Nz[e]}function jz(e,t,n){!t&&n&&(t=n),t=TR({},t,zL.templateSettings);var r=RegExp([(t.escape||Mz).source,(t.interpolate||Mz).source,(t.evaluate||Mz).source].join(`|`)+`|$`,`g`),i=0,a=`__p+='`;e.replace(r,function(t,n,r,o,s){return a+=e.slice(i,s).replace(Pz,Az),i=s+t.length,n?a+=`'+
|
|
264
|
+
((__t=(`+n+`))==null?'':_.escape(__t))+
|
|
265
|
+
'`:r?a+=`'+
|
|
266
|
+
((__t=(`+r+`))==null?'':__t)+
|
|
267
|
+
'`:o&&(a+=`';
|
|
268
|
+
`+o+`
|
|
269
|
+
__p+='`),t}),a+=`';
|
|
270
|
+
`;var o=t.variable;if(o){if(!Fz.test(o))throw Error(`variable is not a bare identifier: `+o)}else a=`with(obj||{}){
|
|
271
|
+
`+a+`}
|
|
272
|
+
`,o=`obj`;a=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
|
|
273
|
+
`+a+`return __p;
|
|
274
|
+
`;var s;try{s=Function(o,`_`,a)}catch(e){throw e.source=a,e}var c=function(e){return s.call(this,e,zL)};return c.source=`function(`+o+`){
|
|
275
|
+
`+a+`}`,c}var Mz,Nz,Pz,Fz,Iz=o((()=>{ER(),BL(),kz(),Mz=/(.)^/,Nz={"'":`'`,"\\":`\\`,"\r":`r`,"\n":`n`,"\u2028":`u2028`,"\u2029":`u2029`},Pz=/\\|'|\r|\n|\u2028|\u2029/g,Fz=/^\s*(\w|\$)+\s*$/}));function Lz(e,t,n){t=RR(t);var r=t.length;if(!r)return KI(n)?n.call(e):n;for(var i=0;i<r;i++){var a=e?.[t[i]];a===void 0&&(a=n,i=r),e=KI(a)?a.call(e):a}return e}var Rz=o((()=>{qI(),zR()}));function zz(e){var t=++Bz+``;return e?e+t:t}var Bz,Vz=o((()=>{Bz=0}));function Hz(e){var t=zL(e);return t._chain=!0,t}var Uz=o((()=>{BL()}));function Wz(e,t,n,r,i){if(!(r instanceof t))return e.apply(n,i);var a=OR(e.prototype),o=e.apply(a,i);return vI(o)?o:a}var Gz=o((()=>{kR(),yI()})),Kz,qz=o((()=>{_I(),Gz(),BL(),Kz=gI(function(e,t){var n=Kz.placeholder,r=function(){for(var i=0,a=t.length,o=Array(a),s=0;s<a;s++)o[s]=t[s]===n?arguments[i++]:t[s];for(;i<arguments.length;)o.push(arguments[i++]);return Wz(e,r,this,this,o)};return r}),Kz.placeholder=zL})),Jz,Yz=o((()=>{_I(),qI(),Gz(),Jz=gI(function(e,t,n){if(!KI(e))throw TypeError(`Bind must be called on a function`);var r=gI(function(i){return Wz(e,r,t,this,n.concat(i))});return r})})),Xz,Zz=o((()=>{_L(),kL(),Xz=gL(OL)}));function Qz(e,t,n){!t&&t!==0&&(t=1/0);for(var r=[],i=0,a=0,o=OL(e)||0,s=[];;){if(a>=o){if(!s.length)break;var c=s.pop();a=c.i,e=c.v,o=OL(e);continue}var l=e[a++];s.length>=t?r[i++]=l:Xz(l)&&(rL(l)||cL(l))?(s.push({i:a,v:e}),a=0,e=l,o=OL(e)):n||(r[i++]=l)}return r}var $z=o((()=>{kL(),Zz(),iL(),lL()})),eB,tB=o((()=>{_I(),$z(),Yz(),eB=gI(function(e,t){t=Qz(t,!1,!1);var n=t.length;if(n<1)throw Error(`bindAll must be passed function names`);for(;n--;){var r=t[n];e[r]=Jz(e[r],e)}return e})}));function nB(e,t){var n=function(r){var i=n.cache,a=``+(t?t.apply(this,arguments):r);return aL(i,a)||(i[a]=e.apply(this,arguments)),i[a]};return n.cache={},n}var rB=o((()=>{oL()})),iB,aB=o((()=>{_I(),iB=gI(function(e,t,n){return setTimeout(function(){return e.apply(null,n)},t)})})),oB,sB=o((()=>{qz(),aB(),BL(),oB=Kz(iB,zL,1)}));function cB(e,t,n){var r,i,a,o,s=0;n||={};var c=function(){s=n.leading===!1?0:gz(),r=null,o=e.apply(i,a),r||(i=a=null)},l=function(){var l=gz();!s&&n.leading===!1&&(s=l);var u=t-(l-s);return i=this,a=arguments,u<=0||u>t?(r&&=(clearTimeout(r),null),s=l,o=e.apply(i,a),r||(i=a=null)):!r&&n.trailing!==!1&&(r=setTimeout(c,u)),o};return l.cancel=function(){clearTimeout(r),s=0,r=i=a=null},l}var lB=o((()=>{_z()}));function uB(e,t,n){var r,i,a,o,s,c=function(){var l=gz()-i;t>l?r=setTimeout(c,t-l):(r=null,n||(o=e.apply(s,a)),r||(a=s=null))},l=gI(function(l){return s=this,a=l,i=gz(),r||(r=setTimeout(c,t),n&&(o=e.apply(s,a))),o});return l.cancel=function(){clearTimeout(r),r=a=s=null},l}var dB=o((()=>{_I(),_z()}));function fB(e,t){return Kz(t,e)}var pB=o((()=>{qz()}));function mB(e){return function(){return!e.apply(this,arguments)}}var hB=o((()=>{}));function gB(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}}var _B=o((()=>{}));function vB(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}var yB=o((()=>{}));function bB(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}var xB=o((()=>{})),SB,CB=o((()=>{qz(),xB(),SB=Kz(bB,2)}));function wB(e,t,n){t=iz(t,n);for(var r=NL(e),i,a=0,o=r.length;a<o;a++)if(i=r[a],t(e[i],i,e))return i}var TB=o((()=>{az(),PL()}));function EB(e){return function(t,n,r){n=iz(n,r);for(var i=OL(t),a=e>0?0:i-1;a>=0&&a<i;a+=e)if(n(t[a],a,t))return a;return-1}}var DB=o((()=>{az(),kL()})),OB,kB=o((()=>{DB(),OB=EB(1)})),AB,jB=o((()=>{DB(),AB=EB(-1)}));function MB(e,t,n,r){n=iz(n,r,1);for(var i=n(t),a=0,o=OL(e);a<o;){var s=Math.floor((a+o)/2);n(e[s])<i?a=s+1:o=s}return a}var NB=o((()=>{az(),kL()}));function PB(e,t,n){return function(r,i,a){var o=0,s=OL(r);if(typeof a==`number`)e>0?o=a>=0?a:Math.max(a+s,o):s=a>=0?Math.min(a+1,s):a+s+1;else if(n&&a&&s)return a=n(r,i),r[a]===i?a:-1;if(i!==i)return a=t(tI.call(r,o,s),fL),a>=0?a+o:-1;for(a=e>0?o:s-1;a>=0&&a<s;a+=e)if(r[a]===i)return a;return-1}}var FB=o((()=>{kL(),hI(),pL()})),IB,LB=o((()=>{NB(),kB(),FB(),IB=PB(1,OB,MB)})),RB,zB=o((()=>{jB(),FB(),RB=PB(-1,AB)}));function BB(e,t,n){var r=(Xz(e)?OB:wB)(e,t,n);if(r!==void 0&&r!==-1)return e[r]}var VB=o((()=>{Zz(),kB(),TB()}));function HB(e,t){return BB(e,JR(t))}var UB=o((()=>{VB(),YR()}));function WB(e,t,n){t=QR(t,n);var r,i;if(Xz(e))for(r=0,i=e.length;r<i;r++)t(e[r],r,e);else{var a=NL(e);for(r=0,i=a.length;r<i;r++)t(e[a[r]],a[r],e)}return e}var GB=o((()=>{$R(),Zz(),PL()}));function KB(e,t,n){t=iz(t,n);for(var r=!Xz(e)&&NL(e),i=(r||e).length,a=Array(i),o=0;o<i;o++){var s=r?r[o]:o;a[o]=t(e[s],s,e)}return a}var qB=o((()=>{az(),Zz(),PL()}));function JB(e){var t=function(t,n,r,i){var a=!Xz(t)&&NL(t),o=(a||t).length,s=e>0?0:o-1;for(i||(r=t[a?a[s]:s],s+=e);s>=0&&s<o;s+=e){var c=a?a[s]:s;r=n(r,t[c],c,t)}return r};return function(e,n,r,i){var a=arguments.length>=3;return t(e,QR(n,i,4),r,a)}}var YB=o((()=>{Zz(),PL(),$R()})),XB,ZB=o((()=>{YB(),XB=JB(1)})),QB,$B=o((()=>{YB(),QB=JB(-1)}));function eV(e,t,n){var r=[];return t=iz(t,n),WB(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}var tV=o((()=>{az(),GB()}));function nV(e,t,n){return eV(e,mB(iz(t)),n)}var rV=o((()=>{tV(),hB(),az()}));function iV(e,t,n){t=iz(t,n);for(var r=!Xz(e)&&NL(e),i=(r||e).length,a=0;a<i;a++){var o=r?r[a]:a;if(!t(e[o],o,e))return!1}return!0}var aV=o((()=>{az(),Zz(),PL()}));function oV(e,t,n){t=iz(t,n);for(var r=!Xz(e)&&NL(e),i=(r||e).length,a=0;a<i;a++){var o=r?r[a]:a;if(t(e[o],o,e))return!0}return!1}var sV=o((()=>{az(),Zz(),PL()}));function cV(e,t,n,r){return Xz(e)||(e=dR(e)),(typeof n!=`number`||r)&&(n=0),IB(e,t,n)>=0}var lV=o((()=>{Zz(),fR(),LB()})),uV,dV=o((()=>{_I(),qI(),qB(),VR(),zR(),uV=gI(function(e,t,n){var r,i;return KI(t)?i=t:(t=RR(t),r=t.slice(0,-1),t=t[t.length-1]),KB(e,function(e){var a=i;if(!a){if(r&&r.length&&(e=BR(e,r)),e==null)return;a=e[t]}return a==null?a:a.apply(e,n)})})}));function fV(e,t){return KB(e,XR(t))}var pV=o((()=>{qB(),ZR()}));function mV(e,t){return eV(e,JR(t))}var hV=o((()=>{tV(),YR()}));function gV(e,t,n){var r=-1/0,i=-1/0,a,o;if(t==null||typeof t==`number`&&typeof e[0]!=`object`&&e!=null){e=Xz(e)?e:dR(e);for(var s=0,c=e.length;s<c;s++)a=e[s],a!=null&&a>r&&(r=a)}else t=iz(t,n),WB(e,function(e,n,a){o=t(e,n,a),(o>i||o===-1/0&&r===-1/0)&&(r=e,i=o)});return r}var _V=o((()=>{Zz(),fR(),az(),GB()}));function vV(e,t,n){var r=1/0,i=1/0,a,o;if(t==null||typeof t==`number`&&typeof e[0]!=`object`&&e!=null){e=Xz(e)?e:dR(e);for(var s=0,c=e.length;s<c;s++)a=e[s],a!=null&&a<r&&(r=a)}else t=iz(t,n),WB(e,function(e,n,a){o=t(e,n,a),(o<i||o===1/0&&r===1/0)&&(r=e,i=o)});return r}var yV=o((()=>{Zz(),fR(),az(),GB()}));function bV(e){return e?rL(e)?tI.call(e):AI(e)?e.match(xV):Xz(e)?KB(e,KR):dR(e):[]}var xV,SV=o((()=>{iL(),hI(),jI(),Zz(),qB(),qR(),fR(),xV=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g}));function CV(e,t,n){if(t==null||n)return Xz(e)||(e=dR(e)),e[mz(e.length-1)];var r=bV(e),i=OL(r);t=Math.max(Math.min(t,i),0);for(var a=i-1,o=0;o<t;o++){var s=mz(o,a),c=r[o];r[o]=r[s],r[s]=c}return r.slice(0,t)}var wV=o((()=>{Zz(),fR(),kL(),hz(),SV()}));function TV(e){return CV(e,1/0)}var EV=o((()=>{wV()}));function DV(e,t,n){var r=0;return t=iz(t,n),fV(KB(e,function(e,n,i){return{value:e,index:r++,criteria:t(e,n,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||n===void 0)return 1;if(n<r||r===void 0)return-1}return e.index-t.index}),`value`)}var OV=o((()=>{az(),pV(),qB()}));function kV(e,t){return function(n,r,i){var a=t?[[],[]]:{};return r=iz(r,i),WB(n,function(t,i){e(a,t,r(t,i,n))}),a}}var AV=o((()=>{az(),GB()})),jV,MV=o((()=>{AV(),oL(),jV=kV(function(e,t,n){aL(e,n)?e[n].push(t):e[n]=[t]})})),NV,PV=o((()=>{AV(),NV=kV(function(e,t,n){e[n]=t})})),FV,IV=o((()=>{AV(),oL(),FV=kV(function(e,t,n){aL(e,n)?e[n]++:e[n]=1})})),LV,RV=o((()=>{AV(),LV=kV(function(e,t,n){e[n?0:1].push(t)},!0)}));function zV(e){return e==null?0:Xz(e)?e.length:NL(e).length}var BV=o((()=>{Zz(),PL()}));function VV(e,t,n){return t in n}var HV=o((()=>{})),UV,WV=o((()=>{_I(),qI(),$R(),qL(),HV(),$z(),UV=gI(function(e,t){var n={},r=t[0];if(e==null)return n;KI(r)?(t.length>1&&(r=QR(r,t[1])),t=KL(e)):(r=VV,t=Qz(t,!1,!1),e=Object(e));for(var i=0,a=t.length;i<a;i++){var o=t[i],s=e[o];r(s,o,e)&&(n[o]=s)}return n})})),GV,KV=o((()=>{_I(),qI(),hB(),qB(),$z(),lV(),WV(),GV=gI(function(e,t){var n=t[0],r;return KI(n)?(n=mB(n),t.length>1&&(r=t[1])):(t=KB(Qz(t,!1,!1),String),n=function(e,n){return!cV(t,n)}),UV(e,n,r)})}));function qV(e,t,n){return tI.call(e,0,Math.max(0,e.length-(t==null||n?1:t)))}var JV=o((()=>{hI()}));function YV(e,t,n){return e==null||e.length<1?t==null||n?void 0:[]:t==null||n?e[0]:qV(e,e.length-t)}var XV=o((()=>{JV()}));function ZV(e,t,n){return tI.call(e,t==null||n?1:t)}var QV=o((()=>{hI()}));function $V(e,t,n){return e==null||e.length<1?t==null||n?void 0:[]:t==null||n?e[e.length-1]:ZV(e,Math.max(0,e.length-t))}var eH=o((()=>{QV()}));function tH(e){return eV(e,Boolean)}var nH=o((()=>{tV()}));function rH(e,t){return Qz(e,t,!1)}var iH=o((()=>{$z()})),aH,oH=o((()=>{_I(),$z(),tV(),lV(),aH=gI(function(e,t){return t=Qz(t,!0,!0),eV(e,function(e){return!cV(t,e)})})})),sH,cH=o((()=>{_I(),oH(),sH=gI(function(e,t){return aH(e,t)})}));function lH(e,t,n,r){wI(t)||(r=n,n=t,t=!1),n!=null&&(n=iz(n,r));for(var i=[],a=[],o=0,s=OL(e);o<s;o++){var c=e[o],l=n?n(c,o,e):c;t&&!n?((!o||a!==l)&&i.push(c),a=l):n?cV(a,l)||(a.push(l),i.push(c)):cV(i,c)||i.push(c)}return i}var uH=o((()=>{TI(),az(),kL(),lV()})),dH,fH=o((()=>{_I(),uH(),$z(),dH=gI(function(e){return lH(Qz(e,!0,!0))})}));function pH(e){for(var t=[],n=arguments.length,r=0,i=OL(e);r<i;r++){var a=e[r];if(!cV(t,a)){var o;for(o=1;o<n&&cV(arguments[o],a);o++);o===n&&t.push(a)}}return t}var mH=o((()=>{kL(),lV()}));function hH(e){for(var t=e&&gV(e,OL).length||0,n=Array(t),r=0;r<t;r++)n[r]=fV(e,r);return n}var gH=o((()=>{_V(),kL(),pV()})),_H,vH=o((()=>{_I(),gH(),_H=gI(hH)}));function yH(e,t){for(var n={},r=0,i=OL(e);r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n}var bH=o((()=>{kL()}));function xH(e,t,n){t??(t=e||0,e=0),n||=t<e?-1:1;for(var r=Math.max(Math.ceil((t-e)/n),0),i=Array(r),a=0;a<r;a++,e+=n)i[a]=e;return i}var SH=o((()=>{}));function CH(e,t){if(t==null||t<1)return[];for(var n=[],r=0,i=e.length;r<i;)n.push(tI.call(e,r,r+=t));return n}var wH=o((()=>{hI()}));function TH(e,t){return e._chain?zL(t).chain():t}var EH=o((()=>{BL()}));function DH(e){return WB(_R(e),function(t){var n=zL[t]=e[t];zL.prototype[t]=function(){var e=[this._wrapped];return eI.apply(e,arguments),TH(this,n.apply(zL,e))}}),zL}var OH=o((()=>{BL(),GB(),vR(),hI(),EH()})),kH,AH=o((()=>{BL(),GB(),hI(),EH(),WB([`pop`,`push`,`reverse`,`shift`,`sort`,`splice`,`unshift`],function(e){var t=ZF[e];zL.prototype[e]=function(){var n=this._wrapped;return n!=null&&(t.apply(n,arguments),(e===`shift`||e===`splice`)&&n.length===0&&delete n[0]),TH(this,n)}}),WB([`concat`,`join`,`slice`],function(e){var t=ZF[e];zL.prototype[e]=function(){var e=this._wrapped;return e!=null&&(e=t.apply(e,arguments)),TH(this,e)}}),kH=zL})),jH=c({VERSION:()=>YF,after:()=>vB,all:()=>iV,allKeys:()=>KL,any:()=>oV,assign:()=>CR,before:()=>bB,bind:()=>Jz,bindAll:()=>eB,chain:()=>Hz,chunk:()=>CH,clone:()=>MR,collect:()=>KB,compact:()=>tH,compose:()=>gB,constant:()=>mL,contains:()=>cV,countBy:()=>FV,create:()=>AR,debounce:()=>uB,default:()=>kH,defaults:()=>TR,defer:()=>oB,delay:()=>iB,detect:()=>BB,difference:()=>aH,drop:()=>ZV,each:()=>WB,escape:()=>Sz,every:()=>iV,extend:()=>xR,extendOwn:()=>CR,filter:()=>eV,find:()=>BB,findIndex:()=>OB,findKey:()=>wB,findLastIndex:()=>AB,findWhere:()=>HB,first:()=>YV,flatten:()=>rH,foldl:()=>XB,foldr:()=>QB,forEach:()=>WB,functions:()=>_R,get:()=>HR,groupBy:()=>jV,has:()=>WR,head:()=>YV,identity:()=>KR,include:()=>cV,includes:()=>cV,indexBy:()=>NV,indexOf:()=>IB,initial:()=>qV,inject:()=>XB,intersection:()=>pH,invert:()=>hR,invoke:()=>uV,isArguments:()=>cL,isArray:()=>rL,isArrayBuffer:()=>HI,isBoolean:()=>wI,isDataView:()=>tL,isDate:()=>PI,isElement:()=>EI,isEmpty:()=>FL,isEqual:()=>UL,isError:()=>RI,isFinite:()=>uL,isFunction:()=>KI,isMap:()=>rR,isMatch:()=>LL,isNaN:()=>fL,isNull:()=>bI,isNumber:()=>MI,isObject:()=>vI,isRegExp:()=>II,isSet:()=>sR,isString:()=>AI,isSymbol:()=>BI,isTypedArray:()=>EL,isUndefined:()=>SI,isWeakMap:()=>aR,isWeakSet:()=>lR,iteratee:()=>nz,keys:()=>NL,last:()=>$V,lastIndexOf:()=>RB,map:()=>KB,mapObject:()=>oz,matcher:()=>JR,matches:()=>JR,max:()=>gV,memoize:()=>nB,methods:()=>_R,min:()=>vV,mixin:()=>DH,negate:()=>mB,noop:()=>cz,now:()=>gz,object:()=>yH,omit:()=>GV,once:()=>SB,pairs:()=>pR,partial:()=>Kz,partition:()=>LV,pick:()=>UV,pluck:()=>fV,property:()=>XR,propertyOf:()=>uz,random:()=>mz,range:()=>xH,reduce:()=>XB,reduceRight:()=>QB,reject:()=>nV,rest:()=>ZV,restArguments:()=>gI,result:()=>Lz,sample:()=>CV,select:()=>eV,shuffle:()=>TV,size:()=>zV,some:()=>oV,sortBy:()=>DV,sortedIndex:()=>MB,tail:()=>ZV,take:()=>YV,tap:()=>PR,template:()=>jz,templateSettings:()=>Oz,throttle:()=>cB,times:()=>fz,toArray:()=>bV,toPath:()=>IR,transpose:()=>hH,unescape:()=>Ez,union:()=>dH,uniq:()=>lH,unique:()=>lH,uniqueId:()=>zz,unzip:()=>hH,values:()=>dR,where:()=>mV,without:()=>sH,wrap:()=>fB,zip:()=>_H}),MH=o((()=>{hI(),_I(),yI(),xI(),CI(),TI(),DI(),jI(),NI(),FI(),LI(),zI(),VI(),UI(),nL(),iL(),qI(),lL(),dL(),pL(),DL(),IL(),RL(),GL(),iR(),oR(),cR(),uR(),PL(),qL(),fR(),mR(),gR(),vR(),SR(),wR(),ER(),jR(),NR(),FR(),UR(),GR(),sz(),qR(),hL(),lz(),LR(),ZR(),dz(),YR(),pz(),hz(),_z(),Cz(),Dz(),kz(),Iz(),Rz(),Vz(),Uz(),rz(),qz(),Yz(),tB(),rB(),aB(),sB(),lB(),dB(),pB(),hB(),_B(),yB(),xB(),CB(),TB(),kB(),jB(),NB(),LB(),zB(),VB(),UB(),GB(),qB(),ZB(),$B(),tV(),rV(),aV(),sV(),lV(),dV(),pV(),hV(),_V(),yV(),EV(),wV(),OV(),MV(),PV(),IV(),RV(),SV(),BV(),WV(),KV(),XV(),JV(),eH(),QV(),nH(),iH(),cH(),uH(),fH(),mH(),oH(),gH(),vH(),bH(),SH(),wH(),OH(),AH()})),NH,PH=o((()=>{MH(),NH=DH(jH),NH._=NH})),FH=c({VERSION:()=>YF,after:()=>vB,all:()=>iV,allKeys:()=>KL,any:()=>oV,assign:()=>CR,before:()=>bB,bind:()=>Jz,bindAll:()=>eB,chain:()=>Hz,chunk:()=>CH,clone:()=>MR,collect:()=>KB,compact:()=>tH,compose:()=>gB,constant:()=>mL,contains:()=>cV,countBy:()=>FV,create:()=>AR,debounce:()=>uB,default:()=>NH,defaults:()=>TR,defer:()=>oB,delay:()=>iB,detect:()=>BB,difference:()=>aH,drop:()=>ZV,each:()=>WB,escape:()=>Sz,every:()=>iV,extend:()=>xR,extendOwn:()=>CR,filter:()=>eV,find:()=>BB,findIndex:()=>OB,findKey:()=>wB,findLastIndex:()=>AB,findWhere:()=>HB,first:()=>YV,flatten:()=>rH,foldl:()=>XB,foldr:()=>QB,forEach:()=>WB,functions:()=>_R,get:()=>HR,groupBy:()=>jV,has:()=>WR,head:()=>YV,identity:()=>KR,include:()=>cV,includes:()=>cV,indexBy:()=>NV,indexOf:()=>IB,initial:()=>qV,inject:()=>XB,intersection:()=>pH,invert:()=>hR,invoke:()=>uV,isArguments:()=>cL,isArray:()=>rL,isArrayBuffer:()=>HI,isBoolean:()=>wI,isDataView:()=>tL,isDate:()=>PI,isElement:()=>EI,isEmpty:()=>FL,isEqual:()=>UL,isError:()=>RI,isFinite:()=>uL,isFunction:()=>KI,isMap:()=>rR,isMatch:()=>LL,isNaN:()=>fL,isNull:()=>bI,isNumber:()=>MI,isObject:()=>vI,isRegExp:()=>II,isSet:()=>sR,isString:()=>AI,isSymbol:()=>BI,isTypedArray:()=>EL,isUndefined:()=>SI,isWeakMap:()=>aR,isWeakSet:()=>lR,iteratee:()=>nz,keys:()=>NL,last:()=>$V,lastIndexOf:()=>RB,map:()=>KB,mapObject:()=>oz,matcher:()=>JR,matches:()=>JR,max:()=>gV,memoize:()=>nB,methods:()=>_R,min:()=>vV,mixin:()=>DH,negate:()=>mB,noop:()=>cz,now:()=>gz,object:()=>yH,omit:()=>GV,once:()=>SB,pairs:()=>pR,partial:()=>Kz,partition:()=>LV,pick:()=>UV,pluck:()=>fV,property:()=>XR,propertyOf:()=>uz,random:()=>mz,range:()=>xH,reduce:()=>XB,reduceRight:()=>QB,reject:()=>nV,rest:()=>ZV,restArguments:()=>gI,result:()=>Lz,sample:()=>CV,select:()=>eV,shuffle:()=>TV,size:()=>zV,some:()=>oV,sortBy:()=>DV,sortedIndex:()=>MB,tail:()=>ZV,take:()=>YV,tap:()=>PR,template:()=>jz,templateSettings:()=>Oz,throttle:()=>cB,times:()=>fz,toArray:()=>bV,toPath:()=>IR,transpose:()=>hH,unescape:()=>Ez,union:()=>dH,uniq:()=>lH,unique:()=>lH,uniqueId:()=>zz,unzip:()=>hH,values:()=>dR,where:()=>mV,without:()=>sH,wrap:()=>fB,zip:()=>_H}),IH=o((()=>{PH(),MH()})),LH=s(((e,t)=>{var n=(function(){"use strict";return this===void 0})();if(n)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:n,propertyIsWritable:function(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!!(!n||n.writable||n.set)}};else{var r={}.hasOwnProperty,i={}.toString,a={}.constructor.prototype,o=function(e){var t=[];for(var n in e)r.call(e,n)&&t.push(n);return t};t.exports={isArray:function(e){try{return i.call(e)===`[object Array]`}catch{return!1}},keys:o,names:o,defineProperty:function(e,t,n){return e[t]=n.value,e},getDescriptor:function(e,t){return{value:e[t]}},freeze:function(e){return e},getPrototypeOf:function(e){try{return Object(e).constructor.prototype}catch{return a}},isES5:n,propertyIsWritable:function(){return!0}}}})),RH=s(((e,t)=>{var n=LH(),r=typeof navigator>`u`,i={e:{}},a,o=typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:e===void 0?null:e;function s(){try{var e=a;return a=null,e.apply(this,arguments)}catch(e){return i.e=e,i}}function c(e){return a=e,s}var l=function(e,t){var n={}.hasOwnProperty;function r(){for(var r in this.constructor=e,this.constructor$=t,t.prototype)n.call(t.prototype,r)&&r.charAt(r.length-1)!==`$`&&(this[r+`$`]=t.prototype[r])}return r.prototype=t.prototype,e.prototype=new r,e.prototype};function u(e){return e==null||e===!0||e===!1||typeof e==`string`||typeof e==`number`}function d(e){return typeof e==`function`||typeof e==`object`&&!!e}function f(e){return u(e)?Error(w(e)):e}function p(e,t){var n=e.length,r=Array(n+1),i;for(i=0;i<n;++i)r[i]=e[i];return r[i]=t,r}function m(e,t,r){if(n.isES5){var i=Object.getOwnPropertyDescriptor(e,t);if(i!=null)return i.get==null&&i.set==null?i.value:r}else return{}.hasOwnProperty.call(e,t)?e[t]:void 0}function h(e,t,r){if(u(e))return e;var i={value:r,configurable:!0,enumerable:!1,writable:!0};return n.defineProperty(e,t,i),e}function g(e){throw e}var _=(function(){var e=[Array.prototype,Object.prototype,Function.prototype],t=function(t){for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1};if(n.isES5){var r=Object.getOwnPropertyNames;return function(e){for(var i=[],a=Object.create(null);e!=null&&!t(e);){var o;try{o=r(e)}catch{return i}for(var s=0;s<o.length;++s){var c=o[s];if(!a[c]){a[c]=!0;var l=Object.getOwnPropertyDescriptor(e,c);l!=null&&l.get==null&&l.set==null&&i.push(c)}}e=n.getPrototypeOf(e)}return i}}else{var i={}.hasOwnProperty;return function(n){if(t(n))return[];var r=[];enumeration:for(var a in n)if(i.call(n,a))r.push(a);else{for(var o=0;o<e.length;++o)if(i.call(e[o],a))continue enumeration;r.push(a)}return r}}})(),v=/this\s*\.\s*\S+\s*=/;function y(e){try{if(typeof e==`function`){var t=n.names(e.prototype),r=n.isES5&&t.length>1,i=t.length>0&&!(t.length===1&&t[0]===`constructor`),a=v.test(e+``)&&n.names(e).length>0;if(r||i||a)return!0}return!1}catch{return!1}}function b(e){function t(){}t.prototype=e;for(var n=8;n--;)new t;return e}var x=/^[a-z$_][a-z$_0-9]*$/i;function S(e){return x.test(e)}function C(e,t,n){for(var r=Array(e),i=0;i<e;++i)r[i]=t+i+n;return r}function w(e){try{return e+``}catch{return`[no string representation]`}}function T(e){return typeof e==`object`&&!!e&&typeof e.message==`string`&&typeof e.name==`string`}function E(e){try{h(e,`isOperational`,!0)}catch{}}function D(e){return e==null?!1:e instanceof Error.__BluebirdErrorTypes__.OperationalError||e.isOperational===!0}function O(e){return T(e)&&n.propertyIsWritable(e,`stack`)}var k=(function(){return`stack`in Error()?function(e){return O(e)?e:Error(w(e))}:function(e){if(O(e))return e;try{throw Error(w(e))}catch(e){return e}}})();function A(e){return{}.toString.call(e)}function j(e,t,r){for(var i=n.names(e),a=0;a<i.length;++a){var o=i[a];if(r(o))try{n.defineProperty(t,o,n.getDescriptor(e,o))}catch{}}}var M=function(e){return n.isArray(e)?e:null};if(typeof Symbol<`u`&&Symbol.iterator){var N=typeof Array.from==`function`?function(e){return Array.from(e)}:function(e){for(var t=[],n=e[Symbol.iterator](),r;!(r=n.next()).done;)t.push(r.value);return t};M=function(e){return n.isArray(e)?e:e!=null&&typeof e[Symbol.iterator]==`function`?N(e):null}}var P=typeof process<`u`&&A(process).toLowerCase()===`[object process]`,F=typeof process<`u`&&process.env!==void 0;function I(e){return F?process.env[e]:void 0}function L(){if(typeof Promise==`function`)try{var e=new Promise(function(){});if({}.toString.call(e)===`[object Promise]`)return Promise}catch{}}function R(e,t){return e.bind(t)}var z={isClass:y,isIdentifier:S,inheritedDataKeys:_,getDataPropertyOrDefault:m,thrower:g,isArray:n.isArray,asArray:M,notEnumerableProp:h,isPrimitive:u,isObject:d,isError:T,canEvaluate:r,errorObj:i,tryCatch:c,inherits:l,withAppended:p,maybeWrapAsError:f,toFastProperties:b,filledRange:C,toString:w,canAttachTrace:O,ensureErrorObject:k,originatesFromRejection:D,markAsOriginatingFromRejection:E,classString:A,copyDescriptors:j,hasDevTools:typeof chrome<`u`&&chrome&&typeof chrome.loadTimes==`function`,isNode:P,hasEnvVariables:F,env:I,global:o,getNativePromise:L,domainBind:R};z.isRecentNode=z.isNode&&(function(){var e=process.versions.node.split(`.`).map(Number);return e[0]===0&&e[1]>10||e[0]>0})(),z.isNode&&z.toFastProperties(process);try{throw Error()}catch(e){z.lastLineError=e}t.exports=z})),zH=s(((e,t)=>{var n=RH(),r,i=function(){throw Error(`No async scheduler available
|
|
276
|
+
|
|
277
|
+
See http://goo.gl/MqrFmX
|
|
278
|
+
`)},a=n.getNativePromise();if(n.isNode&&typeof MutationObserver>`u`){var o=global.setImmediate,s=process.nextTick;r=n.isRecentNode?function(e){o.call(global,e)}:function(e){s.call(process,e)}}else if(typeof a==`function`&&typeof a.resolve==`function`){var c=a.resolve();r=function(e){c.then(e)}}else r=typeof MutationObserver<`u`&&!(typeof window<`u`&&window.navigator&&(window.navigator.standalone||window.cordova))?(function(){var e=document.createElement(`div`),t={attributes:!0},n=!1,r=document.createElement(`div`);new MutationObserver(function(){e.classList.toggle(`foo`),n=!1}).observe(r,t);var i=function(){n||(n=!0,r.classList.toggle(`foo`))};return function(n){var r=new MutationObserver(function(){r.disconnect(),n()});r.observe(e,t),i()}})():typeof setImmediate<`u`?function(e){setImmediate(e)}:typeof setTimeout<`u`?function(e){setTimeout(e,0)}:i;t.exports=r})),BH=s(((e,t)=>{function n(e,t,n,r,i){for(var a=0;a<i;++a)n[a+r]=e[a+t],e[a+t]=void 0}function r(e){this._capacity=e,this._length=0,this._front=0}r.prototype._willBeOverCapacity=function(e){return this._capacity<e},r.prototype._pushOne=function(e){var t=this.length();this._checkCapacity(t+1);var n=this._front+t&this._capacity-1;this[n]=e,this._length=t+1},r.prototype.push=function(e,t,n){var r=this.length()+3;if(this._willBeOverCapacity(r)){this._pushOne(e),this._pushOne(t),this._pushOne(n);return}var i=this._front+r-3;this._checkCapacity(r);var a=this._capacity-1;this[i+0&a]=e,this[i+1&a]=t,this[i+2&a]=n,this._length=r},r.prototype.shift=function(){var e=this._front,t=this[e];return this[e]=void 0,this._front=e+1&this._capacity-1,this._length--,t},r.prototype.length=function(){return this._length},r.prototype._checkCapacity=function(e){this._capacity<e&&this._resizeTo(this._capacity<<1)},r.prototype._resizeTo=function(e){var t=this._capacity;this._capacity=e;var r=this._front+this._length&t-1;n(this,0,this,t,r)},t.exports=r})),VH=s(((e,t)=>{var n;try{throw Error()}catch(e){n=e}var r=zH(),i=BH(),a=RH();function o(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new i(16),this._normalQueue=new i(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var e=this;this.drainQueues=function(){e._drainQueues()},this._schedule=r}o.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},o.prototype.hasCustomScheduler=function(){return this._customScheduler},o.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},o.prototype.disableTrampolineIfNecessary=function(){a.hasDevTools&&(this._trampolineEnabled=!1)},o.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},o.prototype.fatalError=function(e,t){t?(process.stderr.write(`Fatal `+(e instanceof Error?e.stack:e)+`
|
|
279
|
+
`),process.exit(2)):this.throwLater(e)},o.prototype.throwLater=function(e,t){if(arguments.length===1&&(t=e,e=function(){throw t}),typeof setTimeout<`u`)setTimeout(function(){e(t)},0);else try{this._schedule(function(){e(t)})}catch{throw Error(`No async scheduler available
|
|
280
|
+
|
|
281
|
+
See http://goo.gl/MqrFmX
|
|
282
|
+
`)}};function s(e,t,n){this._lateQueue.push(e,t,n),this._queueTick()}function c(e,t,n){this._normalQueue.push(e,t,n),this._queueTick()}function l(e){this._normalQueue._pushOne(e),this._queueTick()}a.hasDevTools?(o.prototype.invokeLater=function(e,t,n){this._trampolineEnabled?s.call(this,e,t,n):this._schedule(function(){setTimeout(function(){e.call(t,n)},100)})},o.prototype.invoke=function(e,t,n){this._trampolineEnabled?c.call(this,e,t,n):this._schedule(function(){e.call(t,n)})},o.prototype.settlePromises=function(e){this._trampolineEnabled?l.call(this,e):this._schedule(function(){e._settlePromises()})}):(o.prototype.invokeLater=s,o.prototype.invoke=c,o.prototype.settlePromises=l),o.prototype._drainQueue=function(e){for(;e.length()>0;){var t=e.shift();if(typeof t!=`function`){t._settlePromises();continue}var n=e.shift(),r=e.shift();t.call(n,r)}},o.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},o.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},o.prototype._reset=function(){this._isTickUsed=!1},t.exports=o,t.exports.firstLineError=n})),HH=s(((e,t)=>{var n=LH(),r=n.freeze,i=RH(),a=i.inherits,o=i.notEnumerableProp;function s(e,t){function n(r){if(!(this instanceof n))return new n(r);o(this,`message`,typeof r==`string`?r:t),o(this,`name`,e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return a(n,Error),n}var c,l,u=s(`Warning`,`warning`),d=s(`CancellationError`,`cancellation error`),f=s(`TimeoutError`,`timeout error`),p=s(`AggregateError`,`aggregate error`);try{c=TypeError,l=RangeError}catch{c=s(`TypeError`,`type error`),l=s(`RangeError`,`range error`)}for(var m=`join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse`.split(` `),h=0;h<m.length;++h)typeof Array.prototype[m[h]]==`function`&&(p.prototype[m[h]]=Array.prototype[m[h]]);n.defineProperty(p.prototype,`length`,{value:0,configurable:!1,writable:!0,enumerable:!0}),p.prototype.isOperational=!0;var g=0;p.prototype.toString=function(){var e=Array(g*4+1).join(` `),t=`
|
|
283
|
+
`+e+`AggregateError of:
|
|
284
|
+
`;g++,e=Array(g*4+1).join(` `);for(var n=0;n<this.length;++n){for(var r=this[n]===this?`[Circular AggregateError]`:this[n]+``,i=r.split(`
|
|
285
|
+
`),a=0;a<i.length;++a)i[a]=e+i[a];r=i.join(`
|
|
286
|
+
`),t+=r+`
|
|
287
|
+
`}return g--,t};function _(e){if(!(this instanceof _))return new _(e);o(this,`name`,`OperationalError`),o(this,`message`,e),this.cause=e,this.isOperational=!0,e instanceof Error?(o(this,`message`,e.message),o(this,`stack`,e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}a(_,Error);var v=Error.__BluebirdErrorTypes__;v||(v=r({CancellationError:d,TimeoutError:f,OperationalError:_,RejectionError:_,AggregateError:p}),n.defineProperty(Error,`__BluebirdErrorTypes__`,{value:v,writable:!1,enumerable:!1,configurable:!1})),t.exports={Error,TypeError:c,RangeError:l,CancellationError:v.CancellationError,OperationalError:v.OperationalError,TimeoutError:v.TimeoutError,AggregateError:v.AggregateError,Warning:u}})),UH=s(((e,t)=>{t.exports=function(e,t){var n=RH(),r=n.errorObj,i=n.isObject;function a(n,a){if(i(n)){if(n instanceof e)return n;var o=s(n);if(o===r){a&&a._pushContext();var c=e.reject(o.e);return a&&a._popContext(),c}else if(typeof o==`function`){if(l(n)){var c=new e(t);return n._then(c._fulfill,c._reject,void 0,c,null),c}return u(n,o,a)}}return n}function o(e){return e.then}function s(e){try{return o(e)}catch(e){return r.e=e,r}}var c={}.hasOwnProperty;function l(e){try{return c.call(e,`_promise0`)}catch{return!1}}function u(i,a,o){var s=new e(t),c=s;o&&o._pushContext(),s._captureStackTrace(),o&&o._popContext();var l=!0,u=n.tryCatch(a).call(i,d,f);l=!1,s&&u===r&&(s._rejectCallback(u.e,!0,!0),s=null);function d(e){s&&=(s._resolveCallback(e),null)}function f(e){s&&=(s._rejectCallback(e,l,!0),null)}return c}return a}})),WH=s(((e,t)=>{t.exports=function(e,t,n,r,i){var a=RH();a.isArray;function o(e){switch(e){case-2:return[];case-3:return{}}}function s(n){var r=this._promise=new e(t);n instanceof e&&r._propagateFrom(n,3),r._setOnCancel(this),this._values=n,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.inherits(s,i),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function t(i,s){var c=n(this._values,this._promise);if(c instanceof e){c=c._target();var l=c._bitField;if(this._values=c,!(l&50397184))return this._promise._setAsyncGuaranteed(),c._then(t,this._reject,void 0,this,s);if(l&33554432)c=c._value();else if(l&16777216)return this._reject(c._reason());else return this._cancel()}if(c=a.asArray(c),c===null){var u=r(`expecting an array or an iterable object but got `+a.classString(c)).reason();this._promise._rejectCallback(u,!1);return}if(c.length===0){s===-5?this._resolveEmptyArray():this._resolve(o(s));return}this._iterate(c)},s.prototype._iterate=function(t){var r=this.getActualLength(t.length);this._length=r,this._values=this.shouldCopyValues()?Array(r):this._values;for(var i=this._promise,a=!1,o=null,s=0;s<r;++s){var c=n(t[s],i);c instanceof e?(c=c._target(),o=c._bitField):o=null,a?o!==null&&c.suppressUnhandledRejections():o===null?a=this._promiseFulfilled(c,s):o&50397184?a=o&33554432?this._promiseFulfilled(c._value(),s):o&16777216?this._promiseRejected(c._reason(),s):this._promiseCancelled(s):(c._proxy(this,s),this._values[s]=c)}a||i._setAsyncGuaranteed()},s.prototype._isResolved=function(){return this._values===null},s.prototype._resolve=function(e){this._values=null,this._promise._fulfill(e)},s.prototype._cancel=function(){this._isResolved()||!this._promise._isCancellable()||(this._values=null,this._promise._cancel())},s.prototype._reject=function(e){this._values=null,this._promise._rejectCallback(e,!1)},s.prototype._promiseFulfilled=function(e,t){return this._values[t]=e,++this._totalResolved>=this._length?(this._resolve(this._values),!0):!1},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;n<t.length;++n)t[n]instanceof e&&t[n].cancel()}},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(e){return e},s}})),GH=s(((e,t)=>{t.exports=function(e){var t=!1,n=[];e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){};function r(){this._trace=new r.CapturedTrace(a())}r.prototype._pushContext=function(){this._trace!==void 0&&(this._trace._promiseCreated=null,n.push(this._trace))},r.prototype._popContext=function(){if(this._trace!==void 0){var e=n.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null};function i(){if(t)return new r}function a(){var e=n.length-1;if(e>=0)return n[e]}return r.CapturedTrace=null,r.create=i,r.deactivateLongStackTraces=function(){},r.activateLongStackTraces=function(){var n=e.prototype._pushContext,i=e.prototype._popContext,o=e._peekContext,s=e.prototype._peekContext,c=e.prototype._promiseCreated;r.deactivateLongStackTraces=function(){e.prototype._pushContext=n,e.prototype._popContext=i,e._peekContext=o,e.prototype._peekContext=s,e.prototype._promiseCreated=c,t=!1},t=!0,e.prototype._pushContext=r.prototype._pushContext,e.prototype._popContext=r.prototype._popContext,e._peekContext=e.prototype._peekContext=a,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&e._promiseCreated==null&&(e._promiseCreated=this)}},r}})),KH=s(((e,t)=>{t.exports=function(e,t){var n=e._getDomain,r=e._async,i=HH().Warning,a=RH(),o=a.canAttachTrace,s,c,l=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,u=/\((?:timers\.js):\d+:\d+\)/,d=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,f=null,p=null,m=!1,h,g=!!(a.env(`BLUEBIRD_DEBUG`)!=0&&(a.env(`BLUEBIRD_DEBUG`)||a.env(`NODE_ENV`)===`development`)),_=!!(a.env(`BLUEBIRD_WARNINGS`)!=0&&(g||a.env(`BLUEBIRD_WARNINGS`))),v=!!(a.env(`BLUEBIRD_LONG_STACK_TRACES`)!=0&&(g||a.env(`BLUEBIRD_LONG_STACK_TRACES`))),y=a.env(`BLUEBIRD_W_FORGOTTEN_RETURN`)!=0&&(_||!!a.env(`BLUEBIRD_W_FORGOTTEN_RETURN`));e.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=e._bitField&-1048577|524288},e.prototype._ensurePossibleRejectionHandled=function(){this._bitField&524288||(this._setRejectionIsUnhandled(),r.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){ae(`rejectionHandled`,s,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField|=268435456},e.prototype._returnedNonUndefined=function(){return(this._bitField&268435456)!=0},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),ae(`unhandledRejection`,c,e,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField|=262144},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField&=-262145},e.prototype._isUnhandledRejectionNotified=function(){return(this._bitField&262144)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField|=1048576},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField&=-1048577,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(this._bitField&1048576)>0},e.prototype._warn=function(e,t,n){return B(e,t,n||this)},e.onPossiblyUnhandledRejection=function(e){var t=n();c=typeof e==`function`?t===null?e:a.domainBind(t,e):void 0},e.onUnhandledRejectionHandled=function(e){var t=n();s=typeof e==`function`?t===null?e:a.domainBind(t,e):void 0};var b=function(){};e.longStackTraces=function(){if(r.haveItemsQueued()&&!he.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
|
|
288
|
+
|
|
289
|
+
See http://goo.gl/MqrFmX
|
|
290
|
+
`);if(!he.longStackTraces&&ce()){var n=e.prototype._captureStackTrace,i=e.prototype._attachExtraTrace;he.longStackTraces=!0,b=function(){if(r.haveItemsQueued()&&!he.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
|
|
291
|
+
|
|
292
|
+
See http://goo.gl/MqrFmX
|
|
293
|
+
`);e.prototype._captureStackTrace=n,e.prototype._attachExtraTrace=i,t.deactivateLongStackTraces(),r.enableTrampoline(),he.longStackTraces=!1},e.prototype._captureStackTrace=I,e.prototype._attachExtraTrace=L,t.activateLongStackTraces(),r.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return he.longStackTraces&&ce()};var x=(function(){try{if(typeof CustomEvent==`function`){var e=new CustomEvent(`CustomEvent`);return a.global.dispatchEvent(e),function(e,t){var n=new CustomEvent(e.toLowerCase(),{detail:t,cancelable:!0});return!a.global.dispatchEvent(n)}}else if(typeof Event==`function`){var e=new Event(`CustomEvent`);return a.global.dispatchEvent(e),function(e,t){var n=new Event(e.toLowerCase(),{cancelable:!0});return n.detail=t,!a.global.dispatchEvent(n)}}else{var e=document.createEvent(`CustomEvent`);return e.initCustomEvent(`testingtheevent`,!1,!0,{}),a.global.dispatchEvent(e),function(e,t){var n=document.createEvent(`CustomEvent`);return n.initCustomEvent(e.toLowerCase(),!1,!0,t),!a.global.dispatchEvent(n)}}}catch{}return function(){return!1}})(),S=(function(){return a.isNode?function(){return process.emit.apply(process,arguments)}:a.global?function(e){var t=`on`+e.toLowerCase(),n=a.global[t];return n?(n.apply(a.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}})();function C(e,t){return{promise:t}}var w={promiseCreated:C,promiseFulfilled:C,promiseRejected:C,promiseResolved:C,promiseCancelled:C,promiseChained:function(e,t,n){return{promise:t,child:n}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,n){return{reason:t,promise:n}},rejectionHandled:C},T=function(e){var t=!1;try{t=S.apply(null,arguments)}catch(e){r.throwLater(e),t=!0}var n=!1;try{n=x(e,w[e].apply(null,arguments))}catch(e){r.throwLater(e),n=!0}return n||t};e.config=function(t){if(t=Object(t),`longStackTraces`in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&b()),`warnings`in t){var n=t.warnings;he.warnings=!!n,y=he.warnings,a.isObject(n)&&`wForgottenReturn`in n&&(y=!!n.wForgottenReturn)}if(`cancellation`in t&&t.cancellation&&!he.cancellation){if(r.haveItemsQueued())throw Error(`cannot enable cancellation after promises are in use`);e.prototype._clearCancellationData=j,e.prototype._propagateFrom=M,e.prototype._onCancel=k,e.prototype._setOnCancel=A,e.prototype._attachCancellationCallback=O,e.prototype._execute=D,P=M,he.cancellation=!0}return`monitoring`in t&&(t.monitoring&&!he.monitoring?(he.monitoring=!0,e.prototype._fireEvent=T):!t.monitoring&&he.monitoring&&(he.monitoring=!1,e.prototype._fireEvent=E)),e};function E(){return!1}e.prototype._fireEvent=E,e.prototype._execute=function(e,t,n){try{e(t,n)}catch(e){return e}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(e){},e.prototype._attachCancellationCallback=function(e){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(e,t){};function D(e,t,n){var r=this;try{e(t,n,function(e){if(typeof e!=`function`)throw TypeError(`onCancel must be a function, got: `+a.toString(e));r._attachCancellationCallback(e)})}catch(e){return e}}function O(e){if(!this._isCancellable())return this;var t=this._onCancel();t===void 0?this._setOnCancel(e):a.isArray(t)?t.push(e):this._setOnCancel([t,e])}function k(){return this._onCancelField}function A(e){this._onCancelField=e}function j(){this._cancellationParent=void 0,this._onCancelField=void 0}function M(e,t){if(t&1){this._cancellationParent=e;var n=e._branchesRemainingToCancel;n===void 0&&(n=0),e._branchesRemainingToCancel=n+1}t&2&&e._isBound()&&this._setBoundTo(e._boundTo)}function N(e,t){t&2&&e._isBound()&&this._setBoundTo(e._boundTo)}var P=N;function F(){var t=this._boundTo;return t!==void 0&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function I(){this._trace=new pe(this._peekContext())}function L(e,t){if(o(e)){var n=this._trace;if(n!==void 0&&t&&(n=n._parent),n!==void 0)n.attachExtraTrace(e);else if(!e.__stackCleaned__){var r=V(e);a.notEnumerableProp(e,`stack`,r.message+`
|
|
294
|
+
`+r.stack.join(`
|
|
295
|
+
`)),a.notEnumerableProp(e,`__stackCleaned__`,!0)}}}function R(e,t,n,r,i){if(e===void 0&&t!==null&&y){if(i!==void 0&&i._returnedNonUndefined()||!(r._bitField&65535))return;n&&(n+=` `);var a=``,o=``;if(t._trace){for(var s=t._trace.stack.split(`
|
|
296
|
+
`),c=re(s),l=c.length-1;l>=0;--l){var f=c[l];if(!u.test(f)){var p=f.match(d);p&&(a=`at `+p[1]+`:`+p[2]+`:`+p[3]+` `);break}}if(c.length>0){for(var m=c[0],l=0;l<s.length;++l)if(s[l]===m){l>0&&(o=`
|
|
297
|
+
`+s[l-1]);break}}}var h=`a promise was created in a `+n+`handler `+a+`but was not returned from it, see http://goo.gl/rRqMUw`+o;r._warn(h,!0,t)}}function z(e,t){var n=e+` is deprecated and will be removed in a future version.`;return t&&(n+=` Use `+t+` instead.`),B(n)}function B(t,n,r){if(he.warnings){var a=new i(t),o;if(n)r._attachExtraTrace(a);else if(he.longStackTraces&&(o=e._peekContext()))o.attachExtraTrace(a);else{var s=V(a);a.stack=s.message+`
|
|
298
|
+
`+s.stack.join(`
|
|
299
|
+
`)}T(`warning`,a)||H(a,``,!0)}}function ee(e,t){for(var n=0;n<t.length-1;++n)t[n].push(`From previous event:`),t[n]=t[n].join(`
|
|
300
|
+
`);return n<t.length&&(t[n]=t[n].join(`
|
|
301
|
+
`)),e+`
|
|
302
|
+
`+t.join(`
|
|
303
|
+
`)}function te(e){for(var t=0;t<e.length;++t)(e[t].length===0||t+1<e.length&&e[t][0]===e[t+1][0])&&(e.splice(t,1),t--)}function ne(e){for(var t=e[0],n=1;n<e.length;++n){for(var r=e[n],i=t.length-1,a=t[i],o=-1,s=r.length-1;s>=0;--s)if(r[s]===a){o=s;break}for(var s=o;s>=0;--s){var c=r[s];if(t[i]===c)t.pop(),i--;else break}t=r}}function re(e){for(var t=[],n=0;n<e.length;++n){var r=e[n],i=r===` (No stack trace)`||f.test(r),a=i&&le(r);i&&!a&&(m&&r.charAt(0)!==` `&&(r=` `+r),t.push(r))}return t}function ie(e){for(var t=e.stack.replace(/\s+$/g,``).split(`
|
|
304
|
+
`),n=0;n<t.length;++n){var r=t[n];if(r===` (No stack trace)`||f.test(r))break}return n>0&&e.name!=`SyntaxError`&&(t=t.slice(n)),t}function V(e){var t=e.stack,n=e.toString();return t=typeof t==`string`&&t.length>0?ie(e):[` (No stack trace)`],{message:n,stack:e.name==`SyntaxError`?t:re(t)}}function H(e,t,n){if(typeof console<`u`){var r;if(a.isObject(e)){var i=e.stack;r=t+p(i,e)}else r=t+String(e);typeof h==`function`?h(r,n):(typeof console.log==`function`||typeof console.log==`object`)&&console.log(r)}}function ae(e,t,n,i){var a=!1;try{typeof t==`function`&&(a=!0,e===`rejectionHandled`?t(i):t(n,i))}catch(e){r.throwLater(e)}e===`unhandledRejection`?!T(e,n,i)&&!a&&H(n,`Unhandled rejection `):T(e,i)}function oe(e){var t;if(typeof e==`function`)t=`[function `+(e.name||`anonymous`)+`]`;else{if(t=e&&typeof e.toString==`function`?e.toString():a.toString(e),/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch{}t.length===0&&(t=`(empty array)`)}return`(<`+se(t)+`>, no stack trace)`}function se(e){var t=41;return e.length<t?e:e.substr(0,t-3)+`...`}function ce(){return typeof me==`function`}var le=function(){return!1},ue=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function de(e){var t=e.match(ue);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function fe(e,t){if(ce()){for(var n=e.stack.split(`
|
|
305
|
+
`),r=t.stack.split(`
|
|
306
|
+
`),i=-1,a=-1,o,s,c=0;c<n.length;++c){var u=de(n[c]);if(u){o=u.fileName,i=u.line;break}}for(var c=0;c<r.length;++c){var u=de(r[c]);if(u){s=u.fileName,a=u.line;break}}i<0||a<0||!o||!s||o!==s||i>=a||(le=function(e){if(l.test(e))return!0;var t=de(e);return!!(t&&t.fileName===o&&i<=t.line&&t.line<=a)})}}function pe(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(e===void 0?0:e._length);me(this,pe),t>32&&this.uncycle()}a.inherits(pe,Error),t.CapturedTrace=pe,pe.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],n={},r=0,i=this;i!==void 0;++r)t.push(i),i=i._parent;e=this._length=r;for(var r=e-1;r>=0;--r){var a=t[r].stack;n[a]===void 0&&(n[a]=r)}for(var r=0;r<e;++r){var o=n[t[r].stack];if(o!==void 0&&o!==r){o>0&&(t[o-1]._parent=void 0,t[o-1]._length=1),t[r]._parent=void 0,t[r]._length=1;var s=r>0?t[r-1]:this;o<e-1?(s._parent=t[o+1],s._parent.uncycle(),s._length=s._parent._length+1):(s._parent=void 0,s._length=1);for(var c=s._length+1,l=r-2;l>=0;--l)t[l]._length=c,c++;return}}}},pe.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=V(e),n=t.message,r=[t.stack],i=this;i!==void 0;)r.push(re(i.stack.split(`
|
|
307
|
+
`))),i=i._parent;ne(r),te(r),a.notEnumerableProp(e,`stack`,ee(n,r)),a.notEnumerableProp(e,`__stackCleaned__`,!0)}};var me=(function(){var e=/^\s*at\s*/,t=function(e,t){return typeof e==`string`?e:t.name!==void 0&&t.message!==void 0?t.toString():oe(t)};if(typeof Error.stackTraceLimit==`number`&&typeof Error.captureStackTrace==`function`){Error.stackTraceLimit+=6,f=e,p=t;var n=Error.captureStackTrace;return le=function(e){return l.test(e)},function(e,t){Error.stackTraceLimit+=6,n(e,t),Error.stackTraceLimit-=6}}var r=Error();if(typeof r.stack==`string`&&r.stack.split(`
|
|
308
|
+
`)[0].indexOf(`stackDetection@`)>=0)return f=/@/,p=t,m=!0,function(e){e.stack=Error().stack};var i;try{throw Error()}catch(e){i=`stack`in e}return!(`stack`in r)&&i&&typeof Error.stackTraceLimit==`number`?(f=e,p=t,function(e){Error.stackTraceLimit+=6;try{throw Error()}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6}):(p=function(e,t){return typeof e==`string`?e:(typeof t==`object`||typeof t==`function`)&&t.name!==void 0&&t.message!==void 0?t.toString():oe(t)},null)})([]);typeof console<`u`&&console.warn!==void 0&&(h=function(e){console.warn(e)},a.isNode&&process.stderr.isTTY?h=function(e,t){console.warn((t?`\x1B[33m`:`\x1B[31m`)+e+`\x1B[0m
|
|
309
|
+
`)}:!a.isNode&&typeof Error().stack==`string`&&(h=function(e,t){console.warn(`%c`+e,t?`color: darkorange`:`color: red`)}));var he={warnings:_,longStackTraces:!1,cancellation:!1,monitoring:!1};return v&&e.longStackTraces(),{longStackTraces:function(){return he.longStackTraces},warnings:function(){return he.warnings},cancellation:function(){return he.cancellation},monitoring:function(){return he.monitoring},propagateFromFunction:function(){return P},boundValueFunction:function(){return F},checkForgottenReturns:R,setBounds:fe,warn:B,deprecated:z,CapturedTrace:pe,fireDomEvent:x,fireGlobalEvent:S}}})),qH=s(((e,t)=>{t.exports=function(e,t){var n=RH(),r=e.CancellationError,i=n.errorObj;function a(e,t,n){this.promise=e,this.type=t,this.handler=n,this.called=!1,this.cancelPromise=null}a.prototype.isFinallyHandler=function(){return this.type===0};function o(e){this.finallyHandler=e}o.prototype._resultCancelled=function(){s(this.finallyHandler)};function s(e,t){return e.cancelPromise==null?!1:(arguments.length>1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function c(){return u.call(this,this.promise._target()._settledValue())}function l(e){if(!s(this,e))return i.e=e,i}function u(n){var a=this.promise,u=this.handler;if(!this.called){this.called=!0;var d=this.isFinallyHandler()?u.call(a._boundValue()):u.call(a._boundValue(),n);if(d!==void 0){a._setReturnedNonUndefined();var f=t(d,a);if(f instanceof e){if(this.cancelPromise!=null)if(f._isCancelled()){var p=new r(`late cancellation observer`);return a._attachExtraTrace(p),i.e=p,i}else f.isPending()&&f._attachCancellationCallback(new o(this));return f._then(c,l,void 0,this,void 0)}}}return a.isRejected()?(s(this),i.e=n,i):(s(this),n)}return e.prototype._passThrough=function(e,t,n,r){return typeof e==`function`?this._then(n,r,void 0,new a(this,t,e),void 0):this.then()},e.prototype.lastly=e.prototype.finally=function(e){return this._passThrough(e,0,u,u)},e.prototype.tap=function(e){return this._passThrough(e,1,u)},a}})),JH=s(((e,t)=>{t.exports=function(e){var t=RH(),n=LH().keys,r=t.tryCatch,i=t.errorObj;function a(a,o,s){return function(c){var l=s._boundValue();predicateLoop:for(var u=0;u<a.length;++u){var d=a[u];if(d===Error||d!=null&&d.prototype instanceof Error){if(c instanceof d)return r(o).call(l,c)}else if(typeof d==`function`){var f=r(d).call(l,c);if(f===i)return f;if(f)return r(o).call(l,c)}else if(t.isObject(c)){for(var p=n(d),m=0;m<p.length;++m){var h=p[m];if(d[h]!=c[h])continue predicateLoop}return r(o).call(l,c)}}return e}}return a}})),YH=s(((e,t)=>{var n=RH(),r=n.maybeWrapAsError,i=HH().OperationalError,a=LH();function o(e){return e instanceof Error&&a.getPrototypeOf(e)===Error.prototype}var s=/^(?:name|message|stack|cause)$/;function c(e){var t;if(o(e)){t=new i(e),t.name=e.name,t.message=e.message,t.stack=e.stack;for(var r=a.keys(e),c=0;c<r.length;++c){var l=r[c];s.test(l)||(t[l]=e[l])}return t}return n.markAsOriginatingFromRejection(e),e}function l(e,t){return function(n,i){if(e!==null){if(n){var a=c(r(n));e._attachExtraTrace(a),e._reject(a)}else if(!t)e._fulfill(i);else{for(var o=arguments.length,s=Array(Math.max(o-1,0)),l=1;l<o;++l)s[l-1]=arguments[l];e._fulfill(s)}e=null}}}t.exports=l})),XH=s(((e,t)=>{t.exports=function(e,t,n,r,i){var a=RH(),o=a.tryCatch;e.method=function(n){if(typeof n!=`function`)throw new e.TypeError(`expecting a function but got `+a.classString(n));return function(){var r=new e(t);r._captureStackTrace(),r._pushContext();var a=o(n).apply(this,arguments),s=r._popContext();return i.checkForgottenReturns(a,s,`Promise.method`,r),r._resolveFromSyncValue(a),r}},e.attempt=e.try=function(n){if(typeof n!=`function`)return r(`expecting a function but got `+a.classString(n));var s=new e(t);s._captureStackTrace(),s._pushContext();var c;if(arguments.length>1){i.deprecated(`calling Promise.try with more than 1 argument`);var l=arguments[1],u=arguments[2];c=a.isArray(l)?o(n).apply(u,l):o(n).call(u,l)}else c=o(n)();var d=s._popContext();return i.checkForgottenReturns(c,d,`Promise.try`,s),s._resolveFromSyncValue(c),s},e.prototype._resolveFromSyncValue=function(e){e===a.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}})),ZH=s(((e,t)=>{t.exports=function(e,t,n,r){var i=!1,a=function(e,t){this._reject(t)},o=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(a,a,null,this,e)},s=function(e,t){this._bitField&50397184||this._resolveCallback(t.target)},c=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(a){i||(i=!0,e.prototype._propagateFrom=r.propagateFromFunction(),e.prototype._boundValue=r.boundValueFunction());var l=n(a),u=new e(t);u._propagateFrom(this,1);var d=this._target();if(u._setBoundTo(l),l instanceof e){var f={promiseRejectionQueued:!1,promise:u,target:d,bindingPromise:l};d._then(t,o,void 0,u,f),l._then(s,c,void 0,u,f),u._setOnCancel(l)}else u._resolveCallback(d);return u},e.prototype._setBoundTo=function(e){e===void 0?this._bitField&=-2097153:(this._bitField|=2097152,this._boundTo=e)},e.prototype._isBound=function(){return(this._bitField&2097152)==2097152},e.bind=function(t,n){return e.resolve(n).bind(t)}}})),QH=s(((e,t)=>{t.exports=function(e,t,n,r){var i=RH(),a=i.tryCatch,o=i.errorObj,s=e._async;e.prototype.break=e.prototype.cancel=function(){if(!r.cancellation())return this._warn(`cancellation is disabled`);for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var n=e._cancellationParent;if(n==null||!n._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}else e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return this._branchesRemainingToCancel===void 0||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),s.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(e,t){if(i.isArray(e))for(var n=0;n<e.length;++n)this._doInvokeOnCancel(e[n],t);else if(e!==void 0)if(typeof e==`function`){if(!t){var r=a(e).call(this._boundValue());r===o&&(this._attachExtraTrace(r.e),s.throwLater(r.e))}}else e._resultCancelled(this)},e.prototype._invokeOnCancel=function(){var e=this._onCancel();this._unsetOnCancel(),s.invoke(this._doInvokeOnCancel,this,e)},e.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},e.prototype._resultCancelled=function(){this.cancel()}}})),$H=s(((e,t)=>{t.exports=function(e){function t(){return this.value}function n(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(n){return n instanceof e&&n.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:n},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(n,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:e},void 0);var t=arguments[1];return this.caught(e,function(){throw t})},e.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof e&&n.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:n},void 0);var r=arguments[1];return r instanceof e&&r.suppressUnhandledRejections(),this.caught(n,function(){return r})}}})),eU=s(((e,t)=>{t.exports=function(e){function t(e){e===void 0?(this._bitField=0,this._settledValueField=void 0):(e=e._target(),this._bitField=e._bitField,this._settledValueField=e._isFateSealed()?e._settledValue():void 0)}t.prototype._settledValue=function(){return this._settledValueField};var n=t.prototype.value=function(){if(!this.isFulfilled())throw TypeError(`cannot get fulfillment value of a non-fulfilled promise
|
|
310
|
+
|
|
311
|
+
See http://goo.gl/MqrFmX
|
|
312
|
+
`);return this._settledValue()},r=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw TypeError(`cannot get rejection reason of a non-rejected promise
|
|
313
|
+
|
|
314
|
+
See http://goo.gl/MqrFmX
|
|
315
|
+
`);return this._settledValue()},i=t.prototype.isFulfilled=function(){return(this._bitField&33554432)!=0},a=t.prototype.isRejected=function(){return(this._bitField&16777216)!=0},o=t.prototype.isPending=function(){return(this._bitField&50397184)==0},s=t.prototype.isResolved=function(){return(this._bitField&50331648)!=0};t.prototype.isCancelled=function(){return(this._bitField&8454144)!=0},e.prototype.__isCancelled=function(){return(this._bitField&65536)==65536},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!=0},e.prototype.isPending=function(){return o.call(this._target())},e.prototype.isRejected=function(){return a.call(this._target())},e.prototype.isFulfilled=function(){return i.call(this._target())},e.prototype.isResolved=function(){return s.call(this._target())},e.prototype.value=function(){return n.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),r.call(e)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}})),tU=s(((e,t)=>{t.exports=function(e,t,n,r,i,a){var o=RH(),s=o.canEvaluate,c=o.tryCatch,l=o.errorObj,u;if(s){for(var d=function(e){return Function(`value`,`holder`,`
|
|
316
|
+
'use strict';
|
|
317
|
+
holder.pIndex = value;
|
|
318
|
+
holder.checkFulfillment(this);
|
|
319
|
+
`.replace(/Index/g,e))},f=function(e){return Function(`promise`,`holder`,`
|
|
320
|
+
'use strict';
|
|
321
|
+
holder.pIndex = promise;
|
|
322
|
+
`.replace(/Index/g,e))},p=function(t){for(var n=Array(t),r=0;r<n.length;++r)n[r]=`this.p`+(r+1);var a=n.join(` = `)+` = null;`,o=`var promise;
|
|
323
|
+
`+n.map(function(e){return`
|
|
324
|
+
promise = `+e+`;
|
|
325
|
+
if (promise instanceof Promise) {
|
|
326
|
+
promise.cancel();
|
|
327
|
+
}
|
|
328
|
+
`}).join(`
|
|
329
|
+
`),s=n.join(`, `),u=`Holder$`+t,d=`return function(tryCatch, errorObj, Promise, async) {
|
|
330
|
+
'use strict';
|
|
331
|
+
function [TheName](fn) {
|
|
332
|
+
[TheProperties]
|
|
333
|
+
this.fn = fn;
|
|
334
|
+
this.asyncNeeded = true;
|
|
335
|
+
this.now = 0;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
[TheName].prototype._callFunction = function(promise) {
|
|
339
|
+
promise._pushContext();
|
|
340
|
+
var ret = tryCatch(this.fn)([ThePassedArguments]);
|
|
341
|
+
promise._popContext();
|
|
342
|
+
if (ret === errorObj) {
|
|
343
|
+
promise._rejectCallback(ret.e, false);
|
|
344
|
+
} else {
|
|
345
|
+
promise._resolveCallback(ret);
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
[TheName].prototype.checkFulfillment = function(promise) {
|
|
350
|
+
var now = ++this.now;
|
|
351
|
+
if (now === [TheTotal]) {
|
|
352
|
+
if (this.asyncNeeded) {
|
|
353
|
+
async.invoke(this._callFunction, this, promise);
|
|
354
|
+
} else {
|
|
355
|
+
this._callFunction(promise);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
[TheName].prototype._resultCancelled = function() {
|
|
362
|
+
[CancellationCode]
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
return [TheName];
|
|
366
|
+
}(tryCatch, errorObj, Promise, async);
|
|
367
|
+
`;return d=d.replace(/\[TheName\]/g,u).replace(/\[TheTotal\]/g,t).replace(/\[ThePassedArguments\]/g,s).replace(/\[TheProperties\]/g,a).replace(/\[CancellationCode\]/g,o),Function(`tryCatch`,`errorObj`,`Promise`,`async`,d)(c,l,e,i)},m=[],h=[],g=[],_=0;_<8;++_)m.push(p(_+1)),h.push(d(_+1)),g.push(f(_+1));u=function(e){this._reject(e)}}e.join=function(){var i=arguments.length-1,c;if(i>0&&typeof arguments[i]==`function`&&(c=arguments[i],i<=8&&s)){var l=new e(r);l._captureStackTrace();for(var d=m[i-1],f=new d(c),p=h,_=0;_<i;++_){var v=n(arguments[_],l);if(v instanceof e){v=v._target();var y=v._bitField;y&50397184?y&33554432?p[_].call(l,v._value(),f):y&16777216?l._reject(v._reason()):l._cancel():(v._then(p[_],u,void 0,l,f),g[_](v,f),f.asyncNeeded=!1)}else p[_].call(l,v,f)}if(!l._isFateSealed()){if(f.asyncNeeded){var b=a();b!==null&&(f.fn=o.domainBind(b,f.fn))}l._setAsyncGuaranteed(),l._setOnCancel(f)}return l}for(var x=arguments.length,S=Array(x),C=0;C<x;++C)S[C]=arguments[C];c&&S.pop();var l=new t(S).promise();return c===void 0?l:l.spread(c)}}})),nU=s(((e,t)=>{t.exports=function(e,t,n,r,i,a){var o=e._getDomain,s=RH(),c=s.tryCatch,l=s.errorObj,u=e._async;function d(e,t,n,r){this.constructor$(e),this._promise._captureStackTrace();var a=o();this._callback=a===null?t:s.domainBind(a,t),this._preservedValues=r===i?Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],u.invoke(this._asyncInit,this,void 0)}s.inherits(d,t),d.prototype._asyncInit=function(){this._init$(void 0,-2)},d.prototype._init=function(){},d.prototype._promiseFulfilled=function(t,n){var i=this._values,o=this.length(),s=this._preservedValues,u=this._limit;if(n<0){if(n=n*-1-1,i[n]=t,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return i[n]=t,this._queue.push(n),!1;s!==null&&(s[n]=t);var d=this._promise,f=this._callback,p=d._boundValue();d._pushContext();var m=c(f).call(p,t,n,o),h=d._popContext();if(a.checkForgottenReturns(m,h,s===null?`Promise.map`:`Promise.filter`,d),m===l)return this._reject(m.e),!0;var g=r(m,this._promise);if(g instanceof e){g=g._target();var _=g._bitField;if(!(_&50397184))return u>=1&&this._inFlight++,i[n]=g,g._proxy(this,(n+1)*-1),!1;if(_&33554432)m=g._value();else if(_&16777216)return this._reject(g._reason()),!0;else return this._cancel(),!0}i[n]=m}return++this._totalResolved>=o?(s===null?this._resolve(i):this._filter(i,s),!0):!1},d.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,n=this._values;e.length>0&&this._inFlight<t;){if(this._isResolved())return;var r=e.pop();this._promiseFulfilled(n[r],r)}},d.prototype._filter=function(e,t){for(var n=t.length,r=Array(n),i=0,a=0;a<n;++a)e[a]&&(r[i++]=t[a]);r.length=i,this._resolve(r)},d.prototype.preservedValues=function(){return this._preservedValues};function f(t,r,i,a){if(typeof r!=`function`)return n(`expecting a function but got `+s.classString(r));var o=0;if(i!==void 0)if(typeof i==`object`&&i){if(typeof i.concurrency!=`number`)return e.reject(TypeError(`'concurrency' must be a number but it is `+s.classString(i.concurrency)));o=i.concurrency}else return e.reject(TypeError(`options argument must be an object but it is `+s.classString(i)));return o=typeof o==`number`&&isFinite(o)&&o>=1?o:0,new d(t,r,o,a).promise()}e.prototype.map=function(e,t){return f(this,e,t,null)},e.map=function(e,t,n,r){return f(e,t,n,r)}}})),rU=s(((e,t)=>{var n=Object.create;if(n){var r=n(null),i=n(null);r[` size`]=i[` size`]=0}t.exports=function(e){var t=RH(),n=t.canEvaluate,a=t.isIdentifier,o,s,c=function(e){return Function(`ensureMethod`,`
|
|
368
|
+
return function(obj) {
|
|
369
|
+
'use strict'
|
|
370
|
+
var len = this.length;
|
|
371
|
+
ensureMethod(obj, 'methodName');
|
|
372
|
+
switch(len) {
|
|
373
|
+
case 1: return obj.methodName(this[0]);
|
|
374
|
+
case 2: return obj.methodName(this[0], this[1]);
|
|
375
|
+
case 3: return obj.methodName(this[0], this[1], this[2]);
|
|
376
|
+
case 0: return obj.methodName();
|
|
377
|
+
default:
|
|
378
|
+
return obj.methodName.apply(obj, this);
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
`.replace(/methodName/g,e))(d)},l=function(e){return Function(`obj`,`
|
|
382
|
+
'use strict';
|
|
383
|
+
return obj.propertyName;
|
|
384
|
+
`.replace(`propertyName`,e))},u=function(e,t,n){var r=n[e];if(typeof r!=`function`){if(!a(e))return null;if(r=t(e),n[e]=r,n[` size`]++,n[` size`]>512){for(var i=Object.keys(n),o=0;o<256;++o)delete n[i[o]];n[` size`]=i.length-256}}return r};o=function(e){return u(e,c,r)},s=function(e){return u(e,l,i)};function d(n,r){var i;if(n!=null&&(i=n[r]),typeof i!=`function`){var a=`Object `+t.classString(n)+` has no method '`+t.toString(r)+`'`;throw new e.TypeError(a)}return i}function f(e){return d(e,this.pop()).apply(e,this)}e.prototype.call=function(e){for(var t=arguments.length,r=Array(Math.max(t-1,0)),i=1;i<t;++i)r[i-1]=arguments[i];if(n){var a=o(e);if(a!==null)return this._then(a,void 0,void 0,r,void 0)}return r.push(e),this._then(f,void 0,void 0,r,void 0)};function p(e){return e[this]}function m(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}e.prototype.get=function(e){var t=typeof e==`number`,r;if(t)r=m;else if(n){var i=s(e);r=i===null?p:i}else r=p;return this._then(r,void 0,void 0,e,void 0)}}})),iU=s(((e,t)=>{t.exports=function(e,t,n,r,i,a){var o=RH(),s=HH().TypeError,c=RH().inherits,l=o.errorObj,u=o.tryCatch,d={};function f(e){setTimeout(function(){throw e},0)}function p(e){var t=n(e);return t!==e&&typeof e._isDisposable==`function`&&typeof e._getDisposer==`function`&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t}function m(t,r){var a=0,o=t.length,s=new e(i);function c(){if(a>=o)return s._fulfill();var i=p(t[a++]);if(i instanceof e&&i._isDisposable()){try{i=n(i._getDisposer().tryDispose(r),t.promise)}catch(e){return f(e)}if(i instanceof e)return i._then(c,f,null,null,null)}c()}return c(),s}function h(e,t,n){this._data=e,this._promise=t,this._context=n}h.prototype.data=function(){return this._data},h.prototype.promise=function(){return this._promise},h.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():d},h.prototype.tryDispose=function(e){var t=this.resource(),n=this._context;n!==void 0&&n._pushContext();var r=t===d?null:this.doDispose(t,e);return n!==void 0&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},h.isDisposer=function(e){return e!=null&&typeof e.resource==`function`&&typeof e.tryDispose==`function`};function g(e,t,n){this.constructor$(e,t,n)}c(g,h),g.prototype.doDispose=function(e,t){return this.data().call(e,e,t)};function _(e){return h.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function v(e){this.length=e,this.promise=null,this[e-1]=null}v.prototype._resultCancelled=function(){for(var t=this.length,n=0;n<t;++n){var r=this[n];r instanceof e&&r.cancel()}},e.using=function(){var r=arguments.length;if(r<2)return t(`you must pass at least 2 arguments to Promise.using`);var i=arguments[r-1];if(typeof i!=`function`)return t(`expecting a function but got `+o.classString(i));var s,c=!0;r===2&&Array.isArray(arguments[0])?(s=arguments[0],r=s.length,c=!1):(s=arguments,r--);for(var d=new v(r),f=0;f<r;++f){var p=s[f];if(h.isDisposer(p)){var g=p;p=p.promise(),p._setDisposable(g)}else{var y=n(p);y instanceof e&&(p=y._then(_,null,null,{resources:d,index:f},void 0))}d[f]=p}for(var b=Array(d.length),f=0;f<b.length;++f)b[f]=e.resolve(d[f]).reflect();var x=e.all(b).then(function(e){for(var t=0;t<e.length;++t){var n=e[t];if(n.isRejected())return l.e=n.error(),l;if(!n.isFulfilled()){x.cancel();return}e[t]=n.value()}S._pushContext(),i=u(i);var r=c?i.apply(void 0,e):i(e),o=S._popContext();return a.checkForgottenReturns(r,o,`Promise.using`,S),r}),S=x.lastly(function(){return m(d,new e.PromiseInspection(x))});return d.promise=S,S._setOnCancel(d),S},e.prototype._setDisposable=function(e){this._bitField|=131072,this._disposer=e},e.prototype._isDisposable=function(){return(this._bitField&131072)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField&=-131073,this._disposer=void 0},e.prototype.disposer=function(e){if(typeof e==`function`)return new g(e,this,r());throw new s}}})),aU=s(((e,t)=>{t.exports=function(e,t,n){var r=RH(),i=e.TimeoutError;function a(e){this.handle=e}a.prototype._resultCancelled=function(){clearTimeout(this.handle)};var o=function(e){return s(+this).thenReturn(e)},s=e.delay=function(r,i){var s,c;return i===void 0?(s=new e(t),c=setTimeout(function(){s._fulfill()},+r),n.cancellation()&&s._setOnCancel(new a(c)),s._captureStackTrace()):(s=e.resolve(i)._then(o,null,null,r,void 0),n.cancellation()&&i instanceof e&&s._setOnCancel(i)),s._setAsyncGuaranteed(),s};e.prototype.delay=function(e){return s(e,this)};var c=function(e,t,n){var a=typeof t==`string`?new i(t):t instanceof Error?t:new i(`operation timed out`);r.markAsOriginatingFromRejection(a),e._attachExtraTrace(a),e._reject(a),n?.cancel()};function l(e){return clearTimeout(this.handle),e}function u(e){throw clearTimeout(this.handle),e}e.prototype.timeout=function(e,t){e=+e;var r,i,o=new a(setTimeout(function(){r.isPending()&&c(r,t,i)},e));return n.cancellation()?(i=this.then(),r=i._then(l,u,void 0,o,void 0),r._setOnCancel(o)):r=this._then(l,u,void 0,o,void 0),r}}})),oU=s(((e,t)=>{t.exports=function(e,t,n,r,i,a){var o=HH().TypeError,s=RH(),c=s.errorObj,l=s.tryCatch,u=[];function d(t,n,i){for(var a=0;a<n.length;++a){i._pushContext();var o=l(n[a])(t);if(i._popContext(),o===c){i._pushContext();var s=e.reject(c.e);return i._popContext(),s}var u=r(o,i);if(u instanceof e)return u}return null}function f(t,r,i,o){if(a.cancellation()){var s=new e(n),c=this._finallyPromise=new e(n);this._promise=s.lastly(function(){return c}),s._captureStackTrace(),s._setOnCancel(this)}else (this._promise=new e(n))._captureStackTrace();this._stack=o,this._generatorFunction=t,this._receiver=r,this._generator=void 0,this._yieldHandlers=typeof i==`function`?[i].concat(u):u,this._yieldedPromise=null,this._cancellationPhase=!1}s.inherits(f,i),f.prototype._isResolved=function(){return this._promise===null},f.prototype._cleanup=function(){this._promise=this._generator=null,a.cancellation()&&this._finallyPromise!==null&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},f.prototype._promiseCancelled=function(){if(!this._isResolved()){var t=this._generator.return!==void 0,n;if(t)this._promise._pushContext(),n=l(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var r=new e.CancellationError(`generator .return() sentinel`);e.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),n=l(this._generator.throw).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(n)}},f.prototype._promiseFulfilled=function(e){this._yieldedPromise=null,this._promise._pushContext();var t=l(this._generator.next).call(this._generator,e);this._promise._popContext(),this._continue(t)},f.prototype._promiseRejected=function(e){this._yieldedPromise=null,this._promise._attachExtraTrace(e),this._promise._pushContext();var t=l(this._generator.throw).call(this._generator,e);this._promise._popContext(),this._continue(t)},f.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof e){var t=this._yieldedPromise;this._yieldedPromise=null,t.cancel()}},f.prototype.promise=function(){return this._promise},f.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},f.prototype._continue=function(t){var n=this._promise;if(t===c)return this._cleanup(),this._cancellationPhase?n.cancel():n._rejectCallback(t.e,!1);var i=t.value;if(t.done===!0)return this._cleanup(),this._cancellationPhase?n.cancel():n._resolveCallback(i);var a=r(i,this._promise);if(!(a instanceof e)&&(a=d(a,this._yieldHandlers,this._promise),a===null)){this._promiseRejected(new o(`A value %s was yielded that could not be treated as a promise
|
|
385
|
+
|
|
386
|
+
See http://goo.gl/MqrFmX
|
|
387
|
+
|
|
388
|
+
`.replace(`%s`,i)+`From coroutine:
|
|
389
|
+
`+this._stack.split(`
|
|
390
|
+
`).slice(1,-7).join(`
|
|
391
|
+
`)));return}a=a._target();var s=a._bitField;s&50397184?s&33554432?e._async.invoke(this._promiseFulfilled,this,a._value()):s&16777216?e._async.invoke(this._promiseRejected,this,a._reason()):this._promiseCancelled():(this._yieldedPromise=a,a._proxy(this,null))},e.coroutine=function(e,t){if(typeof e!=`function`)throw new o(`generatorFunction must be a function
|
|
392
|
+
|
|
393
|
+
See http://goo.gl/MqrFmX
|
|
394
|
+
`);var n=Object(t).yieldHandler,r=f,i=Error().stack;return function(){var t=e.apply(this,arguments),a=new r(void 0,void 0,n,i),o=a.promise();return a._generator=t,a._promiseFulfilled(void 0),o}},e.coroutine.addYieldHandler=function(e){if(typeof e!=`function`)throw new o(`expecting a function but got `+s.classString(e));u.push(e)},e.spawn=function(n){if(a.deprecated(`Promise.spawn()`,`Promise.coroutine()`),typeof n!=`function`)return t(`generatorFunction must be a function
|
|
395
|
+
|
|
396
|
+
See http://goo.gl/MqrFmX
|
|
397
|
+
`);var r=new f(n,this),i=r.promise();return r._run(e.spawn),i}}})),sU=s(((e,t)=>{t.exports=function(e){var t=RH(),n=e._async,r=t.tryCatch,i=t.errorObj;function a(e,a){var s=this;if(!t.isArray(e))return o.call(s,e,a);var c=r(a).apply(s._boundValue(),[null].concat(e));c===i&&n.throwLater(c.e)}function o(e,t){var a=this._boundValue(),o=e===void 0?r(t).call(a,null):r(t).call(a,null,e);o===i&&n.throwLater(o.e)}function s(e,t){var a=this;if(!e){var o=Error(e+``);o.cause=e,e=o}var s=r(t).call(a._boundValue(),e);s===i&&n.throwLater(s.e)}e.prototype.asCallback=e.prototype.nodeify=function(e,t){if(typeof e==`function`){var n=o;t!==void 0&&Object(t).spread&&(n=a),this._then(n,s,void 0,this,e)}return this}}})),cU=s(((e,t)=>{t.exports=function(e,t){var n={},r=RH(),i=YH(),a=r.withAppended,o=r.maybeWrapAsError,s=r.canEvaluate,c=HH().TypeError,l=`Async`,u={__isPromisified__:!0},d=RegExp(`^(?:`+[`arity`,`length`,`name`,`arguments`,`caller`,`callee`,`prototype`,`__isPromisified__`].join(`|`)+`)$`),f=function(e){return r.isIdentifier(e)&&e.charAt(0)!==`_`&&e!==`constructor`};function p(e){return!d.test(e)}function m(e){try{return e.__isPromisified__===!0}catch{return!1}}function h(e,t,n){var i=r.getDataPropertyOrDefault(e,t+n,u);return i?m(i):!1}function g(e,t,n){for(var r=0;r<e.length;r+=2){var i=e[r];if(n.test(i)){for(var a=i.replace(n,``),o=0;o<e.length;o+=2)if(e[o]===a)throw new c(`Cannot promisify an API that has normal methods with '%s'-suffix
|
|
398
|
+
|
|
399
|
+
See http://goo.gl/MqrFmX
|
|
400
|
+
`.replace(`%s`,t))}}}function _(e,t,n,i){for(var a=r.inheritedDataKeys(e),o=[],s=0;s<a.length;++s){var c=a[s],l=e[c],u=i===f?!0:f(c,l,e);typeof l==`function`&&!m(l)&&!h(e,c,t)&&i(c,l,e,u)&&o.push(c,l)}return g(o,t,n),o}var v=function(e){return e.replace(/([$])/,`\\$`)},y,b=function(e){for(var t=[e],n=Math.max(0,e-1-3),r=e-1;r>=n;--r)t.push(r);for(var r=e+1;r<=3;++r)t.push(r);return t},x=function(e){return r.filledRange(e,`_arg`,``)},S=function(e){return r.filledRange(Math.max(e,3),`_arg`,``)},C=function(e){return typeof e.length==`number`?Math.max(Math.min(e.length,1024),0):0};y=function(s,c,l,u,d,f){var p=Math.max(0,C(u)-1),m=b(p),h=typeof s==`string`||c===n;function g(e){var t=x(e).join(`, `),n=e>0?`, `:``;return(h?`ret = callback.call(this, {{args}}, nodeback); break;
|
|
401
|
+
`:c===void 0?`ret = callback({{args}}, nodeback); break;
|
|
402
|
+
`:`ret = callback.call(receiver, {{args}}, nodeback); break;
|
|
403
|
+
`).replace(`{{args}}`,t).replace(`, `,n)}function _(){for(var e=``,t=0;t<m.length;++t)e+=`case `+m[t]+`:`+g(m[t]);return e+=`
|
|
404
|
+
default:
|
|
405
|
+
var args = new Array(len + 1);
|
|
406
|
+
var i = 0;
|
|
407
|
+
for (var i = 0; i < len; ++i) {
|
|
408
|
+
args[i] = arguments[i];
|
|
409
|
+
}
|
|
410
|
+
args[i] = nodeback;
|
|
411
|
+
[CodeForCall]
|
|
412
|
+
break;
|
|
413
|
+
`.replace(`[CodeForCall]`,h?`ret = callback.apply(this, args);
|
|
414
|
+
`:`ret = callback.apply(receiver, args);
|
|
415
|
+
`),e}var v=typeof s==`string`?`this != null ? this['`+s+`'] : fn`:`fn`,y=`'use strict';
|
|
416
|
+
var ret = function (Parameters) {
|
|
417
|
+
'use strict';
|
|
418
|
+
var len = arguments.length;
|
|
419
|
+
var promise = new Promise(INTERNAL);
|
|
420
|
+
promise._captureStackTrace();
|
|
421
|
+
var nodeback = nodebackForPromise(promise, `+f+`);
|
|
422
|
+
var ret;
|
|
423
|
+
var callback = tryCatch([GetFunctionCode]);
|
|
424
|
+
switch(len) {
|
|
425
|
+
[CodeForSwitchCase]
|
|
426
|
+
}
|
|
427
|
+
if (ret === errorObj) {
|
|
428
|
+
promise._rejectCallback(maybeWrapAsError(ret.e), true, true);
|
|
429
|
+
}
|
|
430
|
+
if (!promise._isFateSealed()) promise._setAsyncGuaranteed();
|
|
431
|
+
return promise;
|
|
432
|
+
};
|
|
433
|
+
notEnumerableProp(ret, '__isPromisified__', true);
|
|
434
|
+
return ret;
|
|
435
|
+
`.replace(`[CodeForSwitchCase]`,_()).replace(`[GetFunctionCode]`,v);return y=y.replace(`Parameters`,S(p)),Function(`Promise`,`fn`,`receiver`,`withAppended`,`maybeWrapAsError`,`nodebackForPromise`,`tryCatch`,`errorObj`,`notEnumerableProp`,`INTERNAL`,y)(e,u,c,a,o,i,r.tryCatch,r.errorObj,r.notEnumerableProp,t)};function w(s,c,l,u,d,f){var p=(function(){return this})(),m=s;typeof m==`string`&&(s=u);function h(){var r=c;c===n&&(r=this);var l=new e(t);l._captureStackTrace();var u=typeof m==`string`&&this!==p?this[m]:s,d=i(l,f);try{u.apply(r,a(arguments,d))}catch(e){l._rejectCallback(o(e),!0,!0)}return l._isFateSealed()||l._setAsyncGuaranteed(),l}return r.notEnumerableProp(h,`__isPromisified__`,!0),h}var T=s?y:w;function E(e,t,i,a,o){for(var s=_(e,t,RegExp(v(t)+`$`),i),c=0,l=s.length;c<l;c+=2){var u=s[c],d=s[c+1],f=u+t;if(a===T)e[f]=T(u,n,u,d,t,o);else{var p=a(d,function(){return T(u,n,u,d,t,o)});r.notEnumerableProp(p,`__isPromisified__`,!0),e[f]=p}}return r.toFastProperties(e),e}function D(e,t,n){return T(e,t,void 0,e,null,n)}e.promisify=function(e,t){if(typeof e!=`function`)throw new c(`expecting a function but got `+r.classString(e));if(m(e))return e;t=Object(t);var i=D(e,t.context===void 0?n:t.context,!!t.multiArgs);return r.copyDescriptors(e,i,p),i},e.promisifyAll=function(e,t){if(typeof e!=`function`&&typeof e!=`object`)throw new c(`the target of promisifyAll must be an object or a function
|
|
436
|
+
|
|
437
|
+
See http://goo.gl/MqrFmX
|
|
438
|
+
`);t=Object(t);var n=!!t.multiArgs,i=t.suffix;typeof i!=`string`&&(i=l);var a=t.filter;typeof a!=`function`&&(a=f);var o=t.promisifier;if(typeof o!=`function`&&(o=T),!r.isIdentifier(i))throw RangeError(`suffix must be a valid identifier
|
|
439
|
+
|
|
440
|
+
See http://goo.gl/MqrFmX
|
|
441
|
+
`);for(var s=r.inheritedDataKeys(e),u=0;u<s.length;++u){var d=e[s[u]];s[u]!==`constructor`&&r.isClass(d)&&(E(d.prototype,i,a,o,n),E(d,i,a,o,n))}return E(e,i,a,o,n)}}})),lU=s(((e,t)=>{t.exports=function(e,t,n,r){var i=RH(),a=i.isObject,o=LH(),s;typeof Map==`function`&&(s=Map);var c=(function(){var e=0,t=0;function n(n,r){this[e]=n,this[e+t]=r,e++}return function(r){t=r.size,e=0;var i=Array(r.size*2);return r.forEach(n,i),i}})(),l=function(e){for(var t=new s,n=e.length/2|0,r=0;r<n;++r){var i=e[n+r],a=e[r];t.set(i,a)}return t};function u(e){var t=!1,n;if(s!==void 0&&e instanceof s)n=c(e),t=!0;else{var r=o.keys(e),i=r.length;n=Array(i*2);for(var a=0;a<i;++a){var l=r[a];n[a]=e[l],n[a+i]=l}}this.constructor$(n),this._isMap=t,this._init$(void 0,-3)}i.inherits(u,t),u.prototype._init=function(){},u.prototype._promiseFulfilled=function(e,t){if(this._values[t]=e,++this._totalResolved>=this._length){var n;if(this._isMap)n=l(this._values);else{n={};for(var r=this.length(),i=0,a=this.length();i<a;++i)n[this._values[i+r]]=this._values[i]}return this._resolve(n),!0}return!1},u.prototype.shouldCopyValues=function(){return!1},u.prototype.getActualLength=function(e){return e>>1};function d(t){var i,o=n(t);if(a(o))i=o instanceof e?o._then(e.props,void 0,void 0,void 0,void 0):new u(o).promise();else return r(`cannot await properties of a non-object
|
|
442
|
+
|
|
443
|
+
See http://goo.gl/MqrFmX
|
|
444
|
+
`);return o instanceof e&&i._propagateFrom(o,2),i}e.prototype.props=function(){return d(this)},e.props=function(e){return d(e)}}})),uU=s(((e,t)=>{t.exports=function(e,t,n,r){var i=RH(),a=function(e){return e.then(function(t){return o(t,e)})};function o(o,s){var c=n(o);if(c instanceof e)return a(c);if(o=i.asArray(o),o===null)return r(`expecting an array or an iterable object but got `+i.classString(o));var l=new e(t);s!==void 0&&l._propagateFrom(s,3);for(var u=l._fulfill,d=l._reject,f=0,p=o.length;f<p;++f){var m=o[f];m===void 0&&!(f in o)||e.cast(m)._then(u,d,void 0,l,null)}return l}e.race=function(e){return o(e,void 0)},e.prototype.race=function(){return o(this,void 0)}}})),dU=s(((e,t)=>{t.exports=function(e,t,n,r,i,a){var o=e._getDomain,s=RH(),c=s.tryCatch;function l(t,n,r,a){this.constructor$(t);var c=o();this._fn=c===null?n:s.domainBind(c,n),r!==void 0&&(r=e.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,a===i?this._eachValues=Array(this._length):a===0?this._eachValues=null:this._eachValues=void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}s.inherits(l,t),l.prototype._gotAccum=function(e){this._eachValues!==void 0&&this._eachValues!==null&&e!==i&&this._eachValues.push(e)},l.prototype._eachComplete=function(e){return this._eachValues!==null&&this._eachValues.push(e),this._eachValues},l.prototype._init=function(){},l.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues===void 0?this._initialValue:this._eachValues)},l.prototype.shouldCopyValues=function(){return!1},l.prototype._resolve=function(e){this._promise._resolveCallback(e),this._values=null},l.prototype._resultCancelled=function(t){if(t===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel())},l.prototype._iterate=function(t){this._values=t;var n,r,i=t.length;if(this._initialValue===void 0?(n=e.resolve(t[0]),r=1):(n=this._initialValue,r=0),this._currentCancellable=n,!n.isRejected())for(;r<i;++r){var a={accum:null,value:t[r],index:r,length:i,array:this};n=n._then(f,void 0,void 0,a,void 0)}this._eachValues!==void 0&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(u,u,void 0,n,this)},e.prototype.reduce=function(e,t){return d(this,e,t,null)},e.reduce=function(e,t,n,r){return d(e,t,n,r)};function u(e,t){this.isFulfilled()?t._resolve(e):t._reject(e)}function d(e,t,r,i){return typeof t==`function`?new l(e,t,r,i).promise():n(`expecting a function but got `+s.classString(t))}function f(t){this.accum=t,this.array._gotAccum(t);var n=r(this.value,this.array._promise);return n instanceof e?(this.array._currentCancellable=n,n._then(p,void 0,void 0,this,void 0)):p.call(this,n)}function p(t){var n=this.array,r=n._promise,i=c(n._fn);r._pushContext();var o=n._eachValues===void 0?i.call(r._boundValue(),this.accum,t,this.index,this.length):i.call(r._boundValue(),t,this.index,this.length);o instanceof e&&(n._currentCancellable=o);var s=r._popContext();return a.checkForgottenReturns(o,s,n._eachValues===void 0?`Promise.reduce`:`Promise.each`,r),o}}})),fU=s(((e,t)=>{t.exports=function(e,t,n){var r=e.PromiseInspection,i=RH();function a(e){this.constructor$(e)}i.inherits(a,t),a.prototype._promiseResolved=function(e,t){return this._values[e]=t,++this._totalResolved>=this._length?(this._resolve(this._values),!0):!1},a.prototype._promiseFulfilled=function(e,t){var n=new r;return n._bitField=33554432,n._settledValueField=e,this._promiseResolved(t,n)},a.prototype._promiseRejected=function(e,t){var n=new r;return n._bitField=16777216,n._settledValueField=e,this._promiseResolved(t,n)},e.settle=function(e){return n.deprecated(`.settle()`,`.reflect()`),new a(e).promise()},e.prototype.settle=function(){return e.settle(this)}}})),pU=s(((e,t)=>{t.exports=function(e,t,n){var r=RH(),i=HH().RangeError,a=HH().AggregateError,o=r.isArray,s={};function c(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}r.inherits(c,t),c.prototype._init=function(){if(this._initialized){if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var e=o(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(e){this._howMany=e},c.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),this.howMany()===1&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},c.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||this._values==null?this._cancel():(this._addRejected(s),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t<this._values.length;++t)this._values[t]!==s&&e.push(this._values[t]);return e.length>0?this._reject(e):this._cancel(),!0}return!1},c.prototype._fulfilled=function(){return this._totalResolved},c.prototype._rejected=function(){return this._values.length-this.length()},c.prototype._addRejected=function(e){this._values.push(e)},c.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},c.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},c.prototype._getRangeError=function(e){return new i(`Input array must contain at least `+this._howMany+` items but contains only `+e+` items`)},c.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))};function l(e,t){if((t|0)!==t||t<0)return n(`expecting a positive integer
|
|
445
|
+
|
|
446
|
+
See http://goo.gl/MqrFmX
|
|
447
|
+
`);var r=new c(e),i=r.promise();return r.setHowMany(t),r.init(),i}e.some=function(e,t){return l(e,t)},e.prototype.some=function(e){return l(this,e)},e._SomePromiseArray=c}})),mU=s(((e,t)=>{t.exports=function(e,t){var n=e.map;e.prototype.filter=function(e,r){return n(this,e,r,t)},e.filter=function(e,r,i){return n(e,r,i,t)}}})),hU=s(((e,t)=>{t.exports=function(e,t){var n=e.reduce,r=e.all;function i(){return r(this)}function a(e,r){return n(e,r,t,t)}e.prototype.each=function(e){return n(this,e,t,0)._then(i,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return n(this,e,t,t)},e.each=function(e,r){return n(e,r,t,0)._then(i,void 0,void 0,e,void 0)},e.mapSeries=a}})),gU=s(((e,t)=>{t.exports=function(e){var t=e._SomePromiseArray;function n(e){var n=new t(e),r=n.promise();return n.setHowMany(1),n.setUnwrap(),n.init(),r}e.any=function(e){return n(e)},e.prototype.any=function(){return n(this)}}})),_U=s(((e,t)=>{t.exports=function(){var e=function(){return new f(`circular promise resolution chain
|
|
448
|
+
|
|
449
|
+
See http://goo.gl/MqrFmX
|
|
450
|
+
`)},n=function(){return new O.PromiseInspection(this._target())},r=function(e){return O.reject(new f(e))};function i(){}var a={},o=RH(),s=o.isNode?function(){var e=process.domain;return e===void 0&&(e=null),e}:function(){return null};o.notEnumerableProp(O,`_getDomain`,s);var c=LH(),l=VH(),u=new l;c.defineProperty(O,`_async`,{value:u});var d=HH(),f=O.TypeError=d.TypeError;O.RangeError=d.RangeError;var p=O.CancellationError=d.CancellationError;O.TimeoutError=d.TimeoutError,O.OperationalError=d.OperationalError,O.RejectionError=d.OperationalError,O.AggregateError=d.AggregateError;var m=function(){},h={},g={},_=UH()(O,m),v=WH()(O,m,_,r,i),y=GH()(O),b=y.create,x=KH()(O,y);x.CapturedTrace;var S=qH()(O,_),C=JH()(g),w=YH(),T=o.errorObj,E=o.tryCatch;function D(e,t){if(typeof t!=`function`)throw new f(`expecting a function but got `+o.classString(t));if(e.constructor!==O)throw new f(`the promise constructor cannot be invoked directly
|
|
451
|
+
|
|
452
|
+
See http://goo.gl/MqrFmX
|
|
453
|
+
`)}function O(e){this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,e!==m&&(D(this,e),this._resolveFromExecutor(e)),this._promiseCreated(),this._fireEvent(`promiseCreated`,this)}O.prototype.toString=function(){return`[object Promise]`},O.prototype.caught=O.prototype.catch=function(e){var t=arguments.length;if(t>1){var n=Array(t-1),i=0,a;for(a=0;a<t-1;++a){var s=arguments[a];if(o.isObject(s))n[i++]=s;else return r(`expecting an object but got A catch statement predicate `+o.classString(s))}return n.length=i,e=arguments[a],this.then(void 0,C(n,e,this))}return this.then(void 0,e)},O.prototype.reflect=function(){return this._then(n,n,void 0,this,void 0)},O.prototype.then=function(e,t){if(x.warnings()&&arguments.length>0&&typeof e!=`function`&&typeof t!=`function`){var n=`.then() only accepts functions but was passed: `+o.classString(e);arguments.length>1&&(n+=`, `+o.classString(t)),this._warn(n)}return this._then(e,t,void 0,void 0,void 0)},O.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},O.prototype.spread=function(e){return typeof e==`function`?this.all()._then(e,void 0,void 0,h,void 0):r(`expecting a function but got `+o.classString(e))},O.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},O.prototype.all=function(){return arguments.length>0&&this._warn(`.all() was passed arguments but it does not take any`),new v(this).promise()},O.prototype.error=function(e){return this.caught(o.originatesFromRejection,e)},O.getNewLibraryCopy=t.exports,O.is=function(e){return e instanceof O},O.fromNode=O.fromCallback=function(e){var t=new O(m);t._captureStackTrace();var n=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=E(e)(w(t,n));return r===T&&t._rejectCallback(r.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},O.all=function(e){return new v(e).promise()},O.cast=function(e){var t=_(e);return t instanceof O||(t=new O(m),t._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},O.resolve=O.fulfilled=O.cast,O.reject=O.rejected=function(e){var t=new O(m);return t._captureStackTrace(),t._rejectCallback(e,!0),t},O.setScheduler=function(e){if(typeof e!=`function`)throw new f(`expecting a function but got `+o.classString(e));return u.setScheduler(e)},O.prototype._then=function(e,t,n,r,i){var a=i!==void 0,c=a?i:new O(m),l=this._target(),d=l._bitField;a||(c._propagateFrom(this,3),c._captureStackTrace(),r===void 0&&this._bitField&2097152&&(r=d&50397184?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent(`promiseChained`,this,c));var f=s();if(d&50397184){var h,g,_=l._settlePromiseCtx;d&33554432?(g=l._rejectionHandler0,h=e):d&16777216?(g=l._fulfillmentHandler0,h=t,l._unsetRejectionIsUnhandled()):(_=l._settlePromiseLateCancellationObserver,g=new p(`late cancellation observer`),l._attachExtraTrace(g),h=t),u.invoke(_,l,{handler:f===null?h:typeof h==`function`&&o.domainBind(f,h),promise:c,receiver:r,value:g})}else l._addCallbacks(e,t,c,r,f);return c},O.prototype._length=function(){return this._bitField&65535},O.prototype._isFateSealed=function(){return(this._bitField&117506048)!=0},O.prototype._isFollowing=function(){return(this._bitField&67108864)==67108864},O.prototype._setLength=function(e){this._bitField=this._bitField&-65536|e&65535},O.prototype._setFulfilled=function(){this._bitField|=33554432,this._fireEvent(`promiseFulfilled`,this)},O.prototype._setRejected=function(){this._bitField|=16777216,this._fireEvent(`promiseRejected`,this)},O.prototype._setFollowing=function(){this._bitField|=67108864,this._fireEvent(`promiseResolved`,this)},O.prototype._setIsFinal=function(){this._bitField|=4194304},O.prototype._isFinal=function(){return(this._bitField&4194304)>0},O.prototype._unsetCancelled=function(){this._bitField&=-65537},O.prototype._setCancelled=function(){this._bitField|=65536,this._fireEvent(`promiseCancelled`,this)},O.prototype._setWillBeCancelled=function(){this._bitField|=8388608},O.prototype._setAsyncGuaranteed=function(){u.hasCustomScheduler()||(this._bitField|=134217728)},O.prototype._receiverAt=function(e){var t=e===0?this._receiver0:this[e*4-4+3];if(t!==a)return t===void 0&&this._isBound()?this._boundValue():t},O.prototype._promiseAt=function(e){return this[e*4-4+2]},O.prototype._fulfillmentHandlerAt=function(e){return this[e*4-4+0]},O.prototype._rejectionHandlerAt=function(e){return this[e*4-4+1]},O.prototype._boundValue=function(){},O.prototype._migrateCallback0=function(e){e._bitField;var t=e._fulfillmentHandler0,n=e._rejectionHandler0,r=e._promise0,i=e._receiverAt(0);i===void 0&&(i=a),this._addCallbacks(t,n,r,i,null)},O.prototype._migrateCallbackAt=function(e,t){var n=e._fulfillmentHandlerAt(t),r=e._rejectionHandlerAt(t),i=e._promiseAt(t),o=e._receiverAt(t);o===void 0&&(o=a),this._addCallbacks(n,r,i,o,null)},O.prototype._addCallbacks=function(e,t,n,r,i){var a=this._length();if(a>=65531&&(a=0,this._setLength(0)),a===0)this._promise0=n,this._receiver0=r,typeof e==`function`&&(this._fulfillmentHandler0=i===null?e:o.domainBind(i,e)),typeof t==`function`&&(this._rejectionHandler0=i===null?t:o.domainBind(i,t));else{var s=a*4-4;this[s+2]=n,this[s+3]=r,typeof e==`function`&&(this[s+0]=i===null?e:o.domainBind(i,e)),typeof t==`function`&&(this[s+1]=i===null?t:o.domainBind(i,t))}return this._setLength(a+1),a},O.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},O.prototype._resolveCallback=function(t,n){if(!(this._bitField&117506048)){if(t===this)return this._rejectCallback(e(),!1);var r=_(t,this);if(!(r instanceof O))return this._fulfill(t);n&&this._propagateFrom(r,2);var i=r._target();if(i===this){this._reject(e());return}var a=i._bitField;if(!(a&50397184)){var o=this._length();o>0&&i._migrateCallback0(this);for(var s=1;s<o;++s)i._migrateCallbackAt(this,s);this._setFollowing(),this._setLength(0),this._setFollowee(i)}else if(a&33554432)this._fulfill(i._value());else if(a&16777216)this._reject(i._reason());else{var c=new p(`late cancellation observer`);i._attachExtraTrace(c),this._reject(c)}}},O.prototype._rejectCallback=function(e,t,n){var r=o.ensureErrorObject(e),i=r===e;if(!i&&!n&&x.warnings()){var a=`a promise was rejected with a non-error: `+o.classString(e);this._warn(a,!0)}this._attachExtraTrace(r,t?i:!1),this._reject(e)},O.prototype._resolveFromExecutor=function(e){var t=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(e,function(e){t._resolveCallback(e)},function(e){t._rejectCallback(e,n)});n=!1,this._popContext(),r!==void 0&&t._rejectCallback(r,!0)},O.prototype._settlePromiseFromHandler=function(e,t,n,r){var i=r._bitField;if(!(i&65536)){r._pushContext();var a;t===h?!n||typeof n.length!=`number`?(a=T,a.e=new f(`cannot .spread() a non-array: `+o.classString(n))):a=E(e).apply(this._boundValue(),n):a=E(e).call(t,n);var s=r._popContext();i=r._bitField,!(i&65536)&&(a===g?r._reject(n):a===T?r._rejectCallback(a.e,!1):(x.checkForgottenReturns(a,s,``,r,this),r._resolveCallback(a)))}},O.prototype._target=function(){for(var e=this;e._isFollowing();)e=e._followee();return e},O.prototype._followee=function(){return this._rejectionHandler0},O.prototype._setFollowee=function(e){this._rejectionHandler0=e},O.prototype._settlePromise=function(e,t,r,a){var o=e instanceof O,s=this._bitField,c=(s&134217728)!=0;s&65536?(o&&e._invokeInternalOnCancel(),r instanceof S&&r.isFinallyHandler()?(r.cancelPromise=e,E(t).call(r,a)===T&&e._reject(T.e)):t===n?e._fulfill(n.call(r)):r instanceof i?r._promiseCancelled(e):o||e instanceof v?e._cancel():r.cancel()):typeof t==`function`?o?(c&&e._setAsyncGuaranteed(),this._settlePromiseFromHandler(t,r,a,e)):t.call(r,a,e):r instanceof i?r._isResolved()||(s&33554432?r._promiseFulfilled(a,e):r._promiseRejected(a,e)):o&&(c&&e._setAsyncGuaranteed(),s&33554432?e._fulfill(a):e._reject(a))},O.prototype._settlePromiseLateCancellationObserver=function(e){var t=e.handler,n=e.promise,r=e.receiver,i=e.value;typeof t==`function`?n instanceof O?this._settlePromiseFromHandler(t,r,i,n):t.call(r,i,n):n instanceof O&&n._reject(i)},O.prototype._settlePromiseCtx=function(e){this._settlePromise(e.promise,e.handler,e.receiver,e.value)},O.prototype._settlePromise0=function(e,t,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,e,i,t)},O.prototype._clearCallbackDataAtIndex=function(e){var t=e*4-4;this[t+2]=this[t+3]=this[t+0]=this[t+1]=void 0},O.prototype._fulfill=function(t){var n=this._bitField;if(!((n&117506048)>>>16)){if(t===this){var r=e();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=t,(n&65535)>0&&(n&134217728?this._settlePromises():u.settlePromises(this))}},O.prototype._reject=function(e){var t=this._bitField;if(!((t&117506048)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return u.fatalError(e,o.isNode);(t&65535)>0?u.settlePromises(this):this._ensurePossibleRejectionHandled()}},O.prototype._fulfillPromises=function(e,t){for(var n=1;n<e;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),a=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,a,t)}},O.prototype._rejectPromises=function(e,t){for(var n=1;n<e;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),a=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,a,t)}},O.prototype._settlePromises=function(){var e=this._bitField,t=e&65535;if(t>0){if(e&16842752){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,e),this._rejectPromises(t,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,e),this._fulfillPromises(t,r)}this._setLength(0)}this._clearCancellationData()},O.prototype._settledValue=function(){var e=this._bitField;if(e&33554432)return this._rejectionHandler0;if(e&16777216)return this._fulfillmentHandler0};function k(e){this.promise._resolveCallback(e)}function A(e){this.promise._rejectCallback(e,!1)}O.defer=O.pending=function(){return x.deprecated(`Promise.defer`,`new Promise`),{promise:new O(m),resolve:k,reject:A}},o.notEnumerableProp(O,`_makeSelfResolutionError`,e),XH()(O,m,_,r,x),ZH()(O,m,_,x),QH()(O,v,r,x),$H()(O),eU()(O),tU()(O,v,_,m,u,s),O.Promise=O,O.version=`3.4.7`,nU()(O,v,r,_,m,x),rU()(O),iU()(O,r,_,b,m,x),aU()(O,m,x),oU()(O,r,m,_,i,x),sU()(O),cU()(O,m),lU()(O,v,_,r),uU()(O,m,_,r),dU()(O,v,r,_,m,x),fU()(O,v,x),pU()(O,v,r),mU()(O,m),hU()(O,m),gU()(O),o.toFastProperties(O),o.toFastProperties(O.prototype);function j(e){var t=new O(m);t._fulfillmentHandler0=e,t._rejectionHandler0=e,t._promise0=e,t._receiver0=e}return j({a:1}),j({b:2}),j({c:3}),j(1),j(function(){}),j(void 0),j(!1),j(new O(m)),x.setBounds(l.firstLineError,o.lastLineError),O}})),vU=s((e=>{var t=(IH(),d(FH)),n=_U()();e.defer=r,e.when=n.resolve,e.resolve=n.resolve,e.all=n.all,e.props=n.props,e.reject=n.reject,e.promisify=n.promisify,e.mapSeries=n.mapSeries,e.attempt=n.attempt,e.nfcall=function(e){var t=Array.prototype.slice.call(arguments,1);return n.promisify(e).apply(null,t)},n.prototype.fail=n.prototype.caught,n.prototype.also=function(e){return this.then(function(r){var i=t.extend({},r,e(r));return n.props(i)})};function r(){var e,t,r=new n.Promise(function(n,r){e=n,t=r});return{resolve:e,reject:t,promise:r}}})),yU=s((e=>{var t=(IH(),d(FH)),n=e.types={document:`document`,paragraph:`paragraph`,run:`run`,text:`text`,tab:`tab`,checkbox:`checkbox`,hyperlink:`hyperlink`,noteReference:`noteReference`,image:`image`,note:`note`,commentReference:`commentReference`,comment:`comment`,table:`table`,tableRow:`tableRow`,tableCell:`tableCell`,break:`break`,bookmarkStart:`bookmarkStart`};function r(e,t){return t||={},{type:n.document,children:e,notes:t.notes||new p({}),comments:t.comments||[]}}function i(e,t){t||={};var r=t.indent||{};return{type:n.paragraph,children:e,styleId:t.styleId||null,styleName:t.styleName||null,numbering:t.numbering||null,alignment:t.alignment||null,indent:{start:r.start||null,end:r.end||null,firstLine:r.firstLine||null,hanging:r.hanging||null}}}function a(e,t){return t||={},{type:n.run,children:e,styleId:t.styleId||null,styleName:t.styleName||null,isBold:!!t.isBold,isUnderline:!!t.isUnderline,isItalic:!!t.isItalic,isStrikethrough:!!t.isStrikethrough,isAllCaps:!!t.isAllCaps,isSmallCaps:!!t.isSmallCaps,verticalAlignment:t.verticalAlignment||o.baseline,font:t.font||null,fontSize:t.fontSize||null,highlight:t.highlight||null}}var o={baseline:`baseline`,superscript:`superscript`,subscript:`subscript`};function s(e){return{type:n.text,value:e}}function c(){return{type:n.tab}}function l(e){return{type:n.checkbox,checked:e.checked}}function u(e,t){return{type:n.hyperlink,children:e,href:t.href,anchor:t.anchor,targetFrame:t.targetFrame}}function f(e){return{type:n.noteReference,noteType:e.noteType,noteId:e.noteId}}function p(e){this._notes=t.indexBy(e,function(e){return _(e.noteType,e.noteId)})}p.prototype.resolve=function(e){return this.findNoteByKey(_(e.noteType,e.noteId))},p.prototype.findNoteByKey=function(e){return this._notes[e]||null};function m(e){return{type:n.note,noteType:e.noteType,noteId:e.noteId,body:e.body}}function h(e){return{type:n.commentReference,commentId:e.commentId}}function g(e){return{type:n.comment,commentId:e.commentId,body:e.body,authorName:e.authorName,authorInitials:e.authorInitials}}function _(e,t){return e+`-`+t}function v(e){return{type:n.image,read:function(t){return t?e.readImage(t):e.readImage().then(function(e){return Buffer.from(e)})},readAsArrayBuffer:function(){return e.readImage()},readAsBase64String:function(){return e.readImage(`base64`)},readAsBuffer:function(){return e.readImage().then(function(e){return Buffer.from(e)})},altText:e.altText,contentType:e.contentType}}function y(e,t){return t||={},{type:n.table,children:e,styleId:t.styleId||null,styleName:t.styleName||null}}function b(e,t){return t||={},{type:n.tableRow,children:e,isHeader:t.isHeader||!1}}function x(e,t){return t||={},{type:n.tableCell,children:e,colSpan:t.colSpan==null?1:t.colSpan,rowSpan:t.rowSpan==null?1:t.rowSpan}}function S(e){return{type:n.break,breakType:e}}function C(e){return{type:n.bookmarkStart,name:e.name}}e.document=e.Document=r,e.paragraph=e.Paragraph=i,e.run=e.Run=a,e.text=e.Text=s,e.tab=e.Tab=c,e.checkbox=e.Checkbox=l,e.Hyperlink=u,e.noteReference=e.NoteReference=f,e.Notes=p,e.Note=m,e.commentReference=h,e.comment=g,e.Image=v,e.Table=y,e.TableRow=b,e.TableCell=x,e.lineBreak=S(`line`),e.pageBreak=S(`page`),e.columnBreak=S(`column`),e.BookmarkStart=C,e.verticalAlignment=o})),bU=s((e=>{var t=(IH(),d(FH));e.Result=n,e.success=r,e.warning=i,e.error=a;function n(e,t){this.value=e,this.messages=t||[]}n.prototype.map=function(e){return new n(e(this.value),this.messages)},n.prototype.flatMap=function(e){var t=e(this.value);return new n(t.value,o([this,t]))},n.prototype.flatMapThen=function(e){var t=this;return e(this.value).then(function(e){return new n(e.value,o([t,e]))})},n.combine=function(e){return new n(t.flatten(t.pluck(e,`value`)),o(e))};function r(e){return new n(e,[])}function i(e){return{type:`warning`,message:e}}function a(e){return{type:`error`,message:e.message,error:e}}function o(e){var n=[];return t.flatten(t.pluck(e,`messages`),!0).forEach(function(e){s(n,e)||n.push(e)}),n}function s(e,n){return t.find(e,c.bind(null,n))!==void 0}function c(e,t){return e.type===t.type&&e.message===t.message}})),xU=s((e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;for(var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),SU=s(((e,t)=>{(function(n){typeof e==`object`&&t!==void 0?t.exports=n():typeof define==`function`&&define.amd?define([],n):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).JSZip=n()})(function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof require==`function`&&require;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var l=Error(`Cannot find module '`+o+`'`);throw l.code=`MODULE_NOT_FOUND`,l}var u=n[o]={exports:{}};t[o][0].call(u.exports,function(e){var n=t[o][1][e];return i(n||e)},u,u.exports,e,t,n,r)}return n[o].exports}for(var a=typeof require==`function`&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){"use strict";var r=e(`./utils`),i=e(`./support`),a=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`;n.encode=function(e){for(var t,n,i,o,s,c,l,u=[],d=0,f=e.length,p=f,m=r.getTypeOf(e)!==`string`;d<e.length;)p=f-d,i=m?(t=e[d++],n=d<f?e[d++]:0,d<f?e[d++]:0):(t=e.charCodeAt(d++),n=d<f?e.charCodeAt(d++):0,d<f?e.charCodeAt(d++):0),o=t>>2,s=(3&t)<<4|n>>4,c=1<p?(15&n)<<2|i>>6:64,l=2<p?63&i:64,u.push(a.charAt(o)+a.charAt(s)+a.charAt(c)+a.charAt(l));return u.join(``)},n.decode=function(e){var t,n,r,o,s,c,l=0,u=0,d=`data:`;if(e.substr(0,d.length)===d)throw Error(`Invalid base64 input, it looks like a data url.`);var f,p=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,``)).length/4;if(e.charAt(e.length-1)===a.charAt(64)&&p--,e.charAt(e.length-2)===a.charAt(64)&&p--,p%1!=0)throw Error(`Invalid base64 input, bad content length.`);for(f=i.uint8array?new Uint8Array(0|p):Array(0|p);l<e.length;)t=a.indexOf(e.charAt(l++))<<2|(o=a.indexOf(e.charAt(l++)))>>4,n=(15&o)<<4|(s=a.indexOf(e.charAt(l++)))>>2,r=(3&s)<<6|(c=a.indexOf(e.charAt(l++))),f[u++]=t,s!==64&&(f[u++]=n),c!==64&&(f[u++]=r);return f}},{"./support":30,"./utils":32}],2:[function(e,t,n){"use strict";var r=e(`./external`),i=e(`./stream/DataWorker`),a=e(`./stream/Crc32Probe`),o=e(`./stream/DataLengthProbe`);function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(`data_length`)),t=this;return e.on(`end`,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error(`Bug : uncompressed data size mismatch`)}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo(`compressedSize`,this.compressedSize).withStreamInfo(`uncompressedSize`,this.uncompressedSize).withStreamInfo(`crc32`,this.crc32).withStreamInfo(`compression`,this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new o(`uncompressedSize`)).pipe(t.compressWorker(n)).pipe(new o(`compressedSize`)).withStreamInfo(`compression`,t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){"use strict";var r=e(`./stream/GenericWorker`);n.STORE={magic:`\0\0`,compressWorker:function(){return new r(`STORE compression`)},uncompressWorker:function(){return new r(`STORE decompression`)}},n.DEFLATE=e(`./flate`)},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){"use strict";var r=e(`./utils`),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return e!==void 0&&e.length?r.getTypeOf(e)===`string`?function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s<o;s++)e=e>>>8^a[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s<o;s++)e=e>>>8^a[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){"use strict";var r=null;r=typeof Promise<`u`?Promise:e(`lie`),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){"use strict";var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Uint32Array<`u`,i=e(`pako`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=r?`uint8array`:`array`;function c(e,t){o.call(this,`FlateWorker/`+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic=`\b\0`,a.inherits(c,o),c.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(s,e.data),!1)},c.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c(`Deflate`,e)},n.uncompressWorker=function(){return new c(`Inflate`,{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){"use strict";function r(e,t){var n,r=``;for(n=0;n<t;n++)r+=String.fromCharCode(255&e),e>>>=8;return r}function i(e,t,n,i,o,u){var d,f,p=e.file,m=e.compression,h=u!==s.utf8encode,g=a.transformTo(`string`,u(p.name)),_=a.transformTo(`string`,s.utf8encode(p.name)),v=p.comment,y=a.transformTo(`string`,u(v)),b=a.transformTo(`string`,s.utf8encode(v)),x=_.length!==p.name.length,S=b.length!==v.length,C=``,w=``,T=``,E=p.dir,D=p.date,O={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(O.crc32=e.crc32,O.compressedSize=e.compressedSize,O.uncompressedSize=e.uncompressedSize);var k=0;t&&(k|=8),h||!x&&!S||(k|=2048);var A=0,j=0;E&&(A|=16),o===`UNIX`?(j=798,A|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,E)):(j=20,A|=function(e){return 63&(e||0)}(p.dosPermissions)),d=D.getUTCHours(),d<<=6,d|=D.getUTCMinutes(),d<<=5,d|=D.getUTCSeconds()/2,f=D.getUTCFullYear()-1980,f<<=4,f|=D.getUTCMonth()+1,f<<=5,f|=D.getUTCDate(),x&&(w=r(1,1)+r(c(g),4)+_,C+=`up`+r(w.length,2)+w),S&&(T=r(1,1)+r(c(y),4)+b,C+=`uc`+r(T.length,2)+T);var M=``;return M+=`
|
|
454
|
+
\0`,M+=r(k,2),M+=m.magic,M+=r(d,2),M+=r(f,2),M+=r(O.crc32,4),M+=r(O.compressedSize,4),M+=r(O.uncompressedSize,4),M+=r(g.length,2),M+=r(C.length,2),{fileRecord:l.LOCAL_FILE_HEADER+M+g+C,dirRecord:l.CENTRAL_FILE_HEADER+r(j,2)+M+r(y.length,2)+`\0\0\0\0`+r(A,4)+r(i,4)+g+C+y}}var a=e(`../utils`),o=e(`../stream/GenericWorker`),s=e(`../utf8`),c=e(`../crc32`),l=e(`../signature`);function u(e,t,n,r){o.call(this,`ZipFileWorker`),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(u,o),u.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return l.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var n=this.bytesWritten-e,i=function(e,t,n,i,o){var s=a.transformTo(`string`,o(i));return l.CENTRAL_DIRECTORY_END+`\0\0\0\0`+r(e,2)+r(e,2)+r(t,4)+r(n,4)+r(s.length,2)+s}(this.dirRecords.length,n,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},u.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},u.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on(`data`,function(e){t.processChunk(e)}),e.on(`end`,function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on(`error`,function(e){t.error(e)}),this},u.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},u.prototype.error=function(e){var t=this._sources;if(!o.prototype.error.call(this,e))return!1;for(var n=0;n<t.length;n++)try{t[n].error(e)}catch{}return!0},u.prototype.lock=function(){o.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=u},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,n){"use strict";var r=e(`../compressions`),i=e(`./ZipFileWorker`);n.generateWorker=function(e,t,n){var a=new i(t.streamFiles,n,t.platform,t.encodeFileName),o=0;try{e.forEach(function(e,n){o++;var i=function(e,t){var n=e||t,i=r[n];if(!i)throw Error(n+` is not a valid compression method !`);return i}(n.options.compression,t.compression),s=n.options.compressionOptions||t.compressionOptions||{},c=n.dir,l=n.date;n._compressWorker(i,s).withStreamInfo(`file`,{name:e,dir:c,date:l,comment:n.comment||``,unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(a)}),a.entriesCount=o}catch(e){a.error(e)}return a}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,n){"use strict";function r(){if(!(this instanceof r))return new r;if(arguments.length)throw 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 e=new r;for(var t in this)typeof this[t]!=`function`&&(e[t]=this[t]);return e}}(r.prototype=e(`./object`)).loadAsync=e(`./load`),r.support=e(`./support`),r.defaults=e(`./defaults`),r.version=`3.10.1`,r.loadAsync=function(e,t){return new r().loadAsync(e,t)},r.external=e(`./external`),t.exports=r},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,n){"use strict";var r=e(`./utils`),i=e(`./external`),a=e(`./utf8`),o=e(`./zipEntries`),s=e(`./stream/Crc32Probe`),c=e(`./nodejsUtils`);function l(e){return new i.Promise(function(t,n){var r=e.decompressed.getContentWorker().pipe(new s);r.on(`error`,function(e){n(e)}).on(`end`,function(){r.streamInfo.crc32===e.decompressed.crc32?t():n(Error(`Corrupted zip : CRC32 mismatch`))}).resume()})}t.exports=function(e,t){var n=this;return t=r.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),c.isNode&&c.isStream(e)?i.Promise.reject(Error(`JSZip can't accept a stream when loading a zip file.`)):r.prepareContent(`the loaded zip file`,e,!0,t.optimizedBinaryString,t.base64).then(function(e){var n=new o(t);return n.load(e),n}).then(function(e){var n=[i.Promise.resolve(e)],r=e.files;if(t.checkCRC32)for(var a=0;a<r.length;a++)n.push(l(r[a]));return i.Promise.all(n)}).then(function(e){for(var i=e.shift(),a=i.files,o=0;o<a.length;o++){var s=a[o],c=s.fileNameStr,l=r.resolve(s.fileNameStr);n.file(l,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:t.createFolders}),s.dir||(n.file(l).unsafeOriginalName=c)}return i.zipComment.length&&(n.comment=i.zipComment),n})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`../stream/GenericWorker`);function a(e,t){i.call(this,`Nodejs stream input adapter for `+e),this._upstreamEnded=!1,this._bindStream(t)}r.inherits(a,i),a.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on(`data`,function(e){t.push({data:e,meta:{percent:0}})}).on(`error`,function(e){t.isPaused?this.generatedError=e:t.error(e)}).on(`end`,function(){t.isPaused?t._upstreamEnded=!0:t.end()})},a.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,n){"use strict";var r=e(`readable-stream`).Readable;function i(e,t,n){r.call(this,t),this._helper=e;var i=this;e.on(`data`,function(e,t){i.push(e)||i._helper.pause(),n&&n(t)}).on(`error`,function(e){i.emit(`error`,e)}).on(`end`,function(){i.push(null)})}e(`../utils`).inherits(i,r),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,t,n){"use strict";t.exports={isNode:typeof Buffer<`u`,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if(typeof e==`number`)throw Error(`The "data" argument must not be a number`);return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&typeof e.on==`function`&&typeof e.pause==`function`&&typeof e.resume==`function`}}},{}],15:[function(e,t,n){"use strict";function r(e,t,n){var r,i=a.getTypeOf(t),s=a.extend(n||{},c);s.date=s.date||new Date,s.compression!==null&&(s.compression=s.compression.toUpperCase()),typeof s.unixPermissions==`string`&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=h(e)),s.createFolders&&(r=m(e))&&g.call(this,r,!0);var d=i===`string`&&!1===s.binary&&!1===s.base64;n&&n.binary!==void 0||(s.binary=!d),(t instanceof l&&t.uncompressedSize===0||s.dir||!t||t.length===0)&&(s.base64=!1,s.binary=!0,t=``,s.compression=`STORE`,i=`string`);var _=null;_=t instanceof l||t instanceof o?t:f.isNode&&f.isStream(t)?new p(e,t):a.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var v=new u(e,_,s);this.files[e]=v}var i=e(`./utf8`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=e(`./stream/StreamHelper`),c=e(`./defaults`),l=e(`./compressedObject`),u=e(`./zipObject`),d=e(`./generate`),f=e(`./nodejsUtils`),p=e(`./nodejs/NodejsStreamInputAdapter`),m=function(e){e.slice(-1)===`/`&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf(`/`);return 0<t?e.substring(0,t):``},h=function(e){return e.slice(-1)!==`/`&&(e+=`/`),e},g=function(e,t){return t=t===void 0?c.createFolders:t,e=h(e),this.files[e]||r.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function _(e){return Object.prototype.toString.call(e)===`[object RegExp]`}t.exports={load:function(){throw Error(`This method has been removed in JSZip 3.0, please check the upgrade guide.`)},forEach:function(e){var t,n,r;for(t in this.files)r=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,r)},filter:function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(r)}),t},file:function(e,t,n){if(arguments.length!==1)return e=this.root+e,r.call(this,e,t,n),this;if(_(e)){var i=e;return this.filter(function(e,t){return!t.dir&&i.test(e)})}var a=this.files[this.root+e];return a&&!a.dir?a:null},folder:function(e){if(!e)return this;if(_(e))return this.filter(function(t,n){return n.dir&&e.test(t)});var t=this.root+e,n=g.call(this,t),r=this.clone();return r.root=n.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||=(e.slice(-1)!==`/`&&(e+=`/`),this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter(function(t,n){return n.name.slice(0,e.length)===e}),r=0;r<n.length;r++)delete this.files[n[r].name];return this},generate:function(){throw Error(`This method has been removed in JSZip 3.0, please check the upgrade guide.`)},generateInternalStream:function(e){var t,n={};try{if((n=a.extend(e||{},{streamFiles:!1,compression:`STORE`,compressionOptions:null,type:``,platform:`DOS`,comment:null,mimeType:`application/zip`,encodeFileName:i.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),n.type===`binarystring`&&(n.type=`string`),!n.type)throw Error(`No output type specified.`);a.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 r=n.comment||this.comment||``;t=d.generateWorker(this,n,r)}catch(e){(t=new o(`error`)).error(e)}return new s(t,n.type||`string`,n.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e||={}).type||(e.type=`nodebuffer`),this.generateInternalStream(e).toNodejsStream(t)}}},{"./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,t,n){"use strict";t.exports=e(`stream`)},{stream:void 0}],17:[function(e,t,n){"use strict";var r=e(`./DataReader`);function i(e){r.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),a=this.length-4;0<=a;--a)if(this.data[a]===t&&this.data[a+1]===n&&this.data[a+2]===r&&this.data[a+3]===i)return a-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&n===a[1]&&r===a[2]&&i===a[3]},i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,n){"use strict";var r=e(`../utils`);function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw Error(`End of data reached (data length = `+this.length+`, asked index = `+e+`). Corrupted zip ?`)},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,n=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo(`string`,this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){"use strict";var r=e(`./Uint8ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){"use strict";var r=e(`./DataReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){"use strict";var r=e(`./ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array;var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`../support`),a=e(`./ArrayReader`),o=e(`./StringReader`),s=e(`./NodeBufferReader`),c=e(`./Uint8ArrayReader`);t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),t!==`string`||i.uint8array?t===`nodebuffer`?new s(e):i.uint8array?new c(r.transformTo(`uint8array`,e)):new a(r.transformTo(`array`,e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){"use strict";n.LOCAL_FILE_HEADER=`PK`,n.CENTRAL_FILE_HEADER=`PK`,n.CENTRAL_DIRECTORY_END=`PK`,n.ZIP64_CENTRAL_DIRECTORY_LOCATOR=`PK\x07`,n.ZIP64_CENTRAL_DIRECTORY_END=`PK`,n.DATA_DESCRIPTOR=`PK\x07\b`},{}],24:[function(e,t,n){"use strict";var r=e(`./GenericWorker`),i=e(`../utils`);function a(e){r.call(this,`ConvertWorker to `+e),this.destType=e}i.inherits(a,r),a.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){"use strict";var r=e(`./GenericWorker`),i=e(`../crc32`);function a(){r.call(this,`Crc32Probe`),this.withStreamInfo(`crc32`,0)}e(`../utils`).inherits(a,r),a.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataLengthProbe for `+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(a,i),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataWorker`);var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=``,this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case`string`:e=this.data.substring(this.index,t);break;case`uint8array`:e=this.data.subarray(this.index,t);break;case`array`:case`nodebuffer`:e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){"use strict";function r(e){this.name=e||`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}r.prototype={push:function(e){this.emit(`data`,e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(`end`),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(`error`,e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(`error`,e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n<this._listeners[e].length;n++)this._listeners[e][n].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw Error(`The stream '`+this+`' has already been used.`);this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on(`data`,function(e){t.processChunk(e)}),e.on(`end`,function(){t.end()}),e.on(`error`,function(e){t.error(e)}),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 e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw Error(`The stream '`+this+`' has already been used.`);this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e=`Worker `+this.name;return this.previous?this.previous+` -> `+e:e}},t.exports=r},{}],29:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./ConvertWorker`),a=e(`./GenericWorker`),o=e(`../base64`),s=e(`../support`),c=e(`../external`),l=null;if(s.nodestream)try{l=e(`../nodejs/NodejsStreamOutputAdapter`)}catch{}function u(e,t){return new c.Promise(function(n,i){var a=[],s=e._internalType,c=e._outputType,l=e._mimeType;e.on(`data`,function(e,n){a.push(e),t&&t(n)}).on(`error`,function(e){a=[],i(e)}).on(`end`,function(){try{n(function(e,t,n){switch(e){case`blob`:return r.newBlob(r.transformTo(`arraybuffer`,t),n);case`base64`:return o.encode(t);default:return r.transformTo(e,t)}}(c,function(e,t){var n,r=0,i=null,a=0;for(n=0;n<t.length;n++)a+=t[n].length;switch(e){case`string`:return t.join(``);case`array`:return Array.prototype.concat.apply([],t);case`uint8array`:for(i=new Uint8Array(a),n=0;n<t.length;n++)i.set(t[n],r),r+=t[n].length;return i;case`nodebuffer`:return Buffer.concat(t);default:throw Error(`concat : unsupported type '`+e+`'`)}}(s,a),l))}catch(e){i(e)}a=[]}).resume()})}function d(e,t,n){var o=t;switch(t){case`blob`:case`arraybuffer`:o=`uint8array`;break;case`base64`:o=`string`}try{this._internalType=o,this._outputType=t,this._mimeType=n,r.checkSupport(o),this._worker=e.pipe(new i(o)),e.lock()}catch(e){this._worker=new a(`error`),this._worker.error(e)}}d.prototype={accumulate:function(e){return u(this,e)},on:function(e,t){var n=this;return e===`data`?this._worker.on(e,function(e){t.call(n,e.data,e.meta)}):this._worker.on(e,function(){r.delay(t,arguments,n)}),this},resume:function(){return r.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(r.checkSupport(`nodestream`),this._outputType!==`nodebuffer`)throw Error(this._outputType+` is not supported by this method`);return new l(this,{objectMode:this._outputType!==`nodebuffer`},e)}},t.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,n){"use strict";if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer=typeof ArrayBuffer<`u`&&typeof Uint8Array<`u`,n.nodebuffer=typeof Buffer<`u`,n.uint8array=typeof Uint8Array<`u`,typeof ArrayBuffer>`u`)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=new Blob([r],{type:`application/zip`}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=i.getBlob(`application/zip`).size===0}catch{n.blob=!1}}}try{n.nodestream=!!e(`readable-stream`).Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){"use strict";for(var r=e(`./utils`),i=e(`./support`),a=e(`./nodejsUtils`),o=e(`./stream/GenericWorker`),s=Array(256),c=0;c<256;c++)s[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;s[254]=s[254]=1;function l(){o.call(this,`utf-8 decode`),this.leftOver=null}function u(){o.call(this,`utf-8 encode`)}n.utf8encode=function(e){return i.nodebuffer?a.newBufferFrom(e,`utf-8`):function(e){var t,n,r,a,o,s=e.length,c=0;for(a=0;a<s;a++)(64512&(n=e.charCodeAt(a)))==55296&&a+1<s&&(64512&(r=e.charCodeAt(a+1)))==56320&&(n=65536+(n-55296<<10)+(r-56320),a++),c+=n<128?1:n<2048?2:n<65536?3:4;for(t=i.uint8array?new Uint8Array(c):Array(c),a=o=0;o<c;a++)(64512&(n=e.charCodeAt(a)))==55296&&a+1<s&&(64512&(r=e.charCodeAt(a+1)))==56320&&(n=65536+(n-55296<<10)+(r-56320),a++),n<128?t[o++]=n:(n<2048?t[o++]=192|n>>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo(`nodebuffer`,e).toString(`utf-8`):function(e){var t,n,i,a,o=e.length,c=Array(2*o);for(t=n=0;t<o;)if((i=e[t++])<128)c[n++]=i;else if(4<(a=s[i]))c[n++]=65533,t+=a-1;else{for(i&=a===2?31:a===3?15:7;1<a&&t<o;)i=i<<6|63&e[t++],a--;1<a?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),r.applyFromCharCode(c)}(e=r.transformTo(i.uint8array?`uint8array`:`array`,e))},r.inherits(l,o),l.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?`uint8array`:`array`,e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+s[e[n]]>t?n:t}(t),c=t;o!==t.length&&(i.uint8array?(c=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(c=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(c),meta:e.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=l,r.inherits(u,o),u.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){"use strict";var r=e(`./support`),i=e(`./base64`),a=e(`./nodejsUtils`),o=e(`./external`);function s(e){return e}function c(e,t){for(var n=0;n<e.length;++n)t[n]=255&e.charCodeAt(n);return t}e(`setimmediate`),n.newBlob=function(e,t){n.checkSupport(`blob`);try{return new Blob([e],{type:t})}catch{try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return r.append(e),r.getBlob(t)}catch{throw Error(`Bug : can't construct the Blob.`)}}};var l={stringifyByChunk:function(e,t,n){var r=[],i=0,a=e.length;if(a<=n)return String.fromCharCode.apply(null,e);for(;i<a;)t===`array`||t===`nodebuffer`?r.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+n,a)))):r.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+n,a)))),i+=n;return r.join(``)},stringifyByChar:function(e){for(var t=``,n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},applyCanBeUsed:{uint8array:function(){try{return r.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return r.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}}()}};function u(e){var t=65536,r=n.getTypeOf(e),i=!0;if(r===`uint8array`?i=l.applyCanBeUsed.uint8array:r===`nodebuffer`&&(i=l.applyCanBeUsed.nodebuffer),i)for(;1<t;)try{return l.stringifyByChunk(e,r,t)}catch{t=Math.floor(t/2)}return l.stringifyByChar(e)}function d(e,t){for(var n=0;n<e.length;n++)t[n]=e[n];return t}n.applyFromCharCode=u;var f={};f.string={string:s,array:function(e){return c(e,Array(e.length))},arraybuffer:function(e){return f.string.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:function(e){return c(e,a.allocBuffer(e.length))}},f.array={string:u,array:s,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return a.newBufferFrom(e)}},f.arraybuffer={string:function(e){return u(new Uint8Array(e))},array:function(e){return d(new Uint8Array(e),Array(e.byteLength))},arraybuffer:s,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return a.newBufferFrom(new Uint8Array(e))}},f.uint8array={string:u,array:function(e){return d(e,Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:s,nodebuffer:function(e){return a.newBufferFrom(e)}},f.nodebuffer={string:u,array:function(e){return d(e,Array(e.length))},arraybuffer:function(e){return f.nodebuffer.uint8array(e).buffer},uint8array:function(e){return d(e,new Uint8Array(e.length))},nodebuffer:s},n.transformTo=function(e,t){return t||=``,e?(n.checkSupport(e),f[n.getTypeOf(t)][e](t)):t},n.resolve=function(e){for(var t=e.split(`/`),n=[],r=0;r<t.length;r++){var i=t[r];i===`.`||i===``&&r!==0&&r!==t.length-1||(i===`..`?n.pop():n.push(i))}return n.join(`/`)},n.getTypeOf=function(e){return typeof e==`string`?`string`:Object.prototype.toString.call(e)===`[object Array]`?`array`:r.nodebuffer&&a.isBuffer(e)?`nodebuffer`:r.uint8array&&e instanceof Uint8Array?`uint8array`:r.arraybuffer&&e instanceof ArrayBuffer?`arraybuffer`:void 0},n.checkSupport=function(e){if(!r[e.toLowerCase()])throw Error(e+` is not supported by this platform`)},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(e){var t,n,r=``;for(n=0;n<(e||``).length;n++)r+=`\\x`+((t=e.charCodeAt(n))<16?`0`:``)+t.toString(16).toUpperCase();return r},n.delay=function(e,t,n){setImmediate(function(){e.apply(n||null,t||[])})},n.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n},n.extend=function(){var e,t,n={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&n[t]===void 0&&(n[t]=arguments[e][t]);return n},n.prepareContent=function(e,t,a,s,l){return o.Promise.resolve(t).then(function(e){return r.blob&&(e instanceof Blob||[`[object File]`,`[object Blob]`].indexOf(Object.prototype.toString.call(e))!==-1)&&typeof FileReader<`u`?new o.Promise(function(t,n){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=function(e){n(e.target.error)},r.readAsArrayBuffer(e)}):e}).then(function(t){var u=n.getTypeOf(t);return u?(u===`arraybuffer`?t=n.transformTo(`uint8array`,t):u===`string`&&(l?t=i.decode(t):a&&!0!==s&&(t=function(e){return c(e,r.uint8array?new Uint8Array(e.length):Array(e.length))}(t))),t):o.Promise.reject(Error(`Can't read the data of '`+e+`'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?`))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,n){"use strict";var r=e(`./reader/readerFor`),i=e(`./utils`),a=e(`./signature`),o=e(`./zipEntry`),s=e(`./support`);function c(e){this.files=[],this.loadOptions=e}c.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw Error(`Corrupted zip or bug: unexpected signature (`+i.pretty(t)+`, expected `+i.pretty(e)+`)`)}},isSignature:function(e,t){var n=this.reader.index;this.reader.setIndex(e);var r=this.reader.readString(4)===t;return this.reader.setIndex(n),r},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 e=this.reader.readData(this.zipCommentLength),t=s.uint8array?`uint8array`:`array`,n=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(n)},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 e,t,n,r=this.zip64EndOfCentralSize-44;0<r;)e=this.reader.readInt(2),t=this.reader.readInt(4),n=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:n}},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 Error(`Multi-volumes zip are not supported`)},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(e=new o({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw Error(`Corrupted zip or bug: expected `+this.centralDirRecords+` records in central dir, got `+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?Error(`Corrupted zip: can't find end of central directory`):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(e);var t=e;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw Error(`Corrupted zip: can't find the ZIP64 end of central directory locator`);if(this.reader.setIndex(e),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw Error(`Corrupted zip: can't find the ZIP64 end of central directory`);this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var r=t-n;if(0<r)this.isSignature(t,a.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw Error(`Corrupted zip: missing `+Math.abs(r)+` bytes.`)},prepareReader:function(e){this.reader=r(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=c},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,t,n){"use strict";var r=e(`./reader/readerFor`),i=e(`./utils`),a=e(`./compressedObject`),o=e(`./crc32`),s=e(`./utf8`),c=e(`./compressions`),l=e(`./support`);function u(e,t){this.options=e,this.loadOptions=t}u.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),this.compressedSize===-1||this.uncompressedSize===-1)throw Error(`Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)`);if((t=function(e){for(var t in c)if(Object.prototype.hasOwnProperty.call(c,t)&&c[t].magic===e)return c[t];return null}(this.compressionMethod))===null)throw Error(`Corrupted zip : compression `+i.pretty(this.compressionMethod)+` unknown (inner file : `+i.transformTo(`string`,this.fileName)+`)`);this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw Error(`Encrypted zip are not supported`);e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),e==0&&(this.dosPermissions=63&this.externalFileAttributes),e==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!==`/`||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||={};e.index+4<i;)t=e.readInt(2),n=e.readInt(2),r=e.readData(n),this.extraFields[t]={id:t,length:n,value:r};e.setIndex(i)},handleUTF8:function(){var e=l.uint8array?`uint8array`:`array`;if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(t!==null)this.fileNameStr=t;else{var n=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var r=this.findExtraFieldUnicodeComment();if(r!==null)this.fileCommentStr=r;else{var a=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(a)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=r(e.value);return t.readInt(1)===1&&o(this.fileName)===t.readInt(4)?s.utf8decode(t.readData(e.length-5)):null}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=r(e.value);return t.readInt(1)===1&&o(this.fileComment)===t.readInt(4)?s.utf8decode(t.readData(e.length-5)):null}return null}},t.exports=u},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,n){"use strict";function r(e,t,n){this.name=e,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=t,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}}var i=e(`./stream/StreamHelper`),a=e(`./stream/DataWorker`),o=e(`./utf8`),s=e(`./compressedObject`),c=e(`./stream/GenericWorker`);r.prototype={internalStream:function(e){var t=null,n=`string`;try{if(!e)throw Error(`No output type specified.`);var r=(n=e.toLowerCase())===`string`||n===`text`;n!==`binarystring`&&n!==`text`||(n=`string`),t=this._decompressWorker();var a=!this._dataBinary;a&&!r&&(t=t.pipe(new o.Utf8EncodeWorker)),!a&&r&&(t=t.pipe(new o.Utf8DecodeWorker))}catch(e){(t=new c(`error`)).error(e)}return new i(t,n,``)},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||`nodebuffer`).toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof s&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new o.Utf8EncodeWorker)),s.createWorkerFrom(n,e,t)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof c?this._data:new a(this._data)}};for(var l=[`asText`,`asBinary`,`asNodeBuffer`,`asUint8Array`,`asArrayBuffer`],u=function(){throw Error(`This method has been removed in JSZip 3.0, please check the upgrade guide.`)},d=0;d<l.length;d++)r.prototype[l[d]]=u;t.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,n){(function(e){"use strict";var n,r,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var a=0,o=new i(u),s=e.document.createTextNode(``);o.observe(s,{characterData:!0}),n=function(){s.data=a=++a%2}}else if(e.setImmediate||e.MessageChannel===void 0)n=`document`in e&&`onreadystatechange`in e.document.createElement(`script`)?function(){var t=e.document.createElement(`script`);t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var c=new e.MessageChannel;c.port1.onmessage=u,n=function(){c.port2.postMessage(0)}}var l=[];function u(){var e,t;r=!0;for(var n=l.length;n;){for(t=l,l=[],e=-1;++e<n;)t[e]();n=l.length}r=!1}t.exports=function(e){l.push(e)!==1||r||n()}}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}],37:[function(e,t,n){"use strict";var r=e(`immediate`);function i(){}var a={},o=[`REJECTED`],s=[`FULFILLED`],c=[`PENDING`];function l(e){if(typeof e!=`function`)throw TypeError(`resolver must be a function`);this.state=c,this.queue=[],this.outcome=void 0,e!==i&&p(this,e)}function u(e,t,n){this.promise=e,typeof t==`function`&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),typeof n==`function`&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function d(e,t,n){r(function(){var r;try{r=t(n)}catch(t){return a.reject(e,t)}r===e?a.reject(e,TypeError(`Cannot resolve promise with itself`)):a.resolve(e,r)})}function f(e){var t=e&&e.then;if(e&&(typeof e==`object`||typeof e==`function`)&&typeof t==`function`)return function(){t.apply(e,arguments)}}function p(e,t){var n=!1;function r(t){n||(n=!0,a.reject(e,t))}function i(t){n||(n=!0,a.resolve(e,t))}var o=m(function(){t(i,r)});o.status===`error`&&r(o.value)}function m(e,t){var n={};try{n.value=e(t),n.status=`success`}catch(e){n.status=`error`,n.value=e}return n}(t.exports=l).prototype.finally=function(e){if(typeof e!=`function`)return this;var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){throw n})})},l.prototype.catch=function(e){return this.then(null,e)},l.prototype.then=function(e,t){if(typeof e!=`function`&&this.state===s||typeof t!=`function`&&this.state===o)return this;var n=new this.constructor(i);return this.state===c?this.queue.push(new u(n,e,t)):d(n,this.state===s?e:t,this.outcome),n},u.prototype.callFulfilled=function(e){a.resolve(this.promise,e)},u.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},u.prototype.callRejected=function(e){a.reject(this.promise,e)},u.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},a.resolve=function(e,t){var n=m(f,t);if(n.status===`error`)return a.reject(e,n.value);var r=n.value;if(r)p(e,r);else{e.state=s,e.outcome=t;for(var i=-1,o=e.queue.length;++i<o;)e.queue[i].callFulfilled(t)}return e},a.reject=function(e,t){e.state=o,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},l.resolve=function(e){return e instanceof this?e:a.resolve(new this(i),e)},l.reject=function(e){var t=new this(i);return a.reject(t,e)},l.all=function(e){var t=this;if(Object.prototype.toString.call(e)!==`[object Array]`)return this.reject(TypeError(`must be an array`));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=Array(n),s=0,c=-1,l=new this(i);++c<n;)u(e[c],c);return l;function u(e,i){t.resolve(e).then(function(e){o[i]=e,++s!==n||r||(r=!0,a.resolve(l,o))},function(e){r||(r=!0,a.reject(l,e))})}},l.race=function(e){var t=this;if(Object.prototype.toString.call(e)!==`[object Array]`)return this.reject(TypeError(`must be an array`));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=-1,s=new this(i);++o<n;)c=e[o],t.resolve(c).then(function(e){r||(r=!0,a.resolve(s,e))},function(e){r||(r=!0,a.reject(s,e))});var c;return s}},{immediate:36}],38:[function(e,t,n){"use strict";var r={};(0,e(`./lib/utils/common`).assign)(r,e(`./lib/deflate`),e(`./lib/inflate`),e(`./lib/zlib/constants`)),t.exports=r},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,n){"use strict";var r=e(`./zlib/deflate`),i=e(`./utils/common`),a=e(`./utils/strings`),o=e(`./zlib/messages`),s=e(`./zlib/zstream`),c=Object.prototype.toString,l=0,u=-1,d=0,f=8;function p(e){if(!(this instanceof p))return new p(e);this.options=i.assign({level:u,method:f,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:``},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==l)throw Error(o[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var m;if(m=typeof t.dictionary==`string`?a.string2buf(t.dictionary):c.call(t.dictionary)===`[object ArrayBuffer]`?new Uint8Array(t.dictionary):t.dictionary,(n=r.deflateSetDictionary(this.strm,m))!==l)throw Error(o[n]);this._dict_set=!0}}function m(e,t){var n=new p(t);if(n.push(e,!0),n.err)throw n.msg||o[n.err];return n.result}p.prototype.push=function(e,t){var n,o,s=this.strm,u=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,typeof e==`string`?s.input=a.string2buf(e):c.call(e)===`[object ArrayBuffer]`?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(s.avail_out===0&&(s.output=new i.Buf8(u),s.next_out=0,s.avail_out=u),(n=r.deflate(s,o))!==1&&n!==l)return this.onEnd(n),!(this.ended=!0);s.avail_out!==0&&(s.avail_in!==0||o!==4&&o!==2)||(this.options.to===`string`?this.onData(a.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||s.avail_out===0)&&n!==1);return o===4?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===l):o!==2||(this.onEnd(l),!(s.avail_out=0))},p.prototype.onData=function(e){this.chunks.push(e)},p.prototype.onEnd=function(e){e===l&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=p,n.deflate=m,n.deflateRaw=function(e,t){return(t||={}).raw=!0,m(e,t)},n.gzip=function(e,t){return(t||={}).gzip=!0,m(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,n){"use strict";var r=e(`./zlib/inflate`),i=e(`./utils/common`),a=e(`./utils/strings`),o=e(`./zlib/constants`),s=e(`./zlib/messages`),c=e(`./zlib/zstream`),l=e(`./zlib/gzheader`),u=Object.prototype.toString;function d(e){if(!(this instanceof d))return new d(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:``},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==o.Z_OK)throw Error(s[n]);this.header=new l,r.inflateGetHeader(this.strm,this.header)}function f(e,t){var n=new d(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}d.prototype.push=function(e,t){var n,s,c,l,d,f,p=this.strm,m=this.options.chunkSize,h=this.options.dictionary,g=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,typeof e==`string`?p.input=a.binstring2buf(e):u.call(e)===`[object ArrayBuffer]`?p.input=new Uint8Array(e):p.input=e,p.next_in=0,p.avail_in=p.input.length;do{if(p.avail_out===0&&(p.output=new i.Buf8(m),p.next_out=0,p.avail_out=m),(n=r.inflate(p,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&h&&(f=typeof h==`string`?a.string2buf(h):u.call(h)===`[object ArrayBuffer]`?new Uint8Array(h):h,n=r.inflateSetDictionary(this.strm,f)),n===o.Z_BUF_ERROR&&!0===g&&(n=o.Z_OK,g=!1),n!==o.Z_STREAM_END&&n!==o.Z_OK)return this.onEnd(n),!(this.ended=!0);p.next_out&&(p.avail_out!==0&&n!==o.Z_STREAM_END&&(p.avail_in!==0||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||(this.options.to===`string`?(c=a.utf8border(p.output,p.next_out),l=p.next_out-c,d=a.buf2string(p.output,c),p.next_out=l,p.avail_out=m-l,l&&i.arraySet(p.output,p.output,c,l,0),this.onData(d)):this.onData(i.shrinkBuf(p.output,p.next_out)))),p.avail_in===0&&p.avail_out===0&&(g=!0)}while((0<p.avail_in||p.avail_out===0)&&n!==o.Z_STREAM_END);return n===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(p.avail_out=0))},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===o.Z_OK&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=d,n.inflate=f,n.inflateRaw=function(e,t){return(t||={}).raw=!0,f(e,t)},n.ungzip=f},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,n){"use strict";var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Int32Array<`u`;n.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if(typeof n!=`object`)throw TypeError(n+`must be non-object`);for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r,i,a,o;for(t=r=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),t=i=0,n=e.length;t<n;t++)a=e[t],o.set(a,i),i+=a.length;return o}},a={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,a))},n.setTyped(r)},{}],42:[function(e,t,n){"use strict";var r=e(`./common`),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var o=new r.Buf8(256),s=0;s<256;s++)o[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function c(e,t){if(t<65537&&(e.subarray&&a||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n=``,o=0;o<t;o++)n+=String.fromCharCode(e[o]);return n}o[254]=o[254]=1,n.string2buf=function(e){var t,n,i,a,o,s=e.length,c=0;for(a=0;a<s;a++)(64512&(n=e.charCodeAt(a)))==55296&&a+1<s&&(64512&(i=e.charCodeAt(a+1)))==56320&&(n=65536+(n-55296<<10)+(i-56320),a++),c+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(c),a=o=0;o<c;a++)(64512&(n=e.charCodeAt(a)))==55296&&a+1<s&&(64512&(i=e.charCodeAt(a+1)))==56320&&(n=65536+(n-55296<<10)+(i-56320),a++),n<128?t[o++]=n:(n<2048?t[o++]=192|n>>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,r,i,a,s=t||e.length,l=Array(2*s);for(n=r=0;n<s;)if((i=e[n++])<128)l[r++]=i;else if(4<(a=o[i]))l[r++]=65533,n+=a-1;else{for(i&=a===2?31:a===3?15:7;1<a&&n<s;)i=i<<6|63&e[n++],a--;1<a?l[r++]=65533:i<65536?l[r++]=i:(i-=65536,l[r++]=55296|i>>10&1023,l[r++]=56320|1023&i)}return c(l,r)},n.utf8border=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;n!==0;){for(n-=o=2e3<n?2e3:n;a=a+(i=i+t[r++]|0)|0,--o;);i%=65521,a%=65521}return i|a<<16|0}},{}],44:[function(e,t,n){"use strict";t.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,t,n){"use strict";var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s<o;s++)e=e>>>8^a[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){"use strict";var r,i=e(`../utils/common`),a=e(`./trees`),o=e(`./adler32`),s=e(`./crc32`),c=e(`./messages`),l=0,u=4,d=0,f=-2,p=-1,m=4,h=2,g=8,_=9,v=286,y=30,b=19,x=2*v+1,S=15,C=3,w=258,T=w+C+1,E=42,D=113,O=1,k=2,A=3,j=4;function M(e,t){return e.msg=c[t],t}function N(e){return(e<<1)-(4<e?9:0)}function P(e){for(var t=e.length;0<=--t;)e[t]=0}function F(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function I(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,F(e.strm)}function L(e,t){e.pending_buf[e.pending++]=t}function R(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function z(e,t){var n,r,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-T?e.strstart-(e.w_size-T):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+w,p=l[a+o-1],m=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do if(l[(n=t)+o]===m&&l[n+o-1]===p&&l[n]===l[a]&&l[++n]===l[a+1]){a+=2,n++;do;while(l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&a<f);if(r=w-(f-a),a=f-w,o<r){if(e.match_start=t,s<=(o=r))break;p=l[a+o-1],m=l[a+o]}}while((t=d[t&u])>c&&--i!=0);return o<=e.lookahead?o:e.lookahead}function B(e){var t,n,r,a,c,l,u,d,f,p,m=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-T)){for(i.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=n=e.hash_size;r=e.head[--t],e.head[t]=m<=r?r-m:0,--n;);for(t=n=m;r=e.prev[--t],e.prev[t]=m<=r?r-m:0,--n;);a+=m}if(e.strm.avail_in===0)break;if(l=e.strm,u=e.window,d=e.strstart+e.lookahead,f=a,p=void 0,p=l.avail_in,f<p&&(p=f),n=p===0?0:(l.avail_in-=p,i.arraySet(u,l.input,l.next_in,p,d),l.state.wrap===1?l.adler=o(l.adler,u,p,d):l.state.wrap===2&&(l.adler=s(l.adler,u,p,d)),l.next_in+=p,l.total_in+=p,p),e.lookahead+=n,e.lookahead+e.insert>=C)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<<e.hash_shift^e.window[c+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[c+C-1])&e.hash_mask,e.prev[c&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=c,c++,e.insert--,!(e.lookahead+e.insert<C)););}while(e.lookahead<T&&e.strm.avail_in!==0)}function ee(e,t){for(var n,r;;){if(e.lookahead<T){if(B(e),e.lookahead<T&&t===l)return O;if(e.lookahead===0)break}if(n=0,e.lookahead>=C&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+C-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-T&&(e.match_length=z(e,n)),e.match_length>=C)if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-C),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=C){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+C-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,--e.match_length!=0;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=e.strstart<C-1?e.strstart:C-1,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}function te(e,t){for(var n,r,i;;){if(e.lookahead<T){if(B(e),e.lookahead<T&&t===l)return O;if(e.lookahead===0)break}if(n=0,e.lookahead>=C&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+C-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=C-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-T&&(e.match_length=z(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===C&&4096<e.strstart-e.match_start)&&(e.match_length=C-1)),e.prev_length>=C&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-C,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-C),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+C-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),--e.prev_length!=0;);if(e.match_available=0,e.match_length=C-1,e.strstart++,r&&(I(e,!1),e.strm.avail_out===0))return O}else if(e.match_available){if((r=a._tr_tally(e,0,e.window[e.strstart-1]))&&I(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return O}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=a._tr_tally(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<C-1?e.strstart:C-1,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}function ne(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function re(){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=g,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 i.Buf16(2*x),this.dyn_dtree=new i.Buf16(2*(2*y+1)),this.bl_tree=new i.Buf16(2*(2*b+1)),P(this.dyn_ltree),P(this.dyn_dtree),P(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(S+1),this.heap=new i.Buf16(2*v+1),P(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*v+1),P(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 ie(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=h,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?E:D,e.adler=t.wrap===2?0:1,t.last_flush=l,a._tr_init(t),d):M(e,f)}function V(e){var t=ie(e);return t===d&&function(e){e.window_size=2*e.w_size,P(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=C-1,e.match_available=0,e.ins_h=0}(e.state),t}function H(e,t,n,r,a,o){if(!e)return f;var s=1;if(t===p&&(t=6),r<0?(s=0,r=-r):15<r&&(s=2,r-=16),a<1||_<a||n!==g||r<8||15<r||t<0||9<t||o<0||m<o)return M(e,f);r===8&&(r=9);var c=new re;return(e.state=c).strm=e,c.wrap=s,c.gzhead=null,c.w_bits=r,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=a+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+C-1)/C),c.window=new i.Buf8(2*c.w_size),c.head=new i.Buf16(c.hash_size),c.prev=new i.Buf16(c.w_size),c.lit_bufsize=1<<a+6,c.pending_buf_size=4*c.lit_bufsize,c.pending_buf=new i.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=t,c.strategy=o,c.method=n,V(e)}r=[new ne(0,0,0,0,function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(B(e),e.lookahead===0&&t===l)return O;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,I(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(I(e,!1),e.strm.avail_out),O)}),new ne(4,4,8,4,ee),new ne(4,5,16,8,ee),new ne(4,6,32,32,ee),new ne(4,4,16,16,te),new ne(8,16,32,32,te),new ne(8,16,128,128,te),new ne(8,32,128,256,te),new ne(32,128,258,1024,te),new ne(32,258,258,4096,te)],n.deflateInit=function(e,t){return H(e,t,g,15,8,0)},n.deflateInit2=H,n.deflateReset=V,n.deflateResetKeep=ie,n.deflateSetHeader=function(e,t){return e&&e.state&&e.state.wrap===2?(e.state.gzhead=t,d):f},n.deflate=function(e,t){var n,i,o,c;if(!e||!e.state||5<t||t<0)return e?M(e,f):f;if(i=e.state,!e.output||!e.input&&e.avail_in!==0||i.status===666&&t!==u)return M(e,e.avail_out===0?-5:f);if(i.strm=e,n=i.last_flush,i.last_flush=t,i.status===E)if(i.wrap===2)e.adler=0,L(i,31),L(i,139),L(i,8),i.gzhead?(L(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),L(i,255&i.gzhead.time),L(i,i.gzhead.time>>8&255),L(i,i.gzhead.time>>16&255),L(i,i.gzhead.time>>24&255),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(L(i,255&i.gzhead.extra.length),L(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(L(i,0),L(i,0),L(i,0),L(i,0),L(i,0),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(i,3),i.status=D);else{var p=g+(i.w_bits-8<<4)<<8;p|=(2<=i.strategy||i.level<2?0:i.level<6?1:i.level===6?2:3)<<6,i.strstart!==0&&(p|=32),p+=31-p%31,i.status=D,R(i,p),i.strstart!==0&&(R(i,e.adler>>>16),R(i,65535&e.adler)),e.adler=1}if(i.status===69)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending!==i.pending_buf_size));)L(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(i.status===73)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,L(i,c)}while(c!==0);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.gzindex=0,i.status=91)}else i.status=91;if(i.status===91)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,L(i,c)}while(c!==0);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.status=103)}else i.status=103;if(i.status===103&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&F(e),i.pending+2<=i.pending_buf_size&&(L(i,255&e.adler),L(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(F(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&N(t)<=N(n)&&t!==u)return M(e,-5);if(i.status===666&&e.avail_in!==0)return M(e,-5);if(e.avail_in!==0||i.lookahead!==0||t!==l&&i.status!==666){var m=i.strategy===2?function(e,t){for(var n;;){if(e.lookahead===0&&(B(e),e.lookahead===0)){if(t===l)return O;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}(i,t):i.strategy===3?function(e,t){for(var n,r,i,o,s=e.window;;){if(e.lookahead<=w){if(B(e),e.lookahead<=w&&t===l)return O;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=C&&0<e.strstart&&(r=s[i=e.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){o=e.strstart+w;do;while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<o);e.match_length=w-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=C?(n=a._tr_tally(e,1,e.match_length-C),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}(i,t):r[i.level].func(i,t);if(m!==A&&m!==j||(i.status=666),m===O||m===A)return e.avail_out===0&&(i.last_flush=-1),d;if(m===k&&(t===1?a._tr_align(i):t!==5&&(a._tr_stored_block(i,0,0,!1),t===3&&(P(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),F(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(L(i,255&e.adler),L(i,e.adler>>8&255),L(i,e.adler>>16&255),L(i,e.adler>>24&255),L(i,255&e.total_in),L(i,e.total_in>>8&255),L(i,e.total_in>>16&255),L(i,e.total_in>>24&255)):(R(i,e.adler>>>16),R(i,65535&e.adler)),F(e),0<i.wrap&&(i.wrap=-i.wrap),i.pending===0?1:d):d},n.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==E&&t!==69&&t!==73&&t!==91&&t!==103&&t!==D&&t!==666?M(e,f):(e.state=null,t===D?M(e,-3):d):f},n.deflateSetDictionary=function(e,t){var n,r,a,s,c,l,u,p,m=t.length;if(!e||!e.state||(s=(n=e.state).wrap)===2||s===1&&n.status!==E||n.lookahead)return f;for(s===1&&(e.adler=o(e.adler,t,m,0)),n.wrap=0,m>=n.w_size&&(s===0&&(P(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new i.Buf8(n.w_size),i.arraySet(p,t,m-n.w_size,n.w_size,0),t=p,m=n.w_size),c=e.avail_in,l=e.next_in,u=e.input,e.avail_in=m,e.next_in=0,e.input=t,B(n);n.lookahead>=C;){for(r=n.strstart,a=n.lookahead-(C-1);n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+C-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,--a;);n.strstart=r,n.lookahead=C-1,B(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=C-1,n.match_available=0,e.next_in=l,e.input=u,e.avail_in=c,n.wrap=s,d},n.deflateInfo=`pako deflate (from Nodeca project)`},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,n){"use strict";t.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,t,n){"use strict";t.exports=function(e,t){var n=e.state,r=e.next_in,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=e.input,E;i=r+(e.avail_in-5),a=e.next_out,E=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),c=n.dmax,l=n.wsize,u=n.whave,d=n.wnext,f=n.window,p=n.hold,m=n.bits,h=n.lencode,g=n.distcode,_=(1<<n.lenbits)-1,v=(1<<n.distbits)-1;e:do{m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=h[p&_];t:for(;;){if(p>>>=b=y>>>24,m-=b,(b=y>>>16&255)==0)E[a++]=65535&y;else{if(!(16&b)){if(!(64&b)){y=h[(65535&y)+(p&(1<<b)-1)];continue t}if(32&b){n.mode=12;break e}e.msg=`invalid literal/length code`,n.mode=30;break e}x=65535&y,(b&=15)&&(m<b&&(p+=T[r++]<<m,m+=8),x+=p&(1<<b)-1,p>>>=b,m-=b),m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=g[p&v];r:for(;;){if(p>>>=b=y>>>24,m-=b,!(16&(b=y>>>16&255))){if(!(64&b)){y=g[(65535&y)+(p&(1<<b)-1)];continue r}e.msg=`invalid distance code`,n.mode=30;break e}if(S=65535&y,m<(b&=15)&&(p+=T[r++]<<m,(m+=8)<b&&(p+=T[r++]<<m,m+=8)),c<(S+=p&(1<<b)-1)){e.msg=`invalid distance too far back`,n.mode=30;break e}if(p>>>=b,m-=b,(b=a-o)<S){if(u<(b=S-b)&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break e}if(w=f,(C=0)===d){if(C+=l-b,b<x){for(x-=b;E[a++]=f[C++],--b;);C=a-S,w=E}}else if(d<b){if(C+=l+d-b,(b-=d)<x){for(x-=b;E[a++]=f[C++],--b;);if(C=0,d<x){for(x-=b=d;E[a++]=f[C++],--b;);C=a-S,w=E}}}else if(C+=d-b,b<x){for(x-=b;E[a++]=f[C++],--b;);C=a-S,w=E}for(;2<x;)E[a++]=w[C++],E[a++]=w[C++],E[a++]=w[C++],x-=3;x&&(E[a++]=w[C++],1<x&&(E[a++]=w[C++]))}else{for(C=a-S;E[a++]=E[C++],E[a++]=E[C++],E[a++]=E[C++],2<(x-=3););x&&(E[a++]=E[C++],1<x&&(E[a++]=E[C++]))}break}}break}}while(r<i&&a<s);r-=x=m>>3,p&=(1<<(m-=x<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=a<s?s-a+257:257-(a-s),n.hold=p,n.bits=m}},{}],49:[function(e,t,n){"use strict";var r=e(`../utils/common`),i=e(`./adler32`),a=e(`./crc32`),o=e(`./inffast`),s=e(`./inftrees`),c=1,l=2,u=0,d=-2,f=1,p=852,m=592;function h(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){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 r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(p),t.distcode=t.distdyn=new r.Buf32(m),t.sane=1,t.back=-1,u):d}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,_(e)):d}function y(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?d:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,v(e))):d}function b(e,t){var n,r;return e?(r=new g,(e.state=r).window=null,(n=y(e,t))!==u&&(e.state=null),n):d}var x,S,C=!0;function w(e){if(C){var t;for(x=new r.Buf32(512),S=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(c,e.lens,0,288,x,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(l,e.lens,0,32,S,0,e.work,{bits:5}),C=!1}e.lencode=x,e.lenbits=9,e.distcode=S,e.distbits=5}function T(e,t,n,i){var a,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new r.Buf8(o.wsize)),i>=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(a=o.wsize-o.wnext)&&(a=i),r.arraySet(o.window,t,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}n.inflateReset=v,n.inflateReset2=y,n.inflateResetKeep=_,n.inflateInit=function(e){return b(e,15)},n.inflateInit2=b,n.inflate=function(e,t){var n,p,m,g,_,v,y,b,x,S,C,E,D,O,k,A,j,M,N,P,F,I,L,R,z=0,B=new r.Buf8(4),ee=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return d;(n=e.state).mode===12&&(n.mode=13),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,S=v,C=y,I=u;e:for(;;)switch(n.mode){case f:if(n.wrap===0){n.mode=13;break}for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(2&n.wrap&&b===35615){B[n.check=0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,2,0),x=b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&b)<<8)+(b>>8))%31){e.msg=`incorrect header check`,n.mode=30;break}if((15&b)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(x-=4,F=8+(15&(b>>>=4)),n.wbits===0)n.wbits=F;else if(F>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<<F,e.adler=n.check=1,n.mode=512&b?10:12,x=b=0;break;case 2:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(n.flags=b,(255&n.flags)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(57344&n.flags){e.msg=`unknown header flags set`,n.mode=30;break}n.head&&(n.head.text=b>>8&1),512&n.flags&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,2,0)),x=b=0,n.mode=3;case 3:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.head&&(n.head.time=b),512&n.flags&&(B[0]=255&b,B[1]=b>>>8&255,B[2]=b>>>16&255,B[3]=b>>>24&255,n.check=a(n.check,B,4,0)),x=b=0,n.mode=4;case 4:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.head&&(n.head.xflags=255&b,n.head.os=b>>8),512&n.flags&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,2,0)),x=b=0,n.mode=5;case 5:if(1024&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.length=b,n.head&&(n.head.extra_len=b),512&n.flags&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,2,0)),x=b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(v<(E=n.length)&&(E=v),E&&(n.head&&(F=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),r.arraySet(n.head.extra,p,g,E,F)),512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(v===0)break e;for(E=0;F=p[g+ E++],n.head&&F&&n.length<65536&&(n.head.name+=String.fromCharCode(F)),F&&E<v;);if(512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,F)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(v===0)break e;for(E=0;F=p[g+ E++],n.head&&F&&n.length<65536&&(n.head.comment+=String.fromCharCode(F)),F&&E<v;);if(512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,F)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(b!==(65535&n.check)){e.msg=`header crc mismatch`,n.mode=30;break}x=b=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}e.adler=n.check=h(b),x=b=0,n.mode=11;case 11:if(n.havedict===0)return e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,2;e.adler=n.check=1,n.mode=12;case 12:if(t===5||t===6)break e;case 13:if(n.last){b>>>=7&x,x-=7&x,n.mode=27;break}for(;x<3;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}switch(n.last=1&b,--x,3&(b>>>=1)){case 0:n.mode=14;break;case 1:if(w(n),n.mode=20,t!==6)break;b>>>=2,x-=2;break e;case 2:n.mode=17;break;case 3:e.msg=`invalid block type`,n.mode=30}b>>>=2,x-=2;break;case 14:for(b>>>=7&x,x-=7&x;x<32;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if((65535&b)!=(b>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=30;break}if(n.length=65535&b,x=b=0,n.mode=15,t===6)break e;case 15:n.mode=16;case 16:if(E=n.length){if(v<E&&(E=v),y<E&&(E=y),E===0)break e;r.arraySet(m,p,g,E,_),v-=E,g+=E,y-=E,_+=E,n.length-=E;break}n.mode=12;break;case 17:for(;x<14;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(n.nlen=257+(31&b),b>>>=5,x-=5,n.ndist=1+(31&b),b>>>=5,x-=5,n.ncode=4+(15&b),b>>>=4,x-=4,286<n.nlen||30<n.ndist){e.msg=`too many length or distance symbols`,n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;x<3;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.lens[ee[n.have++]]=7&b,b>>>=3,x-=3}for(;n.have<19;)n.lens[ee[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,L={bits:n.lenbits},I=s(0,n.lens,0,19,n.lencode,0,n.work,L),n.lenbits=L.bits,I){e.msg=`invalid code lengths set`,n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;A=(z=n.lencode[b&(1<<n.lenbits)-1])>>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(j<16)b>>>=k,x-=k,n.lens[n.have++]=j;else{if(j===16){for(R=k+2;x<R;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(b>>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}F=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===17){for(R=k+3;x<R;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}x-=k,F=0,E=3+(7&(b>>>=k)),b>>>=3,x-=3}else{for(R=k+7;x<R;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}x-=k,F=0,E=11+(127&(b>>>=k)),b>>>=7,x-=7}if(n.have+E>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=30;break}for(;E--;)n.lens[n.have++]=F}}if(n.mode===30)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=30;break}if(n.lenbits=9,L={bits:n.lenbits},I=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,L),n.lenbits=L.bits,I){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,L={bits:n.distbits},I=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,L),n.distbits=L.bits,I){e.msg=`invalid distances set`,n.mode=30;break}if(n.mode=20,t===6)break e;case 20:n.mode=21;case 21:if(6<=v&&258<=y){e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,o(e,C),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,n.mode===12&&(n.back=-1);break}for(n.back=0;A=(z=n.lencode[b&(1<<n.lenbits)-1])>>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(A&&!(240&A)){for(M=k,N=A,P=j;A=(z=n.lencode[P+((b&(1<<M+N)-1)>>M)])>>>16&255,j=65535&z,!(M+(k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}b>>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,n.length=j,A===0){n.mode=26;break}if(32&A){n.back=-1,n.mode=12;break}if(64&A){e.msg=`invalid literal/length code`,n.mode=30;break}n.extra=15&A,n.mode=22;case 22:if(n.extra){for(R=n.extra;x<R;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.length+=b&(1<<n.extra)-1,b>>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(z=n.distcode[b&(1<<n.distbits)-1])>>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(!(240&A)){for(M=k,N=A,P=j;A=(z=n.distcode[P+((b&(1<<M+N)-1)>>M)])>>>16&255,j=65535&z,!(M+(k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}b>>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,64&A){e.msg=`invalid distance code`,n.mode=30;break}n.offset=j,n.extra=15&A,n.mode=24;case 24:if(n.extra){for(R=n.extra;x<R;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.offset+=b&(1<<n.extra)-1,b>>>=n.extra,x-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=30;break}n.mode=25;case 25:if(y===0)break e;if(E=C-y,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break}D=E>n.wnext?(E-=n.wnext,n.wsize-E):n.wnext-E,E>n.length&&(E=n.length),O=n.window}else O=m,D=_-n.offset,E=n.length;for(y<E&&(E=y),y-=E,n.length-=E;m[_++]=O[D++],--E;);n.length===0&&(n.mode=21);break;case 26:if(y===0)break e;m[_++]=n.length,y--,n.mode=21;break;case 27:if(n.wrap){for(;x<32;){if(v===0)break e;v--,b|=p[g++]<<x,x+=8}if(C-=y,e.total_out+=C,n.total+=C,C&&(e.adler=n.check=n.flags?a(n.check,m,C,_-C):i(n.check,m,C,_-C)),C=y,(n.flags?b:h(b))!==n.check){e.msg=`incorrect data check`,n.mode=30;break}x=b=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;x<32;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(b!==(4294967295&n.total)){e.msg=`incorrect length check`,n.mode=30;break}x=b=0}n.mode=29;case 29:I=1;break e;case 30:I=-3;break e;case 31:return-4;case 32:default:return d}return e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,(n.wsize||C!==e.avail_out&&n.mode<30&&(n.mode<27||t!==4))&&T(e,e.output,e.next_out,C-e.avail_out)?(n.mode=31,-4):(S-=e.avail_in,C-=e.avail_out,e.total_in+=S,e.total_out+=C,n.total+=C,n.wrap&&C&&(e.adler=n.check=n.flags?a(n.check,m,C,e.next_out-C):i(n.check,m,C,e.next_out-C)),e.data_type=n.bits+(n.last?64:0)+(n.mode===12?128:0)+(n.mode===20||n.mode===15?256:0),(S==0&&C===0||t===4)&&I===u&&(I=-5),I)},n.inflateEnd=function(e){if(!e||!e.state)return d;var t=e.state;return t.window&&=null,e.state=null,u},n.inflateGetHeader=function(e,t){var n;return e&&e.state&&2&(n=e.state).wrap?((n.head=t).done=!1,u):d},n.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?(n=e.state).wrap!==0&&n.mode!==11?d:n.mode===11&&i(1,t,r,0)!==n.check?-3:T(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,u):d},n.inflateInfo=`pako inflate (from Nodeca project)`},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,n){"use strict";var r=e(`../utils/common`),i=[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],a=[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],o=[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],s=[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];t.exports=function(e,t,n,c,l,u,d,f){var p,m,h,g,_,v,y,b,x,S=f.bits,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=null,P=0,F=new r.Buf16(16),I=new r.Buf16(16),L=null,R=0;for(C=0;C<=15;C++)F[C]=0;for(w=0;w<c;w++)F[t[n+w]]++;for(D=S,E=15;1<=E&&F[E]===0;E--);if(E<D&&(D=E),E===0)return l[u++]=20971520,l[u++]=20971520,f.bits=1,0;for(T=1;T<E&&F[T]===0;T++);for(D<T&&(D=T),C=A=1;C<=15;C++)if(A<<=1,(A-=F[C])<0)return-1;if(0<A&&(e===0||E!==1))return-1;for(I[1]=0,C=1;C<15;C++)I[C+1]=I[C]+F[C];for(w=0;w<c;w++)t[n+w]!==0&&(d[I[t[n+w]]++]=w);if(v=e===0?(N=L=d,19):e===1?(N=i,P-=257,L=a,R-=257,256):(N=o,L=s,-1),C=T,_=u,k=w=M=0,h=-1,g=(j=1<<(O=D))-1,e===1&&852<j||e===2&&592<j)return 1;for(;;){for(y=C-k,x=d[w]<v?(b=0,d[w]):d[w]>v?(b=L[R+d[w]],N[P+d[w]]):(b=96,0),p=1<<C-k,T=m=1<<O;l[_+(M>>k)+(m-=p)]=y<<24|b<<16|x|0,m!==0;);for(p=1<<C-1;M&p;)p>>=1;if(p===0?M=0:(M&=p-1,M+=p),w++,--F[C]==0){if(C===E)break;C=t[n+d[w]]}if(D<C&&(M&g)!==h){for(k===0&&(k=D),_+=T,A=1<<(O=C-k);O+k<E&&!((A-=F[O+k])<=0);)O++,A<<=1;if(j+=1<<O,e===1&&852<j||e===2&&592<j)return 1;l[h=M&g]=D<<24|O<<16|_-u|0}}return M!==0&&(l[_+M]=C-k<<24|4194304),f.bits=D,0}},{"../utils/common":41}],51:[function(e,t,n){"use strict";t.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,t,n){"use strict";var r=e(`../utils/common`),i=0,a=1;function o(e){for(var t=e.length;0<=--t;)e[t]=0}var s=0,c=29,l=256,u=l+1+c,d=30,f=19,p=2*u+1,m=15,h=16,g=7,_=256,v=16,y=17,b=18,x=[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],S=[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],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],T=Array(2*(u+2));o(T);var E=Array(2*d);o(E);var D=Array(512);o(D);var O=Array(256);o(O);var k=Array(c);o(k);var A,j,M,N=Array(d);function P(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function F(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function I(e){return e<256?D[e]:D[256+(e>>>7)]}function L(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function R(e,t,n){e.bi_valid>h-n?(e.bi_buf|=t<<e.bi_valid&65535,L(e,e.bi_buf),e.bi_buf=t>>h-e.bi_valid,e.bi_valid+=n-h):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function z(e,t,n){R(e,n[2*t],n[2*t+1])}function B(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function ee(e,t,n){var r,i,a=Array(m+1),o=0;for(r=1;r<=m;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];s!==0&&(e[2*i]=B(a[s]++,s))}}function te(e){var t;for(t=0;t<u;t++)e.dyn_ltree[2*t]=0;for(t=0;t<d;t++)e.dyn_dtree[2*t]=0;for(t=0;t<f;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*_]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function ne(e){8<e.bi_valid?L(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function re(e,t,n,r){var i=2*t,a=2*n;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function ie(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&re(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!re(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function V(e,t,n){var r,i,a,o,s=0;if(e.last_lit!==0)for(;r=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,r===0?z(e,i,t):(z(e,(a=O[i])+l+1,t),(o=x[a])!==0&&R(e,i-=k[a],o),z(e,a=I(--r),n),(o=S[a])!==0&&R(e,r-=N[a],o)),s<e.last_lit;);z(e,_,t)}function H(e,t){var n,r,i,a=t.dyn_tree,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,c=t.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=p,n=0;n<c;n++)a[2*n]===0?a[2*n+1]=0:(e.heap[++e.heap_len]=l=n,e.depth[n]=0);for(;e.heap_len<2;)a[2*(i=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=o[2*i+1]);for(t.max_code=l,n=e.heap_len>>1;1<=n;n--)ie(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ie(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*i]=a[2*n]+a[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=i,e.heap[1]=i++,ie(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,a,o,s,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,g=t.stat_desc.max_length,_=0;for(a=0;a<=m;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<p;n++)g<(a=c[2*c[2*(r=e.heap[n])+1]+1]+1)&&(a=g,_++),c[2*r+1]=a,l<r||(e.bl_count[a]++,o=0,h<=r&&(o=f[r-h]),s=c[2*r],e.opt_len+=s*(a+o),d&&(e.static_len+=s*(u[2*r+1]+o)));if(_!==0){do{for(a=g-1;e.bl_count[a]===0;)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[g]--,_-=2}while(0<_);for(a=g;a!==0;a--)for(r=e.bl_count[a];r!==0;)l<(i=e.heap[--n])||(c[2*i+1]!==a&&(e.opt_len+=(a-c[2*i+1])*c[2*i],c[2*i+1]=a),r--)}}(e,t),ee(a,l,e.bl_count)}function ae(e,t,n){var r,i,a=-1,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=o,o=t[2*(r+1)+1],++s<c&&i===o||(s<l?e.bl_tree[2*i]+=s:i===0?s<=10?e.bl_tree[2*y]++:e.bl_tree[2*b]++:(i!==a&&e.bl_tree[2*i]++,e.bl_tree[2*v]++),a=i,l=(s=0)===o?(c=138,3):i===o?(c=6,3):(c=7,4))}function oe(e,t,n){var r,i,a=-1,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(i=o,o=t[2*(r+1)+1],!(++s<c&&i===o)){if(s<l)for(;z(e,i,e.bl_tree),--s!=0;);else i===0?s<=10?(z(e,y,e.bl_tree),R(e,s-3,3)):(z(e,b,e.bl_tree),R(e,s-11,7)):(i!==a&&(z(e,i,e.bl_tree),s--),z(e,v,e.bl_tree),R(e,s-3,2));a=i,l=(s=0)===o?(c=138,3):i===o?(c=6,3):(c=7,4)}}o(N);var se=!1;function ce(e,t,n,i){R(e,(s<<1)+(i?1:0),3),function(e,t,n,i){ne(e),i&&(L(e,n),L(e,~n)),r.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n,!0)}n._tr_init=function(e){se||=(function(){var e,t,n,r,i,a=Array(m+1);for(r=n=0;r<c-1;r++)for(k[r]=n,e=0;e<1<<x[r];e++)O[n++]=r;for(O[n-1]=r,r=i=0;r<16;r++)for(N[r]=i,e=0;e<1<<S[r];e++)D[i++]=r;for(i>>=7;r<d;r++)for(N[r]=i<<7,e=0;e<1<<S[r]-7;e++)D[256+ i++]=r;for(t=0;t<=m;t++)a[t]=0;for(e=0;e<=143;)T[2*e+1]=8,e++,a[8]++;for(;e<=255;)T[2*e+1]=9,e++,a[9]++;for(;e<=279;)T[2*e+1]=7,e++,a[7]++;for(;e<=287;)T[2*e+1]=8,e++,a[8]++;for(ee(T,u+1,a),e=0;e<d;e++)E[2*e+1]=5,E[2*e]=B(e,5);A=new P(T,x,l+1,u,m),j=new P(E,S,0,d,m),M=new P([],C,0,f,g)}(),!0),e.l_desc=new F(e.dyn_ltree,A),e.d_desc=new F(e.dyn_dtree,j),e.bl_desc=new F(e.bl_tree,M),e.bi_buf=0,e.bi_valid=0,te(e)},n._tr_stored_block=ce,n._tr_flush_block=function(e,t,n,r){var o,s,c=0;0<e.level?(e.strm.data_type===2&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&e.dyn_ltree[2*t]!==0)return i;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return a;for(t=32;t<l;t++)if(e.dyn_ltree[2*t]!==0)return a;return i}(e)),H(e,e.l_desc),H(e,e.d_desc),c=function(e){var t;for(ae(e,e.dyn_ltree,e.l_desc.max_code),ae(e,e.dyn_dtree,e.d_desc.max_code),H(e,e.bl_desc),t=f-1;3<=t&&e.bl_tree[2*w[t]+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),o=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=o&&(o=s)):o=s=n+5,n+4<=o&&t!==-1?ce(e,t,n,r):e.strategy===4||s===o?(R(e,2+(r?1:0),3),V(e,T,E)):(R(e,4+(r?1:0),3),function(e,t,n,r){var i;for(R(e,t-257,5),R(e,n-1,5),R(e,r-4,4),i=0;i<r;i++)R(e,e.bl_tree[2*w[i]+1],3);oe(e,e.dyn_ltree,t-1),oe(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,c+1),V(e,e.dyn_ltree,e.dyn_dtree)),te(e),r&&ne(e)},n._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,t===0?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(O[n]+l+1)]++,e.dyn_dtree[2*I(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){R(e,2,3),z(e,_,T),function(e){e.bi_valid===16?(L(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){"use strict";t.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,t,n){(function(e){(function(e,t){"use strict";if(!e.setImmediate){var n,r,i,a,o=1,s={},c=!1,l=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,n={}.toString.call(e.process)===`[object process]`?function(e){process.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage(``,`*`),e.onmessage=n,t}}()?(a=`setImmediate$`+Math.random()+`$`,e.addEventListener?e.addEventListener(`message`,p,!1):e.attachEvent(`onmessage`,p),function(t){e.postMessage(a+t,`*`)}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){f(e.data)},function(e){i.port2.postMessage(e)}):l&&`onreadystatechange`in l.createElement(`script`)?(r=l.documentElement,function(e){var t=l.createElement(`script`);t.onreadystatechange=function(){f(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(f,0,e)},u.setImmediate=function(e){typeof e!=`function`&&(e=Function(``+e));for(var t=Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];return s[o]={callback:e,args:t},n(o),o++},u.clearImmediate=d}function d(e){delete s[e]}function f(e){if(c)setTimeout(f,0,e);else{var n=s[e];if(n){c=!0;try{(function(e){var n=e.callback,r=e.args;switch(r.length){case 0:n();break;case 1:n(r[0]);break;case 2:n(r[0],r[1]);break;case 3:n(r[0],r[1],r[2]);break;default:n.apply(t,r)}})(n)}finally{d(e),c=!1}}}}function p(t){t.source===e&&typeof t.data==`string`&&t.data.indexOf(a)===0&&f(+t.data.slice(a.length))}})(typeof self>`u`?e===void 0?this:e:self)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}]},{},[10])(10)})})),CU=s((e=>{var t=xU(),n=SU();e.openArrayBuffer=r,e.splitPath=i,e.joinPath=a;function r(e){return n.loadAsync(e).then(function(e){function n(t){return e.file(t)!==null}function r(n,r){return e.file(n).async(`uint8array`).then(function(e){return r===`base64`?t.fromByteArray(e):r?new TextDecoder(r).decode(e):e})}function i(t,n){e.file(t,n)}function a(){return e.generateAsync({type:`arraybuffer`})}return{exists:n,read:r,write:i,toArrayBuffer:a}})}function i(e){var t=e.lastIndexOf(`/`);return t===-1?{dirname:``,basename:e}:{dirname:e.substring(0,t),basename:e.substring(t+1)}}function a(){var e=Array.prototype.filter.call(arguments,function(e){return e}),t=[];return e.forEach(function(e){/^\//.test(e)?t=[e]:t.push(e)}),t.join(`/`)}})),wU=s((e=>{var t=(IH(),d(FH));e.Element=r,e.element=function(e,t,n){return new r(e,t,n)},e.text=function(e){return{type:`text`,value:e}};var n=e.emptyElement={first:function(){return null},firstOrEmpty:function(){return n},attributes:{},children:[]};function r(e,t,n){this.type=`element`,this.name=e,this.attributes=t||{},this.children=n||[]}r.prototype.first=function(e){return t.find(this.children,function(t){return t.name===e})},r.prototype.firstOrEmpty=function(e){return this.first(e)||n},r.prototype.getElementsByTagName=function(e){return a(t.filter(this.children,function(t){return t.name===e}))},r.prototype.text=function(){if(this.children.length===0)return``;if(this.children.length!==1||this.children[0].type!==`text`)throw Error(`Not implemented`);return this.children[0].value};var i={getElementsByTagName:function(e){return a(t.flatten(this.map(function(t){return t.getElementsByTagName(e)},!0)))}};function a(e){return t.extend(e,i)}})),TU=s((e=>{function t(e,t,n){if(n===void 0&&(n=Array.prototype),e&&typeof n.find==`function`)return n.find.call(e,t);for(var r=0;r<e.length;r++)if(Object.prototype.hasOwnProperty.call(e,r)){var i=e[r];if(t.call(void 0,i,r,e))return i}}function n(e,t){return t===void 0&&(t=Object),t&&typeof t.freeze==`function`?t.freeze(e):e}function r(e,t){if(typeof e!=`object`||!e)throw TypeError(`target is not an object`);for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}var i=n({HTML:`text/html`,isHTML:function(e){return e===i.HTML},XML_APPLICATION:`application/xml`,XML_TEXT:`text/xml`,XML_XHTML_APPLICATION:`application/xhtml+xml`,XML_SVG_IMAGE:`image/svg+xml`}),a=n({HTML:`http://www.w3.org/1999/xhtml`,isHTML:function(e){return e===a.HTML},SVG:`http://www.w3.org/2000/svg`,XML:`http://www.w3.org/XML/1998/namespace`,XMLNS:`http://www.w3.org/2000/xmlns/`});e.assign=r,e.find=t,e.freeze=n,e.MIME_TYPE=i,e.NAMESPACE=a})),EU=s((e=>{var t=TU(),n=t.find,r=t.NAMESPACE;function i(e){return e!==``}function a(e){return e?e.split(/[\t\n\f\r ]+/).filter(i):[]}function o(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function s(e){if(!e)return[];var t=a(e);return Object.keys(t.reduce(o,{}))}function c(e){return function(t){return e&&e.indexOf(t)!==-1}}function l(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function u(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,r=new r,l(n,r),e.prototype=n=r}n.constructor!=e&&(typeof e!=`function`&&console.error(`unknown Class:`+e),n.constructor=e)}var d={},f=d.ELEMENT_NODE=1,p=d.ATTRIBUTE_NODE=2,m=d.TEXT_NODE=3,h=d.CDATA_SECTION_NODE=4,g=d.ENTITY_REFERENCE_NODE=5,_=d.ENTITY_NODE=6,v=d.PROCESSING_INSTRUCTION_NODE=7,y=d.COMMENT_NODE=8,b=d.DOCUMENT_NODE=9,x=d.DOCUMENT_TYPE_NODE=10,S=d.DOCUMENT_FRAGMENT_NODE=11,C=d.NOTATION_NODE=12,w={},T={};w.INDEX_SIZE_ERR=(T[1]=`Index size error`,1),w.DOMSTRING_SIZE_ERR=(T[2]=`DOMString size error`,2);var E=w.HIERARCHY_REQUEST_ERR=(T[3]=`Hierarchy request error`,3);w.WRONG_DOCUMENT_ERR=(T[4]=`Wrong document`,4),w.INVALID_CHARACTER_ERR=(T[5]=`Invalid character`,5),w.NO_DATA_ALLOWED_ERR=(T[6]=`No data allowed`,6),w.NO_MODIFICATION_ALLOWED_ERR=(T[7]=`No modification allowed`,7);var D=w.NOT_FOUND_ERR=(T[8]=`Not found`,8);w.NOT_SUPPORTED_ERR=(T[9]=`Not supported`,9);var O=w.INUSE_ATTRIBUTE_ERR=(T[10]=`Attribute in use`,10);w.INVALID_STATE_ERR=(T[11]=`Invalid state`,11),w.SYNTAX_ERR=(T[12]=`Syntax error`,12),w.INVALID_MODIFICATION_ERR=(T[13]=`Invalid modification`,13),w.NAMESPACE_ERR=(T[14]=`Invalid namespace`,14),w.INVALID_ACCESS_ERR=(T[15]=`Invalid access`,15);function k(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,T[e]),this.message=T[e],Error.captureStackTrace&&Error.captureStackTrace(this,k);return n.code=e,t&&(this.message=this.message+`: `+t),n}k.prototype=Error.prototype,l(w,k);function A(){}A.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t){for(var n=[],r=0;r<this.length;r++)Me(this[r],n,e,t);return n.join(``)},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}};function j(e,t){this._node=e,this._refresh=t,M(this)}function M(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var n=e._refresh(e._node);if(Fe(e,`length`,n.length),!e.$$length||n.length<e.$$length)for(var r=n.length;r in e;r++)Object.prototype.hasOwnProperty.call(e,r)&&delete e[r];l(n,e),e._inc=t}}j.prototype.item=function(e){return M(this),this[e]||null},u(j,A);function N(){}function P(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function F(e,t,n,r){if(r?t[P(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&ne(i,e,r),te(i,e,n))}}function I(e,t,n){var r=P(t,n);if(r>=0){for(var i=t.length-1;r<i;)t[r]=t[++r];if(t.length=i,e){var a=e.ownerDocument;a&&(ne(a,e,n),n.ownerElement=null)}}else throw new k(D,Error(e.tagName+`@`+n))}N.prototype={length:0,item:A.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var n=this[t];if(n.nodeName==e)return n}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new k(O);var n=this.getNamedItem(e.nodeName);return F(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t=e.ownerElement,n;if(t&&t!=this._ownerElement)throw new k(O);return n=this.getNamedItemNS(e.namespaceURI,e.localName),F(this._ownerElement,this,e,n),n},removeNamedItem:function(e){var t=this.getNamedItem(e);return I(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return I(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var r=this[n];if(r.localName==t&&r.namespaceURI==e)return r}return null}};function L(){}L.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var r=new ee;if(r.implementation=this,r.childNodes=new A,r.doctype=n||null,n&&r.appendChild(n),t){var i=r.createElementNS(e,t);r.appendChild(i)}return r},createDocumentType:function(e,t,n){var r=new Se;return r.name=e,r.nodeName=e,r.publicId=t||``,r.systemId=n||``,r}};function R(){}R.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return pe(this,e,t)},replaceChild:function(e,t){pe(this,e,t,fe),t&&this.removeChild(t)},removeChild:function(e){return ie(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return Pe(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==m&&e.nodeType==m?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&n[r]===e)return r}t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&Object.prototype.hasOwnProperty.call(n,e))return n[e];t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return this.lookupPrefix(e)==null}};function z(e){return e==`<`&&`<`||e==`>`&&`>`||e==`&`&&`&`||e==`"`&&`"`||`&#`+e.charCodeAt()+`;`}l(d,R),l(d,R.prototype);function B(e,t){if(t(e))return!0;if(e=e.firstChild)do if(B(e,t))return!0;while(e=e.nextSibling)}function ee(){this.ownerDocument=this}function te(e,t,n){e&&e._inc++,n.namespaceURI===r.XMLNS&&(t._nsMap[n.prefix?n.localName:``]=n.value)}function ne(e,t,n,i){e&&e._inc++,n.namespaceURI===r.XMLNS&&delete t._nsMap[n.prefix?n.localName:``]}function re(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,a=0;i;)r[a++]=i,i=i.nextSibling;r.length=a,delete r[r.length]}}}function ie(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,re(e.ownerDocument,e),t}function V(e){return e&&(e.nodeType===R.DOCUMENT_NODE||e.nodeType===R.DOCUMENT_FRAGMENT_NODE||e.nodeType===R.ELEMENT_NODE)}function H(e){return e&&(oe(e)||se(e)||ae(e)||e.nodeType===R.DOCUMENT_FRAGMENT_NODE||e.nodeType===R.COMMENT_NODE||e.nodeType===R.PROCESSING_INSTRUCTION_NODE)}function ae(e){return e&&e.nodeType===R.DOCUMENT_TYPE_NODE}function oe(e){return e&&e.nodeType===R.ELEMENT_NODE}function se(e){return e&&e.nodeType===R.TEXT_NODE}function ce(e,t){var r=e.childNodes||[];if(n(r,oe)||ae(t))return!1;var i=n(r,ae);return!(t&&i&&r.indexOf(i)>r.indexOf(t))}function le(e,t){var r=e.childNodes||[];function i(e){return oe(e)&&e!==t}if(n(r,i))return!1;var a=n(r,ae);return!(t&&a&&r.indexOf(a)>r.indexOf(t))}function ue(e,t,n){if(!V(e))throw new k(E,`Unexpected parent node type `+e.nodeType);if(n&&n.parentNode!==e)throw new k(D,`child not in parent`);if(!H(t)||ae(t)&&e.nodeType!==R.DOCUMENT_NODE)throw new k(E,`Unexpected node type `+t.nodeType+` for parent node type `+e.nodeType)}function de(e,t,r){var i=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===R.DOCUMENT_FRAGMENT_NODE){var o=a.filter(oe);if(o.length>1||n(a,se))throw new k(E,`More than one element or text in fragment`);if(o.length===1&&!ce(e,r))throw new k(E,`Element in fragment can not be inserted before doctype`)}if(oe(t)&&!ce(e,r))throw new k(E,`Only one element can be added and only after doctype`);if(ae(t)){if(n(i,ae))throw new k(E,`Only one doctype is allowed`);var s=n(i,oe);if(r&&i.indexOf(s)<i.indexOf(r))throw new k(E,`Doctype can only be inserted before an element`);if(!r&&s)throw new k(E,`Doctype can not be appended since element is present`)}}function fe(e,t,r){var i=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===R.DOCUMENT_FRAGMENT_NODE){var o=a.filter(oe);if(o.length>1||n(a,se))throw new k(E,`More than one element or text in fragment`);if(o.length===1&&!le(e,r))throw new k(E,`Element in fragment can not be inserted before doctype`)}if(oe(t)&&!le(e,r))throw new k(E,`Only one element can be added and only after doctype`);if(ae(t)){function e(e){return ae(e)&&e!==r}if(n(i,e))throw new k(E,`Only one doctype is allowed`);var s=n(i,oe);if(r&&i.indexOf(s)<i.indexOf(r))throw new k(E,`Doctype can only be inserted before an element`)}}function pe(e,t,n,r){ue(e,t,n),e.nodeType===R.DOCUMENT_NODE&&(r||de)(e,t,n);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===S){var a=t.firstChild;if(a==null)return t;var o=t.lastChild}else a=o=t;var s=n?n.previousSibling:e.lastChild;a.previousSibling=s,o.nextSibling=n,s?s.nextSibling=a:e.firstChild=a,n==null?e.lastChild=o:n.previousSibling=o;do{a.parentNode=e;var c=e.ownerDocument||e;me(a,c)}while(a!==o&&(a=a.nextSibling));return re(e.ownerDocument||e,e),t.nodeType==S&&(t.firstChild=t.lastChild=null),t}function me(e,t){if(e.ownerDocument!==t){if(e.ownerDocument=t,e.nodeType===f&&e.attributes)for(var n=0;n<e.attributes.length;n++){var r=e.attributes.item(n);r&&(r.ownerDocument=t)}for(var i=e.firstChild;i;)me(i,t),i=i.nextSibling}}function he(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,re(e.ownerDocument,e,t),me(t,e.ownerDocument||e),t}ee.prototype={nodeName:`#document`,nodeType:b,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==S){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return pe(this,e,t),me(e,this),this.documentElement===null&&e.nodeType===f&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),ie(this,e)},replaceChild:function(e,t){pe(this,e,t,fe),me(e,this),t&&this.removeChild(t),oe(e)&&(this.documentElement=e)},importNode:function(e,t){return Ne(this,e,t)},getElementById:function(e){var t=null;return B(this.documentElement,function(n){if(n.nodeType==f&&n.getAttribute(`id`)==e)return t=n,!0}),t},getElementsByClassName:function(e){var t=s(e);return new j(this,function(n){var r=[];return t.length>0&&B(n.documentElement,function(i){if(i!==n&&i.nodeType===f){var a=i.getAttribute(`class`);if(a){var o=e===a;if(!o){var l=s(a);o=t.every(c(l))}o&&r.push(i)}}}),r})},createElement:function(e){var t=new ge;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new A;var n=t.attributes=new N;return n._ownerElement=t,t},createDocumentFragment:function(){var e=new Ee;return e.ownerDocument=this,e.childNodes=new A,e},createTextNode:function(e){var t=new ye;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new be;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new xe;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new De;return n.ownerDocument=this,n.tagName=n.nodeName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new _e;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new Te;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new ge,r=t.split(`:`),i=n.attributes=new N;return n.childNodes=new A,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new _e,r=t.split(`:`);return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},u(ee,R);function ge(){this._nsMap={}}ge.prototype={nodeType:f,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||``},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=``+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===S?this.insertBefore(e,null):he(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||``},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=``+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new j(this,function(t){var n=[];return B(t,function(r){r!==t&&r.nodeType==f&&(e===`*`||r.tagName==e)&&n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new j(this,function(n){var r=[];return B(n,function(i){i!==n&&i.nodeType===f&&(e===`*`||i.namespaceURI===e)&&(t===`*`||i.localName==t)&&r.push(i)}),r})}},ee.prototype.getElementsByTagName=ge.prototype.getElementsByTagName,ee.prototype.getElementsByTagNameNS=ge.prototype.getElementsByTagNameNS,u(ge,R);function _e(){}_e.prototype.nodeType=p,u(_e,R);function ve(){}ve.prototype={data:``,substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw Error(T[E])},deleteData:function(e,t){this.replaceData(e,t,``)},replaceData:function(e,t,n){var r=this.data.substring(0,e),i=this.data.substring(e+t);n=r+n+i,this.nodeValue=this.data=n,this.length=n.length}},u(ve,R);function ye(){}ye.prototype={nodeName:`#text`,nodeType:m,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},u(ye,ve);function be(){}be.prototype={nodeName:`#comment`,nodeType:y},u(be,ve);function xe(){}xe.prototype={nodeName:`#cdata-section`,nodeType:h},u(xe,ve);function Se(){}Se.prototype.nodeType=x,u(Se,R);function Ce(){}Ce.prototype.nodeType=C,u(Ce,R);function we(){}we.prototype.nodeType=_,u(we,R);function Te(){}Te.prototype.nodeType=g,u(Te,R);function Ee(){}Ee.prototype.nodeName=`#document-fragment`,Ee.prototype.nodeType=S,u(Ee,R);function De(){}De.prototype.nodeType=v,u(De,R);function Oe(){}Oe.prototype.serializeToString=function(e,t,n){return ke.call(e,t,n)},R.prototype.toString=ke;function ke(e,t){var n=[],r=this.nodeType==9&&this.documentElement||this,i=r.prefix,a=r.namespaceURI;if(a&&i==null){var i=r.lookupPrefix(a);if(i==null)var o=[{namespace:a,prefix:null}]}return Me(this,n,e,t,o),n.join(``)}function Ae(e,t,n){var i=e.prefix||``,a=e.namespaceURI;if(!a||i===`xml`&&a===r.XML||a===r.XMLNS)return!1;for(var o=n.length;o--;){var s=n[o];if(s.prefix===i)return s.namespace!==a}return!0}function je(e,t,n){e.push(` `,t,`="`,n.replace(/[<>&"\t\n\r]/g,z),`"`)}function Me(e,t,n,i,a){if(a||=[],i)if(e=i(e),e){if(typeof e==`string`){t.push(e);return}}else return;switch(e.nodeType){case f:var o=e.attributes,s=o.length,c=e.firstChild,l=e.tagName;n=r.isHTML(e.namespaceURI)||n;var u=l;if(!n&&!e.prefix&&e.namespaceURI){for(var d,_=0;_<o.length;_++)if(o.item(_).name===`xmlns`){d=o.item(_).value;break}if(!d)for(var C=a.length-1;C>=0;C--){var w=a[C];if(w.prefix===``&&w.namespace===e.namespaceURI){d=w.namespace;break}}if(d!==e.namespaceURI)for(var C=a.length-1;C>=0;C--){var w=a[C];if(w.namespace===e.namespaceURI){w.prefix&&(u=w.prefix+`:`+l);break}}}t.push(`<`,u);for(var T=0;T<s;T++){var E=o.item(T);E.prefix==`xmlns`?a.push({prefix:E.localName,namespace:E.value}):E.nodeName==`xmlns`&&a.push({prefix:``,namespace:E.value})}for(var T=0;T<s;T++){var E=o.item(T);if(Ae(E,n,a)){var D=E.prefix||``,O=E.namespaceURI;je(t,D?`xmlns:`+D:`xmlns`,O),a.push({prefix:D,namespace:O})}Me(E,t,n,i,a)}if(l===u&&Ae(e,n,a)){var D=e.prefix||``,O=e.namespaceURI;je(t,D?`xmlns:`+D:`xmlns`,O),a.push({prefix:D,namespace:O})}if(c||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){if(t.push(`>`),n&&/^script$/i.test(l))for(;c;)c.data?t.push(c.data):Me(c,t,n,i,a.slice()),c=c.nextSibling;else for(;c;)Me(c,t,n,i,a.slice()),c=c.nextSibling;t.push(`</`,u,`>`)}else t.push(`/>`);return;case b:case S:for(var c=e.firstChild;c;)Me(c,t,n,i,a.slice()),c=c.nextSibling;return;case p:return je(t,e.name,e.value);case m:return t.push(e.data.replace(/[<&>]/g,z));case h:return t.push(`<![CDATA[`,e.data,`]]>`);case y:return t.push(`<!--`,e.data,`-->`);case x:var k=e.publicId,A=e.systemId;if(t.push(`<!DOCTYPE `,e.name),k)t.push(` PUBLIC `,k),A&&A!=`.`&&t.push(` `,A),t.push(`>`);else if(A&&A!=`.`)t.push(` SYSTEM `,A,`>`);else{var j=e.internalSubset;j&&t.push(` [`,j,`]`),t.push(`>`)}return;case v:return t.push(`<?`,e.target,` `,e.data,`?>`);case g:return t.push(`&`,e.nodeName,`;`);default:t.push(`??`,e.nodeName)}}function Ne(e,t,n){var r;switch(t.nodeType){case f:r=t.cloneNode(!1),r.ownerDocument=e;case S:break;case p:n=!0;break}if(r||=t.cloneNode(!1),r.ownerDocument=e,r.parentNode=null,n)for(var i=t.firstChild;i;)r.appendChild(Ne(e,i,n)),i=i.nextSibling;return r}function Pe(e,t,n){var r=new t.constructor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=t[i];typeof a!=`object`&&a!=r[i]&&(r[i]=a)}switch(t.childNodes&&(r.childNodes=new A),r.ownerDocument=e,r.nodeType){case f:var o=t.attributes,s=r.attributes=new N,c=o.length;s._ownerElement=r;for(var l=0;l<c;l++)r.setAttributeNode(Pe(e,o.item(l),!0));break;case p:n=!0}if(n)for(var u=t.firstChild;u;)r.appendChild(Pe(e,u,n)),u=u.nextSibling;return r}function Fe(e,t,n){e[t]=n}try{if(Object.defineProperty){Object.defineProperty(j.prototype,`length`,{get:function(){return M(this),this.$$length}}),Object.defineProperty(R.prototype,`textContent`,{get:function(){return e(this)},set:function(e){switch(this.nodeType){case f:case S:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}});function e(t){switch(t.nodeType){case f:case S:var n=[];for(t=t.firstChild;t;)t.nodeType!==7&&t.nodeType!==8&&n.push(e(t)),t=t.nextSibling;return n.join(``);default:return t.nodeValue}}Fe=function(e,t,n){e[`$$`+t]=n}}}catch{}e.DocumentType=Se,e.DOMException=k,e.DOMImplementation=L,e.Element=ge,e.Node=R,e.NodeList=A,e.XMLSerializer=Oe})),DU=s((e=>{var t=TU().freeze;e.XML_ENTITIES=t({amp:`&`,apos:`'`,gt:`>`,lt:`<`,quot:`"`}),e.HTML_ENTITIES=t({Aacute:`Á`,aacute:`á`,Abreve:`Ă`,abreve:`ă`,ac:`∾`,acd:`∿`,acE:`∾̳`,Acirc:`Â`,acirc:`â`,acute:`´`,Acy:`А`,acy:`а`,AElig:`Æ`,aelig:`æ`,af:``,Afr:`𝔄`,afr:`𝔞`,Agrave:`À`,agrave:`à`,alefsym:`ℵ`,aleph:`ℵ`,Alpha:`Α`,alpha:`α`,Amacr:`Ā`,amacr:`ā`,amalg:`⨿`,AMP:`&`,amp:`&`,And:`⩓`,and:`∧`,andand:`⩕`,andd:`⩜`,andslope:`⩘`,andv:`⩚`,ang:`∠`,ange:`⦤`,angle:`∠`,angmsd:`∡`,angmsdaa:`⦨`,angmsdab:`⦩`,angmsdac:`⦪`,angmsdad:`⦫`,angmsdae:`⦬`,angmsdaf:`⦭`,angmsdag:`⦮`,angmsdah:`⦯`,angrt:`∟`,angrtvb:`⊾`,angrtvbd:`⦝`,angsph:`∢`,angst:`Å`,angzarr:`⍼`,Aogon:`Ą`,aogon:`ą`,Aopf:`𝔸`,aopf:`𝕒`,ap:`≈`,apacir:`⩯`,apE:`⩰`,ape:`≊`,apid:`≋`,apos:`'`,ApplyFunction:``,approx:`≈`,approxeq:`≊`,Aring:`Å`,aring:`å`,Ascr:`𝒜`,ascr:`𝒶`,Assign:`≔`,ast:`*`,asymp:`≈`,asympeq:`≍`,Atilde:`Ã`,atilde:`ã`,Auml:`Ä`,auml:`ä`,awconint:`∳`,awint:`⨑`,backcong:`≌`,backepsilon:`϶`,backprime:`‵`,backsim:`∽`,backsimeq:`⋍`,Backslash:`∖`,Barv:`⫧`,barvee:`⊽`,Barwed:`⌆`,barwed:`⌅`,barwedge:`⌅`,bbrk:`⎵`,bbrktbrk:`⎶`,bcong:`≌`,Bcy:`Б`,bcy:`б`,bdquo:`„`,becaus:`∵`,Because:`∵`,because:`∵`,bemptyv:`⦰`,bepsi:`϶`,bernou:`ℬ`,Bernoullis:`ℬ`,Beta:`Β`,beta:`β`,beth:`ℶ`,between:`≬`,Bfr:`𝔅`,bfr:`𝔟`,bigcap:`⋂`,bigcirc:`◯`,bigcup:`⋃`,bigodot:`⨀`,bigoplus:`⨁`,bigotimes:`⨂`,bigsqcup:`⨆`,bigstar:`★`,bigtriangledown:`▽`,bigtriangleup:`△`,biguplus:`⨄`,bigvee:`⋁`,bigwedge:`⋀`,bkarow:`⤍`,blacklozenge:`⧫`,blacksquare:`▪`,blacktriangle:`▴`,blacktriangledown:`▾`,blacktriangleleft:`◂`,blacktriangleright:`▸`,blank:`␣`,blk12:`▒`,blk14:`░`,blk34:`▓`,block:`█`,bne:`=⃥`,bnequiv:`≡⃥`,bNot:`⫭`,bnot:`⌐`,Bopf:`𝔹`,bopf:`𝕓`,bot:`⊥`,bottom:`⊥`,bowtie:`⋈`,boxbox:`⧉`,boxDL:`╗`,boxDl:`╖`,boxdL:`╕`,boxdl:`┐`,boxDR:`╔`,boxDr:`╓`,boxdR:`╒`,boxdr:`┌`,boxH:`═`,boxh:`─`,boxHD:`╦`,boxHd:`╤`,boxhD:`╥`,boxhd:`┬`,boxHU:`╩`,boxHu:`╧`,boxhU:`╨`,boxhu:`┴`,boxminus:`⊟`,boxplus:`⊞`,boxtimes:`⊠`,boxUL:`╝`,boxUl:`╜`,boxuL:`╛`,boxul:`┘`,boxUR:`╚`,boxUr:`╙`,boxuR:`╘`,boxur:`└`,boxV:`║`,boxv:`│`,boxVH:`╬`,boxVh:`╫`,boxvH:`╪`,boxvh:`┼`,boxVL:`╣`,boxVl:`╢`,boxvL:`╡`,boxvl:`┤`,boxVR:`╠`,boxVr:`╟`,boxvR:`╞`,boxvr:`├`,bprime:`‵`,Breve:`˘`,breve:`˘`,brvbar:`¦`,Bscr:`ℬ`,bscr:`𝒷`,bsemi:`⁏`,bsim:`∽`,bsime:`⋍`,bsol:`\\`,bsolb:`⧅`,bsolhsub:`⟈`,bull:`•`,bullet:`•`,bump:`≎`,bumpE:`⪮`,bumpe:`≏`,Bumpeq:`≎`,bumpeq:`≏`,Cacute:`Ć`,cacute:`ć`,Cap:`⋒`,cap:`∩`,capand:`⩄`,capbrcup:`⩉`,capcap:`⩋`,capcup:`⩇`,capdot:`⩀`,CapitalDifferentialD:`ⅅ`,caps:`∩︀`,caret:`⁁`,caron:`ˇ`,Cayleys:`ℭ`,ccaps:`⩍`,Ccaron:`Č`,ccaron:`č`,Ccedil:`Ç`,ccedil:`ç`,Ccirc:`Ĉ`,ccirc:`ĉ`,Cconint:`∰`,ccups:`⩌`,ccupssm:`⩐`,Cdot:`Ċ`,cdot:`ċ`,cedil:`¸`,Cedilla:`¸`,cemptyv:`⦲`,cent:`¢`,CenterDot:`·`,centerdot:`·`,Cfr:`ℭ`,cfr:`𝔠`,CHcy:`Ч`,chcy:`ч`,check:`✓`,checkmark:`✓`,Chi:`Χ`,chi:`χ`,cir:`○`,circ:`ˆ`,circeq:`≗`,circlearrowleft:`↺`,circlearrowright:`↻`,circledast:`⊛`,circledcirc:`⊚`,circleddash:`⊝`,CircleDot:`⊙`,circledR:`®`,circledS:`Ⓢ`,CircleMinus:`⊖`,CirclePlus:`⊕`,CircleTimes:`⊗`,cirE:`⧃`,cire:`≗`,cirfnint:`⨐`,cirmid:`⫯`,cirscir:`⧂`,ClockwiseContourIntegral:`∲`,CloseCurlyDoubleQuote:`”`,CloseCurlyQuote:`’`,clubs:`♣`,clubsuit:`♣`,Colon:`∷`,colon:`:`,Colone:`⩴`,colone:`≔`,coloneq:`≔`,comma:`,`,commat:`@`,comp:`∁`,compfn:`∘`,complement:`∁`,complexes:`ℂ`,cong:`≅`,congdot:`⩭`,Congruent:`≡`,Conint:`∯`,conint:`∮`,ContourIntegral:`∮`,Copf:`ℂ`,copf:`𝕔`,coprod:`∐`,Coproduct:`∐`,COPY:`©`,copy:`©`,copysr:`℗`,CounterClockwiseContourIntegral:`∳`,crarr:`↵`,Cross:`⨯`,cross:`✗`,Cscr:`𝒞`,cscr:`𝒸`,csub:`⫏`,csube:`⫑`,csup:`⫐`,csupe:`⫒`,ctdot:`⋯`,cudarrl:`⤸`,cudarrr:`⤵`,cuepr:`⋞`,cuesc:`⋟`,cularr:`↶`,cularrp:`⤽`,Cup:`⋓`,cup:`∪`,cupbrcap:`⩈`,CupCap:`≍`,cupcap:`⩆`,cupcup:`⩊`,cupdot:`⊍`,cupor:`⩅`,cups:`∪︀`,curarr:`↷`,curarrm:`⤼`,curlyeqprec:`⋞`,curlyeqsucc:`⋟`,curlyvee:`⋎`,curlywedge:`⋏`,curren:`¤`,curvearrowleft:`↶`,curvearrowright:`↷`,cuvee:`⋎`,cuwed:`⋏`,cwconint:`∲`,cwint:`∱`,cylcty:`⌭`,Dagger:`‡`,dagger:`†`,daleth:`ℸ`,Darr:`↡`,dArr:`⇓`,darr:`↓`,dash:`‐`,Dashv:`⫤`,dashv:`⊣`,dbkarow:`⤏`,dblac:`˝`,Dcaron:`Ď`,dcaron:`ď`,Dcy:`Д`,dcy:`д`,DD:`ⅅ`,dd:`ⅆ`,ddagger:`‡`,ddarr:`⇊`,DDotrahd:`⤑`,ddotseq:`⩷`,deg:`°`,Del:`∇`,Delta:`Δ`,delta:`δ`,demptyv:`⦱`,dfisht:`⥿`,Dfr:`𝔇`,dfr:`𝔡`,dHar:`⥥`,dharl:`⇃`,dharr:`⇂`,DiacriticalAcute:`´`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,DiacriticalGrave:"`",DiacriticalTilde:`˜`,diam:`⋄`,Diamond:`⋄`,diamond:`⋄`,diamondsuit:`♦`,diams:`♦`,die:`¨`,DifferentialD:`ⅆ`,digamma:`ϝ`,disin:`⋲`,div:`÷`,divide:`÷`,divideontimes:`⋇`,divonx:`⋇`,DJcy:`Ђ`,djcy:`ђ`,dlcorn:`⌞`,dlcrop:`⌍`,dollar:`$`,Dopf:`𝔻`,dopf:`𝕕`,Dot:`¨`,dot:`˙`,DotDot:`⃜`,doteq:`≐`,doteqdot:`≑`,DotEqual:`≐`,dotminus:`∸`,dotplus:`∔`,dotsquare:`⊡`,doublebarwedge:`⌆`,DoubleContourIntegral:`∯`,DoubleDot:`¨`,DoubleDownArrow:`⇓`,DoubleLeftArrow:`⇐`,DoubleLeftRightArrow:`⇔`,DoubleLeftTee:`⫤`,DoubleLongLeftArrow:`⟸`,DoubleLongLeftRightArrow:`⟺`,DoubleLongRightArrow:`⟹`,DoubleRightArrow:`⇒`,DoubleRightTee:`⊨`,DoubleUpArrow:`⇑`,DoubleUpDownArrow:`⇕`,DoubleVerticalBar:`∥`,DownArrow:`↓`,Downarrow:`⇓`,downarrow:`↓`,DownArrowBar:`⤓`,DownArrowUpArrow:`⇵`,DownBreve:`̑`,downdownarrows:`⇊`,downharpoonleft:`⇃`,downharpoonright:`⇂`,DownLeftRightVector:`⥐`,DownLeftTeeVector:`⥞`,DownLeftVector:`↽`,DownLeftVectorBar:`⥖`,DownRightTeeVector:`⥟`,DownRightVector:`⇁`,DownRightVectorBar:`⥗`,DownTee:`⊤`,DownTeeArrow:`↧`,drbkarow:`⤐`,drcorn:`⌟`,drcrop:`⌌`,Dscr:`𝒟`,dscr:`𝒹`,DScy:`Ѕ`,dscy:`ѕ`,dsol:`⧶`,Dstrok:`Đ`,dstrok:`đ`,dtdot:`⋱`,dtri:`▿`,dtrif:`▾`,duarr:`⇵`,duhar:`⥯`,dwangle:`⦦`,DZcy:`Џ`,dzcy:`џ`,dzigrarr:`⟿`,Eacute:`É`,eacute:`é`,easter:`⩮`,Ecaron:`Ě`,ecaron:`ě`,ecir:`≖`,Ecirc:`Ê`,ecirc:`ê`,ecolon:`≕`,Ecy:`Э`,ecy:`э`,eDDot:`⩷`,Edot:`Ė`,eDot:`≑`,edot:`ė`,ee:`ⅇ`,efDot:`≒`,Efr:`𝔈`,efr:`𝔢`,eg:`⪚`,Egrave:`È`,egrave:`è`,egs:`⪖`,egsdot:`⪘`,el:`⪙`,Element:`∈`,elinters:`⏧`,ell:`ℓ`,els:`⪕`,elsdot:`⪗`,Emacr:`Ē`,emacr:`ē`,empty:`∅`,emptyset:`∅`,EmptySmallSquare:`◻`,emptyv:`∅`,EmptyVerySmallSquare:`▫`,emsp:` `,emsp13:` `,emsp14:` `,ENG:`Ŋ`,eng:`ŋ`,ensp:` `,Eogon:`Ę`,eogon:`ę`,Eopf:`𝔼`,eopf:`𝕖`,epar:`⋕`,eparsl:`⧣`,eplus:`⩱`,epsi:`ε`,Epsilon:`Ε`,epsilon:`ε`,epsiv:`ϵ`,eqcirc:`≖`,eqcolon:`≕`,eqsim:`≂`,eqslantgtr:`⪖`,eqslantless:`⪕`,Equal:`⩵`,equals:`=`,EqualTilde:`≂`,equest:`≟`,Equilibrium:`⇌`,equiv:`≡`,equivDD:`⩸`,eqvparsl:`⧥`,erarr:`⥱`,erDot:`≓`,Escr:`ℰ`,escr:`ℯ`,esdot:`≐`,Esim:`⩳`,esim:`≂`,Eta:`Η`,eta:`η`,ETH:`Ð`,eth:`ð`,Euml:`Ë`,euml:`ë`,euro:`€`,excl:`!`,exist:`∃`,Exists:`∃`,expectation:`ℰ`,ExponentialE:`ⅇ`,exponentiale:`ⅇ`,fallingdotseq:`≒`,Fcy:`Ф`,fcy:`ф`,female:`♀`,ffilig:`ffi`,fflig:`ff`,ffllig:`ffl`,Ffr:`𝔉`,ffr:`𝔣`,filig:`fi`,FilledSmallSquare:`◼`,FilledVerySmallSquare:`▪`,fjlig:`fj`,flat:`♭`,fllig:`fl`,fltns:`▱`,fnof:`ƒ`,Fopf:`𝔽`,fopf:`𝕗`,ForAll:`∀`,forall:`∀`,fork:`⋔`,forkv:`⫙`,Fouriertrf:`ℱ`,fpartint:`⨍`,frac12:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`,frown:`⌢`,Fscr:`ℱ`,fscr:`𝒻`,gacute:`ǵ`,Gamma:`Γ`,gamma:`γ`,Gammad:`Ϝ`,gammad:`ϝ`,gap:`⪆`,Gbreve:`Ğ`,gbreve:`ğ`,Gcedil:`Ģ`,Gcirc:`Ĝ`,gcirc:`ĝ`,Gcy:`Г`,gcy:`г`,Gdot:`Ġ`,gdot:`ġ`,gE:`≧`,ge:`≥`,gEl:`⪌`,gel:`⋛`,geq:`≥`,geqq:`≧`,geqslant:`⩾`,ges:`⩾`,gescc:`⪩`,gesdot:`⪀`,gesdoto:`⪂`,gesdotol:`⪄`,gesl:`⋛︀`,gesles:`⪔`,Gfr:`𝔊`,gfr:`𝔤`,Gg:`⋙`,gg:`≫`,ggg:`⋙`,gimel:`ℷ`,GJcy:`Ѓ`,gjcy:`ѓ`,gl:`≷`,gla:`⪥`,glE:`⪒`,glj:`⪤`,gnap:`⪊`,gnapprox:`⪊`,gnE:`≩`,gne:`⪈`,gneq:`⪈`,gneqq:`≩`,gnsim:`⋧`,Gopf:`𝔾`,gopf:`𝕘`,grave:"`",GreaterEqual:`≥`,GreaterEqualLess:`⋛`,GreaterFullEqual:`≧`,GreaterGreater:`⪢`,GreaterLess:`≷`,GreaterSlantEqual:`⩾`,GreaterTilde:`≳`,Gscr:`𝒢`,gscr:`ℊ`,gsim:`≳`,gsime:`⪎`,gsiml:`⪐`,Gt:`≫`,GT:`>`,gt:`>`,gtcc:`⪧`,gtcir:`⩺`,gtdot:`⋗`,gtlPar:`⦕`,gtquest:`⩼`,gtrapprox:`⪆`,gtrarr:`⥸`,gtrdot:`⋗`,gtreqless:`⋛`,gtreqqless:`⪌`,gtrless:`≷`,gtrsim:`≳`,gvertneqq:`≩︀`,gvnE:`≩︀`,Hacek:`ˇ`,hairsp:` `,half:`½`,hamilt:`ℋ`,HARDcy:`Ъ`,hardcy:`ъ`,hArr:`⇔`,harr:`↔`,harrcir:`⥈`,harrw:`↭`,Hat:`^`,hbar:`ℏ`,Hcirc:`Ĥ`,hcirc:`ĥ`,hearts:`♥`,heartsuit:`♥`,hellip:`…`,hercon:`⊹`,Hfr:`ℌ`,hfr:`𝔥`,HilbertSpace:`ℋ`,hksearow:`⤥`,hkswarow:`⤦`,hoarr:`⇿`,homtht:`∻`,hookleftarrow:`↩`,hookrightarrow:`↪`,Hopf:`ℍ`,hopf:`𝕙`,horbar:`―`,HorizontalLine:`─`,Hscr:`ℋ`,hscr:`𝒽`,hslash:`ℏ`,Hstrok:`Ħ`,hstrok:`ħ`,HumpDownHump:`≎`,HumpEqual:`≏`,hybull:`⁃`,hyphen:`‐`,Iacute:`Í`,iacute:`í`,ic:``,Icirc:`Î`,icirc:`î`,Icy:`И`,icy:`и`,Idot:`İ`,IEcy:`Е`,iecy:`е`,iexcl:`¡`,iff:`⇔`,Ifr:`ℑ`,ifr:`𝔦`,Igrave:`Ì`,igrave:`ì`,ii:`ⅈ`,iiiint:`⨌`,iiint:`∭`,iinfin:`⧜`,iiota:`℩`,IJlig:`IJ`,ijlig:`ij`,Im:`ℑ`,Imacr:`Ī`,imacr:`ī`,image:`ℑ`,ImaginaryI:`ⅈ`,imagline:`ℐ`,imagpart:`ℑ`,imath:`ı`,imof:`⊷`,imped:`Ƶ`,Implies:`⇒`,in:`∈`,incare:`℅`,infin:`∞`,infintie:`⧝`,inodot:`ı`,Int:`∬`,int:`∫`,intcal:`⊺`,integers:`ℤ`,Integral:`∫`,intercal:`⊺`,Intersection:`⋂`,intlarhk:`⨗`,intprod:`⨼`,InvisibleComma:``,InvisibleTimes:``,IOcy:`Ё`,iocy:`ё`,Iogon:`Į`,iogon:`į`,Iopf:`𝕀`,iopf:`𝕚`,Iota:`Ι`,iota:`ι`,iprod:`⨼`,iquest:`¿`,Iscr:`ℐ`,iscr:`𝒾`,isin:`∈`,isindot:`⋵`,isinE:`⋹`,isins:`⋴`,isinsv:`⋳`,isinv:`∈`,it:``,Itilde:`Ĩ`,itilde:`ĩ`,Iukcy:`І`,iukcy:`і`,Iuml:`Ï`,iuml:`ï`,Jcirc:`Ĵ`,jcirc:`ĵ`,Jcy:`Й`,jcy:`й`,Jfr:`𝔍`,jfr:`𝔧`,jmath:`ȷ`,Jopf:`𝕁`,jopf:`𝕛`,Jscr:`𝒥`,jscr:`𝒿`,Jsercy:`Ј`,jsercy:`ј`,Jukcy:`Є`,jukcy:`є`,Kappa:`Κ`,kappa:`κ`,kappav:`ϰ`,Kcedil:`Ķ`,kcedil:`ķ`,Kcy:`К`,kcy:`к`,Kfr:`𝔎`,kfr:`𝔨`,kgreen:`ĸ`,KHcy:`Х`,khcy:`х`,KJcy:`Ќ`,kjcy:`ќ`,Kopf:`𝕂`,kopf:`𝕜`,Kscr:`𝒦`,kscr:`𝓀`,lAarr:`⇚`,Lacute:`Ĺ`,lacute:`ĺ`,laemptyv:`⦴`,lagran:`ℒ`,Lambda:`Λ`,lambda:`λ`,Lang:`⟪`,lang:`⟨`,langd:`⦑`,langle:`⟨`,lap:`⪅`,Laplacetrf:`ℒ`,laquo:`«`,Larr:`↞`,lArr:`⇐`,larr:`←`,larrb:`⇤`,larrbfs:`⤟`,larrfs:`⤝`,larrhk:`↩`,larrlp:`↫`,larrpl:`⤹`,larrsim:`⥳`,larrtl:`↢`,lat:`⪫`,lAtail:`⤛`,latail:`⤙`,late:`⪭`,lates:`⪭︀`,lBarr:`⤎`,lbarr:`⤌`,lbbrk:`❲`,lbrace:`{`,lbrack:`[`,lbrke:`⦋`,lbrksld:`⦏`,lbrkslu:`⦍`,Lcaron:`Ľ`,lcaron:`ľ`,Lcedil:`Ļ`,lcedil:`ļ`,lceil:`⌈`,lcub:`{`,Lcy:`Л`,lcy:`л`,ldca:`⤶`,ldquo:`“`,ldquor:`„`,ldrdhar:`⥧`,ldrushar:`⥋`,ldsh:`↲`,lE:`≦`,le:`≤`,LeftAngleBracket:`⟨`,LeftArrow:`←`,Leftarrow:`⇐`,leftarrow:`←`,LeftArrowBar:`⇤`,LeftArrowRightArrow:`⇆`,leftarrowtail:`↢`,LeftCeiling:`⌈`,LeftDoubleBracket:`⟦`,LeftDownTeeVector:`⥡`,LeftDownVector:`⇃`,LeftDownVectorBar:`⥙`,LeftFloor:`⌊`,leftharpoondown:`↽`,leftharpoonup:`↼`,leftleftarrows:`⇇`,LeftRightArrow:`↔`,Leftrightarrow:`⇔`,leftrightarrow:`↔`,leftrightarrows:`⇆`,leftrightharpoons:`⇋`,leftrightsquigarrow:`↭`,LeftRightVector:`⥎`,LeftTee:`⊣`,LeftTeeArrow:`↤`,LeftTeeVector:`⥚`,leftthreetimes:`⋋`,LeftTriangle:`⊲`,LeftTriangleBar:`⧏`,LeftTriangleEqual:`⊴`,LeftUpDownVector:`⥑`,LeftUpTeeVector:`⥠`,LeftUpVector:`↿`,LeftUpVectorBar:`⥘`,LeftVector:`↼`,LeftVectorBar:`⥒`,lEg:`⪋`,leg:`⋚`,leq:`≤`,leqq:`≦`,leqslant:`⩽`,les:`⩽`,lescc:`⪨`,lesdot:`⩿`,lesdoto:`⪁`,lesdotor:`⪃`,lesg:`⋚︀`,lesges:`⪓`,lessapprox:`⪅`,lessdot:`⋖`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,LessEqualGreater:`⋚`,LessFullEqual:`≦`,LessGreater:`≶`,lessgtr:`≶`,LessLess:`⪡`,lesssim:`≲`,LessSlantEqual:`⩽`,LessTilde:`≲`,lfisht:`⥼`,lfloor:`⌊`,Lfr:`𝔏`,lfr:`𝔩`,lg:`≶`,lgE:`⪑`,lHar:`⥢`,lhard:`↽`,lharu:`↼`,lharul:`⥪`,lhblk:`▄`,LJcy:`Љ`,ljcy:`љ`,Ll:`⋘`,ll:`≪`,llarr:`⇇`,llcorner:`⌞`,Lleftarrow:`⇚`,llhard:`⥫`,lltri:`◺`,Lmidot:`Ŀ`,lmidot:`ŀ`,lmoust:`⎰`,lmoustache:`⎰`,lnap:`⪉`,lnapprox:`⪉`,lnE:`≨`,lne:`⪇`,lneq:`⪇`,lneqq:`≨`,lnsim:`⋦`,loang:`⟬`,loarr:`⇽`,lobrk:`⟦`,LongLeftArrow:`⟵`,Longleftarrow:`⟸`,longleftarrow:`⟵`,LongLeftRightArrow:`⟷`,Longleftrightarrow:`⟺`,longleftrightarrow:`⟷`,longmapsto:`⟼`,LongRightArrow:`⟶`,Longrightarrow:`⟹`,longrightarrow:`⟶`,looparrowleft:`↫`,looparrowright:`↬`,lopar:`⦅`,Lopf:`𝕃`,lopf:`𝕝`,loplus:`⨭`,lotimes:`⨴`,lowast:`∗`,lowbar:`_`,LowerLeftArrow:`↙`,LowerRightArrow:`↘`,loz:`◊`,lozenge:`◊`,lozf:`⧫`,lpar:`(`,lparlt:`⦓`,lrarr:`⇆`,lrcorner:`⌟`,lrhar:`⇋`,lrhard:`⥭`,lrm:``,lrtri:`⊿`,lsaquo:`‹`,Lscr:`ℒ`,lscr:`𝓁`,Lsh:`↰`,lsh:`↰`,lsim:`≲`,lsime:`⪍`,lsimg:`⪏`,lsqb:`[`,lsquo:`‘`,lsquor:`‚`,Lstrok:`Ł`,lstrok:`ł`,Lt:`≪`,LT:`<`,lt:`<`,ltcc:`⪦`,ltcir:`⩹`,ltdot:`⋖`,lthree:`⋋`,ltimes:`⋉`,ltlarr:`⥶`,ltquest:`⩻`,ltri:`◃`,ltrie:`⊴`,ltrif:`◂`,ltrPar:`⦖`,lurdshar:`⥊`,luruhar:`⥦`,lvertneqq:`≨︀`,lvnE:`≨︀`,macr:`¯`,male:`♂`,malt:`✠`,maltese:`✠`,Map:`⤅`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,mapstoleft:`↤`,mapstoup:`↥`,marker:`▮`,mcomma:`⨩`,Mcy:`М`,mcy:`м`,mdash:`—`,mDDot:`∺`,measuredangle:`∡`,MediumSpace:` `,Mellintrf:`ℳ`,Mfr:`𝔐`,mfr:`𝔪`,mho:`℧`,micro:`µ`,mid:`∣`,midast:`*`,midcir:`⫰`,middot:`·`,minus:`−`,minusb:`⊟`,minusd:`∸`,minusdu:`⨪`,MinusPlus:`∓`,mlcp:`⫛`,mldr:`…`,mnplus:`∓`,models:`⊧`,Mopf:`𝕄`,mopf:`𝕞`,mp:`∓`,Mscr:`ℳ`,mscr:`𝓂`,mstpos:`∾`,Mu:`Μ`,mu:`μ`,multimap:`⊸`,mumap:`⊸`,nabla:`∇`,Nacute:`Ń`,nacute:`ń`,nang:`∠⃒`,nap:`≉`,napE:`⩰̸`,napid:`≋̸`,napos:`ʼn`,napprox:`≉`,natur:`♮`,natural:`♮`,naturals:`ℕ`,nbsp:`\xA0`,nbump:`≎̸`,nbumpe:`≏̸`,ncap:`⩃`,Ncaron:`Ň`,ncaron:`ň`,Ncedil:`Ņ`,ncedil:`ņ`,ncong:`≇`,ncongdot:`⩭̸`,ncup:`⩂`,Ncy:`Н`,ncy:`н`,ndash:`–`,ne:`≠`,nearhk:`⤤`,neArr:`⇗`,nearr:`↗`,nearrow:`↗`,nedot:`≐̸`,NegativeMediumSpace:``,NegativeThickSpace:``,NegativeThinSpace:``,NegativeVeryThinSpace:``,nequiv:`≢`,nesear:`⤨`,nesim:`≂̸`,NestedGreaterGreater:`≫`,NestedLessLess:`≪`,NewLine:`
|
|
455
|
+
`,nexist:`∄`,nexists:`∄`,Nfr:`𝔑`,nfr:`𝔫`,ngE:`≧̸`,nge:`≱`,ngeq:`≱`,ngeqq:`≧̸`,ngeqslant:`⩾̸`,nges:`⩾̸`,nGg:`⋙̸`,ngsim:`≵`,nGt:`≫⃒`,ngt:`≯`,ngtr:`≯`,nGtv:`≫̸`,nhArr:`⇎`,nharr:`↮`,nhpar:`⫲`,ni:`∋`,nis:`⋼`,nisd:`⋺`,niv:`∋`,NJcy:`Њ`,njcy:`њ`,nlArr:`⇍`,nlarr:`↚`,nldr:`‥`,nlE:`≦̸`,nle:`≰`,nLeftarrow:`⇍`,nleftarrow:`↚`,nLeftrightarrow:`⇎`,nleftrightarrow:`↮`,nleq:`≰`,nleqq:`≦̸`,nleqslant:`⩽̸`,nles:`⩽̸`,nless:`≮`,nLl:`⋘̸`,nlsim:`≴`,nLt:`≪⃒`,nlt:`≮`,nltri:`⋪`,nltrie:`⋬`,nLtv:`≪̸`,nmid:`∤`,NoBreak:``,NonBreakingSpace:`\xA0`,Nopf:`ℕ`,nopf:`𝕟`,Not:`⫬`,not:`¬`,NotCongruent:`≢`,NotCupCap:`≭`,NotDoubleVerticalBar:`∦`,NotElement:`∉`,NotEqual:`≠`,NotEqualTilde:`≂̸`,NotExists:`∄`,NotGreater:`≯`,NotGreaterEqual:`≱`,NotGreaterFullEqual:`≧̸`,NotGreaterGreater:`≫̸`,NotGreaterLess:`≹`,NotGreaterSlantEqual:`⩾̸`,NotGreaterTilde:`≵`,NotHumpDownHump:`≎̸`,NotHumpEqual:`≏̸`,notin:`∉`,notindot:`⋵̸`,notinE:`⋹̸`,notinva:`∉`,notinvb:`⋷`,notinvc:`⋶`,NotLeftTriangle:`⋪`,NotLeftTriangleBar:`⧏̸`,NotLeftTriangleEqual:`⋬`,NotLess:`≮`,NotLessEqual:`≰`,NotLessGreater:`≸`,NotLessLess:`≪̸`,NotLessSlantEqual:`⩽̸`,NotLessTilde:`≴`,NotNestedGreaterGreater:`⪢̸`,NotNestedLessLess:`⪡̸`,notni:`∌`,notniva:`∌`,notnivb:`⋾`,notnivc:`⋽`,NotPrecedes:`⊀`,NotPrecedesEqual:`⪯̸`,NotPrecedesSlantEqual:`⋠`,NotReverseElement:`∌`,NotRightTriangle:`⋫`,NotRightTriangleBar:`⧐̸`,NotRightTriangleEqual:`⋭`,NotSquareSubset:`⊏̸`,NotSquareSubsetEqual:`⋢`,NotSquareSuperset:`⊐̸`,NotSquareSupersetEqual:`⋣`,NotSubset:`⊂⃒`,NotSubsetEqual:`⊈`,NotSucceeds:`⊁`,NotSucceedsEqual:`⪰̸`,NotSucceedsSlantEqual:`⋡`,NotSucceedsTilde:`≿̸`,NotSuperset:`⊃⃒`,NotSupersetEqual:`⊉`,NotTilde:`≁`,NotTildeEqual:`≄`,NotTildeFullEqual:`≇`,NotTildeTilde:`≉`,NotVerticalBar:`∤`,npar:`∦`,nparallel:`∦`,nparsl:`⫽⃥`,npart:`∂̸`,npolint:`⨔`,npr:`⊀`,nprcue:`⋠`,npre:`⪯̸`,nprec:`⊀`,npreceq:`⪯̸`,nrArr:`⇏`,nrarr:`↛`,nrarrc:`⤳̸`,nrarrw:`↝̸`,nRightarrow:`⇏`,nrightarrow:`↛`,nrtri:`⋫`,nrtrie:`⋭`,nsc:`⊁`,nsccue:`⋡`,nsce:`⪰̸`,Nscr:`𝒩`,nscr:`𝓃`,nshortmid:`∤`,nshortparallel:`∦`,nsim:`≁`,nsime:`≄`,nsimeq:`≄`,nsmid:`∤`,nspar:`∦`,nsqsube:`⋢`,nsqsupe:`⋣`,nsub:`⊄`,nsubE:`⫅̸`,nsube:`⊈`,nsubset:`⊂⃒`,nsubseteq:`⊈`,nsubseteqq:`⫅̸`,nsucc:`⊁`,nsucceq:`⪰̸`,nsup:`⊅`,nsupE:`⫆̸`,nsupe:`⊉`,nsupset:`⊃⃒`,nsupseteq:`⊉`,nsupseteqq:`⫆̸`,ntgl:`≹`,Ntilde:`Ñ`,ntilde:`ñ`,ntlg:`≸`,ntriangleleft:`⋪`,ntrianglelefteq:`⋬`,ntriangleright:`⋫`,ntrianglerighteq:`⋭`,Nu:`Ν`,nu:`ν`,num:`#`,numero:`№`,numsp:` `,nvap:`≍⃒`,nVDash:`⊯`,nVdash:`⊮`,nvDash:`⊭`,nvdash:`⊬`,nvge:`≥⃒`,nvgt:`>⃒`,nvHarr:`⤄`,nvinfin:`⧞`,nvlArr:`⤂`,nvle:`≤⃒`,nvlt:`<⃒`,nvltrie:`⊴⃒`,nvrArr:`⤃`,nvrtrie:`⊵⃒`,nvsim:`∼⃒`,nwarhk:`⤣`,nwArr:`⇖`,nwarr:`↖`,nwarrow:`↖`,nwnear:`⤧`,Oacute:`Ó`,oacute:`ó`,oast:`⊛`,ocir:`⊚`,Ocirc:`Ô`,ocirc:`ô`,Ocy:`О`,ocy:`о`,odash:`⊝`,Odblac:`Ő`,odblac:`ő`,odiv:`⨸`,odot:`⊙`,odsold:`⦼`,OElig:`Œ`,oelig:`œ`,ofcir:`⦿`,Ofr:`𝔒`,ofr:`𝔬`,ogon:`˛`,Ograve:`Ò`,ograve:`ò`,ogt:`⧁`,ohbar:`⦵`,ohm:`Ω`,oint:`∮`,olarr:`↺`,olcir:`⦾`,olcross:`⦻`,oline:`‾`,olt:`⧀`,Omacr:`Ō`,omacr:`ō`,Omega:`Ω`,omega:`ω`,Omicron:`Ο`,omicron:`ο`,omid:`⦶`,ominus:`⊖`,Oopf:`𝕆`,oopf:`𝕠`,opar:`⦷`,OpenCurlyDoubleQuote:`“`,OpenCurlyQuote:`‘`,operp:`⦹`,oplus:`⊕`,Or:`⩔`,or:`∨`,orarr:`↻`,ord:`⩝`,order:`ℴ`,orderof:`ℴ`,ordf:`ª`,ordm:`º`,origof:`⊶`,oror:`⩖`,orslope:`⩗`,orv:`⩛`,oS:`Ⓢ`,Oscr:`𝒪`,oscr:`ℴ`,Oslash:`Ø`,oslash:`ø`,osol:`⊘`,Otilde:`Õ`,otilde:`õ`,Otimes:`⨷`,otimes:`⊗`,otimesas:`⨶`,Ouml:`Ö`,ouml:`ö`,ovbar:`⌽`,OverBar:`‾`,OverBrace:`⏞`,OverBracket:`⎴`,OverParenthesis:`⏜`,par:`∥`,para:`¶`,parallel:`∥`,parsim:`⫳`,parsl:`⫽`,part:`∂`,PartialD:`∂`,Pcy:`П`,pcy:`п`,percnt:`%`,period:`.`,permil:`‰`,perp:`⊥`,pertenk:`‱`,Pfr:`𝔓`,pfr:`𝔭`,Phi:`Φ`,phi:`φ`,phiv:`ϕ`,phmmat:`ℳ`,phone:`☎`,Pi:`Π`,pi:`π`,pitchfork:`⋔`,piv:`ϖ`,planck:`ℏ`,planckh:`ℎ`,plankv:`ℏ`,plus:`+`,plusacir:`⨣`,plusb:`⊞`,pluscir:`⨢`,plusdo:`∔`,plusdu:`⨥`,pluse:`⩲`,PlusMinus:`±`,plusmn:`±`,plussim:`⨦`,plustwo:`⨧`,pm:`±`,Poincareplane:`ℌ`,pointint:`⨕`,Popf:`ℙ`,popf:`𝕡`,pound:`£`,Pr:`⪻`,pr:`≺`,prap:`⪷`,prcue:`≼`,prE:`⪳`,pre:`⪯`,prec:`≺`,precapprox:`⪷`,preccurlyeq:`≼`,Precedes:`≺`,PrecedesEqual:`⪯`,PrecedesSlantEqual:`≼`,PrecedesTilde:`≾`,preceq:`⪯`,precnapprox:`⪹`,precneqq:`⪵`,precnsim:`⋨`,precsim:`≾`,Prime:`″`,prime:`′`,primes:`ℙ`,prnap:`⪹`,prnE:`⪵`,prnsim:`⋨`,prod:`∏`,Product:`∏`,profalar:`⌮`,profline:`⌒`,profsurf:`⌓`,prop:`∝`,Proportion:`∷`,Proportional:`∝`,propto:`∝`,prsim:`≾`,prurel:`⊰`,Pscr:`𝒫`,pscr:`𝓅`,Psi:`Ψ`,psi:`ψ`,puncsp:` `,Qfr:`𝔔`,qfr:`𝔮`,qint:`⨌`,Qopf:`ℚ`,qopf:`𝕢`,qprime:`⁗`,Qscr:`𝒬`,qscr:`𝓆`,quaternions:`ℍ`,quatint:`⨖`,quest:`?`,questeq:`≟`,QUOT:`"`,quot:`"`,rAarr:`⇛`,race:`∽̱`,Racute:`Ŕ`,racute:`ŕ`,radic:`√`,raemptyv:`⦳`,Rang:`⟫`,rang:`⟩`,rangd:`⦒`,range:`⦥`,rangle:`⟩`,raquo:`»`,Rarr:`↠`,rArr:`⇒`,rarr:`→`,rarrap:`⥵`,rarrb:`⇥`,rarrbfs:`⤠`,rarrc:`⤳`,rarrfs:`⤞`,rarrhk:`↪`,rarrlp:`↬`,rarrpl:`⥅`,rarrsim:`⥴`,Rarrtl:`⤖`,rarrtl:`↣`,rarrw:`↝`,rAtail:`⤜`,ratail:`⤚`,ratio:`∶`,rationals:`ℚ`,RBarr:`⤐`,rBarr:`⤏`,rbarr:`⤍`,rbbrk:`❳`,rbrace:`}`,rbrack:`]`,rbrke:`⦌`,rbrksld:`⦎`,rbrkslu:`⦐`,Rcaron:`Ř`,rcaron:`ř`,Rcedil:`Ŗ`,rcedil:`ŗ`,rceil:`⌉`,rcub:`}`,Rcy:`Р`,rcy:`р`,rdca:`⤷`,rdldhar:`⥩`,rdquo:`”`,rdquor:`”`,rdsh:`↳`,Re:`ℜ`,real:`ℜ`,realine:`ℛ`,realpart:`ℜ`,reals:`ℝ`,rect:`▭`,REG:`®`,reg:`®`,ReverseElement:`∋`,ReverseEquilibrium:`⇋`,ReverseUpEquilibrium:`⥯`,rfisht:`⥽`,rfloor:`⌋`,Rfr:`ℜ`,rfr:`𝔯`,rHar:`⥤`,rhard:`⇁`,rharu:`⇀`,rharul:`⥬`,Rho:`Ρ`,rho:`ρ`,rhov:`ϱ`,RightAngleBracket:`⟩`,RightArrow:`→`,Rightarrow:`⇒`,rightarrow:`→`,RightArrowBar:`⇥`,RightArrowLeftArrow:`⇄`,rightarrowtail:`↣`,RightCeiling:`⌉`,RightDoubleBracket:`⟧`,RightDownTeeVector:`⥝`,RightDownVector:`⇂`,RightDownVectorBar:`⥕`,RightFloor:`⌋`,rightharpoondown:`⇁`,rightharpoonup:`⇀`,rightleftarrows:`⇄`,rightleftharpoons:`⇌`,rightrightarrows:`⇉`,rightsquigarrow:`↝`,RightTee:`⊢`,RightTeeArrow:`↦`,RightTeeVector:`⥛`,rightthreetimes:`⋌`,RightTriangle:`⊳`,RightTriangleBar:`⧐`,RightTriangleEqual:`⊵`,RightUpDownVector:`⥏`,RightUpTeeVector:`⥜`,RightUpVector:`↾`,RightUpVectorBar:`⥔`,RightVector:`⇀`,RightVectorBar:`⥓`,ring:`˚`,risingdotseq:`≓`,rlarr:`⇄`,rlhar:`⇌`,rlm:``,rmoust:`⎱`,rmoustache:`⎱`,rnmid:`⫮`,roang:`⟭`,roarr:`⇾`,robrk:`⟧`,ropar:`⦆`,Ropf:`ℝ`,ropf:`𝕣`,roplus:`⨮`,rotimes:`⨵`,RoundImplies:`⥰`,rpar:`)`,rpargt:`⦔`,rppolint:`⨒`,rrarr:`⇉`,Rrightarrow:`⇛`,rsaquo:`›`,Rscr:`ℛ`,rscr:`𝓇`,Rsh:`↱`,rsh:`↱`,rsqb:`]`,rsquo:`’`,rsquor:`’`,rthree:`⋌`,rtimes:`⋊`,rtri:`▹`,rtrie:`⊵`,rtrif:`▸`,rtriltri:`⧎`,RuleDelayed:`⧴`,ruluhar:`⥨`,rx:`℞`,Sacute:`Ś`,sacute:`ś`,sbquo:`‚`,Sc:`⪼`,sc:`≻`,scap:`⪸`,Scaron:`Š`,scaron:`š`,sccue:`≽`,scE:`⪴`,sce:`⪰`,Scedil:`Ş`,scedil:`ş`,Scirc:`Ŝ`,scirc:`ŝ`,scnap:`⪺`,scnE:`⪶`,scnsim:`⋩`,scpolint:`⨓`,scsim:`≿`,Scy:`С`,scy:`с`,sdot:`⋅`,sdotb:`⊡`,sdote:`⩦`,searhk:`⤥`,seArr:`⇘`,searr:`↘`,searrow:`↘`,sect:`§`,semi:`;`,seswar:`⤩`,setminus:`∖`,setmn:`∖`,sext:`✶`,Sfr:`𝔖`,sfr:`𝔰`,sfrown:`⌢`,sharp:`♯`,SHCHcy:`Щ`,shchcy:`щ`,SHcy:`Ш`,shcy:`ш`,ShortDownArrow:`↓`,ShortLeftArrow:`←`,shortmid:`∣`,shortparallel:`∥`,ShortRightArrow:`→`,ShortUpArrow:`↑`,shy:``,Sigma:`Σ`,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,sim:`∼`,simdot:`⩪`,sime:`≃`,simeq:`≃`,simg:`⪞`,simgE:`⪠`,siml:`⪝`,simlE:`⪟`,simne:`≆`,simplus:`⨤`,simrarr:`⥲`,slarr:`←`,SmallCircle:`∘`,smallsetminus:`∖`,smashp:`⨳`,smeparsl:`⧤`,smid:`∣`,smile:`⌣`,smt:`⪪`,smte:`⪬`,smtes:`⪬︀`,SOFTcy:`Ь`,softcy:`ь`,sol:`/`,solb:`⧄`,solbar:`⌿`,Sopf:`𝕊`,sopf:`𝕤`,spades:`♠`,spadesuit:`♠`,spar:`∥`,sqcap:`⊓`,sqcaps:`⊓︀`,sqcup:`⊔`,sqcups:`⊔︀`,Sqrt:`√`,sqsub:`⊏`,sqsube:`⊑`,sqsubset:`⊏`,sqsubseteq:`⊑`,sqsup:`⊐`,sqsupe:`⊒`,sqsupset:`⊐`,sqsupseteq:`⊒`,squ:`□`,Square:`□`,square:`□`,SquareIntersection:`⊓`,SquareSubset:`⊏`,SquareSubsetEqual:`⊑`,SquareSuperset:`⊐`,SquareSupersetEqual:`⊒`,SquareUnion:`⊔`,squarf:`▪`,squf:`▪`,srarr:`→`,Sscr:`𝒮`,sscr:`𝓈`,ssetmn:`∖`,ssmile:`⌣`,sstarf:`⋆`,Star:`⋆`,star:`☆`,starf:`★`,straightepsilon:`ϵ`,straightphi:`ϕ`,strns:`¯`,Sub:`⋐`,sub:`⊂`,subdot:`⪽`,subE:`⫅`,sube:`⊆`,subedot:`⫃`,submult:`⫁`,subnE:`⫋`,subne:`⊊`,subplus:`⪿`,subrarr:`⥹`,Subset:`⋐`,subset:`⊂`,subseteq:`⊆`,subseteqq:`⫅`,SubsetEqual:`⊆`,subsetneq:`⊊`,subsetneqq:`⫋`,subsim:`⫇`,subsub:`⫕`,subsup:`⫓`,succ:`≻`,succapprox:`⪸`,succcurlyeq:`≽`,Succeeds:`≻`,SucceedsEqual:`⪰`,SucceedsSlantEqual:`≽`,SucceedsTilde:`≿`,succeq:`⪰`,succnapprox:`⪺`,succneqq:`⪶`,succnsim:`⋩`,succsim:`≿`,SuchThat:`∋`,Sum:`∑`,sum:`∑`,sung:`♪`,Sup:`⋑`,sup:`⊃`,sup1:`¹`,sup2:`²`,sup3:`³`,supdot:`⪾`,supdsub:`⫘`,supE:`⫆`,supe:`⊇`,supedot:`⫄`,Superset:`⊃`,SupersetEqual:`⊇`,suphsol:`⟉`,suphsub:`⫗`,suplarr:`⥻`,supmult:`⫂`,supnE:`⫌`,supne:`⊋`,supplus:`⫀`,Supset:`⋑`,supset:`⊃`,supseteq:`⊇`,supseteqq:`⫆`,supsetneq:`⊋`,supsetneqq:`⫌`,supsim:`⫈`,supsub:`⫔`,supsup:`⫖`,swarhk:`⤦`,swArr:`⇙`,swarr:`↙`,swarrow:`↙`,swnwar:`⤪`,szlig:`ß`,Tab:` `,target:`⌖`,Tau:`Τ`,tau:`τ`,tbrk:`⎴`,Tcaron:`Ť`,tcaron:`ť`,Tcedil:`Ţ`,tcedil:`ţ`,Tcy:`Т`,tcy:`т`,tdot:`⃛`,telrec:`⌕`,Tfr:`𝔗`,tfr:`𝔱`,there4:`∴`,Therefore:`∴`,therefore:`∴`,Theta:`Θ`,theta:`θ`,thetasym:`ϑ`,thetav:`ϑ`,thickapprox:`≈`,thicksim:`∼`,ThickSpace:` `,thinsp:` `,ThinSpace:` `,thkap:`≈`,thksim:`∼`,THORN:`Þ`,thorn:`þ`,Tilde:`∼`,tilde:`˜`,TildeEqual:`≃`,TildeFullEqual:`≅`,TildeTilde:`≈`,times:`×`,timesb:`⊠`,timesbar:`⨱`,timesd:`⨰`,tint:`∭`,toea:`⤨`,top:`⊤`,topbot:`⌶`,topcir:`⫱`,Topf:`𝕋`,topf:`𝕥`,topfork:`⫚`,tosa:`⤩`,tprime:`‴`,TRADE:`™`,trade:`™`,triangle:`▵`,triangledown:`▿`,triangleleft:`◃`,trianglelefteq:`⊴`,triangleq:`≜`,triangleright:`▹`,trianglerighteq:`⊵`,tridot:`◬`,trie:`≜`,triminus:`⨺`,TripleDot:`⃛`,triplus:`⨹`,trisb:`⧍`,tritime:`⨻`,trpezium:`⏢`,Tscr:`𝒯`,tscr:`𝓉`,TScy:`Ц`,tscy:`ц`,TSHcy:`Ћ`,tshcy:`ћ`,Tstrok:`Ŧ`,tstrok:`ŧ`,twixt:`≬`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,Uacute:`Ú`,uacute:`ú`,Uarr:`↟`,uArr:`⇑`,uarr:`↑`,Uarrocir:`⥉`,Ubrcy:`Ў`,ubrcy:`ў`,Ubreve:`Ŭ`,ubreve:`ŭ`,Ucirc:`Û`,ucirc:`û`,Ucy:`У`,ucy:`у`,udarr:`⇅`,Udblac:`Ű`,udblac:`ű`,udhar:`⥮`,ufisht:`⥾`,Ufr:`𝔘`,ufr:`𝔲`,Ugrave:`Ù`,ugrave:`ù`,uHar:`⥣`,uharl:`↿`,uharr:`↾`,uhblk:`▀`,ulcorn:`⌜`,ulcorner:`⌜`,ulcrop:`⌏`,ultri:`◸`,Umacr:`Ū`,umacr:`ū`,uml:`¨`,UnderBar:`_`,UnderBrace:`⏟`,UnderBracket:`⎵`,UnderParenthesis:`⏝`,Union:`⋃`,UnionPlus:`⊎`,Uogon:`Ų`,uogon:`ų`,Uopf:`𝕌`,uopf:`𝕦`,UpArrow:`↑`,Uparrow:`⇑`,uparrow:`↑`,UpArrowBar:`⤒`,UpArrowDownArrow:`⇅`,UpDownArrow:`↕`,Updownarrow:`⇕`,updownarrow:`↕`,UpEquilibrium:`⥮`,upharpoonleft:`↿`,upharpoonright:`↾`,uplus:`⊎`,UpperLeftArrow:`↖`,UpperRightArrow:`↗`,Upsi:`ϒ`,upsi:`υ`,upsih:`ϒ`,Upsilon:`Υ`,upsilon:`υ`,UpTee:`⊥`,UpTeeArrow:`↥`,upuparrows:`⇈`,urcorn:`⌝`,urcorner:`⌝`,urcrop:`⌎`,Uring:`Ů`,uring:`ů`,urtri:`◹`,Uscr:`𝒰`,uscr:`𝓊`,utdot:`⋰`,Utilde:`Ũ`,utilde:`ũ`,utri:`▵`,utrif:`▴`,uuarr:`⇈`,Uuml:`Ü`,uuml:`ü`,uwangle:`⦧`,vangrt:`⦜`,varepsilon:`ϵ`,varkappa:`ϰ`,varnothing:`∅`,varphi:`ϕ`,varpi:`ϖ`,varpropto:`∝`,vArr:`⇕`,varr:`↕`,varrho:`ϱ`,varsigma:`ς`,varsubsetneq:`⊊︀`,varsubsetneqq:`⫋︀`,varsupsetneq:`⊋︀`,varsupsetneqq:`⫌︀`,vartheta:`ϑ`,vartriangleleft:`⊲`,vartriangleright:`⊳`,Vbar:`⫫`,vBar:`⫨`,vBarv:`⫩`,Vcy:`В`,vcy:`в`,VDash:`⊫`,Vdash:`⊩`,vDash:`⊨`,vdash:`⊢`,Vdashl:`⫦`,Vee:`⋁`,vee:`∨`,veebar:`⊻`,veeeq:`≚`,vellip:`⋮`,Verbar:`‖`,verbar:`|`,Vert:`‖`,vert:`|`,VerticalBar:`∣`,VerticalLine:`|`,VerticalSeparator:`❘`,VerticalTilde:`≀`,VeryThinSpace:` `,Vfr:`𝔙`,vfr:`𝔳`,vltri:`⊲`,vnsub:`⊂⃒`,vnsup:`⊃⃒`,Vopf:`𝕍`,vopf:`𝕧`,vprop:`∝`,vrtri:`⊳`,Vscr:`𝒱`,vscr:`𝓋`,vsubnE:`⫋︀`,vsubne:`⊊︀`,vsupnE:`⫌︀`,vsupne:`⊋︀`,Vvdash:`⊪`,vzigzag:`⦚`,Wcirc:`Ŵ`,wcirc:`ŵ`,wedbar:`⩟`,Wedge:`⋀`,wedge:`∧`,wedgeq:`≙`,weierp:`℘`,Wfr:`𝔚`,wfr:`𝔴`,Wopf:`𝕎`,wopf:`𝕨`,wp:`℘`,wr:`≀`,wreath:`≀`,Wscr:`𝒲`,wscr:`𝓌`,xcap:`⋂`,xcirc:`◯`,xcup:`⋃`,xdtri:`▽`,Xfr:`𝔛`,xfr:`𝔵`,xhArr:`⟺`,xharr:`⟷`,Xi:`Ξ`,xi:`ξ`,xlArr:`⟸`,xlarr:`⟵`,xmap:`⟼`,xnis:`⋻`,xodot:`⨀`,Xopf:`𝕏`,xopf:`𝕩`,xoplus:`⨁`,xotime:`⨂`,xrArr:`⟹`,xrarr:`⟶`,Xscr:`𝒳`,xscr:`𝓍`,xsqcup:`⨆`,xuplus:`⨄`,xutri:`△`,xvee:`⋁`,xwedge:`⋀`,Yacute:`Ý`,yacute:`ý`,YAcy:`Я`,yacy:`я`,Ycirc:`Ŷ`,ycirc:`ŷ`,Ycy:`Ы`,ycy:`ы`,yen:`¥`,Yfr:`𝔜`,yfr:`𝔶`,YIcy:`Ї`,yicy:`ї`,Yopf:`𝕐`,yopf:`𝕪`,Yscr:`𝒴`,yscr:`𝓎`,YUcy:`Ю`,yucy:`ю`,Yuml:`Ÿ`,yuml:`ÿ`,Zacute:`Ź`,zacute:`ź`,Zcaron:`Ž`,zcaron:`ž`,Zcy:`З`,zcy:`з`,Zdot:`Ż`,zdot:`ż`,zeetrf:`ℨ`,ZeroWidthSpace:``,Zeta:`Ζ`,zeta:`ζ`,Zfr:`ℨ`,zfr:`𝔷`,ZHcy:`Ж`,zhcy:`ж`,zigrarr:`⇝`,Zopf:`ℤ`,zopf:`𝕫`,Zscr:`𝒵`,zscr:`𝓏`,zwj:``,zwnj:``}),e.entityMap=e.HTML_ENTITIES})),OU=s((e=>{var t=TU().NAMESPACE,n=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,r=RegExp(`[\\-\\.0-9`+n.source.slice(1,-1)+`\\u00B7\\u0300-\\u036F\\u203F-\\u2040]`),i=RegExp(`^`+n.source+r.source+`*(?::`+n.source+r.source+`*)?$`),a=0,o=1,s=2,c=3,l=4,u=5,d=6,f=7;function p(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,p)}p.prototype=Error(),p.prototype.name=p.name;function m(){}m.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),x(t,t={}),h(e,t,n,r,this.errorHandler),r.endDocument()}};function h(e,n,r,i,a){function o(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}else return String.fromCharCode(e)}function s(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(r,t)?r[t]:t.charAt(0)===`#`?o(parseInt(t.substr(1).replace(`x`,`0x`))):(a.error(`entity not found:`+e),e)}function c(t){if(t>T){var n=e.substring(T,t).replace(/&#?\w+;/g,s);m&&l(T),i.characters(n,0,t-T),T=t}}function l(t,n){for(;t>=d&&(n=f.exec(e));)u=n.index,d=u+n[0].length,m.lineNumber++;m.columnNumber=t-u+1}for(var u=0,d=0,f=/.*(?:\r\n?|\n)|.*$/g,m=i.locator,h=[{currentNSMap:n}],x={},T=0;;){try{var E=e.indexOf(`<`,T);if(E<0){if(!e.substr(T).match(/^\s*$/)){var D=i.doc,O=D.createTextNode(e.substr(T));D.appendChild(O),i.currentElement=O}return}switch(E>T&&c(E),e.charAt(E+1)){case`/`:var k=e.indexOf(`>`,E+3),A=e.substring(E+2,k).replace(/[ \t\n\r]+$/g,``),j=h.pop();k<0?(A=e.substring(E+2).replace(/[\s<].*/,``),a.error(`end tag name: `+A+` is not complete:`+j.tagName),k=E+1+A.length):A.match(/\s</)&&(A=A.replace(/[\s<].*/,``),a.error(`end tag name: `+A+` maybe not complete`),k=E+1+A.length);var M=j.localNSMap,N=j.tagName==A;if(N||j.tagName&&j.tagName.toLowerCase()==A.toLowerCase()){if(i.endElement(j.uri,j.localName,A),M)for(var P in M)Object.prototype.hasOwnProperty.call(M,P)&&i.endPrefixMapping(P);N||a.fatalError(`end tag name: `+A+` is not match the current start tagName:`+j.tagName)}else h.push(j);k++;break;case`?`:m&&l(E),k=C(e,E,i);break;case`!`:m&&l(E),k=S(e,E,i,a);break;default:m&&l(E);var F=new w,I=h[h.length-1].currentNSMap,k=_(e,E,F,I,s,a),L=F.length;if(!F.closed&&b(e,k,F.tagName,x)&&(F.closed=!0,r.nbsp||a.warning(`unclosed xml attribute`)),m&&L){for(var R=g(m,{}),z=0;z<L;z++){var B=F[z];l(B.offset),B.locator=g(m,{})}i.locator=R,v(F,i,I)&&h.push(F),i.locator=m}else v(F,i,I)&&h.push(F);t.isHTML(F.uri)&&!F.closed?k=y(e,k,F.tagName,s,i):k++}}catch(e){if(e instanceof p)throw e;a.error(`element parse error: `+e),k=-1}k>T?T=k:c(Math.max(E,T)+1)}}function g(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function _(e,n,r,i,p,m){function h(e,t,n){r.attributeNames.hasOwnProperty(e)&&m.fatalError(`Attribute `+e+` redefined`),r.addValue(e,t.replace(/[\t\n\r]/g,` `).replace(/&#?\w+;/g,p),n)}for(var g,_,v=++n,y=a;;){var b=e.charAt(v);switch(b){case`=`:if(y===o)g=e.slice(n,v),y=c;else if(y===s)y=c;else throw Error(`attribute equal must after attrName`);break;case`'`:case`"`:if(y===c||y===o)if(y===o&&(m.warning(`attribute value must after "="`),g=e.slice(n,v)),n=v+1,v=e.indexOf(b,n),v>0)_=e.slice(n,v),h(g,_,n-1),y=u;else throw Error(`attribute value no end '`+b+`' match`);else if(y==l)_=e.slice(n,v),h(g,_,n),m.warning(`attribute "`+g+`" missed start quot(`+b+`)!!`),n=v+1,y=u;else throw Error(`attribute value must after "="`);break;case`/`:switch(y){case a:r.setTagName(e.slice(n,v));case u:case d:case f:y=f,r.closed=!0;case l:case o:break;case s:r.closed=!0;break;default:throw Error(`attribute invalid close char('/')`)}break;case``:return m.error(`unexpected end of input`),y==a&&r.setTagName(e.slice(n,v)),v;case`>`:switch(y){case a:r.setTagName(e.slice(n,v));case u:case d:case f:break;case l:case o:_=e.slice(n,v),_.slice(-1)===`/`&&(r.closed=!0,_=_.slice(0,-1));case s:y===s&&(_=g),y==l?(m.warning(`attribute "`+_+`" missed quot(")!`),h(g,_,n)):((!t.isHTML(i[``])||!_.match(/^(?:disabled|checked|selected)$/i))&&m.warning(`attribute "`+_+`" missed value!! "`+_+`" instead!!`),h(_,_,n));break;case c:throw Error(`attribute value missed!!`)}return v;case``:b=` `;default:if(b<=` `)switch(y){case a:r.setTagName(e.slice(n,v)),y=d;break;case o:g=e.slice(n,v),y=s;break;case l:var _=e.slice(n,v);m.warning(`attribute "`+_+`" missed quot(")!!`),h(g,_,n);case u:y=d;break}else switch(y){case s:r.tagName,(!t.isHTML(i[``])||!g.match(/^(?:disabled|checked|selected)$/i))&&m.warning(`attribute "`+g+`" missed value!! "`+g+`" instead2!!`),h(g,g,n),n=v,y=o;break;case u:m.warning(`attribute space is required"`+g+`"!!`);case d:y=o,n=v;break;case c:y=l,n=v;break;case f:throw Error(`elements closed character '/' and '>' must be connected to`)}}v++}}function v(e,n,r){for(var i=e.tagName,a=null,o=e.length;o--;){var s=e[o],c=s.qName,l=s.value,u=c.indexOf(`:`);if(u>0)var d=s.prefix=c.slice(0,u),f=c.slice(u+1),p=d===`xmlns`&&f;else f=c,d=null,p=c===`xmlns`&&``;s.localName=f,p!==!1&&(a??(a={},x(r,r={})),r[p]=a[p]=l,s.uri=t.XMLNS,n.startPrefixMapping(p,l))}for(var o=e.length;o--;){s=e[o];var d=s.prefix;d&&(d===`xml`&&(s.uri=t.XML),d!==`xmlns`&&(s.uri=r[d||``]))}var u=i.indexOf(`:`);u>0?(d=e.prefix=i.slice(0,u),f=e.localName=i.slice(u+1)):(d=null,f=e.localName=i);var m=e.uri=r[d||``];if(n.startElement(m,f,i,e),e.closed){if(n.endElement(m,f,i),a)for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&n.endPrefixMapping(d)}else return e.currentNSMap=r,e.localNSMap=a,!0}function y(e,t,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var a=e.indexOf(`</`+n+`>`,t),o=e.substring(t+1,a);if(/[&<]/.test(o))return/^script$/i.test(n)?(i.characters(o,0,o.length),a):(o=o.replace(/&#?\w+;/g,r),i.characters(o,0,o.length),a)}return t+1}function b(e,t,n,r){var i=r[n];return i??(i=e.lastIndexOf(`</`+n+`>`),i<t&&(i=e.lastIndexOf(`</`+n)),r[n]=i),i<t}function x(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function S(e,t,n,r){switch(e.charAt(t+2)){case`-`:if(e.charAt(t+3)===`-`){var i=e.indexOf(`-->`,t+4);return i>t?(n.comment(e,t+4,i-t-4),i+3):(r.error(`Unclosed comment`),-1)}else return-1;default:if(e.substr(t+3,6)==`CDATA[`){var i=e.indexOf(`]]>`,t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}var a=T(e,t),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var s=a[1][0],c=!1,l=!1;o>3&&(/^public$/i.test(a[2][0])?(c=a[3][0],l=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(l=a[3][0]));var u=a[o-1];return n.startDTD(s,c,l),n.endDTD(),u.index+u[0].length}}return-1}function C(e,t,n){var r=e.indexOf(`?>`,t);if(r){var i=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,n.processingInstruction(i[1],i[2]),r+2):-1}return-1}function w(){this.attributeNames={}}w.prototype={setTagName:function(e){if(!i.test(e))throw Error(`invalid tagName:`+e);this.tagName=e},addValue:function(e,t,n){if(!i.test(e))throw Error(`invalid attribute:`+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function T(e,t){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);n=i.exec(e);)if(r.push(n),n[1])return r}e.XMLReader=m,e.ParseError=p})),kU=s((e=>{var t=TU(),n=EU(),r=DU(),i=OU(),a=n.DOMImplementation,o=t.NAMESPACE,s=i.ParseError,c=i.XMLReader;function l(e){return e.replace(/\r[\n\u0085]/g,`
|
|
456
|
+
`).replace(/[\r\u0085\u2028]/g,`
|
|
457
|
+
`)}function u(e){this.options=e||{locator:{}}}u.prototype.parseFromString=function(e,t){var n=this.options,i=new c,a=n.domBuilder||new f,s=n.errorHandler,u=n.locator,p=n.xmlns||{},m=/\/x?html?$/.test(t),h=m?r.HTML_ENTITIES:r.XML_ENTITIES;u&&a.setDocumentLocator(u),i.errorHandler=d(s,a,u),i.domBuilder=n.domBuilder||a,m&&(p[``]=o.HTML),p.xml=p.xml||o.XML;var g=n.normalizeLineEndings||l;return e&&typeof e==`string`?i.parse(g(e),p,h):i.errorHandler.error(`invalid doc source`),a.doc};function d(e,t,n){if(!e){if(t instanceof f)return t;e=t}var r={},i=e instanceof Function;n||={};function a(t){var a=e[t];!a&&i&&(a=e.length==2?function(n){e(t,n)}:e),r[t]=a&&function(e){a(`[xmldom `+t+`] `+e+m(n))}||function(){}}return a(`warning`),a(`error`),a(`fatalError`),r}function f(){this.cdata=!1}function p(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}f.prototype={startDocument:function(){this.doc=new a().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),o=r.length;g(this,a),this.currentElement=a,this.locator&&p(this.locator,a);for(var s=0;s<o;s++){var e=r.getURI(s),c=r.getValue(s),n=r.getQName(s),l=i.createAttributeNS(e,n);this.locator&&p(r.getLocator(s),l),l.value=l.nodeValue=c,a.setAttributeNode(l)}},endElement:function(e,t,n){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&p(this.locator,n),g(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=h.apply(this,arguments),e){if(this.cdata)var r=this.doc.createCDATASection(e);else var r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&p(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=h.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&p(this.locator,r),g(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(e,t,n);this.locator&&p(this.locator,i),g(this,i),this.doc.doctype=i}},warning:function(e){console.warn(`[xmldom warning] `+e,m(this.locator))},error:function(e){console.error(`[xmldom error] `+e,m(this.locator))},fatalError:function(e){throw new s(e,this.locator)}};function m(e){if(e)return`
|
|
458
|
+
@`+(e.systemId||``)+`#[line:`+e.lineNumber+`,col:`+e.columnNumber+`]`}function h(e,t,n){return typeof e==`string`?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+``:e}`endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl`.replace(/\w+/g,function(e){f.prototype[e]=function(){return null}});function g(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}e.__DOMHandler=f,e.normalizeLineEndings=l,e.DOMParser=u})),AU=s((e=>{var t=EU();e.DOMImplementation=t.DOMImplementation,e.XMLSerializer=t.XMLSerializer,e.DOMParser=kU().DOMParser})),jU=s((e=>{var t=AU(),n=EU();function r(e){var n=null,r=new t.DOMParser({errorHandler:function(e,t){n={level:e,message:t}}}).parseFromString(e);if(n===null)return r;throw Error(n.level+`: `+n.message)}e.parseFromString=r,e.Node=n.Node})),MU=s((e=>{var t=vU(),n=(IH(),d(FH)),r=jU(),i=wU(),a=i.Element;e.readString=s;var o=r.Node;function s(e,s){s||={};try{var c=r.parseFromString(e,`text/xml`)}catch(e){return t.reject(e)}if(c.documentElement.tagName===`parsererror`)return t.resolve(Error(c.documentElement.textContent));function l(e){switch(e.nodeType){case o.ELEMENT_NODE:return u(e);case o.TEXT_NODE:return i.text(e.nodeValue)}}function u(e){var t=d(e),r=[];n.forEach(e.childNodes,function(e){var t=l(e);t&&r.push(t)});var i={};return n.forEach(e.attributes,function(e){i[d(e)]=e.value}),new a(t,i,r)}function d(e){if(e.namespaceURI){var t=s[e.namespaceURI];return(t?t+`:`:`{`+e.namespaceURI+`}`)+e.localName}else return e.localName}return t.resolve(l(c.documentElement))}})),NU=s(((e,t)=>{(function(){var e,n,r,i,a,o,s,c=[].slice,l={}.hasOwnProperty;e=function(){var e,t,n,r,i,o=arguments[0];if(i=2<=arguments.length?c.call(arguments,1):[],a(Object.assign))Object.assign.apply(null,arguments);else for(e=0,n=i.length;e<n;e++)if(r=i[e],r!=null)for(t in r)l.call(r,t)&&(o[t]=r[t]);return o},a=function(e){return!!e&&Object.prototype.toString.call(e)===`[object Function]`},o=function(e){var t;return!!e&&((t=typeof e)==`function`||t===`object`)},r=function(e){return a(Array.isArray)?Array.isArray(e):Object.prototype.toString.call(e)===`[object Array]`},i=function(e){var t;if(r(e))return!e.length;for(t in e)if(l.call(e,t))return!1;return!0},s=function(e){var t,n;return o(e)&&(n=Object.getPrototypeOf(e))&&(t=n.constructor)&&typeof t==`function`&&t instanceof t&&Function.prototype.toString.call(t)===Function.prototype.toString.call(Object)},n=function(e){return a(e.valueOf)?e.valueOf():e},t.exports.assign=e,t.exports.isFunction=a,t.exports.isObject=o,t.exports.isArray=r,t.exports.isEmpty=i,t.exports.isPlainObject=s,t.exports.getValue=n}).call(e)})),PU=s(((e,t)=>{(function(){t.exports=(function(){function e(e,t,n){if(this.options=e.options,this.stringify=e.stringify,this.parent=e,t==null)throw Error(`Missing attribute name. `+this.debugInfo(t));if(n==null)throw Error(`Missing attribute value. `+this.debugInfo(t));this.name=this.stringify.attName(t),this.value=this.stringify.attValue(n)}return e.prototype.clone=function(){return Object.create(this)},e.prototype.toString=function(e){return this.options.writer.set(e).attribute(this)},e.prototype.debugInfo=function(e){return e||=this.name,e==null?`parent: <`+this.parent.name+`>`:`attribute: {`+e+`}, parent: <`+this.parent.name+`>`},e})()}).call(e)})),FU=s(((e,t)=>{(function(){var e,n,r,i,a,o,s=function(e,t){for(var n in t)c.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},c={}.hasOwnProperty;o=NU(),a=o.isObject,i=o.isFunction,r=o.getValue,n=JU(),e=PU(),t.exports=(function(t){s(n,t);function n(e,t,r){if(n.__super__.constructor.call(this,e),t==null)throw Error(`Missing element name. `+this.debugInfo());this.name=this.stringify.eleName(t),this.attributes={},r!=null&&this.attribute(r),e.isDocument&&(this.isRoot=!0,this.documentObject=e,e.rootObject=this)}return n.prototype.clone=function(){var e,t,n=Object.create(this),r;for(t in n.isRoot&&(n.documentObject=null),n.attributes={},r=this.attributes,r)c.call(r,t)&&(e=r[t],n.attributes[t]=e.clone());return n.children=[],this.children.forEach(function(e){var t=e.clone();return t.parent=n,n.children.push(t)}),n},n.prototype.attribute=function(t,n){var o,s;if(t!=null&&(t=r(t)),a(t))for(o in t)c.call(t,o)&&(s=t[o],this.attribute(o,s));else i(n)&&(n=n.apply()),(!this.options.skipNullAttributes||n!=null)&&(this.attributes[t]=new e(this,t,n));return this},n.prototype.removeAttribute=function(e){var t,n,i;if(e==null)throw Error(`Missing attribute name. `+this.debugInfo());if(e=r(e),Array.isArray(e))for(n=0,i=e.length;n<i;n++)t=e[n],delete this.attributes[t];else delete this.attributes[e];return this},n.prototype.toString=function(e){return this.options.writer.set(e).element(this)},n.prototype.att=function(e,t){return this.attribute(e,t)},n.prototype.a=function(e,t){return this.attribute(e,t)},n})(n)}).call(e)})),IU=s(((e,t)=>{(function(){var e,n=function(e,t){for(var n in t)r.call(t,n)&&(e[n]=t[n]);function i(){this.constructor=e}return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},r={}.hasOwnProperty;e=JU(),t.exports=(function(e){n(t,e);function t(e,n){if(t.__super__.constructor.call(this,e),n==null)throw Error(`Missing CDATA text. `+this.debugInfo());this.text=this.stringify.cdata(n)}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.set(e).cdata(this)},t})(e)}).call(e)})),LU=s(((e,t)=>{(function(){var e,n=function(e,t){for(var n in t)r.call(t,n)&&(e[n]=t[n]);function i(){this.constructor=e}return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},r={}.hasOwnProperty;e=JU(),t.exports=(function(e){n(t,e);function t(e,n){if(t.__super__.constructor.call(this,e),n==null)throw Error(`Missing comment text. `+this.debugInfo());this.text=this.stringify.comment(n)}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.set(e).comment(this)},t})(e)}).call(e)})),RU=s(((e,t)=>{(function(){var e,n,r=function(e,t){for(var n in t)i.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},i={}.hasOwnProperty;n=NU().isObject,e=JU(),t.exports=(function(e){r(t,e);function t(e,r,i,a){var o;t.__super__.constructor.call(this,e),n(r)&&(o=r,r=o.version,i=o.encoding,a=o.standalone),r||=`1.0`,this.version=this.stringify.xmlVersion(r),i!=null&&(this.encoding=this.stringify.xmlEncoding(i)),a!=null&&(this.standalone=this.stringify.xmlStandalone(a))}return t.prototype.toString=function(e){return this.options.writer.set(e).declaration(this)},t})(e)}).call(e)})),zU=s(((e,t)=>{(function(){var e,n=function(e,t){for(var n in t)r.call(t,n)&&(e[n]=t[n]);function i(){this.constructor=e}return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},r={}.hasOwnProperty;e=JU(),t.exports=(function(e){n(t,e);function t(e,n,r,i,a,o){if(t.__super__.constructor.call(this,e),n==null)throw Error(`Missing DTD element name. `+this.debugInfo());if(r==null)throw Error(`Missing DTD attribute name. `+this.debugInfo(n));if(!i)throw Error(`Missing DTD attribute type. `+this.debugInfo(n));if(!a)throw Error(`Missing DTD attribute default. `+this.debugInfo(n));if(a.indexOf(`#`)!==0&&(a=`#`+a),!a.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw Error(`Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. `+this.debugInfo(n));if(o&&!a.match(/^(#FIXED|#DEFAULT)$/))throw Error(`Default value only applies to #FIXED or #DEFAULT. `+this.debugInfo(n));this.elementName=this.stringify.eleName(n),this.attributeName=this.stringify.attName(r),this.attributeType=this.stringify.dtdAttType(i),this.defaultValue=this.stringify.dtdAttDefault(o),this.defaultValueType=a}return t.prototype.toString=function(e){return this.options.writer.set(e).dtdAttList(this)},t})(e)}).call(e)})),BU=s(((e,t)=>{(function(){var e,n,r=function(e,t){for(var n in t)i.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},i={}.hasOwnProperty;n=NU().isObject,e=JU(),t.exports=(function(e){r(t,e);function t(e,r,i,a){if(t.__super__.constructor.call(this,e),i==null)throw Error(`Missing DTD entity name. `+this.debugInfo(i));if(a==null)throw Error(`Missing DTD entity value. `+this.debugInfo(i));if(this.pe=!!r,this.name=this.stringify.eleName(i),!n(a))this.value=this.stringify.dtdEntityValue(a);else{if(!a.pubID&&!a.sysID)throw Error(`Public and/or system identifiers are required for an external entity. `+this.debugInfo(i));if(a.pubID&&!a.sysID)throw Error(`System identifier is required for a public external entity. `+this.debugInfo(i));if(a.pubID!=null&&(this.pubID=this.stringify.dtdPubID(a.pubID)),a.sysID!=null&&(this.sysID=this.stringify.dtdSysID(a.sysID)),a.nData!=null&&(this.nData=this.stringify.dtdNData(a.nData)),this.pe&&this.nData)throw Error(`Notation declaration is not allowed in a parameter entity. `+this.debugInfo(i))}}return t.prototype.toString=function(e){return this.options.writer.set(e).dtdEntity(this)},t})(e)}).call(e)})),VU=s(((e,t)=>{(function(){var e,n=function(e,t){for(var n in t)r.call(t,n)&&(e[n]=t[n]);function i(){this.constructor=e}return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},r={}.hasOwnProperty;e=JU(),t.exports=(function(e){n(t,e);function t(e,n,r){if(t.__super__.constructor.call(this,e),n==null)throw Error(`Missing DTD element name. `+this.debugInfo());r||=`(#PCDATA)`,Array.isArray(r)&&(r=`(`+r.join(`,`)+`)`),this.name=this.stringify.eleName(n),this.value=this.stringify.dtdElementValue(r)}return t.prototype.toString=function(e){return this.options.writer.set(e).dtdElement(this)},t})(e)}).call(e)})),HU=s(((e,t)=>{(function(){var e,n=function(e,t){for(var n in t)r.call(t,n)&&(e[n]=t[n]);function i(){this.constructor=e}return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},r={}.hasOwnProperty;e=JU(),t.exports=(function(e){n(t,e);function t(e,n,r){if(t.__super__.constructor.call(this,e),n==null)throw Error(`Missing DTD notation name. `+this.debugInfo(n));if(!r.pubID&&!r.sysID)throw Error(`Public or system identifiers are required for an external entity. `+this.debugInfo(n));this.name=this.stringify.eleName(n),r.pubID!=null&&(this.pubID=this.stringify.dtdPubID(r.pubID)),r.sysID!=null&&(this.sysID=this.stringify.dtdSysID(r.sysID))}return t.prototype.toString=function(e){return this.options.writer.set(e).dtdNotation(this)},t})(e)}).call(e)})),UU=s(((e,t)=>{(function(){var e,n,r,i,a,o,s=function(e,t){for(var n in t)c.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},c={}.hasOwnProperty;o=NU().isObject,a=JU(),e=zU(),r=BU(),n=VU(),i=HU(),t.exports=(function(t){s(a,t);function a(e,t,n){var r,i;a.__super__.constructor.call(this,e),this.name=`!DOCTYPE`,this.documentObject=e,o(t)&&(r=t,t=r.pubID,n=r.sysID),n??(i=[t,n],n=i[0],t=i[1]),t!=null&&(this.pubID=this.stringify.dtdPubID(t)),n!=null&&(this.sysID=this.stringify.dtdSysID(n))}return a.prototype.element=function(e,t){var r=new n(this,e,t);return this.children.push(r),this},a.prototype.attList=function(t,n,r,i,a){var o=new e(this,t,n,r,i,a);return this.children.push(o),this},a.prototype.entity=function(e,t){var n=new r(this,!1,e,t);return this.children.push(n),this},a.prototype.pEntity=function(e,t){var n=new r(this,!0,e,t);return this.children.push(n),this},a.prototype.notation=function(e,t){var n=new i(this,e,t);return this.children.push(n),this},a.prototype.toString=function(e){return this.options.writer.set(e).docType(this)},a.prototype.ele=function(e,t){return this.element(e,t)},a.prototype.att=function(e,t,n,r,i){return this.attList(e,t,n,r,i)},a.prototype.ent=function(e,t){return this.entity(e,t)},a.prototype.pent=function(e,t){return this.pEntity(e,t)},a.prototype.not=function(e,t){return this.notation(e,t)},a.prototype.up=function(){return this.root()||this.documentObject},a})(a)}).call(e)})),WU=s(((e,t)=>{(function(){var e,n=function(e,t){for(var n in t)r.call(t,n)&&(e[n]=t[n]);function i(){this.constructor=e}return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},r={}.hasOwnProperty;e=JU(),t.exports=(function(e){n(t,e);function t(e,n){if(t.__super__.constructor.call(this,e),n==null)throw Error(`Missing raw text. `+this.debugInfo());this.value=this.stringify.raw(n)}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.set(e).raw(this)},t})(e)}).call(e)})),GU=s(((e,t)=>{(function(){var e,n=function(e,t){for(var n in t)r.call(t,n)&&(e[n]=t[n]);function i(){this.constructor=e}return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},r={}.hasOwnProperty;e=JU(),t.exports=(function(e){n(t,e);function t(e,n){if(t.__super__.constructor.call(this,e),n==null)throw Error(`Missing element text. `+this.debugInfo());this.value=this.stringify.eleText(n)}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.set(e).text(this)},t})(e)}).call(e)})),KU=s(((e,t)=>{(function(){var e,n=function(e,t){for(var n in t)r.call(t,n)&&(e[n]=t[n]);function i(){this.constructor=e}return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},r={}.hasOwnProperty;e=JU(),t.exports=(function(e){n(t,e);function t(e,n,r){if(t.__super__.constructor.call(this,e),n==null)throw Error(`Missing instruction target. `+this.debugInfo());this.target=this.stringify.insTarget(n),r&&(this.value=this.stringify.insValue(r))}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.set(e).processingInstruction(this)},t})(e)}).call(e)})),qU=s(((e,t)=>{(function(){var e,n=function(e,t){for(var n in t)r.call(t,n)&&(e[n]=t[n]);function i(){this.constructor=e}return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},r={}.hasOwnProperty;e=JU(),t.exports=(function(e){n(t,e);function t(e){t.__super__.constructor.call(this,e),this.isDummy=!0}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return``},t})(e)}).call(e)})),JU=s(((e,t)=>{(function(){var e,n,r,i,a,o,s,c,l,u,d,f,p,m,h={}.hasOwnProperty;m=NU(),p=m.isObject,f=m.isFunction,d=m.isEmpty,u=m.getValue,o=null,e=null,n=null,r=null,i=null,c=null,l=null,s=null,a=null,t.exports=(function(){function t(t){this.parent=t,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.children=[],o||(o=FU(),e=IU(),n=LU(),r=RU(),i=UU(),c=WU(),l=GU(),s=KU(),a=qU())}return t.prototype.element=function(e,t,n){var r,i,a,o,s,c=null,l,m,g,_,v;if(t===null&&n==null&&(g=[{},null],t=g[0],n=g[1]),t??={},t=u(t),p(t)||(_=[t,n],n=_[0],t=_[1]),e!=null&&(e=u(e)),Array.isArray(e))for(a=0,l=e.length;a<l;a++)i=e[a],c=this.element(i);else if(f(e))c=this.element(e.apply());else if(p(e)){for(s in e)if(h.call(e,s))if(v=e[s],f(v)&&(v=v.apply()),p(v)&&d(v)&&(v=null),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&s.indexOf(this.stringify.convertAttKey)===0)c=this.attribute(s.substr(this.stringify.convertAttKey.length),v);else if(!this.options.separateArrayItems&&Array.isArray(v))for(o=0,m=v.length;o<m;o++)i=v[o],r={},r[s]=i,c=this.element(r);else p(v)?(c=this.element(s),c.element(v)):c=this.element(s,v)}else c=this.options.skipNullNodes&&n===null?this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&e.indexOf(this.stringify.convertTextKey)===0?this.text(n):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&e.indexOf(this.stringify.convertCDataKey)===0?this.cdata(n):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&e.indexOf(this.stringify.convertCommentKey)===0?this.comment(n):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&e.indexOf(this.stringify.convertRawKey)===0?this.raw(n):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&e.indexOf(this.stringify.convertPIKey)===0?this.instruction(e.substr(this.stringify.convertPIKey.length),n):this.node(e,t,n);if(c==null)throw Error(`Could not create any elements with: `+e+`. `+this.debugInfo());return c},t.prototype.insertBefore=function(e,t,n){var r,i,a;if(this.isRoot)throw Error(`Cannot insert elements at root level. `+this.debugInfo(e));return i=this.parent.children.indexOf(this),a=this.parent.children.splice(i),r=this.parent.element(e,t,n),Array.prototype.push.apply(this.parent.children,a),r},t.prototype.insertAfter=function(e,t,n){var r,i,a;if(this.isRoot)throw Error(`Cannot insert elements at root level. `+this.debugInfo(e));return i=this.parent.children.indexOf(this),a=this.parent.children.splice(i+1),r=this.parent.element(e,t,n),Array.prototype.push.apply(this.parent.children,a),r},t.prototype.remove=function(){var e;if(this.isRoot)throw Error(`Cannot remove the root element. `+this.debugInfo());return e=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[e,e-e+1]),this.parent},t.prototype.node=function(e,t,n){var r,i;return e!=null&&(e=u(e)),t||={},t=u(t),p(t)||(i=[t,n],n=i[0],t=i[1]),r=new o(this,e,t),n!=null&&r.text(n),this.children.push(r),r},t.prototype.text=function(e){var t=new l(this,e);return this.children.push(t),this},t.prototype.cdata=function(t){var n=new e(this,t);return this.children.push(n),this},t.prototype.comment=function(e){var t=new n(this,e);return this.children.push(t),this},t.prototype.commentBefore=function(e){var t=this.parent.children.indexOf(this),n=this.parent.children.splice(t);return this.parent.comment(e),Array.prototype.push.apply(this.parent.children,n),this},t.prototype.commentAfter=function(e){var t=this.parent.children.indexOf(this),n=this.parent.children.splice(t+1);return this.parent.comment(e),Array.prototype.push.apply(this.parent.children,n),this},t.prototype.raw=function(e){var t=new c(this,e);return this.children.push(t),this},t.prototype.dummy=function(){var e=new a(this);return this.children.push(e),e},t.prototype.instruction=function(e,t){var n,r,i,a,o;if(e!=null&&(e=u(e)),t!=null&&(t=u(t)),Array.isArray(e))for(a=0,o=e.length;a<o;a++)n=e[a],this.instruction(n);else if(p(e))for(n in e)h.call(e,n)&&(r=e[n],this.instruction(n,r));else f(t)&&(t=t.apply()),i=new s(this,e,t),this.children.push(i);return this},t.prototype.instructionBefore=function(e,t){var n=this.parent.children.indexOf(this),r=this.parent.children.splice(n);return this.parent.instruction(e,t),Array.prototype.push.apply(this.parent.children,r),this},t.prototype.instructionAfter=function(e,t){var n=this.parent.children.indexOf(this),r=this.parent.children.splice(n+1);return this.parent.instruction(e,t),Array.prototype.push.apply(this.parent.children,r),this},t.prototype.declaration=function(e,t,n){var i=this.document(),a=new r(i,e,t,n);return i.children[0]instanceof r?i.children[0]=a:i.children.unshift(a),i.root()||i},t.prototype.doctype=function(e,t){var n,r=this.document(),a=new i(r,e,t),o,s,c,l,u,d=r.children,f;for(o=s=0,l=d.length;s<l;o=++s)if(n=d[o],n instanceof i)return r.children[o]=a,a;for(f=r.children,o=c=0,u=f.length;c<u;o=++c)if(n=f[o],n.isRoot)return r.children.splice(o,0,a),a;return r.children.push(a),a},t.prototype.up=function(){if(this.isRoot)throw Error(`The root node has no parent. Use doc() if you need to get the document object.`);return this.parent},t.prototype.root=function(){for(var e=this;e;)if(e.isDocument)return e.rootObject;else if(e.isRoot)return e;else e=e.parent},t.prototype.document=function(){for(var e=this;e;)if(e.isDocument)return e;else e=e.parent},t.prototype.end=function(e){return this.document().end(e)},t.prototype.prev=function(){for(var e=this.parent.children.indexOf(this);e>0&&this.parent.children[e-1].isDummy;)--e;if(e<1)throw Error(`Already at the first node. `+this.debugInfo());return this.parent.children[e-1]},t.prototype.next=function(){for(var e=this.parent.children.indexOf(this);e<this.parent.children.length-1&&this.parent.children[e+1].isDummy;)e+=1;if(e===-1||e===this.parent.children.length-1)throw Error(`Already at the last node. `+this.debugInfo());return this.parent.children[e+1]},t.prototype.importDocument=function(e){var t=e.root().clone();return t.parent=this,t.isRoot=!1,this.children.push(t),this},t.prototype.debugInfo=function(e){return e||=this.name,e==null&&!this.parent?.name?``:e==null?`parent: <`+this.parent.name+`>`:this.parent?.name?`node: <`+e+`>, parent: <`+this.parent.name+`>`:`node: <`+e+`>`},t.prototype.ele=function(e,t,n){return this.element(e,t,n)},t.prototype.nod=function(e,t,n){return this.node(e,t,n)},t.prototype.txt=function(e){return this.text(e)},t.prototype.dat=function(e){return this.cdata(e)},t.prototype.com=function(e){return this.comment(e)},t.prototype.ins=function(e,t){return this.instruction(e,t)},t.prototype.doc=function(){return this.document()},t.prototype.dec=function(e,t,n){return this.declaration(e,t,n)},t.prototype.dtd=function(e,t){return this.doctype(e,t)},t.prototype.e=function(e,t,n){return this.element(e,t,n)},t.prototype.n=function(e,t,n){return this.node(e,t,n)},t.prototype.t=function(e){return this.text(e)},t.prototype.d=function(e){return this.cdata(e)},t.prototype.c=function(e){return this.comment(e)},t.prototype.r=function(e){return this.raw(e)},t.prototype.i=function(e,t){return this.instruction(e,t)},t.prototype.u=function(){return this.up()},t.prototype.importXMLBuilder=function(e){return this.importDocument(e)},t})()}).call(e)})),YU=s(((e,t)=>{(function(){var e=function(e,t){return function(){return e.apply(t,arguments)}},n={}.hasOwnProperty;t.exports=(function(){function t(t){this.assertLegalChar=e(this.assertLegalChar,this);var r,i,a;for(r in t||={},this.noDoubleEncoding=t.noDoubleEncoding,i=t.stringify||{},i)n.call(i,r)&&(a=i[r],this[r]=a)}return t.prototype.eleName=function(e){return e=``+e||``,this.assertLegalChar(e)},t.prototype.eleText=function(e){return e=``+e||``,this.assertLegalChar(this.elEscape(e))},t.prototype.cdata=function(e){return e=``+e||``,e=e.replace(`]]>`,`]]]]><![CDATA[>`),this.assertLegalChar(e)},t.prototype.comment=function(e){if(e=``+e||``,e.match(/--/))throw Error(`Comment text cannot contain double-hypen: `+e);return this.assertLegalChar(e)},t.prototype.raw=function(e){return``+e||``},t.prototype.attName=function(e){return e=``+e||``},t.prototype.attValue=function(e){return e=``+e||``,this.attEscape(e)},t.prototype.insTarget=function(e){return``+e||``},t.prototype.insValue=function(e){if(e=``+e||``,e.match(/\?>/))throw Error(`Invalid processing instruction value: `+e);return e},t.prototype.xmlVersion=function(e){if(e=``+e||``,!e.match(/1\.[0-9]+/))throw Error(`Invalid version number: `+e);return e},t.prototype.xmlEncoding=function(e){if(e=``+e||``,!e.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw Error(`Invalid encoding: `+e);return e},t.prototype.xmlStandalone=function(e){return e?`yes`:`no`},t.prototype.dtdPubID=function(e){return``+e||``},t.prototype.dtdSysID=function(e){return``+e||``},t.prototype.dtdElementValue=function(e){return``+e||``},t.prototype.dtdAttType=function(e){return``+e||``},t.prototype.dtdAttDefault=function(e){return e==null?e:``+e||``},t.prototype.dtdEntityValue=function(e){return``+e||``},t.prototype.dtdNData=function(e){return``+e||``},t.prototype.convertAttKey=`@`,t.prototype.convertPIKey=`?`,t.prototype.convertTextKey=`#text`,t.prototype.convertCDataKey=`#cdata`,t.prototype.convertCommentKey=`#comment`,t.prototype.convertRawKey=`#raw`,t.prototype.assertLegalChar=function(e){var t=e.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/);if(t)throw Error(`Invalid character in string: `+e+` at index `+t.index);return e},t.prototype.elEscape=function(e){var t=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return e.replace(t,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/\r/g,`
`)},t.prototype.attEscape=function(e){var t=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return e.replace(t,`&`).replace(/</g,`<`).replace(/"/g,`"`).replace(/\t/g,`	`).replace(/\n/g,`
`).replace(/\r/g,`
`)},t})()}).call(e)})),XU=s(((e,t)=>{(function(){var e={}.hasOwnProperty;t.exports=(function(){function t(t){var n,r,i;for(n in t||={},this.pretty=t.pretty||!1,this.allowEmpty=t.allowEmpty??!1,this.pretty?(this.indent=t.indent??` `,this.newline=t.newline??`
|
|
459
|
+
`,this.offset=t.offset??0,this.dontprettytextnodes=t.dontprettytextnodes??0):(this.indent=``,this.newline=``,this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=t.spacebeforeslash??``,this.spacebeforeslash===!0&&(this.spacebeforeslash=` `),this.newlinedefault=this.newline,this.prettydefault=this.pretty,r=t.writer||{},r)e.call(r,n)&&(i=r[n],this[n]=i)}return t.prototype.set=function(t){var n,r,i;for(n in t||={},`pretty`in t&&(this.pretty=t.pretty),`allowEmpty`in t&&(this.allowEmpty=t.allowEmpty),this.pretty?(this.indent=`indent`in t?t.indent:` `,this.newline=`newline`in t?t.newline:`
|
|
460
|
+
`,this.offset=`offset`in t?t.offset:0,this.dontprettytextnodes=`dontprettytextnodes`in t?t.dontprettytextnodes:0):(this.indent=``,this.newline=``,this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=`spacebeforeslash`in t?t.spacebeforeslash:``,this.spacebeforeslash===!0&&(this.spacebeforeslash=` `),this.newlinedefault=this.newline,this.prettydefault=this.pretty,r=t.writer||{},r)e.call(r,n)&&(i=r[n],this[n]=i);return this},t.prototype.space=function(e){var t;return this.pretty?(t=(e||0)+this.offset+1,t>0?Array(t).join(this.indent):``):``},t})()}).call(e)})),ZU=s(((e,t)=>{(function(){var e,n,r,i,a,o,s,c,l,u,d,f,p,m,h=function(e,t){for(var n in t)g.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},g={}.hasOwnProperty;s=RU(),c=UU(),e=IU(),n=LU(),u=FU(),f=WU(),p=GU(),d=KU(),l=qU(),r=zU(),i=VU(),a=BU(),o=HU(),m=XU(),t.exports=(function(t){h(m,t);function m(e){m.__super__.constructor.call(this,e)}return m.prototype.document=function(e){var t,r,i,a,o;for(this.textispresent=!1,a=``,o=e.children,r=0,i=o.length;r<i;r++)t=o[r],!(t instanceof l)&&(a+=(function(){switch(!1){case!(t instanceof s):return this.declaration(t);case!(t instanceof c):return this.docType(t);case!(t instanceof n):return this.comment(t);case!(t instanceof d):return this.processingInstruction(t);default:return this.element(t,0)}}).call(this));return this.pretty&&a.slice(-this.newline.length)===this.newline&&(a=a.slice(0,-this.newline.length)),a},m.prototype.attribute=function(e){return` `+e.name+`="`+e.value+`"`},m.prototype.cdata=function(e,t){return this.space(t)+`<![CDATA[`+e.text+`]]>`+this.newline},m.prototype.comment=function(e,t){return this.space(t)+`<!-- `+e.text+` -->`+this.newline},m.prototype.declaration=function(e,t){var n=this.space(t);return n+=`<?xml version="`+e.version+`"`,e.encoding!=null&&(n+=` encoding="`+e.encoding+`"`),e.standalone!=null&&(n+=` standalone="`+e.standalone+`"`),n+=this.spacebeforeslash+`?>`,n+=this.newline,n},m.prototype.docType=function(t,s){var c,l,u,f,p;if(s||=0,f=this.space(s),f+=`<!DOCTYPE `+t.root().name,t.pubID&&t.sysID?f+=` PUBLIC "`+t.pubID+`" "`+t.sysID+`"`:t.sysID&&(f+=` SYSTEM "`+t.sysID+`"`),t.children.length>0){for(f+=` [`,f+=this.newline,p=t.children,l=0,u=p.length;l<u;l++)c=p[l],f+=(function(){switch(!1){case!(c instanceof r):return this.dtdAttList(c,s+1);case!(c instanceof i):return this.dtdElement(c,s+1);case!(c instanceof a):return this.dtdEntity(c,s+1);case!(c instanceof o):return this.dtdNotation(c,s+1);case!(c instanceof e):return this.cdata(c,s+1);case!(c instanceof n):return this.comment(c,s+1);case!(c instanceof d):return this.processingInstruction(c,s+1);default:throw Error(`Unknown DTD node type: `+c.constructor.name)}}).call(this);f+=`]`}return f+=this.spacebeforeslash+`>`,f+=this.newline,f},m.prototype.element=function(t,r){var i,a,o,s,c,m,h,_,v,y,b,x,S;for(h in r||=0,S=!1,this.textispresent?(this.newline=``,this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),x=this.space(r),_=``,_+=x+`<`+t.name,v=t.attributes,v)g.call(v,h)&&(i=v[h],_+=this.attribute(i));if(t.children.length===0||t.children.every(function(e){return e.value===``}))this.allowEmpty?_+=`></`+t.name+`>`+this.newline:_+=this.spacebeforeslash+`/>`+this.newline;else if(this.pretty&&t.children.length===1&&t.children[0].value!=null)_+=`>`,_+=t.children[0].value,_+=`</`+t.name+`>`+this.newline;else{if(this.dontprettytextnodes){for(y=t.children,o=0,c=y.length;o<c;o++)if(a=y[o],a.value!=null){this.textispresent++,S=!0;break}}for(this.textispresent&&(this.newline=``,this.pretty=!1,x=this.space(r)),_+=`>`+this.newline,b=t.children,s=0,m=b.length;s<m;s++)a=b[s],_+=(function(){switch(!1){case!(a instanceof e):return this.cdata(a,r+1);case!(a instanceof n):return this.comment(a,r+1);case!(a instanceof u):return this.element(a,r+1);case!(a instanceof f):return this.raw(a,r+1);case!(a instanceof p):return this.text(a,r+1);case!(a instanceof d):return this.processingInstruction(a,r+1);case!(a instanceof l):return``;default:throw Error(`Unknown XML node type: `+a.constructor.name)}}).call(this);S&&this.textispresent--,this.textispresent||(this.newline=this.newlinedefault,this.pretty=this.prettydefault),_+=x+`</`+t.name+`>`+this.newline}return _},m.prototype.processingInstruction=function(e,t){var n=this.space(t)+`<?`+e.target;return e.value&&(n+=` `+e.value),n+=this.spacebeforeslash+`?>`+this.newline,n},m.prototype.raw=function(e,t){return this.space(t)+e.value+this.newline},m.prototype.text=function(e,t){return this.space(t)+e.value+this.newline},m.prototype.dtdAttList=function(e,t){var n=this.space(t)+`<!ATTLIST `+e.elementName+` `+e.attributeName+` `+e.attributeType;return e.defaultValueType!==`#DEFAULT`&&(n+=` `+e.defaultValueType),e.defaultValue&&(n+=` "`+e.defaultValue+`"`),n+=this.spacebeforeslash+`>`+this.newline,n},m.prototype.dtdElement=function(e,t){return this.space(t)+`<!ELEMENT `+e.name+` `+e.value+this.spacebeforeslash+`>`+this.newline},m.prototype.dtdEntity=function(e,t){var n=this.space(t)+`<!ENTITY`;return e.pe&&(n+=` %`),n+=` `+e.name,e.value?n+=` "`+e.value+`"`:(e.pubID&&e.sysID?n+=` PUBLIC "`+e.pubID+`" "`+e.sysID+`"`:e.sysID&&(n+=` SYSTEM "`+e.sysID+`"`),e.nData&&(n+=` NDATA `+e.nData)),n+=this.spacebeforeslash+`>`+this.newline,n},m.prototype.dtdNotation=function(e,t){var n=this.space(t)+`<!NOTATION `+e.name;return e.pubID&&e.sysID?n+=` PUBLIC "`+e.pubID+`" "`+e.sysID+`"`:e.pubID?n+=` PUBLIC "`+e.pubID+`"`:e.sysID&&(n+=` SYSTEM "`+e.sysID+`"`),n+=this.spacebeforeslash+`>`+this.newline,n},m.prototype.openNode=function(e,t){var n,r,i,a;if(t||=0,e instanceof u){for(r in i=this.space(t)+`<`+e.name,a=e.attributes,a)g.call(a,r)&&(n=a[r],i+=this.attribute(n));return i+=(e.children?`>`:`/>`)+this.newline,i}else return i=this.space(t)+`<!DOCTYPE `+e.rootNodeName,e.pubID&&e.sysID?i+=` PUBLIC "`+e.pubID+`" "`+e.sysID+`"`:e.sysID&&(i+=` SYSTEM "`+e.sysID+`"`),i+=(e.children?` [`:`>`)+this.newline,i},m.prototype.closeNode=function(e,t){switch(t||=0,!1){case!(e instanceof u):return this.space(t)+`</`+e.name+`>`+this.newline;case!(e instanceof c):return this.space(t)+`]>`+this.newline}},m})(m)}).call(e)})),QU=s(((e,t)=>{(function(){var e,n,r,i,a=function(e,t){for(var n in t)o.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},o={}.hasOwnProperty;i=NU().isPlainObject,e=JU(),r=YU(),n=ZU(),t.exports=(function(e){a(t,e);function t(e){t.__super__.constructor.call(this,null),this.name=`?xml`,e||={},e.writer||=new n,this.options=e,this.stringify=new r(e),this.isDocument=!0}return t.prototype.end=function(e){var t;return e?i(e)&&(t=e,e=this.options.writer.set(t)):e=this.options.writer,e.document(this)},t.prototype.toString=function(e){return this.options.writer.set(e).document(this)},t})(e)}).call(e)})),$U=s(((e,t)=>{(function(){var e,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x={}.hasOwnProperty;b=NU(),v=b.isObject,_=b.isFunction,y=b.isPlainObject,g=b.getValue,u=FU(),n=IU(),r=LU(),f=WU(),h=GU(),d=KU(),c=RU(),l=UU(),i=zU(),o=BU(),a=VU(),s=HU(),e=PU(),m=YU(),p=ZU(),t.exports=(function(){function t(e,t,n){var r;this.name=`?xml`,e||={},e.writer?y(e.writer)&&(r=e.writer,e.writer=new p(r)):e.writer=new p(e),this.options=e,this.writer=e.writer,this.stringify=new m(e),this.onDataCallback=t||function(){},this.onEndCallback=n||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return t.prototype.node=function(e,t,n){var r,i;if(e==null)throw Error(`Missing node name.`);if(this.root&&this.currentLevel===-1)throw Error(`Document can only have one root node. `+this.debugInfo(e));return this.openCurrent(),e=g(e),t===null&&n==null&&(r=[{},null],t=r[0],n=r[1]),t??={},t=g(t),v(t)||(i=[t,n],n=i[0],t=i[1]),this.currentNode=new u(this,e,t),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,n!=null&&this.text(n),this},t.prototype.element=function(e,t,n){return this.currentNode&&this.currentNode instanceof l?this.dtdElement.apply(this,arguments):this.node(e,t,n)},t.prototype.attribute=function(t,n){var r,i;if(!this.currentNode||this.currentNode.children)throw Error(`att() can only be used immediately after an ele() call in callback mode. `+this.debugInfo(t));if(t!=null&&(t=g(t)),v(t))for(r in t)x.call(t,r)&&(i=t[r],this.attribute(r,i));else _(n)&&(n=n.apply()),(!this.options.skipNullAttributes||n!=null)&&(this.currentNode.attributes[t]=new e(this,t,n));return this},t.prototype.text=function(e){var t;return this.openCurrent(),t=new h(this,e),this.onData(this.writer.text(t,this.currentLevel+1),this.currentLevel+1),this},t.prototype.cdata=function(e){var t;return this.openCurrent(),t=new n(this,e),this.onData(this.writer.cdata(t,this.currentLevel+1),this.currentLevel+1),this},t.prototype.comment=function(e){var t;return this.openCurrent(),t=new r(this,e),this.onData(this.writer.comment(t,this.currentLevel+1),this.currentLevel+1),this},t.prototype.raw=function(e){var t;return this.openCurrent(),t=new f(this,e),this.onData(this.writer.raw(t,this.currentLevel+1),this.currentLevel+1),this},t.prototype.instruction=function(e,t){var n,r,i,a,o;if(this.openCurrent(),e!=null&&(e=g(e)),t!=null&&(t=g(t)),Array.isArray(e))for(n=0,a=e.length;n<a;n++)r=e[n],this.instruction(r);else if(v(e))for(r in e)x.call(e,r)&&(i=e[r],this.instruction(r,i));else _(t)&&(t=t.apply()),o=new d(this,e,t),this.onData(this.writer.processingInstruction(o,this.currentLevel+1),this.currentLevel+1);return this},t.prototype.declaration=function(e,t,n){var r;if(this.openCurrent(),this.documentStarted)throw Error(`declaration() must be the first node.`);return r=new c(this,e,t,n),this.onData(this.writer.declaration(r,this.currentLevel+1),this.currentLevel+1),this},t.prototype.doctype=function(e,t,n){if(this.openCurrent(),e==null)throw Error(`Missing root node name.`);if(this.root)throw Error(`dtd() must come before the root node.`);return this.currentNode=new l(this,t,n),this.currentNode.rootNodeName=e,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},t.prototype.dtdElement=function(e,t){var n;return this.openCurrent(),n=new a(this,e,t),this.onData(this.writer.dtdElement(n,this.currentLevel+1),this.currentLevel+1),this},t.prototype.attList=function(e,t,n,r,a){var o;return this.openCurrent(),o=new i(this,e,t,n,r,a),this.onData(this.writer.dtdAttList(o,this.currentLevel+1),this.currentLevel+1),this},t.prototype.entity=function(e,t){var n;return this.openCurrent(),n=new o(this,!1,e,t),this.onData(this.writer.dtdEntity(n,this.currentLevel+1),this.currentLevel+1),this},t.prototype.pEntity=function(e,t){var n;return this.openCurrent(),n=new o(this,!0,e,t),this.onData(this.writer.dtdEntity(n,this.currentLevel+1),this.currentLevel+1),this},t.prototype.notation=function(e,t){var n;return this.openCurrent(),n=new s(this,e,t),this.onData(this.writer.dtdNotation(n,this.currentLevel+1),this.currentLevel+1),this},t.prototype.up=function(){if(this.currentLevel<0)throw Error(`The document node has no parent.`);return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},t.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},t.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},t.prototype.openNode=function(e){if(!e.isOpen)return!this.root&&this.currentLevel===0&&e instanceof u&&(this.root=e),this.onData(this.writer.openNode(e,this.currentLevel),this.currentLevel),e.isOpen=!0},t.prototype.closeNode=function(e){if(!e.isClosed)return this.onData(this.writer.closeNode(e,this.currentLevel),this.currentLevel),e.isClosed=!0},t.prototype.onData=function(e,t){return this.documentStarted=!0,this.onDataCallback(e,t+1)},t.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},t.prototype.debugInfo=function(e){return e==null?``:`node: <`+e+`>`},t.prototype.ele=function(){return this.element.apply(this,arguments)},t.prototype.nod=function(e,t,n){return this.node(e,t,n)},t.prototype.txt=function(e){return this.text(e)},t.prototype.dat=function(e){return this.cdata(e)},t.prototype.com=function(e){return this.comment(e)},t.prototype.ins=function(e,t){return this.instruction(e,t)},t.prototype.dec=function(e,t,n){return this.declaration(e,t,n)},t.prototype.dtd=function(e,t,n){return this.doctype(e,t,n)},t.prototype.e=function(e,t,n){return this.element(e,t,n)},t.prototype.n=function(e,t,n){return this.node(e,t,n)},t.prototype.t=function(e){return this.text(e)},t.prototype.d=function(e){return this.cdata(e)},t.prototype.c=function(e){return this.comment(e)},t.prototype.r=function(e){return this.raw(e)},t.prototype.i=function(e,t){return this.instruction(e,t)},t.prototype.att=function(){return this.currentNode&&this.currentNode instanceof l?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},t.prototype.a=function(){return this.currentNode&&this.currentNode instanceof l?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},t.prototype.ent=function(e,t){return this.entity(e,t)},t.prototype.pent=function(e,t){return this.pEntity(e,t)},t.prototype.not=function(e,t){return this.notation(e,t)},t})()}).call(e)})),eW=s(((e,t)=>{(function(){var e,n,r,i,a,o,s,c,l,u,d,f,p,m,h=function(e,t){for(var n in t)g.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},g={}.hasOwnProperty;s=RU(),c=UU(),e=IU(),n=LU(),u=FU(),f=WU(),p=GU(),d=KU(),l=qU(),r=zU(),i=VU(),a=BU(),o=HU(),m=XU(),t.exports=(function(t){h(m,t);function m(e,t){m.__super__.constructor.call(this,t),this.stream=e}return m.prototype.document=function(e){var t,r,i,a,o,u=e.children,f,p;for(r=0,a=u.length;r<a;r++)t=u[r],t.isLastRootNode=!1;for(e.children[e.children.length-1].isLastRootNode=!0,f=e.children,p=[],i=0,o=f.length;i<o;i++)if(t=f[i],!(t instanceof l))switch(!1){case!(t instanceof s):p.push(this.declaration(t));break;case!(t instanceof c):p.push(this.docType(t));break;case!(t instanceof n):p.push(this.comment(t));break;case!(t instanceof d):p.push(this.processingInstruction(t));break;default:p.push(this.element(t))}return p},m.prototype.attribute=function(e){return this.stream.write(` `+e.name+`="`+e.value+`"`)},m.prototype.cdata=function(e,t){return this.stream.write(this.space(t)+`<![CDATA[`+e.text+`]]>`+this.endline(e))},m.prototype.comment=function(e,t){return this.stream.write(this.space(t)+`<!-- `+e.text+` -->`+this.endline(e))},m.prototype.declaration=function(e,t){return this.stream.write(this.space(t)),this.stream.write(`<?xml version="`+e.version+`"`),e.encoding!=null&&this.stream.write(` encoding="`+e.encoding+`"`),e.standalone!=null&&this.stream.write(` standalone="`+e.standalone+`"`),this.stream.write(this.spacebeforeslash+`?>`),this.stream.write(this.endline(e))},m.prototype.docType=function(t,s){var c,l,u,f;if(s||=0,this.stream.write(this.space(s)),this.stream.write(`<!DOCTYPE `+t.root().name),t.pubID&&t.sysID?this.stream.write(` PUBLIC "`+t.pubID+`" "`+t.sysID+`"`):t.sysID&&this.stream.write(` SYSTEM "`+t.sysID+`"`),t.children.length>0){for(this.stream.write(` [`),this.stream.write(this.endline(t)),f=t.children,l=0,u=f.length;l<u;l++)switch(c=f[l],!1){case!(c instanceof r):this.dtdAttList(c,s+1);break;case!(c instanceof i):this.dtdElement(c,s+1);break;case!(c instanceof a):this.dtdEntity(c,s+1);break;case!(c instanceof o):this.dtdNotation(c,s+1);break;case!(c instanceof e):this.cdata(c,s+1);break;case!(c instanceof n):this.comment(c,s+1);break;case!(c instanceof d):this.processingInstruction(c,s+1);break;default:throw Error(`Unknown DTD node type: `+c.constructor.name)}this.stream.write(`]`)}return this.stream.write(this.spacebeforeslash+`>`),this.stream.write(this.endline(t))},m.prototype.element=function(t,r){var i,a,o,s,c,m,h,_;for(c in r||=0,_=this.space(r),this.stream.write(_+`<`+t.name),m=t.attributes,m)g.call(m,c)&&(i=m[c],this.attribute(i));if(t.children.length===0||t.children.every(function(e){return e.value===``}))this.allowEmpty?this.stream.write(`></`+t.name+`>`):this.stream.write(this.spacebeforeslash+`/>`);else if(this.pretty&&t.children.length===1&&t.children[0].value!=null)this.stream.write(`>`),this.stream.write(t.children[0].value),this.stream.write(`</`+t.name+`>`);else{for(this.stream.write(`>`+this.newline),h=t.children,o=0,s=h.length;o<s;o++)switch(a=h[o],!1){case!(a instanceof e):this.cdata(a,r+1);break;case!(a instanceof n):this.comment(a,r+1);break;case!(a instanceof u):this.element(a,r+1);break;case!(a instanceof f):this.raw(a,r+1);break;case!(a instanceof p):this.text(a,r+1);break;case!(a instanceof d):this.processingInstruction(a,r+1);break;case!(a instanceof l):break;default:throw Error(`Unknown XML node type: `+a.constructor.name)}this.stream.write(_+`</`+t.name+`>`)}return this.stream.write(this.endline(t))},m.prototype.processingInstruction=function(e,t){return this.stream.write(this.space(t)+`<?`+e.target),e.value&&this.stream.write(` `+e.value),this.stream.write(this.spacebeforeslash+`?>`+this.endline(e))},m.prototype.raw=function(e,t){return this.stream.write(this.space(t)+e.value+this.endline(e))},m.prototype.text=function(e,t){return this.stream.write(this.space(t)+e.value+this.endline(e))},m.prototype.dtdAttList=function(e,t){return this.stream.write(this.space(t)+`<!ATTLIST `+e.elementName+` `+e.attributeName+` `+e.attributeType),e.defaultValueType!==`#DEFAULT`&&this.stream.write(` `+e.defaultValueType),e.defaultValue&&this.stream.write(` "`+e.defaultValue+`"`),this.stream.write(this.spacebeforeslash+`>`+this.endline(e))},m.prototype.dtdElement=function(e,t){return this.stream.write(this.space(t)+`<!ELEMENT `+e.name+` `+e.value),this.stream.write(this.spacebeforeslash+`>`+this.endline(e))},m.prototype.dtdEntity=function(e,t){return this.stream.write(this.space(t)+`<!ENTITY`),e.pe&&this.stream.write(` %`),this.stream.write(` `+e.name),e.value?this.stream.write(` "`+e.value+`"`):(e.pubID&&e.sysID?this.stream.write(` PUBLIC "`+e.pubID+`" "`+e.sysID+`"`):e.sysID&&this.stream.write(` SYSTEM "`+e.sysID+`"`),e.nData&&this.stream.write(` NDATA `+e.nData)),this.stream.write(this.spacebeforeslash+`>`+this.endline(e))},m.prototype.dtdNotation=function(e,t){return this.stream.write(this.space(t)+`<!NOTATION `+e.name),e.pubID&&e.sysID?this.stream.write(` PUBLIC "`+e.pubID+`" "`+e.sysID+`"`):e.pubID?this.stream.write(` PUBLIC "`+e.pubID+`"`):e.sysID&&this.stream.write(` SYSTEM "`+e.sysID+`"`),this.stream.write(this.spacebeforeslash+`>`+this.endline(e))},m.prototype.endline=function(e){return e.isLastRootNode?``:this.newline},m})(m)}).call(e)})),tW=s(((e,t)=>{(function(){var e,n,r,i,a,o,s=NU();a=s.assign,o=s.isFunction,e=QU(),n=$U(),i=ZU(),r=eW(),t.exports.create=function(t,n,r,i){var o,s;if(t==null)throw Error(`Root element needs a name.`);return i=a({},n,r,i),o=new e(i),s=o.element(t),i.headless||(o.declaration(i),(i.pubID!=null||i.sysID!=null)&&o.doctype(i)),s},t.exports.begin=function(t,r,i){var a;return o(t)&&(a=[t,r],r=a[0],i=a[1],t={}),r?new n(t,r,i):new e(t)},t.exports.stringWriter=function(e){return new i(e)},t.exports.streamWriter=function(e,t){return new r(e,t)}}).call(e)})),nW=s((e=>{var t=(IH(),d(FH)),n=tW();e.writeString=r;function r(e,r){var a=t.invert(r),o={element:c,text:i};function s(e,t){return o[t.type](e,t)}function c(e,t){var n=e.element(l(t.name),t.attributes);t.children.forEach(function(e){s(n,e)})}function l(e){var t=/^\{(.*)\}(.*)$/.exec(e);if(t){var n=a[t[1]];return n+(n===``?``:`:`)+t[2]}else return e}function u(e){var i=n.create(l(e.name),{version:`1.0`,encoding:`UTF-8`,standalone:!0});return t.forEach(r,function(e,t){var n=`xmlns`+(t===``?``:`:`+t);i.attribute(n,e)}),e.children.forEach(function(e){s(i,e)}),i.end()}return u(e)}function i(e,t){e.text(t.value)}})),rW=s((e=>{var t=wU();e.Element=t.Element,e.element=t.element,e.emptyElement=t.emptyElement,e.text=t.text,e.readString=MU().readString,e.writeString=nW().writeString})),iW=s((e=>{var t=(IH(),d(FH)),n=vU(),r=rW();e.read=a,e.readXmlFromZipFile=o;var i={"http://schemas.openxmlformats.org/wordprocessingml/2006/main":`w`,"http://schemas.openxmlformats.org/officeDocument/2006/relationships":`r`,"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing":`wp`,"http://schemas.openxmlformats.org/drawingml/2006/main":`a`,"http://schemas.openxmlformats.org/drawingml/2006/picture":`pic`,"http://purl.oclc.org/ooxml/wordprocessingml/main":`w`,"http://purl.oclc.org/ooxml/officeDocument/relationships":`r`,"http://purl.oclc.org/ooxml/drawingml/wordprocessingDrawing":`wp`,"http://purl.oclc.org/ooxml/drawingml/main":`a`,"http://purl.oclc.org/ooxml/drawingml/picture":`pic`,"http://schemas.openxmlformats.org/package/2006/content-types":`content-types`,"http://schemas.openxmlformats.org/package/2006/relationships":`relationships`,"http://schemas.openxmlformats.org/markup-compatibility/2006":`mc`,"urn:schemas-microsoft-com:vml":`v`,"urn:schemas-microsoft-com:office:word":`office-word`,"http://schemas.microsoft.com/office/word/2010/wordml":`wordml`};function a(e){return r.readString(e,i).then(function(e){return c(e)[0]})}function o(e,t){return e.exists(t)?e.read(t,`utf-8`).then(s).then(a):n.resolve(null)}function s(e){return e.replace(/^\uFEFF/g,``)}function c(e){return e.type===`element`?e.name===`mc:AlternateContent`?e.firstOrEmpty(`mc:Fallback`).children:(e.children=t.flatten(e.children.map(c,!0)),[e]):[e]}})),aW=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=[{"Typeface name":`Symbol`,"Dingbat dec":`32`,"Dingbat hex":`20`,"Unicode dec":`32`,"Unicode hex":`20`},{"Typeface name":`Symbol`,"Dingbat dec":`33`,"Dingbat hex":`21`,"Unicode dec":`33`,"Unicode hex":`21`},{"Typeface name":`Symbol`,"Dingbat dec":`34`,"Dingbat hex":`22`,"Unicode dec":`8704`,"Unicode hex":`2200`},{"Typeface name":`Symbol`,"Dingbat dec":`35`,"Dingbat hex":`23`,"Unicode dec":`35`,"Unicode hex":`23`},{"Typeface name":`Symbol`,"Dingbat dec":`36`,"Dingbat hex":`24`,"Unicode dec":`8707`,"Unicode hex":`2203`},{"Typeface name":`Symbol`,"Dingbat dec":`37`,"Dingbat hex":`25`,"Unicode dec":`37`,"Unicode hex":`25`},{"Typeface name":`Symbol`,"Dingbat dec":`38`,"Dingbat hex":`26`,"Unicode dec":`38`,"Unicode hex":`26`},{"Typeface name":`Symbol`,"Dingbat dec":`39`,"Dingbat hex":`27`,"Unicode dec":`8717`,"Unicode hex":`220D`},{"Typeface name":`Symbol`,"Dingbat dec":`40`,"Dingbat hex":`28`,"Unicode dec":`40`,"Unicode hex":`28`},{"Typeface name":`Symbol`,"Dingbat dec":`41`,"Dingbat hex":`29`,"Unicode dec":`41`,"Unicode hex":`29`},{"Typeface name":`Symbol`,"Dingbat dec":`42`,"Dingbat hex":`2A`,"Unicode dec":`42`,"Unicode hex":`2A`},{"Typeface name":`Symbol`,"Dingbat dec":`43`,"Dingbat hex":`2B`,"Unicode dec":`43`,"Unicode hex":`2B`},{"Typeface name":`Symbol`,"Dingbat dec":`44`,"Dingbat hex":`2C`,"Unicode dec":`44`,"Unicode hex":`2C`},{"Typeface name":`Symbol`,"Dingbat dec":`45`,"Dingbat hex":`2D`,"Unicode dec":`8722`,"Unicode hex":`2212`},{"Typeface name":`Symbol`,"Dingbat dec":`46`,"Dingbat hex":`2E`,"Unicode dec":`46`,"Unicode hex":`2E`},{"Typeface name":`Symbol`,"Dingbat dec":`47`,"Dingbat hex":`2F`,"Unicode dec":`47`,"Unicode hex":`2F`},{"Typeface name":`Symbol`,"Dingbat dec":`48`,"Dingbat hex":`30`,"Unicode dec":`48`,"Unicode hex":`30`},{"Typeface name":`Symbol`,"Dingbat dec":`49`,"Dingbat hex":`31`,"Unicode dec":`49`,"Unicode hex":`31`},{"Typeface name":`Symbol`,"Dingbat dec":`50`,"Dingbat hex":`32`,"Unicode dec":`50`,"Unicode hex":`32`},{"Typeface name":`Symbol`,"Dingbat dec":`51`,"Dingbat hex":`33`,"Unicode dec":`51`,"Unicode hex":`33`},{"Typeface name":`Symbol`,"Dingbat dec":`52`,"Dingbat hex":`34`,"Unicode dec":`52`,"Unicode hex":`34`},{"Typeface name":`Symbol`,"Dingbat dec":`53`,"Dingbat hex":`35`,"Unicode dec":`53`,"Unicode hex":`35`},{"Typeface name":`Symbol`,"Dingbat dec":`54`,"Dingbat hex":`36`,"Unicode dec":`54`,"Unicode hex":`36`},{"Typeface name":`Symbol`,"Dingbat dec":`55`,"Dingbat hex":`37`,"Unicode dec":`55`,"Unicode hex":`37`},{"Typeface name":`Symbol`,"Dingbat dec":`56`,"Dingbat hex":`38`,"Unicode dec":`56`,"Unicode hex":`38`},{"Typeface name":`Symbol`,"Dingbat dec":`57`,"Dingbat hex":`39`,"Unicode dec":`57`,"Unicode hex":`39`},{"Typeface name":`Symbol`,"Dingbat dec":`58`,"Dingbat hex":`3A`,"Unicode dec":`58`,"Unicode hex":`3A`},{"Typeface name":`Symbol`,"Dingbat dec":`59`,"Dingbat hex":`3B`,"Unicode dec":`59`,"Unicode hex":`3B`},{"Typeface name":`Symbol`,"Dingbat dec":`60`,"Dingbat hex":`3C`,"Unicode dec":`60`,"Unicode hex":`3C`},{"Typeface name":`Symbol`,"Dingbat dec":`61`,"Dingbat hex":`3D`,"Unicode dec":`61`,"Unicode hex":`3D`},{"Typeface name":`Symbol`,"Dingbat dec":`62`,"Dingbat hex":`3E`,"Unicode dec":`62`,"Unicode hex":`3E`},{"Typeface name":`Symbol`,"Dingbat dec":`63`,"Dingbat hex":`3F`,"Unicode dec":`63`,"Unicode hex":`3F`},{"Typeface name":`Symbol`,"Dingbat dec":`64`,"Dingbat hex":`40`,"Unicode dec":`8773`,"Unicode hex":`2245`},{"Typeface name":`Symbol`,"Dingbat dec":`65`,"Dingbat hex":`41`,"Unicode dec":`913`,"Unicode hex":`391`},{"Typeface name":`Symbol`,"Dingbat dec":`66`,"Dingbat hex":`42`,"Unicode dec":`914`,"Unicode hex":`392`},{"Typeface name":`Symbol`,"Dingbat dec":`67`,"Dingbat hex":`43`,"Unicode dec":`935`,"Unicode hex":`3A7`},{"Typeface name":`Symbol`,"Dingbat dec":`68`,"Dingbat hex":`44`,"Unicode dec":`916`,"Unicode hex":`394`},{"Typeface name":`Symbol`,"Dingbat dec":`69`,"Dingbat hex":`45`,"Unicode dec":`917`,"Unicode hex":`395`},{"Typeface name":`Symbol`,"Dingbat dec":`70`,"Dingbat hex":`46`,"Unicode dec":`934`,"Unicode hex":`3A6`},{"Typeface name":`Symbol`,"Dingbat dec":`71`,"Dingbat hex":`47`,"Unicode dec":`915`,"Unicode hex":`393`},{"Typeface name":`Symbol`,"Dingbat dec":`72`,"Dingbat hex":`48`,"Unicode dec":`919`,"Unicode hex":`397`},{"Typeface name":`Symbol`,"Dingbat dec":`73`,"Dingbat hex":`49`,"Unicode dec":`921`,"Unicode hex":`399`},{"Typeface name":`Symbol`,"Dingbat dec":`74`,"Dingbat hex":`4A`,"Unicode dec":`977`,"Unicode hex":`3D1`},{"Typeface name":`Symbol`,"Dingbat dec":`75`,"Dingbat hex":`4B`,"Unicode dec":`922`,"Unicode hex":`39A`},{"Typeface name":`Symbol`,"Dingbat dec":`76`,"Dingbat hex":`4C`,"Unicode dec":`923`,"Unicode hex":`39B`},{"Typeface name":`Symbol`,"Dingbat dec":`77`,"Dingbat hex":`4D`,"Unicode dec":`924`,"Unicode hex":`39C`},{"Typeface name":`Symbol`,"Dingbat dec":`78`,"Dingbat hex":`4E`,"Unicode dec":`925`,"Unicode hex":`39D`},{"Typeface name":`Symbol`,"Dingbat dec":`79`,"Dingbat hex":`4F`,"Unicode dec":`927`,"Unicode hex":`39F`},{"Typeface name":`Symbol`,"Dingbat dec":`80`,"Dingbat hex":`50`,"Unicode dec":`928`,"Unicode hex":`3A0`},{"Typeface name":`Symbol`,"Dingbat dec":`81`,"Dingbat hex":`51`,"Unicode dec":`920`,"Unicode hex":`398`},{"Typeface name":`Symbol`,"Dingbat dec":`82`,"Dingbat hex":`52`,"Unicode dec":`929`,"Unicode hex":`3A1`},{"Typeface name":`Symbol`,"Dingbat dec":`83`,"Dingbat hex":`53`,"Unicode dec":`931`,"Unicode hex":`3A3`},{"Typeface name":`Symbol`,"Dingbat dec":`84`,"Dingbat hex":`54`,"Unicode dec":`932`,"Unicode hex":`3A4`},{"Typeface name":`Symbol`,"Dingbat dec":`85`,"Dingbat hex":`55`,"Unicode dec":`933`,"Unicode hex":`3A5`},{"Typeface name":`Symbol`,"Dingbat dec":`86`,"Dingbat hex":`56`,"Unicode dec":`962`,"Unicode hex":`3C2`},{"Typeface name":`Symbol`,"Dingbat dec":`87`,"Dingbat hex":`57`,"Unicode dec":`937`,"Unicode hex":`3A9`},{"Typeface name":`Symbol`,"Dingbat dec":`88`,"Dingbat hex":`58`,"Unicode dec":`926`,"Unicode hex":`39E`},{"Typeface name":`Symbol`,"Dingbat dec":`89`,"Dingbat hex":`59`,"Unicode dec":`936`,"Unicode hex":`3A8`},{"Typeface name":`Symbol`,"Dingbat dec":`90`,"Dingbat hex":`5A`,"Unicode dec":`918`,"Unicode hex":`396`},{"Typeface name":`Symbol`,"Dingbat dec":`91`,"Dingbat hex":`5B`,"Unicode dec":`91`,"Unicode hex":`5B`},{"Typeface name":`Symbol`,"Dingbat dec":`92`,"Dingbat hex":`5C`,"Unicode dec":`8756`,"Unicode hex":`2234`},{"Typeface name":`Symbol`,"Dingbat dec":`93`,"Dingbat hex":`5D`,"Unicode dec":`93`,"Unicode hex":`5D`},{"Typeface name":`Symbol`,"Dingbat dec":`94`,"Dingbat hex":`5E`,"Unicode dec":`8869`,"Unicode hex":`22A5`},{"Typeface name":`Symbol`,"Dingbat dec":`95`,"Dingbat hex":`5F`,"Unicode dec":`95`,"Unicode hex":`5F`},{"Typeface name":`Symbol`,"Dingbat dec":`96`,"Dingbat hex":`60`,"Unicode dec":`8254`,"Unicode hex":`203E`},{"Typeface name":`Symbol`,"Dingbat dec":`97`,"Dingbat hex":`61`,"Unicode dec":`945`,"Unicode hex":`3B1`},{"Typeface name":`Symbol`,"Dingbat dec":`98`,"Dingbat hex":`62`,"Unicode dec":`946`,"Unicode hex":`3B2`},{"Typeface name":`Symbol`,"Dingbat dec":`99`,"Dingbat hex":`63`,"Unicode dec":`967`,"Unicode hex":`3C7`},{"Typeface name":`Symbol`,"Dingbat dec":`100`,"Dingbat hex":`64`,"Unicode dec":`948`,"Unicode hex":`3B4`},{"Typeface name":`Symbol`,"Dingbat dec":`101`,"Dingbat hex":`65`,"Unicode dec":`949`,"Unicode hex":`3B5`},{"Typeface name":`Symbol`,"Dingbat dec":`102`,"Dingbat hex":`66`,"Unicode dec":`966`,"Unicode hex":`3C6`},{"Typeface name":`Symbol`,"Dingbat dec":`103`,"Dingbat hex":`67`,"Unicode dec":`947`,"Unicode hex":`3B3`},{"Typeface name":`Symbol`,"Dingbat dec":`104`,"Dingbat hex":`68`,"Unicode dec":`951`,"Unicode hex":`3B7`},{"Typeface name":`Symbol`,"Dingbat dec":`105`,"Dingbat hex":`69`,"Unicode dec":`953`,"Unicode hex":`3B9`},{"Typeface name":`Symbol`,"Dingbat dec":`106`,"Dingbat hex":`6A`,"Unicode dec":`981`,"Unicode hex":`3D5`},{"Typeface name":`Symbol`,"Dingbat dec":`107`,"Dingbat hex":`6B`,"Unicode dec":`954`,"Unicode hex":`3BA`},{"Typeface name":`Symbol`,"Dingbat dec":`108`,"Dingbat hex":`6C`,"Unicode dec":`955`,"Unicode hex":`3BB`},{"Typeface name":`Symbol`,"Dingbat dec":`109`,"Dingbat hex":`6D`,"Unicode dec":`956`,"Unicode hex":`3BC`},{"Typeface name":`Symbol`,"Dingbat dec":`110`,"Dingbat hex":`6E`,"Unicode dec":`957`,"Unicode hex":`3BD`},{"Typeface name":`Symbol`,"Dingbat dec":`111`,"Dingbat hex":`6F`,"Unicode dec":`959`,"Unicode hex":`3BF`},{"Typeface name":`Symbol`,"Dingbat dec":`112`,"Dingbat hex":`70`,"Unicode dec":`960`,"Unicode hex":`3C0`},{"Typeface name":`Symbol`,"Dingbat dec":`113`,"Dingbat hex":`71`,"Unicode dec":`952`,"Unicode hex":`3B8`},{"Typeface name":`Symbol`,"Dingbat dec":`114`,"Dingbat hex":`72`,"Unicode dec":`961`,"Unicode hex":`3C1`},{"Typeface name":`Symbol`,"Dingbat dec":`115`,"Dingbat hex":`73`,"Unicode dec":`963`,"Unicode hex":`3C3`},{"Typeface name":`Symbol`,"Dingbat dec":`116`,"Dingbat hex":`74`,"Unicode dec":`964`,"Unicode hex":`3C4`},{"Typeface name":`Symbol`,"Dingbat dec":`117`,"Dingbat hex":`75`,"Unicode dec":`965`,"Unicode hex":`3C5`},{"Typeface name":`Symbol`,"Dingbat dec":`118`,"Dingbat hex":`76`,"Unicode dec":`982`,"Unicode hex":`3D6`},{"Typeface name":`Symbol`,"Dingbat dec":`119`,"Dingbat hex":`77`,"Unicode dec":`969`,"Unicode hex":`3C9`},{"Typeface name":`Symbol`,"Dingbat dec":`120`,"Dingbat hex":`78`,"Unicode dec":`958`,"Unicode hex":`3BE`},{"Typeface name":`Symbol`,"Dingbat dec":`121`,"Dingbat hex":`79`,"Unicode dec":`968`,"Unicode hex":`3C8`},{"Typeface name":`Symbol`,"Dingbat dec":`122`,"Dingbat hex":`7A`,"Unicode dec":`950`,"Unicode hex":`3B6`},{"Typeface name":`Symbol`,"Dingbat dec":`123`,"Dingbat hex":`7B`,"Unicode dec":`123`,"Unicode hex":`7B`},{"Typeface name":`Symbol`,"Dingbat dec":`124`,"Dingbat hex":`7C`,"Unicode dec":`124`,"Unicode hex":`7C`},{"Typeface name":`Symbol`,"Dingbat dec":`125`,"Dingbat hex":`7D`,"Unicode dec":`125`,"Unicode hex":`7D`},{"Typeface name":`Symbol`,"Dingbat dec":`126`,"Dingbat hex":`7E`,"Unicode dec":`126`,"Unicode hex":`7E`},{"Typeface name":`Symbol`,"Dingbat dec":`160`,"Dingbat hex":`A0`,"Unicode dec":`8364`,"Unicode hex":`20AC`},{"Typeface name":`Symbol`,"Dingbat dec":`161`,"Dingbat hex":`A1`,"Unicode dec":`978`,"Unicode hex":`3D2`},{"Typeface name":`Symbol`,"Dingbat dec":`162`,"Dingbat hex":`A2`,"Unicode dec":`8242`,"Unicode hex":`2032`},{"Typeface name":`Symbol`,"Dingbat dec":`163`,"Dingbat hex":`A3`,"Unicode dec":`8804`,"Unicode hex":`2264`},{"Typeface name":`Symbol`,"Dingbat dec":`164`,"Dingbat hex":`A4`,"Unicode dec":`8260`,"Unicode hex":`2044`},{"Typeface name":`Symbol`,"Dingbat dec":`165`,"Dingbat hex":`A5`,"Unicode dec":`8734`,"Unicode hex":`221E`},{"Typeface name":`Symbol`,"Dingbat dec":`166`,"Dingbat hex":`A6`,"Unicode dec":`402`,"Unicode hex":`192`},{"Typeface name":`Symbol`,"Dingbat dec":`167`,"Dingbat hex":`A7`,"Unicode dec":`9827`,"Unicode hex":`2663`},{"Typeface name":`Symbol`,"Dingbat dec":`168`,"Dingbat hex":`A8`,"Unicode dec":`9830`,"Unicode hex":`2666`},{"Typeface name":`Symbol`,"Dingbat dec":`169`,"Dingbat hex":`A9`,"Unicode dec":`9829`,"Unicode hex":`2665`},{"Typeface name":`Symbol`,"Dingbat dec":`170`,"Dingbat hex":`AA`,"Unicode dec":`9824`,"Unicode hex":`2660`},{"Typeface name":`Symbol`,"Dingbat dec":`171`,"Dingbat hex":`AB`,"Unicode dec":`8596`,"Unicode hex":`2194`},{"Typeface name":`Symbol`,"Dingbat dec":`172`,"Dingbat hex":`AC`,"Unicode dec":`8592`,"Unicode hex":`2190`},{"Typeface name":`Symbol`,"Dingbat dec":`173`,"Dingbat hex":`AD`,"Unicode dec":`8593`,"Unicode hex":`2191`},{"Typeface name":`Symbol`,"Dingbat dec":`174`,"Dingbat hex":`AE`,"Unicode dec":`8594`,"Unicode hex":`2192`},{"Typeface name":`Symbol`,"Dingbat dec":`175`,"Dingbat hex":`AF`,"Unicode dec":`8595`,"Unicode hex":`2193`},{"Typeface name":`Symbol`,"Dingbat dec":`176`,"Dingbat hex":`B0`,"Unicode dec":`176`,"Unicode hex":`B0`},{"Typeface name":`Symbol`,"Dingbat dec":`177`,"Dingbat hex":`B1`,"Unicode dec":`177`,"Unicode hex":`B1`},{"Typeface name":`Symbol`,"Dingbat dec":`178`,"Dingbat hex":`B2`,"Unicode dec":`8243`,"Unicode hex":`2033`},{"Typeface name":`Symbol`,"Dingbat dec":`179`,"Dingbat hex":`B3`,"Unicode dec":`8805`,"Unicode hex":`2265`},{"Typeface name":`Symbol`,"Dingbat dec":`180`,"Dingbat hex":`B4`,"Unicode dec":`215`,"Unicode hex":`D7`},{"Typeface name":`Symbol`,"Dingbat dec":`181`,"Dingbat hex":`B5`,"Unicode dec":`8733`,"Unicode hex":`221D`},{"Typeface name":`Symbol`,"Dingbat dec":`182`,"Dingbat hex":`B6`,"Unicode dec":`8706`,"Unicode hex":`2202`},{"Typeface name":`Symbol`,"Dingbat dec":`183`,"Dingbat hex":`B7`,"Unicode dec":`8226`,"Unicode hex":`2022`},{"Typeface name":`Symbol`,"Dingbat dec":`184`,"Dingbat hex":`B8`,"Unicode dec":`247`,"Unicode hex":`F7`},{"Typeface name":`Symbol`,"Dingbat dec":`185`,"Dingbat hex":`B9`,"Unicode dec":`8800`,"Unicode hex":`2260`},{"Typeface name":`Symbol`,"Dingbat dec":`186`,"Dingbat hex":`BA`,"Unicode dec":`8801`,"Unicode hex":`2261`},{"Typeface name":`Symbol`,"Dingbat dec":`187`,"Dingbat hex":`BB`,"Unicode dec":`8776`,"Unicode hex":`2248`},{"Typeface name":`Symbol`,"Dingbat dec":`188`,"Dingbat hex":`BC`,"Unicode dec":`8230`,"Unicode hex":`2026`},{"Typeface name":`Symbol`,"Dingbat dec":`189`,"Dingbat hex":`BD`,"Unicode dec":`9168`,"Unicode hex":`23D0`},{"Typeface name":`Symbol`,"Dingbat dec":`190`,"Dingbat hex":`BE`,"Unicode dec":`9135`,"Unicode hex":`23AF`},{"Typeface name":`Symbol`,"Dingbat dec":`191`,"Dingbat hex":`BF`,"Unicode dec":`8629`,"Unicode hex":`21B5`},{"Typeface name":`Symbol`,"Dingbat dec":`192`,"Dingbat hex":`C0`,"Unicode dec":`8501`,"Unicode hex":`2135`},{"Typeface name":`Symbol`,"Dingbat dec":`193`,"Dingbat hex":`C1`,"Unicode dec":`8465`,"Unicode hex":`2111`},{"Typeface name":`Symbol`,"Dingbat dec":`194`,"Dingbat hex":`C2`,"Unicode dec":`8476`,"Unicode hex":`211C`},{"Typeface name":`Symbol`,"Dingbat dec":`195`,"Dingbat hex":`C3`,"Unicode dec":`8472`,"Unicode hex":`2118`},{"Typeface name":`Symbol`,"Dingbat dec":`196`,"Dingbat hex":`C4`,"Unicode dec":`8855`,"Unicode hex":`2297`},{"Typeface name":`Symbol`,"Dingbat dec":`197`,"Dingbat hex":`C5`,"Unicode dec":`8853`,"Unicode hex":`2295`},{"Typeface name":`Symbol`,"Dingbat dec":`198`,"Dingbat hex":`C6`,"Unicode dec":`8709`,"Unicode hex":`2205`},{"Typeface name":`Symbol`,"Dingbat dec":`199`,"Dingbat hex":`C7`,"Unicode dec":`8745`,"Unicode hex":`2229`},{"Typeface name":`Symbol`,"Dingbat dec":`200`,"Dingbat hex":`C8`,"Unicode dec":`8746`,"Unicode hex":`222A`},{"Typeface name":`Symbol`,"Dingbat dec":`201`,"Dingbat hex":`C9`,"Unicode dec":`8835`,"Unicode hex":`2283`},{"Typeface name":`Symbol`,"Dingbat dec":`202`,"Dingbat hex":`CA`,"Unicode dec":`8839`,"Unicode hex":`2287`},{"Typeface name":`Symbol`,"Dingbat dec":`203`,"Dingbat hex":`CB`,"Unicode dec":`8836`,"Unicode hex":`2284`},{"Typeface name":`Symbol`,"Dingbat dec":`204`,"Dingbat hex":`CC`,"Unicode dec":`8834`,"Unicode hex":`2282`},{"Typeface name":`Symbol`,"Dingbat dec":`205`,"Dingbat hex":`CD`,"Unicode dec":`8838`,"Unicode hex":`2286`},{"Typeface name":`Symbol`,"Dingbat dec":`206`,"Dingbat hex":`CE`,"Unicode dec":`8712`,"Unicode hex":`2208`},{"Typeface name":`Symbol`,"Dingbat dec":`207`,"Dingbat hex":`CF`,"Unicode dec":`8713`,"Unicode hex":`2209`},{"Typeface name":`Symbol`,"Dingbat dec":`208`,"Dingbat hex":`D0`,"Unicode dec":`8736`,"Unicode hex":`2220`},{"Typeface name":`Symbol`,"Dingbat dec":`209`,"Dingbat hex":`D1`,"Unicode dec":`8711`,"Unicode hex":`2207`},{"Typeface name":`Symbol`,"Dingbat dec":`210`,"Dingbat hex":`D2`,"Unicode dec":`174`,"Unicode hex":`AE`},{"Typeface name":`Symbol`,"Dingbat dec":`211`,"Dingbat hex":`D3`,"Unicode dec":`169`,"Unicode hex":`A9`},{"Typeface name":`Symbol`,"Dingbat dec":`212`,"Dingbat hex":`D4`,"Unicode dec":`8482`,"Unicode hex":`2122`},{"Typeface name":`Symbol`,"Dingbat dec":`213`,"Dingbat hex":`D5`,"Unicode dec":`8719`,"Unicode hex":`220F`},{"Typeface name":`Symbol`,"Dingbat dec":`214`,"Dingbat hex":`D6`,"Unicode dec":`8730`,"Unicode hex":`221A`},{"Typeface name":`Symbol`,"Dingbat dec":`215`,"Dingbat hex":`D7`,"Unicode dec":`8901`,"Unicode hex":`22C5`},{"Typeface name":`Symbol`,"Dingbat dec":`216`,"Dingbat hex":`D8`,"Unicode dec":`172`,"Unicode hex":`AC`},{"Typeface name":`Symbol`,"Dingbat dec":`217`,"Dingbat hex":`D9`,"Unicode dec":`8743`,"Unicode hex":`2227`},{"Typeface name":`Symbol`,"Dingbat dec":`218`,"Dingbat hex":`DA`,"Unicode dec":`8744`,"Unicode hex":`2228`},{"Typeface name":`Symbol`,"Dingbat dec":`219`,"Dingbat hex":`DB`,"Unicode dec":`8660`,"Unicode hex":`21D4`},{"Typeface name":`Symbol`,"Dingbat dec":`220`,"Dingbat hex":`DC`,"Unicode dec":`8656`,"Unicode hex":`21D0`},{"Typeface name":`Symbol`,"Dingbat dec":`221`,"Dingbat hex":`DD`,"Unicode dec":`8657`,"Unicode hex":`21D1`},{"Typeface name":`Symbol`,"Dingbat dec":`222`,"Dingbat hex":`DE`,"Unicode dec":`8658`,"Unicode hex":`21D2`},{"Typeface name":`Symbol`,"Dingbat dec":`223`,"Dingbat hex":`DF`,"Unicode dec":`8659`,"Unicode hex":`21D3`},{"Typeface name":`Symbol`,"Dingbat dec":`224`,"Dingbat hex":`E0`,"Unicode dec":`9674`,"Unicode hex":`25CA`},{"Typeface name":`Symbol`,"Dingbat dec":`225`,"Dingbat hex":`E1`,"Unicode dec":`12296`,"Unicode hex":`3008`},{"Typeface name":`Symbol`,"Dingbat dec":`226`,"Dingbat hex":`E2`,"Unicode dec":`174`,"Unicode hex":`AE`},{"Typeface name":`Symbol`,"Dingbat dec":`227`,"Dingbat hex":`E3`,"Unicode dec":`169`,"Unicode hex":`A9`},{"Typeface name":`Symbol`,"Dingbat dec":`228`,"Dingbat hex":`E4`,"Unicode dec":`8482`,"Unicode hex":`2122`},{"Typeface name":`Symbol`,"Dingbat dec":`229`,"Dingbat hex":`E5`,"Unicode dec":`8721`,"Unicode hex":`2211`},{"Typeface name":`Symbol`,"Dingbat dec":`230`,"Dingbat hex":`E6`,"Unicode dec":`9115`,"Unicode hex":`239B`},{"Typeface name":`Symbol`,"Dingbat dec":`231`,"Dingbat hex":`E7`,"Unicode dec":`9116`,"Unicode hex":`239C`},{"Typeface name":`Symbol`,"Dingbat dec":`232`,"Dingbat hex":`E8`,"Unicode dec":`9117`,"Unicode hex":`239D`},{"Typeface name":`Symbol`,"Dingbat dec":`233`,"Dingbat hex":`E9`,"Unicode dec":`9121`,"Unicode hex":`23A1`},{"Typeface name":`Symbol`,"Dingbat dec":`234`,"Dingbat hex":`EA`,"Unicode dec":`9122`,"Unicode hex":`23A2`},{"Typeface name":`Symbol`,"Dingbat dec":`235`,"Dingbat hex":`EB`,"Unicode dec":`9123`,"Unicode hex":`23A3`},{"Typeface name":`Symbol`,"Dingbat dec":`236`,"Dingbat hex":`EC`,"Unicode dec":`9127`,"Unicode hex":`23A7`},{"Typeface name":`Symbol`,"Dingbat dec":`237`,"Dingbat hex":`ED`,"Unicode dec":`9128`,"Unicode hex":`23A8`},{"Typeface name":`Symbol`,"Dingbat dec":`238`,"Dingbat hex":`EE`,"Unicode dec":`9129`,"Unicode hex":`23A9`},{"Typeface name":`Symbol`,"Dingbat dec":`239`,"Dingbat hex":`EF`,"Unicode dec":`9130`,"Unicode hex":`23AA`},{"Typeface name":`Symbol`,"Dingbat dec":`240`,"Dingbat hex":`F0`,"Unicode dec":`63743`,"Unicode hex":`F8FF`},{"Typeface name":`Symbol`,"Dingbat dec":`241`,"Dingbat hex":`F1`,"Unicode dec":`12297`,"Unicode hex":`3009`},{"Typeface name":`Symbol`,"Dingbat dec":`242`,"Dingbat hex":`F2`,"Unicode dec":`8747`,"Unicode hex":`222B`},{"Typeface name":`Symbol`,"Dingbat dec":`243`,"Dingbat hex":`F3`,"Unicode dec":`8992`,"Unicode hex":`2320`},{"Typeface name":`Symbol`,"Dingbat dec":`244`,"Dingbat hex":`F4`,"Unicode dec":`9134`,"Unicode hex":`23AE`},{"Typeface name":`Symbol`,"Dingbat dec":`245`,"Dingbat hex":`F5`,"Unicode dec":`8993`,"Unicode hex":`2321`},{"Typeface name":`Symbol`,"Dingbat dec":`246`,"Dingbat hex":`F6`,"Unicode dec":`9118`,"Unicode hex":`239E`},{"Typeface name":`Symbol`,"Dingbat dec":`247`,"Dingbat hex":`F7`,"Unicode dec":`9119`,"Unicode hex":`239F`},{"Typeface name":`Symbol`,"Dingbat dec":`248`,"Dingbat hex":`F8`,"Unicode dec":`9120`,"Unicode hex":`23A0`},{"Typeface name":`Symbol`,"Dingbat dec":`249`,"Dingbat hex":`F9`,"Unicode dec":`9124`,"Unicode hex":`23A4`},{"Typeface name":`Symbol`,"Dingbat dec":`250`,"Dingbat hex":`FA`,"Unicode dec":`9125`,"Unicode hex":`23A5`},{"Typeface name":`Symbol`,"Dingbat dec":`251`,"Dingbat hex":`FB`,"Unicode dec":`9126`,"Unicode hex":`23A6`},{"Typeface name":`Symbol`,"Dingbat dec":`252`,"Dingbat hex":`FC`,"Unicode dec":`9131`,"Unicode hex":`23AB`},{"Typeface name":`Symbol`,"Dingbat dec":`253`,"Dingbat hex":`FD`,"Unicode dec":`9132`,"Unicode hex":`23AC`},{"Typeface name":`Symbol`,"Dingbat dec":`254`,"Dingbat hex":`FE`,"Unicode dec":`9133`,"Unicode hex":`23AD`},{"Typeface name":`Webdings`,"Dingbat dec":`32`,"Dingbat hex":`20`,"Unicode dec":`32`,"Unicode hex":`20`},{"Typeface name":`Webdings`,"Dingbat dec":`33`,"Dingbat hex":`21`,"Unicode dec":`128375`,"Unicode hex":`1F577`},{"Typeface name":`Webdings`,"Dingbat dec":`34`,"Dingbat hex":`22`,"Unicode dec":`128376`,"Unicode hex":`1F578`},{"Typeface name":`Webdings`,"Dingbat dec":`35`,"Dingbat hex":`23`,"Unicode dec":`128370`,"Unicode hex":`1F572`},{"Typeface name":`Webdings`,"Dingbat dec":`36`,"Dingbat hex":`24`,"Unicode dec":`128374`,"Unicode hex":`1F576`},{"Typeface name":`Webdings`,"Dingbat dec":`37`,"Dingbat hex":`25`,"Unicode dec":`127942`,"Unicode hex":`1F3C6`},{"Typeface name":`Webdings`,"Dingbat dec":`38`,"Dingbat hex":`26`,"Unicode dec":`127894`,"Unicode hex":`1F396`},{"Typeface name":`Webdings`,"Dingbat dec":`39`,"Dingbat hex":`27`,"Unicode dec":`128391`,"Unicode hex":`1F587`},{"Typeface name":`Webdings`,"Dingbat dec":`40`,"Dingbat hex":`28`,"Unicode dec":`128488`,"Unicode hex":`1F5E8`},{"Typeface name":`Webdings`,"Dingbat dec":`41`,"Dingbat hex":`29`,"Unicode dec":`128489`,"Unicode hex":`1F5E9`},{"Typeface name":`Webdings`,"Dingbat dec":`42`,"Dingbat hex":`2A`,"Unicode dec":`128496`,"Unicode hex":`1F5F0`},{"Typeface name":`Webdings`,"Dingbat dec":`43`,"Dingbat hex":`2B`,"Unicode dec":`128497`,"Unicode hex":`1F5F1`},{"Typeface name":`Webdings`,"Dingbat dec":`44`,"Dingbat hex":`2C`,"Unicode dec":`127798`,"Unicode hex":`1F336`},{"Typeface name":`Webdings`,"Dingbat dec":`45`,"Dingbat hex":`2D`,"Unicode dec":`127895`,"Unicode hex":`1F397`},{"Typeface name":`Webdings`,"Dingbat dec":`46`,"Dingbat hex":`2E`,"Unicode dec":`128638`,"Unicode hex":`1F67E`},{"Typeface name":`Webdings`,"Dingbat dec":`47`,"Dingbat hex":`2F`,"Unicode dec":`128636`,"Unicode hex":`1F67C`},{"Typeface name":`Webdings`,"Dingbat dec":`48`,"Dingbat hex":`30`,"Unicode dec":`128469`,"Unicode hex":`1F5D5`},{"Typeface name":`Webdings`,"Dingbat dec":`49`,"Dingbat hex":`31`,"Unicode dec":`128470`,"Unicode hex":`1F5D6`},{"Typeface name":`Webdings`,"Dingbat dec":`50`,"Dingbat hex":`32`,"Unicode dec":`128471`,"Unicode hex":`1F5D7`},{"Typeface name":`Webdings`,"Dingbat dec":`51`,"Dingbat hex":`33`,"Unicode dec":`9204`,"Unicode hex":`23F4`},{"Typeface name":`Webdings`,"Dingbat dec":`52`,"Dingbat hex":`34`,"Unicode dec":`9205`,"Unicode hex":`23F5`},{"Typeface name":`Webdings`,"Dingbat dec":`53`,"Dingbat hex":`35`,"Unicode dec":`9206`,"Unicode hex":`23F6`},{"Typeface name":`Webdings`,"Dingbat dec":`54`,"Dingbat hex":`36`,"Unicode dec":`9207`,"Unicode hex":`23F7`},{"Typeface name":`Webdings`,"Dingbat dec":`55`,"Dingbat hex":`37`,"Unicode dec":`9194`,"Unicode hex":`23EA`},{"Typeface name":`Webdings`,"Dingbat dec":`56`,"Dingbat hex":`38`,"Unicode dec":`9193`,"Unicode hex":`23E9`},{"Typeface name":`Webdings`,"Dingbat dec":`57`,"Dingbat hex":`39`,"Unicode dec":`9198`,"Unicode hex":`23EE`},{"Typeface name":`Webdings`,"Dingbat dec":`58`,"Dingbat hex":`3A`,"Unicode dec":`9197`,"Unicode hex":`23ED`},{"Typeface name":`Webdings`,"Dingbat dec":`59`,"Dingbat hex":`3B`,"Unicode dec":`9208`,"Unicode hex":`23F8`},{"Typeface name":`Webdings`,"Dingbat dec":`60`,"Dingbat hex":`3C`,"Unicode dec":`9209`,"Unicode hex":`23F9`},{"Typeface name":`Webdings`,"Dingbat dec":`61`,"Dingbat hex":`3D`,"Unicode dec":`9210`,"Unicode hex":`23FA`},{"Typeface name":`Webdings`,"Dingbat dec":`62`,"Dingbat hex":`3E`,"Unicode dec":`128474`,"Unicode hex":`1F5DA`},{"Typeface name":`Webdings`,"Dingbat dec":`63`,"Dingbat hex":`3F`,"Unicode dec":`128499`,"Unicode hex":`1F5F3`},{"Typeface name":`Webdings`,"Dingbat dec":`64`,"Dingbat hex":`40`,"Unicode dec":`128736`,"Unicode hex":`1F6E0`},{"Typeface name":`Webdings`,"Dingbat dec":`65`,"Dingbat hex":`41`,"Unicode dec":`127959`,"Unicode hex":`1F3D7`},{"Typeface name":`Webdings`,"Dingbat dec":`66`,"Dingbat hex":`42`,"Unicode dec":`127960`,"Unicode hex":`1F3D8`},{"Typeface name":`Webdings`,"Dingbat dec":`67`,"Dingbat hex":`43`,"Unicode dec":`127961`,"Unicode hex":`1F3D9`},{"Typeface name":`Webdings`,"Dingbat dec":`68`,"Dingbat hex":`44`,"Unicode dec":`127962`,"Unicode hex":`1F3DA`},{"Typeface name":`Webdings`,"Dingbat dec":`69`,"Dingbat hex":`45`,"Unicode dec":`127964`,"Unicode hex":`1F3DC`},{"Typeface name":`Webdings`,"Dingbat dec":`70`,"Dingbat hex":`46`,"Unicode dec":`127981`,"Unicode hex":`1F3ED`},{"Typeface name":`Webdings`,"Dingbat dec":`71`,"Dingbat hex":`47`,"Unicode dec":`127963`,"Unicode hex":`1F3DB`},{"Typeface name":`Webdings`,"Dingbat dec":`72`,"Dingbat hex":`48`,"Unicode dec":`127968`,"Unicode hex":`1F3E0`},{"Typeface name":`Webdings`,"Dingbat dec":`73`,"Dingbat hex":`49`,"Unicode dec":`127958`,"Unicode hex":`1F3D6`},{"Typeface name":`Webdings`,"Dingbat dec":`74`,"Dingbat hex":`4A`,"Unicode dec":`127965`,"Unicode hex":`1F3DD`},{"Typeface name":`Webdings`,"Dingbat dec":`75`,"Dingbat hex":`4B`,"Unicode dec":`128739`,"Unicode hex":`1F6E3`},{"Typeface name":`Webdings`,"Dingbat dec":`76`,"Dingbat hex":`4C`,"Unicode dec":`128269`,"Unicode hex":`1F50D`},{"Typeface name":`Webdings`,"Dingbat dec":`77`,"Dingbat hex":`4D`,"Unicode dec":`127956`,"Unicode hex":`1F3D4`},{"Typeface name":`Webdings`,"Dingbat dec":`78`,"Dingbat hex":`4E`,"Unicode dec":`128065`,"Unicode hex":`1F441`},{"Typeface name":`Webdings`,"Dingbat dec":`79`,"Dingbat hex":`4F`,"Unicode dec":`128066`,"Unicode hex":`1F442`},{"Typeface name":`Webdings`,"Dingbat dec":`80`,"Dingbat hex":`50`,"Unicode dec":`127966`,"Unicode hex":`1F3DE`},{"Typeface name":`Webdings`,"Dingbat dec":`81`,"Dingbat hex":`51`,"Unicode dec":`127957`,"Unicode hex":`1F3D5`},{"Typeface name":`Webdings`,"Dingbat dec":`82`,"Dingbat hex":`52`,"Unicode dec":`128740`,"Unicode hex":`1F6E4`},{"Typeface name":`Webdings`,"Dingbat dec":`83`,"Dingbat hex":`53`,"Unicode dec":`127967`,"Unicode hex":`1F3DF`},{"Typeface name":`Webdings`,"Dingbat dec":`84`,"Dingbat hex":`54`,"Unicode dec":`128755`,"Unicode hex":`1F6F3`},{"Typeface name":`Webdings`,"Dingbat dec":`85`,"Dingbat hex":`55`,"Unicode dec":`128364`,"Unicode hex":`1F56C`},{"Typeface name":`Webdings`,"Dingbat dec":`86`,"Dingbat hex":`56`,"Unicode dec":`128363`,"Unicode hex":`1F56B`},{"Typeface name":`Webdings`,"Dingbat dec":`87`,"Dingbat hex":`57`,"Unicode dec":`128360`,"Unicode hex":`1F568`},{"Typeface name":`Webdings`,"Dingbat dec":`88`,"Dingbat hex":`58`,"Unicode dec":`128264`,"Unicode hex":`1F508`},{"Typeface name":`Webdings`,"Dingbat dec":`89`,"Dingbat hex":`59`,"Unicode dec":`127892`,"Unicode hex":`1F394`},{"Typeface name":`Webdings`,"Dingbat dec":`90`,"Dingbat hex":`5A`,"Unicode dec":`127893`,"Unicode hex":`1F395`},{"Typeface name":`Webdings`,"Dingbat dec":`91`,"Dingbat hex":`5B`,"Unicode dec":`128492`,"Unicode hex":`1F5EC`},{"Typeface name":`Webdings`,"Dingbat dec":`92`,"Dingbat hex":`5C`,"Unicode dec":`128637`,"Unicode hex":`1F67D`},{"Typeface name":`Webdings`,"Dingbat dec":`93`,"Dingbat hex":`5D`,"Unicode dec":`128493`,"Unicode hex":`1F5ED`},{"Typeface name":`Webdings`,"Dingbat dec":`94`,"Dingbat hex":`5E`,"Unicode dec":`128490`,"Unicode hex":`1F5EA`},{"Typeface name":`Webdings`,"Dingbat dec":`95`,"Dingbat hex":`5F`,"Unicode dec":`128491`,"Unicode hex":`1F5EB`},{"Typeface name":`Webdings`,"Dingbat dec":`96`,"Dingbat hex":`60`,"Unicode dec":`11156`,"Unicode hex":`2B94`},{"Typeface name":`Webdings`,"Dingbat dec":`97`,"Dingbat hex":`61`,"Unicode dec":`10004`,"Unicode hex":`2714`},{"Typeface name":`Webdings`,"Dingbat dec":`98`,"Dingbat hex":`62`,"Unicode dec":`128690`,"Unicode hex":`1F6B2`},{"Typeface name":`Webdings`,"Dingbat dec":`99`,"Dingbat hex":`63`,"Unicode dec":`11036`,"Unicode hex":`2B1C`},{"Typeface name":`Webdings`,"Dingbat dec":`100`,"Dingbat hex":`64`,"Unicode dec":`128737`,"Unicode hex":`1F6E1`},{"Typeface name":`Webdings`,"Dingbat dec":`101`,"Dingbat hex":`65`,"Unicode dec":`128230`,"Unicode hex":`1F4E6`},{"Typeface name":`Webdings`,"Dingbat dec":`102`,"Dingbat hex":`66`,"Unicode dec":`128753`,"Unicode hex":`1F6F1`},{"Typeface name":`Webdings`,"Dingbat dec":`103`,"Dingbat hex":`67`,"Unicode dec":`11035`,"Unicode hex":`2B1B`},{"Typeface name":`Webdings`,"Dingbat dec":`104`,"Dingbat hex":`68`,"Unicode dec":`128657`,"Unicode hex":`1F691`},{"Typeface name":`Webdings`,"Dingbat dec":`105`,"Dingbat hex":`69`,"Unicode dec":`128712`,"Unicode hex":`1F6C8`},{"Typeface name":`Webdings`,"Dingbat dec":`106`,"Dingbat hex":`6A`,"Unicode dec":`128745`,"Unicode hex":`1F6E9`},{"Typeface name":`Webdings`,"Dingbat dec":`107`,"Dingbat hex":`6B`,"Unicode dec":`128752`,"Unicode hex":`1F6F0`},{"Typeface name":`Webdings`,"Dingbat dec":`108`,"Dingbat hex":`6C`,"Unicode dec":`128968`,"Unicode hex":`1F7C8`},{"Typeface name":`Webdings`,"Dingbat dec":`109`,"Dingbat hex":`6D`,"Unicode dec":`128372`,"Unicode hex":`1F574`},{"Typeface name":`Webdings`,"Dingbat dec":`110`,"Dingbat hex":`6E`,"Unicode dec":`11044`,"Unicode hex":`2B24`},{"Typeface name":`Webdings`,"Dingbat dec":`111`,"Dingbat hex":`6F`,"Unicode dec":`128741`,"Unicode hex":`1F6E5`},{"Typeface name":`Webdings`,"Dingbat dec":`112`,"Dingbat hex":`70`,"Unicode dec":`128660`,"Unicode hex":`1F694`},{"Typeface name":`Webdings`,"Dingbat dec":`113`,"Dingbat hex":`71`,"Unicode dec":`128472`,"Unicode hex":`1F5D8`},{"Typeface name":`Webdings`,"Dingbat dec":`114`,"Dingbat hex":`72`,"Unicode dec":`128473`,"Unicode hex":`1F5D9`},{"Typeface name":`Webdings`,"Dingbat dec":`115`,"Dingbat hex":`73`,"Unicode dec":`10067`,"Unicode hex":`2753`},{"Typeface name":`Webdings`,"Dingbat dec":`116`,"Dingbat hex":`74`,"Unicode dec":`128754`,"Unicode hex":`1F6F2`},{"Typeface name":`Webdings`,"Dingbat dec":`117`,"Dingbat hex":`75`,"Unicode dec":`128647`,"Unicode hex":`1F687`},{"Typeface name":`Webdings`,"Dingbat dec":`118`,"Dingbat hex":`76`,"Unicode dec":`128653`,"Unicode hex":`1F68D`},{"Typeface name":`Webdings`,"Dingbat dec":`119`,"Dingbat hex":`77`,"Unicode dec":`9971`,"Unicode hex":`26F3`},{"Typeface name":`Webdings`,"Dingbat dec":`120`,"Dingbat hex":`78`,"Unicode dec":`10680`,"Unicode hex":`29B8`},{"Typeface name":`Webdings`,"Dingbat dec":`121`,"Dingbat hex":`79`,"Unicode dec":`8854`,"Unicode hex":`2296`},{"Typeface name":`Webdings`,"Dingbat dec":`122`,"Dingbat hex":`7A`,"Unicode dec":`128685`,"Unicode hex":`1F6AD`},{"Typeface name":`Webdings`,"Dingbat dec":`123`,"Dingbat hex":`7B`,"Unicode dec":`128494`,"Unicode hex":`1F5EE`},{"Typeface name":`Webdings`,"Dingbat dec":`124`,"Dingbat hex":`7C`,"Unicode dec":`9168`,"Unicode hex":`23D0`},{"Typeface name":`Webdings`,"Dingbat dec":`125`,"Dingbat hex":`7D`,"Unicode dec":`128495`,"Unicode hex":`1F5EF`},{"Typeface name":`Webdings`,"Dingbat dec":`126`,"Dingbat hex":`7E`,"Unicode dec":`128498`,"Unicode hex":`1F5F2`},{"Typeface name":`Webdings`,"Dingbat dec":`128`,"Dingbat hex":`80`,"Unicode dec":`128697`,"Unicode hex":`1F6B9`},{"Typeface name":`Webdings`,"Dingbat dec":`129`,"Dingbat hex":`81`,"Unicode dec":`128698`,"Unicode hex":`1F6BA`},{"Typeface name":`Webdings`,"Dingbat dec":`130`,"Dingbat hex":`82`,"Unicode dec":`128713`,"Unicode hex":`1F6C9`},{"Typeface name":`Webdings`,"Dingbat dec":`131`,"Dingbat hex":`83`,"Unicode dec":`128714`,"Unicode hex":`1F6CA`},{"Typeface name":`Webdings`,"Dingbat dec":`132`,"Dingbat hex":`84`,"Unicode dec":`128700`,"Unicode hex":`1F6BC`},{"Typeface name":`Webdings`,"Dingbat dec":`133`,"Dingbat hex":`85`,"Unicode dec":`128125`,"Unicode hex":`1F47D`},{"Typeface name":`Webdings`,"Dingbat dec":`134`,"Dingbat hex":`86`,"Unicode dec":`127947`,"Unicode hex":`1F3CB`},{"Typeface name":`Webdings`,"Dingbat dec":`135`,"Dingbat hex":`87`,"Unicode dec":`9975`,"Unicode hex":`26F7`},{"Typeface name":`Webdings`,"Dingbat dec":`136`,"Dingbat hex":`88`,"Unicode dec":`127938`,"Unicode hex":`1F3C2`},{"Typeface name":`Webdings`,"Dingbat dec":`137`,"Dingbat hex":`89`,"Unicode dec":`127948`,"Unicode hex":`1F3CC`},{"Typeface name":`Webdings`,"Dingbat dec":`138`,"Dingbat hex":`8A`,"Unicode dec":`127946`,"Unicode hex":`1F3CA`},{"Typeface name":`Webdings`,"Dingbat dec":`139`,"Dingbat hex":`8B`,"Unicode dec":`127940`,"Unicode hex":`1F3C4`},{"Typeface name":`Webdings`,"Dingbat dec":`140`,"Dingbat hex":`8C`,"Unicode dec":`127949`,"Unicode hex":`1F3CD`},{"Typeface name":`Webdings`,"Dingbat dec":`141`,"Dingbat hex":`8D`,"Unicode dec":`127950`,"Unicode hex":`1F3CE`},{"Typeface name":`Webdings`,"Dingbat dec":`142`,"Dingbat hex":`8E`,"Unicode dec":`128664`,"Unicode hex":`1F698`},{"Typeface name":`Webdings`,"Dingbat dec":`143`,"Dingbat hex":`8F`,"Unicode dec":`128480`,"Unicode hex":`1F5E0`},{"Typeface name":`Webdings`,"Dingbat dec":`144`,"Dingbat hex":`90`,"Unicode dec":`128738`,"Unicode hex":`1F6E2`},{"Typeface name":`Webdings`,"Dingbat dec":`145`,"Dingbat hex":`91`,"Unicode dec":`128176`,"Unicode hex":`1F4B0`},{"Typeface name":`Webdings`,"Dingbat dec":`146`,"Dingbat hex":`92`,"Unicode dec":`127991`,"Unicode hex":`1F3F7`},{"Typeface name":`Webdings`,"Dingbat dec":`147`,"Dingbat hex":`93`,"Unicode dec":`128179`,"Unicode hex":`1F4B3`},{"Typeface name":`Webdings`,"Dingbat dec":`148`,"Dingbat hex":`94`,"Unicode dec":`128106`,"Unicode hex":`1F46A`},{"Typeface name":`Webdings`,"Dingbat dec":`149`,"Dingbat hex":`95`,"Unicode dec":`128481`,"Unicode hex":`1F5E1`},{"Typeface name":`Webdings`,"Dingbat dec":`150`,"Dingbat hex":`96`,"Unicode dec":`128482`,"Unicode hex":`1F5E2`},{"Typeface name":`Webdings`,"Dingbat dec":`151`,"Dingbat hex":`97`,"Unicode dec":`128483`,"Unicode hex":`1F5E3`},{"Typeface name":`Webdings`,"Dingbat dec":`152`,"Dingbat hex":`98`,"Unicode dec":`10031`,"Unicode hex":`272F`},{"Typeface name":`Webdings`,"Dingbat dec":`153`,"Dingbat hex":`99`,"Unicode dec":`128388`,"Unicode hex":`1F584`},{"Typeface name":`Webdings`,"Dingbat dec":`154`,"Dingbat hex":`9A`,"Unicode dec":`128389`,"Unicode hex":`1F585`},{"Typeface name":`Webdings`,"Dingbat dec":`155`,"Dingbat hex":`9B`,"Unicode dec":`128387`,"Unicode hex":`1F583`},{"Typeface name":`Webdings`,"Dingbat dec":`156`,"Dingbat hex":`9C`,"Unicode dec":`128390`,"Unicode hex":`1F586`},{"Typeface name":`Webdings`,"Dingbat dec":`157`,"Dingbat hex":`9D`,"Unicode dec":`128441`,"Unicode hex":`1F5B9`},{"Typeface name":`Webdings`,"Dingbat dec":`158`,"Dingbat hex":`9E`,"Unicode dec":`128442`,"Unicode hex":`1F5BA`},{"Typeface name":`Webdings`,"Dingbat dec":`159`,"Dingbat hex":`9F`,"Unicode dec":`128443`,"Unicode hex":`1F5BB`},{"Typeface name":`Webdings`,"Dingbat dec":`160`,"Dingbat hex":`A0`,"Unicode dec":`128373`,"Unicode hex":`1F575`},{"Typeface name":`Webdings`,"Dingbat dec":`161`,"Dingbat hex":`A1`,"Unicode dec":`128368`,"Unicode hex":`1F570`},{"Typeface name":`Webdings`,"Dingbat dec":`162`,"Dingbat hex":`A2`,"Unicode dec":`128445`,"Unicode hex":`1F5BD`},{"Typeface name":`Webdings`,"Dingbat dec":`163`,"Dingbat hex":`A3`,"Unicode dec":`128446`,"Unicode hex":`1F5BE`},{"Typeface name":`Webdings`,"Dingbat dec":`164`,"Dingbat hex":`A4`,"Unicode dec":`128203`,"Unicode hex":`1F4CB`},{"Typeface name":`Webdings`,"Dingbat dec":`165`,"Dingbat hex":`A5`,"Unicode dec":`128466`,"Unicode hex":`1F5D2`},{"Typeface name":`Webdings`,"Dingbat dec":`166`,"Dingbat hex":`A6`,"Unicode dec":`128467`,"Unicode hex":`1F5D3`},{"Typeface name":`Webdings`,"Dingbat dec":`167`,"Dingbat hex":`A7`,"Unicode dec":`128366`,"Unicode hex":`1F56E`},{"Typeface name":`Webdings`,"Dingbat dec":`168`,"Dingbat hex":`A8`,"Unicode dec":`128218`,"Unicode hex":`1F4DA`},{"Typeface name":`Webdings`,"Dingbat dec":`169`,"Dingbat hex":`A9`,"Unicode dec":`128478`,"Unicode hex":`1F5DE`},{"Typeface name":`Webdings`,"Dingbat dec":`170`,"Dingbat hex":`AA`,"Unicode dec":`128479`,"Unicode hex":`1F5DF`},{"Typeface name":`Webdings`,"Dingbat dec":`171`,"Dingbat hex":`AB`,"Unicode dec":`128451`,"Unicode hex":`1F5C3`},{"Typeface name":`Webdings`,"Dingbat dec":`172`,"Dingbat hex":`AC`,"Unicode dec":`128450`,"Unicode hex":`1F5C2`},{"Typeface name":`Webdings`,"Dingbat dec":`173`,"Dingbat hex":`AD`,"Unicode dec":`128444`,"Unicode hex":`1F5BC`},{"Typeface name":`Webdings`,"Dingbat dec":`174`,"Dingbat hex":`AE`,"Unicode dec":`127917`,"Unicode hex":`1F3AD`},{"Typeface name":`Webdings`,"Dingbat dec":`175`,"Dingbat hex":`AF`,"Unicode dec":`127900`,"Unicode hex":`1F39C`},{"Typeface name":`Webdings`,"Dingbat dec":`176`,"Dingbat hex":`B0`,"Unicode dec":`127896`,"Unicode hex":`1F398`},{"Typeface name":`Webdings`,"Dingbat dec":`177`,"Dingbat hex":`B1`,"Unicode dec":`127897`,"Unicode hex":`1F399`},{"Typeface name":`Webdings`,"Dingbat dec":`178`,"Dingbat hex":`B2`,"Unicode dec":`127911`,"Unicode hex":`1F3A7`},{"Typeface name":`Webdings`,"Dingbat dec":`179`,"Dingbat hex":`B3`,"Unicode dec":`128191`,"Unicode hex":`1F4BF`},{"Typeface name":`Webdings`,"Dingbat dec":`180`,"Dingbat hex":`B4`,"Unicode dec":`127902`,"Unicode hex":`1F39E`},{"Typeface name":`Webdings`,"Dingbat dec":`181`,"Dingbat hex":`B5`,"Unicode dec":`128247`,"Unicode hex":`1F4F7`},{"Typeface name":`Webdings`,"Dingbat dec":`182`,"Dingbat hex":`B6`,"Unicode dec":`127903`,"Unicode hex":`1F39F`},{"Typeface name":`Webdings`,"Dingbat dec":`183`,"Dingbat hex":`B7`,"Unicode dec":`127916`,"Unicode hex":`1F3AC`},{"Typeface name":`Webdings`,"Dingbat dec":`184`,"Dingbat hex":`B8`,"Unicode dec":`128253`,"Unicode hex":`1F4FD`},{"Typeface name":`Webdings`,"Dingbat dec":`185`,"Dingbat hex":`B9`,"Unicode dec":`128249`,"Unicode hex":`1F4F9`},{"Typeface name":`Webdings`,"Dingbat dec":`186`,"Dingbat hex":`BA`,"Unicode dec":`128254`,"Unicode hex":`1F4FE`},{"Typeface name":`Webdings`,"Dingbat dec":`187`,"Dingbat hex":`BB`,"Unicode dec":`128251`,"Unicode hex":`1F4FB`},{"Typeface name":`Webdings`,"Dingbat dec":`188`,"Dingbat hex":`BC`,"Unicode dec":`127898`,"Unicode hex":`1F39A`},{"Typeface name":`Webdings`,"Dingbat dec":`189`,"Dingbat hex":`BD`,"Unicode dec":`127899`,"Unicode hex":`1F39B`},{"Typeface name":`Webdings`,"Dingbat dec":`190`,"Dingbat hex":`BE`,"Unicode dec":`128250`,"Unicode hex":`1F4FA`},{"Typeface name":`Webdings`,"Dingbat dec":`191`,"Dingbat hex":`BF`,"Unicode dec":`128187`,"Unicode hex":`1F4BB`},{"Typeface name":`Webdings`,"Dingbat dec":`192`,"Dingbat hex":`C0`,"Unicode dec":`128421`,"Unicode hex":`1F5A5`},{"Typeface name":`Webdings`,"Dingbat dec":`193`,"Dingbat hex":`C1`,"Unicode dec":`128422`,"Unicode hex":`1F5A6`},{"Typeface name":`Webdings`,"Dingbat dec":`194`,"Dingbat hex":`C2`,"Unicode dec":`128423`,"Unicode hex":`1F5A7`},{"Typeface name":`Webdings`,"Dingbat dec":`195`,"Dingbat hex":`C3`,"Unicode dec":`128377`,"Unicode hex":`1F579`},{"Typeface name":`Webdings`,"Dingbat dec":`196`,"Dingbat hex":`C4`,"Unicode dec":`127918`,"Unicode hex":`1F3AE`},{"Typeface name":`Webdings`,"Dingbat dec":`197`,"Dingbat hex":`C5`,"Unicode dec":`128379`,"Unicode hex":`1F57B`},{"Typeface name":`Webdings`,"Dingbat dec":`198`,"Dingbat hex":`C6`,"Unicode dec":`128380`,"Unicode hex":`1F57C`},{"Typeface name":`Webdings`,"Dingbat dec":`199`,"Dingbat hex":`C7`,"Unicode dec":`128223`,"Unicode hex":`1F4DF`},{"Typeface name":`Webdings`,"Dingbat dec":`200`,"Dingbat hex":`C8`,"Unicode dec":`128385`,"Unicode hex":`1F581`},{"Typeface name":`Webdings`,"Dingbat dec":`201`,"Dingbat hex":`C9`,"Unicode dec":`128384`,"Unicode hex":`1F580`},{"Typeface name":`Webdings`,"Dingbat dec":`202`,"Dingbat hex":`CA`,"Unicode dec":`128424`,"Unicode hex":`1F5A8`},{"Typeface name":`Webdings`,"Dingbat dec":`203`,"Dingbat hex":`CB`,"Unicode dec":`128425`,"Unicode hex":`1F5A9`},{"Typeface name":`Webdings`,"Dingbat dec":`204`,"Dingbat hex":`CC`,"Unicode dec":`128447`,"Unicode hex":`1F5BF`},{"Typeface name":`Webdings`,"Dingbat dec":`205`,"Dingbat hex":`CD`,"Unicode dec":`128426`,"Unicode hex":`1F5AA`},{"Typeface name":`Webdings`,"Dingbat dec":`206`,"Dingbat hex":`CE`,"Unicode dec":`128476`,"Unicode hex":`1F5DC`},{"Typeface name":`Webdings`,"Dingbat dec":`207`,"Dingbat hex":`CF`,"Unicode dec":`128274`,"Unicode hex":`1F512`},{"Typeface name":`Webdings`,"Dingbat dec":`208`,"Dingbat hex":`D0`,"Unicode dec":`128275`,"Unicode hex":`1F513`},{"Typeface name":`Webdings`,"Dingbat dec":`209`,"Dingbat hex":`D1`,"Unicode dec":`128477`,"Unicode hex":`1F5DD`},{"Typeface name":`Webdings`,"Dingbat dec":`210`,"Dingbat hex":`D2`,"Unicode dec":`128229`,"Unicode hex":`1F4E5`},{"Typeface name":`Webdings`,"Dingbat dec":`211`,"Dingbat hex":`D3`,"Unicode dec":`128228`,"Unicode hex":`1F4E4`},{"Typeface name":`Webdings`,"Dingbat dec":`212`,"Dingbat hex":`D4`,"Unicode dec":`128371`,"Unicode hex":`1F573`},{"Typeface name":`Webdings`,"Dingbat dec":`213`,"Dingbat hex":`D5`,"Unicode dec":`127779`,"Unicode hex":`1F323`},{"Typeface name":`Webdings`,"Dingbat dec":`214`,"Dingbat hex":`D6`,"Unicode dec":`127780`,"Unicode hex":`1F324`},{"Typeface name":`Webdings`,"Dingbat dec":`215`,"Dingbat hex":`D7`,"Unicode dec":`127781`,"Unicode hex":`1F325`},{"Typeface name":`Webdings`,"Dingbat dec":`216`,"Dingbat hex":`D8`,"Unicode dec":`127782`,"Unicode hex":`1F326`},{"Typeface name":`Webdings`,"Dingbat dec":`217`,"Dingbat hex":`D9`,"Unicode dec":`9729`,"Unicode hex":`2601`},{"Typeface name":`Webdings`,"Dingbat dec":`218`,"Dingbat hex":`DA`,"Unicode dec":`127784`,"Unicode hex":`1F328`},{"Typeface name":`Webdings`,"Dingbat dec":`219`,"Dingbat hex":`DB`,"Unicode dec":`127783`,"Unicode hex":`1F327`},{"Typeface name":`Webdings`,"Dingbat dec":`220`,"Dingbat hex":`DC`,"Unicode dec":`127785`,"Unicode hex":`1F329`},{"Typeface name":`Webdings`,"Dingbat dec":`221`,"Dingbat hex":`DD`,"Unicode dec":`127786`,"Unicode hex":`1F32A`},{"Typeface name":`Webdings`,"Dingbat dec":`222`,"Dingbat hex":`DE`,"Unicode dec":`127788`,"Unicode hex":`1F32C`},{"Typeface name":`Webdings`,"Dingbat dec":`223`,"Dingbat hex":`DF`,"Unicode dec":`127787`,"Unicode hex":`1F32B`},{"Typeface name":`Webdings`,"Dingbat dec":`224`,"Dingbat hex":`E0`,"Unicode dec":`127772`,"Unicode hex":`1F31C`},{"Typeface name":`Webdings`,"Dingbat dec":`225`,"Dingbat hex":`E1`,"Unicode dec":`127777`,"Unicode hex":`1F321`},{"Typeface name":`Webdings`,"Dingbat dec":`226`,"Dingbat hex":`E2`,"Unicode dec":`128715`,"Unicode hex":`1F6CB`},{"Typeface name":`Webdings`,"Dingbat dec":`227`,"Dingbat hex":`E3`,"Unicode dec":`128719`,"Unicode hex":`1F6CF`},{"Typeface name":`Webdings`,"Dingbat dec":`228`,"Dingbat hex":`E4`,"Unicode dec":`127869`,"Unicode hex":`1F37D`},{"Typeface name":`Webdings`,"Dingbat dec":`229`,"Dingbat hex":`E5`,"Unicode dec":`127864`,"Unicode hex":`1F378`},{"Typeface name":`Webdings`,"Dingbat dec":`230`,"Dingbat hex":`E6`,"Unicode dec":`128718`,"Unicode hex":`1F6CE`},{"Typeface name":`Webdings`,"Dingbat dec":`231`,"Dingbat hex":`E7`,"Unicode dec":`128717`,"Unicode hex":`1F6CD`},{"Typeface name":`Webdings`,"Dingbat dec":`232`,"Dingbat hex":`E8`,"Unicode dec":`9413`,"Unicode hex":`24C5`},{"Typeface name":`Webdings`,"Dingbat dec":`233`,"Dingbat hex":`E9`,"Unicode dec":`9855`,"Unicode hex":`267F`},{"Typeface name":`Webdings`,"Dingbat dec":`234`,"Dingbat hex":`EA`,"Unicode dec":`128710`,"Unicode hex":`1F6C6`},{"Typeface name":`Webdings`,"Dingbat dec":`235`,"Dingbat hex":`EB`,"Unicode dec":`128392`,"Unicode hex":`1F588`},{"Typeface name":`Webdings`,"Dingbat dec":`236`,"Dingbat hex":`EC`,"Unicode dec":`127891`,"Unicode hex":`1F393`},{"Typeface name":`Webdings`,"Dingbat dec":`237`,"Dingbat hex":`ED`,"Unicode dec":`128484`,"Unicode hex":`1F5E4`},{"Typeface name":`Webdings`,"Dingbat dec":`238`,"Dingbat hex":`EE`,"Unicode dec":`128485`,"Unicode hex":`1F5E5`},{"Typeface name":`Webdings`,"Dingbat dec":`239`,"Dingbat hex":`EF`,"Unicode dec":`128486`,"Unicode hex":`1F5E6`},{"Typeface name":`Webdings`,"Dingbat dec":`240`,"Dingbat hex":`F0`,"Unicode dec":`128487`,"Unicode hex":`1F5E7`},{"Typeface name":`Webdings`,"Dingbat dec":`241`,"Dingbat hex":`F1`,"Unicode dec":`128746`,"Unicode hex":`1F6EA`},{"Typeface name":`Webdings`,"Dingbat dec":`242`,"Dingbat hex":`F2`,"Unicode dec":`128063`,"Unicode hex":`1F43F`},{"Typeface name":`Webdings`,"Dingbat dec":`243`,"Dingbat hex":`F3`,"Unicode dec":`128038`,"Unicode hex":`1F426`},{"Typeface name":`Webdings`,"Dingbat dec":`244`,"Dingbat hex":`F4`,"Unicode dec":`128031`,"Unicode hex":`1F41F`},{"Typeface name":`Webdings`,"Dingbat dec":`245`,"Dingbat hex":`F5`,"Unicode dec":`128021`,"Unicode hex":`1F415`},{"Typeface name":`Webdings`,"Dingbat dec":`246`,"Dingbat hex":`F6`,"Unicode dec":`128008`,"Unicode hex":`1F408`},{"Typeface name":`Webdings`,"Dingbat dec":`247`,"Dingbat hex":`F7`,"Unicode dec":`128620`,"Unicode hex":`1F66C`},{"Typeface name":`Webdings`,"Dingbat dec":`248`,"Dingbat hex":`F8`,"Unicode dec":`128622`,"Unicode hex":`1F66E`},{"Typeface name":`Webdings`,"Dingbat dec":`249`,"Dingbat hex":`F9`,"Unicode dec":`128621`,"Unicode hex":`1F66D`},{"Typeface name":`Webdings`,"Dingbat dec":`250`,"Dingbat hex":`FA`,"Unicode dec":`128623`,"Unicode hex":`1F66F`},{"Typeface name":`Webdings`,"Dingbat dec":`251`,"Dingbat hex":`FB`,"Unicode dec":`128506`,"Unicode hex":`1F5FA`},{"Typeface name":`Webdings`,"Dingbat dec":`252`,"Dingbat hex":`FC`,"Unicode dec":`127757`,"Unicode hex":`1F30D`},{"Typeface name":`Webdings`,"Dingbat dec":`253`,"Dingbat hex":`FD`,"Unicode dec":`127759`,"Unicode hex":`1F30F`},{"Typeface name":`Webdings`,"Dingbat dec":`254`,"Dingbat hex":`FE`,"Unicode dec":`127758`,"Unicode hex":`1F30E`},{"Typeface name":`Webdings`,"Dingbat dec":`255`,"Dingbat hex":`FF`,"Unicode dec":`128330`,"Unicode hex":`1F54A`},{"Typeface name":`Wingdings`,"Dingbat dec":`32`,"Dingbat hex":`20`,"Unicode dec":`32`,"Unicode hex":`20`},{"Typeface name":`Wingdings`,"Dingbat dec":`33`,"Dingbat hex":`21`,"Unicode dec":`128393`,"Unicode hex":`1F589`},{"Typeface name":`Wingdings`,"Dingbat dec":`34`,"Dingbat hex":`22`,"Unicode dec":`9986`,"Unicode hex":`2702`},{"Typeface name":`Wingdings`,"Dingbat dec":`35`,"Dingbat hex":`23`,"Unicode dec":`9985`,"Unicode hex":`2701`},{"Typeface name":`Wingdings`,"Dingbat dec":`36`,"Dingbat hex":`24`,"Unicode dec":`128083`,"Unicode hex":`1F453`},{"Typeface name":`Wingdings`,"Dingbat dec":`37`,"Dingbat hex":`25`,"Unicode dec":`128365`,"Unicode hex":`1F56D`},{"Typeface name":`Wingdings`,"Dingbat dec":`38`,"Dingbat hex":`26`,"Unicode dec":`128366`,"Unicode hex":`1F56E`},{"Typeface name":`Wingdings`,"Dingbat dec":`39`,"Dingbat hex":`27`,"Unicode dec":`128367`,"Unicode hex":`1F56F`},{"Typeface name":`Wingdings`,"Dingbat dec":`40`,"Dingbat hex":`28`,"Unicode dec":`128383`,"Unicode hex":`1F57F`},{"Typeface name":`Wingdings`,"Dingbat dec":`41`,"Dingbat hex":`29`,"Unicode dec":`9990`,"Unicode hex":`2706`},{"Typeface name":`Wingdings`,"Dingbat dec":`42`,"Dingbat hex":`2A`,"Unicode dec":`128386`,"Unicode hex":`1F582`},{"Typeface name":`Wingdings`,"Dingbat dec":`43`,"Dingbat hex":`2B`,"Unicode dec":`128387`,"Unicode hex":`1F583`},{"Typeface name":`Wingdings`,"Dingbat dec":`44`,"Dingbat hex":`2C`,"Unicode dec":`128234`,"Unicode hex":`1F4EA`},{"Typeface name":`Wingdings`,"Dingbat dec":`45`,"Dingbat hex":`2D`,"Unicode dec":`128235`,"Unicode hex":`1F4EB`},{"Typeface name":`Wingdings`,"Dingbat dec":`46`,"Dingbat hex":`2E`,"Unicode dec":`128236`,"Unicode hex":`1F4EC`},{"Typeface name":`Wingdings`,"Dingbat dec":`47`,"Dingbat hex":`2F`,"Unicode dec":`128237`,"Unicode hex":`1F4ED`},{"Typeface name":`Wingdings`,"Dingbat dec":`48`,"Dingbat hex":`30`,"Unicode dec":`128448`,"Unicode hex":`1F5C0`},{"Typeface name":`Wingdings`,"Dingbat dec":`49`,"Dingbat hex":`31`,"Unicode dec":`128449`,"Unicode hex":`1F5C1`},{"Typeface name":`Wingdings`,"Dingbat dec":`50`,"Dingbat hex":`32`,"Unicode dec":`128462`,"Unicode hex":`1F5CE`},{"Typeface name":`Wingdings`,"Dingbat dec":`51`,"Dingbat hex":`33`,"Unicode dec":`128463`,"Unicode hex":`1F5CF`},{"Typeface name":`Wingdings`,"Dingbat dec":`52`,"Dingbat hex":`34`,"Unicode dec":`128464`,"Unicode hex":`1F5D0`},{"Typeface name":`Wingdings`,"Dingbat dec":`53`,"Dingbat hex":`35`,"Unicode dec":`128452`,"Unicode hex":`1F5C4`},{"Typeface name":`Wingdings`,"Dingbat dec":`54`,"Dingbat hex":`36`,"Unicode dec":`8987`,"Unicode hex":`231B`},{"Typeface name":`Wingdings`,"Dingbat dec":`55`,"Dingbat hex":`37`,"Unicode dec":`128430`,"Unicode hex":`1F5AE`},{"Typeface name":`Wingdings`,"Dingbat dec":`56`,"Dingbat hex":`38`,"Unicode dec":`128432`,"Unicode hex":`1F5B0`},{"Typeface name":`Wingdings`,"Dingbat dec":`57`,"Dingbat hex":`39`,"Unicode dec":`128434`,"Unicode hex":`1F5B2`},{"Typeface name":`Wingdings`,"Dingbat dec":`58`,"Dingbat hex":`3A`,"Unicode dec":`128435`,"Unicode hex":`1F5B3`},{"Typeface name":`Wingdings`,"Dingbat dec":`59`,"Dingbat hex":`3B`,"Unicode dec":`128436`,"Unicode hex":`1F5B4`},{"Typeface name":`Wingdings`,"Dingbat dec":`60`,"Dingbat hex":`3C`,"Unicode dec":`128427`,"Unicode hex":`1F5AB`},{"Typeface name":`Wingdings`,"Dingbat dec":`61`,"Dingbat hex":`3D`,"Unicode dec":`128428`,"Unicode hex":`1F5AC`},{"Typeface name":`Wingdings`,"Dingbat dec":`62`,"Dingbat hex":`3E`,"Unicode dec":`9991`,"Unicode hex":`2707`},{"Typeface name":`Wingdings`,"Dingbat dec":`63`,"Dingbat hex":`3F`,"Unicode dec":`9997`,"Unicode hex":`270D`},{"Typeface name":`Wingdings`,"Dingbat dec":`64`,"Dingbat hex":`40`,"Unicode dec":`128398`,"Unicode hex":`1F58E`},{"Typeface name":`Wingdings`,"Dingbat dec":`65`,"Dingbat hex":`41`,"Unicode dec":`9996`,"Unicode hex":`270C`},{"Typeface name":`Wingdings`,"Dingbat dec":`66`,"Dingbat hex":`42`,"Unicode dec":`128399`,"Unicode hex":`1F58F`},{"Typeface name":`Wingdings`,"Dingbat dec":`67`,"Dingbat hex":`43`,"Unicode dec":`128077`,"Unicode hex":`1F44D`},{"Typeface name":`Wingdings`,"Dingbat dec":`68`,"Dingbat hex":`44`,"Unicode dec":`128078`,"Unicode hex":`1F44E`},{"Typeface name":`Wingdings`,"Dingbat dec":`69`,"Dingbat hex":`45`,"Unicode dec":`9756`,"Unicode hex":`261C`},{"Typeface name":`Wingdings`,"Dingbat dec":`70`,"Dingbat hex":`46`,"Unicode dec":`9758`,"Unicode hex":`261E`},{"Typeface name":`Wingdings`,"Dingbat dec":`71`,"Dingbat hex":`47`,"Unicode dec":`9757`,"Unicode hex":`261D`},{"Typeface name":`Wingdings`,"Dingbat dec":`72`,"Dingbat hex":`48`,"Unicode dec":`9759`,"Unicode hex":`261F`},{"Typeface name":`Wingdings`,"Dingbat dec":`73`,"Dingbat hex":`49`,"Unicode dec":`128400`,"Unicode hex":`1F590`},{"Typeface name":`Wingdings`,"Dingbat dec":`74`,"Dingbat hex":`4A`,"Unicode dec":`9786`,"Unicode hex":`263A`},{"Typeface name":`Wingdings`,"Dingbat dec":`75`,"Dingbat hex":`4B`,"Unicode dec":`128528`,"Unicode hex":`1F610`},{"Typeface name":`Wingdings`,"Dingbat dec":`76`,"Dingbat hex":`4C`,"Unicode dec":`9785`,"Unicode hex":`2639`},{"Typeface name":`Wingdings`,"Dingbat dec":`77`,"Dingbat hex":`4D`,"Unicode dec":`128163`,"Unicode hex":`1F4A3`},{"Typeface name":`Wingdings`,"Dingbat dec":`78`,"Dingbat hex":`4E`,"Unicode dec":`128369`,"Unicode hex":`1F571`},{"Typeface name":`Wingdings`,"Dingbat dec":`79`,"Dingbat hex":`4F`,"Unicode dec":`127987`,"Unicode hex":`1F3F3`},{"Typeface name":`Wingdings`,"Dingbat dec":`80`,"Dingbat hex":`50`,"Unicode dec":`127985`,"Unicode hex":`1F3F1`},{"Typeface name":`Wingdings`,"Dingbat dec":`81`,"Dingbat hex":`51`,"Unicode dec":`9992`,"Unicode hex":`2708`},{"Typeface name":`Wingdings`,"Dingbat dec":`82`,"Dingbat hex":`52`,"Unicode dec":`9788`,"Unicode hex":`263C`},{"Typeface name":`Wingdings`,"Dingbat dec":`83`,"Dingbat hex":`53`,"Unicode dec":`127778`,"Unicode hex":`1F322`},{"Typeface name":`Wingdings`,"Dingbat dec":`84`,"Dingbat hex":`54`,"Unicode dec":`10052`,"Unicode hex":`2744`},{"Typeface name":`Wingdings`,"Dingbat dec":`85`,"Dingbat hex":`55`,"Unicode dec":`128326`,"Unicode hex":`1F546`},{"Typeface name":`Wingdings`,"Dingbat dec":`86`,"Dingbat hex":`56`,"Unicode dec":`10014`,"Unicode hex":`271E`},{"Typeface name":`Wingdings`,"Dingbat dec":`87`,"Dingbat hex":`57`,"Unicode dec":`128328`,"Unicode hex":`1F548`},{"Typeface name":`Wingdings`,"Dingbat dec":`88`,"Dingbat hex":`58`,"Unicode dec":`10016`,"Unicode hex":`2720`},{"Typeface name":`Wingdings`,"Dingbat dec":`89`,"Dingbat hex":`59`,"Unicode dec":`10017`,"Unicode hex":`2721`},{"Typeface name":`Wingdings`,"Dingbat dec":`90`,"Dingbat hex":`5A`,"Unicode dec":`9770`,"Unicode hex":`262A`},{"Typeface name":`Wingdings`,"Dingbat dec":`91`,"Dingbat hex":`5B`,"Unicode dec":`9775`,"Unicode hex":`262F`},{"Typeface name":`Wingdings`,"Dingbat dec":`92`,"Dingbat hex":`5C`,"Unicode dec":`128329`,"Unicode hex":`1F549`},{"Typeface name":`Wingdings`,"Dingbat dec":`93`,"Dingbat hex":`5D`,"Unicode dec":`9784`,"Unicode hex":`2638`},{"Typeface name":`Wingdings`,"Dingbat dec":`94`,"Dingbat hex":`5E`,"Unicode dec":`9800`,"Unicode hex":`2648`},{"Typeface name":`Wingdings`,"Dingbat dec":`95`,"Dingbat hex":`5F`,"Unicode dec":`9801`,"Unicode hex":`2649`},{"Typeface name":`Wingdings`,"Dingbat dec":`96`,"Dingbat hex":`60`,"Unicode dec":`9802`,"Unicode hex":`264A`},{"Typeface name":`Wingdings`,"Dingbat dec":`97`,"Dingbat hex":`61`,"Unicode dec":`9803`,"Unicode hex":`264B`},{"Typeface name":`Wingdings`,"Dingbat dec":`98`,"Dingbat hex":`62`,"Unicode dec":`9804`,"Unicode hex":`264C`},{"Typeface name":`Wingdings`,"Dingbat dec":`99`,"Dingbat hex":`63`,"Unicode dec":`9805`,"Unicode hex":`264D`},{"Typeface name":`Wingdings`,"Dingbat dec":`100`,"Dingbat hex":`64`,"Unicode dec":`9806`,"Unicode hex":`264E`},{"Typeface name":`Wingdings`,"Dingbat dec":`101`,"Dingbat hex":`65`,"Unicode dec":`9807`,"Unicode hex":`264F`},{"Typeface name":`Wingdings`,"Dingbat dec":`102`,"Dingbat hex":`66`,"Unicode dec":`9808`,"Unicode hex":`2650`},{"Typeface name":`Wingdings`,"Dingbat dec":`103`,"Dingbat hex":`67`,"Unicode dec":`9809`,"Unicode hex":`2651`},{"Typeface name":`Wingdings`,"Dingbat dec":`104`,"Dingbat hex":`68`,"Unicode dec":`9810`,"Unicode hex":`2652`},{"Typeface name":`Wingdings`,"Dingbat dec":`105`,"Dingbat hex":`69`,"Unicode dec":`9811`,"Unicode hex":`2653`},{"Typeface name":`Wingdings`,"Dingbat dec":`106`,"Dingbat hex":`6A`,"Unicode dec":`128624`,"Unicode hex":`1F670`},{"Typeface name":`Wingdings`,"Dingbat dec":`107`,"Dingbat hex":`6B`,"Unicode dec":`128629`,"Unicode hex":`1F675`},{"Typeface name":`Wingdings`,"Dingbat dec":`108`,"Dingbat hex":`6C`,"Unicode dec":`9899`,"Unicode hex":`26AB`},{"Typeface name":`Wingdings`,"Dingbat dec":`109`,"Dingbat hex":`6D`,"Unicode dec":`128318`,"Unicode hex":`1F53E`},{"Typeface name":`Wingdings`,"Dingbat dec":`110`,"Dingbat hex":`6E`,"Unicode dec":`9724`,"Unicode hex":`25FC`},{"Typeface name":`Wingdings`,"Dingbat dec":`111`,"Dingbat hex":`6F`,"Unicode dec":`128911`,"Unicode hex":`1F78F`},{"Typeface name":`Wingdings`,"Dingbat dec":`112`,"Dingbat hex":`70`,"Unicode dec":`128912`,"Unicode hex":`1F790`},{"Typeface name":`Wingdings`,"Dingbat dec":`113`,"Dingbat hex":`71`,"Unicode dec":`10065`,"Unicode hex":`2751`},{"Typeface name":`Wingdings`,"Dingbat dec":`114`,"Dingbat hex":`72`,"Unicode dec":`10066`,"Unicode hex":`2752`},{"Typeface name":`Wingdings`,"Dingbat dec":`115`,"Dingbat hex":`73`,"Unicode dec":`128927`,"Unicode hex":`1F79F`},{"Typeface name":`Wingdings`,"Dingbat dec":`116`,"Dingbat hex":`74`,"Unicode dec":`10731`,"Unicode hex":`29EB`},{"Typeface name":`Wingdings`,"Dingbat dec":`117`,"Dingbat hex":`75`,"Unicode dec":`9670`,"Unicode hex":`25C6`},{"Typeface name":`Wingdings`,"Dingbat dec":`118`,"Dingbat hex":`76`,"Unicode dec":`10070`,"Unicode hex":`2756`},{"Typeface name":`Wingdings`,"Dingbat dec":`119`,"Dingbat hex":`77`,"Unicode dec":`11049`,"Unicode hex":`2B29`},{"Typeface name":`Wingdings`,"Dingbat dec":`120`,"Dingbat hex":`78`,"Unicode dec":`8999`,"Unicode hex":`2327`},{"Typeface name":`Wingdings`,"Dingbat dec":`121`,"Dingbat hex":`79`,"Unicode dec":`11193`,"Unicode hex":`2BB9`},{"Typeface name":`Wingdings`,"Dingbat dec":`122`,"Dingbat hex":`7A`,"Unicode dec":`8984`,"Unicode hex":`2318`},{"Typeface name":`Wingdings`,"Dingbat dec":`123`,"Dingbat hex":`7B`,"Unicode dec":`127989`,"Unicode hex":`1F3F5`},{"Typeface name":`Wingdings`,"Dingbat dec":`124`,"Dingbat hex":`7C`,"Unicode dec":`127990`,"Unicode hex":`1F3F6`},{"Typeface name":`Wingdings`,"Dingbat dec":`125`,"Dingbat hex":`7D`,"Unicode dec":`128630`,"Unicode hex":`1F676`},{"Typeface name":`Wingdings`,"Dingbat dec":`126`,"Dingbat hex":`7E`,"Unicode dec":`128631`,"Unicode hex":`1F677`},{"Typeface name":`Wingdings`,"Dingbat dec":`127`,"Dingbat hex":`7F`,"Unicode dec":`9647`,"Unicode hex":`25AF`},{"Typeface name":`Wingdings`,"Dingbat dec":`128`,"Dingbat hex":`80`,"Unicode dec":`127243`,"Unicode hex":`1F10B`},{"Typeface name":`Wingdings`,"Dingbat dec":`129`,"Dingbat hex":`81`,"Unicode dec":`10112`,"Unicode hex":`2780`},{"Typeface name":`Wingdings`,"Dingbat dec":`130`,"Dingbat hex":`82`,"Unicode dec":`10113`,"Unicode hex":`2781`},{"Typeface name":`Wingdings`,"Dingbat dec":`131`,"Dingbat hex":`83`,"Unicode dec":`10114`,"Unicode hex":`2782`},{"Typeface name":`Wingdings`,"Dingbat dec":`132`,"Dingbat hex":`84`,"Unicode dec":`10115`,"Unicode hex":`2783`},{"Typeface name":`Wingdings`,"Dingbat dec":`133`,"Dingbat hex":`85`,"Unicode dec":`10116`,"Unicode hex":`2784`},{"Typeface name":`Wingdings`,"Dingbat dec":`134`,"Dingbat hex":`86`,"Unicode dec":`10117`,"Unicode hex":`2785`},{"Typeface name":`Wingdings`,"Dingbat dec":`135`,"Dingbat hex":`87`,"Unicode dec":`10118`,"Unicode hex":`2786`},{"Typeface name":`Wingdings`,"Dingbat dec":`136`,"Dingbat hex":`88`,"Unicode dec":`10119`,"Unicode hex":`2787`},{"Typeface name":`Wingdings`,"Dingbat dec":`137`,"Dingbat hex":`89`,"Unicode dec":`10120`,"Unicode hex":`2788`},{"Typeface name":`Wingdings`,"Dingbat dec":`138`,"Dingbat hex":`8A`,"Unicode dec":`10121`,"Unicode hex":`2789`},{"Typeface name":`Wingdings`,"Dingbat dec":`139`,"Dingbat hex":`8B`,"Unicode dec":`127244`,"Unicode hex":`1F10C`},{"Typeface name":`Wingdings`,"Dingbat dec":`140`,"Dingbat hex":`8C`,"Unicode dec":`10122`,"Unicode hex":`278A`},{"Typeface name":`Wingdings`,"Dingbat dec":`141`,"Dingbat hex":`8D`,"Unicode dec":`10123`,"Unicode hex":`278B`},{"Typeface name":`Wingdings`,"Dingbat dec":`142`,"Dingbat hex":`8E`,"Unicode dec":`10124`,"Unicode hex":`278C`},{"Typeface name":`Wingdings`,"Dingbat dec":`143`,"Dingbat hex":`8F`,"Unicode dec":`10125`,"Unicode hex":`278D`},{"Typeface name":`Wingdings`,"Dingbat dec":`144`,"Dingbat hex":`90`,"Unicode dec":`10126`,"Unicode hex":`278E`},{"Typeface name":`Wingdings`,"Dingbat dec":`145`,"Dingbat hex":`91`,"Unicode dec":`10127`,"Unicode hex":`278F`},{"Typeface name":`Wingdings`,"Dingbat dec":`146`,"Dingbat hex":`92`,"Unicode dec":`10128`,"Unicode hex":`2790`},{"Typeface name":`Wingdings`,"Dingbat dec":`147`,"Dingbat hex":`93`,"Unicode dec":`10129`,"Unicode hex":`2791`},{"Typeface name":`Wingdings`,"Dingbat dec":`148`,"Dingbat hex":`94`,"Unicode dec":`10130`,"Unicode hex":`2792`},{"Typeface name":`Wingdings`,"Dingbat dec":`149`,"Dingbat hex":`95`,"Unicode dec":`10131`,"Unicode hex":`2793`},{"Typeface name":`Wingdings`,"Dingbat dec":`150`,"Dingbat hex":`96`,"Unicode dec":`128610`,"Unicode hex":`1F662`},{"Typeface name":`Wingdings`,"Dingbat dec":`151`,"Dingbat hex":`97`,"Unicode dec":`128608`,"Unicode hex":`1F660`},{"Typeface name":`Wingdings`,"Dingbat dec":`152`,"Dingbat hex":`98`,"Unicode dec":`128609`,"Unicode hex":`1F661`},{"Typeface name":`Wingdings`,"Dingbat dec":`153`,"Dingbat hex":`99`,"Unicode dec":`128611`,"Unicode hex":`1F663`},{"Typeface name":`Wingdings`,"Dingbat dec":`154`,"Dingbat hex":`9A`,"Unicode dec":`128606`,"Unicode hex":`1F65E`},{"Typeface name":`Wingdings`,"Dingbat dec":`155`,"Dingbat hex":`9B`,"Unicode dec":`128604`,"Unicode hex":`1F65C`},{"Typeface name":`Wingdings`,"Dingbat dec":`156`,"Dingbat hex":`9C`,"Unicode dec":`128605`,"Unicode hex":`1F65D`},{"Typeface name":`Wingdings`,"Dingbat dec":`157`,"Dingbat hex":`9D`,"Unicode dec":`128607`,"Unicode hex":`1F65F`},{"Typeface name":`Wingdings`,"Dingbat dec":`158`,"Dingbat hex":`9E`,"Unicode dec":`8729`,"Unicode hex":`2219`},{"Typeface name":`Wingdings`,"Dingbat dec":`159`,"Dingbat hex":`9F`,"Unicode dec":`8226`,"Unicode hex":`2022`},{"Typeface name":`Wingdings`,"Dingbat dec":`160`,"Dingbat hex":`A0`,"Unicode dec":`11037`,"Unicode hex":`2B1D`},{"Typeface name":`Wingdings`,"Dingbat dec":`161`,"Dingbat hex":`A1`,"Unicode dec":`11096`,"Unicode hex":`2B58`},{"Typeface name":`Wingdings`,"Dingbat dec":`162`,"Dingbat hex":`A2`,"Unicode dec":`128902`,"Unicode hex":`1F786`},{"Typeface name":`Wingdings`,"Dingbat dec":`163`,"Dingbat hex":`A3`,"Unicode dec":`128904`,"Unicode hex":`1F788`},{"Typeface name":`Wingdings`,"Dingbat dec":`164`,"Dingbat hex":`A4`,"Unicode dec":`128906`,"Unicode hex":`1F78A`},{"Typeface name":`Wingdings`,"Dingbat dec":`165`,"Dingbat hex":`A5`,"Unicode dec":`128907`,"Unicode hex":`1F78B`},{"Typeface name":`Wingdings`,"Dingbat dec":`166`,"Dingbat hex":`A6`,"Unicode dec":`128319`,"Unicode hex":`1F53F`},{"Typeface name":`Wingdings`,"Dingbat dec":`167`,"Dingbat hex":`A7`,"Unicode dec":`9642`,"Unicode hex":`25AA`},{"Typeface name":`Wingdings`,"Dingbat dec":`168`,"Dingbat hex":`A8`,"Unicode dec":`128910`,"Unicode hex":`1F78E`},{"Typeface name":`Wingdings`,"Dingbat dec":`169`,"Dingbat hex":`A9`,"Unicode dec":`128961`,"Unicode hex":`1F7C1`},{"Typeface name":`Wingdings`,"Dingbat dec":`170`,"Dingbat hex":`AA`,"Unicode dec":`128965`,"Unicode hex":`1F7C5`},{"Typeface name":`Wingdings`,"Dingbat dec":`171`,"Dingbat hex":`AB`,"Unicode dec":`9733`,"Unicode hex":`2605`},{"Typeface name":`Wingdings`,"Dingbat dec":`172`,"Dingbat hex":`AC`,"Unicode dec":`128971`,"Unicode hex":`1F7CB`},{"Typeface name":`Wingdings`,"Dingbat dec":`173`,"Dingbat hex":`AD`,"Unicode dec":`128975`,"Unicode hex":`1F7CF`},{"Typeface name":`Wingdings`,"Dingbat dec":`174`,"Dingbat hex":`AE`,"Unicode dec":`128979`,"Unicode hex":`1F7D3`},{"Typeface name":`Wingdings`,"Dingbat dec":`175`,"Dingbat hex":`AF`,"Unicode dec":`128977`,"Unicode hex":`1F7D1`},{"Typeface name":`Wingdings`,"Dingbat dec":`176`,"Dingbat hex":`B0`,"Unicode dec":`11216`,"Unicode hex":`2BD0`},{"Typeface name":`Wingdings`,"Dingbat dec":`177`,"Dingbat hex":`B1`,"Unicode dec":`8982`,"Unicode hex":`2316`},{"Typeface name":`Wingdings`,"Dingbat dec":`178`,"Dingbat hex":`B2`,"Unicode dec":`11214`,"Unicode hex":`2BCE`},{"Typeface name":`Wingdings`,"Dingbat dec":`179`,"Dingbat hex":`B3`,"Unicode dec":`11215`,"Unicode hex":`2BCF`},{"Typeface name":`Wingdings`,"Dingbat dec":`180`,"Dingbat hex":`B4`,"Unicode dec":`11217`,"Unicode hex":`2BD1`},{"Typeface name":`Wingdings`,"Dingbat dec":`181`,"Dingbat hex":`B5`,"Unicode dec":`10026`,"Unicode hex":`272A`},{"Typeface name":`Wingdings`,"Dingbat dec":`182`,"Dingbat hex":`B6`,"Unicode dec":`10032`,"Unicode hex":`2730`},{"Typeface name":`Wingdings`,"Dingbat dec":`183`,"Dingbat hex":`B7`,"Unicode dec":`128336`,"Unicode hex":`1F550`},{"Typeface name":`Wingdings`,"Dingbat dec":`184`,"Dingbat hex":`B8`,"Unicode dec":`128337`,"Unicode hex":`1F551`},{"Typeface name":`Wingdings`,"Dingbat dec":`185`,"Dingbat hex":`B9`,"Unicode dec":`128338`,"Unicode hex":`1F552`},{"Typeface name":`Wingdings`,"Dingbat dec":`186`,"Dingbat hex":`BA`,"Unicode dec":`128339`,"Unicode hex":`1F553`},{"Typeface name":`Wingdings`,"Dingbat dec":`187`,"Dingbat hex":`BB`,"Unicode dec":`128340`,"Unicode hex":`1F554`},{"Typeface name":`Wingdings`,"Dingbat dec":`188`,"Dingbat hex":`BC`,"Unicode dec":`128341`,"Unicode hex":`1F555`},{"Typeface name":`Wingdings`,"Dingbat dec":`189`,"Dingbat hex":`BD`,"Unicode dec":`128342`,"Unicode hex":`1F556`},{"Typeface name":`Wingdings`,"Dingbat dec":`190`,"Dingbat hex":`BE`,"Unicode dec":`128343`,"Unicode hex":`1F557`},{"Typeface name":`Wingdings`,"Dingbat dec":`191`,"Dingbat hex":`BF`,"Unicode dec":`128344`,"Unicode hex":`1F558`},{"Typeface name":`Wingdings`,"Dingbat dec":`192`,"Dingbat hex":`C0`,"Unicode dec":`128345`,"Unicode hex":`1F559`},{"Typeface name":`Wingdings`,"Dingbat dec":`193`,"Dingbat hex":`C1`,"Unicode dec":`128346`,"Unicode hex":`1F55A`},{"Typeface name":`Wingdings`,"Dingbat dec":`194`,"Dingbat hex":`C2`,"Unicode dec":`128347`,"Unicode hex":`1F55B`},{"Typeface name":`Wingdings`,"Dingbat dec":`195`,"Dingbat hex":`C3`,"Unicode dec":`11184`,"Unicode hex":`2BB0`},{"Typeface name":`Wingdings`,"Dingbat dec":`196`,"Dingbat hex":`C4`,"Unicode dec":`11185`,"Unicode hex":`2BB1`},{"Typeface name":`Wingdings`,"Dingbat dec":`197`,"Dingbat hex":`C5`,"Unicode dec":`11186`,"Unicode hex":`2BB2`},{"Typeface name":`Wingdings`,"Dingbat dec":`198`,"Dingbat hex":`C6`,"Unicode dec":`11187`,"Unicode hex":`2BB3`},{"Typeface name":`Wingdings`,"Dingbat dec":`199`,"Dingbat hex":`C7`,"Unicode dec":`11188`,"Unicode hex":`2BB4`},{"Typeface name":`Wingdings`,"Dingbat dec":`200`,"Dingbat hex":`C8`,"Unicode dec":`11189`,"Unicode hex":`2BB5`},{"Typeface name":`Wingdings`,"Dingbat dec":`201`,"Dingbat hex":`C9`,"Unicode dec":`11190`,"Unicode hex":`2BB6`},{"Typeface name":`Wingdings`,"Dingbat dec":`202`,"Dingbat hex":`CA`,"Unicode dec":`11191`,"Unicode hex":`2BB7`},{"Typeface name":`Wingdings`,"Dingbat dec":`203`,"Dingbat hex":`CB`,"Unicode dec":`128618`,"Unicode hex":`1F66A`},{"Typeface name":`Wingdings`,"Dingbat dec":`204`,"Dingbat hex":`CC`,"Unicode dec":`128619`,"Unicode hex":`1F66B`},{"Typeface name":`Wingdings`,"Dingbat dec":`205`,"Dingbat hex":`CD`,"Unicode dec":`128597`,"Unicode hex":`1F655`},{"Typeface name":`Wingdings`,"Dingbat dec":`206`,"Dingbat hex":`CE`,"Unicode dec":`128596`,"Unicode hex":`1F654`},{"Typeface name":`Wingdings`,"Dingbat dec":`207`,"Dingbat hex":`CF`,"Unicode dec":`128599`,"Unicode hex":`1F657`},{"Typeface name":`Wingdings`,"Dingbat dec":`208`,"Dingbat hex":`D0`,"Unicode dec":`128598`,"Unicode hex":`1F656`},{"Typeface name":`Wingdings`,"Dingbat dec":`209`,"Dingbat hex":`D1`,"Unicode dec":`128592`,"Unicode hex":`1F650`},{"Typeface name":`Wingdings`,"Dingbat dec":`210`,"Dingbat hex":`D2`,"Unicode dec":`128593`,"Unicode hex":`1F651`},{"Typeface name":`Wingdings`,"Dingbat dec":`211`,"Dingbat hex":`D3`,"Unicode dec":`128594`,"Unicode hex":`1F652`},{"Typeface name":`Wingdings`,"Dingbat dec":`212`,"Dingbat hex":`D4`,"Unicode dec":`128595`,"Unicode hex":`1F653`},{"Typeface name":`Wingdings`,"Dingbat dec":`213`,"Dingbat hex":`D5`,"Unicode dec":`9003`,"Unicode hex":`232B`},{"Typeface name":`Wingdings`,"Dingbat dec":`214`,"Dingbat hex":`D6`,"Unicode dec":`8998`,"Unicode hex":`2326`},{"Typeface name":`Wingdings`,"Dingbat dec":`215`,"Dingbat hex":`D7`,"Unicode dec":`11160`,"Unicode hex":`2B98`},{"Typeface name":`Wingdings`,"Dingbat dec":`216`,"Dingbat hex":`D8`,"Unicode dec":`11162`,"Unicode hex":`2B9A`},{"Typeface name":`Wingdings`,"Dingbat dec":`217`,"Dingbat hex":`D9`,"Unicode dec":`11161`,"Unicode hex":`2B99`},{"Typeface name":`Wingdings`,"Dingbat dec":`218`,"Dingbat hex":`DA`,"Unicode dec":`11163`,"Unicode hex":`2B9B`},{"Typeface name":`Wingdings`,"Dingbat dec":`219`,"Dingbat hex":`DB`,"Unicode dec":`11144`,"Unicode hex":`2B88`},{"Typeface name":`Wingdings`,"Dingbat dec":`220`,"Dingbat hex":`DC`,"Unicode dec":`11146`,"Unicode hex":`2B8A`},{"Typeface name":`Wingdings`,"Dingbat dec":`221`,"Dingbat hex":`DD`,"Unicode dec":`11145`,"Unicode hex":`2B89`},{"Typeface name":`Wingdings`,"Dingbat dec":`222`,"Dingbat hex":`DE`,"Unicode dec":`11147`,"Unicode hex":`2B8B`},{"Typeface name":`Wingdings`,"Dingbat dec":`223`,"Dingbat hex":`DF`,"Unicode dec":`129128`,"Unicode hex":`1F868`},{"Typeface name":`Wingdings`,"Dingbat dec":`224`,"Dingbat hex":`E0`,"Unicode dec":`129130`,"Unicode hex":`1F86A`},{"Typeface name":`Wingdings`,"Dingbat dec":`225`,"Dingbat hex":`E1`,"Unicode dec":`129129`,"Unicode hex":`1F869`},{"Typeface name":`Wingdings`,"Dingbat dec":`226`,"Dingbat hex":`E2`,"Unicode dec":`129131`,"Unicode hex":`1F86B`},{"Typeface name":`Wingdings`,"Dingbat dec":`227`,"Dingbat hex":`E3`,"Unicode dec":`129132`,"Unicode hex":`1F86C`},{"Typeface name":`Wingdings`,"Dingbat dec":`228`,"Dingbat hex":`E4`,"Unicode dec":`129133`,"Unicode hex":`1F86D`},{"Typeface name":`Wingdings`,"Dingbat dec":`229`,"Dingbat hex":`E5`,"Unicode dec":`129135`,"Unicode hex":`1F86F`},{"Typeface name":`Wingdings`,"Dingbat dec":`230`,"Dingbat hex":`E6`,"Unicode dec":`129134`,"Unicode hex":`1F86E`},{"Typeface name":`Wingdings`,"Dingbat dec":`231`,"Dingbat hex":`E7`,"Unicode dec":`129144`,"Unicode hex":`1F878`},{"Typeface name":`Wingdings`,"Dingbat dec":`232`,"Dingbat hex":`E8`,"Unicode dec":`129146`,"Unicode hex":`1F87A`},{"Typeface name":`Wingdings`,"Dingbat dec":`233`,"Dingbat hex":`E9`,"Unicode dec":`129145`,"Unicode hex":`1F879`},{"Typeface name":`Wingdings`,"Dingbat dec":`234`,"Dingbat hex":`EA`,"Unicode dec":`129147`,"Unicode hex":`1F87B`},{"Typeface name":`Wingdings`,"Dingbat dec":`235`,"Dingbat hex":`EB`,"Unicode dec":`129148`,"Unicode hex":`1F87C`},{"Typeface name":`Wingdings`,"Dingbat dec":`236`,"Dingbat hex":`EC`,"Unicode dec":`129149`,"Unicode hex":`1F87D`},{"Typeface name":`Wingdings`,"Dingbat dec":`237`,"Dingbat hex":`ED`,"Unicode dec":`129151`,"Unicode hex":`1F87F`},{"Typeface name":`Wingdings`,"Dingbat dec":`238`,"Dingbat hex":`EE`,"Unicode dec":`129150`,"Unicode hex":`1F87E`},{"Typeface name":`Wingdings`,"Dingbat dec":`239`,"Dingbat hex":`EF`,"Unicode dec":`8678`,"Unicode hex":`21E6`},{"Typeface name":`Wingdings`,"Dingbat dec":`240`,"Dingbat hex":`F0`,"Unicode dec":`8680`,"Unicode hex":`21E8`},{"Typeface name":`Wingdings`,"Dingbat dec":`241`,"Dingbat hex":`F1`,"Unicode dec":`8679`,"Unicode hex":`21E7`},{"Typeface name":`Wingdings`,"Dingbat dec":`242`,"Dingbat hex":`F2`,"Unicode dec":`8681`,"Unicode hex":`21E9`},{"Typeface name":`Wingdings`,"Dingbat dec":`243`,"Dingbat hex":`F3`,"Unicode dec":`11012`,"Unicode hex":`2B04`},{"Typeface name":`Wingdings`,"Dingbat dec":`244`,"Dingbat hex":`F4`,"Unicode dec":`8691`,"Unicode hex":`21F3`},{"Typeface name":`Wingdings`,"Dingbat dec":`245`,"Dingbat hex":`F5`,"Unicode dec":`11009`,"Unicode hex":`2B01`},{"Typeface name":`Wingdings`,"Dingbat dec":`246`,"Dingbat hex":`F6`,"Unicode dec":`11008`,"Unicode hex":`2B00`},{"Typeface name":`Wingdings`,"Dingbat dec":`247`,"Dingbat hex":`F7`,"Unicode dec":`11011`,"Unicode hex":`2B03`},{"Typeface name":`Wingdings`,"Dingbat dec":`248`,"Dingbat hex":`F8`,"Unicode dec":`11010`,"Unicode hex":`2B02`},{"Typeface name":`Wingdings`,"Dingbat dec":`249`,"Dingbat hex":`F9`,"Unicode dec":`129196`,"Unicode hex":`1F8AC`},{"Typeface name":`Wingdings`,"Dingbat dec":`250`,"Dingbat hex":`FA`,"Unicode dec":`129197`,"Unicode hex":`1F8AD`},{"Typeface name":`Wingdings`,"Dingbat dec":`251`,"Dingbat hex":`FB`,"Unicode dec":`128502`,"Unicode hex":`1F5F6`},{"Typeface name":`Wingdings`,"Dingbat dec":`252`,"Dingbat hex":`FC`,"Unicode dec":`10003`,"Unicode hex":`2713`},{"Typeface name":`Wingdings`,"Dingbat dec":`253`,"Dingbat hex":`FD`,"Unicode dec":`128503`,"Unicode hex":`1F5F7`},{"Typeface name":`Wingdings`,"Dingbat dec":`254`,"Dingbat hex":`FE`,"Unicode dec":`128505`,"Unicode hex":`1F5F9`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`32`,"Dingbat hex":`20`,"Unicode dec":`32`,"Unicode hex":`20`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`33`,"Dingbat hex":`21`,"Unicode dec":`128394`,"Unicode hex":`1F58A`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`34`,"Dingbat hex":`22`,"Unicode dec":`128395`,"Unicode hex":`1F58B`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`35`,"Dingbat hex":`23`,"Unicode dec":`128396`,"Unicode hex":`1F58C`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`36`,"Dingbat hex":`24`,"Unicode dec":`128397`,"Unicode hex":`1F58D`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`37`,"Dingbat hex":`25`,"Unicode dec":`9988`,"Unicode hex":`2704`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`38`,"Dingbat hex":`26`,"Unicode dec":`9984`,"Unicode hex":`2700`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`39`,"Dingbat hex":`27`,"Unicode dec":`128382`,"Unicode hex":`1F57E`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`40`,"Dingbat hex":`28`,"Unicode dec":`128381`,"Unicode hex":`1F57D`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`41`,"Dingbat hex":`29`,"Unicode dec":`128453`,"Unicode hex":`1F5C5`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`42`,"Dingbat hex":`2A`,"Unicode dec":`128454`,"Unicode hex":`1F5C6`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`43`,"Dingbat hex":`2B`,"Unicode dec":`128455`,"Unicode hex":`1F5C7`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`44`,"Dingbat hex":`2C`,"Unicode dec":`128456`,"Unicode hex":`1F5C8`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`45`,"Dingbat hex":`2D`,"Unicode dec":`128457`,"Unicode hex":`1F5C9`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`46`,"Dingbat hex":`2E`,"Unicode dec":`128458`,"Unicode hex":`1F5CA`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`47`,"Dingbat hex":`2F`,"Unicode dec":`128459`,"Unicode hex":`1F5CB`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`48`,"Dingbat hex":`30`,"Unicode dec":`128460`,"Unicode hex":`1F5CC`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`49`,"Dingbat hex":`31`,"Unicode dec":`128461`,"Unicode hex":`1F5CD`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`50`,"Dingbat hex":`32`,"Unicode dec":`128203`,"Unicode hex":`1F4CB`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`51`,"Dingbat hex":`33`,"Unicode dec":`128465`,"Unicode hex":`1F5D1`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`52`,"Dingbat hex":`34`,"Unicode dec":`128468`,"Unicode hex":`1F5D4`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`53`,"Dingbat hex":`35`,"Unicode dec":`128437`,"Unicode hex":`1F5B5`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`54`,"Dingbat hex":`36`,"Unicode dec":`128438`,"Unicode hex":`1F5B6`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`55`,"Dingbat hex":`37`,"Unicode dec":`128439`,"Unicode hex":`1F5B7`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`56`,"Dingbat hex":`38`,"Unicode dec":`128440`,"Unicode hex":`1F5B8`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`57`,"Dingbat hex":`39`,"Unicode dec":`128429`,"Unicode hex":`1F5AD`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`58`,"Dingbat hex":`3A`,"Unicode dec":`128431`,"Unicode hex":`1F5AF`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`59`,"Dingbat hex":`3B`,"Unicode dec":`128433`,"Unicode hex":`1F5B1`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`60`,"Dingbat hex":`3C`,"Unicode dec":`128402`,"Unicode hex":`1F592`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`61`,"Dingbat hex":`3D`,"Unicode dec":`128403`,"Unicode hex":`1F593`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`62`,"Dingbat hex":`3E`,"Unicode dec":`128408`,"Unicode hex":`1F598`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`63`,"Dingbat hex":`3F`,"Unicode dec":`128409`,"Unicode hex":`1F599`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`64`,"Dingbat hex":`40`,"Unicode dec":`128410`,"Unicode hex":`1F59A`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`65`,"Dingbat hex":`41`,"Unicode dec":`128411`,"Unicode hex":`1F59B`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`66`,"Dingbat hex":`42`,"Unicode dec":`128072`,"Unicode hex":`1F448`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`67`,"Dingbat hex":`43`,"Unicode dec":`128073`,"Unicode hex":`1F449`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`68`,"Dingbat hex":`44`,"Unicode dec":`128412`,"Unicode hex":`1F59C`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`69`,"Dingbat hex":`45`,"Unicode dec":`128413`,"Unicode hex":`1F59D`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`70`,"Dingbat hex":`46`,"Unicode dec":`128414`,"Unicode hex":`1F59E`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`71`,"Dingbat hex":`47`,"Unicode dec":`128415`,"Unicode hex":`1F59F`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`72`,"Dingbat hex":`48`,"Unicode dec":`128416`,"Unicode hex":`1F5A0`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`73`,"Dingbat hex":`49`,"Unicode dec":`128417`,"Unicode hex":`1F5A1`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`74`,"Dingbat hex":`4A`,"Unicode dec":`128070`,"Unicode hex":`1F446`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`75`,"Dingbat hex":`4B`,"Unicode dec":`128071`,"Unicode hex":`1F447`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`76`,"Dingbat hex":`4C`,"Unicode dec":`128418`,"Unicode hex":`1F5A2`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`77`,"Dingbat hex":`4D`,"Unicode dec":`128419`,"Unicode hex":`1F5A3`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`78`,"Dingbat hex":`4E`,"Unicode dec":`128401`,"Unicode hex":`1F591`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`79`,"Dingbat hex":`4F`,"Unicode dec":`128500`,"Unicode hex":`1F5F4`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`80`,"Dingbat hex":`50`,"Unicode dec":`128504`,"Unicode hex":`1F5F8`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`81`,"Dingbat hex":`51`,"Unicode dec":`128501`,"Unicode hex":`1F5F5`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`82`,"Dingbat hex":`52`,"Unicode dec":`9745`,"Unicode hex":`2611`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`83`,"Dingbat hex":`53`,"Unicode dec":`11197`,"Unicode hex":`2BBD`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`84`,"Dingbat hex":`54`,"Unicode dec":`9746`,"Unicode hex":`2612`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`85`,"Dingbat hex":`55`,"Unicode dec":`11198`,"Unicode hex":`2BBE`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`86`,"Dingbat hex":`56`,"Unicode dec":`11199`,"Unicode hex":`2BBF`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`87`,"Dingbat hex":`57`,"Unicode dec":`128711`,"Unicode hex":`1F6C7`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`88`,"Dingbat hex":`58`,"Unicode dec":`10680`,"Unicode hex":`29B8`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`89`,"Dingbat hex":`59`,"Unicode dec":`128625`,"Unicode hex":`1F671`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`90`,"Dingbat hex":`5A`,"Unicode dec":`128628`,"Unicode hex":`1F674`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`91`,"Dingbat hex":`5B`,"Unicode dec":`128626`,"Unicode hex":`1F672`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`92`,"Dingbat hex":`5C`,"Unicode dec":`128627`,"Unicode hex":`1F673`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`93`,"Dingbat hex":`5D`,"Unicode dec":`8253`,"Unicode hex":`203D`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`94`,"Dingbat hex":`5E`,"Unicode dec":`128633`,"Unicode hex":`1F679`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`95`,"Dingbat hex":`5F`,"Unicode dec":`128634`,"Unicode hex":`1F67A`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`96`,"Dingbat hex":`60`,"Unicode dec":`128635`,"Unicode hex":`1F67B`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`97`,"Dingbat hex":`61`,"Unicode dec":`128614`,"Unicode hex":`1F666`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`98`,"Dingbat hex":`62`,"Unicode dec":`128612`,"Unicode hex":`1F664`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`99`,"Dingbat hex":`63`,"Unicode dec":`128613`,"Unicode hex":`1F665`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`100`,"Dingbat hex":`64`,"Unicode dec":`128615`,"Unicode hex":`1F667`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`101`,"Dingbat hex":`65`,"Unicode dec":`128602`,"Unicode hex":`1F65A`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`102`,"Dingbat hex":`66`,"Unicode dec":`128600`,"Unicode hex":`1F658`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`103`,"Dingbat hex":`67`,"Unicode dec":`128601`,"Unicode hex":`1F659`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`104`,"Dingbat hex":`68`,"Unicode dec":`128603`,"Unicode hex":`1F65B`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`105`,"Dingbat hex":`69`,"Unicode dec":`9450`,"Unicode hex":`24EA`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`106`,"Dingbat hex":`6A`,"Unicode dec":`9312`,"Unicode hex":`2460`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`107`,"Dingbat hex":`6B`,"Unicode dec":`9313`,"Unicode hex":`2461`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`108`,"Dingbat hex":`6C`,"Unicode dec":`9314`,"Unicode hex":`2462`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`109`,"Dingbat hex":`6D`,"Unicode dec":`9315`,"Unicode hex":`2463`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`110`,"Dingbat hex":`6E`,"Unicode dec":`9316`,"Unicode hex":`2464`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`111`,"Dingbat hex":`6F`,"Unicode dec":`9317`,"Unicode hex":`2465`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`112`,"Dingbat hex":`70`,"Unicode dec":`9318`,"Unicode hex":`2466`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`113`,"Dingbat hex":`71`,"Unicode dec":`9319`,"Unicode hex":`2467`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`114`,"Dingbat hex":`72`,"Unicode dec":`9320`,"Unicode hex":`2468`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`115`,"Dingbat hex":`73`,"Unicode dec":`9321`,"Unicode hex":`2469`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`116`,"Dingbat hex":`74`,"Unicode dec":`9471`,"Unicode hex":`24FF`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`117`,"Dingbat hex":`75`,"Unicode dec":`10102`,"Unicode hex":`2776`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`118`,"Dingbat hex":`76`,"Unicode dec":`10103`,"Unicode hex":`2777`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`119`,"Dingbat hex":`77`,"Unicode dec":`10104`,"Unicode hex":`2778`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`120`,"Dingbat hex":`78`,"Unicode dec":`10105`,"Unicode hex":`2779`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`121`,"Dingbat hex":`79`,"Unicode dec":`10106`,"Unicode hex":`277A`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`122`,"Dingbat hex":`7A`,"Unicode dec":`10107`,"Unicode hex":`277B`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`123`,"Dingbat hex":`7B`,"Unicode dec":`10108`,"Unicode hex":`277C`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`124`,"Dingbat hex":`7C`,"Unicode dec":`10109`,"Unicode hex":`277D`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`125`,"Dingbat hex":`7D`,"Unicode dec":`10110`,"Unicode hex":`277E`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`126`,"Dingbat hex":`7E`,"Unicode dec":`10111`,"Unicode hex":`277F`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`128`,"Dingbat hex":`80`,"Unicode dec":`9737`,"Unicode hex":`2609`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`129`,"Dingbat hex":`81`,"Unicode dec":`127765`,"Unicode hex":`1F315`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`130`,"Dingbat hex":`82`,"Unicode dec":`9789`,"Unicode hex":`263D`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`131`,"Dingbat hex":`83`,"Unicode dec":`9790`,"Unicode hex":`263E`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`132`,"Dingbat hex":`84`,"Unicode dec":`11839`,"Unicode hex":`2E3F`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`133`,"Dingbat hex":`85`,"Unicode dec":`10013`,"Unicode hex":`271D`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`134`,"Dingbat hex":`86`,"Unicode dec":`128327`,"Unicode hex":`1F547`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`135`,"Dingbat hex":`87`,"Unicode dec":`128348`,"Unicode hex":`1F55C`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`136`,"Dingbat hex":`88`,"Unicode dec":`128349`,"Unicode hex":`1F55D`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`137`,"Dingbat hex":`89`,"Unicode dec":`128350`,"Unicode hex":`1F55E`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`138`,"Dingbat hex":`8A`,"Unicode dec":`128351`,"Unicode hex":`1F55F`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`139`,"Dingbat hex":`8B`,"Unicode dec":`128352`,"Unicode hex":`1F560`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`140`,"Dingbat hex":`8C`,"Unicode dec":`128353`,"Unicode hex":`1F561`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`141`,"Dingbat hex":`8D`,"Unicode dec":`128354`,"Unicode hex":`1F562`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`142`,"Dingbat hex":`8E`,"Unicode dec":`128355`,"Unicode hex":`1F563`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`143`,"Dingbat hex":`8F`,"Unicode dec":`128356`,"Unicode hex":`1F564`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`144`,"Dingbat hex":`90`,"Unicode dec":`128357`,"Unicode hex":`1F565`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`145`,"Dingbat hex":`91`,"Unicode dec":`128358`,"Unicode hex":`1F566`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`146`,"Dingbat hex":`92`,"Unicode dec":`128359`,"Unicode hex":`1F567`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`147`,"Dingbat hex":`93`,"Unicode dec":`128616`,"Unicode hex":`1F668`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`148`,"Dingbat hex":`94`,"Unicode dec":`128617`,"Unicode hex":`1F669`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`149`,"Dingbat hex":`95`,"Unicode dec":`8901`,"Unicode hex":`22C5`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`150`,"Dingbat hex":`96`,"Unicode dec":`128900`,"Unicode hex":`1F784`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`151`,"Dingbat hex":`97`,"Unicode dec":`10625`,"Unicode hex":`2981`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`152`,"Dingbat hex":`98`,"Unicode dec":`9679`,"Unicode hex":`25CF`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`153`,"Dingbat hex":`99`,"Unicode dec":`9675`,"Unicode hex":`25CB`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`154`,"Dingbat hex":`9A`,"Unicode dec":`128901`,"Unicode hex":`1F785`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`155`,"Dingbat hex":`9B`,"Unicode dec":`128903`,"Unicode hex":`1F787`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`156`,"Dingbat hex":`9C`,"Unicode dec":`128905`,"Unicode hex":`1F789`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`157`,"Dingbat hex":`9D`,"Unicode dec":`8857`,"Unicode hex":`2299`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`158`,"Dingbat hex":`9E`,"Unicode dec":`10687`,"Unicode hex":`29BF`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`159`,"Dingbat hex":`9F`,"Unicode dec":`128908`,"Unicode hex":`1F78C`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`160`,"Dingbat hex":`A0`,"Unicode dec":`128909`,"Unicode hex":`1F78D`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`161`,"Dingbat hex":`A1`,"Unicode dec":`9726`,"Unicode hex":`25FE`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`162`,"Dingbat hex":`A2`,"Unicode dec":`9632`,"Unicode hex":`25A0`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`163`,"Dingbat hex":`A3`,"Unicode dec":`9633`,"Unicode hex":`25A1`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`164`,"Dingbat hex":`A4`,"Unicode dec":`128913`,"Unicode hex":`1F791`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`165`,"Dingbat hex":`A5`,"Unicode dec":`128914`,"Unicode hex":`1F792`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`166`,"Dingbat hex":`A6`,"Unicode dec":`128915`,"Unicode hex":`1F793`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`167`,"Dingbat hex":`A7`,"Unicode dec":`128916`,"Unicode hex":`1F794`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`168`,"Dingbat hex":`A8`,"Unicode dec":`9635`,"Unicode hex":`25A3`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`169`,"Dingbat hex":`A9`,"Unicode dec":`128917`,"Unicode hex":`1F795`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`170`,"Dingbat hex":`AA`,"Unicode dec":`128918`,"Unicode hex":`1F796`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`171`,"Dingbat hex":`AB`,"Unicode dec":`128919`,"Unicode hex":`1F797`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`172`,"Dingbat hex":`AC`,"Unicode dec":`128920`,"Unicode hex":`1F798`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`173`,"Dingbat hex":`AD`,"Unicode dec":`11049`,"Unicode hex":`2B29`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`174`,"Dingbat hex":`AE`,"Unicode dec":`11045`,"Unicode hex":`2B25`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`175`,"Dingbat hex":`AF`,"Unicode dec":`9671`,"Unicode hex":`25C7`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`176`,"Dingbat hex":`B0`,"Unicode dec":`128922`,"Unicode hex":`1F79A`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`177`,"Dingbat hex":`B1`,"Unicode dec":`9672`,"Unicode hex":`25C8`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`178`,"Dingbat hex":`B2`,"Unicode dec":`128923`,"Unicode hex":`1F79B`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`179`,"Dingbat hex":`B3`,"Unicode dec":`128924`,"Unicode hex":`1F79C`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`180`,"Dingbat hex":`B4`,"Unicode dec":`128925`,"Unicode hex":`1F79D`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`181`,"Dingbat hex":`B5`,"Unicode dec":`128926`,"Unicode hex":`1F79E`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`182`,"Dingbat hex":`B6`,"Unicode dec":`11050`,"Unicode hex":`2B2A`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`183`,"Dingbat hex":`B7`,"Unicode dec":`11047`,"Unicode hex":`2B27`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`184`,"Dingbat hex":`B8`,"Unicode dec":`9674`,"Unicode hex":`25CA`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`185`,"Dingbat hex":`B9`,"Unicode dec":`128928`,"Unicode hex":`1F7A0`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`186`,"Dingbat hex":`BA`,"Unicode dec":`9686`,"Unicode hex":`25D6`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`187`,"Dingbat hex":`BB`,"Unicode dec":`9687`,"Unicode hex":`25D7`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`188`,"Dingbat hex":`BC`,"Unicode dec":`11210`,"Unicode hex":`2BCA`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`189`,"Dingbat hex":`BD`,"Unicode dec":`11211`,"Unicode hex":`2BCB`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`190`,"Dingbat hex":`BE`,"Unicode dec":`11200`,"Unicode hex":`2BC0`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`191`,"Dingbat hex":`BF`,"Unicode dec":`11201`,"Unicode hex":`2BC1`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`192`,"Dingbat hex":`C0`,"Unicode dec":`11039`,"Unicode hex":`2B1F`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`193`,"Dingbat hex":`C1`,"Unicode dec":`11202`,"Unicode hex":`2BC2`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`194`,"Dingbat hex":`C2`,"Unicode dec":`11043`,"Unicode hex":`2B23`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`195`,"Dingbat hex":`C3`,"Unicode dec":`11042`,"Unicode hex":`2B22`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`196`,"Dingbat hex":`C4`,"Unicode dec":`11203`,"Unicode hex":`2BC3`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`197`,"Dingbat hex":`C5`,"Unicode dec":`11204`,"Unicode hex":`2BC4`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`198`,"Dingbat hex":`C6`,"Unicode dec":`128929`,"Unicode hex":`1F7A1`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`199`,"Dingbat hex":`C7`,"Unicode dec":`128930`,"Unicode hex":`1F7A2`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`200`,"Dingbat hex":`C8`,"Unicode dec":`128931`,"Unicode hex":`1F7A3`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`201`,"Dingbat hex":`C9`,"Unicode dec":`128932`,"Unicode hex":`1F7A4`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`202`,"Dingbat hex":`CA`,"Unicode dec":`128933`,"Unicode hex":`1F7A5`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`203`,"Dingbat hex":`CB`,"Unicode dec":`128934`,"Unicode hex":`1F7A6`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`204`,"Dingbat hex":`CC`,"Unicode dec":`128935`,"Unicode hex":`1F7A7`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`205`,"Dingbat hex":`CD`,"Unicode dec":`128936`,"Unicode hex":`1F7A8`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`206`,"Dingbat hex":`CE`,"Unicode dec":`128937`,"Unicode hex":`1F7A9`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`207`,"Dingbat hex":`CF`,"Unicode dec":`128938`,"Unicode hex":`1F7AA`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`208`,"Dingbat hex":`D0`,"Unicode dec":`128939`,"Unicode hex":`1F7AB`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`209`,"Dingbat hex":`D1`,"Unicode dec":`128940`,"Unicode hex":`1F7AC`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`210`,"Dingbat hex":`D2`,"Unicode dec":`128941`,"Unicode hex":`1F7AD`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`211`,"Dingbat hex":`D3`,"Unicode dec":`128942`,"Unicode hex":`1F7AE`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`212`,"Dingbat hex":`D4`,"Unicode dec":`128943`,"Unicode hex":`1F7AF`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`213`,"Dingbat hex":`D5`,"Unicode dec":`128944`,"Unicode hex":`1F7B0`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`214`,"Dingbat hex":`D6`,"Unicode dec":`128945`,"Unicode hex":`1F7B1`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`215`,"Dingbat hex":`D7`,"Unicode dec":`128946`,"Unicode hex":`1F7B2`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`216`,"Dingbat hex":`D8`,"Unicode dec":`128947`,"Unicode hex":`1F7B3`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`217`,"Dingbat hex":`D9`,"Unicode dec":`128948`,"Unicode hex":`1F7B4`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`218`,"Dingbat hex":`DA`,"Unicode dec":`128949`,"Unicode hex":`1F7B5`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`219`,"Dingbat hex":`DB`,"Unicode dec":`128950`,"Unicode hex":`1F7B6`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`220`,"Dingbat hex":`DC`,"Unicode dec":`128951`,"Unicode hex":`1F7B7`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`221`,"Dingbat hex":`DD`,"Unicode dec":`128952`,"Unicode hex":`1F7B8`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`222`,"Dingbat hex":`DE`,"Unicode dec":`128953`,"Unicode hex":`1F7B9`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`223`,"Dingbat hex":`DF`,"Unicode dec":`128954`,"Unicode hex":`1F7BA`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`224`,"Dingbat hex":`E0`,"Unicode dec":`128955`,"Unicode hex":`1F7BB`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`225`,"Dingbat hex":`E1`,"Unicode dec":`128956`,"Unicode hex":`1F7BC`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`226`,"Dingbat hex":`E2`,"Unicode dec":`128957`,"Unicode hex":`1F7BD`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`227`,"Dingbat hex":`E3`,"Unicode dec":`128958`,"Unicode hex":`1F7BE`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`228`,"Dingbat hex":`E4`,"Unicode dec":`128959`,"Unicode hex":`1F7BF`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`229`,"Dingbat hex":`E5`,"Unicode dec":`128960`,"Unicode hex":`1F7C0`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`230`,"Dingbat hex":`E6`,"Unicode dec":`128962`,"Unicode hex":`1F7C2`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`231`,"Dingbat hex":`E7`,"Unicode dec":`128964`,"Unicode hex":`1F7C4`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`232`,"Dingbat hex":`E8`,"Unicode dec":`128966`,"Unicode hex":`1F7C6`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`233`,"Dingbat hex":`E9`,"Unicode dec":`128969`,"Unicode hex":`1F7C9`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`234`,"Dingbat hex":`EA`,"Unicode dec":`128970`,"Unicode hex":`1F7CA`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`235`,"Dingbat hex":`EB`,"Unicode dec":`10038`,"Unicode hex":`2736`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`236`,"Dingbat hex":`EC`,"Unicode dec":`128972`,"Unicode hex":`1F7CC`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`237`,"Dingbat hex":`ED`,"Unicode dec":`128974`,"Unicode hex":`1F7CE`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`238`,"Dingbat hex":`EE`,"Unicode dec":`128976`,"Unicode hex":`1F7D0`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`239`,"Dingbat hex":`EF`,"Unicode dec":`128978`,"Unicode hex":`1F7D2`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`240`,"Dingbat hex":`F0`,"Unicode dec":`10041`,"Unicode hex":`2739`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`241`,"Dingbat hex":`F1`,"Unicode dec":`128963`,"Unicode hex":`1F7C3`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`242`,"Dingbat hex":`F2`,"Unicode dec":`128967`,"Unicode hex":`1F7C7`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`243`,"Dingbat hex":`F3`,"Unicode dec":`10031`,"Unicode hex":`272F`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`244`,"Dingbat hex":`F4`,"Unicode dec":`128973`,"Unicode hex":`1F7CD`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`245`,"Dingbat hex":`F5`,"Unicode dec":`128980`,"Unicode hex":`1F7D4`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`246`,"Dingbat hex":`F6`,"Unicode dec":`11212`,"Unicode hex":`2BCC`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`247`,"Dingbat hex":`F7`,"Unicode dec":`11213`,"Unicode hex":`2BCD`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`248`,"Dingbat hex":`F8`,"Unicode dec":`8251`,"Unicode hex":`203B`},{"Typeface name":`Wingdings 2`,"Dingbat dec":`249`,"Dingbat hex":`F9`,"Unicode dec":`8258`,"Unicode hex":`2042`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`32`,"Dingbat hex":`20`,"Unicode dec":`32`,"Unicode hex":`20`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`33`,"Dingbat hex":`21`,"Unicode dec":`11104`,"Unicode hex":`2B60`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`34`,"Dingbat hex":`22`,"Unicode dec":`11106`,"Unicode hex":`2B62`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`35`,"Dingbat hex":`23`,"Unicode dec":`11105`,"Unicode hex":`2B61`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`36`,"Dingbat hex":`24`,"Unicode dec":`11107`,"Unicode hex":`2B63`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`37`,"Dingbat hex":`25`,"Unicode dec":`11110`,"Unicode hex":`2B66`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`38`,"Dingbat hex":`26`,"Unicode dec":`11111`,"Unicode hex":`2B67`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`39`,"Dingbat hex":`27`,"Unicode dec":`11113`,"Unicode hex":`2B69`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`40`,"Dingbat hex":`28`,"Unicode dec":`11112`,"Unicode hex":`2B68`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`41`,"Dingbat hex":`29`,"Unicode dec":`11120`,"Unicode hex":`2B70`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`42`,"Dingbat hex":`2A`,"Unicode dec":`11122`,"Unicode hex":`2B72`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`43`,"Dingbat hex":`2B`,"Unicode dec":`11121`,"Unicode hex":`2B71`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`44`,"Dingbat hex":`2C`,"Unicode dec":`11123`,"Unicode hex":`2B73`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`45`,"Dingbat hex":`2D`,"Unicode dec":`11126`,"Unicode hex":`2B76`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`46`,"Dingbat hex":`2E`,"Unicode dec":`11128`,"Unicode hex":`2B78`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`47`,"Dingbat hex":`2F`,"Unicode dec":`11131`,"Unicode hex":`2B7B`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`48`,"Dingbat hex":`30`,"Unicode dec":`11133`,"Unicode hex":`2B7D`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`49`,"Dingbat hex":`31`,"Unicode dec":`11108`,"Unicode hex":`2B64`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`50`,"Dingbat hex":`32`,"Unicode dec":`11109`,"Unicode hex":`2B65`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`51`,"Dingbat hex":`33`,"Unicode dec":`11114`,"Unicode hex":`2B6A`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`52`,"Dingbat hex":`34`,"Unicode dec":`11116`,"Unicode hex":`2B6C`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`53`,"Dingbat hex":`35`,"Unicode dec":`11115`,"Unicode hex":`2B6B`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`54`,"Dingbat hex":`36`,"Unicode dec":`11117`,"Unicode hex":`2B6D`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`55`,"Dingbat hex":`37`,"Unicode dec":`11085`,"Unicode hex":`2B4D`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`56`,"Dingbat hex":`38`,"Unicode dec":`11168`,"Unicode hex":`2BA0`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`57`,"Dingbat hex":`39`,"Unicode dec":`11169`,"Unicode hex":`2BA1`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`58`,"Dingbat hex":`3A`,"Unicode dec":`11170`,"Unicode hex":`2BA2`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`59`,"Dingbat hex":`3B`,"Unicode dec":`11171`,"Unicode hex":`2BA3`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`60`,"Dingbat hex":`3C`,"Unicode dec":`11172`,"Unicode hex":`2BA4`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`61`,"Dingbat hex":`3D`,"Unicode dec":`11173`,"Unicode hex":`2BA5`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`62`,"Dingbat hex":`3E`,"Unicode dec":`11174`,"Unicode hex":`2BA6`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`63`,"Dingbat hex":`3F`,"Unicode dec":`11175`,"Unicode hex":`2BA7`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`64`,"Dingbat hex":`40`,"Unicode dec":`11152`,"Unicode hex":`2B90`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`65`,"Dingbat hex":`41`,"Unicode dec":`11153`,"Unicode hex":`2B91`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`66`,"Dingbat hex":`42`,"Unicode dec":`11154`,"Unicode hex":`2B92`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`67`,"Dingbat hex":`43`,"Unicode dec":`11155`,"Unicode hex":`2B93`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`68`,"Dingbat hex":`44`,"Unicode dec":`11136`,"Unicode hex":`2B80`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`69`,"Dingbat hex":`45`,"Unicode dec":`11139`,"Unicode hex":`2B83`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`70`,"Dingbat hex":`46`,"Unicode dec":`11134`,"Unicode hex":`2B7E`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`71`,"Dingbat hex":`47`,"Unicode dec":`11135`,"Unicode hex":`2B7F`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`72`,"Dingbat hex":`48`,"Unicode dec":`11140`,"Unicode hex":`2B84`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`73`,"Dingbat hex":`49`,"Unicode dec":`11142`,"Unicode hex":`2B86`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`74`,"Dingbat hex":`4A`,"Unicode dec":`11141`,"Unicode hex":`2B85`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`75`,"Dingbat hex":`4B`,"Unicode dec":`11143`,"Unicode hex":`2B87`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`76`,"Dingbat hex":`4C`,"Unicode dec":`11151`,"Unicode hex":`2B8F`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`77`,"Dingbat hex":`4D`,"Unicode dec":`11149`,"Unicode hex":`2B8D`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`78`,"Dingbat hex":`4E`,"Unicode dec":`11150`,"Unicode hex":`2B8E`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`79`,"Dingbat hex":`4F`,"Unicode dec":`11148`,"Unicode hex":`2B8C`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`80`,"Dingbat hex":`50`,"Unicode dec":`11118`,"Unicode hex":`2B6E`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`81`,"Dingbat hex":`51`,"Unicode dec":`11119`,"Unicode hex":`2B6F`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`82`,"Dingbat hex":`52`,"Unicode dec":`9099`,"Unicode hex":`238B`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`83`,"Dingbat hex":`53`,"Unicode dec":`8996`,"Unicode hex":`2324`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`84`,"Dingbat hex":`54`,"Unicode dec":`8963`,"Unicode hex":`2303`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`85`,"Dingbat hex":`55`,"Unicode dec":`8997`,"Unicode hex":`2325`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`86`,"Dingbat hex":`56`,"Unicode dec":`9251`,"Unicode hex":`2423`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`87`,"Dingbat hex":`57`,"Unicode dec":`9085`,"Unicode hex":`237D`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`88`,"Dingbat hex":`58`,"Unicode dec":`8682`,"Unicode hex":`21EA`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`89`,"Dingbat hex":`59`,"Unicode dec":`11192`,"Unicode hex":`2BB8`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`90`,"Dingbat hex":`5A`,"Unicode dec":`129184`,"Unicode hex":`1F8A0`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`91`,"Dingbat hex":`5B`,"Unicode dec":`129185`,"Unicode hex":`1F8A1`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`92`,"Dingbat hex":`5C`,"Unicode dec":`129186`,"Unicode hex":`1F8A2`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`93`,"Dingbat hex":`5D`,"Unicode dec":`129187`,"Unicode hex":`1F8A3`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`94`,"Dingbat hex":`5E`,"Unicode dec":`129188`,"Unicode hex":`1F8A4`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`95`,"Dingbat hex":`5F`,"Unicode dec":`129189`,"Unicode hex":`1F8A5`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`96`,"Dingbat hex":`60`,"Unicode dec":`129190`,"Unicode hex":`1F8A6`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`97`,"Dingbat hex":`61`,"Unicode dec":`129191`,"Unicode hex":`1F8A7`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`98`,"Dingbat hex":`62`,"Unicode dec":`129192`,"Unicode hex":`1F8A8`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`99`,"Dingbat hex":`63`,"Unicode dec":`129193`,"Unicode hex":`1F8A9`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`100`,"Dingbat hex":`64`,"Unicode dec":`129194`,"Unicode hex":`1F8AA`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`101`,"Dingbat hex":`65`,"Unicode dec":`129195`,"Unicode hex":`1F8AB`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`102`,"Dingbat hex":`66`,"Unicode dec":`129104`,"Unicode hex":`1F850`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`103`,"Dingbat hex":`67`,"Unicode dec":`129106`,"Unicode hex":`1F852`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`104`,"Dingbat hex":`68`,"Unicode dec":`129105`,"Unicode hex":`1F851`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`105`,"Dingbat hex":`69`,"Unicode dec":`129107`,"Unicode hex":`1F853`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`106`,"Dingbat hex":`6A`,"Unicode dec":`129108`,"Unicode hex":`1F854`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`107`,"Dingbat hex":`6B`,"Unicode dec":`129109`,"Unicode hex":`1F855`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`108`,"Dingbat hex":`6C`,"Unicode dec":`129111`,"Unicode hex":`1F857`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`109`,"Dingbat hex":`6D`,"Unicode dec":`129110`,"Unicode hex":`1F856`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`110`,"Dingbat hex":`6E`,"Unicode dec":`129112`,"Unicode hex":`1F858`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`111`,"Dingbat hex":`6F`,"Unicode dec":`129113`,"Unicode hex":`1F859`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`112`,"Dingbat hex":`70`,"Unicode dec":`9650`,"Unicode hex":`25B2`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`113`,"Dingbat hex":`71`,"Unicode dec":`9660`,"Unicode hex":`25BC`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`114`,"Dingbat hex":`72`,"Unicode dec":`9651`,"Unicode hex":`25B3`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`115`,"Dingbat hex":`73`,"Unicode dec":`9661`,"Unicode hex":`25BD`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`116`,"Dingbat hex":`74`,"Unicode dec":`9664`,"Unicode hex":`25C0`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`117`,"Dingbat hex":`75`,"Unicode dec":`9654`,"Unicode hex":`25B6`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`118`,"Dingbat hex":`76`,"Unicode dec":`9665`,"Unicode hex":`25C1`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`119`,"Dingbat hex":`77`,"Unicode dec":`9655`,"Unicode hex":`25B7`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`120`,"Dingbat hex":`78`,"Unicode dec":`9699`,"Unicode hex":`25E3`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`121`,"Dingbat hex":`79`,"Unicode dec":`9698`,"Unicode hex":`25E2`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`122`,"Dingbat hex":`7A`,"Unicode dec":`9700`,"Unicode hex":`25E4`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`123`,"Dingbat hex":`7B`,"Unicode dec":`9701`,"Unicode hex":`25E5`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`124`,"Dingbat hex":`7C`,"Unicode dec":`128896`,"Unicode hex":`1F780`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`125`,"Dingbat hex":`7D`,"Unicode dec":`128898`,"Unicode hex":`1F782`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`126`,"Dingbat hex":`7E`,"Unicode dec":`128897`,"Unicode hex":`1F781`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`128`,"Dingbat hex":`80`,"Unicode dec":`128899`,"Unicode hex":`1F783`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`129`,"Dingbat hex":`81`,"Unicode dec":`11205`,"Unicode hex":`2BC5`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`130`,"Dingbat hex":`82`,"Unicode dec":`11206`,"Unicode hex":`2BC6`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`131`,"Dingbat hex":`83`,"Unicode dec":`11207`,"Unicode hex":`2BC7`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`132`,"Dingbat hex":`84`,"Unicode dec":`11208`,"Unicode hex":`2BC8`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`133`,"Dingbat hex":`85`,"Unicode dec":`11164`,"Unicode hex":`2B9C`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`134`,"Dingbat hex":`86`,"Unicode dec":`11166`,"Unicode hex":`2B9E`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`135`,"Dingbat hex":`87`,"Unicode dec":`11165`,"Unicode hex":`2B9D`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`136`,"Dingbat hex":`88`,"Unicode dec":`11167`,"Unicode hex":`2B9F`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`137`,"Dingbat hex":`89`,"Unicode dec":`129040`,"Unicode hex":`1F810`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`138`,"Dingbat hex":`8A`,"Unicode dec":`129042`,"Unicode hex":`1F812`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`139`,"Dingbat hex":`8B`,"Unicode dec":`129041`,"Unicode hex":`1F811`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`140`,"Dingbat hex":`8C`,"Unicode dec":`129043`,"Unicode hex":`1F813`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`141`,"Dingbat hex":`8D`,"Unicode dec":`129044`,"Unicode hex":`1F814`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`142`,"Dingbat hex":`8E`,"Unicode dec":`129046`,"Unicode hex":`1F816`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`143`,"Dingbat hex":`8F`,"Unicode dec":`129045`,"Unicode hex":`1F815`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`144`,"Dingbat hex":`90`,"Unicode dec":`129047`,"Unicode hex":`1F817`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`145`,"Dingbat hex":`91`,"Unicode dec":`129048`,"Unicode hex":`1F818`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`146`,"Dingbat hex":`92`,"Unicode dec":`129050`,"Unicode hex":`1F81A`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`147`,"Dingbat hex":`93`,"Unicode dec":`129049`,"Unicode hex":`1F819`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`148`,"Dingbat hex":`94`,"Unicode dec":`129051`,"Unicode hex":`1F81B`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`149`,"Dingbat hex":`95`,"Unicode dec":`129052`,"Unicode hex":`1F81C`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`150`,"Dingbat hex":`96`,"Unicode dec":`129054`,"Unicode hex":`1F81E`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`151`,"Dingbat hex":`97`,"Unicode dec":`129053`,"Unicode hex":`1F81D`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`152`,"Dingbat hex":`98`,"Unicode dec":`129055`,"Unicode hex":`1F81F`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`153`,"Dingbat hex":`99`,"Unicode dec":`129024`,"Unicode hex":`1F800`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`154`,"Dingbat hex":`9A`,"Unicode dec":`129026`,"Unicode hex":`1F802`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`155`,"Dingbat hex":`9B`,"Unicode dec":`129025`,"Unicode hex":`1F801`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`156`,"Dingbat hex":`9C`,"Unicode dec":`129027`,"Unicode hex":`1F803`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`157`,"Dingbat hex":`9D`,"Unicode dec":`129028`,"Unicode hex":`1F804`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`158`,"Dingbat hex":`9E`,"Unicode dec":`129030`,"Unicode hex":`1F806`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`159`,"Dingbat hex":`9F`,"Unicode dec":`129029`,"Unicode hex":`1F805`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`160`,"Dingbat hex":`A0`,"Unicode dec":`129031`,"Unicode hex":`1F807`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`161`,"Dingbat hex":`A1`,"Unicode dec":`129032`,"Unicode hex":`1F808`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`162`,"Dingbat hex":`A2`,"Unicode dec":`129034`,"Unicode hex":`1F80A`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`163`,"Dingbat hex":`A3`,"Unicode dec":`129033`,"Unicode hex":`1F809`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`164`,"Dingbat hex":`A4`,"Unicode dec":`129035`,"Unicode hex":`1F80B`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`165`,"Dingbat hex":`A5`,"Unicode dec":`129056`,"Unicode hex":`1F820`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`166`,"Dingbat hex":`A6`,"Unicode dec":`129058`,"Unicode hex":`1F822`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`167`,"Dingbat hex":`A7`,"Unicode dec":`129060`,"Unicode hex":`1F824`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`168`,"Dingbat hex":`A8`,"Unicode dec":`129062`,"Unicode hex":`1F826`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`169`,"Dingbat hex":`A9`,"Unicode dec":`129064`,"Unicode hex":`1F828`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`170`,"Dingbat hex":`AA`,"Unicode dec":`129066`,"Unicode hex":`1F82A`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`171`,"Dingbat hex":`AB`,"Unicode dec":`129068`,"Unicode hex":`1F82C`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`172`,"Dingbat hex":`AC`,"Unicode dec":`129180`,"Unicode hex":`1F89C`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`173`,"Dingbat hex":`AD`,"Unicode dec":`129181`,"Unicode hex":`1F89D`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`174`,"Dingbat hex":`AE`,"Unicode dec":`129182`,"Unicode hex":`1F89E`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`175`,"Dingbat hex":`AF`,"Unicode dec":`129183`,"Unicode hex":`1F89F`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`176`,"Dingbat hex":`B0`,"Unicode dec":`129070`,"Unicode hex":`1F82E`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`177`,"Dingbat hex":`B1`,"Unicode dec":`129072`,"Unicode hex":`1F830`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`178`,"Dingbat hex":`B2`,"Unicode dec":`129074`,"Unicode hex":`1F832`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`179`,"Dingbat hex":`B3`,"Unicode dec":`129076`,"Unicode hex":`1F834`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`180`,"Dingbat hex":`B4`,"Unicode dec":`129078`,"Unicode hex":`1F836`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`181`,"Dingbat hex":`B5`,"Unicode dec":`129080`,"Unicode hex":`1F838`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`182`,"Dingbat hex":`B6`,"Unicode dec":`129082`,"Unicode hex":`1F83A`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`183`,"Dingbat hex":`B7`,"Unicode dec":`129081`,"Unicode hex":`1F839`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`184`,"Dingbat hex":`B8`,"Unicode dec":`129083`,"Unicode hex":`1F83B`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`185`,"Dingbat hex":`B9`,"Unicode dec":`129176`,"Unicode hex":`1F898`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`186`,"Dingbat hex":`BA`,"Unicode dec":`129178`,"Unicode hex":`1F89A`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`187`,"Dingbat hex":`BB`,"Unicode dec":`129177`,"Unicode hex":`1F899`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`188`,"Dingbat hex":`BC`,"Unicode dec":`129179`,"Unicode hex":`1F89B`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`189`,"Dingbat hex":`BD`,"Unicode dec":`129084`,"Unicode hex":`1F83C`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`190`,"Dingbat hex":`BE`,"Unicode dec":`129086`,"Unicode hex":`1F83E`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`191`,"Dingbat hex":`BF`,"Unicode dec":`129085`,"Unicode hex":`1F83D`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`192`,"Dingbat hex":`C0`,"Unicode dec":`129087`,"Unicode hex":`1F83F`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`193`,"Dingbat hex":`C1`,"Unicode dec":`129088`,"Unicode hex":`1F840`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`194`,"Dingbat hex":`C2`,"Unicode dec":`129090`,"Unicode hex":`1F842`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`195`,"Dingbat hex":`C3`,"Unicode dec":`129089`,"Unicode hex":`1F841`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`196`,"Dingbat hex":`C4`,"Unicode dec":`129091`,"Unicode hex":`1F843`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`197`,"Dingbat hex":`C5`,"Unicode dec":`129092`,"Unicode hex":`1F844`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`198`,"Dingbat hex":`C6`,"Unicode dec":`129094`,"Unicode hex":`1F846`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`199`,"Dingbat hex":`C7`,"Unicode dec":`129093`,"Unicode hex":`1F845`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`200`,"Dingbat hex":`C8`,"Unicode dec":`129095`,"Unicode hex":`1F847`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`201`,"Dingbat hex":`C9`,"Unicode dec":`11176`,"Unicode hex":`2BA8`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`202`,"Dingbat hex":`CA`,"Unicode dec":`11177`,"Unicode hex":`2BA9`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`203`,"Dingbat hex":`CB`,"Unicode dec":`11178`,"Unicode hex":`2BAA`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`204`,"Dingbat hex":`CC`,"Unicode dec":`11179`,"Unicode hex":`2BAB`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`205`,"Dingbat hex":`CD`,"Unicode dec":`11180`,"Unicode hex":`2BAC`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`206`,"Dingbat hex":`CE`,"Unicode dec":`11181`,"Unicode hex":`2BAD`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`207`,"Dingbat hex":`CF`,"Unicode dec":`11182`,"Unicode hex":`2BAE`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`208`,"Dingbat hex":`D0`,"Unicode dec":`11183`,"Unicode hex":`2BAF`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`209`,"Dingbat hex":`D1`,"Unicode dec":`129120`,"Unicode hex":`1F860`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`210`,"Dingbat hex":`D2`,"Unicode dec":`129122`,"Unicode hex":`1F862`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`211`,"Dingbat hex":`D3`,"Unicode dec":`129121`,"Unicode hex":`1F861`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`212`,"Dingbat hex":`D4`,"Unicode dec":`129123`,"Unicode hex":`1F863`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`213`,"Dingbat hex":`D5`,"Unicode dec":`129124`,"Unicode hex":`1F864`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`214`,"Dingbat hex":`D6`,"Unicode dec":`129125`,"Unicode hex":`1F865`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`215`,"Dingbat hex":`D7`,"Unicode dec":`129127`,"Unicode hex":`1F867`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`216`,"Dingbat hex":`D8`,"Unicode dec":`129126`,"Unicode hex":`1F866`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`217`,"Dingbat hex":`D9`,"Unicode dec":`129136`,"Unicode hex":`1F870`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`218`,"Dingbat hex":`DA`,"Unicode dec":`129138`,"Unicode hex":`1F872`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`219`,"Dingbat hex":`DB`,"Unicode dec":`129137`,"Unicode hex":`1F871`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`220`,"Dingbat hex":`DC`,"Unicode dec":`129139`,"Unicode hex":`1F873`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`221`,"Dingbat hex":`DD`,"Unicode dec":`129140`,"Unicode hex":`1F874`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`222`,"Dingbat hex":`DE`,"Unicode dec":`129141`,"Unicode hex":`1F875`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`223`,"Dingbat hex":`DF`,"Unicode dec":`129143`,"Unicode hex":`1F877`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`224`,"Dingbat hex":`E0`,"Unicode dec":`129142`,"Unicode hex":`1F876`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`225`,"Dingbat hex":`E1`,"Unicode dec":`129152`,"Unicode hex":`1F880`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`226`,"Dingbat hex":`E2`,"Unicode dec":`129154`,"Unicode hex":`1F882`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`227`,"Dingbat hex":`E3`,"Unicode dec":`129153`,"Unicode hex":`1F881`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`228`,"Dingbat hex":`E4`,"Unicode dec":`129155`,"Unicode hex":`1F883`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`229`,"Dingbat hex":`E5`,"Unicode dec":`129156`,"Unicode hex":`1F884`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`230`,"Dingbat hex":`E6`,"Unicode dec":`129157`,"Unicode hex":`1F885`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`231`,"Dingbat hex":`E7`,"Unicode dec":`129159`,"Unicode hex":`1F887`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`232`,"Dingbat hex":`E8`,"Unicode dec":`129158`,"Unicode hex":`1F886`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`233`,"Dingbat hex":`E9`,"Unicode dec":`129168`,"Unicode hex":`1F890`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`234`,"Dingbat hex":`EA`,"Unicode dec":`129170`,"Unicode hex":`1F892`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`235`,"Dingbat hex":`EB`,"Unicode dec":`129169`,"Unicode hex":`1F891`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`236`,"Dingbat hex":`EC`,"Unicode dec":`129171`,"Unicode hex":`1F893`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`237`,"Dingbat hex":`ED`,"Unicode dec":`129172`,"Unicode hex":`1F894`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`238`,"Dingbat hex":`EE`,"Unicode dec":`129174`,"Unicode hex":`1F896`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`239`,"Dingbat hex":`EF`,"Unicode dec":`129173`,"Unicode hex":`1F895`},{"Typeface name":`Wingdings 3`,"Dingbat dec":`240`,"Dingbat hex":`F0`,"Unicode dec":`129175`,"Unicode hex":`1F897`}]})),oW=s((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.hex=e.dec=e.codePoint=void 0;for(var n=t(aW()),r={},i=String.fromCodePoint?String.fromCodePoint:p,a=0,o=n.default;a<o.length;a++){var s=o[a],c=parseInt(s[`Unicode dec`],10),l={codePoint:c,string:i(c)};r[s[`Typeface name`].toUpperCase()+`_`+s[`Dingbat dec`]]=l}function u(e,t){return r[e.toUpperCase()+`_`+t]}e.codePoint=u;function d(e,t){return u(e,parseInt(t,10))}e.dec=d;function f(e,t){return u(e,parseInt(t,16))}e.hex=f;function p(e){if(e<=65535)return String.fromCharCode(e);var t=Math.floor((e-65536)/1024)+55296,n=(e-65536)%1024+56320;return String.fromCharCode(t,n)}})),sW=s((e=>{var t=(IH(),d(FH));e.paragraph=n,e.run=r,e._elements=a,e._elementsOfType=i,e.getDescendantsOfType=o,e.getDescendants=s;function n(e){return i(`paragraph`,e)}function r(e){return i(`run`,e)}function i(e,t){return a(function(n){return n.type===e?t(n):n})}function a(e){return function n(r){if(r.children){var i=t.map(r.children,n);r=t.extend(r,{children:i})}return e(r)}}function o(e,t){return s(e).filter(function(e){return e.type===t})}function s(e){var t=[];return c(e,function(e){t.push(e)}),t}function c(e,t){e.children&&e.children.forEach(function(e){c(e,t),t(e)})}})),cW=s((e=>{e.uriToZipEntryName=t,e.replaceFragment=n;function t(e,t){return t.charAt(0)===`/`?t.substr(1):e+`/`+t}function n(e,t){var n=e.indexOf(`#`);return n!==-1&&(e=e.substring(0,n)),e+`#`+t}})),lW=s((e=>{e.createBodyReader=l,e._readNumberingProperties=f;var t=oW(),n=(IH(),d(FH)),r=yU(),i=bU().Result,a=bU().warning,o=rW(),s=sW(),c=cW();function l(e){return{readXmlElement:function(t){return new u(e).readXmlElement(t)},readXmlElements:function(t){return new u(e).readXmlElements(t)}}}function u(e){var i=[],l=[],u=[],d=e.relationships,x=e.contentTypes,S=e.docxFile,C=e.files,w=e.numbering,T=e.styles;function E(e){return b(e.map(D))}function D(e){if(e.type===`element`){var t=ae[e.name];if(t)return t(e);if(!Object.prototype.hasOwnProperty.call(m,e.name))return h([a(`An unrecognised element was ignored: `+e.name)])}return g()}function O(e){return F(e).map(function(t){return{type:`paragraphProperties`,styleId:t.styleId,styleName:t.name,alignment:e.firstOrEmpty(`w:jc`).attributes[`w:val`],numbering:f(t.styleId,e.firstOrEmpty(`w:numPr`),w),indent:k(e.firstOrEmpty(`w:ind`))}})}function k(e){return{start:e.attributes[`w:start`]||e.attributes[`w:left`],end:e.attributes[`w:end`]||e.attributes[`w:right`],firstLine:e.attributes[`w:firstLine`],hanging:e.attributes[`w:hanging`]}}function A(e){return I(e).map(function(t){var n=e.firstOrEmpty(`w:sz`).attributes[`w:val`],r=/^[0-9]+$/.test(n)?parseInt(n,10)/2:null;return{type:`runProperties`,styleId:t.styleId,styleName:t.name,verticalAlignment:e.firstOrEmpty(`w:vertAlign`).attributes[`w:val`],font:e.firstOrEmpty(`w:rFonts`).attributes[`w:ascii`],fontSize:r,isBold:M(e.first(`w:b`)),isUnderline:j(e.first(`w:u`)),isItalic:M(e.first(`w:i`)),isStrikethrough:M(e.first(`w:strike`)),isAllCaps:M(e.first(`w:caps`)),isSmallCaps:M(e.first(`w:smallCaps`)),highlight:P(e.firstOrEmpty(`w:highlight`).attributes[`w:val`])}})}function j(e){if(e){var t=e.attributes[`w:val`];return t!==void 0&&t!==`false`&&t!==`0`&&t!==`none`}else return!1}function M(e){if(e){var t=e.attributes[`w:val`];return t!==`false`&&t!==`0`}else return!1}function N(e){return e!==`false`&&e!==`0`}function P(e){return!e||e===`none`?null:e}function F(e){return R(e,`w:pStyle`,`Paragraph`,T.findParagraphStyleById)}function I(e){return R(e,`w:rStyle`,`Run`,T.findCharacterStyleById)}function L(e){return R(e,`w:tblStyle`,`Table`,T.findTableStyleById)}function R(e,t,n,r){var i=[],a=e.first(t),o=null,s=null;if(a&&(o=a.attributes[`w:val`],o)){var c=r(o);c?s=c.name:i.push(be(n,o))}return v({styleId:o,name:s},i)}function z(e){var t=e.attributes[`w:fldCharType`];if(t===`begin`)i.push({type:`begin`,fldChar:e}),l=[];else if(t===`end`){var n=i.pop();if(n.type===`begin`&&(n=ee(n)),n.type===`checkbox`)return _(r.checkbox({checked:n.checked}))}else if(t===`separate`){var a=ee(i.pop());i.push(a)}return g()}function B(){var e=n.last(i.filter(function(e){return e.type===`hyperlink`}));return e?e.options:null}function ee(e){return te(l.join(``),e.type===`begin`?e.fldChar:o.emptyElement)}function te(e,t){var n=/^\s*HYPERLINK\s+(\\l\s+)?(?:"(.*)"|([^\\]\S*))/.exec(e);if(n){var r=n[2]===void 0?n[3]:n[2];return{type:`hyperlink`,options:n[1]===void 0?{href:r}:{anchor:r}}}if(/\s*FORMCHECKBOX\s*/.exec(e)){var i=t.firstOrEmpty(`w:ffData`).firstOrEmpty(`w:checkBox`);return{type:`checkbox`,checked:M(i.first(`w:checked`)??i.first(`w:default`))}}return{type:`unknown`}}function ne(e){return l.push(e.text()),g()}function re(e){var n=e.attributes[`w:font`],i=e.attributes[`w:char`],o=t.hex(n,i);return o==null&&/^F0..$/.test(i)&&(o=t.hex(n,i.substring(2))),o==null?h([a(`A w:sym element with an unsupported character was ignored: char `+i+` in font `+n)]):_(new r.Text(o.string))}function ie(e){return function(t){var n=t.attributes[`w:id`];return _(new r.NoteReference({noteType:e,noteId:n}))}}function V(e){return _(r.commentReference({commentId:e.attributes[`w:id`]}))}function H(e){return E(e.children)}var ae={"w:p":function(e){var t=e.firstOrEmpty(`w:pPr`);if(t.firstOrEmpty(`w:rPr`).first(`w:del`))return e.children.forEach(function(e){u.push(e)}),g();var n=e.children;return u.length>0&&(n=u.concat(n),u=[]),y.map(O(t),E(n),function(e,t){return new r.Paragraph(t,e)}).insertExtra()},"w:r":function(e){return y.map(A(e.firstOrEmpty(`w:rPr`)),E(e.children),function(e,t){var n=B();return n!==null&&(t=[new r.Hyperlink(t,n)]),new r.Run(t,e)})},"w:fldChar":z,"w:instrText":ne,"w:t":function(e){return _(new r.Text(e.text()))},"w:tab":function(e){return _(new r.Tab)},"w:noBreakHyphen":function(){return _(new r.Text(`‑`))},"w:softHyphen":function(e){return _(new r.Text(``))},"w:sym":re,"w:hyperlink":function(e){var t=e.attributes[`r:id`],i=e.attributes[`w:anchor`];return E(e.children).map(function(a){function o(t){var i=e.attributes[`w:tgtFrame`]||null;return new r.Hyperlink(a,n.extend({targetFrame:i},t))}if(t){var s=d.findTargetByRelationshipId(t);return i&&(s=c.replaceFragment(s,i)),o({href:s})}else if(i)return o({anchor:i});else return a})},"w:tbl":oe,"w:tr":ce,"w:tc":le,"w:footnoteReference":ie(`footnote`),"w:endnoteReference":ie(`endnote`),"w:commentReference":V,"w:br":function(e){var t=e.attributes[`w:type`];return t==null||t===`textWrapping`?_(r.lineBreak):t===`page`?_(r.pageBreak):t===`column`?_(r.columnBreak):h([a(`Unsupported break type: `+t)])},"w:bookmarkStart":function(e){var t=e.attributes[`w:name`];return t===`_GoBack`?g():_(new r.BookmarkStart({name:t}))},"mc:AlternateContent":function(e){return H(e.firstOrEmpty(`mc:Fallback`))},"w:sdt":function(e){return E(e.firstOrEmpty(`w:sdtContent`).children).map(function(t){var n=e.firstOrEmpty(`w:sdtPr`).first(`wordml:checkbox`);if(n){var i=n.first(`wordml:checked`),a=!!i&&N(i.attributes[`wordml:val`]),o=r.checkbox({checked:a}),c=!1,l=t.map(s._elementsOfType(r.types.text,function(e){return e.value.length>0&&!c?(c=!0,o):e}));return c?l:o}else return t})},"w:ins":H,"w:object":H,"w:smartTag":H,"w:drawing":H,"w:pict":function(e){return H(e).toExtra()},"v:roundrect":H,"v:shape":H,"v:textbox":H,"w:txbxContent":H,"wp:inline":pe,"wp:anchor":pe,"v:imagedata":_e,"v:group":H,"v:rect":H};return{readXmlElement:D,readXmlElements:E};function oe(e){var t=se(e.firstOrEmpty(`w:tblPr`));return E(e.children).flatMap(de).flatMap(function(e){return t.map(function(t){return r.Table(e,t)})})}function se(e){return L(e).map(function(e){return{styleId:e.styleId,styleName:e.name}})}function ce(e){var t=e.firstOrEmpty(`w:trPr`);if(t.first(`w:del`))return g();var n=!!t.first(`w:tblHeader`);return E(e.children).map(function(e){return r.TableRow(e,{isHeader:n})})}function le(e){return E(e.children).map(function(t){var n=e.firstOrEmpty(`w:tcPr`),i=n.firstOrEmpty(`w:gridSpan`).attributes[`w:val`],a=i?parseInt(i,10):1,o=r.TableCell(t,{colSpan:a});return o._vMerge=ue(n),o})}function ue(e){var t=e.first(`w:vMerge`);if(t){var n=t.attributes[`w:val`];return n===`continue`||!n}else return null}function de(e){if(n.any(e,function(e){return e.type!==r.types.tableRow}))return fe(e),v(e,[a(`unexpected non-row element in table, cell merging may be incorrect`)]);if(n.any(e,function(e){return n.any(e.children,function(e){return e.type!==r.types.tableCell})}))return fe(e),v(e,[a(`unexpected non-cell element in table row, cell merging may be incorrect`)]);var t={};return e.forEach(function(e){var n=0;e.children.forEach(function(e){e._vMerge&&t[n]?t[n].rowSpan++:(t[n]=e,e._vMerge=!1),n+=e.colSpan})}),e.forEach(function(e){e.children=e.children.filter(function(e){return!e._vMerge}),e.children.forEach(function(e){delete e._vMerge})}),_(e)}function fe(e){e.forEach(function(e){s.getDescendantsOfType(e,r.types.tableCell).forEach(function(e){delete e._vMerge})})}function pe(e){return b(e.getElementsByTagName(`a:graphic`).getElementsByTagName(`a:graphicData`).getElementsByTagName(`pic:pic`).getElementsByTagName(`pic:blipFill`).getElementsByTagName(`a:blip`).map(me.bind(null,e)))}function me(e,t){var n=e.firstOrEmpty(`wp:docPr`),i=n.attributes,o=he(i.descr)?i.title:i.descr,s=ge(t);return s===null?h([a(`Could not find image file for a:blip element`)]):ye(s,o).map(function(e){var t=n.firstOrEmpty(`a:hlinkClick`).attributes[`r:id`];if(t){var i=d.findTargetByRelationshipId(t);return new r.Hyperlink([e],{href:i})}else return e})}function he(e){return e==null||/^\s*$/.test(e)}function ge(e){var t=e.attributes[`r:embed`],n=e.attributes[`r:link`];if(t)return ve(t);if(n){var r=d.findTargetByRelationshipId(n);return{path:r,read:C.read.bind(C,r)}}else return null}function _e(e){var t=e.attributes[`r:id`];return t?ye(ve(t),e.attributes[`o:title`]):h([a(`A v:imagedata element without a relationship ID was ignored`)])}function ve(e){var t=c.uriToZipEntryName(`word`,d.findTargetByRelationshipId(e));return{path:t,read:S.read.bind(S,t)}}function ye(e,t){var n=x.findContentType(e.path);return v(r.Image({readImage:e.read,altText:t,contentType:n}),p[n]?[]:a(`Image of type `+n+` is unlikely to display in web browsers`))}function be(e,t){return a(e+` style with ID `+t+` was referenced but not defined in the document`)}}function f(e,t,n){var r=t.firstOrEmpty(`w:ilvl`).attributes[`w:val`],i=t.firstOrEmpty(`w:numId`).attributes[`w:val`];if(r!==void 0&&i!==void 0)return n.findLevel(i,r);if(e!=null){var a=n.findLevelByParagraphStyleId(e);if(a!=null)return a}return i===void 0?null:n.findLevel(i,`0`)}var p={"image/png":!0,"image/gif":!0,"image/jpeg":!0,"image/svg+xml":!0,"image/tiff":!0},m={"office-word:wrap":!0,"v:shadow":!0,"v:shapetype":!0,"w:annotationRef":!0,"w:bookmarkEnd":!0,"w:sectPr":!0,"w:proofErr":!0,"w:lastRenderedPageBreak":!0,"w:commentRangeStart":!0,"w:commentRangeEnd":!0,"w:del":!0,"w:footnoteRef":!0,"w:endnoteRef":!0,"w:pPr":!0,"w:rPr":!0,"w:tblPr":!0,"w:tblGrid":!0,"w:trPr":!0,"w:tcPr":!0};function h(e){return new y(null,null,e)}function g(){return new y(null)}function _(e){return new y(e)}function v(e,t){return new y(e,null,t)}function y(e,t,n){this.value=e||[],this.extra=t||[],this._result=new i({element:this.value,extra:t},n),this.messages=this._result.messages}y.prototype.toExtra=function(){return new y(null,x(this.extra,this.value),this.messages)},y.prototype.insertExtra=function(){var e=this.extra;return e&&e.length?new y(x(this.value,e),null,this.messages):this},y.prototype.map=function(e){var t=this._result.map(function(t){return e(t.element)});return new y(t.value,this.extra,t.messages)},y.prototype.flatMap=function(e){var t=this._result.flatMap(function(t){return e(t.element)._result});return new y(t.value.element,x(this.extra,t.value.extra),t.messages)},y.map=function(e,t,n){return new y(n(e.value,t.value),x(e.extra,t.extra),e.messages.concat(t.messages))};function b(e){var t=i.combine(n.pluck(e,`_result`));return new y(n.flatten(n.pluck(t.value,`element`)),n.filter(n.flatten(n.pluck(t.value,`extra`)),S),t.messages)}function x(e,t){return n.flatten([e,t])}function S(e){return e}})),uW=s((e=>{e.DocumentXmlReader=r;var t=yU(),n=bU().Result;function r(e){var r=e.bodyReader;function i(i){var a=i.first(`w:body`);if(a==null)throw Error(`Could not find the body element: are you sure this is a docx file?`);var o=r.readXmlElements(a.children).map(function(n){return new t.Document(n,{notes:e.notes,comments:e.comments})});return new n(o.value,o.messages)}return{convertXmlToDocument:i}}})),dW=s((e=>{e.readRelationships=t,e.defaultValue=new n([]),e.Relationships=n;function t(e){var t=[];return e.children.forEach(function(e){if(e.name===`relationships:Relationship`){var n={relationshipId:e.attributes.Id,target:e.attributes.Target,type:e.attributes.Type};t.push(n)}}),new n(t)}function n(e){var t={};e.forEach(function(e){t[e.relationshipId]=e.target});var n={};return e.forEach(function(e){n[e.type]||(n[e.type]=[]),n[e.type].push(e.target)}),{findTargetByRelationshipId:function(e){return t[e]},findTargetsByType:function(e){return n[e]||[]}}}})),fW=s((e=>{e.readContentTypesFromXml=n;var t={png:`png`,gif:`gif`,jpeg:`jpeg`,jpg:`jpeg`,tif:`tiff`,tiff:`tiff`,bmp:`bmp`};e.defaultContentTypes=r({},{});function n(e){var t={},n={};return e.children.forEach(function(e){if(e.name===`content-types:Default`&&(t[e.attributes.Extension]=e.attributes.ContentType),e.name===`content-types:Override`){var r=e.attributes.PartName;r.charAt(0)===`/`&&(r=r.substring(1)),n[r]=e.attributes.ContentType}}),r(n,t)}function r(e,n){return{findContentType:function(r){var i=e[r];if(i)return i;var a=r.split(`.`),o=a[a.length-1];if(n.hasOwnProperty(o))return n[o];var s=t[o.toLowerCase()];return s?`image/`+s:null}}}})),pW=s((e=>{var t=(IH(),d(FH));e.readNumberingXml=r,e.Numbering=n,e.defaultNumbering=new n({},{});function n(e,n,r){var i=t.flatten(t.values(n).map(function(e){return t.values(e.levels)})),a=t.indexBy(i.filter(function(e){return e.paragraphStyleId!=null}),`paragraphStyleId`);function o(t,i){var a=e[t];if(a){var s=n[a.abstractNumId];return s?s.numStyleLink==null?n[a.abstractNumId].levels[i]:o(r.findNumberingStyleById(s.numStyleLink).numId,i):null}else return null}function s(e){return a[e]||null}return{findLevel:o,findLevelByParagraphStyleId:s}}function r(e,t){if(!t||!t.styles)throw Error(`styles is missing`);var r=i(e);return new n(o(e,r),r,t.styles)}function i(e){var t={};return e.getElementsByTagName(`w:abstractNum`).forEach(function(e){var n=e.attributes[`w:abstractNumId`];t[n]=a(e)}),t}function a(e){var t={},n=null;return e.getElementsByTagName(`w:lvl`).forEach(function(e){var r=e.attributes[`w:ilvl`],i=e.firstOrEmpty(`w:numFmt`).attributes[`w:val`]!==`bullet`,a=e.firstOrEmpty(`w:pStyle`).attributes[`w:val`];r===void 0?n={isOrdered:i,level:`0`,paragraphStyleId:a}:t[r]={isOrdered:i,level:r,paragraphStyleId:a}}),n!==null&&t[n.level]===void 0&&(t[n.level]=n),{levels:t,numStyleLink:e.firstOrEmpty(`w:numStyleLink`).attributes[`w:val`]}}function o(e){var t={};return e.getElementsByTagName(`w:num`).forEach(function(e){var n=e.attributes[`w:numId`];t[n]={abstractNumId:e.first(`w:abstractNumId`).attributes[`w:val`]}}),t}})),mW=s((e=>{e.readStylesXml=n,e.Styles=t,e.defaultStyles=new t({},{});function t(e,t,n,r){return{findParagraphStyleById:function(t){return e[t]},findCharacterStyleById:function(e){return t[e]},findTableStyleById:function(e){return n[e]},findNumberingStyleById:function(e){return r[e]}}}t.EMPTY=new t({},{},{},{});function n(e){var n={},i={},a={},o={},s={paragraph:n,character:i,table:a,numbering:o};return e.getElementsByTagName(`w:style`).forEach(function(e){var t=r(e),n=s[t.type];n&&n[t.styleId]===void 0&&(n[t.styleId]=t)}),new t(n,i,a,o)}function r(e){var t=e.attributes[`w:type`];return t===`numbering`?a(t,e):{type:t,styleId:o(e),name:i(e)}}function i(e){var t=e.first(`w:name`);return t?t.attributes[`w:val`]:null}function a(e,t){var n=o(t);return{type:e,numId:t.firstOrEmpty(`w:pPr`).firstOrEmpty(`w:numPr`).firstOrEmpty(`w:numId`).attributes[`w:val`],styleId:n}}function o(e){return e.attributes[`w:styleId`]}})),hW=s((e=>{var t=yU(),n=bU().Result;e.createFootnotesReader=r.bind(e,`footnote`),e.createEndnotesReader=r.bind(e,`endnote`);function r(e,r){function i(t){return n.combine(t.getElementsByTagName(`w:`+e).filter(a).map(o))}function a(e){var t=e.attributes[`w:type`];return t!==`continuationSeparator`&&t!==`separator`}function o(n){var i=n.attributes[`w:id`];return r.readXmlElements(n.children).map(function(n){return t.Note({noteType:e,noteId:i,body:n})})}return i}})),gW=s((e=>{var t=yU(),n=bU().Result;function r(e){function r(e){return n.combine(e.getElementsByTagName(`w:comment`).map(i))}function i(n){var r=n.attributes[`w:id`];function i(e){return(n.attributes[e]||``).trim()||null}return e.readXmlElements(n.children).map(function(e){return t.comment({commentId:r,body:e,authorName:i(`w:author`),authorInitials:i(`w:initials`)})})}return r}e.createCommentsReader=r})),_W=s((e=>{var t=vU();e.Files=n;function n(){function e(e){return t.reject(Error(`could not open external image: '`+e+`'
|
|
461
|
+
cannot open linked files from a web browser`))}return{read:e}}})),vW=s((e=>{e.read=h,e._findPartPaths=g;var t=vU(),n=yU(),r=bU().Result,i=CU(),a=iW().readXmlFromZipFile,o=lW().createBodyReader,s=uW().DocumentXmlReader,c=dW(),l=fW(),u=pW(),d=mW(),f=hW(),p=gW(),m=_W().Files;function h(e,i,a){i||={},a||={};var o=new m({externalFileAccess:a.externalFileAccess,relativeToFile:i.path});return t.props({contentTypes:S(e),partPaths:g(e),docxFile:e,files:o}).also(function(t){return{styles:w(e,t.partPaths.styles)}}).also(function(t){return{numbering:C(e,t.partPaths.numbering,t.styles)}}).also(function(e){return{footnotes:b(e.partPaths.footnotes,e,function(e,t){return t?f.createFootnotesReader(e)(t):new r([])}),endnotes:b(e.partPaths.endnotes,e,function(e,t){return t?f.createEndnotesReader(e)(t):new r([])}),comments:b(e.partPaths.comments,e,function(e,t){return t?p.createCommentsReader(e)(t):new r([])})}}).also(function(e){return{notes:e.footnotes.flatMap(function(t){return e.endnotes.map(function(e){return new n.Notes(t.concat(e))})})}}).then(function(e){return b(e.partPaths.mainDocument,e,function(t,n){return e.notes.flatMap(function(r){return e.comments.flatMap(function(e){return new s({bodyReader:t,notes:r,comments:e}).convertXmlToDocument(n)})})})})}function g(e){return T(e).then(function(t){var n=_({docxFile:e,relationships:t,relationshipType:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument`,basePath:``,fallbackPath:`word/document.xml`});if(!e.exists(n))throw Error(`Could not find main document part. Are you sure this is a valid .docx file?`);return y({filename:x(n),readElement:c.readRelationships,defaultValue:c.defaultValue})(e).then(function(t){function r(r){return _({docxFile:e,relationships:t,relationshipType:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/`+r,basePath:i.splitPath(n).dirname,fallbackPath:`word/`+r+`.xml`})}return{mainDocument:n,comments:r(`comments`),endnotes:r(`endnotes`),footnotes:r(`footnotes`),numbering:r(`numbering`),styles:r(`styles`)}})})}function _(e){var t=e.docxFile,n=e.relationships,r=e.relationshipType,a=e.basePath,o=e.fallbackPath,s=n.findTargetsByType(r).map(function(e){return v(i.joinPath(a,e),`/`)}).filter(function(e){return t.exists(e)});return s.length===0?o:s[0]}function v(e,t){return e.substring(0,t.length)===t?e.substring(t.length):e}function y(e){return function(t){return a(t,e.filename).then(function(t){return t?e.readElement(t):e.defaultValue})}}function b(e,t,n){return y({filename:x(e),readElement:c.readRelationships,defaultValue:c.defaultValue})(t.docxFile).then(function(r){var i=new o({relationships:r,contentTypes:t.contentTypes,docxFile:t.docxFile,numbering:t.numbering,styles:t.styles,files:t.files});return a(t.docxFile,e).then(function(e){return n(i,e)})})}function x(e){var t=i.splitPath(e);return i.joinPath(t.dirname,`_rels`,t.basename+`.rels`)}var S=y({filename:`[Content_Types].xml`,readElement:l.readContentTypesFromXml,defaultValue:l.defaultContentTypes});function C(e,t,n){return y({filename:t,readElement:function(e){return u.readNumberingXml(e,{styles:n})},defaultValue:u.defaultNumbering})(e)}function w(e,t){return y({filename:t,readElement:d.readStylesXml,defaultValue:d.defaultStyles})(e)}var T=y({filename:`_rels/.rels`,readElement:c.readRelationships,defaultValue:c.defaultValue})})),yW=s((e=>{var t=(IH(),d(FH)),n=vU(),r=rW();e.writeStyleMap=s,e.readStyleMap=f;var i=`http://schemas.zwobble.org/mammoth/style-map`,a=`mammoth/style-map`,o=`/`+a;function s(e,t){return e.write(a,t),c(e).then(function(){return l(e)})}function c(e){var t=`word/_rels/document.xml.rels`,n=`http://schemas.openxmlformats.org/package/2006/relationships`,a=`{`+n+`}Relationship`;return e.read(t,`utf8`).then(r.readString).then(function(s){var c=s.children;u(c,a,`Id`,{Id:`rMammothStyleMap`,Type:i,Target:o});var l={"":n};return e.write(t,r.writeString(s,l))})}function l(e){var t=`[Content_Types].xml`,n=`http://schemas.openxmlformats.org/package/2006/content-types`,i=`{`+n+`}Override`;return e.read(t,`utf8`).then(r.readString).then(function(a){var s=a.children;u(s,i,`PartName`,{PartName:o,ContentType:`text/prs.mammoth.style-map`});var c={"":n};return e.write(t,r.writeString(a,c))})}function u(e,n,i,a){var o=t.find(e,function(e){return e.name===n&&e.attributes[i]===a[i]});o?o.attributes=a:e.push(r.element(n,a))}function f(e){return e.exists(a)?e.read(a,`utf8`):n.resolve(null)}})),bW=s((e=>{var t=CW();function n(e,n,r){return i(t.element(e,n,{fresh:!1}),r)}function r(e,n,r){return i(t.element(e,n,{fresh:!0}),r)}function i(e,t){return{type:`element`,tag:e,children:t||[]}}function a(e){return{type:`text`,value:e}}e.freshElement=r,e.nonFreshElement=n,e.elementWithTag=i,e.text=a,e.forceWrite={type:`forceWrite`};var o={br:!0,hr:!0,img:!0,input:!0};function s(e){return e.children.length===0&&o[e.tag.tagName]}e.isVoidElement=s})),xW=s(((e,t)=>{var n=(IH(),d(FH)),r=bW();function i(e){return a(f(e))}function a(e){var t=[];return e.map(o).forEach(function(e){u(t,e)}),t}function o(e){return s[e.type](e)}var s={element:c,text:l,forceWrite:l};function c(e){return r.elementWithTag(e.tag,a(e.children))}function l(e){return e}function u(e,t){var n=e[e.length-1];t.type===`element`&&!t.tag.fresh&&n&&n.type===`element`&&t.tag.matchesElement(n.tag)?(t.tag.separator&&u(n.children,r.text(t.tag.separator)),t.children.forEach(function(e){u(n.children,e)})):e.push(t)}function f(e){return p(e,function(e){return m[e.type](e)})}function p(e,t){return n.flatten(n.map(e,t),!0)}var m={element:g,text:_,forceWrite:h};function h(e){return[e]}function g(e){var t=f(e.children);return t.length===0&&!r.isVoidElement(e)?[]:[r.elementWithTag(e.tag,t)]}function _(e){return e.value.length===0?[]:[e]}t.exports=i})),SW=s((e=>{var t=bW();e.freshElement=t.freshElement,e.nonFreshElement=t.nonFreshElement,e.elementWithTag=t.elementWithTag,e.text=t.text,e.forceWrite=t.forceWrite,e.simplify=xW();function n(e,t){t.forEach(function(t){r(e,t)})}function r(e,t){i[t.type](e,t)}var i={element:a,text:o,forceWrite:function(){}};function a(e,r){t.isVoidElement(r)?e.selfClosing(r.tag.tagName,r.tag.attributes):(e.open(r.tag.tagName,r.tag.attributes),n(e,r.children),e.close(r.tag.tagName))}function o(e,t){e.text(t.value)}e.write=n})),CW=s((e=>{var t=(IH(),d(FH)),n=SW();e.topLevelElement=r,e.elements=i,e.element=o;function r(e,t){return i([o(e,t,{fresh:!0})])}function i(e){return new a(e.map(function(e){return t.isString(e)?o(e):e}))}function a(e){this._elements=e}a.prototype.wrap=function(e){for(var t=e(),n=this._elements.length-1;n>=0;n--)t=this._elements[n].wrapNodes(t);return t};function o(e,t,n){return n||={},new s(e,t,n)}function s(e,n,r){var i={};t.isArray(e)?(e.forEach(function(e){i[e]=!0}),e=e[0]):i[e]=!0,this.tagName=e,this.tagNames=i,this.attributes=n||{},this.fresh=r.fresh,this.separator=r.separator}s.prototype.matchesElement=function(e){return this.tagNames[e.tagName]&&t.isEqual(this.attributes||{},e.attributes||{})},s.prototype.wrap=function(e){return this.wrapNodes(e())},s.prototype.wrapNodes=function(e){return[n.elementWithTag(this,e)]},e.empty=i([]),e.ignore={wrap:function(){return[]}}})),wW=s((e=>{var t=(IH(),d(FH)),n=vU(),r=SW();e.imgElement=i;function i(e){return function(i,a){return n.when(e(i)).then(function(e){var n={};return i.altText&&(n.alt=i.altText),t.extend(n,e),[r.freshElement(`img`,n)]})}}e.inline=e.imgElement,e.dataUri=i(function(e){return e.readAsBase64String().then(function(t){return{src:`data:`+e.contentType+`;base64,`+t}})})})),TW=s((e=>{var t=(IH(),d(FH));e.writer=n;function n(e){return e||={},e.prettyPrint?i():a()}var r={div:!0,p:!0,ul:!0,li:!0};function i(){var e=0,n=` `,i=[],o=!0,s=!1,c=a();function l(t,n){r[t]&&h(),i.push(t),c.open(t,n),r[t]&&e++,o=!1}function u(t){r[t]&&(e--,h()),i.pop(),c.close(t)}function d(e){m();var t=g()?e:e.replace(`
|
|
462
|
+
`,`
|
|
463
|
+
`+n);c.text(t)}function f(e,t){h(),c.selfClosing(e,t)}function p(){return i.length===0||r[i[i.length-1]]}function m(){s||=(h(),!0)}function h(){if(s=!1,!o&&p()&&!g()){c._append(`
|
|
464
|
+
`);for(var t=0;t<e;t++)c._append(n)}}function g(){return t.some(i,function(e){return e===`pre`})}return{asString:c.asString,open:l,close:u,text:d,selfClosing:f}}function a(){var e=[];function n(t,n){var r=a(n);e.push(`<`+t+r+`>`)}function r(t){e.push(`</`+t+`>`)}function i(t,n){var r=a(n);e.push(`<`+t+r+` />`)}function a(e){return t.map(e,function(e,t){return` `+t+`="`+s(e)+`"`}).join(``)}function c(t){e.push(o(t))}function l(t){e.push(t)}function u(){return e.join(``)}return{asString:u,open:n,close:r,text:c,selfClosing:i,_append:l}}function o(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function s(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}})),EW=s((e=>{var t=(IH(),d(FH));function n(e){return r(e,e)}function r(e,t){return function(){return{start:e,end:t}}}function i(e){var t=e.href||``;return t?{start:`[`,end:`](`+t+`)`,anchorPosition:`before`}:{}}function a(e){var t=e.src||``,n=e.alt||``;return t||n?{start:``}:{}}function o(e){return function(t,n){return{start:n?`
|
|
465
|
+
`:``,end:n?``:`
|
|
466
|
+
`,list:{isOrdered:e.isOrdered,indent:n?n.indent+1:0,count:0}}}}function s(e,t,n){t||={indent:0,isOrdered:!1,count:0},t.count++,n.hasClosed=!1;var r=t.isOrdered?t.count+`.`:`-`;return{start:l(` `,t.indent)+r+` `,end:function(){if(!n.hasClosed)return n.hasClosed=!0,`
|
|
467
|
+
`}}}var c={p:r(``,`
|
|
468
|
+
|
|
469
|
+
`),br:r(``,`
|
|
470
|
+
`),ul:o({isOrdered:!1}),ol:o({isOrdered:!0}),li:s,strong:n(`__`),em:n(`*`),a:i,img:a};(function(){for(var e=1;e<=6;e++)c[`h`+e]=r(l(`#`,e)+` `,`
|
|
471
|
+
|
|
472
|
+
`)})();function l(e,t){return Array(t+1).join(e)}function u(){var e=[],n=[],r=null,i={};function a(t,a){a||={};var s=(c[t]||function(){return{}})(a,r,i);n.push({end:s.end,list:r}),s.list&&(r=s.list);var l=s.anchorPosition===`before`;l&&o(a),e.push(s.start||``),l||o(a)}function o(t){t.id&&e.push(`<a id="`+t.id+`"></a>`)}function s(i){var a=n.pop();r=a.list;var o=t.isFunction(a.end)?a.end():a.end;e.push(o||``)}function l(e,t){a(e,t),s(e)}function u(t){e.push(f(t))}function d(){return e.join(``)}return{asString:d,open:a,close:s,text:u,selfClosing:l}}e.writer=u;function f(e){return e.replace(/\\/g,`\\\\`).replace(/([\`\*_\{\}\[\]\(\)\#\+\-\.\!])/g,`\\$1`)}})),DW=s((e=>{var t=TW(),n=EW();e.writer=r;function r(e){return e||={},e.outputFormat===`markdown`?n.writer():t.writer(e)}})),OW=s((e=>{var t=(IH(),d(FH)),n=vU(),r=yU(),i=CW(),a=bU(),o=wW(),s=SW(),c=DW();e.DocumentConverter=l;function l(e){return{convertToHtml:function(n){return new u(e,t.indexBy(n.type===r.types.document?n.comments:[],`commentId`)).convertToHtml(n)}}}function u(e,l){var u=1,d=[],f=[];e=t.extend({ignoreEmptyParagraphs:!0},e);var v=e.idPrefix===void 0?``:e.idPrefix,y=e.ignoreEmptyParagraphs,b=i.topLevelElement(`p`),x=e.styleMap||[];function S(r){var i=[],o=w(r,i,{}),l=[];g(o,function(e){e.type===`deferred`&&l.push(e)});var u={};return n.mapSeries(l,function(e){return e.value().then(function(t){u[e.id]=t})}).then(function(){function n(e){return h(e,function(e){return e.type===`deferred`?u[e.id]:e.children?[t.extend({},e,{children:n(e.children)})]:[e]})}var r=c.writer({prettyPrint:e.prettyPrint,outputFormat:e.outputFormat});return s.write(r,s.simplify(n(o))),new a.Result(r.asString(),i)})}function C(e,t,n){return h(e,function(e){return w(e,t,n)})}function w(e,t,n){if(!n)throw Error(`options not set`);var r=V[e.type];return r?r(e,t,n):[]}function T(e,t,n){return E(e,t).wrap(function(){var r=C(e.children,t,n);return y?r:[s.forceWrite].concat(r)})}function E(e,t){var n=A(e);return n?n.to:(e.styleId&&t.push(m(`paragraph`,e)),b)}function D(e,t,n){var a=function(){return C(e.children,t,n)},o=[];if(e.highlight!==null){var s=k({type:`highlight`,color:e.highlight});s&&o.push(s)}e.isSmallCaps&&o.push(O(`smallCaps`)),e.isAllCaps&&o.push(O(`allCaps`)),e.isStrikethrough&&o.push(O(`strikethrough`,`s`)),e.isUnderline&&o.push(O(`underline`)),e.verticalAlignment===r.verticalAlignment.subscript&&o.push(i.element(`sub`,{},{fresh:!1})),e.verticalAlignment===r.verticalAlignment.superscript&&o.push(i.element(`sup`,{},{fresh:!1})),e.isItalic&&o.push(O(`italic`,`em`)),e.isBold&&o.push(O(`bold`,`strong`));var c=i.empty,l=A(e);return l?c=l.to:e.styleId&&t.push(m(`run`,e)),o.push(c),o.forEach(function(e){a=e.wrap.bind(e,a)}),a()}function O(e,t){return k({type:e})||(t?i.element(t,{},{fresh:!1}):i.empty)}function k(e,t){var n=A(e);return n?n.to:t}function A(e){for(var t=0;t<x.length;t++)if(x[t].from.matches(e))return x[t]}function j(e){return function(t,r){return n.attempt(function(){return e(t,r)}).caught(function(e){return r.push(a.error(e)),[]})}}function M(e){return P(e.noteType,e.noteId)}function N(e){return F(e.noteType,e.noteId)}function P(e,t){return I(e+`-`+t)}function F(e,t){return I(e+`-ref-`+t)}function I(e){return v+e}var L=i.elements([i.element(`table`,{},{fresh:!0})]);function R(e,t,n){return k(e,L).wrap(function(){return z(e,t,n)})}function z(e,n,i){var a=t.findIndex(e.children,function(e){return!e.type===r.types.tableRow||!e.isHeader});a===-1&&(a=e.children.length);var o;if(a===0)o=C(e.children,n,t.extend({},i,{isTableHeader:!1}));else{var c=C(e.children.slice(0,a),n,t.extend({},i,{isTableHeader:!0})),l=C(e.children.slice(a),n,t.extend({},i,{isTableHeader:!1}));o=[s.freshElement(`thead`,{},c),s.freshElement(`tbody`,{},l)]}return[s.forceWrite].concat(o)}function B(e,t,n){var r=C(e.children,t,n);return[s.freshElement(`tr`,{},[s.forceWrite].concat(r))]}function ee(e,t,n){var r=n.isTableHeader?`th`:`td`,i=C(e.children,t,n),a={};return e.colSpan!==1&&(a.colspan=e.colSpan.toString()),e.rowSpan!==1&&(a.rowspan=e.rowSpan.toString()),[s.freshElement(r,a,[s.forceWrite].concat(i))]}function te(e,t,n){return k(e,i.ignore).wrap(function(){var t=l[e.commentId],n=f.length+1,r=`[`+_(t)+n+`]`;return f.push({label:r,comment:t}),[s.freshElement(`a`,{href:`#`+P(`comment`,e.commentId),id:F(`comment`,e.commentId)},[s.text(r)])]})}function ne(e,t,n){var r=e.label,i=e.comment,a=C(i.body,t,n).concat([s.nonFreshElement(`p`,{},[s.text(` `),s.freshElement(`a`,{href:`#`+F(`comment`,i.commentId)},[s.text(`↑`)])])]);return[s.freshElement(`dt`,{id:P(`comment`,i.commentId)},[s.text(`Comment `+r)]),s.freshElement(`dd`,{},a)]}function re(e,t,n){return ie(e).wrap(function(){return[]})}function ie(e){var t=A(e);return t?t.to:e.breakType===`line`?i.topLevelElement(`br`):i.empty}var V={document:function(e,t,n){var r=C(e.children,t,n),i=C(d.map(function(t){return e.notes.resolve(t)}),t,n);return r.concat([s.freshElement(`ol`,{},i),s.freshElement(`dl`,{},h(f,function(e){return ne(e,t,n)}))])},paragraph:T,run:D,text:function(e,t,n){return[s.text(e.value)]},tab:function(e,t,n){return[s.text(` `)]},hyperlink:function(e,t,n){var r={href:e.anchor?`#`+I(e.anchor):e.href};e.targetFrame!=null&&(r.target=e.targetFrame);var i=C(e.children,t,n);return[s.nonFreshElement(`a`,r,i)]},checkbox:function(e){var t={type:`checkbox`};return e.checked&&(t.checked=`checked`),[s.freshElement(`input`,t)]},bookmarkStart:function(e,t,n){return[s.freshElement(`a`,{id:I(e.name)},[s.forceWrite])]},noteReference:function(e,t,n){d.push(e);var r=s.freshElement(`a`,{href:`#`+M(e),id:N(e)},[s.text(`[`+ u+++`]`)]);return[s.freshElement(`sup`,{},[r])]},note:function(e,t,n){var r=C(e.body,t,n),a=s.elementWithTag(i.element(`p`,{},{fresh:!1}),[s.text(` `),s.freshElement(`a`,{href:`#`+N(e)},[s.text(`↑`)])]),o=r.concat([a]);return s.freshElement(`li`,{id:M(e)},o)},commentReference:te,comment:ne,image:p(j(e.convertImage||o.dataUri)),table:R,tableRow:B,tableCell:ee,break:re};return{convertToHtml:S}}var f=1;function p(e){return function(t,n,r){return[{type:`deferred`,id:f++,value:function(){return e(t,n,r)}}]}}function m(e,t){return a.warning(`Unrecognised `+e+` style: '`+t.styleName+`' (Style ID: `+t.styleId+`)`)}function h(e,n){return t.flatten(e.map(n),!0)}function g(e,t){e.forEach(function(e){t(e),e.children&&g(e.children,t)})}var _=e.commentAuthorLabel=function(e){return e.authorInitials||``}})),kW=s((e=>{var t=yU();function n(e){if(e.type===`text`)return e.value;if(e.type===t.types.tab)return` `;var r=e.type===`paragraph`?`
|
|
473
|
+
|
|
474
|
+
`:``;return(e.children||[]).map(n).join(``)+r}e.convertElementToRawText=n})),AW=s(((e,t)=>{var n=t.exports=function(e,t){this._tokens=e,this._startIndex=t||0};n.prototype.head=function(){return this._tokens[this._startIndex]},n.prototype.tail=function(e){return new n(this._tokens,this._startIndex+1)},n.prototype.toArray=function(){return this._tokens.slice(this._startIndex)},n.prototype.end=function(){return this._tokens[this._tokens.length-1]},n.prototype.to=function(e){var t=this.head().source,n=e.head()||e.end();return t.to(n.source)}})),jW=s((e=>{var t=AW();e.Parser=function(e){return{parseTokens:function(e,n){return e(new t(n))}}}})),MW=s((e=>{e.none=Object.create({value:function(){throw Error(`Called value on none`)},isNone:function(){return!0},isSome:function(){return!1},map:function(){return e.none},flatMap:function(){return e.none},filter:function(){return e.none},toArray:function(){return[]},orElse:t,valueOrElse:t});function t(e){return typeof e==`function`?e():e}e.some=function(e){return new n(e)};var n=function(e){this._value=e};n.prototype.value=function(){return this._value},n.prototype.isNone=function(){return!1},n.prototype.isSome=function(){return!0},n.prototype.map=function(e){return new n(e(this._value))},n.prototype.flatMap=function(e){return e(this._value)},n.prototype.filter=function(t){return t(this._value)?this:e.none},n.prototype.toArray=function(){return[this._value]},n.prototype.orElse=function(e){return this},n.prototype.valueOrElse=function(e){return this._value},e.isOption=function(t){return t===e.none||t instanceof n},e.fromNullable=function(t){return t==null?e.none:new n(t)}})),NW=s(((e,t)=>{t.exports={failure:function(e,t){if(e.length<1)throw Error(`Failure must have errors`);return new n({status:`failure`,remaining:t,errors:e})},error:function(e,t){if(e.length<1)throw Error(`Failure must have errors`);return new n({status:`error`,remaining:t,errors:e})},success:function(e,t,r){return new n({status:`success`,value:e,source:r,remaining:t,errors:[]})},cut:function(e){return new n({status:`cut`,remaining:e,errors:[]})}};var n=function(e){this._value=e.value,this._status=e.status,this._hasValue=e.value!==void 0,this._remaining=e.remaining,this._source=e.source,this._errors=e.errors};n.prototype.map=function(e){return this._hasValue?new n({value:e(this._value,this._source),status:this._status,remaining:this._remaining,source:this._source,errors:this._errors}):this},n.prototype.changeRemaining=function(e){return new n({value:this._value,status:this._status,remaining:e,source:this._source,errors:this._errors})},n.prototype.isSuccess=function(){return this._status===`success`||this._status===`cut`},n.prototype.isFailure=function(){return this._status===`failure`},n.prototype.isError=function(){return this._status===`error`},n.prototype.isCut=function(){return this._status===`cut`},n.prototype.value=function(){return this._value},n.prototype.remaining=function(){return this._remaining},n.prototype.source=function(){return this._source},n.prototype.errors=function(){return this._errors}})),PW=s((e=>{e.error=function(e){return new t(e)};var t=function(e){this.expected=e.expected,this.actual=e.actual,this._location=e.location};t.prototype.describe=function(){return(this._location?this._location.describe()+`:
|
|
475
|
+
`:``)+`Expected `+this.expected+`
|
|
476
|
+
but got `+this.actual},t.prototype.lineNumber=function(){return this._location.lineNumber()},t.prototype.characterNumber=function(){return this._location.characterNumber()}})),FW=s((e=>{e.fromArray=function(e){var n=0,r=function(){return n<e.length};return new t({hasNext:r,next:function(){if(r())return e[n++];throw Error(`No more elements`)}})};var t=function(e){this._iterator=e};t.prototype.map=function(e){var n=this._iterator;return new t({hasNext:function(){return n.hasNext()},next:function(){return e(n.next())}})},t.prototype.filter=function(e){var n=this._iterator,r=!1,i=!1,a,o=function(){if(!r)for(r=!0,i=!1;n.hasNext()&&!i;)a=n.next(),i=e(a)};return new t({hasNext:function(){return o(),i},next:function(){o();var e=a;return r=!1,e}})},t.prototype.first=function(){var e=this._iterator;return this._iterator.hasNext()?e.next():null},t.prototype.toArray=function(){for(var e=[];this._iterator.hasNext();)e.push(this._iterator.next());return e}})),IW=s((e=>{var t=(IH(),d(FH)),n=MW(),r=NW(),i=PW(),a=FW();e.token=function(e,t){var n=t!==void 0;return function(i){var a=i.head();return a&&a.name===e&&(!n||a.value===t)?r.success(a.value,i.tail(),a.source):f(i,u({name:e,value:t}))}},e.tokenOfType=function(t){return e.token(t)},e.firstOf=function(e,n){return t.isArray(n)||(n=Array.prototype.slice.call(arguments,1)),function(t){return a.fromArray(n).map(function(e){return e(t)}).filter(function(e){return e.isSuccess()||e.isError()}).first()||f(t,e)}},e.then=function(e,t){return function(n){var r=e(n);return r.map||console.log(r),r.map(t)}},e.sequence=function(){var n=Array.prototype.slice.call(arguments,0),i=function(i){var a=t.foldl(n,function(e,t){var n=e.result,a=e.hasCut;if(!n.isSuccess())return{result:n,hasCut:a};var o=t(n.remaining());if(o.isCut())return{result:n,hasCut:!0};if(o.isSuccess()){var s=t.isCaptured?n.value().withValue(t,o.value()):n.value(),c=o.remaining(),l=i.to(c);return{result:r.success(s,c,l),hasCut:a}}else if(a)return{result:r.error(o.errors(),o.remaining()),hasCut:a};else return{result:o,hasCut:a}},{result:r.success(new o,i),hasCut:!1}).result,s=i.to(a.remaining());return a.map(function(t){return t.withValue(e.sequence.source,s)})};i.head=function(){var r=t.find(n,a);return e.then(i,e.sequence.extract(r))},i.map=function(t){return e.then(i,function(e){return t.apply(this,e.toArray())})};function a(e){return e.isCaptured}return i};var o=function(e,t){this._values=e||{},this._valuesArray=t||[]};o.prototype.withValue=function(e,n){if(e.captureName&&e.captureName in this._values)throw Error(`Cannot add second value for capture "`+e.captureName+`"`);var r=t.clone(this._values);return r[e.captureName]=n,new o(r,this._valuesArray.concat([n]))},o.prototype.get=function(e){if(e.captureName in this._values)return this._values[e.captureName];throw Error(`No value for capture "`+e.captureName+`"`)},o.prototype.toArray=function(){return this._valuesArray},e.sequence.capture=function(e,t){var n=function(){return e.apply(this,arguments)};return n.captureName=t,n.isCaptured=!0,n},e.sequence.extract=function(e){return function(t){return t.get(e)}},e.sequence.applyValues=function(e){var t=Array.prototype.slice.call(arguments,1);return function(n){var r=t.map(function(e){return n.get(e)});return e.apply(this,r)}},e.sequence.source={captureName:`☃source☃`},e.sequence.cut=function(){return function(e){return r.cut(e)}},e.optional=function(e){return function(t){var i=e(t);return i.isSuccess()?i.map(n.some):i.isFailure()?r.success(n.none,t):i}},e.zeroOrMoreWithSeparator=function(e,t){return l(e,t,!1)},e.oneOrMoreWithSeparator=function(e,t){return l(e,t,!0)};var s=e.zeroOrMore=function(e){return function(t){for(var n=[],i;(i=e(t))&&i.isSuccess();)t=i.remaining(),n.push(i.value());return i.isError()?i:r.success(n,t)}};e.oneOrMore=function(t){return e.oneOrMoreWithSeparator(t,c)};function c(e){return r.success(null,e)}var l=function(t,n,i){return function(a){var o=t(a);if(o.isSuccess()){var c=e.sequence.capture(t,`main`),l=s(e.then(e.sequence(n,c),e.sequence.extract(c)))(o.remaining());return r.success([o.value()].concat(l.value()),l.remaining())}else if(i||o.isError())return o;else return r.success([],a)}};e.leftAssociative=function(t,n,i){var a=i?[{func:i,rule:n}]:n;a=a.map(function(t){return e.then(t.rule,function(e){return function(n,r){return t.func(n,e,r)}})});var o=e.firstOf.apply(null,[`rules`].concat(a));return function(e){var n=e,i=t(e);if(!i.isSuccess())return i;for(var a=o(i.remaining());a.isSuccess();){var s=a.remaining(),c=n.to(a.remaining()),l=a.value();i=r.success(l(i.value(),c),s,c),a=o(i.remaining())}return a.isError()?a:i}},e.leftAssociative.firstOf=function(){return Array.prototype.slice.call(arguments,0)},e.nonConsuming=function(e){return function(t){return e(t).changeRemaining(t)}};var u=function(e){return e.value?e.name+` "`+e.value+`"`:e.name};function f(e,t){var n,a=e.head();return n=a?i.error({expected:t,actual:u(a),location:a.source}):i.error({expected:t,actual:`end of tokens`}),r.failure([n],e)}})),LW=s(((e,t)=>{t.exports=function(e,t){return{asString:function(){return e},range:function(r,i){return new n(e,t,r,i)}}};var n=function(e,t,n,r){this._string=e,this._description=t,this._startIndex=n,this._endIndex=r};n.prototype.to=function(e){return new n(this._string,this._description,this._startIndex,e._endIndex)},n.prototype.describe=function(){var e=this._position();return(this._description?this._description+`
|
|
477
|
+
`:``)+`Line number: `+e.lineNumber+`
|
|
478
|
+
Character number: `+e.characterNumber},n.prototype.lineNumber=function(){return this._position().lineNumber},n.prototype.characterNumber=function(){return this._position().characterNumber},n.prototype._position=function(){for(var e=this,t=0,n=function(){return e._string.indexOf(`
|
|
479
|
+
`,t)},r=1;n()!==-1&&n()<this._startIndex;)t=n()+1,r+=1;var i=this._startIndex-t+1;return{lineNumber:r,characterNumber:i}}})),RW=s(((e,t)=>{t.exports=function(e,t,n){this.name=e,this.value=t,n&&(this.source=n)}})),zW=s((e=>{var t=IW(),n=NW();e.parser=function(e,n,a){var o={rule:u,leftAssociative:d,rightAssociative:f},s=new r(a.map(l)),c=t.firstOf(e,n);function l(e){return{name:e.name,rule:i(e.ruleBuilder.bind(null,o))}}function u(){return p(s)}function d(e){return p(s.untilExclusive(e))}function f(e){return p(s.untilInclusive(e))}function p(e){return m.bind(null,e)}function m(e,t){var n=c(t);return n.isSuccess()?e.apply(n):n}return o};function r(e){function i(t){return new r(e.slice(0,o().indexOf(t)))}function a(t){return new r(e.slice(0,o().indexOf(t)+1))}function o(){return e.map(function(e){return e.name})}function s(e){for(var t,r;;)if(t=c(e.remaining()),t.isSuccess())r=e.source().to(t.source()),e=n.success(t.value()(e.value(),r),t.remaining(),r);else if(t.isFailure())return e;else return t}function c(n){return t.firstOf(`infix`,e.map(function(e){return e.rule}))(n)}return{apply:s,untilExclusive:i,untilInclusive:a}}e.infix=function(t,n){function r(r){return e.infix(t,function(e){var t=n(e);return function(e){return t(e).map(function(e){return function(t,n){return r(t,e,n)}})}})}return{name:t,ruleBuilder:n,map:r}};var i=function(e){var t;return function(n){return t||=e(),t(n)}}})),BW=s((e=>{var t=RW(),n=LW();e.RegexTokeniser=r;function r(e){e=e.map(function(e){return{name:e.name,regex:new RegExp(e.regex.source,`g`)}});function r(e,t){for(var r=new n(e,t),o=0,s=[];o<e.length;){var c=i(e,o,r);o=c.endIndex,s.push(c.token)}return s.push(a(e,r)),s}function i(n,r,i){for(var a=0;a<e.length;a++){var o=e[a].regex;o.lastIndex=r;var s=o.exec(n);if(s){var c=r+s[0].length;if(s.index===r&&c>r){var l=s[1],u=new t(e[a].name,l,i.range(r,c));return{token:u,endIndex:c}}}}var c=r+1,u=new t(`unrecognisedCharacter`,n.substring(r,c),i.range(r,c));return{token:u,endIndex:c}}function a(e,n){return new t(`end`,null,n.range(e.length,e.length))}return{tokenise:r}}})),VW=s((e=>{e.Parser=jW().Parser,e.rules=IW(),e.errors=PW(),e.results=NW(),e.StringSource=LW(),e.Token=RW(),e.bottomUp=zW(),e.RegexTokeniser=BW().RegexTokeniser,e.rule=function(e){var t;return function(n){return t||=e(),t(n)}}})),HW=s((e=>{e.paragraph=t,e.run=n,e.table=r,e.bold=new a(`bold`),e.italic=new a(`italic`),e.underline=new a(`underline`),e.strikethrough=new a(`strikethrough`),e.allCaps=new a(`allCaps`),e.smallCaps=new a(`smallCaps`),e.highlight=i,e.commentReference=new a(`commentReference`),e.lineBreak=new s({breakType:`line`}),e.pageBreak=new s({breakType:`page`}),e.columnBreak=new s({breakType:`column`}),e.equalTo=l,e.startsWith=u;function t(e){return new a(`paragraph`,e)}function n(e){return new a(`run`,e)}function r(e){return new a(`table`,e)}function i(e){return new o(e)}function a(e,t){t||={},this._elementType=e,this._styleId=t.styleId,this._styleName=t.styleName,t.list&&(this._listIndex=t.list.levelIndex,this._listIsOrdered=t.list.isOrdered)}a.prototype.matches=function(e){return e.type===this._elementType&&(this._styleId===void 0||e.styleId===this._styleId)&&(this._styleName===void 0||e.styleName&&this._styleName.operator(this._styleName.operand,e.styleName))&&(this._listIndex===void 0||c(e,this._listIndex,this._listIsOrdered))&&(this._breakType===void 0||this._breakType===e.breakType)};function o(e){e||={},this._color=e.color}o.prototype.matches=function(e){return e.type===`highlight`&&(this._color===void 0||e.color===this._color)};function s(e){e||={},this._breakType=e.breakType}s.prototype.matches=function(e){return e.type===`break`&&(this._breakType===void 0||e.breakType===this._breakType)};function c(e,t,n){return e.numbering&&e.numbering.level==t&&e.numbering.isOrdered==n}function l(e){return{operator:d,operand:e}}function u(e){return{operator:f,operand:e}}function d(e,t){return e.toUpperCase()===t.toUpperCase()}function f(e,t){return t.toUpperCase().indexOf(e.toUpperCase())===0}})),UW=s((e=>{var t=VW().RegexTokeniser;e.tokenise=r;var n=`'((?:\\\\.|[^'])*)`;function r(e){var r=`(?:[a-zA-Z\\-_]|\\\\.)`;return new t([{name:`identifier`,regex:RegExp(`(`+r+`(?:`+r+`|[0-9])*)`)},{name:`dot`,regex:/\./},{name:`colon`,regex:/:/},{name:`gt`,regex:/>/},{name:`whitespace`,regex:/\s+/},{name:`arrow`,regex:/=>/},{name:`equals`,regex:/=/},{name:`startsWith`,regex:/\^=/},{name:`open-paren`,regex:/\(/},{name:`close-paren`,regex:/\)/},{name:`open-square-bracket`,regex:/\[/},{name:`close-square-bracket`,regex:/\]/},{name:`string`,regex:RegExp(n+`'`)},{name:`unterminated-string`,regex:new RegExp(n)},{name:`integer`,regex:/([0-9]+)/},{name:`choice`,regex:/\|/},{name:`bang`,regex:/(!)/}]).tokenise(e)}})),WW=s((e=>{var t=(IH(),d(FH)),n=VW(),r=HW(),i=CW(),a=UW().tokenise,o=bU();e.readHtmlPath=f,e.readDocumentMatcher=l,e.readStyle=s;function s(e){return S(T,e)}function c(){return n.rules.sequence(n.rules.sequence.capture(u()),n.rules.tokenOfType(`whitespace`),n.rules.tokenOfType(`arrow`),n.rules.sequence.capture(n.rules.optional(n.rules.sequence(n.rules.tokenOfType(`whitespace`),n.rules.sequence.capture(p())).head())),n.rules.tokenOfType(`end`)).map(function(e,t){return{from:e,to:t.valueOrElse(i.empty)}})}function l(e){return S(u(),e)}function u(){var e=n.rules.sequence,i=function(e,t){return n.rules.then(n.rules.token(`identifier`,e),function(){return t})},a=i(`p`,r.paragraph),o=i(`r`,r.run),s=n.rules.firstOf(`p or r or table`,a,o),c=n.rules.sequence(n.rules.tokenOfType(`dot`),n.rules.sequence.cut(),n.rules.sequence.capture(m)).map(function(e){return{styleId:e}}),l=n.rules.firstOf(`style name matcher`,n.rules.then(n.rules.sequence(n.rules.tokenOfType(`equals`),n.rules.sequence.cut(),n.rules.sequence.capture(g)).head(),function(e){return{styleName:r.equalTo(e)}}),n.rules.then(n.rules.sequence(n.rules.tokenOfType(`startsWith`),n.rules.sequence.cut(),n.rules.sequence.capture(g)).head(),function(e){return{styleName:r.startsWith(e)}})),u=n.rules.sequence(n.rules.tokenOfType(`open-square-bracket`),n.rules.sequence.cut(),n.rules.token(`identifier`,`style-name`),n.rules.sequence.capture(l),n.rules.tokenOfType(`close-square-bracket`)).head(),d=n.rules.firstOf(`list type`,i(`ordered-list`,{isOrdered:!0}),i(`unordered-list`,{isOrdered:!1})),f=e(n.rules.tokenOfType(`colon`),e.capture(d),e.cut(),n.rules.tokenOfType(`open-paren`),e.capture(h),n.rules.tokenOfType(`close-paren`)).map(function(e,t){return{list:{isOrdered:e.isOrdered,levelIndex:t-1}}});function p(e){var r=n.rules.firstOf.apply(n.rules.firstOf,[`matcher suffix`].concat(e)),i=n.rules.zeroOrMore(r);return n.rules.then(i,function(e){var n={};return e.forEach(function(e){t.extend(n,e)}),n})}var _=e(e.capture(s),e.capture(p([c,u,f]))).map(function(e,t){return e(t)}),v=e(n.rules.token(`identifier`,`table`),e.capture(p([c,u]))).map(function(e){return r.table(e)}),y=i(`b`,r.bold),b=i(`i`,r.italic),x=i(`u`,r.underline),S=i(`strike`,r.strikethrough),C=i(`all-caps`,r.allCaps),w=i(`small-caps`,r.smallCaps),T=e(n.rules.token(`identifier`,`highlight`),n.rules.sequence.capture(n.rules.optional(n.rules.sequence(n.rules.tokenOfType(`open-square-bracket`),n.rules.sequence.cut(),n.rules.token(`identifier`,`color`),n.rules.tokenOfType(`equals`),n.rules.sequence.capture(g),n.rules.tokenOfType(`close-square-bracket`)).head()))).map(function(e){return r.highlight({color:e.valueOrElse(void 0)})}),E=i(`comment-reference`,r.commentReference),D=e(n.rules.token(`identifier`,`br`),e.cut(),n.rules.tokenOfType(`open-square-bracket`),n.rules.token(`identifier`,`type`),n.rules.tokenOfType(`equals`),e.capture(g),n.rules.tokenOfType(`close-square-bracket`)).map(function(e){switch(e){case`line`:return r.lineBreak;case`page`:return r.pageBreak;case`column`:return r.columnBreak;default:}});return n.rules.firstOf(`element type`,_,v,y,b,x,S,C,w,T,E,D)}function f(e){return S(p(),e)}function p(){var e=n.rules.sequence.capture,t=n.rules.tokenOfType(`whitespace`),r=n.rules.then(n.rules.optional(n.rules.sequence(n.rules.tokenOfType(`colon`),n.rules.token(`identifier`,`fresh`))),function(e){return e.map(function(){return!0}).valueOrElse(!1)}),a=n.rules.then(n.rules.optional(n.rules.sequence(n.rules.tokenOfType(`colon`),n.rules.token(`identifier`,`separator`),n.rules.tokenOfType(`open-paren`),e(g),n.rules.tokenOfType(`close-paren`)).head()),function(e){return e.valueOrElse(``)}),o=n.rules.oneOrMoreWithSeparator(m,n.rules.tokenOfType(`choice`)),s=n.rules.sequence(e(o),e(n.rules.zeroOrMore(x)),e(r),e(a)).map(function(e,t,n,r){var a={},o={};return t.forEach(function(e){e.append&&a[e.name]?a[e.name]+=` `+e.value:a[e.name]=e.value}),n&&(o.fresh=!0),r&&(o.separator=r),i.element(e,a,o)});return n.rules.firstOf(`html path`,n.rules.then(n.rules.tokenOfType(`bang`),function(){return i.ignore}),n.rules.then(n.rules.zeroOrMoreWithSeparator(s,n.rules.sequence(t,n.rules.tokenOfType(`gt`),t)),i.elements))}var m=n.rules.then(n.rules.tokenOfType(`identifier`),v),h=n.rules.tokenOfType(`integer`),g=n.rules.then(n.rules.tokenOfType(`string`),v),_={n:`
|
|
480
|
+
`,r:`\r`,t:` `};function v(e){return e.replace(/\\(.)/g,function(e,t){return _[t]||t})}var y=n.rules.sequence(n.rules.tokenOfType(`open-square-bracket`),n.rules.sequence.cut(),n.rules.sequence.capture(m),n.rules.tokenOfType(`equals`),n.rules.sequence.capture(g),n.rules.tokenOfType(`close-square-bracket`)).map(function(e,t){return{name:e,value:t,append:!1}}),b=n.rules.sequence(n.rules.tokenOfType(`dot`),n.rules.sequence.cut(),n.rules.sequence.capture(m)).map(function(e){return{name:`class`,value:e,append:!0}}),x=n.rules.firstOf(`attribute or class`,y,b);function S(e,t){var r=a(t),i=n.Parser().parseTokens(e,r);return i.isSuccess()?o.success(i.value()):new o.Result(null,[o.warning(C(t,i))])}function C(e,t){return`Did not understand this style mapping, so ignored it: `+e+`
|
|
481
|
+
`+t.errors().map(w).join(`
|
|
482
|
+
`)}function w(e){return`Error was at character number `+e.characterNumber()+`: Expected `+e.expected+` but got `+e.actual}var T=c()})),GW=s((e=>{e.readOptions=i;var t=(IH(),d(FH)),n=e._defaultStyleMap=`p.Heading1 => h1:fresh,p.Heading2 => h2:fresh,p.Heading3 => h3:fresh,p.Heading4 => h4:fresh,p.Heading5 => h5:fresh,p.Heading6 => h6:fresh,p[style-name='Heading 1'] => h1:fresh,p[style-name='Heading 2'] => h2:fresh,p[style-name='Heading 3'] => h3:fresh,p[style-name='Heading 4'] => h4:fresh,p[style-name='Heading 5'] => h5:fresh,p[style-name='Heading 6'] => h6:fresh,p[style-name='heading 1'] => h1:fresh,p[style-name='heading 2'] => h2:fresh,p[style-name='heading 3'] => h3:fresh,p[style-name='heading 4'] => h4:fresh,p[style-name='heading 5'] => h5:fresh,p[style-name='heading 6'] => h6:fresh,p.Heading => h1:fresh,p[style-name='Heading'] => h1:fresh,r[style-name='Strong'] => strong,p[style-name='footnote text'] => p:fresh,r[style-name='footnote reference'] =>,p[style-name='endnote text'] => p:fresh,r[style-name='endnote reference'] =>,p[style-name='annotation text'] => p:fresh,r[style-name='annotation reference'] =>,p[style-name='Footnote'] => p:fresh,r[style-name='Footnote anchor'] =>,p[style-name='Endnote'] => p:fresh,r[style-name='Endnote anchor'] =>,p:unordered-list(1) => ul > li:fresh,p:unordered-list(2) => ul|ol > li > ul > li:fresh,p:unordered-list(3) => ul|ol > li > ul|ol > li > ul > li:fresh,p:unordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh,p:unordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh,p:ordered-list(1) => ol > li:fresh,p:ordered-list(2) => ul|ol > li > ol > li:fresh,p:ordered-list(3) => ul|ol > li > ul|ol > li > ol > li:fresh,p:ordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh,p:ordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh,r[style-name='Hyperlink'] =>,p[style-name='Normal'] => p:fresh,p.Body => p:fresh,p[style-name='Body'] => p:fresh`.split(`,`),r=e._standardOptions={externalFileAccess:!1,transformDocument:o,includeDefaultStyleMap:!0,includeEmbeddedStyleMap:!0};function i(e){return e||={},t.extend({},r,e,{customStyleMap:a(e.styleMap),readStyleMap:function(){var e=this.customStyleMap;return this.includeEmbeddedStyleMap&&(e=e.concat(a(this.embeddedStyleMap))),this.includeDefaultStyleMap&&(e=e.concat(n)),e}})}function a(e){return e?t.isString(e)?e.split(`
|
|
483
|
+
`).map(function(e){return e.trim()}).filter(function(e){return e!==``&&e.charAt(0)!==`#`}):e:[]}function o(e){return e}})),KW=s((e=>{var t=vU(),n=CU();e.openZip=r;function r(e){return e.arrayBuffer?t.resolve(n.openArrayBuffer(e.arrayBuffer)):t.reject(Error(`Could not find file in options`))}})),qW=s((e=>{var t=CW(),n=SW();e.element=r;function r(e){return function(r){return n.elementWithTag(t.element(e),[r])}}})),JW=u(s((e=>{var t=(IH(),d(FH)),n=vW(),r=yW(),i=OW().DocumentConverter;kW().convertElementToRawText;var a=WW().readStyle,o=GW().readOptions,s=KW(),c=bU().Result;e.convertToHtml=l,e.images=wW(),e.transforms=sW(),e.underline=qW();function l(e,t){return u(e,t)}function u(e,t){return t=o(t),s.openZip(e).tap(function(e){return r.readStyleMap(e).then(function(e){t.embeddedStyleMap=e})}).then(function(r){return n.read(r,e,t).then(function(e){return e.map(t.transformDocument)}).then(function(e){return f(e,t)})})}function f(e,n){var r=p(n.readStyleMap()),a=new i(t.extend({},n,{styleMap:r.value}));return e.flatMapThen(function(e){return r.flatMapThen(function(t){return a.convertToHtml(e)})})}function p(e){return c.combine((e||[]).map(a)).map(function(e){return e.filter(function(e){return!!e})})}}))(),1);async function YW(e){let t=await e.arrayBuffer(),n=await JW.convertToHtml({arrayBuffer:t},{styleMap:[`p[style-name='Heading 1'] => h1:fresh`,`p[style-name='Heading 2'] => h2:fresh`,`p[style-name='Heading 3'] => h3:fresh`,`p[style-name='Heading 4'] => h4:fresh`,`p[style-name='Title'] => h1:fresh`,`p[style-name='Subtitle'] => h2:fresh`,`r[style-name='Underline'] => u`,`p[style-name='Quote'] => blockquote > p:fresh`,`p[style-name='Block Text'] => blockquote > p:fresh`,`p[style-name='Intense Quote'] => blockquote > p:fresh`],convertImage:JW.images.imgElement(async e=>{let t=XW(await e.read());return{src:`data:${e.contentType||`image/png`};base64,${t}`}})}),r=n.value;return r=r.replace(/<p><br\s*\/?><\/p>/g,`<p></p>`),{html:r,messages:n.messages.map(e=>`${e.type}: ${e.message}`)}}function XW(e){let t=new Uint8Array(e),n=``;for(let e=0;e<t.length;e++)n+=String.fromCharCode(t[e]);return btoa(n)}async function ZW(){let e=await Promise.resolve().then(()=>require(`./pdf-DDIBR0qz.cjs`)),t=e.version||`5.5.207`;return e.GlobalWorkerOptions.workerSrc=`https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${t}/pdf.worker.min.mjs`,e}async function QW(e){let t=await e.arrayBuffer(),n=[],r=await ZW(),i;try{i=await r.getDocument({data:t}).promise}catch(e){return{html:`<p>Failed to load PDF. The file may be corrupted or password-protected.</p>`,messages:[`error: ${e}`]}}let a=i.numPages;n.push(`Importing ${a} page(s)`);let o=[];for(let e=1;e<=a;e++){let t=await i.getPage(e),n=$W((await t.getTextContent()).items),r=await eG(t),s=n;r.length>0&&(s+=r.join(`
|
|
484
|
+
`)),o.push(s),e<a&&o.push(`<div data-page-break class="page-break"></div>`)}return{html:o.join(`
|
|
485
|
+
`),messages:n}}function $W(e){if(e.length===0)return``;let t=[],n=null;for(let r of e){if(!r.str.trim()&&!r.hasEOL)continue;let e=Math.abs(r.transform[0])||Math.abs(r.transform[3])||12,i=r.transform[5],a=r.fontName?.toLowerCase().includes(`bold`)??!1;!n||Math.abs(n.y-i)>3?(n&&t.push(n),n={text:r.str,fontSize:Math.round(e),y:i,isBold:a}):(n.text+=r.str,e>n.fontSize&&(n.fontSize=Math.round(e)),a&&(n.isBold=!0))}if(n&&t.push(n),t.length===0)return``;let r=new Map;for(let e of t)r.set(e.fontSize,(r.get(e.fontSize)||0)+1);let i=12,a=0;for(let[e,t]of r)t>a&&(a=t,i=e);let o=[];for(let e of t){let t=e.text.trim();if(!t)continue;let n=tG(t),r=e.fontSize/i;r>=1.8?o.push(`<h1>${n}</h1>`):r>=1.5?o.push(`<h2>${n}</h2>`):r>=1.2?o.push(`<h3>${n}</h3>`):e.isBold&&e.text.length<100?o.push(`<h4>${n}</h4>`):e.isBold?o.push(`<p><strong>${n}</strong></p>`):o.push(`<p>${n}</p>`)}return o.join(`
|
|
486
|
+
`)}async function eG(e){let t=[];try{let n=await e.getOperatorList(),{OPS:r}=await ZW();for(let i=0;i<n.fnArray.length;i++)if(n.fnArray[i]===r.paintImageXObject||n.fnArray[i]===r.paintInlineImageXObject){let r=n.argsArray[i][0];try{let n=await e.objs.get(r);if(!n)continue;let i=document.createElement(`canvas`),a=i.getContext(`2d`);if(!a)continue;if(n instanceof ImageBitmap)i.width=n.width,i.height=n.height,a.drawImage(n,0,0);else if(`data`in n&&`width`in n){i.width=n.width,i.height=n.height;let e=new ImageData(new Uint8ClampedArray(n.data),n.width,n.height);a.putImageData(e,0,0)}else continue;if(i.width>50&&i.height>50){let e=i.toDataURL(`image/png`);t.push(`<img src="${e}" alt="Imported image" />`)}}catch{}}}catch{}return t}function tG(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function nG({config:e,editorRef:t,readOnly:n,onToggleReadOnly:r}){let[i,a]=(0,f.useState)(!1),[o,s]=(0,f.useState)(!1),c=(0,f.useRef)(null),l=e.import!==!1,u=e.preview!==!1,d=e.print!==!1,p=e.export!==!1,h=(0,f.useCallback)(async n=>{let r=n.target.files?.[0];if(!(!r||!t.current)&&!(e.onBeforeImport&&!await e.onBeforeImport(r))){a(!0);try{let n=r.name.split(`.`).pop()?.toLowerCase(),i=``;if(n===`docx`||n===`doc`)i=(await YW(r)).html;else if(n===`pdf`)i=(await QW(r)).html;else{let e=await r.text();i=e.includes(`<`)&&e.includes(`>`)?e:`<p>${e}</p>`}t.current.setContent(i),e.onAfterImport?.(i,r)}catch(e){console.error(`[DocCraft Import] Failed:`,e)}finally{a(!1),c.current&&(c.current.value=``)}}},[t,e]),g=(0,f.useCallback)(()=>{if(!(!n&&e.onBeforePreview&&!e.onBeforePreview())&&(r(),!n)){let n=t.current?.getPreviewHTML({title:`Preview`});n&&e.onAfterPreview?.(n)}},[t,e,n,r]),_=(0,f.useCallback)(()=>{if(e.onBeforePrint&&!e.onBeforePrint())return;let n=t.current?.getPdfHTML({title:`Document`});if(!n)return;let r=document.createElement(`iframe`);r.style.cssText=`position:fixed;top:-10000px;left:-10000px;width:0;height:0`,document.body.appendChild(r);let i=r.contentDocument;if(!i){document.body.removeChild(r);return}i.open(),i.write(n),i.close();let a=!1,o=()=>{a||(a=!0,r.parentNode&&document.body.removeChild(r),e.onAfterPrint?.())},s=setTimeout(o,1e4);r.onload=()=>{clearTimeout(s),!a&&(r.contentWindow?.print(),r.contentWindow&&(r.contentWindow.onafterprint=o),setTimeout(o,2e3))}},[t,e]),v=(0,f.useCallback)(async()=>{if(e.onBeforeExport&&!e.onBeforeExport(`clipboard`))return;let n=t.current?.getPdfHTML({title:`Document`});if(n){try{await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([n],{type:`text/html`}),"text/plain":new Blob([n],{type:`text/plain`})})])}catch{await navigator.clipboard.writeText(n)}s(!0),setTimeout(()=>s(!1),2e3),e.onAfterExport?.(n,`clipboard`)}},[t,e]),y=(0,f.useCallback)(()=>{if(e.onBeforeExport&&!e.onBeforeExport(`html`))return;let n=t.current?.getPdfHTML({title:`Document`});if(!n)return;let r=new Blob([n],{type:`text/html`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`document.html`,a.click(),URL.revokeObjectURL(i),e.onAfterExport?.(n,`html`)},[t,e]),b=(0,f.useCallback)(()=>{if(e.onBeforeExport&&!e.onBeforeExport(`markdown`))return;let n=t.current?.getHTML();if(!n)return;let r=rG(n),i=new Blob([r],{type:`text/markdown`}),a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=`document.md`,o.click(),URL.revokeObjectURL(a),e.onAfterExport?.(r,`markdown`)},[t,e]);return!l&&!u&&!d&&!p?null:(0,m.jsxs)(m.Fragment,{children:[l&&(0,m.jsxs)(YM,{children:[(0,m.jsx)(XM,{render:(0,m.jsx)(PC,{variant:`ghost`,size:`icon-xs`,onClick:()=>c.current?.click(),disabled:i}),children:i?(0,m.jsx)(mw,{className:`size-3.5 animate-spin`,strokeWidth:1.5}):(0,m.jsx)(rw,{className:`size-3.5`,strokeWidth:1.5})}),(0,m.jsx)(ZM,{side:`bottom`,className:`text-xs`,children:`Import`})]}),u&&(0,m.jsxs)(YM,{children:[(0,m.jsx)(XM,{render:(0,m.jsx)(PC,{variant:`ghost`,size:`icon-xs`,onClick:g,className:n?`bg-muted text-foreground`:``}),children:n?(0,m.jsx)(yw,{className:`size-3.5`,strokeWidth:1.5}):(0,m.jsx)(ew,{className:`size-3.5`,strokeWidth:1.5})}),(0,m.jsx)(ZM,{side:`bottom`,className:`text-xs`,children:n?`Edit`:`Preview`})]}),d&&(0,m.jsxs)(YM,{children:[(0,m.jsx)(XM,{render:(0,m.jsx)(PC,{variant:`ghost`,size:`icon-xs`,onClick:_}),children:(0,m.jsx)(xw,{className:`size-3.5`,strokeWidth:1.5})}),(0,m.jsx)(ZM,{side:`bottom`,className:`text-xs`,children:`Print`})]}),p&&(0,m.jsxs)(fP,{children:[(0,m.jsxs)(YM,{children:[(0,m.jsx)(XM,{render:(0,m.jsx)(pP,{render:(0,m.jsx)(PC,{variant:`ghost`,size:`icon-xs`}),children:(0,m.jsx)($C,{className:`size-3.5`,strokeWidth:1.5})}),children:(0,m.jsx)($C,{className:`size-3.5`,strokeWidth:1.5})}),(0,m.jsx)(ZM,{side:`bottom`,className:`text-xs`,children:`Export`})]}),(0,m.jsxs)(mP,{align:`end`,children:[(0,m.jsxs)(hP,{onClick:v,children:[o?(0,m.jsx)(GC,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}):(0,m.jsx)(ZC,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),o?`Copied!`:`Copy HTML`]}),(0,m.jsx)(yP,{}),(0,m.jsxs)(hP,{onClick:y,children:[(0,m.jsx)(tw,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Export as HTML`]}),(0,m.jsxs)(hP,{onClick:b,children:[(0,m.jsx)(nw,{className:`size-3.5 mr-1.5`,strokeWidth:1.5}),`Export as Markdown`]})]})]}),l&&(0,m.jsx)(`input`,{ref:c,type:`file`,accept:`.docx,.doc,.pdf,.html,.htm,.txt`,style:{display:`none`},onChange:h})]})}function rG(e){return iG(new DOMParser().parseFromString(e,`text/html`).body).trim()}function iG(e){if(e.nodeType===Node.TEXT_NODE)return e.textContent||``;if(e.nodeType!==Node.ELEMENT_NODE)return``;let t=e,n=t.tagName.toLowerCase(),r=Array.from(t.childNodes).map(iG).join(``);switch(n){case`h1`:return`# ${r}\n\n`;case`h2`:return`## ${r}\n\n`;case`h3`:return`### ${r}\n\n`;case`h4`:return`#### ${r}\n\n`;case`p`:return`${r}\n\n`;case`br`:return`
|
|
487
|
+
`;case`strong`:case`b`:return`**${r}**`;case`em`:case`i`:return`*${r}*`;case`u`:return`<u>${r}</u>`;case`s`:case`del`:return`~~${r}~~`;case`code`:return`\`${r}\``;case`pre`:return`\`\`\`\n${t.textContent}\n\`\`\`\n\n`;case`a`:return`[${r}](${t.getAttribute(`href`)||``})`;case`img`:return`||``})`;case`ul`:case`ol`:return`${r}\n`;case`li`:{let e=t.parentElement;return e?.tagName===`OL`?`${Array.from(e.children).indexOf(t)+1}. ${r.trim()}\n`:`- ${r.trim()}\n`}case`blockquote`:return r.split(`
|
|
488
|
+
`).filter(Boolean).map(e=>`> ${e}`).join(`
|
|
489
|
+
`)+`
|
|
490
|
+
|
|
491
|
+
`;case`hr`:return`---
|
|
492
|
+
|
|
493
|
+
`;case`table`:return aG(t)+`
|
|
494
|
+
|
|
495
|
+
`;default:return r}}function aG(e){let t=Array.from(e.querySelectorAll(`tr`));if(t.length===0)return``;let n=[];return t.forEach((e,t)=>{let r=Array.from(e.querySelectorAll(`td, th`));n.push(`| `+r.map(e=>(e.textContent||``).trim()).join(` | `)+` |`),t===0&&n.push(`| `+r.map(()=>`---`).join(` | `)+` |`)}),n.join(`
|
|
496
|
+
`)}var oG=`
|
|
497
|
+
h1 { font-size: 24pt; font-weight: 700; line-height: 1.2; margin: 0.5em 0 0.3em; }
|
|
498
|
+
h2 { font-size: 18pt; font-weight: 600; line-height: 1.25; margin: 0.4em 0 0.25em; }
|
|
499
|
+
h3 { font-size: 14pt; font-weight: 600; line-height: 1.3; margin: 0.35em 0 0.2em; }
|
|
500
|
+
h4 { font-size: 12pt; font-weight: 600; line-height: 1.35; margin: 0.3em 0 0.15em; }
|
|
501
|
+
p { margin: 0.25em 0; }
|
|
502
|
+
|
|
503
|
+
ul, ol { padding-left: 1.5em; margin: 0.5em 0; }
|
|
504
|
+
ul { list-style-type: disc; }
|
|
505
|
+
ol { list-style-type: decimal; }
|
|
506
|
+
li { margin: 0.15em 0; }
|
|
507
|
+
|
|
508
|
+
ul[data-type="taskList"] { list-style: none; padding-left: 0; }
|
|
509
|
+
ul[data-type="taskList"] li { display: flex; align-items: flex-start; gap: 0.5em; }
|
|
510
|
+
|
|
511
|
+
blockquote {
|
|
512
|
+
border-left: 3px solid #d1d5db;
|
|
513
|
+
padding-left: 1em;
|
|
514
|
+
margin: 0.5em 0;
|
|
515
|
+
color: #6b7280;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
code {
|
|
519
|
+
background: #f3f4f6;
|
|
520
|
+
border-radius: 3px;
|
|
521
|
+
padding: 0.15em 0.3em;
|
|
522
|
+
font-size: 0.9em;
|
|
523
|
+
font-family: 'Courier New', monospace;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
pre {
|
|
527
|
+
background: #1e1e1e;
|
|
528
|
+
border-radius: 6px;
|
|
529
|
+
padding: 1em;
|
|
530
|
+
margin: 0.5em 0;
|
|
531
|
+
overflow-x: auto;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
pre code {
|
|
535
|
+
background: none;
|
|
536
|
+
padding: 0;
|
|
537
|
+
color: #d4d4d4;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
table {
|
|
541
|
+
border-collapse: collapse;
|
|
542
|
+
width: 100%;
|
|
543
|
+
margin: 0.5em 0;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
td, th {
|
|
547
|
+
border: 1px solid #d1d5db;
|
|
548
|
+
padding: 8px 12px;
|
|
549
|
+
vertical-align: top;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
th {
|
|
553
|
+
background: #f9fafb;
|
|
554
|
+
font-weight: 600;
|
|
555
|
+
text-align: left;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
img {
|
|
559
|
+
max-width: 100%;
|
|
560
|
+
height: auto;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.image-container { margin: 0.5em 0; }
|
|
564
|
+
|
|
565
|
+
a {
|
|
566
|
+
color: #2563eb;
|
|
567
|
+
text-decoration: underline;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
hr {
|
|
571
|
+
border: none;
|
|
572
|
+
border-top: 1px solid #e5e7eb;
|
|
573
|
+
margin: 1.5em 0;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
mark {
|
|
577
|
+
background-color: #fef08a;
|
|
578
|
+
padding: 0.1em 0;
|
|
579
|
+
-webkit-print-color-adjust: exact;
|
|
580
|
+
print-color-adjust: exact;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
.text-left, [style*="text-align: left"] { text-align: left; }
|
|
584
|
+
.text-center, [style*="text-align: center"] { text-align: center; }
|
|
585
|
+
.text-right, [style*="text-align: right"] { text-align: right; }
|
|
586
|
+
.text-justify, [style*="text-align: justify"] { text-align: justify; }
|
|
587
|
+
|
|
588
|
+
/* Template variables */
|
|
589
|
+
.template-variable, span[data-variable] {
|
|
590
|
+
display: inline;
|
|
591
|
+
background: #ede9fe;
|
|
592
|
+
color: #6d28d9;
|
|
593
|
+
border: 1px solid #c4b5fd;
|
|
594
|
+
border-radius: 4px;
|
|
595
|
+
padding: 0 4px;
|
|
596
|
+
font-size: 0.85em;
|
|
597
|
+
font-family: 'Courier New', monospace;
|
|
598
|
+
white-space: nowrap;
|
|
599
|
+
}
|
|
600
|
+
`;function sG(e,t={}){let{title:n=`Document`,pageSize:r=`A4`,margins:i={top:`25.4mm`,right:`25.4mm`,bottom:`25.4mm`,left:`25.4mm`},extraStyles:a=``,header:o=``,footer:s=``}=t,c=e.replace(/<div[^>]*data-page-break[^>]*><\/div>/gi,`<div style="page-break-after: always; break-after: page;"></div>`),l=fG(o),u=fG(s),d=l&&l!==`<p></p>`,f=u&&u!==`<p></p>`;return`<!DOCTYPE html>
|
|
601
|
+
<html lang="en">
|
|
602
|
+
<head>
|
|
603
|
+
<meta charset="UTF-8">
|
|
604
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
605
|
+
<title>${dG(n)}</title>
|
|
606
|
+
<style>
|
|
607
|
+
@page {
|
|
608
|
+
size: ${r};
|
|
609
|
+
margin: ${d?`10mm`:i.top} ${i.right} ${f?`10mm`:i.bottom} ${i.left};
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
* {
|
|
613
|
+
margin: 0;
|
|
614
|
+
padding: 0;
|
|
615
|
+
box-sizing: border-box;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
body {
|
|
619
|
+
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
620
|
+
font-size: 11pt;
|
|
621
|
+
line-height: 1.5;
|
|
622
|
+
color: #1a1a1a;
|
|
623
|
+
-webkit-print-color-adjust: exact;
|
|
624
|
+
print-color-adjust: exact;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
${oG}
|
|
628
|
+
${a}
|
|
629
|
+
|
|
630
|
+
/* Table-based layout for repeating header/footer on every printed page */
|
|
631
|
+
.doc-table {
|
|
632
|
+
width: 100%;
|
|
633
|
+
border-collapse: collapse;
|
|
634
|
+
}
|
|
635
|
+
.doc-table td, .doc-table th {
|
|
636
|
+
border: none;
|
|
637
|
+
padding: 0;
|
|
638
|
+
vertical-align: top;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.doc-header {
|
|
642
|
+
padding: 0;
|
|
643
|
+
-webkit-print-color-adjust: exact;
|
|
644
|
+
print-color-adjust: exact;
|
|
645
|
+
}
|
|
646
|
+
.doc-header-content {
|
|
647
|
+
padding-bottom: 8px;
|
|
648
|
+
border-bottom: 1px solid #e5e7eb;
|
|
649
|
+
margin-bottom: 8px;
|
|
650
|
+
}
|
|
651
|
+
.doc-header img {
|
|
652
|
+
max-width: 100%;
|
|
653
|
+
height: auto;
|
|
654
|
+
display: block;
|
|
655
|
+
}
|
|
656
|
+
.doc-header p { margin: 0; }
|
|
657
|
+
|
|
658
|
+
.doc-footer {
|
|
659
|
+
padding: 0;
|
|
660
|
+
}
|
|
661
|
+
.doc-footer-content {
|
|
662
|
+
padding-top: 8px;
|
|
663
|
+
border-top: 1px solid #e5e7eb;
|
|
664
|
+
margin-top: 8px;
|
|
665
|
+
}
|
|
666
|
+
.doc-footer img {
|
|
667
|
+
max-width: 100%;
|
|
668
|
+
height: auto;
|
|
669
|
+
display: block;
|
|
670
|
+
}
|
|
671
|
+
.doc-footer p { margin: 0; }
|
|
672
|
+
</style>
|
|
673
|
+
</head>
|
|
674
|
+
<body>
|
|
675
|
+
<table class="doc-table">
|
|
676
|
+
${d?`<thead><tr><td class="doc-header"><div class="doc-header-content">${l}</div></td></tr></thead>`:``}
|
|
677
|
+
${f?`<tfoot><tr><td class="doc-footer"><div class="doc-footer-content">${u}</div></td></tr></tfoot>`:``}
|
|
678
|
+
<tbody><tr><td class="doc-body">
|
|
679
|
+
${c}
|
|
680
|
+
</td></tr></tbody>
|
|
681
|
+
</table>
|
|
682
|
+
</body>
|
|
683
|
+
</html>`}function cG(e,t={}){let{title:n=`Document`,pageSize:r=`A4`,margins:i={top:`25.4mm`,right:`25.4mm`,bottom:`25.4mm`,left:`25.4mm`},extraStyles:a=``,header:o=``,footer:s=``}=t,c=fG(o),l=fG(s),u=c?`<div class="doc-header">${c}</div>`:``,d=l?`<div class="doc-footer">${l}</div>`:``,f=uG(e).map(e=>`<div class="page">${u}<div class="doc-body">${e}</div>${d}</div>`).join(`
|
|
684
|
+
`);return`<!DOCTYPE html>
|
|
685
|
+
<html lang="en">
|
|
686
|
+
<head>
|
|
687
|
+
<meta charset="UTF-8">
|
|
688
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
689
|
+
<title>${dG(n)}</title>
|
|
690
|
+
<style>
|
|
691
|
+
* {
|
|
692
|
+
margin: 0;
|
|
693
|
+
padding: 0;
|
|
694
|
+
box-sizing: border-box;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
body {
|
|
698
|
+
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
699
|
+
font-size: 11pt;
|
|
700
|
+
line-height: 1.5;
|
|
701
|
+
color: #1a1a1a;
|
|
702
|
+
background: #f0f0f0;
|
|
703
|
+
padding: 32px 0;
|
|
704
|
+
display: flex;
|
|
705
|
+
flex-direction: column;
|
|
706
|
+
align-items: center;
|
|
707
|
+
gap: 32px;
|
|
708
|
+
-webkit-print-color-adjust: exact;
|
|
709
|
+
print-color-adjust: exact;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
.page {
|
|
713
|
+
background: white;
|
|
714
|
+
width: 210mm;
|
|
715
|
+
min-height: 297mm;
|
|
716
|
+
padding: ${i.top} ${i.right} ${i.bottom} ${i.left};
|
|
717
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
@media print {
|
|
721
|
+
body {
|
|
722
|
+
background: white;
|
|
723
|
+
padding: 0;
|
|
724
|
+
display: block;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
@page {
|
|
728
|
+
size: ${r};
|
|
729
|
+
margin: ${i.top} ${i.right} ${i.bottom} ${i.left};
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
.page {
|
|
733
|
+
width: auto;
|
|
734
|
+
min-height: auto;
|
|
735
|
+
padding: 0;
|
|
736
|
+
box-shadow: none;
|
|
737
|
+
page-break-after: always;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
.page:last-child {
|
|
741
|
+
page-break-after: auto;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
${oG}
|
|
746
|
+
${a}
|
|
747
|
+
|
|
748
|
+
.page-break, div[data-page-break] {
|
|
749
|
+
display: none;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.page { display: flex; flex-direction: column; overflow: hidden; }
|
|
753
|
+
.doc-body { flex: 1; min-height: 0; }
|
|
754
|
+
.doc-header, .doc-footer {
|
|
755
|
+
font-size: 9pt;
|
|
756
|
+
color: #6b7280;
|
|
757
|
+
padding: 0;
|
|
758
|
+
flex-shrink: 0;
|
|
759
|
+
}
|
|
760
|
+
.doc-header {
|
|
761
|
+
border-bottom: 1px solid #e5e7eb;
|
|
762
|
+
padding: 0 0 4px 0;
|
|
763
|
+
margin: 0 0 8px 0;
|
|
764
|
+
/* Pull header into page padding for edge-to-edge */
|
|
765
|
+
margin-left: -${i.left};
|
|
766
|
+
margin-right: -${i.right};
|
|
767
|
+
margin-top: -${i.top};
|
|
768
|
+
padding: 0;
|
|
769
|
+
}
|
|
770
|
+
.doc-footer {
|
|
771
|
+
border-top: 1px solid #e5e7eb;
|
|
772
|
+
padding: 4px 0 0 0;
|
|
773
|
+
margin: 8px 0 0 0;
|
|
774
|
+
margin-left: -${i.left};
|
|
775
|
+
margin-right: -${i.right};
|
|
776
|
+
margin-bottom: -${i.bottom};
|
|
777
|
+
padding: 0;
|
|
778
|
+
}
|
|
779
|
+
.doc-header img, .doc-footer img { max-width: 100%; height: auto; display: block; }
|
|
780
|
+
</style>
|
|
781
|
+
</head>
|
|
782
|
+
<body>
|
|
783
|
+
${f}
|
|
784
|
+
<script>
|
|
785
|
+
(function() {
|
|
786
|
+
function paginatePages() {
|
|
787
|
+
var pages = Array.from(document.querySelectorAll('.page'));
|
|
788
|
+
pages.forEach(function(page) {
|
|
789
|
+
var body = page.querySelector('.doc-body');
|
|
790
|
+
if (!body) return;
|
|
791
|
+
|
|
792
|
+
var style = getComputedStyle(page);
|
|
793
|
+
var pt = parseFloat(style.paddingTop) || 0;
|
|
794
|
+
var pb = parseFloat(style.paddingBottom) || 0;
|
|
795
|
+
var pageHeight = page.getBoundingClientRect().width * (297 / 210);
|
|
796
|
+
|
|
797
|
+
// Account for header/footer heights
|
|
798
|
+
var headerEl = page.querySelector('.doc-header');
|
|
799
|
+
var footerEl = page.querySelector('.doc-footer');
|
|
800
|
+
var headerH = headerEl ? headerEl.getBoundingClientRect().height : 0;
|
|
801
|
+
var footerH = footerEl ? footerEl.getBoundingClientRect().height : 0;
|
|
802
|
+
var maxContent = pageHeight - pt - pb - headerH - footerH;
|
|
803
|
+
|
|
804
|
+
if (maxContent <= 0) return;
|
|
805
|
+
|
|
806
|
+
var bodyRect = body.getBoundingClientRect();
|
|
807
|
+
if (body.scrollHeight <= maxContent + 2) return;
|
|
808
|
+
|
|
809
|
+
var children = Array.from(body.childNodes).filter(function(n) { return n.nodeType === 1; });
|
|
810
|
+
var currentPage = page;
|
|
811
|
+
var currentBody = body;
|
|
812
|
+
|
|
813
|
+
children.forEach(function(child) {
|
|
814
|
+
var rect = child.getBoundingClientRect();
|
|
815
|
+
var relTop = rect.top - currentBody.getBoundingClientRect().top;
|
|
816
|
+
var elBottom = relTop + rect.height;
|
|
817
|
+
|
|
818
|
+
if (elBottom > maxContent && relTop > 0) {
|
|
819
|
+
// Create new page with header + body + footer
|
|
820
|
+
var newPage = document.createElement('div');
|
|
821
|
+
newPage.className = 'page';
|
|
822
|
+
if (headerEl) newPage.appendChild(headerEl.cloneNode(true));
|
|
823
|
+
var newBody = document.createElement('div');
|
|
824
|
+
newBody.className = 'doc-body';
|
|
825
|
+
newPage.appendChild(newBody);
|
|
826
|
+
if (footerEl) newPage.appendChild(footerEl.cloneNode(true));
|
|
827
|
+
currentPage.parentNode.insertBefore(newPage, currentPage.nextSibling);
|
|
828
|
+
|
|
829
|
+
// Move remaining elements to new body
|
|
830
|
+
var sibling = child;
|
|
831
|
+
while (sibling) {
|
|
832
|
+
var next = sibling.nextSibling;
|
|
833
|
+
newBody.appendChild(sibling);
|
|
834
|
+
sibling = next;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
currentPage = newPage;
|
|
838
|
+
currentBody = newBody;
|
|
839
|
+
}
|
|
840
|
+
});
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
if (document.readyState === 'complete') {
|
|
845
|
+
setTimeout(paginatePages, 100);
|
|
846
|
+
} else {
|
|
847
|
+
window.addEventListener('load', function() {
|
|
848
|
+
setTimeout(paginatePages, 100);
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
})();
|
|
852
|
+
<\/script>
|
|
853
|
+
</body>
|
|
854
|
+
</html>`}function lG(e){return e}function uG(e){let t=e.split(/<div[^>]*(?:data-page-break)[^>]*><\/div>/gi).filter(e=>e.trim().length>0);return t.length>0?t:[e]}function dG(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function fG(e){return e&&e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,``).replace(/\s*on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,``).replace(/<iframe\b[^>]*>.*?<\/iframe>/gi,``).replace(/javascript\s*:/gi,``)}var pG={a4:{width:`210mm`,height:`297mm`,padding:{top:`25.4mm`,right:`25.4mm`,bottom:`25.4mm`,left:`25.4mm`},paginate:!0,pageGap:40},email:{width:`600px`,height:void 0,padding:{top:`20px`,right:`20px`,bottom:`20px`,left:`20px`},paginate:!1}};function mG(e){let t=typeof e==`string`?pG[e]||pG.a4:e||pG.a4,n=hG(t.width),r=t.height?hG(t.height):void 0,i=t.padding||{top:`0`,right:`0`,bottom:`0`,left:`0`},a={top:hG(i.top),right:hG(i.right),bottom:hG(i.bottom),left:hG(i.left)},o=r?r-a.top-a.bottom:void 0;return{width:t.width,height:t.height,padding:i,paginate:t.paginate??!0,pageGap:t.pageGap??40,widthPx:n,heightPx:r,paddingPx:a,contentHeightPx:o}}function hG(e){let t=parseFloat(e);return e.endsWith(`mm`)?96/25.4*t:e.endsWith(`in`)?t*96:e.endsWith(`cm`)?96/2.54*t:e.endsWith(`pt`)?96/72*t:t}var gG={full:[...`undo.redo.heading.bold.italic.underline.strikethrough.subscript.superscript.color.highlight.alignLeft.alignCenter.alignRight.alignJustify.bulletList.orderedList.taskList.indent.outdent.link.table.image.horizontalRule.pageBreak.blockquote.codeBlock.variables.blocks`.split(`.`)],minimal:[`undo`,`redo`,`heading`,`bold`,`italic`,`underline`,`link`],document:[`undo`,`redo`,`heading`,`bold`,`italic`,`underline`,`strikethrough`,`color`,`highlight`,`alignLeft`,`alignCenter`,`alignRight`,`alignJustify`,`bulletList`,`orderedList`,`indent`,`outdent`,`link`,`table`,`image`,`horizontalRule`,`pageBreak`,`blockquote`,`variables`,`blocks`]};function _G(e){if(e===void 0)return new Set(gG.full);if(typeof e==`string`)return new Set(gG[e]||gG.full);let t=new Set(gG[e.preset||`full`]);return e.enable?.forEach(e=>t.add(e)),e.disable?.forEach(e=>t.delete(e)),t}var vG=(0,f.forwardRef)(({content:e,placeholder:t,onChange:n,className:r,variables:i=!1,blocks:a=[],header:o=``,footer:s=``,readOnly:c=!1,showToolbar:l,actions:u=!0,toolbarActions:d,canvas:p,toolbar:h,extensions:g,theme:_},v)=>{let y=i!==!1,[b,x]=(0,f.useState)(y?i:[]),[S,C]=(0,f.useState)(o),[w,T]=(0,f.useState)(s),[E,D]=(0,f.useState)(null),[O,k]=(0,f.useState)(c),A=(0,f.useRef)(null);(0,f.useEffect)(()=>{i!==!1&&x(i)},[i]),(0,f.useEffect)(()=>{k(c)},[c]);let j=(0,f.useMemo)(()=>mG(p),[p]),M=(0,f.useMemo)(()=>{let e=_G(h);return j.paginate===!1&&e.delete(`pageBreak`),a.length===0&&e.delete(`blocks`),e},[h,j.paginate,a.length]);aT(a);let N=(0,f.useMemo)(()=>a.map(e=>e.exportStyles||``).filter(Boolean).join(`
|
|
855
|
+
`),[a]),P=rT({content:e,placeholder:t,variables:y?b:!1,blocks:a,canvas:j,extensions:g,onUpdate:n});(0,f.useEffect)(()=>{P&&P.setEditable(!O)},[P,O]);let F=(0,f.useCallback)(e=>{x(t=>t.some(t=>t.key===e)?t:[...t,{key:e}])},[]),I=E??P,L={getHTML:()=>P?.getHTML()??``,getPdfHTML:e=>sG(P?.getHTML()??``,{...e,extraStyles:N,header:S,footer:w}),getPreviewHTML:e=>cG(P?.getHTML()??``,{...e,extraStyles:N,header:S,footer:w}),getJSON:()=>P?.getJSON()??{},setContent:e=>P?.commands.setContent(e),getVariables:()=>b,getHeader:()=>S,getFooter:()=>w,setHeader:C,setFooter:T,setReadOnly:k,isReadOnly:()=>O,focus:()=>P?.commands.focus(),clear:()=>P?.commands.clearContent()};A.current=L,(0,f.useImperativeHandle)(v,()=>L,[P,b,N,S,w,O]);let R=u===!1?null:u===!0?{}:u,z=(0,m.jsxs)(m.Fragment,{children:[R&&(0,m.jsx)(nG,{config:R,editorRef:A,readOnly:O,onToggleReadOnly:()=>k(e=>!e)}),d]}),B=l!==!1;return P?(0,m.jsxs)(`div`,{className:`doccraft flex flex-col h-full ${O?`doccraft--readonly`:``} ${r??``}`,children:[B&&(0,m.jsx)(lF,{editor:I,variables:y?b:void 0,onAddVariable:y?F:void 0,blocks:a,actions:z,readOnly:O,features:M}),B&&!O&&j.paginate&&(0,m.jsx)(VF,{editor:P}),(0,m.jsx)(JF,{editor:P,canvas:j,header:S,footer:w,onHeaderChange:O?void 0:C,onFooterChange:O?void 0:T,onActiveHfEditor:O?void 0:D,readOnly:O,theme:_})]}):null});vG.displayName=`DocCraft`;function yG({node:e,updateAttributes:t,deleteNode:n,selected:r,extension:i,editor:a}){let{listVar:o,iterVar:s}=e.attrs,c=a.isEditable,[l,u]=(0,f.useState)(!1),[d,p]=(0,f.useState)(!1),h=(0,f.useRef)(null),g=i.options.variables||[];return(0,f.useEffect)(()=>{if(!d)return;let e=e=>{h.current&&!h.current.contains(e.target)&&p(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[d]),(0,m.jsxs)(pp,{className:`s-block s-block--for ${r?`s-block--selected`:``}`,children:[(0,m.jsxs)(`div`,{className:`s-block__header s-block--for__header`,contentEditable:!1,children:[(0,m.jsxs)(`div`,{className:`s-block__header-left`,children:[(0,m.jsx)(Tw,{className:`size-3.5`,strokeWidth:1.5}),l&&c?(0,m.jsxs)(`span`,{className:`s-block__expr-edit`,children:[(0,m.jsx)(`span`,{className:`s-block__expr-kw`,children:`for each`}),(0,m.jsx)(`input`,{className:`s-block__expr-input`,value:s,onChange:e=>t({iterVar:e.target.value.replace(/[^a-zA-Z0-9_]/g,``)}),onKeyDown:e=>e.key===`Enter`&&u(!1),placeholder:`item`,autoFocus:!0,style:{width:`${Math.max(3,s.length+1)}ch`}}),(0,m.jsx)(`span`,{className:`s-block__expr-kw`,children:`in`}),(0,m.jsxs)(`div`,{className:`s-block__var-picker-wrap`,ref:h,children:[(0,m.jsxs)(`button`,{type:`button`,className:`s-block__var-picker-btn`,onClick:()=>p(!d),children:[(0,m.jsx)(`span`,{children:o}),(0,m.jsx)(KC,{className:`size-3`,strokeWidth:1.5})]}),d&&(0,m.jsxs)(`div`,{className:`s-block__var-picker-dropdown`,children:[g.length>0?g.map(e=>(0,m.jsx)(`button`,{type:`button`,className:`s-block__var-picker-item ${e.key===o?`active`:``}`,onClick:()=>{t({listVar:e.key}),p(!1)},children:e.label||e.key},e.key)):(0,m.jsx)(`div`,{className:`s-block__var-picker-empty`,children:`No variables defined`}),(0,m.jsx)(`div`,{className:`s-block__var-picker-divider`}),(0,m.jsx)(`div`,{className:`s-block__var-picker-custom`,children:(0,m.jsx)(`input`,{className:`s-block__expr-input`,value:o,onChange:e=>t({listVar:e.target.value.replace(/[^a-zA-Z0-9_.]/g,``)}),onKeyDown:e=>{e.key===`Enter`&&p(!1)},placeholder:`custom_list`,style:{width:`100%`}})})]})]}),(0,m.jsx)(`button`,{type:`button`,className:`s-block__expr-done`,onClick:()=>{u(!1),p(!1)},children:`Done`})]}):(0,m.jsxs)(`span`,{className:`s-block__expr`,onDoubleClick:c?()=>u(!0):void 0,title:c?`Double-click to edit`:void 0,children:[`For each `,(0,m.jsx)(`strong`,{children:s}),` in `,(0,m.jsx)(`strong`,{children:o})]})]}),c&&(0,m.jsx)(`button`,{className:`s-block__delete`,onClick:n,type:`button`,children:(0,m.jsx)(Vw,{className:`size-3`,strokeWidth:1.5})})]}),(0,m.jsx)(`div`,{className:`s-block__body`,children:(0,m.jsx)(fp,{})}),(0,m.jsx)(`div`,{className:`s-block__footer s-block--for__footer`,contentEditable:!1,children:`End for each`})]})}var bG=Wd.create({name:`forBlock`,group:`block`,content:`block+`,defining:!0,isolating:!0,draggable:!0,selectable:!0,addOptions(){return{variables:[]}},addAttributes(){return{listVar:{default:`items`},iterVar:{default:`item`}}},parseHTML(){return[{tag:`div[data-block-for]`}]},renderHTML({HTMLAttributes:e}){let{listVar:t,iterVar:n,...r}=e;return[`div`,Ul(r,{"data-block-for":`${n} in ${t}`}),0]},addNodeView(){return xp(yG)},addCommands(){return{insertForBlock:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e,content:[{type:`paragraph`}]})}}}),xG={name:`forBlock`,label:`For Loop`,icon:Tw,description:`Repeat content for each item in a list`,extension:e=>bG.configure({variables:e.variables}),styles:`
|
|
856
|
+
.s-block--for { color: #1d4ed8; }
|
|
857
|
+
.s-block--for__header { background: #dbeafe; color: #1e40af; }
|
|
858
|
+
.s-block--for__footer { background: #dbeafe; color: #1e40af; }
|
|
859
|
+
.s-block--for .s-block__body {
|
|
860
|
+
background: #f0f7ff;
|
|
861
|
+
border-left: 2px solid #93c5fd;
|
|
862
|
+
border-right: 2px solid #93c5fd;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
/* Variable picker */
|
|
866
|
+
.s-block__var-picker-wrap {
|
|
867
|
+
position: relative;
|
|
868
|
+
display: inline-flex;
|
|
869
|
+
}
|
|
870
|
+
.s-block__var-picker-btn {
|
|
871
|
+
display: inline-flex;
|
|
872
|
+
align-items: center;
|
|
873
|
+
gap: 2px;
|
|
874
|
+
background: rgba(255,255,255,0.3);
|
|
875
|
+
border: 1px solid rgba(255,255,255,0.5);
|
|
876
|
+
border-radius: 3px;
|
|
877
|
+
padding: 0 6px 0 4px;
|
|
878
|
+
font-size: 11px;
|
|
879
|
+
font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
|
|
880
|
+
font-weight: 700;
|
|
881
|
+
color: inherit;
|
|
882
|
+
cursor: pointer;
|
|
883
|
+
min-width: 3ch;
|
|
884
|
+
line-height: 1.6;
|
|
885
|
+
}
|
|
886
|
+
.s-block__var-picker-btn:hover {
|
|
887
|
+
background: rgba(255,255,255,0.5);
|
|
888
|
+
}
|
|
889
|
+
.s-block__var-picker-dropdown {
|
|
890
|
+
position: absolute;
|
|
891
|
+
top: 100%;
|
|
892
|
+
left: 0;
|
|
893
|
+
margin-top: 4px;
|
|
894
|
+
background: white;
|
|
895
|
+
border: 1px solid #d1d5db;
|
|
896
|
+
border-radius: 6px;
|
|
897
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
898
|
+
min-width: 160px;
|
|
899
|
+
max-height: 200px;
|
|
900
|
+
overflow-y: auto;
|
|
901
|
+
z-index: 50;
|
|
902
|
+
padding: 4px;
|
|
903
|
+
}
|
|
904
|
+
.s-block__var-picker-item {
|
|
905
|
+
display: block;
|
|
906
|
+
width: 100%;
|
|
907
|
+
text-align: left;
|
|
908
|
+
padding: 4px 8px;
|
|
909
|
+
font-size: 12px;
|
|
910
|
+
font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
|
|
911
|
+
color: #374151;
|
|
912
|
+
background: none;
|
|
913
|
+
border: none;
|
|
914
|
+
border-radius: 4px;
|
|
915
|
+
cursor: pointer;
|
|
916
|
+
}
|
|
917
|
+
.s-block__var-picker-item:hover {
|
|
918
|
+
background: #dbeafe;
|
|
919
|
+
color: #1e40af;
|
|
920
|
+
}
|
|
921
|
+
.s-block__var-picker-item.active {
|
|
922
|
+
background: #bfdbfe;
|
|
923
|
+
color: #1e40af;
|
|
924
|
+
font-weight: 600;
|
|
925
|
+
}
|
|
926
|
+
.s-block__var-picker-empty {
|
|
927
|
+
padding: 8px;
|
|
928
|
+
font-size: 11px;
|
|
929
|
+
color: #9ca3af;
|
|
930
|
+
text-align: center;
|
|
931
|
+
}
|
|
932
|
+
.s-block__var-picker-divider {
|
|
933
|
+
height: 1px;
|
|
934
|
+
background: #e5e7eb;
|
|
935
|
+
margin: 4px 0;
|
|
936
|
+
}
|
|
937
|
+
.s-block__var-picker-custom {
|
|
938
|
+
padding: 4px;
|
|
939
|
+
}
|
|
940
|
+
.s-block__var-picker-custom .s-block__expr-input {
|
|
941
|
+
background: #f9fafb;
|
|
942
|
+
border-color: #d1d5db;
|
|
943
|
+
color: #374151;
|
|
944
|
+
width: 100%;
|
|
945
|
+
padding: 2px 6px;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
/* Done button */
|
|
949
|
+
.s-block__expr-done {
|
|
950
|
+
background: rgba(255,255,255,0.4);
|
|
951
|
+
border: 1px solid rgba(255,255,255,0.6);
|
|
952
|
+
border-radius: 3px;
|
|
953
|
+
padding: 0 8px;
|
|
954
|
+
font-size: 10px;
|
|
955
|
+
color: inherit;
|
|
956
|
+
cursor: pointer;
|
|
957
|
+
margin-left: 4px;
|
|
958
|
+
line-height: 1.6;
|
|
959
|
+
}
|
|
960
|
+
.s-block__expr-done:hover {
|
|
961
|
+
background: rgba(255,255,255,0.6);
|
|
962
|
+
}
|
|
963
|
+
`,exportStyles:`
|
|
964
|
+
div[data-block-for] {
|
|
965
|
+
border-left: 3px solid #93c5fd;
|
|
966
|
+
padding-left: 12px;
|
|
967
|
+
margin: 0.5em 0;
|
|
968
|
+
}
|
|
969
|
+
`,insert:e=>{e.chain().focus().insertForBlock({iterVar:`item`,listVar:`items`}).run()}};function SG({node:e,updateAttributes:t,deleteNode:n,selected:r,editor:i}){let{condition:a}=e.attrs,o=i.isEditable,[s,c]=(0,f.useState)(!1);return(0,m.jsxs)(pp,{className:`s-block s-block--if ${r?`s-block--selected`:``}`,children:[(0,m.jsxs)(`div`,{className:`s-block__header s-block--if__header`,contentEditable:!1,children:[(0,m.jsxs)(`div`,{className:`s-block__header-left`,children:[(0,m.jsx)(iw,{className:`size-3.5`,strokeWidth:1.5}),s&&o?(0,m.jsxs)(`span`,{className:`s-block__expr-edit`,children:[(0,m.jsx)(`span`,{className:`s-block__expr-kw`,children:`if`}),(0,m.jsx)(`input`,{className:`s-block__expr-input`,value:a,onChange:e=>t({condition:e.target.value}),onBlur:()=>c(!1),onKeyDown:e=>e.key===`Enter`&&c(!1),autoFocus:!0,style:{width:`${Math.max(8,a.length+1)}ch`}})]}):(0,m.jsxs)(`span`,{className:`s-block__expr`,onDoubleClick:o?()=>c(!0):void 0,title:o?`Double-click to edit condition`:void 0,children:[`If `,(0,m.jsx)(`strong`,{children:a})]})]}),o&&(0,m.jsx)(`button`,{className:`s-block__delete`,onClick:n,type:`button`,children:(0,m.jsx)(Vw,{className:`size-3`,strokeWidth:1.5})})]}),(0,m.jsx)(`div`,{className:`s-block__body`,children:(0,m.jsx)(fp,{})}),(0,m.jsx)(`div`,{className:`s-block__footer s-block--if__footer`,contentEditable:!1,children:`End if`})]})}var CG={name:`ifBlock`,label:`If Condition`,icon:iw,description:`Show content only when a condition is true`,extension:Wd.create({name:`ifBlock`,group:`block`,content:`block+`,defining:!0,isolating:!0,draggable:!0,selectable:!0,addAttributes(){return{condition:{default:`condition`}}},parseHTML(){return[{tag:`div[data-block-if]`}]},renderHTML({HTMLAttributes:e}){let{condition:t,...n}=e;return[`div`,Ul(n,{"data-block-if":t}),0]},addNodeView(){return xp(SG)},addCommands(){return{insertIfBlock:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e,content:[{type:`paragraph`}]})}}}),styles:`
|
|
970
|
+
.s-block--if { color: #b45309; }
|
|
971
|
+
.s-block--if__header { background: #fef3c7; color: #92400e; }
|
|
972
|
+
.s-block--if__footer { background: #fef3c7; color: #92400e; }
|
|
973
|
+
.s-block--if .s-block__body {
|
|
974
|
+
background: #fffbeb;
|
|
975
|
+
border-left: 2px solid #fcd34d;
|
|
976
|
+
border-right: 2px solid #fcd34d;
|
|
977
|
+
}
|
|
978
|
+
`,exportStyles:`
|
|
979
|
+
div[data-block-if] {
|
|
980
|
+
border-left: 3px solid #fcd34d;
|
|
981
|
+
padding-left: 12px;
|
|
982
|
+
margin: 0.5em 0;
|
|
983
|
+
}
|
|
984
|
+
`,insert:e=>{e.chain().focus().insertIfBlock({condition:`condition`}).run()}};function wG({node:e,deleteNode:t,selected:n,editor:r}){let{content:i,label:a}=e.attrs,o=(0,f.useRef)(null);return(0,f.useEffect)(()=>{if(o.current)if(o.current.textContent=``,i.includes(`<`)&&i.includes(`>`)){let e=new DOMParser().parseFromString(i,`text/html`);e.querySelectorAll(`script, [onload], [onerror], [onclick], [onmouseover]`).forEach(e=>e.remove()),Array.from(e.body.childNodes).forEach(e=>{o.current.appendChild(document.importNode(e,!0))})}else o.current.textContent=i},[i]),(0,m.jsxs)(pp,{className:`s-block s-block--readonly ${n?`s-block--selected`:``}`,children:[(0,m.jsxs)(`div`,{className:`s-block__header s-block--readonly__header`,contentEditable:!1,children:[(0,m.jsxs)(`div`,{className:`s-block__header-left`,children:[(0,m.jsx)(hw,{className:`size-3.5`,strokeWidth:1.5}),(0,m.jsx)(`span`,{className:`s-block__expr`,children:a})]}),r.isEditable&&(0,m.jsx)(`button`,{className:`s-block__delete`,onClick:t,type:`button`,children:(0,m.jsx)(Vw,{className:`size-3`,strokeWidth:1.5})})]}),(0,m.jsx)(`div`,{ref:o,className:`s-block__body s-block--readonly__body`,contentEditable:!1})]})}var TG={name:`readonlyBlock`,label:`Read Only`,icon:hw,description:`Non-editable content block (deletable only)`,extension:Wd.create({name:`readonlyBlock`,group:`block`,atom:!0,selectable:!0,draggable:!0,addAttributes(){return{content:{default:``},label:{default:`Read Only`}}},parseHTML(){return[{tag:`div[data-block-readonly]`,getAttrs:e=>{let t=e;return{content:t.getAttribute(`data-block-content`)||t.textContent||``,label:t.getAttribute(`data-block-label`)||`Read Only`}}}]},renderHTML({HTMLAttributes:e}){let{content:t,label:n,...r}=e;return[`div`,Ul(r,{"data-block-readonly":`true`,"data-block-label":n,"data-block-content":t}),t]},addNodeView(){return xp(wG)},addCommands(){return{insertReadOnlyBlock:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}}}),styles:`
|
|
985
|
+
.s-block--readonly { color: #4b5563; }
|
|
986
|
+
.s-block--readonly__header { background: #e5e7eb; color: #374151; }
|
|
987
|
+
.s-block--readonly__body {
|
|
988
|
+
background: #f9fafb;
|
|
989
|
+
border-left: 2px solid #d1d5db;
|
|
990
|
+
border-right: 2px solid #d1d5db;
|
|
991
|
+
border-bottom: 2px solid #d1d5db;
|
|
992
|
+
border-radius: 0 0 5px 5px;
|
|
993
|
+
color: #6b7280;
|
|
994
|
+
cursor: default;
|
|
995
|
+
}
|
|
996
|
+
`,exportStyles:`
|
|
997
|
+
div[data-block-readonly] {
|
|
998
|
+
background: #f9fafb;
|
|
999
|
+
border: 1px solid #e5e7eb;
|
|
1000
|
+
border-radius: 4px;
|
|
1001
|
+
padding: 8px 12px;
|
|
1002
|
+
margin: 0.5em 0;
|
|
1003
|
+
color: #6b7280;
|
|
1004
|
+
}
|
|
1005
|
+
`,insert:e=>{e.chain().focus().insertReadOnlyBlock({content:`Read-only content goes here`,label:`Read Only`}).run()}};exports.CANVAS_PRESETS=pG,exports.DocCraft=vG,exports.TOOLBAR_PRESETS=gG,exports.exportToHtml=lG,exports.exportToPdfHtml=sG,exports.exportToPreviewHtml=cG,exports.forBlock=xG,exports.ifBlock=CG,exports.importDocx=YW,exports.importPdf=QW,exports.readonlyBlock=TG,exports.resolveCanvas=mG,exports.resolveToolbar=_G,exports.t=d;
|
|
1006
|
+
//# sourceMappingURL=doccraft.cjs.map
|